sealclaw 2026.7.21 → 2026.7.28-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/dist/abort-Dz7OpCbT.js +201 -0
- package/dist/abort.runtime-D9-uoMfD.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/acp-cli-CdHJsS_d.js +2095 -0
- package/dist/acp-spawn-DHQ7heQf.js +2 -0
- package/dist/acp-spawn-WI9gmGyD.js +1171 -0
- package/dist/acp-stateful-target-driver-BkA8j7gz.js +89 -0
- package/dist/action-agents-DBv72teF.js +67 -0
- package/dist/action-focus-BHn6hXoA.js +135 -0
- package/dist/action-help-CkQuh12H.js +7 -0
- package/dist/action-info-BgcbjcbJ.js +101 -0
- package/dist/action-kill-Z_eiqXn1.js +33 -0
- package/dist/action-list-Cd4mE2zR.js +21 -0
- package/dist/action-log-hosx1cSS.js +30 -0
- package/dist/action-send-DOrl1VIw.js +39 -0
- package/dist/action-spawn-CtPkQWcm.js +47 -0
- package/dist/action-unfocus-k70eaIfi.js +29 -0
- package/dist/agent-Bp_KjoU3.js +3 -0
- package/dist/agent-CxsGDGsG.js +2 -0
- package/dist/agent-command-DnKuLbRo.js +994 -0
- package/dist/agent-harness-runtime-DO7PUWYA.js +139 -0
- package/dist/agent-runner-utils-vlinqg2l.js +257 -0
- package/dist/agent-runner.runtime-C3bwCU7i.js +4118 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-CQia04nT.js +199 -0
- package/dist/agent-runtime-label-BzJt-1nS.js +30 -0
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents/pi-model-discovery-runtime.js +1 -1
- package/dist/agents-BiT6YMcj2.js +6 -0
- package/dist/agents-ChXzZ_Fb.js +740 -0
- package/dist/agents.commands.add-CPjppzvu.js +2 -0
- package/dist/agents.commands.add-lftZsiRg.js +290 -0
- package/dist/aliases-Cfvg36Dw.js +96 -0
- package/dist/api-BTh3bAYs.js +2 -0
- package/dist/api-key-rotation-C24XAZnZ.js +48 -0
- package/dist/api-mbD_lSQv.js +2 -0
- package/dist/app-registration-DH1eX5Oe.js +186 -0
- package/dist/apply-B-ZwQY4w.js +461 -0
- package/dist/approval-gateway-runtime-QFAB7BC_.js +29 -0
- package/dist/approval-handler-runtime-Bh_6_nug.js +440 -0
- package/dist/approval-native-runtime-DnJL8VD4.js +544 -0
- package/dist/approval-shared-CY93GIhK.js +203 -0
- package/dist/assistant-DGT_0b-g.js +259 -0
- package/dist/attempt-execution-0aipV8af.js +465 -0
- package/dist/attempt-execution.helpers-CXG7ANOa.js +256 -0
- package/dist/attempt-execution.runtime-AKAmaRUG.js +3 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt.prompt-helpers-CUwGrG-H.js +363 -0
- package/dist/attempt.tool-run-context-B0d41XB6.js +569 -0
- package/dist/audio-preflight.runtime-D2lPf-I5.js +7 -0
- package/dist/audio-preflight.runtime.js +1 -1
- package/dist/audit-DQWRvfSi.js +955 -0
- package/dist/audit.nondeep.runtime-BCRvte-F.js +1268 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-BqjAxKlr.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-choice-CPnvfUbv.js +90 -0
- package/dist/auth-choice-D7sFrpiS.js +3 -0
- package/dist/auth-choice-DH5faEl6.js +359 -0
- package/dist/auth-choice.apply.api-providers-CKQaGFti.js +2 -0
- package/dist/auth-choice.apply.api-providers-DOChOO-z.js +34 -0
- package/dist/auth-choice.plugin-providers.runtime-CsspPPRd.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/bash-tools-BX5X676W.js +3 -0
- package/dist/bash-tools-ZdxIKLba.js +2967 -0
- package/dist/binding-routing-DxC24DCz.js +105 -0
- package/dist/binding-targets-Cvg-Qn6a.js +121 -0
- package/dist/btw-command-C6mfE7Jk.js +18 -0
- package/dist/build-BwJwzrk8.js +196 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/call-CTIlmgxh.js +422 -0
- package/dist/call-CXkEDYN3.js +3 -0
- package/dist/call.runtime-BB2SkHlP.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-D0CtCrZF.js +1511 -0
- package/dist/channel-C0tL2mlV.js +1719 -0
- package/dist/channel-core-DdHbluWu.js +5 -0
- package/dist/channel.runtime-H-bK4jiZ.js +704 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-CEWXmRBV.js +961 -0
- package/dist/channels-cli-By2oaDPh.js +311 -0
- package/dist/channels.cn-CdMS9gma.js +940 -0
- package/dist/chat-DOiGkcc-.js +3199 -0
- package/dist/clawbot-cli-Dsb1SE0M.js +9 -0
- package/dist/cli/daemon-cli.js +3 -3
- package/dist/cli/gateway-lifecycle.runtime.js +3 -3
- package/dist/cli/run-main.js +8 -8
- package/dist/cli-BT9gMk6h.js +2 -0
- package/dist/cli-C79957ne.js +1392 -0
- package/dist/cli-CalxhuMU.js +4549 -0
- package/dist/cli-Cn-1MfPA.js +76 -0
- package/dist/cli-CpdF02jW.js +87 -0
- package/dist/cli-compaction-DTxkhwRM.js +153 -0
- package/dist/cli-corSDsbZ.js +2 -0
- package/dist/cli-registry-loader-CKlrQHIE.js +2 -0
- package/dist/cli-registry-loader-M_JE3sDf.js +185 -0
- package/dist/cli-runner-DgO-HVmK.js +302 -0
- package/dist/cli-runner-DnLq_riS.js +2 -0
- package/dist/cli-runner.runtime-DB20nw_F.js +4 -0
- package/dist/cli-runner.runtime-Ta6FtQnT.js +3 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-session-BpDT7OO6.js +106 -0
- package/dist/cli-session-history-CzuKhiAy.js +368 -0
- package/dist/cli-startup-metadata.json +2 -2
- package/dist/cli.runtime-8GX15Aan.js +1254 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-Bivx5JfY.js +2 -0
- package/dist/client-Cj4NTwWB.js +679 -0
- package/dist/command-config-resolution-C4lqPwyn.js +2 -0
- package/dist/command-config-resolution-ElRcL0p_.js +23 -0
- package/dist/command-config-resolution.runtime-zADI7rKZ.js +2 -0
- package/dist/command-config-resolution.runtime.js +1 -1
- package/dist/command-primitives-runtime-F5vm66r1.js +3 -0
- package/dist/command-registry-B3agw-ki.js +4 -0
- package/dist/command-registry-GUPpuTru.js +9 -0
- package/dist/command-registry-core-CBADchdQ.js +110 -0
- package/dist/command-secret-gateway-DvVZP7Zn.js +428 -0
- package/dist/command-status-builders-B9j1QJSs.js +147 -0
- package/dist/command-status.runtime-DVSi_QFk.js +90 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands/status.summary.runtime.js +4 -4
- package/dist/commands-acp-k3AfbquA.js +74 -0
- package/dist/commands-compact.runtime-CS_ScgLr.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BKUmE_jT.js +5058 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-cDXqZPyW.js +338 -0
- package/dist/commands-registry-BWZN3V7U.js +194 -0
- package/dist/commands-registry.runtime-BwZTkIK2.js +4 -0
- package/dist/commands-registry.runtime.js +1 -1
- package/dist/commands-status-Bt4Dbb4u.js +16 -0
- package/dist/commands-status.runtime-Dk0zPbY_.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-DhMwiE0Q.js +2 -0
- package/dist/commands-subagents-control.runtime-_tP1JH1g.js +3 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-DcpV9z1L.js +165 -0
- package/dist/commands-system-prompt-DfadZyEx.js +2 -0
- package/dist/commands.runtime-D0mGR7RZ.js +176 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/commitments/runtime.js +1 -1
- package/dist/compact-B9Arz4l8.js +1073 -0
- package/dist/compact.runtime-CdkzCS8b.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/compaction-successor-transcript-DeRy_4of.js +5373 -0
- package/dist/completion-cli-B4jXJnOK.js +315 -0
- package/dist/config-cli-BgYId-_E.js +1302 -0
- package/dist/configure-BD-BnZu5.js +1212 -0
- package/dist/configure-lxHs_vOu.js +2 -0
- package/dist/consequential-action-policy-CyTqHnAU.js +379 -0
- package/dist/context-D24Z0V_u.js +2 -0
- package/dist/context-DBIjppoU.js +292 -0
- package/dist/context-engine-maintenance-BQizempd.js +433 -0
- package/dist/control-ui/assets/agents-DRyAP0RN.js +1002 -0
- package/dist/control-ui/assets/channels-CYcLppeB.js +349 -0
- package/dist/control-ui/assets/channels.cn-CkUIyfoO.js +129 -0
- package/dist/control-ui/assets/cron-DZlK6zeD.js +963 -0
- package/dist/control-ui/assets/cron-task-list-D9By1Z8M.js +226 -0
- package/dist/control-ui/assets/debug-C5aCoAdV.js +96 -0
- package/dist/control-ui/assets/filespace-BFGnCGV3.js +116 -0
- package/dist/control-ui/assets/index-CWs3ukMK.js +9370 -0
- package/dist/control-ui/assets/instances-BDVWfaP4.js +57 -0
- package/dist/control-ui/assets/nodes-DaPdjOG7.js +436 -0
- package/dist/control-ui/assets/pdf-R18WXtb_.js +55 -0
- package/dist/control-ui/assets/pdf.worker-N-SZzvKC.js +49 -0
- package/dist/control-ui/assets/sessions-BbAlePk8.js +365 -0
- package/dist/control-ui/assets/skill-center-7mnRkHqP.js +723 -0
- package/dist/control-ui/assets/skill-publish-e4vzZM4J.js +175 -0
- package/dist/control-ui/assets/skills-D7PNq1jg.js +314 -0
- package/dist/control-ui/assets/store-Cf_1pKfx.js +2 -0
- package/dist/control-ui/assets/workspace-browser-Bii9zNdo.js +348 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui-CLahn6rp.js +760 -0
- package/dist/conversation-label-generator-pBEXxX_0.js +55 -0
- package/dist/conversation-runtime-B3-9YMed.js +31 -0
- package/dist/core-B_UTymWX.js +282 -0
- package/dist/create-DNZtaIvr.js +109 -0
- package/dist/create-pSP0EoJU.js +2 -0
- package/dist/crestodian/crestodian.js +1 -1
- package/dist/crestodian/rescue-message.js +1 -1
- package/dist/crestodian-RQnvjsWb.js +55 -0
- package/dist/cron-cli-IlBZa9Xa.js +777 -0
- package/dist/daemon-cli-G6nvCONL.js +12 -0
- package/dist/defaults-B5SXWBJN.js +3 -0
- package/dist/defaults-DlQNM3-S.js +105 -0
- package/dist/defaults.constants-DvzOtHY4.js +65 -0
- package/dist/detached-task-runtime-Cte_QYei.js +83 -0
- package/dist/dev-DxnRC0AU.js +97 -0
- package/dist/devices-cli-Dnb6BmDs.js +586 -0
- package/dist/diagnostics-CtHvWGhm.js +168 -0
- package/dist/dialogue-Ck_7KyEv.js +37 -0
- package/dist/direct-dm-CpbbBwJk.js +64 -0
- package/dist/directive-handling.defaults-BNXEfAUW.js +20 -0
- package/dist/directive-handling.fast-lane-DHqmuVo2.js +68 -0
- package/dist/directive-handling.impl-C9QllcDQ.js +712 -0
- package/dist/directive-handling.impl-DDvYtDW4.js +2 -0
- package/dist/directive-handling.model-selection-D-O0s0Z_.js +116 -0
- package/dist/directive-handling.persist.runtime-Uw9AXOxB.js +219 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/dispatch-acp-C6OPFhdD.js +1084 -0
- package/dist/dispatch-acp-manager.runtime-BKetSFib.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-BbLNxgdl.js +4 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-transcript.runtime-CpXOYvsn.js +41 -0
- package/dist/dispatch-acp-transcript.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-B0scPVek.js +18 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dispatch-z1tfSlZ2.js +1364 -0
- package/dist/doctor-3mOVPgAU.js +6 -0
- package/dist/doctor-BhPUn7Q6.js +2 -0
- package/dist/doctor-auth-D8auVEjC.js +172 -0
- package/dist/doctor-device-pairing-xXZByxNS.js +321 -0
- package/dist/doctor-gateway-daemon-flow-DXn0lHJq.js +305 -0
- package/dist/doctor-gateway-health-BIk4cSxS.js +78 -0
- package/dist/doctor-health-CzSKfquh.js +61 -0
- package/dist/doctor-health-contributions-Co1L9VIi.js +582 -0
- package/dist/doctor-memory-search-Ql4RBtTR.js +376 -0
- package/dist/doctor-prompter-BpVXFYEJ.js +58 -0
- package/dist/doctor-state-integrity-CarW8sXU.js +1120 -0
- package/dist/doctor-workspace-status-llU7p8sQ.js +76 -0
- package/dist/dreaming-C4tB9ICB.js +504 -0
- package/dist/dreaming-command-BrHwKTab.js +99 -0
- package/dist/dreaming-phases-AN-GWZbU.js +1830 -0
- package/dist/drive-BQ7pcRp6.js +2506 -0
- package/dist/embedded-gateway-stub.runtime-BAeGQL3c.js +12 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/embedding-batch-CowpNGRC.js +190 -0
- package/dist/embedding-provider-BGumZP6x.js +63 -0
- package/dist/embeddings-http-3OVPsZ3z.js +207 -0
- package/dist/engine-qmd-CKjNZLVu.js +640 -0
- package/dist/engine-storage-eVEd0sIo.js +150 -0
- package/dist/entry.js +1 -1
- package/dist/exec-approval-CHaSncXx.js +297 -0
- package/dist/exec-approvals-cli-DTtsUuGG.js +500 -0
- package/dist/execute.runtime-31Dho74l.js +564 -0
- package/dist/execute.runtime.js +1 -1
- package/dist/extensionAPI.js +3 -3
- package/dist/extensions/active-memory/index.js +3 -3
- package/dist/extensions/comfy/image-generation-provider.js +2 -2
- package/dist/extensions/comfy/index.js +2 -2
- package/dist/extensions/comfy/test-helpers.js +1 -1
- package/dist/extensions/comfy/video-generation-provider.js +2 -2
- package/dist/extensions/comfy/workflow-runtime.js +1 -1
- package/dist/extensions/deepgram/index.js +1 -1
- package/dist/extensions/deepgram/realtime-transcription-provider.js +1 -1
- package/dist/extensions/deepgram/test-api.js +1 -1
- package/dist/extensions/elevenlabs/index.js +1 -1
- package/dist/extensions/elevenlabs/realtime-transcription-provider.js +1 -1
- package/dist/extensions/elevenlabs/test-api.js +1 -1
- package/dist/extensions/fal/image-generation-provider.js +1 -1
- package/dist/extensions/fal/index.js +2 -2
- package/dist/extensions/fal/test-api.js +2 -2
- package/dist/extensions/fal/video-generation-provider.js +1 -1
- package/dist/extensions/feishu/api.js +4 -4
- package/dist/extensions/feishu/channel-plugin-api.js +1 -1
- package/dist/extensions/feishu/contract-api.js +1 -1
- package/dist/extensions/feishu/index.js +1 -1
- package/dist/extensions/feishu/runtime-api.js +1 -1
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/feishu/subagent-hooks-api.js +2 -2
- package/dist/extensions/image-generation-core/api.js +2 -2
- package/dist/extensions/image-generation-core/runtime-api.js +2 -2
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/memory-core/api.js +2 -2
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +8 -8
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +7 -7
- package/dist/extensions/memory-wiki/cli-metadata.js +1 -1
- package/dist/extensions/memory-wiki/index.js +1 -1
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +3 -3
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/test-api.js +3 -3
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/runway/index.js +1 -1
- package/dist/extensions/runway/video-generation-provider.js +1 -1
- package/dist/extensions/sealgw/consequential-action-policy.js +1 -1
- package/dist/extensions/sealgw/image-generation-provider.js +1 -1
- package/dist/extensions/sealgw/index.js +5 -5
- package/dist/extensions/sealgw/list-models-tool.js +1 -1
- package/dist/extensions/sealgw/media-gateway.js +1 -1
- package/dist/extensions/sealgw/video-generation-provider.js +1 -1
- package/dist/extensions/senseaudio/index.js +1 -1
- package/dist/extensions/senseaudio/media-understanding-provider.js +1 -1
- package/dist/extensions/senseaudio/test-api.js +1 -1
- package/dist/extensions/speech-core/api.js +2 -2
- package/dist/extensions/speech-core/runtime-api.js +2 -2
- package/dist/extensions/video-generation-core/api.js +2 -2
- package/dist/extensions/video-generation-core/runtime-api.js +2 -2
- package/dist/extensions/voyage/embedding-batch.js +1 -1
- package/dist/extensions/voyage/embedding-provider.js +1 -1
- package/dist/extensions/voyage/index.js +1 -1
- package/dist/extensions/voyage/memory-embedding-adapter.js +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- package/dist/extensions/wecom/channel-plugin-api.js +2 -2
- package/dist/extensions/weixin/channel-plugin-api.js +2 -2
- package/dist/extensions/workspace-browser/index.js +1 -1
- package/dist/extensions/workspace-browser/plugin-registration.js +1 -1
- package/dist/extra-params-BZqqJTTf.js +517 -0
- package/dist/fallbacks-oaL5_WxM.js +31 -0
- package/dist/fallbacks-shared-C20RMmA-.js +111 -0
- package/dist/fast-mode-DWYQM053.js +32 -0
- package/dist/gateway/protocol/index.js +1 -1
- package/dist/gateway/server.js +1 -1
- package/dist/gateway-DCxXGNKv.js +115 -0
- package/dist/gateway-cli-Ds2UCxMQ.js +474 -0
- package/dist/gateway-rpc.runtime-B1B-ZWQq.js +25 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gateway-runtime-VzX09M6O.js +22 -0
- package/dist/gateway-status-Do-cII8j.js +393 -0
- package/dist/get-reply-from-config.runtime-DoZp0DaK.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/get-reply-uzgdjnN9.js +3492 -0
- package/dist/health-COvuYvpf.js +3 -0
- package/dist/health-FA93qjjC.js +549 -0
- package/dist/health-state-BbF95Al6.js +106 -0
- package/dist/heartbeat-runner-BLfpFJ-H.js +1744 -0
- package/dist/heartbeat-runner-Dq36L-k3.js +5 -0
- package/dist/heartbeat-runner.runtime-4_7WeTpE.js +4 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/helpers-DNVBiJbG.js +315 -0
- package/dist/hooks-B6o87Juy.js +508 -0
- package/dist/hooks-cli-BYU7L3qv.js +449 -0
- package/dist/http-endpoint-helpers-CK3oLwIg.js +43 -0
- package/dist/http-utils-CjOvH37s.js +86 -0
- package/dist/image-DiU65gdv.js +336 -0
- package/dist/image-fallbacks-C18sBauT.js +31 -0
- package/dist/image-generation-BzpZ1mKb.js +238 -0
- package/dist/image-generation-core-CuevThln.js +27 -0
- package/dist/image-generation-core.auth.runtime-1wgCt7at.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-B6iIjJLr.js +147 -0
- package/dist/image-generation-provider-Bbb_vX0v.js +267 -0
- package/dist/image-generation-provider-L3Zmv5aW.js +76 -0
- package/dist/image-generation-provider-ubAdL00G.js +63 -0
- package/dist/image-generation-runtime-CHNXxjik.js +2 -0
- package/dist/image-runtime-VlOq2Fe6.js +9 -0
- package/dist/inbound-media-transcript-C2MwP89S.js +311 -0
- package/dist/inbound-reply-dispatch-whxkV18b.js +133 -0
- package/dist/index.js +1 -1
- package/dist/init-SuR7WHa3.js +59 -0
- package/dist/interactive-forms-DNLizvTC.js +169 -0
- package/dist/internal-OxPD6CHI.js +396 -0
- package/dist/isolated-agent-DT0SKLTE.js +2 -0
- package/dist/isolated-agent-pWPH4qII.js +1074 -0
- package/dist/lifecycle-BAU_7fL1.js +571 -0
- package/dist/lifecycle-lqKju31O.js +349 -0
- package/dist/lifecycle-nT_bs6pI.js +2 -0
- package/dist/lifecycle.runtime-D_sppFWC.js +2 -0
- package/dist/lifecycle.runtime.js +1 -1
- package/dist/link-understanding/apply.runtime.js +3 -3
- package/dist/list-C_Hzjr3u.js +2 -0
- package/dist/list-Dlg-LLA9.js +131 -0
- package/dist/list-models-tool-B4S4NKLI.js +48 -0
- package/dist/list.list-command-C4wt19v3.js +376 -0
- package/dist/list.model-row-Ducy4CBb.js +39 -0
- package/dist/list.probe-zDhtggIO.js +433 -0
- package/dist/list.registry-load-B7nLO19v.js +132 -0
- package/dist/list.row-sources-BURxlNet.js +394 -0
- package/dist/list.status-command-D1tVs7H0.js +620 -0
- package/dist/live-auth-keys-CW83C11V.js +110 -0
- package/dist/live-model-switch-RQZeqIw4.js +323 -0
- package/dist/llm-slug-generator-BFMJNZB3.js +78 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/load-config-CTQyJiWO.js +28 -0
- package/dist/logs-cli-DZXjVy76.js +321 -0
- package/dist/logs-cli.runtime-nxFRs3XT.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/main-session-restart-recovery-Ccn-LO3I.js +257 -0
- package/dist/managed-image-attachments-BA-G7A0r.js +729 -0
- package/dist/managed-image-attachments-CKHBM5bq.js +2 -0
- package/dist/manager-Cg6XoC5Z.js +3183 -0
- package/dist/manager-DqrEd_hG.js +2 -0
- package/dist/manager-ExnEJSF8.js +2042 -0
- package/dist/mcp/plugin-tools-serve.js +1 -1
- package/dist/mcp-cli-BfSXD_Op.js +756 -0
- package/dist/mcp-http-DEDOVfUA.js +530 -0
- package/dist/mcp-http-DTZmSqel.js +2 -0
- package/dist/media-gateway-BnCVjTwx.js +360 -0
- package/dist/media-runtime-5rmeWu2r.js +356 -0
- package/dist/media-understanding/apply.runtime.js +1 -1
- package/dist/media-understanding-BBnoPSqs.js +85 -0
- package/dist/media-understanding-provider-C02sMxYc.js +21 -0
- package/dist/media-understanding-provider-CkJe_kVb.js +21 -0
- package/dist/media-understanding-runtime-BvrgZCzG.js +2 -0
- package/dist/media-upload-http-BUfjZvHn.js +179 -0
- package/dist/memory-C4SkryP3.js +413 -0
- package/dist/memory-core-host-engine-embeddings-tnNYL2vA.js +561 -0
- package/dist/memory-core-host-engine-foundation-BNCXAAh9.js +15 -0
- package/dist/memory-core-host-engine-qmd-DlZynYEX.js +2 -0
- package/dist/memory-core-host-engine-storage-DNXRi0KH.js +2 -0
- package/dist/memory-core-host-runtime-cli-v5o0XDAS.js +10 -0
- package/dist/memory-core-host-runtime-core-DbW6x9pU.js +12 -0
- package/dist/memory-core-host-runtime-files-3RGYYxX6.js +4 -0
- package/dist/memory-embedding-adapter-DzHkeS6F.js +49 -0
- package/dist/memory-host-core-DYi4UGxg.js +2 -0
- package/dist/message-action-runner-BMUqmJWh.js +2 -0
- package/dist/message-action-runner-DGNp3YPO.js +1660 -0
- package/dist/message-handler-BZ_eGIRX.js +1498 -0
- package/dist/message.gateway.runtime-Box2-fow.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/minimax-vlm-clGppg5F.js +298 -0
- package/dist/model-CDUofMMB.js +3 -0
- package/dist/model-DWa_tkFj.js +817 -0
- package/dist/model-auth-CPQax0VU.js +5 -0
- package/dist/model-auth-KK0Zk2X_.js +577 -0
- package/dist/model-auth-label-CUy9UC9b.js +56 -0
- package/dist/model-catalog-Bpl-Da9O.js +180 -0
- package/dist/model-catalog-DALdHE7h.js +3 -0
- package/dist/model-catalog-visibility-rdn-1QF8.js +31 -0
- package/dist/model-context-tokens-BOvUkxyU.js +493 -0
- package/dist/model-fallback-6kEcY1vl.js +723 -0
- package/dist/model-picker-BAcaVEH_.js +895 -0
- package/dist/model-picker-Cpn2zP8A.js +3 -0
- package/dist/model-picker.runtime-BS8b4cko.js +48 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-pricing-cache-DsyQPUCH.js +2 -0
- package/dist/model-pricing-cache-Z1AjgjKd.js +839 -0
- package/dist/model-selection-B2AtpGAZ.js +195 -0
- package/dist/model-selection-DVPpXK7W.js +6 -0
- package/dist/model-selection-DtgEYaE5.js +208 -0
- package/dist/model-selection-cli-C8YlaFD4.js +122 -0
- package/dist/model-selection-directive-D2HbKvM1.js +249 -0
- package/dist/model-selection-shared-DmqyFdUW.js +475 -0
- package/dist/model-selection-shared-E5oZWLqQ.js +2 -0
- package/dist/model-selection.runtime-OXPPA1eG.js +7 -0
- package/dist/model-selection.runtime.js +1 -1
- package/dist/model-thinking-default-Dm335GAT.js +32 -0
- package/dist/models-cli-D90ebKSq.js +138 -0
- package/dist/models-config-B8UUDL76.js +2 -0
- package/dist/models-config-CG9zwrQR.js +247 -0
- package/dist/models-http-B9nlQP77.js +94 -0
- package/dist/monitor-BJgFeWKi.js +60 -0
- package/dist/monitor.account-DYtFbrvB.js +4759 -0
- package/dist/native-hook-relay-DAzsgOGY.js +1067 -0
- package/dist/node-cli-C40bBteu.js +2497 -0
- package/dist/nodes-cli-CEI0DeyC.js +1323 -0
- package/dist/nodes-utils-Dy2tXrZQ.js +75 -0
- package/dist/nodes.helpers-CqB11vNE.js +25 -0
- package/dist/oauth-26fADzKJ.js +142 -0
- package/dist/oauth-Bu9bwEUv.js +2 -0
- package/dist/onboard-DrHSMJ-H.js +766 -0
- package/dist/onboard-custom-BONtltYX.js +276 -0
- package/dist/onboard-custom-BTo_gtEu.js +3 -0
- package/dist/onboard-custom-config-t6yjgdKQ.js +414 -0
- package/dist/onboard-helpers-DR_jq_kl.js +6 -0
- package/dist/onboard-helpers-xlq1SWGv.js +206 -0
- package/dist/onboard-remote-BS9ivPZW.js +208 -0
- package/dist/onboard-remote-ClwNBvy2.js +2 -0
- package/dist/onboard-skills-CJt18jHT.js +2 -0
- package/dist/onboard-skills-D0AYu7nG.js +135 -0
- package/dist/openai-http-DrsVVBTz.js +508 -0
- package/dist/openclaw-runtime-CmSQjT4-.js +31 -0
- package/dist/openclaw-runtime-config-D6R1-lqp.js +2 -0
- package/dist/openclaw-runtime-io-DOb3fbC8.js +2 -0
- package/dist/openclaw-runtime-memory-DbVClZye.js +2 -0
- package/dist/openclaw-runtime-session-6aLOsEB0.js +2 -0
- package/dist/openclaw-tools-Bfn8sg2C.js +9909 -0
- package/dist/openclaw-tools.runtime-DQlIV1fq.js +2 -0
- package/dist/openclaw-tools.runtime.js +1 -1
- package/dist/openresponses-http-DA4vWEm2.js +1134 -0
- package/dist/operations-Bo1olN2E.js +805 -0
- package/dist/operator-approvals-client-CWYvhKkt.js +90 -0
- package/dist/overview-CYyleDn9.js +274 -0
- package/dist/overview-D_JS3Aiz.js +2 -0
- package/dist/persistent-bindings.lifecycle-CE6Q-6oM.js +2 -0
- package/dist/persistent-bindings.lifecycle-DjlEMtSY.js +85 -0
- package/dist/pi-embedded-BKxzncWj.js +2816 -0
- package/dist/pi-embedded-CX0sOsLC.js +4 -0
- package/dist/pi-embedded.runtime-Cb8fr4UF.js +4 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-model-discovery-DZiEkjiR.js +259 -0
- package/dist/pi-tool-definition-adapter-Dbx4BCRv.js +249 -0
- package/dist/pi-tools-CLmkhkJD.js +1948 -0
- package/dist/pi-tools.before-tool-call-Bb0HucO6.js +2 -0
- package/dist/pi-tools.before-tool-call-DHu4ETOi.js +675 -0
- package/dist/plugin-approval-QteUE2bF.js +113 -0
- package/dist/plugin-registration-jOLUIkNV.js +486 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
- package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-harness-runtime.js +9 -9
- package/dist/plugin-sdk/agent-harness.js +10 -10
- package/dist/plugin-sdk/agent-runtime-test-contracts.js +1 -1
- package/dist/plugin-sdk/agent-runtime.js +9 -9
- package/dist/plugin-sdk/approval-gateway-runtime.js +1 -1
- package/dist/plugin-sdk/approval-handler-runtime.js +2 -2
- package/dist/plugin-sdk/approval-runtime.js +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +1 -1
- package/dist/plugin-sdk/channel-message-runtime.js +1 -1
- package/dist/plugin-sdk/channel-test-helpers.js +1 -1
- package/dist/plugin-sdk/command-auth-native.js +2 -2
- package/dist/plugin-sdk/command-auth.js +5 -5
- package/dist/plugin-sdk/command-primitives-runtime.js +2 -2
- package/dist/plugin-sdk/command-status-runtime.js +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/config-mutation.js +1 -1
- package/dist/plugin-sdk/config-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +2 -2
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +6 -6
- package/dist/plugin-sdk/image-generation-core.js +2 -2
- package/dist/plugin-sdk/image-generation-runtime.js +2 -2
- package/dist/plugin-sdk/image-generation.js +1 -1
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +6 -6
- package/dist/plugin-sdk/media-understanding-runtime.js +2 -2
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +1 -1
- package/dist/plugin-sdk/memory-core-host-engine-qmd.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-storage.js +4 -4
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +1 -1
- package/dist/plugin-sdk/memory-core-host-runtime-files.js +3 -3
- package/dist/plugin-sdk/memory-host-core.js +1 -1
- package/dist/plugin-sdk/memory-host-files.js +3 -3
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/native-command-registry.js +1 -1
- package/dist/plugin-sdk/plugin-test-contracts.js +1 -1
- package/dist/plugin-sdk/plugin-test-runtime.js +3 -3
- package/dist/plugin-sdk/provider-auth-runtime.js +3 -3
- package/dist/plugin-sdk/provider-test-contracts.js +1 -1
- package/dist/plugin-sdk/realtime-transcription.js +1 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +6 -6
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +1 -1
- package/dist/plugin-sdk/session-visibility.js +1 -1
- package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +1 -1
- package/dist/plugin-sdk/src/agents/openclaw-tools.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/skills-status.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/tools/ask-user-tool.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-report-style.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-report.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-report.runtime.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-tool.d.ts +18 -0
- package/dist/plugin-sdk/src/gateway/interactive-form-manager.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/protocol/client-info.d.ts +1 -0
- package/dist/plugin-sdk/src/gateway/protocol/index.d.ts +42 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/interactive-forms.d.ts +70 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/protocol-schemas.d.ts +69 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/types.d.ts +4 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema.d.ts +1 -0
- package/dist/plugin-sdk/src/gateway/server-methods/shared-types.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/interactive-forms.d.ts +63 -0
- package/dist/plugin-sdk/test-env.js +1 -1
- package/dist/plugin-sdk/testing.js +8 -8
- package/dist/plugin-sdk/video-generation-core.js +2 -2
- package/dist/plugin-sdk/video-generation-runtime.js +2 -2
- package/dist/plugins/runtime/index.js +15 -15
- package/dist/plugins-http-CoQyqjZ5.js +75 -0
- package/dist/postinstall-inventory.json +602 -598
- package/dist/prepare.runtime-B4teIS8G.js +883 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/probe-30VsglD6.js +76 -0
- package/dist/probe-61c-d3F6.js +2 -0
- package/dist/probe-CMCtURPn.js +287 -0
- package/dist/program-BC_U5VaT.js +122 -0
- package/dist/protocol-v53LSe8d.js +3201 -0
- package/dist/provider-adapters-DkxncUMd.js +115 -0
- package/dist/provider-auth-choice-WhHZK5By.js +283 -0
- package/dist/provider-auth-choice-helpers-BVpFhm5D.js +77 -0
- package/dist/provider-auth-choice-preference-B3GFruOr.js +26 -0
- package/dist/provider-auth-choice.runtime-B80_xAok.js +2 -0
- package/dist/provider-auth-choice.runtime-O-zMFiUZ.js +18 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-C43nZfT5.js +2 -0
- package/dist/provider-auth-guidance-DJjA7Pcr.js +34 -0
- package/dist/provider-auth-runtime-Cyr6QmwA.js +148 -0
- package/dist/provider-dispatcher-B_xRt9lM.js +22 -0
- package/dist/provider-dispatcher.runtime.js +1 -1
- package/dist/provider-registry-BiciHShM.js +61 -0
- package/dist/provider-registry-CspgCD0S.js +55 -0
- package/dist/provider-usage-BMdGBAR9.js +413 -0
- package/dist/provider-usage-CBwSFIuM.js +3 -0
- package/dist/provider-wizard-3ovK4ECX.js +181 -0
- package/dist/qmd-manager-CsLQg_gk.js +1987 -0
- package/dist/qr-cli-CjbKxVVi.js +2 -0
- package/dist/qr-cli-DxAYYqX1.js +372 -0
- package/dist/read-file-D_MGDFxH.js +146 -0
- package/dist/realtime-handler-D2sU6asa.js +1054 -0
- package/dist/realtime-transcription-DM1QjcpC.js +305 -0
- package/dist/realtime-transcription-provider-Cny9FnL2.js +172 -0
- package/dist/realtime-transcription-provider-QGxJ-b83.js +186 -0
- package/dist/realtime-transcription.runtime-jDAikSRg.js +3 -0
- package/dist/realtime-transcription.runtime.js +1 -1
- package/dist/register-service-commands-zJjXUK82.js +77 -0
- package/dist/register.agent-fbS5Dgq9.js +298 -0
- package/dist/register.configure-CB3m2f_2.js +15 -0
- package/dist/register.crestodian-BvqLlWX1.js +24 -0
- package/dist/register.maintenance-C5cHiZnY.js +451 -0
- package/dist/register.message-1xO2kihH.js +370 -0
- package/dist/register.onboard-D4VyfpX7.js +111 -0
- package/dist/register.runtime-2ZVwxUi9.js +109 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-CqxyXV-6.js +166 -0
- package/dist/register.status-health-sessions-Dbq9wa_5.js +1235 -0
- package/dist/register.subclis-BsTS3376.js +3 -0
- package/dist/register.subclis-core-wUpqGDkr.js +265 -0
- package/dist/register.subclis-sEf3UoOg.js +31 -0
- package/dist/rem-harness-DVtOzxK3.js +648 -0
- package/dist/reply.runtime-8i9FOjXs.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-w39XoPiC.js +97 -0
- package/dist/restart-health-BEUZoMXq.js +2 -0
- package/dist/restart-health-C0QhPs8z.js +368 -0
- package/dist/root-help-TajNluDX.js +42 -0
- package/dist/route-D72866zw.js +424 -0
- package/dist/rpc.runtime-dNQrEfy5.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-7Cebu6HF.js +925 -0
- package/dist/run-BmzQPF2_.js +2 -0
- package/dist/run-context.runtime-BwWByRUN.js +2 -0
- package/dist/run-context.runtime.js +1 -1
- package/dist/run-delivery.runtime.js +1 -1
- package/dist/run-embedded.runtime-B4Qdh8gd.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-DyExO025.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime-MsGezSB6.js +300 -0
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-model-catalog.runtime-B3_TEyCb.js +2 -0
- package/dist/run-model-catalog.runtime.js +1 -1
- package/dist/run-subagent-registry.runtime-0WOCkstb.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/run-wait-D7GB32SK.js +138 -0
- package/dist/runner-DXM81Lpq.js +1070 -0
- package/dist/runner.entries-BvqWbDBQ.js +644 -0
- package/dist/runtime-Bdk-SHx1.js +438 -0
- package/dist/runtime-CKvNi2Rg.js +5116 -0
- package/dist/runtime-CN1FYkgZ.js +428 -0
- package/dist/runtime-Clf3iYIk.js +150 -0
- package/dist/runtime-OOteZ_Ja.js +2 -0
- package/dist/runtime-VOVfwRob.js +288 -0
- package/dist/runtime-api-B0HVSb1I.js +12 -0
- package/dist/runtime-api-DuT60diB.js +3 -0
- package/dist/runtime-channel-3USN61Wc.js +2 -0
- package/dist/runtime-channel-BZwJ9S19.js +145 -0
- package/dist/runtime-embedded-pi.runtime-BNHi9daL.js +2 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-entry-Chew88I9.js +3324 -0
- package/dist/runtime-internal-C1eh7Kxs.js +2 -0
- package/dist/runtime-model-auth.runtime-CnQfbXQd.js +2 -0
- package/dist/runtime-model-auth.runtime-w7NdkZ7H.js +46 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-options-CS6RgZCw.js +275 -0
- package/dist/runtime-provider-Bvv7lZK4.js +2 -0
- package/dist/runtime-provider-NlzKQ4M6.js +21 -0
- package/dist/runtime-taskflow-DZMvcP_m.js +250 -0
- package/dist/sealseek-registry-CwcFKOQz.js +282 -0
- package/dist/secrets-XEZt9-ux.js +61 -0
- package/dist/secrets-cli-BerUYXuo.js +2108 -0
- package/dist/security-cli-CG5kb4Ce.js +495 -0
- package/dist/selection-BnUSK4X3.js +9151 -0
- package/dist/selection-CiV6du4z.js +2 -0
- package/dist/server-aux-handlers-Cl0FXA7N.js +1070 -0
- package/dist/server-channels-DppUoWsV.js +649 -0
- package/dist/server-chat-C2s2Wqbe.js +555 -0
- package/dist/server-cron-B3LPXQSO.js +2 -0
- package/dist/server-cron-DKJyJGPZ.js +2788 -0
- package/dist/server-maintenance-C68v13CR.js +115 -0
- package/dist/server-methods-Qss6CD_z.js +13812 -0
- package/dist/server-model-catalog-BMm27vxL.js +2 -0
- package/dist/server-model-catalog-CHKZfmku.js +73 -0
- package/dist/server-node-events-Bslvo3lf.js +579 -0
- package/dist/server-plugin-bootstrap-DrWG1doE.js +69 -0
- package/dist/server-plugins-D8rj2c_w.js +385 -0
- package/dist/server-reload-handlers--rFjcOBl.js +606 -0
- package/dist/server-restart-sentinel-C1QGvsi3.js +725 -0
- package/dist/server-restart-sentinel-DsDdxql8.js +2 -0
- package/dist/server-runtime-services-BUyjirC2.js +2 -0
- package/dist/server-runtime-services-DOFaVaWk.js +266 -0
- package/dist/server-runtime-subscriptions-agRCStZd.js +59 -0
- package/dist/server-session-events-CsaxjsQJ.js +209 -0
- package/dist/server-session-key-AODe2CHI.js +45 -0
- package/dist/server-session-key-ZZpBJj6H.js +2 -0
- package/dist/server-startup-early-dYuVnKj4.js +86 -0
- package/dist/server-startup-log-DkSrpc5R.js +74 -0
- package/dist/server-startup-plugins-Cu-YGwHA.js +116 -0
- package/dist/server-startup-post-attach-BdJi-ZDR.js +525 -0
- package/dist/server-startup-sealseek-models-CRb2NI3A.js +90 -0
- package/dist/server-ws-runtime-C9QYCOkw.js +387 -0
- package/dist/server.impl-D_dSD_SQ.js +2473 -0
- package/dist/service-BQgA35Dv.js +677 -0
- package/dist/session-async-task-status-C07Ccb1v.js +42 -0
- package/dist/session-cost-usage-DRfmvigb.js +1299 -0
- package/dist/session-kill-http-ZAHeWJcS.js +111 -0
- package/dist/session-reset-model.runtime-DJz8Sjfs.js +143 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-B1MF9mjl.js +469 -0
- package/dist/session-status.runtime-DO1eFzYB.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-store-Bk2pm_DT.js +174 -0
- package/dist/session-store.runtime-Cp5Qq9oQ.js +2 -0
- package/dist/session-store.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-Cd0Xqxxn.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-utils-_3SA1ci0.js +1272 -0
- package/dist/session-visibility-DuzOtA66.js +147 -0
- package/dist/sessions-CrcHxmPr.js +2 -0
- package/dist/sessions-DQrZ45LY.js +404 -0
- package/dist/sessions-helpers-B5kAnTEi.js +326 -0
- package/dist/sessions-history-http-BT9_aMRm.js +225 -0
- package/dist/sessions-patch-CatnzzD1.js +340 -0
- package/dist/sessions-resolve-CDbqB5ko.js +177 -0
- package/dist/sessions.runtime-ByA9Bpbx.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/set-BQN0TOhz.js +17 -0
- package/dist/set-image-C3DcQJts.js +17 -0
- package/dist/setup-CvsUFHtJ.js +569 -0
- package/dist/setup-UMfOC_oH.js +2 -0
- package/dist/setup.finalize-DyM9FxWY.js +488 -0
- package/dist/setup.gateway-config-BtNDm2kt.js +263 -0
- package/dist/setup.migration-import-BX-_pFNT.js +199 -0
- package/dist/setup.migration-import-D4AiKt25.js +2 -0
- package/dist/shared-BjzB1Ctf.js +71 -0
- package/dist/shared-Bnuzsd6G.js +147 -0
- package/dist/shared-C-R8jCgX.js +5 -0
- package/dist/shared-DskVitjo.js +199 -0
- package/dist/simple-completion-runtime-C9jhcpu7.js +165 -0
- package/dist/speech-core-D72VYon9.js +94 -0
- package/dist/startup-context-DbZyaWZ5.js +312 -0
- package/dist/status-B6zKQS8f.js +214 -0
- package/dist/status-BXI95zqO.js +213 -0
- package/dist/status-C2vui93y.js +4 -0
- package/dist/status-CX02JGzq.js +3 -0
- package/dist/status-CkGtCoyK.js +66 -0
- package/dist/status-DSutRVkY.js +2 -0
- package/dist/status-all-y7loRsX4.js +498 -0
- package/dist/status-json-command-Dqeo5Ape.js +84 -0
- package/dist/status-json-ktw1CvE1.js +14 -0
- package/dist/status-message-BYuis_EJ.js +461 -0
- package/dist/status-message.runtime-BZxp6hL7.js +6 -0
- package/dist/status-message.runtime.js +1 -1
- package/dist/status-runtime-shared-HISH1W4p.js +263 -0
- package/dist/status-subagents.runtime-Dp0ilK6g.js +18 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-4o62i0kt.js +260 -0
- package/dist/status-y7a2jS2L.js +2 -0
- package/dist/status.command-CCvKd2ws.js +390 -0
- package/dist/status.command-Cbal73Q9.js +2 -0
- package/dist/status.gateway-connection.runtime-ClQ5h-QU.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gather-BXj8GvUP.js +348 -0
- package/dist/status.gather-BdrQdcKQ.js +2 -0
- package/dist/status.runtime-DUufsosW.js +2 -0
- package/dist/status.runtime-Dkb1mzWr.js +2 -0
- package/dist/status.scan-BhYXoE9k.js +68 -0
- package/dist/status.scan-overview-DwkbrLol.js +444 -0
- package/dist/status.scan.fast-json-CPOnozeC.js +2 -0
- package/dist/status.scan.fast-json-DbnHgkaE.js +132 -0
- package/dist/status.summary-MBl3t3jh.js +2 -0
- package/dist/status.summary-VD3ScnY0.js +222 -0
- package/dist/stored-model-override-DWuK2sy9.js +40 -0
- package/dist/subagent-announce-BnLwiESs.js +346 -0
- package/dist/subagent-announce-delivery-lhhjpy2U.js +919 -0
- package/dist/subagent-control-7neE98nS.js +507 -0
- package/dist/subagent-followup.runtime-ChcKZ1EC.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-hooks-B97pBp56.js +2 -0
- package/dist/subagent-hooks-IyMYuO8f.js +222 -0
- package/dist/subagent-hooks-api-FqP0y6LP.js +23 -0
- package/dist/subagent-orphan-recovery-CO2VwwpV.js +350 -0
- package/dist/subagent-registry-BoHx09Iy.js +3 -0
- package/dist/subagent-registry-CLwWZpsB.js +1909 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-session-cleanup-DqLvxckd.js +522 -0
- package/dist/subagent-spawn-SmQI3g7i.js +1142 -0
- package/dist/system-cli-JuQsgUnV.js +59 -0
- package/dist/targets-D9lvz5SH.js +67 -0
- package/dist/task-executor-Cb3PO1x0.js +349 -0
- package/dist/task-flow-registry.audit-DutSlCJ-.js +155 -0
- package/dist/task-owner-access-CVoyn2Uq.js +74 -0
- package/dist/task-registry-DxtFKSUD.js +2464 -0
- package/dist/task-registry-control.runtime.js +2 -2
- package/dist/task-registry-delivery-runtime-3fQMAUA2.js +2 -0
- package/dist/task-registry.maintenance-CZPCVe1A.js +676 -0
- package/dist/task-registry.maintenance-DShSMN23.js +2 -0
- package/dist/task-status-access-B5PhFyDw.js +17 -0
- package/dist/tasks-json-F_nTIklp.js +117 -0
- package/dist/testing-COFqefCl.js +161 -0
- package/dist/text-report-BFDRWFUd.js +609 -0
- package/dist/thread-bindings-DHyLTmgy.js +228 -0
- package/dist/tool-resolution-DTqKjjJW.js +104 -0
- package/dist/tool-result-middleware-CTGdLav7.js +334 -0
- package/dist/tools-Bq37jvD0.js +509 -0
- package/dist/tools-effective-inventory-Coy6UgWv.js +163 -0
- package/dist/tools-invoke-http-DrmuXyMK.js +66 -0
- package/dist/tools-invoke-shared-BBIfAXg8.js +201 -0
- package/dist/tools.runtime-DxvvcCUk.js +5 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/tui-CSplOzFu.js +2 -0
- package/dist/tui-S_SeH5Le.js +4878 -0
- package/dist/tui-backend-BF662T4M.js +256 -0
- package/dist/tui-cli-B2MAtev9.js +36 -0
- package/dist/update-cli-C5PxC9HG.js +2685 -0
- package/dist/usage-format-DyYX70y8.js +2 -0
- package/dist/usage-format-y45qhV5r.js +212 -0
- package/dist/video-generation-core-D9TX37yI.js +6 -0
- package/dist/video-generation-provider-C8kZ-maB.js +287 -0
- package/dist/video-generation-provider-C8opd5tE.js +78 -0
- package/dist/video-generation-provider-CEB64hdi.js +293 -0
- package/dist/video-generation-provider-CRm_Ei_f.js +104 -0
- package/dist/video-generation-provider-DHZmW5tJ.js +357 -0
- package/dist/video-generation-runtime-Dvc_8QmA.js +2 -0
- package/dist/video-generation-task-status-SfE7l7sH.js +87 -0
- package/dist/workflow-runtime-CM1GKSIl.js +484 -0
- package/package.json +1 -1
- package/dist/abort-zKXrjZuY.js +0 -201
- package/dist/abort.runtime-DUTwa_yG.js +0 -2
- package/dist/acp-cli-9sRoXHPu.js +0 -2095
- package/dist/acp-spawn-Cq0ud7zc.js +0 -2
- package/dist/acp-spawn-pz5eDzb4.js +0 -1171
- package/dist/acp-stateful-target-driver-DrV5zX0X.js +0 -89
- package/dist/action-agents-BxBFX35j.js +0 -67
- package/dist/action-focus-BJaUagJe.js +0 -135
- package/dist/action-help-atn_WvW-.js +0 -7
- package/dist/action-info-D564Qu5S.js +0 -101
- package/dist/action-kill-CH5h-_5o.js +0 -33
- package/dist/action-list-Dis5deZn.js +0 -21
- package/dist/action-log-CK-zl7kc.js +0 -30
- package/dist/action-send-D_WBPH7W.js +0 -39
- package/dist/action-spawn-B6zRghpZ.js +0 -47
- package/dist/action-unfocus-DI-mOJAP.js +0 -29
- package/dist/agent-DcmqMvx-.js +0 -2
- package/dist/agent-DuwXMAre.js +0 -3
- package/dist/agent-command-DxTYK0X2.js +0 -994
- package/dist/agent-harness-runtime-R3kfP_es.js +0 -139
- package/dist/agent-runner-utils-CU563so0.js +0 -257
- package/dist/agent-runner.runtime-CnPjY4pG.js +0 -4118
- package/dist/agent-runtime-DPOuyTUl.js +0 -199
- package/dist/agent-runtime-label-B9R0cNiR.js +0 -30
- package/dist/agents-BbvuYHYa.js +0 -740
- package/dist/agents-DFe0iUt32.js +0 -6
- package/dist/agents.commands.add-CyijxBe8.js +0 -2
- package/dist/agents.commands.add-D90JPsrB.js +0 -290
- package/dist/aliases-BkLrJi3b.js +0 -96
- package/dist/api-90fmdAdT.js +0 -2
- package/dist/api-BY_E5Di2.js +0 -2
- package/dist/api-key-rotation-Ck0ckKmY.js +0 -48
- package/dist/app-registration-OKUKJ7be.js +0 -186
- package/dist/apply-NZ7KV8nv.js +0 -461
- package/dist/approval-gateway-runtime-BgbW7rHY.js +0 -29
- package/dist/approval-handler-runtime-BvFOD6T6.js +0 -440
- package/dist/approval-native-runtime-kJeuHfXM.js +0 -544
- package/dist/approval-shared-YXcF0azT.js +0 -203
- package/dist/assistant-CRXlyvt-.js +0 -259
- package/dist/attempt-execution-Dz-0OJRx.js +0 -465
- package/dist/attempt-execution.helpers-Dz7-wwvj.js +0 -256
- package/dist/attempt-execution.runtime-F8RfdgO4.js +0 -3
- package/dist/attempt.prompt-helpers-XXf3eWNt.js +0 -363
- package/dist/attempt.tool-run-context-CDwxjyWF.js +0 -569
- package/dist/audio-preflight.runtime-BA8h-K0f.js +0 -7
- package/dist/audit-C6_pvgqn.js +0 -955
- package/dist/audit.nondeep.runtime-DZGBZK9b.js +0 -1268
- package/dist/audit.runtime-7_aML6rO.js +0 -7
- package/dist/auth-choice-CnnJynzv.js +0 -359
- package/dist/auth-choice-Cnn_-7rB.js +0 -90
- package/dist/auth-choice-Ddcj4FUB.js +0 -3
- package/dist/auth-choice.apply.api-providers-BY1yT_Un.js +0 -2
- package/dist/auth-choice.apply.api-providers-tgf-XmKz.js +0 -34
- package/dist/auth-choice.plugin-providers.runtime-BIi73nFD.js +0 -11
- package/dist/bash-tools-CnAsui6Q.js +0 -2967
- package/dist/bash-tools-nEBAutlQ.js +0 -3
- package/dist/binding-routing-B4G8qEvR.js +0 -105
- package/dist/binding-targets-DXqUi2lL.js +0 -121
- package/dist/btw-command-Bff9E79W.js +0 -18
- package/dist/build-BZK3WCJK.js +0 -196
- package/dist/call-C0lqBJwe.js +0 -422
- package/dist/call-Dj8Upk92.js +0 -3
- package/dist/call.runtime-C96Kpbu5.js +0 -2
- package/dist/capability-cli-Bx6m2XPD.js +0 -1511
- package/dist/channel-CyAVvZWp.js +0 -1719
- package/dist/channel-core-Cx4UY1Ju.js +0 -5
- package/dist/channel.runtime-NJipG_mA.js +0 -704
- package/dist/channels-BkDHC6xj.js +0 -961
- package/dist/channels-cli-BPsGcxLz.js +0 -311
- package/dist/channels.cn-DPYeA9u6.js +0 -940
- package/dist/chat-BVlMsL0a.js +0 -3199
- package/dist/clawbot-cli-Bvbs01HM.js +0 -9
- package/dist/cli-B9OJLWsE.js +0 -4549
- package/dist/cli-BTy1nGlR.js +0 -2
- package/dist/cli-BYInIl4C.js +0 -1392
- package/dist/cli-JhobWrep.js +0 -2
- package/dist/cli-QkCBfwai.js +0 -87
- package/dist/cli-compaction-yV2c3771.js +0 -153
- package/dist/cli-fCkTHcjZ.js +0 -76
- package/dist/cli-registry-loader-BvqF2eAS.js +0 -185
- package/dist/cli-registry-loader-vKBebFJn.js +0 -2
- package/dist/cli-runner-BtCYtvnp.js +0 -2
- package/dist/cli-runner-DaB_Ia-I.js +0 -302
- package/dist/cli-runner.runtime-BgJ6mtr5.js +0 -3
- package/dist/cli-runner.runtime-CLQYboQ9.js +0 -4
- package/dist/cli-session-CR5_0pqK.js +0 -106
- package/dist/cli-session-history-yQp04oep.js +0 -368
- package/dist/cli.runtime-DgfxYIoY.js +0 -1254
- package/dist/client-C1CYiPsw.js +0 -679
- package/dist/client-CuJHpJl8.js +0 -2
- package/dist/command-config-resolution-CbKl-uru.js +0 -2
- package/dist/command-config-resolution-D_6tfcBb.js +0 -23
- package/dist/command-config-resolution.runtime-CNI_DIKC.js +0 -2
- package/dist/command-primitives-runtime-CN8LjI7k.js +0 -3
- package/dist/command-registry-BGiqdqme.js +0 -9
- package/dist/command-registry-XThRi9T2.js +0 -4
- package/dist/command-registry-core-Bc4YoCa9.js +0 -110
- package/dist/command-secret-gateway-Bo_7t03e.js +0 -428
- package/dist/command-status-builders-CdjpDshZ.js +0 -147
- package/dist/command-status.runtime-BK63wc1E.js +0 -90
- package/dist/commands-acp-Q-uqmN9K.js +0 -74
- package/dist/commands-compact.runtime-Cbc0WnOm.js +0 -10
- package/dist/commands-handlers.runtime-CJrlSyrY.js +0 -5058
- package/dist/commands-models-B864KuCn.js +0 -338
- package/dist/commands-registry-C7esUJQ7.js +0 -194
- package/dist/commands-registry.runtime-CV88VCOj.js +0 -4
- package/dist/commands-status-Co-r0per.js +0 -16
- package/dist/commands-status.runtime-DLEq2Hwv.js +0 -3
- package/dist/commands-subagents-control.runtime-BeqO2jve.js +0 -3
- package/dist/commands-subagents-control.runtime-Bk6p3stR.js +0 -2
- package/dist/commands-system-prompt-B7wwiDf8.js +0 -165
- package/dist/commands-system-prompt-DogxeqiW.js +0 -2
- package/dist/commands.runtime-erQ43Aj5.js +0 -176
- package/dist/compact-BYFfQVU6.js +0 -1073
- package/dist/compact.runtime-CZSJ4BLi.js +0 -12
- package/dist/compaction-successor-transcript-LKsMnD7V.js +0 -5373
- package/dist/completion-cli-BaDvvqHE.js +0 -315
- package/dist/config-cli-Wg0Vobui.js +0 -1302
- package/dist/configure-BwIzwUJH.js +0 -2
- package/dist/configure-Dkd8Zwz5.js +0 -1212
- package/dist/consequential-action-policy-BfI0ut4F.js +0 -379
- package/dist/context-BBbNAsHL.js +0 -2
- package/dist/context-BosCvfDJ.js +0 -292
- package/dist/context-engine-maintenance-CE_CThm-.js +0 -433
- package/dist/control-ui/assets/agents-DC_5txw_.js +0 -1002
- package/dist/control-ui/assets/channels-AJLOs5oe.js +0 -349
- package/dist/control-ui/assets/channels.cn-D5v5wsPg.js +0 -129
- package/dist/control-ui/assets/cron-DmziEgHd.js +0 -963
- package/dist/control-ui/assets/cron-task-list-Dfm2-ySO.js +0 -226
- package/dist/control-ui/assets/debug-DlnkxYl0.js +0 -96
- package/dist/control-ui/assets/filespace-BCu0fTNu.js +0 -116
- package/dist/control-ui/assets/index-MHKY7bQL.js +0 -9370
- package/dist/control-ui/assets/instances-xV2DU6G8.js +0 -57
- package/dist/control-ui/assets/nodes-DP_5aMTx.js +0 -436
- package/dist/control-ui/assets/pdf-D5BGTI_0.js +0 -55
- package/dist/control-ui/assets/pdf.worker-Bbpj_6DB.js +0 -49
- package/dist/control-ui/assets/sessions-BG9soyGM.js +0 -365
- package/dist/control-ui/assets/skill-center-uzjYjY0s.js +0 -723
- package/dist/control-ui/assets/skill-publish-CIYWYEBY.js +0 -175
- package/dist/control-ui/assets/skills-Cfaa_Ij2.js +0 -314
- package/dist/control-ui/assets/store-DLzVZn7l.js +0 -2
- package/dist/control-ui/assets/workspace-browser-luaBMU4O.js +0 -348
- package/dist/control-ui-D8T2n6cn.js +0 -760
- package/dist/conversation-label-generator-Cvojck51.js +0 -55
- package/dist/conversation-runtime-D1bGN5De.js +0 -31
- package/dist/core-DGZKL3b-.js +0 -282
- package/dist/create-Bt9bYaaD.js +0 -109
- package/dist/create-DtxH8RKh.js +0 -2
- package/dist/crestodian-CXeJCSR1.js +0 -55
- package/dist/cron-cli-Crpinyuc.js +0 -777
- package/dist/daemon-cli-sehfAFBR.js +0 -12
- package/dist/defaults-CiQ6K4YI.js +0 -3
- package/dist/defaults-q_0O8naH.js +0 -105
- package/dist/defaults.constants-DRE2UDqi.js +0 -65
- package/dist/detached-task-runtime-CzcBwKkt.js +0 -83
- package/dist/dev-C4qeD36y.js +0 -97
- package/dist/devices-cli-BxphmGjs.js +0 -586
- package/dist/diagnostics-D2qggpIp.js +0 -168
- package/dist/dialogue-BBg0k7_Q.js +0 -37
- package/dist/direct-dm-DaxWMpA9.js +0 -64
- package/dist/directive-handling.defaults-DW46N_vl.js +0 -20
- package/dist/directive-handling.fast-lane-BV5QbCSy.js +0 -68
- package/dist/directive-handling.impl-B9elE4On.js +0 -2
- package/dist/directive-handling.impl-GvIfhwNc.js +0 -712
- package/dist/directive-handling.model-selection-BtDXXnyk.js +0 -116
- package/dist/directive-handling.persist.runtime-BzGJ5D3F.js +0 -219
- package/dist/dispatch-C4rsP1iH.js +0 -1364
- package/dist/dispatch-acp-manager.runtime-ChjCjAzp.js +0 -3
- package/dist/dispatch-acp-media.runtime-DrOrfbQ0.js +0 -4
- package/dist/dispatch-acp-pQ-BvfTB.js +0 -1084
- package/dist/dispatch-acp-transcript.runtime-Djvs5Nkj.js +0 -41
- package/dist/dispatch-acp.runtime-CngWSumE.js +0 -18
- package/dist/doctor-BQ1d1ZID.js +0 -6
- package/dist/doctor-DyTR-EDB.js +0 -2
- package/dist/doctor-auth-TYaxh5Wu.js +0 -172
- package/dist/doctor-device-pairing-9UhfR1oh.js +0 -321
- package/dist/doctor-gateway-daemon-flow-DsDGbfYL.js +0 -305
- package/dist/doctor-gateway-health-DNS1i014.js +0 -78
- package/dist/doctor-health-BWcHLe-d.js +0 -61
- package/dist/doctor-health-contributions-Cg1q2Ucy.js +0 -582
- package/dist/doctor-memory-search-EC1AZFjq.js +0 -376
- package/dist/doctor-prompter-DunzPa1H.js +0 -58
- package/dist/doctor-state-integrity-J-IfCmdx.js +0 -1120
- package/dist/doctor-workspace-status-Dn9cx2TB.js +0 -76
- package/dist/dreaming-DDh5E1-E.js +0 -504
- package/dist/dreaming-command-DLAqDc5a.js +0 -99
- package/dist/dreaming-phases-LX6GDDAW.js +0 -1830
- package/dist/drive-Cuf-8P23.js +0 -2506
- package/dist/embedded-gateway-stub.runtime-C5VNnsSd.js +0 -12
- package/dist/embedding-batch-D2i3-6Hn.js +0 -190
- package/dist/embedding-provider-BxdqkFqw.js +0 -63
- package/dist/embeddings-http-uEM32aJf.js +0 -207
- package/dist/engine-qmd-Ctd1CzYU.js +0 -640
- package/dist/engine-storage-uOryhQc5.js +0 -150
- package/dist/exec-approval-B4jhU-qw.js +0 -297
- package/dist/exec-approvals-cli-CZsh610d.js +0 -500
- package/dist/execute.runtime-NVnWvgb4.js +0 -564
- package/dist/extra-params-nI7XyHL0.js +0 -517
- package/dist/fallbacks-BJsuqdB6.js +0 -31
- package/dist/fallbacks-shared-B1DzSuca.js +0 -111
- package/dist/fast-mode-GTlyCwCp.js +0 -32
- package/dist/gateway-cli-CufcpRTS.js +0 -474
- package/dist/gateway-nbdQRpjt.js +0 -115
- package/dist/gateway-rpc.runtime-ByLQbFpK.js +0 -25
- package/dist/gateway-runtime-3EWJUpf8.js +0 -22
- package/dist/gateway-status-pgGv7ZzC.js +0 -393
- package/dist/get-reply-CV0V0Jqr.js +0 -3492
- package/dist/get-reply-from-config.runtime-ByLftHfa.js +0 -2
- package/dist/health-BPd8qK7P.js +0 -3
- package/dist/health-DjkqpGze.js +0 -549
- package/dist/health-state-GGpT4SVr.js +0 -106
- package/dist/heartbeat-runner-C3fC0JMV.js +0 -1744
- package/dist/heartbeat-runner-Du1zWOoW.js +0 -5
- package/dist/heartbeat-runner.runtime-DqgpuTtk.js +0 -4
- package/dist/helpers-C6LZr6Lg.js +0 -315
- package/dist/hooks-BinO3SLe.js +0 -508
- package/dist/hooks-cli-D1KGPgOY.js +0 -449
- package/dist/http-endpoint-helpers-bLmE9ZUq.js +0 -43
- package/dist/http-utils-BoeeE_Tc.js +0 -86
- package/dist/image-CsA_D2kK.js +0 -336
- package/dist/image-fallbacks-DgEknji_.js +0 -31
- package/dist/image-generation-HDLi_qSy.js +0 -238
- package/dist/image-generation-core-D5gE4xPa.js +0 -27
- package/dist/image-generation-core.auth.runtime-i8aT5yT-.js +0 -2
- package/dist/image-generation-provider-BSJ2mjXL.js +0 -76
- package/dist/image-generation-provider-Bb2AZkz-.js +0 -63
- package/dist/image-generation-provider-BkA0iCi9.js +0 -267
- package/dist/image-generation-provider-DKlyxpHf.js +0 -147
- package/dist/image-generation-runtime-DJR5u-iK.js +0 -2
- package/dist/image-runtime-BhIbgEOQ.js +0 -9
- package/dist/inbound-media-transcript-D2wqY9Xq.js +0 -311
- package/dist/inbound-reply-dispatch-B0UpHNNo.js +0 -133
- package/dist/init-CN2MRCCG.js +0 -59
- package/dist/interactive-forms-DDSW6HLS.js +0 -169
- package/dist/internal-DlDXUmbL.js +0 -396
- package/dist/isolated-agent-D9yasbpN.js +0 -2
- package/dist/isolated-agent-DpvdiMSc.js +0 -1074
- package/dist/lifecycle-Ce0GaU3k.js +0 -349
- package/dist/lifecycle-Cjf65kJI.js +0 -571
- package/dist/lifecycle-J6xwLo9Z.js +0 -2
- package/dist/lifecycle.runtime-CLbeP1Yv.js +0 -2
- package/dist/list-CijQn-Kc.js +0 -131
- package/dist/list-LSp3EbNj.js +0 -2
- package/dist/list-models-tool-rTizEa2s.js +0 -48
- package/dist/list.list-command-DQXBrlO3.js +0 -376
- package/dist/list.model-row-DtOMG3ij.js +0 -39
- package/dist/list.probe-Bpih0IRy.js +0 -433
- package/dist/list.registry-load-BLZOLX9F.js +0 -132
- package/dist/list.row-sources-CaT_gPXK.js +0 -394
- package/dist/list.status-command-zee_lHrF.js +0 -620
- package/dist/live-auth-keys-Cfld0MdN.js +0 -110
- package/dist/live-model-switch-CUHXExok.js +0 -323
- package/dist/llm-slug-generator-Dy8mfAOS.js +0 -78
- package/dist/load-config-Do55TKXp.js +0 -28
- package/dist/logs-cli-D0YbAbtn.js +0 -321
- package/dist/logs-cli.runtime-CxpEDWUK.js +0 -2
- package/dist/main-session-restart-recovery-BQR78i90.js +0 -257
- package/dist/managed-image-attachments-Bxl53z36.js +0 -729
- package/dist/managed-image-attachments-CFBPqlXh.js +0 -2
- package/dist/manager-DGvBtN-n.js +0 -3183
- package/dist/manager-Dcp3V3pa.js +0 -2
- package/dist/manager-Dp8Mntgt.js +0 -2042
- package/dist/mcp-cli-Ccy7l25l.js +0 -756
- package/dist/mcp-http-Boz5CTad.js +0 -530
- package/dist/mcp-http-DVoPskLT.js +0 -2
- package/dist/media-gateway-BDkulbwU.js +0 -360
- package/dist/media-runtime-BS3Wp54r.js +0 -356
- package/dist/media-understanding-provider-7AEBZoJ2.js +0 -21
- package/dist/media-understanding-provider-ClIHfXem.js +0 -21
- package/dist/media-understanding-runtime-BTszS6XP.js +0 -2
- package/dist/media-understanding-yxNpETLe.js +0 -85
- package/dist/media-upload-http-BnqzRcpp.js +0 -179
- package/dist/memory-DjFunJJS.js +0 -413
- package/dist/memory-core-host-engine-embeddings-DiyEbR0B.js +0 -561
- package/dist/memory-core-host-engine-foundation-B4NpP8yx.js +0 -15
- package/dist/memory-core-host-engine-qmd-0eMjUyu0.js +0 -2
- package/dist/memory-core-host-engine-storage-BDNbQClj.js +0 -2
- package/dist/memory-core-host-runtime-cli-B1aTSykM.js +0 -10
- package/dist/memory-core-host-runtime-core-D1yHp5Nw.js +0 -12
- package/dist/memory-core-host-runtime-files-CvinhF0w.js +0 -4
- package/dist/memory-embedding-adapter-DxKlajfD.js +0 -49
- package/dist/memory-host-core-DCDsay8w.js +0 -2
- package/dist/message-action-runner-CkZ9sa8X.js +0 -1660
- package/dist/message-action-runner-Duja7A3N.js +0 -2
- package/dist/message-handler-BSu85G0y.js +0 -1498
- package/dist/message.gateway.runtime-Dil67anV.js +0 -2
- package/dist/minimax-vlm-MzGohdyr.js +0 -298
- package/dist/model-DjpSwrxI.js +0 -3
- package/dist/model-PkzLtcBS.js +0 -817
- package/dist/model-auth-BtZK_JLJ.js +0 -5
- package/dist/model-auth-D00o8XEw.js +0 -577
- package/dist/model-auth-label-Dz8jghf5.js +0 -56
- package/dist/model-catalog-Bw-rPVmX.js +0 -180
- package/dist/model-catalog-C4c2-6EX.js +0 -3
- package/dist/model-catalog-visibility-C7Y-SJeX.js +0 -31
- package/dist/model-context-tokens-DGIuAxYs.js +0 -493
- package/dist/model-fallback-C0pfneVL.js +0 -723
- package/dist/model-picker-BQ9Q5mKn.js +0 -3
- package/dist/model-picker-BrMVAMI7.js +0 -895
- package/dist/model-picker.runtime-mqMXjcfA.js +0 -48
- package/dist/model-pricing-cache-0p1SnH7S.js +0 -2
- package/dist/model-pricing-cache-CSlaNl4-.js +0 -839
- package/dist/model-selection-CDpcYd3V.js +0 -6
- package/dist/model-selection-DhAg5whl.js +0 -208
- package/dist/model-selection-Mjj1-Rg5.js +0 -195
- package/dist/model-selection-cli-B3C-DNnL.js +0 -122
- package/dist/model-selection-directive-MPkdEg1E.js +0 -249
- package/dist/model-selection-shared-CZ4-AqMs.js +0 -475
- package/dist/model-selection-shared-KlZe1whv.js +0 -2
- package/dist/model-selection.runtime-fIBNnPdw.js +0 -7
- package/dist/model-thinking-default-BU82Pjj7.js +0 -32
- package/dist/models-cli-CclYqwy8.js +0 -138
- package/dist/models-config-CuuzT6UB.js +0 -2
- package/dist/models-config-wHyCnBH5.js +0 -247
- package/dist/models-http-Ak3jkqkd.js +0 -94
- package/dist/monitor-DvKiRARC.js +0 -60
- package/dist/monitor.account-M2H9IKmy.js +0 -4759
- package/dist/native-hook-relay-DQHspY2P.js +0 -1067
- package/dist/node-cli-CP5p4oTG.js +0 -2497
- package/dist/nodes-cli-DRmL-65J.js +0 -1323
- package/dist/nodes-utils-Zj2p4uCZ.js +0 -75
- package/dist/nodes.helpers-ucOwjOHE.js +0 -25
- package/dist/oauth-DNbWGKdy.js +0 -142
- package/dist/oauth-DVkFp8yz.js +0 -2
- package/dist/onboard-CV0O2Lq6.js +0 -766
- package/dist/onboard-custom-CrDvj7ty.js +0 -276
- package/dist/onboard-custom-DBRmY5qL.js +0 -3
- package/dist/onboard-custom-config-8g1s19yX.js +0 -414
- package/dist/onboard-helpers-COM1z6kK.js +0 -206
- package/dist/onboard-helpers-Dmy9uPfv.js +0 -6
- package/dist/onboard-remote-ZWf3hjQE.js +0 -208
- package/dist/onboard-remote-w9L2pQer.js +0 -2
- package/dist/onboard-skills-CIoeJ1oq.js +0 -2
- package/dist/onboard-skills-fgXdaFge.js +0 -135
- package/dist/openai-http-DhZiEy2V.js +0 -508
- package/dist/openclaw-runtime-Dd69QJA-.js +0 -31
- package/dist/openclaw-runtime-config-C9a9TcPJ.js +0 -2
- package/dist/openclaw-runtime-io-DR3k-5Ea.js +0 -2
- package/dist/openclaw-runtime-memory-DPnYwqJ6.js +0 -2
- package/dist/openclaw-runtime-session-C3YVsaUN.js +0 -2
- package/dist/openclaw-tools-CP2o_tFL.js +0 -9909
- package/dist/openclaw-tools.runtime-CwSJsPnU.js +0 -2
- package/dist/openresponses-http-BNolDPR1.js +0 -1134
- package/dist/operations-D08GYWla.js +0 -805
- package/dist/operator-approvals-client-TQMNS_dw.js +0 -90
- package/dist/overview-CG-lxr5q.js +0 -2
- package/dist/overview-DGrddLYS.js +0 -274
- package/dist/persistent-bindings.lifecycle-CbNL89Fe.js +0 -2
- package/dist/persistent-bindings.lifecycle-_59-g80U.js +0 -85
- package/dist/pi-embedded-Cl5ChlEg.js +0 -4
- package/dist/pi-embedded-NPITV0xm.js +0 -2816
- package/dist/pi-embedded.runtime-fqIvINm6.js +0 -4
- package/dist/pi-model-discovery-Cb5FU4zs.js +0 -259
- package/dist/pi-tool-definition-adapter-EGSjB800.js +0 -249
- package/dist/pi-tools-CbssDrrP.js +0 -1948
- package/dist/pi-tools.before-tool-call-BgxxlNUa.js +0 -2
- package/dist/pi-tools.before-tool-call-IwYoS31m.js +0 -675
- package/dist/plugin-approval-BcLLFuzt.js +0 -113
- package/dist/plugin-registration-BiPWsI3s.js +0 -486
- package/dist/plugin-sdk/src/cli/nodes-camera.d.ts +0 -51
- package/dist/plugin-sdk/src/cli/nodes-canvas.d.ts +0 -11
- package/dist/plugin-sdk/src/cli/nodes-media-utils.d.ts +0 -14
- package/dist/plugins-http-CRVWENyl.js +0 -75
- package/dist/prepare.runtime-AjElg8bm.js +0 -883
- package/dist/probe-C4nVUsDN.js +0 -287
- package/dist/probe-CR_eY1kd.js +0 -76
- package/dist/probe-K7gS6Fdc.js +0 -2
- package/dist/program-Ba6vrtdN.js +0 -122
- package/dist/protocol-DGZfyRJL.js +0 -3201
- package/dist/provider-adapters-D2e6b82v.js +0 -115
- package/dist/provider-auth-choice-Dg1S6NRI.js +0 -283
- package/dist/provider-auth-choice-helpers-CdPV_w4Y.js +0 -77
- package/dist/provider-auth-choice-preference-Ce3qPA-b.js +0 -26
- package/dist/provider-auth-choice.runtime-COYyRAY0.js +0 -2
- package/dist/provider-auth-choice.runtime-gD3h0KdP.js +0 -18
- package/dist/provider-auth-guidance-BBV6t8rx.js +0 -2
- package/dist/provider-auth-guidance-COVRXwua.js +0 -34
- package/dist/provider-auth-runtime-DGWzRMLE.js +0 -148
- package/dist/provider-dispatcher-CrSyqlnG.js +0 -22
- package/dist/provider-registry-CSXz4uoo.js +0 -61
- package/dist/provider-registry-MqG9iQD-.js +0 -55
- package/dist/provider-usage-BGF9IWSg.js +0 -3
- package/dist/provider-usage-CAaM57T-.js +0 -413
- package/dist/provider-wizard-Jdaey4uG.js +0 -181
- package/dist/qmd-manager-CDUYJ_OM.js +0 -1987
- package/dist/qr-cli-BcBucY_Y.js +0 -2
- package/dist/qr-cli-CMzzlkzw.js +0 -372
- package/dist/read-file-_p9MyXo_.js +0 -146
- package/dist/realtime-handler-NOL9-CXj.js +0 -1054
- package/dist/realtime-transcription-CNuZ_-Je.js +0 -305
- package/dist/realtime-transcription-provider-CBRpb3uX.js +0 -186
- package/dist/realtime-transcription-provider-D30h_YC8.js +0 -172
- package/dist/realtime-transcription.runtime-DMjx6nBE.js +0 -3
- package/dist/register-service-commands-CD-J_1uu.js +0 -77
- package/dist/register.agent-BoR9EkR0.js +0 -298
- package/dist/register.configure-bIT8Qv2s.js +0 -15
- package/dist/register.crestodian-CU0QMwDQ.js +0 -24
- package/dist/register.maintenance-DEW59mPq.js +0 -451
- package/dist/register.message-Dr8htL_M.js +0 -370
- package/dist/register.onboard-DMgxZBhz.js +0 -111
- package/dist/register.runtime-D6hFi7lr.js +0 -109
- package/dist/register.setup-DRPoN1at.js +0 -166
- package/dist/register.status-health-sessions-XBFmtmy9.js +0 -1235
- package/dist/register.subclis-CaCkdhA5.js +0 -31
- package/dist/register.subclis-DKoTIwRE.js +0 -3
- package/dist/register.subclis-core-CyZBgZiQ.js +0 -265
- package/dist/rem-harness-B28PAXWk.js +0 -648
- package/dist/reply.runtime-CBa05yMz.js +0 -2
- package/dist/resolve-BqPh_hFv.js +0 -97
- package/dist/restart-health-BjxeCP0d.js +0 -368
- package/dist/restart-health-zJJDZwdw.js +0 -2
- package/dist/root-help-CpCT9Zus.js +0 -42
- package/dist/route-yodWG-md.js +0 -424
- package/dist/rpc.runtime-D_c3KzJE.js +0 -21
- package/dist/run-CQT-yarn.js +0 -925
- package/dist/run-_dHYeu03.js +0 -2
- package/dist/run-context.runtime-Dn43bgk1.js +0 -2
- package/dist/run-embedded.runtime-Bf-RFrpm.js +0 -4
- package/dist/run-execution-cli.runtime-DVZRKlxD.js +0 -4
- package/dist/run-executor.runtime-DJQv7yhC.js +0 -300
- package/dist/run-model-catalog.runtime-ByHP8k6U.js +0 -2
- package/dist/run-subagent-registry.runtime-DOAHVCxW.js +0 -2
- package/dist/run-wait-iFTQfpYy.js +0 -138
- package/dist/runner-Bkl2Hi84.js +0 -1070
- package/dist/runner.entries-CWuVVa6A.js +0 -644
- package/dist/runtime--kCbY35Y.js +0 -288
- package/dist/runtime-B1CcFSFr.js +0 -438
- package/dist/runtime-CW4kEQIP.js +0 -2
- package/dist/runtime-D-IBB_X7.js +0 -150
- package/dist/runtime-DgO8rvln.js +0 -5116
- package/dist/runtime-api-DgBBYlUN.js +0 -3
- package/dist/runtime-api-n6jPoHy9.js +0 -12
- package/dist/runtime-channel-BqNcK15w.js +0 -2
- package/dist/runtime-channel-CQJzQYAr.js +0 -145
- package/dist/runtime-embedded-pi.runtime-Bddjf5m8.js +0 -2
- package/dist/runtime-entry-Be5TiDKk.js +0 -3324
- package/dist/runtime-internal-BFHOCa_m.js +0 -2
- package/dist/runtime-jd3voH0X.js +0 -428
- package/dist/runtime-model-auth.runtime-BfgXur3C.js +0 -2
- package/dist/runtime-model-auth.runtime-u_7g_QHl.js +0 -46
- package/dist/runtime-options-W883Ol7C.js +0 -275
- package/dist/runtime-provider-DvSmh2YE.js +0 -21
- package/dist/runtime-provider-b3bxlWIC.js +0 -2
- package/dist/runtime-taskflow-DqtdK9Gf.js +0 -250
- package/dist/sealseek-registry-BLNY8HfE.js +0 -281
- package/dist/secrets-DlLc8TOj.js +0 -61
- package/dist/secrets-cli-DF0YdGuP.js +0 -2108
- package/dist/security-cli-CRknxRkv.js +0 -495
- package/dist/selection-C05-VjNz.js +0 -2
- package/dist/selection-CxkfU6CC.js +0 -9151
- package/dist/server-aux-handlers-BbT_STRI.js +0 -1070
- package/dist/server-channels-4LkcRJ8J.js +0 -649
- package/dist/server-chat-BfsVeICt.js +0 -555
- package/dist/server-cron-D5sotpqT.js +0 -2788
- package/dist/server-cron-SE64Ly6U.js +0 -2
- package/dist/server-maintenance-CRWRPG9T.js +0 -115
- package/dist/server-methods-DiHxiMzp.js +0 -13812
- package/dist/server-model-catalog-Cfv0xotW.js +0 -73
- package/dist/server-model-catalog-CnLn6qtI.js +0 -2
- package/dist/server-node-events-RSlKcPzE.js +0 -579
- package/dist/server-plugin-bootstrap-Gak-n6MH.js +0 -69
- package/dist/server-plugins-bvswBAok.js +0 -385
- package/dist/server-reload-handlers-ByTqaLhu.js +0 -606
- package/dist/server-restart-sentinel-DxV13k03.js +0 -725
- package/dist/server-restart-sentinel-eQfkouMf.js +0 -2
- package/dist/server-runtime-services-B3BBhyxs.js +0 -266
- package/dist/server-runtime-services-DsP2ORN-.js +0 -2
- package/dist/server-runtime-subscriptions-D08t8maI.js +0 -59
- package/dist/server-session-events-YcWuM8dV.js +0 -209
- package/dist/server-session-key-Ba-id1VV.js +0 -2
- package/dist/server-session-key-D_QurbrC.js +0 -45
- package/dist/server-startup-early-1cfHhSs1.js +0 -86
- package/dist/server-startup-log-bnMXgdbr.js +0 -74
- package/dist/server-startup-plugins-rr8EHUhH.js +0 -116
- package/dist/server-startup-post-attach-lWpjXgiy.js +0 -525
- package/dist/server-startup-sealseek-models-BrS2pewY.js +0 -90
- package/dist/server-ws-runtime-3PiRJWHv.js +0 -387
- package/dist/server.impl-B-HnEP-o.js +0 -2473
- package/dist/service-Diuz2Qpi.js +0 -677
- package/dist/session-async-task-status-CSVxmdAE.js +0 -42
- package/dist/session-cost-usage-I3ac0Ghh.js +0 -1299
- package/dist/session-kill-http-Dtrt8RGh.js +0 -111
- package/dist/session-reset-model.runtime-MTDCqyXp.js +0 -143
- package/dist/session-reset-service-CaiCbTIV.js +0 -469
- package/dist/session-status.runtime-Cx3TM00c.js +0 -2
- package/dist/session-store-BWwMidaf.js +0 -174
- package/dist/session-store.runtime-Xxm6hTsZ.js +0 -2
- package/dist/session-subagent-reactivation.runtime-TiF2RMPF.js +0 -2
- package/dist/session-utils-DnoqQbSR.js +0 -1272
- package/dist/session-visibility-Cp4T2OE7.js +0 -147
- package/dist/sessions-helpers-9LXer_bQ.js +0 -326
- package/dist/sessions-history-http-DG7b1y3L.js +0 -225
- package/dist/sessions-patch-C45heRLK.js +0 -340
- package/dist/sessions-resolve-BsO-X-iF.js +0 -177
- package/dist/sessions-wymWCoz_.js +0 -404
- package/dist/sessions-ynfoG1zv.js +0 -2
- package/dist/sessions.runtime-3FVoDshL.js +0 -2
- package/dist/set-UtBA5XD9.js +0 -17
- package/dist/set-image-pTdDn7So.js +0 -17
- package/dist/setup-CNtKMlgM.js +0 -569
- package/dist/setup-CqU_GxNh.js +0 -2
- package/dist/setup.finalize-BPY9otB0.js +0 -488
- package/dist/setup.gateway-config-7G1xhv4L.js +0 -263
- package/dist/setup.migration-import-ClI_JOzW.js +0 -199
- package/dist/setup.migration-import-D06cleWF.js +0 -2
- package/dist/shared-0i7GnoR_.js +0 -147
- package/dist/shared-BlVTl3QP.js +0 -71
- package/dist/shared-DMNp2rrh.js +0 -199
- package/dist/shared-DWAlVajG.js +0 -5
- package/dist/simple-completion-runtime-DjHai18t.js +0 -165
- package/dist/speech-core-C7PN87JG.js +0 -94
- package/dist/startup-context-B2DlfQV4.js +0 -312
- package/dist/status-13c69YJJ.js +0 -3
- package/dist/status-4NmDBHhA.js +0 -4
- package/dist/status-C0oub2qi.js +0 -2
- package/dist/status-CT1hItGn.js +0 -213
- package/dist/status-DChcEJ5a.js +0 -214
- package/dist/status-DPgSROhu.js +0 -66
- package/dist/status-all-DbQWUyXb.js +0 -498
- package/dist/status-fLtuP2D4.js +0 -2
- package/dist/status-json-CS94Qs-i.js +0 -14
- package/dist/status-json-command-BmgtJSKM.js +0 -84
- package/dist/status-message-CiQbYQky.js +0 -461
- package/dist/status-message.runtime-CetDxtgf.js +0 -6
- package/dist/status-runtime-shared-DypB9JaT.js +0 -263
- package/dist/status-subagents.runtime-BUj9muaE.js +0 -18
- package/dist/status-text-DEZ20n8_.js +0 -260
- package/dist/status.command-BKj5n_dL.js +0 -2
- package/dist/status.command-euRUuTfP.js +0 -390
- package/dist/status.gateway-connection.runtime-Ca6lrtZM.js +0 -2
- package/dist/status.gather-Bz-PAgnu.js +0 -348
- package/dist/status.gather-DnXIOyqX.js +0 -2
- package/dist/status.runtime-CYuyK8Rb.js +0 -2
- package/dist/status.runtime-DSfQ9woE.js +0 -2
- package/dist/status.scan-DjYInbeK.js +0 -68
- package/dist/status.scan-overview-Dse_OXSu.js +0 -444
- package/dist/status.scan.fast-json--GtY5Bis.js +0 -2
- package/dist/status.scan.fast-json-BNs7aEAI.js +0 -132
- package/dist/status.summary-BMlIzLII.js +0 -222
- package/dist/status.summary-Ba9X_Sos.js +0 -2
- package/dist/stored-model-override-B7s65pgE.js +0 -40
- package/dist/subagent-announce-CYVe5uZ2.js +0 -346
- package/dist/subagent-announce-delivery-DLFe-mA6.js +0 -919
- package/dist/subagent-control-BVufd3Z0.js +0 -507
- package/dist/subagent-followup.runtime-T9roU_v9.js +0 -68
- package/dist/subagent-hooks-api-DVHD93K3.js +0 -23
- package/dist/subagent-hooks-bCW8hL33.js +0 -222
- package/dist/subagent-hooks-oI6xF_3Z.js +0 -2
- package/dist/subagent-orphan-recovery-DRCJVn5t.js +0 -350
- package/dist/subagent-registry-18y8-ILS.js +0 -3
- package/dist/subagent-registry-D5KS6KCv.js +0 -1909
- package/dist/subagent-session-cleanup-Do0dXRFx.js +0 -522
- package/dist/subagent-spawn-GWEcKMn3.js +0 -1142
- package/dist/system-cli-BXdjsuTl.js +0 -59
- package/dist/targets-DAMzLDJA.js +0 -67
- package/dist/task-executor-CElgxUT7.js +0 -349
- package/dist/task-flow-registry.audit-CG0DVoCI.js +0 -155
- package/dist/task-owner-access-CPFlY4We.js +0 -74
- package/dist/task-registry-C84-spyx.js +0 -2464
- package/dist/task-registry-delivery-runtime-Ctaxpdij.js +0 -2
- package/dist/task-registry.maintenance-Tz4k-ycu.js +0 -676
- package/dist/task-registry.maintenance-tRRW3KQX.js +0 -2
- package/dist/task-status-access-BQ7xHL-h.js +0 -17
- package/dist/tasks-json-BHKbh_sT.js +0 -117
- package/dist/testing-CFZ-Rsw3.js +0 -161
- package/dist/text-report-D2FaWkdD.js +0 -609
- package/dist/thread-bindings-J1rbBcvn.js +0 -228
- package/dist/tool-resolution-B1G4W5WO.js +0 -104
- package/dist/tool-result-middleware-BT8n3u6v.js +0 -334
- package/dist/tools-BgXlEY1F.js +0 -509
- package/dist/tools-effective-inventory-QyiGMFr5.js +0 -163
- package/dist/tools-invoke-http-abT5pDVu.js +0 -66
- package/dist/tools-invoke-shared-DO5PTPVy.js +0 -201
- package/dist/tools.runtime-CdR041Pp.js +0 -5
- package/dist/tui-CSZMOvaa.js +0 -2
- package/dist/tui-DduZk2sV.js +0 -4878
- package/dist/tui-backend-OVX0At_g.js +0 -256
- package/dist/tui-cli-BaU5eGyL.js +0 -36
- package/dist/update-cli-DZaCl1-x.js +0 -2685
- package/dist/usage-format-Cs5vxb2n.js +0 -212
- package/dist/usage-format-HH76tLQF.js +0 -2
- package/dist/video-generation-core-CtjX7pht.js +0 -6
- package/dist/video-generation-provider-ClyO1hy4.js +0 -293
- package/dist/video-generation-provider-CysYqahe.js +0 -287
- package/dist/video-generation-provider-D-N3B72i.js +0 -357
- package/dist/video-generation-provider-DFYwauUC.js +0 -78
- package/dist/video-generation-provider-DLJC_2OU.js +0 -104
- package/dist/video-generation-runtime-mXg884FO.js +0 -2
- package/dist/video-generation-task-status-73spZb1J.js +0 -87
- package/dist/workflow-runtime-01PKqXMr.js +0 -484
- package/docs/CLAUDE.md +0 -1
- package/docs/reference/templates/CLAUDE.md +0 -1
- /package/dist/{acp-runtime-backend-DMMeh68G.js → acp-runtime-backend-H3AF-SBD.js} +0 -0
- /package/dist/{delegate-C7_GmmRO.js → delegate-DRXkEb29.js} +0 -0
- /package/dist/{gateway-rpc-Cm-pVJeb.js → gateway-rpc-B4U6nDDq.js} +0 -0
- /package/dist/{get-reply-inline-actions-aIRLuyAP.js → get-reply-inline-actions-DGECj9bd.js} +0 -0
- /package/dist/{library-DeDgQnLL.js → library-BecGDh3y.js} +0 -0
- /package/dist/{message-BqiGNUgf.js → message-Bbn3pF4I.js} +0 -0
- /package/dist/{rpc-CY2urZcU.js → rpc-BT3vj9ch.js} +0 -0
- /package/dist/{run-delivery.runtime-C47HYYUb.js → run-delivery.runtime-DVqq3zGk.js} +0 -0
|
@@ -0,0 +1,2095 @@
|
|
|
1
|
+
import { a as normalizeLowercaseStringOrEmpty, c as normalizeOptionalString, f as readStringValue, s as normalizeOptionalLowercaseString, t as hasNonEmptyString } from "./string-coerce-Bje8XVt9.js";
|
|
2
|
+
import { t as isMainModule } from "./is-main-BEaTwLZn.js";
|
|
3
|
+
import { t as formatDocsLink } from "./links-dQIIPEtq.js";
|
|
4
|
+
import { r as theme } from "./theme-CVJvORNs.js";
|
|
5
|
+
import { n as inheritOptionFromParent } from "./command-options-B-0DBeD5.js";
|
|
6
|
+
import { r as isPathInside } from "./path-DDpzSMRm.js";
|
|
7
|
+
import { g as shortenHomePath } from "./utils-Cqo7291Q.js";
|
|
8
|
+
import { n as VERSION } from "./version-VKZYHUE7.js";
|
|
9
|
+
import "./path-guards-KDSQyc6Z.js";
|
|
10
|
+
import { n as defaultRuntime } from "./runtime-gQFUcUXE.js";
|
|
11
|
+
import { a as routeLogsToStderr } from "./console-I7lUctTx.js";
|
|
12
|
+
import { i as getRuntimeConfig } from "./io-DfHhRQ1H.js";
|
|
13
|
+
import { t as sanitizeTerminalText } from "./safe-text-DAccwgZd.js";
|
|
14
|
+
import { i as omitEnvKeysCaseInsensitive, n as listKnownProviderAuthEnvVarNames } from "./provider-env-vars-L6LxLnPx.js";
|
|
15
|
+
import "./config-B_NeWLw-.js";
|
|
16
|
+
import { i as GATEWAY_CLIENT_NAMES, r as GATEWAY_CLIENT_MODES } from "./client-info-p4mF0Ve4.js";
|
|
17
|
+
import { t as startGatewayClientWhenEventLoopReady } from "./client-start-readiness-BipDt8i0.js";
|
|
18
|
+
import { n as GatewayClient } from "./client-Cj4NTwWB.js";
|
|
19
|
+
import { i as asOptionalRecord } from "./record-coerce-DWsCRJPX.js";
|
|
20
|
+
import { s as isKnownCoreToolId } from "./tool-policy-shared-CUJ6Mzjs.js";
|
|
21
|
+
import { d as resolveOwnerOnlyToolApprovalClass } from "./tool-policy-BgpQKK8v.js";
|
|
22
|
+
import { a as listThinkingLevels } from "./thinking-RaWhlsYg.js";
|
|
23
|
+
import { i as resolveWindowsSpawnProgram, n as materializeWindowsSpawnProgram } from "./windows-spawn-BTOT8Ne7.js";
|
|
24
|
+
import { r as isMutatingToolCall } from "./tool-mutation-DTRIYvBx.js";
|
|
25
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-D54yDLOe.js";
|
|
26
|
+
import { t as resolveGatewayClientBootstrap } from "./client-bootstrap-DGHT7UAE.js";
|
|
27
|
+
import { t as readSecretFromFile } from "./secret-file-CHst5RM6.js";
|
|
28
|
+
import { t as resolveGatewayAuthOptions } from "./gateway-secret-options-B9BMO5P7.js";
|
|
29
|
+
import { fileURLToPath } from "node:url";
|
|
30
|
+
import fs from "node:fs";
|
|
31
|
+
import path from "node:path";
|
|
32
|
+
import os, { homedir } from "node:os";
|
|
33
|
+
import { spawn } from "node:child_process";
|
|
34
|
+
import { randomUUID } from "node:crypto";
|
|
35
|
+
import { Readable, Writable } from "node:stream";
|
|
36
|
+
import * as readline$1 from "node:readline";
|
|
37
|
+
import { AgentSideConnection, ClientSideConnection, PROTOCOL_VERSION, ndJsonStream } from "@agentclientprotocol/sdk";
|
|
38
|
+
//#region src/acp/approval-classifier.ts
|
|
39
|
+
const SAFE_SEARCH_TOOL_IDS = new Set(["search", "memory_search"]);
|
|
40
|
+
const TRUSTED_SAFE_TOOL_ALIASES = new Set(["search"]);
|
|
41
|
+
const EXEC_CAPABLE_TOOL_IDS = new Set([
|
|
42
|
+
"exec",
|
|
43
|
+
"spawn",
|
|
44
|
+
"shell",
|
|
45
|
+
"bash",
|
|
46
|
+
"process"
|
|
47
|
+
]);
|
|
48
|
+
const CONTROL_PLANE_TOOL_IDS = new Set([
|
|
49
|
+
"sessions_spawn",
|
|
50
|
+
"sessions_send",
|
|
51
|
+
"session_status"
|
|
52
|
+
]);
|
|
53
|
+
function readFirstStringValue(source, keys) {
|
|
54
|
+
if (!source) return;
|
|
55
|
+
for (const key of keys) {
|
|
56
|
+
const value = normalizeOptionalString(source[key]);
|
|
57
|
+
if (value) return value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function normalizeToolName(value) {
|
|
61
|
+
const normalized = normalizeLowercaseStringOrEmpty(value);
|
|
62
|
+
if (!normalized || normalized.length > 128) return;
|
|
63
|
+
return /^[a-z0-9._-]+$/.test(normalized) ? normalized : void 0;
|
|
64
|
+
}
|
|
65
|
+
function parseToolNameFromTitle(title) {
|
|
66
|
+
if (!title) return;
|
|
67
|
+
const head = normalizeOptionalString(title.split(":", 1)[0]);
|
|
68
|
+
return head ? normalizeToolName(head) : void 0;
|
|
69
|
+
}
|
|
70
|
+
function resolveToolNameForPermission(params) {
|
|
71
|
+
const toolCall = params.toolCall;
|
|
72
|
+
const toolMeta = asOptionalRecord(toolCall?._meta);
|
|
73
|
+
const rawInput = asOptionalRecord(toolCall?.rawInput);
|
|
74
|
+
const fromMeta = readFirstStringValue(toolMeta, [
|
|
75
|
+
"toolName",
|
|
76
|
+
"tool_name",
|
|
77
|
+
"name"
|
|
78
|
+
]);
|
|
79
|
+
const fromRawInput = readFirstStringValue(rawInput, [
|
|
80
|
+
"tool",
|
|
81
|
+
"toolName",
|
|
82
|
+
"tool_name",
|
|
83
|
+
"name"
|
|
84
|
+
]);
|
|
85
|
+
const fromTitle = parseToolNameFromTitle(toolCall?.title);
|
|
86
|
+
const metaName = fromMeta ? normalizeToolName(fromMeta) : void 0;
|
|
87
|
+
const rawInputName = fromRawInput ? normalizeToolName(fromRawInput) : void 0;
|
|
88
|
+
const titleName = fromTitle;
|
|
89
|
+
if (fromMeta && !metaName || fromRawInput && !rawInputName) return;
|
|
90
|
+
if (metaName && titleName && metaName !== titleName) return;
|
|
91
|
+
if (rawInputName && metaName && rawInputName !== metaName) return;
|
|
92
|
+
if (rawInputName && titleName && rawInputName !== titleName) return;
|
|
93
|
+
return metaName ?? titleName ?? rawInputName;
|
|
94
|
+
}
|
|
95
|
+
function extractPathFromToolTitle(toolTitle, toolName) {
|
|
96
|
+
if (!toolTitle) return;
|
|
97
|
+
const separator = toolTitle.indexOf(":");
|
|
98
|
+
if (separator < 0) return;
|
|
99
|
+
const tail = toolTitle.slice(separator + 1).trim();
|
|
100
|
+
if (!tail) return;
|
|
101
|
+
const keyedMatch = tail.match(/(?:^|,\s*)(?:path|file_path|filePath)\s*:\s*([^,]+)/);
|
|
102
|
+
if (keyedMatch?.[1]) return keyedMatch[1].trim();
|
|
103
|
+
return toolName === "read" ? tail : void 0;
|
|
104
|
+
}
|
|
105
|
+
function resolveToolPathCandidate(params, toolName, toolTitle) {
|
|
106
|
+
return readFirstStringValue(asOptionalRecord(params.toolCall?.rawInput), [
|
|
107
|
+
"path",
|
|
108
|
+
"file_path",
|
|
109
|
+
"filePath"
|
|
110
|
+
]) ?? extractPathFromToolTitle(toolTitle, toolName);
|
|
111
|
+
}
|
|
112
|
+
function resolveAbsoluteScopedPath(value, cwd) {
|
|
113
|
+
let candidate = value.trim();
|
|
114
|
+
if (!candidate) return;
|
|
115
|
+
if (candidate.startsWith("file://")) try {
|
|
116
|
+
const parsed = new URL(candidate);
|
|
117
|
+
candidate = decodeURIComponent(parsed.pathname || "");
|
|
118
|
+
} catch {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (candidate === "~") candidate = homedir();
|
|
122
|
+
else if (candidate.startsWith("~/")) candidate = path.join(homedir(), candidate.slice(2));
|
|
123
|
+
return path.isAbsolute(candidate) ? path.normalize(candidate) : path.resolve(cwd, candidate);
|
|
124
|
+
}
|
|
125
|
+
function isReadToolCallScopedToCwd(params, toolName, toolTitle, cwd) {
|
|
126
|
+
if (toolName !== "read") return false;
|
|
127
|
+
const rawPath = resolveToolPathCandidate(params, toolName, toolTitle);
|
|
128
|
+
if (!rawPath) return false;
|
|
129
|
+
const absolutePath = resolveAbsoluteScopedPath(rawPath, cwd);
|
|
130
|
+
if (!absolutePath) return false;
|
|
131
|
+
return isPathInside(path.resolve(cwd), absolutePath);
|
|
132
|
+
}
|
|
133
|
+
function classifyAcpToolApproval(params) {
|
|
134
|
+
const toolName = resolveToolNameForPermission(params);
|
|
135
|
+
if (!toolName) return {
|
|
136
|
+
toolName: void 0,
|
|
137
|
+
approvalClass: "unknown",
|
|
138
|
+
autoApprove: false
|
|
139
|
+
};
|
|
140
|
+
const isTrustedToolId = isKnownCoreToolId(toolName) || TRUSTED_SAFE_TOOL_ALIASES.has(toolName);
|
|
141
|
+
if (toolName === "read" && isTrustedToolId) {
|
|
142
|
+
const autoApprove = isReadToolCallScopedToCwd(params, toolName, params.toolCall?.title ?? void 0, params.cwd);
|
|
143
|
+
return {
|
|
144
|
+
toolName,
|
|
145
|
+
approvalClass: autoApprove ? "readonly_scoped" : "other",
|
|
146
|
+
autoApprove
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (SAFE_SEARCH_TOOL_IDS.has(toolName) && isTrustedToolId) return {
|
|
150
|
+
toolName,
|
|
151
|
+
approvalClass: "readonly_search",
|
|
152
|
+
autoApprove: true
|
|
153
|
+
};
|
|
154
|
+
const ownerOnlyApprovalClass = resolveOwnerOnlyToolApprovalClass(toolName);
|
|
155
|
+
if (ownerOnlyApprovalClass) return {
|
|
156
|
+
toolName,
|
|
157
|
+
approvalClass: ownerOnlyApprovalClass,
|
|
158
|
+
autoApprove: false
|
|
159
|
+
};
|
|
160
|
+
if (EXEC_CAPABLE_TOOL_IDS.has(toolName)) return {
|
|
161
|
+
toolName,
|
|
162
|
+
approvalClass: "exec_capable",
|
|
163
|
+
autoApprove: false
|
|
164
|
+
};
|
|
165
|
+
if (CONTROL_PLANE_TOOL_IDS.has(toolName)) return {
|
|
166
|
+
toolName,
|
|
167
|
+
approvalClass: "control_plane",
|
|
168
|
+
autoApprove: false
|
|
169
|
+
};
|
|
170
|
+
if (isMutatingToolCall(toolName, params.toolCall?.rawInput)) return {
|
|
171
|
+
toolName,
|
|
172
|
+
approvalClass: "mutating",
|
|
173
|
+
autoApprove: false
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
toolName,
|
|
177
|
+
approvalClass: "other",
|
|
178
|
+
autoApprove: false
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/acp/client-helpers.ts
|
|
183
|
+
function resolveToolKindForPermission(toolName, approvalClass) {
|
|
184
|
+
if (!toolName && approvalClass === "unknown") return;
|
|
185
|
+
if (approvalClass === "readonly_scoped") return "readonly_scoped";
|
|
186
|
+
if (approvalClass === "readonly_search") return "readonly_search";
|
|
187
|
+
return approvalClass;
|
|
188
|
+
}
|
|
189
|
+
function pickOption(options, kinds) {
|
|
190
|
+
for (const kind of kinds) {
|
|
191
|
+
const match = options.find((option) => option.kind === kind);
|
|
192
|
+
if (match) return match;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function selectedPermission(optionId) {
|
|
196
|
+
return { outcome: {
|
|
197
|
+
outcome: "selected",
|
|
198
|
+
optionId
|
|
199
|
+
} };
|
|
200
|
+
}
|
|
201
|
+
function cancelledPermission() {
|
|
202
|
+
return { outcome: { outcome: "cancelled" } };
|
|
203
|
+
}
|
|
204
|
+
function promptUserPermission(toolName, toolTitle) {
|
|
205
|
+
if (!process.stdin.isTTY || !process.stderr.isTTY) {
|
|
206
|
+
console.error(`[permission denied] ${toolName ?? "unknown"}: non-interactive terminal`);
|
|
207
|
+
return Promise.resolve(false);
|
|
208
|
+
}
|
|
209
|
+
return new Promise((resolve) => {
|
|
210
|
+
let settled = false;
|
|
211
|
+
const rl = readline$1.createInterface({
|
|
212
|
+
input: process.stdin,
|
|
213
|
+
output: process.stderr
|
|
214
|
+
});
|
|
215
|
+
const finish = (approved) => {
|
|
216
|
+
if (settled) return;
|
|
217
|
+
settled = true;
|
|
218
|
+
clearTimeout(timeout);
|
|
219
|
+
rl.close();
|
|
220
|
+
resolve(approved);
|
|
221
|
+
};
|
|
222
|
+
const timeout = setTimeout(() => {
|
|
223
|
+
console.error(`\n[permission timeout] denied: ${toolName ?? "unknown"}`);
|
|
224
|
+
finish(false);
|
|
225
|
+
}, 3e4);
|
|
226
|
+
const label = toolTitle ? toolName ? `${toolTitle} (${toolName})` : toolTitle : toolName ?? "unknown tool";
|
|
227
|
+
rl.question(`\n[permission] Allow "${label}"? (y/N) `, (answer) => {
|
|
228
|
+
const approved = normalizeLowercaseStringOrEmpty(answer) === "y";
|
|
229
|
+
console.error(`[permission ${approved ? "approved" : "denied"}] ${toolName ?? "unknown"}`);
|
|
230
|
+
finish(approved);
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
async function resolvePermissionRequest(params, deps = {}) {
|
|
235
|
+
const log = deps.log ?? ((line) => console.error(line));
|
|
236
|
+
const prompt = deps.prompt ?? promptUserPermission;
|
|
237
|
+
const cwd = deps.cwd ?? process.cwd();
|
|
238
|
+
const options = params.options ?? [];
|
|
239
|
+
const toolTitle = sanitizeTerminalText(params.toolCall?.title ?? "tool");
|
|
240
|
+
const classification = classifyAcpToolApproval({
|
|
241
|
+
toolCall: params.toolCall,
|
|
242
|
+
cwd
|
|
243
|
+
});
|
|
244
|
+
const toolName = classification.toolName;
|
|
245
|
+
const toolKind = resolveToolKindForPermission(toolName, classification.approvalClass);
|
|
246
|
+
if (options.length === 0) {
|
|
247
|
+
log(`[permission cancelled] ${toolName ?? "unknown"}: no options available`);
|
|
248
|
+
return cancelledPermission();
|
|
249
|
+
}
|
|
250
|
+
const allowOption = pickOption(options, ["allow_once", "allow_always"]);
|
|
251
|
+
const rejectOption = pickOption(options, ["reject_once", "reject_always"]);
|
|
252
|
+
if (!!classification.autoApprove) {
|
|
253
|
+
const option = allowOption ?? options[0];
|
|
254
|
+
if (!option) {
|
|
255
|
+
log(`[permission cancelled] ${toolName}: no selectable options`);
|
|
256
|
+
return cancelledPermission();
|
|
257
|
+
}
|
|
258
|
+
log(`[permission auto-approved] ${toolName} (${toolKind ?? "unknown"})`);
|
|
259
|
+
return selectedPermission(option.optionId);
|
|
260
|
+
}
|
|
261
|
+
log(`\n[permission requested] ${toolTitle}${toolName ? ` (${toolName})` : ""}${toolKind ? ` [${toolKind}]` : ""}`);
|
|
262
|
+
const approved = await prompt(toolName, toolTitle);
|
|
263
|
+
if (approved && allowOption) return selectedPermission(allowOption.optionId);
|
|
264
|
+
if (!approved && rejectOption) return selectedPermission(rejectOption.optionId);
|
|
265
|
+
log(`[permission cancelled] ${toolName ?? "unknown"}: missing ${approved ? "allow" : "reject"} option`);
|
|
266
|
+
return cancelledPermission();
|
|
267
|
+
}
|
|
268
|
+
function resolveAcpClientSpawnEnv(baseEnv = process.env, options = {}) {
|
|
269
|
+
const env = omitEnvKeysCaseInsensitive(baseEnv, options.stripKeys ?? []);
|
|
270
|
+
env.OPENCLAW_SHELL = "acp-client";
|
|
271
|
+
return env;
|
|
272
|
+
}
|
|
273
|
+
function shouldStripProviderAuthEnvVarsForAcpServer(params = {}) {
|
|
274
|
+
const serverCommand = normalizeOptionalString(params.serverCommand);
|
|
275
|
+
if (!serverCommand) return true;
|
|
276
|
+
const defaultServerCommand = normalizeOptionalString(params.defaultServerCommand);
|
|
277
|
+
if (!defaultServerCommand || serverCommand !== defaultServerCommand) return false;
|
|
278
|
+
const serverArgs = params.serverArgs ?? [];
|
|
279
|
+
const defaultServerArgs = params.defaultServerArgs ?? [];
|
|
280
|
+
return serverArgs.length === defaultServerArgs.length && serverArgs.every((arg, index) => arg === defaultServerArgs[index]);
|
|
281
|
+
}
|
|
282
|
+
function buildAcpClientStripKeys(params) {
|
|
283
|
+
const stripKeys = new Set(params.activeSkillEnvKeys ?? []);
|
|
284
|
+
if (params.stripProviderAuthEnvVars) for (const key of listKnownProviderAuthEnvVarNames()) stripKeys.add(key);
|
|
285
|
+
return stripKeys;
|
|
286
|
+
}
|
|
287
|
+
const DEFAULT_ACP_SPAWN_RUNTIME = {
|
|
288
|
+
platform: process.platform,
|
|
289
|
+
env: process.env,
|
|
290
|
+
execPath: process.execPath
|
|
291
|
+
};
|
|
292
|
+
function resolveAcpClientSpawnInvocation(params, runtime = DEFAULT_ACP_SPAWN_RUNTIME) {
|
|
293
|
+
const resolved = materializeWindowsSpawnProgram(resolveWindowsSpawnProgram({
|
|
294
|
+
command: params.serverCommand,
|
|
295
|
+
platform: runtime.platform,
|
|
296
|
+
env: runtime.env,
|
|
297
|
+
execPath: runtime.execPath,
|
|
298
|
+
packageName: "openclaw"
|
|
299
|
+
}), params.serverArgs);
|
|
300
|
+
return {
|
|
301
|
+
command: resolved.command,
|
|
302
|
+
args: resolved.argv,
|
|
303
|
+
shell: resolved.shell,
|
|
304
|
+
windowsHide: resolved.windowsHide
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/acp/client.ts
|
|
309
|
+
function toArgs(value) {
|
|
310
|
+
if (!value) return [];
|
|
311
|
+
return Array.isArray(value) ? value : [value];
|
|
312
|
+
}
|
|
313
|
+
function buildServerArgs(opts) {
|
|
314
|
+
const args = ["acp", ...toArgs(opts.serverArgs)];
|
|
315
|
+
if (opts.serverVerbose && !args.includes("--verbose") && !args.includes("-v")) args.push("--verbose");
|
|
316
|
+
return args;
|
|
317
|
+
}
|
|
318
|
+
function resolveSelfEntryPath() {
|
|
319
|
+
try {
|
|
320
|
+
const here = fileURLToPath(import.meta.url);
|
|
321
|
+
const candidate = path.resolve(path.dirname(here), "..", "entry.js");
|
|
322
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
323
|
+
} catch {}
|
|
324
|
+
const argv1 = normalizeOptionalString(process.argv[1]);
|
|
325
|
+
if (argv1) return path.isAbsolute(argv1) ? argv1 : path.resolve(process.cwd(), argv1);
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
function printSessionUpdate(notification) {
|
|
329
|
+
const update = notification.update;
|
|
330
|
+
if (!("sessionUpdate" in update)) return;
|
|
331
|
+
switch (update.sessionUpdate) {
|
|
332
|
+
case "agent_message_chunk":
|
|
333
|
+
if (update.content?.type === "text") process.stdout.write(update.content.text);
|
|
334
|
+
return;
|
|
335
|
+
case "tool_call":
|
|
336
|
+
console.log(`\n[tool] ${update.title} (${update.status})`);
|
|
337
|
+
return;
|
|
338
|
+
case "tool_call_update":
|
|
339
|
+
if (update.status) console.log(`[tool update] ${update.toolCallId}: ${update.status}`);
|
|
340
|
+
return;
|
|
341
|
+
case "available_commands_update": {
|
|
342
|
+
const names = update.availableCommands?.map((cmd) => `/${cmd.name}`).join(" ");
|
|
343
|
+
if (names) console.log(`\n[commands] ${names}`);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
default: return;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
async function createAcpClient(opts = {}) {
|
|
350
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
351
|
+
const log = Boolean(opts.verbose) ? (msg) => console.error(`[acp-client] ${msg}`) : () => {};
|
|
352
|
+
ensureOpenClawCliOnPath();
|
|
353
|
+
const serverArgs = buildServerArgs(opts);
|
|
354
|
+
const entryPath = resolveSelfEntryPath();
|
|
355
|
+
const defaultServerCommand = entryPath ? process.execPath : "openclaw";
|
|
356
|
+
const defaultServerArgs = entryPath ? [entryPath, ...serverArgs] : serverArgs;
|
|
357
|
+
const serverCommand = opts.serverCommand ?? defaultServerCommand;
|
|
358
|
+
const effectiveArgs = opts.serverCommand || !entryPath ? serverArgs : defaultServerArgs;
|
|
359
|
+
const { getActiveSkillEnvKeys } = await import("./env-overrides.runtime.js");
|
|
360
|
+
const stripKeys = buildAcpClientStripKeys({
|
|
361
|
+
stripProviderAuthEnvVars: shouldStripProviderAuthEnvVarsForAcpServer({
|
|
362
|
+
serverCommand,
|
|
363
|
+
serverArgs: effectiveArgs,
|
|
364
|
+
defaultServerCommand,
|
|
365
|
+
defaultServerArgs
|
|
366
|
+
}),
|
|
367
|
+
activeSkillEnvKeys: getActiveSkillEnvKeys()
|
|
368
|
+
});
|
|
369
|
+
const spawnEnv = resolveAcpClientSpawnEnv(process.env, { stripKeys });
|
|
370
|
+
const spawnInvocation = resolveAcpClientSpawnInvocation({
|
|
371
|
+
serverCommand,
|
|
372
|
+
serverArgs: effectiveArgs
|
|
373
|
+
}, {
|
|
374
|
+
platform: process.platform,
|
|
375
|
+
env: spawnEnv,
|
|
376
|
+
execPath: process.execPath
|
|
377
|
+
});
|
|
378
|
+
log(`spawning: ${spawnInvocation.command} ${spawnInvocation.args.join(" ")}`);
|
|
379
|
+
const agent = spawn(spawnInvocation.command, spawnInvocation.args, {
|
|
380
|
+
stdio: [
|
|
381
|
+
"pipe",
|
|
382
|
+
"pipe",
|
|
383
|
+
"inherit"
|
|
384
|
+
],
|
|
385
|
+
cwd,
|
|
386
|
+
env: spawnEnv,
|
|
387
|
+
shell: spawnInvocation.shell,
|
|
388
|
+
windowsHide: spawnInvocation.windowsHide
|
|
389
|
+
});
|
|
390
|
+
if (!agent.stdin || !agent.stdout) throw new Error("Failed to create ACP stdio pipes");
|
|
391
|
+
const client = new ClientSideConnection(() => ({
|
|
392
|
+
sessionUpdate: async (params) => {
|
|
393
|
+
printSessionUpdate(params);
|
|
394
|
+
},
|
|
395
|
+
requestPermission: async (params) => {
|
|
396
|
+
return resolvePermissionRequest(params, { cwd });
|
|
397
|
+
}
|
|
398
|
+
}), ndJsonStream(Writable.toWeb(agent.stdin), Readable.toWeb(agent.stdout)));
|
|
399
|
+
log("initializing");
|
|
400
|
+
await client.initialize({
|
|
401
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
402
|
+
clientCapabilities: {
|
|
403
|
+
fs: {
|
|
404
|
+
readTextFile: true,
|
|
405
|
+
writeTextFile: true
|
|
406
|
+
},
|
|
407
|
+
terminal: true
|
|
408
|
+
},
|
|
409
|
+
clientInfo: {
|
|
410
|
+
name: "openclaw-acp-client",
|
|
411
|
+
version: "1.0.0"
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
log("creating session");
|
|
415
|
+
return {
|
|
416
|
+
client,
|
|
417
|
+
agent,
|
|
418
|
+
sessionId: (await client.newSession({
|
|
419
|
+
cwd,
|
|
420
|
+
mcpServers: []
|
|
421
|
+
})).sessionId
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
async function runAcpClientInteractive(opts = {}) {
|
|
425
|
+
const { client, agent, sessionId } = await createAcpClient(opts);
|
|
426
|
+
const rl = readline$1.createInterface({
|
|
427
|
+
input: process.stdin,
|
|
428
|
+
output: process.stdout
|
|
429
|
+
});
|
|
430
|
+
console.log("OpenClaw ACP client");
|
|
431
|
+
console.log(`Session: ${sessionId}`);
|
|
432
|
+
console.log("Type a prompt, or \"exit\" to quit.\n");
|
|
433
|
+
const prompt = () => {
|
|
434
|
+
rl.question("> ", async (input) => {
|
|
435
|
+
const text = input.trim();
|
|
436
|
+
if (!text) {
|
|
437
|
+
prompt();
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (text === "exit" || text === "quit") {
|
|
441
|
+
agent.kill();
|
|
442
|
+
rl.close();
|
|
443
|
+
process.exit(0);
|
|
444
|
+
}
|
|
445
|
+
try {
|
|
446
|
+
const response = await client.prompt({
|
|
447
|
+
sessionId,
|
|
448
|
+
prompt: [{
|
|
449
|
+
type: "text",
|
|
450
|
+
text
|
|
451
|
+
}]
|
|
452
|
+
});
|
|
453
|
+
console.log(`\n[${response.stopReason}]\n`);
|
|
454
|
+
} catch (err) {
|
|
455
|
+
console.error(`\n[error] ${String(err)}\n`);
|
|
456
|
+
}
|
|
457
|
+
prompt();
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
prompt();
|
|
461
|
+
agent.on("exit", (code) => {
|
|
462
|
+
console.log(`\nAgent exited with code ${code ?? 0}`);
|
|
463
|
+
rl.close();
|
|
464
|
+
process.exit(code ?? 0);
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/infra/fixed-window-rate-limit.ts
|
|
469
|
+
function createFixedWindowRateLimiter(params) {
|
|
470
|
+
const maxRequests = Math.max(1, Math.floor(params.maxRequests));
|
|
471
|
+
const windowMs = Math.max(1, Math.floor(params.windowMs));
|
|
472
|
+
const now = params.now ?? Date.now;
|
|
473
|
+
let count = 0;
|
|
474
|
+
let windowStartMs = 0;
|
|
475
|
+
return {
|
|
476
|
+
consume() {
|
|
477
|
+
const nowMs = now();
|
|
478
|
+
if (nowMs - windowStartMs >= windowMs) {
|
|
479
|
+
windowStartMs = nowMs;
|
|
480
|
+
count = 0;
|
|
481
|
+
}
|
|
482
|
+
if (count >= maxRequests) return {
|
|
483
|
+
allowed: false,
|
|
484
|
+
retryAfterMs: Math.max(0, windowStartMs + windowMs - nowMs),
|
|
485
|
+
remaining: 0
|
|
486
|
+
};
|
|
487
|
+
count += 1;
|
|
488
|
+
return {
|
|
489
|
+
allowed: true,
|
|
490
|
+
retryAfterMs: 0,
|
|
491
|
+
remaining: Math.max(0, maxRequests - count)
|
|
492
|
+
};
|
|
493
|
+
},
|
|
494
|
+
reset() {
|
|
495
|
+
count = 0;
|
|
496
|
+
windowStartMs = 0;
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/acp/event-mapper.ts
|
|
502
|
+
const TOOL_LOCATION_PATH_KEYS = [
|
|
503
|
+
"path",
|
|
504
|
+
"filePath",
|
|
505
|
+
"file_path",
|
|
506
|
+
"targetPath",
|
|
507
|
+
"target_path",
|
|
508
|
+
"targetFile",
|
|
509
|
+
"target_file",
|
|
510
|
+
"sourcePath",
|
|
511
|
+
"source_path",
|
|
512
|
+
"destinationPath",
|
|
513
|
+
"destination_path",
|
|
514
|
+
"oldPath",
|
|
515
|
+
"old_path",
|
|
516
|
+
"newPath",
|
|
517
|
+
"new_path",
|
|
518
|
+
"outputPath",
|
|
519
|
+
"output_path",
|
|
520
|
+
"inputPath",
|
|
521
|
+
"input_path"
|
|
522
|
+
];
|
|
523
|
+
const TOOL_LOCATION_LINE_KEYS = [
|
|
524
|
+
"line",
|
|
525
|
+
"lineNumber",
|
|
526
|
+
"line_number",
|
|
527
|
+
"startLine",
|
|
528
|
+
"start_line"
|
|
529
|
+
];
|
|
530
|
+
const TOOL_RESULT_PATH_MARKER_RE = /^(?:FILE|MEDIA):(.+)$/gm;
|
|
531
|
+
const TOOL_LOCATION_MAX_DEPTH = 4;
|
|
532
|
+
const TOOL_LOCATION_MAX_NODES = 100;
|
|
533
|
+
const INLINE_CONTROL_ESCAPE_MAP = {
|
|
534
|
+
"\0": "\\0",
|
|
535
|
+
"\r": "\\r",
|
|
536
|
+
"\n": "\\n",
|
|
537
|
+
" ": "\\t",
|
|
538
|
+
"\v": "\\v",
|
|
539
|
+
"\f": "\\f",
|
|
540
|
+
"\u2028": "\\u2028",
|
|
541
|
+
"\u2029": "\\u2029"
|
|
542
|
+
};
|
|
543
|
+
function escapeInlineControlChars(value) {
|
|
544
|
+
let escaped = "";
|
|
545
|
+
for (const char of value) {
|
|
546
|
+
const codePoint = char.codePointAt(0);
|
|
547
|
+
if (codePoint === void 0) {
|
|
548
|
+
escaped += char;
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
if (!(codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint === 8232 || codePoint === 8233)) {
|
|
552
|
+
escaped += char;
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
const mapped = INLINE_CONTROL_ESCAPE_MAP[char];
|
|
556
|
+
if (mapped) {
|
|
557
|
+
escaped += mapped;
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
escaped += codePoint <= 255 ? `\\x${codePoint.toString(16).padStart(2, "0")}` : `\\u${codePoint.toString(16).padStart(4, "0")}`;
|
|
561
|
+
}
|
|
562
|
+
return escaped;
|
|
563
|
+
}
|
|
564
|
+
function escapeResourceTitle(value) {
|
|
565
|
+
return escapeInlineControlChars(value).replace(/[()[\]]/g, (char) => `\\${char}`);
|
|
566
|
+
}
|
|
567
|
+
function normalizeToolLocationPath(value) {
|
|
568
|
+
const trimmed = value.trim();
|
|
569
|
+
if (!trimmed || trimmed.length > 4096 || trimmed.includes("\0") || trimmed.includes("\r") || trimmed.includes("\n")) return;
|
|
570
|
+
if (/^https?:\/\//i.test(trimmed)) return;
|
|
571
|
+
if (/^file:\/\//i.test(trimmed)) try {
|
|
572
|
+
const parsed = new URL(trimmed);
|
|
573
|
+
return decodeURIComponent(parsed.pathname || "") || void 0;
|
|
574
|
+
} catch {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
return trimmed;
|
|
578
|
+
}
|
|
579
|
+
function normalizeToolLocationLine(value) {
|
|
580
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return;
|
|
581
|
+
const line = Math.floor(value);
|
|
582
|
+
return line > 0 ? line : void 0;
|
|
583
|
+
}
|
|
584
|
+
function extractToolLocationLine(record) {
|
|
585
|
+
for (const key of TOOL_LOCATION_LINE_KEYS) {
|
|
586
|
+
const line = normalizeToolLocationLine(record[key]);
|
|
587
|
+
if (line !== void 0) return line;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function addToolLocation(locations, rawPath, line) {
|
|
591
|
+
const path = normalizeToolLocationPath(rawPath);
|
|
592
|
+
if (!path) return;
|
|
593
|
+
for (const [existingKey, existing] of locations.entries()) {
|
|
594
|
+
if (existing.path !== path) continue;
|
|
595
|
+
if (line === void 0 || existing.line === line) return;
|
|
596
|
+
if (existing.line === void 0) locations.delete(existingKey);
|
|
597
|
+
}
|
|
598
|
+
const locationKey = `${path}:${line ?? ""}`;
|
|
599
|
+
if (locations.has(locationKey)) return;
|
|
600
|
+
locations.set(locationKey, line ? {
|
|
601
|
+
path,
|
|
602
|
+
line
|
|
603
|
+
} : { path });
|
|
604
|
+
}
|
|
605
|
+
function collectLocationsFromTextMarkers(text, locations) {
|
|
606
|
+
for (const match of text.matchAll(TOOL_RESULT_PATH_MARKER_RE)) {
|
|
607
|
+
const candidate = normalizeOptionalString(match[1]);
|
|
608
|
+
if (candidate) addToolLocation(locations, candidate);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
function collectToolLocations(value, locations, state, depth) {
|
|
612
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES || depth > TOOL_LOCATION_MAX_DEPTH) return;
|
|
613
|
+
state.visited += 1;
|
|
614
|
+
if (typeof value === "string") {
|
|
615
|
+
collectLocationsFromTextMarkers(value, locations);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (!value || typeof value !== "object") return;
|
|
619
|
+
if (Array.isArray(value)) {
|
|
620
|
+
for (const item of value) {
|
|
621
|
+
collectToolLocations(item, locations, state, depth + 1);
|
|
622
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES) return;
|
|
623
|
+
}
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const record = value;
|
|
627
|
+
const line = extractToolLocationLine(record);
|
|
628
|
+
for (const key of TOOL_LOCATION_PATH_KEYS) {
|
|
629
|
+
const rawPath = record[key];
|
|
630
|
+
if (typeof rawPath === "string") addToolLocation(locations, rawPath, line);
|
|
631
|
+
}
|
|
632
|
+
const content = Array.isArray(record.content) ? record.content : void 0;
|
|
633
|
+
if (content) for (const block of content) {
|
|
634
|
+
const entry = asOptionalRecord(block);
|
|
635
|
+
if (entry?.type === "text" && typeof entry.text === "string") collectLocationsFromTextMarkers(entry.text, locations);
|
|
636
|
+
}
|
|
637
|
+
for (const [key, nested] of Object.entries(record)) {
|
|
638
|
+
if (key === "content") continue;
|
|
639
|
+
collectToolLocations(nested, locations, state, depth + 1);
|
|
640
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES) return;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function extractTextFromPrompt(prompt, maxBytes) {
|
|
644
|
+
const parts = [];
|
|
645
|
+
let totalBytes = 0;
|
|
646
|
+
for (const block of prompt) {
|
|
647
|
+
let blockText;
|
|
648
|
+
if (block.type === "text") blockText = block.text;
|
|
649
|
+
else if (block.type === "resource") {
|
|
650
|
+
const resource = block.resource;
|
|
651
|
+
if (resource?.text) blockText = resource.text;
|
|
652
|
+
} else if (block.type === "resource_link") {
|
|
653
|
+
const title = block.title ? ` (${escapeResourceTitle(block.title)})` : "";
|
|
654
|
+
const uri = block.uri ? escapeInlineControlChars(block.uri) : "";
|
|
655
|
+
blockText = uri ? `[Resource link${title}] ${uri}` : `[Resource link${title}]`;
|
|
656
|
+
}
|
|
657
|
+
if (blockText !== void 0) {
|
|
658
|
+
if (maxBytes !== void 0) {
|
|
659
|
+
const separatorBytes = parts.length > 0 ? 1 : 0;
|
|
660
|
+
totalBytes += separatorBytes + Buffer.byteLength(blockText, "utf-8");
|
|
661
|
+
if (totalBytes > maxBytes) throw new Error(`Prompt exceeds maximum allowed size of ${maxBytes} bytes`);
|
|
662
|
+
}
|
|
663
|
+
parts.push(blockText);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return parts.join("\n");
|
|
667
|
+
}
|
|
668
|
+
function extractAttachmentsFromPrompt(prompt) {
|
|
669
|
+
const attachments = [];
|
|
670
|
+
for (const block of prompt) {
|
|
671
|
+
if (block.type !== "image") continue;
|
|
672
|
+
const image = block;
|
|
673
|
+
if (!image.data || !image.mimeType) continue;
|
|
674
|
+
attachments.push({
|
|
675
|
+
type: "image",
|
|
676
|
+
mimeType: image.mimeType,
|
|
677
|
+
content: image.data
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
return attachments;
|
|
681
|
+
}
|
|
682
|
+
function formatToolTitle(name, args) {
|
|
683
|
+
const base = name ?? "tool";
|
|
684
|
+
if (!args || Object.keys(args).length === 0) return base;
|
|
685
|
+
return escapeInlineControlChars(`${base}: ${Object.entries(args).map(([key, value]) => {
|
|
686
|
+
const raw = typeof value === "string" ? value : JSON.stringify(value);
|
|
687
|
+
return `${key}: ${raw.length > 100 ? `${raw.slice(0, 100)}...` : raw}`;
|
|
688
|
+
}).join(", ")}`);
|
|
689
|
+
}
|
|
690
|
+
function inferToolKind(name) {
|
|
691
|
+
if (!name) return "other";
|
|
692
|
+
const normalized = normalizeLowercaseStringOrEmpty(name);
|
|
693
|
+
if (normalized.includes("read")) return "read";
|
|
694
|
+
if (normalized.includes("write") || normalized.includes("edit")) return "edit";
|
|
695
|
+
if (normalized.includes("delete") || normalized.includes("remove")) return "delete";
|
|
696
|
+
if (normalized.includes("move") || normalized.includes("rename")) return "move";
|
|
697
|
+
if (normalized.includes("search") || normalized.includes("find")) return "search";
|
|
698
|
+
if (normalized.includes("exec") || normalized.includes("run") || normalized.includes("bash")) return "execute";
|
|
699
|
+
if (normalized.includes("fetch") || normalized.includes("http")) return "fetch";
|
|
700
|
+
return "other";
|
|
701
|
+
}
|
|
702
|
+
function extractToolCallContent(value) {
|
|
703
|
+
if (hasNonEmptyString(value)) return value.trim() ? [{
|
|
704
|
+
type: "content",
|
|
705
|
+
content: {
|
|
706
|
+
type: "text",
|
|
707
|
+
text: value
|
|
708
|
+
}
|
|
709
|
+
}] : void 0;
|
|
710
|
+
const record = asOptionalRecord(value);
|
|
711
|
+
if (!record) return;
|
|
712
|
+
const contents = [];
|
|
713
|
+
const blocks = Array.isArray(record.content) ? record.content : [];
|
|
714
|
+
for (const block of blocks) {
|
|
715
|
+
const entry = asOptionalRecord(block);
|
|
716
|
+
if (entry?.type === "text" && hasNonEmptyString(entry.text)) contents.push({
|
|
717
|
+
type: "content",
|
|
718
|
+
content: {
|
|
719
|
+
type: "text",
|
|
720
|
+
text: entry.text
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
if (contents.length > 0) return contents;
|
|
725
|
+
const fallbackText = readStringValue(record.text) ?? readStringValue(record.message) ?? readStringValue(record.error);
|
|
726
|
+
if (!hasNonEmptyString(fallbackText)) return;
|
|
727
|
+
return [{
|
|
728
|
+
type: "content",
|
|
729
|
+
content: {
|
|
730
|
+
type: "text",
|
|
731
|
+
text: fallbackText
|
|
732
|
+
}
|
|
733
|
+
}];
|
|
734
|
+
}
|
|
735
|
+
function extractToolCallLocations(...values) {
|
|
736
|
+
const locations = /* @__PURE__ */ new Map();
|
|
737
|
+
for (const value of values) collectToolLocations(value, locations, { visited: 0 }, 0);
|
|
738
|
+
return locations.size > 0 ? [...locations.values()] : void 0;
|
|
739
|
+
}
|
|
740
|
+
//#endregion
|
|
741
|
+
//#region src/acp/meta.ts
|
|
742
|
+
function readString(meta, keys) {
|
|
743
|
+
if (!meta) return;
|
|
744
|
+
for (const key of keys) {
|
|
745
|
+
const value = normalizeOptionalString(meta[key]);
|
|
746
|
+
if (value) return value;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function readBool(meta, keys) {
|
|
750
|
+
if (!meta) return;
|
|
751
|
+
for (const key of keys) {
|
|
752
|
+
const value = meta[key];
|
|
753
|
+
if (typeof value === "boolean") return value;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function readNumber(meta, keys) {
|
|
757
|
+
if (!meta) return;
|
|
758
|
+
for (const key of keys) {
|
|
759
|
+
const value = meta[key];
|
|
760
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/acp/session-mapper.ts
|
|
765
|
+
function parseSessionMeta(meta) {
|
|
766
|
+
if (!meta || typeof meta !== "object") return {};
|
|
767
|
+
const record = meta;
|
|
768
|
+
return {
|
|
769
|
+
sessionKey: readString(record, [
|
|
770
|
+
"sessionKey",
|
|
771
|
+
"session",
|
|
772
|
+
"key"
|
|
773
|
+
]),
|
|
774
|
+
sessionLabel: readString(record, ["sessionLabel", "label"]),
|
|
775
|
+
resetSession: readBool(record, ["resetSession", "reset"]),
|
|
776
|
+
requireExisting: readBool(record, ["requireExistingSession", "requireExisting"]),
|
|
777
|
+
prefixCwd: readBool(record, ["prefixCwd"])
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
async function resolveSessionKey(params) {
|
|
781
|
+
const requestedLabel = params.meta.sessionLabel ?? params.opts.defaultSessionLabel;
|
|
782
|
+
const requestedKey = params.meta.sessionKey ?? params.opts.defaultSessionKey;
|
|
783
|
+
const requireExisting = params.meta.requireExisting ?? params.opts.requireExistingSession ?? false;
|
|
784
|
+
if (params.meta.sessionLabel) {
|
|
785
|
+
const resolved = await params.gateway.request("sessions.resolve", { label: params.meta.sessionLabel });
|
|
786
|
+
if (!resolved?.key) throw new Error(`Unable to resolve session label: ${params.meta.sessionLabel}`);
|
|
787
|
+
return resolved.key;
|
|
788
|
+
}
|
|
789
|
+
if (params.meta.sessionKey) {
|
|
790
|
+
if (!requireExisting) return params.meta.sessionKey;
|
|
791
|
+
const resolved = await params.gateway.request("sessions.resolve", { key: params.meta.sessionKey });
|
|
792
|
+
if (!resolved?.key) throw new Error(`Session key not found: ${params.meta.sessionKey}`);
|
|
793
|
+
return resolved.key;
|
|
794
|
+
}
|
|
795
|
+
if (requestedLabel) {
|
|
796
|
+
const resolved = await params.gateway.request("sessions.resolve", { label: requestedLabel });
|
|
797
|
+
if (!resolved?.key) throw new Error(`Unable to resolve session label: ${requestedLabel}`);
|
|
798
|
+
return resolved.key;
|
|
799
|
+
}
|
|
800
|
+
if (requestedKey) {
|
|
801
|
+
if (!requireExisting) return requestedKey;
|
|
802
|
+
const resolved = await params.gateway.request("sessions.resolve", { key: requestedKey });
|
|
803
|
+
if (!resolved?.key) throw new Error(`Session key not found: ${requestedKey}`);
|
|
804
|
+
return resolved.key;
|
|
805
|
+
}
|
|
806
|
+
return params.fallbackKey;
|
|
807
|
+
}
|
|
808
|
+
async function resetSessionIfNeeded(params) {
|
|
809
|
+
if (!(params.meta.resetSession ?? params.opts.resetSession ?? false)) return;
|
|
810
|
+
await params.gateway.request("sessions.reset", { key: params.sessionKey });
|
|
811
|
+
}
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/acp/session.ts
|
|
814
|
+
const DEFAULT_MAX_SESSIONS = 5e3;
|
|
815
|
+
const DEFAULT_IDLE_TTL_MS = 1440 * 60 * 1e3;
|
|
816
|
+
function createInMemorySessionStore(options = {}) {
|
|
817
|
+
const maxSessions = Math.max(1, options.maxSessions ?? DEFAULT_MAX_SESSIONS);
|
|
818
|
+
const idleTtlMs = Math.max(1e3, options.idleTtlMs ?? DEFAULT_IDLE_TTL_MS);
|
|
819
|
+
const now = options.now ?? Date.now;
|
|
820
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
821
|
+
const runIdToSessionId = /* @__PURE__ */ new Map();
|
|
822
|
+
const touchSession = (session, nowMs) => {
|
|
823
|
+
session.lastTouchedAt = nowMs;
|
|
824
|
+
};
|
|
825
|
+
const removeSession = (sessionId) => {
|
|
826
|
+
const session = sessions.get(sessionId);
|
|
827
|
+
if (!session) return false;
|
|
828
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
829
|
+
session.abortController?.abort();
|
|
830
|
+
sessions.delete(sessionId);
|
|
831
|
+
return true;
|
|
832
|
+
};
|
|
833
|
+
const reapIdleSessions = (nowMs) => {
|
|
834
|
+
const idleBefore = nowMs - idleTtlMs;
|
|
835
|
+
for (const [sessionId, session] of sessions.entries()) {
|
|
836
|
+
if (session.activeRunId || session.abortController) continue;
|
|
837
|
+
if (session.lastTouchedAt > idleBefore) continue;
|
|
838
|
+
removeSession(sessionId);
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
const evictOldestIdleSession = () => {
|
|
842
|
+
let oldestSessionId = null;
|
|
843
|
+
let oldestLastTouchedAt = Number.POSITIVE_INFINITY;
|
|
844
|
+
for (const [sessionId, session] of sessions.entries()) {
|
|
845
|
+
if (session.activeRunId || session.abortController) continue;
|
|
846
|
+
if (session.lastTouchedAt >= oldestLastTouchedAt) continue;
|
|
847
|
+
oldestLastTouchedAt = session.lastTouchedAt;
|
|
848
|
+
oldestSessionId = sessionId;
|
|
849
|
+
}
|
|
850
|
+
if (!oldestSessionId) return false;
|
|
851
|
+
return removeSession(oldestSessionId);
|
|
852
|
+
};
|
|
853
|
+
const createSession = (params) => {
|
|
854
|
+
const nowMs = now();
|
|
855
|
+
const sessionId = params.sessionId ?? randomUUID();
|
|
856
|
+
const existingSession = sessions.get(sessionId);
|
|
857
|
+
if (existingSession) {
|
|
858
|
+
existingSession.sessionKey = params.sessionKey;
|
|
859
|
+
existingSession.cwd = params.cwd;
|
|
860
|
+
touchSession(existingSession, nowMs);
|
|
861
|
+
return existingSession;
|
|
862
|
+
}
|
|
863
|
+
reapIdleSessions(nowMs);
|
|
864
|
+
if (sessions.size >= maxSessions && !evictOldestIdleSession()) throw new Error(`ACP session limit reached (max ${maxSessions}). Close idle ACP clients and retry.`);
|
|
865
|
+
const session = {
|
|
866
|
+
sessionId,
|
|
867
|
+
sessionKey: params.sessionKey,
|
|
868
|
+
cwd: params.cwd,
|
|
869
|
+
createdAt: nowMs,
|
|
870
|
+
lastTouchedAt: nowMs,
|
|
871
|
+
abortController: null,
|
|
872
|
+
activeRunId: null
|
|
873
|
+
};
|
|
874
|
+
sessions.set(sessionId, session);
|
|
875
|
+
return session;
|
|
876
|
+
};
|
|
877
|
+
const hasSession = (sessionId) => sessions.has(sessionId);
|
|
878
|
+
const getSession = (sessionId) => {
|
|
879
|
+
const session = sessions.get(sessionId);
|
|
880
|
+
if (session) touchSession(session, now());
|
|
881
|
+
return session;
|
|
882
|
+
};
|
|
883
|
+
const getSessionByRunId = (runId) => {
|
|
884
|
+
const sessionId = runIdToSessionId.get(runId);
|
|
885
|
+
if (!sessionId) return;
|
|
886
|
+
const session = sessions.get(sessionId);
|
|
887
|
+
if (session) touchSession(session, now());
|
|
888
|
+
return session;
|
|
889
|
+
};
|
|
890
|
+
const setActiveRun = (sessionId, runId, abortController) => {
|
|
891
|
+
const session = sessions.get(sessionId);
|
|
892
|
+
if (!session) return;
|
|
893
|
+
session.activeRunId = runId;
|
|
894
|
+
session.abortController = abortController;
|
|
895
|
+
runIdToSessionId.set(runId, sessionId);
|
|
896
|
+
touchSession(session, now());
|
|
897
|
+
};
|
|
898
|
+
const clearActiveRun = (sessionId) => {
|
|
899
|
+
const session = sessions.get(sessionId);
|
|
900
|
+
if (!session) return;
|
|
901
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
902
|
+
session.activeRunId = null;
|
|
903
|
+
session.abortController = null;
|
|
904
|
+
touchSession(session, now());
|
|
905
|
+
};
|
|
906
|
+
const cancelActiveRun = (sessionId) => {
|
|
907
|
+
const session = sessions.get(sessionId);
|
|
908
|
+
if (!session?.abortController) return false;
|
|
909
|
+
session.abortController.abort();
|
|
910
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
911
|
+
session.abortController = null;
|
|
912
|
+
session.activeRunId = null;
|
|
913
|
+
touchSession(session, now());
|
|
914
|
+
return true;
|
|
915
|
+
};
|
|
916
|
+
const clearAllSessionsForTest = () => {
|
|
917
|
+
for (const session of sessions.values()) session.abortController?.abort();
|
|
918
|
+
sessions.clear();
|
|
919
|
+
runIdToSessionId.clear();
|
|
920
|
+
};
|
|
921
|
+
return {
|
|
922
|
+
createSession,
|
|
923
|
+
hasSession,
|
|
924
|
+
getSession,
|
|
925
|
+
getSessionByRunId,
|
|
926
|
+
setActiveRun,
|
|
927
|
+
clearActiveRun,
|
|
928
|
+
cancelActiveRun,
|
|
929
|
+
clearAllSessionsForTest
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
const defaultAcpSessionStore = createInMemorySessionStore();
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/acp/types.ts
|
|
935
|
+
const ACP_PROVENANCE_MODE_VALUES = [
|
|
936
|
+
"off",
|
|
937
|
+
"meta",
|
|
938
|
+
"meta+receipt"
|
|
939
|
+
];
|
|
940
|
+
function normalizeAcpProvenanceMode(value) {
|
|
941
|
+
const normalized = normalizeOptionalLowercaseString(value);
|
|
942
|
+
if (!normalized) return;
|
|
943
|
+
return ACP_PROVENANCE_MODE_VALUES.includes(normalized) ? normalized : void 0;
|
|
944
|
+
}
|
|
945
|
+
const ACP_AGENT_INFO = {
|
|
946
|
+
name: "openclaw-acp",
|
|
947
|
+
title: "OpenClaw ACP Gateway",
|
|
948
|
+
version: VERSION
|
|
949
|
+
};
|
|
950
|
+
//#endregion
|
|
951
|
+
//#region src/acp/translator.ts
|
|
952
|
+
const MAX_PROMPT_BYTES = 2 * 1024 * 1024;
|
|
953
|
+
const ACP_THOUGHT_LEVEL_CONFIG_ID = "thought_level";
|
|
954
|
+
const ACP_FAST_MODE_CONFIG_ID = "fast_mode";
|
|
955
|
+
const ACP_VERBOSE_LEVEL_CONFIG_ID = "verbose_level";
|
|
956
|
+
const ACP_TRACE_LEVEL_CONFIG_ID = "trace_level";
|
|
957
|
+
const ACP_REASONING_LEVEL_CONFIG_ID = "reasoning_level";
|
|
958
|
+
const ACP_RESPONSE_USAGE_CONFIG_ID = "response_usage";
|
|
959
|
+
const ACP_ELEVATED_LEVEL_CONFIG_ID = "elevated_level";
|
|
960
|
+
const ACP_TIMEOUT_CONFIG_ID = "timeout";
|
|
961
|
+
const ACP_TIMEOUT_SECONDS_CONFIG_ID = "timeout_seconds";
|
|
962
|
+
const ACP_LOAD_SESSION_REPLAY_LIMIT = 1e6;
|
|
963
|
+
const ACP_GATEWAY_DISCONNECT_GRACE_MS = 5e3;
|
|
964
|
+
let acpCommandsModulePromise;
|
|
965
|
+
let acpSdkModulePromise;
|
|
966
|
+
async function getAvailableCommandsForAcp() {
|
|
967
|
+
acpCommandsModulePromise ??= import("./commands-CbLwhnfY.js");
|
|
968
|
+
const { getAvailableCommands } = await acpCommandsModulePromise;
|
|
969
|
+
return getAvailableCommands();
|
|
970
|
+
}
|
|
971
|
+
async function getAcpProtocolVersion() {
|
|
972
|
+
acpSdkModulePromise ??= import("@agentclientprotocol/sdk");
|
|
973
|
+
const { PROTOCOL_VERSION } = await acpSdkModulePromise;
|
|
974
|
+
return PROTOCOL_VERSION;
|
|
975
|
+
}
|
|
976
|
+
function isAdminScopeProvenanceRejection(err) {
|
|
977
|
+
if (!(err instanceof Error)) return false;
|
|
978
|
+
const gatewayCode = typeof err.gatewayCode === "string" ? err.gatewayCode : void 0;
|
|
979
|
+
return err.name === "GatewayClientRequestError" && gatewayCode === "INVALID_REQUEST" && err.message.includes("system provenance fields require admin scope");
|
|
980
|
+
}
|
|
981
|
+
function isGatewayCloseError(err) {
|
|
982
|
+
return err instanceof Error && err.message.startsWith("gateway closed (");
|
|
983
|
+
}
|
|
984
|
+
const SESSION_CREATE_RATE_LIMIT_DEFAULT_MAX_REQUESTS = 120;
|
|
985
|
+
const SESSION_CREATE_RATE_LIMIT_DEFAULT_WINDOW_MS = 1e4;
|
|
986
|
+
function formatThinkingLevelName(level) {
|
|
987
|
+
switch (level) {
|
|
988
|
+
case "xhigh": return "Extra High";
|
|
989
|
+
case "adaptive": return "Adaptive";
|
|
990
|
+
default: return level.length > 0 ? `${level[0].toUpperCase()}${level.slice(1)}` : "Unknown";
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
function buildThinkingModeDescription(level) {
|
|
994
|
+
if (level === "adaptive") return "Use the Gateway session default thought level.";
|
|
995
|
+
}
|
|
996
|
+
function formatConfigValueName(value) {
|
|
997
|
+
switch (value) {
|
|
998
|
+
case "xhigh": return "Extra High";
|
|
999
|
+
default: return value.length > 0 ? `${value[0].toUpperCase()}${value.slice(1)}` : "Unknown";
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
function buildSelectConfigOption(params) {
|
|
1003
|
+
return {
|
|
1004
|
+
type: "select",
|
|
1005
|
+
id: params.id,
|
|
1006
|
+
name: params.name,
|
|
1007
|
+
category: params.category,
|
|
1008
|
+
description: params.description,
|
|
1009
|
+
currentValue: params.currentValue,
|
|
1010
|
+
options: params.values.map((value) => ({
|
|
1011
|
+
value,
|
|
1012
|
+
name: formatConfigValueName(value)
|
|
1013
|
+
}))
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
function buildSessionPresentation(params) {
|
|
1017
|
+
const row = {
|
|
1018
|
+
...params.row,
|
|
1019
|
+
...params.overrides
|
|
1020
|
+
};
|
|
1021
|
+
const availableLevelIds = row.thinkingLevels?.map((level) => level.id) ?? [...listThinkingLevels(row.modelProvider, row.model)];
|
|
1022
|
+
const currentModeId = normalizeOptionalString(row.thinkingLevel) || "adaptive";
|
|
1023
|
+
if (!availableLevelIds.includes(currentModeId)) availableLevelIds.push(currentModeId);
|
|
1024
|
+
const modes = {
|
|
1025
|
+
currentModeId,
|
|
1026
|
+
availableModes: availableLevelIds.map((level) => ({
|
|
1027
|
+
id: level,
|
|
1028
|
+
name: formatThinkingLevelName(level),
|
|
1029
|
+
description: buildThinkingModeDescription(level)
|
|
1030
|
+
}))
|
|
1031
|
+
};
|
|
1032
|
+
return {
|
|
1033
|
+
configOptions: [
|
|
1034
|
+
buildSelectConfigOption({
|
|
1035
|
+
id: ACP_THOUGHT_LEVEL_CONFIG_ID,
|
|
1036
|
+
name: "Thought level",
|
|
1037
|
+
category: "thought_level",
|
|
1038
|
+
description: "Controls how much deliberate reasoning OpenClaw requests from the Gateway model.",
|
|
1039
|
+
currentValue: currentModeId,
|
|
1040
|
+
values: availableLevelIds
|
|
1041
|
+
}),
|
|
1042
|
+
buildSelectConfigOption({
|
|
1043
|
+
id: ACP_FAST_MODE_CONFIG_ID,
|
|
1044
|
+
name: "Fast mode",
|
|
1045
|
+
description: "Controls whether OpenAI sessions use the Gateway fast-mode profile.",
|
|
1046
|
+
currentValue: row.fastMode ? "on" : "off",
|
|
1047
|
+
values: ["off", "on"]
|
|
1048
|
+
}),
|
|
1049
|
+
buildSelectConfigOption({
|
|
1050
|
+
id: ACP_VERBOSE_LEVEL_CONFIG_ID,
|
|
1051
|
+
name: "Tool verbosity",
|
|
1052
|
+
description: "Controls how much tool progress and output detail OpenClaw keeps enabled for the session.",
|
|
1053
|
+
currentValue: normalizeOptionalString(row.verboseLevel) || "off",
|
|
1054
|
+
values: [
|
|
1055
|
+
"off",
|
|
1056
|
+
"on",
|
|
1057
|
+
"full"
|
|
1058
|
+
]
|
|
1059
|
+
}),
|
|
1060
|
+
buildSelectConfigOption({
|
|
1061
|
+
id: ACP_TRACE_LEVEL_CONFIG_ID,
|
|
1062
|
+
name: "Plugin trace",
|
|
1063
|
+
description: "Controls whether plugin-owned trace lines are shown for the session.",
|
|
1064
|
+
currentValue: normalizeOptionalString(row.traceLevel) || "off",
|
|
1065
|
+
values: ["off", "on"]
|
|
1066
|
+
}),
|
|
1067
|
+
buildSelectConfigOption({
|
|
1068
|
+
id: ACP_REASONING_LEVEL_CONFIG_ID,
|
|
1069
|
+
name: "Reasoning stream",
|
|
1070
|
+
description: "Controls whether reasoning-capable models emit reasoning text for the session.",
|
|
1071
|
+
currentValue: normalizeOptionalString(row.reasoningLevel) || "off",
|
|
1072
|
+
values: [
|
|
1073
|
+
"off",
|
|
1074
|
+
"on",
|
|
1075
|
+
"stream"
|
|
1076
|
+
]
|
|
1077
|
+
}),
|
|
1078
|
+
buildSelectConfigOption({
|
|
1079
|
+
id: ACP_RESPONSE_USAGE_CONFIG_ID,
|
|
1080
|
+
name: "Usage detail",
|
|
1081
|
+
description: "Controls how much usage information OpenClaw attaches to responses for the session.",
|
|
1082
|
+
currentValue: normalizeOptionalString(row.responseUsage) || "off",
|
|
1083
|
+
values: [
|
|
1084
|
+
"off",
|
|
1085
|
+
"tokens",
|
|
1086
|
+
"full"
|
|
1087
|
+
]
|
|
1088
|
+
}),
|
|
1089
|
+
buildSelectConfigOption({
|
|
1090
|
+
id: ACP_ELEVATED_LEVEL_CONFIG_ID,
|
|
1091
|
+
name: "Elevated actions",
|
|
1092
|
+
description: "Controls how aggressively the session allows elevated execution behavior.",
|
|
1093
|
+
currentValue: normalizeOptionalString(row.elevatedLevel) || "off",
|
|
1094
|
+
values: [
|
|
1095
|
+
"off",
|
|
1096
|
+
"on",
|
|
1097
|
+
"ask",
|
|
1098
|
+
"full"
|
|
1099
|
+
]
|
|
1100
|
+
})
|
|
1101
|
+
],
|
|
1102
|
+
modes
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function extractReplayChunks(message) {
|
|
1106
|
+
const role = typeof message.role === "string" ? message.role : "";
|
|
1107
|
+
if (role !== "user" && role !== "assistant") return [];
|
|
1108
|
+
if (typeof message.content === "string") return message.content.length > 0 ? [{
|
|
1109
|
+
sessionUpdate: role === "user" ? "user_message_chunk" : "agent_message_chunk",
|
|
1110
|
+
text: message.content
|
|
1111
|
+
}] : [];
|
|
1112
|
+
if (!Array.isArray(message.content)) return [];
|
|
1113
|
+
const replayChunks = [];
|
|
1114
|
+
for (const block of message.content) {
|
|
1115
|
+
if (!block || typeof block !== "object" || Array.isArray(block)) continue;
|
|
1116
|
+
const typedBlock = block;
|
|
1117
|
+
if (typedBlock.type === "text" && typeof typedBlock.text === "string" && typedBlock.text) {
|
|
1118
|
+
replayChunks.push({
|
|
1119
|
+
sessionUpdate: role === "user" ? "user_message_chunk" : "agent_message_chunk",
|
|
1120
|
+
text: typedBlock.text
|
|
1121
|
+
});
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
if (role === "assistant" && typedBlock.type === "thinking" && typeof typedBlock.thinking === "string" && typedBlock.thinking) replayChunks.push({
|
|
1125
|
+
sessionUpdate: "agent_thought_chunk",
|
|
1126
|
+
text: typedBlock.thinking
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
return replayChunks;
|
|
1130
|
+
}
|
|
1131
|
+
function buildSessionMetadata(params) {
|
|
1132
|
+
return {
|
|
1133
|
+
title: normalizeOptionalString(params.row?.derivedTitle) || normalizeOptionalString(params.row?.displayName) || normalizeOptionalString(params.row?.label) || params.sessionKey,
|
|
1134
|
+
updatedAt: typeof params.row?.updatedAt === "number" && Number.isFinite(params.row.updatedAt) ? new Date(params.row.updatedAt).toISOString() : null
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
function buildSessionUsageSnapshot(row) {
|
|
1138
|
+
const totalTokens = row?.totalTokens;
|
|
1139
|
+
const contextTokens = row?.contextTokens;
|
|
1140
|
+
if (row?.totalTokensFresh !== true || typeof totalTokens !== "number" || !Number.isFinite(totalTokens) || typeof contextTokens !== "number" || !Number.isFinite(contextTokens) || contextTokens <= 0) return;
|
|
1141
|
+
const size = Math.max(0, Math.floor(contextTokens));
|
|
1142
|
+
return {
|
|
1143
|
+
size,
|
|
1144
|
+
used: Math.max(0, Math.min(Math.floor(totalTokens), size))
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function buildSystemInputProvenance(originSessionId) {
|
|
1148
|
+
return {
|
|
1149
|
+
kind: "external_user",
|
|
1150
|
+
originSessionId,
|
|
1151
|
+
sourceChannel: "acp",
|
|
1152
|
+
sourceTool: "openclaw_acp"
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
function buildSystemProvenanceReceipt(params) {
|
|
1156
|
+
return [
|
|
1157
|
+
"[Source Receipt]",
|
|
1158
|
+
"bridge=openclaw-acp",
|
|
1159
|
+
`originHost=${os.hostname()}`,
|
|
1160
|
+
`originCwd=${shortenHomePath(params.cwd)}`,
|
|
1161
|
+
`acpSessionId=${params.sessionId}`,
|
|
1162
|
+
`originSessionId=${params.sessionId}`,
|
|
1163
|
+
`targetSession=${params.sessionKey}`,
|
|
1164
|
+
"[/Source Receipt]"
|
|
1165
|
+
].join("\n");
|
|
1166
|
+
}
|
|
1167
|
+
var AcpGatewayAgent = class {
|
|
1168
|
+
getPendingPrompt(sessionId, runId) {
|
|
1169
|
+
const pending = this.pendingPrompts.get(sessionId);
|
|
1170
|
+
if (pending?.idempotencyKey !== runId) return;
|
|
1171
|
+
return pending;
|
|
1172
|
+
}
|
|
1173
|
+
constructor(connection, gateway, opts = {}) {
|
|
1174
|
+
this.pendingPrompts = /* @__PURE__ */ new Map();
|
|
1175
|
+
this.disconnectTimer = null;
|
|
1176
|
+
this.activeDisconnectContext = null;
|
|
1177
|
+
this.disconnectGeneration = 0;
|
|
1178
|
+
this.connection = connection;
|
|
1179
|
+
this.gateway = gateway;
|
|
1180
|
+
this.opts = opts;
|
|
1181
|
+
this.log = opts.verbose ? (msg) => process.stderr.write(`[acp] ${msg}\n`) : () => {};
|
|
1182
|
+
this.sessionStore = opts.sessionStore ?? defaultAcpSessionStore;
|
|
1183
|
+
this.sessionCreateRateLimiter = createFixedWindowRateLimiter({
|
|
1184
|
+
maxRequests: Math.max(1, opts.sessionCreateRateLimit?.maxRequests ?? SESSION_CREATE_RATE_LIMIT_DEFAULT_MAX_REQUESTS),
|
|
1185
|
+
windowMs: Math.max(1e3, opts.sessionCreateRateLimit?.windowMs ?? SESSION_CREATE_RATE_LIMIT_DEFAULT_WINDOW_MS)
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
start() {
|
|
1189
|
+
this.log("ready");
|
|
1190
|
+
}
|
|
1191
|
+
handleGatewayReconnect() {
|
|
1192
|
+
this.log("gateway reconnected");
|
|
1193
|
+
const disconnectContext = this.activeDisconnectContext;
|
|
1194
|
+
this.activeDisconnectContext = null;
|
|
1195
|
+
if (!disconnectContext) return;
|
|
1196
|
+
this.reconcilePendingPrompts(disconnectContext.generation, false);
|
|
1197
|
+
}
|
|
1198
|
+
handleGatewayDisconnect(reason) {
|
|
1199
|
+
this.log(`gateway disconnected: ${reason}`);
|
|
1200
|
+
const disconnectContext = {
|
|
1201
|
+
generation: this.disconnectGeneration + 1,
|
|
1202
|
+
reason
|
|
1203
|
+
};
|
|
1204
|
+
this.disconnectGeneration = disconnectContext.generation;
|
|
1205
|
+
this.activeDisconnectContext = disconnectContext;
|
|
1206
|
+
if (this.pendingPrompts.size === 0) return;
|
|
1207
|
+
for (const pending of this.pendingPrompts.values()) pending.disconnectContext = disconnectContext;
|
|
1208
|
+
this.armDisconnectTimer(disconnectContext);
|
|
1209
|
+
}
|
|
1210
|
+
async handleGatewayEvent(evt) {
|
|
1211
|
+
if (evt.event === "chat") {
|
|
1212
|
+
await this.handleChatEvent(evt);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
if (evt.event === "agent") await this.handleAgentEvent(evt);
|
|
1216
|
+
}
|
|
1217
|
+
async initialize(_params) {
|
|
1218
|
+
return {
|
|
1219
|
+
protocolVersion: await getAcpProtocolVersion(),
|
|
1220
|
+
agentCapabilities: {
|
|
1221
|
+
loadSession: true,
|
|
1222
|
+
promptCapabilities: {
|
|
1223
|
+
image: true,
|
|
1224
|
+
audio: false,
|
|
1225
|
+
embeddedContext: true
|
|
1226
|
+
},
|
|
1227
|
+
mcpCapabilities: {
|
|
1228
|
+
http: false,
|
|
1229
|
+
sse: false
|
|
1230
|
+
},
|
|
1231
|
+
sessionCapabilities: { list: {} }
|
|
1232
|
+
},
|
|
1233
|
+
agentInfo: ACP_AGENT_INFO,
|
|
1234
|
+
authMethods: []
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
async newSession(params) {
|
|
1238
|
+
this.assertSupportedSessionSetup(params.mcpServers);
|
|
1239
|
+
this.enforceSessionCreateRateLimit("newSession");
|
|
1240
|
+
const sessionId = randomUUID();
|
|
1241
|
+
const meta = parseSessionMeta(params._meta);
|
|
1242
|
+
const sessionKey = await this.resolveSessionKeyFromMeta({
|
|
1243
|
+
meta,
|
|
1244
|
+
fallbackKey: `acp:${sessionId}`
|
|
1245
|
+
});
|
|
1246
|
+
const session = this.sessionStore.createSession({
|
|
1247
|
+
sessionId,
|
|
1248
|
+
sessionKey,
|
|
1249
|
+
cwd: params.cwd
|
|
1250
|
+
});
|
|
1251
|
+
this.log(`newSession: ${session.sessionId} -> ${session.sessionKey}`);
|
|
1252
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey);
|
|
1253
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: false });
|
|
1254
|
+
await this.sendAvailableCommands(session.sessionId);
|
|
1255
|
+
const { configOptions, modes } = sessionSnapshot;
|
|
1256
|
+
return {
|
|
1257
|
+
sessionId: session.sessionId,
|
|
1258
|
+
configOptions,
|
|
1259
|
+
modes
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
async loadSession(params) {
|
|
1263
|
+
this.assertSupportedSessionSetup(params.mcpServers);
|
|
1264
|
+
if (!this.sessionStore.hasSession(params.sessionId)) this.enforceSessionCreateRateLimit("loadSession");
|
|
1265
|
+
const meta = parseSessionMeta(params._meta);
|
|
1266
|
+
const sessionKey = await this.resolveSessionKeyFromMeta({
|
|
1267
|
+
meta,
|
|
1268
|
+
fallbackKey: params.sessionId
|
|
1269
|
+
});
|
|
1270
|
+
const session = this.sessionStore.createSession({
|
|
1271
|
+
sessionId: params.sessionId,
|
|
1272
|
+
sessionKey,
|
|
1273
|
+
cwd: params.cwd
|
|
1274
|
+
});
|
|
1275
|
+
this.log(`loadSession: ${session.sessionId} -> ${session.sessionKey}`);
|
|
1276
|
+
const [sessionSnapshot, transcript] = await Promise.all([this.getSessionSnapshot(session.sessionKey), this.getSessionTranscript(session.sessionKey).catch((err) => {
|
|
1277
|
+
this.log(`session transcript fallback for ${session.sessionKey}: ${String(err)}`);
|
|
1278
|
+
return [];
|
|
1279
|
+
})]);
|
|
1280
|
+
await this.replaySessionTranscript(session.sessionId, transcript);
|
|
1281
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: false });
|
|
1282
|
+
await this.sendAvailableCommands(session.sessionId);
|
|
1283
|
+
const { configOptions, modes } = sessionSnapshot;
|
|
1284
|
+
return {
|
|
1285
|
+
configOptions,
|
|
1286
|
+
modes
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
async unstable_listSessions(params) {
|
|
1290
|
+
const limit = readNumber(params._meta, ["limit"]) ?? 100;
|
|
1291
|
+
const result = await this.gateway.request("sessions.list", { limit });
|
|
1292
|
+
const cwd = params.cwd ?? process.cwd();
|
|
1293
|
+
return {
|
|
1294
|
+
sessions: result.sessions.map((session) => ({
|
|
1295
|
+
sessionId: session.key,
|
|
1296
|
+
cwd,
|
|
1297
|
+
title: session.displayName ?? session.label ?? session.key,
|
|
1298
|
+
updatedAt: session.updatedAt ? new Date(session.updatedAt).toISOString() : void 0,
|
|
1299
|
+
_meta: {
|
|
1300
|
+
sessionKey: session.key,
|
|
1301
|
+
kind: session.kind,
|
|
1302
|
+
channel: session.channel
|
|
1303
|
+
}
|
|
1304
|
+
})),
|
|
1305
|
+
nextCursor: null
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
async authenticate(_params) {
|
|
1309
|
+
return {};
|
|
1310
|
+
}
|
|
1311
|
+
async setSessionMode(params) {
|
|
1312
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1313
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1314
|
+
if (!params.modeId) return {};
|
|
1315
|
+
try {
|
|
1316
|
+
await this.gateway.request("sessions.patch", {
|
|
1317
|
+
key: session.sessionKey,
|
|
1318
|
+
thinkingLevel: params.modeId
|
|
1319
|
+
});
|
|
1320
|
+
this.log(`setSessionMode: ${session.sessionId} -> ${params.modeId}`);
|
|
1321
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey, { thinkingLevel: params.modeId });
|
|
1322
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: true });
|
|
1323
|
+
} catch (err) {
|
|
1324
|
+
this.log(`setSessionMode error: ${String(err)}`);
|
|
1325
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
1326
|
+
}
|
|
1327
|
+
return {};
|
|
1328
|
+
}
|
|
1329
|
+
async setSessionConfigOption(params) {
|
|
1330
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1331
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1332
|
+
const sessionPatch = this.resolveSessionConfigPatch(params.configId, params.value);
|
|
1333
|
+
try {
|
|
1334
|
+
if (sessionPatch.patch) await this.gateway.request("sessions.patch", {
|
|
1335
|
+
key: session.sessionKey,
|
|
1336
|
+
...sessionPatch.patch
|
|
1337
|
+
});
|
|
1338
|
+
this.log(`setSessionConfigOption: ${session.sessionId} -> ${params.configId}=${params.value}`);
|
|
1339
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey, sessionPatch.overrides);
|
|
1340
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: true });
|
|
1341
|
+
return { configOptions: sessionSnapshot.configOptions };
|
|
1342
|
+
} catch (err) {
|
|
1343
|
+
this.log(`setSessionConfigOption error: ${String(err)}`);
|
|
1344
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
async prompt(params) {
|
|
1348
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1349
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1350
|
+
if (session.abortController) this.sessionStore.cancelActiveRun(params.sessionId);
|
|
1351
|
+
const meta = parseSessionMeta(params._meta);
|
|
1352
|
+
const userText = extractTextFromPrompt(params.prompt, MAX_PROMPT_BYTES);
|
|
1353
|
+
const attachments = extractAttachmentsFromPrompt(params.prompt);
|
|
1354
|
+
const prefixCwd = meta.prefixCwd ?? this.opts.prefixCwd ?? true;
|
|
1355
|
+
const displayCwd = shortenHomePath(session.cwd);
|
|
1356
|
+
const message = prefixCwd ? `[Working directory: ${displayCwd}]\n\n${userText}` : userText;
|
|
1357
|
+
const provenanceMode = this.opts.provenanceMode ?? "off";
|
|
1358
|
+
const systemInputProvenance = provenanceMode === "off" ? void 0 : buildSystemInputProvenance(params.sessionId);
|
|
1359
|
+
const systemProvenanceReceipt = provenanceMode === "meta+receipt" ? buildSystemProvenanceReceipt({
|
|
1360
|
+
cwd: session.cwd,
|
|
1361
|
+
sessionId: params.sessionId,
|
|
1362
|
+
sessionKey: session.sessionKey
|
|
1363
|
+
}) : void 0;
|
|
1364
|
+
if (Buffer.byteLength(message, "utf-8") > MAX_PROMPT_BYTES) throw new Error(`Prompt exceeds maximum allowed size of ${MAX_PROMPT_BYTES} bytes`);
|
|
1365
|
+
const abortController = new AbortController();
|
|
1366
|
+
const runId = randomUUID();
|
|
1367
|
+
this.sessionStore.setActiveRun(params.sessionId, runId, abortController);
|
|
1368
|
+
const requestParams = {
|
|
1369
|
+
sessionKey: session.sessionKey,
|
|
1370
|
+
message,
|
|
1371
|
+
attachments: attachments.length > 0 ? attachments : void 0,
|
|
1372
|
+
idempotencyKey: runId,
|
|
1373
|
+
thinking: readString(params._meta, ["thinking", "thinkingLevel"]),
|
|
1374
|
+
deliver: readBool(params._meta, ["deliver"]),
|
|
1375
|
+
timeoutMs: readNumber(params._meta, ["timeoutMs"])
|
|
1376
|
+
};
|
|
1377
|
+
return new Promise((resolve, reject) => {
|
|
1378
|
+
this.pendingPrompts.set(params.sessionId, {
|
|
1379
|
+
sessionId: params.sessionId,
|
|
1380
|
+
sessionKey: session.sessionKey,
|
|
1381
|
+
idempotencyKey: runId,
|
|
1382
|
+
disconnectContext: this.activeDisconnectContext ?? void 0,
|
|
1383
|
+
resolve,
|
|
1384
|
+
reject
|
|
1385
|
+
});
|
|
1386
|
+
if (this.activeDisconnectContext && !this.disconnectTimer) this.armDisconnectTimer(this.activeDisconnectContext);
|
|
1387
|
+
const sendWithProvenanceFallback = async () => {
|
|
1388
|
+
try {
|
|
1389
|
+
await this.gateway.request("chat.send", {
|
|
1390
|
+
...requestParams,
|
|
1391
|
+
systemInputProvenance,
|
|
1392
|
+
systemProvenanceReceipt
|
|
1393
|
+
}, { timeoutMs: null });
|
|
1394
|
+
const pending = this.getPendingPrompt(params.sessionId, runId);
|
|
1395
|
+
if (pending) pending.sendAccepted = true;
|
|
1396
|
+
} catch (err) {
|
|
1397
|
+
if ((systemInputProvenance || systemProvenanceReceipt) && isAdminScopeProvenanceRejection(err)) {
|
|
1398
|
+
await this.gateway.request("chat.send", requestParams, { timeoutMs: null });
|
|
1399
|
+
const pending = this.getPendingPrompt(params.sessionId, runId);
|
|
1400
|
+
if (pending) pending.sendAccepted = true;
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
throw err;
|
|
1404
|
+
}
|
|
1405
|
+
};
|
|
1406
|
+
sendWithProvenanceFallback().catch((err) => {
|
|
1407
|
+
if (isGatewayCloseError(err) && this.getPendingPrompt(params.sessionId, runId)) return;
|
|
1408
|
+
this.pendingPrompts.delete(params.sessionId);
|
|
1409
|
+
this.sessionStore.clearActiveRun(params.sessionId);
|
|
1410
|
+
if (this.pendingPrompts.size === 0) this.clearDisconnectTimer();
|
|
1411
|
+
reject(err instanceof Error ? err : new Error(String(err)));
|
|
1412
|
+
});
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
async cancel(params) {
|
|
1416
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1417
|
+
if (!session) return;
|
|
1418
|
+
const activeRunId = session.activeRunId;
|
|
1419
|
+
this.sessionStore.cancelActiveRun(params.sessionId);
|
|
1420
|
+
const pending = this.pendingPrompts.get(params.sessionId);
|
|
1421
|
+
const scopedRunId = activeRunId ?? pending?.idempotencyKey;
|
|
1422
|
+
if (!scopedRunId) return;
|
|
1423
|
+
try {
|
|
1424
|
+
await this.gateway.request("chat.abort", {
|
|
1425
|
+
sessionKey: session.sessionKey,
|
|
1426
|
+
runId: scopedRunId
|
|
1427
|
+
});
|
|
1428
|
+
} catch (err) {
|
|
1429
|
+
this.log(`cancel error: ${String(err)}`);
|
|
1430
|
+
}
|
|
1431
|
+
if (pending) {
|
|
1432
|
+
this.pendingPrompts.delete(params.sessionId);
|
|
1433
|
+
if (this.pendingPrompts.size === 0) this.clearDisconnectTimer();
|
|
1434
|
+
pending.resolve({ stopReason: "cancelled" });
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
async resolveSessionKeyFromMeta(params) {
|
|
1438
|
+
const sessionKey = await resolveSessionKey({
|
|
1439
|
+
meta: params.meta,
|
|
1440
|
+
fallbackKey: params.fallbackKey,
|
|
1441
|
+
gateway: this.gateway,
|
|
1442
|
+
opts: this.opts
|
|
1443
|
+
});
|
|
1444
|
+
await resetSessionIfNeeded({
|
|
1445
|
+
meta: params.meta,
|
|
1446
|
+
sessionKey,
|
|
1447
|
+
gateway: this.gateway,
|
|
1448
|
+
opts: this.opts
|
|
1449
|
+
});
|
|
1450
|
+
return sessionKey;
|
|
1451
|
+
}
|
|
1452
|
+
async handleAgentEvent(evt) {
|
|
1453
|
+
const payload = evt.payload;
|
|
1454
|
+
if (!payload) return;
|
|
1455
|
+
const stream = payload.stream;
|
|
1456
|
+
const runId = payload.runId;
|
|
1457
|
+
const data = payload.data;
|
|
1458
|
+
const sessionKey = payload.sessionKey;
|
|
1459
|
+
if (!stream || !data || !sessionKey) return;
|
|
1460
|
+
if (stream !== "tool") return;
|
|
1461
|
+
const phase = data.phase;
|
|
1462
|
+
const name = data.name;
|
|
1463
|
+
const toolCallId = data.toolCallId;
|
|
1464
|
+
if (!toolCallId) return;
|
|
1465
|
+
const pending = this.findPendingBySessionKey(sessionKey, runId);
|
|
1466
|
+
if (!pending) return;
|
|
1467
|
+
if (phase === "start") {
|
|
1468
|
+
if (!pending.toolCalls) pending.toolCalls = /* @__PURE__ */ new Map();
|
|
1469
|
+
if (pending.toolCalls.has(toolCallId)) return;
|
|
1470
|
+
const args = data.args;
|
|
1471
|
+
const title = formatToolTitle(name, args);
|
|
1472
|
+
const kind = inferToolKind(name);
|
|
1473
|
+
const locations = extractToolCallLocations(args);
|
|
1474
|
+
pending.toolCalls.set(toolCallId, {
|
|
1475
|
+
title,
|
|
1476
|
+
kind,
|
|
1477
|
+
rawInput: args,
|
|
1478
|
+
locations
|
|
1479
|
+
});
|
|
1480
|
+
await this.connection.sessionUpdate({
|
|
1481
|
+
sessionId: pending.sessionId,
|
|
1482
|
+
update: {
|
|
1483
|
+
sessionUpdate: "tool_call",
|
|
1484
|
+
toolCallId,
|
|
1485
|
+
title,
|
|
1486
|
+
status: "in_progress",
|
|
1487
|
+
rawInput: args,
|
|
1488
|
+
kind,
|
|
1489
|
+
locations
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
if (phase === "update") {
|
|
1495
|
+
const toolState = pending.toolCalls?.get(toolCallId);
|
|
1496
|
+
const partialResult = data.partialResult;
|
|
1497
|
+
await this.connection.sessionUpdate({
|
|
1498
|
+
sessionId: pending.sessionId,
|
|
1499
|
+
update: {
|
|
1500
|
+
sessionUpdate: "tool_call_update",
|
|
1501
|
+
toolCallId,
|
|
1502
|
+
status: "in_progress",
|
|
1503
|
+
rawOutput: partialResult,
|
|
1504
|
+
content: extractToolCallContent(partialResult),
|
|
1505
|
+
locations: extractToolCallLocations(toolState?.locations, partialResult)
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
if (phase === "result") {
|
|
1511
|
+
const isError = Boolean(data.isError);
|
|
1512
|
+
const toolState = pending.toolCalls?.get(toolCallId);
|
|
1513
|
+
pending.toolCalls?.delete(toolCallId);
|
|
1514
|
+
await this.connection.sessionUpdate({
|
|
1515
|
+
sessionId: pending.sessionId,
|
|
1516
|
+
update: {
|
|
1517
|
+
sessionUpdate: "tool_call_update",
|
|
1518
|
+
toolCallId,
|
|
1519
|
+
status: isError ? "failed" : "completed",
|
|
1520
|
+
rawOutput: data.result,
|
|
1521
|
+
content: extractToolCallContent(data.result),
|
|
1522
|
+
locations: extractToolCallLocations(toolState?.locations, data.result)
|
|
1523
|
+
}
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
async handleChatEvent(evt) {
|
|
1528
|
+
const payload = evt.payload;
|
|
1529
|
+
if (!payload) return;
|
|
1530
|
+
const sessionKey = payload.sessionKey;
|
|
1531
|
+
const state = payload.state;
|
|
1532
|
+
const runId = payload.runId;
|
|
1533
|
+
const messageData = payload.message;
|
|
1534
|
+
if (!sessionKey || !state) return;
|
|
1535
|
+
const pending = this.findPendingBySessionKey(sessionKey, runId);
|
|
1536
|
+
if (!pending) return;
|
|
1537
|
+
if (messageData && (state === "delta" || state === "final")) {
|
|
1538
|
+
await this.handleDeltaEvent(pending.sessionId, messageData);
|
|
1539
|
+
if (state === "delta") return;
|
|
1540
|
+
}
|
|
1541
|
+
if (state === "final") {
|
|
1542
|
+
const stopReason = payload.stopReason === "max_tokens" ? "max_tokens" : "end_turn";
|
|
1543
|
+
await this.finishPrompt(pending.sessionId, pending, stopReason);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
if (state === "aborted") {
|
|
1547
|
+
await this.finishPrompt(pending.sessionId, pending, "cancelled");
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
if (state === "error") {
|
|
1551
|
+
const stopReason = payload.errorKind === "refusal" ? "refusal" : "end_turn";
|
|
1552
|
+
this.finishPrompt(pending.sessionId, pending, stopReason);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
async handleDeltaEvent(sessionId, messageData) {
|
|
1556
|
+
const content = messageData.content;
|
|
1557
|
+
const pending = this.pendingPrompts.get(sessionId);
|
|
1558
|
+
if (!pending) return;
|
|
1559
|
+
const fullThought = content?.filter((block) => block?.type === "thinking").map((block) => block.thinking ?? "").join("\n").trimEnd();
|
|
1560
|
+
const sentThoughtSoFar = pending.sentThoughtLength ?? 0;
|
|
1561
|
+
if (fullThought && fullThought.length > sentThoughtSoFar) {
|
|
1562
|
+
const newThought = fullThought.slice(sentThoughtSoFar);
|
|
1563
|
+
pending.sentThoughtLength = fullThought.length;
|
|
1564
|
+
pending.sentThought = fullThought;
|
|
1565
|
+
await this.connection.sessionUpdate({
|
|
1566
|
+
sessionId,
|
|
1567
|
+
update: {
|
|
1568
|
+
sessionUpdate: "agent_thought_chunk",
|
|
1569
|
+
content: {
|
|
1570
|
+
type: "text",
|
|
1571
|
+
text: newThought
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
const fullText = content?.filter((block) => block?.type === "text").map((block) => block.text ?? "").join("\n").trimEnd();
|
|
1577
|
+
const sentSoFar = pending.sentTextLength ?? 0;
|
|
1578
|
+
if (!fullText || fullText.length <= sentSoFar) return;
|
|
1579
|
+
const newText = fullText.slice(sentSoFar);
|
|
1580
|
+
pending.sentTextLength = fullText.length;
|
|
1581
|
+
pending.sentText = fullText;
|
|
1582
|
+
await this.connection.sessionUpdate({
|
|
1583
|
+
sessionId,
|
|
1584
|
+
update: {
|
|
1585
|
+
sessionUpdate: "agent_message_chunk",
|
|
1586
|
+
content: {
|
|
1587
|
+
type: "text",
|
|
1588
|
+
text: newText
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
async finishPrompt(sessionId, pending, stopReason) {
|
|
1594
|
+
this.pendingPrompts.delete(sessionId);
|
|
1595
|
+
this.sessionStore.clearActiveRun(sessionId);
|
|
1596
|
+
if (this.pendingPrompts.size === 0) this.clearDisconnectTimer();
|
|
1597
|
+
const sessionSnapshot = await this.getSessionSnapshot(pending.sessionKey);
|
|
1598
|
+
try {
|
|
1599
|
+
await this.sendSessionSnapshotUpdate(sessionId, sessionSnapshot, { includeControls: false });
|
|
1600
|
+
} catch (err) {
|
|
1601
|
+
this.log(`session snapshot update failed for ${sessionId}: ${String(err)}`);
|
|
1602
|
+
}
|
|
1603
|
+
pending.resolve({ stopReason });
|
|
1604
|
+
}
|
|
1605
|
+
findPendingBySessionKey(sessionKey, runId) {
|
|
1606
|
+
for (const pending of this.pendingPrompts.values()) {
|
|
1607
|
+
if (pending.sessionKey !== sessionKey) continue;
|
|
1608
|
+
if (runId && pending.idempotencyKey !== runId) continue;
|
|
1609
|
+
return pending;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
clearDisconnectTimer() {
|
|
1613
|
+
if (!this.disconnectTimer) return;
|
|
1614
|
+
clearTimeout(this.disconnectTimer);
|
|
1615
|
+
this.disconnectTimer = null;
|
|
1616
|
+
}
|
|
1617
|
+
armDisconnectTimer(disconnectContext) {
|
|
1618
|
+
this.clearDisconnectTimer();
|
|
1619
|
+
this.disconnectTimer = setTimeout(() => {
|
|
1620
|
+
this.disconnectTimer = null;
|
|
1621
|
+
this.reconcilePendingPrompts(disconnectContext.generation, true);
|
|
1622
|
+
}, ACP_GATEWAY_DISCONNECT_GRACE_MS);
|
|
1623
|
+
this.disconnectTimer.unref?.();
|
|
1624
|
+
}
|
|
1625
|
+
rejectPendingPrompt(pending, error) {
|
|
1626
|
+
if (this.getPendingPrompt(pending.sessionId, pending.idempotencyKey) !== pending) return;
|
|
1627
|
+
this.pendingPrompts.delete(pending.sessionId);
|
|
1628
|
+
this.sessionStore.clearActiveRun(pending.sessionId);
|
|
1629
|
+
if (this.pendingPrompts.size === 0) this.clearDisconnectTimer();
|
|
1630
|
+
pending.reject(error);
|
|
1631
|
+
}
|
|
1632
|
+
clearPendingDisconnectState(pending, disconnectContext) {
|
|
1633
|
+
if (pending.disconnectContext !== disconnectContext) return;
|
|
1634
|
+
pending.disconnectContext = void 0;
|
|
1635
|
+
}
|
|
1636
|
+
shouldRejectPendingAtDisconnectDeadline(pending, disconnectContext) {
|
|
1637
|
+
return pending.disconnectContext === disconnectContext && (!pending.sendAccepted || this.activeDisconnectContext?.generation === disconnectContext.generation);
|
|
1638
|
+
}
|
|
1639
|
+
async reconcilePendingPrompts(observedDisconnectGeneration, deadlineExpired) {
|
|
1640
|
+
if (this.pendingPrompts.size === 0) {
|
|
1641
|
+
if (this.disconnectGeneration === observedDisconnectGeneration) this.clearDisconnectTimer();
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
const pendingEntries = [...this.pendingPrompts.entries()];
|
|
1645
|
+
let keepDisconnectTimer = false;
|
|
1646
|
+
for (const [sessionId, pending] of pendingEntries) {
|
|
1647
|
+
if (this.pendingPrompts.get(sessionId) !== pending) continue;
|
|
1648
|
+
if (pending.disconnectContext?.generation !== observedDisconnectGeneration) continue;
|
|
1649
|
+
if (await this.reconcilePendingPrompt(sessionId, pending, deadlineExpired)) keepDisconnectTimer = true;
|
|
1650
|
+
}
|
|
1651
|
+
if (!keepDisconnectTimer && this.disconnectGeneration === observedDisconnectGeneration) this.clearDisconnectTimer();
|
|
1652
|
+
}
|
|
1653
|
+
async reconcilePendingPrompt(sessionId, pending, deadlineExpired) {
|
|
1654
|
+
const disconnectContext = pending.disconnectContext;
|
|
1655
|
+
if (!disconnectContext) return false;
|
|
1656
|
+
let result;
|
|
1657
|
+
try {
|
|
1658
|
+
result = await this.gateway.request("agent.wait", {
|
|
1659
|
+
runId: pending.idempotencyKey,
|
|
1660
|
+
timeoutMs: 0
|
|
1661
|
+
}, { timeoutMs: null });
|
|
1662
|
+
} catch (err) {
|
|
1663
|
+
this.log(`agent.wait reconcile failed for ${pending.idempotencyKey}: ${String(err)}`);
|
|
1664
|
+
if (deadlineExpired) {
|
|
1665
|
+
if (this.shouldRejectPendingAtDisconnectDeadline(pending, disconnectContext)) {
|
|
1666
|
+
this.rejectPendingPrompt(pending, /* @__PURE__ */ new Error(`Gateway disconnected: ${disconnectContext.reason}`));
|
|
1667
|
+
return false;
|
|
1668
|
+
}
|
|
1669
|
+
this.clearPendingDisconnectState(pending, disconnectContext);
|
|
1670
|
+
return false;
|
|
1671
|
+
}
|
|
1672
|
+
return true;
|
|
1673
|
+
}
|
|
1674
|
+
const currentPending = this.getPendingPrompt(sessionId, pending.idempotencyKey);
|
|
1675
|
+
if (!currentPending) return false;
|
|
1676
|
+
if (result?.status === "ok") {
|
|
1677
|
+
await this.finishPrompt(sessionId, currentPending, "end_turn");
|
|
1678
|
+
return false;
|
|
1679
|
+
}
|
|
1680
|
+
if (result?.status === "error") {
|
|
1681
|
+
this.finishPrompt(sessionId, currentPending, "end_turn");
|
|
1682
|
+
return false;
|
|
1683
|
+
}
|
|
1684
|
+
if (deadlineExpired) {
|
|
1685
|
+
if (this.shouldRejectPendingAtDisconnectDeadline(currentPending, disconnectContext)) {
|
|
1686
|
+
const currentDisconnectContext = currentPending.disconnectContext;
|
|
1687
|
+
if (!currentDisconnectContext) return false;
|
|
1688
|
+
this.rejectPendingPrompt(currentPending, /* @__PURE__ */ new Error(`Gateway disconnected: ${currentDisconnectContext.reason}`));
|
|
1689
|
+
return false;
|
|
1690
|
+
}
|
|
1691
|
+
this.clearPendingDisconnectState(currentPending, disconnectContext);
|
|
1692
|
+
return false;
|
|
1693
|
+
}
|
|
1694
|
+
return true;
|
|
1695
|
+
}
|
|
1696
|
+
async sendAvailableCommands(sessionId) {
|
|
1697
|
+
await this.connection.sessionUpdate({
|
|
1698
|
+
sessionId,
|
|
1699
|
+
update: {
|
|
1700
|
+
sessionUpdate: "available_commands_update",
|
|
1701
|
+
availableCommands: await getAvailableCommandsForAcp()
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
async getSessionSnapshot(sessionKey, overrides) {
|
|
1706
|
+
try {
|
|
1707
|
+
const row = await this.getGatewaySessionRow(sessionKey);
|
|
1708
|
+
return {
|
|
1709
|
+
...buildSessionPresentation({
|
|
1710
|
+
row,
|
|
1711
|
+
overrides
|
|
1712
|
+
}),
|
|
1713
|
+
metadata: buildSessionMetadata({
|
|
1714
|
+
row,
|
|
1715
|
+
sessionKey
|
|
1716
|
+
}),
|
|
1717
|
+
usage: buildSessionUsageSnapshot(row)
|
|
1718
|
+
};
|
|
1719
|
+
} catch (err) {
|
|
1720
|
+
this.log(`session presentation fallback for ${sessionKey}: ${String(err)}`);
|
|
1721
|
+
return {
|
|
1722
|
+
...buildSessionPresentation({ overrides }),
|
|
1723
|
+
metadata: buildSessionMetadata({ sessionKey })
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
async getGatewaySessionRow(sessionKey) {
|
|
1728
|
+
const session = (await this.gateway.request("sessions.list", {
|
|
1729
|
+
limit: 200,
|
|
1730
|
+
search: sessionKey,
|
|
1731
|
+
includeDerivedTitles: true
|
|
1732
|
+
})).sessions.find((entry) => entry.key === sessionKey);
|
|
1733
|
+
if (!session) return;
|
|
1734
|
+
return {
|
|
1735
|
+
displayName: session.displayName,
|
|
1736
|
+
label: session.label,
|
|
1737
|
+
derivedTitle: session.derivedTitle,
|
|
1738
|
+
updatedAt: session.updatedAt,
|
|
1739
|
+
thinkingLevel: session.thinkingLevel,
|
|
1740
|
+
thinkingLevels: session.thinkingLevels,
|
|
1741
|
+
modelProvider: session.modelProvider,
|
|
1742
|
+
model: session.model,
|
|
1743
|
+
fastMode: session.fastMode,
|
|
1744
|
+
verboseLevel: session.verboseLevel,
|
|
1745
|
+
traceLevel: session.traceLevel,
|
|
1746
|
+
reasoningLevel: session.reasoningLevel,
|
|
1747
|
+
responseUsage: session.responseUsage,
|
|
1748
|
+
elevatedLevel: session.elevatedLevel,
|
|
1749
|
+
totalTokens: session.totalTokens,
|
|
1750
|
+
totalTokensFresh: session.totalTokensFresh,
|
|
1751
|
+
contextTokens: session.contextTokens
|
|
1752
|
+
};
|
|
1753
|
+
}
|
|
1754
|
+
resolveSessionConfigPatch(configId, value) {
|
|
1755
|
+
if (typeof value !== "string") throw new Error(`ACP bridge does not support non-string session config option values for "${configId}".`);
|
|
1756
|
+
switch (configId) {
|
|
1757
|
+
case ACP_THOUGHT_LEVEL_CONFIG_ID: return {
|
|
1758
|
+
patch: { thinkingLevel: value },
|
|
1759
|
+
overrides: { thinkingLevel: value }
|
|
1760
|
+
};
|
|
1761
|
+
case ACP_FAST_MODE_CONFIG_ID: return {
|
|
1762
|
+
patch: { fastMode: value === "on" },
|
|
1763
|
+
overrides: { fastMode: value === "on" }
|
|
1764
|
+
};
|
|
1765
|
+
case ACP_VERBOSE_LEVEL_CONFIG_ID: return {
|
|
1766
|
+
patch: { verboseLevel: value },
|
|
1767
|
+
overrides: { verboseLevel: value }
|
|
1768
|
+
};
|
|
1769
|
+
case ACP_TRACE_LEVEL_CONFIG_ID: return {
|
|
1770
|
+
patch: { traceLevel: value },
|
|
1771
|
+
overrides: { traceLevel: value }
|
|
1772
|
+
};
|
|
1773
|
+
case ACP_REASONING_LEVEL_CONFIG_ID: return {
|
|
1774
|
+
patch: { reasoningLevel: value },
|
|
1775
|
+
overrides: { reasoningLevel: value }
|
|
1776
|
+
};
|
|
1777
|
+
case ACP_RESPONSE_USAGE_CONFIG_ID: return {
|
|
1778
|
+
patch: { responseUsage: value },
|
|
1779
|
+
overrides: { responseUsage: value }
|
|
1780
|
+
};
|
|
1781
|
+
case ACP_ELEVATED_LEVEL_CONFIG_ID: return {
|
|
1782
|
+
patch: { elevatedLevel: value },
|
|
1783
|
+
overrides: { elevatedLevel: value }
|
|
1784
|
+
};
|
|
1785
|
+
case ACP_TIMEOUT_CONFIG_ID:
|
|
1786
|
+
case ACP_TIMEOUT_SECONDS_CONFIG_ID: return { overrides: {} };
|
|
1787
|
+
default: throw new Error(`ACP bridge mode does not support session config option "${configId}".`);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
async getSessionTranscript(sessionKey) {
|
|
1791
|
+
const result = await this.gateway.request("sessions.get", {
|
|
1792
|
+
key: sessionKey,
|
|
1793
|
+
limit: ACP_LOAD_SESSION_REPLAY_LIMIT
|
|
1794
|
+
});
|
|
1795
|
+
if (!Array.isArray(result.messages)) return [];
|
|
1796
|
+
return result.messages;
|
|
1797
|
+
}
|
|
1798
|
+
async replaySessionTranscript(sessionId, transcript) {
|
|
1799
|
+
for (const message of transcript) {
|
|
1800
|
+
const replayChunks = extractReplayChunks(message);
|
|
1801
|
+
for (const chunk of replayChunks) await this.connection.sessionUpdate({
|
|
1802
|
+
sessionId,
|
|
1803
|
+
update: {
|
|
1804
|
+
sessionUpdate: chunk.sessionUpdate,
|
|
1805
|
+
content: {
|
|
1806
|
+
type: "text",
|
|
1807
|
+
text: chunk.text
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
async sendSessionSnapshotUpdate(sessionId, sessionSnapshot, options) {
|
|
1814
|
+
if (options.includeControls) {
|
|
1815
|
+
await this.connection.sessionUpdate({
|
|
1816
|
+
sessionId,
|
|
1817
|
+
update: {
|
|
1818
|
+
sessionUpdate: "current_mode_update",
|
|
1819
|
+
currentModeId: sessionSnapshot.modes.currentModeId
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
await this.connection.sessionUpdate({
|
|
1823
|
+
sessionId,
|
|
1824
|
+
update: {
|
|
1825
|
+
sessionUpdate: "config_option_update",
|
|
1826
|
+
configOptions: sessionSnapshot.configOptions
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
if (sessionSnapshot.metadata) await this.connection.sessionUpdate({
|
|
1831
|
+
sessionId,
|
|
1832
|
+
update: {
|
|
1833
|
+
sessionUpdate: "session_info_update",
|
|
1834
|
+
...sessionSnapshot.metadata
|
|
1835
|
+
}
|
|
1836
|
+
});
|
|
1837
|
+
if (sessionSnapshot.usage) await this.connection.sessionUpdate({
|
|
1838
|
+
sessionId,
|
|
1839
|
+
update: {
|
|
1840
|
+
sessionUpdate: "usage_update",
|
|
1841
|
+
used: sessionSnapshot.usage.used,
|
|
1842
|
+
size: sessionSnapshot.usage.size,
|
|
1843
|
+
_meta: {
|
|
1844
|
+
source: "gateway-session-store",
|
|
1845
|
+
approximate: true
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
assertSupportedSessionSetup(mcpServers) {
|
|
1851
|
+
if (mcpServers.length === 0) return;
|
|
1852
|
+
throw new Error("ACP bridge mode does not support per-session MCP servers. Configure MCP on the OpenClaw gateway or agent instead.");
|
|
1853
|
+
}
|
|
1854
|
+
enforceSessionCreateRateLimit(method) {
|
|
1855
|
+
const budget = this.sessionCreateRateLimiter.consume();
|
|
1856
|
+
if (budget.allowed) return;
|
|
1857
|
+
throw new Error(`ACP session creation rate limit exceeded for ${method}; retry after ${Math.ceil(budget.retryAfterMs / 1e3)}s.`);
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
//#endregion
|
|
1861
|
+
//#region src/acp/server.ts
|
|
1862
|
+
async function serveAcpGateway(opts = {}) {
|
|
1863
|
+
routeLogsToStderr();
|
|
1864
|
+
const bootstrap = await resolveGatewayClientBootstrap({
|
|
1865
|
+
config: getRuntimeConfig(),
|
|
1866
|
+
gatewayUrl: opts.gatewayUrl,
|
|
1867
|
+
explicitAuth: {
|
|
1868
|
+
token: opts.gatewayToken,
|
|
1869
|
+
password: opts.gatewayPassword
|
|
1870
|
+
},
|
|
1871
|
+
env: process.env
|
|
1872
|
+
});
|
|
1873
|
+
let agent = null;
|
|
1874
|
+
let onClosed;
|
|
1875
|
+
const closed = new Promise((resolve) => {
|
|
1876
|
+
onClosed = resolve;
|
|
1877
|
+
});
|
|
1878
|
+
let stopped = false;
|
|
1879
|
+
let onGatewayReadyResolve;
|
|
1880
|
+
let onGatewayReadyReject;
|
|
1881
|
+
let gatewayReadySettled = false;
|
|
1882
|
+
const gatewayReady = new Promise((resolve, reject) => {
|
|
1883
|
+
onGatewayReadyResolve = resolve;
|
|
1884
|
+
onGatewayReadyReject = reject;
|
|
1885
|
+
});
|
|
1886
|
+
const resolveGatewayReady = () => {
|
|
1887
|
+
if (gatewayReadySettled) return;
|
|
1888
|
+
gatewayReadySettled = true;
|
|
1889
|
+
onGatewayReadyResolve();
|
|
1890
|
+
};
|
|
1891
|
+
const rejectGatewayReady = (err) => {
|
|
1892
|
+
if (gatewayReadySettled) return;
|
|
1893
|
+
gatewayReadySettled = true;
|
|
1894
|
+
onGatewayReadyReject(err instanceof Error ? err : new Error(String(err)));
|
|
1895
|
+
};
|
|
1896
|
+
const gateway = new GatewayClient({
|
|
1897
|
+
url: bootstrap.url,
|
|
1898
|
+
token: bootstrap.auth.token,
|
|
1899
|
+
password: bootstrap.auth.password,
|
|
1900
|
+
preauthHandshakeTimeoutMs: bootstrap.preauthHandshakeTimeoutMs,
|
|
1901
|
+
clientName: GATEWAY_CLIENT_NAMES.CLI,
|
|
1902
|
+
clientDisplayName: "ACP",
|
|
1903
|
+
clientVersion: "acp",
|
|
1904
|
+
mode: GATEWAY_CLIENT_MODES.CLI,
|
|
1905
|
+
onEvent: (evt) => {
|
|
1906
|
+
agent?.handleGatewayEvent(evt);
|
|
1907
|
+
},
|
|
1908
|
+
onHelloOk: () => {
|
|
1909
|
+
resolveGatewayReady();
|
|
1910
|
+
agent?.handleGatewayReconnect();
|
|
1911
|
+
},
|
|
1912
|
+
onConnectError: (err) => {
|
|
1913
|
+
rejectGatewayReady(err);
|
|
1914
|
+
},
|
|
1915
|
+
onClose: (code, reason) => {
|
|
1916
|
+
if (!stopped) rejectGatewayReady(/* @__PURE__ */ new Error(`gateway closed before ready (${code}): ${reason}`));
|
|
1917
|
+
agent?.handleGatewayDisconnect(`${code}: ${reason}`);
|
|
1918
|
+
if (stopped) onClosed();
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
const shutdown = () => {
|
|
1922
|
+
if (stopped) return;
|
|
1923
|
+
stopped = true;
|
|
1924
|
+
resolveGatewayReady();
|
|
1925
|
+
gateway.stop();
|
|
1926
|
+
onClosed();
|
|
1927
|
+
};
|
|
1928
|
+
process.once("SIGINT", shutdown);
|
|
1929
|
+
process.once("SIGTERM", shutdown);
|
|
1930
|
+
if (!(await startGatewayClientWhenEventLoopReady(gateway, { clientOptions: { preauthHandshakeTimeoutMs: bootstrap.preauthHandshakeTimeoutMs } })).ready) rejectGatewayReady(/* @__PURE__ */ new Error("gateway event loop readiness timeout"));
|
|
1931
|
+
await gatewayReady.catch((err) => {
|
|
1932
|
+
shutdown();
|
|
1933
|
+
throw err;
|
|
1934
|
+
});
|
|
1935
|
+
if (stopped) return closed;
|
|
1936
|
+
new AgentSideConnection((conn) => {
|
|
1937
|
+
agent = new AcpGatewayAgent(conn, gateway, opts);
|
|
1938
|
+
agent.start();
|
|
1939
|
+
return agent;
|
|
1940
|
+
}, ndJsonStream(Writable.toWeb(process.stdout), Readable.toWeb(process.stdin)));
|
|
1941
|
+
return closed;
|
|
1942
|
+
}
|
|
1943
|
+
function parseArgs(args) {
|
|
1944
|
+
const opts = {};
|
|
1945
|
+
let tokenFile;
|
|
1946
|
+
let passwordFile;
|
|
1947
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
1948
|
+
const arg = args[i];
|
|
1949
|
+
if (arg === "--url" || arg === "--gateway-url") {
|
|
1950
|
+
opts.gatewayUrl = args[i + 1];
|
|
1951
|
+
i += 1;
|
|
1952
|
+
continue;
|
|
1953
|
+
}
|
|
1954
|
+
if (arg === "--token" || arg === "--gateway-token") {
|
|
1955
|
+
opts.gatewayToken = args[i + 1];
|
|
1956
|
+
i += 1;
|
|
1957
|
+
continue;
|
|
1958
|
+
}
|
|
1959
|
+
if (arg === "--token-file" || arg === "--gateway-token-file") {
|
|
1960
|
+
tokenFile = args[i + 1];
|
|
1961
|
+
i += 1;
|
|
1962
|
+
continue;
|
|
1963
|
+
}
|
|
1964
|
+
if (arg === "--password" || arg === "--gateway-password") {
|
|
1965
|
+
opts.gatewayPassword = args[i + 1];
|
|
1966
|
+
i += 1;
|
|
1967
|
+
continue;
|
|
1968
|
+
}
|
|
1969
|
+
if (arg === "--password-file" || arg === "--gateway-password-file") {
|
|
1970
|
+
passwordFile = args[i + 1];
|
|
1971
|
+
i += 1;
|
|
1972
|
+
continue;
|
|
1973
|
+
}
|
|
1974
|
+
if (arg === "--session") {
|
|
1975
|
+
opts.defaultSessionKey = args[i + 1];
|
|
1976
|
+
i += 1;
|
|
1977
|
+
continue;
|
|
1978
|
+
}
|
|
1979
|
+
if (arg === "--session-label") {
|
|
1980
|
+
opts.defaultSessionLabel = args[i + 1];
|
|
1981
|
+
i += 1;
|
|
1982
|
+
continue;
|
|
1983
|
+
}
|
|
1984
|
+
if (arg === "--require-existing") {
|
|
1985
|
+
opts.requireExistingSession = true;
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (arg === "--reset-session") {
|
|
1989
|
+
opts.resetSession = true;
|
|
1990
|
+
continue;
|
|
1991
|
+
}
|
|
1992
|
+
if (arg === "--no-prefix-cwd") {
|
|
1993
|
+
opts.prefixCwd = false;
|
|
1994
|
+
continue;
|
|
1995
|
+
}
|
|
1996
|
+
if (arg === "--provenance") {
|
|
1997
|
+
const provenanceMode = normalizeAcpProvenanceMode(args[i + 1]);
|
|
1998
|
+
if (!provenanceMode) throw new Error("Invalid --provenance value. Use off, meta, or meta+receipt.");
|
|
1999
|
+
opts.provenanceMode = provenanceMode;
|
|
2000
|
+
i += 1;
|
|
2001
|
+
continue;
|
|
2002
|
+
}
|
|
2003
|
+
if (arg === "--verbose" || arg === "-v") {
|
|
2004
|
+
opts.verbose = true;
|
|
2005
|
+
continue;
|
|
2006
|
+
}
|
|
2007
|
+
if (arg === "--help" || arg === "-h") {
|
|
2008
|
+
printHelp();
|
|
2009
|
+
process.exit(0);
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
const gatewayToken = normalizeOptionalString(opts.gatewayToken);
|
|
2013
|
+
const gatewayPassword = normalizeOptionalString(opts.gatewayPassword);
|
|
2014
|
+
const normalizedTokenFile = normalizeOptionalString(tokenFile);
|
|
2015
|
+
const normalizedPasswordFile = normalizeOptionalString(passwordFile);
|
|
2016
|
+
if (gatewayToken && normalizedTokenFile) throw new Error("Use either --token or --token-file.");
|
|
2017
|
+
if (gatewayPassword && normalizedPasswordFile) throw new Error("Use either --password or --password-file.");
|
|
2018
|
+
if (normalizedTokenFile) opts.gatewayToken = readSecretFromFile(normalizedTokenFile, "Gateway token");
|
|
2019
|
+
if (normalizedPasswordFile) opts.gatewayPassword = readSecretFromFile(normalizedPasswordFile, "Gateway password");
|
|
2020
|
+
return opts;
|
|
2021
|
+
}
|
|
2022
|
+
function printHelp() {
|
|
2023
|
+
console.log(`Usage: openclaw acp [options]
|
|
2024
|
+
|
|
2025
|
+
Gateway-backed ACP server for IDE integration.
|
|
2026
|
+
|
|
2027
|
+
Options:
|
|
2028
|
+
--url <url> Gateway WebSocket URL
|
|
2029
|
+
--token <token> Gateway auth token
|
|
2030
|
+
--token-file <path> Read gateway auth token from file
|
|
2031
|
+
--password <password> Gateway auth password
|
|
2032
|
+
--password-file <path> Read gateway auth password from file
|
|
2033
|
+
--session <key> Default session key (e.g. "agent:main:main")
|
|
2034
|
+
--session-label <label> Default session label to resolve
|
|
2035
|
+
--require-existing Fail if the session key/label does not exist
|
|
2036
|
+
--reset-session Reset the session key before first use
|
|
2037
|
+
--no-prefix-cwd Do not prefix prompts with the working directory
|
|
2038
|
+
--provenance <mode> ACP provenance mode: off, meta, or meta+receipt
|
|
2039
|
+
--verbose, -v Verbose logging to stderr
|
|
2040
|
+
--help, -h Show this help message
|
|
2041
|
+
`);
|
|
2042
|
+
}
|
|
2043
|
+
if (isMainModule({ currentFile: fileURLToPath(import.meta.url) })) {
|
|
2044
|
+
const argv = process.argv.slice(2);
|
|
2045
|
+
if (argv.includes("--token") || argv.includes("--gateway-token")) console.error("Warning: --token can be exposed via process listings. Prefer --token-file or OPENCLAW_GATEWAY_TOKEN.");
|
|
2046
|
+
if (argv.includes("--password") || argv.includes("--gateway-password")) console.error("Warning: --password can be exposed via process listings. Prefer --password-file or OPENCLAW_GATEWAY_PASSWORD.");
|
|
2047
|
+
serveAcpGateway(parseArgs(argv)).catch((err) => {
|
|
2048
|
+
console.error(String(err));
|
|
2049
|
+
process.exit(1);
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/cli/acp-cli.ts
|
|
2054
|
+
function registerAcpCli(program) {
|
|
2055
|
+
const acp = program.command("acp").description("Run an ACP bridge backed by the Gateway");
|
|
2056
|
+
acp.option("--url <url>", "Gateway WebSocket URL (defaults to gateway.remote.url when configured)").option("--token <token>", "Gateway token (if required)").option("--token-file <path>", "Read gateway token from file").option("--password <password>", "Gateway password (if required)").option("--password-file <path>", "Read gateway password from file").option("--session <key>", "Default session key (e.g. agent:main:main)").option("--session-label <label>", "Default session label to resolve").option("--require-existing", "Fail if the session key/label does not exist", false).option("--reset-session", "Reset the session key before first use", false).option("--no-prefix-cwd", "Do not prefix prompts with the working directory", false).option("--provenance <mode>", "ACP provenance mode: off, meta, or meta+receipt").option("-v, --verbose", "Verbose logging to stderr", false).addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/acp", "docs.openclaw.ai/cli/acp")}\n`).action(async (opts) => {
|
|
2057
|
+
try {
|
|
2058
|
+
const { gatewayToken, gatewayPassword } = resolveGatewayAuthOptions(opts);
|
|
2059
|
+
const provenanceMode = normalizeAcpProvenanceMode(opts.provenance);
|
|
2060
|
+
if (opts.provenance && !provenanceMode) throw new Error("Invalid --provenance value. Use off, meta, or meta+receipt.");
|
|
2061
|
+
await serveAcpGateway({
|
|
2062
|
+
gatewayUrl: opts.url,
|
|
2063
|
+
gatewayToken,
|
|
2064
|
+
gatewayPassword,
|
|
2065
|
+
defaultSessionKey: opts.session,
|
|
2066
|
+
defaultSessionLabel: opts.sessionLabel,
|
|
2067
|
+
requireExistingSession: Boolean(opts.requireExisting),
|
|
2068
|
+
resetSession: Boolean(opts.resetSession),
|
|
2069
|
+
prefixCwd: !opts.noPrefixCwd,
|
|
2070
|
+
provenanceMode,
|
|
2071
|
+
verbose: Boolean(opts.verbose)
|
|
2072
|
+
});
|
|
2073
|
+
} catch (err) {
|
|
2074
|
+
defaultRuntime.error(String(err));
|
|
2075
|
+
defaultRuntime.exit(1);
|
|
2076
|
+
}
|
|
2077
|
+
});
|
|
2078
|
+
acp.command("client").description("Run an interactive ACP client against the local ACP bridge").option("--cwd <dir>", "Working directory for the ACP session").option("--server <command>", "ACP server command (default: openclaw)").option("--server-args <args...>", "Extra arguments for the ACP server").option("--server-verbose", "Enable verbose logging on the ACP server", false).option("-v, --verbose", "Verbose client logging", false).action(async (opts, command) => {
|
|
2079
|
+
const inheritedVerbose = inheritOptionFromParent(command, "verbose");
|
|
2080
|
+
try {
|
|
2081
|
+
await runAcpClientInteractive({
|
|
2082
|
+
cwd: opts.cwd,
|
|
2083
|
+
serverCommand: opts.server,
|
|
2084
|
+
serverArgs: opts.serverArgs,
|
|
2085
|
+
serverVerbose: Boolean(opts.serverVerbose),
|
|
2086
|
+
verbose: Boolean(opts.verbose || inheritedVerbose)
|
|
2087
|
+
});
|
|
2088
|
+
} catch (err) {
|
|
2089
|
+
defaultRuntime.error(String(err));
|
|
2090
|
+
defaultRuntime.exit(1);
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
//#endregion
|
|
2095
|
+
export { registerAcpCli };
|