refactor(agents): narrow unused helper exports · openclaw/openclaw@4292f0f
vincentkoc
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,10 +17,7 @@ export type AgentGeneratedAttachment = {
|
17 | 17 | name?: string; |
18 | 18 | }; |
19 | 19 | |
20 | | -/** Resolve the first usable path or URL reference for a generated attachment. */ |
21 | | -export function generatedAttachmentReference( |
22 | | -attachment: AgentGeneratedAttachment, |
23 | | -): string | undefined { |
| 20 | +function generatedAttachmentReference(attachment: AgentGeneratedAttachment): string | undefined { |
24 | 21 | return normalizeOptionalString( |
25 | 22 | attachment.path ?? attachment.url ?? attachment.mediaUrl ?? attachment.filePath, |
26 | 23 | ); |
@@ -35,10 +32,7 @@ export function mediaUrlsFromGeneratedAttachments(
|
35 | 32 | ); |
36 | 33 | } |
37 | 34 | |
38 | | -/** Resolve a display name from attachment metadata or path basename. */ |
39 | | -export function nameFromGeneratedAttachment( |
40 | | -attachment: AgentGeneratedAttachment, |
41 | | -): string | undefined { |
| 35 | +function nameFromGeneratedAttachment(attachment: AgentGeneratedAttachment): string | undefined { |
42 | 36 | return ( |
43 | 37 | normalizeOptionalString(attachment.name) ?? |
44 | 38 | basenameFromAnyPath(generatedAttachmentReference(attachment) ?? "") |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -173,11 +173,6 @@ export function collectAnthropicApiKeys(): string[] {
|
173 | 173 | return collectProviderApiKeys("anthropic"); |
174 | 174 | } |
175 | 175 | |
176 | | -/** Collect Gemini API keys for live cache/model tests. */ |
177 | | -export function collectGeminiApiKeys(): string[] { |
178 | | -return collectProviderApiKeys("google"); |
179 | | -} |
180 | | - |
181 | 176 | /** Return whether a provider error message indicates API-key rate limiting. */ |
182 | 177 | export function isApiKeyRateLimitError(message: string): boolean { |
183 | 178 | const lower = normalizeLowercaseStringOrEmpty(message); |
@@ -202,11 +197,6 @@ export function isApiKeyRateLimitError(message: string): boolean {
|
202 | 197 | return false; |
203 | 198 | } |
204 | 199 | |
205 | | -/** Return whether an Anthropic error message indicates rate limiting. */ |
206 | | -export function isAnthropicRateLimitError(message: string): boolean { |
207 | | -return isApiKeyRateLimitError(message); |
208 | | -} |
209 | | - |
210 | 200 | /** Return whether an Anthropic error message indicates billing exhaustion. */ |
211 | 201 | export function isAnthropicBillingError(message: string): boolean { |
212 | 202 | const lower = normalizeLowercaseStringOrEmpty(message); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,7 @@ import { loadUndiciRuntimeDeps } from "../infra/net/undici-runtime.js";
|
16 | 16 | export type { FetchLike }; |
17 | 17 | |
18 | 18 | /** Default MCP HTTP fetch backed by lazy-loaded undici runtime deps. */ |
19 | | -export const fetchWithUndici: FetchLike = async (url, init) => |
| 19 | +const fetchWithUndici: FetchLike = async (url, init) => |
20 | 20 | (await loadUndiciRuntimeDeps().fetch( |
21 | 21 | url, |
22 | 22 | init as Parameters<ReturnType<typeof loadUndiciRuntimeDeps>["fetch"]>[1], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。