kaijibot 2026.8.21 → 2026.8.23
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/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/.buildstamp +1 -1
- package/dist/abort-Bg5O8Yiz.js +202 -0
- package/dist/abort-cutoff.runtime-CvjKPRCc.js +20 -0
- package/dist/abort-cutoff.runtime.js +1 -1
- package/dist/abort.runtime-UZvtDM6M.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/acp-cli-BHDaxHbu.js +2171 -0
- package/dist/acp-spawn-BJJ8QbXE.js +1024 -0
- package/dist/acp-stateful-target-driver-DyZ1dneY.js +88 -0
- package/dist/action-agents-Bx5S-ZYL.js +67 -0
- package/dist/action-focus-DGURwLDo.js +124 -0
- package/dist/action-help-7ey3e-V9.js +7 -0
- package/dist/action-info-BxQpOqFZ.js +58 -0
- package/dist/action-kill-C7kGSXgP.js +33 -0
- package/dist/action-list-cwGVroWS.js +21 -0
- package/dist/action-log-DT-bRM9X.js +30 -0
- package/dist/action-send-BNv-Wz-l.js +39 -0
- package/dist/action-spawn-DkEYjxPF.js +46 -0
- package/dist/action-unfocus-CU1WRop0.js +28 -0
- package/dist/agent-BOaVCAE9.js +2 -0
- package/dist/agent-command-0Ie27CS4.js +1479 -0
- package/dist/agent-runner-utils-fBrjJUeq.js +202 -0
- package/dist/agent-runner.runtime-DEArTfVM.js +2825 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- 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-CH6NQBfT.js +5 -0
- package/dist/agents-DuBi4yGs.js +887 -0
- package/dist/anthropic-vertex-stream-C-dr7gew.js +5666 -0
- package/dist/api-C-d6hJ6R.js +3 -0
- package/dist/api-CWzMTsre.js +35 -0
- package/dist/api-CspIEuoI.js +4 -0
- package/dist/api-DWfH8UCU.js +19 -0
- package/dist/api-DnP8S2bH.js +5 -0
- package/dist/api-Y8trG2YC.js +2 -0
- package/dist/api-fZ1Mwhb9.js +2 -0
- package/dist/api-inKLxoen.js +45 -0
- package/dist/api-plrtNPKq.js +2 -0
- package/dist/api-tiV4Lam3.js +2 -0
- package/dist/apply-DyMW1n_a.js +493 -0
- package/dist/apply.runtime-BOvle-IJ.js +166 -0
- package/dist/apply.runtime-C0ny2nmc.js +2 -0
- package/dist/apply.runtime.js +1 -1
- package/dist/approval-client-helpers-Ss4gUaso.js +82 -0
- package/dist/approval-gateway-resolver-D6xh0K2G.js +58 -0
- package/dist/approval-gateway-runtime-CffF6RIQ.js +2 -0
- package/dist/approval-handler-runtime-p9BmT1Xf.js +439 -0
- package/dist/approval-native-runtime-DN73OHKf.js +709 -0
- package/dist/approval-renderers-CITEnajR.js +64 -0
- package/dist/asr-Jt-OmxEb.js +196 -0
- package/dist/audit-BM_BshdA.js +885 -0
- package/dist/audit-extra.async-Cvm-ViC4.js +847 -0
- package/dist/audit.deep.runtime-Ccabqd1Y.js +2 -0
- package/dist/audit.deep.runtime.js +1 -1
- package/dist/audit.nondeep.runtime-BNrDSb24.js +859 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-BKUEHsrE.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-Dt8gUUJi.js +181 -0
- package/dist/auth-choice-BC_BWYZD.js +3 -0
- package/dist/auth-choice-BtwWAcEq.js +71 -0
- package/dist/auth-choice-CO__21te.js +353 -0
- package/dist/auth-choice-options-BxgjFsFO.js +104 -0
- package/dist/auth-choice-prompt-B-P39mib.js +2 -0
- package/dist/auth-choice-prompt-Dp7Vptqj.js +36 -0
- package/dist/auth-choice.plugin-providers.runtime-BJqmauZz.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-CPclIUZ3.js +165 -0
- package/dist/auth-profiles-P49vCUs4.js +438 -0
- package/dist/auth-profiles.runtime-pIuc_0v-.js +7 -0
- package/dist/auth-profiles.runtime.js +1 -1
- package/dist/auto-recall-Dm-J3oEj.js +78 -0
- package/dist/backup-create-DcO0pYFy.js +391 -0
- package/dist/banner-CIw8Yepm.js +2 -0
- package/dist/banner-w4GNKrs6.js +281 -0
- package/dist/binding-routing-upMo3iCO.js +50 -0
- package/dist/binding-targets-C9WygzAM.js +99 -0
- package/dist/bridge-server-Cu0xkN0E.js +103 -0
- package/dist/browser-config-runtime-3QVJiqnP.js +6 -0
- package/dist/browser-control-auth-BkunTzw7.js +120 -0
- package/dist/browser-node-runtime-BusKdg2E.js +12 -0
- package/dist/browser-profiles-BocOxjqC.js +170 -0
- package/dist/browser-runtime-D3goJLF9.js +377 -0
- package/dist/browser-setup-tools-j-IDYASL.js +12 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +4 -4
- package/dist/bundled/session-memory/handler.js +2 -2
- package/dist/call-CMDK9Mqx.js +2 -0
- package/dist/call-Cisydyym.js +495 -0
- package/dist/call.runtime-CJUaD_Ck.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-e_bf338W.js +1357 -0
- package/dist/catalog-provider-D5mzbnCM.js +40 -0
- package/dist/cdp.helpers-BqVqEY02.js +372 -0
- package/dist/channel-core-cQ4DROoP.js +5 -0
- package/dist/channel-summary-BHojSrOd.js +139 -0
- package/dist/channel-summary-CzjCL-4-.js +2 -0
- package/dist/channel.runtime-D6e2VBFb.js +399 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-cli-Y-Wnalvd.js +248 -0
- package/dist/channels-uiGUmLk2.js +1147 -0
- package/dist/chat-CQc5lJAu.js +213 -0
- package/dist/chrome-BcU0ZvUn.js +1080 -0
- package/dist/chrome.executables-Dp0Lkjmz.js +550 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-BGB7qdp3.js +191 -0
- package/dist/cli-BtTS8CKF.js +2 -0
- package/dist/cli-CQX3q4Fm.js +57 -0
- package/dist/cli-ZLAF588A.js +154 -0
- package/dist/cli-auth-seam-D-Qci5-b.js +14 -0
- package/dist/cli-backend-DxaeTZ8N.js +66 -0
- package/dist/cli-g4KJW_UT.js +2 -0
- package/dist/cli-migration-B2SFdY0j.js +127 -0
- package/dist/cli-runner-BVQt0v1D.js +1662 -0
- package/dist/cli-runner.runtime-BAMS4uW0.js +3 -0
- package/dist/cli-runner.runtime-H3alxbDK.js +2 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-shared-BaJRfEqD.js +142 -0
- package/dist/cli-startup-metadata.json +2 -2
- package/dist/cli.runtime-CQ1qvGdJ.js +819 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-bootstrap-BE7PiMJr.js +28 -0
- package/dist/codex-native-web-search-TdFXLTHZ.js +2 -0
- package/dist/codex-native-web-search-dKQT4ZPV.js +156 -0
- package/dist/collector-BXDPP4rJ.js +2 -0
- package/dist/collector-CT3qBEYi.js +424 -0
- package/dist/command-auth-FR5r0kKW.js +75 -0
- package/dist/command-config-resolution-BfTLOZxI.js +23 -0
- package/dist/command-config-resolution-GV0h_B0u.js +2 -0
- package/dist/command-execution-startup-oMdUg9Py.js +269 -0
- package/dist/command-format-CZ8oMoC9.js +2 -0
- package/dist/command-queue-BlORGS1M.js +260 -0
- package/dist/command-registry-DNKWkedC.js +3 -0
- package/dist/command-registry-DO6fBZ31.js +113 -0
- package/dist/command-secret-gateway-Cnjliq_k.js +528 -0
- package/dist/commands-acp-OeD4TGXU.js +1017 -0
- package/dist/commands-compact.runtime-ZE5b-Pvj.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-core.runtime-Ca3exd9B.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-DKL8ULNw.js +3762 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-uaQEC1GX.js +306 -0
- package/dist/commands-reset-hooks-0RFpUGBC.js +129 -0
- package/dist/commands-status-4HTjDVIN.js +223 -0
- package/dist/commands-status.runtime-CyJiWLQs.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-B3DtD7Se.js +3 -0
- package/dist/commands-subagents-control.runtime-BLHWicyx.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands.runtime-Bk9-pUEs.js +103 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/comment-shared-BCggDOtV.js +40 -0
- package/dist/compact-CBJu2_ft.js +11324 -0
- package/dist/compact.runtime-Bj3PGRRh.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-B27D7vni.js +468 -0
- package/dist/completion-cli-QdkbM0Vz.js +2 -0
- package/dist/config-BZb7_jO5.js +166 -0
- package/dist/config-C2M27bOw.js +8 -0
- package/dist/config-D_fICGrQ.js +53 -0
- package/dist/config-cli-B7j3KePQ.js +948 -0
- package/dist/config-defaults-XFEo6I7v.js +163 -0
- package/dist/config-guard-wGGj2x7b.js +94 -0
- package/dist/config-runtime-xwO8vvQP.js +14 -0
- package/dist/config-validation-tPbNhbrH.js +279 -0
- package/dist/configure-CXFWPXal.js +1162 -0
- package/dist/configure-lBR_2rAt.js +2 -0
- package/dist/connection-auth-ClCO21bT.js +30 -0
- package/dist/context-CJMC7SyI.js +249 -0
- package/dist/context-CWC_tVM8.js +2 -0
- package/dist/context-writer-DNkMBOu9.js +290 -0
- package/dist/control-auth-DUZs9D8n.js +122 -0
- package/dist/control-ui/assets/agents-HENIRhRj.js +767 -0
- package/dist/control-ui/assets/anthropic-DlOZcqqy.js +40 -0
- package/dist/control-ui/assets/azure-openai-responses-BmSDwKAQ.js +2 -0
- package/dist/control-ui/assets/cron-B2CJajqc.js +744 -0
- package/dist/control-ui/assets/dialogues-DmWmdbMF.js +83 -0
- package/dist/control-ui/assets/history-CP7LOJan.js +71 -0
- package/dist/control-ui/assets/index-BsGBtIKy.css +1 -0
- package/dist/control-ui/assets/index-BtNFbQhY.js +2686 -0
- package/dist/control-ui/assets/mistral-CYEJ-E7G.js +72 -0
- package/dist/control-ui/assets/openai-codex-responses-BnLjDxo3.js +8 -0
- package/dist/control-ui/assets/openai-completions-D46D4eD2.js +6 -0
- package/dist/control-ui/assets/openai-responses-CNVWXuC0.js +2 -0
- package/dist/control-ui/assets/openai-responses-shared-ByeOE-gc.js +13 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/conversation-id-DlazDTmW.js +140 -0
- package/dist/conversation-runtime-BjljNAU1.js +31 -0
- package/dist/core-4Dt1_PpO.js +210 -0
- package/dist/cron-cli-CTGN3Kum.js +637 -0
- package/dist/curator-BM2jeaou.js +600 -0
- package/dist/curator-_QLWjb7r.js +2 -0
- package/dist/daemon-cli-BLe7aLfJ.js +476 -0
- package/dist/daemon-install-BneaHOcs.js +70 -0
- package/dist/delegate-CyUm6mk6.js +61 -0
- package/dist/deliver-BvUx9v-a.js +3 -0
- package/dist/deliver-DQbRPHSb.js +782 -0
- package/dist/deliver-runtime-ERlRZAW4.js +2 -0
- package/dist/delivery-outbound.runtime-Bi6Lu4JP.js +6 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-B4kCxhnW.js +2 -0
- package/dist/delivery-queue-DDHwRyN-.js +372 -0
- package/dist/deps-DZQeVHSD.js +60 -0
- package/dist/devices-cli-CFSjN2KZ.js +336 -0
- package/dist/diagnostic-Bh12mVkv.js +311 -0
- package/dist/direct-dm-Bn07LLbq.js +139 -0
- package/dist/directive-handling.fast-lane-Cd6SSr-l.js +64 -0
- package/dist/directive-handling.fast-lane-ejwgECy7.js +2 -0
- package/dist/directive-handling.impl-Bpy5KQZr.js +659 -0
- package/dist/directive-handling.impl-ZEKrT-pi.js +2 -0
- package/dist/directive-handling.parse-COyCTXvI.js +376 -0
- package/dist/directive-handling.persist-CgxhTMmz.js +139 -0
- package/dist/directive-handling.persist.runtime-4pppF2CM.js +2 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directive-handling.shared-BuNzwbwp.js +159 -0
- package/dist/directory-cli-gWQfdmFR.js +240 -0
- package/dist/dispatch-Cg_O6HsU.js +1126 -0
- package/dist/dispatch-acp-C7kPkeqX.js +969 -0
- package/dist/dispatch-acp-manager.runtime-Bh3V5wGh.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-pWY6A7VY.js +3 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-session.runtime-DdkuSkq8.js +2 -0
- package/dist/dispatch-acp-session.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-fr_7acr8.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dns-cli-C4uepTJE.js +193 -0
- package/dist/docs-cli-DWzfteG6.js +156 -0
- package/dist/doctor-completion-D2s3ieS6.js +90 -0
- package/dist/doctor-config-preflight-BIf8igIW.js +148 -0
- package/dist/doctor-config-preflight-BiJSPUPg.js +2 -0
- package/dist/doctor-state-migrations-BbfPLoLz.js +2 -0
- package/dist/doctor-state-migrations-DFQets45.js +3 -0
- package/dist/drive-CvbBPFcl.js +718 -0
- package/dist/embedding-provider-DUT_HxYD.js +26 -0
- package/dist/embedding-provider-DjVEIg-4.js +33 -0
- package/dist/embedding-provider-TKNNnQ3m.js +129 -0
- package/dist/engine-CT4xJJ-H.js +82 -0
- package/dist/engine-embeddings-BN4uJOv0.js +1489 -0
- package/dist/entry-capabilities-BhpTqh0w.js +89 -0
- package/dist/entry.js +2 -2
- package/dist/env-overrides-Dn5yy0l4.js +347 -0
- package/dist/env-overrides.runtime-DdD841Km.js +7 -0
- package/dist/env-overrides.runtime.js +1 -1
- package/dist/exec-approval-forwarder.runtime-CV81fvQh.js +3 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-reply-C_NfihTE.js +292 -0
- package/dist/exec-approvals-cli-DKOFcUAn.js +485 -0
- package/dist/exec-defaults-Cs1FwIKH.js +1440 -0
- package/dist/extensionAPI.js +4 -4
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/anthropic/api.js +2 -2
- package/dist/extensions/anthropic/cli-auth-seam.js +1 -1
- package/dist/extensions/anthropic/cli-backend-api.js +2 -2
- package/dist/extensions/anthropic/cli-backend.js +1 -1
- package/dist/extensions/anthropic/cli-migration.js +1 -1
- package/dist/extensions/anthropic/cli-shared.js +1 -1
- package/dist/extensions/anthropic/config-defaults.js +1 -1
- package/dist/extensions/anthropic/contract-api.js +1 -1
- package/dist/extensions/anthropic/index.js +1 -1
- package/dist/extensions/anthropic/media-understanding-provider.js +1 -1
- package/dist/extensions/anthropic/provider-policy-api.js +1 -1
- package/dist/extensions/anthropic/register.runtime.js +1 -1
- package/dist/extensions/anthropic/setup-api.js +1 -1
- package/dist/extensions/anthropic/stream-wrappers.js +1 -1
- package/dist/extensions/anthropic/test-api.js +3 -3
- package/dist/extensions/anthropic-vertex/api.js +3 -3
- package/dist/extensions/anthropic-vertex/index.js +2 -2
- package/dist/extensions/anthropic-vertex/provider-catalog.js +1 -1
- package/dist/extensions/anthropic-vertex/region.js +1 -1
- package/dist/extensions/anthropic-vertex/setup-api.js +1 -1
- package/dist/extensions/arcee/index.js +2 -2
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +1 -1
- package/dist/extensions/browser/browser-config.js +3 -3
- package/dist/extensions/browser/browser-control-auth.js +1 -1
- package/dist/extensions/browser/browser-doctor.js +4 -4
- package/dist/extensions/browser/browser-host-inspection.js +1 -1
- package/dist/extensions/browser/browser-maintenance.js +2 -2
- package/dist/extensions/browser/browser-profiles.js +1 -1
- package/dist/extensions/browser/browser-runtime-api.js +11 -11
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +12 -12
- package/dist/extensions/browser/setup-api.js +2 -2
- package/dist/extensions/browser/test-support.js +1 -1
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/cerebras/index.js +1 -1
- package/dist/extensions/chutes/api.js +3 -3
- package/dist/extensions/chutes/index.js +7 -7
- package/dist/extensions/chutes/models.js +1 -1
- package/dist/extensions/chutes/onboard.js +2 -2
- package/dist/extensions/chutes/provider-catalog.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/api.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/catalog-provider.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +6 -6
- package/dist/extensions/deepinfra/api.js +3 -3
- package/dist/extensions/deepinfra/embedding-provider.js +1 -1
- package/dist/extensions/deepinfra/index.js +4 -4
- package/dist/extensions/deepinfra/media-understanding-provider.js +1 -1
- package/dist/extensions/deepinfra/memory-embedding-adapter.js +1 -1
- package/dist/extensions/deepinfra/video-generation-provider.js +1 -1
- package/dist/extensions/deepseek/index.js +1 -1
- package/dist/extensions/device-pair/api.js +2 -2
- package/dist/extensions/device-pair/index.js +5 -5
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/diffs/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/diffs/index.js +1 -1
- package/dist/extensions/diffs/node_modules/.package-lock.json +3 -3
- package/dist/extensions/diffs/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/diffs/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/diffs/node_modules/typebox/package.json +1 -1
- package/dist/extensions/exa/index.js +1 -1
- package/dist/extensions/feishu/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/feishu/api.js +16 -16
- package/dist/extensions/feishu/contract-api.js +2 -2
- package/dist/extensions/feishu/node_modules/.package-lock.json +3 -3
- package/dist/extensions/feishu/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/feishu/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/feishu/node_modules/typebox/package.json +1 -1
- package/dist/extensions/feishu/runtime-api.js +2 -2
- package/dist/extensions/feishu/security-contract-api.js +1 -1
- package/dist/extensions/feishu/session-key-api.js +1 -1
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/fireworks/index.js +1 -1
- package/dist/extensions/github-copilot/api.js +1 -1
- package/dist/extensions/github-copilot/index.js +6 -6
- package/dist/extensions/github-copilot/login.js +1 -1
- package/dist/extensions/github-copilot/models-defaults.js +1 -1
- package/dist/extensions/github-copilot/models.js +1 -1
- package/dist/extensions/github-copilot/register.runtime.js +4 -4
- package/dist/extensions/github-copilot/replay-policy.js +1 -1
- package/dist/extensions/google/api.js +1 -1
- package/dist/extensions/google/gemini-cli-provider.js +1 -1
- package/dist/extensions/google/image-generation-provider.js +1 -1
- package/dist/extensions/google/index.js +5 -5
- package/dist/extensions/google/media-understanding-provider.js +1 -1
- package/dist/extensions/google/music-generation-provider.js +1 -1
- package/dist/extensions/google/oauth-token-shared.js +1 -1
- package/dist/extensions/google/oauth.credentials.js +1 -1
- package/dist/extensions/google/oauth.flow.js +1 -1
- package/dist/extensions/google/oauth.js +2 -2
- package/dist/extensions/google/oauth.runtime.js +1 -1
- package/dist/extensions/google/oauth.settings.js +1 -1
- package/dist/extensions/google/oauth.token.js +1 -1
- package/dist/extensions/google/provider-models.js +1 -1
- package/dist/extensions/google/provider-registration.js +1 -1
- package/dist/extensions/google/runtime-api.js +2 -2
- package/dist/extensions/google/test-api.js +2 -2
- package/dist/extensions/google/video-generation-provider.js +1 -1
- package/dist/extensions/google/web-search-provider.js +1 -1
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/groq/test-api.js +1 -1
- package/dist/extensions/huggingface/api.js +3 -3
- package/dist/extensions/huggingface/index.js +3 -3
- package/dist/extensions/huggingface/models.js +1 -1
- package/dist/extensions/huggingface/onboard.js +1 -1
- package/dist/extensions/huggingface/provider-catalog.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/kilocode/api.js +2 -2
- package/dist/extensions/kilocode/index.js +6 -6
- package/dist/extensions/kilocode/onboard.js +2 -2
- package/dist/extensions/kilocode/provider-catalog.js +1 -1
- package/dist/extensions/kilocode/provider-models.js +1 -1
- package/dist/extensions/kilocode/shared.js +1 -1
- package/dist/extensions/kimi-coding/index.js +3 -3
- package/dist/extensions/kindle-portal/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/.package-lock.json +3 -3
- package/dist/extensions/kindle-portal/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/package.json +1 -1
- package/dist/extensions/knowledge-wiki/index.js +2 -2
- package/dist/extensions/litellm/index.js +1 -1
- package/dist/extensions/llm-task/index.js +1 -1
- package/dist/extensions/lmstudio/api.js +6 -6
- package/dist/extensions/lmstudio/index.js +2 -2
- package/dist/extensions/lmstudio/runtime-api.js +1 -1
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +12 -12
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +5 -5
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/memory-lancedb/index.js +1 -1
- package/dist/extensions/microsoft/index.js +1 -1
- package/dist/extensions/microsoft/speech-provider.js +1 -1
- package/dist/extensions/microsoft/test-api.js +1 -1
- package/dist/extensions/microsoft/tts.js +1 -1
- package/dist/extensions/microsoft-foundry/auth.js +1 -1
- package/dist/extensions/microsoft-foundry/cli.js +1 -1
- package/dist/extensions/microsoft-foundry/index.js +1 -1
- package/dist/extensions/microsoft-foundry/onboard.js +2 -2
- package/dist/extensions/microsoft-foundry/provider.js +1 -1
- package/dist/extensions/microsoft-foundry/runtime.js +1 -1
- package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
- package/dist/extensions/microsoft-foundry/shared.js +1 -1
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +7 -7
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/minimax/provider-registration.js +1 -1
- package/dist/extensions/minimax/speech-provider.js +1 -1
- package/dist/extensions/minimax/test-api.js +2 -2
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/mistral/embedding-provider.js +1 -1
- package/dist/extensions/mistral/index.js +2 -2
- package/dist/extensions/mistral/media-understanding-provider.js +1 -1
- package/dist/extensions/mistral/memory-embedding-adapter.js +3 -3
- package/dist/extensions/mistral/test-api.js +1 -1
- package/dist/extensions/moonshot/index.js +5 -5
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/moonshot/test-api.js +2 -2
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/nvidia/index.js +1 -1
- package/dist/extensions/ollama/api.js +3 -3
- package/dist/extensions/ollama/index.js +6 -6
- package/dist/extensions/ollama/runtime-api.js +2 -2
- package/dist/extensions/ollama/web-search-provider.js +1 -1
- package/dist/extensions/openai/api.js +3 -3
- package/dist/extensions/openai/image-generation-provider.js +1 -1
- package/dist/extensions/openai/index.js +9 -9
- package/dist/extensions/openai/media-understanding-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-auth-identity.js +1 -1
- package/dist/extensions/openai/openai-codex-cli-auth.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-shared.js +1 -1
- package/dist/extensions/openai/openai-provider.js +1 -1
- package/dist/extensions/openai/prompt-overlay.js +1 -1
- package/dist/extensions/openai/realtime-provider-shared.js +1 -1
- package/dist/extensions/openai/realtime-transcription-provider.js +1 -1
- package/dist/extensions/openai/realtime-voice-provider.js +1 -1
- package/dist/extensions/openai/register.runtime.js +8 -8
- package/dist/extensions/openai/shared.js +1 -1
- package/dist/extensions/openai/speech-provider.js +1 -1
- package/dist/extensions/openai/test-api.js +5 -5
- package/dist/extensions/openai/transport-policy.js +1 -1
- package/dist/extensions/openai/video-generation-provider.js +1 -1
- package/dist/extensions/opencode/index.js +3 -3
- package/dist/extensions/opencode-go/index.js +2 -2
- package/dist/extensions/openrouter/api.js +2 -2
- package/dist/extensions/openrouter/image-generation-provider.js +1 -1
- package/dist/extensions/openrouter/index.js +6 -6
- package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
- package/dist/extensions/openrouter/music-generation-provider.js +1 -1
- package/dist/extensions/openrouter/test-api.js +3 -3
- package/dist/extensions/openrouter/video-generation-provider.js +1 -1
- package/dist/extensions/openshell/index.js +4 -4
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/index.js +3 -3
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/test-api.js +2 -2
- package/dist/extensions/qwen/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/sglang/api.js +2 -2
- package/dist/extensions/sglang/index.js +2 -2
- package/dist/extensions/sglang/models.js +1 -1
- package/dist/extensions/sherpa-speech/asr.js +1 -1
- package/dist/extensions/sherpa-speech/engine.js +1 -1
- package/dist/extensions/sherpa-speech/index.js +1 -1
- package/dist/extensions/speech-core/api.js +2 -2
- package/dist/extensions/speech-core/runtime-api.js +4 -4
- package/dist/extensions/stepfun/index.js +2 -2
- package/dist/extensions/talk-voice/index.js +3 -3
- package/dist/extensions/tavily/index.js +1 -1
- package/dist/extensions/together/index.js +1 -1
- package/dist/extensions/together/video-generation-provider.js +1 -1
- package/dist/extensions/venice/api.js +3 -3
- package/dist/extensions/venice/index.js +5 -5
- package/dist/extensions/venice/models.js +1 -1
- package/dist/extensions/venice/onboard.js +2 -2
- package/dist/extensions/venice/provider-catalog.js +1 -1
- package/dist/extensions/vercel-ai-gateway/index.js +1 -1
- package/dist/extensions/vllm/api.js +2 -2
- package/dist/extensions/vllm/index.js +2 -2
- package/dist/extensions/vllm/models.js +1 -1
- package/dist/extensions/vllm/register.runtime.js +2 -2
- package/dist/extensions/volcengine/index.js +2 -2
- package/dist/extensions/vydra/image-generation-provider.js +1 -1
- package/dist/extensions/vydra/index.js +5 -5
- package/dist/extensions/vydra/shared.js +1 -1
- package/dist/extensions/vydra/speech-provider.js +1 -1
- package/dist/extensions/vydra/video-generation-provider.js +1 -1
- package/dist/extensions/webhooks/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +3 -3
- package/dist/extensions/webhooks/runtime-api.js +1 -1
- package/dist/extensions/wechat/api.js +3 -3
- package/dist/extensions/xai/api.js +5 -5
- package/dist/extensions/xai/code-execution.js +3 -3
- package/dist/extensions/xai/index.js +9 -9
- package/dist/extensions/xai/model-definitions.js +1 -1
- package/dist/extensions/xai/onboard.js +1 -1
- package/dist/extensions/xai/provider-catalog.js +1 -1
- package/dist/extensions/xai/provider-models.js +1 -1
- package/dist/extensions/xai/setup-api.js +1 -1
- package/dist/extensions/xai/video-generation-provider.js +1 -1
- package/dist/extensions/xai/web-search.js +1 -1
- package/dist/extensions/xai/x-search.js +3 -3
- package/dist/extensions/xiaomi/index.js +1 -1
- package/dist/extensions/zai/index.js +5 -5
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zai/test-api.js +1 -1
- package/dist/extra-params-CEZLNZPM.js +295 -0
- package/dist/format-P9xNDyfD.js +245 -0
- package/dist/fragment-collector-D6OalgG0.js +189 -0
- package/dist/gateway-cli-Zfvn259p.js +1532 -0
- package/dist/gateway-install-token-6z725yP4.js +284 -0
- package/dist/gateway-rpc-BIq75xob.js +14 -0
- package/dist/gateway-rpc.runtime-qaUC59kw.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gemini-cli-provider-DapCuX8Q.js +106 -0
- package/dist/gemini-web-search-provider-qckYFHgT.js +167 -0
- package/dist/get-reply-from-config.runtime-DHsGpgGI.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/gmail-setup-utils-Cc3pRzTO.js +422 -0
- package/dist/health-3b-YI19K.js +579 -0
- package/dist/health-MLtfjMov.js +2 -0
- package/dist/heartbeat-runner-BUj0aHm6.js +4 -0
- package/dist/heartbeat-runner-CsnBv3An.js +1365 -0
- package/dist/heartbeat-runner.runtime-DYHZ3Vol.js +2 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/help-ktSd2tag.js +76 -0
- package/dist/hooks-cli-IZb2tmWn.js +364 -0
- package/dist/image-C3lHN8WH.js +152 -0
- package/dist/image-generation-core-Csa-tOLR.js +17 -0
- package/dist/image-generation-core.auth.runtime-DWfzUU3N.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-Bq81bEDF.js +94 -0
- package/dist/image-generation-provider-D9rV0jKg.js +280 -0
- package/dist/image-generation-provider-DLxx1bzz.js +130 -0
- package/dist/image-generation-provider-DtYtLZ5X.js +136 -0
- package/dist/image-generation-provider-DxkBVWXc.js +163 -0
- package/dist/image-generation-runtime-BSjvNi3e.js +2 -0
- package/dist/image-runtime-DiMm78ho.js +7 -0
- package/dist/inbound-reply-dispatch-vAjY1w2F.js +73 -0
- package/dist/inbound.runtime-CRF3jMe0.js +3 -0
- package/dist/inbound.runtime-DTPuWSKr.js +4 -0
- package/dist/inbound.runtime.js +1 -1
- package/dist/index.js +2 -2
- package/dist/infra-runtime-D3jjt6RI.js +25 -0
- package/dist/ingest-DZbARiPc.js +2 -0
- package/dist/ingest-gzQEKaUE.js +842 -0
- package/dist/io-NwOu0Lqq.js +7188 -0
- package/dist/io-p7f7Dzgz.js +5 -0
- package/dist/kaijibot-tools-DlPDuhB1.js +9434 -0
- package/dist/kaijibot-tools.runtime-Cme2o8P6.js +2 -0
- package/dist/kaijibot-tools.runtime.js +1 -1
- package/dist/kimi-web-search-provider-Ccz-6FOv.js +308 -0
- package/dist/library-CNY5LwdW.js +45 -0
- package/dist/lifecycle-DPisznBr.js +51 -0
- package/dist/lifecycle-core-DHpL48zF.js +422 -0
- package/dist/list.runtime-BGQLMIEV.js +9 -0
- package/dist/list.runtime-rNaKvGI6.js +12 -0
- package/dist/list.runtime.js +1 -1
- package/dist/llm-engine-CJ4a8si7.js +2 -0
- package/dist/llm-engine-JflSw21y.js +1792 -0
- package/dist/llm-extractor-f_T1e84b.js +445 -0
- package/dist/llm-slug-generator.js +2 -2
- package/dist/load-context-BgiRixkE.js +51 -0
- package/dist/logging-BmlPHvHz.js +13 -0
- package/dist/logging-i6p97HMj.js +2 -0
- package/dist/login-BCtkm5rk.js +108 -0
- package/dist/logs-cli-ObIjoAas.js +264 -0
- package/dist/logs-cli.runtime-BFjo2k4n.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/manager-CWqmCOrL.js +2049 -0
- package/dist/manager-YA9gsC3-.js +3314 -0
- package/dist/mcp/plugin-tools-serve.js +3 -3
- package/dist/mcp-cli-4snhlJll.js +733 -0
- package/dist/mcp-config-BorcRx6O.js +115 -0
- package/dist/media-runtime-we0ajcYl.js +312 -0
- package/dist/media-understanding-provider-3Ttl6hmp.js +18 -0
- package/dist/media-understanding-provider-BGTcMbZI.js +13 -0
- package/dist/media-understanding-provider-BWZtBNix.js +30 -0
- package/dist/media-understanding-provider-CLJBFDyf.js +123 -0
- package/dist/media-understanding-provider-CZ0oRDnO.js +69 -0
- package/dist/media-understanding-provider-CfBvdveE.js +112 -0
- package/dist/media-understanding-provider-D6Ei6zjV.js +18 -0
- package/dist/media-understanding-provider-DEbLZtur.js +37 -0
- package/dist/media-understanding-provider-DysTPulI.js +14 -0
- package/dist/media-understanding-provider-guIrycoj.js +21 -0
- package/dist/media-understanding-provider-sqqt3Zo1.js +67 -0
- package/dist/media-understanding-runtime-DIH8yX06.js +2 -0
- package/dist/media-understanding-zIdRKTHF.js +83 -0
- package/dist/memory-CEPz51C1.js +242 -0
- package/dist/memory-Dz9LyrwM.js +3 -0
- package/dist/memory-core-host-engine-embeddings-D_hioQXv.js +2 -0
- package/dist/memory-core-host-engine-foundation-1Abnrvzg.js +11 -0
- package/dist/memory-core-host-runtime-cli-CPpWR4jD.js +9 -0
- package/dist/memory-core-host-runtime-core-QOAE1eXJ.js +8 -0
- package/dist/memory-embedding-adapter-CJMHQ4fD.js +33 -0
- package/dist/memory-host-search.runtime-CCL0QyRa.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-index-BaKGqStn.js +2 -0
- package/dist/memory-index-Dq16t3Le.js +514 -0
- package/dist/memory-runtime-Cr2ycPVC.js +2 -0
- package/dist/memory-runtime-DuWAywa6.js +26 -0
- package/dist/message-B59-6tOr.js +223 -0
- package/dist/message-action-runner-CD2L-ZBQ.js +2 -0
- package/dist/message-action-runner-y-EYEp0n.js +1628 -0
- package/dist/message.config.runtime-NCa2v5Ci.js +3 -0
- package/dist/message.config.runtime.js +1 -1
- package/dist/message.gateway.runtime-Ba2cmeG0.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/metadata-registry-loader-BAAhCgIz.js +2 -0
- package/dist/metadata-registry-loader-D7YsnsL7.js +15 -0
- package/dist/minimax-vlm-CRQ1qjBy.js +183 -0
- package/dist/minimax-web-search-provider-CBq2_5UU.js +165 -0
- package/dist/mmr-CqmAMXIW.js +146 -0
- package/dist/model-NNxPja4R.js +630 -0
- package/dist/model-auth-BCNvl8s6.js +427 -0
- package/dist/model-auth-label-B0iZbvPM.js +45 -0
- package/dist/model-catalog-B_WMQ0w_.js +204 -0
- package/dist/model-definitions-YQ1lzfH1.js +258 -0
- package/dist/model-picker-ByUUyua6.js +3 -0
- package/dist/model-picker-D2NwBUVu.js +500 -0
- package/dist/model-picker.runtime-BLIC1v4k.js +15 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-selection-BNkt6VsY.js +381 -0
- package/dist/model-suppression-BLpblK4C.js +28 -0
- package/dist/model-suppression.runtime-CzgXh3-Q.js +7 -0
- package/dist/model-suppression.runtime.js +1 -1
- package/dist/models-11Amlqm7.js +2584 -0
- package/dist/models-BAPi-xJJ.js +2 -0
- package/dist/models-BUxoFu33.js +47 -0
- package/dist/models-Ch34kBry.js +18 -0
- package/dist/models-CxT1_oJh.js +157 -0
- package/dist/models-DdsCg0Z3.js +18 -0
- package/dist/models-cli-DyOOLtYl.js +198 -0
- package/dist/models-config-C91hdcPk.js +900 -0
- package/dist/models-config.providers.secrets-CAQfFlJs.js +299 -0
- package/dist/models-jeG3zz29.js +555 -0
- package/dist/models-uX_1Gq3N.js +760 -0
- package/dist/models.fetch-CBAxXkYq.js +518 -0
- package/dist/monitor-DAF8Gyq4.js +4435 -0
- package/dist/monitor-DSKG-_yl.js +1023 -0
- package/dist/music-generation-provider-BnrTAmbY.js +142 -0
- package/dist/music-generation-provider-CEN-hiuw.js +238 -0
- package/dist/music-generation-provider-CltAphNV.js +169 -0
- package/dist/node-cli-DiZrvwCr.js +2374 -0
- package/dist/nodes-cli-CHIEN-F1.js +1046 -0
- package/dist/nodes-utils-DsRDUdkI.js +196 -0
- package/dist/notify-CLlD_xFa.js +305 -0
- package/dist/oauth-BH1NzJxX.js +57 -0
- package/dist/oauth-oo4i0YoK.js +152 -0
- package/dist/oauth-token-shared-DQSx2gNJ.js +28 -0
- package/dist/oauth.credentials-Bry_dis_.js +165 -0
- package/dist/oauth.flow-BHm8lbRc.js +122 -0
- package/dist/oauth.settings-BEQZQI_l.js +44 -0
- package/dist/oauth.token-CrxxQ__U.js +43 -0
- package/dist/onboard-7nVuWCbc.js +25 -0
- package/dist/onboard-BR4C6q_p.js +25 -0
- package/dist/onboard-CLJvlk15.js +621 -0
- package/dist/onboard-CdxRLmEw2.js +58 -0
- package/dist/onboard-ClstIj39.js +29 -0
- package/dist/onboard-DCvok686.js +25 -0
- package/dist/onboard-RcjANnyK.js +312 -0
- package/dist/onboard-custom-utbZx3tp.js +2 -0
- package/dist/onboard-custom-zmMvywOs.js +647 -0
- package/dist/onboard-helpers-DptwxvqO.js +223 -0
- package/dist/onboard-helpers-hUiLSHkd.js +5 -0
- package/dist/onboard-remote-BLFcjcH2.js +2 -0
- package/dist/onboard-remote-D21HhC2v.js +193 -0
- package/dist/onboard-search-D-BZAp6B.js +324 -0
- package/dist/onboard-skills-B90sl6kA.js +134 -0
- package/dist/onboard-skills-DBZJuUNt.js +2 -0
- package/dist/openai-codex-auth-identity-DJ-yiC5N.js +45 -0
- package/dist/openai-codex-cli-auth-BdZB_Fn0.js +57 -0
- package/dist/openai-codex-provider-D23flY_z.js +299 -0
- package/dist/openai-codex-shared-7LLW54Av.js +6 -0
- package/dist/openai-provider-xmL-RBDi.js +283 -0
- package/dist/openai-transport-stream-M1bujvhd.js +1632 -0
- package/dist/operator-approvals-client-DNHRZj38.js +68 -0
- package/dist/order-DFWeiLxK.js +794 -0
- package/dist/pair-command-approve-CSw5-2fz.js +34 -0
- package/dist/pairing-cli-WXk-duET.js +118 -0
- package/dist/persistent-bindings.lifecycle-CvUywK5_.js +94 -0
- package/dist/pi-bundle-mcp-tools-CX0SFgbF.js +709 -0
- package/dist/pi-embedded-BycqI-F6.js +2 -0
- package/dist/pi-embedded-CROyZQKw.js +6 -0
- package/dist/pi-embedded-runner-DvjFL5Sg.js +8350 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-DAY2Idkx.js +23 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime.js +1 -1
- package/dist/pi-embedded.runtime-CnpLMfdZ.js +5 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-model-discovery-eCOzFFEF.js +232 -0
- package/dist/pi-tools.before-tool-call.runtime-DxhFk59d.js +354 -0
- package/dist/pi-tools.before-tool-call.runtime.js +1 -1
- package/dist/plugin-enabled-CHyNN_TN.js +71 -0
- package/dist/plugin-install-config-policy-AxFoCFZw.js +137 -0
- package/dist/plugin-registration-DNzK0hY5.js +23 -0
- package/dist/plugin-registry-CtFzpQUT.js +3 -0
- package/dist/plugin-registry-loader-2DtlC05M.js +22 -0
- package/dist/plugin-registry-rGAVZ04A.js +2 -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.js +3 -3
- package/dist/plugin-sdk/agent-harness-runtime.js +6 -6
- package/dist/plugin-sdk/agent-runtime.js +9 -9
- package/dist/plugin-sdk/approval-client-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-reply-runtime.js +2 -2
- package/dist/plugin-sdk/approval-runtime.js +4 -4
- package/dist/plugin-sdk/browser-config-runtime.js +2 -2
- package/dist/plugin-sdk/browser-config.js +2 -2
- package/dist/plugin-sdk/browser-control-auth.js +1 -1
- package/dist/plugin-sdk/browser-node-runtime.js +3 -3
- package/dist/plugin-sdk/browser-profiles.js +1 -1
- package/dist/plugin-sdk/browser-setup-tools.js +2 -2
- package/dist/plugin-sdk/browser-support.js +7 -7
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +3 -3
- package/dist/plugin-sdk/command-auth.js +4 -4
- package/dist/plugin-sdk/compat.js +2 -2
- package/dist/plugin-sdk/config-mutation.js +4 -4
- package/dist/plugin-sdk/config-runtime.js +6 -6
- package/dist/plugin-sdk/config-schema.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +4 -4
- package/dist/plugin-sdk/core.js +3 -3
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +1 -1
- package/dist/plugin-sdk/generate-text.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +2 -2
- package/dist/plugin-sdk/image-generation-runtime.js +2 -2
- 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 +4 -4
- package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +5 -5
- 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 +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +3 -3
- package/dist/plugin-sdk/memory-core.js +5 -5
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/plugin-test-runtime.js +3 -3
- package/dist/plugin-sdk/provider-auth-api-key.js +4 -4
- package/dist/plugin-sdk/provider-auth.js +7 -7
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-setup.js +2 -2
- package/dist/plugin-sdk/provider-stream-family.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +2 -2
- package/dist/plugin-sdk/provider-test-contracts.js +2 -2
- package/dist/plugin-sdk/provider-transport-runtime.js +1 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +7 -7
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +3 -3
- package/dist/plugin-sdk/sandbox.js +2 -2
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/session-store-runtime.js +2 -2
- package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
- package/dist/plugin-sdk/skill-commands-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +1 -1
- package/dist/plugin-sdk/src/cognitive/feedback/collector.d.ts +21 -0
- package/dist/plugin-sdk/src/cognitive/persona/lifecycle.d.ts +3 -6
- package/dist/plugin-sdk/src/cognitive/types.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.cognitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.cognitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +1 -0
- package/dist/plugin-sdk/testing.js +5 -5
- package/dist/plugin-sdk/text-runtime.js +2 -2
- package/dist/plugin-sdk/video-generation-core.js +1 -1
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-service-ByhemcPW.js +2494 -0
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins-cli-Bsu-vzeD.js +576 -0
- package/dist/plugins-command-helpers-DHYkcqua.js +117 -0
- package/dist/plugins-install-persist-C8eGd_C5.js +121 -0
- package/dist/plugins-update-command-3xt3Uqf8.js +1009 -0
- package/dist/policy-D-ZKSMmN.js +172 -0
- package/dist/preemptive-compaction-DBfSd-op.js +430 -0
- package/dist/proactive-scheduler-CsHZHnLk.js +1535 -0
- package/dist/probe-CWzUPp-f.js +426 -0
- package/dist/probe-QRfkrTQp.js +54 -0
- package/dist/probe-auth-DG3q8vB9.js +69 -0
- package/dist/probe-auth-GBOKLPAd.js +3 -0
- package/dist/profiles-CBddrdQK.js +117 -0
- package/dist/program-g6p3Qeig.js +111 -0
- package/dist/prompt-overlay-CTwbv1jO.js +72 -0
- package/dist/prompt-select-styled-Cgy0KIgT.js +5305 -0
- package/dist/provider-B_TyrVqo.js +70 -0
- package/dist/provider-api-key-auth-DsEmjrKm.js +113 -0
- package/dist/provider-api-key-auth.runtime-DnU922Pm.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-B0NxCABI.js +36 -0
- package/dist/provider-auth-api-key-BRkYGkki.js +5 -0
- package/dist/provider-auth-choice-BU5MwS9n.js +134 -0
- package/dist/provider-auth-choice-preference-BjTvWslj.js +62 -0
- package/dist/provider-auth-choice.runtime-B8ZRr0Ji.js +2 -0
- package/dist/provider-auth-choice.runtime-DIN9GqRk.js +14 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-BmbcHSR7.js +34 -0
- package/dist/provider-auth-helpers-BHAUl4Gr.js +168 -0
- package/dist/provider-catalog-BL8_CAyj.js +11 -0
- package/dist/provider-catalog-BRtoWqwn.js +11 -0
- package/dist/provider-catalog-BeddZRA_.js +12 -0
- package/dist/provider-catalog-Dl5yMnFQ.js +17 -0
- package/dist/provider-catalog-Doxz6-g3.js +56 -0
- package/dist/provider-catalog-nJImUuqB.js +26 -0
- package/dist/provider-dispatcher-D2GbNyfD.js +22 -0
- package/dist/provider-entry-B01Usrgw.js +97 -0
- package/dist/provider-flow-DgiCMoEf.js +66 -0
- package/dist/provider-models-CjNZS5bS.js +35 -0
- package/dist/provider-models-KjFLrk3V.js +119 -0
- package/dist/provider-models-vPWkBVJC.js +116 -0
- package/dist/provider-registration-BKyn4HAU.js +238 -0
- package/dist/provider-registration-Dtxvk5CC.js +57 -0
- package/dist/provider-runtime-DOtN11v9.js +2 -0
- package/dist/provider-runtime-DSAVX2DR.js +366 -0
- package/dist/provider-runtime.runtime-kKhVhqLz.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-l_z2VcmU.js +249 -0
- package/dist/provider-setup-Bf_9tp4f.js +2 -0
- package/dist/provider-stream-BdikYSRa.js +285 -0
- package/dist/provider-stream-family-DSm3KbQw.js +2 -0
- package/dist/provider-usage-BGu0-R4j.js +289 -0
- package/dist/provider-usage-lgVGEKOt.js +3 -0
- package/dist/provider-wizard-BLwU3k7w.js +166 -0
- package/dist/providers.runtime-C0Xkoksw.js +125 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-stream-wrappers-CIRRoMpa.js +480 -0
- package/dist/push-apns-BuLz1QrB.js +1061 -0
- package/dist/pw-ai-Ld88tf39.js +2268 -0
- package/dist/qmd-manager-kG_qjIil.js +1799 -0
- package/dist/qr-cli-CsNdevN-.js +359 -0
- package/dist/qr-image-CJ2mMFzI.js +2 -0
- package/dist/queue-fniCZ6ND.js +636 -0
- package/dist/realtime-provider-shared-B2y3nIjr.js +21 -0
- package/dist/realtime-transcription-provider-BYeb_Pdh.js +180 -0
- package/dist/realtime-voice-provider-Cs5kAI5o.js +342 -0
- package/dist/record-shared-vbhlkLLm.js +10 -0
- package/dist/refresh-DgMFD0Y0.js +115 -0
- package/dist/region-BOx9--Jp.js +74 -0
- package/dist/register.agent-i88emBrg.js +241 -0
- package/dist/register.backup-PaaKiScO.js +234 -0
- package/dist/register.configure-DOwB_pGJ.js +15 -0
- package/dist/register.maintenance-CYchYFw1.js +443 -0
- package/dist/register.message-DCzLrhHI.js +601 -0
- package/dist/register.onboard-La1ps81U.js +83 -0
- package/dist/register.runtime-Br9LK2gh.js +81 -0
- package/dist/register.runtime-CgbjcVmK.js +343 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-BwGIBl0j.js +104 -0
- package/dist/register.status-health-sessions-Bg-JiJ0c.js +1211 -0
- package/dist/register.subclis-BvRTTvO6.js +3 -0
- package/dist/register.subclis-C72FAl_s.js +232 -0
- package/dist/repair-DUb-NpH_.js +112 -0
- package/dist/replay-policy-8aUdDKqI.js +8 -0
- package/dist/reply-SolAjGzg.js +3523 -0
- package/dist/reply.runtime-BzJw9WP7.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-b0jc4sM3.js +280 -0
- package/dist/restart-CReI1iMn.js +454 -0
- package/dist/root-help-DOYfXVGX.js +44 -0
- package/dist/route-reply-Bsd_X1hM.js +141 -0
- package/dist/route-reply.runtime-0EDNxcfO.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/rpc-C4VoC6lx.js +61 -0
- package/dist/rpc.runtime-CrjwpfEG.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-main-BqkJC57m.js +453 -0
- package/dist/run-wait-KirpkWGm.js +118 -0
- package/dist/runner-BVkPQnQI.js +1497 -0
- package/dist/runs-Djzm6zWd.js +495 -0
- package/dist/runtime-6nDEFb75.js +72 -0
- package/dist/runtime-BU-qtT4-.js +107 -0
- package/dist/runtime-BYFm5p1W.js +725 -0
- package/dist/runtime-Bw9f54EP.js +355 -0
- package/dist/runtime-D2tXO42J2.js +242 -0
- package/dist/runtime-DOWgnTkX.js +191 -0
- package/dist/runtime-DObmMc6X.js +253 -0
- package/dist/runtime-DoFRWRgY.js +9 -0
- package/dist/runtime-Dt-rXRTW.js +2 -0
- package/dist/runtime-api-BtobjiSx.js +12 -0
- package/dist/runtime-api-CjjNrjOu2.js +2 -0
- package/dist/runtime-api-D7fKSLcI.js +3 -0
- package/dist/runtime-embedded-pi.runtime-2nLOBaP4.js +3 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-internal-BBIguEmO.js +2 -0
- package/dist/runtime-model-auth.runtime-Cgx5HiVv.js +39 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-oxFh0OA-.js +2 -0
- package/dist/runtime-plugins-zeEZH6Ee.js +69 -0
- package/dist/runtime-prepare.runtime-C1hoi3Pj.js +80 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-CXi4BTPW.js +21 -0
- package/dist/runtime-r3Ke_KuH.js +200 -0
- package/dist/runtime-registry-loader-471RbKgH.js +2 -0
- package/dist/runtime-registry-loader-Dov85dVR.js +58 -0
- package/dist/runtime-schema-DUetufoV.js +28395 -0
- package/dist/runtime-shared-BGttaPX3.js +249 -0
- package/dist/runtime-taskflow-CXpDzGWH.js +250 -0
- package/dist/runtime-web-channel-plugin-Dyt-ZWxm.js +215 -0
- package/dist/runtime-web-tools-CXeVnAOE.js +1467 -0
- package/dist/runtime-web-tools-fallback.runtime-B5P96RjD.js +9 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/sandbox-B7Mdkad9.js +2586 -0
- package/dist/sandbox-Bkj7NfH_.js +4 -0
- package/dist/sandbox-cli-BMrDh7ip.js +447 -0
- package/dist/secrets-cli-CDO_S3rr.js +2114 -0
- package/dist/security-audit-D4tdLi7R.js +34 -0
- package/dist/security-cli-BtMEiNIM.js +486 -0
- package/dist/semantic-dedup-BGgf2SFR.js +95 -0
- package/dist/send-C5pIHqBv.js +993 -0
- package/dist/send-media-Dcmyu6Y-.js +2123 -0
- package/dist/server-D0ZKpih4.js +77 -0
- package/dist/server-context-BekzVd0R.js +4164 -0
- package/dist/server-iDg2UFb7.js +13 -0
- package/dist/server-methods-MPVSmE3_.js +11937 -0
- package/dist/server-middleware-FqXPNqqT.js +110 -0
- package/dist/server-node-events-C1iGhswC.js +451 -0
- package/dist/server.impl-CFp5ICor.js +19766 -0
- package/dist/session-C-0F1BlP.js +48 -0
- package/dist/session-conversation-Ckza03tl.js +27 -0
- package/dist/session-cost-usage-Dnbtqvv7.js +648 -0
- package/dist/session-cost-usage-iTVG22AO.js +2 -0
- package/dist/session-file-CiJXAZP4.js +44 -0
- package/dist/session-key-6G1LpIon.js +65 -0
- package/dist/session-meta-knhthO95.js +109 -0
- package/dist/session-override-CGqy8cfR.js +103 -0
- package/dist/session-reset-model.runtime-VxsiNT-r.js +120 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-6oOKZMC9.js +474 -0
- package/dist/session-subagent-reactivation.runtime-DzMHk0SH.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-system-events-BifSkL6x.js +63 -0
- package/dist/session-tab-registry-DR0gRhet.js +553 -0
- package/dist/session-updates-CHOc_4vH.js +234 -0
- package/dist/session-updates.runtime-DsHKjhyM.js +2 -0
- package/dist/session-updates.runtime.js +1 -1
- package/dist/session-utils-GLg54NBi.js +930 -0
- package/dist/sessions-BxOkBx-e.js +45 -0
- package/dist/sessions-C6oolVsU.js +231 -0
- package/dist/sessions-D6_b32XT.js +2 -0
- package/dist/sessions.runtime-Dtv72AMI.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-DOX0TZju.js +505 -0
- package/dist/setup-DwqTuGTp.js +329 -0
- package/dist/setup-surface-Ore2Ehcn.js +586 -0
- package/dist/setup.finalize-hAPbyOmw.js +436 -0
- package/dist/setup.gateway-config-DteoOy8F.js +246 -0
- package/dist/shared-CLjMam2L.js +36 -0
- package/dist/shared-DGIkRU6J.js +218 -0
- package/dist/shared-DUnO9yTD.js +175 -0
- package/dist/shared-DeBJWig-.js +137 -0
- package/dist/shared-igYZ1cFQ.js +224 -0
- package/dist/shared-runtime-cWVnVIl5.js +7 -0
- package/dist/short-term-promotion-BhxerFzv.js +1631 -0
- package/dist/simple-completion-runtime-Bv1VtWSA.js +131 -0
- package/dist/simple-completion-transport-CLqa5Iyl.js +32 -0
- package/dist/skill-commands-D02-U6zf.js +82 -0
- package/dist/skill-commands.runtime-J2XiyESs.js +2 -0
- package/dist/skill-commands.runtime.js +1 -1
- package/dist/skills-BI8fjdW_.js +4 -0
- package/dist/skills-C6n71k5r.js +1075 -0
- package/dist/skills-cli-zp3lOjti.js +382 -0
- package/dist/skills-install-DlqA6nec.js +822 -0
- package/dist/skills-status-B57B5p12.js +170 -0
- package/dist/skills-status-DSk7-Gbk.js +2 -0
- package/dist/soul-cli-D_VMWljI.js +110 -0
- package/dist/speech-core-5C9NDTWw.js +126 -0
- package/dist/speech-provider-5npDU3CX.js +103 -0
- package/dist/speech-provider-B-nDtAnq.js +182 -0
- package/dist/speech-provider-BgLqt9Ul.js +184 -0
- package/dist/speech-provider-DAxRZc2f.js +167 -0
- package/dist/stage-sandbox-media.runtime-CFdAVxo8.js +230 -0
- package/dist/stage-sandbox-media.runtime.js +1 -1
- package/dist/standalone-generate-BG6TQ0jK.js +217 -0
- package/dist/standalone-generate-CgZQCsuI.js +2 -0
- package/dist/startup-auth-CKh--SuD.js +151 -0
- package/dist/state-migrations-CN7oRMHd.js +823 -0
- package/dist/status-BAqccuUp.js +278 -0
- package/dist/status-BaSW-xxu.js +2 -0
- package/dist/status-CAODeWKS.js +3 -0
- package/dist/status-CJpxvQmZ.js +500 -0
- package/dist/status-KOZpSuVN.js +2 -0
- package/dist/status-TqK4AoMQ.js +473 -0
- package/dist/status-all-DNG9crv3.js +495 -0
- package/dist/status-evx_KM_Z.js +399 -0
- package/dist/status-json-CT6-w9e9.js +14 -0
- package/dist/status-json-command-sAasGH5G.js +92 -0
- package/dist/status-runtime-shared-DTGujn3T.js +271 -0
- package/dist/status.command.text-runtime-CugrZfYj.js +15 -0
- package/dist/status.gateway-connection.runtime-kuu5mcJa.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gateway-probe-DNRjTzrV.js +16 -0
- package/dist/status.scan-overview-BjX4TLdw.js +395 -0
- package/dist/status.scan-rcGDJYtU.js +62 -0
- package/dist/status.scan.deps.runtime-CvmH94mX.js +18 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-BJv_9gqh.js +128 -0
- package/dist/status.scan.fast-json-DKOmheDO.js +2 -0
- package/dist/status.scan.runtime-BRjuY3QE.js +417 -0
- package/dist/status.scan.runtime.js +1 -1
- package/dist/status.summary-Bxs_2k1b.js +2 -0
- package/dist/status.summary-Dag8_BJw.js +209 -0
- package/dist/store-BCDEVRXR.js +1112 -0
- package/dist/store-C6poa5Og.js +1075 -0
- package/dist/store-DxQRR8Va.js +424 -0
- package/dist/store.runtime-D6t_wvEo.js +2 -0
- package/dist/store.runtime.js +1 -1
- package/dist/stream-CxAFhAae.js +649 -0
- package/dist/stream-wrappers-BALQapyz.js +144 -0
- package/dist/subagent-announce.registry.runtime-C55O0bdZ.js +3 -0
- package/dist/subagent-announce.registry.runtime.js +1 -1
- package/dist/subagent-control-CoVHKnJF.js +485 -0
- package/dist/subagent-followup.runtime-9Gmh8O_s.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-list-BPsxOWK_.js +168 -0
- package/dist/subagent-orphan-recovery-BCcEet7k.js +214 -0
- package/dist/subagent-registry-DfHx9pew.js +2889 -0
- package/dist/subagent-registry-runtime-B_Mc7UDa.js +2 -0
- package/dist/subagent-registry.runtime-gOuSIzDg.js +3 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-spawn-BOLGVu7f.js +782 -0
- package/dist/subagents-format-DXuyOMu-.js +629 -0
- package/dist/system-cli-_jfrKryu.js +60 -0
- package/dist/targets-DKzJlbu6.js +595 -0
- package/dist/task-executor-DhjMRE2d.js +350 -0
- package/dist/task-owner-access-rwopIPhc.js +48 -0
- package/dist/task-registry-C6EQpySp.js +2346 -0
- package/dist/task-registry-control.runtime-t4jeMENC.js +3 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/task-registry-delivery-runtime-BMfszrF8.js +2 -0
- package/dist/task-registry-delivery-runtime-D_Ocdg0_.js +3 -0
- package/dist/task-registry.maintenance-DNXaqTr4.js +2 -0
- package/dist/task-registry.maintenance-DqvsLuqb.js +425 -0
- package/dist/testing-CXEcd2QQ.js +441 -0
- package/dist/text-report-CUwo5L1k.js +587 -0
- package/dist/text-runtime-B3UrMt6T.js +313 -0
- package/dist/thread-bindings-BR0oLaqe.js +223 -0
- package/dist/tool-auth-shared-BwlRX_zo.js +53 -0
- package/dist/tool-config-shared-CThVi2Zv.js +19 -0
- package/dist/tool-schema-runtime-CiqxCMkH.js +1892 -0
- package/dist/tools-BUzk9uUn.js +110 -0
- package/dist/tools-effective-inventory-CMhZ6G55.js +152 -0
- package/dist/tools.runtime-D6GnPvuW.js +4 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-kBzFcvfJ.js +233 -0
- package/dist/transcript.runtime-X5nUWG5J.js +2 -0
- package/dist/transcript.runtime.js +1 -1
- package/dist/transport-policy-qrbV7LdB.js +75 -0
- package/dist/tts-BW2-rTjx.js +31 -0
- package/dist/tui-Cnxy7MIi.js +4018 -0
- package/dist/tui-cli-COdAidhT.js +31 -0
- package/dist/update-cli-C62761SQ.js +1779 -0
- package/dist/update-runner-BY92EdE9.js +1492 -0
- package/dist/usage-format-CPx6tGPA.js +2 -0
- package/dist/usage-format-CpsXzXcG.js +507 -0
- package/dist/video-generation-provider-BKRHP8oO.js +171 -0
- package/dist/video-generation-provider-CCsVq0-G.js +263 -0
- package/dist/video-generation-provider-CPHXFGar.js +246 -0
- package/dist/video-generation-provider-DRMOwtTj.js +104 -0
- package/dist/video-generation-provider-DohNwNos.js +181 -0
- package/dist/video-generation-provider-DsIqJI0e.js +227 -0
- package/dist/video-generation-provider-Kg01Dy_G.js +233 -0
- package/dist/video-generation-provider-Z-xZjApd.js +240 -0
- package/dist/video-generation-provider-kfoZ8epM.js +64 -0
- package/dist/video-generation-provider-wgwFq2Wr.js +77 -0
- package/dist/web-fetch-providers.runtime-YHUYJGZL.js +33 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-search-C0DUuJkz.js +221 -0
- package/dist/web-search-provider-BVISR8ti.js +155 -0
- package/dist/web-search-providers.runtime-BxK0HVx5.js +206 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/dist/webhooks-cli-CNvp2Osa.js +321 -0
- package/dist/x-search-shared-uvKOvvdl.js +109 -0
- package/dist/zod-schema-CgftpN_n.js +1401 -0
- package/docs/concepts/cognitive-overview.md +27 -12
- package/package.json +2 -1
- package/dist/abort-BA4i4CO6.js +0 -202
- package/dist/abort-cutoff.runtime-140Dy9Z_.js +0 -20
- package/dist/abort.runtime-D2xd_Jxq.js +0 -2
- package/dist/acp-cli-lUerPOt4.js +0 -2171
- package/dist/acp-spawn-CKu5HWZd.js +0 -1024
- package/dist/acp-stateful-target-driver-DNcDMame.js +0 -88
- package/dist/action-agents-bNO5zlxQ.js +0 -67
- package/dist/action-focus-BQH1yzA9.js +0 -124
- package/dist/action-help-Copk6G3d.js +0 -7
- package/dist/action-info-BUV_zoSU.js +0 -58
- package/dist/action-kill-BMDz9l_U.js +0 -33
- package/dist/action-list-CxkulhYF.js +0 -21
- package/dist/action-log-D0K9-YCV.js +0 -30
- package/dist/action-send-B8ggJVwC.js +0 -39
- package/dist/action-spawn-D9kSXA_K.js +0 -46
- package/dist/action-unfocus-bI4VBonB.js +0 -28
- package/dist/agent-CdxQT19_.js +0 -2
- package/dist/agent-command-Bu_cXSEL.js +0 -1479
- package/dist/agent-runner-utils--p6HAP6k.js +0 -202
- package/dist/agent-runner.runtime-BossnlL1.js +0 -2825
- package/dist/agents-DA2-qNUI.js +0 -887
- package/dist/agents-DaKVGj9F.js +0 -5
- package/dist/anthropic-vertex-stream-CrF-fPgb.js +0 -5666
- package/dist/api-BPByI3-X.js +0 -2
- package/dist/api-BRJq6Aya.js +0 -2
- package/dist/api-BpAm-eRQ.js +0 -2
- package/dist/api-BvFPt7b2.js +0 -19
- package/dist/api-CSOm-O9I.js +0 -5
- package/dist/api-ChQfiSmG.js +0 -4
- package/dist/api-CqBQhm6r.js +0 -2
- package/dist/api-D7qSjVDS.js +0 -3
- package/dist/api-DbRoXBTn.js +0 -45
- package/dist/api-_HshnS5J.js +0 -35
- package/dist/apply-G86rau7x.js +0 -493
- package/dist/apply.runtime-BoYc09wu.js +0 -166
- package/dist/apply.runtime-Dmh02lO-.js +0 -2
- package/dist/approval-client-helpers-cyaJyAMz.js +0 -82
- package/dist/approval-gateway-resolver-bdX78er-.js +0 -58
- package/dist/approval-gateway-runtime-CJm68vrp.js +0 -2
- package/dist/approval-handler-runtime-CT08B2_a.js +0 -439
- package/dist/approval-native-runtime-CN4meUkM.js +0 -709
- package/dist/approval-renderers-CnmO8wke.js +0 -64
- package/dist/asr-Cz-FH-3c.js +0 -196
- package/dist/audit-Cbfv4nmn.js +0 -885
- package/dist/audit-extra.async-DQv_s9K0.js +0 -847
- package/dist/audit.deep.runtime-CAPtrWg1.js +0 -2
- package/dist/audit.nondeep.runtime-HUJ6INiD.js +0 -859
- package/dist/audit.runtime-CAKbHyXK.js +0 -7
- package/dist/auth-CRAwpkC_.js +0 -181
- package/dist/auth-choice-Bhps2D29.js +0 -3
- package/dist/auth-choice-kMIs0xTd.js +0 -71
- package/dist/auth-choice-options-Bx_XsiW-.js +0 -104
- package/dist/auth-choice-prompt-B-koxVGL.js +0 -2
- package/dist/auth-choice-prompt-DytHsI5U.js +0 -36
- package/dist/auth-choice-vRXPONqL.js +0 -353
- package/dist/auth-choice.plugin-providers.runtime-BNfpK_sp.js +0 -11
- package/dist/auth-health-BAxUQXZE.js +0 -165
- package/dist/auth-profiles-YXfmeEhu.js +0 -438
- package/dist/auth-profiles.runtime-CNNciZQU.js +0 -7
- package/dist/auto-recall-CsrNcQNa.js +0 -78
- package/dist/backup-create-DuIPhK_s.js +0 -391
- package/dist/banner-Bb9u_-IS.js +0 -2
- package/dist/banner-BkHTsqFt.js +0 -281
- package/dist/binding-routing-C6_mrNEN.js +0 -50
- package/dist/binding-targets-Cq2e7wRT.js +0 -99
- package/dist/bridge-server-Co3awCAM.js +0 -103
- package/dist/browser-config-runtime-BtkKPBMj.js +0 -6
- package/dist/browser-control-auth-Bqu1lakr.js +0 -120
- package/dist/browser-node-runtime-D8xut4fJ.js +0 -12
- package/dist/browser-profiles-gPG14SPk.js +0 -170
- package/dist/browser-runtime-BBkGI01q.js +0 -377
- package/dist/browser-setup-tools-CD_s48fd.js +0 -12
- package/dist/call-CiUZqjsN.js +0 -2
- package/dist/call-k_nZXTJ3.js +0 -495
- package/dist/call.runtime-CZI7yxSF.js +0 -2
- package/dist/capability-cli-CIm_YhHH.js +0 -1357
- package/dist/catalog-provider-Ch4CMHLl.js +0 -40
- package/dist/cdp.helpers-BVl3YwYe.js +0 -372
- package/dist/channel-core-BB7pTANC.js +0 -5
- package/dist/channel-summary-TxoZjGPA.js +0 -139
- package/dist/channel-summary-dKkFDRbe.js +0 -2
- package/dist/channel.runtime-2WY9MkoH.js +0 -399
- package/dist/channels-D66hRVnR.js +0 -1147
- package/dist/channels-cli-0DjAVaKh.js +0 -248
- package/dist/chat-Fv3LkEfF.js +0 -213
- package/dist/chrome-CEE9kYYR.js +0 -1080
- package/dist/chrome.executables-Dp7W-RgV.js +0 -550
- package/dist/cli-BsNkLoFI.js +0 -57
- package/dist/cli-DQH9X5IE.js +0 -2
- package/dist/cli-DW_ou4hw.js +0 -2
- package/dist/cli-DuoVlLKx.js +0 -154
- package/dist/cli-QG03g_im.js +0 -191
- package/dist/cli-auth-seam-BrijKBRQ.js +0 -14
- package/dist/cli-backend-CIs4F7ip.js +0 -66
- package/dist/cli-migration-CVktTGRI.js +0 -127
- package/dist/cli-runner-12iECISR.js +0 -1662
- package/dist/cli-runner.runtime-C5noDuQ-.js +0 -3
- package/dist/cli-runner.runtime-YrAg_h19.js +0 -2
- package/dist/cli-shared-BUW2okV2.js +0 -142
- package/dist/cli.runtime-Bhxt80sB.js +0 -819
- package/dist/client-bootstrap-BWo-ZK_j.js +0 -28
- package/dist/codex-native-web-search-C6s55zGf.js +0 -2
- package/dist/codex-native-web-search-Cxf1u7R-.js +0 -156
- package/dist/collector-CRTTihSY.js +0 -349
- package/dist/collector-tJxrYXuY.js +0 -2
- package/dist/command-auth-Dlrd5CYD.js +0 -75
- package/dist/command-config-resolution-B8pxzh3W.js +0 -2
- package/dist/command-config-resolution-BXSCDJTh.js +0 -23
- package/dist/command-execution-startup-DYXpKpvc.js +0 -269
- package/dist/command-format-JYoGhCek.js +0 -2
- package/dist/command-queue-CmX7XAL1.js +0 -260
- package/dist/command-registry-BF51N12E.js +0 -3
- package/dist/command-registry-BqpfCBbW.js +0 -113
- package/dist/command-secret-gateway-DuuctECr.js +0 -528
- package/dist/commands-acp-DiLJUV45.js +0 -1017
- package/dist/commands-compact.runtime-BOM8PsWH.js +0 -10
- package/dist/commands-core.runtime-CH_aGeT-.js +0 -2
- package/dist/commands-handlers.runtime-Ca6xoeW5.js +0 -3762
- package/dist/commands-models-CRURuXR-.js +0 -306
- package/dist/commands-reset-hooks-D3RzsOIn.js +0 -129
- package/dist/commands-status-Cufj4x2j.js +0 -223
- package/dist/commands-status.runtime-C8Nz4Glk.js +0 -2
- package/dist/commands-subagents-control.runtime-DjhcmoRT.js +0 -3
- package/dist/commands-subagents-control.runtime-s_DYQWfW.js +0 -2
- package/dist/commands.runtime-ChfYOBeV.js +0 -103
- package/dist/comment-shared-DFEZzqhH.js +0 -40
- package/dist/compact-DEsHFhEL.js +0 -11324
- package/dist/compact.runtime-BzLFUSmk.js +0 -7
- package/dist/completion-cli-CiWtzUFQ.js +0 -2
- package/dist/completion-cli-h3zgpXGM.js +0 -468
- package/dist/config-B3cxNRyw.js +0 -8
- package/dist/config-Bd1PtH4x.js +0 -166
- package/dist/config-DuLfQQvE.js +0 -53
- package/dist/config-cli-BiEmyiRa.js +0 -948
- package/dist/config-defaults-Bw9wwyo1.js +0 -163
- package/dist/config-guard-BGGjXg_Y.js +0 -94
- package/dist/config-runtime-Bvdi0W59.js +0 -14
- package/dist/config-validation-BDeuMlc1.js +0 -279
- package/dist/configure-CUSDnrHs.js +0 -2
- package/dist/configure-FDqT3i_9.js +0 -1162
- package/dist/connection-auth-7izNv08V.js +0 -30
- package/dist/context-B2wCjR9D.js +0 -249
- package/dist/context-n8ANhlMJ.js +0 -2
- package/dist/context-writer-COhxMkVz.js +0 -290
- package/dist/control-auth-Csa4b5CR.js +0 -122
- package/dist/control-ui/assets/agents-CYCtph5J.js +0 -767
- package/dist/control-ui/assets/anthropic-B66S-tt5.js +0 -40
- package/dist/control-ui/assets/azure-openai-responses-CRJyPvrW.js +0 -2
- package/dist/control-ui/assets/cron-DPaLQLTR.js +0 -744
- package/dist/control-ui/assets/dialogues-DPJy1B4C.js +0 -83
- package/dist/control-ui/assets/history-CT3DjMa7.js +0 -71
- package/dist/control-ui/assets/index-Ci2oc-eJ.css +0 -1
- package/dist/control-ui/assets/index-Ua-cFlP6.js +0 -2686
- package/dist/control-ui/assets/mistral-DWkPN1WM.js +0 -72
- package/dist/control-ui/assets/openai-codex-responses-CSJ_tbUW.js +0 -8
- package/dist/control-ui/assets/openai-completions-QUhkmdlC.js +0 -6
- package/dist/control-ui/assets/openai-responses-CjthZA3L.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-tozh4HQx.js +0 -13
- package/dist/conversation-id-d7KXWjzV.js +0 -140
- package/dist/conversation-runtime-D-YmpVS2.js +0 -31
- package/dist/core-8TPCsNB-.js +0 -210
- package/dist/cron-cli-C5ok2iVK.js +0 -637
- package/dist/curator-9KwCnpXG.js +0 -598
- package/dist/curator-t_jLT3Ie.js +0 -2
- package/dist/daemon-cli-Cr_y38yv.js +0 -476
- package/dist/daemon-install-CrhzPiZ-.js +0 -70
- package/dist/delegate-r3VqUt34.js +0 -61
- package/dist/deliver-Cuu36rnv.js +0 -3
- package/dist/deliver-SAyi_F0e.js +0 -782
- package/dist/deliver-runtime-DKv9J6QE.js +0 -2
- package/dist/delivery-outbound.runtime-DDoInTnF.js +0 -6
- package/dist/delivery-queue-CWi3kUit.js +0 -372
- package/dist/delivery-queue-ecSu6ZNL.js +0 -2
- package/dist/deps-BIU2SScd.js +0 -60
- package/dist/devices-cli-BUAuMOOj.js +0 -336
- package/dist/diagnostic-BLwuJXPT.js +0 -311
- package/dist/direct-dm-D_7_vKGq.js +0 -139
- package/dist/directive-handling.fast-lane-C91i_iZm.js +0 -2
- package/dist/directive-handling.fast-lane-F7l0XNwG.js +0 -64
- package/dist/directive-handling.impl-8RAWZiZE.js +0 -659
- package/dist/directive-handling.impl-BxAIWFS-.js +0 -2
- package/dist/directive-handling.parse-B3O0CfXY.js +0 -376
- package/dist/directive-handling.persist-QXt7GHcD.js +0 -139
- package/dist/directive-handling.persist.runtime-CPPm2qYQ.js +0 -2
- package/dist/directive-handling.shared-C5ywsGJd.js +0 -159
- package/dist/directory-cli-D9v1dSPr.js +0 -240
- package/dist/dispatch-DoyBs65s.js +0 -1126
- package/dist/dispatch-acp-Dz8rU6t9.js +0 -969
- package/dist/dispatch-acp-manager.runtime-tPUGDjl3.js +0 -3
- package/dist/dispatch-acp-media.runtime-rwYN3ewY.js +0 -3
- package/dist/dispatch-acp-session.runtime-C9nyGih8.js +0 -2
- package/dist/dispatch-acp.runtime-Co-JFuKU.js +0 -19
- package/dist/dns-cli-BRVJtnve.js +0 -193
- package/dist/docs-cli-DvJd--iI.js +0 -156
- package/dist/doctor-completion-C46W5KI7.js +0 -90
- package/dist/doctor-config-preflight-B_UDrFsE.js +0 -148
- package/dist/doctor-config-preflight-DtvhOeuT.js +0 -2
- package/dist/doctor-state-migrations-Cd3yfnI1.js +0 -2
- package/dist/doctor-state-migrations-D3qorqjy.js +0 -3
- package/dist/drive-C2mxxJx5.js +0 -718
- package/dist/embedding-provider-C5S1sxvR.js +0 -129
- package/dist/embedding-provider-CNDA2uD3.js +0 -26
- package/dist/embedding-provider-CdVS1B85.js +0 -33
- package/dist/engine-CKgZ1obQ.js +0 -82
- package/dist/engine-embeddings-Bt1bTxtw.js +0 -1489
- package/dist/entry-capabilities-DrciJZn1.js +0 -89
- package/dist/env-overrides-DTd6EBBV.js +0 -347
- package/dist/env-overrides.runtime-Dxy8Shg7.js +0 -7
- package/dist/exec-approval-forwarder.runtime-Dpa8Gi_P.js +0 -3
- package/dist/exec-approval-reply-BaUWuhD6.js +0 -292
- package/dist/exec-approvals-cli-BuOJPaPp.js +0 -485
- package/dist/exec-defaults-B5egc-6t.js +0 -1440
- package/dist/extra-params-Bfdm7Piq.js +0 -295
- package/dist/format-KzNAm6y6.js +0 -245
- package/dist/fragment-collector-DEW1fwlc.js +0 -189
- package/dist/gateway-cli-CWHsIpm8.js +0 -1532
- package/dist/gateway-install-token-CcpoWcqs.js +0 -284
- package/dist/gateway-rpc-Do_3fQSm.js +0 -14
- package/dist/gateway-rpc.runtime-C4kzyrJj.js +0 -23
- package/dist/gemini-cli-provider-YULRMcs8.js +0 -106
- package/dist/gemini-web-search-provider-D_QJZMM3.js +0 -167
- package/dist/get-reply-from-config.runtime-BpdriKtr.js +0 -2
- package/dist/gmail-setup-utils-D_e1q-h_.js +0 -422
- package/dist/health-B5YmS_bW.js +0 -2
- package/dist/health-CQ4zXQ-2.js +0 -579
- package/dist/heartbeat-runner--rVDmB2Z.js +0 -1365
- package/dist/heartbeat-runner-CwtXIPI-.js +0 -4
- package/dist/heartbeat-runner.runtime-D_5UeAsX.js +0 -2
- package/dist/help-CAj5xloH.js +0 -76
- package/dist/hooks-cli-BGDBJqzt.js +0 -364
- package/dist/image-DiK7kcmJ.js +0 -152
- package/dist/image-generation-core-Cwutmg_V.js +0 -17
- package/dist/image-generation-core.auth.runtime-DA7XD5V2.js +0 -2
- package/dist/image-generation-provider-B-0SxnvJ.js +0 -280
- package/dist/image-generation-provider-B-UW3NU_.js +0 -94
- package/dist/image-generation-provider-BR1_oIU4.js +0 -130
- package/dist/image-generation-provider-CnGMLnE9.js +0 -163
- package/dist/image-generation-provider-DHvw6TSJ.js +0 -136
- package/dist/image-generation-runtime-DCWf9P6F.js +0 -2
- package/dist/image-runtime-DGNzvqkb.js +0 -7
- package/dist/inbound-reply-dispatch-DgEqNffL.js +0 -73
- package/dist/inbound.runtime-CloYEZJO.js +0 -4
- package/dist/inbound.runtime-DLbKJWOY.js +0 -3
- package/dist/infra-runtime-DE-Vi3Dn.js +0 -25
- package/dist/ingest-DbZJju1a.js +0 -842
- package/dist/ingest-Dyj9M3ZM.js +0 -2
- package/dist/io-Bz-M35LC.js +0 -7184
- package/dist/io-DacBLjh1.js +0 -5
- package/dist/kaijibot-tools-Df_9YJcO.js +0 -9434
- package/dist/kaijibot-tools.runtime-CZId-V1O.js +0 -2
- package/dist/kimi-web-search-provider-DunVVASJ.js +0 -308
- package/dist/library-BqMFzJMy.js +0 -45
- package/dist/lifecycle-core-DD_IXtH-.js +0 -422
- package/dist/lifecycle-lZ5BtT_X.js +0 -57
- package/dist/list.runtime-DU0ctAjd.js +0 -12
- package/dist/list.runtime-DXWlaAJq.js +0 -9
- package/dist/llm-engine-CMR9RxLA.js +0 -1792
- package/dist/llm-engine-VKRjaGY_.js +0 -2
- package/dist/llm-extractor-BCPvoWmb.js +0 -445
- package/dist/load-context-DV3B4twI.js +0 -51
- package/dist/logging-BMNGvpuz.js +0 -13
- package/dist/logging-CN3VAZ70.js +0 -2
- package/dist/login-Dex1JqnY.js +0 -108
- package/dist/logs-cli-BZFJyrsk.js +0 -264
- package/dist/logs-cli.runtime-bBS2Sbi6.js +0 -2
- package/dist/manager-BmS2ofc4.js +0 -2049
- package/dist/manager-CabVEPeE.js +0 -3314
- package/dist/mcp-cli-DGrmbpsu.js +0 -733
- package/dist/mcp-config-CY_3tJVi.js +0 -115
- package/dist/media-runtime-CAa8uHqv.js +0 -312
- package/dist/media-understanding-D_VRj6xY.js +0 -83
- package/dist/media-understanding-provider-B9Jfjq6L.js +0 -13
- package/dist/media-understanding-provider-BWksuEBw.js +0 -30
- package/dist/media-understanding-provider-Bhtq5Kpe.js +0 -14
- package/dist/media-understanding-provider-BzsmDAMk.js +0 -67
- package/dist/media-understanding-provider-C6_6yxvP.js +0 -123
- package/dist/media-understanding-provider-CdRlAb9s.js +0 -18
- package/dist/media-understanding-provider-D5m-2RW8.js +0 -21
- package/dist/media-understanding-provider-PmVmfI6p.js +0 -112
- package/dist/media-understanding-provider-cmLTPd8x.js +0 -18
- package/dist/media-understanding-provider-nPxfFv8l.js +0 -37
- package/dist/media-understanding-provider-yp9gxov6.js +0 -69
- package/dist/media-understanding-runtime-Bu7m-lVs.js +0 -2
- package/dist/memory-5jlpYBqx.js +0 -242
- package/dist/memory-BFKl6oSn.js +0 -3
- package/dist/memory-core-host-engine-embeddings-p06288xV.js +0 -2
- package/dist/memory-core-host-engine-foundation-DHbdNLgZ.js +0 -11
- package/dist/memory-core-host-runtime-cli-BnvAiNzO.js +0 -9
- package/dist/memory-core-host-runtime-core-CnVg69Uw.js +0 -8
- package/dist/memory-embedding-adapter-Cux48Bvk.js +0 -33
- package/dist/memory-host-search.runtime-D6ORyqHq.js +0 -2
- package/dist/memory-index-DSbV_yD0.js +0 -2
- package/dist/memory-index-EFkCRTeh.js +0 -514
- package/dist/memory-runtime-BKqNwQ9X.js +0 -2
- package/dist/memory-runtime-Cn41W0bC.js +0 -26
- package/dist/message-CMCdNyAT.js +0 -223
- package/dist/message-action-runner-CG2CcWaS.js +0 -1628
- package/dist/message-action-runner-DUZQ7nmt.js +0 -2
- package/dist/message.config.runtime-B3ztIjsr.js +0 -3
- package/dist/message.gateway.runtime-COLMRCv4.js +0 -2
- package/dist/metadata-registry-loader-BSyFpHop.js +0 -15
- package/dist/metadata-registry-loader-Ci3mcmNV.js +0 -2
- package/dist/minimax-vlm-D1DbVSjC.js +0 -183
- package/dist/minimax-web-search-provider-BzgvahXM.js +0 -165
- package/dist/mmr-Clamw4uq.js +0 -146
- package/dist/model-CJIbRRp9.js +0 -630
- package/dist/model-auth-BQpkMtoP.js +0 -427
- package/dist/model-auth-label-dLSkL9EI.js +0 -45
- package/dist/model-catalog-DgqowW_L.js +0 -204
- package/dist/model-definitions-BOTIDDWJ.js +0 -258
- package/dist/model-picker-B4SuA28P.js +0 -3
- package/dist/model-picker-buwrc8kM.js +0 -500
- package/dist/model-picker.runtime-DXgS2Rab.js +0 -15
- package/dist/model-selection-CBuo2hSg.js +0 -381
- package/dist/model-suppression-CthTVW_x.js +0 -28
- package/dist/model-suppression.runtime-R-qnGNBa.js +0 -7
- package/dist/models-B3UnmjRf.js +0 -18
- package/dist/models-BucP8NI1.js +0 -760
- package/dist/models-C3w7hz3K.js +0 -18
- package/dist/models-C4-eAnR7.js +0 -157
- package/dist/models-DMLYOe4h.js +0 -2
- package/dist/models-DNNfkS3j.js +0 -2584
- package/dist/models-DkiHZi9S.js +0 -47
- package/dist/models-OhM18fW_.js +0 -555
- package/dist/models-cli-CfvtZXPd.js +0 -198
- package/dist/models-config-BLMZzgfx.js +0 -900
- package/dist/models-config.providers.secrets-rjdH8T5l.js +0 -299
- package/dist/models.fetch-D1o7sMO8.js +0 -518
- package/dist/monitor-CJdL31iS.js +0 -4435
- package/dist/monitor-DB732mUY.js +0 -1023
- package/dist/music-generation-provider-BrUTQBmG.js +0 -169
- package/dist/music-generation-provider-D6aYWSSm.js +0 -238
- package/dist/music-generation-provider-dpX_Oiuw.js +0 -142
- package/dist/node-cli-BSrC37hh.js +0 -2374
- package/dist/nodes-cli-uwgDIsqv.js +0 -1046
- package/dist/nodes-utils-ChvZvxK1.js +0 -196
- package/dist/notify-C9-q0Rdu.js +0 -305
- package/dist/oauth-CVAbqwnx.js +0 -152
- package/dist/oauth-RbN-L8pg.js +0 -57
- package/dist/oauth-token-shared-CCzflFLG.js +0 -28
- package/dist/oauth.credentials-BeCOUsTe.js +0 -165
- package/dist/oauth.flow-C2PFyq_h.js +0 -122
- package/dist/oauth.settings-CBmYrmAk.js +0 -44
- package/dist/oauth.token-DSow_5Ie.js +0 -43
- package/dist/onboard-B-ZJptUZ.js +0 -25
- package/dist/onboard-Beu-mw_-.js +0 -29
- package/dist/onboard-BzUrcgZ5.js +0 -25
- package/dist/onboard-CPuf8esc.js +0 -25
- package/dist/onboard-CTfex1XR2.js +0 -58
- package/dist/onboard-D-ccZlbM.js +0 -312
- package/dist/onboard-DHXNhsF7.js +0 -621
- package/dist/onboard-custom-9KIp_ybR.js +0 -647
- package/dist/onboard-custom-CbXUFVN6.js +0 -2
- package/dist/onboard-helpers-BFknCN7m.js +0 -223
- package/dist/onboard-helpers-DSJ_xWpL.js +0 -5
- package/dist/onboard-remote-C28pAu4b.js +0 -193
- package/dist/onboard-remote-DQxyE18D.js +0 -2
- package/dist/onboard-search-CPHGVmos.js +0 -324
- package/dist/onboard-skills-B642NK1o.js +0 -2
- package/dist/onboard-skills-CI4B6Kx5.js +0 -134
- package/dist/openai-codex-auth-identity-PqpqYz4a.js +0 -45
- package/dist/openai-codex-cli-auth-cFTkwXjR.js +0 -57
- package/dist/openai-codex-provider-DjUpM_l9.js +0 -299
- package/dist/openai-codex-shared-o0pq7UkS.js +0 -6
- package/dist/openai-provider-ChZN4Q0c.js +0 -283
- package/dist/openai-transport-stream-DXBBlxJ9.js +0 -1632
- package/dist/operator-approvals-client-RJESCyw4.js +0 -68
- package/dist/order-D863tCt-.js +0 -794
- package/dist/pair-command-approve-5Jr6xo-1.js +0 -34
- package/dist/pairing-cli-BF3jieZo.js +0 -118
- package/dist/persistent-bindings.lifecycle-CjXEQUMz.js +0 -94
- package/dist/pi-bundle-mcp-tools-DPVGNVRw.js +0 -709
- package/dist/pi-embedded-Cp3OIZy9.js +0 -2
- package/dist/pi-embedded-DJN2vlNF.js +0 -6
- package/dist/pi-embedded-runner-DXHhhGRS.js +0 -8348
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-D1jUEg-R.js +0 -23
- package/dist/pi-embedded.runtime-DQPfEvkF.js +0 -5
- package/dist/pi-model-discovery-B9q9ykaA.js +0 -232
- package/dist/pi-tools.before-tool-call.runtime-vGvkJ6V9.js +0 -354
- package/dist/plugin-enabled-CMdiRqJS.js +0 -71
- package/dist/plugin-install-config-policy-32D2JJMl.js +0 -137
- package/dist/plugin-registration-BhPJI7wp.js +0 -23
- package/dist/plugin-registry-Bo4RF_Fn.js +0 -2
- package/dist/plugin-registry-C4M8QkVh.js +0 -3
- package/dist/plugin-registry-loader-ZzUapRh3.js +0 -22
- package/dist/plugin-service-31XQtuZr.js +0 -2494
- package/dist/plugins-cli-20A8dYUN.js +0 -576
- package/dist/plugins-command-helpers-C3Qls10N.js +0 -117
- package/dist/plugins-install-persist-DEr-zA4G.js +0 -121
- package/dist/plugins-update-command-D0Iv4BPb.js +0 -1009
- package/dist/policy-BEVsx7jw.js +0 -172
- package/dist/preemptive-compaction-DlRJt7Zq.js +0 -430
- package/dist/proactive-scheduler-B3w5rW0h.js +0 -1444
- package/dist/probe-CCTEVLB2.js +0 -54
- package/dist/probe-DcSW0ngD.js +0 -426
- package/dist/probe-auth-C7DjgU_m.js +0 -69
- package/dist/probe-auth-Cfwc8qaj.js +0 -3
- package/dist/profiles-BYudUysD.js +0 -117
- package/dist/program-E_Dt_QTp.js +0 -111
- package/dist/prompt-overlay-DsEnjhTn.js +0 -72
- package/dist/prompt-select-styled-Dtw90p2J.js +0 -5305
- package/dist/provider-api-key-auth-CerNsquw.js +0 -113
- package/dist/provider-api-key-auth.runtime-B0BpFkRm.js +0 -14
- package/dist/provider-auth-DwgUXcgu.js +0 -36
- package/dist/provider-auth-api-key-BQfXwqgU.js +0 -5
- package/dist/provider-auth-choice-BKxMQwxd.js +0 -134
- package/dist/provider-auth-choice-preference-DeDdHlsY.js +0 -62
- package/dist/provider-auth-choice.runtime-BJxc73Ex.js +0 -2
- package/dist/provider-auth-choice.runtime-DBcrr0Ab.js +0 -14
- package/dist/provider-auth-guidance-Cqo9An-I.js +0 -34
- package/dist/provider-auth-helpers-r9kVb6L3.js +0 -168
- package/dist/provider-catalog-CjNAbR9b.js +0 -12
- package/dist/provider-catalog-CpTP4D3p.js +0 -56
- package/dist/provider-catalog-D1iJW59q.js +0 -11
- package/dist/provider-catalog-Dc48HHhB.js +0 -11
- package/dist/provider-catalog-jKq2UIeG.js +0 -17
- package/dist/provider-catalog-pmlFBXYr.js +0 -26
- package/dist/provider-dispatcher-Dl07uV70.js +0 -22
- package/dist/provider-entry-DkwXZuZY.js +0 -97
- package/dist/provider-flow-CmI4jkWV.js +0 -66
- package/dist/provider-iVtrs6XY.js +0 -70
- package/dist/provider-models-BXMZj2p1.js +0 -119
- package/dist/provider-models-Bq_MZ0xR.js +0 -35
- package/dist/provider-models-CsUYkHTw.js +0 -116
- package/dist/provider-registration-DkqLtXSj.js +0 -57
- package/dist/provider-registration-vrLHkywc.js +0 -238
- package/dist/provider-runtime-C_ebc-4l.js +0 -2
- package/dist/provider-runtime-Czioyn5w.js +0 -366
- package/dist/provider-runtime.runtime-lPuF4lqy.js +0 -26
- package/dist/provider-self-hosted-setup-Bjk91HZ7.js +0 -249
- package/dist/provider-setup-hUbxRciz.js +0 -2
- package/dist/provider-stream-DTbeHqKf.js +0 -285
- package/dist/provider-stream-family-Cz7SHqeS.js +0 -2
- package/dist/provider-usage-4x0im5xP.js +0 -3
- package/dist/provider-usage-CdkW3Bkb.js +0 -289
- package/dist/provider-wizard-BPkIa2bk.js +0 -166
- package/dist/providers.runtime-CawuCJXc.js +0 -125
- package/dist/proxy-stream-wrappers-BcJuaE24.js +0 -480
- package/dist/push-apns-CO3sqbX3.js +0 -1061
- package/dist/pw-ai-DEf5tZLp.js +0 -2268
- package/dist/qmd-manager-CrqmeTuY.js +0 -1799
- package/dist/qr-cli-g_Pkqstu.js +0 -359
- package/dist/qr-image-DcG1bUox.js +0 -2
- package/dist/queue-BveCZpTb.js +0 -636
- package/dist/realtime-provider-shared-BIili3oc.js +0 -21
- package/dist/realtime-transcription-provider-DqEHy_Jr.js +0 -180
- package/dist/realtime-voice-provider-Dau1KlKK.js +0 -342
- package/dist/record-shared-CC55xbFE.js +0 -10
- package/dist/refresh-BXJ80ji4.js +0 -115
- package/dist/region-CPFmncMW.js +0 -74
- package/dist/register.agent-D5el253o.js +0 -241
- package/dist/register.backup-CBhoChp-.js +0 -234
- package/dist/register.configure-DeqUaelp.js +0 -15
- package/dist/register.maintenance-Dv5x9ZE6.js +0 -443
- package/dist/register.message-e2Pbh8A_.js +0 -601
- package/dist/register.onboard-COuTKpAw.js +0 -83
- package/dist/register.runtime-BjOIl4eF.js +0 -81
- package/dist/register.runtime-BzJ6RkQN.js +0 -343
- package/dist/register.setup-DQYY7K4K.js +0 -104
- package/dist/register.status-health-sessions-CXNGQh_O.js +0 -1211
- package/dist/register.subclis-B6uy_ogx.js +0 -232
- package/dist/register.subclis-Cmdrfiej.js +0 -3
- package/dist/repair-C8v1vNU-.js +0 -112
- package/dist/replay-policy-C6igC4nS.js +0 -8
- package/dist/reply-Bd8ShNWW.js +0 -3523
- package/dist/reply.runtime-ByKwE5dg.js +0 -2
- package/dist/resolve-CSTOvc_c.js +0 -280
- package/dist/restart-C0QhPXk1.js +0 -454
- package/dist/root-help-D2vz4lbV.js +0 -44
- package/dist/route-reply-CXZFXlfK.js +0 -141
- package/dist/route-reply.runtime-BK8V9NEg.js +0 -2
- package/dist/rpc-f0OkPaI1.js +0 -61
- package/dist/rpc.runtime-BQ78T_pB.js +0 -21
- package/dist/run-main-CkwrrhfI.js +0 -453
- package/dist/run-wait-B4pXPLkF.js +0 -118
- package/dist/runner-BSA9M_M9.js +0 -1497
- package/dist/runs-CEDW87Fd.js +0 -495
- package/dist/runtime-C18YgW822.js +0 -242
- package/dist/runtime-C3OJQ1Xd.js +0 -200
- package/dist/runtime-CDNVtwVk.js +0 -72
- package/dist/runtime-CMNHfJtF.js +0 -725
- package/dist/runtime-C_o_otMV.js +0 -355
- package/dist/runtime-CiJWy5Ce.js +0 -9
- package/dist/runtime-D8bLKXLh.js +0 -253
- package/dist/runtime-DM4z9RVx.js +0 -2
- package/dist/runtime-Di50Fr1z.js +0 -191
- package/dist/runtime-W3qG5LHM.js +0 -2
- package/dist/runtime-api-Bx7nlc4w.js +0 -12
- package/dist/runtime-api-DCNC_FTy2.js +0 -2
- package/dist/runtime-api-_Z8MjR0l.js +0 -3
- package/dist/runtime-embedded-pi.runtime-Cv0MW9ps.js +0 -3
- package/dist/runtime-internal-DclGtT-e.js +0 -2
- package/dist/runtime-model-auth.runtime-Bjl23_fr.js +0 -39
- package/dist/runtime-oEwr_zQb.js +0 -107
- package/dist/runtime-plugins-CwWhqXLJ.js +0 -69
- package/dist/runtime-prepare.runtime-Bi-YD5R-.js +0 -80
- package/dist/runtime-provider-CSEDbSxr.js +0 -21
- package/dist/runtime-registry-loader-CbbaZCXY.js +0 -58
- package/dist/runtime-registry-loader-kqiMFCUa.js +0 -2
- package/dist/runtime-schema-CDuvvU7B.js +0 -28383
- package/dist/runtime-shared-BxJFDFe6.js +0 -249
- package/dist/runtime-taskflow-RwpXng2l.js +0 -250
- package/dist/runtime-web-channel-plugin-Bw74Ar_q.js +0 -215
- package/dist/runtime-web-tools-CEaAGeYr.js +0 -1467
- package/dist/runtime-web-tools-fallback.runtime-DU8Hp_QZ.js +0 -9
- package/dist/sandbox-BC2XUWcW.js +0 -4
- package/dist/sandbox-cli-ain0MYTB.js +0 -447
- package/dist/sandbox-epLgxWBQ.js +0 -2586
- package/dist/secrets-cli-iLwRZbRt.js +0 -2114
- package/dist/security-audit-DfrokBuq.js +0 -34
- package/dist/security-cli-BqsMM550.js +0 -486
- package/dist/semantic-dedup-BBpIPaSV.js +0 -95
- package/dist/send-C5LHdZqP.js +0 -993
- package/dist/send-media-Df0E2Z_m.js +0 -2123
- package/dist/server-2CD2yd73.js +0 -13
- package/dist/server-B44RMlVT.js +0 -77
- package/dist/server-context-SulhWpXY.js +0 -4164
- package/dist/server-methods-BPzzX5VC.js +0 -11937
- package/dist/server-middleware-WQzQIrD4.js +0 -110
- package/dist/server-node-events-Ug_Atc7G.js +0 -451
- package/dist/server.impl-InfVdwPj.js +0 -19765
- package/dist/session-B5RmIL21.js +0 -48
- package/dist/session-conversation-CFty7VTc.js +0 -27
- package/dist/session-cost-usage-CckjvorH.js +0 -2
- package/dist/session-cost-usage-DMRjhi4B.js +0 -648
- package/dist/session-file-DGJqy_ea.js +0 -44
- package/dist/session-key-D-jBcxEp.js +0 -65
- package/dist/session-meta-BijZlLS3.js +0 -109
- package/dist/session-override-1YQHEAlz.js +0 -103
- package/dist/session-reset-model.runtime-CEWrfXLr.js +0 -120
- package/dist/session-reset-service-Dphtb16d.js +0 -474
- package/dist/session-subagent-reactivation.runtime-CF4aqSpn.js +0 -2
- package/dist/session-system-events-BSVIh760.js +0 -63
- package/dist/session-tab-registry-DG9SGi0I.js +0 -553
- package/dist/session-updates-BRFvmIoC.js +0 -234
- package/dist/session-updates.runtime-CiHARWGr.js +0 -2
- package/dist/session-utils-Cai4P9ih.js +0 -930
- package/dist/sessions-BTcXDmCA.js +0 -2
- package/dist/sessions-CyYVTseV.js +0 -45
- package/dist/sessions-Fb0ep3uj.js +0 -231
- package/dist/sessions.runtime-BGyynSR4.js +0 -2
- package/dist/setup-CjEjg8Ci.js +0 -505
- package/dist/setup-D-ypxGnK.js +0 -329
- package/dist/setup-surface-QaubzT60.js +0 -586
- package/dist/setup.finalize-B3MWkUF9.js +0 -436
- package/dist/setup.gateway-config-BdK0tA_r.js +0 -246
- package/dist/shared-0JcWj8-R.js +0 -224
- package/dist/shared-BOd3OCF0.js +0 -36
- package/dist/shared-DICWV0-6.js +0 -218
- package/dist/shared-DiGX-JK8.js +0 -137
- package/dist/shared-DktX3NHd.js +0 -175
- package/dist/shared-runtime-BltNIfGY.js +0 -7
- package/dist/short-term-promotion-CT1zdD1r.js +0 -1631
- package/dist/simple-completion-runtime-CZyp8rJ3.js +0 -131
- package/dist/simple-completion-transport-BWyoXghG.js +0 -32
- package/dist/skill-commands-BC_2IdwF.js +0 -82
- package/dist/skill-commands.runtime-BP6BnOeq.js +0 -2
- package/dist/skills-BQX1AsbM.js +0 -4
- package/dist/skills-D7XPR8N-.js +0 -1075
- package/dist/skills-cli-CxmgxC7X.js +0 -382
- package/dist/skills-install-CHUWYiLs.js +0 -822
- package/dist/skills-status-DRTnP8E3.js +0 -170
- package/dist/skills-status-v28wm8HD.js +0 -2
- package/dist/soul-cli-B1-3BHbA.js +0 -110
- package/dist/speech-core-aXx4I3sB.js +0 -126
- package/dist/speech-provider-BTBQ5VOv.js +0 -103
- package/dist/speech-provider-BciszvJf.js +0 -184
- package/dist/speech-provider-BoQDEC_Y.js +0 -167
- package/dist/speech-provider-C-wTEx8k.js +0 -182
- package/dist/stage-sandbox-media.runtime-DhlTQjXA.js +0 -230
- package/dist/standalone-generate-BRvNW_O7.js +0 -2
- package/dist/standalone-generate-CDfZss4x.js +0 -217
- package/dist/startup-auth-B5V0AaIU.js +0 -151
- package/dist/state-migrations-BNib6l8O.js +0 -823
- package/dist/status-8clcfnN0.js +0 -473
- package/dist/status-C9YBVOov.js +0 -278
- package/dist/status-CNcOKUs2.js +0 -500
- package/dist/status-D1l9Tu3s.js +0 -399
- package/dist/status-DKth_wbp.js +0 -2
- package/dist/status-P3bvFirO.js +0 -3
- package/dist/status-TmH9qSMG.js +0 -2
- package/dist/status-all-BeyVXDNT.js +0 -495
- package/dist/status-json-Cj42CVZZ.js +0 -14
- package/dist/status-json-command-DWk5RiyN.js +0 -92
- package/dist/status-runtime-shared-orzti3tZ.js +0 -271
- package/dist/status.command.text-runtime-B-tNLc3T.js +0 -15
- package/dist/status.gateway-connection.runtime-BrkaJ2f5.js +0 -2
- package/dist/status.gateway-probe-BwuiZk1h.js +0 -16
- package/dist/status.scan-DegSjLE2.js +0 -62
- package/dist/status.scan-overview-CrSELCru.js +0 -395
- package/dist/status.scan.deps.runtime-DrUvBz4e.js +0 -18
- package/dist/status.scan.fast-json-Bm5lN6IK.js +0 -2
- package/dist/status.scan.fast-json-Ch2Zw813.js +0 -128
- package/dist/status.scan.runtime-D-LvzBYN.js +0 -417
- package/dist/status.summary-OB-43Bvk.js +0 -2
- package/dist/status.summary-gJukahkb.js +0 -209
- package/dist/store-D5JODeba.js +0 -421
- package/dist/store-D_vXZ7m9.js +0 -1112
- package/dist/store-yc7MvXdd.js +0 -1075
- package/dist/store.runtime-6eaZtPq6.js +0 -2
- package/dist/stream-BgcqyefI.js +0 -649
- package/dist/stream-wrappers-B7-5gN0i.js +0 -144
- package/dist/subagent-announce.registry.runtime-R2bop0gW.js +0 -3
- package/dist/subagent-control-UyMtkJwo.js +0 -485
- package/dist/subagent-followup.runtime-bTK0TymS.js +0 -68
- package/dist/subagent-list-c0JKZR0g.js +0 -168
- package/dist/subagent-orphan-recovery-CSEzwva5.js +0 -214
- package/dist/subagent-registry-Be219RP1.js +0 -2889
- package/dist/subagent-registry-runtime-Dk57Y91p.js +0 -2
- package/dist/subagent-registry.runtime-D6h_BK2i.js +0 -3
- package/dist/subagent-spawn-BeyYZuFf.js +0 -782
- package/dist/subagents-format-ZcZBg1Vh.js +0 -629
- package/dist/system-cli-_3czEwa7.js +0 -60
- package/dist/targets-CXrDP8_l.js +0 -595
- package/dist/task-executor-DNUNtRg8.js +0 -350
- package/dist/task-owner-access--E5Vkg9U.js +0 -48
- package/dist/task-registry-COE-B6MO.js +0 -2346
- package/dist/task-registry-control.runtime-BzsTfRw1.js +0 -3
- package/dist/task-registry-delivery-runtime-Cv6xz8KP.js +0 -2
- package/dist/task-registry-delivery-runtime-DSfcd2LA.js +0 -3
- package/dist/task-registry.maintenance-Bhd9abl9.js +0 -2
- package/dist/task-registry.maintenance-W3lTkY0l.js +0 -425
- package/dist/testing-CQ_-oCQB.js +0 -441
- package/dist/text-report-BgqWDKJR.js +0 -587
- package/dist/text-runtime-asv4kIxS.js +0 -313
- package/dist/thread-bindings-BCRWofo_.js +0 -223
- package/dist/tool-auth-shared-BWZwTobX.js +0 -53
- package/dist/tool-config-shared-BleK697I.js +0 -19
- package/dist/tool-schema-runtime-DZsW_KR4.js +0 -1892
- package/dist/tools-C7lv9rSD.js +0 -110
- package/dist/tools-effective-inventory-SB9JwX-y.js +0 -152
- package/dist/tools.runtime-J5rhfXQp.js +0 -4
- package/dist/transcript-DxWx6dVc.js +0 -233
- package/dist/transcript.runtime-CmBnobSv.js +0 -2
- package/dist/transport-policy-BGfaKNz0.js +0 -75
- package/dist/tts-C1GyTLOi.js +0 -31
- package/dist/tui-Cqdp1x16.js +0 -4018
- package/dist/tui-cli-BC4O3H6r.js +0 -31
- package/dist/update-cli-BzaCTuax.js +0 -1779
- package/dist/update-runner-Cvxezvhf.js +0 -1492
- package/dist/usage-format-DQTT4pqY.js +0 -507
- package/dist/usage-format-sR4xu0xw.js +0 -2
- package/dist/video-generation-provider-7YR4_ldd.js +0 -171
- package/dist/video-generation-provider-AlAZkYIW.js +0 -181
- package/dist/video-generation-provider-BEqi4pUJ.js +0 -104
- package/dist/video-generation-provider-CraaZaR7.js +0 -77
- package/dist/video-generation-provider-CuvO2Hzh.js +0 -246
- package/dist/video-generation-provider-D-t16ACe.js +0 -240
- package/dist/video-generation-provider-DeowxvLt.js +0 -233
- package/dist/video-generation-provider-HbOZ3qzI.js +0 -227
- package/dist/video-generation-provider-_apx1yFE.js +0 -263
- package/dist/video-generation-provider-bvpb6cdV.js +0 -64
- package/dist/web-fetch-providers.runtime-m66rypbB.js +0 -33
- package/dist/web-search-DSDz1iyf.js +0 -221
- package/dist/web-search-provider-DnYRRBVM.js +0 -155
- package/dist/web-search-providers.runtime-Cv56XIGr.js +0 -206
- package/dist/webhooks-cli-DQ_JTSNA.js +0 -321
- package/dist/x-search-shared-DKPdPR5_.js +0 -109
- package/dist/zod-schema-B7jQiHXQ.js +0 -1400
|
@@ -0,0 +1,1662 @@
|
|
|
1
|
+
import { i as normalizeLowercaseStringOrEmpty, o as normalizeOptionalLowercaseString, s as normalizeOptionalString } from "./string-coerce-xZwG7Dq8.js";
|
|
2
|
+
import { r as formatErrorMessage } from "./errors-Ez4cKI2Y.js";
|
|
3
|
+
import { l as isRecord$2 } from "./utils-C8dt4mi-.js";
|
|
4
|
+
import { n as resolvePreferredKaijiBotTmpDir } from "./tmp-kaijibot-dir-BrBqRkqt.js";
|
|
5
|
+
import { t as createSubsystemLogger } from "./subsystem-BikUf0BS.js";
|
|
6
|
+
import { t as isTruthyEnvValue } from "./env-XRvlVcpF.js";
|
|
7
|
+
import { o as loadAuthProfileStoreForRuntime, v as readClaudeCliCredentialsCached, y as readCodexCliCredentialsCached } from "./store-C6poa5Og.js";
|
|
8
|
+
import { k as resolveRuntimeCliBackends, p as resolveDefaultModelForAgent } from "./model-selection-Bq91MzO2.js";
|
|
9
|
+
import { r as normalizeProviderId } from "./provider-id-DjOGAXK8.js";
|
|
10
|
+
import { m as scopedHeartbeatWakeOptions } from "./session-key-Dny5dRer.js";
|
|
11
|
+
import { y as resolveSessionAgentIds } from "./agent-scope-z3lpbLWu.js";
|
|
12
|
+
import { a as shouldLogVerbose } from "./globals-CwigADVM.js";
|
|
13
|
+
import { ot as resolveOwnerDisplaySetting } from "./io-NwOu0Lqq.js";
|
|
14
|
+
import { n as resolvePluginSetupCliBackend } from "./setup-registry-BpUliO1G.js";
|
|
15
|
+
import { o as sanitizeHostExecEnv } from "./host-env-security-KmRly3g2.js";
|
|
16
|
+
import { i as applyMergePatch } from "./schema-validator-Czhl4DwJ.js";
|
|
17
|
+
import { c as loadEnabledBundleMcpConfig, o as extractMcpServerMap } from "./loader-C5UkICT1.js";
|
|
18
|
+
import { n as buildTtsSystemPromptHint } from "./tts-CLcD9M9-.js";
|
|
19
|
+
import { i as resolveBootstrapContextForRun, o as resolveHeartbeatPromptForSystemPrompt, r as makeBootstrapWarn } from "./bootstrap-files-DsmC0cJP.js";
|
|
20
|
+
import { _ as resolveBootstrapPromptTruncationWarningMode, g as resolveBootstrapMaxChars, v as resolveBootstrapTotalMaxChars } from "./pi-embedded-helpers-y7PopKx-.js";
|
|
21
|
+
import { m as isFailoverErrorMessage, n as classifyFailoverReason } from "./errors-CVtNPIIv.js";
|
|
22
|
+
import { n as sanitizeImageBlocks } from "./tool-images-DwQbpK4N.js";
|
|
23
|
+
import { n as requestHeartbeatNow } from "./heartbeat-wake-DL3yhijT.js";
|
|
24
|
+
import { i as enqueueSystemEvent } from "./system-events-Yd4M0_kC.js";
|
|
25
|
+
import { n as detectRuntimeShell, t as getProcessSupervisor } from "./supervisor-DVGQ2rPX.js";
|
|
26
|
+
import { n as extensionForMime } from "./mime-DU0uzyOh.js";
|
|
27
|
+
import { i as isFailoverError, s as resolveFailoverStatus, t as FailoverError } from "./failover-error-DhuV9hFr.js";
|
|
28
|
+
import { i as emitAgentEvent } from "./agent-events-DScaTZPE.js";
|
|
29
|
+
import { t as KeyedAsyncQueue } from "./keyed-async-queue-C2sMQqNB.js";
|
|
30
|
+
import { i as stripSystemPromptCacheBoundary } from "./system-prompt-cache-boundary-BqVZ8lnu.js";
|
|
31
|
+
import { t as resolveSystemPromptOverride } from "./system-prompt-override-BvrVp0wH.js";
|
|
32
|
+
import { t as buildAgentSystemPrompt } from "./system-prompt-BBrWR8Ef.js";
|
|
33
|
+
import { t as buildModelAliasLines } from "./model-alias-lines-Dec_ADy_.js";
|
|
34
|
+
import { a as buildSystemPromptParams, i as buildSystemPromptReport, n as detectImageReferences, o as redactRunIdentifier, r as loadImageFromRef, s as resolveRunWorkspaceDir } from "./images-BwT2L5zh.js";
|
|
35
|
+
import { a as prependBootstrapPromptWarning, i as buildBootstrapTruncationReportMeta, n as buildBootstrapInjectionStats, r as buildBootstrapPromptWarning, t as analyzeBootstrapBudget } from "./bootstrap-budget-zHsa4DnA.js";
|
|
36
|
+
import { n as CLI_RESUME_WATCHDOG_DEFAULTS, r as CLI_WATCHDOG_MIN_TIMEOUT_MS, t as CLI_FRESH_WATCHDOG_DEFAULTS } from "./cli-watchdog-defaults-BI8aHces.js";
|
|
37
|
+
import os from "node:os";
|
|
38
|
+
import path from "node:path";
|
|
39
|
+
import fs from "node:fs/promises";
|
|
40
|
+
import crypto from "node:crypto";
|
|
41
|
+
//#region src/agents/cli-output.ts
|
|
42
|
+
function isClaudeCliProvider$1(providerId) {
|
|
43
|
+
return normalizeLowercaseStringOrEmpty(providerId) === "claude-cli";
|
|
44
|
+
}
|
|
45
|
+
function extractJsonObjectCandidates(raw) {
|
|
46
|
+
const candidates = [];
|
|
47
|
+
let depth = 0;
|
|
48
|
+
let start = -1;
|
|
49
|
+
let inString = false;
|
|
50
|
+
let escaped = false;
|
|
51
|
+
for (let index = 0; index < raw.length; index += 1) {
|
|
52
|
+
const char = raw[index] ?? "";
|
|
53
|
+
if (escaped) {
|
|
54
|
+
escaped = false;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (char === "\\") {
|
|
58
|
+
if (inString) escaped = true;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (char === "\"") {
|
|
62
|
+
inString = !inString;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (inString) continue;
|
|
66
|
+
if (char === "{") {
|
|
67
|
+
if (depth === 0) start = index;
|
|
68
|
+
depth += 1;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (char === "}" && depth > 0) {
|
|
72
|
+
depth -= 1;
|
|
73
|
+
if (depth === 0 && start >= 0) {
|
|
74
|
+
candidates.push(raw.slice(start, index + 1));
|
|
75
|
+
start = -1;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return candidates;
|
|
80
|
+
}
|
|
81
|
+
function parseJsonRecordCandidates(raw) {
|
|
82
|
+
const parsedRecords = [];
|
|
83
|
+
const trimmed = raw.trim();
|
|
84
|
+
if (!trimmed) return parsedRecords;
|
|
85
|
+
try {
|
|
86
|
+
const parsed = JSON.parse(trimmed);
|
|
87
|
+
if (isRecord$2(parsed)) {
|
|
88
|
+
parsedRecords.push(parsed);
|
|
89
|
+
return parsedRecords;
|
|
90
|
+
}
|
|
91
|
+
} catch {}
|
|
92
|
+
for (const candidate of extractJsonObjectCandidates(trimmed)) try {
|
|
93
|
+
const parsed = JSON.parse(candidate);
|
|
94
|
+
if (isRecord$2(parsed)) parsedRecords.push(parsed);
|
|
95
|
+
} catch {}
|
|
96
|
+
return parsedRecords;
|
|
97
|
+
}
|
|
98
|
+
function readNestedErrorMessage(parsed) {
|
|
99
|
+
if (isRecord$2(parsed.error)) {
|
|
100
|
+
const errorMessage = readNestedErrorMessage(parsed.error);
|
|
101
|
+
if (errorMessage) return errorMessage;
|
|
102
|
+
}
|
|
103
|
+
if (typeof parsed.message === "string") {
|
|
104
|
+
const trimmed = parsed.message.trim();
|
|
105
|
+
if (trimmed) return trimmed;
|
|
106
|
+
}
|
|
107
|
+
if (typeof parsed.error === "string") {
|
|
108
|
+
const trimmed = parsed.error.trim();
|
|
109
|
+
if (trimmed) return trimmed;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function unwrapCliErrorText(raw) {
|
|
113
|
+
const trimmed = raw.trim();
|
|
114
|
+
if (!trimmed) return "";
|
|
115
|
+
for (const parsed of parseJsonRecordCandidates(trimmed)) {
|
|
116
|
+
const nested = readNestedErrorMessage(parsed);
|
|
117
|
+
if (nested) return nested;
|
|
118
|
+
}
|
|
119
|
+
return trimmed;
|
|
120
|
+
}
|
|
121
|
+
function toCliUsage(raw) {
|
|
122
|
+
const pick = (key) => typeof raw[key] === "number" && raw[key] > 0 ? raw[key] : void 0;
|
|
123
|
+
const totalInput = pick("input_tokens") ?? pick("inputTokens");
|
|
124
|
+
const output = pick("output_tokens") ?? pick("outputTokens");
|
|
125
|
+
const cacheRead = pick("cache_read_input_tokens") ?? pick("cached_input_tokens") ?? pick("cacheRead") ?? pick("cached");
|
|
126
|
+
const input = pick("input") ?? (Object.hasOwn(raw, "cached") && typeof totalInput === "number" ? Math.max(0, totalInput - (cacheRead ?? 0)) : totalInput);
|
|
127
|
+
const cacheWrite = pick("cache_creation_input_tokens") ?? pick("cache_write_input_tokens") ?? pick("cacheWrite");
|
|
128
|
+
const total = pick("total_tokens") ?? pick("total");
|
|
129
|
+
if (!input && !output && !cacheRead && !cacheWrite && !total) return;
|
|
130
|
+
return {
|
|
131
|
+
input,
|
|
132
|
+
output,
|
|
133
|
+
cacheRead,
|
|
134
|
+
cacheWrite,
|
|
135
|
+
total
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function readCliUsage(parsed) {
|
|
139
|
+
if (isRecord$2(parsed.usage)) {
|
|
140
|
+
const usage = toCliUsage(parsed.usage);
|
|
141
|
+
if (usage) return usage;
|
|
142
|
+
}
|
|
143
|
+
if (isRecord$2(parsed.stats)) return toCliUsage(parsed.stats);
|
|
144
|
+
}
|
|
145
|
+
function collectCliText(value) {
|
|
146
|
+
if (!value) return "";
|
|
147
|
+
if (typeof value === "string") return value;
|
|
148
|
+
if (Array.isArray(value)) return value.map((entry) => collectCliText(entry)).join("");
|
|
149
|
+
if (!isRecord$2(value)) return "";
|
|
150
|
+
if (typeof value.response === "string") return value.response;
|
|
151
|
+
if (typeof value.text === "string") return value.text;
|
|
152
|
+
if (typeof value.result === "string") return value.result;
|
|
153
|
+
if (typeof value.content === "string") return value.content;
|
|
154
|
+
if (Array.isArray(value.content)) return value.content.map((entry) => collectCliText(entry)).join("");
|
|
155
|
+
if (isRecord$2(value.message)) return collectCliText(value.message);
|
|
156
|
+
return "";
|
|
157
|
+
}
|
|
158
|
+
function collectExplicitCliErrorText(parsed) {
|
|
159
|
+
const nested = readNestedErrorMessage(parsed);
|
|
160
|
+
if (nested) return unwrapCliErrorText(nested);
|
|
161
|
+
if (parsed.is_error === true && typeof parsed.result === "string") return unwrapCliErrorText(parsed.result);
|
|
162
|
+
if (parsed.type === "assistant") {
|
|
163
|
+
const text = collectCliText(parsed.message);
|
|
164
|
+
if (/^\s*API Error:/i.test(text)) return unwrapCliErrorText(text);
|
|
165
|
+
}
|
|
166
|
+
if (parsed.type === "error") return unwrapCliErrorText(collectCliText(parsed.message) || collectCliText(parsed.content) || collectCliText(parsed.result) || collectCliText(parsed));
|
|
167
|
+
return "";
|
|
168
|
+
}
|
|
169
|
+
function pickCliSessionId(parsed, backend) {
|
|
170
|
+
const fields = backend.sessionIdFields ?? [
|
|
171
|
+
"session_id",
|
|
172
|
+
"sessionId",
|
|
173
|
+
"conversation_id",
|
|
174
|
+
"conversationId"
|
|
175
|
+
];
|
|
176
|
+
for (const field of fields) {
|
|
177
|
+
const value = parsed[field];
|
|
178
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function parseCliJson(raw, backend) {
|
|
182
|
+
const parsedRecords = parseJsonRecordCandidates(raw);
|
|
183
|
+
if (parsedRecords.length === 0) return null;
|
|
184
|
+
let sessionId;
|
|
185
|
+
let usage;
|
|
186
|
+
let text = "";
|
|
187
|
+
let sawStructuredOutput = false;
|
|
188
|
+
for (const parsed of parsedRecords) {
|
|
189
|
+
sessionId = pickCliSessionId(parsed, backend) ?? sessionId;
|
|
190
|
+
usage = readCliUsage(parsed) ?? usage;
|
|
191
|
+
const trimmedText = (collectCliText(parsed.message) || collectCliText(parsed.content) || collectCliText(parsed.result) || collectCliText(parsed.response) || collectCliText(parsed)).trim();
|
|
192
|
+
if (trimmedText) {
|
|
193
|
+
text = trimmedText;
|
|
194
|
+
sawStructuredOutput = true;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (sessionId || usage) sawStructuredOutput = true;
|
|
198
|
+
}
|
|
199
|
+
if (!text && !sawStructuredOutput) return null;
|
|
200
|
+
return {
|
|
201
|
+
text,
|
|
202
|
+
sessionId,
|
|
203
|
+
usage
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function parseClaudeCliJsonlResult(params) {
|
|
207
|
+
if (!isClaudeCliProvider$1(params.providerId)) return null;
|
|
208
|
+
if (typeof params.parsed.type === "string" && params.parsed.type === "result" && typeof params.parsed.result === "string") {
|
|
209
|
+
const resultText = params.parsed.result.trim();
|
|
210
|
+
if (resultText) return {
|
|
211
|
+
text: resultText,
|
|
212
|
+
sessionId: params.sessionId,
|
|
213
|
+
usage: params.usage
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
text: "",
|
|
217
|
+
sessionId: params.sessionId,
|
|
218
|
+
usage: params.usage
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
function parseClaudeCliStreamingDelta(params) {
|
|
224
|
+
if (!isClaudeCliProvider$1(params.providerId)) return null;
|
|
225
|
+
if (params.parsed.type !== "stream_event" || !isRecord$2(params.parsed.event)) return null;
|
|
226
|
+
const event = params.parsed.event;
|
|
227
|
+
if (event.type !== "content_block_delta" || !isRecord$2(event.delta)) return null;
|
|
228
|
+
const delta = event.delta;
|
|
229
|
+
if (delta.type !== "text_delta" || typeof delta.text !== "string") return null;
|
|
230
|
+
if (!delta.text) return null;
|
|
231
|
+
return {
|
|
232
|
+
text: `${params.textSoFar}${delta.text}`,
|
|
233
|
+
delta: delta.text,
|
|
234
|
+
sessionId: params.sessionId,
|
|
235
|
+
usage: params.usage
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function createCliJsonlStreamingParser(params) {
|
|
239
|
+
let lineBuffer = "";
|
|
240
|
+
let assistantText = "";
|
|
241
|
+
let sessionId;
|
|
242
|
+
let usage;
|
|
243
|
+
const handleParsedRecord = (parsed) => {
|
|
244
|
+
sessionId = pickCliSessionId(parsed, params.backend) ?? sessionId;
|
|
245
|
+
if (!sessionId && typeof parsed.thread_id === "string") sessionId = parsed.thread_id.trim();
|
|
246
|
+
if (isRecord$2(parsed.usage)) usage = toCliUsage(parsed.usage) ?? usage;
|
|
247
|
+
const delta = parseClaudeCliStreamingDelta({
|
|
248
|
+
providerId: params.providerId,
|
|
249
|
+
parsed,
|
|
250
|
+
textSoFar: assistantText,
|
|
251
|
+
sessionId,
|
|
252
|
+
usage
|
|
253
|
+
});
|
|
254
|
+
if (!delta) return;
|
|
255
|
+
assistantText = delta.text;
|
|
256
|
+
params.onAssistantDelta(delta);
|
|
257
|
+
};
|
|
258
|
+
const flushLines = (flushPartial) => {
|
|
259
|
+
while (true) {
|
|
260
|
+
const newlineIndex = lineBuffer.indexOf("\n");
|
|
261
|
+
if (newlineIndex < 0) break;
|
|
262
|
+
const line = lineBuffer.slice(0, newlineIndex).trim();
|
|
263
|
+
lineBuffer = lineBuffer.slice(newlineIndex + 1);
|
|
264
|
+
if (!line) continue;
|
|
265
|
+
for (const parsed of parseJsonRecordCandidates(line)) handleParsedRecord(parsed);
|
|
266
|
+
}
|
|
267
|
+
if (!flushPartial) return;
|
|
268
|
+
const tail = lineBuffer.trim();
|
|
269
|
+
lineBuffer = "";
|
|
270
|
+
if (!tail) return;
|
|
271
|
+
for (const parsed of parseJsonRecordCandidates(tail)) handleParsedRecord(parsed);
|
|
272
|
+
};
|
|
273
|
+
return {
|
|
274
|
+
push(chunk) {
|
|
275
|
+
if (!chunk) return;
|
|
276
|
+
lineBuffer += chunk;
|
|
277
|
+
flushLines(false);
|
|
278
|
+
},
|
|
279
|
+
finish() {
|
|
280
|
+
flushLines(true);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function parseCliJsonl(raw, backend, providerId) {
|
|
285
|
+
const lines = raw.split(/\r?\n/g).map((line) => line.trim()).filter(Boolean);
|
|
286
|
+
if (lines.length === 0) return null;
|
|
287
|
+
let sessionId;
|
|
288
|
+
let usage;
|
|
289
|
+
const texts = [];
|
|
290
|
+
for (const line of lines) for (const parsed of parseJsonRecordCandidates(line)) {
|
|
291
|
+
if (!sessionId) sessionId = pickCliSessionId(parsed, backend);
|
|
292
|
+
if (!sessionId && typeof parsed.thread_id === "string") sessionId = parsed.thread_id.trim();
|
|
293
|
+
usage = readCliUsage(parsed) ?? usage;
|
|
294
|
+
const claudeResult = parseClaudeCliJsonlResult({
|
|
295
|
+
providerId,
|
|
296
|
+
parsed,
|
|
297
|
+
sessionId,
|
|
298
|
+
usage
|
|
299
|
+
});
|
|
300
|
+
if (claudeResult) return claudeResult;
|
|
301
|
+
const item = isRecord$2(parsed.item) ? parsed.item : null;
|
|
302
|
+
if (item && typeof item.text === "string") {
|
|
303
|
+
const type = normalizeLowercaseStringOrEmpty(item.type);
|
|
304
|
+
if (!type || type.includes("message")) texts.push(item.text);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const text = texts.join("\n").trim();
|
|
308
|
+
if (!text) return null;
|
|
309
|
+
return {
|
|
310
|
+
text,
|
|
311
|
+
sessionId,
|
|
312
|
+
usage
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function parseCliOutput(params) {
|
|
316
|
+
const outputMode = params.outputMode ?? "text";
|
|
317
|
+
if (outputMode === "text") return {
|
|
318
|
+
text: params.raw.trim(),
|
|
319
|
+
sessionId: params.fallbackSessionId
|
|
320
|
+
};
|
|
321
|
+
if (outputMode === "jsonl") return parseCliJsonl(params.raw, params.backend, params.providerId) ?? {
|
|
322
|
+
text: params.raw.trim(),
|
|
323
|
+
sessionId: params.fallbackSessionId
|
|
324
|
+
};
|
|
325
|
+
return parseCliJson(params.raw, params.backend) ?? {
|
|
326
|
+
text: params.raw.trim(),
|
|
327
|
+
sessionId: params.fallbackSessionId
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function extractCliErrorMessage(raw) {
|
|
331
|
+
const parsedRecords = parseJsonRecordCandidates(raw);
|
|
332
|
+
if (parsedRecords.length === 0) return null;
|
|
333
|
+
let errorText = "";
|
|
334
|
+
for (const parsed of parsedRecords) {
|
|
335
|
+
const next = collectExplicitCliErrorText(parsed);
|
|
336
|
+
if (next) errorText = next;
|
|
337
|
+
}
|
|
338
|
+
return errorText || null;
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/agents/cli-runner/toml-inline.ts
|
|
342
|
+
function escapeTomlString(value) {
|
|
343
|
+
return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
344
|
+
}
|
|
345
|
+
function formatTomlKey(key) {
|
|
346
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : `"${escapeTomlString(key)}"`;
|
|
347
|
+
}
|
|
348
|
+
function isRecord$1(value) {
|
|
349
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
350
|
+
}
|
|
351
|
+
function serializeTomlInlineValue(value) {
|
|
352
|
+
if (typeof value === "string") return `"${escapeTomlString(value)}"`;
|
|
353
|
+
if (typeof value === "number" || typeof value === "bigint") return String(value);
|
|
354
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
355
|
+
if (Array.isArray(value)) return `[${value.map((entry) => serializeTomlInlineValue(entry)).join(", ")}]`;
|
|
356
|
+
if (isRecord$1(value)) return `{ ${Object.entries(value).map(([key, entry]) => `${formatTomlKey(key)} = ${serializeTomlInlineValue(entry)}`).join(", ")} }`;
|
|
357
|
+
throw new Error(`Unsupported TOML inline value: ${String(value)}`);
|
|
358
|
+
}
|
|
359
|
+
function formatTomlConfigOverride(key, value) {
|
|
360
|
+
return `${key}=${serializeTomlInlineValue(value)}`;
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/agents/cli-runner/reliability.ts
|
|
364
|
+
function pickWatchdogProfile(backend, useResume) {
|
|
365
|
+
const defaults = useResume ? CLI_RESUME_WATCHDOG_DEFAULTS : CLI_FRESH_WATCHDOG_DEFAULTS;
|
|
366
|
+
const configured = useResume ? backend.reliability?.watchdog?.resume : backend.reliability?.watchdog?.fresh;
|
|
367
|
+
const ratio = (() => {
|
|
368
|
+
const value = configured?.noOutputTimeoutRatio;
|
|
369
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return defaults.noOutputTimeoutRatio;
|
|
370
|
+
return Math.max(.05, Math.min(.95, value));
|
|
371
|
+
})();
|
|
372
|
+
const minMs = (() => {
|
|
373
|
+
const value = configured?.minMs;
|
|
374
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return defaults.minMs;
|
|
375
|
+
return Math.max(CLI_WATCHDOG_MIN_TIMEOUT_MS, Math.floor(value));
|
|
376
|
+
})();
|
|
377
|
+
const maxMs = (() => {
|
|
378
|
+
const value = configured?.maxMs;
|
|
379
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return defaults.maxMs;
|
|
380
|
+
return Math.max(CLI_WATCHDOG_MIN_TIMEOUT_MS, Math.floor(value));
|
|
381
|
+
})();
|
|
382
|
+
return {
|
|
383
|
+
noOutputTimeoutMs: typeof configured?.noOutputTimeoutMs === "number" && Number.isFinite(configured.noOutputTimeoutMs) ? Math.max(CLI_WATCHDOG_MIN_TIMEOUT_MS, Math.floor(configured.noOutputTimeoutMs)) : void 0,
|
|
384
|
+
noOutputTimeoutRatio: ratio,
|
|
385
|
+
minMs: Math.min(minMs, maxMs),
|
|
386
|
+
maxMs: Math.max(minMs, maxMs)
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function resolveCliNoOutputTimeoutMs(params) {
|
|
390
|
+
const profile = pickWatchdogProfile(params.backend, params.useResume);
|
|
391
|
+
const cap = Math.max(CLI_WATCHDOG_MIN_TIMEOUT_MS, params.timeoutMs - 1e3);
|
|
392
|
+
if (profile.noOutputTimeoutMs !== void 0) return Math.min(profile.noOutputTimeoutMs, cap);
|
|
393
|
+
const computed = Math.floor(params.timeoutMs * profile.noOutputTimeoutRatio);
|
|
394
|
+
const bounded = Math.min(profile.maxMs, Math.max(profile.minMs, computed));
|
|
395
|
+
return Math.min(bounded, cap);
|
|
396
|
+
}
|
|
397
|
+
function buildCliSupervisorScopeKey(params) {
|
|
398
|
+
const commandToken = normalizeLowercaseStringOrEmpty(path.basename(params.backend.command ?? ""));
|
|
399
|
+
const backendToken = normalizeLowercaseStringOrEmpty(params.backendId);
|
|
400
|
+
const sessionToken = params.cliSessionId?.trim();
|
|
401
|
+
if (!sessionToken) return;
|
|
402
|
+
return `cli:${backendToken}:${commandToken}:${sessionToken}`;
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/agents/cli-runner/helpers.ts
|
|
406
|
+
const CLI_RUN_QUEUE = new KeyedAsyncQueue();
|
|
407
|
+
function isClaudeCliProvider(providerId) {
|
|
408
|
+
return normalizeOptionalLowercaseString(providerId) === "claude-cli";
|
|
409
|
+
}
|
|
410
|
+
function enqueueCliRun(key, task) {
|
|
411
|
+
return CLI_RUN_QUEUE.enqueue(key, task);
|
|
412
|
+
}
|
|
413
|
+
function resolveCliRunQueueKey(params) {
|
|
414
|
+
if (params.serialize === false) return `${params.backendId}:${params.runId}`;
|
|
415
|
+
if (isClaudeCliProvider(params.backendId)) {
|
|
416
|
+
const sessionId = params.cliSessionId?.trim();
|
|
417
|
+
if (sessionId) return `${params.backendId}:session:${sessionId}`;
|
|
418
|
+
const workspaceDir = params.workspaceDir.trim();
|
|
419
|
+
if (workspaceDir) return `${params.backendId}:workspace:${workspaceDir}`;
|
|
420
|
+
}
|
|
421
|
+
return params.backendId;
|
|
422
|
+
}
|
|
423
|
+
function buildSystemPrompt(params) {
|
|
424
|
+
const defaultModelRef = resolveDefaultModelForAgent({
|
|
425
|
+
cfg: params.config ?? {},
|
|
426
|
+
agentId: params.agentId
|
|
427
|
+
});
|
|
428
|
+
const defaultModelLabel = `${defaultModelRef.provider}/${defaultModelRef.model}`;
|
|
429
|
+
const { runtimeInfo, userTimezone, userTime, userTimeFormat } = buildSystemPromptParams({
|
|
430
|
+
config: params.config,
|
|
431
|
+
agentId: params.agentId,
|
|
432
|
+
workspaceDir: params.workspaceDir,
|
|
433
|
+
cwd: process.cwd(),
|
|
434
|
+
runtime: {
|
|
435
|
+
host: "kaijibot",
|
|
436
|
+
os: `${os.type()} ${os.release()}`,
|
|
437
|
+
arch: os.arch(),
|
|
438
|
+
node: process.version,
|
|
439
|
+
model: params.modelDisplay,
|
|
440
|
+
defaultModel: defaultModelLabel,
|
|
441
|
+
shell: detectRuntimeShell()
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
const ttsHint = params.config ? buildTtsSystemPromptHint(params.config) : void 0;
|
|
445
|
+
const ownerDisplay = resolveOwnerDisplaySetting(params.config);
|
|
446
|
+
return buildAgentSystemPrompt({
|
|
447
|
+
workspaceDir: params.workspaceDir,
|
|
448
|
+
defaultThinkLevel: params.defaultThinkLevel,
|
|
449
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
450
|
+
ownerNumbers: params.ownerNumbers,
|
|
451
|
+
ownerDisplay: ownerDisplay.ownerDisplay,
|
|
452
|
+
ownerDisplaySecret: ownerDisplay.ownerDisplaySecret,
|
|
453
|
+
reasoningTagHint: false,
|
|
454
|
+
heartbeatPrompt: params.heartbeatPrompt,
|
|
455
|
+
docsPath: params.docsPath,
|
|
456
|
+
acpEnabled: params.config?.acp?.enabled !== false,
|
|
457
|
+
runtimeInfo,
|
|
458
|
+
toolNames: params.tools.map((tool) => tool.name),
|
|
459
|
+
modelAliasLines: buildModelAliasLines(params.config),
|
|
460
|
+
userTimezone,
|
|
461
|
+
userTime,
|
|
462
|
+
userTimeFormat,
|
|
463
|
+
contextFiles: params.contextFiles,
|
|
464
|
+
ttsHint,
|
|
465
|
+
memoryCitationsMode: params.config?.memory?.citations
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
function normalizeCliModel(modelId, backend) {
|
|
469
|
+
const trimmed = modelId.trim();
|
|
470
|
+
if (!trimmed) return trimmed;
|
|
471
|
+
const direct = backend.modelAliases?.[trimmed];
|
|
472
|
+
if (direct) return direct;
|
|
473
|
+
const lower = normalizeLowercaseStringOrEmpty(trimmed);
|
|
474
|
+
const mapped = backend.modelAliases?.[lower];
|
|
475
|
+
if (mapped) return mapped;
|
|
476
|
+
return trimmed;
|
|
477
|
+
}
|
|
478
|
+
function resolveSystemPromptUsage(params) {
|
|
479
|
+
const systemPrompt = params.systemPrompt?.trim();
|
|
480
|
+
if (!systemPrompt) return null;
|
|
481
|
+
const when = params.backend.systemPromptWhen ?? "first";
|
|
482
|
+
if (when === "never") return null;
|
|
483
|
+
if (when === "first" && !params.isNewSession) return null;
|
|
484
|
+
if (!params.backend.systemPromptArg?.trim() && !params.backend.systemPromptFileConfigKey?.trim()) return null;
|
|
485
|
+
return systemPrompt;
|
|
486
|
+
}
|
|
487
|
+
function resolveSessionIdToSend(params) {
|
|
488
|
+
const mode = params.backend.sessionMode ?? "always";
|
|
489
|
+
const existing = params.cliSessionId?.trim();
|
|
490
|
+
if (mode === "none") return {
|
|
491
|
+
sessionId: void 0,
|
|
492
|
+
isNew: !existing
|
|
493
|
+
};
|
|
494
|
+
if (mode === "existing") return {
|
|
495
|
+
sessionId: existing,
|
|
496
|
+
isNew: !existing
|
|
497
|
+
};
|
|
498
|
+
if (existing) return {
|
|
499
|
+
sessionId: existing,
|
|
500
|
+
isNew: false
|
|
501
|
+
};
|
|
502
|
+
return {
|
|
503
|
+
sessionId: crypto.randomUUID(),
|
|
504
|
+
isNew: true
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
function resolvePromptInput(params) {
|
|
508
|
+
if ((params.backend.input ?? "arg") === "stdin") return { stdin: params.prompt };
|
|
509
|
+
if (params.backend.maxPromptArgChars && params.prompt.length > params.backend.maxPromptArgChars) return { stdin: params.prompt };
|
|
510
|
+
return { argsPrompt: params.prompt };
|
|
511
|
+
}
|
|
512
|
+
function resolveCliImagePath(image) {
|
|
513
|
+
const ext = extensionForMime(image.mimeType) ?? ".bin";
|
|
514
|
+
const digest = crypto.createHash("sha256").update(image.mimeType).update("\0").update(image.data).digest("hex");
|
|
515
|
+
return path.join(resolvePreferredKaijiBotTmpDir(), "kaijibot-cli-images", `${digest}${ext}`);
|
|
516
|
+
}
|
|
517
|
+
function resolveCliImageRoot(params) {
|
|
518
|
+
if (params.backend.imagePathScope === "workspace") return path.join(params.workspaceDir, ".kaijibot-cli-images");
|
|
519
|
+
return path.join(resolvePreferredKaijiBotTmpDir(), "kaijibot-cli-images");
|
|
520
|
+
}
|
|
521
|
+
function appendImagePathsToPrompt(prompt, paths, prefix = "") {
|
|
522
|
+
if (!paths.length) return prompt;
|
|
523
|
+
const trimmed = prompt.trimEnd();
|
|
524
|
+
return `${trimmed}${trimmed ? "\n\n" : ""}${paths.map((entry) => `${prefix}${entry}`).join("\n")}`;
|
|
525
|
+
}
|
|
526
|
+
async function loadPromptRefImages(params) {
|
|
527
|
+
const refs = detectImageReferences(params.prompt);
|
|
528
|
+
if (refs.length === 0) return [];
|
|
529
|
+
const maxBytes = params.maxBytes ?? 6291456;
|
|
530
|
+
const seen = /* @__PURE__ */ new Set();
|
|
531
|
+
const images = [];
|
|
532
|
+
for (const ref of refs) {
|
|
533
|
+
const key = `${ref.type}:${ref.resolved}`;
|
|
534
|
+
if (seen.has(key)) continue;
|
|
535
|
+
seen.add(key);
|
|
536
|
+
const image = await loadImageFromRef(ref, params.workspaceDir, {
|
|
537
|
+
maxBytes,
|
|
538
|
+
workspaceOnly: params.workspaceOnly,
|
|
539
|
+
sandbox: params.sandbox
|
|
540
|
+
});
|
|
541
|
+
if (image) images.push(image);
|
|
542
|
+
}
|
|
543
|
+
const { images: sanitizedImages } = await sanitizeImageBlocks(images, "prompt:images", { maxBytes });
|
|
544
|
+
return sanitizedImages;
|
|
545
|
+
}
|
|
546
|
+
async function writeCliImages(params) {
|
|
547
|
+
const imageRoot = resolveCliImageRoot({
|
|
548
|
+
backend: params.backend,
|
|
549
|
+
workspaceDir: params.workspaceDir
|
|
550
|
+
});
|
|
551
|
+
await fs.mkdir(imageRoot, {
|
|
552
|
+
recursive: true,
|
|
553
|
+
mode: 448
|
|
554
|
+
});
|
|
555
|
+
const paths = [];
|
|
556
|
+
for (let i = 0; i < params.images.length; i += 1) {
|
|
557
|
+
const image = params.images[i];
|
|
558
|
+
const fileName = path.basename(resolveCliImagePath(image));
|
|
559
|
+
const filePath = path.join(imageRoot, fileName);
|
|
560
|
+
const buffer = Buffer.from(image.data, "base64");
|
|
561
|
+
await fs.writeFile(filePath, buffer, { mode: 384 });
|
|
562
|
+
paths.push(filePath);
|
|
563
|
+
}
|
|
564
|
+
const cleanup = async () => {};
|
|
565
|
+
return {
|
|
566
|
+
paths,
|
|
567
|
+
cleanup
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
async function writeCliSystemPromptFile(params) {
|
|
571
|
+
if (!params.backend.systemPromptFileConfigKey?.trim()) return { cleanup: async () => {} };
|
|
572
|
+
const tempDir = await fs.mkdtemp(path.join(resolvePreferredKaijiBotTmpDir(), "kaijibot-cli-system-prompt-"));
|
|
573
|
+
const filePath = path.join(tempDir, "system-prompt.md");
|
|
574
|
+
await fs.writeFile(filePath, stripSystemPromptCacheBoundary(params.systemPrompt), {
|
|
575
|
+
encoding: "utf-8",
|
|
576
|
+
mode: 384
|
|
577
|
+
});
|
|
578
|
+
return {
|
|
579
|
+
filePath,
|
|
580
|
+
cleanup: async () => {
|
|
581
|
+
await fs.rm(tempDir, {
|
|
582
|
+
recursive: true,
|
|
583
|
+
force: true
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
async function prepareCliPromptImagePayload(params) {
|
|
589
|
+
let prompt = params.prompt;
|
|
590
|
+
const resolvedImages = params.images && params.images.length > 0 ? params.images : await loadPromptRefImages({
|
|
591
|
+
prompt,
|
|
592
|
+
workspaceDir: params.workspaceDir
|
|
593
|
+
});
|
|
594
|
+
if (resolvedImages.length === 0) return { prompt };
|
|
595
|
+
const imagePayload = await writeCliImages({
|
|
596
|
+
backend: params.backend,
|
|
597
|
+
workspaceDir: params.workspaceDir,
|
|
598
|
+
images: resolvedImages
|
|
599
|
+
});
|
|
600
|
+
const imagePaths = imagePayload.paths;
|
|
601
|
+
if (!params.backend.imageArg || params.backend.input === "stdin" || params.backend.imageArg === "@") prompt = appendImagePathsToPrompt(prompt, imagePaths, params.backend.imageArg === "@" ? "@" : "");
|
|
602
|
+
return {
|
|
603
|
+
prompt,
|
|
604
|
+
imagePaths,
|
|
605
|
+
cleanupImages: imagePayload.cleanup
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
function buildCliArgs(params) {
|
|
609
|
+
const args = [...params.baseArgs];
|
|
610
|
+
if (params.backend.modelArg && params.modelId) args.push(params.backend.modelArg, params.modelId);
|
|
611
|
+
if (!params.useResume && params.systemPrompt && params.systemPromptFilePath && params.backend.systemPromptFileConfigKey) args.push(params.backend.systemPromptFileConfigArg ?? "-c", formatTomlConfigOverride(params.backend.systemPromptFileConfigKey, params.systemPromptFilePath));
|
|
612
|
+
else if (!params.useResume && params.systemPrompt && params.backend.systemPromptArg) args.push(params.backend.systemPromptArg, stripSystemPromptCacheBoundary(params.systemPrompt));
|
|
613
|
+
if (!params.useResume && params.sessionId) {
|
|
614
|
+
if (params.backend.sessionArgs && params.backend.sessionArgs.length > 0) for (const entry of params.backend.sessionArgs) args.push(entry.replaceAll("{sessionId}", params.sessionId));
|
|
615
|
+
else if (params.backend.sessionArg) args.push(params.backend.sessionArg, params.sessionId);
|
|
616
|
+
}
|
|
617
|
+
if (params.imagePaths && params.imagePaths.length > 0) {
|
|
618
|
+
const mode = params.backend.imageMode ?? "repeat";
|
|
619
|
+
const imageArg = params.backend.imageArg;
|
|
620
|
+
if (imageArg && imageArg !== "@") if (mode === "list") args.push(imageArg, params.imagePaths.join(","));
|
|
621
|
+
else for (const imagePath of params.imagePaths) args.push(imageArg, imagePath);
|
|
622
|
+
}
|
|
623
|
+
if (params.promptArg !== void 0) {
|
|
624
|
+
let replacedPromptPlaceholder = false;
|
|
625
|
+
for (let i = 0; i < args.length; i += 1) if (args[i] === "{prompt}") {
|
|
626
|
+
args[i] = params.promptArg;
|
|
627
|
+
replacedPromptPlaceholder = true;
|
|
628
|
+
}
|
|
629
|
+
if (replacedPromptPlaceholder) return args;
|
|
630
|
+
args.push(params.promptArg);
|
|
631
|
+
}
|
|
632
|
+
return args;
|
|
633
|
+
}
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/agents/cli-runner/log.ts
|
|
636
|
+
const cliBackendLog = createSubsystemLogger("agent/cli-backend");
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/agents/cli-runner/execute.ts
|
|
639
|
+
const executeDeps = {
|
|
640
|
+
getProcessSupervisor,
|
|
641
|
+
enqueueSystemEvent,
|
|
642
|
+
requestHeartbeatNow
|
|
643
|
+
};
|
|
644
|
+
function createCliAbortError() {
|
|
645
|
+
const error = /* @__PURE__ */ new Error("CLI run aborted");
|
|
646
|
+
error.name = "AbortError";
|
|
647
|
+
return error;
|
|
648
|
+
}
|
|
649
|
+
function buildCliLogArgs(params) {
|
|
650
|
+
const logArgs = [];
|
|
651
|
+
for (let i = 0; i < params.args.length; i += 1) {
|
|
652
|
+
const arg = params.args[i] ?? "";
|
|
653
|
+
if (arg === params.systemPromptArg) {
|
|
654
|
+
const systemPromptValue = params.args[i + 1] ?? "";
|
|
655
|
+
logArgs.push(arg, `<systemPrompt:${systemPromptValue.length} chars>`);
|
|
656
|
+
i += 1;
|
|
657
|
+
continue;
|
|
658
|
+
}
|
|
659
|
+
if (arg === params.sessionArg) {
|
|
660
|
+
logArgs.push(arg, params.args[i + 1] ?? "");
|
|
661
|
+
i += 1;
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
if (arg === params.modelArg) {
|
|
665
|
+
logArgs.push(arg, params.args[i + 1] ?? "");
|
|
666
|
+
i += 1;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (arg === params.imageArg) {
|
|
670
|
+
logArgs.push(arg, "<image>");
|
|
671
|
+
i += 1;
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
logArgs.push(arg);
|
|
675
|
+
}
|
|
676
|
+
if (params.argsPrompt) {
|
|
677
|
+
const promptIndex = logArgs.indexOf(params.argsPrompt);
|
|
678
|
+
if (promptIndex >= 0) logArgs[promptIndex] = `<prompt:${params.argsPrompt.length} chars>`;
|
|
679
|
+
}
|
|
680
|
+
return logArgs;
|
|
681
|
+
}
|
|
682
|
+
async function executePreparedCliRun(context, cliSessionIdToUse) {
|
|
683
|
+
const params = context.params;
|
|
684
|
+
if (params.abortSignal?.aborted) throw createCliAbortError();
|
|
685
|
+
const backend = context.preparedBackend.backend;
|
|
686
|
+
const { sessionId: resolvedSessionId, isNew } = resolveSessionIdToSend({
|
|
687
|
+
backend,
|
|
688
|
+
cliSessionId: cliSessionIdToUse
|
|
689
|
+
});
|
|
690
|
+
const useResume = Boolean(cliSessionIdToUse && resolvedSessionId && backend.resumeArgs && backend.resumeArgs.length > 0);
|
|
691
|
+
const systemPromptArg = resolveSystemPromptUsage({
|
|
692
|
+
backend,
|
|
693
|
+
isNewSession: isNew,
|
|
694
|
+
systemPrompt: context.systemPrompt
|
|
695
|
+
});
|
|
696
|
+
const systemPromptFile = !useResume && systemPromptArg ? await writeCliSystemPromptFile({
|
|
697
|
+
backend,
|
|
698
|
+
systemPrompt: systemPromptArg
|
|
699
|
+
}) : void 0;
|
|
700
|
+
let prompt = prependBootstrapPromptWarning(params.prompt, context.bootstrapPromptWarningLines, { preserveExactPrompt: context.heartbeatPrompt });
|
|
701
|
+
const { prompt: promptWithImages, imagePaths, cleanupImages } = await prepareCliPromptImagePayload({
|
|
702
|
+
backend,
|
|
703
|
+
prompt,
|
|
704
|
+
workspaceDir: context.workspaceDir,
|
|
705
|
+
images: params.images
|
|
706
|
+
});
|
|
707
|
+
prompt = promptWithImages;
|
|
708
|
+
const { argsPrompt, stdin } = resolvePromptInput({
|
|
709
|
+
backend,
|
|
710
|
+
prompt
|
|
711
|
+
});
|
|
712
|
+
const stdinPayload = stdin ?? "";
|
|
713
|
+
const baseArgs = useResume ? backend.resumeArgs ?? backend.args ?? [] : backend.args ?? [];
|
|
714
|
+
const args = buildCliArgs({
|
|
715
|
+
backend,
|
|
716
|
+
baseArgs: useResume ? baseArgs.map((entry) => entry.replaceAll("{sessionId}", resolvedSessionId ?? "")) : baseArgs,
|
|
717
|
+
modelId: context.normalizedModel,
|
|
718
|
+
sessionId: resolvedSessionId,
|
|
719
|
+
systemPrompt: systemPromptArg,
|
|
720
|
+
systemPromptFilePath: systemPromptFile?.filePath,
|
|
721
|
+
imagePaths,
|
|
722
|
+
promptArg: argsPrompt,
|
|
723
|
+
useResume
|
|
724
|
+
});
|
|
725
|
+
const queueKey = resolveCliRunQueueKey({
|
|
726
|
+
backendId: context.backendResolved.id,
|
|
727
|
+
serialize: backend.serialize,
|
|
728
|
+
runId: params.runId,
|
|
729
|
+
workspaceDir: context.workspaceDir,
|
|
730
|
+
cliSessionId: useResume ? resolvedSessionId : void 0
|
|
731
|
+
});
|
|
732
|
+
try {
|
|
733
|
+
return await enqueueCliRun(queueKey, async () => {
|
|
734
|
+
cliBackendLog.info(`cli exec: provider=${params.provider} model=${context.normalizedModel} promptChars=${params.prompt.length}`);
|
|
735
|
+
const logOutputText = isTruthyEnvValue(process.env["KAIJIBOT_CLI_BACKEND_LOG_OUTPUT"]) || isTruthyEnvValue(process.env["KAIJIBOT_CLAUDE_CLI_LOG_OUTPUT"]);
|
|
736
|
+
if (logOutputText) {
|
|
737
|
+
const logArgs = buildCliLogArgs({
|
|
738
|
+
args,
|
|
739
|
+
systemPromptArg: backend.systemPromptArg,
|
|
740
|
+
sessionArg: backend.sessionArg,
|
|
741
|
+
modelArg: backend.modelArg,
|
|
742
|
+
imageArg: backend.imageArg,
|
|
743
|
+
argsPrompt
|
|
744
|
+
});
|
|
745
|
+
cliBackendLog.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
746
|
+
}
|
|
747
|
+
const env = (() => {
|
|
748
|
+
const next = sanitizeHostExecEnv({
|
|
749
|
+
baseEnv: process.env,
|
|
750
|
+
blockPathOverrides: true
|
|
751
|
+
});
|
|
752
|
+
for (const key of backend.clearEnv ?? []) delete next[key];
|
|
753
|
+
if (backend.env && Object.keys(backend.env).length > 0) Object.assign(next, sanitizeHostExecEnv({
|
|
754
|
+
baseEnv: {},
|
|
755
|
+
overrides: backend.env,
|
|
756
|
+
blockPathOverrides: true
|
|
757
|
+
}));
|
|
758
|
+
Object.assign(next, context.preparedBackend.env);
|
|
759
|
+
return next;
|
|
760
|
+
})();
|
|
761
|
+
const noOutputTimeoutMs = resolveCliNoOutputTimeoutMs({
|
|
762
|
+
backend,
|
|
763
|
+
timeoutMs: params.timeoutMs,
|
|
764
|
+
useResume
|
|
765
|
+
});
|
|
766
|
+
const streamingParser = backend.output === "jsonl" ? createCliJsonlStreamingParser({
|
|
767
|
+
backend,
|
|
768
|
+
providerId: context.backendResolved.id,
|
|
769
|
+
onAssistantDelta: ({ text, delta }) => {
|
|
770
|
+
emitAgentEvent({
|
|
771
|
+
runId: params.runId,
|
|
772
|
+
stream: "assistant",
|
|
773
|
+
data: {
|
|
774
|
+
text,
|
|
775
|
+
delta
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
}) : null;
|
|
780
|
+
const supervisor = executeDeps.getProcessSupervisor();
|
|
781
|
+
const scopeKey = buildCliSupervisorScopeKey({
|
|
782
|
+
backend,
|
|
783
|
+
backendId: context.backendResolved.id,
|
|
784
|
+
cliSessionId: useResume ? resolvedSessionId : void 0
|
|
785
|
+
});
|
|
786
|
+
const managedRun = await supervisor.spawn({
|
|
787
|
+
sessionId: params.sessionId,
|
|
788
|
+
backendId: context.backendResolved.id,
|
|
789
|
+
scopeKey,
|
|
790
|
+
replaceExistingScope: Boolean(useResume && scopeKey),
|
|
791
|
+
mode: "child",
|
|
792
|
+
argv: [backend.command, ...args],
|
|
793
|
+
timeoutMs: params.timeoutMs,
|
|
794
|
+
noOutputTimeoutMs,
|
|
795
|
+
cwd: context.workspaceDir,
|
|
796
|
+
env,
|
|
797
|
+
input: stdinPayload,
|
|
798
|
+
onStdout: streamingParser ? (chunk) => streamingParser.push(chunk) : void 0
|
|
799
|
+
});
|
|
800
|
+
const replyBackendHandle = params.replyOperation ? {
|
|
801
|
+
kind: "cli",
|
|
802
|
+
cancel: () => {
|
|
803
|
+
managedRun.cancel("manual-cancel");
|
|
804
|
+
},
|
|
805
|
+
isStreaming: () => false
|
|
806
|
+
} : void 0;
|
|
807
|
+
if (replyBackendHandle) params.replyOperation?.attachBackend(replyBackendHandle);
|
|
808
|
+
const abortManagedRun = () => {
|
|
809
|
+
managedRun.cancel("manual-cancel");
|
|
810
|
+
};
|
|
811
|
+
params.abortSignal?.addEventListener("abort", abortManagedRun, { once: true });
|
|
812
|
+
if (params.abortSignal?.aborted) abortManagedRun();
|
|
813
|
+
let result;
|
|
814
|
+
try {
|
|
815
|
+
result = await managedRun.wait();
|
|
816
|
+
} finally {
|
|
817
|
+
if (replyBackendHandle) params.replyOperation?.detachBackend(replyBackendHandle);
|
|
818
|
+
params.abortSignal?.removeEventListener("abort", abortManagedRun);
|
|
819
|
+
}
|
|
820
|
+
streamingParser?.finish();
|
|
821
|
+
if (params.abortSignal?.aborted && result.reason === "manual-cancel") throw createCliAbortError();
|
|
822
|
+
const stdout = result.stdout.trim();
|
|
823
|
+
const stderr = result.stderr.trim();
|
|
824
|
+
if (logOutputText) {
|
|
825
|
+
if (stdout) cliBackendLog.info(`cli stdout:\n${stdout}`);
|
|
826
|
+
if (stderr) cliBackendLog.info(`cli stderr:\n${stderr}`);
|
|
827
|
+
}
|
|
828
|
+
if (shouldLogVerbose()) {
|
|
829
|
+
if (stdout) cliBackendLog.debug(`cli stdout:\n${stdout}`);
|
|
830
|
+
if (stderr) cliBackendLog.debug(`cli stderr:\n${stderr}`);
|
|
831
|
+
}
|
|
832
|
+
if (result.exitCode !== 0 || result.reason !== "exit") {
|
|
833
|
+
if (result.reason === "no-output-timeout" || result.noOutputTimedOut) {
|
|
834
|
+
const timeoutReason = `CLI produced no output for ${Math.round(noOutputTimeoutMs / 1e3)}s and was terminated.`;
|
|
835
|
+
cliBackendLog.warn(`cli watchdog timeout: provider=${params.provider} model=${context.modelId} session=${resolvedSessionId ?? params.sessionId} noOutputTimeoutMs=${noOutputTimeoutMs} pid=${managedRun.pid ?? "unknown"}`);
|
|
836
|
+
if (params.sessionKey) {
|
|
837
|
+
const stallNotice = [
|
|
838
|
+
`CLI agent (${params.provider}) produced no output for ${Math.round(noOutputTimeoutMs / 1e3)}s and was terminated.`,
|
|
839
|
+
"It may have been waiting for interactive input or an approval prompt.",
|
|
840
|
+
"For Claude Code, prefer --permission-mode bypassPermissions --print."
|
|
841
|
+
].join(" ");
|
|
842
|
+
executeDeps.enqueueSystemEvent(stallNotice, { sessionKey: params.sessionKey });
|
|
843
|
+
executeDeps.requestHeartbeatNow(scopedHeartbeatWakeOptions(params.sessionKey, { reason: "cli:watchdog:stall" }));
|
|
844
|
+
}
|
|
845
|
+
throw new FailoverError(timeoutReason, {
|
|
846
|
+
reason: "timeout",
|
|
847
|
+
provider: params.provider,
|
|
848
|
+
model: context.modelId,
|
|
849
|
+
status: resolveFailoverStatus("timeout")
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
if (result.reason === "overall-timeout") throw new FailoverError(`CLI exceeded timeout (${Math.round(params.timeoutMs / 1e3)}s) and was terminated.`, {
|
|
853
|
+
reason: "timeout",
|
|
854
|
+
provider: params.provider,
|
|
855
|
+
model: context.modelId,
|
|
856
|
+
status: resolveFailoverStatus("timeout")
|
|
857
|
+
});
|
|
858
|
+
const primaryErrorText = stderr || stdout;
|
|
859
|
+
const err = (extractCliErrorMessage(primaryErrorText) ?? (stderr ? extractCliErrorMessage(stdout) : null)) || primaryErrorText || "CLI failed.";
|
|
860
|
+
const reason = classifyFailoverReason(err, { provider: params.provider }) ?? "unknown";
|
|
861
|
+
const status = resolveFailoverStatus(reason);
|
|
862
|
+
throw new FailoverError(err, {
|
|
863
|
+
reason,
|
|
864
|
+
provider: params.provider,
|
|
865
|
+
model: context.modelId,
|
|
866
|
+
status
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return parseCliOutput({
|
|
870
|
+
raw: stdout,
|
|
871
|
+
backend,
|
|
872
|
+
providerId: context.backendResolved.id,
|
|
873
|
+
outputMode: useResume ? backend.resumeOutput ?? backend.output : backend.output,
|
|
874
|
+
fallbackSessionId: resolvedSessionId
|
|
875
|
+
});
|
|
876
|
+
});
|
|
877
|
+
} finally {
|
|
878
|
+
if (systemPromptFile) await systemPromptFile.cleanup();
|
|
879
|
+
if (cleanupImages) await cleanupImages();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/gateway/mcp-http.loopback-runtime.ts
|
|
884
|
+
let activeRuntime;
|
|
885
|
+
function getActiveMcpLoopbackRuntime() {
|
|
886
|
+
return activeRuntime ? { ...activeRuntime } : void 0;
|
|
887
|
+
}
|
|
888
|
+
function setActiveMcpLoopbackRuntime(runtime) {
|
|
889
|
+
activeRuntime = { ...runtime };
|
|
890
|
+
}
|
|
891
|
+
function clearActiveMcpLoopbackRuntime(token) {
|
|
892
|
+
if (activeRuntime?.token === token) activeRuntime = void 0;
|
|
893
|
+
}
|
|
894
|
+
function createMcpLoopbackServerConfig(port) {
|
|
895
|
+
return { mcpServers: { kaijibot: {
|
|
896
|
+
type: "http",
|
|
897
|
+
url: `http://127.0.0.1:${port}/mcp`,
|
|
898
|
+
headers: {
|
|
899
|
+
Authorization: "Bearer ${KAIJIBOT_MCP_TOKEN}",
|
|
900
|
+
"x-session-key": "${KAIJIBOT_MCP_SESSION_KEY}",
|
|
901
|
+
"x-kaijibot-agent-id": "${KAIJIBOT_MCP_AGENT_ID}",
|
|
902
|
+
"x-kaijibot-account-id": "${KAIJIBOT_MCP_ACCOUNT_ID}",
|
|
903
|
+
"x-kaijibot-message-channel": "${KAIJIBOT_MCP_MESSAGE_CHANNEL}"
|
|
904
|
+
}
|
|
905
|
+
} } };
|
|
906
|
+
}
|
|
907
|
+
const cliAuthEpochDeps = {
|
|
908
|
+
readClaudeCliCredentialsCached,
|
|
909
|
+
readCodexCliCredentialsCached,
|
|
910
|
+
loadAuthProfileStoreForRuntime
|
|
911
|
+
};
|
|
912
|
+
function hashCliAuthEpochPart(value) {
|
|
913
|
+
return crypto.createHash("sha256").update(value).digest("hex");
|
|
914
|
+
}
|
|
915
|
+
function encodeUnknown(value) {
|
|
916
|
+
return JSON.stringify(value ?? null);
|
|
917
|
+
}
|
|
918
|
+
function encodeClaudeCredential(credential) {
|
|
919
|
+
if (credential.type === "oauth") return JSON.stringify([
|
|
920
|
+
"oauth",
|
|
921
|
+
credential.provider,
|
|
922
|
+
credential.access,
|
|
923
|
+
credential.refresh,
|
|
924
|
+
credential.expires
|
|
925
|
+
]);
|
|
926
|
+
return JSON.stringify([
|
|
927
|
+
"token",
|
|
928
|
+
credential.provider,
|
|
929
|
+
credential.token,
|
|
930
|
+
credential.expires
|
|
931
|
+
]);
|
|
932
|
+
}
|
|
933
|
+
function encodeCodexCredential(credential) {
|
|
934
|
+
return JSON.stringify([
|
|
935
|
+
credential.type,
|
|
936
|
+
credential.provider,
|
|
937
|
+
credential.access,
|
|
938
|
+
credential.refresh,
|
|
939
|
+
credential.expires,
|
|
940
|
+
credential.accountId ?? null
|
|
941
|
+
]);
|
|
942
|
+
}
|
|
943
|
+
function encodeAuthProfileCredential(credential) {
|
|
944
|
+
switch (credential.type) {
|
|
945
|
+
case "api_key": return JSON.stringify([
|
|
946
|
+
"api_key",
|
|
947
|
+
credential.provider,
|
|
948
|
+
credential.key ?? null,
|
|
949
|
+
encodeUnknown(credential.keyRef),
|
|
950
|
+
credential.email ?? null,
|
|
951
|
+
credential.displayName ?? null,
|
|
952
|
+
encodeUnknown(credential.metadata)
|
|
953
|
+
]);
|
|
954
|
+
case "token": return JSON.stringify([
|
|
955
|
+
"token",
|
|
956
|
+
credential.provider,
|
|
957
|
+
credential.token ?? null,
|
|
958
|
+
encodeUnknown(credential.tokenRef),
|
|
959
|
+
credential.expires ?? null,
|
|
960
|
+
credential.email ?? null,
|
|
961
|
+
credential.displayName ?? null
|
|
962
|
+
]);
|
|
963
|
+
case "oauth": return JSON.stringify([
|
|
964
|
+
"oauth",
|
|
965
|
+
credential.provider,
|
|
966
|
+
credential.access,
|
|
967
|
+
credential.refresh,
|
|
968
|
+
credential.expires,
|
|
969
|
+
credential.clientId ?? null,
|
|
970
|
+
credential.email ?? null,
|
|
971
|
+
credential.displayName ?? null,
|
|
972
|
+
credential.enterpriseUrl ?? null,
|
|
973
|
+
credential.projectId ?? null,
|
|
974
|
+
credential.accountId ?? null,
|
|
975
|
+
credential.managedBy ?? null
|
|
976
|
+
]);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
function getLocalCliCredentialFingerprint(provider) {
|
|
980
|
+
switch (provider) {
|
|
981
|
+
case "claude-cli": {
|
|
982
|
+
const credential = cliAuthEpochDeps.readClaudeCliCredentialsCached({
|
|
983
|
+
ttlMs: 5e3,
|
|
984
|
+
allowKeychainPrompt: false
|
|
985
|
+
});
|
|
986
|
+
return credential ? hashCliAuthEpochPart(encodeClaudeCredential(credential)) : void 0;
|
|
987
|
+
}
|
|
988
|
+
case "codex-cli": {
|
|
989
|
+
const credential = cliAuthEpochDeps.readCodexCliCredentialsCached({ ttlMs: 5e3 });
|
|
990
|
+
return credential ? hashCliAuthEpochPart(encodeCodexCredential(credential)) : void 0;
|
|
991
|
+
}
|
|
992
|
+
default: return;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
function getAuthProfileCredential(store, authProfileId) {
|
|
996
|
+
if (!authProfileId) return;
|
|
997
|
+
return store.profiles[authProfileId];
|
|
998
|
+
}
|
|
999
|
+
async function resolveCliAuthEpoch(params) {
|
|
1000
|
+
const provider = params.provider.trim();
|
|
1001
|
+
const authProfileId = normalizeOptionalString(params.authProfileId);
|
|
1002
|
+
const parts = [];
|
|
1003
|
+
const localFingerprint = getLocalCliCredentialFingerprint(provider);
|
|
1004
|
+
if (localFingerprint) parts.push(`local:${provider}:${localFingerprint}`);
|
|
1005
|
+
if (authProfileId) {
|
|
1006
|
+
const credential = getAuthProfileCredential(cliAuthEpochDeps.loadAuthProfileStoreForRuntime(void 0, {
|
|
1007
|
+
readOnly: true,
|
|
1008
|
+
allowKeychainPrompt: false
|
|
1009
|
+
}), authProfileId);
|
|
1010
|
+
if (credential) parts.push(`profile:${authProfileId}:${hashCliAuthEpochPart(encodeAuthProfileCredential(credential))}`);
|
|
1011
|
+
}
|
|
1012
|
+
if (parts.length === 0) return;
|
|
1013
|
+
return hashCliAuthEpochPart(parts.join("\n"));
|
|
1014
|
+
}
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/agents/cli-backends.ts
|
|
1017
|
+
const FALLBACK_CLI_BACKEND_POLICIES = {};
|
|
1018
|
+
function normalizeBundleMcpMode(mode, enabled) {
|
|
1019
|
+
if (!enabled) return;
|
|
1020
|
+
return mode ?? "claude-config-file";
|
|
1021
|
+
}
|
|
1022
|
+
function resolveSetupCliBackendPolicy(provider) {
|
|
1023
|
+
const entry = resolvePluginSetupCliBackend({ backend: provider });
|
|
1024
|
+
if (!entry) return;
|
|
1025
|
+
return {
|
|
1026
|
+
bundleMcp: entry.backend.bundleMcp === true,
|
|
1027
|
+
bundleMcpMode: normalizeBundleMcpMode(entry.backend.bundleMcpMode, entry.backend.bundleMcp === true),
|
|
1028
|
+
baseConfig: entry.backend.config,
|
|
1029
|
+
normalizeConfig: entry.backend.normalizeConfig
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
function resolveFallbackCliBackendPolicy(provider) {
|
|
1033
|
+
return FALLBACK_CLI_BACKEND_POLICIES[provider] ?? resolveSetupCliBackendPolicy(provider);
|
|
1034
|
+
}
|
|
1035
|
+
function normalizeBackendKey(key) {
|
|
1036
|
+
return normalizeProviderId(key);
|
|
1037
|
+
}
|
|
1038
|
+
function pickBackendConfig(config, normalizedId) {
|
|
1039
|
+
const directKey = Object.keys(config).find((key) => normalizeOptionalLowercaseString(key) === normalizedId);
|
|
1040
|
+
if (directKey) return config[directKey];
|
|
1041
|
+
for (const [key, entry] of Object.entries(config)) if (normalizeBackendKey(key) === normalizedId) return entry;
|
|
1042
|
+
}
|
|
1043
|
+
function resolveRegisteredBackend(provider) {
|
|
1044
|
+
const normalized = normalizeBackendKey(provider);
|
|
1045
|
+
return resolveRuntimeCliBackends().find((entry) => normalizeBackendKey(entry.id) === normalized);
|
|
1046
|
+
}
|
|
1047
|
+
function mergeBackendConfig(base, override) {
|
|
1048
|
+
if (!override) return { ...base };
|
|
1049
|
+
const baseFresh = base.reliability?.watchdog?.fresh ?? {};
|
|
1050
|
+
const baseResume = base.reliability?.watchdog?.resume ?? {};
|
|
1051
|
+
const overrideFresh = override.reliability?.watchdog?.fresh ?? {};
|
|
1052
|
+
const overrideResume = override.reliability?.watchdog?.resume ?? {};
|
|
1053
|
+
return {
|
|
1054
|
+
...base,
|
|
1055
|
+
...override,
|
|
1056
|
+
args: override.args ?? base.args,
|
|
1057
|
+
env: {
|
|
1058
|
+
...base.env,
|
|
1059
|
+
...override.env
|
|
1060
|
+
},
|
|
1061
|
+
modelAliases: {
|
|
1062
|
+
...base.modelAliases,
|
|
1063
|
+
...override.modelAliases
|
|
1064
|
+
},
|
|
1065
|
+
clearEnv: Array.from(new Set([...base.clearEnv ?? [], ...override.clearEnv ?? []])),
|
|
1066
|
+
sessionIdFields: override.sessionIdFields ?? base.sessionIdFields,
|
|
1067
|
+
sessionArgs: override.sessionArgs ?? base.sessionArgs,
|
|
1068
|
+
resumeArgs: override.resumeArgs ?? base.resumeArgs,
|
|
1069
|
+
reliability: {
|
|
1070
|
+
...base.reliability,
|
|
1071
|
+
...override.reliability,
|
|
1072
|
+
watchdog: {
|
|
1073
|
+
...base.reliability?.watchdog,
|
|
1074
|
+
...override.reliability?.watchdog,
|
|
1075
|
+
fresh: {
|
|
1076
|
+
...baseFresh,
|
|
1077
|
+
...overrideFresh
|
|
1078
|
+
},
|
|
1079
|
+
resume: {
|
|
1080
|
+
...baseResume,
|
|
1081
|
+
...overrideResume
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function resolveCliBackendConfig(provider, cfg) {
|
|
1088
|
+
const normalized = normalizeBackendKey(provider);
|
|
1089
|
+
const override = pickBackendConfig(cfg?.agents?.defaults?.cliBackends ?? {}, normalized);
|
|
1090
|
+
const registered = resolveRegisteredBackend(normalized);
|
|
1091
|
+
if (registered) {
|
|
1092
|
+
const merged = mergeBackendConfig(registered.config, override);
|
|
1093
|
+
const config = registered.normalizeConfig ? registered.normalizeConfig(merged) : merged;
|
|
1094
|
+
const command = config.command?.trim();
|
|
1095
|
+
if (!command) return null;
|
|
1096
|
+
return {
|
|
1097
|
+
id: normalized,
|
|
1098
|
+
config: {
|
|
1099
|
+
...config,
|
|
1100
|
+
command
|
|
1101
|
+
},
|
|
1102
|
+
bundleMcp: registered.bundleMcp === true,
|
|
1103
|
+
bundleMcpMode: normalizeBundleMcpMode(registered.bundleMcpMode, registered.bundleMcp === true),
|
|
1104
|
+
pluginId: registered.pluginId
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
const fallbackPolicy = resolveFallbackCliBackendPolicy(normalized);
|
|
1108
|
+
if (!override) {
|
|
1109
|
+
if (!fallbackPolicy?.baseConfig) return null;
|
|
1110
|
+
const baseConfig = fallbackPolicy.normalizeConfig ? fallbackPolicy.normalizeConfig(fallbackPolicy.baseConfig) : fallbackPolicy.baseConfig;
|
|
1111
|
+
const command = baseConfig.command?.trim();
|
|
1112
|
+
if (!command) return null;
|
|
1113
|
+
return {
|
|
1114
|
+
id: normalized,
|
|
1115
|
+
config: {
|
|
1116
|
+
...baseConfig,
|
|
1117
|
+
command
|
|
1118
|
+
},
|
|
1119
|
+
bundleMcp: fallbackPolicy.bundleMcp,
|
|
1120
|
+
bundleMcpMode: fallbackPolicy.bundleMcpMode
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
const mergedFallback = fallbackPolicy?.baseConfig ? mergeBackendConfig(fallbackPolicy.baseConfig, override) : override;
|
|
1124
|
+
const config = fallbackPolicy?.normalizeConfig ? fallbackPolicy.normalizeConfig(mergedFallback) : mergedFallback;
|
|
1125
|
+
const command = config.command?.trim();
|
|
1126
|
+
if (!command) return null;
|
|
1127
|
+
return {
|
|
1128
|
+
id: normalized,
|
|
1129
|
+
config: {
|
|
1130
|
+
...config,
|
|
1131
|
+
command
|
|
1132
|
+
},
|
|
1133
|
+
bundleMcp: fallbackPolicy?.bundleMcp === true,
|
|
1134
|
+
bundleMcpMode: fallbackPolicy?.bundleMcpMode
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
//#endregion
|
|
1138
|
+
//#region src/agents/cli-session.ts
|
|
1139
|
+
const CLAUDE_CLI_BACKEND_ID = "claude-cli";
|
|
1140
|
+
function hashCliSessionText(value) {
|
|
1141
|
+
const trimmed = normalizeOptionalString(value);
|
|
1142
|
+
if (!trimmed) return;
|
|
1143
|
+
return crypto.createHash("sha256").update(trimmed).digest("hex");
|
|
1144
|
+
}
|
|
1145
|
+
function getCliSessionBinding(entry, provider) {
|
|
1146
|
+
if (!entry) return;
|
|
1147
|
+
const normalized = normalizeProviderId(provider);
|
|
1148
|
+
const fromBindings = entry.cliSessionBindings?.[normalized];
|
|
1149
|
+
const bindingSessionId = normalizeOptionalString(fromBindings?.sessionId);
|
|
1150
|
+
if (bindingSessionId) return {
|
|
1151
|
+
sessionId: bindingSessionId,
|
|
1152
|
+
authProfileId: normalizeOptionalString(fromBindings?.authProfileId),
|
|
1153
|
+
authEpoch: normalizeOptionalString(fromBindings?.authEpoch),
|
|
1154
|
+
extraSystemPromptHash: normalizeOptionalString(fromBindings?.extraSystemPromptHash),
|
|
1155
|
+
mcpConfigHash: normalizeOptionalString(fromBindings?.mcpConfigHash)
|
|
1156
|
+
};
|
|
1157
|
+
const fromMap = entry.cliSessionIds?.[normalized];
|
|
1158
|
+
const normalizedFromMap = normalizeOptionalString(fromMap);
|
|
1159
|
+
if (normalizedFromMap) return { sessionId: normalizedFromMap };
|
|
1160
|
+
if (normalized === CLAUDE_CLI_BACKEND_ID) {
|
|
1161
|
+
const legacy = normalizeOptionalString(entry.claudeCliSessionId);
|
|
1162
|
+
if (legacy) return { sessionId: legacy };
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
function getCliSessionId(entry, provider) {
|
|
1166
|
+
return getCliSessionBinding(entry, provider)?.sessionId;
|
|
1167
|
+
}
|
|
1168
|
+
function setCliSessionId(entry, provider, sessionId) {
|
|
1169
|
+
setCliSessionBinding(entry, provider, { sessionId });
|
|
1170
|
+
}
|
|
1171
|
+
function setCliSessionBinding(entry, provider, binding) {
|
|
1172
|
+
const normalized = normalizeProviderId(provider);
|
|
1173
|
+
const trimmed = binding.sessionId.trim();
|
|
1174
|
+
if (!trimmed) return;
|
|
1175
|
+
entry.cliSessionBindings = {
|
|
1176
|
+
...entry.cliSessionBindings,
|
|
1177
|
+
[normalized]: {
|
|
1178
|
+
sessionId: trimmed,
|
|
1179
|
+
...normalizeOptionalString(binding.authProfileId) ? { authProfileId: normalizeOptionalString(binding.authProfileId) } : {},
|
|
1180
|
+
...normalizeOptionalString(binding.authEpoch) ? { authEpoch: normalizeOptionalString(binding.authEpoch) } : {},
|
|
1181
|
+
...normalizeOptionalString(binding.extraSystemPromptHash) ? { extraSystemPromptHash: normalizeOptionalString(binding.extraSystemPromptHash) } : {},
|
|
1182
|
+
...normalizeOptionalString(binding.mcpConfigHash) ? { mcpConfigHash: normalizeOptionalString(binding.mcpConfigHash) } : {}
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
entry.cliSessionIds = {
|
|
1186
|
+
...entry.cliSessionIds,
|
|
1187
|
+
[normalized]: trimmed
|
|
1188
|
+
};
|
|
1189
|
+
if (normalized === CLAUDE_CLI_BACKEND_ID) entry.claudeCliSessionId = trimmed;
|
|
1190
|
+
}
|
|
1191
|
+
function clearCliSession(entry, provider) {
|
|
1192
|
+
const normalized = normalizeProviderId(provider);
|
|
1193
|
+
if (entry.cliSessionBindings?.[normalized] !== void 0) {
|
|
1194
|
+
const next = { ...entry.cliSessionBindings };
|
|
1195
|
+
delete next[normalized];
|
|
1196
|
+
entry.cliSessionBindings = Object.keys(next).length > 0 ? next : void 0;
|
|
1197
|
+
}
|
|
1198
|
+
if (entry.cliSessionIds?.[normalized] !== void 0) {
|
|
1199
|
+
const next = { ...entry.cliSessionIds };
|
|
1200
|
+
delete next[normalized];
|
|
1201
|
+
entry.cliSessionIds = Object.keys(next).length > 0 ? next : void 0;
|
|
1202
|
+
}
|
|
1203
|
+
if (normalized === CLAUDE_CLI_BACKEND_ID) delete entry.claudeCliSessionId;
|
|
1204
|
+
}
|
|
1205
|
+
function resolveCliSessionReuse(params) {
|
|
1206
|
+
const binding = params.binding;
|
|
1207
|
+
const sessionId = normalizeOptionalString(binding?.sessionId);
|
|
1208
|
+
if (!sessionId) return {};
|
|
1209
|
+
const currentAuthProfileId = normalizeOptionalString(params.authProfileId);
|
|
1210
|
+
const currentAuthEpoch = normalizeOptionalString(params.authEpoch);
|
|
1211
|
+
const currentExtraSystemPromptHash = normalizeOptionalString(params.extraSystemPromptHash);
|
|
1212
|
+
const currentMcpConfigHash = normalizeOptionalString(params.mcpConfigHash);
|
|
1213
|
+
if (normalizeOptionalString(binding?.authProfileId) !== currentAuthProfileId) return { invalidatedReason: "auth-profile" };
|
|
1214
|
+
if (normalizeOptionalString(binding?.authEpoch) !== currentAuthEpoch) return { invalidatedReason: "auth-epoch" };
|
|
1215
|
+
if (normalizeOptionalString(binding?.extraSystemPromptHash) !== currentExtraSystemPromptHash) return { invalidatedReason: "system-prompt" };
|
|
1216
|
+
if (normalizeOptionalString(binding?.mcpConfigHash) !== currentMcpConfigHash) return { invalidatedReason: "mcp" };
|
|
1217
|
+
return { sessionId };
|
|
1218
|
+
}
|
|
1219
|
+
//#endregion
|
|
1220
|
+
//#region src/agents/cli-runner/bundle-mcp.ts
|
|
1221
|
+
function resolveBundleMcpMode(mode) {
|
|
1222
|
+
return mode ?? "claude-config-file";
|
|
1223
|
+
}
|
|
1224
|
+
async function readExternalMcpConfig(configPath) {
|
|
1225
|
+
try {
|
|
1226
|
+
return { mcpServers: extractMcpServerMap(JSON.parse(await fs.readFile(configPath, "utf-8"))) };
|
|
1227
|
+
} catch {
|
|
1228
|
+
return { mcpServers: {} };
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
async function readJsonObject(filePath) {
|
|
1232
|
+
try {
|
|
1233
|
+
const raw = JSON.parse(await fs.readFile(filePath, "utf-8"));
|
|
1234
|
+
return raw && typeof raw === "object" && !Array.isArray(raw) ? { ...raw } : {};
|
|
1235
|
+
} catch {
|
|
1236
|
+
return {};
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function findMcpConfigPath(args) {
|
|
1240
|
+
if (!args?.length) return;
|
|
1241
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
1242
|
+
const arg = args[i] ?? "";
|
|
1243
|
+
if (arg === "--mcp-config") return normalizeOptionalString(args[i + 1]);
|
|
1244
|
+
if (arg.startsWith("--mcp-config=")) return normalizeOptionalString(arg.slice(13));
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
function injectClaudeMcpConfigArgs(args, mcpConfigPath) {
|
|
1248
|
+
const next = [];
|
|
1249
|
+
for (let i = 0; i < (args?.length ?? 0); i += 1) {
|
|
1250
|
+
const arg = args?.[i] ?? "";
|
|
1251
|
+
if (arg === "--strict-mcp-config") continue;
|
|
1252
|
+
if (arg === "--mcp-config") {
|
|
1253
|
+
i += 1;
|
|
1254
|
+
continue;
|
|
1255
|
+
}
|
|
1256
|
+
if (arg.startsWith("--mcp-config=")) continue;
|
|
1257
|
+
next.push(arg);
|
|
1258
|
+
}
|
|
1259
|
+
next.push("--strict-mcp-config", "--mcp-config", mcpConfigPath);
|
|
1260
|
+
return next;
|
|
1261
|
+
}
|
|
1262
|
+
function isRecord(value) {
|
|
1263
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1264
|
+
}
|
|
1265
|
+
function normalizeStringArray(value) {
|
|
1266
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? [...value] : void 0;
|
|
1267
|
+
}
|
|
1268
|
+
function normalizeStringRecord(value) {
|
|
1269
|
+
if (!isRecord(value)) return;
|
|
1270
|
+
const entries = Object.entries(value).filter((entry) => {
|
|
1271
|
+
return typeof entry[1] === "string";
|
|
1272
|
+
});
|
|
1273
|
+
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
1274
|
+
}
|
|
1275
|
+
function decodeHeaderEnvPlaceholder(value) {
|
|
1276
|
+
const bearerMatch = /^Bearer \${([A-Z0-9_]+)}$/.exec(value);
|
|
1277
|
+
if (bearerMatch) return {
|
|
1278
|
+
envVar: bearerMatch[1],
|
|
1279
|
+
bearer: true
|
|
1280
|
+
};
|
|
1281
|
+
const envMatch = /^\${([A-Z0-9_]+)}$/.exec(value);
|
|
1282
|
+
if (envMatch) return {
|
|
1283
|
+
envVar: envMatch[1],
|
|
1284
|
+
bearer: false
|
|
1285
|
+
};
|
|
1286
|
+
return null;
|
|
1287
|
+
}
|
|
1288
|
+
function applyCommonServerConfig(next, server) {
|
|
1289
|
+
if (typeof server.command === "string") next.command = server.command;
|
|
1290
|
+
const args = normalizeStringArray(server.args);
|
|
1291
|
+
if (args) next.args = args;
|
|
1292
|
+
const env = normalizeStringRecord(server.env);
|
|
1293
|
+
if (env) next.env = env;
|
|
1294
|
+
if (typeof server.cwd === "string") next.cwd = server.cwd;
|
|
1295
|
+
if (typeof server.url === "string") next.url = server.url;
|
|
1296
|
+
}
|
|
1297
|
+
function normalizeCodexServerConfig(server) {
|
|
1298
|
+
const next = {};
|
|
1299
|
+
applyCommonServerConfig(next, server);
|
|
1300
|
+
const httpHeaders = normalizeStringRecord(server.headers);
|
|
1301
|
+
if (httpHeaders) {
|
|
1302
|
+
const staticHeaders = {};
|
|
1303
|
+
const envHeaders = {};
|
|
1304
|
+
for (const [name, value] of Object.entries(httpHeaders)) {
|
|
1305
|
+
const decoded = decodeHeaderEnvPlaceholder(value);
|
|
1306
|
+
if (!decoded) {
|
|
1307
|
+
staticHeaders[name] = value;
|
|
1308
|
+
continue;
|
|
1309
|
+
}
|
|
1310
|
+
if (decoded.bearer && normalizeOptionalLowercaseString(name) === "authorization") {
|
|
1311
|
+
next.bearer_token_env_var = decoded.envVar;
|
|
1312
|
+
continue;
|
|
1313
|
+
}
|
|
1314
|
+
envHeaders[name] = decoded.envVar;
|
|
1315
|
+
}
|
|
1316
|
+
if (Object.keys(staticHeaders).length > 0) next.http_headers = staticHeaders;
|
|
1317
|
+
if (Object.keys(envHeaders).length > 0) next.env_http_headers = envHeaders;
|
|
1318
|
+
}
|
|
1319
|
+
return next;
|
|
1320
|
+
}
|
|
1321
|
+
function resolveEnvPlaceholder(value, inheritedEnv) {
|
|
1322
|
+
const decoded = decodeHeaderEnvPlaceholder(value);
|
|
1323
|
+
if (!decoded) return value;
|
|
1324
|
+
const resolved = inheritedEnv?.[decoded.envVar] ?? process.env[decoded.envVar] ?? "";
|
|
1325
|
+
return decoded.bearer ? `Bearer ${resolved}` : resolved;
|
|
1326
|
+
}
|
|
1327
|
+
function normalizeGeminiServerConfig(server, inheritedEnv) {
|
|
1328
|
+
const next = {};
|
|
1329
|
+
applyCommonServerConfig(next, server);
|
|
1330
|
+
if (typeof server.type === "string") next.type = server.type;
|
|
1331
|
+
const headers = normalizeStringRecord(server.headers);
|
|
1332
|
+
if (headers) next.headers = Object.fromEntries(Object.entries(headers).map(([name, value]) => [name, resolveEnvPlaceholder(value, inheritedEnv)]));
|
|
1333
|
+
if (typeof server.trust === "boolean") next.trust = server.trust;
|
|
1334
|
+
return next;
|
|
1335
|
+
}
|
|
1336
|
+
function injectCodexMcpConfigArgs(args, config) {
|
|
1337
|
+
const overrides = serializeTomlInlineValue(Object.fromEntries(Object.entries(config.mcpServers).map(([name, server]) => [name, normalizeCodexServerConfig(server)])));
|
|
1338
|
+
return [
|
|
1339
|
+
...args ?? [],
|
|
1340
|
+
"-c",
|
|
1341
|
+
`mcp_servers=${overrides}`
|
|
1342
|
+
];
|
|
1343
|
+
}
|
|
1344
|
+
async function writeGeminiSystemSettings(mergedConfig, inheritedEnv) {
|
|
1345
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "kaijibot-gemini-mcp-"));
|
|
1346
|
+
const settingsPath = path.join(tempDir, "settings.json");
|
|
1347
|
+
const existingSettingsPath = inheritedEnv?.GEMINI_CLI_SYSTEM_SETTINGS_PATH ?? process.env.GEMINI_CLI_SYSTEM_SETTINGS_PATH;
|
|
1348
|
+
const base = typeof existingSettingsPath === "string" && existingSettingsPath.trim() ? await readJsonObject(existingSettingsPath) : {};
|
|
1349
|
+
const normalizedConfig = { mcpServers: Object.fromEntries(Object.entries(mergedConfig.mcpServers).map(([name, server]) => [name, normalizeGeminiServerConfig(server, inheritedEnv)])) };
|
|
1350
|
+
const settings = applyMergePatch(base, {
|
|
1351
|
+
mcp: { allowed: Object.keys(normalizedConfig.mcpServers) },
|
|
1352
|
+
mcpServers: normalizedConfig.mcpServers
|
|
1353
|
+
});
|
|
1354
|
+
await fs.writeFile(settingsPath, `${JSON.stringify(settings, null, 2)}\n`, "utf-8");
|
|
1355
|
+
return {
|
|
1356
|
+
env: {
|
|
1357
|
+
...inheritedEnv,
|
|
1358
|
+
GEMINI_CLI_SYSTEM_SETTINGS_PATH: settingsPath
|
|
1359
|
+
},
|
|
1360
|
+
cleanup: async () => {
|
|
1361
|
+
await fs.rm(tempDir, {
|
|
1362
|
+
recursive: true,
|
|
1363
|
+
force: true
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
async function prepareModeSpecificBundleMcpConfig(params) {
|
|
1369
|
+
const serializedConfig = `${JSON.stringify(params.mergedConfig, null, 2)}\n`;
|
|
1370
|
+
const mcpConfigHash = crypto.createHash("sha256").update(serializedConfig).digest("hex");
|
|
1371
|
+
if (params.mode === "codex-config-overrides") return {
|
|
1372
|
+
backend: {
|
|
1373
|
+
...params.backend,
|
|
1374
|
+
args: injectCodexMcpConfigArgs(params.backend.args, params.mergedConfig),
|
|
1375
|
+
resumeArgs: injectCodexMcpConfigArgs(params.backend.resumeArgs ?? params.backend.args ?? [], params.mergedConfig)
|
|
1376
|
+
},
|
|
1377
|
+
mcpConfigHash,
|
|
1378
|
+
env: params.env
|
|
1379
|
+
};
|
|
1380
|
+
if (params.mode === "gemini-system-settings") {
|
|
1381
|
+
const settings = await writeGeminiSystemSettings(params.mergedConfig, params.env);
|
|
1382
|
+
return {
|
|
1383
|
+
backend: params.backend,
|
|
1384
|
+
mcpConfigHash,
|
|
1385
|
+
env: settings.env,
|
|
1386
|
+
cleanup: settings.cleanup
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "kaijibot-cli-mcp-"));
|
|
1390
|
+
const mcpConfigPath = path.join(tempDir, "mcp.json");
|
|
1391
|
+
await fs.writeFile(mcpConfigPath, serializedConfig, "utf-8");
|
|
1392
|
+
return {
|
|
1393
|
+
backend: {
|
|
1394
|
+
...params.backend,
|
|
1395
|
+
args: injectClaudeMcpConfigArgs(params.backend.args, mcpConfigPath),
|
|
1396
|
+
resumeArgs: injectClaudeMcpConfigArgs(params.backend.resumeArgs ?? params.backend.args ?? [], mcpConfigPath)
|
|
1397
|
+
},
|
|
1398
|
+
mcpConfigHash,
|
|
1399
|
+
env: params.env,
|
|
1400
|
+
cleanup: async () => {
|
|
1401
|
+
await fs.rm(tempDir, {
|
|
1402
|
+
recursive: true,
|
|
1403
|
+
force: true
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
async function prepareCliBundleMcpConfig(params) {
|
|
1409
|
+
if (!params.enabled) return {
|
|
1410
|
+
backend: params.backend,
|
|
1411
|
+
env: params.env
|
|
1412
|
+
};
|
|
1413
|
+
const mode = resolveBundleMcpMode(params.mode);
|
|
1414
|
+
const existingMcpConfigPath = mode === "claude-config-file" ? findMcpConfigPath(params.backend.resumeArgs) ?? findMcpConfigPath(params.backend.args) : void 0;
|
|
1415
|
+
let mergedConfig = { mcpServers: {} };
|
|
1416
|
+
if (existingMcpConfigPath) {
|
|
1417
|
+
const resolvedExistingPath = path.isAbsolute(existingMcpConfigPath) ? existingMcpConfigPath : path.resolve(params.workspaceDir, existingMcpConfigPath);
|
|
1418
|
+
mergedConfig = applyMergePatch(mergedConfig, await readExternalMcpConfig(resolvedExistingPath));
|
|
1419
|
+
}
|
|
1420
|
+
const bundleConfig = loadEnabledBundleMcpConfig({
|
|
1421
|
+
workspaceDir: params.workspaceDir,
|
|
1422
|
+
cfg: params.config
|
|
1423
|
+
});
|
|
1424
|
+
for (const diagnostic of bundleConfig.diagnostics) params.warn?.(`bundle MCP skipped for ${diagnostic.pluginId}: ${diagnostic.message}`);
|
|
1425
|
+
mergedConfig = applyMergePatch(mergedConfig, bundleConfig.config);
|
|
1426
|
+
if (params.additionalConfig) mergedConfig = applyMergePatch(mergedConfig, params.additionalConfig);
|
|
1427
|
+
return await prepareModeSpecificBundleMcpConfig({
|
|
1428
|
+
mode,
|
|
1429
|
+
backend: params.backend,
|
|
1430
|
+
mergedConfig,
|
|
1431
|
+
env: params.env
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
//#endregion
|
|
1435
|
+
//#region src/agents/cli-runner/prepare.ts
|
|
1436
|
+
const prepareDeps = {
|
|
1437
|
+
makeBootstrapWarn,
|
|
1438
|
+
resolveBootstrapContextForRun,
|
|
1439
|
+
getActiveMcpLoopbackRuntime,
|
|
1440
|
+
createMcpLoopbackServerConfig,
|
|
1441
|
+
resolveKaijiBotDocsPath: async (params) => (await import("./docs-path-BB9R-rc-.js")).resolveKaijiBotDocsPath(params)
|
|
1442
|
+
};
|
|
1443
|
+
async function prepareCliRunContext(params) {
|
|
1444
|
+
const started = Date.now();
|
|
1445
|
+
const workspaceResolution = resolveRunWorkspaceDir({
|
|
1446
|
+
workspaceDir: params.workspaceDir,
|
|
1447
|
+
sessionKey: params.sessionKey,
|
|
1448
|
+
agentId: params.agentId,
|
|
1449
|
+
config: params.config
|
|
1450
|
+
});
|
|
1451
|
+
const resolvedWorkspace = workspaceResolution.workspaceDir;
|
|
1452
|
+
const redactedSessionId = redactRunIdentifier(params.sessionId);
|
|
1453
|
+
const redactedSessionKey = redactRunIdentifier(params.sessionKey);
|
|
1454
|
+
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
1455
|
+
if (workspaceResolution.usedFallback) cliBackendLog.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
1456
|
+
const workspaceDir = resolvedWorkspace;
|
|
1457
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
1458
|
+
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
1459
|
+
const authEpoch = await resolveCliAuthEpoch({
|
|
1460
|
+
provider: params.provider,
|
|
1461
|
+
authProfileId: params.authProfileId
|
|
1462
|
+
});
|
|
1463
|
+
const extraSystemPrompt = params.extraSystemPrompt?.trim() ?? "";
|
|
1464
|
+
const extraSystemPromptHash = hashCliSessionText(extraSystemPrompt);
|
|
1465
|
+
const modelId = (params.model ?? "default").trim() || "default";
|
|
1466
|
+
const normalizedModel = normalizeCliModel(modelId, backendResolved.config);
|
|
1467
|
+
const modelDisplay = `${params.provider}/${modelId}`;
|
|
1468
|
+
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
1469
|
+
const { bootstrapFiles, contextFiles } = await prepareDeps.resolveBootstrapContextForRun({
|
|
1470
|
+
workspaceDir,
|
|
1471
|
+
config: params.config,
|
|
1472
|
+
sessionKey: params.sessionKey,
|
|
1473
|
+
sessionId: params.sessionId,
|
|
1474
|
+
warn: prepareDeps.makeBootstrapWarn({
|
|
1475
|
+
sessionLabel,
|
|
1476
|
+
warn: (message) => cliBackendLog.warn(message)
|
|
1477
|
+
})
|
|
1478
|
+
});
|
|
1479
|
+
const bootstrapMaxChars = resolveBootstrapMaxChars(params.config);
|
|
1480
|
+
const bootstrapTotalMaxChars = resolveBootstrapTotalMaxChars(params.config);
|
|
1481
|
+
const bootstrapAnalysis = analyzeBootstrapBudget({
|
|
1482
|
+
files: buildBootstrapInjectionStats({
|
|
1483
|
+
bootstrapFiles,
|
|
1484
|
+
injectedFiles: contextFiles
|
|
1485
|
+
}),
|
|
1486
|
+
bootstrapMaxChars,
|
|
1487
|
+
bootstrapTotalMaxChars
|
|
1488
|
+
});
|
|
1489
|
+
const bootstrapPromptWarningMode = resolveBootstrapPromptTruncationWarningMode(params.config);
|
|
1490
|
+
const bootstrapPromptWarning = buildBootstrapPromptWarning({
|
|
1491
|
+
analysis: bootstrapAnalysis,
|
|
1492
|
+
mode: bootstrapPromptWarningMode,
|
|
1493
|
+
seenSignatures: params.bootstrapPromptWarningSignaturesSeen,
|
|
1494
|
+
previousSignature: params.bootstrapPromptWarningSignature
|
|
1495
|
+
});
|
|
1496
|
+
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
1497
|
+
sessionKey: params.sessionKey,
|
|
1498
|
+
config: params.config,
|
|
1499
|
+
agentId: params.agentId
|
|
1500
|
+
});
|
|
1501
|
+
const mcpLoopbackRuntime = backendResolved.bundleMcp ? prepareDeps.getActiveMcpLoopbackRuntime() : void 0;
|
|
1502
|
+
const preparedBackend = await prepareCliBundleMcpConfig({
|
|
1503
|
+
enabled: backendResolved.bundleMcp,
|
|
1504
|
+
mode: backendResolved.bundleMcpMode,
|
|
1505
|
+
backend: backendResolved.config,
|
|
1506
|
+
workspaceDir,
|
|
1507
|
+
config: params.config,
|
|
1508
|
+
additionalConfig: mcpLoopbackRuntime ? prepareDeps.createMcpLoopbackServerConfig(mcpLoopbackRuntime.port) : void 0,
|
|
1509
|
+
env: mcpLoopbackRuntime ? {
|
|
1510
|
+
KAIJIBOT_MCP_TOKEN: mcpLoopbackRuntime.token,
|
|
1511
|
+
KAIJIBOT_MCP_AGENT_ID: sessionAgentId ?? "",
|
|
1512
|
+
KAIJIBOT_MCP_ACCOUNT_ID: params.agentAccountId ?? "",
|
|
1513
|
+
KAIJIBOT_MCP_SESSION_KEY: params.sessionKey ?? "",
|
|
1514
|
+
KAIJIBOT_MCP_MESSAGE_CHANNEL: params.messageProvider ?? ""
|
|
1515
|
+
} : void 0,
|
|
1516
|
+
warn: (message) => cliBackendLog.warn(message)
|
|
1517
|
+
});
|
|
1518
|
+
const reusableCliSession = params.cliSessionBinding ? resolveCliSessionReuse({
|
|
1519
|
+
binding: params.cliSessionBinding,
|
|
1520
|
+
authProfileId: params.authProfileId,
|
|
1521
|
+
authEpoch,
|
|
1522
|
+
extraSystemPromptHash,
|
|
1523
|
+
mcpConfigHash: preparedBackend.mcpConfigHash
|
|
1524
|
+
}) : params.cliSessionId ? { sessionId: params.cliSessionId } : {};
|
|
1525
|
+
if (reusableCliSession.invalidatedReason) cliBackendLog.info(`cli session reset: provider=${params.provider} reason=${reusableCliSession.invalidatedReason}`);
|
|
1526
|
+
const heartbeatPrompt = resolveHeartbeatPromptForSystemPrompt({
|
|
1527
|
+
config: params.config,
|
|
1528
|
+
agentId: sessionAgentId,
|
|
1529
|
+
defaultAgentId
|
|
1530
|
+
});
|
|
1531
|
+
const docsPath = await prepareDeps.resolveKaijiBotDocsPath({
|
|
1532
|
+
workspaceDir,
|
|
1533
|
+
argv1: process.argv[1],
|
|
1534
|
+
cwd: process.cwd(),
|
|
1535
|
+
moduleUrl: import.meta.url
|
|
1536
|
+
});
|
|
1537
|
+
const systemPrompt = resolveSystemPromptOverride({
|
|
1538
|
+
config: params.config,
|
|
1539
|
+
agentId: sessionAgentId
|
|
1540
|
+
}) ?? buildSystemPrompt({
|
|
1541
|
+
workspaceDir,
|
|
1542
|
+
config: params.config,
|
|
1543
|
+
defaultThinkLevel: params.thinkLevel,
|
|
1544
|
+
extraSystemPrompt,
|
|
1545
|
+
ownerNumbers: params.ownerNumbers,
|
|
1546
|
+
heartbeatPrompt,
|
|
1547
|
+
docsPath: docsPath ?? void 0,
|
|
1548
|
+
tools: [],
|
|
1549
|
+
contextFiles,
|
|
1550
|
+
modelDisplay,
|
|
1551
|
+
agentId: sessionAgentId
|
|
1552
|
+
});
|
|
1553
|
+
return {
|
|
1554
|
+
params,
|
|
1555
|
+
started,
|
|
1556
|
+
workspaceDir,
|
|
1557
|
+
backendResolved,
|
|
1558
|
+
preparedBackend,
|
|
1559
|
+
reusableCliSession,
|
|
1560
|
+
modelId,
|
|
1561
|
+
normalizedModel,
|
|
1562
|
+
systemPrompt,
|
|
1563
|
+
systemPromptReport: buildSystemPromptReport({
|
|
1564
|
+
source: "run",
|
|
1565
|
+
generatedAt: Date.now(),
|
|
1566
|
+
sessionId: params.sessionId,
|
|
1567
|
+
sessionKey: params.sessionKey,
|
|
1568
|
+
provider: params.provider,
|
|
1569
|
+
model: modelId,
|
|
1570
|
+
workspaceDir,
|
|
1571
|
+
bootstrapMaxChars,
|
|
1572
|
+
bootstrapTotalMaxChars,
|
|
1573
|
+
bootstrapTruncation: buildBootstrapTruncationReportMeta({
|
|
1574
|
+
analysis: bootstrapAnalysis,
|
|
1575
|
+
warningMode: bootstrapPromptWarningMode,
|
|
1576
|
+
warning: bootstrapPromptWarning
|
|
1577
|
+
}),
|
|
1578
|
+
sandbox: {
|
|
1579
|
+
mode: "off",
|
|
1580
|
+
sandboxed: false
|
|
1581
|
+
},
|
|
1582
|
+
systemPrompt,
|
|
1583
|
+
bootstrapFiles,
|
|
1584
|
+
injectedFiles: contextFiles,
|
|
1585
|
+
skillsPrompt: "",
|
|
1586
|
+
tools: []
|
|
1587
|
+
}),
|
|
1588
|
+
bootstrapPromptWarningLines: bootstrapPromptWarning.lines,
|
|
1589
|
+
heartbeatPrompt,
|
|
1590
|
+
authEpoch,
|
|
1591
|
+
extraSystemPromptHash
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region src/agents/cli-runner.ts
|
|
1596
|
+
async function runCliAgent(params) {
|
|
1597
|
+
return runPreparedCliAgent(await prepareCliRunContext(params));
|
|
1598
|
+
}
|
|
1599
|
+
async function runPreparedCliAgent(context) {
|
|
1600
|
+
const { params } = context;
|
|
1601
|
+
const buildCliRunResult = (resultParams) => {
|
|
1602
|
+
const text = resultParams.output.text?.trim();
|
|
1603
|
+
return {
|
|
1604
|
+
payloads: text ? [{ text }] : void 0,
|
|
1605
|
+
meta: {
|
|
1606
|
+
durationMs: Date.now() - context.started,
|
|
1607
|
+
systemPromptReport: context.systemPromptReport,
|
|
1608
|
+
agentMeta: {
|
|
1609
|
+
sessionId: resultParams.effectiveCliSessionId ?? params.sessionId ?? "",
|
|
1610
|
+
provider: params.provider,
|
|
1611
|
+
model: context.modelId,
|
|
1612
|
+
usage: resultParams.output.usage,
|
|
1613
|
+
...resultParams.effectiveCliSessionId ? { cliSessionBinding: {
|
|
1614
|
+
sessionId: resultParams.effectiveCliSessionId,
|
|
1615
|
+
...params.authProfileId ? { authProfileId: params.authProfileId } : {},
|
|
1616
|
+
...context.authEpoch ? { authEpoch: context.authEpoch } : {},
|
|
1617
|
+
...context.extraSystemPromptHash ? { extraSystemPromptHash: context.extraSystemPromptHash } : {},
|
|
1618
|
+
...context.preparedBackend.mcpConfigHash ? { mcpConfigHash: context.preparedBackend.mcpConfigHash } : {}
|
|
1619
|
+
} } : {}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
};
|
|
1624
|
+
try {
|
|
1625
|
+
try {
|
|
1626
|
+
const output = await executePreparedCliRun(context, context.reusableCliSession.sessionId);
|
|
1627
|
+
return buildCliRunResult({
|
|
1628
|
+
output,
|
|
1629
|
+
effectiveCliSessionId: output.sessionId ?? context.reusableCliSession.sessionId
|
|
1630
|
+
});
|
|
1631
|
+
} catch (err) {
|
|
1632
|
+
if (isFailoverError(err)) {
|
|
1633
|
+
const retryableSessionId = context.reusableCliSession.sessionId ?? params.cliSessionId;
|
|
1634
|
+
if (err.reason === "session_expired" && retryableSessionId && params.sessionKey) {
|
|
1635
|
+
const output = await executePreparedCliRun(context, void 0);
|
|
1636
|
+
const effectiveCliSessionId = output.sessionId;
|
|
1637
|
+
return buildCliRunResult({
|
|
1638
|
+
output,
|
|
1639
|
+
effectiveCliSessionId
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
throw err;
|
|
1643
|
+
}
|
|
1644
|
+
const message = formatErrorMessage(err);
|
|
1645
|
+
if (isFailoverErrorMessage(message, { provider: params.provider })) {
|
|
1646
|
+
const reason = classifyFailoverReason(message, { provider: params.provider }) ?? "unknown";
|
|
1647
|
+
const status = resolveFailoverStatus(reason);
|
|
1648
|
+
throw new FailoverError(message, {
|
|
1649
|
+
reason,
|
|
1650
|
+
provider: params.provider,
|
|
1651
|
+
model: context.modelId,
|
|
1652
|
+
status
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
throw err;
|
|
1656
|
+
}
|
|
1657
|
+
} finally {
|
|
1658
|
+
await context.preparedBackend.cleanup?.();
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
//#endregion
|
|
1662
|
+
export { setCliSessionBinding as a, setActiveMcpLoopbackRuntime as c, getCliSessionId as i, clearCliSession as n, setCliSessionId as o, getCliSessionBinding as r, clearActiveMcpLoopbackRuntime as s, runCliAgent as t };
|