diff --git a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts index 9ce3e9434ba..e7d34dd4403 100644 --- a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts +++ b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts @@ -9,7 +9,6 @@ import { stream, type Model, type SimpleStreamOptions } from "openclaw/plugin-sd const MANTLE_ANTHROPIC_BETA = "fine-grained-tool-streaming-2025-05-14"; type AnthropicOptions = ConstructorParameters[0]; type MantleAnthropicStream = typeof stream; -type AnthropicStreamClient = Anthropic; /** Resolve the Anthropic-compatible Mantle base URL from a provider base URL. */ export function resolveMantleAnthropicBaseUrl(baseUrl: string): string { @@ -138,7 +137,7 @@ export function createMantleAnthropicStreamFn(deps?: { const base = buildMantleAnthropicBaseOptions(model, options, apiKey); // Plugin package deps can give this plugin a distinct physical SDK copy. // The client API is the same, but the SDK class private field makes types nominal. - const streamClient = client as unknown as AnthropicStreamClient; + const streamClient = client as unknown as Anthropic; const reasoning = resolveMantleReasoning(model, options); if (!reasoning) { return streamFn(model as Model<"anthropic-messages">, context, { diff --git a/extensions/discord/src/internal/gateway.ts b/extensions/discord/src/internal/gateway.ts index 4d9c3f5353c..bb5a54947da 100644 --- a/extensions/discord/src/internal/gateway.ts +++ b/extensions/discord/src/internal/gateway.ts @@ -28,7 +28,6 @@ export type Activity = NonNullable[numb export type UpdatePresenceData = Omit & { status: "online" | "idle" | "dnd" | "invisible" | "offline"; }; -type UpdateVoiceStateData = GatewayVoiceStateUpdateData; type RequestGuildMembersData = { guild_id: string; query?: string; @@ -441,7 +440,7 @@ export class GatewayPlugin extends Plugin { this.send({ op: GatewayOpcodes.PresenceUpdate, d: data } as GatewaySendPayload); } - updateVoiceState(data: UpdateVoiceStateData): void { + updateVoiceState(data: GatewayVoiceStateUpdateData): void { this.send({ op: GatewayOpcodes.VoiceStateUpdate, d: data } as GatewaySendPayload, true); } diff --git a/extensions/discord/src/preview-streaming.ts b/extensions/discord/src/preview-streaming.ts index 6b5cfbcbb16..f088f52e98f 100644 --- a/extensions/discord/src/preview-streaming.ts +++ b/extensions/discord/src/preview-streaming.ts @@ -4,14 +4,12 @@ import { type StreamingMode, } from "openclaw/plugin-sdk/channel-outbound"; -type DiscordPreviewStreamMode = StreamingMode; - export function resolveDiscordPreviewStreamMode( params: { streamMode?: unknown; streaming?: unknown; } = {}, -): DiscordPreviewStreamMode { +): StreamingMode { if (params.streaming === undefined && params.streamMode === undefined) { return "progress"; } diff --git a/extensions/discord/src/proxy-request-client.ts b/extensions/discord/src/proxy-request-client.ts index bb91335f05c..a97c212b0a0 100644 --- a/extensions/discord/src/proxy-request-client.ts +++ b/extensions/discord/src/proxy-request-client.ts @@ -1,13 +1,11 @@ // Discord plugin module implements proxy request client behavior. import { RequestClient, type RequestClientOptions } from "./internal/discord.js"; -type ProxyRequestClientOptions = RequestClientOptions; - export const DISCORD_REST_TIMEOUT_MS = 15_000; export function createDiscordRequestClient( token: string, - options?: ProxyRequestClientOptions, + options?: RequestClientOptions, ): RequestClient { if (!options?.fetch) { return new RequestClient(token, options); diff --git a/extensions/discord/src/send-target-parsing.ts b/extensions/discord/src/send-target-parsing.ts index d2c939f5650..efd4cfe95dd 100644 --- a/extensions/discord/src/send-target-parsing.ts +++ b/extensions/discord/src/send-target-parsing.ts @@ -7,9 +7,7 @@ import { export type SendDiscordTarget = DiscordTarget; -type SendDiscordTargetParseOptions = DiscordTargetParseOptions; - export const parseDiscordSendTarget = ( raw: string, - options: SendDiscordTargetParseOptions = {}, + options: DiscordTargetParseOptions = {}, ): SendDiscordTarget | undefined => parseDiscordTarget(raw, options); diff --git a/extensions/matrix/src/cli.ts b/extensions/matrix/src/cli.ts index 65e240dd89c..6614145b6b2 100644 --- a/extensions/matrix/src/cli.ts +++ b/extensions/matrix/src/cli.ts @@ -538,13 +538,11 @@ async function repairMatrixDirectRoom(params: { }); } -type MatrixCliProfileSetResult = MatrixProfileUpdateResult; - async function setMatrixProfile(params: { account?: string; name?: string; avatarUrl?: string; -}): Promise { +}): Promise { return await applyMatrixProfileUpdate({ account: params.account, displayName: params.name, diff --git a/extensions/qa-lab/src/suite-runtime-types.ts b/extensions/qa-lab/src/suite-runtime-types.ts index 5fe0fc9b8eb..d47cd01f4ca 100644 --- a/extensions/qa-lab/src/suite-runtime-types.ts +++ b/extensions/qa-lab/src/suite-runtime-types.ts @@ -28,11 +28,9 @@ type QaRuntimeGatewayClient = { ) => Promise; }; -type QaRuntimeTransport = QaTransportAdapter; - export type QaSuiteRuntimeEnv = { gateway: QaRuntimeGatewayClient; - transport: QaRuntimeTransport; + transport: QaTransportAdapter; repoRoot: string; providerMode: QaProviderMode; primaryModel: string; diff --git a/extensions/telegram/src/preview-streaming.ts b/extensions/telegram/src/preview-streaming.ts index 58670073852..62f621ed6eb 100644 --- a/extensions/telegram/src/preview-streaming.ts +++ b/extensions/telegram/src/preview-streaming.ts @@ -4,13 +4,11 @@ import { type StreamingMode, } from "openclaw/plugin-sdk/channel-outbound"; -type TelegramPreviewStreamMode = StreamingMode; - export function resolveTelegramPreviewStreamMode( params: { streamMode?: unknown; streaming?: unknown; } = {}, -): TelegramPreviewStreamMode { +): StreamingMode { return resolveChannelPreviewStreamMode(params, "partial"); } diff --git a/extensions/whatsapp/src/reaction-level.ts b/extensions/whatsapp/src/reaction-level.ts index 33eeac40a48..0bfe74febd7 100644 --- a/extensions/whatsapp/src/reaction-level.ts +++ b/extensions/whatsapp/src/reaction-level.ts @@ -6,13 +6,11 @@ import { } from "openclaw/plugin-sdk/status-helpers"; import { resolveMergedWhatsAppAccountConfig } from "./account-config.js"; -type ResolvedWhatsAppReactionLevel = ResolvedReactionLevel; - /** Resolve the effective reaction level and its implications for WhatsApp. */ export function resolveWhatsAppReactionLevel(params: { cfg: OpenClawConfig; accountId?: string; -}): ResolvedWhatsAppReactionLevel { +}): ResolvedReactionLevel { const account = resolveMergedWhatsAppAccountConfig({ cfg: params.cfg, accountId: params.accountId, diff --git a/packages/media-generation-core/src/model-ref.ts b/packages/media-generation-core/src/model-ref.ts index 2bf10505dfe..ff1aeaf2b26 100644 --- a/packages/media-generation-core/src/model-ref.ts +++ b/packages/media-generation-core/src/model-ref.ts @@ -8,6 +8,6 @@ import { export type ParsedGenerationModelRef = ProviderModelRef; /** Parses strict generation model refs and rejects missing provider or model segments. */ -export function parseGenerationModelRef(raw: string | undefined): ParsedGenerationModelRef | null { +export function parseGenerationModelRef(raw: string | undefined): ProviderModelRef | null { return raw === undefined ? null : parseProviderModelRef(raw); } diff --git a/src/agents/model-selection-normalize.ts b/src/agents/model-selection-normalize.ts index 67a2885bea9..7d4cb49f7c7 100644 --- a/src/agents/model-selection-normalize.ts +++ b/src/agents/model-selection-normalize.ts @@ -111,14 +111,13 @@ export function normalizeModelRef( return { provider: normalizedProvider, model: normalizedModel }; } -type ParseModelRefOptions = ModelRefNormalizeOptions; const OPENROUTER_AUTO_COMPAT_ALIAS = "openrouter:auto"; /** Parse `provider/model` or bare model text using a default provider. */ export function parseModelRef( raw: string, defaultProvider: string, - options?: ParseModelRefOptions, + options?: ModelRefNormalizeOptions, ): ModelRef | null { const trimmed = raw.trim(); if (!trimmed) { diff --git a/src/commands/status.command-sections.ts b/src/commands/status.command-sections.ts index 2b8306c54f7..db49b5f8d89 100644 --- a/src/commands/status.command-sections.ts +++ b/src/commands/status.command-sections.ts @@ -25,7 +25,6 @@ type AgentStatusLike = { type SummaryLike = Pick; type MemoryLike = MemoryStatusSnapshot | null; -type MemoryPluginLike = MemoryPluginStatus; type SessionsRecentLike = SessionStatus; type EventLoopHealthLike = NonNullable; @@ -151,7 +150,7 @@ export function buildStatusLastHeartbeatValue(params: { export function buildStatusMemoryValue( params: { memory: MemoryLike; - memoryPlugin: MemoryPluginLike; + memoryPlugin: MemoryPluginStatus; ok: (value: string) => string; warn: (value: string) => string; muted: (value: string) => string; diff --git a/src/gateway/local-request-context.ts b/src/gateway/local-request-context.ts index 7ebcaad2a5e..e4249588f61 100644 --- a/src/gateway/local-request-context.ts +++ b/src/gateway/local-request-context.ts @@ -22,8 +22,6 @@ type LocalGatewayRequestContextParams = { getRuntimeConfig: () => OpenClawConfig; }; -type LocalGatewayScopeParams = LocalGatewayRequestContextParams; - function cronUnavailable(): never { throw new Error("Cron is unavailable in local embedded agent gateway context."); } @@ -156,7 +154,10 @@ export function createLocalGatewayRequestContext( } /** Runs code inside a local gateway request scope unless an outer scope already exists. */ -export function withLocalGatewayRequestScope(params: LocalGatewayScopeParams, run: () => T): T { +export function withLocalGatewayRequestScope( + params: LocalGatewayRequestContextParams, + run: () => T, +): T { const existing = getPluginRuntimeGatewayRequestScope(); if (existing?.context) { return run(); diff --git a/src/gateway/server-methods/agent-job.ts b/src/gateway/server-methods/agent-job.ts index bb6b2334c51..69ee39fe4a4 100644 --- a/src/gateway/server-methods/agent-job.ts +++ b/src/gateway/server-methods/agent-job.ts @@ -27,7 +27,7 @@ const AGENT_RUN_TIMEOUT_RETRY_GRACE_MS = 15_000; const agentRunCache = new Map(); const agentRunStarts = new Map(); -const pendingAgentRunErrors = new Map(); +const pendingAgentRunErrors = new Map(); const pendingAgentRunTimeouts = new Map(); const agentRunWaiterCounts = new Map(); let agentRunListenerStarted = false; @@ -43,8 +43,6 @@ type PendingAgentRunTerminal = { timer: NodeJS.Timeout; }; -type PendingAgentRunError = PendingAgentRunTerminal; - function pruneAgentRunCache(now = Date.now()) { for (const [runId, entry] of agentRunCache) { if (now - entry.ts > AGENT_RUN_CACHE_TTL_MS) { diff --git a/src/gateway/server-methods/chat-webchat-media.ts b/src/gateway/server-methods/chat-webchat-media.ts index 77d711caec2..9c5d83b247b 100644 --- a/src/gateway/server-methods/chat-webchat-media.ts +++ b/src/gateway/server-methods/chat-webchat-media.ts @@ -42,8 +42,6 @@ type WebchatAudioEmbeddingOptions = { onLocalAudioAccessDenied?: (err: LocalMediaAccessError) => void; }; -type WebchatAssistantMediaOptions = WebchatAudioEmbeddingOptions; - type LocalAudioContentBlock = { path: string; block: Record; @@ -253,7 +251,7 @@ export async function buildWebchatAudioContentBlocksFromReplyPayloads( export async function buildWebchatAssistantMessageFromReplyPayloads( payloads: ReplyPayload[], - options?: WebchatAssistantMediaOptions, + options?: WebchatAudioEmbeddingOptions, ): Promise<{ content: Array>; transcriptText: string } | null> { const content: Array> = []; const transcriptTextParts: string[] = []; diff --git a/src/infra/command-explainer/extract.ts b/src/infra/command-explainer/extract.ts index a4dd2585c6f..5e9c8eb1187 100644 --- a/src/infra/command-explainer/extract.ts +++ b/src/infra/command-explainer/extract.ts @@ -946,9 +946,8 @@ function shellWrapperPayloadForParsing( return { command: payload, spanBase }; } -type InlineEvalHit = InterpreterInlineEvalHit; function recordInlineEvalRisk( - inlineEval: InlineEvalHit, + inlineEval: InterpreterInlineEvalHit, text: string, span: SourceSpan, output: MutableExplanation, diff --git a/src/infra/provider-usage.fetch.claude.ts b/src/infra/provider-usage.fetch.claude.ts index 08d400a45a8..31df98ef0b3 100644 --- a/src/infra/provider-usage.fetch.claude.ts +++ b/src/infra/provider-usage.fetch.claude.ts @@ -21,8 +21,6 @@ type ClaudeWebOrganizationsResponse = Array<{ name?: string; }>; -type ClaudeWebUsageResponse = ClaudeUsageResponse; - function buildClaudeUsageWindows(data: ClaudeUsageResponse): UsageWindow[] { const windows: UsageWindow[] = []; @@ -116,7 +114,7 @@ async function fetchClaudeWebUsage( if (!parsedUsage.ok) { return null; } - const data = parsedUsage.data as ClaudeWebUsageResponse; + const data = parsedUsage.data as ClaudeUsageResponse; const windows = buildClaudeUsageWindows(data); if (windows.length === 0) { diff --git a/src/plugin-sdk/session-store-runtime.ts b/src/plugin-sdk/session-store-runtime.ts index 86b7fa64014..8610614c3a2 100644 --- a/src/plugin-sdk/session-store-runtime.ts +++ b/src/plugin-sdk/session-store-runtime.ts @@ -55,8 +55,6 @@ type PatchSessionEntryParams = SessionStoreReadParams & { update: SessionStoreEntryPatch; }; -type ReadSessionUpdatedAtParams = SessionStoreReadParams; - type ReadAmbientTranscriptWatermarkParams = SessionStoreReadParams & { key: string; }; @@ -149,7 +147,7 @@ export async function patchSessionEntry( } /** Reads the last activity timestamp for one session entry. */ -export function readSessionUpdatedAt(params: ReadSessionUpdatedAtParams): number | undefined { +export function readSessionUpdatedAt(params: SessionStoreReadParams): number | undefined { return readAccessorSessionUpdatedAt(toSessionAccessScope(params)); } diff --git a/src/skills/discovery/status.ts b/src/skills/discovery/status.ts index 1d8d5810a65..8e930aeaef2 100644 --- a/src/skills/discovery/status.ts +++ b/src/skills/discovery/status.ts @@ -35,8 +35,6 @@ import { type SkillIndexEntry, } from "./skill-index.js"; -type SkillStatusConfigCheck = RequirementConfigCheck; - type SkillInstallOption = { id: string; kind: SkillInstallSpec["kind"]; @@ -72,7 +70,7 @@ export type SkillStatusEntry = { commandVisible: boolean; requirements: Requirements; missing: Requirements; - configChecks: SkillStatusConfigCheck[]; + configChecks: RequirementConfigCheck[]; install: SkillInstallOption[]; clawhub?: ClawHubSkillStatusLink; skillCard?: LocalSkillCardStatus; diff --git a/src/tasks/task-executor.ts b/src/tasks/task-executor.ts index d081f265f54..1757c23a1a9 100644 --- a/src/tasks/task-executor.ts +++ b/src/tasks/task-executor.ts @@ -91,10 +91,7 @@ function ensureSingleTaskFlow(params: { } } -type TaskRunCreateParams = DetachedTaskCreateParams; -type RunningTaskRunCreateParams = DetachedRunningTaskCreateParams; - -export function createQueuedTaskRun(params: TaskRunCreateParams): TaskRecord | null { +export function createQueuedTaskRun(params: DetachedTaskCreateParams): TaskRecord | null { const task = createTaskRecord({ ...params, status: "queued", @@ -112,7 +109,7 @@ export function getFlowTaskSummary(flowId: string): TaskRegistrySummary { return summarizeTaskRecords(listTasksForFlowId(flowId)); } -export function createRunningTaskRun(params: RunningTaskRunCreateParams): TaskRecord | null { +export function createRunningTaskRun(params: DetachedRunningTaskCreateParams): TaskRecord | null { const task = createTaskRecord({ ...params, status: "running",