remoteclaw 0.1.0-next.c403049 → 0.1.0-next.cfbbf3e
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/LICENSE +661 -22
- package/README.md +18 -10
- package/dist/accounts-Aqbb2_Fn.js +270 -0
- package/dist/accounts-Bo2bX8jP.js +272 -0
- package/dist/accounts-CM9-wQiO.js +32 -0
- package/dist/accounts-D3fAPVzU.js +36 -0
- package/dist/accounts-DZmv4bXS.js +47 -0
- package/dist/accounts-DmB4SVPK.js +47 -0
- package/dist/accounts-DtkyfvwR.js +36 -0
- package/dist/ack-reactions-BpScrBGW.js +446 -0
- package/dist/ack-reactions-Dzzngl4O.js +446 -0
- package/dist/acp-cli-DVXhDMc6.js +1324 -0
- package/dist/acp-cli-QBL4_qcW.js +1319 -0
- package/dist/active-listener-CwxZ24bZ.js +37 -0
- package/dist/active-listener-v2sItamh.js +37 -0
- package/dist/agent-BDLAlLCL.js +704 -0
- package/dist/agent-BLF0q7z7.js +703 -0
- package/dist/agent-helpers-BSGqeJr-.js +400 -0
- package/dist/agent-helpers-eEHy5uX2.js +400 -0
- package/dist/agent-scope-CJW7vnF8.js +114 -0
- package/dist/agent-scope-_ND_-bJy.js +116 -0
- package/dist/agents-CL3NO8AU.js +760 -0
- package/dist/agents.config-BPIAuyp2.js +116 -0
- package/dist/agents.config-H06b2bwI.js +116 -0
- package/dist/ansi-DtaiOnt1.js +107 -0
- package/dist/audio-BIvUsncf.js +43 -0
- package/dist/audio-CQ8TfmVN.js +43 -0
- package/dist/audit-BK7HInSG.js +3150 -0
- package/dist/audit-DEXNUeWm.js +3150 -0
- package/dist/auth-DGqCLaQq.js +448 -0
- package/dist/auth-DLTRySEi.js +314 -0
- package/dist/auth-Drf91ntw.js +315 -0
- package/dist/auth-ku2khJyQ.js +448 -0
- package/dist/banner-V89c8CZr.js +294 -0
- package/dist/binaries-BTvHIrCr.js +13 -0
- package/dist/bindings-Dr0bGRst.js +69 -0
- package/dist/bindings-DsWJQVKh.js +69 -0
- package/dist/bonjour-discovery-753eUdn8.js +378 -0
- package/dist/bonjour-discovery-Lo4oz5nx.js +378 -0
- package/dist/boot/handler.js +31 -58
- package/dist/browser-cli-DxJew43l.js +1694 -0
- package/dist/browser-cli-p0nakrjO.js +1690 -0
- package/dist/build-info.json +3 -3
- package/dist/call-BrTmlOx3.js +518 -0
- package/dist/call-ChdUdwb4.js +517 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/catalog-DTlcfTT9.js +185 -0
- package/dist/catalog-PixZqhZK.js +185 -0
- package/dist/channel-account-context-BM7ekXJw.js +133 -0
- package/dist/channel-account-context-B_CTilep.js +133 -0
- package/dist/channel-activity-C-L6rDrQ.js +94 -0
- package/dist/channel-activity-DdgLBZ7M.js +94 -0
- package/dist/channel-activity-hL4KZrCz.js +292 -0
- package/dist/channel-options-DDJfZ19-.js +33 -0
- package/dist/channel-options-DPgNXhhg.js +32 -0
- package/dist/channel-selection-Ba3RY1Ao.js +51 -0
- package/dist/channel-selection-DW21dXB1.js +51 -0
- package/dist/channel-web-BsdEYRcn.js +2136 -0
- package/dist/channel-web-DrEUZh4c.js +2134 -0
- package/dist/channels-cli-D1Hg7OoJ.js +1429 -0
- package/dist/channels-cli-DYdSWyJS.js +1425 -0
- package/dist/channels-status-issues-Chzsa1R2.js +18 -0
- package/dist/channels-status-issues-dszAk26n.js +18 -0
- package/dist/chat-envelope-BIujl9Cj.js +248 -0
- package/dist/chat-envelope-CrM0X4sl.js +248 -0
- package/dist/chrome-Dqtq7zCc.js +1733 -0
- package/dist/chrome-XeSY99Z_.js +1732 -0
- package/dist/chunk-CWD_zrz_.js +341 -0
- package/dist/chunk-LUabyS9k.js +341 -0
- package/dist/clack-prompter-BhtlKYaz.js +122 -0
- package/dist/clack-prompter-Ds_jQwRg.js +121 -0
- package/dist/cleanup-utils-C957khj6.js +94 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-B7AOUqP7.js +133 -0
- package/dist/cli-Cf0q1XPt.js +129 -0
- package/dist/client-B9u3JdT_.js +2316 -0
- package/dist/client-DEEOhx0w.js +2316 -0
- package/dist/clipboard-B2nstLx7.js +31 -0
- package/dist/clipboard-C8QI9fes.js +31 -0
- package/dist/command-format-D0vKipG9.js +32 -0
- package/dist/command-format-LFmgWzKJ.js +18 -0
- package/dist/command-logger/handler.js +1 -1
- package/dist/command-registry-G0iFZSsB.js +215 -0
- package/dist/commands-BAYwlS3d.js +41 -0
- package/dist/commands-D842kCjj.js +41 -0
- package/dist/commands-registry-Cg2GTT2J.js +892 -0
- package/dist/commands-registry-Yz-uV5oG.js +891 -0
- package/dist/common-B67cBSew.js +156 -0
- package/dist/common-DEoiTqOr.js +156 -0
- package/dist/completion-cli-CsnRuzKE.js +452 -0
- package/dist/completion-cli-up_dylJo.js +452 -0
- package/dist/config-CAa0rZSx.js +4225 -0
- package/dist/config-W0w-gi2j.js +4223 -0
- package/dist/config-cli-B3ZJv_rA.js +247 -0
- package/dist/config-cli-Bw9dMm2_.js +243 -0
- package/dist/config-guard-BB8ZCtG2.js +75 -0
- package/dist/config-guard-BGDrhmVw.js +99 -0
- package/dist/config-validation-BRV8Dwlm.js +18 -0
- package/dist/config-validation-CgLT7yOT.js +18 -0
- package/dist/configure-9Z1a-62u.js +889 -0
- package/dist/configure-B8GTAFVp.js +891 -0
- package/dist/constants-BAZuhSRm.js +75 -0
- package/dist/constants-BBVTjb1j.js +75 -0
- package/dist/control-auth-BrBr2xb8.js +397 -0
- package/dist/control-auth-CehjYKnL.js +397 -0
- package/dist/control-ui/assets/index-DdiU_ccM.css +1 -0
- package/dist/control-ui/assets/index-kVUYi64u.js +7723 -0
- package/dist/control-ui/assets/index-kVUYi64u.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui-assets-BhJwfkgT.js +186 -0
- package/dist/control-ui-assets-DEQuKyme.js +186 -0
- package/dist/conversation-label-Bn5j3lUT.js +36 -0
- package/dist/conversation-label-CDH4rKMG.js +36 -0
- package/dist/cron-cli-Be9JgLb2.js +498 -0
- package/dist/cron-cli-DkXVZaCq.js +494 -0
- package/dist/daemon-cli-CIoKNZvF.js +735 -0
- package/dist/daemon-cli-niV5fzD4.js +737 -0
- package/dist/daemon-cli.js +56 -102
- package/dist/daemon-install-1ynjvFZL.js +56 -0
- package/dist/daemon-install-C8IcQYs1.js +60 -0
- package/dist/daemon-install-helpers-CfcKL7QX.js +504 -0
- package/dist/daemon-install-helpers-DzVSXu0U.js +504 -0
- package/dist/deliver-CDcL8ok6.js +481 -0
- package/dist/deliver-xpNcxpb6.js +481 -0
- package/dist/delivery-queue-33Q7Kk2m.js +244 -0
- package/dist/delivery-queue-CTaYZQ_8.js +244 -0
- package/dist/devices-cli-BKKwdow_.js +319 -0
- package/dist/devices-cli-ChY_hDCH.js +323 -0
- package/dist/diagnostics-DRGjLipf.js +35 -0
- package/dist/diagnostics-DeuGkI5l.js +35 -0
- package/dist/directory-cli-1GNpcNre.js +224 -0
- package/dist/directory-cli-CdlTrGda.js +220 -0
- package/dist/dispatcher-BMmzjWPB.js +174 -0
- package/dist/dispatcher-WqL89TYp.js +173 -0
- package/dist/dm-policy-shared-n9ISCHRR.js +22 -0
- package/dist/dm-policy-shared-rngrU9Sh.js +22 -0
- package/dist/dns-cli-Dih_PCz2.js +203 -0
- package/dist/dns-cli-mGfvT-X2.js +199 -0
- package/dist/dock-Big-J2VN.js +929 -0
- package/dist/dock-Cj4PKiUh.js +928 -0
- package/dist/doctor-completion-Bg4iXpHR.js +92 -0
- package/dist/doctor-completion-x0A_9Rp_.js +92 -0
- package/dist/doctor-config-flow-CP28w1Gp.js +1935 -0
- package/dist/doctor-config-flow-C_HMyUfr.js +1934 -0
- package/dist/enable-Bnnd9rJQ.js +59 -0
- package/dist/enable-DeRa_Dwn.js +59 -0
- package/dist/entry.js +14 -16
- package/dist/env-B3zr72vQ.js +60 -0
- package/dist/env-vars-CD2_baIP.js +43 -0
- package/dist/env-vars-a7S70ba7.js +43 -0
- package/dist/errors-CdmXrBic.js +35 -0
- package/dist/errors-Cr_NbOb4.js +35 -0
- package/dist/exec-D_s-zAtY.js +164 -0
- package/dist/exec-Zz6eJ6YU.js +164 -0
- package/dist/export-html/template.css +0 -36
- package/dist/export-html/template.js +1 -32
- package/dist/extensionAPI.js +1148 -148
- package/dist/fetch-C0Kt-OTD.js +67 -0
- package/dist/fetch-DRVdxxEj.js +67 -0
- package/dist/fetch-DTR2MlOk.js +67 -0
- package/dist/file-lock-6NXMPZTT.js +107 -0
- package/dist/file-lock-C_KRlR7M.js +107 -0
- package/dist/fs-safe-DZHpH7TI.js +98 -0
- package/dist/fs-safe-vm3JMUkq.js +88 -0
- package/dist/gateway-cli-CNBEuTi7.js +24347 -0
- package/dist/gateway-cli-D8h_MX6P.js +24351 -0
- package/dist/gateway-rpc-BCFkQPa2.js +28 -0
- package/dist/gateway-rpc-DOgYbsOG.js +28 -0
- package/dist/gmail-setup-utils-CaCw59UH.js +423 -0
- package/dist/gmail-setup-utils-Esi4W52F.js +422 -0
- package/dist/health-CBusRcqc.js +1417 -0
- package/dist/health-QDyYt942.js +1414 -0
- package/dist/health-format-4qIciWnH.js +28 -0
- package/dist/heartbeat-visibility-BjkWJxq6.js +125 -0
- package/dist/heartbeat-visibility-Cg_NtXtE.js +125 -0
- package/dist/help-format-DM6-OBt-.js +17 -0
- package/dist/helpers-CGZx9FJd.js +10 -0
- package/dist/helpers-b1jzdNE7.js +10 -0
- package/dist/hook-runner-global-C0DFQmQw.js +527 -0
- package/dist/hooks-cli-Dx9gOIX8.js +1225 -0
- package/dist/hooks-cli-K-N__uX4.js +1221 -0
- package/dist/host-env-security-BGibnCbS.js +106 -0
- package/dist/host-env-security-axRnIi8d.js +106 -0
- package/dist/image-ops-B9ofmzSq.js +354 -0
- package/dist/image-ops-CMuvRsMY.js +354 -0
- package/dist/import-CeK_fKST.js +604 -0
- package/dist/import-DMBcRq13.js +606 -0
- package/dist/inbound-context-BLy-G2Eq.js +68 -0
- package/dist/inbound-context-CmmmT8IP.js +68 -0
- package/dist/inbound-path-policy-BdmTOUka.js +90 -0
- package/dist/inbound-path-policy-BurOAu44.js +90 -0
- package/dist/index.js +110 -107
- package/dist/inspect-BK1tKJHb.js +286 -0
- package/dist/inspect-DBREkI_G.js +286 -0
- package/dist/installs-BYABRozP.js +325 -0
- package/dist/installs-CoZboJSz.js +325 -0
- package/dist/ipv4-B7xPGk8R.js +46 -0
- package/dist/ipv4-Y373I4Sy.js +46 -0
- package/dist/ir-CaxTklDC.js +940 -0
- package/dist/json-files-CfhnuGaC.js +46 -0
- package/dist/lifecycle-core-BiImPUqN.js +474 -0
- package/dist/lifecycle-core-DhR4-w4Q.js +476 -0
- package/dist/links-D5vtq30Q.js +15 -0
- package/dist/loader-DCBZ8gN2.js +22401 -0
- package/dist/loader-Dd7Cl24B.js +22404 -0
- package/dist/local-roots-CrJ_Jv_G.js +314 -0
- package/dist/local-roots-n_Y4iYwb.js +313 -0
- package/dist/logger-B8yHnzPl.js +49 -0
- package/dist/logging-BiuZwq5D.js +1 -0
- package/dist/logging-JZEg5nDp.js +1 -0
- package/dist/logging-xAM90kGK.js +20 -0
- package/dist/login-C99fsB0N.js +61 -0
- package/dist/login-cLvGPjeO.js +62 -0
- package/dist/login-qr-BAq-OGnv.js +325 -0
- package/dist/login-qr-BH1GPRt0.js +329 -0
- package/dist/logs-cli-CukoNyQ2.js +240 -0
- package/dist/logs-cli-D7GEvBIc.js +236 -0
- package/dist/markdown-tables-58Hq__7K.js +29 -0
- package/dist/markdown-tables-GFEX0OR6.js +29 -0
- package/dist/media-Bj2S2t91.js +10452 -0
- package/dist/media-CFsyXs3H.js +940 -0
- package/dist/message-action-names-CFl6mreB.js +2521 -0
- package/dist/message-action-names-DngGaJR0.js +2521 -0
- package/dist/message-channel-FMNRI5Ax.js +91 -0
- package/dist/message-channel-tuc9CdEw.js +91 -0
- package/dist/net-BEFkF-nI.js +225 -0
- package/dist/net-CNsUGiSw.js +225 -0
- package/dist/node-cli-BNnJAzRx.js +1458 -0
- package/dist/node-cli-pCw87J46.js +1462 -0
- package/dist/node-service-DJRZflx8.js +67 -0
- package/dist/node-service-GmW3_BfS.js +67 -0
- package/dist/nodes-cli-CIAUxdc0.js +1350 -0
- package/dist/nodes-cli-TzMjNiS1.js +1346 -0
- package/dist/nodes-screen-CFQjs8MT.js +250 -0
- package/dist/nodes-screen-DWZW8GM2.js +250 -0
- package/dist/note-BDIews1m.js +92 -0
- package/dist/note-Nm8KaHZU.js +92 -0
- package/dist/npm-registry-spec-BvfH5h_W.js +786 -0
- package/dist/npm-registry-spec-JNJIF0sj.js +786 -0
- package/dist/npm-resolution-BKF5UOfb.js +86 -0
- package/dist/npm-resolution-CbILViog.js +86 -0
- package/dist/onboard-CRbh4DgN.js +436 -0
- package/dist/onboard-IWFW8JdN.js +438 -0
- package/dist/onboard-channels-D6QHtbux.js +2547 -0
- package/dist/onboard-channels-ZfIB3AQ7.js +2548 -0
- package/dist/onboard-config-B22XEPgo.js +39 -0
- package/dist/onboard-config-CnzPYr-v.js +39 -0
- package/dist/onboard-helpers-CpaqhBRc.js +363 -0
- package/dist/onboard-helpers-SCO3k5Y8.js +364 -0
- package/dist/onboard-remote-BuNPRJ5F.js +127 -0
- package/dist/onboard-remote-qen5mdEh.js +127 -0
- package/dist/onboarding-Bfrfm9h3.js +586 -0
- package/dist/onboarding-BwamheyW.js +588 -0
- package/dist/onboarding.finalize-DmQVHUeh.js +402 -0
- package/dist/onboarding.finalize-OhTirY4S.js +404 -0
- package/dist/onboarding.gateway-config-Bnhzp671.js +201 -0
- package/dist/onboarding.gateway-config-CrAPZ-KT.js +195 -0
- package/dist/outbound-CcaPcetn.js +220 -0
- package/dist/outbound-CeiW8z3a.js +221 -0
- package/dist/outbound-attachment-BXV5BWfH.js +18 -0
- package/dist/outbound-attachment-Ba4U62Y0.js +18 -0
- package/dist/outbound-attachment-CZ7zoYxB.js +18 -0
- package/dist/pairing-cli-Cfas8mtn.js +125 -0
- package/dist/pairing-cli-DPYlR__9.js +129 -0
- package/dist/pairing-labels-3wDxaApH.js +9 -0
- package/dist/pairing-labels-iJmT0otM.js +9 -0
- package/dist/pairing-store-CdY7iRS0.js +459 -0
- package/dist/pairing-store-DykkYpQ7.js +460 -0
- package/dist/path-env-Cqo5LZmw.js +89 -0
- package/dist/path-env-GTM4HXCN.js +89 -0
- package/dist/path-safety-Cp7nWVMJ.js +14 -0
- package/dist/path-safety-Dtu7zu8V.js +14 -0
- package/dist/plugin-auto-enable-BuGRHS7-.js +301 -0
- package/dist/plugin-auto-enable-CLfBNuVK.js +302 -0
- package/dist/plugin-registry-DEp-56qo.js +33 -0
- package/dist/plugin-registry-eDrBvMCH.js +33 -0
- package/dist/plugin-sdk/agents/agent-helpers.d.ts +0 -1
- package/dist/plugin-sdk/agents/agent-scope.d.ts +11 -0
- package/dist/plugin-sdk/agents/agent-types.d.ts +1 -6
- package/dist/plugin-sdk/agents/agent-utils.d.ts +0 -14
- package/dist/plugin-sdk/agents/provider-utils.d.ts +0 -1
- package/dist/plugin-sdk/agents/subagent-spawn.d.ts +0 -1
- package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +0 -1
- package/dist/plugin-sdk/auth/constants.d.ts +15 -0
- package/dist/plugin-sdk/auth/display.d.ts +7 -0
- package/dist/plugin-sdk/auth/doctor.d.ts +8 -0
- package/dist/plugin-sdk/auth/env-injection.d.ts +38 -0
- package/dist/plugin-sdk/auth/index.d.ts +10 -0
- package/dist/plugin-sdk/auth/oauth.d.ts +13 -0
- package/dist/plugin-sdk/auth/order.d.ts +8 -0
- package/dist/plugin-sdk/auth/paths.d.ts +3 -0
- package/dist/plugin-sdk/auth/profiles.d.ts +11 -0
- package/dist/plugin-sdk/auth/provider-auth.d.ts +38 -0
- package/dist/plugin-sdk/auth/session-override.d.ts +17 -0
- package/dist/plugin-sdk/auth/store.d.ts +7 -0
- package/dist/plugin-sdk/auth/types.d.ts +45 -0
- package/dist/plugin-sdk/auth/usage.d.ts +80 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +0 -2
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +1 -2
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +1 -7
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +1 -7
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +3 -15
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -6
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +1 -5
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +1 -5
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +1 -3
- package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +4 -6
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +0 -7
- package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +0 -10
- package/dist/plugin-sdk/auto-reply/reply.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/status.d.ts +3 -7
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +0 -11
- package/dist/plugin-sdk/auto-reply/types.d.ts +1 -2
- package/dist/plugin-sdk/commands/agent/session.d.ts +1 -2
- package/dist/plugin-sdk/config/defaults.d.ts +0 -1
- package/dist/plugin-sdk/config/sessions/types.d.ts +0 -8
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +28 -112
- package/dist/plugin-sdk/config/types.agents.d.ts +8 -0
- package/dist/plugin-sdk/config/types.messages.d.ts +1 -2
- package/dist/plugin-sdk/config/types.remoteclaw.d.ts +2 -2
- package/dist/plugin-sdk/config/types.tools.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +9 -66
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +5 -13
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +12 -76
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -77
- package/dist/plugin-sdk/daemon/constants.d.ts +2 -2
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +1 -3
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +0 -2
- package/dist/plugin-sdk/gateway/server/ws-types.d.ts +2 -0
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +0 -2
- package/dist/plugin-sdk/index.js +131 -145
- package/dist/plugin-sdk/infra/agent-events.d.ts +1 -1
- package/dist/plugin-sdk/infra/provider-usage.auth.d.ts +0 -1
- package/dist/plugin-sdk/infra/provider-usage.load.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/defaults.d.ts +1 -2
- package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +1 -4
- package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +1 -3
- package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +1 -3
- package/dist/plugin-sdk/media-understanding/types.d.ts +3 -18
- package/dist/plugin-sdk/middleware/auth-key-retry.d.ts +31 -0
- package/dist/plugin-sdk/middleware/channel-bridge.d.ts +4 -0
- package/dist/plugin-sdk/middleware/error-classifier.d.ts +5 -0
- package/dist/plugin-sdk/middleware/media-capability.d.ts +21 -0
- package/dist/plugin-sdk/middleware/media-resolver.d.ts +12 -0
- package/dist/plugin-sdk/middleware/runtime-factory.d.ts +42 -0
- package/dist/plugin-sdk/middleware/runtimes/claude.d.ts +4 -0
- package/dist/plugin-sdk/middleware/runtimes/codex.d.ts +5 -0
- package/dist/plugin-sdk/middleware/runtimes/gemini.d.ts +4 -0
- package/dist/plugin-sdk/middleware/runtimes/opencode.d.ts +5 -0
- package/dist/plugin-sdk/middleware/types.d.ts +41 -1
- package/dist/plugin-sdk/plugins/types.d.ts +1 -1
- package/dist/plugin-sdk/stt/defaults.d.ts +2 -0
- package/dist/plugin-sdk/stt/preflight.d.ts +16 -0
- package/dist/plugin-sdk/stt/providers/deepgram/audio.d.ts +4 -0
- package/dist/plugin-sdk/stt/providers/deepgram/index.d.ts +2 -0
- package/dist/plugin-sdk/stt/providers/google/audio.d.ts +3 -0
- package/dist/plugin-sdk/stt/providers/google/index.d.ts +2 -0
- package/dist/plugin-sdk/stt/providers/groq/index.d.ts +2 -0
- package/dist/plugin-sdk/stt/providers/index.d.ts +4 -0
- package/dist/plugin-sdk/stt/providers/mistral/index.d.ts +2 -0
- package/dist/plugin-sdk/stt/providers/openai/audio.d.ts +3 -0
- package/dist/plugin-sdk/stt/providers/openai/index.d.ts +2 -0
- package/dist/plugin-sdk/stt/providers/shared.d.ts +1 -0
- package/dist/plugin-sdk/stt/stt.d.ts +27 -0
- package/dist/plugin-sdk/stt/types.d.ts +22 -0
- package/dist/plugin-sdk/terminal/palette.d.ts +2 -2
- package/dist/plugin-sdk/tts/tts.d.ts +3 -3
- package/dist/plugins-7B167wIj.js +453 -0
- package/dist/plugins-BRHOfy1Z.js +455 -0
- package/dist/plugins-cli-BvRGvufE.js +797 -0
- package/dist/plugins-cli-aI4bjnQ4.js +801 -0
- package/dist/ports-CAqyeQYZ.js +316 -0
- package/dist/ports-CTUgXF2d.js +96 -0
- package/dist/ports-DLPAW42A.js +96 -0
- package/dist/ports-DqfnVnCw.js +370 -0
- package/dist/preflight-Bj0s82gR.js +64 -0
- package/dist/preflight-x_CMwa17.js +68 -0
- package/dist/program-COwy4sJS.js +248 -0
- package/dist/program-context-D9cxxxLY.js +474 -0
- package/dist/progress-BOdRbOHD.js +124 -0
- package/dist/prompt-WEkXwIMT.js +21 -0
- package/dist/prompt-select-styled-6MqsW5bZ.js +1648 -0
- package/dist/prompt-select-styled-uxLmoEua.js +1651 -0
- package/dist/prompt-style-B4Cq4PyQ.js +9 -0
- package/dist/provider-dispatcher-Cy2Isoz1.js +659 -0
- package/dist/provider-dispatcher-I3K1YmY3.js +660 -0
- package/dist/push-apns-KJ97wv09.js +713 -0
- package/dist/push-apns-NnGGNBCY.js +711 -0
- package/dist/pw-ai-CnN2sITD.js +1908 -0
- package/dist/pw-ai-fnX3cecw.js +1911 -0
- package/dist/qr-cli-B7LLp7Uo.js +353 -0
- package/dist/qr-cli-CcvOgLQ1.js +349 -0
- package/dist/redact-gXuh8MFk.js +191 -0
- package/dist/redact-snapshot-CuSk1PiF.js +2016 -0
- package/dist/redact-snapshot-DsfhbREd.js +2016 -0
- package/dist/register.agent-B0aT5KAm.js +290 -0
- package/dist/register.agent-DbTAbTF7.js +1018 -0
- package/dist/register.configure-Bg5pK0p7.js +128 -0
- package/dist/register.configure-DHm-bmFr.js +133 -0
- package/dist/register.import-C059WtC6.js +31 -0
- package/dist/register.import-DHOWhJbR.js +29 -0
- package/dist/register.maintenance-CBdNBh2k.js +500 -0
- package/dist/register.maintenance-_jnyzREO.js +498 -0
- package/dist/register.message-BhkqTcxt.js +685 -0
- package/dist/register.message-CTj5j1Gh.js +689 -0
- package/dist/register.onboard-6RmDaVze.js +261 -0
- package/dist/register.onboard-DFcMuO4e.js +265 -0
- package/dist/register.setup-BhAJcFcx.js +117 -0
- package/dist/register.setup-BpQpGPcS.js +113 -0
- package/dist/register.status-health-sessions-BDDOQjxJ.js +668 -0
- package/dist/register.status-health-sessions-CqUJ7FNe.js +428 -0
- package/dist/register.subclis-VFXvj7dx.js +267 -0
- package/dist/replies-B58ewStm.js +136 -0
- package/dist/replies-LSx_XhsP.js +136 -0
- package/dist/reply-BY4A8j7Z.js +13715 -0
- package/dist/reply-C1ydfb_h.js +13718 -0
- package/dist/reply-directives-Cz7622Qx.js +182 -0
- package/dist/reply-directives-ssnaPNiU.js +182 -0
- package/dist/reply-payloads-CQMtrphw.js +527 -0
- package/dist/reply-prefix-CWcAZKhE.js +37 -0
- package/dist/reply-prefix-Drq7Pf3A.js +37 -0
- package/dist/resolve-route-B8uIc2H3.js +249 -0
- package/dist/resolve-route-C8ooNlI4.js +249 -0
- package/dist/response-prefix-template-D3ZcJP4E.js +134 -0
- package/dist/response-prefix-template-DPOggmPO.js +134 -0
- package/dist/retry-B19gMxS7.js +77 -0
- package/dist/retry-BMUvSHT-.js +77 -0
- package/dist/run-main-BwtU9LeR.js +306 -0
- package/dist/runner-BQat0D_4.js +2394 -0
- package/dist/runner-CzEWYvcp.js +2394 -0
- package/dist/runtime-guard-CK80eucm.js +60 -0
- package/dist/runtime-status-CM4rzyfO.js +12 -0
- package/dist/runtime-status-CcDMsddE.js +12 -0
- package/dist/secure-random-pF_q3xhf.js +44 -0
- package/dist/security-cli-CPPCeteZ.js +487 -0
- package/dist/security-cli-dGXRUT_F.js +482 -0
- package/dist/send-9Huf62k3.js +2245 -0
- package/dist/send-B9mIJdUo.js +547 -0
- package/dist/send-C7lqywdv.js +374 -0
- package/dist/send-CXj20hiJ.js +332 -0
- package/dist/send-C_RLMTgb.js +11 -0
- package/dist/send-Casi9Q0G.js +492 -0
- package/dist/send-ChvasRSh.js +1779 -0
- package/dist/send-CwcHjhXw.js +426 -0
- package/dist/send-DAEzDqyo.js +547 -0
- package/dist/send-DT-HD0B8.js +1776 -0
- package/dist/send-DWf7BCPe.js +492 -0
- package/dist/send-Dd2_MykI.js +2245 -0
- package/dist/send-DheZejq2.js +29 -0
- package/dist/send-Dt4C-KXH.js +349 -0
- package/dist/send-eIbBsLlB.js +1174 -0
- package/dist/send-vvZXksNU.js +349 -0
- package/dist/server-BrzR9JmX.js +206 -0
- package/dist/server-_h27-uP_.js +202 -0
- package/dist/server-lifecycle-CUdA6Far.js +2437 -0
- package/dist/server-lifecycle-DQZWL8iP.js +2437 -0
- package/dist/server-node-events-6XFKuq3Y.js +392 -0
- package/dist/server-node-events-D29jcNbz.js +396 -0
- package/dist/service-Z0W9IHDW.js +670 -0
- package/dist/service-aV0YmkBw.js +670 -0
- package/dist/session-BIAOl5QR.js +170 -0
- package/dist/session-Wu00pCn_.js +170 -0
- package/dist/session-cost-usage-7plmOKbs.js +627 -0
- package/dist/session-cost-usage-CPFxBFUg.js +627 -0
- package/dist/session-dirs-BLLxW3ZS.js +318 -0
- package/dist/session-dirs-CVihy8Ai.js +318 -0
- package/dist/session-utils-90yswubs.js +622 -0
- package/dist/session-utils-D8GljJ55.js +622 -0
- package/dist/sessions-ZRmCDdj1.js +2569 -0
- package/dist/sessions-usKmYetT.js +247 -0
- package/dist/shell-env-DBS5su07.js +163 -0
- package/dist/shell-env-DYZq9PqC.js +163 -0
- package/dist/ssrf-B-rF_tZB.js +183 -0
- package/dist/ssrf-DJW14Wkh.js +183 -0
- package/dist/status-B1RE8YnT.js +1979 -0
- package/dist/status-Dy4u3bpY.js +1983 -0
- package/dist/status.update-B96J4HaE.js +449 -0
- package/dist/status.update-BjBbgwxn.js +449 -0
- package/dist/store-B5989JkX.js +64 -0
- package/dist/store-DCrrxHyS.js +2571 -0
- package/dist/store-IFJqgD2Q.js +53 -0
- package/dist/store-Ql6vAcsg.js +64 -0
- package/dist/subagent-registry-BGknZEUI.js +4856 -0
- package/dist/subagent-registry-CGhMOYVx.js +4854 -0
- package/dist/subsystem-PQ64_nsu.js +1136 -0
- package/dist/subsystem-SgROXN1v.js +1079 -0
- package/dist/system-cli-Cfk2ankT.js +77 -0
- package/dist/system-cli-feOkmeNQ.js +73 -0
- package/dist/systemd-B6BCzznn.js +547 -0
- package/dist/systemd-BhQdjwJw.js +547 -0
- package/dist/systemd-hints-B8d0fce2.js +278 -0
- package/dist/systemd-hints-C5dlAJ5Z.js +278 -0
- package/dist/systemd-linger-B42HZhnk.js +75 -0
- package/dist/systemd-linger-D1Jtwxar.js +75 -0
- package/dist/table-CzC1hpWo.js +279 -0
- package/dist/tables-CO_kxD0e.js +55 -0
- package/dist/tables-Du1Gu0aG.js +55 -0
- package/dist/tables-WZp8Vt9n.js +55 -0
- package/dist/tailnet-CfZhpSnt.js +40 -0
- package/dist/tailnet-D0NV0tRJ.js +40 -0
- package/dist/tailscale-B__xvMjA.js +230 -0
- package/dist/tailscale-q_ZrxUCc.js +230 -0
- package/dist/targets-B4rMyQFJ.js +53 -0
- package/dist/targets-BHYLCv06.js +2534 -0
- package/dist/targets-BjWhDMJM.js +650 -0
- package/dist/targets-CHwGDIgO.js +650 -0
- package/dist/targets-DkmiOlPe.js +220 -0
- package/dist/targets-bqjVeCnF.js +2535 -0
- package/dist/targets-mqj9GNg1.js +53 -0
- package/dist/targets-tDrl_ioQ.js +46 -0
- package/dist/thinking-BqJmU6Zp.js +88 -0
- package/dist/thinking-l-rrvZwu.js +88 -0
- package/dist/tokens-DAFBx5qr.js +21 -0
- package/dist/tool-display-C0hpLmkw.js +785 -0
- package/dist/tool-display-CQTRHo3Z.js +785 -0
- package/dist/tool-images-BYY11Gw3.js +263 -0
- package/dist/tool-images-CnJ0R8Fo.js +263 -0
- package/dist/trash-C0mjnHuW.js +125 -0
- package/dist/trash-Cgwc9mLD.js +125 -0
- package/dist/tui-DmstEnnX.js +3282 -0
- package/dist/tui-Dngv7ykt.js +3282 -0
- package/dist/tui-cli-D2dJs5Fl.js +62 -0
- package/dist/tui-cli-azwehnLo.js +66 -0
- package/dist/update-B7nMMqp1.js +349 -0
- package/dist/update-C1-XOYtz.js +349 -0
- package/dist/update-cli-BmI_TMNi.js +1147 -0
- package/dist/update-cli-BxtNSw_X.js +1145 -0
- package/dist/usage-BOEcX9lB.js +5448 -0
- package/dist/utils-C5daYcFn.js +631 -0
- package/dist/version-3QUZW8EP.js +52 -0
- package/dist/version-CVMnqdzu.js +52 -0
- package/dist/web-CSur3l1X.js +74 -0
- package/dist/web-DABJ4byB.js +79 -0
- package/dist/web-Dkbd0w1V.js +3070 -0
- package/dist/webhooks-cli-CzSeHHov.js +334 -0
- package/dist/webhooks-cli-DDeU_DV5.js +330 -0
- package/dist/whatsapp-actions-3NdzsNg1.js +130 -0
- package/dist/whatsapp-actions-y_1vjkYY.js +125 -0
- package/dist/widearea-dns-BNFRmJwa.js +127 -0
- package/dist/workspace-DW1ofNbI.js +447 -0
- package/dist/workspace-aStQsS6k.js +449 -0
- package/dist/zod-schema-CbqZAIYy.js +2696 -0
- package/dist/zod-schema-YGQJEcnj.js +2696 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +0 -24
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +0 -1
- package/package.json +4 -5
- package/dist/accounts-BFy_Z3od.js +0 -272
- package/dist/accounts-BTXSfPWi.js +0 -270
- package/dist/accounts-BxGS70Do.js +0 -36
- package/dist/accounts-CNY1TGj1.js +0 -47
- package/dist/accounts-DqRQ75w3.js +0 -36
- package/dist/accounts-DsVLU34G.js +0 -32
- package/dist/accounts-iODF3SK2.js +0 -47
- package/dist/ack-reactions-C1hk85VE.js +0 -446
- package/dist/ack-reactions-DRC2CiDQ.js +0 -446
- package/dist/acp-cli-DD-PD4NM.js +0 -1326
- package/dist/acp-cli-DIyRCOum.js +0 -1320
- package/dist/active-listener-VzhWW8W6.js +0 -37
- package/dist/active-listener-z0qVEcom.js +0 -37
- package/dist/agent-D2HeDFFR.js +0 -731
- package/dist/agent-Da_eZ5BP.js +0 -732
- package/dist/agent-helpers-B6VfZ9_u.js +0 -606
- package/dist/agent-helpers-CTx5KKJu.js +0 -606
- package/dist/agent-scope-BqPmD-Ax.js +0 -114
- package/dist/agent-scope-DgQzamQB.js +0 -116
- package/dist/agents-TB3QpHoo.js +0 -788
- package/dist/agents.config-BsAQTYe1.js +0 -116
- package/dist/agents.config-C9fyYfAh.js +0 -116
- package/dist/ansi-D04X81yq.js +0 -14
- package/dist/audio-DPOuhNq7.js +0 -43
- package/dist/audio-VBcVDa08.js +0 -43
- package/dist/audio-preflight-CK3EA3Dv.js +0 -69
- package/dist/audio-preflight-tdXtrutj.js +0 -64
- package/dist/audit-CJipUWDi.js +0 -3138
- package/dist/audit-COWzB9Y1.js +0 -3138
- package/dist/auth-CAczFgAO.js +0 -448
- package/dist/auth-Deh9i9Eg.js +0 -448
- package/dist/auth-profiles-BquJGKLC.js +0 -279
- package/dist/auth-profiles-D8vKiBPq.js +0 -281
- package/dist/banner-CUWBOR42.js +0 -294
- package/dist/binaries-DXW6oATV.js +0 -13
- package/dist/bindings-8YtSWb91.js +0 -69
- package/dist/bindings-l1R5LQQH.js +0 -69
- package/dist/bonjour-discovery-DdAk1VyO.js +0 -378
- package/dist/bonjour-discovery-DuhiIZZx.js +0 -378
- package/dist/browser-cli-5Q9lhGdd.js +0 -1687
- package/dist/browser-cli-D2qMeSx1.js +0 -1692
- package/dist/call-CZHVeMf1.js +0 -2828
- package/dist/call-CoMjY7ah.js +0 -2829
- package/dist/catalog-CYiAleBT.js +0 -185
- package/dist/catalog-pjPqB2hC.js +0 -185
- package/dist/channel-account-context-CvIDAtHS.js +0 -550
- package/dist/channel-account-context-q-o0pG1A.js +0 -550
- package/dist/channel-activity-BaCNOZpP.js +0 -94
- package/dist/channel-activity-DSr3jFkv.js +0 -292
- package/dist/channel-activity-DTKGf3j5.js +0 -94
- package/dist/channel-options-8SjIcDDI.js +0 -33
- package/dist/channel-options-BtQGtMF4.js +0 -32
- package/dist/channel-selection-C4DzrynU.js +0 -51
- package/dist/channel-selection-DdfhwFuY.js +0 -51
- package/dist/channel-web-BKJSXnwf.js +0 -2136
- package/dist/channel-web-BUzvNE_A.js +0 -2134
- package/dist/channels-cli-CCXY796Z.js +0 -1421
- package/dist/channels-cli-DTfx1zFC.js +0 -1426
- package/dist/channels-status-issues-DnmuqPsi.js +0 -18
- package/dist/channels-status-issues-p1pCvTh8.js +0 -18
- package/dist/chat-envelope-DEZ-5RY8.js +0 -248
- package/dist/chat-envelope-el7Uo-Fe.js +0 -248
- package/dist/chrome-Dd4dv0Vh.js +0 -1732
- package/dist/chrome-DdNEInwI.js +0 -1733
- package/dist/chunk-CSQfUhgF.js +0 -341
- package/dist/chunk-D0Y_w4oX.js +0 -341
- package/dist/clack-prompter-B7tOxhJd.js +0 -122
- package/dist/clack-prompter-CCFnKP_1.js +0 -121
- package/dist/cleanup-utils-CqAVZz2b.js +0 -94
- package/dist/cli-BRwDPW0r.js +0 -125
- package/dist/cli-CV86F7iv.js +0 -130
- package/dist/clipboard-D7_SKHPK.js +0 -31
- package/dist/clipboard-Dzkx6Q2K.js +0 -31
- package/dist/command-format-CVfo8I5f.js +0 -18
- package/dist/command-format-DgXcqxBt.js +0 -32
- package/dist/command-registry-BvLC28b4.js +0 -215
- package/dist/commands-B49Lu-pa.js +0 -41
- package/dist/commands-DI1BCqnj.js +0 -41
- package/dist/commands-registry-Cr6SIR3n.js +0 -892
- package/dist/commands-registry-agiTEGDz.js +0 -893
- package/dist/common-CMI-qsF8.js +0 -156
- package/dist/common-DSVmydhm.js +0 -156
- package/dist/completion-cli-C7O4JU8t.js +0 -452
- package/dist/completion-cli-CQNXtEJ7.js +0 -452
- package/dist/config-ChYRSJQt.js +0 -6953
- package/dist/config-CwtWvygh.js +0 -6951
- package/dist/config-cli-Df5nJcfO.js +0 -241
- package/dist/config-cli-Dqe5O1pl.js +0 -246
- package/dist/config-guard-C6hyuH-z.js +0 -75
- package/dist/config-guard-kNMQS_tm.js +0 -97
- package/dist/config-validation-BZBaBH69.js +0 -18
- package/dist/config-validation-DkrbzCyL.js +0 -18
- package/dist/configure-CoJmCHqT.js +0 -891
- package/dist/configure-DJbojDRf.js +0 -889
- package/dist/constants-BmRFoHl0.js +0 -67
- package/dist/constants-C9WPAluB.js +0 -67
- package/dist/control-auth-7k6Cb2zH.js +0 -397
- package/dist/control-auth-DBxfkJ3g.js +0 -397
- package/dist/control-ui/assets/index-B4ZM1lW1.js +0 -7738
- package/dist/control-ui/assets/index-B4ZM1lW1.js.map +0 -1
- package/dist/control-ui/assets/index-PED72sKF.css +0 -1
- package/dist/control-ui-assets-Cx_mw4D0.js +0 -186
- package/dist/control-ui-assets-W1AUuGrO.js +0 -186
- package/dist/conversation-label-C4SDz4sT.js +0 -36
- package/dist/conversation-label-D1frnvYe.js +0 -36
- package/dist/cron-cli-BJXQKtR3.js +0 -495
- package/dist/cron-cli-CTIj0WPW.js +0 -490
- package/dist/daemon-cli-CZbHvkRG.js +0 -1197
- package/dist/daemon-cli-Cf_YKWvV.js +0 -1199
- package/dist/daemon-install-CcohRvKV.js +0 -55
- package/dist/daemon-install-DDshfT0J.js +0 -60
- package/dist/daemon-install-helpers-CFGAfRlj.js +0 -462
- package/dist/daemon-install-helpers-DIUzSFG1.js +0 -462
- package/dist/defaults-B5KStIBg.js +0 -7
- package/dist/defaults-xUAL2Z-F.js +0 -7
- package/dist/deliver-BDf2lIEK.js +0 -481
- package/dist/deliver-DvmkSwLt.js +0 -481
- package/dist/delivery-queue-Cfa9Wmxp.js +0 -244
- package/dist/delivery-queue-CxVRi4tw.js +0 -244
- package/dist/devices-cli-CRsW5WOw.js +0 -316
- package/dist/devices-cli-Crzrk5uf.js +0 -321
- package/dist/diagnostics-99iCgBUh.js +0 -46
- package/dist/diagnostics-VC0cz7kX.js +0 -46
- package/dist/directory-cli-BnoQqeOX.js +0 -222
- package/dist/directory-cli-DdBAX3AV.js +0 -217
- package/dist/dm-policy-shared-DNqPbnip.js +0 -22
- package/dist/dm-policy-shared-vCb_hnqo.js +0 -22
- package/dist/dns-cli-D410XQr9.js +0 -197
- package/dist/dns-cli-Fgg96Xkg.js +0 -202
- package/dist/dock-DXSgTbDw.js +0 -928
- package/dist/dock-FtQwUHXE.js +0 -929
- package/dist/doctor-completion-BWmtCiFR.js +0 -92
- package/dist/doctor-completion-DTM_wDxy.js +0 -92
- package/dist/doctor-config-flow-Ccna5fPs.js +0 -1934
- package/dist/doctor-config-flow-DqzrK_jh.js +0 -1933
- package/dist/enable-DcJnkzfz.js +0 -59
- package/dist/enable-ibNq4UWy.js +0 -59
- package/dist/env-DeF64iu0.js +0 -60
- package/dist/env-vars-7aZqKPhk.js +0 -93
- package/dist/env-vars-CLGbxdpL.js +0 -93
- package/dist/errors-8F-77i6m.js +0 -35
- package/dist/errors-DZ199hOo.js +0 -35
- package/dist/exec-DbKuYyM1.js +0 -164
- package/dist/exec-DkFE7lqU.js +0 -164
- package/dist/fetch-C6XKGA11.js +0 -67
- package/dist/fetch-CEDsOiql.js +0 -67
- package/dist/fetch-Cw7cgstX.js +0 -67
- package/dist/file-lock-CIvloidc.js +0 -107
- package/dist/file-lock-CzBL_VIx.js +0 -107
- package/dist/fs-safe-DSwT85uK.js +0 -88
- package/dist/fs-safe-DkBhNAc3.js +0 -98
- package/dist/gateway-cli-BJooqlkO.js +0 -23747
- package/dist/gateway-cli-C2wPjxY4.js +0 -23742
- package/dist/gateway-rpc-BcT4FqJQ.js +0 -28
- package/dist/gateway-rpc-DhKAJ5EW.js +0 -28
- package/dist/gmail-setup-utils-Cnx8A5pW.js +0 -422
- package/dist/gmail-setup-utils-nkabbKOE.js +0 -423
- package/dist/health-BZX-PyP0.js +0 -1420
- package/dist/health-BgD0koJx.js +0 -1423
- package/dist/health-format-BG95OE6N.js +0 -28
- package/dist/heartbeat-visibility-DeW9EIeS.js +0 -125
- package/dist/heartbeat-visibility-DvogUlnZ.js +0 -125
- package/dist/help-format-DAxf0l_h.js +0 -17
- package/dist/helpers-R7bU5IBz.js +0 -10
- package/dist/helpers-kkeXif0Q.js +0 -10
- package/dist/hook-runner-global-cyaKukZP.js +0 -527
- package/dist/hooks-cli-DTygpzqS.js +0 -1217
- package/dist/hooks-cli-Dg853OdZ.js +0 -1222
- package/dist/host-env-security-Bms2_EMV.js +0 -92
- package/dist/host-env-security-szwfmhC4.js +0 -92
- package/dist/image-ops-Bi6JPSkD.js +0 -354
- package/dist/image-ops-DWytvdh_.js +0 -354
- package/dist/import-D8BBZQgl.js +0 -170
- package/dist/import-DQ6NI4Fz.js +0 -168
- package/dist/inbound-context-CPkkQW0i.js +0 -68
- package/dist/inbound-context-DS_kpIYI.js +0 -68
- package/dist/inbound-path-policy-Bg4gZBx-.js +0 -250
- package/dist/inbound-path-policy-sdr5Ji0k.js +0 -250
- package/dist/inspect-Dt8hogS3.js +0 -559
- package/dist/inspect-vYIL1oA0.js +0 -559
- package/dist/installs-ClX3qQmh.js +0 -325
- package/dist/installs-CxjOiLUM.js +0 -325
- package/dist/ipv4--2WXMVtE.js +0 -46
- package/dist/ipv4-CDQpx1A7.js +0 -46
- package/dist/ir-BvKdMuSP.js +0 -940
- package/dist/json-files-DzpTak5i.js +0 -46
- package/dist/links-C3soDNDH.js +0 -15
- package/dist/loader-BWZ_iRxI.js +0 -22624
- package/dist/loader-ClFP7wvS.js +0 -22621
- package/dist/local-roots-B6rSCu4U.js +0 -314
- package/dist/local-roots-v2HlOaG5.js +0 -313
- package/dist/logger-Bw3cFE5t.js +0 -49
- package/dist/logging-C-nxX2fn.js +0 -20
- package/dist/login-Cmpeb59f.js +0 -62
- package/dist/login-D1CV2eNF.js +0 -61
- package/dist/login-qr-B3tpFLRV.js +0 -327
- package/dist/login-qr-CSQzrtFX.js +0 -322
- package/dist/logs-cli-BSiUZwb2.js +0 -238
- package/dist/logs-cli-DDtoJ1Fr.js +0 -233
- package/dist/markdown-tables-PJUMrC4T.js +0 -29
- package/dist/markdown-tables-dDWBbtqd.js +0 -29
- package/dist/media-CBltNZ5U.js +0 -10492
- package/dist/media-DtN0R9A0.js +0 -940
- package/dist/message-action-names-Bs50Ia1g.js +0 -2521
- package/dist/message-action-names-Btd7cMvx.js +0 -2521
- package/dist/message-channel-DzJqHVZD.js +0 -91
- package/dist/message-channel-uWMAiywE.js +0 -91
- package/dist/net-Cg8AQeke.js +0 -225
- package/dist/net-D6D0wgcF.js +0 -225
- package/dist/node-cli-Q2-n3Fgv.js +0 -24
- package/dist/node-cli-Uf6lAntf.js +0 -24
- package/dist/nodes-cli-DVLvMgBV.js +0 -1343
- package/dist/nodes-cli-Dxf7vAKk.js +0 -1348
- package/dist/nodes-screen-BR9sYoPa.js +0 -250
- package/dist/nodes-screen-Cw7Hv7M2.js +0 -250
- package/dist/note-Dlv4NmlQ.js +0 -92
- package/dist/note-kvWV4xtw.js +0 -92
- package/dist/npm-registry-spec-0qiKawvv.js +0 -786
- package/dist/npm-registry-spec-COvUzy5J.js +0 -786
- package/dist/npm-resolution-DJnq5QBs.js +0 -86
- package/dist/npm-resolution-DVl2spoD.js +0 -86
- package/dist/onboard-BcQWYGY3.js +0 -405
- package/dist/onboard-RQ_FAMyg.js +0 -407
- package/dist/onboard-channels-CHh_BuxJ.js +0 -2547
- package/dist/onboard-channels-DXD-CK_M.js +0 -2548
- package/dist/onboard-config-BCTthQ7J.js +0 -24
- package/dist/onboard-config-y-2cgT0V.js +0 -24
- package/dist/onboard-helpers-BRMP8mup.js +0 -362
- package/dist/onboard-helpers-CUGbuZwH.js +0 -363
- package/dist/onboard-remote-D-qWujdL.js +0 -127
- package/dist/onboard-remote-o_OW-uzc.js +0 -127
- package/dist/onboarding-Bf9kVcef.js +0 -541
- package/dist/onboarding-CVlOLLp1.js +0 -543
- package/dist/onboarding.finalize-CQSt37fw.js +0 -398
- package/dist/onboarding.finalize-DggVL7Ay.js +0 -401
- package/dist/onboarding.gateway-config-BLca3Td2.js +0 -198
- package/dist/onboarding.gateway-config-C1mcOkRh.js +0 -191
- package/dist/outbound-DXXccLDS.js +0 -220
- package/dist/outbound-ZnVvUReT.js +0 -221
- package/dist/outbound-attachment-CfRb07J7.js +0 -18
- package/dist/outbound-attachment-DGXTtERK.js +0 -18
- package/dist/outbound-attachment-LWdiQLik.js +0 -18
- package/dist/pairing-cli-Bgm4fRA3.js +0 -127
- package/dist/pairing-cli-J0uGb1nU.js +0 -122
- package/dist/pairing-labels-CVm65Jkh.js +0 -9
- package/dist/pairing-labels-DD1mcvQG.js +0 -9
- package/dist/pairing-store-5qapT5-t.js +0 -460
- package/dist/pairing-store-MLceBEeL.js +0 -459
- package/dist/path-env-DR5vn3QL.js +0 -89
- package/dist/path-env-qRJbjJzj.js +0 -89
- package/dist/path-safety-DkT9RmTG.js +0 -14
- package/dist/path-safety-juI2XbO1.js +0 -14
- package/dist/plugin-auto-enable-BUSF117F.js +0 -301
- package/dist/plugin-auto-enable-CoDnqA0S.js +0 -302
- package/dist/plugin-registry-D2B6nbn1.js +0 -33
- package/dist/plugin-registry-fLaMC0ik.js +0 -33
- package/dist/plugin-sdk/agents/agent-helpers/thinking.d.ts +0 -5
- package/dist/plugin-sdk/agents/agent-paths.d.ts +0 -1
- package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +0 -16
- package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +0 -7
- package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +0 -8
- package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +0 -14
- package/dist/plugin-sdk/agents/auth-profiles/paths.d.ts +0 -4
- package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +0 -12
- package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +0 -18
- package/dist/plugin-sdk/agents/auth-profiles/store.d.ts +0 -10
- package/dist/plugin-sdk/agents/auth-profiles/types.d.ts +0 -13
- package/dist/plugin-sdk/agents/auth-profiles.d.ts +0 -8
- package/dist/plugin-sdk/agents/defaults.d.ts +0 -3
- package/dist/plugin-sdk/agents/provider-auth.d.ts +0 -40
- package/dist/plugin-sdk/auto-reply/model-runtime.d.ts +0 -17
- package/dist/plugin-sdk/config/model-input.d.ts +0 -9
- package/dist/plugin-sdk/config/zod-schema.agent-model.d.ts +0 -5
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +0 -16
- package/dist/plugin-sdk/sessions/model-overrides.d.ts +0 -14
- package/dist/plugin-sdk/telegram/reasoning-lane-coordinator.d.ts +0 -18
- package/dist/plugins-CsYMlnVa.js +0 -455
- package/dist/plugins-Dhit-VHt.js +0 -453
- package/dist/plugins-cli-BwuvKtN-.js +0 -798
- package/dist/plugins-cli-D34k2VsI.js +0 -793
- package/dist/ports-DrruB2fK.js +0 -370
- package/dist/ports-GT1yV-Tg.js +0 -96
- package/dist/ports-NPqtlfp0.js +0 -316
- package/dist/ports-QMI4-F9m.js +0 -96
- package/dist/program-C5ukTU6N.js +0 -244
- package/dist/program-context-D55P0vBV.js +0 -474
- package/dist/progress-CBkSaM6z.js +0 -124
- package/dist/prompt-Bllj1dhc.js +0 -21
- package/dist/prompt-select-styled-WStiI-bz.js +0 -1647
- package/dist/prompt-select-styled-ram-aXWu.js +0 -1650
- package/dist/prompt-style-DVEm3BZW.js +0 -9
- package/dist/provider-dispatcher-epFKwpGK.js +0 -659
- package/dist/provider-dispatcher-vEBMmwZ0.js +0 -660
- package/dist/push-apns-C0LyG-WB.js +0 -713
- package/dist/push-apns-DuG95AKC.js +0 -711
- package/dist/pw-ai-TygsEDgY.js +0 -1906
- package/dist/pw-ai-eS0sIkZo.js +0 -1910
- package/dist/qr-cli-B8sYhugo.js +0 -352
- package/dist/qr-cli-yP8i4Iv1.js +0 -347
- package/dist/redact-eZq1uwNK.js +0 -191
- package/dist/redact-snapshot-gOLgfKp3.js +0 -2028
- package/dist/redact-snapshot-uT-CXbM8.js +0 -2028
- package/dist/register.agent-CSoigVGq.js +0 -1043
- package/dist/register.agent-GZLrbUPm.js +0 -286
- package/dist/register.configure-CXpiRohq.js +0 -124
- package/dist/register.configure-RaqiHe5L.js +0 -130
- package/dist/register.import-Bs-UkOs-.js +0 -27
- package/dist/register.import-DLng8g-e.js +0 -30
- package/dist/register.maintenance-B-ZLQ56Y.js +0 -494
- package/dist/register.maintenance-Bjr_SmG9.js +0 -497
- package/dist/register.message-BCQ8Vg4O.js +0 -686
- package/dist/register.message-ChhiSr7g.js +0 -681
- package/dist/register.onboard-DJCqNufv.js +0 -257
- package/dist/register.onboard-jlxjsrv6.js +0 -262
- package/dist/register.setup-C-sdixz5.js +0 -114
- package/dist/register.setup-Dwpe4ArC.js +0 -109
- package/dist/register.status-health-sessions-BWFRHBCZ.js +0 -669
- package/dist/register.status-health-sessions-D7noMz9y.js +0 -423
- package/dist/register.subclis-DFI5u4a6.js +0 -267
- package/dist/replies-Bzcj-R8d.js +0 -136
- package/dist/replies-uvTI-4lg.js +0 -136
- package/dist/reply-B9qz9Wwk.js +0 -13897
- package/dist/reply-CmGAXQKc.js +0 -13900
- package/dist/reply-directives-Be97YiyM.js +0 -182
- package/dist/reply-directives-DsLughUT.js +0 -182
- package/dist/reply-payloads-DW0YgT82.js +0 -527
- package/dist/reply-prefix-BzoT8h8o.js +0 -38
- package/dist/reply-prefix-CSaiVnkC.js +0 -38
- package/dist/resolve-route-2P40JKXk.js +0 -249
- package/dist/resolve-route-_CwEKLq6.js +0 -249
- package/dist/response-prefix-template-BAlvtSjL.js +0 -136
- package/dist/response-prefix-template-D-tls8tI.js +0 -136
- package/dist/retry-BhuXOEVR.js +0 -77
- package/dist/retry-bEaU56Ma.js +0 -77
- package/dist/run-main-B-O5ZtbU.js +0 -320
- package/dist/runner-DGkTSlOS.js +0 -2294
- package/dist/runner-hs4uxAUP.js +0 -2294
- package/dist/runtime-DJNp29jv.js +0 -94
- package/dist/runtime-guard-DZ_xuCc4.js +0 -60
- package/dist/secure-random-HdKbfH_R.js +0 -44
- package/dist/security-cli-1iY1lW6F.js +0 -484
- package/dist/security-cli-BuiPPQYU.js +0 -478
- package/dist/send-3lgWtHHf.js +0 -349
- package/dist/send-9NV7sSlD.js +0 -2245
- package/dist/send-B0TcjZUD.js +0 -1778
- package/dist/send-Bb6K_10X.js +0 -2245
- package/dist/send-Caz-txXK.js +0 -492
- package/dist/send-CnalbSF4.js +0 -426
- package/dist/send-DJEr4rP6.js +0 -547
- package/dist/send-DJiDHXsu.js +0 -349
- package/dist/send-DOjg7kJj.js +0 -1775
- package/dist/send-DYNAIWyP.js +0 -11
- package/dist/send-Dc_K995l.js +0 -547
- package/dist/send-DoP0H-N6.js +0 -29
- package/dist/send-DuYZwoY8.js +0 -332
- package/dist/send-_gen0ZTz.js +0 -374
- package/dist/send-iPAfbiYM.js +0 -492
- package/dist/send-z_IcqJ2I.js +0 -1174
- package/dist/server-B0IC-Osg.js +0 -205
- package/dist/server-MccRxMpb.js +0 -200
- package/dist/server-lifecycle-C_0CfoP7.js +0 -2437
- package/dist/server-lifecycle-IKdGw1kM.js +0 -2437
- package/dist/server-node-events-Czr2gXp_.js +0 -393
- package/dist/server-node-events-DFG6cXud.js +0 -398
- package/dist/service-Bjqii5nW.js +0 -670
- package/dist/service-fp29z5Ww.js +0 -670
- package/dist/session-DBL5nHDy.js +0 -170
- package/dist/session-cost-usage-DX09eTPU.js +0 -627
- package/dist/session-cost-usage-yYi525j3.js +0 -627
- package/dist/session-dirs-Cj5xi7zX.js +0 -947
- package/dist/session-dirs-DdF6TDsE.js +0 -947
- package/dist/session-utils-C7BtKlun.js +0 -625
- package/dist/session-utils-CLe1dano.js +0 -625
- package/dist/session-xKIW6gL2.js +0 -170
- package/dist/sessions-C65iUuN9.js +0 -2593
- package/dist/sessions-DjZ9IshB.js +0 -252
- package/dist/ssrf-Ck9HDZpv.js +0 -183
- package/dist/ssrf-m7kFIobZ.js +0 -183
- package/dist/status-C6ghjxvX.js +0 -2072
- package/dist/status-D-qTB8aZ.js +0 -2068
- package/dist/status.update-C55QM2xs.js +0 -79
- package/dist/status.update-CBmPXwYN.js +0 -79
- package/dist/store-BoOkbDvD.js +0 -53
- package/dist/store-C3tOpizT.js +0 -64
- package/dist/store-uRA67h-o.js +0 -2595
- package/dist/store-v3P-OWhi.js +0 -64
- package/dist/subagent-registry-BTG1aAZ8.js +0 -4860
- package/dist/subagent-registry-CoclNL5c.js +0 -4858
- package/dist/subsystem-COd61u0P.js +0 -1139
- package/dist/subsystem-Ca1UHeYu.js +0 -1079
- package/dist/system-cli-C__5QOMX.js +0 -70
- package/dist/system-cli-Dr4XoVTq.js +0 -75
- package/dist/systemd-DSnlM3jX.js +0 -547
- package/dist/systemd-TfK8GuTx.js +0 -547
- package/dist/systemd-linger-Axnc1xCb.js +0 -75
- package/dist/systemd-linger-_0_-RY4v.js +0 -75
- package/dist/table-DPTzZyhu.js +0 -279
- package/dist/tables-B-tpO28w.js +0 -55
- package/dist/tables-BQ-CvUfT.js +0 -55
- package/dist/tables-D3zdgEuK.js +0 -55
- package/dist/tailnet-CEudzG0i.js +0 -40
- package/dist/tailnet-PnMrjwGT.js +0 -40
- package/dist/tailscale-DTATQxAG.js +0 -230
- package/dist/tailscale-Dbyahx0J.js +0 -230
- package/dist/targets-B_0Y1i-1.js +0 -2173
- package/dist/targets-CP4YmCK4.js +0 -220
- package/dist/targets-CTmhieRB.js +0 -650
- package/dist/targets-CcTME3bp.js +0 -46
- package/dist/targets-CmC5m7Ey.js +0 -53
- package/dist/targets-DtiQgjEL.js +0 -2172
- package/dist/targets-DyybKefq.js +0 -53
- package/dist/targets-rDolm5YS.js +0 -650
- package/dist/tokens-DzFOtLlW.js +0 -21
- package/dist/tool-display-Br6mwaJc.js +0 -785
- package/dist/tool-display-sgNwLOBj.js +0 -785
- package/dist/tool-images-BNfIJ_Kj.js +0 -263
- package/dist/tool-images-kloBqxqK.js +0 -263
- package/dist/trash-DPi0aCCQ.js +0 -125
- package/dist/trash-D_Jd_yQZ.js +0 -125
- package/dist/tui-BSDCI2hh.js +0 -3392
- package/dist/tui-DT7hLOBk.js +0 -3392
- package/dist/tui-cli-DUWvLaoG.js +0 -58
- package/dist/tui-cli-Dn2iXQTO.js +0 -63
- package/dist/update-Bgl3Pk2N.js +0 -349
- package/dist/update-CFPFib4P.js +0 -349
- package/dist/update-cli-DSDSQ2Xi.js +0 -1373
- package/dist/update-cli-DYR_7NLy.js +0 -1370
- package/dist/usage-84J5-IJT.js +0 -5279
- package/dist/utils-LBKvDoPx.js +0 -631
- package/dist/web-BECD5Akw.js +0 -70
- package/dist/web-CfORbnPQ.js +0 -3065
- package/dist/web-KP-TI2sO.js +0 -76
- package/dist/webhooks-cli-BqoG_i-D.js +0 -328
- package/dist/webhooks-cli-Ddu7dfdE.js +0 -333
- package/dist/whatsapp-actions-BZLIjQ8J.js +0 -122
- package/dist/whatsapp-actions-KCc1vHN5.js +0 -128
- package/dist/widearea-dns-DSoaA-eH.js +0 -127
- package/dist/workspace-4EaHHEWi.js +0 -447
- package/dist/workspace-B_1t_yq3.js +0 -449
- /package/dist/{account-lookup-0KDSp5Mj.js → account-lookup-BOCzCnir.js} +0 -0
- /package/dist/{account-lookup-zvANGr2x.js → account-lookup-C0ndrpt-.js} +0 -0
- /package/dist/{api-BeQMq2iS.js → api-BRGaT2rg.js} +0 -0
- /package/dist/{api-CxX8-gGz.js → api-CUkn9zpm.js} +0 -0
- /package/dist/{argv-Co-b9Zsc.js → argv-BY8EVMTP.js} +0 -0
- /package/dist/{brew-DbSbN8sD.js → brew-CmTYeZk1.js} +0 -0
- /package/dist/{brew-C4zKZsHX.js → brew-V4lMBeE3.js} +0 -0
- /package/dist/{chat-type-CYPyHAj-.js → chat-type-CH3W-zKy.js} +0 -0
- /package/dist/{chat-type-DKb2TlGZ.js → chat-type-DyovJwCt.js} +0 -0
- /package/dist/{cleanup-utils-CwQvD73q.js → cleanup-utils-CJ_R9s8l.js} +0 -0
- /package/dist/{cli-name-BicfmwQX.js → cli-name-3MdfbvIR.js} +0 -0
- /package/dist/{cli-name-C6rJGl18.js → cli-name-CRLBidNP.js} +0 -0
- /package/dist/{cli-utils-BhXbz2UF.js → cli-utils-5ZIfXAfM.js} +0 -0
- /package/dist/{cli-utils-DZe_rVkZ.js → cli-utils-BUOtyfnU.js} +0 -0
- /package/dist/{client-C61M8zI3.js → client-D5m46AuY.js} +0 -0
- /package/dist/{client-DdpmATKq.js → client-DFyI5I0n.js} +0 -0
- /package/dist/{command-options-C4paWSGf.js → command-options-Cn2fc1Of.js} +0 -0
- /package/dist/{command-options-CA30lfLK.js → command-options-D2nN4AXX.js} +0 -0
- /package/dist/{config-eval-H_wlEYIG.js → config-eval-COtEQ2A7.js} +0 -0
- /package/dist/{config-eval-CjGZtLwx.js → config-eval-DtP5xy_j.js} +0 -0
- /package/dist/{constants-ChptG3d7.js → constants-CRGAZ2ow.js} +0 -0
- /package/dist/{constants-DY6b-_Wl.js → constants-DoYLsBmv.js} +0 -0
- /package/dist/{credentials-BHWUBHMd.js → credentials-DMAWNZdV.js} +0 -0
- /package/dist/{credentials-DFsi1_e8.js → credentials-Dmc3H-jd.js} +0 -0
- /package/dist/{daemon-runtime-CMnbwryP.js → daemon-runtime-99xh1fGv.js} +0 -0
- /package/dist/{daemon-runtime-CvqE4ysg.js → daemon-runtime-KyXiP2ib.js} +0 -0
- /package/dist/{dangerous-name-matching-BzmiLXmA.js → dangerous-name-matching--N6kyM-p.js} +0 -0
- /package/dist/{dangerous-name-matching-DaVRgwer.js → dangerous-name-matching-BlTBBZns.js} +0 -0
- /package/dist/{dangerous-tools-BOLoCRv4.js → dangerous-tools-BRmbBvRf.js} +0 -0
- /package/dist/{dangerous-tools-Baq7Q-i6.js → dangerous-tools-E1i3IoxZ.js} +0 -0
- /package/dist/{fetch-timeout-DTIN7CGM.js → fetch-timeout-DBRRPNBi.js} +0 -0
- /package/dist/{fetch-timeout-DoySHqfO.js → fetch-timeout-l_6RdoMw.js} +0 -0
- /package/dist/{file-identity-BxlKD8Ys.js → file-identity-BnGA6wyc.js} +0 -0
- /package/dist/{format-duration-CqUERz51.js → format-duration-B-Uv5nOi.js} +0 -0
- /package/dist/{format-duration-Ct-yiwkS.js → format-duration-D1M3Zxu6.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-Cywx6ldk.js} +0 -0
- /package/dist/{format-relative-CxLpEQOX.js → format-relative-DcQZUAYl.js} +0 -0
- /package/dist/{health-format-B_QRD8Si.js → health-format-DVAm0AKy.js} +0 -0
- /package/dist/{heartbeat-wake-LGEgcXjs.js → heartbeat-wake-D6Lt5YUk.js} +0 -0
- /package/dist/{heartbeat-wake-Y97geucO.js → heartbeat-wake-exV5m54T.js} +0 -0
- /package/dist/{help-format-NNm_Ov4H.js → help-format-CJQ7APRn.js} +0 -0
- /package/dist/{helpers-BAsMXprO.js → helpers-BER76F_2.js} +0 -0
- /package/dist/{helpers-DLgbkcEn.js → helpers-CAHQ-4Mb.js} +0 -0
- /package/dist/{input-provenance-Bn6thJNm.js → input-provenance-BgfeDgck.js} +0 -0
- /package/dist/{ip-C9q3Oq20.js → ip-BAhS4rY2.js} +0 -0
- /package/dist/{ip-D0zgNmBV.js → ip-BUhsZdJu.js} +0 -0
- /package/dist/{is-main-DN8-sNR5.js → is-main-BmHYGRhd.js} +0 -0
- /package/dist/{json-file-ChO_R9yh.js → json-file-B5WEJJye.js} +0 -0
- /package/dist/{json-file-B7l5-Xhr.js → json-file-Dbg7nZg1.js} +0 -0
- /package/dist/{json-files-CmpYSF4G.js → json-files-BFGbyEzL.js} +0 -0
- /package/dist/{lanes-ByWMUgrz.js → lanes-4FoQemog.js} +0 -0
- /package/dist/{lanes-cHJ5arWg.js → lanes-BhdzrAIa.js} +0 -0
- /package/dist/{links-Bz4V7R_p.js → links-CwTlzaPe.js} +0 -0
- /package/dist/{location-DBWCGNLq.js → location-50gaJF5Z.js} +0 -0
- /package/dist/{location-GbZ0bBRU.js → location-Qo8Ii1zo.js} +0 -0
- /package/dist/{logger-DyL5G2DO.js → logger-B1JSUwco.js} +0 -0
- /package/dist/{logger-GvipVDfh.js → logger-Ds0NtnLh.js} +0 -0
- /package/dist/{logger-BWMPnILd.js → logger-nEdVxm5D.js} +0 -0
- /package/dist/{logging-D8-Kozjc.js → logging-IMll-y7p.js} +0 -0
- /package/dist/{mime-BS3jhcZE.js → mime-AuIDUZPG.js} +0 -0
- /package/dist/{mime-Cxh_64P6.js → mime-Cqg1jjia.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-4m-Kc8Kn.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-U5ThQr9V.js → mutable-allowlist-detectors-DpVwqsrI.js} +0 -0
- /package/dist/{parse-log-line-enq8pduH.js → parse-log-line-BqNWR10F.js} +0 -0
- /package/dist/{parse-log-line-mz9TG6ig.js → parse-log-line-ZSGs_ws7.js} +0 -0
- /package/dist/{parse-timeout-BMP8a0_a.js → parse-timeout-BjhbNq7X.js} +0 -0
- /package/dist/{parse-timeout-CDkco8kd.js → parse-timeout-CvODy9RC.js} +0 -0
- /package/dist/{path-guards-CIx4hURU.js → path-guards-DOpzcMXz.js} +0 -0
- /package/dist/{path-guards-CrQOUlsq.js → path-guards-DipYoPVw.js} +0 -0
- /package/dist/plugin-sdk/{agents → auth}/api-key-rotation.d.ts +0 -0
- /package/dist/{plugins-allowlist-BbTQ5Z2k.js → plugins-allowlist-BdyQ2KUk.js} +0 -0
- /package/dist/{plugins-allowlist-C20oaESO.js → plugins-allowlist-NGzAob6Q.js} +0 -0
- /package/dist/{polls-B0CCBDeR.js → polls-DQrR-qT3.js} +0 -0
- /package/dist/{polls-CwwHzYBM.js → polls-ybwcqkWt.js} +0 -0
- /package/dist/{ports-lsof-Wteul3ju.js → ports-lsof-CDyv5GJd.js} +0 -0
- /package/dist/{process-scoped-map-CV9kDvfG.js → process-scoped-map-BwUkYFQV.js} +0 -0
- /package/dist/{process-scoped-map-PEvnG75N.js → process-scoped-map-_zxf_kLz.js} +0 -0
- /package/dist/{program-context-jqeI5alP.js → program-context-D5txVtUZ.js} +0 -0
- /package/dist/{progress-C1kUfYL-.js → progress-DRLmcFiG.js} +0 -0
- /package/dist/{prompt-Yn2yClg1.js → prompt-BRGfic91.js} +0 -0
- /package/dist/{prompt-style-DjEYC_s-.js → prompt-style-DKz0g3V_.js} +0 -0
- /package/dist/{provider-utils-3JTMJroG.js → provider-utils-C9kBVF1f.js} +0 -0
- /package/dist/{provider-utils-FaBmofiq.js → provider-utils-DiLhkKQp.js} +0 -0
- /package/dist/{proxy-DL3MD6-P.js → proxy-BMJL0Qog.js} +0 -0
- /package/dist/{proxy-DpNv2cSV.js → proxy-DIuxrx_D.js} +0 -0
- /package/dist/{pw-ai-state-CGfLv6nV.js → pw-ai-state-CwXeO5d0.js} +0 -0
- /package/dist/{pw-ai-state-Dynx20hr.js → pw-ai-state-DaISdsXY.js} +0 -0
- /package/dist/{redact-Dx1Fue21.js → redact-CqWx9rpK.js} +0 -0
- /package/dist/{redact-identifier-BTIWtaa-.js → redact-identifier-BJOQDEj0.js} +0 -0
- /package/dist/{redact-identifier-CAagcfWA.js → redact-identifier-DR54qsoT.js} +0 -0
- /package/dist/{remoteclaw-root-DybYl8PL.js → remoteclaw-root-C3Pq14Zr.js} +0 -0
- /package/dist/{remoteclaw-root-C2HV2VeC.js → remoteclaw-root-DTWE68ED.js} +0 -0
- /package/dist/{render-CCLsW6Lz.js → render-CDCvpfhh.js} +0 -0
- /package/dist/{render-uf6PvGMV.js → render-CJl4GK1B.js} +0 -0
- /package/dist/{retry-DnqPAqWp.js → retry-cXXk2j6_.js} +0 -0
- /package/dist/{runtime-guard-U-ewY_QH.js → runtime-guard-CohQmZ1R.js} +0 -0
- /package/dist/{secret-equal-BbHdTtqY.js → secret-equal-CJzes24Z.js} +0 -0
- /package/dist/{secret-equal-CXJEZiWb.js → secret-equal-CQAmGfGc.js} +0 -0
- /package/dist/{secure-random-CS2mSdTn.js → secure-random-B3f7Ri2X.js} +0 -0
- /package/dist/{secure-random-_dzDDlFo.js → secure-random-BkZFG9cd.js} +0 -0
- /package/dist/{session-key-5YLnn_qf.js → session-key-BF-9YzxC.js} +0 -0
- /package/dist/{session-key-C2n-VILA.js → session-key-CgKWfjoZ.js} +0 -0
- /package/dist/{stagger-BXv_apuy.js → stagger--wvODnNe.js} +0 -0
- /package/dist/{stagger-MI9gd2rQ.js → stagger-DhN5TT84.js} +0 -0
- /package/dist/{status-BmtCS3T1.js → status-BVTsuvCS.js} +0 -0
- /package/dist/{status-BrwHRn2B.js → status-BwiJpA37.js} +0 -0
- /package/dist/{strip-inbound-meta-jy3bkUab.js → strip-inbound-meta-0cvL6itU.js} +0 -0
- /package/dist/{table-C1rdyYl9.js → table-r6POocso.js} +0 -0
- /package/dist/{target-errors-BDpPcwh5.js → target-errors-DJVRKFcU.js} +0 -0
- /package/dist/{target-errors-DdIAPcMM.js → target-errors-GZXDqlUu.js} +0 -0
- /package/dist/{targets-D-qLBpTA.js → targets-B_d_1z3N.js} +0 -0
- /package/dist/{targets-UncQvCVs.js → targets-D01MJGnh.js} +0 -0
- /package/dist/{targets-JCISV-hS.js → targets-D3WkRcT8.js} +0 -0
- /package/dist/{targets-BMenhVHg.js → targets-D3r6Zgic.js} +0 -0
- /package/dist/{targets-C-2xwh9f.js → targets-DOJXjN1U.js} +0 -0
- /package/dist/{targets-D7PT_rdO.js → targets-WSwPflb6.js} +0 -0
- /package/dist/{text-format-BQ3z_OXA.js → text-format-C_RADpVD.js} +0 -0
- /package/dist/{text-format-oWqzVmah.js → text-format-VSogn9Yq.js} +0 -0
- /package/dist/{tokens-B-jmvNR9.js → tokens-C8yGxAcR.js} +0 -0
- /package/dist/{usage-BdhBT0Vz.js → usage-BXi79Rq6.js} +0 -0
- /package/dist/{usage-BtQcAnf6.js → usage-C1lHaofV.js} +0 -0
- /package/dist/{usage-format-C3mNLfhI.js → usage-format-CD5jsZY1.js} +0 -0
- /package/dist/{usage-format-DAaPzr_z.js → usage-format-CRVpDVj1.js} +0 -0
- /package/dist/{widearea-dns-CsmBVbez.js → widearea-dns-CV8_Cl64.js} +0 -0
- /package/dist/{workspace-BzPeZDew.js → workspace-BJCKO8Ns.js} +0 -0
- /package/dist/{workspace-DkGLVfOl.js → workspace-BisvA9oA.js} +0 -0
- /package/dist/{wsl-B_sPlzWw.js → wsl-DOF5ZlX9.js} +0 -0
- /package/dist/{wsl-BCnYV9O0.js → wsl-kFaeW76c.js} +0 -0
package/dist/extensionAPI.js
CHANGED
|
@@ -13,16 +13,13 @@ import { execFileSync, spawn } from "node:child_process";
|
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
import AjvPkg from "ajv";
|
|
15
15
|
import { z } from "zod";
|
|
16
|
+
import { lookup } from "node:dns";
|
|
17
|
+
import { lookup as lookup$1 } from "node:dns/promises";
|
|
18
|
+
import { Agent } from "undici";
|
|
19
|
+
import ipaddr from "ipaddr.js";
|
|
20
|
+
import { fileTypeFromBuffer } from "file-type";
|
|
16
21
|
import { createInterface } from "node:readline";
|
|
17
22
|
|
|
18
|
-
//#region src/config/model-input.ts
|
|
19
|
-
function resolveAgentModelPrimaryValue(model) {
|
|
20
|
-
if (typeof model === "string") return model.trim() || void 0;
|
|
21
|
-
if (!model || typeof model !== "object") return;
|
|
22
|
-
return model.primary?.trim() || void 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
23
|
//#region src/infra/home-dir.ts
|
|
27
24
|
function normalize(value) {
|
|
28
25
|
const trimmed = value?.trim();
|
|
@@ -542,8 +539,8 @@ function pruneOldRollingLogs(dir) {
|
|
|
542
539
|
|
|
543
540
|
//#endregion
|
|
544
541
|
//#region src/terminal/palette.ts
|
|
545
|
-
const
|
|
546
|
-
accent: "#
|
|
542
|
+
const PALETTE = {
|
|
543
|
+
accent: "#FF5A36",
|
|
547
544
|
accentBright: "#FF7A3D",
|
|
548
545
|
accentDim: "#D14A22",
|
|
549
546
|
info: "#FF8A5B",
|
|
@@ -559,17 +556,17 @@ const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env
|
|
|
559
556
|
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
560
557
|
const hex = (value) => baseChalk.hex(value);
|
|
561
558
|
const theme = {
|
|
562
|
-
accent: hex(
|
|
563
|
-
accentBright: hex(
|
|
564
|
-
accentDim: hex(
|
|
565
|
-
info: hex(
|
|
566
|
-
success: hex(
|
|
567
|
-
warn: hex(
|
|
568
|
-
error: hex(
|
|
569
|
-
muted: hex(
|
|
570
|
-
heading: baseChalk.bold.hex(
|
|
571
|
-
command: hex(
|
|
572
|
-
option: hex(
|
|
559
|
+
accent: hex(PALETTE.accent),
|
|
560
|
+
accentBright: hex(PALETTE.accentBright),
|
|
561
|
+
accentDim: hex(PALETTE.accentDim),
|
|
562
|
+
info: hex(PALETTE.info),
|
|
563
|
+
success: hex(PALETTE.success),
|
|
564
|
+
warn: hex(PALETTE.warn),
|
|
565
|
+
error: hex(PALETTE.error),
|
|
566
|
+
muted: hex(PALETTE.muted),
|
|
567
|
+
heading: baseChalk.bold.hex(PALETTE.accent),
|
|
568
|
+
command: hex(PALETTE.accentBright),
|
|
569
|
+
option: hex(PALETTE.warn)
|
|
573
570
|
};
|
|
574
571
|
|
|
575
572
|
//#endregion
|
|
@@ -578,6 +575,10 @@ let globalVerbose = false;
|
|
|
578
575
|
function isVerbose() {
|
|
579
576
|
return globalVerbose;
|
|
580
577
|
}
|
|
578
|
+
function logVerboseConsole(message) {
|
|
579
|
+
if (!globalVerbose) return;
|
|
580
|
+
console.log(theme.muted(message));
|
|
581
|
+
}
|
|
581
582
|
const success = theme.success;
|
|
582
583
|
const warn = theme.warn;
|
|
583
584
|
const info = theme.info;
|
|
@@ -1087,7 +1088,8 @@ function resolveAgentConfig(cfg, agentId) {
|
|
|
1087
1088
|
groupChat: entry.groupChat,
|
|
1088
1089
|
subagents: typeof entry.subagents === "object" && entry.subagents ? entry.subagents : void 0,
|
|
1089
1090
|
sandbox: entry.sandbox,
|
|
1090
|
-
tools: entry.tools
|
|
1091
|
+
tools: entry.tools,
|
|
1092
|
+
auth: entry.auth
|
|
1091
1093
|
};
|
|
1092
1094
|
}
|
|
1093
1095
|
function resolveAgentWorkspaceDir(cfg, agentId) {
|
|
@@ -1096,6 +1098,11 @@ function resolveAgentWorkspaceDir(cfg, agentId) {
|
|
|
1096
1098
|
if (configured) return stripNullBytes(resolveUserPath(configured));
|
|
1097
1099
|
throw new Error(`agent '${id}' has no workspace configured — set agents.list[].workspace in remoteclaw.json`);
|
|
1098
1100
|
}
|
|
1101
|
+
function resolveAgentWorkspaceDirOrNull(cfg, agentId) {
|
|
1102
|
+
const configured = resolveAgentConfig(cfg, normalizeAgentId(agentId))?.workspace?.trim();
|
|
1103
|
+
if (configured) return stripNullBytes(resolveUserPath(configured));
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1099
1106
|
function resolveAgentDir(cfg, agentId) {
|
|
1100
1107
|
const id = normalizeAgentId(agentId);
|
|
1101
1108
|
const configured = resolveAgentConfig(cfg, id)?.agentDir?.trim();
|
|
@@ -1104,11 +1111,6 @@ function resolveAgentDir(cfg, agentId) {
|
|
|
1104
1111
|
return path.join(root, "agents", id, "agent");
|
|
1105
1112
|
}
|
|
1106
1113
|
|
|
1107
|
-
//#endregion
|
|
1108
|
-
//#region src/agents/defaults.ts
|
|
1109
|
-
const DEFAULT_PROVIDER = "anthropic";
|
|
1110
|
-
const DEFAULT_MODEL = "claude-opus-4-6";
|
|
1111
|
-
|
|
1112
1114
|
//#endregion
|
|
1113
1115
|
//#region src/agents/identity.ts
|
|
1114
1116
|
function resolveAgentIdentity(cfg, agentId) {
|
|
@@ -1716,13 +1718,12 @@ function findDuplicateAgentDirs(cfg, deps) {
|
|
|
1716
1718
|
function formatDuplicateAgentDirError(dups) {
|
|
1717
1719
|
return [
|
|
1718
1720
|
"Duplicate agentDir detected (multi-agent config).",
|
|
1719
|
-
"Each agent must have a unique agentDir; sharing it causes
|
|
1721
|
+
"Each agent must have a unique agentDir; sharing it causes session state collisions.",
|
|
1720
1722
|
"",
|
|
1721
1723
|
"Conflicts:",
|
|
1722
1724
|
...dups.map((d) => `- ${d.agentDir}: ${d.agentIds.map((id) => `"${id}"`).join(", ")}`),
|
|
1723
1725
|
"",
|
|
1724
|
-
"Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory)."
|
|
1725
|
-
"If you want to share credentials, copy auth-profiles.json instead of sharing the entire agentDir."
|
|
1726
|
+
"Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory)."
|
|
1726
1727
|
].join("\n");
|
|
1727
1728
|
}
|
|
1728
1729
|
|
|
@@ -2168,7 +2169,9 @@ function applyContextPruningDefaults(cfg) {
|
|
|
2168
2169
|
};
|
|
2169
2170
|
modelsMutated = true;
|
|
2170
2171
|
}
|
|
2171
|
-
const
|
|
2172
|
+
const rawModel = defaults.model;
|
|
2173
|
+
const rawPrimary = typeof rawModel === "string" ? rawModel : rawModel?.primary;
|
|
2174
|
+
const primary = resolvePrimaryModelRef(typeof rawPrimary === "string" ? rawPrimary : void 0);
|
|
2172
2175
|
if (primary) {
|
|
2173
2176
|
const parsedPrimary = parseModelRef(primary, "anthropic");
|
|
2174
2177
|
if (isAnthropicCacheRetentionTarget(parsedPrimary)) {
|
|
@@ -2201,25 +2204,6 @@ function applyContextPruningDefaults(cfg) {
|
|
|
2201
2204
|
}
|
|
2202
2205
|
};
|
|
2203
2206
|
}
|
|
2204
|
-
function applyCompactionDefaults(cfg) {
|
|
2205
|
-
const defaults = cfg.agents?.defaults;
|
|
2206
|
-
if (!defaults) return cfg;
|
|
2207
|
-
const compaction = defaults?.compaction;
|
|
2208
|
-
if (compaction?.mode) return cfg;
|
|
2209
|
-
return {
|
|
2210
|
-
...cfg,
|
|
2211
|
-
agents: {
|
|
2212
|
-
...cfg.agents,
|
|
2213
|
-
defaults: {
|
|
2214
|
-
...defaults,
|
|
2215
|
-
compaction: {
|
|
2216
|
-
...compaction,
|
|
2217
|
-
mode: "safeguard"
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
};
|
|
2222
|
-
}
|
|
2223
2207
|
|
|
2224
2208
|
//#endregion
|
|
2225
2209
|
//#region src/config/env-preserve.ts
|
|
@@ -4657,13 +4641,6 @@ function parseDurationMs(raw, opts) {
|
|
|
4657
4641
|
return ms;
|
|
4658
4642
|
}
|
|
4659
4643
|
|
|
4660
|
-
//#endregion
|
|
4661
|
-
//#region src/config/zod-schema.agent-model.ts
|
|
4662
|
-
const AgentModelSchema = z.union([z.string(), z.object({
|
|
4663
|
-
primary: z.string().optional(),
|
|
4664
|
-
fallbacks: z.array(z.string()).optional()
|
|
4665
|
-
}).strict()]);
|
|
4666
|
-
|
|
4667
4644
|
//#endregion
|
|
4668
4645
|
//#region src/config/zod-schema.allowdeny.ts
|
|
4669
4646
|
const AllowDenyActionSchema = z.union([z.literal("allow"), z.literal("deny")]);
|
|
@@ -5037,6 +5014,12 @@ const ProviderCommandsSchema = z.object({ native: NativeCommandsSettingSchema.op
|
|
|
5037
5014
|
|
|
5038
5015
|
//#endregion
|
|
5039
5016
|
//#region src/config/zod-schema.agent-runtime.ts
|
|
5017
|
+
/** Auth profile ref: `false` (skip), single string, or string array (rotation). */
|
|
5018
|
+
const AuthFieldSchema = z.union([
|
|
5019
|
+
z.literal(false),
|
|
5020
|
+
z.string(),
|
|
5021
|
+
z.array(z.string())
|
|
5022
|
+
]).optional();
|
|
5040
5023
|
const BootSchema = z.object({
|
|
5041
5024
|
prompt: z.string().optional(),
|
|
5042
5025
|
file: z.string().optional()
|
|
@@ -5050,7 +5033,6 @@ const HeartbeatSchema = z.object({
|
|
|
5050
5033
|
}).strict().optional(),
|
|
5051
5034
|
model: z.string().optional(),
|
|
5052
5035
|
session: z.string().optional(),
|
|
5053
|
-
includeReasoning: z.boolean().optional(),
|
|
5054
5036
|
target: z.string().optional(),
|
|
5055
5037
|
to: z.string().optional(),
|
|
5056
5038
|
accountId: z.string().optional(),
|
|
@@ -5195,7 +5177,7 @@ const AgentEntrySchema = z.object({
|
|
|
5195
5177
|
name: z.string().optional(),
|
|
5196
5178
|
workspace: z.string().optional(),
|
|
5197
5179
|
agentDir: z.string().optional(),
|
|
5198
|
-
model:
|
|
5180
|
+
model: z.unknown().optional(),
|
|
5199
5181
|
skills: z.array(z.string()).optional(),
|
|
5200
5182
|
humanDelay: HumanDelaySchema.optional(),
|
|
5201
5183
|
heartbeat: HeartbeatSchema,
|
|
@@ -5204,14 +5186,11 @@ const AgentEntrySchema = z.object({
|
|
|
5204
5186
|
groupChat: GroupChatSchema,
|
|
5205
5187
|
subagents: z.object({
|
|
5206
5188
|
allowAgents: z.array(z.string()).optional(),
|
|
5207
|
-
model: z.
|
|
5208
|
-
primary: z.string().optional(),
|
|
5209
|
-
fallbacks: z.array(z.string()).optional()
|
|
5210
|
-
}).strict()]).optional(),
|
|
5211
|
-
thinking: z.string().optional()
|
|
5189
|
+
model: z.unknown().optional()
|
|
5212
5190
|
}).strict().optional(),
|
|
5213
5191
|
editableFiles: z.array(z.string()).optional(),
|
|
5214
|
-
tools: AgentToolsSchema
|
|
5192
|
+
tools: AgentToolsSchema,
|
|
5193
|
+
auth: AuthFieldSchema
|
|
5215
5194
|
}).strict();
|
|
5216
5195
|
const ToolsSchema = z.object({
|
|
5217
5196
|
...CommonToolPolicyFields,
|
|
@@ -5254,13 +5233,10 @@ const ToolsSchema = z.object({
|
|
|
5254
5233
|
//#endregion
|
|
5255
5234
|
//#region src/config/zod-schema.agent-defaults.ts
|
|
5256
5235
|
const AgentDefaultsSchema = z.object({
|
|
5257
|
-
model:
|
|
5258
|
-
imageModel:
|
|
5259
|
-
models: z.
|
|
5260
|
-
|
|
5261
|
-
params: z.record(z.string(), z.unknown()).optional(),
|
|
5262
|
-
streaming: z.boolean().optional()
|
|
5263
|
-
}).strict()).optional(),
|
|
5236
|
+
model: z.unknown().optional(),
|
|
5237
|
+
imageModel: z.unknown().optional(),
|
|
5238
|
+
models: z.unknown().optional(),
|
|
5239
|
+
workspace: z.string().optional(),
|
|
5264
5240
|
repoRoot: z.string().optional(),
|
|
5265
5241
|
skipBootstrap: z.boolean().optional(),
|
|
5266
5242
|
bootstrapMaxChars: z.number().int().positive().optional(),
|
|
@@ -5275,7 +5251,7 @@ const AgentDefaultsSchema = z.object({
|
|
|
5275
5251
|
envelopeTimestamp: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
5276
5252
|
envelopeElapsed: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
5277
5253
|
contextTokens: z.number().int().positive().optional(),
|
|
5278
|
-
cliBackends: z.
|
|
5254
|
+
cliBackends: z.unknown().optional(),
|
|
5279
5255
|
contextPruning: z.object({
|
|
5280
5256
|
mode: z.union([z.literal("off"), z.literal("cache-ttl")]).optional(),
|
|
5281
5257
|
ttl: z.string().optional(),
|
|
@@ -5297,21 +5273,6 @@ const AgentDefaultsSchema = z.object({
|
|
|
5297
5273
|
placeholder: z.string().optional()
|
|
5298
5274
|
}).strict().optional()
|
|
5299
5275
|
}).strict().optional(),
|
|
5300
|
-
compaction: z.object({
|
|
5301
|
-
mode: z.union([z.literal("default"), z.literal("safeguard")]).optional(),
|
|
5302
|
-
reserveTokens: z.number().int().nonnegative().optional(),
|
|
5303
|
-
keepRecentTokens: z.number().int().positive().optional(),
|
|
5304
|
-
reserveTokensFloor: z.number().int().nonnegative().optional(),
|
|
5305
|
-
maxHistoryShare: z.number().min(.1).max(.9).optional()
|
|
5306
|
-
}).strict().optional(),
|
|
5307
|
-
thinkingDefault: z.union([
|
|
5308
|
-
z.literal("off"),
|
|
5309
|
-
z.literal("minimal"),
|
|
5310
|
-
z.literal("low"),
|
|
5311
|
-
z.literal("medium"),
|
|
5312
|
-
z.literal("high"),
|
|
5313
|
-
z.literal("xhigh")
|
|
5314
|
-
]).optional(),
|
|
5315
5276
|
verboseDefault: z.union([
|
|
5316
5277
|
z.literal("off"),
|
|
5317
5278
|
z.literal("on"),
|
|
@@ -5341,8 +5302,7 @@ const AgentDefaultsSchema = z.object({
|
|
|
5341
5302
|
maxSpawnDepth: z.number().int().min(1).max(5).optional().describe("Maximum nesting depth for sub-agent spawning. 1 = no nesting (default), 2 = sub-agents can spawn sub-sub-agents."),
|
|
5342
5303
|
maxChildrenPerAgent: z.number().int().min(1).max(20).optional().describe("Maximum number of active children a single agent session can spawn (default: 5)."),
|
|
5343
5304
|
archiveAfterMinutes: z.number().int().positive().optional(),
|
|
5344
|
-
model:
|
|
5345
|
-
thinking: z.string().optional(),
|
|
5305
|
+
model: z.unknown().optional(),
|
|
5346
5306
|
runTimeoutSeconds: z.number().int().min(0).optional(),
|
|
5347
5307
|
announceTimeoutMs: z.number().int().positive().optional()
|
|
5348
5308
|
}).strict().optional(),
|
|
@@ -5353,7 +5313,10 @@ const AgentDefaultsSchema = z.object({
|
|
|
5353
5313
|
z.literal("gemini"),
|
|
5354
5314
|
z.literal("codex"),
|
|
5355
5315
|
z.literal("opencode")
|
|
5356
|
-
]).optional()
|
|
5316
|
+
]).optional(),
|
|
5317
|
+
runtimeArgs: z.array(z.string()).optional(),
|
|
5318
|
+
runtimeEnv: z.record(z.string(), z.string()).optional(),
|
|
5319
|
+
auth: AuthFieldSchema
|
|
5357
5320
|
}).strict().optional();
|
|
5358
5321
|
|
|
5359
5322
|
//#endregion
|
|
@@ -6913,7 +6876,7 @@ const RemoteClawSchema = z.object({
|
|
|
6913
6876
|
channel: z.union([
|
|
6914
6877
|
z.literal("stable"),
|
|
6915
6878
|
z.literal("beta"),
|
|
6916
|
-
z.literal("
|
|
6879
|
+
z.literal("next")
|
|
6917
6880
|
]).optional(),
|
|
6918
6881
|
checkOnStart: z.boolean().optional(),
|
|
6919
6882
|
auto: z.object({
|
|
@@ -7270,7 +7233,8 @@ function validateIdentityAvatar(config) {
|
|
|
7270
7233
|
});
|
|
7271
7234
|
continue;
|
|
7272
7235
|
}
|
|
7273
|
-
|
|
7236
|
+
const workspaceDir = resolveAgentWorkspaceDirOrNull(config, entry.id ?? resolveDefaultAgentId(config));
|
|
7237
|
+
if (workspaceDir != null && !isWorkspaceAvatarPath(avatar, workspaceDir)) issues.push({
|
|
7274
7238
|
path: `agents.list.${index}.identity.avatar`,
|
|
7275
7239
|
message: "identity.avatar must stay within the agent workspace."
|
|
7276
7240
|
});
|
|
@@ -7346,7 +7310,7 @@ function validateConfigObjectWithPluginsBase(raw, opts) {
|
|
|
7346
7310
|
if (registryInfo) return registryInfo;
|
|
7347
7311
|
const registry = loadPluginManifestRegistry({
|
|
7348
7312
|
config,
|
|
7349
|
-
workspaceDir:
|
|
7313
|
+
workspaceDir: resolveAgentWorkspaceDirOrNull(config, resolveDefaultAgentId(config)) ?? void 0
|
|
7350
7314
|
});
|
|
7351
7315
|
const knownIds = new Set(registry.plugins.map((record) => record.id));
|
|
7352
7316
|
const normalizedPlugins = normalizePluginsConfig(config.plugins);
|
|
@@ -7949,7 +7913,7 @@ function createConfigIO(overrides = {}) {
|
|
|
7949
7913
|
deps.logger.warn(`Config warnings:\\n${details}`);
|
|
7950
7914
|
}
|
|
7951
7915
|
warnIfConfigFromFuture(validated.config, deps.logger);
|
|
7952
|
-
const cfg = applyTalkConfigNormalization(applyModelDefaults(
|
|
7916
|
+
const cfg = applyTalkConfigNormalization(applyModelDefaults(applyContextPruningDefaults(applyAgentDefaults(applySessionDefaults(applyLoggingDefaults(applyMessageDefaults(validated.config)))))));
|
|
7953
7917
|
normalizeConfigPaths(cfg);
|
|
7954
7918
|
const duplicates = findDuplicateAgentDirs(cfg, {
|
|
7955
7919
|
env: deps.env,
|
|
@@ -8009,7 +7973,7 @@ function createConfigIO(overrides = {}) {
|
|
|
8009
7973
|
parsed: {},
|
|
8010
7974
|
resolved: {},
|
|
8011
7975
|
valid: true,
|
|
8012
|
-
config: applyTalkApiKey(applyTalkConfigNormalization(applyModelDefaults(
|
|
7976
|
+
config: applyTalkApiKey(applyTalkConfigNormalization(applyModelDefaults(applyContextPruningDefaults(applyAgentDefaults(applySessionDefaults(applyMessageDefaults({}))))))),
|
|
8013
7977
|
hash,
|
|
8014
7978
|
issues: [],
|
|
8015
7979
|
warnings: [],
|
|
@@ -9810,6 +9774,32 @@ async function withSessionStoreLock(storePath, fn, opts = {}) {
|
|
|
9810
9774
|
});
|
|
9811
9775
|
}
|
|
9812
9776
|
|
|
9777
|
+
//#endregion
|
|
9778
|
+
//#region src/logger.ts
|
|
9779
|
+
const subsystemPrefixRe = /^([a-z][a-z0-9-]{1,20}):\s+(.*)$/i;
|
|
9780
|
+
function splitSubsystem(message) {
|
|
9781
|
+
const match = message.match(subsystemPrefixRe);
|
|
9782
|
+
if (!match) return null;
|
|
9783
|
+
const [, subsystem, rest] = match;
|
|
9784
|
+
return {
|
|
9785
|
+
subsystem,
|
|
9786
|
+
rest
|
|
9787
|
+
};
|
|
9788
|
+
}
|
|
9789
|
+
function logWarn(message, runtime = defaultRuntime) {
|
|
9790
|
+
const parsed = runtime === defaultRuntime ? splitSubsystem(message) : null;
|
|
9791
|
+
if (parsed) {
|
|
9792
|
+
createSubsystemLogger(parsed.subsystem).warn(parsed.rest);
|
|
9793
|
+
return;
|
|
9794
|
+
}
|
|
9795
|
+
runtime.log(warn(message));
|
|
9796
|
+
getLogger().warn(message);
|
|
9797
|
+
}
|
|
9798
|
+
function logDebug(message) {
|
|
9799
|
+
getLogger().debug(message);
|
|
9800
|
+
logVerboseConsole(message);
|
|
9801
|
+
}
|
|
9802
|
+
|
|
9813
9803
|
//#endregion
|
|
9814
9804
|
//#region src/plugins/hook-runner-global.ts
|
|
9815
9805
|
/**
|
|
@@ -9855,46 +9845,80 @@ var DeliveryAdapter = class {
|
|
|
9855
9845
|
async process(events, callbacks) {
|
|
9856
9846
|
let textBuffer = "";
|
|
9857
9847
|
const payloads = [];
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9848
|
+
/** Track media delivered via streaming events to avoid duplicates from result.media. */
|
|
9849
|
+
const deliveredMediaKeys = /* @__PURE__ */ new Set();
|
|
9850
|
+
let eventCount = 0;
|
|
9851
|
+
for await (const event of events) {
|
|
9852
|
+
eventCount++;
|
|
9853
|
+
switch (event.type) {
|
|
9854
|
+
case "text":
|
|
9855
|
+
if (event.text === "") break;
|
|
9856
|
+
textBuffer += event.text;
|
|
9857
|
+
while (textBuffer.length > this.chunkLimit) {
|
|
9858
|
+
const { chunk, rest } = splitAtBoundary(textBuffer, this.chunkLimit);
|
|
9859
|
+
textBuffer = rest;
|
|
9860
|
+
const payload = { text: chunk };
|
|
9861
|
+
payloads.push(payload);
|
|
9862
|
+
await callbacks?.onPartialReply?.(payload);
|
|
9863
|
+
}
|
|
9864
|
+
break;
|
|
9865
|
+
case "media": {
|
|
9866
|
+
const mediaUrl = event.media.filePath ?? event.media.sourceUrl;
|
|
9867
|
+
if (mediaUrl) {
|
|
9868
|
+
if (textBuffer.length > 0) {
|
|
9869
|
+
const textPayload = { text: textBuffer };
|
|
9870
|
+
payloads.push(textPayload);
|
|
9871
|
+
await callbacks?.onBlockReply?.(textPayload);
|
|
9872
|
+
textBuffer = "";
|
|
9873
|
+
}
|
|
9874
|
+
deliveredMediaKeys.add(mediaUrl);
|
|
9875
|
+
const payload = { mediaUrl };
|
|
9876
|
+
payloads.push(payload);
|
|
9877
|
+
await callbacks?.onBlockReply?.(payload);
|
|
9878
|
+
}
|
|
9879
|
+
break;
|
|
9868
9880
|
}
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
break;
|
|
9884
|
-
}
|
|
9885
|
-
case "done":
|
|
9886
|
-
if (textBuffer.length > 0) {
|
|
9887
|
-
const payload = { text: textBuffer };
|
|
9881
|
+
case "thinking":
|
|
9882
|
+
if (event.text) callbacks?.onThinking?.({ text: event.text });
|
|
9883
|
+
break;
|
|
9884
|
+
case "tool_use": break;
|
|
9885
|
+
case "tool_result": {
|
|
9886
|
+
const payload = { text: formatToolResult(event.toolId, event.output, event.isError) };
|
|
9887
|
+
await callbacks?.onToolResult?.(payload);
|
|
9888
|
+
break;
|
|
9889
|
+
}
|
|
9890
|
+
case "error": {
|
|
9891
|
+
const payload = {
|
|
9892
|
+
text: event.code ? `[${event.code}] ${event.message}` : event.message,
|
|
9893
|
+
isError: true
|
|
9894
|
+
};
|
|
9888
9895
|
payloads.push(payload);
|
|
9889
9896
|
await callbacks?.onBlockReply?.(payload);
|
|
9890
|
-
|
|
9897
|
+
break;
|
|
9891
9898
|
}
|
|
9892
|
-
|
|
9899
|
+
case "done":
|
|
9900
|
+
if (textBuffer.length > 0) {
|
|
9901
|
+
const payload = { text: textBuffer };
|
|
9902
|
+
payloads.push(payload);
|
|
9903
|
+
await callbacks?.onBlockReply?.(payload);
|
|
9904
|
+
textBuffer = "";
|
|
9905
|
+
}
|
|
9906
|
+
if (event.result.media?.length) for (const media of event.result.media) {
|
|
9907
|
+
const url = media.filePath ?? media.sourceUrl;
|
|
9908
|
+
if (url && !deliveredMediaKeys.has(url)) {
|
|
9909
|
+
const payload = { mediaUrl: url };
|
|
9910
|
+
payloads.push(payload);
|
|
9911
|
+
await callbacks?.onBlockReply?.(payload);
|
|
9912
|
+
}
|
|
9913
|
+
}
|
|
9914
|
+
break;
|
|
9915
|
+
}
|
|
9893
9916
|
}
|
|
9894
9917
|
if (textBuffer.length > 0) {
|
|
9895
9918
|
const payload = { text: textBuffer };
|
|
9896
9919
|
payloads.push(payload);
|
|
9897
9920
|
}
|
|
9921
|
+
logDebug(`[delivery-adapter] processed ${eventCount} events into ${payloads.length} payloads (chunkLimit=${this.chunkLimit})`);
|
|
9898
9922
|
return payloads;
|
|
9899
9923
|
}
|
|
9900
9924
|
};
|
|
@@ -10010,9 +10034,19 @@ const fatalAuthPatterns = [
|
|
|
10010
10034
|
* Case-insensitive matching throughout.
|
|
10011
10035
|
*/
|
|
10012
10036
|
function classifyError(message) {
|
|
10013
|
-
for (const pattern of retryablePatterns) if (pattern.test(message))
|
|
10014
|
-
|
|
10015
|
-
|
|
10037
|
+
for (const pattern of retryablePatterns) if (pattern.test(message)) {
|
|
10038
|
+
logDebug(`[error-classifier] classified as retryable: ${message.slice(0, 200)}`);
|
|
10039
|
+
return "retryable";
|
|
10040
|
+
}
|
|
10041
|
+
for (const pattern of contextOverflowPatterns) if (pattern.test(message)) {
|
|
10042
|
+
logDebug(`[error-classifier] classified as context_overflow: ${message.slice(0, 200)}`);
|
|
10043
|
+
return "context_overflow";
|
|
10044
|
+
}
|
|
10045
|
+
for (const pattern of fatalAuthPatterns) if (pattern.test(message)) {
|
|
10046
|
+
logDebug(`[error-classifier] classified as fatal (auth): ${message.slice(0, 200)}`);
|
|
10047
|
+
return "fatal";
|
|
10048
|
+
}
|
|
10049
|
+
logDebug(`[error-classifier] classified as fatal (unmatched): ${message.slice(0, 200)}`);
|
|
10016
10050
|
return "fatal";
|
|
10017
10051
|
}
|
|
10018
10052
|
|
|
@@ -10058,6 +10092,823 @@ async function readMcpSideEffects(filePath) {
|
|
|
10058
10092
|
return result;
|
|
10059
10093
|
}
|
|
10060
10094
|
|
|
10095
|
+
//#endregion
|
|
10096
|
+
//#region src/middleware/media-capability.ts
|
|
10097
|
+
/**
|
|
10098
|
+
* Partition media attachments by whether the runtime accepts them.
|
|
10099
|
+
*
|
|
10100
|
+
* If the runtime does not declare `mediaCapabilities` at all, all media is
|
|
10101
|
+
* treated as supported (backwards-compatible — the runtime decides what to do).
|
|
10102
|
+
*/
|
|
10103
|
+
function partitionMedia(runtime, media) {
|
|
10104
|
+
const prefixes = runtime.mediaCapabilities?.acceptsInbound;
|
|
10105
|
+
if (prefixes === void 0) return {
|
|
10106
|
+
supported: media,
|
|
10107
|
+
unsupported: []
|
|
10108
|
+
};
|
|
10109
|
+
const supported = [];
|
|
10110
|
+
const unsupported = [];
|
|
10111
|
+
for (const attachment of media) if (prefixes.some((prefix) => attachment.mimeType.startsWith(prefix))) supported.push(attachment);
|
|
10112
|
+
else unsupported.push(attachment);
|
|
10113
|
+
return {
|
|
10114
|
+
supported,
|
|
10115
|
+
unsupported
|
|
10116
|
+
};
|
|
10117
|
+
}
|
|
10118
|
+
/**
|
|
10119
|
+
* Format a user-facing warning for media the runtime cannot handle.
|
|
10120
|
+
*
|
|
10121
|
+
* Returns `undefined` when there are no unsupported attachments.
|
|
10122
|
+
*/
|
|
10123
|
+
function formatUnsupportedMediaWarning(unsupported, runtimeName) {
|
|
10124
|
+
if (unsupported.length === 0) return;
|
|
10125
|
+
const typeSummary = summarizeMediaTypes(unsupported);
|
|
10126
|
+
const runtimeLabel = runtimeName.toLowerCase();
|
|
10127
|
+
if (unsupported.length === 1) return `\u26a0\ufe0f Your ${typeSummary} was received but the current runtime (${runtimeLabel}) doesn't support ${typeSummary} input. Its content was not included in the conversation.`;
|
|
10128
|
+
return `\u26a0\ufe0f ${unsupported.length} media attachments were received but the current runtime (${runtimeLabel}) doesn't support them: ${typeSummary}. Their content was not included in the conversation.`;
|
|
10129
|
+
}
|
|
10130
|
+
/**
|
|
10131
|
+
* Produce a human-readable summary of MIME type categories.
|
|
10132
|
+
*
|
|
10133
|
+
* Groups by top-level type (image, audio, video) and deduplicates.
|
|
10134
|
+
* Falls back to "media" for unknown types.
|
|
10135
|
+
*/
|
|
10136
|
+
function summarizeMediaTypes(attachments) {
|
|
10137
|
+
const categories = /* @__PURE__ */ new Set();
|
|
10138
|
+
for (const a of attachments) switch (a.mimeType.split("/")[0]) {
|
|
10139
|
+
case "image":
|
|
10140
|
+
categories.add("image");
|
|
10141
|
+
break;
|
|
10142
|
+
case "audio":
|
|
10143
|
+
categories.add("audio");
|
|
10144
|
+
break;
|
|
10145
|
+
case "video":
|
|
10146
|
+
categories.add("video");
|
|
10147
|
+
break;
|
|
10148
|
+
default:
|
|
10149
|
+
categories.add("media");
|
|
10150
|
+
break;
|
|
10151
|
+
}
|
|
10152
|
+
return [...categories].toSorted().join("/");
|
|
10153
|
+
}
|
|
10154
|
+
|
|
10155
|
+
//#endregion
|
|
10156
|
+
//#region src/utils/fetch-timeout.ts
|
|
10157
|
+
/**
|
|
10158
|
+
* Relay abort without forwarding the Event argument as the abort reason.
|
|
10159
|
+
* Using .bind() avoids closure scope capture (memory leak prevention).
|
|
10160
|
+
*/
|
|
10161
|
+
function relayAbort() {
|
|
10162
|
+
this.abort();
|
|
10163
|
+
}
|
|
10164
|
+
/** Returns a bound abort relay for use as an event listener. */
|
|
10165
|
+
function bindAbortRelay(controller) {
|
|
10166
|
+
return relayAbort.bind(controller);
|
|
10167
|
+
}
|
|
10168
|
+
|
|
10169
|
+
//#endregion
|
|
10170
|
+
//#region src/shared/net/ip.ts
|
|
10171
|
+
const BLOCKED_IPV4_SPECIAL_USE_RANGES = new Set([
|
|
10172
|
+
"unspecified",
|
|
10173
|
+
"broadcast",
|
|
10174
|
+
"multicast",
|
|
10175
|
+
"linkLocal",
|
|
10176
|
+
"loopback",
|
|
10177
|
+
"carrierGradeNat",
|
|
10178
|
+
"private",
|
|
10179
|
+
"reserved"
|
|
10180
|
+
]);
|
|
10181
|
+
const PRIVATE_OR_LOOPBACK_IPV4_RANGES = new Set([
|
|
10182
|
+
"loopback",
|
|
10183
|
+
"private",
|
|
10184
|
+
"linkLocal",
|
|
10185
|
+
"carrierGradeNat"
|
|
10186
|
+
]);
|
|
10187
|
+
const PRIVATE_OR_LOOPBACK_IPV6_RANGES = new Set([
|
|
10188
|
+
"unspecified",
|
|
10189
|
+
"loopback",
|
|
10190
|
+
"linkLocal",
|
|
10191
|
+
"uniqueLocal"
|
|
10192
|
+
]);
|
|
10193
|
+
const RFC2544_BENCHMARK_PREFIX = [ipaddr.IPv4.parse("198.18.0.0"), 15];
|
|
10194
|
+
const EMBEDDED_IPV4_SENTINEL_RULES = [
|
|
10195
|
+
{
|
|
10196
|
+
matches: (parts) => parts[0] === 0 && parts[1] === 0 && parts[2] === 0 && parts[3] === 0 && parts[4] === 0 && parts[5] === 0,
|
|
10197
|
+
toHextets: (parts) => [parts[6], parts[7]]
|
|
10198
|
+
},
|
|
10199
|
+
{
|
|
10200
|
+
matches: (parts) => parts[0] === 100 && parts[1] === 65435 && parts[2] === 1 && parts[3] === 0 && parts[4] === 0 && parts[5] === 0,
|
|
10201
|
+
toHextets: (parts) => [parts[6], parts[7]]
|
|
10202
|
+
},
|
|
10203
|
+
{
|
|
10204
|
+
matches: (parts) => parts[0] === 8194,
|
|
10205
|
+
toHextets: (parts) => [parts[1], parts[2]]
|
|
10206
|
+
},
|
|
10207
|
+
{
|
|
10208
|
+
matches: (parts) => parts[0] === 8193 && parts[1] === 0,
|
|
10209
|
+
toHextets: (parts) => [parts[6] ^ 65535, parts[7] ^ 65535]
|
|
10210
|
+
},
|
|
10211
|
+
{
|
|
10212
|
+
matches: (parts) => (parts[4] & 64767) === 0 && parts[5] === 24318,
|
|
10213
|
+
toHextets: (parts) => [parts[6], parts[7]]
|
|
10214
|
+
}
|
|
10215
|
+
];
|
|
10216
|
+
function stripIpv6Brackets(value) {
|
|
10217
|
+
if (value.startsWith("[") && value.endsWith("]")) return value.slice(1, -1);
|
|
10218
|
+
return value;
|
|
10219
|
+
}
|
|
10220
|
+
function isNumericIpv4LiteralPart(value) {
|
|
10221
|
+
return /^[0-9]+$/.test(value) || /^0x[0-9a-f]+$/i.test(value);
|
|
10222
|
+
}
|
|
10223
|
+
function parseIpv6WithEmbeddedIpv4(raw) {
|
|
10224
|
+
if (!raw.includes(":") || !raw.includes(".")) return;
|
|
10225
|
+
const match = /^(.*:)([^:%]+(?:\.[^:%]+){3})(%[0-9A-Za-z]+)?$/i.exec(raw);
|
|
10226
|
+
if (!match) return;
|
|
10227
|
+
const [, prefix, embeddedIpv4, zoneSuffix = ""] = match;
|
|
10228
|
+
if (!ipaddr.IPv4.isValidFourPartDecimal(embeddedIpv4)) return;
|
|
10229
|
+
const octets = embeddedIpv4.split(".").map((part) => Number.parseInt(part, 10));
|
|
10230
|
+
const normalizedIpv6 = `${prefix}${(octets[0] << 8 | octets[1]).toString(16)}:${(octets[2] << 8 | octets[3]).toString(16)}${zoneSuffix}`;
|
|
10231
|
+
if (!ipaddr.IPv6.isValid(normalizedIpv6)) return;
|
|
10232
|
+
return ipaddr.IPv6.parse(normalizedIpv6);
|
|
10233
|
+
}
|
|
10234
|
+
function isIpv4Address(address) {
|
|
10235
|
+
return address.kind() === "ipv4";
|
|
10236
|
+
}
|
|
10237
|
+
function isIpv6Address(address) {
|
|
10238
|
+
return address.kind() === "ipv6";
|
|
10239
|
+
}
|
|
10240
|
+
function normalizeIpv4MappedAddress(address) {
|
|
10241
|
+
if (!isIpv6Address(address)) return address;
|
|
10242
|
+
if (!address.isIPv4MappedAddress()) return address;
|
|
10243
|
+
return address.toIPv4Address();
|
|
10244
|
+
}
|
|
10245
|
+
function parseCanonicalIpAddress(raw) {
|
|
10246
|
+
const trimmed = raw?.trim();
|
|
10247
|
+
if (!trimmed) return;
|
|
10248
|
+
const normalized = stripIpv6Brackets(trimmed);
|
|
10249
|
+
if (!normalized) return;
|
|
10250
|
+
if (ipaddr.IPv4.isValid(normalized)) {
|
|
10251
|
+
if (!ipaddr.IPv4.isValidFourPartDecimal(normalized)) return;
|
|
10252
|
+
return ipaddr.IPv4.parse(normalized);
|
|
10253
|
+
}
|
|
10254
|
+
if (ipaddr.IPv6.isValid(normalized)) return ipaddr.IPv6.parse(normalized);
|
|
10255
|
+
return parseIpv6WithEmbeddedIpv4(normalized);
|
|
10256
|
+
}
|
|
10257
|
+
function parseLooseIpAddress(raw) {
|
|
10258
|
+
const trimmed = raw?.trim();
|
|
10259
|
+
if (!trimmed) return;
|
|
10260
|
+
const normalized = stripIpv6Brackets(trimmed);
|
|
10261
|
+
if (!normalized) return;
|
|
10262
|
+
if (ipaddr.isValid(normalized)) return ipaddr.parse(normalized);
|
|
10263
|
+
return parseIpv6WithEmbeddedIpv4(normalized);
|
|
10264
|
+
}
|
|
10265
|
+
function isCanonicalDottedDecimalIPv4(raw) {
|
|
10266
|
+
const trimmed = raw?.trim();
|
|
10267
|
+
if (!trimmed) return false;
|
|
10268
|
+
const normalized = stripIpv6Brackets(trimmed);
|
|
10269
|
+
if (!normalized) return false;
|
|
10270
|
+
return ipaddr.IPv4.isValidFourPartDecimal(normalized);
|
|
10271
|
+
}
|
|
10272
|
+
function isLegacyIpv4Literal(raw) {
|
|
10273
|
+
const trimmed = raw?.trim();
|
|
10274
|
+
if (!trimmed) return false;
|
|
10275
|
+
const normalized = stripIpv6Brackets(trimmed);
|
|
10276
|
+
if (!normalized || normalized.includes(":")) return false;
|
|
10277
|
+
if (isCanonicalDottedDecimalIPv4(normalized)) return false;
|
|
10278
|
+
const parts = normalized.split(".");
|
|
10279
|
+
if (parts.length === 0 || parts.length > 4) return false;
|
|
10280
|
+
if (parts.some((part) => part.length === 0)) return false;
|
|
10281
|
+
if (!parts.every((part) => isNumericIpv4LiteralPart(part))) return false;
|
|
10282
|
+
return true;
|
|
10283
|
+
}
|
|
10284
|
+
function isPrivateOrLoopbackIpAddress(raw) {
|
|
10285
|
+
const parsed = parseCanonicalIpAddress(raw);
|
|
10286
|
+
if (!parsed) return false;
|
|
10287
|
+
const normalized = normalizeIpv4MappedAddress(parsed);
|
|
10288
|
+
if (isIpv4Address(normalized)) return PRIVATE_OR_LOOPBACK_IPV4_RANGES.has(normalized.range());
|
|
10289
|
+
if (PRIVATE_OR_LOOPBACK_IPV6_RANGES.has(normalized.range())) return true;
|
|
10290
|
+
return (normalized.parts[0] & 65472) === 65216;
|
|
10291
|
+
}
|
|
10292
|
+
function isBlockedSpecialUseIpv4Address(address, options = {}) {
|
|
10293
|
+
const inRfc2544BenchmarkRange = address.match(RFC2544_BENCHMARK_PREFIX);
|
|
10294
|
+
if (inRfc2544BenchmarkRange && options.allowRfc2544BenchmarkRange === true) return false;
|
|
10295
|
+
return BLOCKED_IPV4_SPECIAL_USE_RANGES.has(address.range()) || inRfc2544BenchmarkRange;
|
|
10296
|
+
}
|
|
10297
|
+
function decodeIpv4FromHextets(high, low) {
|
|
10298
|
+
const octets = [
|
|
10299
|
+
high >>> 8 & 255,
|
|
10300
|
+
high & 255,
|
|
10301
|
+
low >>> 8 & 255,
|
|
10302
|
+
low & 255
|
|
10303
|
+
];
|
|
10304
|
+
return ipaddr.IPv4.parse(octets.join("."));
|
|
10305
|
+
}
|
|
10306
|
+
function extractEmbeddedIpv4FromIpv6(address) {
|
|
10307
|
+
if (address.isIPv4MappedAddress()) return address.toIPv4Address();
|
|
10308
|
+
if (address.range() === "rfc6145") return decodeIpv4FromHextets(address.parts[6], address.parts[7]);
|
|
10309
|
+
if (address.range() === "rfc6052") return decodeIpv4FromHextets(address.parts[6], address.parts[7]);
|
|
10310
|
+
for (const rule of EMBEDDED_IPV4_SENTINEL_RULES) {
|
|
10311
|
+
if (!rule.matches(address.parts)) continue;
|
|
10312
|
+
const [high, low] = rule.toHextets(address.parts);
|
|
10313
|
+
return decodeIpv4FromHextets(high, low);
|
|
10314
|
+
}
|
|
10315
|
+
}
|
|
10316
|
+
|
|
10317
|
+
//#endregion
|
|
10318
|
+
//#region src/infra/net/hostname.ts
|
|
10319
|
+
function normalizeHostname(hostname) {
|
|
10320
|
+
const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
|
|
10321
|
+
if (normalized.startsWith("[") && normalized.endsWith("]")) return normalized.slice(1, -1);
|
|
10322
|
+
return normalized;
|
|
10323
|
+
}
|
|
10324
|
+
|
|
10325
|
+
//#endregion
|
|
10326
|
+
//#region src/infra/net/ssrf.ts
|
|
10327
|
+
var SsrFBlockedError = class extends Error {
|
|
10328
|
+
constructor(message) {
|
|
10329
|
+
super(message);
|
|
10330
|
+
this.name = "SsrFBlockedError";
|
|
10331
|
+
}
|
|
10332
|
+
};
|
|
10333
|
+
const BLOCKED_HOSTNAMES = new Set([
|
|
10334
|
+
"localhost",
|
|
10335
|
+
"localhost.localdomain",
|
|
10336
|
+
"metadata.google.internal"
|
|
10337
|
+
]);
|
|
10338
|
+
function normalizeHostnameSet(values) {
|
|
10339
|
+
if (!values || values.length === 0) return /* @__PURE__ */ new Set();
|
|
10340
|
+
return new Set(values.map((value) => normalizeHostname(value)).filter(Boolean));
|
|
10341
|
+
}
|
|
10342
|
+
function normalizeHostnameAllowlist(values) {
|
|
10343
|
+
if (!values || values.length === 0) return [];
|
|
10344
|
+
return Array.from(new Set(values.map((value) => normalizeHostname(value)).filter((value) => value !== "*" && value !== "*." && value.length > 0)));
|
|
10345
|
+
}
|
|
10346
|
+
function resolveAllowPrivateNetwork(policy) {
|
|
10347
|
+
return policy?.dangerouslyAllowPrivateNetwork === true || policy?.allowPrivateNetwork === true;
|
|
10348
|
+
}
|
|
10349
|
+
function resolveIpv4SpecialUseBlockOptions(policy) {
|
|
10350
|
+
return { allowRfc2544BenchmarkRange: policy?.allowRfc2544BenchmarkRange === true };
|
|
10351
|
+
}
|
|
10352
|
+
function isHostnameAllowedByPattern(hostname, pattern) {
|
|
10353
|
+
if (pattern.startsWith("*.")) {
|
|
10354
|
+
const suffix = pattern.slice(2);
|
|
10355
|
+
if (!suffix || hostname === suffix) return false;
|
|
10356
|
+
return hostname.endsWith(`.${suffix}`);
|
|
10357
|
+
}
|
|
10358
|
+
return hostname === pattern;
|
|
10359
|
+
}
|
|
10360
|
+
function matchesHostnameAllowlist(hostname, allowlist) {
|
|
10361
|
+
if (allowlist.length === 0) return true;
|
|
10362
|
+
return allowlist.some((pattern) => isHostnameAllowedByPattern(hostname, pattern));
|
|
10363
|
+
}
|
|
10364
|
+
function looksLikeUnsupportedIpv4Literal(address) {
|
|
10365
|
+
const parts = address.split(".");
|
|
10366
|
+
if (parts.length === 0 || parts.length > 4) return false;
|
|
10367
|
+
if (parts.some((part) => part.length === 0)) return true;
|
|
10368
|
+
return parts.every((part) => /^[0-9]+$/.test(part) || /^0x/i.test(part));
|
|
10369
|
+
}
|
|
10370
|
+
function isPrivateIpAddress(address, policy) {
|
|
10371
|
+
let normalized = address.trim().toLowerCase();
|
|
10372
|
+
if (normalized.startsWith("[") && normalized.endsWith("]")) normalized = normalized.slice(1, -1);
|
|
10373
|
+
if (!normalized) return false;
|
|
10374
|
+
const blockOptions = resolveIpv4SpecialUseBlockOptions(policy);
|
|
10375
|
+
const strictIp = parseCanonicalIpAddress(normalized);
|
|
10376
|
+
if (strictIp) {
|
|
10377
|
+
if (isIpv4Address(strictIp)) return isBlockedSpecialUseIpv4Address(strictIp, blockOptions);
|
|
10378
|
+
if (isPrivateOrLoopbackIpAddress(strictIp.toString())) return true;
|
|
10379
|
+
const embeddedIpv4 = extractEmbeddedIpv4FromIpv6(strictIp);
|
|
10380
|
+
if (embeddedIpv4) return isBlockedSpecialUseIpv4Address(embeddedIpv4, blockOptions);
|
|
10381
|
+
return false;
|
|
10382
|
+
}
|
|
10383
|
+
if (normalized.includes(":") && !parseLooseIpAddress(normalized)) return true;
|
|
10384
|
+
if (!isCanonicalDottedDecimalIPv4(normalized) && isLegacyIpv4Literal(normalized)) return true;
|
|
10385
|
+
if (looksLikeUnsupportedIpv4Literal(normalized)) return true;
|
|
10386
|
+
return false;
|
|
10387
|
+
}
|
|
10388
|
+
function isBlockedHostnameNormalized(normalized) {
|
|
10389
|
+
if (BLOCKED_HOSTNAMES.has(normalized)) return true;
|
|
10390
|
+
return normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal");
|
|
10391
|
+
}
|
|
10392
|
+
function isBlockedHostnameOrIp(hostname, policy) {
|
|
10393
|
+
const normalized = normalizeHostname(hostname);
|
|
10394
|
+
if (!normalized) return false;
|
|
10395
|
+
return isBlockedHostnameNormalized(normalized) || isPrivateIpAddress(normalized, policy);
|
|
10396
|
+
}
|
|
10397
|
+
const BLOCKED_HOST_OR_IP_MESSAGE = "Blocked hostname or private/internal/special-use IP address";
|
|
10398
|
+
const BLOCKED_RESOLVED_IP_MESSAGE = "Blocked: resolves to private/internal/special-use IP address";
|
|
10399
|
+
function assertAllowedHostOrIpOrThrow(hostnameOrIp, policy) {
|
|
10400
|
+
if (isBlockedHostnameOrIp(hostnameOrIp, policy)) throw new SsrFBlockedError(BLOCKED_HOST_OR_IP_MESSAGE);
|
|
10401
|
+
}
|
|
10402
|
+
function assertAllowedResolvedAddressesOrThrow(results, policy) {
|
|
10403
|
+
for (const entry of results) if (isBlockedHostnameOrIp(entry.address, policy)) throw new SsrFBlockedError(BLOCKED_RESOLVED_IP_MESSAGE);
|
|
10404
|
+
}
|
|
10405
|
+
function createPinnedLookup(params) {
|
|
10406
|
+
const normalizedHost = normalizeHostname(params.hostname);
|
|
10407
|
+
const fallback = params.fallback ?? lookup;
|
|
10408
|
+
const fallbackLookup = fallback;
|
|
10409
|
+
const fallbackWithOptions = fallback;
|
|
10410
|
+
const records = params.addresses.map((address) => ({
|
|
10411
|
+
address,
|
|
10412
|
+
family: address.includes(":") ? 6 : 4
|
|
10413
|
+
}));
|
|
10414
|
+
let index = 0;
|
|
10415
|
+
return ((host, options, callback) => {
|
|
10416
|
+
const cb = typeof options === "function" ? options : callback;
|
|
10417
|
+
if (!cb) return;
|
|
10418
|
+
const normalized = normalizeHostname(host);
|
|
10419
|
+
if (!normalized || normalized !== normalizedHost) {
|
|
10420
|
+
if (typeof options === "function" || options === void 0) return fallbackLookup(host, cb);
|
|
10421
|
+
return fallbackWithOptions(host, options, cb);
|
|
10422
|
+
}
|
|
10423
|
+
const opts = typeof options === "object" && options !== null ? options : {};
|
|
10424
|
+
const requestedFamily = typeof options === "number" ? options : typeof opts.family === "number" ? opts.family : 0;
|
|
10425
|
+
const candidates = requestedFamily === 4 || requestedFamily === 6 ? records.filter((entry) => entry.family === requestedFamily) : records;
|
|
10426
|
+
const usable = candidates.length > 0 ? candidates : records;
|
|
10427
|
+
if (opts.all) {
|
|
10428
|
+
cb(null, usable);
|
|
10429
|
+
return;
|
|
10430
|
+
}
|
|
10431
|
+
const chosen = usable[index % usable.length];
|
|
10432
|
+
index += 1;
|
|
10433
|
+
cb(null, chosen.address, chosen.family);
|
|
10434
|
+
});
|
|
10435
|
+
}
|
|
10436
|
+
function dedupeAndPreferIpv4(results) {
|
|
10437
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10438
|
+
const ipv4 = [];
|
|
10439
|
+
const otherFamilies = [];
|
|
10440
|
+
for (const entry of results) {
|
|
10441
|
+
if (seen.has(entry.address)) continue;
|
|
10442
|
+
seen.add(entry.address);
|
|
10443
|
+
if (entry.family === 4) {
|
|
10444
|
+
ipv4.push(entry.address);
|
|
10445
|
+
continue;
|
|
10446
|
+
}
|
|
10447
|
+
otherFamilies.push(entry.address);
|
|
10448
|
+
}
|
|
10449
|
+
return [...ipv4, ...otherFamilies];
|
|
10450
|
+
}
|
|
10451
|
+
async function resolvePinnedHostnameWithPolicy(hostname, params = {}) {
|
|
10452
|
+
const normalized = normalizeHostname(hostname);
|
|
10453
|
+
if (!normalized) throw new Error("Invalid hostname");
|
|
10454
|
+
const allowPrivateNetwork = resolveAllowPrivateNetwork(params.policy);
|
|
10455
|
+
const allowedHostnames = normalizeHostnameSet(params.policy?.allowedHostnames);
|
|
10456
|
+
const hostnameAllowlist = normalizeHostnameAllowlist(params.policy?.hostnameAllowlist);
|
|
10457
|
+
const isExplicitAllowed = allowedHostnames.has(normalized);
|
|
10458
|
+
const skipPrivateNetworkChecks = allowPrivateNetwork || isExplicitAllowed;
|
|
10459
|
+
if (!matchesHostnameAllowlist(normalized, hostnameAllowlist)) throw new SsrFBlockedError(`Blocked hostname (not in allowlist): ${hostname}`);
|
|
10460
|
+
if (!skipPrivateNetworkChecks) assertAllowedHostOrIpOrThrow(normalized, params.policy);
|
|
10461
|
+
const results = await (params.lookupFn ?? lookup$1)(normalized, { all: true });
|
|
10462
|
+
if (results.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
|
|
10463
|
+
if (!skipPrivateNetworkChecks) assertAllowedResolvedAddressesOrThrow(results, params.policy);
|
|
10464
|
+
const addresses = dedupeAndPreferIpv4(results);
|
|
10465
|
+
if (addresses.length === 0) throw new Error(`Unable to resolve hostname: ${hostname}`);
|
|
10466
|
+
return {
|
|
10467
|
+
hostname: normalized,
|
|
10468
|
+
addresses,
|
|
10469
|
+
lookup: createPinnedLookup({
|
|
10470
|
+
hostname: normalized,
|
|
10471
|
+
addresses
|
|
10472
|
+
})
|
|
10473
|
+
};
|
|
10474
|
+
}
|
|
10475
|
+
function createPinnedDispatcher(pinned) {
|
|
10476
|
+
return new Agent({ connect: {
|
|
10477
|
+
lookup: pinned.lookup,
|
|
10478
|
+
autoSelectFamily: true,
|
|
10479
|
+
autoSelectFamilyAttemptTimeout: 300
|
|
10480
|
+
} });
|
|
10481
|
+
}
|
|
10482
|
+
async function closeDispatcher(dispatcher) {
|
|
10483
|
+
if (!dispatcher) return;
|
|
10484
|
+
const candidate = dispatcher;
|
|
10485
|
+
try {
|
|
10486
|
+
if (typeof candidate.close === "function") {
|
|
10487
|
+
await candidate.close();
|
|
10488
|
+
return;
|
|
10489
|
+
}
|
|
10490
|
+
if (typeof candidate.destroy === "function") candidate.destroy();
|
|
10491
|
+
} catch {}
|
|
10492
|
+
}
|
|
10493
|
+
|
|
10494
|
+
//#endregion
|
|
10495
|
+
//#region src/infra/net/fetch-guard.ts
|
|
10496
|
+
const DEFAULT_MAX_REDIRECTS = 3;
|
|
10497
|
+
const CROSS_ORIGIN_REDIRECT_SENSITIVE_HEADERS = [
|
|
10498
|
+
"authorization",
|
|
10499
|
+
"proxy-authorization",
|
|
10500
|
+
"cookie",
|
|
10501
|
+
"cookie2"
|
|
10502
|
+
];
|
|
10503
|
+
function isRedirectStatus(status) {
|
|
10504
|
+
return status === 301 || status === 302 || status === 303 || status === 307 || status === 308;
|
|
10505
|
+
}
|
|
10506
|
+
function stripSensitiveHeadersForCrossOriginRedirect(init) {
|
|
10507
|
+
if (!init?.headers) return init;
|
|
10508
|
+
const headers = new Headers(init.headers);
|
|
10509
|
+
for (const header of CROSS_ORIGIN_REDIRECT_SENSITIVE_HEADERS) headers.delete(header);
|
|
10510
|
+
return {
|
|
10511
|
+
...init,
|
|
10512
|
+
headers
|
|
10513
|
+
};
|
|
10514
|
+
}
|
|
10515
|
+
function buildAbortSignal(params) {
|
|
10516
|
+
const { timeoutMs, signal } = params;
|
|
10517
|
+
if (!timeoutMs && !signal) return {
|
|
10518
|
+
signal: void 0,
|
|
10519
|
+
cleanup: () => {}
|
|
10520
|
+
};
|
|
10521
|
+
if (!timeoutMs) return {
|
|
10522
|
+
signal,
|
|
10523
|
+
cleanup: () => {}
|
|
10524
|
+
};
|
|
10525
|
+
const controller = new AbortController();
|
|
10526
|
+
const timeoutId = setTimeout(controller.abort.bind(controller), timeoutMs);
|
|
10527
|
+
const onAbort = bindAbortRelay(controller);
|
|
10528
|
+
if (signal) if (signal.aborted) controller.abort();
|
|
10529
|
+
else signal.addEventListener("abort", onAbort, { once: true });
|
|
10530
|
+
const cleanup = () => {
|
|
10531
|
+
clearTimeout(timeoutId);
|
|
10532
|
+
if (signal) signal.removeEventListener("abort", onAbort);
|
|
10533
|
+
};
|
|
10534
|
+
return {
|
|
10535
|
+
signal: controller.signal,
|
|
10536
|
+
cleanup
|
|
10537
|
+
};
|
|
10538
|
+
}
|
|
10539
|
+
async function fetchWithSsrFGuard(params) {
|
|
10540
|
+
const fetcher = params.fetchImpl ?? globalThis.fetch;
|
|
10541
|
+
if (!fetcher) throw new Error("fetch is not available");
|
|
10542
|
+
const maxRedirects = typeof params.maxRedirects === "number" && Number.isFinite(params.maxRedirects) ? Math.max(0, Math.floor(params.maxRedirects)) : DEFAULT_MAX_REDIRECTS;
|
|
10543
|
+
const { signal, cleanup } = buildAbortSignal({
|
|
10544
|
+
timeoutMs: params.timeoutMs,
|
|
10545
|
+
signal: params.signal
|
|
10546
|
+
});
|
|
10547
|
+
let released = false;
|
|
10548
|
+
const release = async (dispatcher) => {
|
|
10549
|
+
if (released) return;
|
|
10550
|
+
released = true;
|
|
10551
|
+
cleanup();
|
|
10552
|
+
await closeDispatcher(dispatcher ?? void 0);
|
|
10553
|
+
};
|
|
10554
|
+
const visited = /* @__PURE__ */ new Set();
|
|
10555
|
+
let currentUrl = params.url;
|
|
10556
|
+
let currentInit = params.init ? { ...params.init } : void 0;
|
|
10557
|
+
let redirectCount = 0;
|
|
10558
|
+
while (true) {
|
|
10559
|
+
let parsedUrl;
|
|
10560
|
+
try {
|
|
10561
|
+
parsedUrl = new URL(currentUrl);
|
|
10562
|
+
} catch {
|
|
10563
|
+
await release();
|
|
10564
|
+
throw new Error("Invalid URL: must be http or https");
|
|
10565
|
+
}
|
|
10566
|
+
if (!["http:", "https:"].includes(parsedUrl.protocol)) {
|
|
10567
|
+
await release();
|
|
10568
|
+
throw new Error("Invalid URL: must be http or https");
|
|
10569
|
+
}
|
|
10570
|
+
let dispatcher = null;
|
|
10571
|
+
try {
|
|
10572
|
+
const pinned = await resolvePinnedHostnameWithPolicy(parsedUrl.hostname, {
|
|
10573
|
+
lookupFn: params.lookupFn,
|
|
10574
|
+
policy: params.policy
|
|
10575
|
+
});
|
|
10576
|
+
if (params.pinDns !== false) dispatcher = createPinnedDispatcher(pinned);
|
|
10577
|
+
const init = {
|
|
10578
|
+
...currentInit ? { ...currentInit } : {},
|
|
10579
|
+
redirect: "manual",
|
|
10580
|
+
...dispatcher ? { dispatcher } : {},
|
|
10581
|
+
...signal ? { signal } : {}
|
|
10582
|
+
};
|
|
10583
|
+
const response = await fetcher(parsedUrl.toString(), init);
|
|
10584
|
+
if (isRedirectStatus(response.status)) {
|
|
10585
|
+
const location = response.headers.get("location");
|
|
10586
|
+
if (!location) {
|
|
10587
|
+
await release(dispatcher);
|
|
10588
|
+
throw new Error(`Redirect missing location header (${response.status})`);
|
|
10589
|
+
}
|
|
10590
|
+
redirectCount += 1;
|
|
10591
|
+
if (redirectCount > maxRedirects) {
|
|
10592
|
+
await release(dispatcher);
|
|
10593
|
+
throw new Error(`Too many redirects (limit: ${maxRedirects})`);
|
|
10594
|
+
}
|
|
10595
|
+
const nextParsedUrl = new URL(location, parsedUrl);
|
|
10596
|
+
const nextUrl = nextParsedUrl.toString();
|
|
10597
|
+
if (visited.has(nextUrl)) {
|
|
10598
|
+
await release(dispatcher);
|
|
10599
|
+
throw new Error("Redirect loop detected");
|
|
10600
|
+
}
|
|
10601
|
+
if (nextParsedUrl.origin !== parsedUrl.origin) currentInit = stripSensitiveHeadersForCrossOriginRedirect(currentInit);
|
|
10602
|
+
visited.add(nextUrl);
|
|
10603
|
+
response.body?.cancel();
|
|
10604
|
+
await closeDispatcher(dispatcher);
|
|
10605
|
+
currentUrl = nextUrl;
|
|
10606
|
+
continue;
|
|
10607
|
+
}
|
|
10608
|
+
return {
|
|
10609
|
+
response,
|
|
10610
|
+
finalUrl: currentUrl,
|
|
10611
|
+
release: async () => release(dispatcher)
|
|
10612
|
+
};
|
|
10613
|
+
} catch (err) {
|
|
10614
|
+
if (err instanceof SsrFBlockedError) logWarn(`security: blocked URL fetch (${params.auditContext ?? "url-fetch"}) target=${parsedUrl.origin}${parsedUrl.pathname} reason=${err.message}`);
|
|
10615
|
+
await release(dispatcher);
|
|
10616
|
+
throw err;
|
|
10617
|
+
}
|
|
10618
|
+
}
|
|
10619
|
+
}
|
|
10620
|
+
|
|
10621
|
+
//#endregion
|
|
10622
|
+
//#region src/media/constants.ts
|
|
10623
|
+
const MAX_IMAGE_BYTES = 6 * 1024 * 1024;
|
|
10624
|
+
const MAX_AUDIO_BYTES = 16 * 1024 * 1024;
|
|
10625
|
+
const MAX_VIDEO_BYTES = 16 * 1024 * 1024;
|
|
10626
|
+
const MAX_DOCUMENT_BYTES = 100 * 1024 * 1024;
|
|
10627
|
+
|
|
10628
|
+
//#endregion
|
|
10629
|
+
//#region src/media/mime.ts
|
|
10630
|
+
const EXT_BY_MIME = {
|
|
10631
|
+
"image/heic": ".heic",
|
|
10632
|
+
"image/heif": ".heif",
|
|
10633
|
+
"image/jpeg": ".jpg",
|
|
10634
|
+
"image/png": ".png",
|
|
10635
|
+
"image/webp": ".webp",
|
|
10636
|
+
"image/gif": ".gif",
|
|
10637
|
+
"audio/ogg": ".ogg",
|
|
10638
|
+
"audio/mpeg": ".mp3",
|
|
10639
|
+
"audio/x-m4a": ".m4a",
|
|
10640
|
+
"audio/mp4": ".m4a",
|
|
10641
|
+
"video/mp4": ".mp4",
|
|
10642
|
+
"video/quicktime": ".mov",
|
|
10643
|
+
"application/pdf": ".pdf",
|
|
10644
|
+
"application/json": ".json",
|
|
10645
|
+
"application/zip": ".zip",
|
|
10646
|
+
"application/gzip": ".gz",
|
|
10647
|
+
"application/x-tar": ".tar",
|
|
10648
|
+
"application/x-7z-compressed": ".7z",
|
|
10649
|
+
"application/vnd.rar": ".rar",
|
|
10650
|
+
"application/msword": ".doc",
|
|
10651
|
+
"application/vnd.ms-excel": ".xls",
|
|
10652
|
+
"application/vnd.ms-powerpoint": ".ppt",
|
|
10653
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
|
|
10654
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
|
|
10655
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
|
|
10656
|
+
"text/csv": ".csv",
|
|
10657
|
+
"text/plain": ".txt",
|
|
10658
|
+
"text/markdown": ".md"
|
|
10659
|
+
};
|
|
10660
|
+
const MIME_BY_EXT = {
|
|
10661
|
+
...Object.fromEntries(Object.entries(EXT_BY_MIME).map(([mime, ext]) => [ext, mime])),
|
|
10662
|
+
".jpeg": "image/jpeg"
|
|
10663
|
+
};
|
|
10664
|
+
function normalizeMimeType(mime) {
|
|
10665
|
+
if (!mime) return;
|
|
10666
|
+
return mime.split(";")[0]?.trim().toLowerCase() || void 0;
|
|
10667
|
+
}
|
|
10668
|
+
async function sniffMime(buffer) {
|
|
10669
|
+
if (!buffer) return;
|
|
10670
|
+
try {
|
|
10671
|
+
return (await fileTypeFromBuffer(buffer))?.mime ?? void 0;
|
|
10672
|
+
} catch {
|
|
10673
|
+
return;
|
|
10674
|
+
}
|
|
10675
|
+
}
|
|
10676
|
+
function getFileExtension(filePath) {
|
|
10677
|
+
if (!filePath) return;
|
|
10678
|
+
try {
|
|
10679
|
+
if (/^https?:\/\//i.test(filePath)) {
|
|
10680
|
+
const url = new URL(filePath);
|
|
10681
|
+
return path.extname(url.pathname).toLowerCase() || void 0;
|
|
10682
|
+
}
|
|
10683
|
+
} catch {}
|
|
10684
|
+
return path.extname(filePath).toLowerCase() || void 0;
|
|
10685
|
+
}
|
|
10686
|
+
function detectMime(opts) {
|
|
10687
|
+
return detectMimeImpl(opts);
|
|
10688
|
+
}
|
|
10689
|
+
function isGenericMime(mime) {
|
|
10690
|
+
if (!mime) return true;
|
|
10691
|
+
const m = mime.toLowerCase();
|
|
10692
|
+
return m === "application/octet-stream" || m === "application/zip";
|
|
10693
|
+
}
|
|
10694
|
+
async function detectMimeImpl(opts) {
|
|
10695
|
+
const ext = getFileExtension(opts.filePath);
|
|
10696
|
+
const extMime = ext ? MIME_BY_EXT[ext] : void 0;
|
|
10697
|
+
const headerMime = normalizeMimeType(opts.headerMime);
|
|
10698
|
+
const sniffed = await sniffMime(opts.buffer);
|
|
10699
|
+
if (sniffed && (!isGenericMime(sniffed) || !extMime)) return sniffed;
|
|
10700
|
+
if (extMime) return extMime;
|
|
10701
|
+
if (headerMime && !isGenericMime(headerMime)) return headerMime;
|
|
10702
|
+
if (sniffed) return sniffed;
|
|
10703
|
+
if (headerMime) return headerMime;
|
|
10704
|
+
}
|
|
10705
|
+
function extensionForMime(mime) {
|
|
10706
|
+
const normalized = normalizeMimeType(mime);
|
|
10707
|
+
if (!normalized) return;
|
|
10708
|
+
return EXT_BY_MIME[normalized];
|
|
10709
|
+
}
|
|
10710
|
+
|
|
10711
|
+
//#endregion
|
|
10712
|
+
//#region src/media/read-response-with-limit.ts
|
|
10713
|
+
async function readResponseWithLimit(res, maxBytes, opts) {
|
|
10714
|
+
const onOverflow = opts?.onOverflow ?? ((params) => /* @__PURE__ */ new Error(`Content too large: ${params.size} bytes (limit: ${params.maxBytes} bytes)`));
|
|
10715
|
+
const body = res.body;
|
|
10716
|
+
if (!body || typeof body.getReader !== "function") {
|
|
10717
|
+
const fallback = Buffer.from(await res.arrayBuffer());
|
|
10718
|
+
if (fallback.length > maxBytes) throw onOverflow({
|
|
10719
|
+
size: fallback.length,
|
|
10720
|
+
maxBytes,
|
|
10721
|
+
res
|
|
10722
|
+
});
|
|
10723
|
+
return fallback;
|
|
10724
|
+
}
|
|
10725
|
+
const reader = body.getReader();
|
|
10726
|
+
const chunks = [];
|
|
10727
|
+
let total = 0;
|
|
10728
|
+
try {
|
|
10729
|
+
while (true) {
|
|
10730
|
+
const { done, value } = await reader.read();
|
|
10731
|
+
if (done) break;
|
|
10732
|
+
if (value?.length) {
|
|
10733
|
+
total += value.length;
|
|
10734
|
+
if (total > maxBytes) {
|
|
10735
|
+
try {
|
|
10736
|
+
await reader.cancel();
|
|
10737
|
+
} catch {}
|
|
10738
|
+
throw onOverflow({
|
|
10739
|
+
size: total,
|
|
10740
|
+
maxBytes,
|
|
10741
|
+
res
|
|
10742
|
+
});
|
|
10743
|
+
}
|
|
10744
|
+
chunks.push(value);
|
|
10745
|
+
}
|
|
10746
|
+
}
|
|
10747
|
+
} finally {
|
|
10748
|
+
try {
|
|
10749
|
+
reader.releaseLock();
|
|
10750
|
+
} catch {}
|
|
10751
|
+
}
|
|
10752
|
+
return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)), total);
|
|
10753
|
+
}
|
|
10754
|
+
|
|
10755
|
+
//#endregion
|
|
10756
|
+
//#region src/media/fetch.ts
|
|
10757
|
+
var MediaFetchError = class extends Error {
|
|
10758
|
+
constructor(code, message) {
|
|
10759
|
+
super(message);
|
|
10760
|
+
this.code = code;
|
|
10761
|
+
this.name = "MediaFetchError";
|
|
10762
|
+
}
|
|
10763
|
+
};
|
|
10764
|
+
function stripQuotes(value) {
|
|
10765
|
+
return value.replace(/^["']|["']$/g, "");
|
|
10766
|
+
}
|
|
10767
|
+
function parseContentDispositionFileName(header) {
|
|
10768
|
+
if (!header) return;
|
|
10769
|
+
const starMatch = /filename\*\s*=\s*([^;]+)/i.exec(header);
|
|
10770
|
+
if (starMatch?.[1]) {
|
|
10771
|
+
const cleaned = stripQuotes(starMatch[1].trim());
|
|
10772
|
+
const encoded = cleaned.split("''").slice(1).join("''") || cleaned;
|
|
10773
|
+
try {
|
|
10774
|
+
return path.basename(decodeURIComponent(encoded));
|
|
10775
|
+
} catch {
|
|
10776
|
+
return path.basename(encoded);
|
|
10777
|
+
}
|
|
10778
|
+
}
|
|
10779
|
+
const match = /filename\s*=\s*([^;]+)/i.exec(header);
|
|
10780
|
+
if (match?.[1]) return path.basename(stripQuotes(match[1].trim()));
|
|
10781
|
+
}
|
|
10782
|
+
async function readErrorBodySnippet(res, maxChars = 200) {
|
|
10783
|
+
try {
|
|
10784
|
+
const text = await res.text();
|
|
10785
|
+
if (!text) return;
|
|
10786
|
+
const collapsed = text.replace(/\s+/g, " ").trim();
|
|
10787
|
+
if (!collapsed) return;
|
|
10788
|
+
if (collapsed.length <= maxChars) return collapsed;
|
|
10789
|
+
return `${collapsed.slice(0, maxChars)}…`;
|
|
10790
|
+
} catch {
|
|
10791
|
+
return;
|
|
10792
|
+
}
|
|
10793
|
+
}
|
|
10794
|
+
async function fetchRemoteMedia(options) {
|
|
10795
|
+
const { url, fetchImpl, filePathHint, maxBytes, maxRedirects, ssrfPolicy, lookupFn } = options;
|
|
10796
|
+
let res;
|
|
10797
|
+
let finalUrl = url;
|
|
10798
|
+
let release = null;
|
|
10799
|
+
try {
|
|
10800
|
+
const result = await fetchWithSsrFGuard({
|
|
10801
|
+
url,
|
|
10802
|
+
fetchImpl,
|
|
10803
|
+
maxRedirects,
|
|
10804
|
+
policy: ssrfPolicy,
|
|
10805
|
+
lookupFn
|
|
10806
|
+
});
|
|
10807
|
+
res = result.response;
|
|
10808
|
+
finalUrl = result.finalUrl;
|
|
10809
|
+
release = result.release;
|
|
10810
|
+
} catch (err) {
|
|
10811
|
+
throw new MediaFetchError("fetch_failed", `Failed to fetch media from ${url}: ${String(err)}`);
|
|
10812
|
+
}
|
|
10813
|
+
try {
|
|
10814
|
+
if (!res.ok) {
|
|
10815
|
+
const statusText = res.statusText ? ` ${res.statusText}` : "";
|
|
10816
|
+
const redirected = finalUrl !== url ? ` (redirected to ${finalUrl})` : "";
|
|
10817
|
+
let detail = `HTTP ${res.status}${statusText}`;
|
|
10818
|
+
if (!res.body) detail = `HTTP ${res.status}${statusText}; empty response body`;
|
|
10819
|
+
else {
|
|
10820
|
+
const snippet = await readErrorBodySnippet(res);
|
|
10821
|
+
if (snippet) detail += `; body: ${snippet}`;
|
|
10822
|
+
}
|
|
10823
|
+
throw new MediaFetchError("http_error", `Failed to fetch media from ${url}${redirected}: ${detail}`);
|
|
10824
|
+
}
|
|
10825
|
+
const contentLength = res.headers.get("content-length");
|
|
10826
|
+
if (maxBytes && contentLength) {
|
|
10827
|
+
const length = Number(contentLength);
|
|
10828
|
+
if (Number.isFinite(length) && length > maxBytes) throw new MediaFetchError("max_bytes", `Failed to fetch media from ${url}: content length ${length} exceeds maxBytes ${maxBytes}`);
|
|
10829
|
+
}
|
|
10830
|
+
const buffer = maxBytes ? await readResponseWithLimit(res, maxBytes, { onOverflow: ({ maxBytes, res }) => new MediaFetchError("max_bytes", `Failed to fetch media from ${res.url || url}: payload exceeds maxBytes ${maxBytes}`) }) : Buffer.from(await res.arrayBuffer());
|
|
10831
|
+
let fileNameFromUrl;
|
|
10832
|
+
try {
|
|
10833
|
+
const parsed = new URL(finalUrl);
|
|
10834
|
+
fileNameFromUrl = path.basename(parsed.pathname) || void 0;
|
|
10835
|
+
} catch {}
|
|
10836
|
+
const headerFileName = parseContentDispositionFileName(res.headers.get("content-disposition"));
|
|
10837
|
+
let fileName = headerFileName || fileNameFromUrl || (filePathHint ? path.basename(filePathHint) : void 0);
|
|
10838
|
+
const filePathForMime = headerFileName && path.extname(headerFileName) ? headerFileName : filePathHint ?? finalUrl;
|
|
10839
|
+
const contentType = await detectMime({
|
|
10840
|
+
buffer,
|
|
10841
|
+
headerMime: res.headers.get("content-type"),
|
|
10842
|
+
filePath: filePathForMime
|
|
10843
|
+
});
|
|
10844
|
+
if (fileName && !path.extname(fileName) && contentType) {
|
|
10845
|
+
const ext = extensionForMime(contentType);
|
|
10846
|
+
if (ext) fileName = `${fileName}${ext}`;
|
|
10847
|
+
}
|
|
10848
|
+
return {
|
|
10849
|
+
buffer,
|
|
10850
|
+
contentType: contentType ?? void 0,
|
|
10851
|
+
fileName
|
|
10852
|
+
};
|
|
10853
|
+
} finally {
|
|
10854
|
+
if (release) await release();
|
|
10855
|
+
}
|
|
10856
|
+
}
|
|
10857
|
+
|
|
10858
|
+
//#endregion
|
|
10859
|
+
//#region src/middleware/media-resolver.ts
|
|
10860
|
+
/** Max download size for inbound channel media (100 MB). */
|
|
10861
|
+
const MAX_INBOUND_MEDIA_BYTES = 100 * 1024 * 1024;
|
|
10862
|
+
/**
|
|
10863
|
+
* Resolve an array of media URLs (HTTP or local paths) into MediaAttachment
|
|
10864
|
+
* objects suitable for passing to {@link AgentRuntime.execute}.
|
|
10865
|
+
*
|
|
10866
|
+
* Remote URLs are downloaded into `tempDir` so that CLI runtimes can access
|
|
10867
|
+
* them as local files. Local paths are validated for MIME type only.
|
|
10868
|
+
*
|
|
10869
|
+
* Individual resolution failures are silently skipped — a single bad URL
|
|
10870
|
+
* should not prevent the rest of the message from being processed.
|
|
10871
|
+
*/
|
|
10872
|
+
async function resolveMediaAttachments(mediaUrls, tempDir) {
|
|
10873
|
+
const results = [];
|
|
10874
|
+
for (const [index, url] of mediaUrls.entries()) try {
|
|
10875
|
+
const attachment = await resolveOne(url, tempDir, index);
|
|
10876
|
+
if (attachment) {
|
|
10877
|
+
logDebug(`[media-resolver] resolved: url=${url} mime=${attachment.mimeType} path=${attachment.filePath}`);
|
|
10878
|
+
results.push(attachment);
|
|
10879
|
+
}
|
|
10880
|
+
} catch (err) {
|
|
10881
|
+
logDebug(`[media-resolver] failed: url=${url} error=${String(err)}`);
|
|
10882
|
+
}
|
|
10883
|
+
return results;
|
|
10884
|
+
}
|
|
10885
|
+
async function resolveOne(url, tempDir, index) {
|
|
10886
|
+
if (/^https?:\/\//i.test(url)) return downloadRemote(url, tempDir, index);
|
|
10887
|
+
return resolveLocal(url);
|
|
10888
|
+
}
|
|
10889
|
+
async function downloadRemote(url, tempDir, index) {
|
|
10890
|
+
const fetched = await fetchRemoteMedia({
|
|
10891
|
+
url,
|
|
10892
|
+
maxBytes: MAX_INBOUND_MEDIA_BYTES
|
|
10893
|
+
});
|
|
10894
|
+
const mimeType = fetched.contentType ?? "application/octet-stream";
|
|
10895
|
+
const fileName = `inbound-media-${index}${extensionForMime(mimeType) ?? ""}`;
|
|
10896
|
+
const filePath = join(tempDir, fileName);
|
|
10897
|
+
await writeFile(filePath, fetched.buffer);
|
|
10898
|
+
return {
|
|
10899
|
+
mimeType,
|
|
10900
|
+
filePath,
|
|
10901
|
+
sourceUrl: url,
|
|
10902
|
+
fileName: fetched.fileName ?? fileName
|
|
10903
|
+
};
|
|
10904
|
+
}
|
|
10905
|
+
async function resolveLocal(filePath) {
|
|
10906
|
+
return {
|
|
10907
|
+
mimeType: await detectMime({ filePath }) ?? "application/octet-stream",
|
|
10908
|
+
filePath
|
|
10909
|
+
};
|
|
10910
|
+
}
|
|
10911
|
+
|
|
10061
10912
|
//#endregion
|
|
10062
10913
|
//#region src/middleware/cli-runtime-base.ts
|
|
10063
10914
|
/**
|
|
@@ -10088,11 +10939,18 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10088
10939
|
}
|
|
10089
10940
|
async *execute(params) {
|
|
10090
10941
|
const args = this.buildArgs(params);
|
|
10942
|
+
if (params.extraArgs && params.extraArgs.length > 0) args.push(...params.extraArgs);
|
|
10943
|
+
const runtimeEnv = this.buildEnv(params);
|
|
10944
|
+
const callerEnv = params.env ?? {};
|
|
10091
10945
|
const env = {
|
|
10092
10946
|
...process.env,
|
|
10093
|
-
...
|
|
10094
|
-
...
|
|
10947
|
+
...runtimeEnv,
|
|
10948
|
+
...callerEnv
|
|
10095
10949
|
};
|
|
10950
|
+
logDebug(`[agent-runtime] spawn: ${this.command} ${args.map((a) => JSON.stringify(a)).join(" ")}`);
|
|
10951
|
+
logDebug(`[agent-runtime] cwd: ${params.workingDirectory ?? process.cwd()}`);
|
|
10952
|
+
if (Object.keys(runtimeEnv).length > 0) logDebug(`[agent-runtime] runtime env keys: ${Object.keys(runtimeEnv).join(", ")}`);
|
|
10953
|
+
if (Object.keys(callerEnv).length > 0) logDebug(`[agent-runtime] caller env keys: ${Object.keys(callerEnv).join(", ")}`);
|
|
10096
10954
|
const child = spawn(this.command, args, {
|
|
10097
10955
|
cwd: params.workingDirectory,
|
|
10098
10956
|
env,
|
|
@@ -10102,9 +10960,11 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10102
10960
|
"pipe"
|
|
10103
10961
|
]
|
|
10104
10962
|
});
|
|
10963
|
+
logDebug(`[agent-runtime] spawned pid=${child.pid}`);
|
|
10105
10964
|
const startMs = Date.now();
|
|
10106
10965
|
const stderrChunks = [];
|
|
10107
10966
|
let aborted = false;
|
|
10967
|
+
let yieldedEvents = false;
|
|
10108
10968
|
let escalationTimer;
|
|
10109
10969
|
const killWithEscalation = () => {
|
|
10110
10970
|
if (escalationTimer === void 0) escalationTimer = setTimeout(() => {
|
|
@@ -10126,6 +10986,7 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10126
10986
|
if (watchdogTimer !== void 0) clearTimeout(watchdogTimer);
|
|
10127
10987
|
watchdogTimer = setTimeout(() => {
|
|
10128
10988
|
watchdogFired = true;
|
|
10989
|
+
logDebug(`[agent-runtime] pid=${child.pid}: watchdog timeout after ${this.timeoutMs}ms`);
|
|
10129
10990
|
killWithEscalation();
|
|
10130
10991
|
}, this.timeoutMs);
|
|
10131
10992
|
};
|
|
@@ -10165,10 +11026,14 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10165
11026
|
});
|
|
10166
11027
|
});
|
|
10167
11028
|
});
|
|
10168
|
-
if (this.supportsStdinPrompt && params.prompt.length > CLIRuntimeBase.STDIN_PROMPT_THRESHOLD && child.stdin)
|
|
11029
|
+
if (this.supportsStdinPrompt && params.prompt.length > CLIRuntimeBase.STDIN_PROMPT_THRESHOLD && child.stdin) {
|
|
11030
|
+
logDebug(`[agent-runtime] pid=${child.pid}: delivering prompt via stdin (${params.prompt.length} chars)`);
|
|
11031
|
+
child.stdin.write(params.prompt);
|
|
11032
|
+
}
|
|
10169
11033
|
child.stdin?.end();
|
|
10170
11034
|
const onAbort = () => {
|
|
10171
11035
|
aborted = true;
|
|
11036
|
+
logDebug(`[agent-runtime] pid=${child.pid}: abort signal received`);
|
|
10172
11037
|
killWithEscalation();
|
|
10173
11038
|
};
|
|
10174
11039
|
if (params.abortSignal) if (params.abortSignal.aborted) {
|
|
@@ -10183,6 +11048,7 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10183
11048
|
while (eventQueue.length > 0) {
|
|
10184
11049
|
const event = eventQueue.shift();
|
|
10185
11050
|
if (event === null || event === void 0) break;
|
|
11051
|
+
yieldedEvents = true;
|
|
10186
11052
|
yield event;
|
|
10187
11053
|
}
|
|
10188
11054
|
}
|
|
@@ -10190,9 +11056,16 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10190
11056
|
if (watchdogTimer !== void 0) clearTimeout(watchdogTimer);
|
|
10191
11057
|
params.abortSignal?.removeEventListener("abort", onAbort);
|
|
10192
11058
|
}
|
|
10193
|
-
await exitPromise;
|
|
11059
|
+
const { code: exitCode, signal: exitSignal } = await exitPromise;
|
|
10194
11060
|
if (escalationTimer !== void 0) clearTimeout(escalationTimer);
|
|
10195
11061
|
const durationMs = Date.now() - startMs;
|
|
11062
|
+
logDebug(`[agent-runtime] pid=${child.pid}: exited code=${exitCode} signal=${exitSignal} duration=${durationMs}ms`);
|
|
11063
|
+
const stderr = stderrChunks.join("");
|
|
11064
|
+
if (stderr && (exitCode !== 0 || !yieldedEvents)) yield {
|
|
11065
|
+
type: "error",
|
|
11066
|
+
message: stderr.trim(),
|
|
11067
|
+
code: "CLI_STDERR"
|
|
11068
|
+
};
|
|
10196
11069
|
if (watchdogFired) yield {
|
|
10197
11070
|
type: "error",
|
|
10198
11071
|
message: `Watchdog timeout: no output for ${this.timeoutMs}ms`,
|
|
@@ -10210,7 +11083,8 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10210
11083
|
sessionId: void 0,
|
|
10211
11084
|
durationMs,
|
|
10212
11085
|
usage: void 0,
|
|
10213
|
-
aborted
|
|
11086
|
+
aborted,
|
|
11087
|
+
stderr: stderr || void 0
|
|
10214
11088
|
}
|
|
10215
11089
|
};
|
|
10216
11090
|
}
|
|
@@ -10225,6 +11099,10 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
10225
11099
|
var ClaudeCliRuntime = class extends CLIRuntimeBase {
|
|
10226
11100
|
constructor() {
|
|
10227
11101
|
super("claude");
|
|
11102
|
+
this.mediaCapabilities = {
|
|
11103
|
+
acceptsInbound: ["image/"],
|
|
11104
|
+
emitsOutbound: false
|
|
11105
|
+
};
|
|
10228
11106
|
this.accumulatedText = "";
|
|
10229
11107
|
this.toolBuffer = null;
|
|
10230
11108
|
}
|
|
@@ -10261,6 +11139,11 @@ var ClaudeCliRuntime = class extends CLIRuntimeBase {
|
|
|
10261
11139
|
}
|
|
10262
11140
|
if (parsed.type === "result") {
|
|
10263
11141
|
this.storeResultData(parsed);
|
|
11142
|
+
if (parsed.is_error === true && typeof parsed.result === "string" && parsed.result) return {
|
|
11143
|
+
type: "error",
|
|
11144
|
+
message: parsed.result,
|
|
11145
|
+
code: "CLI_ERROR"
|
|
11146
|
+
};
|
|
10264
11147
|
return null;
|
|
10265
11148
|
}
|
|
10266
11149
|
return null;
|
|
@@ -10303,6 +11186,10 @@ var ClaudeCliRuntime = class extends CLIRuntimeBase {
|
|
|
10303
11186
|
if (this.toolBuffer) this.toolBuffer.input += delta.partial_json;
|
|
10304
11187
|
return null;
|
|
10305
11188
|
}
|
|
11189
|
+
if (delta.type === "thinking_delta" && typeof delta.thinking === "string") return {
|
|
11190
|
+
type: "thinking",
|
|
11191
|
+
text: delta.thinking
|
|
11192
|
+
};
|
|
10306
11193
|
return null;
|
|
10307
11194
|
}
|
|
10308
11195
|
handleContentBlockStop() {
|
|
@@ -10385,6 +11272,10 @@ function parseUsage(raw) {
|
|
|
10385
11272
|
var CodexCliRuntime = class extends CLIRuntimeBase {
|
|
10386
11273
|
constructor() {
|
|
10387
11274
|
super("codex");
|
|
11275
|
+
this.mediaCapabilities = {
|
|
11276
|
+
acceptsInbound: [],
|
|
11277
|
+
emitsOutbound: false
|
|
11278
|
+
};
|
|
10388
11279
|
this.accumulatedText = "";
|
|
10389
11280
|
this.lastEmittedTextLength = 0;
|
|
10390
11281
|
this.itemCounter = 0;
|
|
@@ -10466,12 +11357,22 @@ var CodexCliRuntime = class extends CLIRuntimeBase {
|
|
|
10466
11357
|
case "agent_message":
|
|
10467
11358
|
this.lastEmittedTextLength = 0;
|
|
10468
11359
|
return null;
|
|
11360
|
+
case "reasoning": return null;
|
|
10469
11361
|
default: return null;
|
|
10470
11362
|
}
|
|
10471
11363
|
}
|
|
10472
11364
|
handleItemUpdated(parsed) {
|
|
10473
11365
|
const item = isObject$2(parsed.item) ? parsed.item : null;
|
|
10474
|
-
if (!item
|
|
11366
|
+
if (!item) return null;
|
|
11367
|
+
if (item.type === "reasoning") {
|
|
11368
|
+
const text = this.extractReasoningText(item);
|
|
11369
|
+
if (text) return {
|
|
11370
|
+
type: "thinking",
|
|
11371
|
+
text
|
|
11372
|
+
};
|
|
11373
|
+
return null;
|
|
11374
|
+
}
|
|
11375
|
+
if (item.type !== "agent_message") return null;
|
|
10475
11376
|
const fullText = this.extractMessageText(item);
|
|
10476
11377
|
if (fullText === void 0) return null;
|
|
10477
11378
|
const delta = fullText.substring(this.lastEmittedTextLength);
|
|
@@ -10504,6 +11405,14 @@ var CodexCliRuntime = class extends CLIRuntimeBase {
|
|
|
10504
11405
|
}
|
|
10505
11406
|
return null;
|
|
10506
11407
|
}
|
|
11408
|
+
case "reasoning": {
|
|
11409
|
+
const text = this.extractReasoningText(item);
|
|
11410
|
+
if (text) return {
|
|
11411
|
+
type: "thinking",
|
|
11412
|
+
text
|
|
11413
|
+
};
|
|
11414
|
+
return null;
|
|
11415
|
+
}
|
|
10507
11416
|
case "command_execution": {
|
|
10508
11417
|
const toolId = this.currentToolId ?? this.extractToolId(item);
|
|
10509
11418
|
this.currentToolId = void 0;
|
|
@@ -10573,6 +11482,14 @@ var CodexCliRuntime = class extends CLIRuntimeBase {
|
|
|
10573
11482
|
}
|
|
10574
11483
|
if (typeof item.text === "string") return item.text;
|
|
10575
11484
|
}
|
|
11485
|
+
extractReasoningText(item) {
|
|
11486
|
+
if (Array.isArray(item.summary)) {
|
|
11487
|
+
const textParts = [];
|
|
11488
|
+
for (const part of item.summary) if (isObject$2(part) && part.type === "summary_text" && typeof part.text === "string") textParts.push(part.text);
|
|
11489
|
+
if (textParts.length > 0) return textParts.join("");
|
|
11490
|
+
}
|
|
11491
|
+
if (typeof item.text === "string") return item.text;
|
|
11492
|
+
}
|
|
10576
11493
|
resetState() {
|
|
10577
11494
|
this.currentSessionId = void 0;
|
|
10578
11495
|
this.accumulatedText = "";
|
|
@@ -10709,6 +11626,14 @@ function isObject$2(value) {
|
|
|
10709
11626
|
var GeminiCliRuntime = class extends CLIRuntimeBase {
|
|
10710
11627
|
constructor() {
|
|
10711
11628
|
super("gemini");
|
|
11629
|
+
this.mediaCapabilities = {
|
|
11630
|
+
acceptsInbound: [
|
|
11631
|
+
"image/",
|
|
11632
|
+
"audio/",
|
|
11633
|
+
"video/"
|
|
11634
|
+
],
|
|
11635
|
+
emitsOutbound: false
|
|
11636
|
+
};
|
|
10712
11637
|
this.accumulatedText = "";
|
|
10713
11638
|
}
|
|
10714
11639
|
get supportsStdinPrompt() {
|
|
@@ -10897,6 +11822,10 @@ function isObject$1(value) {
|
|
|
10897
11822
|
var OpenCodeCliRuntime = class extends CLIRuntimeBase {
|
|
10898
11823
|
constructor() {
|
|
10899
11824
|
super("opencode");
|
|
11825
|
+
this.mediaCapabilities = {
|
|
11826
|
+
acceptsInbound: [],
|
|
11827
|
+
emitsOutbound: false
|
|
11828
|
+
};
|
|
10900
11829
|
this.accumulatedText = "";
|
|
10901
11830
|
this.pendingEvents = [];
|
|
10902
11831
|
this.toolCounter = 0;
|
|
@@ -10935,7 +11864,7 @@ var OpenCodeCliRuntime = class extends CLIRuntimeBase {
|
|
|
10935
11864
|
case "tool_use": return this.handleToolUse(data);
|
|
10936
11865
|
case "step_start": return null;
|
|
10937
11866
|
case "step_finish": return this.handleStepFinish(data);
|
|
10938
|
-
case "reasoning": return
|
|
11867
|
+
case "reasoning": return this.handleReasoning(data);
|
|
10939
11868
|
case "error": return this.handleError(data);
|
|
10940
11869
|
default: return null;
|
|
10941
11870
|
}
|
|
@@ -10981,6 +11910,14 @@ var OpenCodeCliRuntime = class extends CLIRuntimeBase {
|
|
|
10981
11910
|
message: typeof parsed.message === "string" ? parsed.message : "Unknown error"
|
|
10982
11911
|
};
|
|
10983
11912
|
}
|
|
11913
|
+
handleReasoning(parsed) {
|
|
11914
|
+
const content = typeof parsed.text === "string" ? parsed.text : typeof parsed.content === "string" ? parsed.content : "";
|
|
11915
|
+
if (!content) return null;
|
|
11916
|
+
return {
|
|
11917
|
+
type: "thinking",
|
|
11918
|
+
text: content
|
|
11919
|
+
};
|
|
11920
|
+
}
|
|
10984
11921
|
enrichDoneEvent(event) {
|
|
10985
11922
|
const { result } = event;
|
|
10986
11923
|
result.text = this.accumulatedText;
|
|
@@ -11075,12 +12012,42 @@ const SUPPORTED_PROVIDERS = [
|
|
|
11075
12012
|
"codex",
|
|
11076
12013
|
"opencode"
|
|
11077
12014
|
];
|
|
12015
|
+
const validatedCommands = /* @__PURE__ */ new Set();
|
|
12016
|
+
/**
|
|
12017
|
+
* Verify that a CLI binary exists on PATH.
|
|
12018
|
+
*
|
|
12019
|
+
* Results are cached per process lifetime so the `which` lookup runs at most
|
|
12020
|
+
* once per command.
|
|
12021
|
+
*/
|
|
12022
|
+
function validateExecutable(command) {
|
|
12023
|
+
if (validatedCommands.has(command)) {
|
|
12024
|
+
logDebug(`[runtime-factory] executable already validated: ${command}`);
|
|
12025
|
+
return;
|
|
12026
|
+
}
|
|
12027
|
+
try {
|
|
12028
|
+
execFileSync("which", [command], { stdio: "ignore" });
|
|
12029
|
+
logDebug(`[runtime-factory] executable validated: ${command}`);
|
|
12030
|
+
validatedCommands.add(command);
|
|
12031
|
+
} catch {
|
|
12032
|
+
throw new Error(`Runtime '${command}' is configured but the '${command}' binary was not found on PATH. Install it or set agents.defaults.runtime to a different provider.`);
|
|
12033
|
+
}
|
|
12034
|
+
}
|
|
11078
12035
|
function createCliRuntime(provider) {
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
case "
|
|
11083
|
-
|
|
12036
|
+
const normalized = provider.trim().toLowerCase();
|
|
12037
|
+
logDebug(`[runtime-factory] creating runtime: provider=${normalized}`);
|
|
12038
|
+
switch (normalized) {
|
|
12039
|
+
case "claude":
|
|
12040
|
+
validateExecutable(normalized);
|
|
12041
|
+
return new ClaudeCliRuntime();
|
|
12042
|
+
case "gemini":
|
|
12043
|
+
validateExecutable(normalized);
|
|
12044
|
+
return new GeminiCliRuntime();
|
|
12045
|
+
case "codex":
|
|
12046
|
+
validateExecutable(normalized);
|
|
12047
|
+
return new CodexCliRuntime();
|
|
12048
|
+
case "opencode":
|
|
12049
|
+
validateExecutable(normalized);
|
|
12050
|
+
return new OpenCodeCliRuntime();
|
|
11084
12051
|
default: throw new Error(`Unknown runtime provider "${provider}". Supported providers: ${SUPPORTED_PROVIDERS.join(", ")}`);
|
|
11085
12052
|
}
|
|
11086
12053
|
}
|
|
@@ -11231,6 +12198,8 @@ var ChannelBridge = class {
|
|
|
11231
12198
|
#workspaceDir;
|
|
11232
12199
|
#chunkLimit;
|
|
11233
12200
|
#mcpServerPath;
|
|
12201
|
+
#runtimeArgs;
|
|
12202
|
+
#runtimeEnv;
|
|
11234
12203
|
constructor(options) {
|
|
11235
12204
|
this.#provider = options.provider;
|
|
11236
12205
|
this.#sessionMap = options.sessionMap;
|
|
@@ -11239,6 +12208,8 @@ var ChannelBridge = class {
|
|
|
11239
12208
|
this.#workspaceDir = options.workspaceDir ?? DEFAULT_WORKSPACE_DIR;
|
|
11240
12209
|
this.#chunkLimit = options.chunkLimit;
|
|
11241
12210
|
this.#mcpServerPath = options.mcpServerPath ?? DEFAULT_MCP_SERVER_PATH;
|
|
12211
|
+
this.#runtimeArgs = options.runtimeArgs;
|
|
12212
|
+
this.#runtimeEnv = options.runtimeEnv;
|
|
11242
12213
|
}
|
|
11243
12214
|
/**
|
|
11244
12215
|
* Process an incoming channel message through the full agent execution pipeline.
|
|
@@ -11248,7 +12219,9 @@ var ChannelBridge = class {
|
|
|
11248
12219
|
*/
|
|
11249
12220
|
async handle(message, callbacks, abortSignal) {
|
|
11250
12221
|
const sessionKey = buildSessionKey(message);
|
|
12222
|
+
logDebug(`[channel-bridge] handle: channel=${message.provider} from=${message.from} channelId=${message.channelId} threadId=${message.replyToId ?? "none"} agentId=${message.agentId ?? "default"} media=${message.mediaUrls?.length ?? 0}`);
|
|
11251
12223
|
const existingSessionId = await this.#sessionMap.get(sessionKey);
|
|
12224
|
+
logDebug(`[channel-bridge] session lookup: key=${formatSessionKeyString(sessionKey)} ${existingSessionId ? `hit=${existingSessionId}` : "miss"}`);
|
|
11252
12225
|
const hookRunner = getGlobalHookRunner();
|
|
11253
12226
|
if (existingSessionId && hookRunner?.hasHooks("session_resumed")) await hookRunner.runSessionResumed({
|
|
11254
12227
|
sessionId: existingSessionId,
|
|
@@ -11275,9 +12248,10 @@ var ChannelBridge = class {
|
|
|
11275
12248
|
const sideEffectsFile = join(invocationDir, "side-effects.ndjson");
|
|
11276
12249
|
try {
|
|
11277
12250
|
const mcpServers = this.#buildMcpConfig(message, sessionKey, sideEffectsFile);
|
|
12251
|
+
logDebug(`[channel-bridge] creating runtime: provider=${this.#provider}`);
|
|
11278
12252
|
const runtime = createCliRuntime(this.#provider);
|
|
11279
12253
|
let workspaceDir = this.#workspaceDir;
|
|
11280
|
-
let
|
|
12254
|
+
let hookEnv;
|
|
11281
12255
|
const runId = randomUUID();
|
|
11282
12256
|
if (hookRunner?.hasHooks("before_runtime_spawn")) {
|
|
11283
12257
|
const spawnResult = await hookRunner.runBeforeRuntimeSpawn({
|
|
@@ -11293,9 +12267,23 @@ var ChannelBridge = class {
|
|
|
11293
12267
|
channelId: message.channelId,
|
|
11294
12268
|
runtimeName: this.#provider
|
|
11295
12269
|
});
|
|
11296
|
-
if (spawnResult?.workspaceDir)
|
|
11297
|
-
|
|
12270
|
+
if (spawnResult?.workspaceDir) {
|
|
12271
|
+
logDebug(`[channel-bridge] hook overrode workspaceDir: ${this.#workspaceDir} -> ${spawnResult.workspaceDir}`);
|
|
12272
|
+
workspaceDir = spawnResult.workspaceDir;
|
|
12273
|
+
}
|
|
12274
|
+
if (spawnResult?.env) {
|
|
12275
|
+
logDebug(`[channel-bridge] hook injected env keys: ${Object.keys(spawnResult.env).join(", ")}`);
|
|
12276
|
+
hookEnv = spawnResult.env;
|
|
12277
|
+
}
|
|
11298
12278
|
}
|
|
12279
|
+
const resolvedMedia = message.mediaUrls?.length ? await resolveMediaAttachments(message.mediaUrls, invocationDir) : void 0;
|
|
12280
|
+
if (resolvedMedia?.length) logDebug(`[channel-bridge] resolved ${resolvedMedia.length}/${message.mediaUrls.length} media attachments`);
|
|
12281
|
+
const { supported: supportedMedia, unsupported: unsupportedMedia } = resolvedMedia?.length ? partitionMedia(runtime, resolvedMedia) : {
|
|
12282
|
+
supported: [],
|
|
12283
|
+
unsupported: []
|
|
12284
|
+
};
|
|
12285
|
+
const mediaWarning = formatUnsupportedMediaWarning(unsupportedMedia, this.#provider);
|
|
12286
|
+
if (unsupportedMedia.length > 0) logDebug(`[channel-bridge] unsupported media: ${unsupportedMedia.length} attachment(s) not accepted by ${this.#provider}`);
|
|
11299
12287
|
const adapter = new DeliveryAdapter(this.#chunkLimit !== void 0 ? { chunkLimit: this.#chunkLimit } : void 0);
|
|
11300
12288
|
let runResult;
|
|
11301
12289
|
let lastError;
|
|
@@ -11303,11 +12291,16 @@ var ChannelBridge = class {
|
|
|
11303
12291
|
try {
|
|
11304
12292
|
const captured = captureResult(runtime.execute({
|
|
11305
12293
|
prompt: systemPrompt + (message.extraContext ? "\n\n" + message.extraContext : "") + "\n\n" + message.text,
|
|
12294
|
+
media: supportedMedia?.length ? supportedMedia : void 0,
|
|
11306
12295
|
sessionId: existingSessionId,
|
|
11307
12296
|
mcpServers,
|
|
11308
12297
|
abortSignal,
|
|
11309
12298
|
workingDirectory: workspaceDir,
|
|
11310
|
-
env:
|
|
12299
|
+
env: this.#runtimeEnv || hookEnv ? {
|
|
12300
|
+
...this.#runtimeEnv,
|
|
12301
|
+
...hookEnv
|
|
12302
|
+
} : void 0,
|
|
12303
|
+
extraArgs: this.#runtimeArgs
|
|
11311
12304
|
}));
|
|
11312
12305
|
payloads = await adapter.process(captured.events, callbacks);
|
|
11313
12306
|
runResult = captured.getResult();
|
|
@@ -11315,6 +12308,7 @@ var ChannelBridge = class {
|
|
|
11315
12308
|
} catch (err) {
|
|
11316
12309
|
const errMsg = String(err);
|
|
11317
12310
|
const category = classifyError(errMsg);
|
|
12311
|
+
logDebug(`[channel-bridge] runtime threw: category=${category} error=${errMsg.slice(0, 500)}`);
|
|
11318
12312
|
lastError = errMsg;
|
|
11319
12313
|
payloads = [];
|
|
11320
12314
|
runResult = {
|
|
@@ -11322,13 +12316,18 @@ var ChannelBridge = class {
|
|
|
11322
12316
|
errorSubtype: category === "context_overflow" ? "context_window" : category
|
|
11323
12317
|
};
|
|
11324
12318
|
}
|
|
12319
|
+
if (mediaWarning) payloads.unshift({ text: mediaWarning });
|
|
11325
12320
|
let mcp;
|
|
11326
12321
|
try {
|
|
11327
12322
|
mcp = await readMcpSideEffects(sideEffectsFile);
|
|
11328
12323
|
} catch {
|
|
11329
12324
|
mcp = { ...EMPTY_SIDE_EFFECTS };
|
|
11330
12325
|
}
|
|
11331
|
-
|
|
12326
|
+
logDebug(`[channel-bridge] side effects: sentTexts=${mcp.sentTexts.length} sentMedia=${mcp.sentMediaUrls.length} cronAdds=${mcp.cronAdds}`);
|
|
12327
|
+
if (runResult?.sessionId) {
|
|
12328
|
+
logDebug(`[channel-bridge] session update: key=${formatSessionKeyString(sessionKey)} sessionId=${runResult.sessionId}`);
|
|
12329
|
+
await this.#sessionMap.set(sessionKey, runResult.sessionId);
|
|
12330
|
+
}
|
|
11332
12331
|
const finalResult = runResult ?? { ...DEFAULT_RUN_RESULT };
|
|
11333
12332
|
if (hookRunner) {
|
|
11334
12333
|
const runtimeCtx = {
|
|
@@ -11356,6 +12355,7 @@ var ChannelBridge = class {
|
|
|
11356
12355
|
durationMs: finalResult.durationMs
|
|
11357
12356
|
}, runtimeCtx);
|
|
11358
12357
|
}
|
|
12358
|
+
logDebug(`[channel-bridge] complete: runId=${runId} duration=${finalResult.durationMs}ms payloads=${payloads.length} error=${lastError ?? "none"}`);
|
|
11359
12359
|
return {
|
|
11360
12360
|
payloads,
|
|
11361
12361
|
run: finalResult,
|
|
@@ -11517,4 +12517,4 @@ function resolveGatewayCredentialsFromConfig(params) {
|
|
|
11517
12517
|
}
|
|
11518
12518
|
|
|
11519
12519
|
//#endregion
|
|
11520
|
-
export { ChannelBridge,
|
|
12520
|
+
export { ChannelBridge, ensureAgentWorkspace, loadSessionStore, resolveAgentDir, resolveAgentIdentity, resolveAgentTimeoutMs, resolveAgentWorkspaceDir, resolveGatewayCredentialsFromConfig, resolveGatewayPort, resolveSessionFilePath, resolveStorePath, saveSessionStore };
|