diff --git a/docs/.generated/plugin-sdk-api-baseline.jsonl b/docs/.generated/plugin-sdk-api-baseline.jsonl index 599ce8c6e89c..201c8c18940e 100644 --- a/docs/.generated/plugin-sdk-api-baseline.jsonl +++ b/docs/.generated/plugin-sdk-api-baseline.jsonl @@ -53,17 +53,17 @@ {"closureHash":"ff3c4616cd6212a6d698831a8b287ad87e3968c8663f4090d095bb30ec40fc1c","declaration":"export function abortAndDrainAgentHarnessRun(params: { sessionId: string; sessionKey?: string; settleMs?: number; forceClear?: boolean; reason?: string; }): Promise;","entrypoint":"agent-harness","exportName":"abortAndDrainAgentHarnessRun","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} {"closureHash":"58989e3fa91eecf2e05202e36548e6e64a3b9219e83154bd99866c851604e34e","declaration":"export function createAgentToolResultMiddlewareRunner(ctx: AgentToolResultMiddlewareContext, handlers?: AgentToolResultMiddleware[]): { applyToolResultMiddleware(event: AgentToolResultMiddlewareEvent): Promise; };","entrypoint":"agent-harness","exportName":"createAgentToolResultMiddlewareRunner","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} {"closureHash":"b8f6355d7ad1700aceecddaa6e9ccf43091a792d5b481a1ee3f55294a881a67d","declaration":"export function createCodexAppServerToolResultExtensionRunner(ctx: CodexAppServerExtensionContext, factories?: CodexAppServerExtensionFactory[]): { applyToolResultExtensions(event: CodexAppServerToolResultEvent): Promise>; };","entrypoint":"agent-harness","exportName":"createCodexAppServerToolResultExtensionRunner","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} -{"closureHash":"c4e5a9433c43e733147472f80b0669afd4521aca58d17aa914ab1615c88aeeeb","declaration":"export function createOpenClawCodingTools(options?: OpenClawCodingToolsOptions): AnyAgentTool[];","entrypoint":"agent-harness","exportName":"createOpenClawCodingTools","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} +{"closureHash":"25ff7f2385cc4945b0242d4e8142701ca11dcb43caf79c13be98d3d7057aa16b","declaration":"export function createOpenClawCodingTools(options?: OpenClawCodingToolsOptions): AnyAgentTool[];","entrypoint":"agent-harness","exportName":"createOpenClawCodingTools","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} {"closureHash":"13649ee853485319e7449fda25c106b3f3f53d3090e53cdbb28e220a8529eb80","declaration":"export function disposeRegisteredAgentHarnesses(): Promise;","entrypoint":"agent-harness","exportName":"disposeRegisteredAgentHarnesses","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} {"closureHash":"f255a91162ece4c239bb8fa745efa14a1054bc024a291e9954f75f239b2b87c3","declaration":"export function resolveActiveEmbeddedRunSessionId(sessionKey: string): string | undefined;","entrypoint":"agent-harness","exportName":"resolveActiveEmbeddedRunSessionId","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} {"closureHash":"27d9f61df9ccf68615cb2002a6da891e36ab0c07623bc37c4d07aa980b446881","declaration":"export function resolveWebSearchToolPolicy(params: WebSearchToolPolicyParams): WebSearchToolPolicyResolution;","entrypoint":"agent-harness","exportName":"resolveWebSearchToolPolicy","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"function","recordType":"export"} -{"closureHash":"89d1232faa739ea7bb8b305d5e92ff1057759b833cd9994ef0923634234741e7","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"agent-harness","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} -{"closureHash":"795de260f25641a5b8da3aebe153b44e06327ee13bf9a05f7e42c3b38f3c2ce3","declaration":"export type AgentHarnessV2 = AgentHarnessV2;","entrypoint":"agent-harness","exportName":"AgentHarnessV2","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} +{"closureHash":"49e181db775c3ee735cef6900062306c81f598b8a5b696379e55a21f3b011741","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"agent-harness","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} +{"closureHash":"b6715292b8d6d9052693092945f171f0c92cd02e816f04e0eef46bd021220691","declaration":"export type AgentHarnessV2 = AgentHarnessV2;","entrypoint":"agent-harness","exportName":"AgentHarnessV2","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} {"closureHash":"4ad0f830bf11a2db48faefb1439b7fbb08d9f22d22083f5e301327e1696f2310","declaration":"export type AgentToolResultMiddleware = AgentToolResultMiddleware;","entrypoint":"agent-harness","exportName":"AgentToolResultMiddleware","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} {"closureHash":"008b6c78d5e44a9d1df1d7e32e6015382ee9ba1cb9b10bd4c2b467619d1c89d4","declaration":"export type AgentToolResultMiddlewareEvent = AgentToolResultMiddlewareEvent;","entrypoint":"agent-harness","exportName":"AgentToolResultMiddlewareEvent","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} {"closureHash":"7414a2a79c2d78c1d52538250c827305bba1a2bb25010448837c8524a9f95b3c","declaration":"export type AnyAgentTool = AnyAgentTool;","entrypoint":"agent-harness","exportName":"AnyAgentTool","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} -{"closureHash":"67d52689459e750067ca4d122d5169a1032fa5a806cdc66b0bf189f702ddbf57","declaration":"export type EmbeddedRunAttemptParams = EmbeddedRunAttemptParams;","entrypoint":"agent-harness","exportName":"EmbeddedRunAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} -{"closureHash":"3c8261189c5490b5f8938dde6c1fd39e05ad9a3156041fcc8b20df8040147986","declaration":"export type EmbeddedRunAttemptParamsV2 = EmbeddedRunAttemptParamsV2;","entrypoint":"agent-harness","exportName":"EmbeddedRunAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} +{"closureHash":"e56cb7e08a025e371381ce766f210b1eb87cd20cf342ec4257a6ed901dee1161","declaration":"export type EmbeddedRunAttemptParams = EmbeddedRunAttemptParams;","entrypoint":"agent-harness","exportName":"EmbeddedRunAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} +{"closureHash":"91ab1bc755e8eed0932ece9b7dbb5509e93abcb017dee7a0cd2ebaca4616f497","declaration":"export type EmbeddedRunAttemptParamsV2 = EmbeddedRunAttemptParamsV2;","entrypoint":"agent-harness","exportName":"EmbeddedRunAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} {"closureHash":"25c6985c3bef2c6efc6a96e70af6d66fe073be0b0d311681cfc0dfc186528d9a","declaration":"export type OpenClawAgentToolResult = OpenClawAgentToolResult;","entrypoint":"agent-harness","exportName":"OpenClawAgentToolResult","importSpecifier":"openclaw/plugin-sdk/agent-harness","kind":"type","recordType":"export"} {"category":"runtime","entrypoint":"agent-harness-runtime","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","recordType":"module"} {"closureHash":"fab99dfcb01d475a1bfdbe7a8fac9be10a93dac5f12ac78c2dea673c8ab86abf","declaration":"export function abortAgentHarnessRun(sessionId: string): boolean;\nexport function abortAgentHarnessRun(sessionId: undefined, opts: { mode: \"all\" | \"compacting\"; reason?: \"restart\"; }): boolean;","entrypoint":"agent-harness-runtime","exportName":"abortAgentHarnessRun","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} @@ -82,8 +82,8 @@ {"closureHash":"f8ad3d762c9753fdc36b2b9af0980167fdc54090c7bcca2f3dbe7c8951e86821","declaration":"export function buildAgentRuntimePlan(params: BuildAgentRuntimePlanParams): AgentRuntimePlan;","entrypoint":"agent-harness-runtime","exportName":"buildAgentRuntimePlan","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"528d11abf061b0b303722737de5a6406e7e55bffa38c45144c77d896ae1b3b0a","declaration":"export function buildBootstrapContextForFiles(bootstrapFiles: WorkspaceBootstrapFile[], params: { config?: OpenClawConfig; agentId?: string | null; warn?: (message: string) => void; }): EmbeddedContextFile[];","entrypoint":"agent-harness-runtime","exportName":"buildBootstrapContextForFiles","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"44d5a4667d2f3dc3a28e5c9d7b46765b1fb3c62820288e40251f5174911c8a6a","declaration":"export function buildEmbeddedAttemptToolRunContext(params: { trigger?: EmbeddedRunTrigger; jobId?: string; memoryFlushWritePath?: string; toolsAllow?: string[]; conversationToolPolicy?: GroupToolPolicyConfig; trace?: DiagnosticTraceContext; }): { trigger?: EmbeddedRunTrigger; jobId?: string; memoryFlushWritePath?: string; runtimeToolAllowlist?: string[]; conversationToolPolicy?: GroupToolPolicyConfig; trace?: DiagnosticTraceContext; };","entrypoint":"agent-harness-runtime","exportName":"buildEmbeddedAttemptToolRunContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} -{"closureHash":"b1299f24e1c39c4f7ee73c0fd858e78a72b908e25e4fe8efce18bee53bf0f09b","declaration":"export function buildHarnessContextEngineRuntimeContext(params: Parameters[0]): ContextEngineRuntimeContext;","entrypoint":"agent-harness-runtime","exportName":"buildHarnessContextEngineRuntimeContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} -{"closureHash":"265665427d4b24c4d76c70928a2ccfa363db7ea51e9a9c3279efb30f199290d6","declaration":"export function buildHarnessContextEngineRuntimeContextFromUsage(params: Parameters[0]): ContextEngineRuntimeContext;","entrypoint":"agent-harness-runtime","exportName":"buildHarnessContextEngineRuntimeContextFromUsage","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} +{"closureHash":"92201c182e890e489de0ded2606be4118d1ec3bf9cf4aa873628cb962304b7f0","declaration":"export function buildHarnessContextEngineRuntimeContext(params: Parameters[0]): ContextEngineRuntimeContext;","entrypoint":"agent-harness-runtime","exportName":"buildHarnessContextEngineRuntimeContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} +{"closureHash":"9217a0d9284005c47780dac9d842b331d2cafeb1eed7e5f17ab63c8cc2a2225f","declaration":"export function buildHarnessContextEngineRuntimeContextFromUsage(params: Parameters[0]): ContextEngineRuntimeContext;","entrypoint":"agent-harness-runtime","exportName":"buildHarnessContextEngineRuntimeContextFromUsage","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"33a7cd8d63d4ef045ee3a42f806026a8b621e7dd32d8d6fbf4e7b44452d5e0ce","declaration":"export function buildNativeHookRelayCommand(params: { provider: NativeHookRelayProvider; relayId: string; generation?: string; event: NativeHookRelayEvent; preToolUseUnavailable?: \"noop\"; timeoutMs?: number; executable?: string; nice?: number | false; nodeExecutable?: string; }): string;","entrypoint":"agent-harness-runtime","exportName":"buildNativeHookRelayCommand","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"3846647c3c2fb0242f70591cf95c2e02f2a5a3c44447efb4cf7a31b2dc2122fd","declaration":"export function buildSkillWorkshopPromptSection(): string[];","entrypoint":"agent-harness-runtime","exportName":"buildSkillWorkshopPromptSection","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"32e977ece65144a83ae1b0a3c8d1b9b00a2a2506ad9ef1db3b2b9770ce762dbe","declaration":"export function buildWatchedSessionsHarnessContext(params: { config?: OpenClawConfig; sessionKey?: string; sandboxed?: boolean; toolNames: Iterable; capabilityToolNames?: Iterable; }): string | undefined;","entrypoint":"agent-harness-runtime","exportName":"buildWatchedSessionsHarnessContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} @@ -100,7 +100,7 @@ {"closureHash":"51f76e9e37b65b358f0313e10152d950b003bc3e50f4bb26fe29a988237772e2","declaration":"export function consumePreExecutionBlockedToolCall(toolCallId: string, runId?: string): boolean;","entrypoint":"agent-harness-runtime","exportName":"consumePreExecutionBlockedToolCall","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"58989e3fa91eecf2e05202e36548e6e64a3b9219e83154bd99866c851604e34e","declaration":"export function createAgentToolResultMiddlewareRunner(ctx: AgentToolResultMiddlewareContext, handlers?: AgentToolResultMiddleware[]): { applyToolResultMiddleware(event: AgentToolResultMiddlewareEvent): Promise; };","entrypoint":"agent-harness-runtime","exportName":"createAgentToolResultMiddlewareRunner","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"b8f6355d7ad1700aceecddaa6e9ccf43091a792d5b481a1ee3f55294a881a67d","declaration":"export function createCodexAppServerToolResultExtensionRunner(ctx: CodexAppServerExtensionContext, factories?: CodexAppServerExtensionFactory[]): { applyToolResultExtensions(event: CodexAppServerToolResultEvent): Promise>; };","entrypoint":"agent-harness-runtime","exportName":"createCodexAppServerToolResultExtensionRunner","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} -{"closureHash":"3f09dd665045d4010e22633cc51d48c75484c5d77c96e2b6235042cdfa778d96","declaration":"export function deliverAgentHarnessUserInputPrompt(params: PromptDeliveryParams, questions: readonly AgentHarnessUserInputQuestion[], options?: AgentHarnessUserInputPromptOptions): Promise;","entrypoint":"agent-harness-runtime","exportName":"deliverAgentHarnessUserInputPrompt","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} +{"closureHash":"7fee754eed7542b76b75703ecb942d42dd60d3d982e1d97cfe199140093a3458","declaration":"export function deliverAgentHarnessUserInputPrompt(params: PromptDeliveryParams, questions: readonly AgentHarnessUserInputQuestion[], options?: AgentHarnessUserInputPromptOptions): Promise;","entrypoint":"agent-harness-runtime","exportName":"deliverAgentHarnessUserInputPrompt","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"6f436485257f69fa07a18203b91d4341690522f12aff4f25805c7a1e21326ee3","declaration":"export function detectAndLoadAgentHarnessPromptImages(params: { prompt: string; workspaceDir: string; model: { input?: string[]; }; existingImages?: ImageContent[]; imageOrder?: PromptImageOrderEntry[]; media?: MediaFact[]; config?: OpenClawConfig; workspaceOnly?: boolean; localRoots?: readonly string[]; sandbox?: { root: string; bridge: SandboxFsBridge; }; }): Promise<{ images: ImageContent[]; detectedRefs: Array<{ raw: string; resolved: string; type: \"path\" | \"media-uri\"; }>; loadedCount: number; skippedCount: number; }>;","entrypoint":"agent-harness-runtime","exportName":"detectAndLoadAgentHarnessPromptImages","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"13649ee853485319e7449fda25c106b3f3f53d3090e53cdbb28e220a8529eb80","declaration":"export function disposeRegisteredAgentHarnesses(): Promise;","entrypoint":"agent-harness-runtime","exportName":"disposeRegisteredAgentHarnesses","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"c38cd390190bb07ddcd247420d6e0b489a0229bd402ddca0440417217a57251a","declaration":"export function emitAgentEvent(event: Omit): void;","entrypoint":"agent-harness-runtime","exportName":"emitAgentEvent","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} @@ -162,7 +162,7 @@ {"closureHash":"40154c3b7b2a7179df33f4a3fbef5e56078be2759d5aab29f39eb0f3c92fc631","declaration":"export function projectRuntimeToolInputSchema(schema: unknown, path?: string): RuntimeToolInputSchemaProjection;","entrypoint":"agent-harness-runtime","exportName":"projectRuntimeToolInputSchema","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"e42e3dc63e8545bb9a6056336fbd6c1dc8f356dce4f0f1c6d9765254c974390e","declaration":"export function projectSettledTurnFinalizationAttemptResult(result: AgentHarnessAttemptResult): AgentHarnessSettledTurnFinalizationResult;","entrypoint":"agent-harness-runtime","exportName":"projectSettledTurnFinalizationAttemptResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"3fbe470f065d2c2f16de538d8347934ec2daee2081d8903db1777b0afd2a8043","declaration":"export function queueAgentHarnessMessage(sessionId: string, text: string, options?: EmbeddedAgentQueueMessageOptions): boolean;","entrypoint":"agent-harness-runtime","exportName":"queueAgentHarnessMessage","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} -{"closureHash":"c1ef32674ceeac32818c97821305d634fbe1b592d6d5bdfa0ed6298c7f842ebc","declaration":"export function registerNativeHookRelay(params: RegisterNativeHookRelayParams): ActiveNativeHookRelayRegistrationHandle;","entrypoint":"agent-harness-runtime","exportName":"registerNativeHookRelay","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} +{"closureHash":"fd0056a173ac764c39e15310e6ad70477ac2971677e172d4161ca234080795d0","declaration":"export function registerNativeHookRelay(params: RegisterNativeHookRelayParams): ActiveNativeHookRelayRegistrationHandle;","entrypoint":"agent-harness-runtime","exportName":"registerNativeHookRelay","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"b7cc6c35506dc6955e0359aa5c53c15a4d0db23639da8c1717f8fefda953c119","declaration":"export function requestDeferredPluginToolApproval(params: { deferredApproval: DeferredPluginToolApproval; signal?: AbortSignal; }): Promise;","entrypoint":"agent-harness-runtime","exportName":"requestDeferredPluginToolApproval","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"a2306cba08cb05ff8430c8362c0cc3c821706da5a4e65a06849ad0d0fb007ae3","declaration":"export function resetAgentEventsForTest(options?: { preserveListeners?: boolean; }): void;","entrypoint":"agent-harness-runtime","exportName":"resetAgentEventsForTest","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"f255a91162ece4c239bb8fa745efa14a1054bc024a291e9954f75f239b2b87c3","declaration":"export function resolveActiveEmbeddedRunSessionId(sessionKey: string): string | undefined;","entrypoint":"agent-harness-runtime","exportName":"resolveActiveEmbeddedRunSessionId","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} @@ -197,7 +197,7 @@ {"closureHash":"e4784aeda4c24b60cd49b7f5983e70a380a4759d5176c74d30f2900952ba848f","declaration":"export function runAgentHarnessBeforeAgentFinalizeHook(params: { event: PluginHookBeforeAgentFinalizeEvent; ctx: AgentHarnessHookContext; hookRunner?: AgentHarnessHookRunner; }): Promise;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessBeforeAgentFinalizeHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"8fec73ee8c7c9be3335bd6dc1bac9278f0be5beef22a5975eb06e56f504f4bd6","declaration":"export function runAgentHarnessBeforeCompactionHook(params: { sessionFile: string; messages?: AgentMessage[]; ctx: AgentHarnessHookContext; }): Promise;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessBeforeCompactionHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"021b81820bef2e8d54c50a5fc159d6665b23b50a1f5c40dae76a4833839d89c9","declaration":"export function runAgentHarnessBeforeMessageWriteHook(params: { message: AgentMessage; agentId?: string; sessionKey?: string; }): AgentMessage | null;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessBeforeMessageWriteHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} -{"closureHash":"8208fa9bd35c5df9d5169347760ecca5002a9a97cfb2006965e40986dba954a4","declaration":"export function runAgentHarnessGatewayQuestion(params: RunAgentHarnessGatewayQuestionParams): Promise;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessGatewayQuestion","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} +{"closureHash":"b3f400ee23218012467ec7f373655abf0547591357fa8e828bdca455fb5cf06f","declaration":"export function runAgentHarnessGatewayQuestion(params: RunAgentHarnessGatewayQuestionParams): Promise;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessGatewayQuestion","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"50a4d7cb20dd8f884abbcb62d77b5b2df183fbfcd058cc7aa76edacd1f7b90d8","declaration":"export function runAgentHarnessLlmInputHook(params: { event: PluginHookLlmInputEvent; ctx: AgentHarnessHookContext; hookRunner?: AgentHarnessHookRunner; }): void;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessLlmInputHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"1bd55c141c249b1c04470cafe0cd4d41dce334ea2883ce83235af56d24a15cca","declaration":"export function runAgentHarnessLlmOutputHook(params: { event: PluginHookLlmOutputEvent; ctx: AgentHarnessHookContext; hookRunner?: AgentHarnessHookRunner; }): void;","entrypoint":"agent-harness-runtime","exportName":"runAgentHarnessLlmOutputHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} {"closureHash":"c4c5131ab7065decd8d8e935ac3779e3baa2c52fbbbd95a6ccb624377db09ca1","declaration":"export function runBeforeToolCallHook(args: { toolName: string; params: unknown; toolKind?: PluginHookToolKind; toolInputKind?: PluginHookToolInputKind; toolCallId?: string; ctx?: HookContext; signal?: AbortSignal; approvalMode?: \"request\" | \"report\" | \"deny\" | \"defer\"; }): Promise;","entrypoint":"agent-harness-runtime","exportName":"runBeforeToolCallHook","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"function","recordType":"export"} @@ -219,13 +219,13 @@ {"closureHash":"0701a22057edc3b733da7e05948db94aa98b337b224a5718efdd85212a8602bf","declaration":"export const TRANSCRIPT_CREDENTIAL_SAFETY_PROMPT: string;","entrypoint":"agent-harness-runtime","exportName":"TRANSCRIPT_CREDENTIAL_SAFETY_PROMPT","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"const","recordType":"export"} {"closureHash":"b5845c99df6c2a834a16678c320e0111bad96a3a7ac245d379aa5e6d2555d29b","declaration":"export const agentHarnessAttemptTerminal: { merge: (current: AgentRunAttemptTerminal, incoming: AgentRunAttemptTerminal) => AgentRunAttemptTerminal; normalize: (input: { aborted?: boolean; externalAbort?: boolean; idleTimedOut?: boolean; promptError?: unknown; promptErrorSource?: AgentRunAttemptFailureSource | null; timedOut?: boolean; timedOutByRunBudget?: boolean; timedOutDuringCompaction?: boolean; timedOutDuringToolExecution?: boolean; }) => AgentRunAttemptTerminal; project: (terminal: AgentRunAttemptTerminal) => { aborted: boolean; cleanupYieldAborted: boolean; externalAbort: boolean; failed: boolean; idleTimedOut: boolean; interrupted: boolean; promptError: unknown; promptErrorSource: AgentRunAttemptFailureSource | null; timedOut: boolean; timedOutByRunBudget: boolean; timedOutDuringCompaction: boolean; timedOutDuringToolExecution: boolean; }; setFailure: (terminal: AgentRunAttemptTerminal, failure: { source: AgentRunAttemptFailureSource; error: unknown; } | null) => AgentRunAttemptTerminal;};","entrypoint":"agent-harness-runtime","exportName":"agentHarnessAttemptTerminal","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"const","recordType":"export"} {"closureHash":"22bcf962aa76c76074c4ed4ad7d6558edbc3588e239263e09af74c1000bbe012","declaration":"export const embeddedAgentLog: SubsystemLogger;","entrypoint":"agent-harness-runtime","exportName":"embeddedAgentLog","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"const","recordType":"export"} -{"closureHash":"2d557ae3f21edf5b81e36ed42915c0b44188ad04730348db803f30fce54fe47a","declaration":"export const nativeHookRelayTesting: { readonly clearNativeHookRelaysForTests: () => void; readonly getNativeHookRelayInvocationsForTests: () => NativeHookRelayInvocation[]; readonly getNativeHookRelayRegistrationForTests: (relayId: string) => NativeHookRelayRegistration | undefined; readonly getNativeHookRelayBridgeDirForTests: () => string; readonly getNativeHookRelayBridgeRegistryPathForTests: (relayId: string) => string; readonly getNativeHookRelayBridgeRecordForTests: (relayId: string) => Record | undefined; readonly isNativeHookRelayBridgeLookupRetryableForTests: (error: unknown, elapsedMs?: number) => boolean; readonly formatPermissionApprovalDescriptionForTests: (request: NativeHookRelayPermissionApprovalRequest) => string; readonly permissionRequestContentFingerprintForTests: (request: NativeHookRelayPermissionApprovalRequest) => string; readonly permissionRequestToolInputKeyFingerprintForTests: (toolInput: Record) => string; readonly setNativeHookRelayPermissionApprovalRequesterForTests: (requester: NativeHookRelayPermissionApprovalRequester) => void; readonly setNativeHookRelayDeferredToolApprovalRequesterForTests: (requester: NativeHookRelayDeferredToolApprovalRequester) => void;};","entrypoint":"agent-harness-runtime","exportName":"nativeHookRelayTesting","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"const","recordType":"export"} +{"closureHash":"b786f0ddfb551440de9e0abdbec0a26f69fe429d6d466cfdf09391b86a372bb2","declaration":"export const nativeHookRelayTesting: { readonly clearNativeHookRelaysForTests: () => void; readonly getNativeHookRelayInvocationsForTests: () => NativeHookRelayInvocation[]; readonly getNativeHookRelayRegistrationForTests: (relayId: string) => NativeHookRelayRegistration | undefined; readonly getNativeHookRelayBridgeDirForTests: () => string; readonly getNativeHookRelayBridgeRegistryPathForTests: (relayId: string) => string; readonly getNativeHookRelayBridgeRecordForTests: (relayId: string) => Record | undefined; readonly isNativeHookRelayBridgeLookupRetryableForTests: (error: unknown, elapsedMs?: number) => boolean; readonly formatPermissionApprovalDescriptionForTests: (request: NativeHookRelayPermissionApprovalRequest) => string; readonly permissionRequestContentFingerprintForTests: (request: NativeHookRelayPermissionApprovalRequest) => string; readonly permissionRequestToolInputKeyFingerprintForTests: (toolInput: Record) => string; readonly setNativeHookRelayPermissionApprovalRequesterForTests: (requester: NativeHookRelayPermissionApprovalRequester) => void; readonly setNativeHookRelayDeferredToolApprovalRequesterForTests: (requester: NativeHookRelayDeferredToolApprovalRequester) => void;};","entrypoint":"agent-harness-runtime","exportName":"nativeHookRelayTesting","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"const","recordType":"export"} {"closureHash":"f237bbc11e1d389679cd4e2ad7aa9055951b3029348e3374b81f769786a51d55","declaration":"export type AbortAndDrainAgentHarnessRunResult = AbortAndDrainEmbeddedAgentRunResult;","entrypoint":"agent-harness-runtime","exportName":"AbortAndDrainAgentHarnessRunResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"6f802f46717d28d260bbcb2cf4790dfed4e9ab28c4fe822d259228189cca4665","declaration":"export type AgentApprovalEventData = AgentApprovalEventData;","entrypoint":"agent-harness-runtime","exportName":"AgentApprovalEventData","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"12aac3a57ce200b0f082002be237625729f84ed7c337f1bac90bcd0688a53319","declaration":"export type AgentEventPayload = AgentEventPayload;","entrypoint":"agent-harness-runtime","exportName":"AgentEventPayload","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"89d1232faa739ea7bb8b305d5e92ff1057759b833cd9994ef0923634234741e7","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"agent-harness-runtime","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"89d1232faa739ea7bb8b305d5e92ff1057759b833cd9994ef0923634234741e7","declaration":"export type AgentHarnessAttemptParams = AgentHarnessAttemptParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"ee3f133d91eaa071727c7e182f4448cd13fec510ea6b2b575283dc548f60c9cf","declaration":"export type AgentHarnessAttemptParamsV2 = AgentHarnessAttemptParamsV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"49e181db775c3ee735cef6900062306c81f598b8a5b696379e55a21f3b011741","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"agent-harness-runtime","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"49e181db775c3ee735cef6900062306c81f598b8a5b696379e55a21f3b011741","declaration":"export type AgentHarnessAttemptParams = AgentHarnessAttemptParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"51819376b167aefcfed0bb08c6bdf8d78099eed5ab54df9f33ee74e4da838ac3","declaration":"export type AgentHarnessAttemptParamsV2 = AgentHarnessAttemptParamsV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"2dc2a62deea63b316142cc28d40afb88fb0d1e5ce3e048f141420726cda38248","declaration":"export type AgentHarnessAttemptResult = AgentHarnessAttemptResult;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAttemptResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"c7e642234081160830fd9e18a301900f8ee1ea8c88382e5a286f0102de65b714","declaration":"export type AgentHarnessAuthBindingFingerprintParams = AgentHarnessAuthBindingFingerprintParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessAuthBindingFingerprintParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"8f496ce75f294f2aa440a49c3c5b065ddff3a4714df775116af5e53f7fd14fe5","declaration":"export type AgentHarnessCompactParams = CompactEmbeddedAgentSessionParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessCompactParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} @@ -239,8 +239,8 @@ {"closureHash":"95741b872a194687696eba4a96d6e887ec6e81922695fa0282cb2f0a46ff9f97","declaration":"export type AgentHarnessSessionForkParams = AgentHarnessSessionForkParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSessionForkParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"f3c46fef2a6c3393b0b6ad09915abcd6f57bb58ddddde1d60ebd113c7a1c5fa6","declaration":"export type AgentHarnessSessionForkResult = AgentHarnessSessionForkResult;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSessionForkResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"4b5a59730309e446f59a8ec1c554c3193aca1959916594cc657347098bd67a35","declaration":"export type AgentHarnessSettledTurnFinalizationResult = AgentHarnessSettledTurnFinalizationResult;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSettledTurnFinalizationResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"e62cfeeba660873901af9d26f7bb425ddc82063d115fc3f900d272676883b49a","declaration":"export type AgentHarnessSideQuestionParams = AgentHarnessSideQuestionParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSideQuestionParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"a0037263e721edda60c398822f5db2731f46db96b2922e8e5a00c5e20df67ec4","declaration":"export type AgentHarnessSideQuestionParamsV2 = AgentHarnessSideQuestionParamsV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSideQuestionParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"7aa583ac9beee165d1b7b3827a322f5e1ce6d0562a82f395c238eec73a125c5c","declaration":"export type AgentHarnessSideQuestionParams = AgentHarnessSideQuestionParams;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSideQuestionParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"7198f77981a1e645eaa441650aa3f02b0f4cc07d18fd081dd6c16f2d8b0e3f5a","declaration":"export type AgentHarnessSideQuestionParamsV2 = AgentHarnessSideQuestionParamsV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSideQuestionParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"e84173055503c40dd0ef1cb67c6d333e9257fcf995252b27c1d58f5c904e8de9","declaration":"export type AgentHarnessSideQuestionResult = AgentHarnessSideQuestionResult;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSideQuestionResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"50214d08dac98e3c1031ac7bc733b85cb2247d2eef3b6b2045758ae403af7647","declaration":"export type AgentHarnessSupport = AgentHarnessSupport;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSupport","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"50ce26ea22bc225e6064d2e5f37356b6f4ce4a57f8b9fa42baa4c421da48aad5","declaration":"export type AgentHarnessSupportContext = AgentHarnessSupportContext;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessSupportContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} @@ -250,7 +250,7 @@ {"closureHash":"20a8a7c9d5ebf425c30d04eea3856c6c889a210f1fa53c99299df24882afbf92","declaration":"export type AgentHarnessUserInputOption = AgentHarnessUserInputOption;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessUserInputOption","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"6224f51b4189f10a642ad7a8f50a902ec9c6a6a4f8dac0c0de5f7bc0271a27e5","declaration":"export type AgentHarnessUserInputPromptOptions = AgentHarnessUserInputPromptOptions;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessUserInputPromptOptions","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"d8f1d0d118e1536d1f442d11aeae5334a1ed7949a6c61824f547e12931278e1d","declaration":"export type AgentHarnessUserInputQuestion = AgentHarnessUserInputQuestion;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessUserInputQuestion","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"795de260f25641a5b8da3aebe153b44e06327ee13bf9a05f7e42c3b38f3c2ce3","declaration":"export type AgentHarnessV2 = AgentHarnessV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"b6715292b8d6d9052693092945f171f0c92cd02e816f04e0eef46bd021220691","declaration":"export type AgentHarnessV2 = AgentHarnessV2;","entrypoint":"agent-harness-runtime","exportName":"AgentHarnessV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"6f2af683e6a31cde5a473c77e4f03b8f0ec0351a43ea6c0af979d5b394a33f95","declaration":"export type AgentMessage = AgentMessage;","entrypoint":"agent-harness-runtime","exportName":"AgentMessage","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"4ad0f830bf11a2db48faefb1439b7fbb08d9f22d22083f5e301327e1696f2310","declaration":"export type AgentToolResultMiddleware = AgentToolResultMiddleware;","entrypoint":"agent-harness-runtime","exportName":"AgentToolResultMiddleware","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"185abd2870d4df65e9f94623061a30167d17ef1279a395201fe429398bf23500","declaration":"export type AgentToolResultMiddlewareContext = AgentToolResultMiddlewareContext;","entrypoint":"agent-harness-runtime","exportName":"AgentToolResultMiddlewareContext","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} @@ -276,8 +276,8 @@ {"closureHash":"f30b66fd82f4cd61c60880c42a3b8f152ca64a2216036c99ab4129648ed329e7","declaration":"export type EmbeddedAgentCompactResult = EmbeddedAgentCompactResult;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedAgentCompactResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"1bbefad0193436f7340f9d0dec50be5d482973325c3c65170b1053dd05566f0a","declaration":"export type EmbeddedContextFile = EmbeddedContextFile;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedContextFile","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"f30b66fd82f4cd61c60880c42a3b8f152ca64a2216036c99ab4129648ed329e7","declaration":"export type EmbeddedPiCompactResult = EmbeddedAgentCompactResult;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedPiCompactResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"67d52689459e750067ca4d122d5169a1032fa5a806cdc66b0bf189f702ddbf57","declaration":"export type EmbeddedRunAttemptParams = EmbeddedRunAttemptParams;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedRunAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"3c8261189c5490b5f8938dde6c1fd39e05ad9a3156041fcc8b20df8040147986","declaration":"export type EmbeddedRunAttemptParamsV2 = EmbeddedRunAttemptParamsV2;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedRunAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"e56cb7e08a025e371381ce766f210b1eb87cd20cf342ec4257a6ed901dee1161","declaration":"export type EmbeddedRunAttemptParams = EmbeddedRunAttemptParams;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedRunAttemptParams","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"91ab1bc755e8eed0932ece9b7dbb5509e93abcb017dee7a0cd2ebaca4616f497","declaration":"export type EmbeddedRunAttemptParamsV2 = EmbeddedRunAttemptParamsV2;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedRunAttemptParamsV2","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"a6cd2eebe0d06e6578ec8438a207c5acda10ddf01041102d84e4c576a0b6a42f","declaration":"export type EmbeddedRunAttemptResult = EmbeddedRunAttemptResult;","entrypoint":"agent-harness-runtime","exportName":"EmbeddedRunAttemptResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"f6cb2d6411db22cb04220777720d97bcca977351de1cb344ce2ff6ab126a3a08","declaration":"export type ExecApprovalDecision = ExecApprovalDecision;","entrypoint":"agent-harness-runtime","exportName":"ExecApprovalDecision","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"7acb0dffc7bcda6c727e4afc49c955fa8e14f4f8b7b45d197ed794dfa0d73b8e","declaration":"export type ExecAutoReviewDecision = ExecAutoReviewDecision;","entrypoint":"agent-harness-runtime","exportName":"ExecAutoReviewDecision","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} @@ -293,7 +293,7 @@ {"closureHash":"d8a720bf250da8daf4dc6a52087aa8728ec33b650b3ad3906fcb40e184de66a0","declaration":"export type NativeHookRelayEvent = \"pre_tool_use\" | \"post_tool_use\" | \"permission_request\" | \"before_agent_finalize\";","entrypoint":"agent-harness-runtime","exportName":"NativeHookRelayEvent","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"cb72ca18e056e52e779d0bf5b67606e1dc160f225225b55937304541105027f4","declaration":"export type NativeHookRelayProcessResponse = NativeHookRelayProcessResponse;","entrypoint":"agent-harness-runtime","exportName":"NativeHookRelayProcessResponse","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"6ee390ae4784b987e22255c16884fb4171033bbfaefaef655e3dd2a2513814a5","declaration":"export type NativeHookRelayProvider = \"codex\";","entrypoint":"agent-harness-runtime","exportName":"NativeHookRelayProvider","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} -{"closureHash":"3026ea832c52143a13ef1ddfa6428f1f284c07b9d6ca27b4a341f61885b4a171","declaration":"export type NativeHookRelayRegistrationHandle = NativeHookRelayRegistrationHandle;","entrypoint":"agent-harness-runtime","exportName":"NativeHookRelayRegistrationHandle","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} +{"closureHash":"eaf2557fd50ea67653a18b1eeb6c93671d6e2b05315f27212275b6450fc57966","declaration":"export type NativeHookRelayRegistrationHandle = NativeHookRelayRegistrationHandle;","entrypoint":"agent-harness-runtime","exportName":"NativeHookRelayRegistrationHandle","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"90fea3155b5d32c22da90460fdaea94e4fd6895d1ca18613d5036ba9835153f9","declaration":"export type NodeListNode = NodeListNode;","entrypoint":"agent-harness-runtime","exportName":"NodeListNode","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"cefe1325c866f0cf7edbec5dcca2fe420237eedc0da172e54094e365894d205d","declaration":"export type NormalizedUsage = NormalizedUsage;","entrypoint":"agent-harness-runtime","exportName":"NormalizedUsage","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} {"closureHash":"25c6985c3bef2c6efc6a96e70af6d66fe073be0b0d311681cfc0dfc186528d9a","declaration":"export type OpenClawAgentToolResult = OpenClawAgentToolResult;","entrypoint":"agent-harness-runtime","exportName":"OpenClawAgentToolResult","importSpecifier":"openclaw/plugin-sdk/agent-harness-runtime","kind":"type","recordType":"export"} @@ -321,7 +321,7 @@ {"closureHash":"ae0f930ec291a0345c4e99e247711465a5d29a8bbdd63968900fa69f382b3a78","declaration":"export function clearExpiredCooldowns(store: AuthProfileStore, now?: number): boolean;","entrypoint":"agent-runtime","exportName":"clearExpiredCooldowns","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"8f29d0208e6502b8721cf83f4c1d777fa8bd7dab4364829e94b3e9b7911b024b","declaration":"export function clearRuntimeAuthProfileStoreSnapshots(): void;","entrypoint":"agent-runtime","exportName":"clearRuntimeAuthProfileStoreSnapshots","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"5bd1a22a2fa52949d3db056103bbdaf44227a3c9f75b2b632451f9c84beb62e7","declaration":"export function ensureAuthProfileStore(agentDir?: string, options?: { allowKeychainPrompt?: boolean; config?: OpenClawConfig; externalCli?: ExternalCliAuthDiscovery; externalCliProviderIds?: Iterable; externalCliProfileIds?: Iterable; inheritedAuthDir?: string; readOnly?: boolean; syncExternalCli?: boolean; }): AuthProfileStore;","entrypoint":"agent-runtime","exportName":"ensureAuthProfileStore","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} -{"closureHash":"76c8f30e776465fd8ee9c33a042ba69d95bc73ff2e204f48890fe02b0f6967b3","declaration":"export function extractAssistantText(msg: AssistantMessage): string;","entrypoint":"agent-runtime","exportName":"extractAssistantText","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} +{"closureHash":"ebd540867ea8426b55adab693bbc67ae5f9e27f985dffbdfb47ac6b48645abe0","declaration":"export function extractAssistantText(msg: AssistantMessage): string;","entrypoint":"agent-runtime","exportName":"extractAssistantText","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"0442a4cf63e80019a759354e7110abc2470e3785780e93d716cca7396d832459","declaration":"export function findModelInCatalog(catalog: ModelCatalogEntry[], provider: string, modelId: string): ModelCatalogEntry | undefined;","entrypoint":"agent-runtime","exportName":"findModelInCatalog","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"9c27564112dd2de275d9882b7bd6492a4e200e9fe47b49c636e72486a0d9d8dd","declaration":"export function findNormalizedProviderValue(entries: Record | undefined, provider: string): T | undefined;","entrypoint":"agent-runtime","exportName":"findNormalizedProviderValue","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"c60b1693951ef119d2b7f5665db2505db610505c57ced28bfde97211e594f616","declaration":"export function findPersistedAuthProfileCredential(params: { agentDir?: string; profileId: string; }): AuthProfileStore[\"profiles\"][string] | undefined;","entrypoint":"agent-runtime","exportName":"findPersistedAuthProfileCredential","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} @@ -343,7 +343,7 @@ {"closureHash":"3ce045b2af784cfd7d86a697116758e7ace98d1275a0192c5a815b2f1a5ccd83","declaration":"export function readNonNegativeIntegerParam(params: Record, key: string, options?: { message?: string; max?: number; }): number | undefined;","entrypoint":"agent-runtime","exportName":"readNonNegativeIntegerParam","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"d32342291ad7c19b5b7066499a65a5b76c8f0e268bbb8852cb0bda67685037bf","declaration":"export function readPositiveIntegerParam(params: Record, key: string, options?: { message?: string; max?: number; }): number | undefined;","entrypoint":"agent-runtime","exportName":"readPositiveIntegerParam","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"7830262486cedbb4b8e156de295bbcea8596738742c39961e429a3cea6836e0b","declaration":"export function readStringArrayParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string[];\nexport function readStringArrayParam(params: Record, key: string, options?: StringParamOptions): string[] | undefined;","entrypoint":"agent-runtime","exportName":"readStringArrayParam","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} -{"closureHash":"1bb870618265ff3d1feb750d975fce5f5b87fe3bd9c458f056eea28933ac7092","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"agent-runtime","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} +{"closureHash":"9ec34afffcb58733bf81e79b036e4cd9fb963dd0c3b1e29758c469e4ea6a5c96","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"agent-runtime","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"9f4c4659aacb655f2e7b4421b9c9b077baea6f61c097f2c050d0e2ae395ff0c8","declaration":"export function refreshOAuthCredentialForRuntime(params: { credential: OAuthCredential; cfg?: OpenClawConfig; }): Promise;","entrypoint":"agent-runtime","exportName":"refreshOAuthCredentialForRuntime","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"cd8f2e82a8e169f1986cfd44c5271c769bc5d6d0f2c0166fc62fcd2c46689397","declaration":"export function replaceRuntimeAuthProfileStoreSnapshots(entries: Array<{ agentDir?: string; store: AuthProfileStore; }>): void;","entrypoint":"agent-runtime","exportName":"replaceRuntimeAuthProfileStoreSnapshots","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} {"closureHash":"e766fc46bf0893f80b12770ed52c6f8bb40ae69d5d60c26998f65bdeed911a11","declaration":"export function resolveAckReaction(cfg: OpenClawConfig, agentId: string, opts?: { channel?: string; accountId?: string; }): string;","entrypoint":"agent-runtime","exportName":"resolveAckReaction","importSpecifier":"openclaw/plugin-sdk/agent-runtime","kind":"function","recordType":"export"} @@ -618,7 +618,7 @@ {"closureHash":"650210a986670f4fc6928fcb58f076c28653cc5c1a7cd605120c714b589b7b14","declaration":"export function readReactionParams(params: Record, options: { emojiKey?: string; removeKey?: string; removeErrorMessage: string; }): ReactionParams;","entrypoint":"channel-actions","exportName":"readReactionParams","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} {"closureHash":"7830262486cedbb4b8e156de295bbcea8596738742c39961e429a3cea6836e0b","declaration":"export function readStringArrayParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string[];\nexport function readStringArrayParam(params: Record, key: string, options?: StringParamOptions): string[] | undefined;","entrypoint":"channel-actions","exportName":"readStringArrayParam","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} {"closureHash":"818ea0efd869633f87abb325bb187725079ffb661b088bb4661668485d4355cf","declaration":"export function readStringOrNumberParam(params: Record, key: string, options?: { required?: boolean; label?: string; }): string | undefined;","entrypoint":"channel-actions","exportName":"readStringOrNumberParam","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} -{"closureHash":"1bb870618265ff3d1feb750d975fce5f5b87fe3bd9c458f056eea28933ac7092","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"channel-actions","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} +{"closureHash":"9ec34afffcb58733bf81e79b036e4cd9fb963dd0c3b1e29758c469e4ea6a5c96","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"channel-actions","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} {"closureHash":"83fb16e40ff0dc51e79eff07c5fd30c19e72f5de3d4b37f0ea9f70acd88ea900","declaration":"export function resolvePollMaxSelections(optionCount: number, allowMultiselect: boolean | undefined): number;","entrypoint":"channel-actions","exportName":"resolvePollMaxSelections","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} {"closureHash":"4ce2ea713aa7d89aa255b8e88e5adb88905d8e08e731db424052397fbb89bea0","declaration":"export function resolveReactionMessageId(params: { args: Record; toolContext?: ReactionToolContext; }): string | number | undefined;","entrypoint":"channel-actions","exportName":"resolveReactionMessageId","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} {"closureHash":"bc4e0894807d6511076fc919718736279bb288e2046a45a27849701053d09286","declaration":"export function stringEnum(values: T, options?: StringEnumOptions): Type.TUnsafe | Type.TEnum;","entrypoint":"channel-actions","exportName":"stringEnum","importSpecifier":"openclaw/plugin-sdk/channel-actions","kind":"function","recordType":"export"} @@ -762,7 +762,7 @@ {"closureHash":"9fc7e45343d7bfbc6ed56d05c9f824e2f9cf6dafc3ca4b25437d1f65c2200727","declaration":"export function clearAccountEntryFields(params: { accounts?: Record; accountId: string; fields: string[]; isValueSet?: (value: unknown) => boolean; markClearedOnFieldPresence?: boolean; }): { nextAccounts?: Record; changed: boolean; cleared: boolean; };","entrypoint":"channel-core","exportName":"clearAccountEntryFields","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} {"closureHash":"f4e084b64b5376268885a73fe507aa5d72bee17a88ec2d7ae1d19b36ea5f1ccb","declaration":"export function createChannelConfigUiHints(params: { channelLabel: string; dmPolicy?: { channelKey: string; includeLegacyNestedPolicy?: boolean; legacyNestedPolicyOrder?: \"before\" | \"after\"; }; configWrites?: boolean; mentionPatterns?: { targetDescription: string; policyTargetDescription?: string; policyNote?: string; denyNote?: string; }; nativeCommands?: boolean; implicitMentions?: boolean; progress?: { includeCommentary?: boolean; commentaryOrder?: \"before-command\" | \"after-command\"; labels?: \"openclaw\"; titleWording?: boolean; }; streaming?: Partial>; retry?: boolean; }): HintMap;","entrypoint":"channel-core","exportName":"createChannelConfigUiHints","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} {"closureHash":"ed8c322fac76968f7f059b65eaa881098ed918b22705b27101166b052213a9d9","declaration":"export function createChatChannelPlugin(params: { base: ChatChannelPluginBase; security?: ChannelSecurityAdapter | ChatChannelSecurityOptions; pairing?: ChannelPairingAdapter | ChatChannelPairingOptions; threading?: ChannelThreadingAdapter | ChatChannelThreadingOptions; outbound?: ChannelOutboundAdapter | ChatChannelAttachedOutboundOptions; }): ChannelPlugin;","entrypoint":"channel-core","exportName":"createChatChannelPlugin","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} -{"closureHash":"ce9c9e8c168d4f87a32d87b0aba10d5a917d997e2f5e35c4ce6728ba15310dbc","declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull, registerCapabilities, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"channel-core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} +{"closureHash":"c168c97c02922332295ee07f0bd9e80cff5ed9047f05fb9824a3e6bd46bab5dc","declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull, registerCapabilities, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"channel-core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} {"closureHash":"0e0a9f6b22c433bdb1165e7707b1f9a1ddac1a544a8add00b503048cf157921f","declaration":"export function defineSetupPluginEntry(plugin: TPlugin): { plugin: TPlugin; };","entrypoint":"channel-core","exportName":"defineSetupPluginEntry","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} {"closureHash":"8895f7af11b994dcd383ebc45d8cfb3c3b1e6d88a64a001b04f604a83f77e517","declaration":"export function parseOptionalDelimitedEntries(value?: string): string[] | undefined;","entrypoint":"channel-core","exportName":"parseOptionalDelimitedEntries","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} {"closureHash":"3f97534b10d08eda6a556044eaba623b3744b200a2033877e48d2f2ca924d298","declaration":"export function recoverCurrentThreadSessionId(params: { route: ChannelOutboundSessionRoute; currentSessionKey?: string | null; canRecover?: (context: ThreadAwareOutboundSessionRouteRecoveryContext) => boolean; }): string | undefined;","entrypoint":"channel-core","exportName":"recoverCurrentThreadSessionId","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"function","recordType":"export"} @@ -774,24 +774,24 @@ {"closureHash":"8126b651a679d5435eaa5d346916792c3600e5f0f75d8492b077dd361854f7dd","declaration":"export type ChannelOutboundSessionRouteParams = { cfg: OpenClawConfig; agentId: string; accountId?: string | null; target: string; currentSessionKey?: string; resolvedTarget?: { to: string; kind: ChannelDirectoryEntryKind | \"channel\"; display?: string; source: \"normalized\" | \"directory\"; }; replyToId?: string | null; threadId?: string | number | null;};","entrypoint":"channel-core","exportName":"ChannelOutboundSessionRouteParams","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} {"closureHash":"37b373e93fe7f86fdbce119947c9e49b17e71ce50fe47e118c4d078c5cea20ec","declaration":"export type ChannelPlugin = ChannelPlugin;","entrypoint":"channel-core","exportName":"ChannelPlugin","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} {"closureHash":"8054ffbe71b91afced900ef8a06f5e368ac10c4f99ffc1c6f538a802856f61c6","declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"channel-core","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} {"closureHash":"86553d1dbbbe0b04d6a233ab33dee847c2cf5f9809032d41c5bff6bec06b78da","declaration":"export type PluginCommandContext = PluginCommandContext;","entrypoint":"channel-core","exportName":"PluginCommandContext","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} {"closureHash":"4180509522e17f8afdf5014bc51f5601952dfa403503e66f8f53e92b0c6ddd45","declaration":"export type PluginRuntime = PluginRuntime;","entrypoint":"channel-core","exportName":"PluginRuntime","importSpecifier":"openclaw/plugin-sdk/channel-core","kind":"type","recordType":"export"} {"category":"channel","entrypoint":"channel-dm-policy","importSpecifier":"openclaw/plugin-sdk/channel-dm-policy","recordType":"module"} {"closureHash":"821fe6ccd0d9323322bf70c4d1ca5697071a0e32032f44c1e14157162c2c729d","declaration":"export function createChannelDmPolicy(params: CreateChannelDmPolicyParams): ChannelSetupDmPolicy & { promptAllowFrom: NonNullable; };","entrypoint":"channel-dm-policy","exportName":"createChannelDmPolicy","importSpecifier":"openclaw/plugin-sdk/channel-dm-policy","kind":"function","recordType":"export"} {"category":null,"entrypoint":"channel-entry-contract","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","recordType":"module"} -{"closureHash":"1d424a5413b9e7f29440f748416ad227ea8a00c33fcea1a039d749c492673289","declaration":"export function defineBundledChannelEntry({ id, name, description, importMetaUrl, plugin, outbound, secrets, configSchema, runtime, accountInspect, features, registerCliMetadata, registerFull, registerCapabilities, }: DefineBundledChannelEntryOptions): BundledChannelEntryContract;","entrypoint":"channel-entry-contract","exportName":"defineBundledChannelEntry","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"function","recordType":"export"} -{"closureHash":"068956e11ec24ed43f2c259ddd62503f71ff39b4c51626f9597274cb62786478","declaration":"export function defineBundledChannelSetupEntry({ importMetaUrl, plugin, secrets, runtime, legacyStateMigrations, legacySessionSurface, registerSetupRuntime, features, }: DefineBundledChannelSetupEntryOptions): BundledChannelSetupEntryContract;","entrypoint":"channel-entry-contract","exportName":"defineBundledChannelSetupEntry","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"function","recordType":"export"} +{"closureHash":"d85ca5b27543b7e5106cdc31dc11fc776505c22cd79448d70bd1813b3b302041","declaration":"export function defineBundledChannelEntry({ id, name, description, importMetaUrl, plugin, outbound, secrets, configSchema, runtime, accountInspect, features, registerCliMetadata, registerFull, registerCapabilities, }: DefineBundledChannelEntryOptions): BundledChannelEntryContract;","entrypoint":"channel-entry-contract","exportName":"defineBundledChannelEntry","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"function","recordType":"export"} +{"closureHash":"f098e62192fea9990f2b283199f8ab363df7702f124fe89b62ce1c6611eca85e","declaration":"export function defineBundledChannelSetupEntry({ importMetaUrl, plugin, secrets, runtime, legacyStateMigrations, legacySessionSurface, registerSetupRuntime, features, }: DefineBundledChannelSetupEntryOptions): BundledChannelSetupEntryContract;","entrypoint":"channel-entry-contract","exportName":"defineBundledChannelSetupEntry","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"function","recordType":"export"} {"closureHash":"cd150287d7e286e7a0d7d6caeb05d0a1efa63b5f351f75f69ba932510a108afd","declaration":"export function loadBundledEntryExportSync(importMetaUrl: string, reference: BundledEntryModuleRef, options?: BundledEntryModuleLoadOptions): T;","entrypoint":"channel-entry-contract","exportName":"loadBundledEntryExportSync","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"function","recordType":"export"} {"closureHash":"7781a3d570d08929af5b3b6cffbb9ef4b9c8e8f1bed55234e0015a681868c812","declaration":"export type AnyAgentTool = AnyAgentTool;","entrypoint":"channel-entry-contract","exportName":"AnyAgentTool","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} -{"closureHash":"96a454f6a7accfc5955eca5e31b6554fbaa4b128c74990913b949626037aba74","declaration":"export type BundledChannelEntryContract = BundledChannelEntryContract;","entrypoint":"channel-entry-contract","exportName":"BundledChannelEntryContract","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} +{"closureHash":"f5a2f6cf7dbda0eba0aa53a66a6ffc41a6b9d3d029e77e3d260ad744b7c57a45","declaration":"export type BundledChannelEntryContract = BundledChannelEntryContract;","entrypoint":"channel-entry-contract","exportName":"BundledChannelEntryContract","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"f4b82dfd995bd6f08b232984743389d1c854866cb845a8dbb3605acb28818688","declaration":"export type BundledChannelEntryFeatures = BundledChannelEntryFeatures;","entrypoint":"channel-entry-contract","exportName":"BundledChannelEntryFeatures","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"960693591b9bdc974bf3f0097076d90490078db3dceb35349a4f851736cde4fc","declaration":"export type BundledChannelLegacySessionSurface = BundledChannelLegacySessionSurface;","entrypoint":"channel-entry-contract","exportName":"BundledChannelLegacySessionSurface","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"edf79e6a736e5c4977e3b86ef21e7fdf0c0b2bc7deacd8edbee2ca76cb8cef43","declaration":"export type BundledChannelLegacyStateMigrationDetector = BundledChannelLegacyStateMigrationDetector;","entrypoint":"channel-entry-contract","exportName":"BundledChannelLegacyStateMigrationDetector","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} -{"closureHash":"fd433c4c8cd02dfdf094953efca2f9b8239ea906dd046f40b74e68d6f5bc28b7","declaration":"export type BundledChannelSetupEntryContract = BundledChannelSetupEntryContract;","entrypoint":"channel-entry-contract","exportName":"BundledChannelSetupEntryContract","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} +{"closureHash":"b0aea7eaff08b2da8ea1c7a6c5f52da83bcc3d488a68689656b693fdfcad6099","declaration":"export type BundledChannelSetupEntryContract = BundledChannelSetupEntryContract;","entrypoint":"channel-entry-contract","exportName":"BundledChannelSetupEntryContract","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"24679ecdf2ff34157b6345a37b58ec1363ec8cb1969b522599d0d92bb7a113b7","declaration":"export type BundledChannelSetupEntryFeatures = BundledChannelSetupEntryFeatures;","entrypoint":"channel-entry-contract","exportName":"BundledChannelSetupEntryFeatures","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"367219c821915e5be4d1ba3a86754475a5f8a4194512f0401de3be11cc649c60","declaration":"export type BundledEntryModuleLoadOptions = BundledEntryModuleLoadOptions;","entrypoint":"channel-entry-contract","exportName":"BundledEntryModuleLoadOptions","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} -{"closureHash":"a314e825c2d1c948accf7d7b17af39ddfa85c43bccfd545051713bc7ab5b2704","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-entry-contract","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} +{"closureHash":"628ea7da08d0fb757509859ce690d9501dc1ff9caa48b0e22852f2b8d11a9799","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-entry-contract","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"e54f9b270df967e0f857de804dbe989f2c55b637c449c9948c4baae8eee18c7b","declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"channel-entry-contract","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"closureHash":"568b5ab033b4970cedd3916d948d31bcdd3c19ea8928c7cd7dc7abf7623b8af8","declaration":"export type PluginCommandContext = PluginCommandContext;","entrypoint":"channel-entry-contract","exportName":"PluginCommandContext","importSpecifier":"openclaw/plugin-sdk/channel-entry-contract","kind":"type","recordType":"export"} {"category":null,"entrypoint":"channel-feedback","importSpecifier":"openclaw/plugin-sdk/channel-feedback","recordType":"module"} @@ -1103,7 +1103,7 @@ {"closureHash":"9555a73ba2717bba0bf94888017be4cecef2c51cc3887ed34f8d8ef3c79d6abf","declaration":"export const DEFAULT_INGRESS_RETRY_DEAD_LETTER_MIN_AGE_MS: number;","entrypoint":"channel-message","exportName":"DEFAULT_INGRESS_RETRY_DEAD_LETTER_MIN_AGE_MS","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"const","recordType":"export"} {"closureHash":"3a2df3ab656149630c004d2d9f71b8ceda99aa81eb6b72b0cc7b3982ed0ce044","declaration":"export const DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS: 8;","entrypoint":"channel-message","exportName":"DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"const","recordType":"export"} {"closureHash":"38c735a14c65067aa7825390d1c5c8876c651d0603e84980dfaf947f5235747a","declaration":"export const INGRESS_CLAIM_PROCESS_ID: string;","entrypoint":"channel-message","exportName":"INGRESS_CLAIM_PROCESS_ID","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"const","recordType":"export"} -{"closureHash":"4ce46d95ad5a8623c0a3c0621b7d977a25280b4a983d62efdf02bfd140ea8da0","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"channel-message","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"const","recordType":"export"} +{"closureHash":"ddd39cfe6429b13a4870786c9366346cf7170f017eda88fad42314bba3301237","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"channel-message","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"const","recordType":"export"} {"closureHash":"2c52eff200a5b9bd2d93ee72209c2626bbe165f59b538591db661b94773023b0","declaration":"export type AgentPlanStep = AgentPlanStep;","entrypoint":"channel-message","exportName":"AgentPlanStep","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"type","recordType":"export"} {"closureHash":"1e8bcb2c8d8f5327f5b81b8c217f722f090dccba21ba3943324010f4f80a5a50","declaration":"export type AgentPlanStepStatus = AgentPlanStepStatus;","entrypoint":"channel-message","exportName":"AgentPlanStepStatus","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"type","recordType":"export"} {"closureHash":"b036fc26e5330dfd7da1af8839bb3c23e85283b9e16e252a659dd4bb0c35cd5e","declaration":"export type ChannelDeliveryStreamingConfig = ChannelDeliveryStreamingConfig;","entrypoint":"channel-message","exportName":"ChannelDeliveryStreamingConfig","importSpecifier":"openclaw/plugin-sdk/channel-message","kind":"type","recordType":"export"} @@ -1232,7 +1232,7 @@ {"closureHash":"9555a73ba2717bba0bf94888017be4cecef2c51cc3887ed34f8d8ef3c79d6abf","declaration":"export const DEFAULT_INGRESS_RETRY_DEAD_LETTER_MIN_AGE_MS: number;","entrypoint":"channel-outbound","exportName":"DEFAULT_INGRESS_RETRY_DEAD_LETTER_MIN_AGE_MS","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"const","recordType":"export"} {"closureHash":"3a2df3ab656149630c004d2d9f71b8ceda99aa81eb6b72b0cc7b3982ed0ce044","declaration":"export const DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS: 8;","entrypoint":"channel-outbound","exportName":"DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"const","recordType":"export"} {"closureHash":"38c735a14c65067aa7825390d1c5c8876c651d0603e84980dfaf947f5235747a","declaration":"export const INGRESS_CLAIM_PROCESS_ID: string;","entrypoint":"channel-outbound","exportName":"INGRESS_CLAIM_PROCESS_ID","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"const","recordType":"export"} -{"closureHash":"4ce46d95ad5a8623c0a3c0621b7d977a25280b4a983d62efdf02bfd140ea8da0","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"channel-outbound","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"const","recordType":"export"} +{"closureHash":"ddd39cfe6429b13a4870786c9366346cf7170f017eda88fad42314bba3301237","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"channel-outbound","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"const","recordType":"export"} {"closureHash":"2c52eff200a5b9bd2d93ee72209c2626bbe165f59b538591db661b94773023b0","declaration":"export type AgentPlanStep = AgentPlanStep;","entrypoint":"channel-outbound","exportName":"AgentPlanStep","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"type","recordType":"export"} {"closureHash":"1e8bcb2c8d8f5327f5b81b8c217f722f090dccba21ba3943324010f4f80a5a50","declaration":"export type AgentPlanStepStatus = AgentPlanStepStatus;","entrypoint":"channel-outbound","exportName":"AgentPlanStepStatus","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"type","recordType":"export"} {"closureHash":"b036fc26e5330dfd7da1af8839bb3c23e85283b9e16e252a659dd4bb0c35cd5e","declaration":"export type ChannelDeliveryStreamingConfig = ChannelDeliveryStreamingConfig;","entrypoint":"channel-outbound","exportName":"ChannelDeliveryStreamingConfig","importSpecifier":"openclaw/plugin-sdk/channel-outbound","kind":"type","recordType":"export"} @@ -1298,7 +1298,7 @@ {"closureHash":"cd6b0d3f962c8cb40d405e92bb06bb8e9285b386200897f550d21036022262c1","declaration":"export const PAIRING_APPROVED_MESSAGE: \"✅ OpenClaw access approved. Send a message to start chatting.\";","entrypoint":"channel-plugin-common","exportName":"PAIRING_APPROVED_MESSAGE","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"const","recordType":"export"} {"closureHash":"712435252d2fe5135542ca6b5a4375a6edea24e83829338011dc6ae7e9802fbb","declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"channel-plugin-common","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"type","recordType":"export"} {"closureHash":"37b373e93fe7f86fdbce119947c9e49b17e71ce50fe47e118c4d078c5cea20ec","declaration":"export type ChannelPlugin = ChannelPlugin;","entrypoint":"channel-plugin-common","exportName":"ChannelPlugin","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-plugin-common","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"channel-plugin-common","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"type","recordType":"export"} {"closureHash":"4180509522e17f8afdf5014bc51f5601952dfa403503e66f8f53e92b0c6ddd45","declaration":"export type PluginRuntime = PluginRuntime;","entrypoint":"channel-plugin-common","exportName":"PluginRuntime","importSpecifier":"openclaw/plugin-sdk/channel-plugin-common","kind":"type","recordType":"export"} {"category":null,"entrypoint":"channel-policy","importSpecifier":"openclaw/plugin-sdk/channel-policy","recordType":"module"} {"closureHash":"017ab29d16d0f3d02d60f3513e65a373868d26496bc93d020d8fc8c17fd875f4","declaration":"export function buildAccountScopedDmSecurityPolicy(params: { cfg: OpenClawConfig; channelKey: string; accountId?: string | null; fallbackAccountId?: string | null; policy?: string | null; allowFrom?: Array | null; defaultPolicy?: string; allowFromPathSuffix?: string; policyPathSuffix?: string; approveChannelId?: string; approveHint?: string; normalizeEntry?: (raw: string) => string; inheritSharedDefaultsFromDefaultAccount?: boolean; }): ChannelSecurityDmPolicy;","entrypoint":"channel-policy","exportName":"buildAccountScopedDmSecurityPolicy","importSpecifier":"openclaw/plugin-sdk/channel-policy","kind":"function","recordType":"export"} @@ -1897,8 +1897,8 @@ {"closureHash":"ed8c322fac76968f7f059b65eaa881098ed918b22705b27101166b052213a9d9","declaration":"export function createChatChannelPlugin(params: { base: ChatChannelPluginBase; security?: ChannelSecurityAdapter | ChatChannelSecurityOptions; pairing?: ChannelPairingAdapter | ChatChannelPairingOptions; threading?: ChannelThreadingAdapter | ChatChannelThreadingOptions; outbound?: ChannelOutboundAdapter | ChatChannelAttachedOutboundOptions; }): ChannelPlugin;","entrypoint":"core","exportName":"createChatChannelPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"785b0f750c5bd20f9f3ca081886a5af79ee0e4d2c38f78f769bf994b234f5076","declaration":"export function createDedupeCache(options: DedupeCacheOptions): DedupeCache;","entrypoint":"core","exportName":"createDedupeCache","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"e2df8d235401aebf58eb71652fbeaedb42ca00aaa5042a76909ff2c48ba6fd54","declaration":"export function createSubsystemLogger(subsystem: string): SubsystemLogger;","entrypoint":"core","exportName":"createSubsystemLogger","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} -{"closureHash":"ce9c9e8c168d4f87a32d87b0aba10d5a917d997e2f5e35c4ce6728ba15310dbc","declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull, registerCapabilities, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} -{"closureHash":"e9633b4ca148dc6289c61a1d85b0e34cb244d926badbf4a591302267c691e62a","declaration":"export function definePluginEntry({ id, name, description, kind, configSchema, reload, nodeHostCommands, securityAuditCollectors, register, }: DefinePluginEntryOptions): DefinedPluginEntry;","entrypoint":"core","exportName":"definePluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} +{"closureHash":"c168c97c02922332295ee07f0bd9e80cff5ed9047f05fb9824a3e6bd46bab5dc","declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull, registerCapabilities, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} +{"closureHash":"c5135d933f690abcdf9cb6bd02dc8c3913d6b0db458fbba9ba7fb7e891a1d30b","declaration":"export function definePluginEntry({ id, name, description, kind, configSchema, reload, nodeHostCommands, securityAuditCollectors, register, }: DefinePluginEntryOptions): DefinedPluginEntry;","entrypoint":"core","exportName":"definePluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"0e0a9f6b22c433bdb1165e7707b1f9a1ddac1a544a8add00b503048cf157921f","declaration":"export function defineSetupPluginEntry(plugin: TPlugin): { plugin: TPlugin; };","entrypoint":"core","exportName":"defineSetupPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"3c5ce0c3733cbb038aeb914af1df5d701f362f0521921b8abd0c9214db9cc4b8","declaration":"export function delegateCompactionToRuntime(params: Parameters[0]): Promise;","entrypoint":"core","exportName":"delegateCompactionToRuntime","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"2c282e0e308f9442bca7cdeb8e89a097531b1d54a692c9d86e5f39a8db1c2537","declaration":"export function deleteAccountFromConfigSection(params: { cfg: OpenClawConfig; sectionKey: string; accountId: string; clearBaseFields?: string[]; }): OpenClawConfig;","entrypoint":"core","exportName":"deleteAccountFromConfigSection","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} @@ -1927,7 +1927,7 @@ {"closureHash":"650210a986670f4fc6928fcb58f076c28653cc5c1a7cd605120c714b589b7b14","declaration":"export function readReactionParams(params: Record, options: { emojiKey?: string; removeKey?: string; removeErrorMessage: string; }): ReactionParams;","entrypoint":"core","exportName":"readReactionParams","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":null,"declaration":"export function readSecretFileSync(filePath: string, label: string, options?: SecretFileReadOptions): string;","entrypoint":"core","exportName":"readSecretFileSync","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"7830262486cedbb4b8e156de295bbcea8596738742c39961e429a3cea6836e0b","declaration":"export function readStringArrayParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string[];\nexport function readStringArrayParam(params: Record, key: string, options?: StringParamOptions): string[] | undefined;","entrypoint":"core","exportName":"readStringArrayParam","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} -{"closureHash":"1bb870618265ff3d1feb750d975fce5f5b87fe3bd9c458f056eea28933ac7092","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"core","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} +{"closureHash":"9ec34afffcb58733bf81e79b036e4cd9fb963dd0c3b1e29758c469e4ea6a5c96","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"core","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"3f97534b10d08eda6a556044eaba623b3744b200a2033877e48d2f2ca924d298","declaration":"export function recoverCurrentThreadSessionId(params: { route: ChannelOutboundSessionRoute; currentSessionKey?: string | null; canRecover?: (context: ThreadAwareOutboundSessionRouteRecoveryContext) => boolean; }): string | undefined;","entrypoint":"core","exportName":"recoverCurrentThreadSessionId","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"a8c46f142302860a8a054178f828da385f8f1f5449a4e320c3fbb49780ac42ed","declaration":"export function resolveClientIp(params: { remoteAddr?: string; forwardedFor?: string; realIp?: string; trustedProxies?: string[]; allowRealIpFallback?: boolean; }): string | undefined;","entrypoint":"core","exportName":"resolveClientIp","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"79d92f4fb2ad64711f9bab6b2ccede5fa213833f84738a610db53a34c41a1245","declaration":"export function resolveConfiguredAcpBindingRecord(params: { cfg: OpenClawConfig; channel: string; accountId: string; conversationId: string; parentConversationId?: string; }): ResolvedConfiguredAcpBinding | null;","entrypoint":"core","exportName":"resolveConfiguredAcpBindingRecord","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} @@ -1945,7 +1945,7 @@ {"closureHash":"2e6ce1f4c1692270a00dc0cf08e2752a26739c3143f8091cb270063c6034605d","declaration":"export function tryReadSecretFileSync(filePath: string | undefined, label: string, options: CredentialFileReadOptions): string | undefined;\nexport function tryReadSecretFileSync(filePath: string | undefined, label: string, options?: FsSafeSecretFileReadOptions): string | undefined;\nexport function tryReadSecretFileSync(filePath: string, label: string, options: FsSafeSecretFileReadOptions | undefined, diagnostic: { configPath: string; }): ConfiguredCredentialResult;\nexport function tryReadSecretFileSync(filePath: string | undefined, label: string, options: FsSafeSecretFileReadOptions | undefined, diagnostic: { configPath: string; }): CredentialResult;","entrypoint":"core","exportName":"tryReadSecretFileSync","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export"} {"closureHash":"b40933a11984425d14a7a479bda0d2cd14cbfa9371164774f39bebbf12861df7","declaration":"export const DEFAULT_ACCOUNT_ID: \"default\";","entrypoint":"core","exportName":"DEFAULT_ACCOUNT_ID","importSpecifier":"openclaw/plugin-sdk/core","kind":"const","recordType":"export"} {"closureHash":null,"declaration":"export const DEFAULT_SECRET_FILE_MAX_BYTES: number;","entrypoint":"core","exportName":"DEFAULT_SECRET_FILE_MAX_BYTES","importSpecifier":"openclaw/plugin-sdk/core","kind":"const","recordType":"export"} -{"closureHash":"89d1232faa739ea7bb8b305d5e92ff1057759b833cd9994ef0923634234741e7","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"core","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} +{"closureHash":"49e181db775c3ee735cef6900062306c81f598b8a5b696379e55a21f3b011741","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"core","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"d2ff4de9ee3fd111c2cc64a3ee7e557d9f161af1b6b437ee7886bcb16e426317","declaration":"export type AgentPromptGuidance = AgentPromptGuidance;","entrypoint":"core","exportName":"AgentPromptGuidance","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"2841127a90e04467adfea8126cbf03655f44ddb089ad9e0d48833c2beea39cbd","declaration":"export type AgentPromptGuidanceEntry = AgentPromptGuidanceEntry;","entrypoint":"core","exportName":"AgentPromptGuidanceEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"aa0412acefe62caff12e5271ead0545504874e824380dc21cfc0566388a05f33","declaration":"export type AgentPromptSurfaceKind = \"openclaw_main\" | \"pi_main\" | \"codex_app_server\" | \"cli_backend\" | \"acp_backend\" | \"subagent\";","entrypoint":"core","exportName":"AgentPromptSurfaceKind","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} @@ -1977,10 +1977,10 @@ {"closureHash":"54ea426dde51859b572b4c1079d2b70b412096f73da2b8c265f2749d9f01cbb5","declaration":"export type NormalizedLocation = NormalizedLocation;","entrypoint":"core","exportName":"NormalizedLocation","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"8054ffbe71b91afced900ef8a06f5e368ac10c4f99ffc1c6f538a802856f61c6","declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"core","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"5189698d102b8b064eefe1442b008312973c3994fd6b203d2205725d7ee9d118","declaration":"export type OpenClawPluginActiveModelContext = OpenClawPluginActiveModelContext;","entrypoint":"core","exportName":"OpenClawPluginActiveModelContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"c968e96cdb5c97e92d26b7b15fb5255531b45a12e7c5c0a2e7e456d31cc6e358","declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"core","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"365beb5cee974639c2f35fc7a39088721ca8e9c618442830298b98033e9c768c","declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"core","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} -{"closureHash":"9303ba80fdfee2f9fae041231bc7482ae3dffcc8d451f1862aac7fc1c2a8b8f2","declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"core","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} +{"closureHash":"1b2636e3bd55c40a8911396cf70dbca69bc43e50dfc13003266def91c69f50da","declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"core","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"a7ed83f0924f818b23cecb5a1f3591ff28b9499ccac9667a2b8505c2bc608ea9","declaration":"export type OpenClawPluginGatewayEventScope = OpenClawPluginGatewayEventScope;","entrypoint":"core","exportName":"OpenClawPluginGatewayEventScope","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"f81f224d9b837e6353b7a546c5a76b124bcf568fd1f1fd0c6881fda30c53120a","declaration":"export type OpenClawPluginGatewayEvents = OpenClawPluginGatewayEvents;","entrypoint":"core","exportName":"OpenClawPluginGatewayEvents","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} {"closureHash":"ddc2738dd0ece94ddde9a7c655f92c15ec6416645ecf932d4aa404c7b7761159","declaration":"export type OpenClawPluginService = OpenClawPluginService;","entrypoint":"core","exportName":"OpenClawPluginService","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export"} @@ -2215,7 +2215,7 @@ {"closureHash":"0db968dad99d84ecef5202167daadd092e3b4f456270283d3fd61585ac2bbd5a","declaration":"export type DiscordComponentSendResult = DiscordComponentSendResult;","entrypoint":"discord","exportName":"DiscordComponentSendResult","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} {"closureHash":"084b46d7dd510eb182a4705559251e824220b57dbfa6dc54392507b72ba1815e","declaration":"export type DiscordOutboundTargetResolution = DiscordOutboundTargetResolution;","entrypoint":"discord","exportName":"DiscordOutboundTargetResolution","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} {"closureHash":"8054ffbe71b91afced900ef8a06f5e368ac10c4f99ffc1c6f538a802856f61c6","declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"discord","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"discord","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"discord","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} {"closureHash":"4180509522e17f8afdf5014bc51f5601952dfa403503e66f8f53e92b0c6ddd45","declaration":"export type PluginRuntime = PluginRuntime;","entrypoint":"discord","exportName":"PluginRuntime","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} {"closureHash":"6b9967e919c1cd420c8356b4f9d40dbc81932b4b15a733eecdcfb2ad84f8e5d8","declaration":"export type ResolvedDiscordAccount = ResolvedDiscordAccount;","entrypoint":"discord","exportName":"ResolvedDiscordAccount","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} {"closureHash":"6bed5ca896b7034117e4757e2c6b4111dd5293dbad9416e3828dd6afa4e858ce","declaration":"export type ThreadBindingRecord = ThreadBindingRecord;","entrypoint":"discord","exportName":"ThreadBindingRecord","importSpecifier":"openclaw/plugin-sdk/discord","kind":"type","recordType":"export"} @@ -2360,7 +2360,7 @@ {"closureHash":"98e0cc16352b7dfcceb4957f8cd2acfe3c2b3acb223c42a5cfb885e088fcb04c","declaration":"export function resolveInboundReplyDispatchCounts(result: ChannelTurnDispatchResultLike): Record;","entrypoint":"inbound-reply-dispatch","exportName":"resolveInboundReplyDispatchCounts","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"function","recordType":"export"} {"closureHash":"4cd63266d379acc2cdf9aba02f50b8ceb55500cf820787c370fc98d173fb1950","declaration":"export function runChannelInboundEvent(params: RunChannelTurnParams): Promise>;\nexport function runChannelInboundEvent(params: ChannelInboundEventRunnerParams): Promise>;","entrypoint":"inbound-reply-dispatch","exportName":"runChannelInboundEvent","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"function","recordType":"export"} {"closureHash":"2c68496a174872b31aaf1ac8fad2789deb79d490c5ffbcb157325f1c95d1b51f","declaration":"export function runPreparedInboundReply(params: PreparedChannelTurn): Promise>;","entrypoint":"inbound-reply-dispatch","exportName":"runPreparedInboundReply","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"function","recordType":"export"} -{"closureHash":"4ce46d95ad5a8623c0a3c0621b7d977a25280b4a983d62efdf02bfd140ea8da0","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"inbound-reply-dispatch","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"const","recordType":"export"} +{"closureHash":"ddd39cfe6429b13a4870786c9366346cf7170f017eda88fad42314bba3301237","declaration":"export const deliverInboundReplyWithMessageSendContext: (params: DurableInboundReplyDeliveryParams) => Promise<{ status: \"not_applicable\"; reason: \"non_final\";} | { status: \"unsupported\"; reason: \"missing_channel\" | \"missing_target\" | \"missing_outbound_handler\" | \"capability_mismatch\"; capability?: DurableFinalDeliveryRequirement;} | { status: \"handled_visible\"; delivery: ChannelDeliveryResult;} | { status: \"handled_no_send\"; reason: \"no_visible_result\"; delivery: ChannelDeliveryResult;} | { status: \"failed\"; error: unknown; sentBeforeError?: true;}>;","entrypoint":"inbound-reply-dispatch","exportName":"deliverInboundReplyWithMessageSendContext","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"const","recordType":"export"} {"closureHash":"ab30d0470348e3af7c18a273afc0d169d91f204fba557c75c4694e8a0ea6c936","declaration":"export type AssembledInboundReply = AssembledChannelTurn;","entrypoint":"inbound-reply-dispatch","exportName":"AssembledInboundReply","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"type","recordType":"export"} {"closureHash":"3de0d6d1bb8f9a83bd1c6e57aa8618e3fea71054236cd530c555e348bd0b7702","declaration":"export type ChannelBotLoopProtectionFacts = ChannelBotLoopProtectionFacts;","entrypoint":"inbound-reply-dispatch","exportName":"ChannelBotLoopProtectionFacts","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"type","recordType":"export"} {"closureHash":"f0da845bbdf49b30f6718a4b7ff012a0536deb98f65418583555dc90825797ca","declaration":"export type ChannelInboundDroppedHistoryOptions = ChannelTurnDroppedHistoryOptions;","entrypoint":"inbound-reply-dispatch","exportName":"ChannelInboundDroppedHistoryOptions","importSpecifier":"openclaw/plugin-sdk/inbound-reply-dispatch","kind":"type","recordType":"export"} @@ -3195,19 +3195,19 @@ {"closureHash":"3362ea0b650933db6db467ef8ae1c82e682e946761647c8dfae401eec1237bd6","declaration":"export function callMeetingBrowserProxyOnNode(params: { runtime: PluginRuntime; adapter: NodeAdapter; nodeId: string; } & MeetingBrowserRequestParams): Promise;","entrypoint":"meeting-runtime","exportName":"callMeetingBrowserProxyOnNode","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"c5fcd1d157edcb4773235adfaf8051e3ec7ca428cb7916b6d55f2511affab56c","declaration":"export function convertMeetingBridgeAudioForStt(audio: Buffer, audioFormat: MeetingRealtimeAudioFormat): Buffer;","entrypoint":"meeting-runtime","exportName":"convertMeetingBridgeAudioForStt","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"aa9063c27c5ff714d3653571c4a2a71e9d2eea5609b161f03e4738e15411358b","declaration":"export function convertMeetingTtsAudioForBridge(audio: Buffer, sampleRate: number, audioFormat: MeetingRealtimeAudioFormat, outputFormat?: string, platformName?: string): Buffer;","entrypoint":"meeting-runtime","exportName":"convertMeetingTtsAudioForBridge","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"21c4eeafbcb8b35075e631d13184777bb1f9e1f5cb0d2316ed62d74de48e898a","declaration":"export function createLocalMeetingRealtimeAudioTransport(params: { inputCommand: string[]; outputCommand: string[]; bargeInInputCommand?: string[]; bargeInRmsThreshold: number; bargeInPeakThreshold: number; bargeInCooldownMs: number; logger: RuntimeLogger; logScope: string; audioFormat?: MeetingRealtimeAudioFormat; spawn?: MeetingRealtimeAudioSpawn; }): MeetingRealtimeAudioTransport;","entrypoint":"meeting-runtime","exportName":"createLocalMeetingRealtimeAudioTransport","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"df8c4f7f73fb734fba28be92cce6b67f6ce4e57a6f90729835c2f40762ba9266","declaration":"export function createLocalMeetingRealtimeAudioTransport(params: { inputCommand: string[]; outputCommand: string[]; bargeInInputCommand?: string[]; bargeInRmsThreshold: number; bargeInPeakThreshold: number; bargeInCooldownMs: number; logger: RuntimeLogger; logScope: string; audioFormat?: MeetingRealtimeAudioFormat; spawn?: MeetingRealtimeAudioSpawn; }): MeetingRealtimeAudioTransport;","entrypoint":"meeting-runtime","exportName":"createLocalMeetingRealtimeAudioTransport","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"0f81bc377d2158b9c8adb6878e454f34c2e57d53bdef9aa34d567d279800c240","declaration":"export function createMeetingBrowserNodeCaller(params: { runtime: PluginRuntime; adapter: NodeAdapter; nodeId: string; }): MeetingBrowserRequestCaller;","entrypoint":"meeting-runtime","exportName":"createMeetingBrowserNodeCaller","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"f244ca8c47f556c9f388953cf9a7581c7d4d413af93e0dfa1462779e6a687a7c","declaration":"export function createMeetingBrowserNodeInvokePolicy(options: MeetingBrowserNodePolicyOptions): OpenClawPluginNodeInvokePolicy;","entrypoint":"meeting-runtime","exportName":"createMeetingBrowserNodeInvokePolicy","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"1aa4e3ff39a2cbe162421c62b1fa4a362973381d4d9ff15c671249b1ebd566bc","declaration":"export function createMeetingNodeHost(options: MeetingNodeHostOptions): { handleCommand(paramsJSON?: string | null): Promise; };","entrypoint":"meeting-runtime","exportName":"createMeetingNodeHost","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"c1ae05a3adf32d70779697f7f268b446587dacdd61492fb577b77d964ec3ea49","declaration":"export function createMeetingRealtimeEngineBindings(params: { platform: MeetingPlatformRuntimeMetadata; config: { realtime: { agentId?: string; toolPolicy: RealtimeVoiceAgentConsultToolPolicy; }; }; fullConfig: OpenClawConfig; runtime: PluginRuntime; logger: RuntimeLogger; }): { platform: MeetingRuntimePlatform; consultAgent: (consult: MeetingAgentConsultParams) => Promise<{ text: string; }>; tools: RealtimeVoiceTool[]; handleToolCall: (call: MeetingRealtimeToolCallParams) => Promise; };","entrypoint":"meeting-runtime","exportName":"createMeetingRealtimeEngineBindings","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"63dd9c3c8c280b7fcefc2b80ff5eea3a7c643be30e8e60097938a65078c3ac38","declaration":"export function createMeetingRealtimeEngineBindings(params: { platform: MeetingPlatformRuntimeMetadata; config: { realtime: { agentId?: string; toolPolicy: RealtimeVoiceAgentConsultToolPolicy; }; }; fullConfig: OpenClawConfig; runtime: PluginRuntime; logger: RuntimeLogger; }): { platform: MeetingRuntimePlatform; consultAgent: (consult: MeetingAgentConsultParams) => Promise<{ text: string; }>; tools: RealtimeVoiceTool[]; handleToolCall: (call: MeetingRealtimeToolCallParams) => Promise; };","entrypoint":"meeting-runtime","exportName":"createMeetingRealtimeEngineBindings","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"9124db05923060c467edb149bd8abdc8be1d00d00f867cf84600972923a58489","declaration":"export function createMeetingSession(params: { platform: MeetingPlatformRuntimeMetadata; config: { realtime: { provider?: string; voiceProvider?: string; transcriptionProvider?: string; model?: string; toolPolicy: TToolPolicy; }; }; resolved: MeetingResolvedJoin; createdAt: string; }): MeetingSessionRecord;","entrypoint":"meeting-runtime","exportName":"createMeetingSession","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"fb276e07e395ab19177b3d7967fd0a8fcda79130883f15092a4a306b826481b9","declaration":"export function createMeetingSetupStatus(checks: MeetingSetupCheck[]): MeetingSetupStatus;","entrypoint":"meeting-runtime","exportName":"createMeetingSetupStatus","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"0457ac9dc4b0b2d11cdbe2070d75ae2e5c2fe5cee69017e92f849849cd06b0f3","declaration":"export function createMeetingVoiceCallGateway(params: { config: MeetingVoiceCallConfig; runtime: PluginRuntime; surface: MeetingVoiceCallSurface; connectClient: (params: { config: MeetingVoiceCallConfig; surface: MeetingVoiceCallSurface; }) => Promise; }): MeetingVoiceCallGateway;","entrypoint":"meeting-runtime","exportName":"createMeetingVoiceCallGateway","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"d15a559cde246e88f545db50addd2146b581642726e9a8a2ddecaa21cc332c71","declaration":"export function createNodeMeetingRealtimeAudioTransport(params: { runtime: PluginRuntime; nodeId: string; bridgeId: string; logger: RuntimeLogger; commandName: string; logScope: string; logPrefix: string; audioFormat?: MeetingRealtimeAudioFormat; }): MeetingRealtimeAudioTransport;","entrypoint":"meeting-runtime","exportName":"createNodeMeetingRealtimeAudioTransport","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"11258379bb5ef57583268d89e301f1815f74d1783024e6244ebe8d2515dac19a","declaration":"export function createNodeMeetingRealtimeAudioTransport(params: { runtime: PluginRuntime; nodeId: string; bridgeId: string; logger: RuntimeLogger; commandName: string; logScope: string; logPrefix: string; audioFormat?: MeetingRealtimeAudioFormat; }): MeetingRealtimeAudioTransport;","entrypoint":"meeting-runtime","exportName":"createNodeMeetingRealtimeAudioTransport","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"c0987b15a391a92d53d3e4e12b61eb122f9547fcf4f45478cdd3c5a8973a3e52","declaration":"export function endMeetingVoiceCallGatewayCall(params: { gateway: MeetingVoiceCallGateway; callId: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"endMeetingVoiceCallGatewayCall","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"b3ebc10fe7ab372e1317eaa8f78621cf277bba1e33fda57acf2254f6759d1e9d","declaration":"export function getMeetingVoiceCallGatewayCall(params: { gateway: MeetingVoiceCallGateway; callId: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"getMeetingVoiceCallGatewayCall","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"aac088df8e80d9ce89c45feccdb04ace3ae4417b3fcdd0f058410ddf25c96b46","declaration":"export function isMeetingVoiceCallMissingError(error: unknown): boolean;","entrypoint":"meeting-runtime","exportName":"isMeetingVoiceCallMissingError","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"5b913b7a7e1d23c37050fd007a9250109b9b787a0aaffd88008e03e5b7f4aae6","declaration":"export function joinMeetingViaVoiceCallGateway(params: { config: MeetingVoiceCallConfig; gateway: MeetingVoiceCallGateway; surface: MeetingVoiceCallSurface; dialInNumber: string; dtmfSequence?: string; logger?: RuntimeLogger; message?: string; requesterSessionKey?: string; agentId?: string; sessionKey?: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"joinMeetingViaVoiceCallGateway","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"bb84ecb8a89b6bddd40741261f2f2e82a0023f4db72c8dfedf4aecf7f91f3e77","declaration":"export function joinMeetingViaVoiceCallGateway(params: { config: MeetingVoiceCallConfig; gateway: MeetingVoiceCallGateway; surface: MeetingVoiceCallSurface; dialInNumber: string; dtmfSequence?: string; logger?: RuntimeLogger; message?: string; requesterSessionKey?: string; agentId?: string; sessionKey?: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"joinMeetingViaVoiceCallGateway","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"bac9621cd025754fbcd4c21409b06eb0503405db81f35cac993aaf0b881ab3e1","declaration":"export function leaveMeetingWithBrowser(params: { adapter: BrowserAdapter; callBrowser: MeetingBrowserRequestCaller; launch: boolean; meetingSessionId?: string; meetingUrl: string; tab: MeetingBrowserTab; timeoutMs: number; }): Promise<{ left: boolean; note: string; }>;","entrypoint":"meeting-runtime","exportName":"leaveMeetingWithBrowser","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"c7b1aeac134b2070d053adf33026d876998b852ccd65cd2c9667119b1a1abee2","declaration":"export function openMeetingWithBrowser, Mode extends string, Health extends MeetingBrowserHealth & { browserTitle?: string; browserUrl?: string; notes?: string[]; }, Transcript extends MeetingTranscriptSnapshot>(params: { adapter: BrowserAdapter; callBrowser: MeetingBrowserRequestCaller; config: MeetingBrowserControllerConfig; session: Session; }): Promise<{ launched: boolean; browser?: Health; tab?: MeetingBrowserTab; }>;","entrypoint":"meeting-runtime","exportName":"openMeetingWithBrowser","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"34858979bd248799c2215d9c7bdd5d4a6b27660c9173bfca2e50dd4373ac27db","declaration":"export function readMeetingBrowserTab(result: unknown): MeetingBrowserCandidateTab | undefined;","entrypoint":"meeting-runtime","exportName":"readMeetingBrowserTab","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} @@ -3218,8 +3218,8 @@ {"closureHash":"a1c367ec2dd927543d490a1393128d475e10c7bd131ffd789c80d88a2d2d0cb2","declaration":"export function resolveMeetingBrowserNodeInfo(params: { runtime: PluginRuntime; adapter: NodeAdapter; requestedNode?: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"resolveMeetingBrowserNodeInfo","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"f21196c9ea8ab90248ffdcdef3e942f1247ee2b9064ddb9757fffe352362c779","declaration":"export function resolveMeetingRealtimeAudioFormat(audioFormat: MeetingRealtimeAudioFormat): RealtimeVoiceAudioFormat;","entrypoint":"meeting-runtime","exportName":"resolveMeetingRealtimeAudioFormat","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"521dc5c262524a709cdd27cdc88e95004073da8223537bcbc73d5d423172dc2b","declaration":"export function speakMeetingViaVoiceCallGateway(params: { gateway: MeetingVoiceCallGateway; callId: string; message: string; }): Promise;","entrypoint":"meeting-runtime","exportName":"speakMeetingViaVoiceCallGateway","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"89fa36fac0b12eafa92caa88fda8625141750a29f0351fd4f2b3b14c458c6e2b","declaration":"export function startMeetingAgentRealtimeEngine(params: { config: MeetingRealtimeEngineConfig; fullConfig: OpenClawConfig; runtime: PluginRuntime; platform: MeetingRuntimePlatform; meetingSessionId: string; requesterSessionKey?: string; logPrefix?: \"node\"; transport: MeetingRealtimeAudioTransport; logger: RuntimeLogger; providers?: RealtimeTranscriptionProviderPlugin[]; consultAgent: (params: MeetingAgentConsultParams) => Promise<{ text: string; }>; }): Promise;","entrypoint":"meeting-runtime","exportName":"startMeetingAgentRealtimeEngine","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} -{"closureHash":"cc9193c9bd57a8a86c439adef3ae5875ddec06f5f272b6b7c7c585560eebad09","declaration":"export function startMeetingRealtimeEngine(params: { config: MeetingRealtimeEngineConfig; fullConfig: OpenClawConfig; runtime: PluginRuntime; platform: MeetingRuntimePlatform; meetingSessionId: string; requesterSessionKey?: string; logPrefix?: \"node\"; talkSessionId?: string; talkContext?: { nodeId: string; bridgeId: string; }; transport: MeetingRealtimeAudioTransport; logger: RuntimeLogger; providers?: RealtimeVoiceProviderPlugin[]; consultAgent: (params: MeetingAgentConsultParams) => Promise<{ text: string; }>; tools: RealtimeVoiceTool[]; handleToolCall: (params: MeetingRealtimeToolCallParams) => Promise; }): Promise;","entrypoint":"meeting-runtime","exportName":"startMeetingRealtimeEngine","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"d0528236feb8086dc39e52299ec4eb87c8577f665385e1507c943e4437c19628","declaration":"export function startMeetingAgentRealtimeEngine(params: { config: MeetingRealtimeEngineConfig; fullConfig: OpenClawConfig; runtime: PluginRuntime; platform: MeetingRuntimePlatform; meetingSessionId: string; requesterSessionKey?: string; logPrefix?: \"node\"; transport: MeetingRealtimeAudioTransport; logger: RuntimeLogger; providers?: RealtimeTranscriptionProviderPlugin[]; consultAgent: (params: MeetingAgentConsultParams) => Promise<{ text: string; }>; }): Promise;","entrypoint":"meeting-runtime","exportName":"startMeetingAgentRealtimeEngine","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} +{"closureHash":"28206695e8368aa410a89350f58eca4be9cfbc3a77ca4f847ea0593a5dcb4e3b","declaration":"export function startMeetingRealtimeEngine(params: { config: MeetingRealtimeEngineConfig; fullConfig: OpenClawConfig; runtime: PluginRuntime; platform: MeetingRuntimePlatform; meetingSessionId: string; requesterSessionKey?: string; logPrefix?: \"node\"; talkSessionId?: string; talkContext?: { nodeId: string; bridgeId: string; }; transport: MeetingRealtimeAudioTransport; logger: RuntimeLogger; providers?: RealtimeVoiceProviderPlugin[]; consultAgent: (params: MeetingAgentConsultParams) => Promise<{ text: string; }>; tools: RealtimeVoiceTool[]; handleToolCall: (params: MeetingRealtimeToolCallParams) => Promise; }): Promise;","entrypoint":"meeting-runtime","exportName":"startMeetingRealtimeEngine","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"function","recordType":"export"} {"closureHash":"663b9c77231b21af697efd5042e22d1c33e9ee972adeb312ad86d81a2b2e36f7","declaration":"export type MeetingAgentConsultParams = MeetingAgentConsultParams;","entrypoint":"meeting-runtime","exportName":"MeetingAgentConsultParams","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"adf0745c611bf737fc28978d766fc2a25b7104e71b6b2fed4e9b95e519c7b115","declaration":"export type MeetingBrowserCandidateTab = MeetingBrowserCandidateTab;","entrypoint":"meeting-runtime","exportName":"MeetingBrowserCandidateTab","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"59b1526172b7491b85f14f13c1ee26d8d6726f33093770748580c767b1689a17","declaration":"export type MeetingBrowserControllerConfig = MeetingBrowserControllerConfig;","entrypoint":"meeting-runtime","exportName":"MeetingBrowserControllerConfig","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} @@ -3251,7 +3251,7 @@ {"closureHash":"8244b408803f57cf2004157e96f2ce11bb036cdf864123b15ba2fac7f03b5d43","declaration":"export type MeetingSessionRuntimeHandles = MeetingSessionRuntimeHandles;","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntimeHandles","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"aa8054fc2c442891197e89bdad61e79999ea15d813c4b127fb6150607b9e67e7","declaration":"export type MeetingSessionRuntimeJoinContext, TTransport extends string, TMode extends string, THealth extends MeetingBrowserHealth, TTab extends MeetingBrowserTab> = MeetingSessionRuntimeJoinContext;","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntimeJoinContext","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"325241724edd38da439c5df03d225e2a7cb8e56d817e98ed7c37850656d3744b","declaration":"export type MeetingSessionRuntimeMessages = MeetingSessionRuntimeMessages;","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntimeMessages","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} -{"closureHash":"c1464291329d4b78d23a9fbf815b214ad5edb2adb2584e85707167c25e2c45d5","declaration":"export type MeetingSessionRuntimeOptions, TRequest, TTransport extends string, TMode extends string, THealth extends MeetingBrowserHealth, TTab extends MeetingBrowserTab, TManualReason extends string, TSpeechBlockedReason extends string> = MeetingSessionRuntimeOptions;","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntimeOptions","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} +{"closureHash":"ef707c79fc8a5d095e5bc50392a123699fd038c2becd4572b0f3b06281b5cb7e","declaration":"export type MeetingSessionRuntimeOptions, TRequest, TTransport extends string, TMode extends string, THealth extends MeetingBrowserHealth, TTab extends MeetingBrowserTab, TManualReason extends string, TSpeechBlockedReason extends string> = MeetingSessionRuntimeOptions;","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntimeOptions","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"d3c730cba02d30512c4cdae6e2367c662982e2c25671833ecd8701283924c642","declaration":"export type MeetingSessionState = MeetingSessionState;","entrypoint":"meeting-runtime","exportName":"MeetingSessionState","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"2496931157bf64fdb16013172ab9c023e60c5f85b98f46a3ee9532ce58d636d6","declaration":"export type MeetingSetupCheck = MeetingSetupCheck;","entrypoint":"meeting-runtime","exportName":"MeetingSetupCheck","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"f0aed6f7955a43fc387d8bbc072cb6276b0f2d18e7f829441a2ad45974bb3831","declaration":"export type MeetingSetupStatus = MeetingSetupStatus;","entrypoint":"meeting-runtime","exportName":"MeetingSetupStatus","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} @@ -3265,9 +3265,9 @@ {"closureHash":"20c70a94483aeddda4d1500cfcc5e71fab844b474ba4061c55d6c8693d40821b","declaration":"export type MeetingVoiceCallJoinResult = MeetingVoiceCallJoinResult;","entrypoint":"meeting-runtime","exportName":"MeetingVoiceCallJoinResult","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"4fb2c5928aa6f809dd4c604d71c5c99cdfe3e98b6e9c1662601c9b4ad9738162","declaration":"export type MeetingVoiceCallStatusResult = MeetingVoiceCallStatusResult;","entrypoint":"meeting-runtime","exportName":"MeetingVoiceCallStatusResult","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} {"closureHash":"5ef812397b6409a4ca228943dd1080661365959477b42e705a9aaa219757d14f","declaration":"export type MeetingVoiceCallSurface = MeetingVoiceCallSurface;","entrypoint":"meeting-runtime","exportName":"MeetingVoiceCallSurface","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"type","recordType":"export"} -{"closureHash":"3bc9c8a87d4f47b40d630bd37d05960f8263c32dd175ecd568aac283a7ff44f7","declaration":"export interface MeetingPlatformAdapter extends MeetingPlatformAdapterContract {\n}","entrypoint":"meeting-runtime","exportName":"MeetingPlatformAdapter","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"interface","recordType":"export"} +{"closureHash":"c396bd350aaf1cb4f2ffa22e908ec4fcc2123a75c8405554b4ce641c53e74ebd","declaration":"export interface MeetingPlatformAdapter extends MeetingPlatformAdapterContract {\n}","entrypoint":"meeting-runtime","exportName":"MeetingPlatformAdapter","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"interface","recordType":"export"} {"closureHash":"79884bd1df1ea0d07d5ceb4c62d93c1ee744b75d31c94c988845869c0f3cbd2d","declaration":"export interface MeetingRealtimeAudioTransport {\n onFatal(handler: () => void): void;\n startInput(onAudio: (audio: Buffer) => void): void;\n beginOutput?(): void;\n stop(): Promise;\n writeOutput(audio: Buffer): Promise;\n clearOutput(): Promise;\n dispose(): Promise;\n getHealth?(): MeetingRealtimeAudioTransportHealth;\n startBargeInMonitor?(onBargeIn: (audio: Buffer) => boolean): void;\n}","entrypoint":"meeting-runtime","exportName":"MeetingRealtimeAudioTransport","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"interface","recordType":"export"} -{"closureHash":"641b9b525dbf62fbfffa58409e4358e22ad0832b18e8ef5f286908ef7999c028","declaration":"export class MeetingSessionRuntime, TRequest, TTransport extends string, TMode extends string, THealth extends MeetingBrowserHealth, TTab extends MeetingBrowserTab, TManualReason extends string, TSpeechBlockedReason extends string> {\n readonly #sessions: Map;\n readonly #sessionLeaves: Map>>;\n readonly #sessionCleanup: MeetingSessionCleanupTracker;\n readonly #meetingLock: MeetingSessionJoinLock;\n readonly #sessionStops: Map Promise>;\n readonly #sessionSpeakers: Map void>;\n readonly #sessionHealth: Map Partial>;\n readonly #durableTranscripts: MeetingSessionDurableTranscripts;\n readonly #transcriptStore: MeetingSessionTranscriptStore;\n constructor(private readonly options: MeetingSessionRuntimeOptions);\n list(): TSession[];\n getSession(sessionId: string): TSession | undefined;\n async status(sessionId?: string): Promise<{\n found: boolean;\n session?: TSession;\n sessions?: TSession[];\n }>;\n async transcript(sessionId: string, options: {\n sinceIndex?: number;\n }): Promise<{ found: boolean; sessionId?: string; startIndex?: number; nextIndex?: number; droppedLines?: number; evicted?: boolean; lines?: MeetingTranscriptLine[]; }>;\n async startTranscriptSource(request: TranscriptStartRequest): Promise;\n async stopTranscriptSource(request: TranscriptStopRequest): Promise;\n isReusableSession(session: TSession, resolved: MeetingResolvedJoin): boolean;\n async join(request: TRequest): Promise<{\n session: TSession;\n spoken?: boolean;\n }>;\n async leave(sessionId: string, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n async speak(sessionId: string, instructions?: string): Promise<{\n found: boolean;\n spoken: boolean;\n session?: TSession;\n }>;\n async speakWhenReady(session: TSession, instructions: string): Promise;\n hasHealthHandle(sessionId: string): boolean;\n refreshHealth(sessionId?: string): void;\n async refreshBrowserHealth(session: TSession, options: {\n force?: boolean;\n readOnly?: boolean;\n }): Promise;\n async refreshCaptionHealth(session: TSession): Promise;\n refreshSpeechReadiness(session: TSession): {\n ready: boolean;\n reason?: TSpeechBlockedReason;\n message?: string;\n };\n markSessionEnded(session: TSession, reason: string): void;\n async #joinUnlocked(request: TRequest, resolved: MeetingResolvedJoin): Promise<{\n session: TSession;\n spoken?: boolean;\n }>;\n async #leaveUnlocked(sessionId: string, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n async #leaveSession(session: TSession, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n #meetingKey(transport: TTransport, url: string): string;\n #inheritBrowserTabOwnership(params: {\n session: TSession;\n transport: TTransport;\n nodeId?: string;\n meetingUrl: string;\n tab?: TTab;\n }): TTab | undefined;\n async #settleRetainedBrowserTabs(retained: Array<{\n session: TSession;\n tab: TTab;\n }>, adopted?: {\n transport: TTransport;\n nodeId?: string;\n tab: TTab;\n }): Promise;\n async #rollbackFailedJoinSession(session: TSession): Promise;\n async #settleRetainedBrowserTabsAfterFailure(retained: Array<{\n session: TSession;\n tab: TTab;\n }>): Promise;\n #attachRuntimeHandles(session: TSession, handles: MeetingSessionRuntimeHandles): void;\n #dropRuntimeHandles(sessionId: string): void;\n #isManagedBrowserSession(session: TSession): boolean;\n #evaluateSpeechReadiness(session: TSession): {\n ready: boolean;\n reason?: TSpeechBlockedReason;\n message?: string;\n };\n #noteSession(session: TSession, note: string): void;\n}","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntime","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"class","recordType":"export"} +{"closureHash":"f20d2bb07c1d92abfd17a3fa90698a3795bf7ca88cecaf43f29311bc6555b6fc","declaration":"export class MeetingSessionRuntime, TRequest, TTransport extends string, TMode extends string, THealth extends MeetingBrowserHealth, TTab extends MeetingBrowserTab, TManualReason extends string, TSpeechBlockedReason extends string> {\n readonly #sessions: Map;\n readonly #sessionLeaves: Map>>;\n readonly #sessionCleanup: MeetingSessionCleanupTracker;\n readonly #meetingLock: MeetingSessionJoinLock;\n readonly #sessionStops: Map Promise>;\n readonly #sessionSpeakers: Map void>;\n readonly #sessionHealth: Map Partial>;\n readonly #durableTranscripts: MeetingSessionDurableTranscripts;\n readonly #transcriptStore: MeetingSessionTranscriptStore;\n constructor(private readonly options: MeetingSessionRuntimeOptions);\n list(): TSession[];\n getSession(sessionId: string): TSession | undefined;\n async status(sessionId?: string): Promise<{\n found: boolean;\n session?: TSession;\n sessions?: TSession[];\n }>;\n async transcript(sessionId: string, options: {\n sinceIndex?: number;\n }): Promise<{ found: boolean; sessionId?: string; startIndex?: number; nextIndex?: number; droppedLines?: number; evicted?: boolean; lines?: MeetingTranscriptLine[]; }>;\n async startTranscriptSource(request: TranscriptStartRequest): Promise;\n async stopTranscriptSource(request: TranscriptStopRequest): Promise;\n isReusableSession(session: TSession, resolved: MeetingResolvedJoin): boolean;\n async join(request: TRequest): Promise<{\n session: TSession;\n spoken?: boolean;\n }>;\n async leave(sessionId: string, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n async speak(sessionId: string, instructions?: string): Promise<{\n found: boolean;\n spoken: boolean;\n session?: TSession;\n }>;\n async speakWhenReady(session: TSession, instructions: string): Promise;\n hasHealthHandle(sessionId: string): boolean;\n refreshHealth(sessionId?: string): void;\n async refreshBrowserHealth(session: TSession, options: {\n force?: boolean;\n readOnly?: boolean;\n }): Promise;\n async refreshCaptionHealth(session: TSession): Promise;\n refreshSpeechReadiness(session: TSession): {\n ready: boolean;\n reason?: TSpeechBlockedReason;\n message?: string;\n };\n markSessionEnded(session: TSession, reason: string): void;\n async #joinUnlocked(request: TRequest, resolved: MeetingResolvedJoin): Promise<{\n session: TSession;\n spoken?: boolean;\n }>;\n async #leaveUnlocked(sessionId: string, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n async #leaveSession(session: TSession, options?: {\n keepBrowserTab?: boolean;\n }): Promise>;\n #meetingKey(transport: TTransport, url: string): string;\n #inheritBrowserTabOwnership(params: {\n session: TSession;\n transport: TTransport;\n nodeId?: string;\n meetingUrl: string;\n tab?: TTab;\n }): TTab | undefined;\n async #settleRetainedBrowserTabs(retained: Array<{\n session: TSession;\n tab: TTab;\n }>, adopted?: {\n transport: TTransport;\n nodeId?: string;\n tab: TTab;\n }): Promise;\n async #rollbackFailedJoinSession(session: TSession): Promise;\n async #settleRetainedBrowserTabsAfterFailure(retained: Array<{\n session: TSession;\n tab: TTab;\n }>): Promise;\n #attachRuntimeHandles(session: TSession, handles: MeetingSessionRuntimeHandles): void;\n #dropRuntimeHandles(sessionId: string): void;\n #isManagedBrowserSession(session: TSession): boolean;\n #evaluateSpeechReadiness(session: TSession): {\n ready: boolean;\n reason?: TSpeechBlockedReason;\n message?: string;\n };\n #noteSession(session: TSession, note: string): void;\n}","entrypoint":"meeting-runtime","exportName":"MeetingSessionRuntime","importSpecifier":"openclaw/plugin-sdk/meeting-runtime","kind":"class","recordType":"export"} {"category":null,"entrypoint":"memory-core-host-engine-foundation","importSpecifier":"openclaw/plugin-sdk/memory-core-host-engine-foundation","recordType":"module"} {"closureHash":"e2df8d235401aebf58eb71652fbeaedb42ca00aaa5042a76909ff2c48ba6fd54","declaration":"export function createSubsystemLogger(subsystem: string): SubsystemLogger;","entrypoint":"memory-core-host-engine-foundation","exportName":"createSubsystemLogger","importSpecifier":"openclaw/plugin-sdk/memory-core-host-engine-foundation","kind":"function","recordType":"export"} {"closureHash":null,"declaration":"export function isPathInside(root: string, target: string): boolean;","entrypoint":"memory-core-host-engine-foundation","exportName":"isPathInside","importSpecifier":"openclaw/plugin-sdk/memory-core-host-engine-foundation","kind":"function","recordType":"export"} @@ -3360,7 +3360,7 @@ {"closureHash":"d32342291ad7c19b5b7066499a65a5b76c8f0e268bbb8852cb0bda67685037bf","declaration":"export function readPositiveIntegerParam(params: Record, key: string, options?: { message?: string; max?: number; }): number | undefined;","entrypoint":"param-readers","exportName":"readPositiveIntegerParam","importSpecifier":"openclaw/plugin-sdk/param-readers","kind":"function","recordType":"export"} {"closureHash":"7830262486cedbb4b8e156de295bbcea8596738742c39961e429a3cea6836e0b","declaration":"export function readStringArrayParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string[];\nexport function readStringArrayParam(params: Record, key: string, options?: StringParamOptions): string[] | undefined;","entrypoint":"param-readers","exportName":"readStringArrayParam","importSpecifier":"openclaw/plugin-sdk/param-readers","kind":"function","recordType":"export"} {"closureHash":"818ea0efd869633f87abb325bb187725079ffb661b088bb4661668485d4355cf","declaration":"export function readStringOrNumberParam(params: Record, key: string, options?: { required?: boolean; label?: string; }): string | undefined;","entrypoint":"param-readers","exportName":"readStringOrNumberParam","importSpecifier":"openclaw/plugin-sdk/param-readers","kind":"function","recordType":"export"} -{"closureHash":"1bb870618265ff3d1feb750d975fce5f5b87fe3bd9c458f056eea28933ac7092","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"param-readers","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/param-readers","kind":"function","recordType":"export"} +{"closureHash":"9ec34afffcb58733bf81e79b036e4cd9fb963dd0c3b1e29758c469e4ea6a5c96","declaration":"export function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string;\nexport function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined;","entrypoint":"param-readers","exportName":"readStringParam","importSpecifier":"openclaw/plugin-sdk/param-readers","kind":"function","recordType":"export"} {"category":null,"entrypoint":"persistent-dedupe","importSpecifier":"openclaw/plugin-sdk/persistent-dedupe","recordType":"module"} {"closureHash":"1bcc14224cbe52a98a97a6d767a8b2f2bbc8473439358417dc913e300c1b0abd","declaration":"export function createChannelReplayGuard(params: ChannelReplayGuardParams): ChannelReplayGuard;","entrypoint":"persistent-dedupe","exportName":"createChannelReplayGuard","importSpecifier":"openclaw/plugin-sdk/persistent-dedupe","kind":"function","recordType":"export"} {"closureHash":"7a3917f9b21766441f3ceda2e888d24d38d8943b5fa57965affddd24732a7289","declaration":"export function createClaimableDedupe(options: ClaimableDedupeOptions): ClaimableDedupe & Required>;","entrypoint":"persistent-dedupe","exportName":"createClaimableDedupe","importSpecifier":"openclaw/plugin-sdk/persistent-dedupe","kind":"function","recordType":"export"} @@ -3403,9 +3403,9 @@ {"category":"core","entrypoint":"plugin-entry","importSpecifier":"openclaw/plugin-sdk/plugin-entry","recordType":"module"} {"closureHash":"3d27406644141af2733cfca6e8c1240fc62327910109f585ce9073cafd7fd89c","declaration":"export function buildJsonPluginConfigSchema(schema: JsonSchemaObject, options?: BuildJsonPluginConfigSchemaOptions): OpenClawPluginConfigSchema;","entrypoint":"plugin-entry","exportName":"buildJsonPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"function","recordType":"export"} {"closureHash":"aff66c792d532642afb9c6e5a03c8d220f219250c3a8b49733f32058f22f98ca","declaration":"export function buildPluginConfigSchema(schema: ZodTypeAny, options?: BuildPluginConfigSchemaOptions): OpenClawPluginConfigSchema;","entrypoint":"plugin-entry","exportName":"buildPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"function","recordType":"export"} -{"closureHash":"e9633b4ca148dc6289c61a1d85b0e34cb244d926badbf4a591302267c691e62a","declaration":"export function definePluginEntry({ id, name, description, kind, configSchema, reload, nodeHostCommands, securityAuditCollectors, register, }: DefinePluginEntryOptions): DefinedPluginEntry;","entrypoint":"plugin-entry","exportName":"definePluginEntry","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"function","recordType":"export"} +{"closureHash":"c5135d933f690abcdf9cb6bd02dc8c3913d6b0db458fbba9ba7fb7e891a1d30b","declaration":"export function definePluginEntry({ id, name, description, kind, configSchema, reload, nodeHostCommands, securityAuditCollectors, register, }: DefinePluginEntryOptions): DefinedPluginEntry;","entrypoint":"plugin-entry","exportName":"definePluginEntry","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"function","recordType":"export"} {"closureHash":"0ef1dfa3b5deeb456480e292c0e835c3cd6d13e7bb7059fc735546507da51594","declaration":"export function emptyPluginConfigSchema(): OpenClawPluginConfigSchema;","entrypoint":"plugin-entry","exportName":"emptyPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"function","recordType":"export"} -{"closureHash":"89d1232faa739ea7bb8b305d5e92ff1057759b833cd9994ef0923634234741e7","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"plugin-entry","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} +{"closureHash":"49e181db775c3ee735cef6900062306c81f598b8a5b696379e55a21f3b011741","declaration":"export type AgentHarness = AgentHarness;","entrypoint":"plugin-entry","exportName":"AgentHarness","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"d2ff4de9ee3fd111c2cc64a3ee7e557d9f161af1b6b437ee7886bcb16e426317","declaration":"export type AgentPromptGuidance = AgentPromptGuidance;","entrypoint":"plugin-entry","exportName":"AgentPromptGuidance","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"2841127a90e04467adfea8126cbf03655f44ddb089ad9e0d48833c2beea39cbd","declaration":"export type AgentPromptGuidanceEntry = AgentPromptGuidanceEntry;","entrypoint":"plugin-entry","exportName":"AgentPromptGuidanceEntry","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"aa0412acefe62caff12e5271ead0545504874e824380dc21cfc0566388a05f33","declaration":"export type AgentPromptSurfaceKind = \"openclaw_main\" | \"pi_main\" | \"codex_app_server\" | \"cli_backend\" | \"acp_backend\" | \"subagent\";","entrypoint":"plugin-entry","exportName":"AgentPromptSurfaceKind","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} @@ -3421,10 +3421,10 @@ {"closureHash":"8054ffbe71b91afced900ef8a06f5e368ac10c4f99ffc1c6f538a802856f61c6","declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"plugin-entry","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"2f6e368fff73e942044cdf95c7c751b46c741e22ac0d2d4d97f45a3158f758ae","declaration":"export type OpenClawGatewayDiscoveryAdvertiseContext = OpenClawGatewayDiscoveryAdvertiseContext;","entrypoint":"plugin-entry","exportName":"OpenClawGatewayDiscoveryAdvertiseContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"b198058e0065e5c60b729a5bdf568f7e2436a006d8c4a7c63de764c7283f96ba","declaration":"export type OpenClawGatewayDiscoveryService = OpenClawGatewayDiscoveryService;","entrypoint":"plugin-entry","exportName":"OpenClawGatewayDiscoveryService","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-entry","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-entry","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"c968e96cdb5c97e92d26b7b15fb5255531b45a12e7c5c0a2e7e456d31cc6e358","declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"365beb5cee974639c2f35fc7a39088721ca8e9c618442830298b98033e9c768c","declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"plugin-entry","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} -{"closureHash":"9303ba80fdfee2f9fae041231bc7482ae3dffcc8d451f1862aac7fc1c2a8b8f2","declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} +{"closureHash":"1b2636e3bd55c40a8911396cf70dbca69bc43e50dfc13003266def91c69f50da","declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"a7ed83f0924f818b23cecb5a1f3591ff28b9499ccac9667a2b8505c2bc608ea9","declaration":"export type OpenClawPluginGatewayEventScope = OpenClawPluginGatewayEventScope;","entrypoint":"plugin-entry","exportName":"OpenClawPluginGatewayEventScope","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"f81f224d9b837e6353b7a546c5a76b124bcf568fd1f1fd0c6881fda30c53120a","declaration":"export type OpenClawPluginGatewayEvents = OpenClawPluginGatewayEvents;","entrypoint":"plugin-entry","exportName":"OpenClawPluginGatewayEvents","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} {"closureHash":"7470b211ac4d3449cd0fc353ee2eb48e9fbc2dbc9259d21c680d0203577aa94f","declaration":"export type OpenClawPluginHttpRouteHandler = OpenClawPluginHttpRouteHandler;","entrypoint":"plugin-entry","exportName":"OpenClawPluginHttpRouteHandler","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export"} @@ -3574,14 +3574,14 @@ {"closureHash":"ad45bb1eb13e99e3217eb7e7e2d29fa456bc1930059dd5e94d7500e05e54c6bc","declaration":"export function executePluginCommand(params: { command: RegisteredPluginCommand; args?: string; senderId?: string; channel: string; channelId?: PluginCommandContext[\"channelId\"]; isAuthorizedSender: boolean; senderIsOwner?: boolean; gatewayClientScopes?: PluginCommandContext[\"gatewayClientScopes\"]; agentId?: string; sessionKey?: PluginCommandContext[\"sessionKey\"]; sessionId?: PluginCommandContext[\"sessionId\"]; sessionTarget?: PluginCommandContext[\"sessionTarget\"]; sessionFile?: PluginCommandContext[\"sessionFile\"]; authProfileId?: string; commandBody: string; config: OpenClawConfig; from?: PluginCommandContext[\"from\"]; to?: PluginCommandContext[\"to\"]; originatingTo?: string; accountId?: PluginCommandContext[\"accountId\"]; messageThreadId?: PluginCommandContext[\"messageThreadId\"]; threadParentId?: PluginCommandContext[\"threadParentId\"]; diagnosticsSessions?: PluginCommandContext[\"diagnosticsSessions\"]; diagnosticsUploadApproved?: PluginCommandContext[\"diagnosticsUploadApproved\"]; diagnosticsPreviewOnly?: PluginCommandContext[\"diagnosticsPreviewOnly\"]; diagnosticsPrivateRouted?: PluginCommandContext[\"diagnosticsPrivateRouted\"]; }): Promise;","entrypoint":"plugin-runtime","exportName":"executePluginCommand","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"7e75fc04d621dc8d12f459d5b5b0c039a39b77c30c2b51af481e123c352f57b8","declaration":"export function getGlobalHookRunner(): HookRunner | null;","entrypoint":"plugin-runtime","exportName":"getGlobalHookRunner","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"db6583607237e4081814e2c5d4f8fb6f216ad3bbfe623bf16fc1a9c09c15f64b","declaration":"export function getPluginCommandSpecs(provider?: string, options?: PluginCommandSpecOptions): Array<{ name: string; description: string; descriptionLocalizations?: Record; acceptsArgs: boolean; }>;","entrypoint":"plugin-runtime","exportName":"getPluginCommandSpecs","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} -{"closureHash":"1b287439685d4de1b6ad946a43783fafa28fb7d66c1c0f71c9dbde0d9eec3698","declaration":"export function getPluginRuntimeGatewayRequestScope(): PluginRuntimeGatewayRequestScope | undefined;","entrypoint":"plugin-runtime","exportName":"getPluginRuntimeGatewayRequestScope","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} +{"closureHash":"ab0c17b46e336c7be975c557239bdcdadaad972ad5d07c862cae9da3670dbed6","declaration":"export function getPluginRuntimeGatewayRequestScope(): PluginRuntimeGatewayRequestScope | undefined;","entrypoint":"plugin-runtime","exportName":"getPluginRuntimeGatewayRequestScope","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"cfe277ce6de0c6ed50f1f54b66c889f6c95e91b058e8bcdc27aa37317a93a447","declaration":"export function listRegisteredPluginAgentPromptGuidance(params?: { surface?: AgentPromptSurfaceKind; includeLegacyGlobalGuidance?: boolean; }): string[];","entrypoint":"plugin-runtime","exportName":"listRegisteredPluginAgentPromptGuidance","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"693462c2a5c07646277169ede37b71ed12dc8d56c648b7fed73712900be34dcf","declaration":"export function matchPluginCommand(commandBody: string, options?: { channel?: string; }): { command: RegisteredPluginCommand; args?: string; } | null;","entrypoint":"plugin-runtime","exportName":"matchPluginCommand","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"8d575a525d165780642e70ff1385311c3422429c2e26c479a85baae491d62efe","declaration":"export function registerPluginCommand(pluginId: string, command: OpenClawPluginCommandDefinition, opts?: { pluginName?: string; pluginRoot?: string; allowReservedCommandNames?: boolean; allowOwnerStatusExposure?: boolean; }): CommandRegistrationResult;","entrypoint":"plugin-runtime","exportName":"registerPluginCommand","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"16986e5d431f584c2d5053289eca3d2225bbe47a92cdfbbc2af91b264a165846","declaration":"export function registerPluginInteractiveHandler(pluginId: string, registration: PluginInteractiveHandlerRegistration, opts?: { pluginName?: string; pluginRoot?: string; }): InteractiveRegistrationResult;","entrypoint":"plugin-runtime","exportName":"registerPluginInteractiveHandler","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"f20c07a48e2c949fbc889e7a32760f4e52339d9f6d3eab49e00ff249266e2396","declaration":"export function startLazyPluginServiceModule(params: { skipEnvVar?: string; overrideEnvVar?: string; validateOverrideSpecifier?: (specifier: string) => string; loadDefaultModule: () => Promise; loadOverrideModule?: (specifier: string) => Promise; startExportNames: string[]; stopExportNames?: string[]; }): Promise;","entrypoint":"plugin-runtime","exportName":"startLazyPluginServiceModule","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"function","recordType":"export"} {"closureHash":"bad43ffe69d1d9d6c92c79df4c388b3dda685013a92392daef456f1622ade659","declaration":"export type LazyPluginServiceHandle = LazyPluginServiceHandle;","entrypoint":"plugin-runtime","exportName":"LazyPluginServiceHandle","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} -{"closureHash":"9dc2f147a95856891b1a644b8863a3ae3c45db0c56b28ee7c5954562148cde17","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-runtime","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} +{"closureHash":"51e15f7b32488d2f964dc3e5e7df9924429b74ee04aa5e7e95763d495ef1682c","declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-runtime","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} {"closureHash":"365beb5cee974639c2f35fc7a39088721ca8e9c618442830298b98033e9c768c","declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"plugin-runtime","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} {"closureHash":"f06379ada10ce0eca4e66bdf978db2c0035e054a135dc044c6d831ac7797c08f","declaration":"export type PluginConversationBinding = PluginConversationBinding;","entrypoint":"plugin-runtime","exportName":"PluginConversationBinding","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} {"closureHash":"a1223d674b2b66918a576ae05b04318d7b8cbe9b1d3bc6dd7a08d1a4fa79b291","declaration":"export type PluginConversationBindingRequestParams = PluginConversationBindingRequestParams;","entrypoint":"plugin-runtime","exportName":"PluginConversationBindingRequestParams","importSpecifier":"openclaw/plugin-sdk/plugin-runtime","kind":"type","recordType":"export"} @@ -3671,10 +3671,10 @@ {"closureHash":"e66adcb55dec79be73a52bc76594b7e9210fd93c69a85b56098fbb58cecbb354","declaration":"export type WriteOAuthCredentialsOptions = WriteOAuthCredentialsOptions;","entrypoint":"provider-auth","exportName":"WriteOAuthCredentialsOptions","importSpecifier":"openclaw/plugin-sdk/provider-auth","kind":"type","recordType":"export"} {"category":null,"entrypoint":"provider-catalog-runtime","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","recordType":"module"} {"closureHash":"b5665596a3f011454a5614681513516acd50b6c749536c43842d811980cf7ad3","declaration":"export function augmentModelCatalogWithProviderPlugins(params: { config?: OpenClawConfig; workspaceDir?: string; env?: NodeJS.ProcessEnv; metadataSnapshot?: PluginMetadataSnapshot; context: ProviderAugmentModelCatalogContext; }): Promise;","entrypoint":"provider-catalog-runtime","exportName":"augmentModelCatalogWithProviderPlugins","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} -{"closureHash":"d561ea4f471fb702c19f765bb646301a6eb7524149642c1c5e05616fb54e5cdc","declaration":"export function isPluginProvidersLoadInFlight(params: Parameters[0]): boolean;","entrypoint":"provider-catalog-runtime","exportName":"isPluginProvidersLoadInFlight","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} -{"closureHash":"b2a1c23ff9b65dcb5ae03052bbaec7f71d4a156a1e7ba6e5c8ae04e894295771","declaration":"export function resolveCatalogHookProviderPluginIds(params: { config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; metadataSnapshot?: ProviderManifestLoadParams[\"metadataSnapshot\"]; }): string[];","entrypoint":"provider-catalog-runtime","exportName":"resolveCatalogHookProviderPluginIds","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} -{"closureHash":"c759181919675a4c4b158629a51cfab8f40aaba54f8ee64be8a5a063efd3825a","declaration":"export function resolveOwningPluginIdsForProvider(params: { provider: string; config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; manifestRegistry?: PluginManifestRegistry; metadataSnapshot?: Pick; }): string[] | undefined;","entrypoint":"provider-catalog-runtime","exportName":"resolveOwningPluginIdsForProvider","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} -{"closureHash":"ed971738e812ee35a0fb8cdda2972251cd613b40cbcfec6c68c64c7c9a89977c","declaration":"export function resolvePluginProviders(params: { config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; bundledProviderVitestCompat?: boolean; onlyPluginIds?: string[]; providerRefs?: readonly string[]; modelRefs?: readonly string[]; activate?: boolean; cache?: boolean; applyAutoEnable?: boolean; pluginSdkResolution?: PluginLoadOptions[\"pluginSdkResolution\"]; mode?: \"runtime\" | \"setup\"; includeUntrustedWorkspacePlugins?: boolean; pluginMetadataSnapshot?: PluginMetadataRegistryView; skipIfLoadInFlight?: boolean; }): ProviderPlugin[];","entrypoint":"provider-catalog-runtime","exportName":"resolvePluginProviders","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} +{"closureHash":"cc888869112db13beb81336c29df4a6a9314cdbc564a10f71cffc472798ff356","declaration":"export function isPluginProvidersLoadInFlight(params: Parameters[0]): boolean;","entrypoint":"provider-catalog-runtime","exportName":"isPluginProvidersLoadInFlight","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} +{"closureHash":"a44ab9ee11889f84d728239f33b9fdaad169e9491aac2a783854986c6c63953b","declaration":"export function resolveCatalogHookProviderPluginIds(params: { config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; metadataSnapshot?: ProviderManifestLoadParams[\"metadataSnapshot\"]; }): string[];","entrypoint":"provider-catalog-runtime","exportName":"resolveCatalogHookProviderPluginIds","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} +{"closureHash":"68a4d7403ea221d30e280d779b6443555c13cb7cc618e06b546919dd1f33b52d","declaration":"export function resolveOwningPluginIdsForProvider(params: { provider: string; config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; manifestRegistry?: PluginManifestRegistry; metadataSnapshot?: Pick; }): string[] | undefined;","entrypoint":"provider-catalog-runtime","exportName":"resolveOwningPluginIdsForProvider","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} +{"closureHash":"ed8468a1d225b3171b733b152ef60d7a25de0c8a6521df328e278b674b073b50","declaration":"export function resolvePluginProviders(params: { config?: PluginLoadOptions[\"config\"]; workspaceDir?: string; env?: PluginLoadOptions[\"env\"]; bundledProviderVitestCompat?: boolean; onlyPluginIds?: string[]; providerRefs?: readonly string[]; modelRefs?: readonly string[]; activate?: boolean; cache?: boolean; applyAutoEnable?: boolean; pluginSdkResolution?: PluginLoadOptions[\"pluginSdkResolution\"]; mode?: \"runtime\" | \"setup\"; includeUntrustedWorkspacePlugins?: boolean; pluginMetadataSnapshot?: PluginMetadataRegistryView; skipIfLoadInFlight?: boolean; }): ProviderPlugin[];","entrypoint":"provider-catalog-runtime","exportName":"resolvePluginProviders","importSpecifier":"openclaw/plugin-sdk/provider-catalog-runtime","kind":"function","recordType":"export"} {"category":null,"entrypoint":"proxy-capture","importSpecifier":"openclaw/plugin-sdk/proxy-capture","recordType":"module"} {"closureHash":"d0e4e026d736bc00b1758d1089c44c3c5f3a09c7254291584de8cb297365804c","declaration":"export function acquireDebugProxyCaptureStore(dbPath: string, blobDir: string): { store: LegacyDebugProxyCaptureStore; release: () => void; };\nexport function acquireDebugProxyCaptureStore(options?: DebugProxyCaptureStoreOptions): { store: SharedDebugProxyCaptureStore; release: () => void; };","entrypoint":"proxy-capture","exportName":"acquireDebugProxyCaptureStore","importSpecifier":"openclaw/plugin-sdk/proxy-capture","kind":"function","recordType":"export"} {"closureHash":"d41cbb9de51b7aee1c6cf8c713b0bc44f27ac926fbb6422c05726f196d11964e","declaration":"export function captureHttpExchange(params: { url: string; method: string; requestHeaders?: Headers | Record | undefined; requestBody?: BodyInit | Buffer | string | null; response: Response; transport?: \"http\" | \"sse\"; flowId?: string; meta?: Record; }, resolved?: DebugProxySettings, deps?: DebugProxyCaptureRuntimeDeps): void;","entrypoint":"proxy-capture","exportName":"captureHttpExchange","importSpecifier":"openclaw/plugin-sdk/proxy-capture","kind":"function","recordType":"export"} @@ -4636,16 +4636,16 @@ {"closureHash":"e365d7ad911453b5139ba700931b061e560cff80b50d4cbe5e9615b5d7e13a52","declaration":"export type ScopedExpiringIdCache = ScopedExpiringIdCache;","entrypoint":"text-runtime","exportName":"ScopedExpiringIdCache","importSpecifier":"openclaw/plugin-sdk/text-runtime","kind":"type","recordType":"export"} {"closureHash":"af5502c92594c2e9049a4b4994e17c00d3adee3f6d1e68edd818a539c74c8787","declaration":"export interface CodeRegion {\n start: number;\n end: number;\n}","entrypoint":"text-runtime","exportName":"CodeRegion","importSpecifier":"openclaw/plugin-sdk/text-runtime","kind":"interface","recordType":"export"} {"category":null,"entrypoint":"tool-plugin","importSpecifier":"openclaw/plugin-sdk/tool-plugin","recordType":"module"} -{"closureHash":"9ec5a3e49b3df340966e826f8b460e22a79567fea9c11b358de4d3270501ac9e","declaration":"export function defineToolPlugin(definition: DefineToolPluginOptions): DefinedToolPluginEntry;","entrypoint":"tool-plugin","exportName":"defineToolPlugin","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"function","recordType":"export"} +{"closureHash":"2fd083315b242569261a7067fc2b0ed41241a23db8f763b10e09c74cf54128e4","declaration":"export function defineToolPlugin(definition: DefineToolPluginOptions): DefinedToolPluginEntry;","entrypoint":"tool-plugin","exportName":"defineToolPlugin","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"function","recordType":"export"} {"closureHash":"36ef907ce20f885b5f3068cbf0475dc442a68da9652579bb5bf8fb83ad34c38b","declaration":"export function getToolPluginMetadata(entry: unknown): ToolPluginMetadata | undefined;","entrypoint":"tool-plugin","exportName":"getToolPluginMetadata","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"function","recordType":"export"} {"closureHash":"bdc58154e36b2625fb3daccca3eab248d981077d04d747f0ad507cb2ff565198","declaration":"export const toolPluginMetadataSymbol: typeof toolPluginMetadataSymbol;","entrypoint":"tool-plugin","exportName":"toolPluginMetadataSymbol","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"const","recordType":"export"} -{"closureHash":"0b4ce6957b84279fb94b47176ebec6b77add2f35a18d2173fc8f0d4edb69c215","declaration":"export type DefineToolPluginOptions = DefineToolPluginOptions;","entrypoint":"tool-plugin","exportName":"DefineToolPluginOptions","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} -{"closureHash":"7fa0cb56f407285ecd68a46229a296a5ea4eb23c05beaaa57c8f27f2650a10b9","declaration":"export type DefinedToolPluginEntry = DefinedToolPluginEntry;","entrypoint":"tool-plugin","exportName":"DefinedToolPluginEntry","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} -{"closureHash":"62546d559009261caca328206579908755922bc2f0e5f7af07e20fb763226a8e","declaration":"export type ToolPluginExecutionContext = ToolPluginExecutionContext;","entrypoint":"tool-plugin","exportName":"ToolPluginExecutionContext","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} -{"closureHash":"ea764b6acc9c66784f615f4eda111d6831df8b7afe51658c589e5dc84fff2057","declaration":"export type ToolPluginFactoryContext = ToolPluginFactoryContext;","entrypoint":"tool-plugin","exportName":"ToolPluginFactoryContext","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} +{"closureHash":"019018ba58a0da36dd91f9d35f99348d423daaaa000fad15a669662b080883a6","declaration":"export type DefineToolPluginOptions = DefineToolPluginOptions;","entrypoint":"tool-plugin","exportName":"DefineToolPluginOptions","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} +{"closureHash":"2532ddbf95230699a9079e94c842e4cd9668ea3c686239b95e9f16900b1c2178","declaration":"export type DefinedToolPluginEntry = DefinedToolPluginEntry;","entrypoint":"tool-plugin","exportName":"DefinedToolPluginEntry","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} +{"closureHash":"efc38b997c27f13230fad5dd998ac04a75afb4ded77c7a45ed88565478636900","declaration":"export type ToolPluginExecutionContext = ToolPluginExecutionContext;","entrypoint":"tool-plugin","exportName":"ToolPluginExecutionContext","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} +{"closureHash":"e1ffdffbfbc1fe3483bdec816765a1951fb5c45e6b02443b9d015a34a5023088","declaration":"export type ToolPluginFactoryContext = ToolPluginFactoryContext;","entrypoint":"tool-plugin","exportName":"ToolPluginFactoryContext","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} {"closureHash":"f774bd092f51a31fbb34847213f9583234f585f66918d0af55e81bbbae40463b","declaration":"export type ToolPluginMetadata = ToolPluginMetadata;","entrypoint":"tool-plugin","exportName":"ToolPluginMetadata","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} {"closureHash":"414a89d0c80eaaf682dc25d306e7223c981c6fd25366adb973a106f4268a6a54","declaration":"export type ToolPluginStaticToolMetadata = ToolPluginStaticToolMetadata;","entrypoint":"tool-plugin","exportName":"ToolPluginStaticToolMetadata","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} -{"closureHash":"4b3f25d036f97031b2b17a813d6e3a250958a085fd4008cf1f21e6bc2ee29bb1","declaration":"export type ToolPluginToolDefinition = ToolPluginToolDefinition;","entrypoint":"tool-plugin","exportName":"ToolPluginToolDefinition","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} +{"closureHash":"8fb933209e8b65204db497c1eebb3a5e809424fbf5f1dc1ff90e9d7da08eacae","declaration":"export type ToolPluginToolDefinition = ToolPluginToolDefinition;","entrypoint":"tool-plugin","exportName":"ToolPluginToolDefinition","importSpecifier":"openclaw/plugin-sdk/tool-plugin","kind":"type","recordType":"export"} {"category":null,"entrypoint":"tool-results","importSpecifier":"openclaw/plugin-sdk/tool-results","recordType":"module"} {"closureHash":"c5b0951c3629834dff78f92317cf1421a6bbc0faf9307be1cabb915055665280","declaration":"export function jsonResult(payload: TDetails): AgentToolResult;","entrypoint":"tool-results","exportName":"jsonResult","importSpecifier":"openclaw/plugin-sdk/tool-results","kind":"function","recordType":"export"} {"closureHash":"b9aefc637a694c74e028e92006004bef18185ed569af48ac43d36b646b0af2f3","declaration":"export function textResult(text: string, details: TDetails): AgentToolResult;","entrypoint":"tool-results","exportName":"textResult","importSpecifier":"openclaw/plugin-sdk/tool-results","kind":"function","recordType":"export"} @@ -4679,9 +4679,9 @@ {"closureHash":"9f9174f1023a8a451232f5d97d1e922b7faa88b76b58cffbfbe246a1488e0ddd","declaration":"export function readJsonWebhookBodyOrReject(params: { req: IncomingMessage; res: ServerResponse; maxBytes?: number; timeoutMs?: number; profile?: WebhookBodyReadProfile; emptyObjectOnEmpty?: boolean; invalidJsonMessage?: string; }): Promise<{ ok: true; value: unknown; } | { ok: false; }>;","entrypoint":"webhook-ingress","exportName":"readJsonWebhookBodyOrReject","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"1bbddd5d1c8297e315275db4d5e1c8748ff09c0be7c37b0cf456db4fc69f8909","declaration":"export function readRequestBodyWithLimit(req: IncomingMessage, options: ReadRequestBodyOptions): Promise;","entrypoint":"webhook-ingress","exportName":"readRequestBodyWithLimit","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"e8a1174cac83ce346a231fd25e82bb5f7618ffb57cdd9af6eaa208411f70646d","declaration":"export function readWebhookBodyOrReject(params: { req: IncomingMessage; res: ServerResponse; maxBytes?: number; timeoutMs?: number; profile?: WebhookBodyReadProfile; invalidBodyMessage?: string; }): Promise<{ ok: true; value: string; } | { ok: false; }>;","entrypoint":"webhook-ingress","exportName":"readWebhookBodyOrReject","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} -{"closureHash":"16f74b7dfedf2874a05eab5305bf87a98e77d4d5e84818f9374b9b5c24031bb0","declaration":"export function registerPluginHttpRoute(params: { path?: string | null; fallbackPath?: string | null; handler: PluginHttpRouteHandler; auth: PluginHttpRouteRegistration[\"auth\"]; match?: PluginHttpRouteRegistration[\"match\"]; gatewayRuntimeScopeSurface?: PluginHttpRouteRegistration[\"gatewayRuntimeScopeSurface\"]; replaceExisting?: boolean; reuseExistingSameOwner?: boolean; throwOnFailure?: boolean; pluginId?: string; source?: string; accountId?: string; log?: (message: string) => void; registry?: PluginRegistry; }): () => void;","entrypoint":"webhook-ingress","exportName":"registerPluginHttpRoute","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} +{"closureHash":"380f4705f5df9dfa68ce8f989a0e8e6c8f34881d49dc5814c04f03cf2958c012","declaration":"export function registerPluginHttpRoute(params: { path?: string | null; fallbackPath?: string | null; handler: PluginHttpRouteHandler; auth: PluginHttpRouteRegistration[\"auth\"]; match?: PluginHttpRouteRegistration[\"match\"]; gatewayRuntimeScopeSurface?: PluginHttpRouteRegistration[\"gatewayRuntimeScopeSurface\"]; replaceExisting?: boolean; reuseExistingSameOwner?: boolean; throwOnFailure?: boolean; pluginId?: string; source?: string; accountId?: string; log?: (message: string) => void; registry?: PluginRegistry; }): () => void;","entrypoint":"webhook-ingress","exportName":"registerPluginHttpRoute","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"05835f2f66f906f736b82b332a84a9714bc3a6b211890a62d8fc4dbf9258a7d4","declaration":"export function registerWebhookTarget(targetsByPath: Map, target: T, opts?: RegisterWebhookTargetOptions): RegisteredWebhookTarget;","entrypoint":"webhook-ingress","exportName":"registerWebhookTarget","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} -{"closureHash":"c3c217bf6e657834d414a4289eb7b117ab1f8bd105ae1d8e75731d22ab900c9d","declaration":"export function registerWebhookTargetWithPluginRoute(params: { targetsByPath: Map; target: T; route: RegisterWebhookPluginRouteOptions; onLastPathTargetRemoved?: RegisterWebhookTargetOptions[\"onLastPathTargetRemoved\"]; }): RegisteredWebhookTarget;","entrypoint":"webhook-ingress","exportName":"registerWebhookTargetWithPluginRoute","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} +{"closureHash":"844e417748d2413ce87c01b14fa8eed0332e1ae77fbc0053882fc3a0e89c687e","declaration":"export function registerWebhookTargetWithPluginRoute(params: { targetsByPath: Map; target: T; route: RegisterWebhookPluginRouteOptions; onLastPathTargetRemoved?: RegisterWebhookTargetOptions[\"onLastPathTargetRemoved\"]; }): RegisteredWebhookTarget;","entrypoint":"webhook-ingress","exportName":"registerWebhookTargetWithPluginRoute","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"ec2f47e9bd7a075a3dd4302ac9e4c0bfe20630445db6735cf803f2d354275841","declaration":"export function requestBodyErrorToText(code: RequestBodyLimitErrorCode): string;","entrypoint":"webhook-ingress","exportName":"requestBodyErrorToText","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"5e1f3b468d56eb0f82104184077fdf4b6bd0c1444aa10b71a65fcaa2ec0298a2","declaration":"export function resolveRequestClientIp(req?: IncomingMessage, trustedProxies?: string[], allowRealIpFallback?: boolean): string | undefined;","entrypoint":"webhook-ingress","exportName":"resolveRequestClientIp","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} {"closureHash":"56c3e9868dfa6ee2a7a128eb02039a16b52696759adadbd3fe0a3bd7a6a07eeb","declaration":"export function resolveSingleWebhookTarget(targets: readonly T[], isMatch: (target: T) => boolean): WebhookTargetMatchResult;","entrypoint":"webhook-ingress","exportName":"resolveSingleWebhookTarget","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"function","recordType":"export"} @@ -4699,7 +4699,7 @@ {"closureHash":"efb74e84339c15d6f607b38d1d477b0504d47d04ae78e77083a1893c756a0b54","declaration":"export const WEBHOOK_RATE_LIMIT_DEFAULTS: Readonly<{ windowMs: 60000; maxRequests: 120; maxTrackedKeys: 4096;}>;","entrypoint":"webhook-ingress","exportName":"WEBHOOK_RATE_LIMIT_DEFAULTS","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"const","recordType":"export"} {"closureHash":"13b28ec9acae43c3bdcd683b9831154f88118dee8142e42b7eebfd59f08c602c","declaration":"export type BoundedCounter = BoundedCounter;","entrypoint":"webhook-ingress","exportName":"BoundedCounter","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} {"closureHash":"9e737ae8c17038ef7becbd2bf1b756cfeaed571e2ded368c0fe3a446ebd1f666","declaration":"export type FixedWindowRateLimiter = FixedWindowRateLimiter;","entrypoint":"webhook-ingress","exportName":"FixedWindowRateLimiter","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} -{"closureHash":"6c4d74ddcfebaa9ed020a15e5076553b08f68c1461af40bb01caca22eed9612a","declaration":"export type RegisterWebhookPluginRouteOptions = RegisterWebhookPluginRouteOptions;","entrypoint":"webhook-ingress","exportName":"RegisterWebhookPluginRouteOptions","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} +{"closureHash":"77120f64d0e4c0f52498e606f90ef9457df7dea318dc333acde75f826f331ffa","declaration":"export type RegisterWebhookPluginRouteOptions = RegisterWebhookPluginRouteOptions;","entrypoint":"webhook-ingress","exportName":"RegisterWebhookPluginRouteOptions","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} {"closureHash":"b3e98619854462acfac6538ac9a2d0cefb88704a0eac712563f0996b07364152","declaration":"export type RegisterWebhookTargetOptions = RegisterWebhookTargetOptions;","entrypoint":"webhook-ingress","exportName":"RegisterWebhookTargetOptions","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} {"closureHash":"964c2bfd8f268c411ee7b982c9de02c207f4bec402dd62c9f998a59752bb9d1f","declaration":"export type RegisteredWebhookTarget = RegisteredWebhookTarget;","entrypoint":"webhook-ingress","exportName":"RegisteredWebhookTarget","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} {"closureHash":"aa552e5bdaefc9eb94d3b5a5cdf8c413fad555d9f452c6a2a6af5a3ce695c9d1","declaration":"export type WebhookAnomalyTracker = WebhookAnomalyTracker;","entrypoint":"webhook-ingress","exportName":"WebhookAnomalyTracker","importSpecifier":"openclaw/plugin-sdk/webhook-ingress","kind":"type","recordType":"export"} diff --git a/packages/memory-host-sdk/src/host/openclaw-runtime.ts b/packages/memory-host-sdk/src/host/openclaw-runtime.ts index 8a8578a51e85..74964ef58460 100644 --- a/packages/memory-host-sdk/src/host/openclaw-runtime.ts +++ b/packages/memory-host-sdk/src/host/openclaw-runtime.ts @@ -15,7 +15,7 @@ export { asToolParamsRecord, jsonResult, readNumberParam, - readStringParam, + readToolStringParam as readStringParam, } from "../../../../src/agents/tools/common.js"; export type { AnyAgentTool } from "../../../../src/agents/tools/common.js"; export { diff --git a/scripts/lib/export-name-collision-baseline.json b/scripts/lib/export-name-collision-baseline.json index db089282b06e..c8a40461ecf7 100644 --- a/scripts/lib/export-name-collision-baseline.json +++ b/scripts/lib/export-name-collision-baseline.json @@ -131,14 +131,6 @@ "src/plugins/loader-cache.ts" ] }, - { - "name": "clearRuntimeAuthProfileStoreSnapshots", - "files": [ - "src/agents/auth-profiles/runtime-snapshots.ts", - "src/agents/auth-profiles/store.ts" - ], - "sdk": true - }, { "name": "clearSecretsRuntimeSnapshot", "files": [ @@ -162,13 +154,6 @@ ], "sdk": true }, - { - "name": "compactEmbeddedAgentSessionDirect", - "files": [ - "src/agents/embedded-agent-runner/compact.runtime.ts", - "src/agents/embedded-agent-runner/compact.ts" - ] - }, { "name": "containsConfigIncludeDirective", "files": [ @@ -176,27 +161,6 @@ "src/plugins/install-persistence.ts" ] }, - { - "name": "countActiveDescendantRuns", - "files": [ - "src/agents/subagents/registry/subagent-registry-read.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, - { - "name": "countPendingDescendantRuns", - "files": [ - "src/agents/subagents/registry/subagent-registry-announce-read.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, - { - "name": "createCompactionDiagId", - "files": [ - "src/agents/embedded-agent-runner/compaction-diagnostics.ts", - "src/agents/embedded-agent-runner/run/helpers.ts" - ] - }, { "name": "createFixedWindowRateLimiter", "files": [ @@ -219,13 +183,6 @@ "src/plugins/logger.ts" ] }, - { - "name": "createSessionId", - "files": [ - "src/agents/sessions/session-manager-id.ts", - "src/agents/tools/transcripts-tool-runtime.ts" - ] - }, { "name": "createSuiteTempRootTracker", "files": [ @@ -312,14 +269,6 @@ "src/config/legacy.shared.ts" ] }, - { - "name": "extractAssistantText", - "files": [ - "src/agents/embedded-agent-utils.ts", - "src/agents/tools/chat-history-text.ts" - ], - "sdk": true - }, { "name": "extractAssistantVisibleText", "files": [ @@ -419,13 +368,6 @@ "src/test-utils/ports.ts" ] }, - { - "name": "getLatestSubagentRunByChildSessionKey", - "files": [ - "src/agents/subagents/registry/subagent-registry-read.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, { "name": "getReplyFromConfig", "files": [ @@ -450,14 +392,6 @@ ], "sdk": true }, - { - "name": "hasUsableOAuthCredential", - "files": [ - "src/agents/auth-profiles/credential-state.ts", - "src/agents/auth-profiles/oauth-shared.ts" - ], - "sdk": true - }, { "name": "inferToolMetaFromArgs", "files": [ @@ -567,13 +501,6 @@ "src/daemon/test-helpers/schtasks-fixtures.ts" ] }, - { - "name": "listDescendantRunsForRequester", - "files": [ - "src/agents/subagents/registry/subagent-registry-read.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, { "name": "listManagedPluginNpmRoots", "files": [ @@ -597,13 +524,6 @@ ], "sdk": true }, - { - "name": "listSubagentRunsForController", - "files": [ - "src/agents/subagents/registry/subagent-registry-read.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, { "name": "loadBundledPluginPublicSurface", "files": [ @@ -754,13 +674,6 @@ "src/infra/state-migrations.session-store.ts" ] }, - { - "name": "normalizeContainerPath", - "files": [ - "src/agents/sandbox/path-utils.ts", - "src/agents/sandbox/remote-fs-bridge-paths.ts" - ] - }, { "name": "normalizeCronRunDiagnostics", "files": [ @@ -948,14 +861,6 @@ ], "sdk": true }, - { - "name": "readStringParam", - "files": [ - "src/agents/tools/common.ts", - "src/agents/tools/transcripts-tool-runtime.ts" - ], - "sdk": true - }, { "name": "recordHookInstall", "files": [ @@ -993,21 +898,6 @@ ], "sdk": true }, - { - "name": "replaceRuntimeAuthProfileStoreSnapshots", - "files": [ - "src/agents/auth-profiles/runtime-snapshots.ts", - "src/agents/auth-profiles/store.ts" - ], - "sdk": true - }, - { - "name": "replaceSubagentRunAfterSteer", - "files": [ - "src/agents/subagents/registry/subagent-registry-runtime.ts", - "src/agents/subagents/registry/subagent-registry.ts" - ] - }, { "name": "reportClawHubPluginInstallTelemetry", "files": [ @@ -1037,13 +927,6 @@ ], "sdk": true }, - { - "name": "resolveAllowlistModelKey", - "files": [ - "src/agents/model-selection-shared.ts", - "src/agents/model-selection.ts" - ] - }, { "name": "resolveApiKeyForProvider", "files": [ @@ -1074,13 +957,6 @@ ], "sdk": true }, - { - "name": "resolveEffectiveOAuthCredential", - "files": [ - "src/agents/auth-profiles/effective-oauth.ts", - "src/agents/auth-profiles/oauth-manager.ts" - ] - }, { "name": "resolveEffectivePluginActivationState", "files": [ @@ -1138,13 +1014,6 @@ "src/cli/nodes-cli/rpc.ts" ] }, - { - "name": "resolveNodeClaudePlacement", - "files": [ - "src/agents/cli-runner/execute-node-claude.ts", - "src/agents/cli-runner/prepare-claude.ts" - ] - }, { "name": "resolveNodeId", "files": [ @@ -1355,14 +1224,6 @@ ], "sdk": true }, - { - "name": "truncateText", - "files": [ - "src/agents/harness/native-hook-relay-utils.ts", - "src/agents/tools/web-fetch-utils.ts" - ], - "sdk": true - }, { "name": "updateNpmInstalledHookPacks", "files": [ diff --git a/scripts/lib/wrapper-shadowing-baseline.json b/scripts/lib/wrapper-shadowing-baseline.json index 56d06ee4f7dc..8d48664fb8a9 100644 --- a/scripts/lib/wrapper-shadowing-baseline.json +++ b/scripts/lib/wrapper-shadowing-baseline.json @@ -14,11 +14,6 @@ "wrapped": "src/agents/auth-profiles/runtime-snapshots.ts", "wrapper": "src/agents/auth-profiles/store.ts" }, - { - "name": "clearRuntimeAuthProfileStoreSnapshots", - "wrapped": "src/agents/auth-profiles/runtime-snapshots.ts", - "wrapper": "src/agents/auth-profiles/store.ts" - }, { "name": "clearSecretsRuntimeSnapshot", "wrapped": "src/secrets/runtime-state.ts", @@ -147,11 +142,6 @@ "wrapped": "src/plugins/config-normalization-shared.ts", "wrapper": "src/plugins/config-state.ts" }, - { - "name": "hasUsableOAuthCredential", - "wrapped": "src/agents/auth-profiles/credential-state.ts", - "wrapper": "src/agents/auth-profiles/oauth-shared.ts" - }, { "name": "isAllowedParsedChatSender", "wrapped": "src/channels/plugins/chat-target-prefixes.ts", @@ -208,11 +198,6 @@ "wrapped": "src/tts/tts-payload.ts", "wrapper": "src/tts/tts.ts" }, - { - "name": "normalizeContainerPath", - "wrapped": "src/agents/sandbox/path-utils.ts", - "wrapper": "src/agents/sandbox/remote-fs-bridge-paths.ts" - }, { "name": "normalizeCronRunDiagnostics", "wrapped": "src/cron/run-diagnostics-normalize.ts", @@ -259,32 +244,17 @@ "wrapper": "src/plugin-sdk/session-transcript-runtime.ts", "via": "src/config/sessions/session-accessor.ts" }, - { - "name": "replaceRuntimeAuthProfileStoreSnapshots", - "wrapped": "src/agents/auth-profiles/runtime-snapshots.ts", - "wrapper": "src/agents/auth-profiles/store.ts" - }, { "name": "resolveAllowedModelRef", "wrapped": "src/agents/model-selection-resolve.ts", "wrapper": "src/agents/model-selection.ts" }, - { - "name": "resolveAllowlistModelKey", - "wrapped": "src/agents/model-selection-shared.ts", - "wrapper": "src/agents/model-selection.ts" - }, { "name": "resolveApiKeyForProvider", "wrapped": "src/agents/model-auth-provider.ts", "wrapper": "src/plugins/runtime/runtime-model-auth.runtime.ts", "via": "src/agents/model-auth.ts" }, - { - "name": "resolveEffectiveOAuthCredential", - "wrapped": "src/agents/auth-profiles/oauth-manager.ts", - "wrapper": "src/agents/auth-profiles/effective-oauth.ts" - }, { "name": "resolveHeartbeatPrompt", "wrapped": "src/auto-reply/heartbeat.ts", diff --git a/src/agents/agent-mcp-style.cache.live.test.ts b/src/agents/agent-mcp-style.cache.live.test.ts index c4a35bb1d3b2..4aa1993112c1 100644 --- a/src/agents/agent-mcp-style.cache.live.test.ts +++ b/src/agents/agent-mcp-style.cache.live.test.ts @@ -2,7 +2,7 @@ import type { AssistantMessage, Tool } from "openclaw/plugin-sdk/llm"; import { Type } from "typebox"; import { describe, expect, it } from "vitest"; -import { extractAssistantText } from "./embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "./embedded-agent-utils.js"; import { buildAssistantHistoryTurn, buildStableCachePrefix, @@ -80,7 +80,7 @@ async function runToolOnlyTurn(params: ToolOnlyTurnParams) { let response = await completeToolOnlyTurn(params, prompt, "openai mcp-style tool-only turn"); let toolCall = extractFirstToolCall(response); - let text = extractAssistantText(response); + let text = extractEmbeddedAssistantText(response); for (let attempt = 0; attempt < 2 && (!toolCall || text.length > 0); attempt += 1) { prompt = `Return only a tool call for \`${MCP_TOOL.name}\` with {}. No text.`; response = await completeToolOnlyTurn( @@ -89,7 +89,7 @@ async function runToolOnlyTurn(params: ToolOnlyTurnParams) { `openai mcp-style tool-only retry ${attempt + 1}`, ); toolCall = extractFirstToolCall(response); - text = extractAssistantText(response); + text = extractEmbeddedAssistantText(response); } expect(text.length).toBe(0); @@ -145,7 +145,7 @@ async function runOpenAiMcpStyleCacheProbe(params: { `openai mcp-style cache probe ${params.suffix}`, OPENAI_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, diff --git a/src/agents/auth-profiles.external-cli-sync.test.ts b/src/agents/auth-profiles.external-cli-sync.test.ts index 133d9c1eaf2d..4382a5499503 100644 --- a/src/agents/auth-profiles.external-cli-sync.test.ts +++ b/src/agents/auth-profiles.external-cli-sync.test.ts @@ -17,7 +17,7 @@ const mocks = vi.hoisted(() => ({ let readExternalCliBootstrapCredential: typeof import("./auth-profiles/external-cli-sync.js").readExternalCliBootstrapCredential; let resolveExternalCliAuthProfiles: typeof import("./auth-profiles/external-cli-sync.js").resolveExternalCliAuthProfiles; -let hasUsableOAuthCredential: typeof import("./auth-profiles/oauth-shared.js").hasUsableOAuthCredential; +let hasUsableOAuthCredential: typeof import("./auth-profiles/credential-state.js").hasUsableOAuthCredential; let shouldBootstrapFromExternalCliCredential: typeof import("./auth-profiles/oauth-shared.js").shouldBootstrapFromExternalCliCredential; let shouldReplaceStoredOAuthCredential: typeof import("./auth-profiles/oauth-shared.js").shouldReplaceStoredOAuthCredential; let CLAUDE_CLI_PROFILE_ID: typeof import("./auth-profiles/constants.js").CLAUDE_CLI_PROFILE_ID; @@ -119,11 +119,9 @@ describe("external cli oauth resolution", () => { mocks.readMiniMaxCliCredentialsCached.mockReset().mockReturnValue(null); ({ readExternalCliBootstrapCredential, resolveExternalCliAuthProfiles } = await import("./auth-profiles/external-cli-sync.js")); - ({ - hasUsableOAuthCredential, - shouldBootstrapFromExternalCliCredential, - shouldReplaceStoredOAuthCredential, - } = await import("./auth-profiles/oauth-shared.js")); + ({ hasUsableOAuthCredential } = await import("./auth-profiles/credential-state.js")); + ({ shouldBootstrapFromExternalCliCredential, shouldReplaceStoredOAuthCredential } = + await import("./auth-profiles/oauth-shared.js")); ({ CLAUDE_CLI_PROFILE_ID, OPENAI_CODEX_DEFAULT_PROFILE_ID, MINIMAX_CLI_PROFILE_ID } = await import("./auth-profiles/constants.js")); }); diff --git a/src/agents/auth-profiles.markauthprofilefailure.test.ts b/src/agents/auth-profiles.markauthprofilefailure.test.ts index 2a2b264527df..e0454697c422 100644 --- a/src/agents/auth-profiles.markauthprofilefailure.test.ts +++ b/src/agents/auth-profiles.markauthprofilefailure.test.ts @@ -19,11 +19,8 @@ vi.mock("../plugins/provider-runtime.js", () => ({ resolveExternalAuthProfilesWithPlugins: () => [], })); -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./auth-profiles/runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./auth-profiles/store.js"; import { calculateAuthProfileCooldownMs, markAuthProfileFailure, diff --git a/src/agents/auth-profiles.permissions.test.ts b/src/agents/auth-profiles.permissions.test.ts index b0f929c41b8f..aea2532ce9e3 100644 --- a/src/agents/auth-profiles.permissions.test.ts +++ b/src/agents/auth-profiles.permissions.test.ts @@ -26,12 +26,12 @@ const { } = await import("./auth-profiles/sqlite.js"); const { captureAuthProfileStorePersistenceSnapshot, - clearRuntimeAuthProfileStoreSnapshots, getRuntimeAuthProfileStoreSnapshot, - replaceRuntimeAuthProfileStoreSnapshots, saveAuthProfileStore, saveAuthProfileStoreIfPersistenceSnapshotMatches, } = await import("./auth-profiles/store.js"); +const { clearRuntimeAuthProfileStoreSnapshots, replaceRuntimeAuthProfileStoreSnapshots } = + await import("./auth-profiles/runtime-snapshots.js"); const { closeOpenClawAgentDatabasesForTest } = await import("../state/openclaw-agent-db.js"); const { closeOpenClawStateDatabaseForTest } = await import("../state/openclaw-state-db.js"); const tempDirs = useAutoCleanupTempDirTracker(afterEach); diff --git a/src/agents/auth-profiles.sqlite-store.test.ts b/src/agents/auth-profiles.sqlite-store.test.ts index d169311e5f9e..ca8e88febf3b 100644 --- a/src/agents/auth-profiles.sqlite-store.test.ts +++ b/src/agents/auth-profiles.sqlite-store.test.ts @@ -21,16 +21,18 @@ import { resolveOpenClawStateSqlitePath } from "../state/openclaw-state-db.paths import { withEnvAsync } from "../test-utils/env.js"; import { resolveAgentDir } from "./agent-scope.js"; import { loadPersistedAuthProfileStore } from "./auth-profiles/persisted.js"; +import { + clearRuntimeAuthProfileStoreSnapshots, + replaceRuntimeAuthProfileStoreSnapshots, +} from "./auth-profiles/runtime-snapshots.js"; import { inspectPersistedAuthProfileStateRaw, inspectPersistedAuthProfileStoreRaw, resolveAuthProfileDatabasePath, } from "./auth-profiles/sqlite.js"; import { - clearRuntimeAuthProfileStoreSnapshots, ensureAuthProfileStore, getRuntimeAuthProfileStoreSnapshotRevision, - replaceRuntimeAuthProfileStoreSnapshots, saveAuthProfileStore, } from "./auth-profiles/store.js"; import type { AuthProfileStore, OAuthCredential } from "./auth-profiles/types.js"; diff --git a/src/agents/auth-profiles.ts b/src/agents/auth-profiles.ts index bbe8dbbf564a..1bdaaf5a7df6 100644 --- a/src/agents/auth-profiles.ts +++ b/src/agents/auth-profiles.ts @@ -58,7 +58,6 @@ export { } from "./auth-profiles/portability.js"; export { clearRuntimeAuthProfileStoreSnapshot, - clearRuntimeAuthProfileStoreSnapshots, ensureAuthProfileStore, ensureAuthProfileStoreWithoutExternalProfiles, getPreparedRuntimeAuthProfileStoreSnapshot, @@ -70,7 +69,6 @@ export { loadAuthProfileStoreForSecretsRuntime, loadAuthProfileStoreWithoutExternalProfiles, loadAuthProfileStoreForRuntime, - replaceRuntimeAuthProfileStoreSnapshots, loadAuthProfileStore, saveAuthProfileStore, findPersistedAuthProfileCredential, @@ -78,6 +76,10 @@ export { withEnvOnlyAuthProfileStore, withAuthProfileStoreAgentDir, } from "./auth-profiles/store.js"; +export { + clearRuntimeAuthProfileStoreSnapshots, + replaceRuntimeAuthProfileStoreSnapshots, +} from "./auth-profiles/runtime-snapshots.js"; export type { ApiKeyCredential, AuthProfileBlockedReason, diff --git a/src/agents/auth-profiles/effective-oauth.ts b/src/agents/auth-profiles/effective-oauth.ts index 06dc7a835727..5a6c2f18b039 100644 --- a/src/agents/auth-profiles/effective-oauth.ts +++ b/src/agents/auth-profiles/effective-oauth.ts @@ -4,7 +4,7 @@ * bootstrap credentials to fill unusable local profile state. */ import { readExternalCliBootstrapCredential } from "./external-cli-sync.js"; -import { resolveEffectiveOAuthCredential as resolveManagedOAuthCredential } from "./oauth-manager.js"; +import { resolveEffectiveOAuthCredentialCore } from "./oauth-manager.js"; import type { AuthProfileStore, OAuthCredential } from "./types.js"; /** Resolves the effective OAuth credential, optionally reading external CLI bootstrap state. */ @@ -14,7 +14,7 @@ export function resolveEffectiveOAuthCredential(params: { credential: OAuthCredential; allowKeychainPrompt?: boolean; }): OAuthCredential { - return resolveManagedOAuthCredential({ + return resolveEffectiveOAuthCredentialCore({ store: params.store, profileId: params.profileId, credential: params.credential, diff --git a/src/agents/auth-profiles/external-cli-sync.ts b/src/agents/auth-profiles/external-cli-sync.ts index b86bc46b5a2e..db1363d355b1 100644 --- a/src/agents/auth-profiles/external-cli-sync.ts +++ b/src/agents/auth-profiles/external-cli-sync.ts @@ -16,10 +16,10 @@ import { OPENAI_CODEX_DEFAULT_PROFILE_ID, } from "./constants.js"; import { log } from "./constants.js"; +import { hasUsableOAuthCredential } from "./credential-state.js"; import { isSafeToCopyOAuthIdentity } from "./oauth-identity.js"; import { areOAuthCredentialsEquivalent, - hasUsableOAuthCredential, isSafeToAdoptBootstrapOAuthIdentity, shouldBootstrapFromExternalCliCredential, } from "./oauth-shared.js"; @@ -359,7 +359,7 @@ export function resolveExternalCliAuthProfiles( if ( existingOAuth && !providerConfig.bootstrapOnly && - hasUsableOAuthCredential(existingOAuth, now) + hasUsableOAuthCredential(existingOAuth, { now }) ) { // Profiles synced before identity capture carry no email; backfill the // non-secret metadata once the CLI read proves it is the same login. diff --git a/src/agents/auth-profiles/external-oauth.test.ts b/src/agents/auth-profiles/external-oauth.test.ts index f4c1b9a17c27..ec3c79385635 100644 --- a/src/agents/auth-profiles/external-oauth.test.ts +++ b/src/agents/auth-profiles/external-oauth.test.ts @@ -11,13 +11,12 @@ import { addEnvBackedAgentCredentials } from "../agent-auth-discovery-core.js"; import { overlayExternalAuthProfiles } from "./external-auth.js"; import { testing } from "./external-auth.test-support.js"; import { readExternalCliBootstrapCredential } from "./external-cli-sync.js"; -import { registerRuntimeAuthProfileStoreMutationListener } from "./runtime-snapshots.js"; import { clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - getRuntimeAuthProfileStoreSnapshot, + registerRuntimeAuthProfileStoreMutationListener, replaceRuntimeAuthProfileStoreSnapshots, -} from "./store.js"; +} from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, getRuntimeAuthProfileStoreSnapshot } from "./store.js"; import type { AuthProfileStore, OAuthCredential } from "./types.js"; const resolveExternalAuthProfilesWithPluginsMock = vi.fn< diff --git a/src/agents/auth-profiles/oauth-manager.test.ts b/src/agents/auth-profiles/oauth-manager.test.ts index 526c486039f9..1a28d1253a4c 100644 --- a/src/agents/auth-profiles/oauth-manager.test.ts +++ b/src/agents/auth-profiles/oauth-manager.test.ts @@ -17,8 +17,8 @@ import { isSafeToAdoptBootstrapOAuthIdentity, isSafeToAdoptMainStoreOAuthIdentity, } from "./oauth-shared.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; import { - clearRuntimeAuthProfileStoreSnapshots, ensureAuthProfileStore, ensureAuthProfileStoreWithoutExternalProfiles, saveAuthProfileStore, diff --git a/src/agents/auth-profiles/oauth-manager.ts b/src/agents/auth-profiles/oauth-manager.ts index 776f07abe43d..ac989c8c51fd 100644 --- a/src/agents/auth-profiles/oauth-manager.ts +++ b/src/agents/auth-profiles/oauth-manager.ts @@ -11,6 +11,7 @@ import { redactSensitiveText } from "../../logging/redact.js"; import { KeyedAsyncQueue } from "../../plugin-sdk/keyed-async-queue.js"; import { asDateTimestampMs } from "../../shared/number-coercion.js"; import { OAUTH_REFRESH_CALL_TIMEOUT_MS, OAUTH_REFRESH_LOCK_OPTIONS, log } from "./constants.js"; +import { hasUsableOAuthCredential } from "./credential-state.js"; import { shouldMirrorRefreshedOAuthCredential } from "./oauth-identity.js"; import { OAuthRefreshFailureError } from "./oauth-refresh-failure.js"; import { @@ -20,7 +21,6 @@ import { import { areOAuthCredentialsEquivalent, hasMatchingOAuthIdentity, - hasUsableOAuthCredential, isSafeToAdoptBootstrapOAuthIdentity, isSafeToAdoptMainStoreOAuthIdentity, shouldBootstrapFromExternalCliCredential, @@ -258,7 +258,7 @@ async function loadFreshStoredOAuthCredential(params: { } /** Select local OAuth unless a safe external bootstrap credential should win. */ -export function resolveEffectiveOAuthCredential(params: { +export function resolveEffectiveOAuthCredentialCore(params: { store: AuthProfileStore; profileId: string; credential: OAuthCredential; @@ -712,7 +712,7 @@ export function createOAuthManager(adapter: OAuthManagerAdapter) { agentDir: params.agentDir, credential: params.credential, }) ?? params.credential; - const effectiveCredential = resolveEffectiveOAuthCredential({ + const effectiveCredential = resolveEffectiveOAuthCredentialCore({ store: params.store, profileId: params.profileId, credential: adoptedCredential, diff --git a/src/agents/auth-profiles/oauth-refresh-queue.test.ts b/src/agents/auth-profiles/oauth-refresh-queue.test.ts index c4a7ef5ae6ac..82253ee70a7d 100644 --- a/src/agents/auth-profiles/oauth-refresh-queue.test.ts +++ b/src/agents/auth-profiles/oauth-refresh-queue.test.ts @@ -21,11 +21,8 @@ import { } from "./oauth-test-utils.js"; import { resolveApiKeyForProfile } from "./oauth.js"; import { resetOAuthRefreshQueuesForTest } from "./oauth.test-support.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; const { refreshProviderOAuthCredentialWithPluginMock, diff --git a/src/agents/auth-profiles/oauth-shared.ts b/src/agents/auth-profiles/oauth-shared.ts index cc3d9c4db9d2..c2cd9f104405 100644 --- a/src/agents/auth-profiles/oauth-shared.ts +++ b/src/agents/auth-profiles/oauth-shared.ts @@ -5,7 +5,7 @@ */ import { asDateTimestampMs } from "../../shared/number-coercion.js"; import { cloneAuthProfileStore } from "./clone.js"; -import { hasUsableOAuthCredential as hasUsableStoredOAuthCredential } from "./credential-state.js"; +import { hasUsableOAuthCredential } from "./credential-state.js"; import { isSafeToCopyOAuthIdentity, normalizeAuthEmailToken, @@ -73,14 +73,6 @@ export function shouldReplaceStoredOAuthCredential( return !hasNewerStoredOAuthCredential(existing, incoming); } -/** Returns true when an OAuth credential has a usable access token. */ -export function hasUsableOAuthCredential( - credential: OAuthCredential | undefined, - now = Date.now(), -): boolean { - return hasUsableStoredOAuthCredential(credential, { now }); -} - /** Returns true when an OAuth credential has account or email identity. */ export function hasOAuthIdentity( credential: Pick, @@ -155,10 +147,10 @@ export function shouldBootstrapFromExternalCliCredential(params: { now?: number; }): boolean { const now = params.now ?? Date.now(); - if (hasUsableOAuthCredential(params.existing, now)) { + if (hasUsableOAuthCredential(params.existing, { now })) { return false; } - return hasUsableOAuthCredential(params.imported, now); + return hasUsableOAuthCredential(params.imported, { now }); } /** Overlays runtime external OAuth profiles on a cloned store. */ diff --git a/src/agents/auth-profiles/oauth.adopt-identity.test.ts b/src/agents/auth-profiles/oauth.adopt-identity.test.ts index 1f32ef18b5ed..c334a36ed72e 100644 --- a/src/agents/auth-profiles/oauth.adopt-identity.test.ts +++ b/src/agents/auth-profiles/oauth.adopt-identity.test.ts @@ -25,11 +25,8 @@ import { } from "./oauth-test-utils.js"; import { resolveApiKeyForProfile } from "./oauth.js"; import { resetOAuthRefreshQueuesForTest } from "./oauth.test-support.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; import type { AuthProfileStore } from "./types.js"; const { diff --git a/src/agents/auth-profiles/oauth.concurrent-agents.test.ts b/src/agents/auth-profiles/oauth.concurrent-agents.test.ts index 19e1983ec8b2..3af79117b633 100644 --- a/src/agents/auth-profiles/oauth.concurrent-agents.test.ts +++ b/src/agents/auth-profiles/oauth.concurrent-agents.test.ts @@ -19,11 +19,8 @@ import { resolveApiKeyForProfileInTest, resetOAuthProviderRuntimeMocks, } from "./oauth-test-utils.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; const { refreshProviderOAuthCredentialWithPluginMock, diff --git a/src/agents/auth-profiles/oauth.fallback-to-main-agent.test.ts b/src/agents/auth-profiles/oauth.fallback-to-main-agent.test.ts index 0e5200b61a3f..fef900cb995d 100644 --- a/src/agents/auth-profiles/oauth.fallback-to-main-agent.test.ts +++ b/src/agents/auth-profiles/oauth.fallback-to-main-agent.test.ts @@ -12,11 +12,8 @@ import { closeOpenClawAgentDatabasesForTest } from "../../state/openclaw-agent-d import { captureEnv, setTestEnvValue } from "../../test-utils/env.js"; import { resolveApiKeyForProfile } from "./oauth.js"; import { loadPersistedAuthProfileStore } from "./persisted.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; import type { AuthProfileStore } from "./types.js"; const { getOAuthApiKeyMock } = vi.hoisted(() => { vi.resetModules(); diff --git a/src/agents/auth-profiles/oauth.mirror-refresh.test.ts b/src/agents/auth-profiles/oauth.mirror-refresh.test.ts index 27acd585f05a..7bc3ef79d208 100644 --- a/src/agents/auth-profiles/oauth.mirror-refresh.test.ts +++ b/src/agents/auth-profiles/oauth.mirror-refresh.test.ts @@ -24,11 +24,8 @@ import { } from "./oauth-test-utils.js"; import { resolveApiKeyForProfile } from "./oauth.js"; import { resetOAuthRefreshQueuesForTest } from "./oauth.test-support.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; import type { AuthProfileStore, OAuthCredential } from "./types.js"; const { diff --git a/src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts b/src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts index 6f98b6101060..a7d2b7724d03 100644 --- a/src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts +++ b/src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts @@ -18,11 +18,8 @@ import { createExpiredOauthStore, readAuthProfileStoreForTest, } from "./oauth-test-utils.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, - saveAuthProfileStore, -} from "./store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./runtime-snapshots.js"; +import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js"; import type { AuthProfileStore, OAuthCredential } from "./types.js"; let resolveApiKeyForProfile: typeof import("./oauth.js").resolveApiKeyForProfile; let resolveApiKeyForProvider: typeof import("../model-auth.js").resolveApiKeyForProvider; diff --git a/src/agents/auth-profiles/persisted.ts b/src/agents/auth-profiles/persisted.ts index 6054251aaba8..923a73a874f1 100644 --- a/src/agents/auth-profiles/persisted.ts +++ b/src/agents/auth-profiles/persisted.ts @@ -10,10 +10,10 @@ import { coerceSecretRef } from "../../config/types.secrets.js"; import type { OpenClawAgentDatabase } from "../../state/openclaw-agent-db.js"; import { asBoolean } from "../../utils/boolean.js"; import { AUTH_STORE_VERSION, log } from "./constants.js"; +import { hasUsableOAuthCredential } from "./credential-state.js"; import { isLegacyOAuthRef } from "./legacy-oauth-ref.js"; import { hasOAuthIdentity, - hasUsableOAuthCredential, isSafeToAdoptMainStoreOAuthIdentity, normalizeAuthEmailToken, normalizeAuthIdentityToken, diff --git a/src/agents/auth-profiles/profiles.test.ts b/src/agents/auth-profiles/profiles.test.ts index b7050c689774..6c141671537b 100644 --- a/src/agents/auth-profiles/profiles.test.ts +++ b/src/agents/auth-profiles/profiles.test.ts @@ -28,20 +28,20 @@ import { upsertAuthProfileWithLock, } from "./profiles.js"; import { + clearRuntimeAuthProfileStoreSnapshots, getRuntimeAuthProfileStoreSnapshot as getInternalRuntimeAuthProfileStoreSnapshot, getRuntimeAuthProfileStoreCredentialMutationToken, getRuntimeAuthProfileStoreCredentialsRevision, getRuntimeAuthProfileStoreStateMutationToken, + replaceRuntimeAuthProfileStoreSnapshots, } from "./runtime-snapshots.js"; import { resolveAuthProfileDatabasePath, runAuthProfileWriteTransaction } from "./sqlite.js"; import { captureAuthProfileStorePersistenceSnapshot, - clearRuntimeAuthProfileStoreSnapshots, ensureAuthProfileStoreWithoutExternalProfiles, getRuntimeAuthProfileStoreSnapshot, loadAuthProfileStoreForRuntime, loadAuthProfileStoreWithoutExternalProfiles, - replaceRuntimeAuthProfileStoreSnapshots, restoreAuthProfileStorePersistenceSnapshot, saveAuthProfileStoreIfPersistenceSnapshotMatches, saveAuthProfileStore, diff --git a/src/agents/auth-profiles/runtime-snapshots.ts b/src/agents/auth-profiles/runtime-snapshots.ts index 56fade110b05..613a077984b2 100644 --- a/src/agents/auth-profiles/runtime-snapshots.ts +++ b/src/agents/auth-profiles/runtime-snapshots.ts @@ -293,7 +293,7 @@ export function hasAnyRuntimeAuthProfileStoreSource(agentDir?: string): boolean /** Replaces all runtime auth profile snapshots with cloned entries. */ export function replaceRuntimeAuthProfileStoreSnapshots( - entries: Array<{ agentDir?: string; store: RuntimeAuthProfileStore }>, + entries: Array<{ agentDir?: string; store: AuthProfileStore }>, ): void { const credentialsChanged = replaceChangesCredentials(entries); const ownerChanged = replaceChangesOwner(entries); diff --git a/src/agents/auth-profiles/store.ts b/src/agents/auth-profiles/store.ts index 5a3b48ceebf4..b59a79b8dc2a 100644 --- a/src/agents/auth-profiles/store.ts +++ b/src/agents/auth-profiles/store.ts @@ -45,13 +45,13 @@ import { } from "./persisted.js"; import { clearRuntimeAuthProfileStoreSnapshot as clearRuntimeAuthProfileStoreSnapshotImpl, - clearRuntimeAuthProfileStoreSnapshots as clearRuntimeAuthProfileStoreSnapshotsImpl, + clearRuntimeAuthProfileStoreSnapshots, getPreparedRuntimeAuthProfileStoreSnapshot as getPreparedRuntimeAuthProfileStoreSnapshotImpl, getRuntimeAuthProfileStoreSnapshot as getRuntimeAuthProfileStoreSnapshotImpl, getRuntimeAuthProfileStoreSnapshotRevision, noteRuntimeAuthProfileStorePersistedMutation, listRuntimeAuthProfileStoreSnapshots, - replaceRuntimeAuthProfileStoreSnapshots as replaceRuntimeAuthProfileStoreSnapshotsImpl, + replaceRuntimeAuthProfileStoreSnapshots, setRuntimeAuthProfileStoreSnapshot, } from "./runtime-snapshots.js"; import { @@ -209,7 +209,7 @@ function publishRuntimeSnapshotsAfterCommit(publish: (() => void) | undefined): } return true; } catch (err) { - clearRuntimeAuthProfileStoreSnapshotsImpl(); + clearRuntimeAuthProfileStoreSnapshots(); log.warn("auth profile store committed but runtime snapshot publication failed", { err }); return false; } @@ -1322,18 +1322,6 @@ export function getPreparedRuntimeAuthProfileStoreSnapshot( export { getRuntimeAuthProfileStoreSnapshotRevision }; -/** Replace runtime auth-profile snapshots, used by tests and prepared runtimes. */ -export function replaceRuntimeAuthProfileStoreSnapshots( - entries: Array<{ agentDir?: string; store: AuthProfileStore }>, -): void { - replaceRuntimeAuthProfileStoreSnapshotsImpl(entries); -} - -/** Clear all runtime auth-profile snapshots. */ -export function clearRuntimeAuthProfileStoreSnapshots(): void { - clearRuntimeAuthProfileStoreSnapshotsImpl(); -} - /** Clear one runtime auth-profile snapshot. */ export function clearRuntimeAuthProfileStoreSnapshot(agentDir?: string): boolean { return clearRuntimeAuthProfileStoreSnapshotImpl(agentDir); @@ -1588,7 +1576,7 @@ function replaceRuntimeAuthProfileStoreSnapshot( return; } const replacedAuthPath = resolveAuthStorePath(agentDir); - replaceRuntimeAuthProfileStoreSnapshotsImpl( + replaceRuntimeAuthProfileStoreSnapshots( listRuntimeAuthProfileStoreSnapshots().filter( (entry) => resolveAuthStorePath(entry.agentDir) !== replacedAuthPath, ), diff --git a/src/agents/cli-runner/execute-node-claude.ts b/src/agents/cli-runner/execute-node-claude.ts index d67abb99fcf5..4d6c8cf9cdcc 100644 --- a/src/agents/cli-runner/execute-node-claude.ts +++ b/src/agents/cli-runner/execute-node-claude.ts @@ -14,7 +14,7 @@ const NODE_CLI_MAX_IDLE_TIMEOUT_MS = 30 * 60 * 1000; type NodeClaudePlacement = { nodeId: string; cwd?: string }; -export function resolveNodeClaudePlacement( +export function resolveNodeClaudeTarget( context: PreparedCliRunContext, ): NodeClaudePlacement | null { const entry = context.params.sessionEntry; diff --git a/src/agents/cli-runner/execute-process.ts b/src/agents/cli-runner/execute-process.ts index e24b25a4b18c..d858152b25e1 100644 --- a/src/agents/cli-runner/execute-process.ts +++ b/src/agents/cli-runner/execute-process.ts @@ -19,7 +19,7 @@ import type { CliEventHandlers } from "./execute-events.js"; import { createCliAbortError, executeNodeClaudeRun, - type resolveNodeClaudePlacement, + type resolveNodeClaudeTarget, } from "./execute-node-claude.js"; import { appendCliOutputTail } from "./execute-output-buffer.js"; import type { CliToolTracking } from "./execute-tool-tracking.js"; @@ -66,7 +66,7 @@ export async function executeCliProcess(params: { events: CliEventHandlers; toolTracking: CliToolTracking; diagnostics: ReturnType; - nodePlacement: ReturnType; + nodePlacement: ReturnType; nodeSystemPrompt?: string; nodeEnv?: Record; nodeClearEnv?: string[]; diff --git a/src/agents/cli-runner/execute.ts b/src/agents/cli-runner/execute.ts index dbdbe6530f12..84731e11f863 100644 --- a/src/agents/cli-runner/execute.ts +++ b/src/agents/cli-runner/execute.ts @@ -38,7 +38,7 @@ import { } from "./execute-logging.js"; import { createCliAbortError, - resolveNodeClaudePlacement, + resolveNodeClaudeTarget, stripGatewayLocalClaudeArgs, } from "./execute-node-claude.js"; import { executeCliProcess } from "./execute-process.js"; @@ -138,7 +138,7 @@ export async function executePreparedCliRun( throw createCliAbortError(); } const backend = context.preparedBackend.backend; - const nodePlacement = resolveNodeClaudePlacement(context); + const nodePlacement = resolveNodeClaudeTarget(context); const { sessionId: resolvedSessionId, isNew } = resolveSessionIdToSend({ backend, cliSessionId: cliSessionIdToUse, diff --git a/src/agents/cli-runner/prepare-claude.ts b/src/agents/cli-runner/prepare-claude.ts index c017d9cf432d..0ee7947034b6 100644 --- a/src/agents/cli-runner/prepare-claude.ts +++ b/src/agents/cli-runner/prepare-claude.ts @@ -15,7 +15,7 @@ export const CLAUDE_CLI_CONTEXT_MODEL_ALIASES: Record = { "fable-5": "claude-fable-5", }; -export function resolveNodeClaudePlacement(params: { +export function detectNodeClaudePlacement(params: { backendId: string; execHost?: string; execNode?: string; diff --git a/src/agents/cli-runner/prepare.ts b/src/agents/cli-runner/prepare.ts index 96e1293cffda..82c38cd23ffc 100644 --- a/src/agents/cli-runner/prepare.ts +++ b/src/agents/cli-runner/prepare.ts @@ -131,7 +131,7 @@ import { import { buildCliAgentSystemPrompt, isClaudeCliProvider, normalizeCliModel } from "./helpers.js"; import { cliBackendLog } from "./log.js"; import { buildCliMcpGrantContext, normalizeOptionalMcpContextValue } from "./mcp-grant-context.js"; -import { CLAUDE_CLI_CONTEXT_MODEL_ALIASES, resolveNodeClaudePlacement } from "./prepare-claude.js"; +import { CLAUDE_CLI_CONTEXT_MODEL_ALIASES, detectNodeClaudePlacement } from "./prepare-claude.js"; import { buildCliSessionHistoryPrompt, hasCliSessionTranscript, @@ -517,7 +517,7 @@ export async function prepareCliRunContext( }; } const internalParams = params as RunCliAgentPrepareParams; - const nodeClaudePlacement = resolveNodeClaudePlacement({ + const nodeClaudePlacement = detectNodeClaudePlacement({ backendId: backendResolved.id, execHost: params.sessionEntry?.execHost, execNode: params.sessionEntry?.execNode, diff --git a/src/agents/command/attempt-execution.cli.test.ts b/src/agents/command/attempt-execution.cli.test.ts index 6c440f029656..4d938a1cfee9 100644 --- a/src/agents/command/attempt-execution.cli.test.ts +++ b/src/agents/command/attempt-execution.cli.test.ts @@ -30,10 +30,8 @@ import { resetGeneratedMediaTaskActivityForTests } from "../../tasks/task-runtim import { createSuiteTempRootTracker } from "../../test-helpers/temp-dir.js"; import { captureEnv, setTestEnvValue } from "../../test-utils/env.js"; import { createTestPreparedRunAdmission } from "../admitted-run-context.test-support.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - saveAuthProfileStore, -} from "../auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../auth-profiles/runtime-snapshots.js"; +import { saveAuthProfileStore } from "../auth-profiles/store.js"; import { testing as cliBackendsTesting } from "../cli-backends.test-support.js"; import type { EmbeddedAgentRunResult } from "../embedded-agent.js"; import { FailoverError } from "../failover-error.js"; diff --git a/src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts b/src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts index e67020e76463..c8f124639247 100644 --- a/src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts +++ b/src/agents/embedded-agent-runner.anthropic-tool-replay.live.test.ts @@ -2,7 +2,7 @@ import type { Message, Model } from "openclaw/plugin-sdk/llm"; import { describe, expect, it, vi } from "vitest"; import { wrapStreamFnSanitizeMalformedToolCalls } from "./embedded-agent-runner/run/attempt.tool-call-normalization.js"; -import { extractAssistantText } from "./embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "./embedded-agent-utils.js"; import { completeSimpleWithLiveTimeout, logLiveCache } from "./live-cache-test-support.js"; import { isLiveTestEnabled } from "./live-test-helpers.js"; import { buildAssistantMessage, buildUsageWithNoCost } from "./stream-message-shared.js"; @@ -100,7 +100,7 @@ describeLive("embedded agent anthropic replay sanitization (live)", () => { ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); logLiveCache(`anthropic regular replay live result=${JSON.stringify(text)}`); if (shouldSkipEmptyAnthropicReplayResult("regular replay", text)) { return; @@ -147,7 +147,7 @@ describeLive("embedded agent anthropic replay sanitization (live)", () => { ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); logLiveCache(`anthropic omitted-reasoning replay live result=${JSON.stringify(text)}`); if (shouldSkipEmptyAnthropicReplayResult("omitted reasoning replay", text)) { return; @@ -216,7 +216,7 @@ describeLive("embedded agent anthropic replay sanitization (live)", () => { ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); logLiveCache(`anthropic replay live result=${JSON.stringify(text)}`); expect(response.content.length).toBeGreaterThanOrEqual(0); }, diff --git a/src/agents/embedded-agent-runner.cache.live.test.ts b/src/agents/embedded-agent-runner.cache.live.test.ts index 8f811804d7ab..00be231dc593 100644 --- a/src/agents/embedded-agent-runner.cache.live.test.ts +++ b/src/agents/embedded-agent-runner.cache.live.test.ts @@ -9,8 +9,8 @@ import type { OpenClawConfig } from "../config/config.js"; import { deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js"; import { createTestAdmittedRunContext } from "./admitted-run-context.test-support.js"; import { runEmbeddedAgent } from "./embedded-agent-runner.js"; -import { compactEmbeddedAgentSessionDirect } from "./embedded-agent-runner/compact.runtime.js"; -import { extractAssistantText } from "./embedded-agent-utils.js"; +import { compactEmbeddedAgentSessionOnDemand } from "./embedded-agent-runner/compact.runtime.js"; +import { extractEmbeddedAssistantText } from "./embedded-agent-utils.js"; import { buildAssistantHistoryTurn as buildTypedAssistantHistoryTurn, buildStableCachePrefix, @@ -370,7 +370,7 @@ async function compactLiveCacheSession(params: { const sessionPaths = buildRunnerSessionPaths(params.sessionId); await fs.mkdir(sessionPaths.workspaceDir, { recursive: true }); return await withLiveCacheHeartbeat( - compactEmbeddedAgentSessionDirect({ + compactEmbeddedAgentSessionOnDemand({ sessionId: params.sessionId, sessionKey: `live-cache:${params.providerTag}:${params.sessionId}`, sessionFile: sessionPaths.sessionFile, @@ -449,7 +449,7 @@ async function runToolOnlyTurn(params: { ); let toolCall = extractFirstToolCall(response); - let text = extractAssistantText(response); + let text = extractEmbeddedAssistantText(response); for (let attempt = 0; attempt < 2 && (!toolCall || text.length > 0); attempt += 1) { prompt = `Return only a tool call for \`${params.tool.name}\` with {}. No text.`; response = await completeSimpleWithLiveTimeout( @@ -477,7 +477,7 @@ async function runToolOnlyTurn(params: { params.providerTag === "openai" ? OPENAI_TIMEOUT_MS : ANTHROPIC_TIMEOUT_MS, ); toolCall = extractFirstToolCall(response); - text = extractAssistantText(response); + text = extractEmbeddedAssistantText(response); } expect(text.length).toBe(0); @@ -542,7 +542,7 @@ async function runOpenAiToolCacheProbe(params: { `openai cache probe ${params.suffix}`, OPENAI_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, @@ -580,7 +580,7 @@ async function runOpenAiCacheProbe(params: { `openai cache probe ${params.suffix}`, OPENAI_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, @@ -621,7 +621,7 @@ async function runOpenAiImageCacheProbe(params: { `openai image cache probe ${params.suffix}`, OPENAI_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, @@ -660,7 +660,7 @@ async function runAnthropicCacheProbe(params: { `anthropic cache probe ${params.suffix} (${params.cacheRetention})`, ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, @@ -719,7 +719,7 @@ async function runAnthropicToolCacheProbe(params: { `anthropic cache probe ${params.suffix} (${params.cacheRetention})`, ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, @@ -760,7 +760,7 @@ async function runAnthropicImageCacheProbe(params: { `anthropic image cache probe ${params.suffix} (${params.cacheRetention})`, ANTHROPIC_TIMEOUT_MS, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); expect(text.toLowerCase()).toContain(params.suffix.toLowerCase()); return { suffix: params.suffix, diff --git a/src/agents/embedded-agent-runner/compact.runtime.ts b/src/agents/embedded-agent-runner/compact.runtime.ts index c766113e2e40..9f8f2025ab1f 100644 --- a/src/agents/embedded-agent-runner/compact.runtime.ts +++ b/src/agents/embedded-agent-runner/compact.runtime.ts @@ -12,10 +12,9 @@ function loadCompactRuntime() { } /** Loads the compaction runtime on demand and forwards the direct compaction call. */ -export async function compactEmbeddedAgentSessionDirect( +export async function compactEmbeddedAgentSessionOnDemand( params: CompactEmbeddedAgentSessionRuntimeParams, ): Promise { - const { compactEmbeddedAgentSessionDirect: compactEmbeddedAgentSessionDirectLocal } = - await loadCompactRuntime(); - return compactEmbeddedAgentSessionDirectLocal(params); + const { compactEmbeddedAgentSessionDirect } = await loadCompactRuntime(); + return compactEmbeddedAgentSessionDirect(params); } diff --git a/src/agents/embedded-agent-runner/compaction-diagnostics.ts b/src/agents/embedded-agent-runner/compaction-diagnostics.ts index 9e7019c6f312..73d0e76fb16e 100644 --- a/src/agents/embedded-agent-runner/compaction-diagnostics.ts +++ b/src/agents/embedded-agent-runner/compaction-diagnostics.ts @@ -11,7 +11,7 @@ import type { CompactionMessageMetrics } from "./compact.types.js"; export const hasRealConversationContent = isRealConversationMessage; -export function createCompactionDiagId(): string { +export function createDirectCompactionDiagId(): string { return `cmp-${Date.now().toString(36)}-${generateSecureToken(4)}`; } diff --git a/src/agents/embedded-agent-runner/direct-compaction-preparation.ts b/src/agents/embedded-agent-runner/direct-compaction-preparation.ts index 4a8c0e38bb59..442d2c472ee3 100644 --- a/src/agents/embedded-agent-runner/direct-compaction-preparation.ts +++ b/src/agents/embedded-agent-runner/direct-compaction-preparation.ts @@ -35,7 +35,7 @@ import { formatUnknownCompactionReasonDetail, } from "./compact-reasons.js"; import type { CompactEmbeddedAgentSessionRuntimeParams } from "./compact.types.js"; -import { createCompactionDiagId } from "./compaction-diagnostics.js"; +import { createDirectCompactionDiagId } from "./compaction-diagnostics.js"; import { resolveEmbeddedCompactionThinkingLevel } from "./compaction-runtime-context.js"; import { prepareCompactionHarnessAuth, @@ -54,7 +54,7 @@ export async function prepareDirectCompactionAttempt( params: PreparedCompactEmbeddedAgentSessionParams, ) { const startedAt = Date.now(); - const diagId = params.diagId?.trim() || createCompactionDiagId(); + const diagId = params.diagId?.trim() || createDirectCompactionDiagId(); const trigger = params.trigger ?? "manual"; const attempt = params.attempt ?? 1; const maxAttempts = params.maxAttempts ?? 1; diff --git a/src/agents/embedded-agent-runner/run/helpers.ts b/src/agents/embedded-agent-runner/run/helpers.ts index 7fd5273bd05f..79c1d93f5818 100644 --- a/src/agents/embedded-agent-runner/run/helpers.ts +++ b/src/agents/embedded-agent-runner/run/helpers.ts @@ -113,7 +113,7 @@ export function resolveEmbeddedAttemptBasePrompt(params: { return scrubAnthropicRefusalMagic(params.prompt); } -export function createCompactionDiagId(): string { +export function createRunRecoveryDiagId(): string { return `ovf-${Date.now().toString(36)}-${generateSecureToken(4)}`; } diff --git a/src/agents/embedded-agent-runner/run/overflow-context-recovery.ts b/src/agents/embedded-agent-runner/run/overflow-context-recovery.ts index eafc52fbca22..de01b399d356 100644 --- a/src/agents/embedded-agent-runner/run/overflow-context-recovery.ts +++ b/src/agents/embedded-agent-runner/run/overflow-context-recovery.ts @@ -25,7 +25,7 @@ import { compactEmbeddedRunForRecovery, type EmbeddedRunCompactionRecoveryInput, } from "./compaction-runtime.js"; -import { createCompactionDiagId } from "./helpers.js"; +import { createRunRecoveryDiagId } from "./helpers.js"; import { isNoRealConversationCompactionNoop, resetNoRealConversationTokenSnapshot, @@ -102,7 +102,7 @@ export async function recoverEmbeddedRunOverflow( : undefined; const runParams = input.runParams; - const overflowDiagId = createCompactionDiagId(); + const overflowDiagId = createRunRecoveryDiagId(); const errorText = contextOverflowError.text; const observedOverflowTokens = extractObservedOverflowTokenCount(errorText); const preflightRecovery = input.attempt.preflightRecovery; diff --git a/src/agents/embedded-agent-runner/run/timeout-context-recovery.ts b/src/agents/embedded-agent-runner/run/timeout-context-recovery.ts index 7c9b52acedf3..aa8afd47a38b 100644 --- a/src/agents/embedded-agent-runner/run/timeout-context-recovery.ts +++ b/src/agents/embedded-agent-runner/run/timeout-context-recovery.ts @@ -5,7 +5,7 @@ import { compactEmbeddedRunForRecovery, type EmbeddedRunCompactionRecoveryInput, } from "./compaction-runtime.js"; -import { createCompactionDiagId } from "./helpers.js"; +import { createRunRecoveryDiagId } from "./helpers.js"; const MAX_TIMEOUT_COMPACTION_ATTEMPTS = 2; @@ -50,7 +50,7 @@ export async function recoverEmbeddedRunTimeout( return false; } - const timeoutDiagId = createCompactionDiagId(); + const timeoutDiagId = createRunRecoveryDiagId(); input.state.timeoutCompactionAttempts += 1; log.warn( `[timeout-compaction] LLM timed out with high prompt token usage (${Math.round(tokenUsedRatio * 100)}%); ` + diff --git a/src/agents/embedded-agent-subscribe.handlers.messages.ts b/src/agents/embedded-agent-subscribe.handlers.messages.ts index 35b79b252a27..8331bcbb4890 100644 --- a/src/agents/embedded-agent-subscribe.handlers.messages.ts +++ b/src/agents/embedded-agent-subscribe.handlers.messages.ts @@ -38,7 +38,7 @@ import { isPromiseLike } from "./embedded-agent-subscribe.promise.js"; import { appendRawStream } from "./embedded-agent-subscribe.raw-stream.js"; import { warnIfAssistantEmittedSuspiciousText } from "./embedded-agent-subscribe.tool-text-diagnostics.js"; import { - extractAssistantText, + extractEmbeddedAssistantText, extractAssistantThinking, extractAssistantCommentaryText, extractAssistantVisibleText, @@ -1292,7 +1292,7 @@ export function handleMessageEnd( event: "assistant_message_end", runId: ctx.params.runId, sessionId: (ctx.params.session as { id?: string }).id, - rawText: coerceChatContentText(extractAssistantText(assistantMessage)), + rawText: coerceChatContentText(extractEmbeddedAssistantText(assistantMessage)), rawThinking: extractAssistantThinking(assistantMessage), }); const commentaryAlreadyStreamed = @@ -1329,7 +1329,7 @@ export function handleMessageEnd( } promoteThinkingTagsToBlocks(assistantMessage); - const rawText = coerceChatContentText(extractAssistantText(assistantMessage)); + const rawText = coerceChatContentText(extractEmbeddedAssistantText(assistantMessage)); const rawVisibleText = coerceChatContentText(extractAssistantVisibleText(assistantMessage)); appendRawStream({ ts: Date.now(), diff --git a/src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-tag-streaming.test.ts b/src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-tag-streaming.test.ts index 3a30719abbea..5e628546fda1 100644 --- a/src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-tag-streaming.test.ts +++ b/src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-tag-streaming.test.ts @@ -88,7 +88,7 @@ describe("subscribeEmbeddedAgentSession", () => { }); // With enforceFinalTag, content is emitted via streaming (text_delta path), - // NOT recovered from message_end fallback. extractAssistantText strips + // NOT recovered from message_end fallback. extractEmbeddedAssistantText strips // tags, so message_end would see plain text with no markers // and correctly suppress it (treated as reasoning leak). emit({ type: "message_start", message: { role: "assistant" } }); diff --git a/src/agents/embedded-agent-utils.test.ts b/src/agents/embedded-agent-utils.test.ts index d39cb447857d..b294b4a38da8 100644 --- a/src/agents/embedded-agent-utils.test.ts +++ b/src/agents/embedded-agent-utils.test.ts @@ -5,7 +5,7 @@ import type { AssistantMessage } from "openclaw/plugin-sdk/llm"; import { describe, expect, it } from "vitest"; import { - extractAssistantText, + extractEmbeddedAssistantText, extractAssistantThinking, extractAssistantVisibleText, createThinkingTagStreamState, @@ -112,7 +112,7 @@ describe("extractThinkingFromTaggedStream", () => { }); }); -describe("extractAssistantText", () => { +describe("extractEmbeddedAssistantText", () => { it("strips tool-only Minimax invocation XML from text", () => { const cases = [ ` @@ -130,7 +130,7 @@ describe("extractAssistantText", () => { content: [{ type: "text", text }], timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe(""); + expect(extractEmbeddedAssistantText(msg)).toBe(""); } }); @@ -246,7 +246,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe(expected); }); @@ -262,7 +262,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe( `Example:\n\nls\n`, ); @@ -277,7 +277,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe("HTTP 500: Internal Server Error"); }); @@ -293,7 +293,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe( "Firebase downgraded Chore Champ to the Spark plan; confirm whether billing should be re-enabled.", ); @@ -309,7 +309,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe(responseText); }); @@ -336,7 +336,7 @@ Back to the user.`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe("First block.\nThird block."); }); @@ -366,7 +366,7 @@ File contents here`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); expect(result).toBe("Here's what I found:\nDone checking."); }); @@ -382,7 +382,7 @@ File contents here`, timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe("Let me check.\n\n Done."); + expect(extractEmbeddedAssistantText(msg)).toBe("Let me check.\n\n Done."); }); it("strips raw XML blocks from assistant text", () => { @@ -397,7 +397,7 @@ File contents here`, timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe("Prefix\n\nSuffix"); + expect(extractEmbeddedAssistantText(msg)).toBe("Prefix\n\nSuffix"); }); it("strips raw workflow blocks from assistant text", () => { @@ -419,7 +419,7 @@ File contents here`, timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe("Prefix\n\nSuffix"); + expect(extractEmbeddedAssistantText(msg)).toBe("Prefix\n\nSuffix"); }); it("strips dangling XML content to end-of-string", () => { @@ -434,7 +434,7 @@ File contents here`, timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe("Let me run."); + expect(extractEmbeddedAssistantText(msg)).toBe("Let me run."); }); it("strips mixed and XML blocks from assistant text", () => { @@ -454,7 +454,7 @@ File contents here`, timestamp: Date.now(), }); - expect(extractAssistantText(msg)).toBe( + expect(extractEmbeddedAssistantText(msg)).toBe( "I will read the file.\n\n\nThe file contains: hello world", ); }); @@ -472,7 +472,7 @@ File contents here`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); // The mismatched closing tag should still exit the block, stripping the // tool XML while preserving legitimate trailing prose. expect(result).not.toContain(""); @@ -493,7 +493,7 @@ File contents here`, timestamp: Date.now(), }); - const result = extractAssistantText(msg); + const result = extractEmbeddedAssistantText(msg); // must NOT exit a block; the block should // continue until the matching , preventing payload leaks. expect(result).not.toContain("LEAK"); @@ -557,7 +557,7 @@ File contents here`, content: [{ type: "text", text: testCase.text }], timestamp: Date.now(), }); - expect(extractAssistantText(msg), testCase.name).toBe(testCase.expected); + expect(extractEmbeddedAssistantText(msg), testCase.name).toBe(testCase.expected); } }); }); diff --git a/src/agents/embedded-agent-utils.ts b/src/agents/embedded-agent-utils.ts index a65496360695..74f4dcef992c 100644 --- a/src/agents/embedded-agent-utils.ts +++ b/src/agents/embedded-agent-utils.ts @@ -52,7 +52,7 @@ type AssistantTextExtractionResult = { hadRequestedPhase: boolean; }; -function extractAssistantTextForPhase( +function extractEmbeddedAssistantTextForPhase( msg: AssistantMessage, phase?: AssistantPhase, options?: { unphasedSignedFinalAnswer?: boolean }, @@ -124,21 +124,22 @@ function extractAssistantTextForPhase( /** Extract text intended for users, preferring explicit final-answer phase blocks. */ export function extractAssistantVisibleText(msg: AssistantMessage): string { - const finalAnswerExtraction = extractAssistantTextForPhase(msg, "final_answer"); + const finalAnswerExtraction = extractEmbeddedAssistantTextForPhase(msg, "final_answer"); if (finalAnswerExtraction.hadRequestedPhase) { return finalAnswerExtraction.text.trim() ? finalAnswerExtraction.text : ""; } - return extractAssistantTextForPhase(msg, undefined, { unphasedSignedFinalAnswer: true }).text; + return extractEmbeddedAssistantTextForPhase(msg, undefined, { unphasedSignedFinalAnswer: true }) + .text; } /** Extract the commentary/narration text of a commentary-phase assistant message. */ export function extractAssistantCommentaryText(msg: AssistantMessage): string { - return extractAssistantTextForPhase(msg, "commentary").text; + return extractEmbeddedAssistantTextForPhase(msg, "commentary").text; } /** Extract sanitized assistant text across all text content blocks. */ -export function extractAssistantText(msg: AssistantMessage): string { +export function extractEmbeddedAssistantText(msg: AssistantMessage): string { const extracted = extractTextFromChatContent(msg.content, { sanitizeText: (text) => sanitizeAssistantText(text), diff --git a/src/agents/harness/native-hook-relay-permissions.ts b/src/agents/harness/native-hook-relay-permissions.ts index c19e42c12509..0790634e2759 100644 --- a/src/agents/harness/native-hook-relay-permissions.ts +++ b/src/agents/harness/native-hook-relay-permissions.ts @@ -36,7 +36,7 @@ import type { NativeHookRelayProviderAdapter, NativeHookRelayRegistration, } from "./native-hook-relay-types.js"; -import { readOptionalString, truncateText } from "./native-hook-relay-utils.js"; +import { readOptionalString, truncateRelayText } from "./native-hook-relay-utils.js"; export type NativeHookRelayDeferredToolApprovalRequester = typeof requestDeferredPluginToolApproval; @@ -282,7 +282,7 @@ function nativeHookRelayPermissionAllowAlwaysKey(params: { function permissionRequestFallbackKey(request: NativeHookRelayPermissionApprovalRequest): string { const command = readOptionalString(request.toolInput.command); if (command) { - return `${request.toolName}:command:${truncateText(command, 240)}`; + return `${request.toolName}:command:${truncateRelayText(command, 240)}`; } return `${request.toolName}:keys:${permissionRequestToolInputKeyFingerprint(request.toolInput)}`; } @@ -482,11 +482,11 @@ async function requestNativeHookRelayPermissionApproval( { timeoutMs: timeoutMs + 10_000 }, { pluginId: `openclaw-native-hook-relay-${request.provider}`, - title: truncateText( + title: truncateRelayText( `${nativeHookRelayProviderDisplayName(request.provider)} permission request`, MAX_APPROVAL_TITLE_LENGTH, ), - description: truncateText( + description: truncateRelayText( formatPermissionApprovalDescription(request), MAX_APPROVAL_DESCRIPTION_LENGTH, ), @@ -592,7 +592,7 @@ function formatPermissionApprovalDescription( function formatToolInputPreview(toolInput: Record): string | undefined { const command = readOptionalString(toolInput.command); if (command) { - return `Command: ${truncateText(sanitizeApprovalText(command), 240)}`; + return `Command: ${truncateRelayText(sanitizeApprovalText(command), 240)}`; } const keys = Object.keys(toolInput).map(sanitizeApprovalText).filter(Boolean).toSorted(); if (!keys.length) { diff --git a/src/agents/harness/native-hook-relay-utils.ts b/src/agents/harness/native-hook-relay-utils.ts index 8b36ae775183..a44eba1790a0 100644 --- a/src/agents/harness/native-hook-relay-utils.ts +++ b/src/agents/harness/native-hook-relay-utils.ts @@ -212,6 +212,6 @@ function snapshotString(value: string, state: { remainingStringLength: number }) return `${prefix}...[truncated]`; } -export function truncateText(value: string, maxLength: number): string { +export function truncateRelayText(value: string, maxLength: number): string { return truncateWithMarker(value, maxLength, { marker: "...", reserve: 3, trimEnd: false }); } diff --git a/src/agents/model-auth.profiles.test.ts b/src/agents/model-auth.profiles.test.ts index b01b9ba4d6d0..dc64d9af4436 100644 --- a/src/agents/model-auth.profiles.test.ts +++ b/src/agents/model-auth.profiles.test.ts @@ -7,10 +7,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { withEnvAsync } from "../test-utils/env.js"; import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - ensureAuthProfileStore, -} from "./auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "./auth-profiles/runtime-snapshots.js"; +import { ensureAuthProfileStore } from "./auth-profiles/store.js"; import type { AuthProfileCredential, AuthProfileStore, diff --git a/src/agents/model-selection-shared.ts b/src/agents/model-selection-shared.ts index 9f03011452bb..588086b63804 100644 --- a/src/agents/model-selection-shared.ts +++ b/src/agents/model-selection-shared.ts @@ -501,7 +501,7 @@ function resolveExactConfiguredProviderRef( } /** Normalize a configured allowlist entry into the canonical provider/model key. */ -export function resolveAllowlistModelKey( +function resolveAllowlistModelKey( params: { cfg?: OpenClawConfig; raw: string; diff --git a/src/agents/model-selection.ts b/src/agents/model-selection.ts index 721a48c2c0a1..ebc3a3075c9d 100644 --- a/src/agents/model-selection.ts +++ b/src/agents/model-selection.ts @@ -43,7 +43,6 @@ import { inferUniqueProviderFromConfiguredModels, normalizeModelSelection, resolveBareModelDefaultProvider, - resolveAllowlistModelKey as resolveAllowlistModelKeyFromShared, resolveConfiguredModelRef, resolveHooksGmailModel, resolveModelAliasFromPair, @@ -210,15 +209,6 @@ export function normalizeStoredOverrideModel(params: { }; } -export function resolveAllowlistModelKey( - raw: string, - defaultProvider: string, - cfg?: OpenClawConfig, - manifestPlugins?: ModelManifestNormalizationContext["manifestPlugins"], -): string | null { - return resolveAllowlistModelKeyFromShared({ cfg, raw, defaultProvider, manifestPlugins }); -} - export async function canonicalizeCaseOnlyCatalogModelRef(params: { raw: string | undefined; cfg?: OpenClawConfig; diff --git a/src/agents/models-config.applies-config-env-vars.test.ts b/src/agents/models-config.applies-config-env-vars.test.ts index c109cb3b13ba..f1e734f92741 100644 --- a/src/agents/models-config.applies-config-env-vars.test.ts +++ b/src/agents/models-config.applies-config-env-vars.test.ts @@ -8,7 +8,7 @@ import { testing as externalAuthTesting } from "./auth-profiles/external-auth.te import { clearRuntimeAuthProfileStoreSnapshots, replaceRuntimeAuthProfileStoreSnapshots, -} from "./auth-profiles/store.js"; +} from "./auth-profiles/runtime-snapshots.js"; import { unsetEnv, withTempEnv } from "./models-config.e2e-harness.js"; import { planOpenClawModelsJsonWithDeps, diff --git a/src/agents/models-config.skips-writing-models-json-no-env-token.test.ts b/src/agents/models-config.skips-writing-models-json-no-env-token.test.ts index 866db1caaf96..6c5ef5166b2e 100644 --- a/src/agents/models-config.skips-writing-models-json-no-env-token.test.ts +++ b/src/agents/models-config.skips-writing-models-json-no-env-token.test.ts @@ -102,7 +102,7 @@ installModelsConfigTestHooks(); let clearConfigCache: typeof import("../config/config.js").clearConfigCache; let clearRuntimeConfigSnapshot: typeof import("../config/config.js").clearRuntimeConfigSnapshot; -let clearRuntimeAuthProfileStoreSnapshots: typeof import("./auth-profiles/store.js").clearRuntimeAuthProfileStoreSnapshots; +let clearRuntimeAuthProfileStoreSnapshots: typeof import("./auth-profiles/runtime-snapshots.js").clearRuntimeAuthProfileStoreSnapshots; let ensureOpenClawModelsJson: typeof import("./models-config.js").ensureOpenClawModelsJson; let resetModelsJsonReadyCacheForTest: typeof import("./models-config-state.test-support.js").resetModelsJsonReadyCacheForTest; @@ -154,7 +154,8 @@ describe("models-config", () => { beforeAll(async () => { vi.resetModules(); ({ clearConfigCache, clearRuntimeConfigSnapshot } = await import("../config/config.js")); - ({ clearRuntimeAuthProfileStoreSnapshots } = await import("./auth-profiles/store.js")); + ({ clearRuntimeAuthProfileStoreSnapshots } = + await import("./auth-profiles/runtime-snapshots.js")); ({ ensureOpenClawModelsJson } = await import("./models-config.js")); ({ resetModelsJsonReadyCacheForTest } = await import("./models-config-state.test-support.js")); }); diff --git a/src/agents/models.profiles.live.test.ts b/src/agents/models.profiles.live.test.ts index b0a868f822f0..44d61a9c012d 100644 --- a/src/agents/models.profiles.live.test.ts +++ b/src/agents/models.profiles.live.test.ts @@ -21,7 +21,7 @@ import { import { resolveDefaultAgentDir } from "./agent-scope.js"; import { externalCliDiscoveryForProviders } from "./auth-profiles/external-cli-discovery.js"; import { ensureCustomApiRegistered } from "./custom-api-registry.js"; -import { extractAssistantText } from "./embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "./embedded-agent-utils.js"; import { isRateLimitErrorMessage } from "./failover/classify.js"; import { collectProviderApiKeys } from "./live-auth-keys.js"; import { isModelNotFoundErrorMessage } from "./live-model-errors.js"; @@ -1597,7 +1597,7 @@ async function runDeepSeekV4ReplayRegression(params: { if (second.stopReason === "error") { throw new Error(second.errorMessage || "DeepSeek V4 replay followup returned error"); } - expect(extractAssistantText(second).length).toBeGreaterThan(0); + expect(extractEmbeddedAssistantText(second).length).toBeGreaterThan(0); } async function runExtraTurnProbes(params: { @@ -1627,7 +1627,7 @@ async function runExtraTurnProbes(params: { if (file.stopReason === "error") { throw new Error(file.errorMessage || "file-read probe returned error with no message"); } - let fileText = extractAssistantText(file); + let fileText = extractEmbeddedAssistantText(file); if (!fileProbeTextMatches(fileText)) { logProgress(`${params.progressLabel}: file-read probe retry`); const retry = await completeSimpleWithTimeout( @@ -1644,7 +1644,7 @@ async function runExtraTurnProbes(params: { retry.errorMessage || "file-read probe retry returned error with no message", ); } - fileText = extractAssistantText(retry); + fileText = extractEmbeddedAssistantText(retry); } if (!fileProbeTextMatches(fileText)) { if (fileText.length === 0) { @@ -1689,7 +1689,7 @@ async function runExtraTurnProbes(params: { : `${attemptLabel} returned error with no message`; throw new Error(image.errorMessage || fallback); } - return extractAssistantText(image); + return extractEmbeddedAssistantText(image); }, onRetry: (firstText) => { const reason = firstText.length === 0 ? "was empty" : "did not return ok"; diff --git a/src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts b/src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts index 110bc4a24d42..6be15aa1a2ab 100644 --- a/src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts +++ b/src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts @@ -16,10 +16,8 @@ import { setSessionsSpawnConfigOverride, waitForSessionsSpawnEvent, } from "./openclaw-tools.subagents.sessions-spawn.test-harness.js"; -import { - getLatestSubagentRunByChildSessionKey, - resetSubagentRegistryForTests, -} from "./subagents/registry/subagent-registry.test-helpers.js"; +import { getLatestSubagentRunByChildSessionKey } from "./subagents/registry/subagent-registry-read.js"; +import { resetSubagentRegistryForTests } from "./subagents/registry/subagent-registry.test-helpers.js"; const fastModeEnv = vi.hoisted(() => { const previous = process.env.OPENCLAW_TEST_FAST; diff --git a/src/agents/openclaw-tools.swarm.ts b/src/agents/openclaw-tools.swarm.ts index 73df4686eeb2..7e8d81070d5a 100644 --- a/src/agents/openclaw-tools.swarm.ts +++ b/src/agents/openclaw-tools.swarm.ts @@ -1,6 +1,6 @@ import type { OpenClawConfig } from "../config/types.openclaw.js"; +import { getLatestSubagentRunByChildSessionKey } from "./subagents/registry/subagent-registry-read.js"; import { - getLatestSubagentRunByChildSessionKey, getSubagentRunByRunId, recordSwarmStructuredOutput, } from "./subagents/registry/subagent-registry.js"; diff --git a/src/agents/run-wait.ts b/src/agents/run-wait.ts index d9187e813d5d..ea2a65a6459d 100644 --- a/src/agents/run-wait.ts +++ b/src/agents/run-wait.ts @@ -34,7 +34,7 @@ import { normalizeProviderStarted, type AgentRunTimeoutPhase, } from "./run-timeout-attribution.js"; -import { extractAssistantText, stripToolMessages } from "./tools/chat-history-text.js"; +import { extractStoredAssistantText, stripToolMessages } from "./tools/chat-history-text.js"; type GatewayCaller = typeof callGateway; @@ -197,7 +197,7 @@ function isWaitedReplyTurnBoundary(message: unknown): boolean { } function snapshotAssistantReply(message: unknown): AssistantReplySnapshot | undefined { - const text = extractAssistantText(message); + const text = extractStoredAssistantText(message); if (!text?.trim()) { return undefined; } diff --git a/src/agents/sandbox-media-paths.ts b/src/agents/sandbox-media-paths.ts index 4e44e2d1541a..ddd455f4f8c2 100644 --- a/src/agents/sandbox-media-paths.ts +++ b/src/agents/sandbox-media-paths.ts @@ -10,7 +10,7 @@ import type { OutboundMediaReadFile } from "../media/load-options.js"; import { resolveMediaReferenceSandboxPath } from "../media/media-reference.js"; import { assertSandboxPath } from "./sandbox-paths.js"; import type { SandboxFsBridge, SandboxResolvedPath } from "./sandbox/fs-bridge.js"; -import { isPathInsideContainerRoot, normalizeContainerPath } from "./sandbox/path-utils.js"; +import { isPathInsideContainerRoot, normalizeContainerPathCore } from "./sandbox/path-utils.js"; export type SandboxedBridgeMediaPathConfig = { root: string; @@ -70,8 +70,8 @@ export async function resolveSandboxedBridgeMediaPath(params: { }); if ( !isPathInsideContainerRoot( - normalizeContainerPath(workspaceRoot.containerPath), - normalizeContainerPath(resolved.containerPath), + normalizeContainerPathCore(workspaceRoot.containerPath), + normalizeContainerPathCore(resolved.containerPath), ) ) { throw new Error(`Sandbox path escapes workspace root: ${resolved.containerPath}`); diff --git a/src/agents/sandbox/fs-bridge-path-safety.ts b/src/agents/sandbox/fs-bridge-path-safety.ts index a098d67ceef6..fd0a93514408 100644 --- a/src/agents/sandbox/fs-bridge-path-safety.ts +++ b/src/agents/sandbox/fs-bridge-path-safety.ts @@ -11,7 +11,7 @@ import { openRootFile, type RootFileOpenResult } from "./fs-bridge-path-safety.r import type { SandboxResolvedFsPath, SandboxFsMount } from "./fs-paths.js"; import { isPathInsideContainerRoot, - normalizeContainerPath, + normalizeContainerPathCore, relativePathEscapesContainerRoot, } from "./path-utils.js"; @@ -189,7 +189,7 @@ export class SandboxFsPathGuard { if (!basename || basename === "." || basename === "/") { throw new Error(`Invalid sandbox entry target: ${target.containerPath}`); } - const parentPath = normalizeContainerPath(path.posix.dirname(target.containerPath)); + const parentPath = normalizeContainerPathCore(path.posix.dirname(target.containerPath)); const mount = this.resolveRequiredMount(parentPath, action); return this.finalizePinnedEntry({ mount, @@ -208,7 +208,7 @@ export class SandboxFsPathGuard { if (!basename || basename === "." || basename === "/") { throw new Error(`Invalid sandbox entry target: ${target.containerPath}`); } - const parentPath = normalizeContainerPath(path.posix.dirname(target.containerPath)); + const parentPath = normalizeContainerPathCore(path.posix.dirname(target.containerPath)); const canonicalParentPath = await this.resolveCanonicalContainerPath({ containerPath: parentPath, allowFinalSymlinkForUnlink: false, @@ -262,9 +262,9 @@ export class SandboxFsPathGuard { } private resolveMountByContainerPath(containerPath: string): SandboxFsMount | null { - const normalized = normalizeContainerPath(containerPath); + const normalized = normalizeContainerPathCore(containerPath); for (const mount of this.mountsByContainer) { - if (isPathInsideContainerRoot(normalizeContainerPath(mount.containerRoot), normalized)) { + if (isPathInsideContainerRoot(normalizeContainerPathCore(mount.containerRoot), normalized)) { return mount; } } @@ -301,6 +301,6 @@ export class SandboxFsPathGuard { if (!canonical.startsWith("/")) { throw new Error(`Failed to resolve canonical sandbox path: ${params.containerPath}`); } - return normalizeContainerPath(canonical); + return normalizeContainerPathCore(canonical); } } diff --git a/src/agents/sandbox/fs-paths.ts b/src/agents/sandbox/fs-paths.ts index 8fca42afe223..0bd5f34ecc3c 100644 --- a/src/agents/sandbox/fs-paths.ts +++ b/src/agents/sandbox/fs-paths.ts @@ -16,7 +16,7 @@ import { SANDBOX_AGENT_WORKSPACE_MOUNT } from "./constants.js"; import { resolveSandboxHostPathViaExistingAncestor } from "./host-paths.js"; import { isPathInsideContainerRoot, - normalizeContainerPath, + normalizeContainerPathCore, relativePathEscapesContainerRoot, } from "./path-utils.js"; import { @@ -65,7 +65,7 @@ function parseSandboxBindMount(spec: string): ParsedBindMount | null { const writable = !optionParts.includes("ro"); return { hostRoot: path.resolve(hostToken), - containerRoot: normalizeContainerPath(containerToken), + containerRoot: normalizeContainerPathCore(containerToken), writable, }; } @@ -74,7 +74,7 @@ export function buildSandboxFsMounts(sandbox: SandboxFsBridgeContext): SandboxFs const mounts: SandboxFsMount[] = [ { hostRoot: path.resolve(sandbox.workspaceDir), - containerRoot: normalizeContainerPath(sandbox.containerWorkdir), + containerRoot: normalizeContainerPathCore(sandbox.containerWorkdir), writable: sandbox.workspaceAccess === "rw", source: "workspace", }, @@ -103,7 +103,7 @@ export function buildSandboxFsMounts(sandbox: SandboxFsBridgeContext): SandboxFs for (const mount of protectedSkillMounts) { mounts.push({ hostRoot: path.resolve(mount.hostPath), - containerRoot: normalizeContainerPath(mount.containerPath), + containerRoot: normalizeContainerPathCore(mount.containerPath), writable: false, source: "protectedSkill", }); @@ -296,13 +296,15 @@ function resolveRelativeContainerCandidate(params: { const containerCwd = relPosix ? path.posix.join(cwdMount.containerRoot, relPosix) : cwdMount.containerRoot; - return normalizeContainerPath(path.posix.resolve(containerCwd, params.inputPosix)); + return normalizeContainerPathCore(path.posix.resolve(containerCwd, params.inputPosix)); } const cwdPosix = normalizePosixInput(params.cwd); if (path.posix.isAbsolute(cwdPosix)) { - return normalizeContainerPath(path.posix.resolve(cwdPosix, params.inputPosix)); + return normalizeContainerPathCore(path.posix.resolve(cwdPosix, params.inputPosix)); } - return normalizeContainerPath(path.posix.resolve(params.defaultContainerRoot, params.inputPosix)); + return normalizeContainerPathCore( + path.posix.resolve(params.defaultContainerRoot, params.inputPosix), + ); } function formatSandboxRootEscapeMessage(params: { @@ -310,7 +312,7 @@ function formatSandboxRootEscapeMessage(params: { defaultWorkspaceRoot: string; defaultContainerRoot: string; }): string { - const containerRoot = normalizeContainerPath(params.defaultContainerRoot); + const containerRoot = normalizeContainerPathCore(params.defaultContainerRoot); const workspaceRoot = shortenHomePath(path.resolve(params.defaultWorkspaceRoot)); return `Path escapes sandbox root (${workspaceRoot}; container root ${containerRoot}): ${params.input}. Use a path under ${containerRoot}/ instead.`; } diff --git a/src/agents/sandbox/path-utils.ts b/src/agents/sandbox/path-utils.ts index bb6a342b497c..1dae60024296 100644 --- a/src/agents/sandbox/path-utils.ts +++ b/src/agents/sandbox/path-utils.ts @@ -6,15 +6,15 @@ import path from "node:path"; /** Normalizes a container path and treats "." as the container root. */ -export function normalizeContainerPath(value: string): string { +export function normalizeContainerPathCore(value: string): string { const normalized = path.posix.normalize(value); return normalized === "." ? "/" : normalized; } /** Returns whether target is lexically inside root after container-path normalization. */ export function isPathInsideContainerRoot(root: string, target: string): boolean { - const normalizedRoot = normalizeContainerPath(root); - const normalizedTarget = normalizeContainerPath(target); + const normalizedRoot = normalizeContainerPathCore(root); + const normalizedTarget = normalizeContainerPathCore(target); if (normalizedRoot === "/") { return true; } diff --git a/src/agents/sandbox/remote-fs-bridge-paths.ts b/src/agents/sandbox/remote-fs-bridge-paths.ts index 166144b7bbf7..7a8692c5ac38 100644 --- a/src/agents/sandbox/remote-fs-bridge-paths.ts +++ b/src/agents/sandbox/remote-fs-bridge-paths.ts @@ -1,6 +1,6 @@ /** Pure mount and path helpers for the remote sandbox filesystem bridge. */ import path from "node:path"; -import { normalizeContainerPath as normalizeSandboxContainerPath } from "./path-utils.js"; +import { normalizeContainerPathCore } from "./path-utils.js"; import { isExistingWorkspaceSkillMountSource, resolveMaterializedSandboxSkillsWorkspaceDir, @@ -132,7 +132,7 @@ function mountPriority(mount: RemoteMountInfo): number { } export function normalizeContainerPath(value: string): string { - const normalized = normalizeSandboxContainerPath(value.trim() || "/"); + const normalized = normalizeContainerPathCore(value.trim() || "/"); return normalized.startsWith("/") ? normalized : `/${normalized}`; } diff --git a/src/agents/sandbox/workspace-mounts.ts b/src/agents/sandbox/workspace-mounts.ts index 23cea49dd664..c1d40d33510a 100644 --- a/src/agents/sandbox/workspace-mounts.ts +++ b/src/agents/sandbox/workspace-mounts.ts @@ -9,7 +9,7 @@ import { isPathInside } from "../../infra/path-guards.js"; import { splitSandboxBindSpec } from "./bind-spec.js"; import { SANDBOX_AGENT_WORKSPACE_MOUNT } from "./constants.js"; import { resolveSandboxHostPathViaExistingAncestor } from "./host-paths.js"; -import { normalizeContainerPath } from "./path-utils.js"; +import { normalizeContainerPathCore } from "./path-utils.js"; import type { SandboxWorkspaceAccess } from "./types.js"; export const SANDBOX_MOUNT_FORMAT_VERSION = 3; @@ -39,7 +39,7 @@ function containerJoin(root: string, ...parts: string[]): string { } function normalizeMountContainerPath(containerPath: string): string { - return normalizeContainerPath(containerPath).replace(/\/+$/, "") || "/"; + return normalizeContainerPathCore(containerPath).replace(/\/+$/, "") || "/"; } /** Hidden workspace used to materialize non-workspace skills for rw sandboxes. */ diff --git a/src/agents/sessions/session-manager-branching.ts b/src/agents/sessions/session-manager-branching.ts index 7be09b58551f..ca93d9a05e54 100644 --- a/src/agents/sessions/session-manager-branching.ts +++ b/src/agents/sessions/session-manager-branching.ts @@ -9,7 +9,7 @@ import { projectCanonicalSessionEntryShape } from "../../config/sessions/store-e import { CURRENT_SESSION_VERSION } from "../../config/sessions/version.js"; import { parseOpaqueLeafEntry, parseParentLinkedOpaqueEntry } from "./session-manager-codec.js"; import { SessionManagerEntries } from "./session-manager-entries.js"; -import { createSessionId, generateSessionEntryId } from "./session-manager-id.js"; +import { createManagedSessionId, generateSessionEntryId } from "./session-manager-id.js"; import type { LabelEntry, PreservedOpaqueFileEntry, @@ -108,7 +108,7 @@ export class SessionManagerBranching extends SessionManagerEntries { throw new Error(`Entry ${leafId} not found`); } - const newSessionId = createSessionId(); + const newSessionId = createManagedSessionId(); const timestamp = new Date().toISOString(); const persistenceTarget = this.persistenceTarget; diff --git a/src/agents/sessions/session-manager-core.ts b/src/agents/sessions/session-manager-core.ts index bc0e2270c3e7..92601988bc22 100644 --- a/src/agents/sessions/session-manager-core.ts +++ b/src/agents/sessions/session-manager-core.ts @@ -12,7 +12,7 @@ import { parseParentLinkedOpaqueEntry, partitionSessionFileEntries, } from "./session-manager-codec.js"; -import { createSessionId, generateSessionEntryId } from "./session-manager-id.js"; +import { createManagedSessionId, generateSessionEntryId } from "./session-manager-id.js"; import type { FileEntry, NewSessionOptions, @@ -91,7 +91,7 @@ export class SessionManagerCore { this.persistenceTarget = target ? { ...target } : undefined; this.fileEntries = partitioned.fileEntries; this.opaqueFileEntries = partitioned.opaqueEntries; - this.sessionId = header?.id ?? target?.sessionId ?? createSessionId(); + this.sessionId = header?.id ?? target?.sessionId ?? createManagedSessionId(); this.migrated = migrateToCurrentVersion( this.fileEntries, partitioned.fileEntriesByOriginalIndex, @@ -115,7 +115,7 @@ export class SessionManagerCore { } private initializeSession(options?: NewSessionOptions): string | undefined { - this.sessionId = options?.id ?? this.persistenceTarget?.sessionId ?? createSessionId(); + this.sessionId = options?.id ?? this.persistenceTarget?.sessionId ?? createManagedSessionId(); this.migrated = false; const timestamp = new Date().toISOString(); const header: SessionHeader = { diff --git a/src/agents/sessions/session-manager-id.ts b/src/agents/sessions/session-manager-id.ts index 90d6754067b8..77a1a63d9924 100644 --- a/src/agents/sessions/session-manager-id.ts +++ b/src/agents/sessions/session-manager-id.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; import { uuidv7 } from "../runtime/index.js"; -export function createSessionId(): string { +export function createManagedSessionId(): string { return uuidv7(); } diff --git a/src/agents/subagents/announce/subagent-announce-output.ts b/src/agents/subagents/announce/subagent-announce-output.ts index 49cced52c7f0..825637b578f8 100644 --- a/src/agents/subagents/announce/subagent-announce-output.ts +++ b/src/agents/subagents/announce/subagent-announce-output.ts @@ -12,7 +12,7 @@ import { isFastTestRuntimeEnv } from "../../../infra/env.js"; import { formatDurationCompact } from "../../../infra/format-time/format-duration.js"; import { buildAgentRunTerminalOutcomeFromWaitResult } from "../../agent-run-terminal-outcome.js"; import { wrapPromptDataBlock } from "../../sanitize-for-prompt.js"; -import { extractAssistantText, sanitizeTextContent } from "../../tools/chat-history-text.js"; +import { extractStoredAssistantText, sanitizeTextContent } from "../../tools/chat-history-text.js"; import { isAnnounceSkip, selectDeliverableSessionsReply, @@ -130,7 +130,7 @@ function extractSubagentAssistantText(message: unknown): string { if (typeof content === "string") { return sanitizeTextContent(content); } - return extractAssistantText(message) ?? ""; + return extractStoredAssistantText(message) ?? ""; } function countAssistantToolCalls(message: unknown): number { diff --git a/src/agents/subagents/registry/subagent-control.test.ts b/src/agents/subagents/registry/subagent-control.test.ts index 120ac29aea91..9a93dc7cae02 100644 --- a/src/agents/subagents/registry/subagent-control.test.ts +++ b/src/agents/subagents/registry/subagent-control.test.ts @@ -40,7 +40,7 @@ import { SUBAGENT_ENDED_REASON_COMPLETE, SUBAGENT_ENDED_REASON_KILLED, } from "./subagent-lifecycle-events.js"; -import { replaceSubagentRunAfterSteer } from "./subagent-registry.js"; +import { replaceSubagentRunAfterSteerCore } from "./subagent-registry.js"; import { testing as subagentRegistryTesting, addSubagentRunForTests, @@ -2011,7 +2011,7 @@ describe("killControlledSubagentRun", () => { onInterrupt: () => undefined, }); expect( - replaceSubagentRunAfterSteer({ + replaceSubagentRunAfterSteerCore({ previousRunId: source.runId, nextRunId: recoveryRunId, expected: source, @@ -2485,7 +2485,7 @@ describe("steerControlledSubagentRun", () => { addSubagentRunForTests(entry); const replaceSpy = vi - .spyOn(await import("./subagent-registry.js"), "replaceSubagentRunAfterSteer") + .spyOn(await import("./subagent-registry.js"), "replaceSubagentRunAfterSteerCore") .mockReturnValue(false); const callGatewayImplementation: GatewayCaller = async >( diff --git a/src/agents/subagents/registry/subagent-control.ts b/src/agents/subagents/registry/subagent-control.ts index f940b1b9b6fd..047171b21f5e 100644 --- a/src/agents/subagents/registry/subagent-control.ts +++ b/src/agents/subagents/registry/subagent-control.ts @@ -41,6 +41,7 @@ import { resolveStoredSubagentCapabilities } from "../spawn/subagent-capabilitie import { terminateAcceptedCollectorRun } from "../spawn/subagent-spawn-cleanup.js"; import { SUBAGENT_ENDED_REASON_KILLED } from "./subagent-lifecycle-events.js"; import { resolveSessionEntryForKey } from "./subagent-list.js"; +import { countPendingDescendantRuns } from "./subagent-registry-announce-read.js"; import { resolveFinalizedSubagentTaskState, resolveKilledSubagentTaskEndedAt, @@ -55,11 +56,10 @@ import { getSubagentRunsSnapshotForRead } from "./subagent-registry-state.js"; import { claimSubagentRunKill, clearSubagentRunSteerRestart, - countPendingDescendantRuns, markSubagentRunTerminated, markSubagentRunForSteerRestart, releaseSubagentRunKillClaim, - replaceSubagentRunAfterSteer, + replaceSubagentRunAfterSteerCore, } from "./subagent-registry.js"; import type { SubagentRunRecord } from "./subagent-registry.types.js"; @@ -1187,7 +1187,7 @@ export async function steerControlledSubagentRun(params: { }; } - const replaced = replaceSubagentRunAfterSteer({ + const replaced = replaceSubagentRunAfterSteerCore({ previousRunId: params.entry.runId, nextRunId: runId, fallback: currentEntry, diff --git a/src/agents/subagents/registry/subagent-registry-public-api.ts b/src/agents/subagents/registry/subagent-registry-public-api.ts index b1e7d4133c4a..a2aa4a760c8d 100644 --- a/src/agents/subagents/registry/subagent-registry-public-api.ts +++ b/src/agents/subagents/registry/subagent-registry-public-api.ts @@ -7,13 +7,9 @@ import type { SubagentRegistryDeps } from "./subagent-registry-deps.js"; import type { createSubagentRegistryLifecycleController } from "./subagent-registry-lifecycle.js"; import { getSubagentRunsForChildSession } from "./subagent-registry-memory.js"; import { - countActiveDescendantRunsFromRuns, countActiveRunsForSessionFromRuns, - countPendingDescendantRunsFromRuns, getLatestSubagentRunByChildSessionKeyFromRuns, getSubagentRunByChildSessionKeyFromRuns, - listDescendantRunsForRequesterFromRuns, - listRunsForControllerFromRuns, } from "./subagent-registry-queries.js"; import { markRequesterTurnYieldedInRuns } from "./subagent-registry-requester-yield.js"; import type { SubagentRunRecord, SwarmStructuredOutputState } from "./subagent-registry.types.js"; @@ -87,13 +83,6 @@ export function createSubagentRegistryPublicApi(config: { return updated; } - function listSubagentRunsForController(controllerSessionKey: string): SubagentRunRecord[] { - return listRunsForControllerFromRuns( - deps().getSubagentRunsSnapshotForController(runs, controllerSessionKey), - controllerSessionKey, - ); - } - function getSubagentRunByRunId(runId: string): SubagentRunRecord | undefined { return findRunById(readRuns(), runId.trim()); } @@ -197,18 +186,6 @@ export function createSubagentRegistryPublicApi(config: { return countActiveRunsForSessionFromRuns(readRuns(), requesterSessionKey, options); } - function countActiveDescendantRuns(rootSessionKey: string): number { - return countActiveDescendantRunsFromRuns(readRuns(), rootSessionKey); - } - - function countPendingDescendantRuns(rootSessionKey: string): number { - return countPendingDescendantRunsFromRuns(readRuns(), rootSessionKey); - } - - function listDescendantRunsForRequester(rootSessionKey: string): SubagentRunRecord[] { - return listDescendantRunsForRequesterFromRuns(readRuns(), rootSessionKey); - } - function getSubagentRunByChildSessionKey(childSessionKey: string): SubagentRunRecord | null { return getSubagentRunByChildSessionKeyFromRuns( deps().getSubagentRunsSnapshotForChildSession(runs, childSessionKey), @@ -216,17 +193,6 @@ export function createSubagentRegistryPublicApi(config: { ); } - function getLatestSubagentRunByChildSessionKey( - childSessionKey: string, - ): SubagentRunRecord | null { - return ( - getLatestSubagentRunByChildSessionKeyFromRuns( - deps().getSubagentRunsSnapshotForChildSession(runs, childSessionKey), - childSessionKey, - ) ?? null - ); - } - /** Records sessions_yield before the active requester run is aborted. */ function markRequesterTurnYielded(params: { requesterSessionKey: string; @@ -244,7 +210,6 @@ export function createSubagentRegistryPublicApi(config: { leasePendingAgentSteeringItems, ackPendingAgentSteeringItems, releasePendingAgentSteeringItems, - listSubagentRunsForController, getSubagentRunByRunId, getSubagentRunsByRunIds, completeCollectorLaunchCleanup, @@ -252,11 +217,7 @@ export function createSubagentRegistryPublicApi(config: { listSwarmRunsForGroup, getSwarmRunByLaunchReplayKey, countActiveRunsForSession, - countActiveDescendantRuns, - countPendingDescendantRuns, - listDescendantRunsForRequester, getSubagentRunByChildSessionKey, - getLatestSubagentRunByChildSessionKey, settleRequesterAfterSessionSpawns: settleRequesterTurn, markRequesterTurnYielded, }; diff --git a/src/agents/subagents/registry/subagent-registry-runtime.ts b/src/agents/subagents/registry/subagent-registry-runtime.ts index e1dfd44d29e0..c6f43f96cc17 100644 --- a/src/agents/subagents/registry/subagent-registry-runtime.ts +++ b/src/agents/subagents/registry/subagent-registry-runtime.ts @@ -13,7 +13,7 @@ export { } from "./subagent-registry-announce-read.js"; export async function replaceSubagentRunAfterSteer( - params: Parameters[0], + params: Parameters[0], ) { - return (await import("./subagent-registry.js")).replaceSubagentRunAfterSteer(params); + return (await import("./subagent-registry.js")).replaceSubagentRunAfterSteerCore(params); } diff --git a/src/agents/subagents/registry/subagent-registry.archive.e2e.test.ts b/src/agents/subagents/registry/subagent-registry.archive.e2e.test.ts index 992b9cdefcdc..88c56ebe7b2c 100644 --- a/src/agents/subagents/registry/subagent-registry.archive.e2e.test.ts +++ b/src/agents/subagents/registry/subagent-registry.archive.e2e.test.ts @@ -962,7 +962,7 @@ describe("subagent registry archive behavior", () => { cleanup: "keep", }); - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-old", nextRunId: "run-new", }); @@ -991,7 +991,7 @@ describe("subagent registry archive behavior", () => { await vi.advanceTimersByTimeAsync(5_000); - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-delete-old", nextRunId: "run-delete-new", }); @@ -1022,7 +1022,7 @@ describe("subagent registry archive behavior", () => { attachmentsDir, }); - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-delete-attachments-old", nextRunId: "run-delete-attachments-new", }); diff --git a/src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts b/src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts index 18fa4ce7deda..ea1e3b86dbf4 100644 --- a/src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts +++ b/src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts @@ -9,6 +9,7 @@ import { testing as settleWakeTesting, } from "../announce/subagent-announce.requester-settle-wake.js"; import * as announceRead from "./subagent-registry-announce-read.js"; +import * as registryRead from "./subagent-registry-read.js"; import * as mod from "./subagent-registry.test-helpers.js"; const noop = () => {}; @@ -129,14 +130,14 @@ vi.mock("../spawn/subagent-depth.js", () => ({ const loadSubagentRegistryRuntimeForTest = async () => ({ - countActiveDescendantRuns: mod.countActiveDescendantRuns, - countPendingDescendantRuns: mod.countPendingDescendantRuns, + countActiveDescendantRuns: registryRead.countActiveDescendantRuns, + countPendingDescendantRuns: announceRead.countPendingDescendantRuns, countPendingDescendantRunsExcludingRun: mod.countPendingDescendantRunsExcludingRun, hasDescendantRunAwaitingSettle: announceRead.hasDescendantRunAwaitingSettle, - getLatestSubagentRunByChildSessionKey: mod.getLatestSubagentRunByChildSessionKey, + getLatestSubagentRunByChildSessionKey: registryRead.getLatestSubagentRunByChildSessionKey, isSubagentSessionRunActive: mod.isSubagentSessionRunActive, listSubagentRunsForRequester: mod.listSubagentRunsForRequester, - replaceSubagentRunAfterSteer: mod.replaceSubagentRunAfterSteer, + replaceSubagentRunAfterSteer: mod.replaceSubagentRunAfterSteerCore, resolveRequesterForChildSession: mod.resolveRequesterForChildSession, shouldIgnorePostCompletionAnnounceForSession: mod.shouldIgnorePostCompletionAnnounceForSession, }) as unknown as typeof import("./subagent-registry-runtime.js"); diff --git a/src/agents/subagents/registry/subagent-registry.nested.e2e.test.ts b/src/agents/subagents/registry/subagent-registry.nested.e2e.test.ts index 0ee4ffee7265..c7a29c835969 100644 --- a/src/agents/subagents/registry/subagent-registry.nested.e2e.test.ts +++ b/src/agents/subagents/registry/subagent-registry.nested.e2e.test.ts @@ -4,6 +4,8 @@ import { expectDefined } from "@openclaw/normalization-core"; import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; import "./subagent-registry.mocks.shared.js"; +import { countPendingDescendantRuns } from "./subagent-registry-announce-read.js"; +import { countActiveDescendantRuns } from "./subagent-registry-read.js"; vi.mock("../../../config/config.js", async () => { const actual = await vi.importActual( @@ -141,7 +143,7 @@ describe("subagent registry nested agent tracking", () => { }); it("countActiveDescendantRuns traverses through ended parents", () => { - const { addSubagentRunForTests, countActiveDescendantRuns } = subagentRegistry; + const { addSubagentRunForTests } = subagentRegistry; addSubagentRunForTests({ runId: "run-parent-ended", @@ -172,7 +174,7 @@ describe("subagent registry nested agent tracking", () => { }); it("countPendingDescendantRuns includes ended descendants until cleanup completes", () => { - const { addSubagentRunForTests, countPendingDescendantRuns } = subagentRegistry; + const { addSubagentRunForTests } = subagentRegistry; addSubagentRunForTests({ runId: "run-parent-ended-pending", @@ -221,7 +223,7 @@ describe("subagent registry nested agent tracking", () => { }); it("keeps parent pending for parallel children until both descendants complete cleanup", () => { - const { addSubagentRunForTests, countPendingDescendantRuns } = subagentRegistry; + const { addSubagentRunForTests } = subagentRegistry; const parentSessionKey = "agent:main:subagent:orch-parallel"; addSubagentRunForTests({ diff --git a/src/agents/subagents/registry/subagent-registry.persistence.test.ts b/src/agents/subagents/registry/subagent-registry.persistence.test.ts index 8850a287cd86..c4cfa53e6dea 100644 --- a/src/agents/subagents/registry/subagent-registry.persistence.test.ts +++ b/src/agents/subagents/registry/subagent-registry.persistence.test.ts @@ -15,6 +15,7 @@ import { captureEnv, setTestEnvValue, withEnv } from "../../../test-utils/env.js import { cleanupSessionStateForTest } from "../../../test-utils/session-state-cleanup.js"; import { createAgentsWaitTool } from "../../tools/agents-wait-tool.js"; import { persistSubagentSessionTiming } from "./subagent-registry-helpers.js"; +import { getLatestSubagentRunByChildSessionKey } from "./subagent-registry-read.js"; import { getSubagentRunsSnapshotForRead } from "./subagent-registry-state.js"; import { canonicalSubagentRunFixtures, @@ -32,7 +33,6 @@ import { testing, addSubagentRunForTests, clearSubagentRunSteerRestart, - getLatestSubagentRunByChildSessionKey, getSubagentRunByChildSessionKey, initSubagentRegistry, listSubagentRunsForRequester, diff --git a/src/agents/subagents/registry/subagent-registry.steer-restart.test.ts b/src/agents/subagents/registry/subagent-registry.steer-restart.test.ts index 042f77ed9857..b4ef91c2dc7a 100644 --- a/src/agents/subagents/registry/subagent-registry.steer-restart.test.ts +++ b/src/agents/subagents/registry/subagent-registry.steer-restart.test.ts @@ -318,7 +318,7 @@ describe("subagent registry steer restarts", () => { }; task?: string; }) => { - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: params.previousRunId, nextRunId: params.nextRunId, fallback: params.fallback, @@ -723,7 +723,7 @@ describe("subagent registry steer restarts", () => { previous.accumulatedRuntimeMs = 0; previous.execution.outcome = { status: "ok" }; - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-runtime-old", nextRunId: "run-runtime-new", fallback: previous, @@ -752,7 +752,7 @@ describe("subagent registry steer restarts", () => { }); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-retired-generation-old", nextRunId: "run-retired-generation-new", lifecycleGeneration: "retired-generation", @@ -771,7 +771,7 @@ describe("subagent registry steer restarts", () => { }); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-current-generation-old", nextRunId: "run-current-generation-new", lifecycleGeneration: "test-generation", @@ -801,7 +801,7 @@ describe("subagent registry steer restarts", () => { }); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-generation-persist-old", nextRunId: "run-generation-persist-new", lifecycleGeneration: "test-generation", @@ -832,7 +832,7 @@ describe("subagent registry steer restarts", () => { lastDropReason: "sink_unavailable", }; - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-delivery-old", nextRunId: "run-delivery-new", fallback: previous, @@ -866,7 +866,7 @@ describe("subagent registry steer restarts", () => { }; } - const replaced = mod.replaceSubagentRunAfterSteer({ + const replaced = mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-wake-old", nextRunId: "run-wake-new", fallback: previous, diff --git a/src/agents/subagents/registry/subagent-registry.test.ts b/src/agents/subagents/registry/subagent-registry.test.ts index 15397e1dad0a..b16d5af3e743 100644 --- a/src/agents/subagents/registry/subagent-registry.test.ts +++ b/src/agents/subagents/registry/subagent-registry.test.ts @@ -59,6 +59,7 @@ import { SUBAGENT_ENDED_REASON_ERROR, SUBAGENT_ENDED_REASON_KILLED, } from "./subagent-lifecycle-events.js"; +import { countPendingDescendantRuns } from "./subagent-registry-announce-read.js"; import { createSubagentRunManager } from "./subagent-registry-run-manager.js"; import type { ContextEngineSubagentEndedParams, @@ -542,35 +543,6 @@ describe("subagent registry seam flow", () => { vi.useRealTimers(); }); - it("routes controller and child lookups through scoped snapshots", () => { - const controllerSessionKey = "agent:main:controller"; - const childSessionKey = "agent:main:subagent:scoped"; - const run = { - runId: "run-scoped", - childSessionKey, - requesterSessionKey: "agent:main:main", - requesterDisplayKey: "main", - controllerSessionKey, - task: "scoped registry run", - cleanup: "keep" as const, - createdAt: Date.now(), - execution: { status: "running" as const }, - }; - mocks.getSubagentRunsSnapshotForController.mockReturnValue(new Map([[run.runId, run]])); - mocks.getSubagentRunsSnapshotForChildSession.mockReturnValue(new Map([[run.runId, run]])); - - expect(mod.listSubagentRunsForController(controllerSessionKey)).toEqual([run]); - expect(mod.getLatestSubagentRunByChildSessionKey(childSessionKey)).toEqual(run); - expect(mocks.getSubagentRunsSnapshotForController).toHaveBeenCalledWith( - expect.any(Map), - controllerSessionKey, - ); - expect(mocks.getSubagentRunsSnapshotForChildSession).toHaveBeenCalledWith( - expect.any(Map), - childSessionKey, - ); - }); - it("keeps a sweeper archive mutation root-admitted until deletion settles", async () => { const now = Date.now(); mocks.loadSessionStore.mockReturnValue( @@ -3313,10 +3285,10 @@ describe("subagent registry seam flow", () => { expect(run?.pauseReason).toBe("sessions_yield"); }); expect(mocks.runSubagentAnnounceFlow).not.toHaveBeenCalled(); - expect(mod.countPendingDescendantRuns("agent:main:main")).toBe(1); + expect(countPendingDescendantRuns("agent:main:main")).toBe(1); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-yield-paused", nextRunId: "run-yield-continuation", }), @@ -3438,7 +3410,7 @@ describe("subagent registry seam flow", () => { expect(mocks.runSubagentAnnounceFlow).not.toHaveBeenCalled(); // A yielded row is still unsettled work, so the parent's batch keeps // deferring instead of waking on a run that has not produced a result. - expect(mod.countPendingDescendantRuns("agent:main:main")).toBe(1); + expect(countPendingDescendantRuns("agent:main:main")).toBe(1); }); }); @@ -5212,7 +5184,7 @@ describe("subagent registry seam flow", () => { }); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-replacement-persist-old", nextRunId: "run-replacement-persist-new", }), @@ -5774,7 +5746,7 @@ describe("subagent registry seam flow", () => { }); expect( - mod.replaceSubagentRunAfterSteer({ + mod.replaceSubagentRunAfterSteerCore({ previousRunId: "run-suspended-old", nextRunId: "run-suspended-new", }), diff --git a/src/agents/subagents/registry/subagent-registry.ts b/src/agents/subagents/registry/subagent-registry.ts index 8187fcf4f176..8b87ad3a00dc 100644 --- a/src/agents/subagents/registry/subagent-registry.ts +++ b/src/agents/subagents/registry/subagent-registry.ts @@ -11,6 +11,7 @@ import { import { prependAgentSteeringPrompt } from "../../agent-steering-queue.js"; import { terminateAcceptedCollectorRun } from "../spawn/subagent-spawn-cleanup.js"; import { isDeliverySuspended } from "./subagent-delivery-state.js"; +import { countPendingDescendantRuns } from "./subagent-registry-announce-read.js"; import { createSubagentRegistryCompletionRuntime } from "./subagent-registry-completion-runtime.js"; import { emitSubagentProgressEndedHook } from "./subagent-registry-completion.js"; import { createSubagentRegistryContextCleanup } from "./subagent-registry-context-cleanup.js"; @@ -137,8 +138,7 @@ const subagentLifecycleController = createSubagentRegistryLifecycleController({ persist: persistSubagentRuns, persistOrThrow: persistSubagentRunsOrThrow, clearPendingLifecycleError, - countPendingDescendantRuns: (rootSessionKey) => - publicApi.countPendingDescendantRuns(rootSessionKey), + countPendingDescendantRuns, suppressAnnounceForSteerRestart: contextCleanup.suppressAnnounceForSteerRestart, resolveSubagentTask: findSubagentTaskForRun, shouldEmitEndedHookForRun: contextCleanup.shouldEmitEndedHookForRun, @@ -469,7 +469,7 @@ const subagentRunManager = createSubagentRunManager({ export const markSubagentRunForSteerRestart = subagentRunManager.markSubagentRunForSteerRestart; export const clearSubagentRunSteerRestart = subagentRunManager.clearSubagentRunSteerRestart; -export const replaceSubagentRunAfterSteer = subagentRunManager.replaceSubagentRunAfterSteer; +export const replaceSubagentRunAfterSteerCore = subagentRunManager.replaceSubagentRunAfterSteer; export const claimSubagentRunKill = subagentRunManager.claimSubagentRunKill; export const releaseSubagentRunKillClaim = subagentRunManager.releaseSubagentRunKillClaim; export const registerSubagentRun: (params: RegisterSubagentRunParams) => void = @@ -583,7 +583,6 @@ const publicApi = createSubagentRegistryPublicApi({ export const leasePendingAgentSteeringItems = publicApi.leasePendingAgentSteeringItems; export const ackPendingAgentSteeringItems = publicApi.ackPendingAgentSteeringItems; export const releasePendingAgentSteeringItems = publicApi.releasePendingAgentSteeringItems; -export const listSubagentRunsForController = publicApi.listSubagentRunsForController; export const getSubagentRunByRunId = publicApi.getSubagentRunByRunId; export const getSubagentRunsByRunIds = publicApi.getSubagentRunsByRunIds; export const completeCollectorLaunchCleanup = publicApi.completeCollectorLaunchCleanup; @@ -591,12 +590,7 @@ export const recordSwarmStructuredOutput = publicApi.recordSwarmStructuredOutput export const listSwarmRunsForGroup = publicApi.listSwarmRunsForGroup; export const getSwarmRunByLaunchReplayKey = publicApi.getSwarmRunByLaunchReplayKey; export const countActiveRunsForSession = publicApi.countActiveRunsForSession; -export const countActiveDescendantRuns = publicApi.countActiveDescendantRuns; -export const countPendingDescendantRuns = publicApi.countPendingDescendantRuns; -export const listDescendantRunsForRequester = publicApi.listDescendantRunsForRequester; export const getSubagentRunByChildSessionKey = publicApi.getSubagentRunByChildSessionKey; -export const getLatestSubagentRunByChildSessionKey = - publicApi.getLatestSubagentRunByChildSessionKey; export function initSubagentRegistry() { const state = getSubagentRegistryBootstrapState(); if (!state.ready || !state.restorer) { diff --git a/src/agents/test-helpers/live-cache-regression-runner.ts b/src/agents/test-helpers/live-cache-regression-runner.ts index 8dfc931e8708..677b9d4b2d0a 100644 --- a/src/agents/test-helpers/live-cache-regression-runner.ts +++ b/src/agents/test-helpers/live-cache-regression-runner.ts @@ -9,7 +9,7 @@ import fs from "node:fs/promises"; import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce"; import { Type } from "typebox"; import type { AssistantMessage, Message, Tool } from "../../llm/types.js"; -import { extractAssistantText } from "../embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "../embedded-agent-utils.js"; import { assertAgainstBaseline, type BaselineFindings, @@ -159,7 +159,7 @@ async function runToolOnlyTurn(params: { ); let toolCall = extractFirstToolCall(response); - let text = extractAssistantText(response); + let text = extractEmbeddedAssistantText(response); for (let attempt = 0; attempt < 2 && (!toolCall || text.length > 0); attempt += 1) { prompt = `Return only a tool call for \`${params.tool.name}\` with {}. No text.`; response = await completeSimpleWithLiveTimeout( @@ -174,7 +174,7 @@ async function runToolOnlyTurn(params: { timeoutMs, ); toolCall = extractFirstToolCall(response); - text = extractAssistantText(response); + text = extractEmbeddedAssistantText(response); } assert(toolCall, `expected tool call for ${params.tool.name}`); @@ -226,7 +226,7 @@ async function completeCacheProbe(params: { `${params.providerTag} cache lane ${params.suffix}`, timeoutMs, ); - const text = extractAssistantText(response); + const text = extractEmbeddedAssistantText(response); const usage = normalizeCacheUsage(response.usage); if ( shouldAcceptEmptyCacheProbe({ diff --git a/src/agents/tools/assistant-phase-text.test.ts b/src/agents/tools/assistant-phase-text.test.ts index 09cdb26e78a1..dc0310381469 100644 --- a/src/agents/tools/assistant-phase-text.test.ts +++ b/src/agents/tools/assistant-phase-text.test.ts @@ -1,7 +1,7 @@ // Assistant phase text tests cover extracting final-answer text from signed // assistant message phases. import { describe, expect, it } from "vitest"; -import { extractAssistantText as extractChatHistoryAssistantText } from "./chat-history-text.js"; +import { extractStoredAssistantText as extractChatHistoryAssistantText } from "./chat-history-text.js"; function assistantTextPart(id: string, phase: string, text: string) { return { diff --git a/src/agents/tools/chat-history-text.ts b/src/agents/tools/chat-history-text.ts index 9da90dbaeaff..ca111a9e2c64 100644 --- a/src/agents/tools/chat-history-text.ts +++ b/src/agents/tools/chat-history-text.ts @@ -26,7 +26,7 @@ export function sanitizeTextContent(text: string): string { return sanitizeAssistantVisibleTextWithProfile(text, "history"); } -export function extractAssistantText(message: unknown): string | undefined { +export function extractStoredAssistantText(message: unknown): string | undefined { if (!message || typeof message !== "object") { return undefined; } diff --git a/src/agents/tools/common.ts b/src/agents/tools/common.ts index 09dbf4c20135..015001cb1ea7 100644 --- a/src/agents/tools/common.ts +++ b/src/agents/tools/common.ts @@ -124,17 +124,17 @@ function isBlankParamValue(raw: unknown): boolean { return typeof raw === "string" && raw.trim() === ""; } -export function readStringParam( +export function readToolStringParam( params: Record, key: string, options: StringParamOptions & { required: true }, ): string; -export function readStringParam( +export function readToolStringParam( params: Record, key: string, options?: StringParamOptions, ): string | undefined; -export function readStringParam( +export function readToolStringParam( params: Record, key: string, options: StringParamOptions = {}, @@ -388,7 +388,7 @@ export function readReactionParams( const emojiKey = options.emojiKey ?? "emoji"; const removeKey = options.removeKey ?? "remove"; const remove = typeof params[removeKey] === "boolean" ? params[removeKey] : false; - const emoji = readStringParam(params, emojiKey, { + const emoji = readToolStringParam(params, emojiKey, { required: true, allowEmpty: true, }); diff --git a/src/agents/tools/computer-tool.ts b/src/agents/tools/computer-tool.ts index fa1afe4d111c..35cb2a945978 100644 --- a/src/agents/tools/computer-tool.ts +++ b/src/agents/tools/computer-tool.ts @@ -32,7 +32,7 @@ import { type AnyAgentTool, readFiniteNumberParam, readPositiveIntegerParam, - readStringParam, + readToolStringParam, } from "./common.js"; import { gatewayCallOptionSchemaProperties } from "./gateway-schema.js"; import { callGatewayTool, type GatewayCallOptions, readGatewayCallOptions } from "./gateway.js"; @@ -296,7 +296,7 @@ function buildComputerActParams(params: { } case "key": case "hold_key": { - const keys = readStringParam(input, "text", { required: true }); + const keys = readToolStringParam(input, "text", { required: true }); wire.keys = keys; if (action === "hold_key") { const seconds = @@ -655,7 +655,9 @@ export function createComputerTool(options?: { serialize(async () => { signal?.throwIfAborted(); const params = args as Record; - const action = readStringParam(params, "action", { required: true }) as ComputerToolAction; + const action = readToolStringParam(params, "action", { + required: true, + }) as ComputerToolAction; const gatewayOpts = readGatewayCallOptions(params); const explicitNode = typeof params.node === "string" ? params.node : undefined; const explicitScreenIndex = (() => { diff --git a/src/agents/tools/conversation-tools.ts b/src/agents/tools/conversation-tools.ts index 27721bee6e32..da833953d920 100644 --- a/src/agents/tools/conversation-tools.ts +++ b/src/agents/tools/conversation-tools.ts @@ -17,7 +17,7 @@ import type { AnyAgentTool } from "./common.js"; import { jsonResult, readPositiveIntegerParam, - readStringParam, + readToolStringParam, ToolAuthorizationError, ToolInputError, } from "./common.js"; @@ -122,8 +122,8 @@ export function createConversationsListTool( requireOwner(options); const params = args as Record; const limit = Math.min(readPositiveIntegerParam(params, "limit") ?? 50, 100); - const channel = readStringParam(params, "channel"); - const query = readStringParam(params, "query"); + const channel = readToolStringParam(params, "channel"); + const query = readToolStringParam(params, "query"); const result = await deps.callGateway({ method: "conversations.list", params: { @@ -156,9 +156,9 @@ export function createConversationsSendTool( requireOwner(options); const params = args as Record; const conversationRef = readConversationRef( - readStringParam(params, "conversationRef", { required: true }), + readToolStringParam(params, "conversationRef", { required: true }), ); - const message = readStringParam(params, "message", { required: true }); + const message = readToolStringParam(params, "message", { required: true }); const operationId = buildConversationOperationId({ options, toolCallId, @@ -199,9 +199,9 @@ export function createConversationsTurnTool( requireOwner(options); const params = args as Record; const conversationRef = readConversationRef( - readStringParam(params, "conversationRef", { required: true }), + readToolStringParam(params, "conversationRef", { required: true }), ); - const message = readStringParam(params, "message", { required: true }); + const message = readToolStringParam(params, "message", { required: true }); const timeoutSeconds = readPositiveIntegerParam(params, "timeoutSeconds") ?? 30; const timeoutMs = timeoutSeconds * 1_000; const agentId = resolveToolAgentId(options); diff --git a/src/agents/tools/cron-tool.ts b/src/agents/tools/cron-tool.ts index 773e281e4890..6fc2c3c28b74 100644 --- a/src/agents/tools/cron-tool.ts +++ b/src/agents/tools/cron-tool.ts @@ -24,7 +24,7 @@ import { jsonResult, readNonNegativeIntegerParam, readPositiveIntegerParam, - readStringParam, + readToolStringParam, } from "./common.js"; import { assertCronToolAgentFieldMatchesScope, @@ -76,7 +76,7 @@ function isMissingOrEmptyObject(value: unknown): boolean { } function readCronJobIdParam(params: Record) { - return readStringParam(params, "jobId") ?? readStringParam(params, "id"); + return readToolStringParam(params, "jobId") ?? readToolStringParam(params, "id"); } const CRON_SELF_REMOVE_SCOPE_ERROR = "Automations tool is restricted to the current automation."; @@ -204,7 +204,7 @@ Job wakeMode (main jobs): "now"(default)|"next-heartbeat". Restricted automation execute: async (_toolCallId, args, operationSignal) => { operationSignal?.throwIfAborted(); const params = args as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); assertCronSelfRemoveScope(opts, action, params); const parsedGatewayOpts = readGatewayCallOptions(params); const gatewayOpts: GatewayCallOptions = { @@ -596,7 +596,7 @@ Job wakeMode (main jobs): "now"(default)|"next-heartbeat". Restricted automation if (!jobId || !runId) { throw new Error("cron next_check is only available to the currently running job"); } - const rawDuration = readStringParam(params, "in", { required: true }); + const rawDuration = readToolStringParam(params, "in", { required: true }); let delayMs: number; try { delayMs = parseDurationMs(rawDuration); @@ -610,7 +610,7 @@ Job wakeMode (main jobs): "now"(default)|"next-heartbeat". Restricted automation return jsonResult({ ok: true, delayMs }); } case "wake": { - const text = readStringParam(params, "text", { required: true }); + const text = readToolStringParam(params, "text", { required: true }); const mode = params.mode === "now" || params.mode === "next-heartbeat" ? params.mode @@ -627,8 +627,8 @@ Job wakeMode (main jobs): "now"(default)|"next-heartbeat". Restricted automation // calling agent. const cfg = getRuntimeConfig(); const { mainKey, alias } = resolveMainSessionAlias(cfg); - const explicitSessionKey = readStringParam(params, "sessionKey"); - const explicitAgentId = readStringParam(params, "agentId"); + const explicitSessionKey = readToolStringParam(params, "sessionKey"); + const explicitAgentId = readToolStringParam(params, "agentId"); if (callerScope) { assertCronToolAgentFieldMatchesScope({ value: explicitAgentId, diff --git a/src/agents/tools/dashboard-tool.ts b/src/agents/tools/dashboard-tool.ts index 427d3d94c4f1..b16078b0da5a 100644 --- a/src/agents/tools/dashboard-tool.ts +++ b/src/agents/tools/dashboard-tool.ts @@ -9,7 +9,7 @@ import type { AnyAgentTool } from "./common.js"; import { readNumberParam, readStringArrayParam, - readStringParam, + readToolStringParam, textResult, ToolInputError, } from "./common.js"; @@ -111,7 +111,7 @@ function readDock( params: Record, key: "chatDock" | "dock", ): "left" | "right" | "bottom" | "hidden" | undefined { - const value = readStringParam(params, key); + const value = readToolStringParam(params, key); if ( value === undefined || value === "left" || @@ -133,7 +133,7 @@ function requireInteger(params: Record, key: string): number { } function readTabId(params: Record): string { - const tabId = readStringParam(params, "tabId", { required: true }); + const tabId = readToolStringParam(params, "tabId", { required: true }); if (!BOARD_TAB_ID_REGEX.test(tabId)) { throw new ToolInputError("tabId must be a lowercase slug up to 40 characters"); } @@ -141,7 +141,7 @@ function readTabId(params: Record): string { } function readOptionalTabId(params: Record): string | undefined { - const tabId = readStringParam(params, "tabId"); + const tabId = readToolStringParam(params, "tabId"); if (tabId !== undefined && !BOARD_TAB_ID_REGEX.test(tabId)) { throw new ToolInputError("tabId must be a lowercase slug up to 40 characters"); } @@ -160,17 +160,17 @@ function readPluginProps(params: Record): Record): BoardOp { - const name = () => readStringParam(params, "name", { required: true }); + const name = () => readToolStringParam(params, "name", { required: true }); switch (action) { case "tab_create": return { kind: "tab_create", tabId: readTabId(params), - title: readStringParam(params, "title", { required: true }), + title: readToolStringParam(params, "title", { required: true }), ...(readDock(params, "chatDock") ? { chatDock: readDock(params, "chatDock") } : {}), }; case "tab_update": { - const title = readStringParam(params, "title"); + const title = readToolStringParam(params, "title"); const chatDock = readDock(params, "chatDock"); const position = readNumberParam(params, "position", { integer: true, strict: true }); if (title === undefined && chatDock === undefined && position === undefined) { @@ -192,9 +192,9 @@ function opForAction(action: string, params: Record): BoardOp { tabIds: readStringArrayParam(params, "tabIds", { required: true }), }; case "widget_move": { - const targetTabId = readStringParam(params, "tabId"); + const targetTabId = readToolStringParam(params, "tabId"); const position = readNumberParam(params, "position", { integer: true, strict: true }); - const after = readStringParam(params, "after"); + const after = readToolStringParam(params, "after"); if (position !== undefined && after !== undefined) { throw new ToolInputError("widget_move accepts either position or after, not both"); } @@ -251,7 +251,7 @@ export function createDashboardTool(opts: DashboardToolOptions = {}): AnyAgentTo parameters: DashboardToolSchema, execute: async (_toolCallId, rawArgs) => { const params = rawArgs as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const sessionKey = requireSessionKey(opts.agentSessionKey); if (action === "read") { return snapshotResult(await gatewayCall("board.get", { sessionKey })); @@ -281,19 +281,19 @@ export function createDashboardTool(opts: DashboardToolOptions = {}): AnyAgentTo }); } if (action === "widget_put") { - const pluginKind = readStringParam(params, "pluginKind", { required: true }); + const pluginKind = readToolStringParam(params, "pluginKind", { required: true }); if (!BOARD_PLUGIN_KIND_REGEX.test(pluginKind)) { throw new ToolInputError("pluginKind must use the : format"); } - const title = readStringParam(params, "title"); + const title = readToolStringParam(params, "title"); const tabId = readOptionalTabId(params); - const size = readStringParam(params, "size"); - const after = readStringParam(params, "after"); + const size = readToolStringParam(params, "size"); + const after = readToolStringParam(params, "after"); const props = readPluginProps(params); return snapshotResult( await gatewayCall("board.widget.put", { sessionKey, - name: readStringParam(params, "name", { required: true }), + name: readToolStringParam(params, "name", { required: true }), ...(title !== undefined ? { title } : {}), content: { kind: "plugin", diff --git a/src/agents/tools/gateway-tool.ts b/src/agents/tools/gateway-tool.ts index 1dbae36f46d0..f34d0a6eccf0 100644 --- a/src/agents/tools/gateway-tool.ts +++ b/src/agents/tools/gateway-tool.ts @@ -7,7 +7,7 @@ import { stringEnum } from "../schema/typebox.js"; import { type AnyAgentTool, jsonResult, - readStringParam, + readToolStringParam, textResult, ToolInputError, } from "./common.js"; @@ -113,17 +113,17 @@ export function createGatewayTool(): AnyAgentTool { parameters: GatewayToolSchema, execute: async (_toolCallId, args, signal) => { const params = args as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const gatewayOpts = readGatewayCallOptions(params); if (action === "config.get") { - const path = readStringParam(params, "path"); + const path = readToolStringParam(params, "path"); const snapshot = await callGatewayTool("config.get", gatewayOpts, {}, { signal }); const result = selectGatewayConfigGetResult(snapshot, path); return createGatewayConfigGetToolResult(result); } if (action === "config.schema.lookup") { - const path = readStringParam(params, "path", { + const path = readToolStringParam(params, "path", { required: true, label: "path", }); diff --git a/src/agents/tools/gateway.ts b/src/agents/tools/gateway.ts index 2ce5b8b1decd..e69d1b5d6f37 100644 --- a/src/agents/tools/gateway.ts +++ b/src/agents/tools/gateway.ts @@ -30,7 +30,7 @@ import { type DeviceIdentity, } from "../../infra/device-identity.js"; import { formatErrorMessage } from "../../infra/errors.js"; -import { readPositiveIntegerParam, readStringParam } from "./common.js"; +import { readPositiveIntegerParam, readToolStringParam } from "./common.js"; import { getGatewayToolCallerIdentity } from "./gateway-caller-context.js"; import { getGatewaySessionSpawnContext } from "./gateway-session-spawn-context.js"; @@ -46,8 +46,8 @@ type GatewayOverrideTarget = "local" | "remote"; /** Reads common gateway options from tool parameters while preserving explicit token whitespace. */ export function readGatewayCallOptions(params: Record): GatewayCallOptions { return { - gatewayUrl: readStringParam(params, "gatewayUrl", { trim: false }), - gatewayToken: readStringParam(params, "gatewayToken", { trim: false }), + gatewayUrl: readToolStringParam(params, "gatewayUrl", { trim: false }), + gatewayToken: readToolStringParam(params, "gatewayToken", { trim: false }), timeoutMs: readPositiveIntegerParam(params, "timeoutMs"), }; } diff --git a/src/agents/tools/goal-tools.ts b/src/agents/tools/goal-tools.ts index 90a835de6e52..d3c79891624d 100644 --- a/src/agents/tools/goal-tools.ts +++ b/src/agents/tools/goal-tools.ts @@ -19,7 +19,7 @@ import { ToolInputError, jsonResult, readPositiveIntegerParam, - readStringParam, + readToolStringParam, } from "./common.js"; type GoalToolOptions = { @@ -103,7 +103,7 @@ export function createCreateGoalTool(options: GoalToolOptions): AnyAgentTool { parameters: CreateGoalToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const objective = readStringParam(params, "objective", { required: true }); + const objective = readToolStringParam(params, "objective", { required: true }); const tokenBudget = readPositiveIntegerParam(params, "token_budget", { message: "token_budget must be a positive integer", }); @@ -130,7 +130,7 @@ export function createUpdateGoalTool(options: GoalToolOptions): AnyAgentTool { parameters: UpdateGoalToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const status = readStringParam(params, "status", { required: true }); + const status = readToolStringParam(params, "status", { required: true }); if ( !MODEL_UPDATABLE_SESSION_GOAL_STATUSES.includes( status as (typeof MODEL_UPDATABLE_SESSION_GOAL_STATUSES)[number], @@ -140,7 +140,7 @@ export function createUpdateGoalTool(options: GoalToolOptions): AnyAgentTool { `status must be one of ${MODEL_UPDATABLE_SESSION_GOAL_STATUSES.join(", ")}`, ); } - const note = readStringParam(params, "note"); + const note = readToolStringParam(params, "note"); const scope = resolveGoalSessionScope(options); const goal = await updateSessionGoalStatus({ ...scope, diff --git a/src/agents/tools/image-generate-tool.ts b/src/agents/tools/image-generate-tool.ts index 5c4554d9d673..80f903aec47d 100644 --- a/src/agents/tools/image-generate-tool.ts +++ b/src/agents/tools/image-generate-tool.ts @@ -56,7 +56,7 @@ import { ToolInputError, readNonNegativeIntegerParam, readPositiveIntegerParam, - readStringParam, + readToolStringParam, } from "./common.js"; import { persistGeneratedMediaBatch } from "./generated-media-batch-persistence.js"; import { @@ -398,15 +398,15 @@ function readRecordParam(params: Record, key: string): Record): ImageGenerationOpenAIOptions { const raw = readRecordParam(args, "openai"); - const background = normalizeOpenAIBackground(readStringParam(raw, "background")); - const moderation = normalizeOpenAIModeration(readStringParam(raw, "moderation")); + const background = normalizeOpenAIBackground(readToolStringParam(raw, "background")); + const moderation = normalizeOpenAIModeration(readToolStringParam(raw, "moderation")); if (readSnakeCaseParamRaw(raw, "outputCompression") === null) { throw new ToolInputError("openai.outputCompression must be between 0 and 100"); } const outputCompression = readNonNegativeIntegerParam(raw, "outputCompression", { message: "openai.outputCompression must be between 0 and 100", }); - const user = readStringParam(raw, "user"); + const user = readToolStringParam(raw, "user"); if (outputCompression !== undefined && (outputCompression < 0 || outputCompression > 100)) { throw new ToolInputError("openai.outputCompression must be between 0 and 100"); } @@ -422,7 +422,7 @@ function normalizeProviderOptions( args: Record, ): ImageGenerationProviderOptions | undefined { const falRaw = readRecordParam(args, "fal"); - const falCreativity = normalizeFalCreativity(readStringParam(falRaw, "creativity")); + const falCreativity = normalizeFalCreativity(readToolStringParam(falRaw, "creativity")); const openai = normalizeOpenAIOptions(args); const fal = falCreativity ? { creativity: falCreativity } : undefined; return fal || Object.keys(openai).length > 0 @@ -927,7 +927,7 @@ export function createImageGenerateTool(options?: { return createImageGenerateStatusActionResult(options?.agentSessionKey); } - const model = readStringParam(params, "model"); + const model = readToolStringParam(params, "model"); const configuredImageGenerationModelConfig = coerceToolModelConfig( cfg.agents?.defaults?.mediaModels?.image, ); @@ -945,7 +945,7 @@ export function createImageGenerateTool(options?: { const effectiveCfg = applyImageGenerationModelConfigDefaults(cfg, imageGenerationModelConfig) ?? cfg; const remoteMediaSsrfPolicy = resolveRemoteMediaSsrfPolicy(effectiveCfg); - const prompt = readStringParam(params, "prompt", { required: true }); + const prompt = readToolStringParam(params, "prompt", { required: true }); const activeDuplicateGuardResult = createImageGenerateDuplicateGuardResult( options?.agentSessionKey, @@ -956,14 +956,14 @@ export function createImageGenerateTool(options?: { } const imageInputs = normalizeReferenceImages(params); - const filename = readStringParam(params, "filename"); - const size = readStringParam(params, "size"); - const aspectRatio = normalizeAspectRatio(readStringParam(params, "aspectRatio")); - const explicitResolution = normalizeResolution(readStringParam(params, "resolution")); + const filename = readToolStringParam(params, "filename"); + const size = readToolStringParam(params, "size"); + const aspectRatio = normalizeAspectRatio(readToolStringParam(params, "aspectRatio")); + const explicitResolution = normalizeResolution(readToolStringParam(params, "resolution")); const timeoutMs = readGenerationTimeoutMs(params) ?? imageGenerationModelConfig.timeoutMs; - const quality = normalizeQuality(readStringParam(params, "quality")); - const outputFormat = normalizeOutputFormat(readStringParam(params, "outputFormat")); - const background = normalizeBackground(readStringParam(params, "background")); + const quality = normalizeQuality(readToolStringParam(params, "quality")); + const outputFormat = normalizeOutputFormat(readToolStringParam(params, "outputFormat")); + const background = normalizeBackground(readToolStringParam(params, "background")); const providerOptions = normalizeProviderOptions(params); const imageGenerationProviders = preparedProviders ?? listRuntimeImageGenerationProviders({ config: effectiveCfg }); diff --git a/src/agents/tools/image-tool.helpers.ts b/src/agents/tools/image-tool.helpers.ts index 84af583005e9..8cbc85e847fa 100644 --- a/src/agents/tools/image-tool.helpers.ts +++ b/src/agents/tools/image-tool.helpers.ts @@ -7,7 +7,7 @@ import { estimateBase64DecodedBytes } from "@openclaw/media-core/base64"; import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { AssistantMessage } from "../../llm/types.js"; -import { extractAssistantText } from "../embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "../embedded-agent-utils.js"; import { isMinimaxVlmProvider } from "../minimax-vlm.js"; import { findNormalizedProviderValue, normalizeProviderId } from "../model-selection.js"; import { coerceToolModelConfig, type ToolModelConfig } from "./model-config.helpers.js"; @@ -62,7 +62,7 @@ function isImageReasoningFallbackSignature(value: unknown): boolean { /** Detects provider responses that contain only reasoning blocks and no usable image text. */ export function hasImageReasoningOnlyResponse(message: AssistantMessage): boolean { - if (extractAssistantText(message).trim() || !Array.isArray(message.content)) { + if (extractEmbeddedAssistantText(message).trim() || !Array.isArray(message.content)) { return false; } let checkedBlocks = 0; @@ -134,7 +134,7 @@ export function coerceImageAssistantText(params: { if (errorMessage) { throw new Error(`Image model failed (${params.provider}/${params.model}): ${errorMessage}`); } - const text = extractAssistantText(params.message); + const text = extractEmbeddedAssistantText(params.message); if (text.trim()) { return text.trim(); } diff --git a/src/agents/tools/media-tool-shared.ts b/src/agents/tools/media-tool-shared.ts index f3c24046b30b..477939079ecd 100644 --- a/src/agents/tools/media-tool-shared.ts +++ b/src/agents/tools/media-tool-shared.ts @@ -30,7 +30,7 @@ import { ToolInputError, readPositiveIntegerParam, readStringArrayParam, - readStringParam, + readToolStringParam, } from "./common.js"; import type { ImageModelConfig } from "./image-tool.helpers.js"; import { @@ -482,7 +482,7 @@ export function resolveGenerateAction(params: { allowed: readonly TAction[]; defaultAction: TAction; }): TAction { - const raw = readStringParam(params.args, "action"); + const raw = readToolStringParam(params.args, "action"); if (!raw) { return params.defaultAction; } @@ -513,7 +513,7 @@ export function normalizeMediaReferenceInputs(params: { maxCount: number; label: string; }): string[] { - const single = readStringParam(params.args, params.singularKey); + const single = readToolStringParam(params.args, params.singularKey); const multiple = readStringArrayParam(params.args, params.pluralKey); const combined = [...(single ? [single] : []), ...(multiple ?? [])]; const deduped: string[] = []; diff --git a/src/agents/tools/message-tool.ts b/src/agents/tools/message-tool.ts index db44e8fe1e40..78e4d629d524 100644 --- a/src/agents/tools/message-tool.ts +++ b/src/agents/tools/message-tool.ts @@ -95,7 +95,7 @@ import { stringEnum, } from "../schema/typebox.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readStringArrayParam, readStringParam } from "./common.js"; +import { jsonResult, readStringArrayParam, readToolStringParam } from "./common.js"; import { gatewayCallOptionSchemaProperties } from "./gateway-schema.js"; import { readGatewayCallOptions, @@ -514,7 +514,7 @@ function sanitizePresentationTextFieldsResult( function readFirstStringParam(params: Record, keys: readonly string[]): string { for (const key of keys) { - const value = readStringParam(params, key); + const value = readToolStringParam(params, key); if (value) { return value; } @@ -533,7 +533,7 @@ function readStructuredAttachmentMediaParams(value: unknown): string[] { } const record = attachment as Record; for (const key of ["media", "mediaUrl", "path", "filePath", "fileUrl", "url"]) { - const candidate = readStringParam(record, key); + const candidate = readToolStringParam(record, key); if (candidate) { values.push(candidate); } @@ -1199,12 +1199,12 @@ function enforceSourceReplyOnlyMessageAction(params: { throw new Error("Completion source replies require an authoritative current conversation."); } - const requestedChannel = readStringParam(params.args, "channel"); + const requestedChannel = readToolStringParam(params.args, "channel"); if (requestedChannel && normalizeMessageChannel(requestedChannel) !== sourceChannel) { throw new Error("Completion source replies cannot target another channel."); } - const requestedAccountId = readStringParam(params.args, "accountId"); + const requestedAccountId = readToolStringParam(params.args, "accountId"); const sourceAccountId = params.trustedTurnContext ? params.trustedTurnContext.requesterAccountId : params.currentAccountId; @@ -1221,7 +1221,7 @@ function enforceSourceReplyOnlyMessageAction(params: { throw new Error("Completion source replies cannot target another thread."); } - const requestedReplyTo = readStringParam(params.args, "replyTo"); + const requestedReplyTo = readToolStringParam(params.args, "replyTo"); const sourceMessageId = normalizeOptionalStringifiedId(sourceContext.currentMessageId); if ( requestedReplyTo && @@ -1621,7 +1621,7 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool { } // Shallow-copy so we don't mutate the original event args (used for logging/dedup). const params = { ...(args as Record) }; - const action = readStringParam(params, "action", { + const action = readToolStringParam(params, "action", { required: true, }) as ChannelMessageActionName; const trustedTurnContext = @@ -1739,7 +1739,7 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool { const gatewayOpts = readGatewayCallOptions(params); const rawConfig = options?.config ?? loadConfigForTool(); - const requestedAccountId = readStringParam(params, "accountId"); + const requestedAccountId = readToolStringParam(params, "accountId"); validateExplicitMessageAccountSelection({ cfg: rawConfig, accountId: requestedAccountId, @@ -1840,9 +1840,9 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool { const vote = recentPollVote; recentPollVoteBySession.delete(pollEchoSessionKey); const outboundText = - readStringParam(params, "text") ?? - readStringParam(params, "message") ?? - readStringParam(params, "content"); + readToolStringParam(params, "text") ?? + readToolStringParam(params, "message") ?? + readToolStringParam(params, "content"); if (outboundText && isPollVoteEchoText(vote.option, outboundText)) { return jsonResult({ status: "suppressed", diff --git a/src/agents/tools/mobile-ui-tool.ts b/src/agents/tools/mobile-ui-tool.ts index c7e2641d7656..ae7fa72db5f0 100644 --- a/src/agents/tools/mobile-ui-tool.ts +++ b/src/agents/tools/mobile-ui-tool.ts @@ -11,7 +11,7 @@ import { normalizeOptionalLowercaseString } from "@openclaw/normalization-core/s import { Type } from "typebox"; import { formatErrorMessage } from "../../infra/errors.js"; import { stringEnum } from "../schema/typebox.js"; -import { type AnyAgentTool, jsonResult, readStringParam, ToolInputError } from "./common.js"; +import { type AnyAgentTool, jsonResult, readToolStringParam, ToolInputError } from "./common.js"; import { gatewayCallOptionSchemaProperties } from "./gateway-schema.js"; import { callGatewayTool, type GatewayCallOptions, readGatewayCallOptions } from "./gateway.js"; import { @@ -152,26 +152,26 @@ function readMobileUiAction(input: Record): MobileUiAction { throw new ToolInputError("mobileAction required for act"); } const action = input.mobileAction; - const type = readStringParam(action, "type", { required: true }); + const type = readToolStringParam(action, "type", { required: true }); switch (type) { case "activate": - return { type, ref: readStringParam(action, "ref", { required: true }) }; + return { type, ref: readToolStringParam(action, "ref", { required: true }) }; case "set_text": return { type, - ref: readStringParam(action, "ref", { required: true }), - text: readStringParam(action, "text", { + ref: readToolStringParam(action, "ref", { required: true }), + text: readToolStringParam(action, "text", { required: true, trim: false, allowEmpty: true, }), }; case "scroll": { - const direction = readStringParam(action, "direction", { required: true }); + const direction = readToolStringParam(action, "direction", { required: true }); if (direction !== "forward" && direction !== "backward") { throw new ToolInputError("direction must be forward or backward"); } - return { type, ref: readStringParam(action, "ref", { required: true }), direction }; + return { type, ref: readToolStringParam(action, "ref", { required: true }), direction }; } case "tap": return { @@ -192,7 +192,7 @@ function readMobileUiAction(input: Record): MobileUiAction { }), }; case "global_action": { - const name = readStringParam(action, "name", { required: true }); + const name = readToolStringParam(action, "name", { required: true }); if (!(GLOBAL_ACTION_NAMES as readonly string[]).includes(name)) { throw new ToolInputError("name must be back, home, recents, or notifications"); } @@ -321,7 +321,7 @@ function parseMobileUiNode(value: unknown): MobileUiNode { if (!isRecord(value)) { throw new Error("mobile.ui.observe returned an invalid node"); } - const ref = readStringParam(value, "ref", { required: true }); + const ref = readToolStringParam(value, "ref", { required: true }); const role = typeof value.role === "string" ? value.role : ""; if ( !Array.isArray(value.bounds) || @@ -356,7 +356,7 @@ function parseMobileUiNode(value: unknown): MobileUiNode { function parseMobileUiSnapshot(payload: unknown): MobileUiSnapshot { const record = payloadRecord(payload, MOBILE_UI_OBSERVE_COMMAND); - const snapshotId = readStringParam(record, "snapshotId", { required: true }); + const snapshotId = readToolStringParam(record, "snapshotId", { required: true }); if (!Array.isArray(record.nodes)) { throw new Error("mobile.ui.observe response missing nodes"); } @@ -371,7 +371,7 @@ function parseMobileUiSnapshot(payload: unknown): MobileUiSnapshot { function parseMobileUiOutcome(payload: unknown): MobileUiOutcome { const record = payloadRecord(payload, MOBILE_UI_ACT_COMMAND); return { - code: readStringParam(record, "code", { required: true }), + code: readToolStringParam(record, "code", { required: true }), message: nullableString(record.message, "message"), }; } @@ -542,7 +542,7 @@ export function createMobileUiTool(options?: { serialize(async () => { signal?.throwIfAborted(); const input = args as Record; - const action = readStringParam(input, "action", { required: true }); + const action = readToolStringParam(input, "action", { required: true }); if (action !== "observe" && action !== "act") { throw new ToolInputError("action must be observe or act"); } @@ -572,7 +572,7 @@ export function createMobileUiTool(options?: { return jsonResult(await observe()); } - const snapshotId = readStringParam(input, "snapshotId", { required: true }); + const snapshotId = readToolStringParam(input, "snapshotId", { required: true }); const mobileAction = readMobileUiAction(input); const observed = observations.get(node.nodeId); if (!observed || observed.snapshotId !== snapshotId) { diff --git a/src/agents/tools/music-generate-tool.ts b/src/agents/tools/music-generate-tool.ts index 4a1de2de1523..dc4b8ec36495 100644 --- a/src/agents/tools/music-generate-tool.ts +++ b/src/agents/tools/music-generate-tool.ts @@ -39,7 +39,7 @@ import { recordRecentMediaGenerationTaskStartForSession, } from "../media-generation-task-status-shared.js"; import type { PreparedModelRuntimeSnapshot } from "../prepared-model-runtime.js"; -import { ToolInputError, readNumberParam, readStringParam } from "./common.js"; +import { ToolInputError, readNumberParam, readToolStringParam } from "./common.js"; import { persistGeneratedMediaBatch } from "./generated-media-batch-persistence.js"; import { decodeDataUrl } from "./image-tool.helpers.js"; import { @@ -686,7 +686,7 @@ export function createMusicGenerateTool(options?: { const explicitModelConfig = hasExplicitMusicGenerationModelConfig(cfg); const effectiveCfg = applyMusicGenerationModelConfigDefaults(cfg, musicGenerationModelConfig) ?? cfg; - const prompt = readStringParam(args, "prompt", { required: true }); + const prompt = readToolStringParam(args, "prompt", { required: true }); const activeDuplicateGuardResult = createMusicGenerateDuplicateGuardResult( options?.agentSessionKey, @@ -696,9 +696,9 @@ export function createMusicGenerateTool(options?: { return activeDuplicateGuardResult; } - const lyrics = readStringParam(args, "lyrics"); + const lyrics = readToolStringParam(args, "lyrics"); const instrumental = readBooleanToolParam(args, "instrumental"); - const model = readStringParam(args, "model"); + const model = readToolStringParam(args, "model"); const durationSeconds = readNumberParam(args, "durationSeconds", { positiveInteger: true, strict: true, @@ -709,8 +709,8 @@ export function createMusicGenerateTool(options?: { ) { throw new ToolInputError("durationSeconds must be a positive integer"); } - const format = normalizeOutputFormat(readStringParam(args, "format")); - const filename = readStringParam(args, "filename"); + const format = normalizeOutputFormat(readToolStringParam(args, "format")); + const filename = readToolStringParam(args, "filename"); const timeout = normalizeMusicGenerationTimeoutMs(musicGenerationModelConfig.timeoutMs); const timeoutMs = timeout.timeoutMs; const imageInputs = normalizeReferenceImageInputs(args); diff --git a/src/agents/tools/nodes-tool-commands.ts b/src/agents/tools/nodes-tool-commands.ts index b3c4367c3060..0d70fc1031d7 100644 --- a/src/agents/tools/nodes-tool-commands.ts +++ b/src/agents/tools/nodes-tool-commands.ts @@ -12,7 +12,7 @@ import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, - readStringParam, + readToolStringParam, } from "./common.js"; import type { GatewayCallOptions } from "./gateway.js"; import { callGatewayTool } from "./gateway.js"; @@ -56,8 +56,8 @@ export async function executeNodeCommandAction(params: { > { switch (params.action) { case "camera_ptz": { - const node = readStringParam(params.input, "node", { required: true }); - const deviceId = readStringParam(params.input, "deviceId", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); + const deviceId = readToolStringParam(params.input, "deviceId", { required: true }); const ptzOperation = normalizeLowercaseStringOrEmpty(params.input.ptzOperation); if ( ptzOperation !== "status" && @@ -102,7 +102,7 @@ export async function executeNodeCommandAction(params: { case "device_info": case "device_permissions": case "device_health": { - const node = readStringParam(params.input, "node", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); const payloadRaw = await invokeNodeCommandPayload({ gatewayOpts: params.gatewayOpts, node, @@ -113,8 +113,10 @@ export async function executeNodeCommandAction(params: { return jsonResult(payload); } case "notifications_action": { - const node = readStringParam(params.input, "node", { required: true }); - const notificationKey = readStringParam(params.input, "notificationKey", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); + const notificationKey = readToolStringParam(params.input, "notificationKey", { + required: true, + }); const notificationAction = normalizeLowercaseStringOrEmpty(params.input.notificationAction); if ( notificationAction !== "open" && @@ -145,7 +147,7 @@ export async function executeNodeCommandAction(params: { return jsonResult(payload); } case "location_get": { - const node = readStringParam(params.input, "node", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); const maxAgeMs = readNonNegativeIntegerParam(params.input, "maxAgeMs"); const desiredAccuracy = params.input.desiredAccuracy === "coarse" || @@ -167,7 +169,7 @@ export async function executeNodeCommandAction(params: { return jsonResult(payload); } case "which": { - const node = readStringParam(params.input, "node", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); const bins = readStringArrayParam(params.input, "bins", { required: true }); const payload = await invokeNodeCommandPayload({ gatewayOpts: params.gatewayOpts, @@ -178,9 +180,9 @@ export async function executeNodeCommandAction(params: { return jsonResult(payload); } case "invoke": { - const node = readStringParam(params.input, "node", { required: true }); + const node = readToolStringParam(params.input, "node", { required: true }); const nodeId = await resolveNodeId(params.gatewayOpts, node); - const invokeCommand = readStringParam(params.input, "invokeCommand", { required: true }); + const invokeCommand = readToolStringParam(params.input, "invokeCommand", { required: true }); const invokeCommandNormalized = normalizeLowercaseStringOrEmpty(invokeCommand); if (BLOCKED_INVOKE_COMMANDS.has(invokeCommandNormalized)) { throw new Error( diff --git a/src/agents/tools/nodes-tool.ts b/src/agents/tools/nodes-tool.ts index 7bdafd782392..0dc5a1a097a0 100644 --- a/src/agents/tools/nodes-tool.ts +++ b/src/agents/tools/nodes-tool.ts @@ -19,7 +19,7 @@ import { optionalStringEnum, stringEnum, } from "../schema/typebox.js"; -import { type AnyAgentTool, jsonResult, readStringParam } from "./common.js"; +import { type AnyAgentTool, jsonResult, readToolStringParam } from "./common.js"; import { gatewayCallOptionSchemaProperties } from "./gateway-schema.js"; import { callGatewayTool, readGatewayCallOptions } from "./gateway.js"; import { executeNodeCommandAction, type NodeCommandAction } from "./nodes-tool-commands.js"; @@ -188,7 +188,7 @@ export function createNodesTool(options?: { parameters: NodesToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const gatewayOpts = readGatewayCallOptions(params); try { @@ -196,7 +196,7 @@ export function createNodesTool(options?: { case "status": return jsonResult(await callGatewayTool("node.list", gatewayOpts, {})); case "describe": { - const node = readStringParam(params, "node"); + const node = readToolStringParam(params, "node"); if (!node) { throw new Error( 'node required for describe; call nodes with action="status" to list nodes, then retry with node', @@ -208,7 +208,7 @@ export function createNodesTool(options?: { case "pending": return jsonResult(await callGatewayTool("node.pair.list", gatewayOpts, {})); case "approve": { - const requestId = readStringParam(params, "requestId", { + const requestId = readToolStringParam(params, "requestId", { required: true, }); const scopes = await resolveNodePairApproveScopes(gatewayOpts, requestId); @@ -224,7 +224,7 @@ export function createNodesTool(options?: { ); } case "reject": { - const requestId = readStringParam(params, "requestId", { + const requestId = readToolStringParam(params, "requestId", { required: true, }); return jsonResult( @@ -234,7 +234,7 @@ export function createNodesTool(options?: { ); } case "notify": { - const node = readStringParam(params, "node", { required: true }); + const node = readToolStringParam(params, "node", { required: true }); const title = typeof params.title === "string" ? params.title : ""; const body = typeof params.body === "string" ? params.body : ""; if (!title.trim() && !body.trim()) { diff --git a/src/agents/tools/openclaw-delegate-tool.ts b/src/agents/tools/openclaw-delegate-tool.ts index b4f025f680eb..db5bae416a45 100644 --- a/src/agents/tools/openclaw-delegate-tool.ts +++ b/src/agents/tools/openclaw-delegate-tool.ts @@ -2,7 +2,7 @@ import { createHash, randomUUID } from "node:crypto"; import { Type } from "typebox"; import { SYSTEM_AGENT_ID } from "../../system-agent/agent-id.js"; -import { jsonResult, readStringParam, type AnyAgentTool } from "./common.js"; +import { jsonResult, readToolStringParam, type AnyAgentTool } from "./common.js"; import { callInProcessGatewayTool, type InProcessGatewayCaller } from "./in-process-gateway.js"; const OpenClawDelegateSchema = Type.Object({ @@ -53,8 +53,8 @@ function createOpenClawDelegateTool(options?: { outputSchema: OpenClawDelegateOutputSchema, execute: async (_toolCallId, args) => { const params = (args ?? {}) as Record; - const message = readStringParam(params, "message", { required: true }); - const sessionId = readStringParam(params, "sessionId") ?? defaultSessionId; + const message = readToolStringParam(params, "message", { required: true }); + const sessionId = readToolStringParam(params, "sessionId") ?? defaultSessionId; const callGateway = options?.callGateway ?? callInProcessGatewayTool; const result = await callGateway("openclaw.chat", { sessionId, diff --git a/src/agents/tools/pdf-tool.helpers.ts b/src/agents/tools/pdf-tool.helpers.ts index 97a070213e34..6aa0cbddcb6a 100644 --- a/src/agents/tools/pdf-tool.helpers.ts +++ b/src/agents/tools/pdf-tool.helpers.ts @@ -10,7 +10,7 @@ import { import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { AssistantMessage } from "../../llm/types.js"; import { providerSupportsNativePdfDocument } from "../../media-understanding/defaults.js"; -import { extractAssistantText } from "../embedded-agent-utils.js"; +import { extractEmbeddedAssistantText } from "../embedded-agent-utils.js"; /** Normalized PDF model preference used by tool registration and execution. */ type PdfModelConfig = { primary?: string; fallbacks?: string[] }; @@ -108,7 +108,7 @@ export function coercePdfAssistantText(params: { if (errorMessage) { fail(errorMessage); } - const text = extractAssistantText(params.message); + const text = extractEmbeddedAssistantText(params.message); const trimmed = text.trim(); if (trimmed) { return trimmed; diff --git a/src/agents/tools/screen-tool.ts b/src/agents/tools/screen-tool.ts index e8fdfec7afc4..8fe803679a68 100644 --- a/src/agents/tools/screen-tool.ts +++ b/src/agents/tools/screen-tool.ts @@ -4,7 +4,7 @@ import type { UiCommand, UiCommandParams } from "../../../packages/gateway-proto // The tool returns the Gateway result unchanged, so the wire schema remains the single owner. import { UiCommandResultSchema } from "../../../packages/gateway-protocol/src/schema/ui-command.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readStringParam, ToolInputError } from "./common.js"; +import { jsonResult, readToolStringParam, ToolInputError } from "./common.js"; import { callInProcessGatewayTool, type InProcessGatewayCaller } from "./in-process-gateway.js"; const ACTIONS = [ @@ -41,7 +41,7 @@ function resolveSessionKey( params: Record, agentSessionKey: string | undefined, ): string { - const sessionKey = readStringParam(params, "sessionKey") ?? agentSessionKey?.trim(); + const sessionKey = readToolStringParam(params, "sessionKey") ?? agentSessionKey?.trim(); if (!sessionKey) { throw new ToolInputError("sessionKey required"); } @@ -49,7 +49,7 @@ function resolveSessionKey( } function readDock(params: Record): "bottom" | "right" | undefined { - const dock = readStringParam(params, "dock"); + const dock = readToolStringParam(params, "dock"); if (dock === undefined || dock === "bottom" || dock === "right") { return dock; } @@ -107,7 +107,7 @@ export function createScreenTool(opts: ScreenToolOptions = {}): AnyAgentTool { requiredClientCaps: [GATEWAY_CLIENT_CAPS.UI_COMMANDS], execute: async (_toolCallId, rawArgs) => { const params = rawArgs as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const payload: UiCommandParams = { command: commandForAction(action, params, opts.agentSessionKey), ...(opts.agentSessionKey ? { sessionKey: opts.agentSessionKey } : {}), diff --git a/src/agents/tools/session-status-tool.ts b/src/agents/tools/session-status-tool.ts index 3d9c9e7a7651..19e2f9b0d9d9 100644 --- a/src/agents/tools/session-status-tool.ts +++ b/src/agents/tools/session-status-tool.ts @@ -70,7 +70,7 @@ import type { AnyAgentTool } from "./common.js"; import { normalizeToolModelOverride, readNonNegativeIntegerParam, - readStringParam, + readToolStringParam, } from "./common.js"; import { callAgentToolGatewayRequest, @@ -634,7 +634,7 @@ export function createSessionStatusTool(opts?: { callGateway: gatewayCall, }); - const requestedKeyParam = readStringParam(params, "sessionKey"); + const requestedKeyParam = readToolStringParam(params, "sessionKey"); const isImplicitRunSessionStatus = requestedKeyParam === undefined && Boolean(opts?.runSessionKey?.trim()); let requestedKeyRaw = requestedKeyParam ?? opts?.agentSessionKey; @@ -878,7 +878,7 @@ export function createSessionStatusTool(opts?: { const configured = resolveDefaultModelForAgent({ cfg, agentId }); const selectedAgentDir = resolveAgentDir(cfg, agentId); const selectedWorkspaceDir = resolveAgentWorkspaceDir(cfg, agentId); - const modelRaw = readStringParam(params, "model"); + const modelRaw = readToolStringParam(params, "model"); let changedModel = false; if (typeof modelRaw === "string") { const selection = await resolveModelOverride({ diff --git a/src/agents/tools/sessions-history-tool.ts b/src/agents/tools/sessions-history-tool.ts index 72ba054d2725..ca3bcdee91d9 100644 --- a/src/agents/tools/sessions-history-tool.ts +++ b/src/agents/tools/sessions-history-tool.ts @@ -22,7 +22,7 @@ import { jsonResult, readNonNegativeIntegerParam, readPositiveIntegerParam, - readStringParam, + readToolStringParam, ToolInputError, } from "./common.js"; import { @@ -365,13 +365,13 @@ export function createSessionsHistoryTool(opts?: { execute: async (_toolCallId, args) => { const params = args as Record; const gatewayCall = opts?.callGateway ?? callAgentToolGatewayRequest; - const sessionKeyParam = readStringParam(params, "sessionKey", { + const sessionKeyParam = readToolStringParam(params, "sessionKey", { required: true, }); const limit = readPositiveIntegerParam(params, "limit"); const offset = readOffsetParam(params); - const messageId = readStringParam(params, "messageId"); - const sessionId = readStringParam(params, "sessionId"); + const messageId = readToolStringParam(params, "messageId"); + const sessionId = readToolStringParam(params, "sessionId"); if (offset !== undefined && messageId) { throw new ToolInputError("offset and messageId cannot be used together"); } diff --git a/src/agents/tools/sessions-list-tool.ts b/src/agents/tools/sessions-list-tool.ts index 784514b88af2..21e7431423df 100644 --- a/src/agents/tools/sessions-list-tool.ts +++ b/src/agents/tools/sessions-list-tool.ts @@ -34,7 +34,7 @@ import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, - readStringParam, + readToolStringParam, } from "./common.js"; import { callAgentToolGatewayRequest, @@ -180,9 +180,9 @@ export function createSessionsListTool(opts?: { const activeMinutes = readPositiveIntegerParam(params, "activeMinutes"); const messageLimitRaw = readNonNegativeIntegerParam(params, "messageLimit") ?? 0; const messageLimit = Math.min(messageLimitRaw, 20); - const label = readStringParam(params, "label"); - const agentId = readStringParam(params, "agentId"); - const search = readStringParam(params, "search"); + const label = readToolStringParam(params, "label"); + const agentId = readToolStringParam(params, "agentId"); + const search = readToolStringParam(params, "search"); const archived = params.archived === true; const includeDerivedTitles = params.includeDerivedTitles === true; const includeLastMessage = params.includeLastMessage === true; diff --git a/src/agents/tools/sessions-search-tool.ts b/src/agents/tools/sessions-search-tool.ts index 5fd987c0f659..502ea8395dfa 100644 --- a/src/agents/tools/sessions-search-tool.ts +++ b/src/agents/tools/sessions-search-tool.ts @@ -18,7 +18,12 @@ import { SESSIONS_SEARCH_TOOL_DISPLAY_SUMMARY, } from "../tool-description-presets.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readPositiveIntegerParam, readStringParam, ToolInputError } from "./common.js"; +import { + jsonResult, + readPositiveIntegerParam, + readToolStringParam, + ToolInputError, +} from "./common.js"; import { callAgentToolGatewayRequest, type AgentToolGatewayRequestCaller, @@ -338,7 +343,7 @@ export function createSessionsSearchTool(opts?: { outputSchema: SessionsSearchOutputSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const query = readStringParam(params, "query")?.trim() ?? ""; + const query = readToolStringParam(params, "query")?.trim() ?? ""; if (!query) { throw new ToolInputError("query must not be empty"); } @@ -351,7 +356,7 @@ export function createSessionsSearchTool(opts?: { readPositiveIntegerParam(params, "limit", { max: SESSIONS_SEARCH_MAX_LIMIT, }) ?? SESSIONS_SEARCH_DEFAULT_LIMIT; - const requestedSessionKey = readStringParam(params, "sessionKey"); + const requestedSessionKey = readToolStringParam(params, "sessionKey"); const cfg = opts?.config ?? getRuntimeConfig(); const { mainKey, alias, effectiveRequesterKey, restrictToSpawned } = resolveSandboxedSessionToolContext({ diff --git a/src/agents/tools/sessions-send-tool.ts b/src/agents/tools/sessions-send-tool.ts index f5222b8b65d7..8b61836b5b21 100644 --- a/src/agents/tools/sessions-send-tool.ts +++ b/src/agents/tools/sessions-send-tool.ts @@ -59,7 +59,7 @@ import { SESSIONS_SEND_TOOL_DISPLAY_SUMMARY, } from "../tool-description-presets.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readNonNegativeIntegerParam, readStringParam } from "./common.js"; +import { jsonResult, readNonNegativeIntegerParam, readToolStringParam } from "./common.js"; import { callAgentToolGatewayRequest, callInProcessGatewayToolWithCreation, @@ -156,7 +156,7 @@ function normalizeSessionsSendArguments(args: unknown): Record if (typeof params.message !== "string" || !params.message.trim()) { for (const alias of SESSIONS_SEND_MESSAGE_ALIASES) { - const value = readStringParam(params, alias); + const value = readToolStringParam(params, alias); if (value) { params.message = stripFormattedReasoningMessage(value); break; @@ -454,7 +454,7 @@ export function createSessionsSendTool(opts?: { execute: async (_toolCallId, args) => { const params = normalizeSessionsSendArguments(args); const gatewayCall = opts?.callGateway ?? callAgentToolGatewayRequest; - const message = readStringParam(params, "message", { required: true }); + const message = readToolStringParam(params, "message", { required: true }); const timeoutSeconds = readNonNegativeIntegerParam(params, "timeoutSeconds") ?? 30; const { cfg, mainKey, alias, effectiveRequesterKey, restrictToSpawned } = resolveSessionToolContext(opts); @@ -465,9 +465,9 @@ export function createSessionsSendTool(opts?: { sandboxed: opts?.sandboxed === true, }); - const sessionKeyParam = readStringParam(params, "sessionKey"); - const labelParam = normalizeOptionalString(readStringParam(params, "label")); - const labelAgentIdParam = normalizeOptionalString(readStringParam(params, "agentId")); + const sessionKeyParam = readToolStringParam(params, "sessionKey"); + const labelParam = normalizeOptionalString(readToolStringParam(params, "label")); + const labelAgentIdParam = normalizeOptionalString(readToolStringParam(params, "agentId")); let sessionKey = sessionKeyParam; if (!sessionKey && !labelParam && labelAgentIdParam) { diff --git a/src/agents/tools/sessions-spawn-tool.ts b/src/agents/tools/sessions-spawn-tool.ts index d5fdac655b01..90fb69887a47 100644 --- a/src/agents/tools/sessions-spawn-tool.ts +++ b/src/agents/tools/sessions-spawn-tool.ts @@ -45,7 +45,7 @@ import { jsonResult, normalizeToolModelOverride, readNonNegativeIntegerParam, - readStringParam, + readToolStringParam, ToolInputError, } from "./common.js"; import { @@ -367,7 +367,7 @@ export function createSessionsSpawnTool( `sessions_spawn does not support "${unsupportedTimeoutParam}". Use "runTimeoutSeconds" for a per-run timeout.`, ); } - const task = readStringParam(params, "task", { required: true }); + const task = readToolStringParam(params, "task", { required: true }); const runTimeoutSeconds = readNonNegativeIntegerParam(params, "runTimeoutSeconds"); const taskNameResult = normalizeSubagentTaskName(params.taskName); if (taskNameResult.error) { @@ -377,16 +377,16 @@ export function createSessionsSpawnTool( }); } const taskName = taskNameResult.taskName; - const label = readStringParam(params, "label") ?? ""; + const label = readToolStringParam(params, "label") ?? ""; const runtime = params.runtime === "acp" ? "acp" : "subagent"; if (collect && runtime === "acp") { throw new ToolInputError('sessions_spawn collect=true supports runtime="subagent" only.'); } - const requestedAgentId = readStringParam(params, "agentId"); - const resumeSessionId = readStringParam(params, "resumeSessionId"); - const modelOverride = normalizeToolModelOverride(readStringParam(params, "model")); - const thinkingOverrideRaw = readStringParam(params, "thinking"); - const cwd = readStringParam(params, "cwd"); + const requestedAgentId = readToolStringParam(params, "agentId"); + const resumeSessionId = readToolStringParam(params, "resumeSessionId"); + const modelOverride = normalizeToolModelOverride(readToolStringParam(params, "model")); + const thinkingOverrideRaw = readToolStringParam(params, "thinking"); + const cwd = readToolStringParam(params, "cwd"); const mode = params.mode === "run" || params.mode === "session" ? params.mode : undefined; const cleanup = params.cleanup === "keep" || params.cleanup === "delete" ? params.cleanup : "keep"; @@ -539,7 +539,7 @@ export function createSessionsSpawnTool( params.fastMode === true || params.fastMode === false || params.fastMode === "auto" ? params.fastMode : undefined, - groupId: readStringParam(params, "groupId"), + groupId: readToolStringParam(params, "groupId"), swarmLaunchReplayKey: typeof params[SWARM_CODE_MODE_IDEMPOTENCY_KEY] === "string" ? params[SWARM_CODE_MODE_IDEMPOTENCY_KEY] @@ -559,7 +559,7 @@ export function createSessionsSpawnTool( attachments, attachMountPath: params.attachAs && typeof params.attachAs === "object" - ? readStringParam(params.attachAs as Record, "mountPath") + ? readToolStringParam(params.attachAs as Record, "mountPath") : undefined, }, { diff --git a/src/agents/tools/sessions-spawn-visible.ts b/src/agents/tools/sessions-spawn-visible.ts index 25ba92d849a8..bb6280b4b442 100644 --- a/src/agents/tools/sessions-spawn-visible.ts +++ b/src/agents/tools/sessions-spawn-visible.ts @@ -26,7 +26,7 @@ import { getSubagentDepthFromSessionStore } from "../subagents/spawn/subagent-de import { resolveSubagentSpawnOwnership } from "../subagents/spawn/subagent-spawn-ownership.js"; import { resolveConfiguredSubagentRunTimeoutSeconds } from "../subagents/spawn/subagent-spawn-plan.js"; import { resolveSubagentTargetPolicy } from "../subagents/spawn/subagent-target-policy.js"; -import { normalizeToolModelOverride, readStringParam, ToolInputError } from "./common.js"; +import { normalizeToolModelOverride, readToolStringParam, ToolInputError } from "./common.js"; import { callInProcessGatewayTool, callInProcessGatewayToolWithCreation, @@ -99,8 +99,8 @@ export async function maybeSpawnVisibleSession(params: { options?: VisibleSessionsSpawnOptions; }): Promise | undefined> { const worktree = params.raw.worktree === true; - const worktreeName = readStringParam(params.raw, "worktreeName"); - const worktreeBaseRef = readStringParam(params.raw, "worktreeBaseRef"); + const worktreeName = readToolStringParam(params.raw, "worktreeName"); + const worktreeBaseRef = readToolStringParam(params.raw, "worktreeBaseRef"); if (params.raw.visible !== true) { const visibleOnlyParams = [ ["worktree", worktree], @@ -117,8 +117,8 @@ export async function maybeSpawnVisibleSession(params: { } return undefined; } - const modelOverride = normalizeToolModelOverride(readStringParam(params.raw, "model")); - const requestedCwd = readStringParam(params.raw, "cwd"); + const modelOverride = normalizeToolModelOverride(readToolStringParam(params.raw, "model")); + const requestedCwd = readToolStringParam(params.raw, "cwd"); const spawnedCwd = requestedCwd ? resolveUserPath(requestedCwd) : undefined; const unsupported = [ [ @@ -128,7 +128,7 @@ export async function maybeSpawnVisibleSession(params: { ], [ "thinking", - readStringParam(params.raw, "thinking"), + readToolStringParam(params.raw, "thinking"), "thinking overrides are not wired to the sessions.create path", ], [ diff --git a/src/agents/tools/sessions-tool.ts b/src/agents/tools/sessions-tool.ts index 784dfea6a663..fa7b99b446ba 100644 --- a/src/agents/tools/sessions-tool.ts +++ b/src/agents/tools/sessions-tool.ts @@ -22,7 +22,12 @@ import { import { resolveDefaultAgentId } from "../agent-scope-config.js"; import { stringEnum } from "../schema/typebox.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readStringParam, ToolAuthorizationError, ToolInputError } from "./common.js"; +import { + jsonResult, + readToolStringParam, + ToolAuthorizationError, + ToolInputError, +} from "./common.js"; import { callAgentToolGatewayRequest, hasInProcessGatewayToolContext, @@ -251,9 +256,9 @@ export function createSessionsTool(opts: SessionsToolOptions = {}): AnyAgentTool parameters: SessionsToolSchema, execute: async (_toolCallId, rawArgs) => { const params = rawArgs as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); if (action === "reset" || action === "delete") { - const rawKey = readStringParam(params, "sessionKey", { required: true }); + const rawKey = readToolStringParam(params, "sessionKey", { required: true }); const { key } = await resolvePatchTarget( { ...opts, config: opts.config ?? getRuntimeConfig() }, rawKey, @@ -320,7 +325,7 @@ export function createSessionsTool(opts: SessionsToolOptions = {}): AnyAgentTool const { cfg, key, requesterKey } = await resolvePatchTarget( { ...opts, config: opts.config ?? getRuntimeConfig() }, - normalizeOptionalString(readStringParam(params, "sessionKey")), + normalizeOptionalString(readToolStringParam(params, "sessionKey")), gatewayRequest, ); const patch = { @@ -332,9 +337,9 @@ export function createSessionsTool(opts: SessionsToolOptions = {}): AnyAgentTool ...(params.attention !== undefined ? { attention: - readStringParam(params, "attention", { required: true }) === "clear" + readToolStringParam(params, "attention", { required: true }) === "clear" ? null - : readStringParam(params, "attention", { required: true }), + : readToolStringParam(params, "attention", { required: true }), } : {}), ...(params.ttlMinutes !== undefined @@ -343,10 +348,10 @@ export function createSessionsTool(opts: SessionsToolOptions = {}): AnyAgentTool ...(params.pinned !== undefined ? { pinned: readBoolean(params, "pinned") } : {}), ...(params.archived !== undefined ? { archived: readBoolean(params, "archived") } : {}), ...(params.model !== undefined - ? { model: readStringParam(params, "model", { required: true }) } + ? { model: readToolStringParam(params, "model", { required: true }) } : {}), ...(params.thinkingLevel !== undefined - ? { thinkingLevel: readStringParam(params, "thinkingLevel", { required: true }) } + ? { thinkingLevel: readToolStringParam(params, "thinkingLevel", { required: true }) } : {}), }; if (Object.keys(patch).length === 1) { diff --git a/src/agents/tools/sessions-yield-tool.ts b/src/agents/tools/sessions-yield-tool.ts index da9eaad725ca..8795173dc7c6 100644 --- a/src/agents/tools/sessions-yield-tool.ts +++ b/src/agents/tools/sessions-yield-tool.ts @@ -5,7 +5,7 @@ */ import { Type } from "typebox"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readStringParam } from "./common.js"; +import { jsonResult, readToolStringParam } from "./common.js"; const SessionsYieldToolSchema = Type.Object({ message: Type.Optional(Type.String()), @@ -27,7 +27,7 @@ export function createSessionsYieldTool(opts?: { parameters: SessionsYieldToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const message = readStringParam(params, "message") || "Turn yielded."; + const message = readToolStringParam(params, "message") || "Turn yielded."; if (!opts?.sessionId) { return jsonResult({ status: "error", error: "No session context" }); } diff --git a/src/agents/tools/sessions.test.ts b/src/agents/tools/sessions.test.ts index 1023b40fd667..a0e8eebff7ae 100644 --- a/src/agents/tools/sessions.test.ts +++ b/src/agents/tools/sessions.test.ts @@ -13,7 +13,7 @@ import { } from "../../config/sessions/transcript-write-context.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { createTestRegistry } from "../../test-utils/channel-plugins.js"; -import { extractAssistantText, sanitizeTextContent } from "./chat-history-text.js"; +import { extractStoredAssistantText, sanitizeTextContent } from "./chat-history-text.js"; const callGatewayMock = vi.fn(); const inProcessGatewayRequestMock = vi.fn((opts: unknown) => callGatewayMock(opts)); @@ -402,7 +402,7 @@ afterEach(() => { clearRuntimeConfigSnapshot(); }); -describe("extractAssistantText", () => { +describe("extractStoredAssistantText", () => { it("sanitizes blocks without injecting newlines", () => { const message = { role: "assistant", @@ -411,7 +411,7 @@ describe("extractAssistantText", () => { { type: "text", text: "secretthere" }, ], }; - expect(extractAssistantText(message)).toBe("Hi there"); + expect(extractStoredAssistantText(message)).toBe("Hi there"); }); it("rewrites error-ish assistant text only when the transcript marks it as an error", () => { @@ -421,7 +421,7 @@ describe("extractAssistantText", () => { errorMessage: "500 Internal Server Error", content: [{ type: "text", text: "500 Internal Server Error" }], }; - expect(extractAssistantText(message)).toBe("HTTP 500: Internal Server Error"); + expect(extractStoredAssistantText(message)).toBe("HTTP 500: Internal Server Error"); }); it("keeps normal status text that mentions billing", () => { @@ -434,7 +434,7 @@ describe("extractAssistantText", () => { }, ], }; - expect(extractAssistantText(message)).toBe( + expect(extractStoredAssistantText(message)).toBe( "Firebase downgraded us to the free Spark plan. Check whether billing should be re-enabled.", ); }); @@ -446,7 +446,7 @@ describe("extractAssistantText", () => { errorMessage: "insufficient credits for embedding model", content: [{ type: "text", text: "Handle payment required errors in your API." }], }; - expect(extractAssistantText(message)).toBe("Handle payment required errors in your API."); + expect(extractStoredAssistantText(message)).toBe("Handle payment required errors in your API."); }); it("prefers final_answer text when phased assistant history is present", () => { @@ -465,7 +465,7 @@ describe("extractAssistantText", () => { }, ], }; - expect(extractAssistantText(message)).toBe("Done."); + expect(extractStoredAssistantText(message)).toBe("Done."); }); }); diff --git a/src/agents/tools/skill-workshop-tool-collection.ts b/src/agents/tools/skill-workshop-tool-collection.ts index c94a2d944051..f87d90f1e38b 100644 --- a/src/agents/tools/skill-workshop-tool-collection.ts +++ b/src/agents/tools/skill-workshop-tool-collection.ts @@ -16,7 +16,7 @@ import { } from "../../skills/workshop/collection-reconcile.js"; import { readSkillProposalTargetTreeSha256 } from "../../skills/workshop/proposal-bundle.js"; import { stringEnum } from "../schema/typebox.js"; -import { readStringParam, ToolInputError } from "./common.js"; +import { readToolStringParam, ToolInputError } from "./common.js"; export async function recordSkillCollectionReadReceipt(params: { context: SkillCollectionReconcileContext; @@ -140,8 +140,8 @@ function readCollectionPlanParam(params: Record): SkillCollecti if (!entry) { throw new ToolInputError(`collection[${index}] must be an object`); } - const action = readStringParam(entry, "action", { required: true }); - const name = readStringParam(entry, "name", { required: true }); + const action = readToolStringParam(entry, "action", { required: true }); + const name = readToolStringParam(entry, "name", { required: true }); if (action === "keep") { return { action, name }; } @@ -149,15 +149,15 @@ function readCollectionPlanParam(params: Record): SkillCollecti return { action, name, - reason: readStringParam(entry, "reason", { required: true }), + reason: readToolStringParam(entry, "reason", { required: true }), }; } if (action === "write") { return { action, name, - description: readStringParam(entry, "description", { required: true }), - content: readStringParam(entry, "content", { required: true, trim: false }), + description: readToolStringParam(entry, "description", { required: true }), + content: readToolStringParam(entry, "content", { required: true, trim: false }), }; } throw new ToolInputError(`collection[${index}].action must be keep, write, or drop`); diff --git a/src/agents/tools/skill-workshop-tool-helpers.ts b/src/agents/tools/skill-workshop-tool-helpers.ts index 15ebfb53dae6..2ee34ab06cd3 100644 --- a/src/agents/tools/skill-workshop-tool-helpers.ts +++ b/src/agents/tools/skill-workshop-tool-helpers.ts @@ -9,7 +9,7 @@ import type { SkillProposalSupportFileInput, SkillWorkshopProposalReviewCompletion, } from "../../skills/workshop/types.js"; -import { readPositiveIntegerParam, readStringParam, ToolInputError } from "./common.js"; +import { readPositiveIntegerParam, readToolStringParam, ToolInputError } from "./common.js"; export function skillWorkshopAgentEventActor(agentId?: string) { return { type: "agent" as const, ...(agentId ? { id: agentId } : {}) }; @@ -124,7 +124,7 @@ export function proposalResult( } export function readLifecycleProposalIdParam(params: Record): string { - return readStringParam(params, "proposal_id", { + return readToolStringParam(params, "proposal_id", { required: true, label: "proposal_id", }); @@ -136,7 +136,7 @@ export async function readProposalForInspect( env?: NodeJS.ProcessEnv, agentId?: string, ): Promise { - const proposalId = readStringParam(params, "proposal_id", { label: "proposal_id" }); + const proposalId = readToolStringParam(params, "proposal_id", { label: "proposal_id" }); if (proposalId) { const proposal = await inspectSkillProposal(proposalId, { agentId, workspaceDir, env }); if (!proposal) { @@ -145,7 +145,7 @@ export async function readProposalForInspect( return proposal; } const resolved = await resolvePendingSkillProposal({ - name: readStringParam(params, "name", { required: true }), + name: readToolStringParam(params, "name", { required: true }), workspaceDir, env, agentId, @@ -165,7 +165,7 @@ export function readProposalStatusParam( params: Record, statuses: readonly SkillProposalStatus[], ): SkillProposalStatus | undefined { - const status = readStringParam(params, "status"); + const status = readToolStringParam(params, "status"); if (!status) { return undefined; } diff --git a/src/agents/tools/skill-workshop-tool.ts b/src/agents/tools/skill-workshop-tool.ts index c4349bc197d0..064ae1a95817 100644 --- a/src/agents/tools/skill-workshop-tool.ts +++ b/src/agents/tools/skill-workshop-tool.ts @@ -38,7 +38,7 @@ import { readWritableWorkspaceSkill } from "../../skills/workshop/workspace-skil import { stringEnum } from "../schema/typebox.js"; import { asToolParamsRecord, - readStringParam, + readToolStringParam, ToolInputError, type AnyAgentTool, } from "./common.js"; @@ -113,6 +113,18 @@ function requireProposalContent(content: string | undefined): string { return content; } +function readSkillPatchText(params: Record) { + return { + oldString: + readToolStringParam(params, "old_string", { label: "old_string", trim: false }) ?? "", + newString: readToolStringParam(params, "new_string", { + required: true, + label: "new_string", + trim: false, + }), + }; +} + function buildSkillWorkshopToolSchema( proposalOnly: boolean, supportsCompletion: boolean, @@ -285,7 +297,7 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA ), execute: async (_toolCallId, args) => { const params = asToolParamsRecord(args); - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const proposalActions = resolveProposalOnlyActions( options.updateProposals === true, options.proposalReviewCompletion !== undefined, @@ -330,7 +342,7 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA } const skill = await readWritableWorkspaceSkill( options.workspaceDir, - readStringParam(params, "skill_name", { required: true, label: "skill_name" }), + readToolStringParam(params, "skill_name", { required: true, label: "skill_name" }), { config: options.config, agentId: options.agentId }, ); if ( @@ -384,7 +396,7 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA if (action === "list") { const status = readProposalStatusParam(params, SKILL_PROPOSAL_STATUSES); - const query = readStringParam(params, "query"); + const query = readToolStringParam(params, "query"); const limit = readListLimitParam(params); const proposals = listProposalEntries({ proposals: ( @@ -426,8 +438,8 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), env: options.env, proposalId: readLifecycleProposalIdParam(params), - expectedRevisionHash: readStringParam(params, "expected_revision_hash"), - correlationId: readStringParam(params, "correlation_id"), + expectedRevisionHash: readToolStringParam(params, "expected_revision_hash"), + correlationId: readToolStringParam(params, "correlation_id"), }); return { content: [ @@ -453,9 +465,9 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA config: options.config, env: options.env, proposalId: readLifecycleProposalIdParam(params), - expectedRevisionHash: readStringParam(params, "expected_revision_hash"), - correlationId: readStringParam(params, "correlation_id"), - reason: readStringParam(params, "reason"), + expectedRevisionHash: readToolStringParam(params, "expected_revision_hash"), + correlationId: readToolStringParam(params, "correlation_id"), + reason: readToolStringParam(params, "reason"), }); return actionResult(applied.record, { contentText: `Applied skill proposal ${applied.record.id}.`, @@ -470,9 +482,9 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), env: options.env, proposalId: readLifecycleProposalIdParam(params), - expectedRevisionHash: readStringParam(params, "expected_revision_hash"), - correlationId: readStringParam(params, "correlation_id"), - reason: readStringParam(params, "reason"), + expectedRevisionHash: readToolStringParam(params, "expected_revision_hash"), + correlationId: readToolStringParam(params, "correlation_id"), + reason: readToolStringParam(params, "reason"), }); return actionResult(rejected, { contentText: `Rejected skill proposal ${rejected.id}.`, @@ -486,16 +498,16 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), env: options.env, proposalId: readLifecycleProposalIdParam(params), - expectedRevisionHash: readStringParam(params, "expected_revision_hash"), - correlationId: readStringParam(params, "correlation_id"), - reason: readStringParam(params, "reason"), + expectedRevisionHash: readToolStringParam(params, "expected_revision_hash"), + correlationId: readToolStringParam(params, "correlation_id"), + reason: readToolStringParam(params, "reason"), }); return actionResult(quarantined, { contentText: `Quarantined skill proposal ${quarantined.id}.`, }); } - const proposalContent = readStringParam(params, "proposal_content", { + const proposalContent = readToolStringParam(params, "proposal_content", { required: action !== "revise" && action !== "patch", label: "proposal_content", trim: false, @@ -504,8 +516,8 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA throw new ToolInputError("proposal_content required"); } const supportFiles = readSupportFilesParam(params); - const goal = readStringParam(params, "goal"); - const evidence = readStringParam(params, "evidence"); + const goal = readToolStringParam(params, "goal"); + const evidence = readToolStringParam(params, "evidence"); if (action === "patch" && options.proposalOnly === true && options.updateProposals !== true) { throw new ToolInputError("this Skill Workshop session cannot patch live skills"); @@ -521,7 +533,7 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA // autonomous rewrite. The service binds the proposal to that read. const target = await readWritableWorkspaceSkill( options.workspaceDir, - readStringParam(params, "skill_name", { required: true, label: "skill_name" }), + readToolStringParam(params, "skill_name", { required: true, label: "skill_name" }), { config: options.config, agentId: options.agentId }, ); const readHash = readSkillHashes.get(target.skillKey); @@ -553,15 +565,10 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA ); } try { - composeSkillBodyPatch(stripProposalFrontmatterForSkill(target.content), { - oldString: - readStringParam(params, "old_string", { label: "old_string", trim: false }) ?? "", - newString: readStringParam(params, "new_string", { - required: true, - label: "new_string", - trim: false, - }), - }); + composeSkillBodyPatch( + stripProposalFrontmatterForSkill(target.content), + readSkillPatchText(params), + ); } catch (error) { throw new ToolInputError(error instanceof Error ? error.message : String(error)); } @@ -595,8 +602,8 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), config: options.config, env: options.env, - name: readStringParam(params, "name", { required: true }), - description: readStringParam(params, "description", { required: true }), + name: readToolStringParam(params, "name", { required: true }), + description: readToolStringParam(params, "description", { required: true }), content: requireProposalContent(proposalContent), supportFiles, createdBy: "skill-workshop", @@ -613,12 +620,12 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), config: options.config, env: options.env, - skillName: readStringParam(params, "skill_name", { + skillName: readToolStringParam(params, "skill_name", { required: true, label: "skill_name", }), expectedCurrentContentHash, - description: readStringParam(params, "description"), + description: readToolStringParam(params, "description"), content: requireProposalContent(proposalContent), supportFiles, createdBy: "skill-workshop", @@ -637,20 +644,12 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA eventActor: skillWorkshopAgentEventActor(options.agentId), config: options.config, env: options.env, - skillName: readStringParam(params, "skill_name", { + skillName: readToolStringParam(params, "skill_name", { required: true, label: "skill_name", }), expectedCurrentContentHash, - composePatch: { - oldString: - readStringParam(params, "old_string", { label: "old_string", trim: false }) ?? "", - newString: readStringParam(params, "new_string", { - required: true, - label: "new_string", - trim: false, - }), - }, + composePatch: readSkillPatchText(params), createdBy: "skill-workshop", ...(options.autonomousCapture || foregroundRepair ? { autonomousCapture: true } : {}), ...(options.origin ? { origin: options.origin } : {}), @@ -664,10 +663,10 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA : proposalMutationText("Created skill patch proposal", proposal.record); } else if (action === "revise") { const pendingProposal = await resolvePendingSkillProposal({ - proposalId: readStringParam(params, "proposal_id", { + proposalId: readToolStringParam(params, "proposal_id", { label: "proposal_id", }), - name: readStringParam(params, "name"), + name: readToolStringParam(params, "name"), workspaceDir: options.workspaceDir, agentId: options.agentId, env: options.env, @@ -680,11 +679,11 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA env: options.env, proposalId: pendingProposal.record.id, expectedRevisionHash: - readStringParam(params, "expected_revision_hash") ?? pendingProposal.revisionHash, - correlationId: readStringParam(params, "correlation_id"), + readToolStringParam(params, "expected_revision_hash") ?? pendingProposal.revisionHash, + correlationId: readToolStringParam(params, "correlation_id"), content: proposalContent, supportFiles, - description: readStringParam(params, "description"), + description: readToolStringParam(params, "description"), ...(options.origin ? { origin: options.origin } : {}), goal, evidence, diff --git a/src/agents/tools/subagents-tool.ts b/src/agents/tools/subagents-tool.ts index bf2fc9768837..e040fc28d838 100644 --- a/src/agents/tools/subagents-tool.ts +++ b/src/agents/tools/subagents-tool.ts @@ -19,7 +19,7 @@ import { } from "../subagents/registry/subagent-control.js"; import { buildSubagentList } from "../subagents/registry/subagent-list.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readPositiveIntegerParam, readStringParam } from "./common.js"; +import { jsonResult, readPositiveIntegerParam, readToolStringParam } from "./common.js"; const SUBAGENT_ACTIONS = ["list", "cancel"] as const; type SubagentAction = (typeof SUBAGENT_ACTIONS)[number]; @@ -104,7 +104,7 @@ export function createSubagentsTool(opts: SubagentsToolOptions = {}): AnyAgentTo parameters: SubagentsToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const action = (readStringParam(params, "action") ?? "list") as SubagentAction; + const action = (readToolStringParam(params, "action") ?? "list") as SubagentAction; const cfg = opts.config ?? getRuntimeConfig(); const recentMinutesRaw = readPositiveIntegerParam(params, "recentMinutes"); const recentMinutes = @@ -154,7 +154,7 @@ export function createSubagentsTool(opts: SubagentsToolOptions = {}): AnyAgentTo } if (action === "cancel") { - const taskId = readStringParam(params, "taskId", { required: true }); + const taskId = readToolStringParam(params, "taskId", { required: true }); const target = treeTasks.find((task) => task.taskId === taskId); if (!target) { return jsonResult({ status: "forbidden", error: "Task outside session tree." }); diff --git a/src/agents/tools/system-agent-tool.ts b/src/agents/tools/system-agent-tool.ts index bd5df813d08c..116a50470d6f 100644 --- a/src/agents/tools/system-agent-tool.ts +++ b/src/agents/tools/system-agent-tool.ts @@ -15,7 +15,7 @@ import { } from "../../system-agent/operations.js"; import { validateSystemAgentPluginInstallSpec } from "../../system-agent/plugin-install.js"; import { stringEnum } from "../schema/typebox.js"; -import { textResult, ToolInputError, readStringParam, type AnyAgentTool } from "./common.js"; +import { textResult, ToolInputError, readToolStringParam, type AnyAgentTool } from "./common.js"; export type SystemAgentToolOptions = { /** Where setup side effects run; the gateway surface never manages its own daemon. */ @@ -245,7 +245,7 @@ function createCaptureRuntime(): RuntimeEnv & { read: () => string } { } function requireParam(params: Record, name: string): string { - const value = readStringParam(params, name); + const value = readToolStringParam(params, name); if (!value?.trim()) { throw new ToolInputError(`openclaw: "${name}" is required for this action`); } @@ -255,7 +255,7 @@ function requireParam(params: Record, name: string): string { function readSetupTarget( params: Record, ): "guided" | "classic" | "channels" | "search" | "gateway" { - const target = readStringParam(params, "target")?.trim() ?? "guided"; + const target = readToolStringParam(params, "target")?.trim() ?? "guided"; if ( target === "guided" || target === "classic" || @@ -269,7 +269,7 @@ function readSetupTarget( } function operationForAction(params: Record): SystemAgentOperation { - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); switch (action) { case "status": return { kind: "status" }; @@ -290,7 +290,7 @@ function operationForAction(params: Record): SystemAgentOperati case "config_get": return { kind: "config-get", path: requireParam(params, "path") }; case "config_schema": { - const path = readStringParam(params, "path")?.trim(); + const path = readToolStringParam(params, "path")?.trim(); return { kind: "config-schema", ...(path ? { path } : {}) }; } case "gateway_status": @@ -306,12 +306,12 @@ function operationForAction(params: Record): SystemAgentOperati case "import_memory": return { kind: "memory-import" }; case "configure_model_provider": { - const workspace = readStringParam(params, "workspace")?.trim(); + const workspace = readToolStringParam(params, "workspace")?.trim(); return { kind: "model-setup", ...(workspace ? { workspace } : {}) }; } case "open_agent": { - const agentId = readStringParam(params, "agentId")?.trim(); - const workspace = readStringParam(params, "workspace")?.trim(); + const agentId = readToolStringParam(params, "agentId")?.trim(); + const workspace = readToolStringParam(params, "workspace")?.trim(); return { kind: "open-tui", ...(agentId ? { agentId } : {}), @@ -320,7 +320,7 @@ function operationForAction(params: Record): SystemAgentOperati } case "open_setup": { const target = readSetupTarget(params); - const channel = readStringParam(params, "channel")?.trim().toLowerCase(); + const channel = readToolStringParam(params, "channel")?.trim().toLowerCase(); return { kind: "open-setup", target, @@ -346,8 +346,8 @@ function operationForAction(params: Record): SystemAgentOperati case "plugin_uninstall": return { kind: "plugin-uninstall", pluginId: requireParam(params, "pluginId") }; case "setup": { - const workspace = readStringParam(params, "workspace")?.trim(); - const model = readStringParam(params, "model")?.trim(); + const workspace = readToolStringParam(params, "workspace")?.trim(); + const model = readToolStringParam(params, "model")?.trim(); return { kind: "setup", ...(workspace ? { workspace } : {}), @@ -355,7 +355,7 @@ function operationForAction(params: Record): SystemAgentOperati }; } case "set_default_model": { - const agentId = readStringParam(params, "agentId")?.trim(); + const agentId = readToolStringParam(params, "agentId")?.trim(); return { kind: "set-default-model", model: requireParam(params, "model"), @@ -363,8 +363,8 @@ function operationForAction(params: Record): SystemAgentOperati }; } case "create_agent": { - const workspace = readStringParam(params, "workspace")?.trim(); - const model = readStringParam(params, "model")?.trim(); + const workspace = readToolStringParam(params, "workspace")?.trim(); + const model = readToolStringParam(params, "model")?.trim(); return { kind: "create-agent", agentId: requireParam(params, "agentId"), diff --git a/src/agents/tools/task-suggestion-tools.ts b/src/agents/tools/task-suggestion-tools.ts index b9c5bb1b88e8..0ff09c98e6a8 100644 --- a/src/agents/tools/task-suggestion-tools.ts +++ b/src/agents/tools/task-suggestion-tools.ts @@ -9,7 +9,7 @@ import { DISMISS_TASK_TOOL_DISPLAY_SUMMARY, SUGGEST_TASK_TOOL_DISPLAY_SUMMARY, } from "../tool-description-presets.js"; -import { type AnyAgentTool, ToolInputError, jsonResult, readStringParam } from "./common.js"; +import { type AnyAgentTool, ToolInputError, jsonResult, readToolStringParam } from "./common.js"; import { callGatewayTool } from "./gateway.js"; const SuggestTaskToolSchema = Type.Object( @@ -91,10 +91,10 @@ export function createTaskSuggestionTools(params: { outputSchema: SuggestTaskOutputSchema, execute: async (_toolCallId, args) => { const input = args as Record; - const title = readStringParam(input, "title", { required: true }); - const prompt = readStringParam(input, "prompt", { required: true }); - const tldr = readStringParam(input, "tldr", { required: true }); - const cwd = readStringParam(input, "cwd") ?? params.cwd; + const title = readToolStringParam(input, "title", { required: true }); + const prompt = readToolStringParam(input, "prompt", { required: true }); + const tldr = readToolStringParam(input, "tldr", { required: true }); + const cwd = readToolStringParam(input, "cwd") ?? params.cwd; if (title.length > 60) { throw new ToolInputError("title must be at most 60 characters"); } @@ -128,8 +128,8 @@ export function createTaskSuggestionTools(params: { parameters: DismissTaskToolSchema, execute: async (_toolCallId, args) => { const input = args as Record; - const taskId = readStringParam(input, "task_id", { required: true }); - const reason = readStringParam(input, "reason"); + const taskId = readToolStringParam(input, "task_id", { required: true }); + const reason = readToolStringParam(input, "reason"); const result = await gatewayCall( "taskSuggestions.dismiss", {}, diff --git a/src/agents/tools/terminal-tool.ts b/src/agents/tools/terminal-tool.ts index 84c9f9594711..fbaf0626262e 100644 --- a/src/agents/tools/terminal-tool.ts +++ b/src/agents/tools/terminal-tool.ts @@ -13,7 +13,12 @@ import { resolveAgentIdFromSessionKey } from "../../routing/session-key.js"; import { isTerminalTaskStatus } from "../../tasks/task-executor-policy.js"; import type { TaskRecord } from "../../tasks/task-registry.types.js"; import type { AnyAgentTool } from "./common.js"; -import { jsonResult, readPositiveIntegerParam, readStringParam, ToolInputError } from "./common.js"; +import { + jsonResult, + readPositiveIntegerParam, + readToolStringParam, + ToolInputError, +} from "./common.js"; import { callInProcessGatewayTool, getInProcessGatewayToolContext, @@ -131,11 +136,11 @@ function readOptionalString( if (typeof params[key] !== "string") { throw new ToolInputError(`${key} must be string`); } - return readStringParam(params, key, options); + return readToolStringParam(params, key, options); } function requireSessionId(params: Record): string { - return readStringParam(params, "sessionId", { required: true }); + return readToolStringParam(params, "sessionId", { required: true }); } function launchBlockMessage( @@ -166,7 +171,7 @@ export function createTerminalTool(opts: TerminalToolOptions = {}): AnyAgentTool outputSchema: TerminalToolOutputSchema, execute: async (_toolCallId, rawArgs, signal) => { const params = rawArgs as Record; - const action = readStringParam(params, "action", { required: true }); + const action = readToolStringParam(params, "action", { required: true }); const agentSessionKey = opts.agentSessionKey?.trim(); if (!agentSessionKey) { throw new ToolInputError("agent session required"); @@ -293,7 +298,7 @@ export function createTerminalTool(opts: TerminalToolOptions = {}): AnyAgentTool return jsonResult({ sessionId, text: renderTerminalBufferText(raw) }); } if (action === "input") { - const data = readStringParam(params, "data", { + const data = readToolStringParam(params, "data", { required: true, trim: false, allowEmpty: true, diff --git a/src/agents/tools/transcripts-tool-runtime.ts b/src/agents/tools/transcripts-tool-runtime.ts index a91f7c25e64b..c0d1d842bf46 100644 --- a/src/agents/tools/transcripts-tool-runtime.ts +++ b/src/agents/tools/transcripts-tool-runtime.ts @@ -57,17 +57,17 @@ function createStartupAbortScope(parent?: AbortSignal): { }; } -export function readStringParam( +export function readTranscriptStringParam( params: Record, key: string, options: { required: true; trim?: boolean }, ): string; -export function readStringParam( +export function readTranscriptStringParam( params: Record, key: string, options?: { required?: false; trim?: boolean }, ): string | undefined; -export function readStringParam( +export function readTranscriptStringParam( params: Record, key: string, options: { required?: boolean; trim?: boolean } = {}, @@ -86,20 +86,21 @@ export function readStringParam( return normalized || undefined; } -export function createSessionId(): string { +export function createTranscriptSessionId(): string { return `transcript-${new Date().toISOString().replace(/[:.]/g, "-")}-${randomUUID().slice(0, 8)}`; } // Provider routing comes from tool params so manual imports and live providers // share one persisted source descriptor. export function sourceFromParams(params: Record): TranscriptSourceLocator { - const providerId = readStringParam(params, "providerId", { trim: true }) ?? "manual-transcript"; + const providerId = + readTranscriptStringParam(params, "providerId", { trim: true }) ?? "manual-transcript"; return { providerId, - accountId: readStringParam(params, "accountId", { trim: true }), - guildId: readStringParam(params, "guildId", { trim: true }), - channelId: readStringParam(params, "channelId", { trim: true }), - meetingUrl: readStringParam(params, "meetingUrl", { trim: true }), + accountId: readTranscriptStringParam(params, "accountId", { trim: true }), + guildId: readTranscriptStringParam(params, "guildId", { trim: true }), + channelId: readTranscriptStringParam(params, "channelId", { trim: true }), + meetingUrl: readTranscriptStringParam(params, "meetingUrl", { trim: true }), }; } @@ -157,8 +158,10 @@ export async function startTranscripts(params: { throw new Error(`transcripts provider ${providerSource.providerId} cannot start live capture`); } const session: TranscriptSessionDescriptor = { - sessionId: readStringParam(params.rawParams, "sessionId", { trim: true }) ?? createSessionId(), - title: readStringParam(params.rawParams, "title", { trim: true }), + sessionId: + readTranscriptStringParam(params.rawParams, "sessionId", { trim: true }) ?? + createTranscriptSessionId(), + title: readTranscriptStringParam(params.rawParams, "title", { trim: true }), source: sanitizeTranscriptSourceLocator(providerSource), startedAt: new Date().toISOString(), ...(params.ctx.agentId ? { metadata: { agentId: params.ctx.agentId } } : {}), diff --git a/src/agents/tools/transcripts-tool.ts b/src/agents/tools/transcripts-tool.ts index 2abdc42c7531..213135afd16a 100644 --- a/src/agents/tools/transcripts-tool.ts +++ b/src/agents/tools/transcripts-tool.ts @@ -22,8 +22,8 @@ import { summarizeTranscripts } from "../../transcripts/summary.js"; import type { AnyAgentTool } from "./common.js"; import { activeSessions, - createSessionId, - readStringParam, + createTranscriptSessionId, + readTranscriptStringParam, resolveSourceProvider, sourceFromParams, startTranscripts, @@ -131,7 +131,7 @@ async function stopTranscripts(params: { store: TranscriptsStore; rawParams: Record; }) { - const sessionSelector = readStringParam(params.rawParams, "sessionId", { + const sessionSelector = readTranscriptStringParam(params.rawParams, "sessionId", { required: true, trim: true, }); @@ -231,14 +231,16 @@ async function importTranscripts(params: { throw new Error(`transcripts provider ${providerSource.providerId} cannot import transcripts`); } const session: TranscriptSessionDescriptor = { - sessionId: readStringParam(params.rawParams, "sessionId", { trim: true }) ?? createSessionId(), - title: readStringParam(params.rawParams, "title", { trim: true }), + sessionId: + readTranscriptStringParam(params.rawParams, "sessionId", { trim: true }) ?? + createTranscriptSessionId(), + title: readTranscriptStringParam(params.rawParams, "title", { trim: true }), source: sanitizeTranscriptSourceLocator(providerSource), startedAt: new Date().toISOString(), stoppedAt: new Date().toISOString(), ...(params.ctx.agentId ? { metadata: { agentId: params.ctx.agentId } } : {}), }; - const transcript = readStringParam(params.rawParams, "transcript", { + const transcript = readTranscriptStringParam(params.rawParams, "transcript", { required: true, trim: false, }); @@ -247,7 +249,7 @@ async function importTranscripts(params: { cfg: params.ctx.config, session: { ...session, source: providerSource }, text: transcript, - speakerLabel: readStringParam(params.rawParams, "speakerLabel", { trim: true }), + speakerLabel: readTranscriptStringParam(params.rawParams, "speakerLabel", { trim: true }), }); for (const utterance of utterances) { await params.store.appendUtteranceForSession(session, utterance); @@ -277,7 +279,7 @@ async function summarizeExisting(params: { store: TranscriptsStore; rawParams: Record; }) { - const sessionId = readStringParam(params.rawParams, "sessionId", { + const sessionId = readTranscriptStringParam(params.rawParams, "sessionId", { required: true, trim: true, }); @@ -352,7 +354,7 @@ export function createTranscriptsTool(options?: { throw new Error("transcripts are disabled"); } const params = asOptionalRecord(rawParams) ?? {}; - const action = readStringParam(params, "action", { required: true, trim: true }); + const action = readTranscriptStringParam(params, "action", { required: true, trim: true }); const store = createStore(ctx); switch (action) { case "start": @@ -411,7 +413,7 @@ export function createTranscriptsAutoStartService(ctx: TranscriptsRuntimeContext rawParams: { action: "start", ...entry, - sessionId: entry.sessionId ?? createSessionId(), + sessionId: entry.sessionId ?? createTranscriptSessionId(), }, }) .then((result) => { @@ -452,7 +454,7 @@ export function createTranscriptsAutoStartService(ctx: TranscriptsRuntimeContext startEntry( { ...entry, - sessionId: entry.sessionId ?? createSessionId(), + sessionId: entry.sessionId ?? createTranscriptSessionId(), }, 1, store, diff --git a/src/agents/tools/tts-tool.ts b/src/agents/tools/tts-tool.ts index bbd342078b60..5edecc8fe42f 100644 --- a/src/agents/tools/tts-tool.ts +++ b/src/agents/tools/tts-tool.ts @@ -8,7 +8,7 @@ import { getRuntimeConfig } from "../../config/config.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { textToSpeech } from "../../tts/tts.js"; import type { AnyAgentTool } from "./common.js"; -import { readPositiveIntegerParam, readStringParam } from "./common.js"; +import { readPositiveIntegerParam, readToolStringParam } from "./common.js"; const TtsToolSchema = Type.Object({ text: Type.String({ description: "Text to speak." }), @@ -57,8 +57,8 @@ export function createTtsTool(opts?: { parameters: TtsToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const text = readStringParam(params, "text", { required: true }); - const channel = readStringParam(params, "channel"); + const text = readToolStringParam(params, "text", { required: true }); + const channel = readToolStringParam(params, "channel"); const timeoutMs = readTtsTimeoutMs(params); const cfg = opts?.config ?? getRuntimeConfig(); const result = await textToSpeech({ diff --git a/src/agents/tools/update-plan-tool.ts b/src/agents/tools/update-plan-tool.ts index 3eaa472c8916..6158db0e0373 100644 --- a/src/agents/tools/update-plan-tool.ts +++ b/src/agents/tools/update-plan-tool.ts @@ -9,7 +9,7 @@ import { describeUpdatePlanTool, UPDATE_PLAN_TOOL_DISPLAY_SUMMARY, } from "../tool-description-presets.js"; -import { type AnyAgentTool, ToolInputError, readStringParam, textResult } from "./common.js"; +import { type AnyAgentTool, ToolInputError, readToolStringParam, textResult } from "./common.js"; const PLAN_STEP_STATUSES = ["pending", "in_progress", "completed"] as const; @@ -52,11 +52,11 @@ function readPlanSteps(params: Record): UpdatePlanStep[] { throw new ToolInputError(`plan[${index}] must be an object`); } const stepParams = entry as Record; - const step = readStringParam(stepParams, "step", { + const step = readToolStringParam(stepParams, "step", { required: true, label: `plan[${index}].step`, }); - const status = readStringParam(stepParams, "status", { + const status = readToolStringParam(stepParams, "status", { required: true, label: `plan[${index}].status`, }); @@ -89,7 +89,7 @@ export function createUpdatePlanTool(): AnyAgentTool { parameters: UpdatePlanToolSchema, execute: async (_toolCallId, args) => { const params = args as Record; - const explanation = readStringParam(params, "explanation"); + const explanation = readToolStringParam(params, "explanation"); const plan = readPlanSteps(params); return textResult("Plan updated", { status: "updated" as const, diff --git a/src/agents/tools/video-generate-tool.ts b/src/agents/tools/video-generate-tool.ts index 8a6b4c34b6f9..9192591b665d 100644 --- a/src/agents/tools/video-generate-tool.ts +++ b/src/agents/tools/video-generate-tool.ts @@ -41,7 +41,7 @@ import { import { getCustomProviderApiKey } from "../model-auth.js"; import type { PreparedModelRuntimeSnapshot } from "../prepared-model-runtime.js"; import { resolveProviderIdForAuth } from "../provider-auth-aliases.js"; -import { ToolInputError, readNumberParam, readStringParam } from "./common.js"; +import { ToolInputError, readNumberParam, readToolStringParam } from "./common.js"; import { persistGeneratedMediaBatch } from "./generated-media-batch-persistence.js"; import { decodeDataUrl } from "./image-tool.helpers.js"; import { @@ -975,7 +975,7 @@ export function createVideoGenerateTool(options?: { const effectiveCfg = applyVideoGenerationModelConfigDefaults(cfg, videoGenerationModelConfig) ?? cfg; const remoteMediaSsrfPolicy = resolveRemoteMediaSsrfPolicy(effectiveCfg); - const prompt = readStringParam(args, "prompt", { required: true }); + const prompt = readToolStringParam(args, "prompt", { required: true }); const activeDuplicateGuardResult = createVideoGenerateDuplicateGuardResult( options?.agentSessionKey, @@ -985,11 +985,11 @@ export function createVideoGenerateTool(options?: { return activeDuplicateGuardResult; } - const model = readStringParam(args, "model"); - const filename = readStringParam(args, "filename"); - const size = readStringParam(args, "size"); - const aspectRatio = normalizeAspectRatio(readStringParam(args, "aspectRatio")); - const resolution = normalizeResolution(readStringParam(args, "resolution")); + const model = readToolStringParam(args, "model"); + const filename = readToolStringParam(args, "filename"); + const size = readToolStringParam(args, "size"); + const aspectRatio = normalizeAspectRatio(readToolStringParam(args, "aspectRatio")); + const resolution = normalizeResolution(readToolStringParam(args, "resolution")); const durationSeconds = readNumberParam(args, "durationSeconds", { positiveInteger: true, strict: true, diff --git a/src/agents/tools/web-fetch-utils.test.ts b/src/agents/tools/web-fetch-utils.test.ts index aa8171893db3..654539df9138 100644 --- a/src/agents/tools/web-fetch-utils.test.ts +++ b/src/agents/tools/web-fetch-utils.test.ts @@ -4,7 +4,7 @@ import { extractBasicHtmlContent, htmlToMarkdown, markdownToText, - truncateText, + truncateWebFetchText, } from "./web-fetch-utils.js"; describe("web-fetch-utils htmlToMarkdown entity decoding", () => { @@ -305,7 +305,7 @@ describe("web-fetch-utils htmlToMarkdown entity decoding", () => { it("truncates without splitting a boundary emoji", () => { const prefix = "a".repeat(79); - const result = truncateText(`${prefix}${grin}tail`, 80); + const result = truncateWebFetchText(`${prefix}${grin}tail`, 80); expect(result.truncated).toBe(true); expect(result.text).toBe(prefix); diff --git a/src/agents/tools/web-fetch-utils.ts b/src/agents/tools/web-fetch-utils.ts index b2279eea79fe..27158d002af5 100644 --- a/src/agents/tools/web-fetch-utils.ts +++ b/src/agents/tools/web-fetch-utils.ts @@ -649,7 +649,7 @@ export function markdownToText(markdown: string): string { } /** Truncates text by characters and reports whether truncation occurred. */ -export function truncateText( +export function truncateWebFetchText( value: string, maxChars: number, ): { text: string; truncated: boolean } { diff --git a/src/agents/tools/web-fetch.ts b/src/agents/tools/web-fetch.ts index 3467627e4e82..c153330099bd 100644 --- a/src/agents/tools/web-fetch.ts +++ b/src/agents/tools/web-fetch.ts @@ -36,14 +36,14 @@ import type { AnyAgentTool } from "./common.js"; import { jsonResult, readPositiveIntegerParam, - readStringParam, + readToolStringParam, scheduleToolProgress, } from "./common.js"; import { extractBasicHtmlContent, htmlToMarkdown, markdownToText, - truncateText, + truncateWebFetchText, type ExtractMode, } from "./web-fetch-utils.js"; import { @@ -337,7 +337,7 @@ function formatWebFetchErrorDetail(params: { const withTitle = rendered.title ? `${rendered.title}\n${rendered.text}` : rendered.text; text = markdownToText(withTitle); } - const truncated = truncateText(text.trim(), maxChars); + const truncated = truncateWebFetchText(text.trim(), maxChars); return truncated.text; } @@ -404,7 +404,7 @@ function wrapWebFetchContent(value: string, maxChars: number): WebFetchWrappedCo const minimal = includeWarning ? wrapWebContent("", "web_fetch") : wrapExternalContent("", { source: "web_fetch", includeWarning: false }); - const truncatedWrapper = truncateText(minimal, maxChars); + const truncatedWrapper = truncateWebFetchText(minimal, maxChars); return { text: truncatedWrapper.text, truncated: true, @@ -413,7 +413,7 @@ function wrapWebFetchContent(value: string, maxChars: number): WebFetchWrappedCo }; } const maxInner = Math.max(0, maxChars - wrapperOverhead); - let truncated = truncateText(value, maxInner); + let truncated = truncateWebFetchText(value, maxInner); let wrappedText = includeWarning ? wrapWebContent(truncated.text, "web_fetch") : wrapExternalContent(truncated.text, { source: "web_fetch", includeWarning: false }); @@ -421,7 +421,7 @@ function wrapWebFetchContent(value: string, maxChars: number): WebFetchWrappedCo if (wrappedText.length > maxChars) { const excess = wrappedText.length - maxChars; const adjustedMaxInner = Math.max(0, maxInner - excess); - truncated = truncateText(value, adjustedMaxInner); + truncated = truncateWebFetchText(value, adjustedMaxInner); wrappedText = includeWarning ? wrapWebContent(truncated.text, "web_fetch") : wrapExternalContent(truncated.text, { source: "web_fetch", includeWarning: false }); @@ -1004,9 +1004,10 @@ export function createWebFetchTool(options?: { }; const params = args as Record; const url = sanitizeWebFetchUrl( - readStringParam(params, "url", { required: true, trim: false }), + readToolStringParam(params, "url", { required: true, trim: false }), ); - const extractMode = readStringParam(params, "extractMode") === "text" ? "text" : "markdown"; + const extractMode = + readToolStringParam(params, "extractMode") === "text" ? "text" : "markdown"; const maxChars = readPositiveIntegerParam(params, "maxChars"); const maxCharsCap = resolveFetchMaxCharsCap(executionFetch); // The progress line is emitted only if the fetch is still pending after diff --git a/src/auto-reply/reply/abort.test-support.ts b/src/auto-reply/reply/abort.test-support.ts index bf37560dd0b7..817ecadfac0e 100644 --- a/src/auto-reply/reply/abort.test-support.ts +++ b/src/auto-reply/reply/abort.test-support.ts @@ -6,8 +6,8 @@ type AbortTestDeps = { resolveActiveEmbeddedRunSessionId: typeof import("../../agents/embedded-agent-runner/runs.js").resolveActiveEmbeddedRunSessionId; markSessionAbortTarget: typeof import("../../config/sessions/session-accessor.js").markSessionAbortTarget; resolveSessionAbortTarget: typeof import("../../config/sessions/session-accessor.js").resolveSessionAbortTarget; - getLatestSubagentRunByChildSessionKey: typeof import("../../agents/subagents/registry/subagent-registry.js").getLatestSubagentRunByChildSessionKey; - listSubagentRunsForController: typeof import("../../agents/subagents/registry/subagent-registry.js").listSubagentRunsForController; + getLatestSubagentRunByChildSessionKey: typeof import("../../agents/subagents/registry/subagent-registry-read.js").getLatestSubagentRunByChildSessionKey; + listSubagentRunsForController: typeof import("../../agents/subagents/registry/subagent-registry-read.js").listSubagentRunsForController; killControlledSubagentRun: typeof import("../../agents/subagents/registry/subagent-control.js").killControlledSubagentRun; }; diff --git a/src/auto-reply/reply/abort.test.ts b/src/auto-reply/reply/abort.test.ts index acb83d88a5b2..caa6d2eccaa7 100644 --- a/src/auto-reply/reply/abort.test.ts +++ b/src/auto-reply/reply/abort.test.ts @@ -96,11 +96,12 @@ const { subagentRegistryMocks, subagentRegistryDeps } = vi.hoisted(() => { }); vi.mock("../../agents/subagents/registry/subagent-registry.js", () => ({ - getLatestSubagentRunByChildSessionKey: subagentRegistryDeps.getLatestSubagentRunByChildSessionKey, - listSubagentRunsForRequester: subagentRegistryDeps.listSubagentRunsForRequester, - listSubagentRunsForController: subagentRegistryDeps.listSubagentRunsForRequester, markSubagentRunTerminated: subagentRegistryMocks.markSubagentRunTerminated, })); +vi.mock("../../agents/subagents/registry/subagent-registry-read.js", () => ({ + getLatestSubagentRunByChildSessionKey: subagentRegistryDeps.getLatestSubagentRunByChildSessionKey, + listSubagentRunsForController: subagentRegistryDeps.listSubagentRunsForRequester, +})); const acpManagerMocks = vi.hoisted(() => ({ resolveSession: vi.fn< diff --git a/src/auto-reply/reply/abort.ts b/src/auto-reply/reply/abort.ts index 1e6377886253..9c207c0cb9ce 100644 --- a/src/auto-reply/reply/abort.ts +++ b/src/auto-reply/reply/abort.ts @@ -13,7 +13,7 @@ import { killControlledSubagentRun } from "../../agents/subagents/registry/subag import { getLatestSubagentRunByChildSessionKey, listSubagentRunsForController, -} from "../../agents/subagents/registry/subagent-registry.js"; +} from "../../agents/subagents/registry/subagent-registry-read.js"; import type { SubagentRunRecord } from "../../agents/subagents/registry/subagent-registry.js"; import { resolveInternalSessionKey, diff --git a/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts b/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts index 67a67cb8138e..14278d75f34c 100644 --- a/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts +++ b/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts @@ -235,11 +235,16 @@ vi.mock("../../agents/subagents/registry/subagent-registry.js", async (importOri return { ...actual, getSwarmRunByLaunchReplayKey: () => undefined, - getLatestSubagentRunByChildSessionKey: () => null, - listSubagentRunsForController: () => [], markSubagentRunTerminated: () => 0, }; }); +vi.mock("../../agents/subagents/registry/subagent-registry-read.js", async (importOriginal) => ({ + ...(await importOriginal< + typeof import("../../agents/subagents/registry/subagent-registry-read.js") + >()), + getLatestSubagentRunByChildSessionKey: () => null, + listSubagentRunsForController: () => [], +})); // #85714: keep the real private-final decision but spy the WARN emitter so we // can assert it fires only through the substantive text suppression branch. diff --git a/src/auto-reply/reply/directive-handling.model.test.ts b/src/auto-reply/reply/directive-handling.model.test.ts index 805fcdb60458..e8f46fc109c3 100644 --- a/src/auto-reply/reply/directive-handling.model.test.ts +++ b/src/auto-reply/reply/directive-handling.model.test.ts @@ -168,9 +168,6 @@ vi.mock("../../agents/auth-profiles/store.js", () => { profiles: authProfilesStoreMock.profiles, }); return { - clearRuntimeAuthProfileStoreSnapshots: () => { - authProfilesStoreMock.profiles = {}; - }, ensureAuthProfileStore: store, ensureAuthProfileStoreForLocalUpdate: store, findPersistedAuthProfileCredential: ({ profileId }: { profileId: string }) => @@ -181,13 +178,6 @@ vi.mock("../../agents/auth-profiles/store.js", () => { loadAuthProfileStoreForRuntime: store, loadAuthProfileStoreForSecretsRuntime: store, loadAuthProfileStoreWithoutExternalProfiles: store, - replaceRuntimeAuthProfileStoreSnapshots: ( - snapshots: Array<{ - store?: { profiles?: Record }; - }>, - ) => { - authProfilesStoreMock.profiles = snapshots[0]?.store?.profiles ?? {}; - }, saveAuthProfileStore: vi.fn(), updateAuthProfileStoreWithLock: vi.fn(async ({ update }) => update(store())), }; diff --git a/src/canvas/widget-tool.ts b/src/canvas/widget-tool.ts index 0d6a0b67b906..95b4c80843eb 100644 --- a/src/canvas/widget-tool.ts +++ b/src/canvas/widget-tool.ts @@ -3,7 +3,7 @@ import { createHash } from "node:crypto"; import { Type } from "typebox"; import type { BoardWidgetPutResult } from "../../packages/gateway-protocol/src/index.js"; import { optionalStringEnum } from "../agents/schema/string-enum.js"; -import { type AnyAgentTool, jsonResult, readStringParam } from "../agents/tools/common.js"; +import { type AnyAgentTool, jsonResult, readToolStringParam } from "../agents/tools/common.js"; import { callInProcessGatewayTool, type InProcessGatewayCaller, @@ -127,8 +127,8 @@ export function createShowWidgetTool(options: ShowWidgetToolOptions = {}): AnyAg requiredClientCaps: SHOW_WIDGET_REQUIRED_CLIENT_CAPS, execute: async (_toolCallId, args) => { const params = args as Record; - const title = readStringParam(params, "title", { required: true }); - const rawWidgetCode = readStringParam(params, "widget_code", { + const title = readToolStringParam(params, "title", { required: true }); + const rawWidgetCode = readToolStringParam(params, "widget_code", { required: true, trim: false, }); @@ -156,12 +156,12 @@ export function createShowWidgetTool(options: ShowWidgetToolOptions = {}): AnyAg let pinnedWidgetName: string | undefined; if (pinSessionKey) { const sessionKey = pinSessionKey; - const explicitName = readStringParam(params, "name"); + const explicitName = readToolStringParam(params, "name"); const name = explicitName ?? slugWidgetName(title); - const tab = readStringParam(params, "tab"); - const size = readStringParam(params, "size"); - const presentation = readStringParam(params, "presentation"); - const after = readStringParam(params, "after"); + const tab = readToolStringParam(params, "tab"); + const size = readToolStringParam(params, "size"); + const presentation = readToolStringParam(params, "presentation"); + const after = readToolStringParam(params, "after"); const pinnedTitle = boardWidgetTitle(title); assertPinnedWidgetDocumentSize( buildWidgetDocument(pinnedTitle ?? name, widgetCode, { diff --git a/src/commands/agent.test.ts b/src/commands/agent.test.ts index e625487d4e31..e118effa1d02 100644 --- a/src/commands/agent.test.ts +++ b/src/commands/agent.test.ts @@ -65,7 +65,6 @@ vi.mock("../config/io.js", () => ({ vi.mock("../agents/auth-profiles/store.js", () => { const createEmptyStore = () => ({ version: 1, profiles: {} }); return { - clearRuntimeAuthProfileStoreSnapshots: vi.fn(), ensureAuthProfileStore: vi.fn(createEmptyStore), ensureAuthProfileStoreForLocalUpdate: vi.fn(createEmptyStore), hasAnyAuthProfileStoreSource: vi.fn(() => false), @@ -73,7 +72,6 @@ vi.mock("../agents/auth-profiles/store.js", () => { loadAuthProfileStoreForRuntime: vi.fn(createEmptyStore), loadAuthProfileStoreForSecretsRuntime: vi.fn(createEmptyStore), loadAuthProfileStoreWithoutExternalProfiles: vi.fn(createEmptyStore), - replaceRuntimeAuthProfileStoreSnapshots: vi.fn(), saveAuthProfileStore: vi.fn(), updateAuthProfileStoreWithLock: vi.fn(async () => createEmptyStore()), }; diff --git a/src/commands/doctor-auth-canonical-api-key-alias.test.ts b/src/commands/doctor-auth-canonical-api-key-alias.test.ts index 62f2fedf796b..f1621f135e43 100644 --- a/src/commands/doctor-auth-canonical-api-key-alias.test.ts +++ b/src/commands/doctor-auth-canonical-api-key-alias.test.ts @@ -3,7 +3,7 @@ import fs from "node:fs"; import path from "node:path"; import { afterEach, describe, expect, it, vi } from "vitest"; import { loadPersistedAuthProfileStore } from "../agents/auth-profiles/persisted.js"; -import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; import { closeOpenClawAgentDatabasesForTest } from "../state/openclaw-agent-db.js"; import { closeOpenClawStateDatabaseForTest } from "../state/openclaw-state-db.js"; import { diff --git a/src/commands/doctor-auth-flat-profiles.test.ts b/src/commands/doctor-auth-flat-profiles.test.ts index 6c91c9f4b214..a34958ce2783 100644 --- a/src/commands/doctor-auth-flat-profiles.test.ts +++ b/src/commands/doctor-auth-flat-profiles.test.ts @@ -4,15 +4,13 @@ import path from "node:path"; import { DatabaseSync } from "node:sqlite"; import { afterEach, describe, expect, it, vi } from "vitest"; import { loadPersistedAuthProfileStore } from "../agents/auth-profiles/persisted.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; import { readPersistedAuthProfileStoreRaw, writePersistedAuthProfileStateRaw, writePersistedAuthProfileStoreRaw, } from "../agents/auth-profiles/sqlite.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - saveAuthProfileStore, -} from "../agents/auth-profiles/store.js"; +import { saveAuthProfileStore } from "../agents/auth-profiles/store.js"; import type { AuthProfileStore } from "../agents/auth-profiles/types.js"; import { clearAgentHarnesses, registerAgentHarness } from "../agents/harness/registry.js"; import { diff --git a/src/commands/doctor-auth-flat-profiles.ts b/src/commands/doctor-auth-flat-profiles.ts index 4dd1535dcbe4..beac8c9cac30 100644 --- a/src/commands/doctor-auth-flat-profiles.ts +++ b/src/commands/doctor-auth-flat-profiles.ts @@ -25,6 +25,7 @@ import { loadPersistedAuthProfileStore, parseLegacyCredentialEntry, } from "../agents/auth-profiles/persisted.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; import { resolveSharedMainAuthAgentDir } from "../agents/auth-profiles/shared-main-dir.js"; import { inspectPersistedAuthProfileStateRaw, @@ -34,10 +35,7 @@ import { runAuthProfileWriteTransaction, } from "../agents/auth-profiles/sqlite.js"; import { coerceAuthProfileState } from "../agents/auth-profiles/state.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - saveAuthProfileStore, -} from "../agents/auth-profiles/store.js"; +import { saveAuthProfileStore } from "../agents/auth-profiles/store.js"; import type { AuthProfileCredential, AuthProfileState, diff --git a/src/commands/doctor-auth-migration-inherited-oauth.test.ts b/src/commands/doctor-auth-migration-inherited-oauth.test.ts index b8f0e150b31e..24c6674a9a0f 100644 --- a/src/commands/doctor-auth-migration-inherited-oauth.test.ts +++ b/src/commands/doctor-auth-migration-inherited-oauth.test.ts @@ -3,10 +3,8 @@ import fs from "node:fs"; import { afterEach, describe, expect, it, vi } from "vitest"; import { loadPersistedAuthProfileStore } from "../agents/auth-profiles/persisted.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - saveAuthProfileStore, -} from "../agents/auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; +import { saveAuthProfileStore } from "../agents/auth-profiles/store.js"; import type { AuthProfileStore } from "../agents/auth-profiles/types.js"; import { closeOpenClawAgentDatabasesForTest } from "../state/openclaw-agent-db.js"; import { closeOpenClawStateDatabaseForTest } from "../state/openclaw-state-db.js"; diff --git a/src/commands/doctor-auth-oauth-sidecar.test.ts b/src/commands/doctor-auth-oauth-sidecar.test.ts index 1332d254f4e1..8edd015afe28 100644 --- a/src/commands/doctor-auth-oauth-sidecar.test.ts +++ b/src/commands/doctor-auth-oauth-sidecar.test.ts @@ -3,7 +3,7 @@ import { createCipheriv } from "node:crypto"; import fs from "node:fs"; import path from "node:path"; import { afterEach, describe, expect, it, vi } from "vitest"; -import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; import { createOpenClawTestState, type OpenClawTestState, diff --git a/src/commands/doctor-auth-oauth-sidecar.ts b/src/commands/doctor-auth-oauth-sidecar.ts index e318d9619c5f..653ea1fa4ca9 100644 --- a/src/commands/doctor-auth-oauth-sidecar.ts +++ b/src/commands/doctor-auth-oauth-sidecar.ts @@ -5,7 +5,7 @@ import { isRecord } from "@openclaw/normalization-core/record-coerce"; import { note } from "../../packages/terminal-core/src/note.js"; import { listAgentIds, resolveAgentDir, resolveDefaultAgentDir } from "../agents/agent-scope.js"; import { AUTH_STORE_VERSION } from "../agents/auth-profiles/constants.js"; -import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/store.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles/runtime-snapshots.js"; import { formatCliCommand } from "../cli/command-format.js"; import { resolveOAuthDir, resolveStateDir } from "../config/paths.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; diff --git a/src/commands/doctor/shared/stale-oauth-profile-shadows.test.ts b/src/commands/doctor/shared/stale-oauth-profile-shadows.test.ts index fe5e3a7502ef..c9b53e296b08 100644 --- a/src/commands/doctor/shared/stale-oauth-profile-shadows.test.ts +++ b/src/commands/doctor/shared/stale-oauth-profile-shadows.test.ts @@ -7,11 +7,9 @@ import { coercePersistedAuthProfileStore, loadPersistedAuthProfileStore, } from "../../../agents/auth-profiles/persisted.js"; +import { clearRuntimeAuthProfileStoreSnapshots } from "../../../agents/auth-profiles/runtime-snapshots.js"; import { writePersistedAuthProfileStoreRaw } from "../../../agents/auth-profiles/sqlite.js"; -import { - clearRuntimeAuthProfileStoreSnapshots, - saveAuthProfileStore, -} from "../../../agents/auth-profiles/store.js"; +import { saveAuthProfileStore } from "../../../agents/auth-profiles/store.js"; import type { AuthProfileStore, OAuthCredential } from "../../../agents/auth-profiles/types.js"; import type { OpenClawConfig } from "../../../config/types.openclaw.js"; import { captureEnv } from "../../../test-utils/env.js"; diff --git a/src/commands/doctor/shared/stale-oauth-profile-shadows.ts b/src/commands/doctor/shared/stale-oauth-profile-shadows.ts index 95187bcdf75d..16e56a2d8d12 100644 --- a/src/commands/doctor/shared/stale-oauth-profile-shadows.ts +++ b/src/commands/doctor/shared/stale-oauth-profile-shadows.ts @@ -4,13 +4,13 @@ import path from "node:path"; import { expectDefined } from "@openclaw/normalization-core"; import { isRecord } from "@openclaw/normalization-core/record-coerce"; import { resolveAgentDir, listAgentEntries } from "../../../agents/agent-scope.js"; +import { hasUsableOAuthCredential } from "../../../agents/auth-profiles/credential-state.js"; import { isLegacyOAuthRef, LEGACY_OAUTH_REF_PROVIDER, } from "../../../agents/auth-profiles/legacy-oauth-ref.js"; import { areOAuthCredentialsEquivalent, - hasUsableOAuthCredential, isSafeToAdoptMainStoreOAuthIdentity, } from "../../../agents/auth-profiles/oauth-shared.js"; import { loadPersistedAuthProfileStore } from "../../../agents/auth-profiles/persisted.js"; @@ -94,10 +94,10 @@ function shouldRemoveLocalOAuthShadow(params: { if (areOAuthCredentialsEquivalent(local, main)) { return true; } - if (!hasUsableOAuthCredential(main, now)) { + if (!hasUsableOAuthCredential(main, { now })) { return false; } - if (!hasUsableOAuthCredential(local, now)) { + if (!hasUsableOAuthCredential(local, { now })) { return true; } const localExpires = Number.isFinite(local.expires) ? local.expires : 0; diff --git a/src/context-engine/context-engine.test.ts b/src/context-engine/context-engine.test.ts index 82012d9acd05..bae0b98c29c7 100644 --- a/src/context-engine/context-engine.test.ts +++ b/src/context-engine/context-engine.test.ts @@ -67,16 +67,16 @@ function registerTestContextEngine(id: string, factory: ContextEngineFactory) { }); } -const { compactEmbeddedAgentSessionDirectMock } = vi.hoisted(() => ({ - compactEmbeddedAgentSessionDirectMock: vi.fn(), +const { compactEmbeddedAgentSessionOnDemandMock } = vi.hoisted(() => ({ + compactEmbeddedAgentSessionOnDemandMock: vi.fn(), })); vi.mock("../agents/embedded-agent-runner/compact.runtime.js", () => ({ - compactEmbeddedAgentSessionDirect: compactEmbeddedAgentSessionDirectMock, + compactEmbeddedAgentSessionOnDemand: compactEmbeddedAgentSessionOnDemandMock, })); function installCompactRuntimeSpy() { - return compactEmbeddedAgentSessionDirectMock.mockResolvedValue({ + return compactEmbeddedAgentSessionOnDemandMock.mockResolvedValue({ ok: true, compacted: false, reason: "mock compaction", @@ -91,7 +91,7 @@ function installCompactRuntimeSpy() { } function requireCompactRuntimeParams(callIndex: number): Record { - const params = compactEmbeddedAgentSessionDirectMock.mock.calls[callIndex]?.[0] as + const params = compactEmbeddedAgentSessionOnDemandMock.mock.calls[callIndex]?.[0] as | Record | undefined; if (!params) { @@ -247,7 +247,7 @@ class MockContextEngine implements ContextEngine { describe("Engine contract tests", () => { beforeEach(() => { vi.restoreAllMocks(); - compactEmbeddedAgentSessionDirectMock.mockReset(); + compactEmbeddedAgentSessionOnDemandMock.mockReset(); clearMemoryPluginState(); }); @@ -325,7 +325,7 @@ describe("Engine contract tests", () => { const root = fs.mkdtempSync(path.join(os.tmpdir(), "context-successor-target-")); const storePath = path.join(root, "openclaw-agent.sqlite"); try { - compactEmbeddedAgentSessionDirectMock.mockResolvedValueOnce({ + compactEmbeddedAgentSessionOnDemandMock.mockResolvedValueOnce({ ok: true, compacted: true, reason: undefined, @@ -378,7 +378,7 @@ describe("Engine contract tests", () => { { agentId: "main", sessionKey: "agent:main:aaa-successor-alias", storePath }, { sessionId: "after-compaction", updatedAt: 2 }, ); - compactEmbeddedAgentSessionDirectMock.mockResolvedValueOnce({ + compactEmbeddedAgentSessionOnDemandMock.mockResolvedValueOnce({ ok: true, compacted: true, reason: undefined, @@ -431,7 +431,7 @@ describe("Engine contract tests", () => { }); it("rejects a successor marker that changes the caller store", async () => { - compactEmbeddedAgentSessionDirectMock.mockResolvedValueOnce({ + compactEmbeddedAgentSessionOnDemandMock.mockResolvedValueOnce({ ok: true, compacted: true, result: { @@ -456,7 +456,7 @@ describe("Engine contract tests", () => { }); it("rejects contradictory marker and top-level successor identities", async () => { - compactEmbeddedAgentSessionDirectMock.mockResolvedValueOnce({ + compactEmbeddedAgentSessionOnDemandMock.mockResolvedValueOnce({ ok: true, compacted: true, result: { @@ -493,7 +493,7 @@ describe("Engine contract tests", () => { }); it("rejects a legacy successor marker for another caller agent", async () => { - compactEmbeddedAgentSessionDirectMock.mockResolvedValueOnce({ + compactEmbeddedAgentSessionOnDemandMock.mockResolvedValueOnce({ ok: true, compacted: true, reason: undefined, diff --git a/src/context-engine/delegate.ts b/src/context-engine/delegate.ts index 8ceba9b559aa..d00955b32eff 100644 --- a/src/context-engine/delegate.ts +++ b/src/context-engine/delegate.ts @@ -152,8 +152,8 @@ export async function delegateCompactionToRuntime( ): Promise { // Load through the dedicated runtime boundary without introducing another // source-level static edge into the embedded runner graph. - const { compactEmbeddedAgentSessionDirect } = await loadCompactRuntime(); - type RuntimeCompactionParams = Parameters[0]; + const { compactEmbeddedAgentSessionOnDemand } = await loadCompactRuntime(); + type RuntimeCompactionParams = Parameters[0]; // runtimeContext carries host-resolved runtime fields set by internal // callers. Keep the public delegate keyed by session identity, not by the @@ -172,7 +172,7 @@ export async function delegateCompactionToRuntime( ? Math.floor(runtimeContext.currentTokenCount) : undefined); - const result = await compactEmbeddedAgentSessionDirect({ + const result = await compactEmbeddedAgentSessionOnDemand({ ...runtimeContextParams, ...(agentId ? { agentId } : {}), sessionId: params.sessionId, diff --git a/src/context-engine/legacy.ts b/src/context-engine/legacy.ts index acb02e2b85b4..5819296efc07 100644 --- a/src/context-engine/legacy.ts +++ b/src/context-engine/legacy.ts @@ -9,7 +9,7 @@ import type { AssembleResult, ContextEngine, ContextEngineInfo } from "./types.j * * - ingest: no-op (SessionManager handles message persistence) * - assemble: pass-through (existing sanitize/validate/limit pipeline in attempt.ts handles this) - * - compact: delegates to compactEmbeddedAgentSessionDirect + * - compact: delegates to the built-in compaction runtime */ export class LegacyContextEngine implements ContextEngine { readonly info: ContextEngineInfo = { diff --git a/src/cron/isolated-agent/run-subagent-registry.runtime.ts b/src/cron/isolated-agent/run-subagent-registry.runtime.ts index fbd3f862d5f8..63506126b563 100644 --- a/src/cron/isolated-agent/run-subagent-registry.runtime.ts +++ b/src/cron/isolated-agent/run-subagent-registry.runtime.ts @@ -2,4 +2,4 @@ export { countActiveDescendantRuns, listDescendantRunsForRequester, -} from "../../agents/subagents/registry/subagent-registry.js"; +} from "../../agents/subagents/registry/subagent-registry-read.js"; diff --git a/src/gateway/session-companion-ask.ts b/src/gateway/session-companion-ask.ts index 02ec7e476b6c..e2db5c1c4e31 100644 --- a/src/gateway/session-companion-ask.ts +++ b/src/gateway/session-companion-ask.ts @@ -8,7 +8,10 @@ import { resolveBtwSessionTranscriptPath, } from "../agents/btw-transcript.js"; import { resolveSimpleCompletionSelectionForAgent } from "../agents/simple-completion-runtime.js"; -import { extractAssistantText, stripToolMessages } from "../agents/tools/chat-history-text.js"; +import { + extractStoredAssistantText, + stripToolMessages, +} from "../agents/tools/chat-history-text.js"; import { resolveUtilityModelRefForAgent } from "../agents/utility-model.js"; import { resolveStorePath } from "../config/sessions.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; @@ -158,7 +161,7 @@ function sanitizeSeedMessages(messages: unknown[]): SessionCompanionSeedMessage[ const role = (message as { role?: unknown }).role; const text = role === "assistant" - ? normalizeSeedText(extractAssistantText(message) ?? "") + ? normalizeSeedText(extractStoredAssistantText(message) ?? "") : role === "user" ? extractUserText(message) : undefined; diff --git a/src/infra/outbound/message-action-execution.ts b/src/infra/outbound/message-action-execution.ts index fa936fc39ee1..f5cfe10f843a 100644 --- a/src/infra/outbound/message-action-execution.ts +++ b/src/infra/outbound/message-action-execution.ts @@ -5,7 +5,7 @@ import { stripPlainTextToolCallBlocks } from "../../../packages/tool-call-repair import { readPositiveIntegerParam, readStringArrayParam, - readStringParam, + readToolStringParam, } from "../../agents/tools/common.js"; import { normalizeConversationReadInvocationOrigin } from "../../channels/plugins/conversation-read-origin.js"; import { dispatchChannelMessageAction } from "../../channels/plugins/message-action-dispatch.js"; @@ -415,7 +415,7 @@ export async function executeMessagePoll(ctx: ResolvedActionContext): Promise { - const question = readStringParam(params, "pollQuestion", { + const question = readToolStringParam(params, "pollQuestion", { required: true, }); const options = readStringArrayParam(params, "pollOption", { required: true }); @@ -599,7 +599,7 @@ export async function executeMessagePlugin( toolContext: input.toolContext, resolveAutoThreadId: channelPlugin.threading?.resolveAutoThreadId, resolveReplyTransport: channelPlugin.threading?.resolveReplyTransport, - replyToIsExplicit: Boolean(readStringParam(params, "replyTo")), + replyToIsExplicit: Boolean(readToolStringParam(params, "replyTo")), }); } @@ -623,7 +623,7 @@ export async function executeMessagePlugin( dryRun, }), }); - const replyToIsExplicit = Boolean(readStringParam(params, "replyTo")); + const replyToIsExplicit = Boolean(readToolStringParam(params, "replyTo")); if (gatewayPluginAction) { // Gateway-owned actions must execute where the live channel runtime exists. return annotateSourceDelivery(gatewayPluginAction, { diff --git a/src/infra/outbound/message-action-params.ts b/src/infra/outbound/message-action-params.ts index cc689265cdf3..5e8b312b1b33 100644 --- a/src/infra/outbound/message-action-params.ts +++ b/src/infra/outbound/message-action-params.ts @@ -6,7 +6,7 @@ import { extensionForMime } from "@openclaw/media-core/mime"; import { isRecord } from "@openclaw/normalization-core/record-coerce"; import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; import { assertMediaNotDataUrl, resolveSandboxedMediaSource } from "../../agents/sandbox-paths.js"; -import { readStringArrayParam, readStringParam } from "../../agents/tools/common.js"; +import { readStringArrayParam, readToolStringParam } from "../../agents/tools/common.js"; import { resolveChannelMessageToolMediaSourceParamKeys } from "../../channels/plugins/message-action-discovery.js"; import type { ChannelId, ChannelMessageActionName } from "../../channels/plugins/types.public.js"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; @@ -63,7 +63,7 @@ type StructuredAttachmentSource = { type StructuredAttachmentMode = "selected" | "all"; function readMediaParam(args: Record, key: string): string | undefined { - return readStringParam(args, key, { trim: false }); + return readToolStringParam(args, key, { trim: false }); } function resolveMediaParamEntry( @@ -88,7 +88,7 @@ function hasExplicitAttachmentPayload( args: Record, extraParamKeys?: readonly string[], ): boolean { - if (readStringParam(args, "buffer", { trim: false })) { + if (readToolStringParam(args, "buffer", { trim: false })) { return true; } return buildActionMediaSourceParamKeys(extraParamKeys).some((key) => { @@ -132,23 +132,23 @@ export function collectAttachmentSources( return []; } const sources: StructuredAttachmentSource[] = []; - for (const attachment of attachments) { - if (!isRecord(attachment)) { + for (const item of attachments) { + if (!isRecord(item)) { continue; } for (const key of STRUCTURED_ATTACHMENT_MEDIA_SOURCE_PARAM_KEYS) { - const entry = resolveMediaParamEntry(attachment, key); + const entry = resolveMediaParamEntry(item, key); if (!entry || !normalizeOptionalString(entry.value)) { continue; } sources.push({ - attachment, + attachment: item, key: entry.key, value: entry.value, kind: STRUCTURED_ATTACHMENT_FILE_SOURCE_PARAM_KEYS.has(key) ? "file" : "media", contentType: - readStringParam(attachment, "contentType") ?? readStringParam(attachment, "mimeType"), - filename: readStringParam(attachment, "filename") ?? readStringParam(attachment, "name"), + readToolStringParam(item, "contentType") ?? readToolStringParam(item, "mimeType"), + filename: readToolStringParam(item, "filename") ?? readToolStringParam(item, "name"), }); break; } @@ -333,23 +333,23 @@ async function hydrateSendBufferMediaParams(params: { delete params.args.buffer; return; } - const rawBuffer = readStringParam(params.args, "buffer", { trim: false }); + const rawBuffer = readToolStringParam(params.args, "buffer", { trim: false }); if (!rawBuffer) { return; } const normalized = normalizeBase64Payload({ base64: rawBuffer, - contentType: readStringParam(params.args, "contentType") ?? undefined, + contentType: readToolStringParam(params.args, "contentType") ?? undefined, }); if (!normalized.base64) { return; } const contentType = - readStringParam(params.args, "contentType") ?? - readStringParam(params.args, "mimeType") ?? + readToolStringParam(params.args, "contentType") ?? + readToolStringParam(params.args, "mimeType") ?? normalized.contentType; const filename = - readStringParam(params.args, "filename") ?? + readToolStringParam(params.args, "filename") ?? inferAttachmentFilename({ contentType: contentType ?? undefined, }); @@ -365,10 +365,10 @@ async function hydrateSendBufferMediaParams(params: { if (!params.preserveBuffer) { delete params.args.buffer; } - if (normalized.contentType && !readStringParam(params.args, "contentType")) { + if (normalized.contentType && !readToolStringParam(params.args, "contentType")) { params.args.contentType = normalized.contentType; } - if (filename && !readStringParam(params.args, "filename")) { + if (filename && !readToolStringParam(params.args, "filename")) { params.args.filename = filename; } return; @@ -388,10 +388,10 @@ async function hydrateSendBufferMediaParams(params: { params.args.mediaUrl = staged.path; params.args.mediaUrls = [staged.path]; delete params.args.buffer; - if (staged.contentType && !readStringParam(params.args, "contentType")) { + if (staged.contentType && !readToolStringParam(params.args, "contentType")) { params.args.contentType = staged.contentType; } - if (filename && !readStringParam(params.args, "filename")) { + if (filename && !readToolStringParam(params.args, "filename")) { params.args.filename = filename; } } @@ -495,7 +495,7 @@ async function hydrateAttachmentPayload(params: { optimizeImages?: boolean; }) { const contentTypeParam = params.contentTypeParam ?? undefined; - const rawBuffer = readStringParam(params.args, "buffer", { trim: false }); + const rawBuffer = readToolStringParam(params.args, "buffer", { trim: false }); const normalized = normalizeBase64Payload({ base64: rawBuffer, contentType: contentTypeParam ?? undefined, @@ -507,10 +507,10 @@ async function hydrateAttachmentPayload(params: { } } - const filename = readStringParam(params.args, "filename"); + const filename = readToolStringParam(params.args, "filename"); const mediaSource = (params.mediaHint ?? undefined) || (params.fileHint ?? undefined); - if (!params.dryRun && !readStringParam(params.args, "buffer", { trim: false }) && mediaSource) { + if (!params.dryRun && !rawBuffer && mediaSource) { const maxBytes = resolveAttachmentMaxBytes({ cfg: params.cfg, channel: params.channel, @@ -631,19 +631,19 @@ async function hydrateAttachmentActionPayload(params: { const mediaHint = readAttachmentMediaHint(params.args); const fileHint = readAttachmentFileHint(params.args); const contentTypeParam = - readStringParam(params.args, "contentType") ?? - readStringParam(params.args, "mimeType") ?? + readToolStringParam(params.args, "contentType") ?? + readToolStringParam(params.args, "mimeType") ?? attachmentSource?.contentType; - if (attachmentSource?.filename && !readStringParam(params.args, "filename")) { + if (attachmentSource?.filename && !readToolStringParam(params.args, "filename")) { params.args.filename = attachmentSource.filename; } - if (attachmentSource?.contentType && !readStringParam(params.args, "contentType")) { + if (attachmentSource?.contentType && !readToolStringParam(params.args, "contentType")) { params.args.contentType = attachmentSource.contentType; } if (params.allowMessageCaptionFallback) { - const caption = readStringParam(params.args, "caption", { allowEmpty: true })?.trim(); - const message = readStringParam(params.args, "message", { allowEmpty: true })?.trim(); + const caption = readToolStringParam(params.args, "caption", { allowEmpty: true })?.trim(); + const message = readToolStringParam(params.args, "message", { allowEmpty: true })?.trim(); if (!caption && message) { params.args.caption = message; } diff --git a/src/infra/outbound/message-action-routing.ts b/src/infra/outbound/message-action-routing.ts index 9007a9294f1f..7bcd01eaa219 100644 --- a/src/infra/outbound/message-action-routing.ts +++ b/src/infra/outbound/message-action-routing.ts @@ -2,7 +2,7 @@ import { normalizeOptionalLowercaseString, normalizeOptionalString, } from "@openclaw/normalization-core/string-coerce"; -import { readStringParam } from "../../agents/tools/common.js"; +import { readToolStringParam } from "../../agents/tools/common.js"; import { normalizeChatType, type ChatType } from "../../channels/chat-type.js"; import { normalizeConversationReadInvocationOrigin } from "../../channels/plugins/conversation-read-origin.js"; import { @@ -38,7 +38,7 @@ async function resolveChannel( toolContext?: { currentChannelProvider?: string }, action?: ChannelMessageActionName, ) { - const channel = readStringParam(params, "channel"); + const channel = readToolStringParam(params, "channel"); // Explicit reads must never switch to the source conversation when their // requested provider is unknown or unavailable. const fallbackChannel = @@ -355,7 +355,7 @@ export async function prepareMessageRoute(params: { const explicitAccountId = validateExplicitMessageAccountSelection({ cfg, channel, - accountId: readStringParam(actionParams, "accountId"), + accountId: readToolStringParam(actionParams, "accountId"), plugin: channelPlugin, }); const pluginOwnedAction = action !== "send" && action !== "poll"; diff --git a/src/infra/outbound/message-action-runner.ts b/src/infra/outbound/message-action-runner.ts index 76a436dd0628..06951d0175c2 100644 --- a/src/infra/outbound/message-action-runner.ts +++ b/src/infra/outbound/message-action-runner.ts @@ -5,7 +5,7 @@ import { } from "@openclaw/normalization-core/string-coerce"; import { resolveSessionAgentId } from "../../agents/agent-scope.js"; import type { AgentToolResult } from "../../agents/runtime/index.js"; -import { readStringArrayParam, readStringParam } from "../../agents/tools/common.js"; +import { readStringArrayParam, readToolStringParam } from "../../agents/tools/common.js"; import type { SourceReplyDeliveryMode } from "../../auto-reply/get-reply-options.types.js"; import type { ReplyPayload } from "../../auto-reply/reply-payload.js"; import type { ChannelId } from "../../channels/plugins/types.public.js"; @@ -72,10 +72,10 @@ async function handleBroadcastAction( if (rawTargets.length === 0) { throw new Error("Broadcast requires at least one target in --targets."); } - const channelHint = readStringParam(params, "channel"); + const channelHint = readToolStringParam(params, "channel"); const explicitAccountId = validateExplicitMessageAccountSelection({ cfg: input.cfg, - accountId: readStringParam(params, "accountId"), + accountId: readToolStringParam(params, "accountId"), checkResolvedAccount: false, }); if (input.broadcastAccountPlan && input.broadcastAccountPlan.accountId !== explicitAccountId) { diff --git a/src/infra/outbound/message-action-send.ts b/src/infra/outbound/message-action-send.ts index 242dab1b60b6..24f0101cf572 100644 --- a/src/infra/outbound/message-action-send.ts +++ b/src/infra/outbound/message-action-send.ts @@ -2,7 +2,7 @@ import { normalizeOptionalString } from "@openclaw/normalization-core/string-coe import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload"; import { stripPlainTextToolCallBlocks } from "../../../packages/tool-call-repair/src/index.js"; import { resolveAgentIdentity, resolveResponsePrefix } from "../../agents/identity.js"; -import { readStringArrayParam, readStringParam } from "../../agents/tools/common.js"; +import { readStringArrayParam, readToolStringParam } from "../../agents/tools/common.js"; import type { ReplyPayload } from "../../auto-reply/reply-payload.js"; import { resolveResponsePrefixTemplate } from "../../auto-reply/reply/response-prefix-template.js"; import { normalizeOutboundLocation } from "../../channels/location.js"; @@ -144,15 +144,15 @@ export async function buildMessagePayload(params: { } } const mediaHint = - readStringParam(actionParams, "media", { trim: false }) ?? - readStringParam(actionParams, "mediaUrl", { trim: false }) ?? - readStringParam(actionParams, "path", { trim: false }) ?? - readStringParam(actionParams, "filePath", { trim: false }) ?? - readStringParam(actionParams, "fileUrl", { trim: false }) ?? - readStringParam(actionParams, "image", { trim: false }); + readToolStringParam(actionParams, "media", { trim: false }) ?? + readToolStringParam(actionParams, "mediaUrl", { trim: false }) ?? + readToolStringParam(actionParams, "path", { trim: false }) ?? + readToolStringParam(actionParams, "filePath", { trim: false }) ?? + readToolStringParam(actionParams, "fileUrl", { trim: false }) ?? + readToolStringParam(actionParams, "image", { trim: false }); const mediaUrlHints = readStringArrayParam(actionParams, "mediaUrls") ?? []; const attachmentMediaHints = collectAttachmentSources(actionParams).map((source) => source.value); - const hasBuffer = Boolean(readStringParam(actionParams, "buffer", { trim: false })); + const hasBuffer = Boolean(readToolStringParam(actionParams, "buffer", { trim: false })); const hasMediaHint = hasBuffer || Boolean(mediaHint) || mediaUrlHints.length > 0 || attachmentMediaHints.length > 0; const hasPresentation = hasMessagePresentationBlocks(actionParams.presentation); @@ -164,9 +164,9 @@ export async function buildMessagePayload(params: { typeof rawLocation === "string" && normalizeOptionalString(rawLocation) === undefined ? undefined : normalizeOutboundLocation(rawLocation); - const caption = readStringParam(actionParams, "caption", { allowEmpty: true }) ?? ""; + const caption = readToolStringParam(actionParams, "caption", { allowEmpty: true }) ?? ""; let message = - readStringParam(actionParams, "message", { + readToolStringParam(actionParams, "message", { required: !hasMediaHint && !hasPresentation && !hasInteractive && !location, allowEmpty: true, }) ?? ""; @@ -261,7 +261,7 @@ export async function buildMessagePayload(params: { }); } - const mediaUrl = readStringParam(actionParams, "media", { trim: false }); + const mediaUrl = readToolStringParam(actionParams, "media", { trim: false }); if ( !hasReplyPayloadContent({ text: message, @@ -350,7 +350,7 @@ export async function executeMessageSend(ctx: ResolvedActionContext): Promise