remoteclaw 0.1.0-next.049f396 → 0.1.0-next.05abcca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/dist/accounts-79XhjwAj.js +32 -0
- package/dist/accounts-B1M3fOxL.js +272 -0
- package/dist/accounts-BwbvnKsW.js +205 -0
- package/dist/accounts-CIVjmTg9.js +270 -0
- package/dist/accounts-D1awQXKu.js +36 -0
- package/dist/accounts-DHkGVGUR.js +36 -0
- package/dist/accounts-P7cmIXUM.js +206 -0
- package/dist/accounts-XFgBY644.js +47 -0
- package/dist/accounts-_ZuNC5bz.js +47 -0
- package/dist/ack-reactions-BGJ9Vigf.js +621 -0
- package/dist/ack-reactions-Diu9O24z.js +621 -0
- package/dist/acp-cli-BwZ-va2P.js +1316 -0
- package/dist/acp-cli-eVKByz-j.js +1311 -0
- package/dist/active-listener--jrUO-8L.js +37 -0
- package/dist/active-listener-C7SyMcNY.js +37 -0
- package/dist/agent-BAxK2KQW.js +688 -0
- package/dist/agent-Dd5Yfhmq.js +687 -0
- package/dist/agent-helpers-5F0tdxud.js +400 -0
- package/dist/agent-helpers-Bs2nBXeI.js +400 -0
- package/dist/agent-scope-BA1HP4K6.js +114 -0
- package/dist/agent-scope-CAQLm3LP.js +116 -0
- package/dist/agents-D--9DD91.js +754 -0
- package/dist/agents.config-CmyzLYqW.js +116 -0
- package/dist/agents.config-DerBqRzk.js +116 -0
- package/dist/ansi-DtaiOnt1.js +107 -0
- package/dist/audio-ClIuKwkl.js +43 -0
- package/dist/audio-DqlIYYTb.js +43 -0
- package/dist/audit-Cn0cNCE4.js +3114 -0
- package/dist/audit-DXY4NHBC.js +3114 -0
- package/dist/auth-B-QK8JhI.js +315 -0
- package/dist/auth-C1zx1O24.js +314 -0
- package/dist/auth-DDmNYVMW.js +448 -0
- package/dist/auth-DH1wEw0w.js +448 -0
- package/dist/banner-CBWZhANO.js +294 -0
- package/dist/binaries-CYwLdubd.js +13 -0
- package/dist/bindings-DFAFatwT.js +69 -0
- package/dist/bindings-GUKIzFCp.js +69 -0
- package/dist/bonjour-discovery-AQMJqY4V.js +378 -0
- package/dist/bonjour-discovery-BLcPWHFJ.js +378 -0
- package/dist/boot/handler.js +41 -84
- package/dist/browser-cli-8Dv5ogFT.js +1690 -0
- package/dist/browser-cli-wNLo8SOy.js +1694 -0
- package/dist/build-info.json +3 -3
- package/dist/call-BTHzKFbN.js +518 -0
- package/dist/call-D_NchaCs.js +517 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/catalog-DgpN5jxU.js +186 -0
- package/dist/catalog-k056Nh93.js +186 -0
- package/dist/channel-account-context-BHIy71Yh.js +133 -0
- package/dist/channel-account-context-DXU_-EkJ.js +133 -0
- package/dist/channel-activity-BatlvP_U.js +292 -0
- package/dist/channel-activity-BhT7NQ_v.js +94 -0
- package/dist/channel-activity-CvjEwpJz.js +94 -0
- package/dist/channel-options-BCccA2WC.js +32 -0
- package/dist/channel-options-VPR_pNyS.js +33 -0
- package/dist/channel-selection-AH6_y6RS.js +51 -0
- package/dist/channel-selection-ovohyJQZ.js +51 -0
- package/dist/channel-web-APDaQ_wp.js +2134 -0
- package/dist/channel-web-BW_YuNlT.js +2132 -0
- package/dist/channels-cli-DVsZyaU5.js +1436 -0
- package/dist/channels-cli-ubrg5vcL.js +1440 -0
- package/dist/channels-status-issues-BbYNzwLp.js +18 -0
- package/dist/channels-status-issues-DRybAijg.js +18 -0
- package/dist/chat-envelope-AJFUAuBM.js +248 -0
- package/dist/chat-envelope-BrfcPlDM.js +248 -0
- package/dist/chrome-Bv2UtAMQ.js +1732 -0
- package/dist/chrome-C6Vc_7su.js +1733 -0
- package/dist/chunk-BAMyFYtF.js +341 -0
- package/dist/chunk-BzVoFUZL.js +341 -0
- package/dist/clack-prompter-C6mBTOzE.js +122 -0
- package/dist/clack-prompter-DKcYqv3o.js +121 -0
- package/dist/cleanup-utils-Cb-leJcy.js +94 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-Cs1n6-eD.js +135 -0
- package/dist/cli-Di3p1tLN.js +131 -0
- package/dist/client-B6h7bgbF.js +2311 -0
- package/dist/client-CMtdm9Ii.js +2311 -0
- package/dist/clipboard-A06eV_5C.js +31 -0
- package/dist/clipboard-DQBl3coj.js +31 -0
- package/dist/command-format-BiiNHkWG.js +18 -0
- package/dist/command-format-Dntg_tnC.js +32 -0
- package/dist/command-logger/handler.js +1 -1
- package/dist/command-registry-CCAvdWh2.js +215 -0
- package/dist/commands-D93TXYhv.js +41 -0
- package/dist/commands-UD7V7QC9.js +41 -0
- package/dist/commands-registry-CCbTtSSK.js +891 -0
- package/dist/commands-registry-De8JhZLG.js +890 -0
- package/dist/common-D4fL3S2m.js +156 -0
- package/dist/common-DXNisGxw.js +156 -0
- package/dist/completion-cli-CLo-r-UP.js +452 -0
- package/dist/completion-cli-D4ajG3yt.js +452 -0
- package/dist/config-BTH7fB_v.js +3345 -0
- package/dist/config-DwuBnd6D.js +3347 -0
- package/dist/config-cli-D0D1LSNt.js +243 -0
- package/dist/config-cli-tWsFNKQM.js +247 -0
- package/dist/config-guard-BcT7soTj.js +92 -0
- package/dist/config-guard-Bqak3bDc.js +75 -0
- package/dist/config-validation-CHEjSJ5K.js +18 -0
- package/dist/config-validation-CvgqLhyG.js +18 -0
- package/dist/configure-CK_0tFJG.js +889 -0
- package/dist/configure-D0z0kE-B.js +891 -0
- package/dist/constants-BBVTjb1j.js +75 -0
- package/dist/constants-PMRtHBHU.js +75 -0
- package/dist/control-auth-DrGYtMJM.js +397 -0
- package/dist/control-auth-KY4Qdr2I.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-DO1L6M0S.js +186 -0
- package/dist/control-ui-assets-S_TLo6Fs.js +186 -0
- package/dist/conversation-label-CDH4rKMG.js +36 -0
- package/dist/conversation-label-CMOfgCVl.js +36 -0
- package/dist/cron-cli-C7h_hLHu.js +495 -0
- package/dist/cron-cli-DTNg0Uvl.js +499 -0
- package/dist/daemon-cli-BlJS9zWM.js +737 -0
- package/dist/daemon-cli-Cfc1yszp.js +735 -0
- package/dist/daemon-cli.js +174 -1167
- package/dist/daemon-install-BbBLuLWg.js +60 -0
- package/dist/daemon-install-WEBvqVOj.js +56 -0
- package/dist/daemon-install-helpers-BVtPC2TK.js +504 -0
- package/dist/daemon-install-helpers-DVr51zvE.js +504 -0
- package/dist/deliver-EB272zWh.js +481 -0
- package/dist/deliver-iGD_woru.js +481 -0
- package/dist/delivery-queue-BDvalA10.js +244 -0
- package/dist/delivery-queue-BimvYz5E.js +244 -0
- package/dist/devices-cli-BXCOsNFc.js +323 -0
- package/dist/devices-cli-CHGdYfrz.js +319 -0
- package/dist/diagnostics-BzzhTQzK.js +35 -0
- package/dist/diagnostics-DILtxtcE.js +35 -0
- package/dist/directory-cli-COS40yI9.js +221 -0
- package/dist/directory-cli-Cb5j1JTC.js +225 -0
- package/dist/dispatcher-BUqxh_mA.js +174 -0
- package/dist/dispatcher-By-KZRWZ.js +173 -0
- package/dist/dm-policy-shared-BCp9_z3w.js +22 -0
- package/dist/dm-policy-shared-DgeKqjOu.js +22 -0
- package/dist/dns-cli-B8yyXB2N.js +203 -0
- package/dist/dns-cli-DAkTk-gM.js +199 -0
- package/dist/dock-B0bIIDS3.js +906 -0
- package/dist/dock-C3PzQ6CS.js +907 -0
- package/dist/doctor-completion-BXGEqLhU.js +92 -0
- package/dist/doctor-completion-D_mNzioP.js +92 -0
- package/dist/doctor-config-flow-BDDsR2J1.js +978 -0
- package/dist/doctor-config-flow-CwFFRUic.js +979 -0
- package/dist/enable-C3I9dWel.js +59 -0
- package/dist/enable-DnwKeWnR.js +59 -0
- package/dist/entry.js +75 -21
- package/dist/env-DyyqmxSM.js +60 -0
- package/dist/env-vars-CD2_baIP.js +43 -0
- package/dist/env-vars-a7S70ba7.js +43 -0
- package/dist/errors-0dfGxeYQ.js +35 -0
- package/dist/errors-C1kDByVU.js +35 -0
- package/dist/exec-CAk1dxq_.js +164 -0
- package/dist/exec-epNpA1aU.js +164 -0
- package/dist/export-html/template.css +0 -36
- package/dist/export-html/template.js +1 -32
- package/dist/extensionAPI.js +1765 -1590
- package/dist/fetch-BMQq41sB.js +281 -0
- package/dist/fetch-Cky99wYB.js +281 -0
- package/dist/fetch-D3tw4B4n.js +67 -0
- package/dist/fetch-DTsU2XnC.js +67 -0
- package/dist/fetch-Dgm9ZHFm.js +67 -0
- package/dist/file-lock-DWH0TfVu.js +107 -0
- package/dist/file-lock-DXW9h9ek.js +107 -0
- package/dist/fs-safe-BjSd07M4.js +115 -0
- package/dist/fs-safe-aWIhCWlb.js +125 -0
- package/dist/gateway-cli-C4y4H61g.js +24546 -0
- package/dist/gateway-cli-CtFr42NV.js +24550 -0
- package/dist/gateway-rpc-B92CH0D3.js +28 -0
- package/dist/gateway-rpc-DZNlWapO.js +28 -0
- package/dist/gmail-setup-utils-CKyh29_R.js +422 -0
- package/dist/gmail-setup-utils-DquflkMR.js +423 -0
- package/dist/health-BYl7T-4m.js +1417 -0
- package/dist/health-DdviISKg.js +1414 -0
- package/dist/health-format-BE5TK5bs.js +28 -0
- package/dist/heartbeat-visibility-BO3iRpB6.js +125 -0
- package/dist/heartbeat-visibility-Cwp4TrTv.js +125 -0
- package/dist/help-format-D3JhWp1E.js +17 -0
- package/dist/helpers-DAEoFkbn.js +10 -0
- package/dist/helpers-ndPQWl6m.js +10 -0
- package/dist/hook-runner-global-C1thol1d.js +527 -0
- package/dist/hooks-cli-BKS9uZ0H.js +1221 -0
- package/dist/hooks-cli-FLWcCr9q.js +1217 -0
- package/dist/host-env-security-BGibnCbS.js +106 -0
- package/dist/host-env-security-axRnIi8d.js +106 -0
- package/dist/image-ops-CX41n0v5.js +354 -0
- package/dist/image-ops-DSL3eFfQ.js +354 -0
- package/dist/import-BSFgt760.js +604 -0
- package/dist/import-Da1CHJJg.js +606 -0
- package/dist/inbound-context-BLy-G2Eq.js +68 -0
- package/dist/inbound-context-a5bzQvRt.js +68 -0
- package/dist/index.js +137 -108
- package/dist/inspect-BEpFbi0c.js +286 -0
- package/dist/inspect-BeNNpWna.js +286 -0
- package/dist/installs-CH7Qq_m_.js +319 -0
- package/dist/installs-CcM8H2YA.js +319 -0
- package/dist/ipv4-DNo9AFDu.js +46 -0
- package/dist/ipv4-VfoVR5uR.js +46 -0
- package/dist/ir-BPwP8hIc.js +972 -0
- package/dist/json-files-BI20PLIm.js +46 -0
- package/dist/lifecycle-core-5Zxqwa6V.js +476 -0
- package/dist/lifecycle-core-C1bGeLby.js +474 -0
- package/dist/links-CtGBIrG8.js +15 -0
- package/dist/loader-BoP3JA-r.js +22411 -0
- package/dist/loader-DXbpue-L.js +22414 -0
- package/dist/logger-ASsO5Nz-.js +49 -0
- package/dist/logging-Cd9y2AdQ.js +20 -0
- package/dist/logging-DRwtiLIS.js +1 -0
- package/dist/logging-fywhKCmE.js +1 -0
- package/dist/login-B2UXzgaB.js +61 -0
- package/dist/login-BEFL3xY9.js +62 -0
- package/dist/login-qr-C7wAz2fe.js +329 -0
- package/dist/login-qr-DWpUP1Ud.js +325 -0
- package/dist/logs-cli-CAcd-pXA.js +240 -0
- package/dist/logs-cli-D7Bzarht.js +236 -0
- package/dist/markdown-tables-BBNUZp4n.js +29 -0
- package/dist/markdown-tables-NgPcfXoF.js +29 -0
- package/dist/media-4-qOIjO-.js +971 -0
- package/dist/media-DTwJhAbE.js +9481 -0
- package/dist/message-action-names-BsNTjuBE.js +2520 -0
- package/dist/message-action-names-ocKcq8_3.js +2520 -0
- package/dist/message-channel-CtcVHawF.js +91 -0
- package/dist/message-channel-tuc9CdEw.js +91 -0
- package/dist/mime-CAqaK3kp.js +146 -0
- package/dist/mime-ViuhRuMM.js +146 -0
- package/dist/net-DSkFMHJ8.js +225 -0
- package/dist/net-DTqfFYzt.js +225 -0
- package/dist/node-cli-BeXU67eQ.js +1458 -0
- package/dist/node-cli-i2aCtnmM.js +1462 -0
- package/dist/node-service-RyMlWp8N.js +67 -0
- package/dist/node-service-TL9b6Qfz.js +67 -0
- package/dist/nodes-cli-CtqnXBMD.js +1346 -0
- package/dist/nodes-cli-DgQU3LrG.js +1350 -0
- package/dist/nodes-screen-B7HJugJ0.js +250 -0
- package/dist/nodes-screen-nCRd71Mk.js +250 -0
- package/dist/note-B6142LyJ.js +92 -0
- package/dist/note-D-EI0czq.js +92 -0
- package/dist/npm-registry-spec-PPyRXSpx.js +786 -0
- package/dist/npm-registry-spec-uUmDWe6v.js +786 -0
- package/dist/npm-resolution-BC1LqCm2.js +86 -0
- package/dist/npm-resolution-DhlhUmRF.js +86 -0
- package/dist/onboard-CGpC2ecw.js +647 -0
- package/dist/onboard-auth-cNtb3FTP.js +211 -0
- package/dist/onboard-auth-gwz-0mZ6.js +207 -0
- package/dist/onboard-channels-CXjJYzHC.js +2548 -0
- package/dist/onboard-channels-vtaIxYml.js +2549 -0
- package/dist/onboard-config-DOmXYEvJ.js +39 -0
- package/dist/onboard-config-JmR21VYa.js +39 -0
- package/dist/onboard-helpers-8afRV_Tm.js +364 -0
- package/dist/onboard-helpers-DTRrJLj-.js +363 -0
- package/dist/onboard-jLzfwoPx.js +649 -0
- package/dist/onboard-remote-CFkvVAYg.js +127 -0
- package/dist/onboard-remote-JfBnmK70.js +127 -0
- package/dist/onboarding-Dt0LKvZn.js +586 -0
- package/dist/onboarding-gMKlA2bP.js +588 -0
- package/dist/onboarding.finalize-BDML6Jx7.js +403 -0
- package/dist/onboarding.finalize-D850VgMA.js +405 -0
- package/dist/onboarding.gateway-config-DolBTXWT.js +196 -0
- package/dist/onboarding.gateway-config-rJkIamlG.js +202 -0
- package/dist/outbound-CPMaDtgC.js +220 -0
- package/dist/outbound-CYSuCMiW.js +221 -0
- package/dist/outbound-attachment-Ci02LXoq.js +18 -0
- package/dist/outbound-attachment-CqZ7Qc_o.js +18 -0
- package/dist/outbound-attachment-CuqWdsdV.js +18 -0
- package/dist/pairing-cli-B9JKvvST.js +126 -0
- package/dist/pairing-cli-C4HrfIHe.js +130 -0
- package/dist/pairing-labels-CBmGQ31P.js +9 -0
- package/dist/pairing-labels-D0xwC7Xb.js +9 -0
- package/dist/pairing-store-BoF0g-iN.js +459 -0
- package/dist/pairing-store-CseXj-5p.js +460 -0
- package/dist/path-env-CPZbb7me.js +89 -0
- package/dist/path-env-GTM4HXCN.js +89 -0
- package/dist/path-safety-BFE0XmGC.js +14 -0
- package/dist/path-safety-BJ8ge6Ho.js +14 -0
- package/dist/paths-DHuXVC00.js +229 -0
- package/dist/plugin-auto-enable-B_9J1XED.js +302 -0
- package/dist/plugin-auto-enable-DghjlFCL.js +301 -0
- package/dist/plugin-registry-68h2T8vi.js +33 -0
- package/dist/plugin-registry-BitdVPb4.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-registry.store.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 +32 -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 +3 -36
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -7
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/shared.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +1 -13
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +1 -10
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +1 -11
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +1 -29
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +0 -3
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +0 -25
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +3 -42
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +0 -9
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -20
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +1 -12
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +1 -15
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +1 -17
- 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 -12
- package/dist/plugin-sdk/auto-reply/templating.d.ts +0 -4
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +0 -15
- package/dist/plugin-sdk/auto-reply/types.d.ts +1 -2
- package/dist/plugin-sdk/channels/dock.d.ts +1 -2
- package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +0 -6
- package/dist/plugin-sdk/channels/plugins/types.core.d.ts +1 -0
- package/dist/plugin-sdk/channels/plugins/types.d.ts +1 -1
- package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +1 -2
- package/dist/plugin-sdk/channels/voice-credentials.d.ts +26 -0
- package/dist/plugin-sdk/commands/agent/session.d.ts +1 -2
- package/dist/plugin-sdk/commands/onboard-helpers.d.ts +0 -1
- package/dist/plugin-sdk/commands/onboard-types.d.ts +2 -1
- package/dist/plugin-sdk/config/defaults.d.ts +0 -1
- package/dist/plugin-sdk/config/legacy.migrations.d.ts +2 -1
- package/dist/plugin-sdk/config/legacy.shared.d.ts +0 -9
- package/dist/plugin-sdk/config/sessions/types.d.ts +0 -17
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +28 -120
- package/dist/plugin-sdk/config/types.agents.d.ts +8 -0
- package/dist/plugin-sdk/config/types.base.d.ts +0 -1
- package/dist/plugin-sdk/config/types.messages.d.ts +1 -6
- package/dist/plugin-sdk/config/types.remoteclaw.d.ts +2 -2
- package/dist/plugin-sdk/config/types.tools.d.ts +1 -74
- package/dist/plugin-sdk/config/types.tts.d.ts +2 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +9 -70
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +12 -210
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +14 -86
- package/dist/plugin-sdk/config/zod-schema.core.d.ts +6 -234
- package/dist/plugin-sdk/config/zod-schema.d.ts +111 -378
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +148 -160
- package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +12 -12
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +88 -96
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +4 -10
- package/dist/plugin-sdk/daemon/constants.d.ts +2 -2
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +10 -17
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +0 -7
- package/dist/plugin-sdk/gateway/server/ws-types.d.ts +2 -0
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +0 -3
- package/dist/plugin-sdk/index.js +722 -1283
- 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/line/config-schema.d.ts +4 -4
- package/dist/plugin-sdk/logging/levels.d.ts +1 -1
- 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/cli-runtime-base.d.ts +6 -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 +10 -0
- package/dist/plugin-sdk/middleware/runtimes/codex.d.ts +5 -0
- package/dist/plugin-sdk/middleware/runtimes/gemini.d.ts +11 -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/plugin-sdk/index.d.ts +5 -1
- package/dist/plugin-sdk/plugins/manifest-registry.d.ts +2 -0
- package/dist/plugin-sdk/plugins/manifest.d.ts +4 -4
- package/dist/plugin-sdk/plugins/registry.d.ts +18 -0
- package/dist/plugin-sdk/plugins/types.d.ts +5 -1
- package/dist/plugin-sdk/stt/defaults.d.ts +2 -0
- package/dist/plugin-sdk/stt/preflight.d.ts +14 -0
- package/dist/plugin-sdk/stt/providers/deepgram/index.d.ts +2 -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/index.d.ts +2 -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/providers/edge.d.ts +2 -0
- package/dist/plugin-sdk/tts/providers/elevenlabs.d.ts +2 -0
- package/dist/plugin-sdk/tts/providers/index.d.ts +4 -0
- package/dist/plugin-sdk/tts/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/tts/tts.d.ts +13 -5
- package/dist/plugin-sdk/tts/types.d.ts +21 -0
- package/dist/plugins-BviLFPLV.js +255 -0
- package/dist/plugins-CaudBUbl.js +254 -0
- package/dist/plugins-cli-CsLhphNr.js +803 -0
- package/dist/plugins-cli-CujSP9NS.js +807 -0
- package/dist/ports-BtuzUQHl.js +370 -0
- package/dist/ports-CMcHia07.js +96 -0
- package/dist/ports-DALdfBQy.js +96 -0
- package/dist/ports-gRBeuUtp.js +316 -0
- package/dist/preflight-Bq8rimP-.js +667 -0
- package/dist/preflight-DyYbEp9X.js +667 -0
- package/dist/program-D64vUv0b.js +250 -0
- package/dist/program-context-CTFkimUr.js +474 -0
- package/dist/progress-BcwxtM9Q.js +124 -0
- package/dist/prompt-DtWGd43j.js +21 -0
- package/dist/prompt-select-styled-GW2PexAK.js +1672 -0
- package/dist/prompt-select-styled-JOuWGHX7.js +1669 -0
- package/dist/prompt-style-BpUMhEHC.js +9 -0
- package/dist/provider-auth-B7QgxlKt.js +187 -0
- package/dist/provider-auth-j-EQvvIk.js +187 -0
- package/dist/provider-dispatcher-Bx6CaIoV.js +660 -0
- package/dist/provider-dispatcher-DhkvjhO5.js +659 -0
- package/dist/push-apns--nEiZmEN.js +711 -0
- package/dist/push-apns-BtS6B6lb.js +713 -0
- package/dist/pw-ai-BpCsXF-x.js +1908 -0
- package/dist/pw-ai-ud_Kbn5S.js +1911 -0
- package/dist/qr-cli-BCeVLGfz.js +353 -0
- package/dist/qr-cli-Crsqtw01.js +349 -0
- package/dist/redact-Ci96Gj0O.js +191 -0
- package/dist/redact-snapshot-B9nof-Pb.js +1952 -0
- package/dist/redact-snapshot-BKiS91Mj.js +1952 -0
- package/dist/register.agent-CcvOeVnL.js +292 -0
- package/dist/register.agent-azH_tdVX.js +1014 -0
- package/dist/register.configure-DAaZLjHs.js +130 -0
- package/dist/register.configure-lUl8O79m.js +135 -0
- package/dist/register.import-B83Dn36B.js +29 -0
- package/dist/register.import-wIYU2cVW.js +31 -0
- package/dist/register.maintenance-Bo-ooQDU.js +501 -0
- package/dist/register.maintenance-BwZ4OkK2.js +503 -0
- package/dist/register.message-BQhRoEQQ.js +687 -0
- package/dist/register.message-CvZKWeGb.js +691 -0
- package/dist/register.onboard---3EPh-O.js +98 -0
- package/dist/register.onboard-rsHSJUvQ.js +94 -0
- package/dist/register.setup-B0gc_lne.js +118 -0
- package/dist/register.setup-MWpb7jxL.js +114 -0
- package/dist/register.status-health-sessions-BZJ0wTSa.js +429 -0
- package/dist/register.status-health-sessions-CyrUwwtB.js +667 -0
- package/dist/register.subclis-i2d2ugaJ.js +267 -0
- package/dist/replies-BIx-MbQ7.js +136 -0
- package/dist/replies-DVU655H4.js +136 -0
- package/dist/reply-CL5VMSKN.js +12372 -0
- package/dist/reply-XKyfU3rS.js +12375 -0
- package/dist/reply-directives-DQfJ001O.js +182 -0
- package/dist/reply-directives-DfUITt7C.js +182 -0
- package/dist/reply-payloads-ZHo6kfTS.js +527 -0
- package/dist/reply-prefix-BSf3PC0x.js +37 -0
- package/dist/reply-prefix-DBTlMHLK.js +37 -0
- package/dist/resolve-route-B-_IgETc.js +249 -0
- package/dist/resolve-route-C8ZsgWDQ.js +249 -0
- package/dist/response-prefix-template-3LeqJx2X.js +134 -0
- package/dist/response-prefix-template-DBrUVx5V.js +134 -0
- package/dist/retry-CDrH81GP.js +77 -0
- package/dist/retry-Dar_7pCv.js +77 -0
- package/dist/run-main-rOudcbbs.js +308 -0
- package/dist/runtime-guard-CK80eucm.js +60 -0
- package/dist/runtime-status-CR9445g5.js +12 -0
- package/dist/runtime-status-hFVEC3wO.js +12 -0
- package/dist/secure-random-CLWSvf8A.js +44 -0
- package/dist/security-cli-B8lXw9ke.js +488 -0
- package/dist/security-cli-CRkS3VAf.js +483 -0
- package/dist/send-6g8QKfWj.js +374 -0
- package/dist/send-B5Hz1PIn.js +29 -0
- package/dist/send-B8eIlA1u.js +349 -0
- package/dist/send-BFZPQE4j.js +492 -0
- package/dist/send-BpTDvE0D.js +1779 -0
- package/dist/send-BxOrO1Wv.js +1776 -0
- package/dist/send-C6gPJu-Z.js +11 -0
- package/dist/send-C7MoKtkN.js +426 -0
- package/dist/send-CXzq2LI6.js +2245 -0
- package/dist/send-CYOZoObr.js +547 -0
- package/dist/send-CfQyIvcC.js +332 -0
- package/dist/send-DUtuuwhw.js +492 -0
- package/dist/send-DbafVwxp.js +2245 -0
- package/dist/send-DeZg8K7y.js +349 -0
- package/dist/send-DwkjxJlv.js +547 -0
- package/dist/send-iX9xbxlU.js +1178 -0
- package/dist/server-BKfCzEzd.js +206 -0
- package/dist/server-fmO4eo7K.js +202 -0
- package/dist/server-lifecycle-CgPpP10P.js +2437 -0
- package/dist/server-lifecycle-Cn8yY5MW.js +2437 -0
- package/dist/server-node-events-C-ZzSBYh.js +391 -0
- package/dist/server-node-events-DYlyfDHM.js +395 -0
- package/dist/service-C2j81L86.js +670 -0
- package/dist/service-C8a0SXHD.js +670 -0
- package/dist/session-AulYhqOb.js +170 -0
- package/dist/session-C6VKWvx6.js +170 -0
- package/dist/session-cost-usage-0Vs4hgMe.js +627 -0
- package/dist/session-cost-usage-C-DsaOfN.js +627 -0
- package/dist/session-dirs-CO1f2ArM.js +318 -0
- package/dist/session-dirs-DoboH7Oy.js +318 -0
- package/dist/session-utils-CRK8ToKG.js +621 -0
- package/dist/session-utils-DWlkmCX8.js +621 -0
- package/dist/sessions-DtqrmUJS.js +2553 -0
- package/dist/sessions-gT-4fcX-.js +245 -0
- package/dist/shell-env-DBS5su07.js +163 -0
- package/dist/shell-env-c3j5zcU9.js +163 -0
- package/dist/ssrf-8wNqPNzN.js +183 -0
- package/dist/ssrf-CJIdPXuS.js +183 -0
- package/dist/status-BI_-xpDt.js +1947 -0
- package/dist/status-PZVwjKjl.js +1943 -0
- package/dist/status.update-BmuDZ7E7.js +449 -0
- package/dist/status.update-Mf6HSRvU.js +449 -0
- package/dist/store-B7PGEdFf.js +2555 -0
- package/dist/store-CzhBjUCN.js +64 -0
- package/dist/store-YkSxKAey.js +53 -0
- package/dist/store-ZNeFv2Q7.js +64 -0
- package/dist/subagent-registry-R1DiAM4R.js +4839 -0
- package/dist/subagent-registry-xLRXC8Bg.js +4841 -0
- package/dist/subsystem-BAW_f3DI.js +1195 -0
- package/dist/subsystem-DGSHVL8I.js +1081 -0
- package/dist/system-cli-9SvRrT9D.js +77 -0
- package/dist/system-cli-yCa5Q1YM.js +73 -0
- package/dist/systemd-40Rij3QR.js +547 -0
- package/dist/systemd-5C97CSzd.js +547 -0
- package/dist/systemd-hints-3iQteJw-.js +278 -0
- package/dist/systemd-hints-CyQqHq1i.js +278 -0
- package/dist/systemd-linger-B2rPbnAi.js +75 -0
- package/dist/systemd-linger-DDvkfxH-.js +75 -0
- package/dist/table-DFx25vNb.js +279 -0
- package/dist/tables-C5fI0PmT.js +55 -0
- package/dist/tables-Cm9qvQ9D.js +55 -0
- package/dist/tables-fRe01eP1.js +55 -0
- package/dist/tailnet-Da-_9e8E.js +40 -0
- package/dist/tailnet-xt92Yaop.js +40 -0
- package/dist/tailscale-CnV0JWca.js +230 -0
- package/dist/tailscale-VkEC8dzj.js +230 -0
- package/dist/targets-C99szk_e.js +114 -0
- package/dist/targets-CPaTjbpp.js +2607 -0
- package/dist/targets-D-p4rJVS.js +650 -0
- package/dist/targets-D2OQt8-7.js +650 -0
- package/dist/targets-D94MtTiZ.js +2606 -0
- package/dist/targets-RajrXTl7.js +220 -0
- package/dist/targets-_UWmnyI9.js +53 -0
- package/dist/targets-tDrl_ioQ.js +46 -0
- package/dist/thinking-4nOZPunr.js +60 -0
- package/dist/thinking-ZfH2V9Os.js +60 -0
- package/dist/tokens-TtJJxzRr.js +21 -0
- package/dist/tool-display-Bxs_1jIn.js +785 -0
- package/dist/tool-display-D9p_Ttkq.js +785 -0
- package/dist/tool-images-9Ron321Q.js +263 -0
- package/dist/tool-images-BWhy6WRN.js +263 -0
- package/dist/trash-B5xyvBDf.js +125 -0
- package/dist/trash-BpB96kHe.js +125 -0
- package/dist/tui-Ba0uZDrg.js +3237 -0
- package/dist/tui-Biz0HqDj.js +3237 -0
- package/dist/tui-cli-C-UV6o2v.js +63 -0
- package/dist/tui-cli-Ds_bLT-h.js +67 -0
- package/dist/types.tools-BBb2rl3g.js +23 -0
- package/dist/types.tools-BDJw1yFx.js +23 -0
- package/dist/update-Barj5dsg.js +349 -0
- package/dist/update-D839Q8su.js +349 -0
- package/dist/update-cli-C0LnrpIt.js +1148 -0
- package/dist/update-cli-CUypa-T-.js +1150 -0
- package/dist/usage-BI9kergH.js +5465 -0
- package/dist/utils-DPoNpP7D.js +631 -0
- package/dist/version-3QUZW8EP.js +52 -0
- package/dist/version-CVMnqdzu.js +52 -0
- package/dist/voice-credentials-64XAMSJm.js +46 -0
- package/dist/voice-credentials-v-CQkTpD.js +46 -0
- package/dist/web-63IbbidQ.js +3051 -0
- package/dist/web-D9N764Da.js +80 -0
- package/dist/web-DUvNYLzr.js +75 -0
- package/dist/webhooks-cli-owhVNNkz.js +334 -0
- package/dist/webhooks-cli-zlvka6QD.js +330 -0
- package/dist/whatsapp-actions-8DejyRG5.js +126 -0
- package/dist/whatsapp-actions-DCzp5LKe.js +131 -0
- package/dist/widearea-dns-CQqZIeu8.js +127 -0
- package/dist/workspace-CB7pVojf.js +441 -0
- package/dist/workspace-DWEyzM0F.js +439 -0
- package/dist/zod-schema-CvFqwpNE.js +2719 -0
- package/dist/zod-schema-Y5SQgJLm.js +2719 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +0 -24
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +0 -1
- package/extensions/voice-call/index.ts +18 -1
- package/package.json +3 -4
- package/dist/accounts-7fm_KzPm.js +0 -32
- 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-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-Cd1JhIUj.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-ePscvwi1.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-Dqv7Q0aS.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/mime-BS3jhcZE.js +0 -149
- package/dist/mime-Cxh_64P6.js +0 -149
- 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-_jj74QBM.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-guards-CIx4hURU.js +0 -31
- package/dist/path-guards-CrQOUlsq.js +0 -31
- package/dist/path-safety-DkT9RmTG.js +0 -14
- package/dist/path-safety-juI2XbO1.js +0 -14
- package/dist/paths-BTaH3rLn.js +0 -232
- 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/auto-reply/reply/directive-handling.auth.d.ts +0 -19
- package/dist/plugin-sdk/auto-reply/reply/elevated-allowlist-matcher.d.ts +0 -20
- package/dist/plugin-sdk/auto-reply/reply/elevated-unavailable.d.ts +0 -8
- package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +0 -16
- package/dist/plugin-sdk/compat/legacy-names.d.ts +0 -8
- package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +0 -2
- package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +0 -2
- package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +0 -2
- 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/link-understanding/apply.d.ts +0 -10
- package/dist/plugin-sdk/link-understanding/defaults.d.ts +0 -2
- package/dist/plugin-sdk/link-understanding/detect.d.ts +0 -3
- package/dist/plugin-sdk/link-understanding/format.d.ts +0 -4
- package/dist/plugin-sdk/link-understanding/runner.d.ts +0 -11
- package/dist/plugin-sdk/media/input-files.d.ts +0 -95
- package/dist/plugin-sdk/media-understanding/apply.d.ts +0 -19
- package/dist/plugin-sdk/media-understanding/attachments.d.ts +0 -49
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +0 -16
- package/dist/plugin-sdk/media-understanding/concurrency.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/defaults.d.ts +0 -12
- package/dist/plugin-sdk/media-understanding/errors.d.ts +0 -6
- package/dist/plugin-sdk/media-understanding/format.d.ts +0 -7
- package/dist/plugin-sdk/media-understanding/fs.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/output-extract.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +0 -3
- package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/index.d.ts +0 -4
- package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/mistral/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/moonshot/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/moonshot/video.d.ts +0 -3
- package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/zai/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/resolve.d.ts +0 -44
- package/dist/plugin-sdk/media-understanding/runner.d.ts +0 -34
- package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +0 -33
- package/dist/plugin-sdk/media-understanding/scope.d.ts +0 -9
- package/dist/plugin-sdk/media-understanding/types.d.ts +0 -74
- package/dist/plugin-sdk/media-understanding/video.d.ts +0 -2
- 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/plugin-sdk/utils/mask-api-key.d.ts +0 -1
- package/dist/plugin-sdk/utils/run-with-concurrency.d.ts +0 -11
- 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-B042l5UJ.js +0 -77
- package/dist/retry-BhuXOEVR.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-DTcQnwrI.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-6l2S1bcr.js +0 -11
- 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-BzN7X1Om.js +0 -374
- package/dist/send-CLrRM0El.js +0 -426
- package/dist/send-Caz-txXK.js +0 -492
- package/dist/send-DJEr4rP6.js +0 -547
- package/dist/send-DJiDHXsu.js +0 -349
- package/dist/send-DOjg7kJj.js +0 -1775
- package/dist/send-DVXOiKT4.js +0 -1174
- package/dist/send-Dc_K995l.js +0 -547
- package/dist/send-Dh6d3CLl.js +0 -332
- package/dist/send-iPAfbiYM.js +0 -492
- package/dist/send-pwe9Gu8e.js +0 -29
- 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-Bjk6rTC_.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-D9ZpRKFP.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-BQ-CvUfT.js +0 -55
- package/dist/tables-D3a9iSU1.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-CMhBAn87.js +0 -120
- package/dist/targets-CTmhieRB.js +0 -650
- package/dist/targets-CcTME3bp.js +0 -46
- package/dist/targets-DfaVEd_u.js +0 -220
- 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-CS1zeIan.js +0 -5279
- package/dist/utils-LBKvDoPx.js +0 -631
- package/dist/web-BECD5Akw.js +0 -70
- package/dist/web-D4oENnAL.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-C0ndrpt-.js} +0 -0
- /package/dist/{account-lookup-zvANGr2x.js → account-lookup-CIY_RKhi.js} +0 -0
- /package/dist/{api-BeQMq2iS.js → api-BE4ZCWWB.js} +0 -0
- /package/dist/{api-CxX8-gGz.js → api-wsk9zRVi.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-BP9akbag.js} +0 -0
- /package/dist/{chat-type-DKb2TlGZ.js → chat-type-CH3W-zKy.js} +0 -0
- /package/dist/{cleanup-utils-CwQvD73q.js → cleanup-utils-ZC2zvntc.js} +0 -0
- /package/dist/{cli-name-BicfmwQX.js → cli-name-BZsYSp9l.js} +0 -0
- /package/dist/{cli-name-C6rJGl18.js → cli-name-CRe5Ow_t.js} +0 -0
- /package/dist/{cli-utils-BhXbz2UF.js → cli-utils-BUOtyfnU.js} +0 -0
- /package/dist/{cli-utils-DZe_rVkZ.js → cli-utils-CGB3cBZm.js} +0 -0
- /package/dist/{client-C61M8zI3.js → client-9dK56xly.js} +0 -0
- /package/dist/{client-DdpmATKq.js → client-D-R1YdRD.js} +0 -0
- /package/dist/{command-options-C4paWSGf.js → command-options-CnHA4TzR.js} +0 -0
- /package/dist/{command-options-CA30lfLK.js → command-options-D2nN4AXX.js} +0 -0
- /package/dist/{config-eval-CjGZtLwx.js → config-eval-BQIR-wSg.js} +0 -0
- /package/dist/{config-eval-H_wlEYIG.js → config-eval-Bh82JoXK.js} +0 -0
- /package/dist/{constants-ChptG3d7.js → constants-C7j1VA2S.js} +0 -0
- /package/dist/{constants-DY6b-_Wl.js → constants-DoYLsBmv.js} +0 -0
- /package/dist/{credentials-BHWUBHMd.js → credentials-C_RoJFmK.js} +0 -0
- /package/dist/{credentials-DFsi1_e8.js → credentials-DM_Dj0m8.js} +0 -0
- /package/dist/{daemon-runtime-CMnbwryP.js → daemon-runtime-9oDBR7YW.js} +0 -0
- /package/dist/{daemon-runtime-CvqE4ysg.js → daemon-runtime-CzFI2dPw.js} +0 -0
- /package/dist/{dangerous-name-matching-BzmiLXmA.js → dangerous-name-matching-BlTBBZns.js} +0 -0
- /package/dist/{dangerous-name-matching-DaVRgwer.js → dangerous-name-matching-CSq9sJDG.js} +0 -0
- /package/dist/{dangerous-tools-BOLoCRv4.js → dangerous-tools-BRmbBvRf.js} +0 -0
- /package/dist/{dangerous-tools-Baq7Q-i6.js → dangerous-tools-D4jtl72G.js} +0 -0
- /package/dist/{fetch-timeout-DTIN7CGM.js → fetch-timeout-CytN1wiO.js} +0 -0
- /package/dist/{fetch-timeout-DoySHqfO.js → fetch-timeout-DBRRPNBi.js} +0 -0
- /package/dist/{file-identity-BxlKD8Ys.js → file-identity-CeRK5CJC.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-Czf5fUjn.js} +0 -0
- /package/dist/{format-relative-CxLpEQOX.js → format-relative-zwkkXJvs.js} +0 -0
- /package/dist/{health-format-B_QRD8Si.js → health-format-DF54wvUU.js} +0 -0
- /package/dist/{heartbeat-wake-LGEgcXjs.js → heartbeat-wake-CvHncCjP.js} +0 -0
- /package/dist/{heartbeat-wake-Y97geucO.js → heartbeat-wake-DLxQm6-U.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-n2CtWpm9.js} +0 -0
- /package/dist/{input-provenance-Bn6thJNm.js → input-provenance-gIfDn1ki.js} +0 -0
- /package/dist/{input-provenance-xUsSMOsz.js → input-provenance-wkso1o5V.js} +0 -0
- /package/dist/{ip-C9q3Oq20.js → ip-D4VG5EJO.js} +0 -0
- /package/dist/{ip-D0zgNmBV.js → ip-MwCwRA7c.js} +0 -0
- /package/dist/{is-main-DN8-sNR5.js → is-main-BmHYGRhd.js} +0 -0
- /package/dist/{json-file-B7l5-Xhr.js → json-file-BW22hGtf.js} +0 -0
- /package/dist/{json-file-ChO_R9yh.js → json-file-DwRAfAAy.js} +0 -0
- /package/dist/{json-files-CmpYSF4G.js → json-files-Dy52honG.js} +0 -0
- /package/dist/{lanes-ByWMUgrz.js → lanes-1CBKdsiR.js} +0 -0
- /package/dist/{lanes-cHJ5arWg.js → lanes-DqVYfPRG.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-B8BE0PyS.js} +0 -0
- /package/dist/{logger-BWMPnILd.js → logger-CPvz-aPM.js} +0 -0
- /package/dist/{logger-GvipVDfh.js → logger-cL0D2DCr.js} +0 -0
- /package/dist/{logging-D8-Kozjc.js → logging-DTEoeoa3.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-BXE7Hr7F.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-U5ThQr9V.js → mutable-allowlist-detectors-CtKavajp.js} +0 -0
- /package/dist/{parse-log-line-enq8pduH.js → parse-log-line-GisaZn5H.js} +0 -0
- /package/dist/{parse-log-line-mz9TG6ig.js → parse-log-line-ZsbwG_u7.js} +0 -0
- /package/dist/{parse-timeout-BMP8a0_a.js → parse-timeout-BpphuwYl.js} +0 -0
- /package/dist/{parse-timeout-CDkco8kd.js → parse-timeout-CE6BjmGU.js} +0 -0
- /package/dist/plugin-sdk/{agents → auth}/api-key-rotation.d.ts +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/deepgram/audio.d.ts +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/google/audio.d.ts +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/google/inline-data.d.ts +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/openai/audio.d.ts +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/shared.d.ts +0 -0
- /package/dist/{plugins-allowlist-BbTQ5Z2k.js → plugins-allowlist-A38nxBRG.js} +0 -0
- /package/dist/{plugins-allowlist-C20oaESO.js → plugins-allowlist-D2tS9tcu.js} +0 -0
- /package/dist/{polls-B0CCBDeR.js → polls-BLyT08ZI.js} +0 -0
- /package/dist/{polls-CwwHzYBM.js → polls-BmymsJEe.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-BCJR56ZB.js} +0 -0
- /package/dist/{process-scoped-map-PEvnG75N.js → process-scoped-map-Cb1EHPyN.js} +0 -0
- /package/dist/{program-context-jqeI5alP.js → program-context-DlXnmuB7.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-CUuA6OCy.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-D-qGA1vm.js} +0 -0
- /package/dist/{pw-ai-state-CGfLv6nV.js → pw-ai-state--TxTVwRW.js} +0 -0
- /package/dist/{pw-ai-state-Dynx20hr.js → pw-ai-state-CwXeO5d0.js} +0 -0
- /package/dist/{redact-Dx1Fue21.js → redact-BW8tobyp.js} +0 -0
- /package/dist/{redact-identifier-BTIWtaa-.js → redact-identifier-BJOQDEj0.js} +0 -0
- /package/dist/{redact-identifier-CAagcfWA.js → redact-identifier-Bv5SUUw-.js} +0 -0
- /package/dist/{remoteclaw-root-C2HV2VeC.js → remoteclaw-root-BfPjgewe.js} +0 -0
- /package/dist/{remoteclaw-root-DybYl8PL.js → remoteclaw-root-E4-hmb4E.js} +0 -0
- /package/dist/{render-CCLsW6Lz.js → render-BhKzKdV0.js} +0 -0
- /package/dist/{render-uf6PvGMV.js → render-e7fENCYH.js} +0 -0
- /package/dist/{retry-DnqPAqWp.js → retry-BWv_fy4u.js} +0 -0
- /package/dist/{runtime-guard-U-ewY_QH.js → runtime-guard-Bhx-pb8_.js} +0 -0
- /package/dist/{secret-equal-BbHdTtqY.js → secret-equal-D6AoXne1.js} +0 -0
- /package/dist/{secret-equal-CXJEZiWb.js → secret-equal-DLnUuWM3.js} +0 -0
- /package/dist/{secure-random-CS2mSdTn.js → secure-random-CJtykx_p.js} +0 -0
- /package/dist/{secure-random-_dzDDlFo.js → secure-random-CRVHgtmO.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-BLmTO4cK.js} +0 -0
- /package/dist/{status-BmtCS3T1.js → status-1zVD-Clq.js} +0 -0
- /package/dist/{status-BrwHRn2B.js → status-BtRY0nXQ.js} +0 -0
- /package/dist/{strip-inbound-meta-DjKcSFaW.js → strip-inbound-meta-zmUXypSS.js} +0 -0
- /package/dist/{strip-inbound-meta-jy3bkUab.js → strip-inbound-meta-zqtN9FTK.js} +0 -0
- /package/dist/{table-C1rdyYl9.js → table-On3hkCqi.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-C-2xwh9f.js → targets-B46m7u5J.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-BMenhVHg.js → targets-D3r6Zgic.js} +0 -0
- /package/dist/{text-format-BQ3z_OXA.js → text-format-DarxU3JH.js} +0 -0
- /package/dist/{text-format-oWqzVmah.js → text-format-Ds92M9UT.js} +0 -0
- /package/dist/{tokens-B-jmvNR9.js → tokens-Dw7ZdYwT.js} +0 -0
- /package/dist/{usage-BdhBT0Vz.js → usage-BIzKZ5dT.js} +0 -0
- /package/dist/{usage-BtQcAnf6.js → usage-BvZOzIC7.js} +0 -0
- /package/dist/{usage-format-C3mNLfhI.js → usage-format-CmniSPCG.js} +0 -0
- /package/dist/{usage-format-DAaPzr_z.js → usage-format-D_KQYQ-w.js} +0 -0
- /package/dist/{widearea-dns-CsmBVbez.js → widearea-dns-D01FFYZ8.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-PDLKeX04.js} +0 -0
- /package/dist/{wsl-BCnYV9O0.js → wsl-kFaeW76c.js} +0 -0
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import fs, { constants, createWriteStream, readFileSync } from "node:fs";
|
|
2
|
+
import fs, { constants, createWriteStream, existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import path, { join } from "node:path";
|
|
4
|
-
import os from "node:os";
|
|
4
|
+
import os, { homedir } from "node:os";
|
|
5
5
|
import { Logger } from "tslog";
|
|
6
6
|
import json5 from "json5";
|
|
7
7
|
import chalk, { Chalk } from "chalk";
|
|
@@ -1203,8 +1203,8 @@ function pruneOldRollingLogs(dir) {
|
|
|
1203
1203
|
|
|
1204
1204
|
//#endregion
|
|
1205
1205
|
//#region src/terminal/palette.ts
|
|
1206
|
-
const
|
|
1207
|
-
accent: "#
|
|
1206
|
+
const PALETTE = {
|
|
1207
|
+
accent: "#FF5A36",
|
|
1208
1208
|
accentBright: "#FF7A3D",
|
|
1209
1209
|
accentDim: "#D14A22",
|
|
1210
1210
|
info: "#FF8A5B",
|
|
@@ -1220,17 +1220,17 @@ const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env
|
|
|
1220
1220
|
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
1221
1221
|
const hex = (value) => baseChalk.hex(value);
|
|
1222
1222
|
const theme = {
|
|
1223
|
-
accent: hex(
|
|
1224
|
-
accentBright: hex(
|
|
1225
|
-
accentDim: hex(
|
|
1226
|
-
info: hex(
|
|
1227
|
-
success: hex(
|
|
1228
|
-
warn: hex(
|
|
1229
|
-
error: hex(
|
|
1230
|
-
muted: hex(
|
|
1231
|
-
heading: baseChalk.bold.hex(
|
|
1232
|
-
command: hex(
|
|
1233
|
-
option: hex(
|
|
1223
|
+
accent: hex(PALETTE.accent),
|
|
1224
|
+
accentBright: hex(PALETTE.accentBright),
|
|
1225
|
+
accentDim: hex(PALETTE.accentDim),
|
|
1226
|
+
info: hex(PALETTE.info),
|
|
1227
|
+
success: hex(PALETTE.success),
|
|
1228
|
+
warn: hex(PALETTE.warn),
|
|
1229
|
+
error: hex(PALETTE.error),
|
|
1230
|
+
muted: hex(PALETTE.muted),
|
|
1231
|
+
heading: baseChalk.bold.hex(PALETTE.accent),
|
|
1232
|
+
command: hex(PALETTE.accentBright),
|
|
1233
|
+
option: hex(PALETTE.warn)
|
|
1234
1234
|
};
|
|
1235
1235
|
|
|
1236
1236
|
//#endregion
|
|
@@ -1705,7 +1705,7 @@ function loadDotEnv(opts) {
|
|
|
1705
1705
|
|
|
1706
1706
|
//#endregion
|
|
1707
1707
|
//#region src/hooks/internal-hooks.ts
|
|
1708
|
-
const log$
|
|
1708
|
+
const log$13 = createSubsystemLogger("internal-hooks");
|
|
1709
1709
|
|
|
1710
1710
|
//#endregion
|
|
1711
1711
|
//#region src/plugins/http-path.ts
|
|
@@ -1729,6 +1729,8 @@ function createEmptyPluginRegistry() {
|
|
|
1729
1729
|
typedHooks: [],
|
|
1730
1730
|
channels: [],
|
|
1731
1731
|
providers: [],
|
|
1732
|
+
sttProviders: [],
|
|
1733
|
+
ttsProviders: [],
|
|
1732
1734
|
gatewayHandlers: {},
|
|
1733
1735
|
httpHandlers: [],
|
|
1734
1736
|
httpRoutes: [],
|
|
@@ -2224,7 +2226,7 @@ function parseBooleanValue(value, options = {}) {
|
|
|
2224
2226
|
|
|
2225
2227
|
//#endregion
|
|
2226
2228
|
//#region src/infra/env.ts
|
|
2227
|
-
const log$
|
|
2229
|
+
const log$12 = createSubsystemLogger("env");
|
|
2228
2230
|
function isTruthyEnvValue(value) {
|
|
2229
2231
|
return parseBooleanValue(value) === true;
|
|
2230
2232
|
}
|
|
@@ -2322,7 +2324,7 @@ function sanitizeHostExecEnv(params) {
|
|
|
2322
2324
|
|
|
2323
2325
|
//#endregion
|
|
2324
2326
|
//#region src/infra/shell-env.ts
|
|
2325
|
-
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
2327
|
+
const DEFAULT_TIMEOUT_MS$1 = 15e3;
|
|
2326
2328
|
const DEFAULT_MAX_BUFFER_BYTES = 2 * 1024 * 1024;
|
|
2327
2329
|
const DEFAULT_SHELL = "/bin/sh";
|
|
2328
2330
|
let lastAppliedKeys = [];
|
|
@@ -2336,7 +2338,7 @@ function resolveShellExecEnv(env) {
|
|
|
2336
2338
|
return execEnv;
|
|
2337
2339
|
}
|
|
2338
2340
|
function resolveTimeoutMs(timeoutMs) {
|
|
2339
|
-
if (typeof timeoutMs !== "number" || !Number.isFinite(timeoutMs)) return DEFAULT_TIMEOUT_MS;
|
|
2341
|
+
if (typeof timeoutMs !== "number" || !Number.isFinite(timeoutMs)) return DEFAULT_TIMEOUT_MS$1;
|
|
2340
2342
|
return Math.max(0, timeoutMs);
|
|
2341
2343
|
}
|
|
2342
2344
|
function readEtcShells() {
|
|
@@ -2466,11 +2468,14 @@ function shouldDeferShellEnvFallback(env) {
|
|
|
2466
2468
|
}
|
|
2467
2469
|
function resolveShellEnvFallbackTimeoutMs(env) {
|
|
2468
2470
|
const raw = env.REMOTECLAW_SHELL_ENV_TIMEOUT_MS?.trim();
|
|
2469
|
-
if (!raw) return DEFAULT_TIMEOUT_MS;
|
|
2471
|
+
if (!raw) return DEFAULT_TIMEOUT_MS$1;
|
|
2470
2472
|
const parsed = Number.parseInt(raw, 10);
|
|
2471
|
-
if (!Number.isFinite(parsed)) return DEFAULT_TIMEOUT_MS;
|
|
2473
|
+
if (!Number.isFinite(parsed)) return DEFAULT_TIMEOUT_MS$1;
|
|
2472
2474
|
return Math.max(0, parsed);
|
|
2473
2475
|
}
|
|
2476
|
+
function getShellEnvAppliedKeys() {
|
|
2477
|
+
return [...lastAppliedKeys];
|
|
2478
|
+
}
|
|
2474
2479
|
|
|
2475
2480
|
//#endregion
|
|
2476
2481
|
//#region src/version.ts
|
|
@@ -2564,13 +2569,12 @@ function findDuplicateAgentDirs(cfg, deps) {
|
|
|
2564
2569
|
function formatDuplicateAgentDirError(dups) {
|
|
2565
2570
|
return [
|
|
2566
2571
|
"Duplicate agentDir detected (multi-agent config).",
|
|
2567
|
-
"Each agent must have a unique agentDir; sharing it causes
|
|
2572
|
+
"Each agent must have a unique agentDir; sharing it causes session state collisions.",
|
|
2568
2573
|
"",
|
|
2569
2574
|
"Conflicts:",
|
|
2570
2575
|
...dups.map((d) => `- ${d.agentDir}: ${d.agentIds.map((id) => `"${id}"`).join(", ")}`),
|
|
2571
2576
|
"",
|
|
2572
|
-
"Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory)."
|
|
2573
|
-
"If you want to share credentials, copy auth-profiles.json instead of sharing the entire agentDir."
|
|
2577
|
+
"Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory)."
|
|
2574
2578
|
].join("\n");
|
|
2575
2579
|
}
|
|
2576
2580
|
|
|
@@ -2659,14 +2663,6 @@ function parseModelRef(raw, defaultProvider) {
|
|
|
2659
2663
|
const DEFAULT_AGENT_MAX_CONCURRENT = 4;
|
|
2660
2664
|
const DEFAULT_SUBAGENT_MAX_CONCURRENT = 8;
|
|
2661
2665
|
|
|
2662
|
-
//#endregion
|
|
2663
|
-
//#region src/config/model-input.ts
|
|
2664
|
-
function resolveAgentModelPrimaryValue(model) {
|
|
2665
|
-
if (typeof model === "string") return model.trim() || void 0;
|
|
2666
|
-
if (!model || typeof model !== "object") return;
|
|
2667
|
-
return model.primary?.trim() || void 0;
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
2666
|
//#endregion
|
|
2671
2667
|
//#region src/config/talk.ts
|
|
2672
2668
|
const DEFAULT_TALK_PROVIDER = "elevenlabs";
|
|
@@ -3024,7 +3020,9 @@ function applyContextPruningDefaults(cfg) {
|
|
|
3024
3020
|
};
|
|
3025
3021
|
modelsMutated = true;
|
|
3026
3022
|
}
|
|
3027
|
-
const
|
|
3023
|
+
const rawModel = defaults.model;
|
|
3024
|
+
const rawPrimary = typeof rawModel === "string" ? rawModel : rawModel?.primary;
|
|
3025
|
+
const primary = resolvePrimaryModelRef(typeof rawPrimary === "string" ? rawPrimary : void 0);
|
|
3028
3026
|
if (primary) {
|
|
3029
3027
|
const parsedPrimary = parseModelRef(primary, "anthropic");
|
|
3030
3028
|
if (isAnthropicCacheRetentionTarget(parsedPrimary)) {
|
|
@@ -3057,25 +3055,6 @@ function applyContextPruningDefaults(cfg) {
|
|
|
3057
3055
|
}
|
|
3058
3056
|
};
|
|
3059
3057
|
}
|
|
3060
|
-
function applyCompactionDefaults(cfg) {
|
|
3061
|
-
const defaults = cfg.agents?.defaults;
|
|
3062
|
-
if (!defaults) return cfg;
|
|
3063
|
-
const compaction = defaults?.compaction;
|
|
3064
|
-
if (compaction?.mode) return cfg;
|
|
3065
|
-
return {
|
|
3066
|
-
...cfg,
|
|
3067
|
-
agents: {
|
|
3068
|
-
...cfg.agents,
|
|
3069
|
-
defaults: {
|
|
3070
|
-
...defaults,
|
|
3071
|
-
compaction: {
|
|
3072
|
-
...compaction,
|
|
3073
|
-
mode: "safeguard"
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
};
|
|
3078
|
-
}
|
|
3079
3058
|
|
|
3080
3059
|
//#endregion
|
|
3081
3060
|
//#region src/config/env-preserve.ts
|
|
@@ -3503,962 +3482,9 @@ function resolveConfigIncludes(obj, configPath, resolver = defaultResolver) {
|
|
|
3503
3482
|
return new IncludeProcessor(configPath, resolver).process(obj);
|
|
3504
3483
|
}
|
|
3505
3484
|
|
|
3506
|
-
//#endregion
|
|
3507
|
-
//#region src/config/discord-preview-streaming.ts
|
|
3508
|
-
function normalizeStreamingMode(value) {
|
|
3509
|
-
if (typeof value !== "string") return null;
|
|
3510
|
-
return value.trim().toLowerCase() || null;
|
|
3511
|
-
}
|
|
3512
|
-
function parseStreamingMode(value) {
|
|
3513
|
-
const normalized = normalizeStreamingMode(value);
|
|
3514
|
-
if (normalized === "off" || normalized === "partial" || normalized === "block" || normalized === "progress") return normalized;
|
|
3515
|
-
return null;
|
|
3516
|
-
}
|
|
3517
|
-
function parseDiscordPreviewStreamMode(value) {
|
|
3518
|
-
const parsed = parseStreamingMode(value);
|
|
3519
|
-
if (!parsed) return null;
|
|
3520
|
-
return parsed === "progress" ? "partial" : parsed;
|
|
3521
|
-
}
|
|
3522
|
-
function parseSlackLegacyDraftStreamMode(value) {
|
|
3523
|
-
const normalized = normalizeStreamingMode(value);
|
|
3524
|
-
if (normalized === "replace" || normalized === "status_final" || normalized === "append") return normalized;
|
|
3525
|
-
return null;
|
|
3526
|
-
}
|
|
3527
|
-
function mapSlackLegacyDraftStreamModeToStreaming(mode) {
|
|
3528
|
-
if (mode === "append") return "block";
|
|
3529
|
-
if (mode === "status_final") return "progress";
|
|
3530
|
-
return "partial";
|
|
3531
|
-
}
|
|
3532
|
-
function resolveTelegramPreviewStreamMode(params = {}) {
|
|
3533
|
-
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
3534
|
-
if (parsedStreaming) {
|
|
3535
|
-
if (parsedStreaming === "progress") return "partial";
|
|
3536
|
-
return parsedStreaming;
|
|
3537
|
-
}
|
|
3538
|
-
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
3539
|
-
if (legacy) return legacy;
|
|
3540
|
-
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
3541
|
-
return "off";
|
|
3542
|
-
}
|
|
3543
|
-
function resolveDiscordPreviewStreamMode(params = {}) {
|
|
3544
|
-
const parsedStreaming = parseDiscordPreviewStreamMode(params.streaming);
|
|
3545
|
-
if (parsedStreaming) return parsedStreaming;
|
|
3546
|
-
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
3547
|
-
if (legacy) return legacy;
|
|
3548
|
-
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
3549
|
-
return "off";
|
|
3550
|
-
}
|
|
3551
|
-
function resolveSlackStreamingMode(params = {}) {
|
|
3552
|
-
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
3553
|
-
if (parsedStreaming) return parsedStreaming;
|
|
3554
|
-
const legacyStreamMode = parseSlackLegacyDraftStreamMode(params.streamMode);
|
|
3555
|
-
if (legacyStreamMode) return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
|
|
3556
|
-
if (typeof params.streaming === "boolean") return "partial";
|
|
3557
|
-
return "partial";
|
|
3558
|
-
}
|
|
3559
|
-
function resolveSlackNativeStreaming(params = {}) {
|
|
3560
|
-
if (typeof params.nativeStreaming === "boolean") return params.nativeStreaming;
|
|
3561
|
-
if (typeof params.streaming === "boolean") return params.streaming;
|
|
3562
|
-
return true;
|
|
3563
|
-
}
|
|
3564
|
-
|
|
3565
|
-
//#endregion
|
|
3566
|
-
//#region src/infra/safe-executable-value.ts
|
|
3567
|
-
const SHELL_METACHARS = /[;&|`$<>]/;
|
|
3568
|
-
const CONTROL_CHARS = /[\r\n]/;
|
|
3569
|
-
const QUOTE_CHARS = /["']/;
|
|
3570
|
-
const BARE_NAME_PATTERN = /^[A-Za-z0-9._+-]+$/;
|
|
3571
|
-
function isLikelyPath(value) {
|
|
3572
|
-
if (value.startsWith(".") || value.startsWith("~")) return true;
|
|
3573
|
-
if (value.includes("/") || value.includes("\\")) return true;
|
|
3574
|
-
return /^[A-Za-z]:[\\/]/.test(value);
|
|
3575
|
-
}
|
|
3576
|
-
function isSafeExecutableValue(value) {
|
|
3577
|
-
if (!value) return false;
|
|
3578
|
-
const trimmed = value.trim();
|
|
3579
|
-
if (!trimmed) return false;
|
|
3580
|
-
if (trimmed.includes("\0")) return false;
|
|
3581
|
-
if (CONTROL_CHARS.test(trimmed)) return false;
|
|
3582
|
-
if (SHELL_METACHARS.test(trimmed)) return false;
|
|
3583
|
-
if (QUOTE_CHARS.test(trimmed)) return false;
|
|
3584
|
-
if (isLikelyPath(trimmed)) return true;
|
|
3585
|
-
if (trimmed.startsWith("-")) return false;
|
|
3586
|
-
return BARE_NAME_PATTERN.test(trimmed);
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3589
|
-
//#endregion
|
|
3590
|
-
//#region src/config/legacy.shared.ts
|
|
3591
|
-
const getRecord = (value) => isRecord(value) ? value : null;
|
|
3592
|
-
const ensureRecord = (root, key) => {
|
|
3593
|
-
const existing = root[key];
|
|
3594
|
-
if (isRecord(existing)) return existing;
|
|
3595
|
-
const next = {};
|
|
3596
|
-
root[key] = next;
|
|
3597
|
-
return next;
|
|
3598
|
-
};
|
|
3599
|
-
const mergeMissing = (target, source) => {
|
|
3600
|
-
for (const [key, value] of Object.entries(source)) {
|
|
3601
|
-
if (value === void 0 || isBlockedObjectKey(key)) continue;
|
|
3602
|
-
const existing = target[key];
|
|
3603
|
-
if (existing === void 0) {
|
|
3604
|
-
target[key] = value;
|
|
3605
|
-
continue;
|
|
3606
|
-
}
|
|
3607
|
-
if (isRecord(existing) && isRecord(value)) mergeMissing(existing, value);
|
|
3608
|
-
}
|
|
3609
|
-
};
|
|
3610
|
-
const mapLegacyAudioTranscription = (value) => {
|
|
3611
|
-
const transcriber = getRecord(value);
|
|
3612
|
-
const command = Array.isArray(transcriber?.command) ? transcriber?.command : null;
|
|
3613
|
-
if (!command || command.length === 0) return null;
|
|
3614
|
-
if (typeof command[0] !== "string") return null;
|
|
3615
|
-
if (!command.every((part) => typeof part === "string")) return null;
|
|
3616
|
-
const rawExecutable = command[0].trim();
|
|
3617
|
-
if (!rawExecutable) return null;
|
|
3618
|
-
if (!isSafeExecutableValue(rawExecutable)) return null;
|
|
3619
|
-
const args = command.slice(1);
|
|
3620
|
-
const timeoutSeconds = typeof transcriber?.timeoutSeconds === "number" ? transcriber?.timeoutSeconds : void 0;
|
|
3621
|
-
const result = {
|
|
3622
|
-
command: rawExecutable,
|
|
3623
|
-
type: "cli"
|
|
3624
|
-
};
|
|
3625
|
-
if (args.length > 0) result.args = args;
|
|
3626
|
-
if (timeoutSeconds !== void 0) result.timeoutSeconds = timeoutSeconds;
|
|
3627
|
-
return result;
|
|
3628
|
-
};
|
|
3629
|
-
const getAgentsList = (agents) => {
|
|
3630
|
-
const list = agents?.list;
|
|
3631
|
-
return Array.isArray(list) ? list : [];
|
|
3632
|
-
};
|
|
3633
|
-
const resolveDefaultAgentIdFromRaw = (raw) => {
|
|
3634
|
-
const list = getAgentsList(getRecord(raw.agents));
|
|
3635
|
-
const defaultEntry = list.find((entry) => isRecord(entry) && entry.default === true && typeof entry.id === "string" && entry.id.trim() !== "");
|
|
3636
|
-
if (defaultEntry) return defaultEntry.id.trim();
|
|
3637
|
-
const routing = getRecord(raw.routing);
|
|
3638
|
-
const routingDefault = typeof routing?.defaultAgentId === "string" ? routing.defaultAgentId.trim() : "";
|
|
3639
|
-
if (routingDefault) return routingDefault;
|
|
3640
|
-
const firstEntry = list.find((entry) => isRecord(entry) && typeof entry.id === "string" && entry.id.trim() !== "");
|
|
3641
|
-
if (firstEntry) return firstEntry.id.trim();
|
|
3642
|
-
return "main";
|
|
3643
|
-
};
|
|
3644
|
-
const ensureAgentEntry = (list, id) => {
|
|
3645
|
-
const normalized = id.trim();
|
|
3646
|
-
const existing = list.find((entry) => isRecord(entry) && typeof entry.id === "string" && entry.id.trim() === normalized);
|
|
3647
|
-
if (existing) return existing;
|
|
3648
|
-
const created = { id: normalized };
|
|
3649
|
-
list.push(created);
|
|
3650
|
-
return created;
|
|
3651
|
-
};
|
|
3652
|
-
|
|
3653
|
-
//#endregion
|
|
3654
|
-
//#region src/config/legacy.migrations.part-1.ts
|
|
3655
|
-
function migrateBindings(raw, changes, changeNote, mutator) {
|
|
3656
|
-
const bindings = Array.isArray(raw.bindings) ? raw.bindings : null;
|
|
3657
|
-
if (!bindings) return;
|
|
3658
|
-
let touched = false;
|
|
3659
|
-
for (const entry of bindings) {
|
|
3660
|
-
if (!isRecord(entry)) continue;
|
|
3661
|
-
const match = getRecord(entry.match);
|
|
3662
|
-
if (!match) continue;
|
|
3663
|
-
if (!mutator(match)) continue;
|
|
3664
|
-
entry.match = match;
|
|
3665
|
-
touched = true;
|
|
3666
|
-
}
|
|
3667
|
-
if (touched) {
|
|
3668
|
-
raw.bindings = bindings;
|
|
3669
|
-
changes.push(changeNote);
|
|
3670
|
-
}
|
|
3671
|
-
}
|
|
3672
|
-
function ensureDefaultGroupEntry(section) {
|
|
3673
|
-
const groups = isRecord(section.groups) ? section.groups : {};
|
|
3674
|
-
const defaultKey = "*";
|
|
3675
|
-
return {
|
|
3676
|
-
groups,
|
|
3677
|
-
entry: isRecord(groups[defaultKey]) ? groups[defaultKey] : {}
|
|
3678
|
-
};
|
|
3679
|
-
}
|
|
3680
|
-
const LEGACY_CONFIG_MIGRATIONS_PART_1 = [
|
|
3681
|
-
{
|
|
3682
|
-
id: "bindings.match.provider->bindings.match.channel",
|
|
3683
|
-
describe: "Move bindings[].match.provider to bindings[].match.channel",
|
|
3684
|
-
apply: (raw, changes) => {
|
|
3685
|
-
migrateBindings(raw, changes, "Moved bindings[].match.provider → bindings[].match.channel.", (match) => {
|
|
3686
|
-
if (typeof match.channel === "string" && match.channel.trim()) return false;
|
|
3687
|
-
const provider = typeof match.provider === "string" ? match.provider.trim() : "";
|
|
3688
|
-
if (!provider) return false;
|
|
3689
|
-
match.channel = provider;
|
|
3690
|
-
delete match.provider;
|
|
3691
|
-
return true;
|
|
3692
|
-
});
|
|
3693
|
-
}
|
|
3694
|
-
},
|
|
3695
|
-
{
|
|
3696
|
-
id: "bindings.match.accountID->bindings.match.accountId",
|
|
3697
|
-
describe: "Move bindings[].match.accountID to bindings[].match.accountId",
|
|
3698
|
-
apply: (raw, changes) => {
|
|
3699
|
-
migrateBindings(raw, changes, "Moved bindings[].match.accountID → bindings[].match.accountId.", (match) => {
|
|
3700
|
-
if (match.accountId !== void 0) return false;
|
|
3701
|
-
const accountID = typeof match.accountID === "string" ? match.accountID.trim() : match.accountID;
|
|
3702
|
-
if (!accountID) return false;
|
|
3703
|
-
match.accountId = accountID;
|
|
3704
|
-
delete match.accountID;
|
|
3705
|
-
return true;
|
|
3706
|
-
});
|
|
3707
|
-
}
|
|
3708
|
-
},
|
|
3709
|
-
{
|
|
3710
|
-
id: "session.sendPolicy.rules.match.provider->match.channel",
|
|
3711
|
-
describe: "Move session.sendPolicy.rules[].match.provider to match.channel",
|
|
3712
|
-
apply: (raw, changes) => {
|
|
3713
|
-
const session = getRecord(raw.session);
|
|
3714
|
-
if (!session) return;
|
|
3715
|
-
const sendPolicy = getRecord(session.sendPolicy);
|
|
3716
|
-
if (!sendPolicy) return;
|
|
3717
|
-
const rules = Array.isArray(sendPolicy.rules) ? sendPolicy.rules : null;
|
|
3718
|
-
if (!rules) return;
|
|
3719
|
-
let touched = false;
|
|
3720
|
-
for (const rule of rules) {
|
|
3721
|
-
if (!isRecord(rule)) continue;
|
|
3722
|
-
const match = getRecord(rule.match);
|
|
3723
|
-
if (!match) continue;
|
|
3724
|
-
if (typeof match.channel === "string" && match.channel.trim()) continue;
|
|
3725
|
-
const provider = typeof match.provider === "string" ? match.provider.trim() : "";
|
|
3726
|
-
if (!provider) continue;
|
|
3727
|
-
match.channel = provider;
|
|
3728
|
-
delete match.provider;
|
|
3729
|
-
rule.match = match;
|
|
3730
|
-
touched = true;
|
|
3731
|
-
}
|
|
3732
|
-
if (touched) {
|
|
3733
|
-
sendPolicy.rules = rules;
|
|
3734
|
-
session.sendPolicy = sendPolicy;
|
|
3735
|
-
raw.session = session;
|
|
3736
|
-
changes.push("Moved session.sendPolicy.rules[].match.provider → match.channel.");
|
|
3737
|
-
}
|
|
3738
|
-
}
|
|
3739
|
-
},
|
|
3740
|
-
{
|
|
3741
|
-
id: "messages.queue.byProvider->byChannel",
|
|
3742
|
-
describe: "Move messages.queue.byProvider to messages.queue.byChannel",
|
|
3743
|
-
apply: (raw, changes) => {
|
|
3744
|
-
const messages = getRecord(raw.messages);
|
|
3745
|
-
if (!messages) return;
|
|
3746
|
-
const queue = getRecord(messages.queue);
|
|
3747
|
-
if (!queue) return;
|
|
3748
|
-
if (queue.byProvider === void 0) return;
|
|
3749
|
-
if (queue.byChannel === void 0) {
|
|
3750
|
-
queue.byChannel = queue.byProvider;
|
|
3751
|
-
changes.push("Moved messages.queue.byProvider → messages.queue.byChannel.");
|
|
3752
|
-
} else changes.push("Removed messages.queue.byProvider (messages.queue.byChannel already set).");
|
|
3753
|
-
delete queue.byProvider;
|
|
3754
|
-
messages.queue = queue;
|
|
3755
|
-
raw.messages = messages;
|
|
3756
|
-
}
|
|
3757
|
-
},
|
|
3758
|
-
{
|
|
3759
|
-
id: "providers->channels",
|
|
3760
|
-
describe: "Move provider config sections to channels.*",
|
|
3761
|
-
apply: (raw, changes) => {
|
|
3762
|
-
const legacyEntries = [
|
|
3763
|
-
"whatsapp",
|
|
3764
|
-
"telegram",
|
|
3765
|
-
"discord",
|
|
3766
|
-
"slack",
|
|
3767
|
-
"signal",
|
|
3768
|
-
"imessage",
|
|
3769
|
-
"msteams"
|
|
3770
|
-
].filter((key) => isRecord(raw[key]));
|
|
3771
|
-
if (legacyEntries.length === 0) return;
|
|
3772
|
-
const channels = ensureRecord(raw, "channels");
|
|
3773
|
-
for (const key of legacyEntries) {
|
|
3774
|
-
const legacy = getRecord(raw[key]);
|
|
3775
|
-
if (!legacy) continue;
|
|
3776
|
-
const channelEntry = ensureRecord(channels, key);
|
|
3777
|
-
const hadEntries = Object.keys(channelEntry).length > 0;
|
|
3778
|
-
mergeMissing(channelEntry, legacy);
|
|
3779
|
-
channels[key] = channelEntry;
|
|
3780
|
-
delete raw[key];
|
|
3781
|
-
changes.push(hadEntries ? `Merged ${key} → channels.${key}.` : `Moved ${key} → channels.${key}.`);
|
|
3782
|
-
}
|
|
3783
|
-
raw.channels = channels;
|
|
3784
|
-
}
|
|
3785
|
-
},
|
|
3786
|
-
{
|
|
3787
|
-
id: "channels.streaming-keys->channels.streaming",
|
|
3788
|
-
describe: "Normalize legacy streaming keys to channels.<provider>.streaming (Telegram/Discord/Slack)",
|
|
3789
|
-
apply: (raw, changes) => {
|
|
3790
|
-
const channels = getRecord(raw.channels);
|
|
3791
|
-
if (!channels) return;
|
|
3792
|
-
const migrateProviderEntry = (params) => {
|
|
3793
|
-
const migrateCommonStreamingMode = (resolveMode) => {
|
|
3794
|
-
const hasLegacyStreamMode = params.entry.streamMode !== void 0;
|
|
3795
|
-
const legacyStreaming = params.entry.streaming;
|
|
3796
|
-
if (!hasLegacyStreamMode && typeof legacyStreaming !== "boolean") return false;
|
|
3797
|
-
const resolved = resolveMode(params.entry);
|
|
3798
|
-
params.entry.streaming = resolved;
|
|
3799
|
-
if (hasLegacyStreamMode) {
|
|
3800
|
-
delete params.entry.streamMode;
|
|
3801
|
-
changes.push(`Moved ${params.pathPrefix}.streamMode → ${params.pathPrefix}.streaming (${resolved}).`);
|
|
3802
|
-
}
|
|
3803
|
-
if (typeof legacyStreaming === "boolean") changes.push(`Normalized ${params.pathPrefix}.streaming boolean → enum (${resolved}).`);
|
|
3804
|
-
return true;
|
|
3805
|
-
};
|
|
3806
|
-
const hasLegacyStreamMode = params.entry.streamMode !== void 0;
|
|
3807
|
-
const legacyStreaming = params.entry.streaming;
|
|
3808
|
-
const legacyNativeStreaming = params.entry.nativeStreaming;
|
|
3809
|
-
if (params.provider === "telegram") {
|
|
3810
|
-
migrateCommonStreamingMode(resolveTelegramPreviewStreamMode);
|
|
3811
|
-
return;
|
|
3812
|
-
}
|
|
3813
|
-
if (params.provider === "discord") {
|
|
3814
|
-
migrateCommonStreamingMode(resolveDiscordPreviewStreamMode);
|
|
3815
|
-
return;
|
|
3816
|
-
}
|
|
3817
|
-
if (!hasLegacyStreamMode && typeof legacyStreaming !== "boolean") return;
|
|
3818
|
-
const resolvedStreaming = resolveSlackStreamingMode(params.entry);
|
|
3819
|
-
const resolvedNativeStreaming = resolveSlackNativeStreaming(params.entry);
|
|
3820
|
-
params.entry.streaming = resolvedStreaming;
|
|
3821
|
-
params.entry.nativeStreaming = resolvedNativeStreaming;
|
|
3822
|
-
if (hasLegacyStreamMode) {
|
|
3823
|
-
delete params.entry.streamMode;
|
|
3824
|
-
changes.push(`Moved ${params.pathPrefix}.streamMode → ${params.pathPrefix}.streaming (${resolvedStreaming}).`);
|
|
3825
|
-
}
|
|
3826
|
-
if (typeof legacyStreaming === "boolean") changes.push(`Moved ${params.pathPrefix}.streaming (boolean) → ${params.pathPrefix}.nativeStreaming (${resolvedNativeStreaming}).`);
|
|
3827
|
-
else if (typeof legacyNativeStreaming !== "boolean" && hasLegacyStreamMode) changes.push(`Set ${params.pathPrefix}.nativeStreaming → ${resolvedNativeStreaming}.`);
|
|
3828
|
-
};
|
|
3829
|
-
const migrateProvider = (provider) => {
|
|
3830
|
-
const providerEntry = getRecord(channels[provider]);
|
|
3831
|
-
if (!providerEntry) return;
|
|
3832
|
-
migrateProviderEntry({
|
|
3833
|
-
provider,
|
|
3834
|
-
entry: providerEntry,
|
|
3835
|
-
pathPrefix: `channels.${provider}`
|
|
3836
|
-
});
|
|
3837
|
-
const accounts = getRecord(providerEntry.accounts);
|
|
3838
|
-
if (!accounts) return;
|
|
3839
|
-
for (const [accountId, accountValue] of Object.entries(accounts)) {
|
|
3840
|
-
const account = getRecord(accountValue);
|
|
3841
|
-
if (!account) continue;
|
|
3842
|
-
migrateProviderEntry({
|
|
3843
|
-
provider,
|
|
3844
|
-
entry: account,
|
|
3845
|
-
pathPrefix: `channels.${provider}.accounts.${accountId}`
|
|
3846
|
-
});
|
|
3847
|
-
}
|
|
3848
|
-
};
|
|
3849
|
-
migrateProvider("telegram");
|
|
3850
|
-
migrateProvider("discord");
|
|
3851
|
-
migrateProvider("slack");
|
|
3852
|
-
}
|
|
3853
|
-
},
|
|
3854
|
-
{
|
|
3855
|
-
id: "routing.allowFrom->channels.whatsapp.allowFrom",
|
|
3856
|
-
describe: "Move routing.allowFrom to channels.whatsapp.allowFrom",
|
|
3857
|
-
apply: (raw, changes) => {
|
|
3858
|
-
const routing = raw.routing;
|
|
3859
|
-
if (!routing || typeof routing !== "object") return;
|
|
3860
|
-
const allowFrom = routing.allowFrom;
|
|
3861
|
-
if (allowFrom === void 0) return;
|
|
3862
|
-
const channels = getRecord(raw.channels);
|
|
3863
|
-
const whatsapp = channels ? getRecord(channels.whatsapp) : null;
|
|
3864
|
-
if (!whatsapp) {
|
|
3865
|
-
delete routing.allowFrom;
|
|
3866
|
-
if (Object.keys(routing).length === 0) delete raw.routing;
|
|
3867
|
-
changes.push("Removed routing.allowFrom (channels.whatsapp not configured).");
|
|
3868
|
-
return;
|
|
3869
|
-
}
|
|
3870
|
-
if (whatsapp.allowFrom === void 0) {
|
|
3871
|
-
whatsapp.allowFrom = allowFrom;
|
|
3872
|
-
changes.push("Moved routing.allowFrom → channels.whatsapp.allowFrom.");
|
|
3873
|
-
} else changes.push("Removed routing.allowFrom (channels.whatsapp.allowFrom already set).");
|
|
3874
|
-
delete routing.allowFrom;
|
|
3875
|
-
if (Object.keys(routing).length === 0) delete raw.routing;
|
|
3876
|
-
channels.whatsapp = whatsapp;
|
|
3877
|
-
raw.channels = channels;
|
|
3878
|
-
}
|
|
3879
|
-
},
|
|
3880
|
-
{
|
|
3881
|
-
id: "routing.groupChat.requireMention->groups.*.requireMention",
|
|
3882
|
-
describe: "Move routing.groupChat.requireMention to channels.whatsapp/telegram/imessage groups",
|
|
3883
|
-
apply: (raw, changes) => {
|
|
3884
|
-
const routing = raw.routing;
|
|
3885
|
-
if (!routing || typeof routing !== "object") return;
|
|
3886
|
-
const groupChat = routing.groupChat && typeof routing.groupChat === "object" ? routing.groupChat : null;
|
|
3887
|
-
if (!groupChat) return;
|
|
3888
|
-
const requireMention = groupChat.requireMention;
|
|
3889
|
-
if (requireMention === void 0) return;
|
|
3890
|
-
const channels = ensureRecord(raw, "channels");
|
|
3891
|
-
const applyTo = (key, options) => {
|
|
3892
|
-
if (options?.requireExisting && !isRecord(channels[key])) return;
|
|
3893
|
-
const section = channels[key] && typeof channels[key] === "object" ? channels[key] : {};
|
|
3894
|
-
const { groups, entry } = ensureDefaultGroupEntry(section);
|
|
3895
|
-
const defaultKey = "*";
|
|
3896
|
-
if (entry.requireMention === void 0) {
|
|
3897
|
-
entry.requireMention = requireMention;
|
|
3898
|
-
groups[defaultKey] = entry;
|
|
3899
|
-
section.groups = groups;
|
|
3900
|
-
channels[key] = section;
|
|
3901
|
-
changes.push(`Moved routing.groupChat.requireMention → channels.${key}.groups."*".requireMention.`);
|
|
3902
|
-
} else changes.push(`Removed routing.groupChat.requireMention (channels.${key}.groups."*" already set).`);
|
|
3903
|
-
};
|
|
3904
|
-
applyTo("whatsapp", { requireExisting: true });
|
|
3905
|
-
applyTo("telegram");
|
|
3906
|
-
applyTo("imessage");
|
|
3907
|
-
delete groupChat.requireMention;
|
|
3908
|
-
if (Object.keys(groupChat).length === 0) delete routing.groupChat;
|
|
3909
|
-
if (Object.keys(routing).length === 0) delete raw.routing;
|
|
3910
|
-
raw.channels = channels;
|
|
3911
|
-
}
|
|
3912
|
-
},
|
|
3913
|
-
{
|
|
3914
|
-
id: "gateway.token->gateway.auth.token",
|
|
3915
|
-
describe: "Move gateway.token to gateway.auth.token",
|
|
3916
|
-
apply: (raw, changes) => {
|
|
3917
|
-
const gateway = raw.gateway;
|
|
3918
|
-
if (!gateway || typeof gateway !== "object") return;
|
|
3919
|
-
const token = gateway.token;
|
|
3920
|
-
if (token === void 0) return;
|
|
3921
|
-
const gatewayObj = gateway;
|
|
3922
|
-
const auth = gatewayObj.auth && typeof gatewayObj.auth === "object" ? gatewayObj.auth : {};
|
|
3923
|
-
if (auth.token === void 0) {
|
|
3924
|
-
auth.token = token;
|
|
3925
|
-
if (!auth.mode) auth.mode = "token";
|
|
3926
|
-
changes.push("Moved gateway.token → gateway.auth.token.");
|
|
3927
|
-
} else changes.push("Removed gateway.token (gateway.auth.token already set).");
|
|
3928
|
-
delete gatewayObj.token;
|
|
3929
|
-
if (Object.keys(auth).length > 0) gatewayObj.auth = auth;
|
|
3930
|
-
raw.gateway = gatewayObj;
|
|
3931
|
-
}
|
|
3932
|
-
},
|
|
3933
|
-
{
|
|
3934
|
-
id: "telegram.requireMention->channels.telegram.groups.*.requireMention",
|
|
3935
|
-
describe: "Move telegram.requireMention to channels.telegram.groups.*.requireMention",
|
|
3936
|
-
apply: (raw, changes) => {
|
|
3937
|
-
const channels = ensureRecord(raw, "channels");
|
|
3938
|
-
const telegram = channels.telegram;
|
|
3939
|
-
if (!telegram || typeof telegram !== "object") return;
|
|
3940
|
-
const requireMention = telegram.requireMention;
|
|
3941
|
-
if (requireMention === void 0) return;
|
|
3942
|
-
const { groups, entry } = ensureDefaultGroupEntry(telegram);
|
|
3943
|
-
const defaultKey = "*";
|
|
3944
|
-
if (entry.requireMention === void 0) {
|
|
3945
|
-
entry.requireMention = requireMention;
|
|
3946
|
-
groups[defaultKey] = entry;
|
|
3947
|
-
telegram.groups = groups;
|
|
3948
|
-
changes.push("Moved telegram.requireMention → channels.telegram.groups.\"*\".requireMention.");
|
|
3949
|
-
} else changes.push("Removed telegram.requireMention (channels.telegram.groups.\"*\" already set).");
|
|
3950
|
-
delete telegram.requireMention;
|
|
3951
|
-
channels.telegram = telegram;
|
|
3952
|
-
raw.channels = channels;
|
|
3953
|
-
}
|
|
3954
|
-
}
|
|
3955
|
-
];
|
|
3956
|
-
|
|
3957
|
-
//#endregion
|
|
3958
|
-
//#region src/config/legacy.migrations.part-2.ts
|
|
3959
|
-
function applyLegacyAudioTranscriptionModel(params) {
|
|
3960
|
-
const mapped = mapLegacyAudioTranscription(params.source);
|
|
3961
|
-
if (!mapped) {
|
|
3962
|
-
params.changes.push(params.invalidMessage);
|
|
3963
|
-
return;
|
|
3964
|
-
}
|
|
3965
|
-
const mediaAudio = ensureRecord(ensureRecord(ensureRecord(params.raw, "tools"), "media"), "audio");
|
|
3966
|
-
if ((Array.isArray(mediaAudio.models) ? mediaAudio.models : []).length === 0) {
|
|
3967
|
-
mediaAudio.enabled = true;
|
|
3968
|
-
mediaAudio.models = [mapped];
|
|
3969
|
-
params.changes.push(params.movedMessage);
|
|
3970
|
-
return;
|
|
3971
|
-
}
|
|
3972
|
-
params.changes.push(params.alreadySetMessage);
|
|
3973
|
-
}
|
|
3974
|
-
const LEGACY_CONFIG_MIGRATIONS_PART_2 = [
|
|
3975
|
-
{
|
|
3976
|
-
id: "agent.model-config-v2",
|
|
3977
|
-
describe: "Migrate legacy agent.model/allowedModels/modelAliases/modelFallbacks/imageModelFallbacks to agent.models + model lists",
|
|
3978
|
-
apply: (raw, changes) => {
|
|
3979
|
-
const agentRoot = getRecord(raw.agent);
|
|
3980
|
-
const defaults = getRecord(getRecord(raw.agents)?.defaults);
|
|
3981
|
-
const agent = agentRoot ?? defaults;
|
|
3982
|
-
if (!agent) return;
|
|
3983
|
-
const label = agentRoot ? "agent" : "agents.defaults";
|
|
3984
|
-
const legacyModel = typeof agent.model === "string" ? String(agent.model) : void 0;
|
|
3985
|
-
const legacyImageModel = typeof agent.imageModel === "string" ? String(agent.imageModel) : void 0;
|
|
3986
|
-
const legacyAllowed = Array.isArray(agent.allowedModels) ? agent.allowedModels.map(String) : [];
|
|
3987
|
-
const legacyModelFallbacks = Array.isArray(agent.modelFallbacks) ? agent.modelFallbacks.map(String) : [];
|
|
3988
|
-
const legacyImageModelFallbacks = Array.isArray(agent.imageModelFallbacks) ? agent.imageModelFallbacks.map(String) : [];
|
|
3989
|
-
const legacyAliases = agent.modelAliases && typeof agent.modelAliases === "object" ? agent.modelAliases : {};
|
|
3990
|
-
if (!(legacyModel || legacyImageModel || legacyAllowed.length > 0 || legacyModelFallbacks.length > 0 || legacyImageModelFallbacks.length > 0 || Object.keys(legacyAliases).length > 0)) return;
|
|
3991
|
-
const models = agent.models && typeof agent.models === "object" ? agent.models : {};
|
|
3992
|
-
const ensureModel = (rawKey) => {
|
|
3993
|
-
if (typeof rawKey !== "string") return;
|
|
3994
|
-
const key = rawKey.trim();
|
|
3995
|
-
if (!key) return;
|
|
3996
|
-
if (!models[key]) models[key] = {};
|
|
3997
|
-
};
|
|
3998
|
-
ensureModel(legacyModel);
|
|
3999
|
-
ensureModel(legacyImageModel);
|
|
4000
|
-
for (const key of legacyAllowed) ensureModel(key);
|
|
4001
|
-
for (const key of legacyModelFallbacks) ensureModel(key);
|
|
4002
|
-
for (const key of legacyImageModelFallbacks) ensureModel(key);
|
|
4003
|
-
for (const target of Object.values(legacyAliases)) {
|
|
4004
|
-
if (typeof target !== "string") continue;
|
|
4005
|
-
ensureModel(target);
|
|
4006
|
-
}
|
|
4007
|
-
for (const [alias, targetRaw] of Object.entries(legacyAliases)) {
|
|
4008
|
-
if (typeof targetRaw !== "string") continue;
|
|
4009
|
-
const target = targetRaw.trim();
|
|
4010
|
-
if (!target) continue;
|
|
4011
|
-
const entry = models[target] && typeof models[target] === "object" ? models[target] : {};
|
|
4012
|
-
if (!("alias" in entry)) {
|
|
4013
|
-
entry.alias = alias;
|
|
4014
|
-
models[target] = entry;
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
const currentModel = agent.model && typeof agent.model === "object" ? agent.model : null;
|
|
4018
|
-
if (currentModel) {
|
|
4019
|
-
if (!currentModel.primary && legacyModel) currentModel.primary = legacyModel;
|
|
4020
|
-
if (legacyModelFallbacks.length > 0 && (!Array.isArray(currentModel.fallbacks) || currentModel.fallbacks.length === 0)) currentModel.fallbacks = legacyModelFallbacks;
|
|
4021
|
-
agent.model = currentModel;
|
|
4022
|
-
} else if (legacyModel || legacyModelFallbacks.length > 0) agent.model = {
|
|
4023
|
-
primary: legacyModel,
|
|
4024
|
-
fallbacks: legacyModelFallbacks.length ? legacyModelFallbacks : []
|
|
4025
|
-
};
|
|
4026
|
-
const currentImageModel = agent.imageModel && typeof agent.imageModel === "object" ? agent.imageModel : null;
|
|
4027
|
-
if (currentImageModel) {
|
|
4028
|
-
if (!currentImageModel.primary && legacyImageModel) currentImageModel.primary = legacyImageModel;
|
|
4029
|
-
if (legacyImageModelFallbacks.length > 0 && (!Array.isArray(currentImageModel.fallbacks) || currentImageModel.fallbacks.length === 0)) currentImageModel.fallbacks = legacyImageModelFallbacks;
|
|
4030
|
-
agent.imageModel = currentImageModel;
|
|
4031
|
-
} else if (legacyImageModel || legacyImageModelFallbacks.length > 0) agent.imageModel = {
|
|
4032
|
-
primary: legacyImageModel,
|
|
4033
|
-
fallbacks: legacyImageModelFallbacks.length ? legacyImageModelFallbacks : []
|
|
4034
|
-
};
|
|
4035
|
-
agent.models = models;
|
|
4036
|
-
if (legacyModel !== void 0) changes.push(`Migrated ${label}.model string → ${label}.model.primary.`);
|
|
4037
|
-
if (legacyModelFallbacks.length > 0) changes.push(`Migrated ${label}.modelFallbacks → ${label}.model.fallbacks.`);
|
|
4038
|
-
if (legacyImageModel !== void 0) changes.push(`Migrated ${label}.imageModel string → ${label}.imageModel.primary.`);
|
|
4039
|
-
if (legacyImageModelFallbacks.length > 0) changes.push(`Migrated ${label}.imageModelFallbacks → ${label}.imageModel.fallbacks.`);
|
|
4040
|
-
if (legacyAllowed.length > 0) changes.push(`Migrated ${label}.allowedModels → ${label}.models.`);
|
|
4041
|
-
if (Object.keys(legacyAliases).length > 0) changes.push(`Migrated ${label}.modelAliases → ${label}.models.*.alias.`);
|
|
4042
|
-
delete agent.allowedModels;
|
|
4043
|
-
delete agent.modelAliases;
|
|
4044
|
-
delete agent.modelFallbacks;
|
|
4045
|
-
delete agent.imageModelFallbacks;
|
|
4046
|
-
}
|
|
4047
|
-
},
|
|
4048
|
-
{
|
|
4049
|
-
id: "routing.agents-v2",
|
|
4050
|
-
describe: "Move routing.agents/defaultAgentId to agents.list",
|
|
4051
|
-
apply: (raw, changes) => {
|
|
4052
|
-
const routing = getRecord(raw.routing);
|
|
4053
|
-
if (!routing) return;
|
|
4054
|
-
const routingAgents = getRecord(routing.agents);
|
|
4055
|
-
const agents = ensureRecord(raw, "agents");
|
|
4056
|
-
const list = getAgentsList(agents);
|
|
4057
|
-
if (routingAgents) {
|
|
4058
|
-
for (const [rawId, entryRaw] of Object.entries(routingAgents)) {
|
|
4059
|
-
const agentId = String(rawId ?? "").trim();
|
|
4060
|
-
const entry = getRecord(entryRaw);
|
|
4061
|
-
if (!agentId || !entry) continue;
|
|
4062
|
-
const target = ensureAgentEntry(list, agentId);
|
|
4063
|
-
const entryCopy = { ...entry };
|
|
4064
|
-
if ("mentionPatterns" in entryCopy) {
|
|
4065
|
-
const mentionPatterns = entryCopy.mentionPatterns;
|
|
4066
|
-
const groupChat = ensureRecord(target, "groupChat");
|
|
4067
|
-
if (groupChat.mentionPatterns === void 0) {
|
|
4068
|
-
groupChat.mentionPatterns = mentionPatterns;
|
|
4069
|
-
changes.push(`Moved routing.agents.${agentId}.mentionPatterns → agents.list (id "${agentId}").groupChat.mentionPatterns.`);
|
|
4070
|
-
} else changes.push(`Removed routing.agents.${agentId}.mentionPatterns (agents.list groupChat mentionPatterns already set).`);
|
|
4071
|
-
delete entryCopy.mentionPatterns;
|
|
4072
|
-
}
|
|
4073
|
-
const legacyGroupChat = getRecord(entryCopy.groupChat);
|
|
4074
|
-
if (legacyGroupChat) {
|
|
4075
|
-
mergeMissing(ensureRecord(target, "groupChat"), legacyGroupChat);
|
|
4076
|
-
delete entryCopy.groupChat;
|
|
4077
|
-
}
|
|
4078
|
-
const legacySandbox = getRecord(entryCopy.sandbox);
|
|
4079
|
-
if (legacySandbox) {
|
|
4080
|
-
const sandboxTools = getRecord(legacySandbox.tools);
|
|
4081
|
-
if (sandboxTools) {
|
|
4082
|
-
mergeMissing(ensureRecord(ensureRecord(ensureRecord(target, "tools"), "sandbox"), "tools"), sandboxTools);
|
|
4083
|
-
delete legacySandbox.tools;
|
|
4084
|
-
changes.push(`Moved routing.agents.${agentId}.sandbox.tools → agents.list (id "${agentId}").tools.sandbox.tools.`);
|
|
4085
|
-
}
|
|
4086
|
-
entryCopy.sandbox = legacySandbox;
|
|
4087
|
-
}
|
|
4088
|
-
mergeMissing(target, entryCopy);
|
|
4089
|
-
}
|
|
4090
|
-
delete routing.agents;
|
|
4091
|
-
changes.push("Moved routing.agents → agents.list.");
|
|
4092
|
-
}
|
|
4093
|
-
const defaultAgentId = typeof routing.defaultAgentId === "string" ? routing.defaultAgentId.trim() : "";
|
|
4094
|
-
if (defaultAgentId) {
|
|
4095
|
-
if (!list.some((entry) => isRecord(entry) && entry.default === true)) {
|
|
4096
|
-
const entry = ensureAgentEntry(list, defaultAgentId);
|
|
4097
|
-
entry.default = true;
|
|
4098
|
-
changes.push(`Moved routing.defaultAgentId → agents.list (id "${defaultAgentId}").default.`);
|
|
4099
|
-
} else changes.push("Removed routing.defaultAgentId (agents.list default already set).");
|
|
4100
|
-
delete routing.defaultAgentId;
|
|
4101
|
-
}
|
|
4102
|
-
if (list.length > 0) agents.list = list;
|
|
4103
|
-
if (Object.keys(routing).length === 0) delete raw.routing;
|
|
4104
|
-
}
|
|
4105
|
-
},
|
|
4106
|
-
{
|
|
4107
|
-
id: "routing.config-v2",
|
|
4108
|
-
describe: "Move routing bindings/groupChat/queue/agentToAgent/transcribeAudio",
|
|
4109
|
-
apply: (raw, changes) => {
|
|
4110
|
-
const routing = getRecord(raw.routing);
|
|
4111
|
-
if (!routing) return;
|
|
4112
|
-
if (routing.bindings !== void 0) {
|
|
4113
|
-
if (raw.bindings === void 0) {
|
|
4114
|
-
raw.bindings = routing.bindings;
|
|
4115
|
-
changes.push("Moved routing.bindings → bindings.");
|
|
4116
|
-
} else changes.push("Removed routing.bindings (bindings already set).");
|
|
4117
|
-
delete routing.bindings;
|
|
4118
|
-
}
|
|
4119
|
-
if (routing.agentToAgent !== void 0) {
|
|
4120
|
-
const tools = ensureRecord(raw, "tools");
|
|
4121
|
-
if (tools.agentToAgent === void 0) {
|
|
4122
|
-
tools.agentToAgent = routing.agentToAgent;
|
|
4123
|
-
changes.push("Moved routing.agentToAgent → tools.agentToAgent.");
|
|
4124
|
-
} else changes.push("Removed routing.agentToAgent (tools.agentToAgent already set).");
|
|
4125
|
-
delete routing.agentToAgent;
|
|
4126
|
-
}
|
|
4127
|
-
if (routing.queue !== void 0) {
|
|
4128
|
-
const messages = ensureRecord(raw, "messages");
|
|
4129
|
-
if (messages.queue === void 0) {
|
|
4130
|
-
messages.queue = routing.queue;
|
|
4131
|
-
changes.push("Moved routing.queue → messages.queue.");
|
|
4132
|
-
} else changes.push("Removed routing.queue (messages.queue already set).");
|
|
4133
|
-
delete routing.queue;
|
|
4134
|
-
}
|
|
4135
|
-
const groupChat = getRecord(routing.groupChat);
|
|
4136
|
-
if (groupChat) {
|
|
4137
|
-
const historyLimit = groupChat.historyLimit;
|
|
4138
|
-
if (historyLimit !== void 0) {
|
|
4139
|
-
const messagesGroup = ensureRecord(ensureRecord(raw, "messages"), "groupChat");
|
|
4140
|
-
if (messagesGroup.historyLimit === void 0) {
|
|
4141
|
-
messagesGroup.historyLimit = historyLimit;
|
|
4142
|
-
changes.push("Moved routing.groupChat.historyLimit → messages.groupChat.historyLimit.");
|
|
4143
|
-
} else changes.push("Removed routing.groupChat.historyLimit (messages.groupChat.historyLimit already set).");
|
|
4144
|
-
delete groupChat.historyLimit;
|
|
4145
|
-
}
|
|
4146
|
-
const mentionPatterns = groupChat.mentionPatterns;
|
|
4147
|
-
if (mentionPatterns !== void 0) {
|
|
4148
|
-
const messagesGroup = ensureRecord(ensureRecord(raw, "messages"), "groupChat");
|
|
4149
|
-
if (messagesGroup.mentionPatterns === void 0) {
|
|
4150
|
-
messagesGroup.mentionPatterns = mentionPatterns;
|
|
4151
|
-
changes.push("Moved routing.groupChat.mentionPatterns → messages.groupChat.mentionPatterns.");
|
|
4152
|
-
} else changes.push("Removed routing.groupChat.mentionPatterns (messages.groupChat.mentionPatterns already set).");
|
|
4153
|
-
delete groupChat.mentionPatterns;
|
|
4154
|
-
}
|
|
4155
|
-
if (Object.keys(groupChat).length === 0) delete routing.groupChat;
|
|
4156
|
-
else routing.groupChat = groupChat;
|
|
4157
|
-
}
|
|
4158
|
-
if (routing.transcribeAudio !== void 0) {
|
|
4159
|
-
applyLegacyAudioTranscriptionModel({
|
|
4160
|
-
raw,
|
|
4161
|
-
source: routing.transcribeAudio,
|
|
4162
|
-
changes,
|
|
4163
|
-
movedMessage: "Moved routing.transcribeAudio → tools.media.audio.models.",
|
|
4164
|
-
alreadySetMessage: "Removed routing.transcribeAudio (tools.media.audio.models already set).",
|
|
4165
|
-
invalidMessage: "Removed routing.transcribeAudio (invalid or empty command)."
|
|
4166
|
-
});
|
|
4167
|
-
delete routing.transcribeAudio;
|
|
4168
|
-
}
|
|
4169
|
-
if (Object.keys(routing).length === 0) delete raw.routing;
|
|
4170
|
-
}
|
|
4171
|
-
},
|
|
4172
|
-
{
|
|
4173
|
-
id: "audio.transcription-v2",
|
|
4174
|
-
describe: "Move audio.transcription to tools.media.audio.models",
|
|
4175
|
-
apply: (raw, changes) => {
|
|
4176
|
-
const audio = getRecord(raw.audio);
|
|
4177
|
-
if (audio?.transcription === void 0) return;
|
|
4178
|
-
applyLegacyAudioTranscriptionModel({
|
|
4179
|
-
raw,
|
|
4180
|
-
source: audio.transcription,
|
|
4181
|
-
changes,
|
|
4182
|
-
movedMessage: "Moved audio.transcription → tools.media.audio.models.",
|
|
4183
|
-
alreadySetMessage: "Removed audio.transcription (tools.media.audio.models already set).",
|
|
4184
|
-
invalidMessage: "Removed audio.transcription (invalid or empty command)."
|
|
4185
|
-
});
|
|
4186
|
-
delete audio.transcription;
|
|
4187
|
-
if (Object.keys(audio).length === 0) delete raw.audio;
|
|
4188
|
-
else raw.audio = audio;
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
];
|
|
4192
|
-
|
|
4193
|
-
//#endregion
|
|
4194
|
-
//#region src/config/legacy.migrations.part-3.ts
|
|
4195
|
-
const LEGACY_CONFIG_MIGRATIONS_PART_3 = [
|
|
4196
|
-
{
|
|
4197
|
-
id: "auth.anthropic-claude-cli-mode-oauth",
|
|
4198
|
-
describe: "Switch anthropic:claude-cli auth profile mode to oauth",
|
|
4199
|
-
apply: (raw, changes) => {
|
|
4200
|
-
const profiles = getRecord(getRecord(raw.auth)?.profiles);
|
|
4201
|
-
if (!profiles) return;
|
|
4202
|
-
const claudeCli = getRecord(profiles["anthropic:claude-cli"]);
|
|
4203
|
-
if (!claudeCli) return;
|
|
4204
|
-
if (claudeCli.mode !== "token") return;
|
|
4205
|
-
claudeCli.mode = "oauth";
|
|
4206
|
-
changes.push("Updated auth.profiles[\"anthropic:claude-cli\"].mode → \"oauth\".");
|
|
4207
|
-
}
|
|
4208
|
-
},
|
|
4209
|
-
{
|
|
4210
|
-
id: "tools.bash->tools.exec",
|
|
4211
|
-
describe: "Move tools.bash to tools.exec",
|
|
4212
|
-
apply: (raw, changes) => {
|
|
4213
|
-
const tools = ensureRecord(raw, "tools");
|
|
4214
|
-
const bash = getRecord(tools.bash);
|
|
4215
|
-
if (!bash) return;
|
|
4216
|
-
if (tools.exec === void 0) {
|
|
4217
|
-
tools.exec = bash;
|
|
4218
|
-
changes.push("Moved tools.bash → tools.exec.");
|
|
4219
|
-
} else changes.push("Removed tools.bash (tools.exec already set).");
|
|
4220
|
-
delete tools.bash;
|
|
4221
|
-
}
|
|
4222
|
-
},
|
|
4223
|
-
{
|
|
4224
|
-
id: "messages.tts.enabled->auto",
|
|
4225
|
-
describe: "Move messages.tts.enabled to messages.tts.auto",
|
|
4226
|
-
apply: (raw, changes) => {
|
|
4227
|
-
const tts = getRecord(getRecord(raw.messages)?.tts);
|
|
4228
|
-
if (!tts) return;
|
|
4229
|
-
if (tts.auto !== void 0) {
|
|
4230
|
-
if ("enabled" in tts) {
|
|
4231
|
-
delete tts.enabled;
|
|
4232
|
-
changes.push("Removed messages.tts.enabled (messages.tts.auto already set).");
|
|
4233
|
-
}
|
|
4234
|
-
return;
|
|
4235
|
-
}
|
|
4236
|
-
if (typeof tts.enabled !== "boolean") return;
|
|
4237
|
-
tts.auto = tts.enabled ? "always" : "off";
|
|
4238
|
-
delete tts.enabled;
|
|
4239
|
-
changes.push(`Moved messages.tts.enabled → messages.tts.auto (${String(tts.auto)}).`);
|
|
4240
|
-
}
|
|
4241
|
-
},
|
|
4242
|
-
{
|
|
4243
|
-
id: "agent.defaults-v2",
|
|
4244
|
-
describe: "Move agent config to agents.defaults and tools",
|
|
4245
|
-
apply: (raw, changes) => {
|
|
4246
|
-
const agent = getRecord(raw.agent);
|
|
4247
|
-
if (!agent) return;
|
|
4248
|
-
const agents = ensureRecord(raw, "agents");
|
|
4249
|
-
const defaults = getRecord(agents.defaults) ?? {};
|
|
4250
|
-
const tools = ensureRecord(raw, "tools");
|
|
4251
|
-
const agentTools = getRecord(agent.tools);
|
|
4252
|
-
if (agentTools) {
|
|
4253
|
-
if (tools.allow === void 0 && agentTools.allow !== void 0) {
|
|
4254
|
-
tools.allow = agentTools.allow;
|
|
4255
|
-
changes.push("Moved agent.tools.allow → tools.allow.");
|
|
4256
|
-
}
|
|
4257
|
-
if (tools.deny === void 0 && agentTools.deny !== void 0) {
|
|
4258
|
-
tools.deny = agentTools.deny;
|
|
4259
|
-
changes.push("Moved agent.tools.deny → tools.deny.");
|
|
4260
|
-
}
|
|
4261
|
-
}
|
|
4262
|
-
const elevated = getRecord(agent.elevated);
|
|
4263
|
-
if (elevated) if (tools.elevated === void 0) {
|
|
4264
|
-
tools.elevated = elevated;
|
|
4265
|
-
changes.push("Moved agent.elevated → tools.elevated.");
|
|
4266
|
-
} else changes.push("Removed agent.elevated (tools.elevated already set).");
|
|
4267
|
-
const bash = getRecord(agent.bash);
|
|
4268
|
-
if (bash) if (tools.exec === void 0) {
|
|
4269
|
-
tools.exec = bash;
|
|
4270
|
-
changes.push("Moved agent.bash → tools.exec.");
|
|
4271
|
-
} else changes.push("Removed agent.bash (tools.exec already set).");
|
|
4272
|
-
const sandbox = getRecord(agent.sandbox);
|
|
4273
|
-
if (sandbox) {
|
|
4274
|
-
const sandboxTools = getRecord(sandbox.tools);
|
|
4275
|
-
if (sandboxTools) {
|
|
4276
|
-
mergeMissing(ensureRecord(ensureRecord(tools, "sandbox"), "tools"), sandboxTools);
|
|
4277
|
-
delete sandbox.tools;
|
|
4278
|
-
changes.push("Moved agent.sandbox.tools → tools.sandbox.tools.");
|
|
4279
|
-
}
|
|
4280
|
-
}
|
|
4281
|
-
const subagents = getRecord(agent.subagents);
|
|
4282
|
-
if (subagents) {
|
|
4283
|
-
const subagentTools = getRecord(subagents.tools);
|
|
4284
|
-
if (subagentTools) {
|
|
4285
|
-
mergeMissing(ensureRecord(ensureRecord(tools, "subagents"), "tools"), subagentTools);
|
|
4286
|
-
delete subagents.tools;
|
|
4287
|
-
changes.push("Moved agent.subagents.tools → tools.subagents.tools.");
|
|
4288
|
-
}
|
|
4289
|
-
}
|
|
4290
|
-
const agentCopy = structuredClone(agent);
|
|
4291
|
-
delete agentCopy.tools;
|
|
4292
|
-
delete agentCopy.elevated;
|
|
4293
|
-
delete agentCopy.bash;
|
|
4294
|
-
if (isRecord(agentCopy.sandbox)) delete agentCopy.sandbox.tools;
|
|
4295
|
-
if (isRecord(agentCopy.subagents)) delete agentCopy.subagents.tools;
|
|
4296
|
-
mergeMissing(defaults, agentCopy);
|
|
4297
|
-
agents.defaults = defaults;
|
|
4298
|
-
raw.agents = agents;
|
|
4299
|
-
delete raw.agent;
|
|
4300
|
-
changes.push("Moved agent → agents.defaults.");
|
|
4301
|
-
}
|
|
4302
|
-
},
|
|
4303
|
-
{
|
|
4304
|
-
id: "identity->agents.list",
|
|
4305
|
-
describe: "Move identity to agents.list[].identity",
|
|
4306
|
-
apply: (raw, changes) => {
|
|
4307
|
-
const identity = getRecord(raw.identity);
|
|
4308
|
-
if (!identity) return;
|
|
4309
|
-
const agents = ensureRecord(raw, "agents");
|
|
4310
|
-
const list = getAgentsList(agents);
|
|
4311
|
-
const defaultId = resolveDefaultAgentIdFromRaw(raw);
|
|
4312
|
-
const entry = ensureAgentEntry(list, defaultId);
|
|
4313
|
-
if (entry.identity === void 0) {
|
|
4314
|
-
entry.identity = identity;
|
|
4315
|
-
changes.push(`Moved identity → agents.list (id "${defaultId}").identity.`);
|
|
4316
|
-
} else changes.push("Removed identity (agents.list identity already set).");
|
|
4317
|
-
agents.list = list;
|
|
4318
|
-
raw.agents = agents;
|
|
4319
|
-
delete raw.identity;
|
|
4320
|
-
}
|
|
4321
|
-
}
|
|
4322
|
-
];
|
|
4323
|
-
|
|
4324
|
-
//#endregion
|
|
4325
|
-
//#region src/config/legacy.migrations.ts
|
|
4326
|
-
const LEGACY_CONFIG_MIGRATIONS = [
|
|
4327
|
-
...LEGACY_CONFIG_MIGRATIONS_PART_1,
|
|
4328
|
-
...LEGACY_CONFIG_MIGRATIONS_PART_2,
|
|
4329
|
-
...LEGACY_CONFIG_MIGRATIONS_PART_3
|
|
4330
|
-
];
|
|
4331
|
-
|
|
4332
3485
|
//#endregion
|
|
4333
3486
|
//#region src/config/legacy.rules.ts
|
|
4334
|
-
const LEGACY_CONFIG_RULES = [
|
|
4335
|
-
{
|
|
4336
|
-
path: ["whatsapp"],
|
|
4337
|
-
message: "whatsapp config moved to channels.whatsapp (auto-migrated on load)."
|
|
4338
|
-
},
|
|
4339
|
-
{
|
|
4340
|
-
path: ["telegram"],
|
|
4341
|
-
message: "telegram config moved to channels.telegram (auto-migrated on load)."
|
|
4342
|
-
},
|
|
4343
|
-
{
|
|
4344
|
-
path: ["discord"],
|
|
4345
|
-
message: "discord config moved to channels.discord (auto-migrated on load)."
|
|
4346
|
-
},
|
|
4347
|
-
{
|
|
4348
|
-
path: ["slack"],
|
|
4349
|
-
message: "slack config moved to channels.slack (auto-migrated on load)."
|
|
4350
|
-
},
|
|
4351
|
-
{
|
|
4352
|
-
path: ["signal"],
|
|
4353
|
-
message: "signal config moved to channels.signal (auto-migrated on load)."
|
|
4354
|
-
},
|
|
4355
|
-
{
|
|
4356
|
-
path: ["imessage"],
|
|
4357
|
-
message: "imessage config moved to channels.imessage (auto-migrated on load)."
|
|
4358
|
-
},
|
|
4359
|
-
{
|
|
4360
|
-
path: ["msteams"],
|
|
4361
|
-
message: "msteams config moved to channels.msteams (auto-migrated on load)."
|
|
4362
|
-
},
|
|
4363
|
-
{
|
|
4364
|
-
path: ["routing", "allowFrom"],
|
|
4365
|
-
message: "routing.allowFrom was removed; use channels.whatsapp.allowFrom instead (auto-migrated on load)."
|
|
4366
|
-
},
|
|
4367
|
-
{
|
|
4368
|
-
path: ["routing", "bindings"],
|
|
4369
|
-
message: "routing.bindings was moved; use top-level bindings instead (auto-migrated on load)."
|
|
4370
|
-
},
|
|
4371
|
-
{
|
|
4372
|
-
path: ["routing", "agents"],
|
|
4373
|
-
message: "routing.agents was moved; use agents.list instead (auto-migrated on load)."
|
|
4374
|
-
},
|
|
4375
|
-
{
|
|
4376
|
-
path: ["routing", "defaultAgentId"],
|
|
4377
|
-
message: "routing.defaultAgentId was moved; use agents.list[].default instead (auto-migrated on load)."
|
|
4378
|
-
},
|
|
4379
|
-
{
|
|
4380
|
-
path: ["routing", "agentToAgent"],
|
|
4381
|
-
message: "routing.agentToAgent was moved; use tools.agentToAgent instead (auto-migrated on load)."
|
|
4382
|
-
},
|
|
4383
|
-
{
|
|
4384
|
-
path: [
|
|
4385
|
-
"routing",
|
|
4386
|
-
"groupChat",
|
|
4387
|
-
"requireMention"
|
|
4388
|
-
],
|
|
4389
|
-
message: "routing.groupChat.requireMention was removed; use channels.whatsapp/telegram/imessage groups defaults (e.g. channels.whatsapp.groups.\"*\".requireMention) instead (auto-migrated on load)."
|
|
4390
|
-
},
|
|
4391
|
-
{
|
|
4392
|
-
path: [
|
|
4393
|
-
"routing",
|
|
4394
|
-
"groupChat",
|
|
4395
|
-
"mentionPatterns"
|
|
4396
|
-
],
|
|
4397
|
-
message: "routing.groupChat.mentionPatterns was moved; use agents.list[].groupChat.mentionPatterns or messages.groupChat.mentionPatterns instead (auto-migrated on load)."
|
|
4398
|
-
},
|
|
4399
|
-
{
|
|
4400
|
-
path: ["routing", "queue"],
|
|
4401
|
-
message: "routing.queue was moved; use messages.queue instead (auto-migrated on load)."
|
|
4402
|
-
},
|
|
4403
|
-
{
|
|
4404
|
-
path: ["routing", "transcribeAudio"],
|
|
4405
|
-
message: "routing.transcribeAudio was moved; use tools.media.audio.models instead (auto-migrated on load)."
|
|
4406
|
-
},
|
|
4407
|
-
{
|
|
4408
|
-
path: ["telegram", "requireMention"],
|
|
4409
|
-
message: "telegram.requireMention was removed; use channels.telegram.groups.\"*\".requireMention instead (auto-migrated on load)."
|
|
4410
|
-
},
|
|
4411
|
-
{
|
|
4412
|
-
path: ["identity"],
|
|
4413
|
-
message: "identity was moved; use agents.list[].identity instead (auto-migrated on load)."
|
|
4414
|
-
},
|
|
4415
|
-
{
|
|
4416
|
-
path: ["agent"],
|
|
4417
|
-
message: "agent.* was moved; use agents.defaults (and tools.* for tool/elevated/exec settings) instead (auto-migrated on load)."
|
|
4418
|
-
},
|
|
4419
|
-
{
|
|
4420
|
-
path: ["tools", "bash"],
|
|
4421
|
-
message: "tools.bash was removed; use tools.exec instead (auto-migrated on load)."
|
|
4422
|
-
},
|
|
4423
|
-
{
|
|
4424
|
-
path: ["agent", "model"],
|
|
4425
|
-
message: "agent.model string was replaced by agents.defaults.model.primary/fallbacks and agents.defaults.models (auto-migrated on load).",
|
|
4426
|
-
match: (value) => typeof value === "string"
|
|
4427
|
-
},
|
|
4428
|
-
{
|
|
4429
|
-
path: ["agent", "imageModel"],
|
|
4430
|
-
message: "agent.imageModel string was replaced by agents.defaults.imageModel.primary/fallbacks (auto-migrated on load).",
|
|
4431
|
-
match: (value) => typeof value === "string"
|
|
4432
|
-
},
|
|
4433
|
-
{
|
|
4434
|
-
path: ["agent", "allowedModels"],
|
|
4435
|
-
message: "agent.allowedModels was replaced by agents.defaults.models (auto-migrated on load)."
|
|
4436
|
-
},
|
|
4437
|
-
{
|
|
4438
|
-
path: ["agent", "modelAliases"],
|
|
4439
|
-
message: "agent.modelAliases was replaced by agents.defaults.models.*.alias (auto-migrated on load)."
|
|
4440
|
-
},
|
|
4441
|
-
{
|
|
4442
|
-
path: ["agent", "modelFallbacks"],
|
|
4443
|
-
message: "agent.modelFallbacks was replaced by agents.defaults.model.fallbacks (auto-migrated on load)."
|
|
4444
|
-
},
|
|
4445
|
-
{
|
|
4446
|
-
path: ["agent", "imageModelFallbacks"],
|
|
4447
|
-
message: "agent.imageModelFallbacks was replaced by agents.defaults.imageModel.fallbacks (auto-migrated on load)."
|
|
4448
|
-
},
|
|
4449
|
-
{
|
|
4450
|
-
path: [
|
|
4451
|
-
"messages",
|
|
4452
|
-
"tts",
|
|
4453
|
-
"enabled"
|
|
4454
|
-
],
|
|
4455
|
-
message: "messages.tts.enabled was replaced by messages.tts.auto (auto-migrated on load)."
|
|
4456
|
-
},
|
|
4457
|
-
{
|
|
4458
|
-
path: ["gateway", "token"],
|
|
4459
|
-
message: "gateway.token is ignored; use gateway.auth.token instead (auto-migrated on load)."
|
|
4460
|
-
}
|
|
4461
|
-
];
|
|
3487
|
+
const LEGACY_CONFIG_RULES = [];
|
|
4462
3488
|
|
|
4463
3489
|
//#endregion
|
|
4464
3490
|
//#region src/config/legacy.ts
|
|
@@ -4606,7 +3632,7 @@ function applyConfigOverrides(cfg) {
|
|
|
4606
3632
|
|
|
4607
3633
|
//#endregion
|
|
4608
3634
|
//#region src/agents/agent-scope.ts
|
|
4609
|
-
const log$
|
|
3635
|
+
const log$11 = createSubsystemLogger("agent-scope");
|
|
4610
3636
|
/** Strip null bytes from paths to prevent ENOTDIR errors. */
|
|
4611
3637
|
function stripNullBytes(s) {
|
|
4612
3638
|
return s.replace(/\0/g, "");
|
|
@@ -4623,7 +3649,7 @@ function resolveDefaultAgentId(cfg) {
|
|
|
4623
3649
|
const defaults = agents.filter((agent) => agent?.default);
|
|
4624
3650
|
if (defaults.length > 1 && !defaultAgentWarned) {
|
|
4625
3651
|
defaultAgentWarned = true;
|
|
4626
|
-
log$
|
|
3652
|
+
log$11.warn("Multiple agents marked default=true; using the first entry as default.");
|
|
4627
3653
|
}
|
|
4628
3654
|
const chosen = (defaults[0] ?? agents[0])?.id?.trim();
|
|
4629
3655
|
return normalizeAgentId(chosen || DEFAULT_AGENT_ID);
|
|
@@ -4648,14 +3674,14 @@ function resolveAgentConfig(cfg, agentId) {
|
|
|
4648
3674
|
groupChat: entry.groupChat,
|
|
4649
3675
|
subagents: typeof entry.subagents === "object" && entry.subagents ? entry.subagents : void 0,
|
|
4650
3676
|
sandbox: entry.sandbox,
|
|
4651
|
-
tools: entry.tools
|
|
3677
|
+
tools: entry.tools,
|
|
3678
|
+
auth: entry.auth
|
|
4652
3679
|
};
|
|
4653
3680
|
}
|
|
4654
|
-
function
|
|
4655
|
-
const
|
|
4656
|
-
const configured = resolveAgentConfig(cfg, id)?.workspace?.trim();
|
|
3681
|
+
function resolveAgentWorkspaceDirOrNull(cfg, agentId) {
|
|
3682
|
+
const configured = resolveAgentConfig(cfg, normalizeAgentId(agentId))?.workspace?.trim();
|
|
4657
3683
|
if (configured) return stripNullBytes(resolveUserPath(configured));
|
|
4658
|
-
|
|
3684
|
+
return null;
|
|
4659
3685
|
}
|
|
4660
3686
|
|
|
4661
3687
|
//#endregion
|
|
@@ -4758,27 +3784,15 @@ function resolveBundledPluginsDir() {
|
|
|
4758
3784
|
} catch {}
|
|
4759
3785
|
}
|
|
4760
3786
|
|
|
4761
|
-
//#endregion
|
|
4762
|
-
//#region src/compat/legacy-names.ts
|
|
4763
|
-
const PROJECT_NAME = "remoteclaw";
|
|
4764
|
-
const LEGACY_PROJECT_NAMES = [];
|
|
4765
|
-
const MANIFEST_KEY = PROJECT_NAME;
|
|
4766
|
-
const LEGACY_MANIFEST_KEYS = LEGACY_PROJECT_NAMES;
|
|
4767
|
-
const LEGACY_PLUGIN_MANIFEST_FILENAMES = [];
|
|
4768
|
-
|
|
4769
3787
|
//#endregion
|
|
4770
3788
|
//#region src/plugins/manifest.ts
|
|
3789
|
+
const MANIFEST_KEY = "remoteclaw";
|
|
4771
3790
|
const PLUGIN_MANIFEST_FILENAME = "remoteclaw.plugin.json";
|
|
4772
|
-
const PLUGIN_MANIFEST_FILENAMES = [PLUGIN_MANIFEST_FILENAME, ...LEGACY_PLUGIN_MANIFEST_FILENAMES];
|
|
4773
3791
|
function normalizeStringList(value) {
|
|
4774
3792
|
if (!Array.isArray(value)) return [];
|
|
4775
3793
|
return value.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean);
|
|
4776
3794
|
}
|
|
4777
3795
|
function resolvePluginManifestPath(rootDir) {
|
|
4778
|
-
for (const filename of PLUGIN_MANIFEST_FILENAMES) {
|
|
4779
|
-
const candidate = path.join(rootDir, filename);
|
|
4780
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
4781
|
-
}
|
|
4782
3796
|
return path.join(rootDir, PLUGIN_MANIFEST_FILENAME);
|
|
4783
3797
|
}
|
|
4784
3798
|
function loadPluginManifest(rootDir) {
|
|
@@ -4822,6 +3836,8 @@ function loadPluginManifest(rootDir) {
|
|
|
4822
3836
|
const channels = normalizeStringList(raw.channels);
|
|
4823
3837
|
const providers = normalizeStringList(raw.providers);
|
|
4824
3838
|
const skills = normalizeStringList(raw.skills);
|
|
3839
|
+
const stt = normalizeStringList(raw.stt);
|
|
3840
|
+
const tts = normalizeStringList(raw.tts);
|
|
4825
3841
|
let uiHints;
|
|
4826
3842
|
if (isRecord(raw.uiHints)) uiHints = raw.uiHints;
|
|
4827
3843
|
return {
|
|
@@ -4833,6 +3849,8 @@ function loadPluginManifest(rootDir) {
|
|
|
4833
3849
|
channels,
|
|
4834
3850
|
providers,
|
|
4835
3851
|
skills,
|
|
3852
|
+
stt,
|
|
3853
|
+
tts,
|
|
4836
3854
|
name,
|
|
4837
3855
|
description,
|
|
4838
3856
|
version,
|
|
@@ -4843,12 +3861,7 @@ function loadPluginManifest(rootDir) {
|
|
|
4843
3861
|
}
|
|
4844
3862
|
function getPackageManifestMetadata(manifest) {
|
|
4845
3863
|
if (!manifest) return;
|
|
4846
|
-
|
|
4847
|
-
if (current) return current;
|
|
4848
|
-
for (const key of LEGACY_MANIFEST_KEYS) {
|
|
4849
|
-
const legacy = manifest[key];
|
|
4850
|
-
if (legacy) return legacy;
|
|
4851
|
-
}
|
|
3864
|
+
return manifest[MANIFEST_KEY];
|
|
4852
3865
|
}
|
|
4853
3866
|
|
|
4854
3867
|
//#endregion
|
|
@@ -5338,6 +4351,8 @@ function buildRecord(params) {
|
|
|
5338
4351
|
channels: params.manifest.channels ?? [],
|
|
5339
4352
|
providers: params.manifest.providers ?? [],
|
|
5340
4353
|
skills: params.manifest.skills ?? [],
|
|
4354
|
+
stt: params.manifest.stt ?? [],
|
|
4355
|
+
tts: params.manifest.tts ?? [],
|
|
5341
4356
|
origin: params.candidate.origin,
|
|
5342
4357
|
workspaceDir: params.candidate.workspaceDir,
|
|
5343
4358
|
rootDir: params.candidate.rootDir,
|
|
@@ -5568,34 +4583,27 @@ function parseDurationMs(raw, opts) {
|
|
|
5568
4583
|
}
|
|
5569
4584
|
|
|
5570
4585
|
//#endregion
|
|
5571
|
-
//#region src/
|
|
5572
|
-
const
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
channel: z.string().optional(),
|
|
5593
|
-
chatType: AllowDenyChatTypeSchema,
|
|
5594
|
-
keyPrefix: z.string().optional(),
|
|
5595
|
-
rawKeyPrefix: z.string().optional()
|
|
5596
|
-
}).strict().optional()
|
|
5597
|
-
}).strict()).optional()
|
|
5598
|
-
}).strict().optional();
|
|
4586
|
+
//#region src/infra/safe-executable-value.ts
|
|
4587
|
+
const SHELL_METACHARS = /[;&|`$<>]/;
|
|
4588
|
+
const CONTROL_CHARS = /[\r\n]/;
|
|
4589
|
+
const QUOTE_CHARS = /["']/;
|
|
4590
|
+
const BARE_NAME_PATTERN = /^[A-Za-z0-9._+-]+$/;
|
|
4591
|
+
function isLikelyPath(value) {
|
|
4592
|
+
if (value.startsWith(".") || value.startsWith("~")) return true;
|
|
4593
|
+
if (value.includes("/") || value.includes("\\")) return true;
|
|
4594
|
+
return /^[A-Za-z]:[\\/]/.test(value);
|
|
4595
|
+
}
|
|
4596
|
+
function isSafeExecutableValue(value) {
|
|
4597
|
+
if (!value) return false;
|
|
4598
|
+
const trimmed = value.trim();
|
|
4599
|
+
if (!trimmed) return false;
|
|
4600
|
+
if (trimmed.includes("\0")) return false;
|
|
4601
|
+
if (CONTROL_CHARS.test(trimmed)) return false;
|
|
4602
|
+
if (SHELL_METACHARS.test(trimmed)) return false;
|
|
4603
|
+
if (QUOTE_CHARS.test(trimmed)) return false;
|
|
4604
|
+
if (isLikelyPath(trimmed)) return true;
|
|
4605
|
+
if (trimmed.startsWith("-")) return false;
|
|
4606
|
+
return BARE_NAME_PATTERN.test(trimmed);
|
|
5599
4607
|
}
|
|
5600
4608
|
|
|
5601
4609
|
//#endregion
|
|
@@ -5682,11 +4690,7 @@ const MarkdownTableModeSchema = z.enum([
|
|
|
5682
4690
|
"code"
|
|
5683
4691
|
]);
|
|
5684
4692
|
const MarkdownConfigSchema = z.object({ tables: MarkdownTableModeSchema.optional() }).strict().optional();
|
|
5685
|
-
const TtsProviderSchema = z.
|
|
5686
|
-
"elevenlabs",
|
|
5687
|
-
"openai",
|
|
5688
|
-
"edge"
|
|
5689
|
-
]);
|
|
4693
|
+
const TtsProviderSchema = z.string().min(1);
|
|
5690
4694
|
const TtsModeSchema = z.enum(["final", "all"]);
|
|
5691
4695
|
const TtsAutoSchema = z.enum([
|
|
5692
4696
|
"off",
|
|
@@ -5864,22 +4868,6 @@ const TranscribeAudioSchema = z.object({
|
|
|
5864
4868
|
}).strict().optional();
|
|
5865
4869
|
const HexColorSchema = z.string().regex(/^#?[0-9a-fA-F]{6}$/, "expected hex color (RRGGBB)");
|
|
5866
4870
|
const ExecutableTokenSchema = z.string().refine(isSafeExecutableValue, "expected safe executable name or path");
|
|
5867
|
-
const MediaUnderstandingScopeSchema = createAllowDenyChannelRulesSchema();
|
|
5868
|
-
const MediaUnderstandingCapabilitiesSchema = z.array(z.union([
|
|
5869
|
-
z.literal("image"),
|
|
5870
|
-
z.literal("audio"),
|
|
5871
|
-
z.literal("video")
|
|
5872
|
-
])).optional();
|
|
5873
|
-
const MediaUnderstandingAttachmentsSchema = z.object({
|
|
5874
|
-
mode: z.union([z.literal("first"), z.literal("all")]).optional(),
|
|
5875
|
-
maxAttachments: z.number().int().positive().optional(),
|
|
5876
|
-
prefer: z.union([
|
|
5877
|
-
z.literal("first"),
|
|
5878
|
-
z.literal("last"),
|
|
5879
|
-
z.literal("path"),
|
|
5880
|
-
z.literal("url")
|
|
5881
|
-
]).optional()
|
|
5882
|
-
}).strict().optional();
|
|
5883
4871
|
const DeepgramAudioSchema = z.object({
|
|
5884
4872
|
detectLanguage: z.boolean().optional(),
|
|
5885
4873
|
punctuate: z.boolean().optional(),
|
|
@@ -5903,7 +4891,6 @@ const MediaUnderstandingRuntimeFields = {
|
|
|
5903
4891
|
const MediaUnderstandingModelSchema = z.object({
|
|
5904
4892
|
provider: z.string().optional(),
|
|
5905
4893
|
model: z.string().optional(),
|
|
5906
|
-
capabilities: MediaUnderstandingCapabilitiesSchema,
|
|
5907
4894
|
type: z.union([z.literal("provider"), z.literal("cli")]).optional(),
|
|
5908
4895
|
command: z.string().optional(),
|
|
5909
4896
|
args: z.array(z.string()).optional(),
|
|
@@ -5915,38 +4902,23 @@ const MediaUnderstandingModelSchema = z.object({
|
|
|
5915
4902
|
}).strict().optional();
|
|
5916
4903
|
const ToolsMediaUnderstandingSchema = z.object({
|
|
5917
4904
|
enabled: z.boolean().optional(),
|
|
5918
|
-
scope: MediaUnderstandingScopeSchema,
|
|
5919
4905
|
maxBytes: z.number().int().positive().optional(),
|
|
5920
4906
|
maxChars: z.number().int().positive().optional(),
|
|
5921
4907
|
...MediaUnderstandingRuntimeFields,
|
|
5922
|
-
attachments: MediaUnderstandingAttachmentsSchema,
|
|
5923
4908
|
models: z.array(MediaUnderstandingModelSchema).optional()
|
|
5924
4909
|
}).strict().optional();
|
|
5925
|
-
const ToolsMediaSchema = z.object({
|
|
5926
|
-
models: z.array(MediaUnderstandingModelSchema).optional(),
|
|
5927
|
-
concurrency: z.number().int().positive().optional(),
|
|
5928
|
-
image: ToolsMediaUnderstandingSchema.optional(),
|
|
5929
|
-
audio: ToolsMediaUnderstandingSchema.optional(),
|
|
5930
|
-
video: ToolsMediaUnderstandingSchema.optional()
|
|
5931
|
-
}).strict().optional();
|
|
5932
|
-
const LinkModelSchema = z.object({
|
|
5933
|
-
type: z.literal("cli").optional(),
|
|
5934
|
-
command: z.string().min(1),
|
|
5935
|
-
args: z.array(z.string()).optional(),
|
|
5936
|
-
timeoutSeconds: z.number().int().positive().optional()
|
|
5937
|
-
}).strict();
|
|
5938
|
-
const ToolsLinksSchema = z.object({
|
|
5939
|
-
enabled: z.boolean().optional(),
|
|
5940
|
-
scope: MediaUnderstandingScopeSchema,
|
|
5941
|
-
maxLinks: z.number().int().positive().optional(),
|
|
5942
|
-
timeoutSeconds: z.number().int().positive().optional(),
|
|
5943
|
-
models: z.array(LinkModelSchema).optional()
|
|
5944
|
-
}).strict().optional();
|
|
4910
|
+
const ToolsMediaSchema = z.object({ audio: ToolsMediaUnderstandingSchema.optional() }).strict().optional();
|
|
5945
4911
|
const NativeCommandsSettingSchema = z.union([z.boolean(), z.literal("auto")]);
|
|
5946
4912
|
const ProviderCommandsSchema = z.object({ native: NativeCommandsSettingSchema.optional() }).strict().optional();
|
|
5947
4913
|
|
|
5948
4914
|
//#endregion
|
|
5949
4915
|
//#region src/config/zod-schema.agent-runtime.ts
|
|
4916
|
+
/** Auth profile ref: `false` (skip), single string, or string array (rotation). */
|
|
4917
|
+
const AuthFieldSchema = z.union([
|
|
4918
|
+
z.literal(false),
|
|
4919
|
+
z.string(),
|
|
4920
|
+
z.array(z.string())
|
|
4921
|
+
]).optional();
|
|
5950
4922
|
const BootSchema = z.object({
|
|
5951
4923
|
prompt: z.string().optional(),
|
|
5952
4924
|
file: z.string().optional()
|
|
@@ -5960,7 +4932,6 @@ const HeartbeatSchema = z.object({
|
|
|
5960
4932
|
}).strict().optional(),
|
|
5961
4933
|
model: z.string().optional(),
|
|
5962
4934
|
session: z.string().optional(),
|
|
5963
|
-
includeReasoning: z.boolean().optional(),
|
|
5964
4935
|
target: z.string().optional(),
|
|
5965
4936
|
to: z.string().optional(),
|
|
5966
4937
|
accountId: z.string().optional(),
|
|
@@ -6041,7 +5012,6 @@ const ToolPolicyWithProfileSchema = z.object({
|
|
|
6041
5012
|
}).strict().superRefine((value, ctx) => {
|
|
6042
5013
|
addAllowAlsoAllowConflictIssue(value, ctx, "tools.byProvider policy cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)");
|
|
6043
5014
|
});
|
|
6044
|
-
const ElevatedAllowFromSchema = z.record(z.string(), z.array(z.union([z.string(), z.number()]))).optional();
|
|
6045
5015
|
const ToolExecSafeBinProfileSchema = z.object({
|
|
6046
5016
|
minPositional: z.number().int().nonnegative().optional(),
|
|
6047
5017
|
maxPositional: z.number().int().nonnegative().optional(),
|
|
@@ -6090,10 +5060,6 @@ const CommonToolPolicyFields = {
|
|
|
6090
5060
|
};
|
|
6091
5061
|
const AgentToolsSchema = z.object({
|
|
6092
5062
|
...CommonToolPolicyFields,
|
|
6093
|
-
elevated: z.object({
|
|
6094
|
-
enabled: z.boolean().optional(),
|
|
6095
|
-
allowFrom: ElevatedAllowFromSchema
|
|
6096
|
-
}).strict().optional(),
|
|
6097
5063
|
exec: AgentToolExecSchema,
|
|
6098
5064
|
fs: ToolFsSchema
|
|
6099
5065
|
}).strict().superRefine((value, ctx) => {
|
|
@@ -6105,7 +5071,7 @@ const AgentEntrySchema = z.object({
|
|
|
6105
5071
|
name: z.string().optional(),
|
|
6106
5072
|
workspace: z.string().optional(),
|
|
6107
5073
|
agentDir: z.string().optional(),
|
|
6108
|
-
model:
|
|
5074
|
+
model: z.unknown().optional(),
|
|
6109
5075
|
skills: z.array(z.string()).optional(),
|
|
6110
5076
|
humanDelay: HumanDelaySchema.optional(),
|
|
6111
5077
|
heartbeat: HeartbeatSchema,
|
|
@@ -6114,19 +5080,15 @@ const AgentEntrySchema = z.object({
|
|
|
6114
5080
|
groupChat: GroupChatSchema,
|
|
6115
5081
|
subagents: z.object({
|
|
6116
5082
|
allowAgents: z.array(z.string()).optional(),
|
|
6117
|
-
model: z.
|
|
6118
|
-
primary: z.string().optional(),
|
|
6119
|
-
fallbacks: z.array(z.string()).optional()
|
|
6120
|
-
}).strict()]).optional(),
|
|
6121
|
-
thinking: z.string().optional()
|
|
5083
|
+
model: z.unknown().optional()
|
|
6122
5084
|
}).strict().optional(),
|
|
6123
5085
|
editableFiles: z.array(z.string()).optional(),
|
|
6124
|
-
tools: AgentToolsSchema
|
|
5086
|
+
tools: AgentToolsSchema,
|
|
5087
|
+
auth: AuthFieldSchema
|
|
6125
5088
|
}).strict();
|
|
6126
5089
|
const ToolsSchema = z.object({
|
|
6127
5090
|
...CommonToolPolicyFields,
|
|
6128
5091
|
media: ToolsMediaSchema,
|
|
6129
|
-
links: ToolsLinksSchema,
|
|
6130
5092
|
sessions: z.object({ visibility: z.enum([
|
|
6131
5093
|
"self",
|
|
6132
5094
|
"tree",
|
|
@@ -6150,10 +5112,6 @@ const ToolsSchema = z.object({
|
|
|
6150
5112
|
enabled: z.boolean().optional(),
|
|
6151
5113
|
allow: z.array(z.string()).optional()
|
|
6152
5114
|
}).strict().optional(),
|
|
6153
|
-
elevated: z.object({
|
|
6154
|
-
enabled: z.boolean().optional(),
|
|
6155
|
-
allowFrom: ElevatedAllowFromSchema
|
|
6156
|
-
}).strict().optional(),
|
|
6157
5115
|
exec: ToolExecSchema,
|
|
6158
5116
|
fs: ToolFsSchema,
|
|
6159
5117
|
subagents: z.object({ tools: ToolPolicySchema }).strict().optional()
|
|
@@ -6164,17 +5122,11 @@ const ToolsSchema = z.object({
|
|
|
6164
5122
|
//#endregion
|
|
6165
5123
|
//#region src/config/zod-schema.agent-defaults.ts
|
|
6166
5124
|
const AgentDefaultsSchema = z.object({
|
|
6167
|
-
model:
|
|
6168
|
-
imageModel:
|
|
6169
|
-
models: z.
|
|
6170
|
-
|
|
6171
|
-
params: z.record(z.string(), z.unknown()).optional(),
|
|
6172
|
-
streaming: z.boolean().optional()
|
|
6173
|
-
}).strict()).optional(),
|
|
5125
|
+
model: z.unknown().optional(),
|
|
5126
|
+
imageModel: z.unknown().optional(),
|
|
5127
|
+
models: z.unknown().optional(),
|
|
5128
|
+
workspace: z.string().optional(),
|
|
6174
5129
|
repoRoot: z.string().optional(),
|
|
6175
|
-
skipBootstrap: z.boolean().optional(),
|
|
6176
|
-
bootstrapMaxChars: z.number().int().positive().optional(),
|
|
6177
|
-
bootstrapTotalMaxChars: z.number().int().positive().optional(),
|
|
6178
5130
|
userTimezone: z.string().optional(),
|
|
6179
5131
|
timeFormat: z.union([
|
|
6180
5132
|
z.literal("auto"),
|
|
@@ -6185,7 +5137,7 @@ const AgentDefaultsSchema = z.object({
|
|
|
6185
5137
|
envelopeTimestamp: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
6186
5138
|
envelopeElapsed: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
6187
5139
|
contextTokens: z.number().int().positive().optional(),
|
|
6188
|
-
cliBackends: z.
|
|
5140
|
+
cliBackends: z.unknown().optional(),
|
|
6189
5141
|
contextPruning: z.object({
|
|
6190
5142
|
mode: z.union([z.literal("off"), z.literal("cache-ttl")]).optional(),
|
|
6191
5143
|
ttl: z.string().optional(),
|
|
@@ -6207,32 +5159,11 @@ const AgentDefaultsSchema = z.object({
|
|
|
6207
5159
|
placeholder: z.string().optional()
|
|
6208
5160
|
}).strict().optional()
|
|
6209
5161
|
}).strict().optional(),
|
|
6210
|
-
compaction: z.object({
|
|
6211
|
-
mode: z.union([z.literal("default"), z.literal("safeguard")]).optional(),
|
|
6212
|
-
reserveTokens: z.number().int().nonnegative().optional(),
|
|
6213
|
-
keepRecentTokens: z.number().int().positive().optional(),
|
|
6214
|
-
reserveTokensFloor: z.number().int().nonnegative().optional(),
|
|
6215
|
-
maxHistoryShare: z.number().min(.1).max(.9).optional()
|
|
6216
|
-
}).strict().optional(),
|
|
6217
|
-
thinkingDefault: z.union([
|
|
6218
|
-
z.literal("off"),
|
|
6219
|
-
z.literal("minimal"),
|
|
6220
|
-
z.literal("low"),
|
|
6221
|
-
z.literal("medium"),
|
|
6222
|
-
z.literal("high"),
|
|
6223
|
-
z.literal("xhigh")
|
|
6224
|
-
]).optional(),
|
|
6225
5162
|
verboseDefault: z.union([
|
|
6226
5163
|
z.literal("off"),
|
|
6227
5164
|
z.literal("on"),
|
|
6228
5165
|
z.literal("full")
|
|
6229
5166
|
]).optional(),
|
|
6230
|
-
elevatedDefault: z.union([
|
|
6231
|
-
z.literal("off"),
|
|
6232
|
-
z.literal("on"),
|
|
6233
|
-
z.literal("ask"),
|
|
6234
|
-
z.literal("full")
|
|
6235
|
-
]).optional(),
|
|
6236
5167
|
blockStreamingDefault: z.union([z.literal("off"), z.literal("on")]).optional(),
|
|
6237
5168
|
blockStreamingBreak: z.union([z.literal("text_end"), z.literal("message_end")]).optional(),
|
|
6238
5169
|
blockStreamingChunk: BlockStreamingChunkSchema.optional(),
|
|
@@ -6251,8 +5182,7 @@ const AgentDefaultsSchema = z.object({
|
|
|
6251
5182
|
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."),
|
|
6252
5183
|
maxChildrenPerAgent: z.number().int().min(1).max(20).optional().describe("Maximum number of active children a single agent session can spawn (default: 5)."),
|
|
6253
5184
|
archiveAfterMinutes: z.number().int().positive().optional(),
|
|
6254
|
-
model:
|
|
6255
|
-
thinking: z.string().optional(),
|
|
5185
|
+
model: z.unknown().optional(),
|
|
6256
5186
|
runTimeoutSeconds: z.number().int().min(0).optional(),
|
|
6257
5187
|
announceTimeoutMs: z.number().int().positive().optional()
|
|
6258
5188
|
}).strict().optional(),
|
|
@@ -6263,7 +5193,10 @@ const AgentDefaultsSchema = z.object({
|
|
|
6263
5193
|
z.literal("gemini"),
|
|
6264
5194
|
z.literal("codex"),
|
|
6265
5195
|
z.literal("opencode")
|
|
6266
|
-
]).optional()
|
|
5196
|
+
]).optional(),
|
|
5197
|
+
runtimeArgs: z.array(z.string()).optional(),
|
|
5198
|
+
runtimeEnv: z.record(z.string(), z.string()).optional(),
|
|
5199
|
+
auth: AuthFieldSchema
|
|
6267
5200
|
}).strict().optional();
|
|
6268
5201
|
|
|
6269
5202
|
//#endregion
|
|
@@ -6491,7 +5424,6 @@ function isSafeScpRemoteHost(value) {
|
|
|
6491
5424
|
const WILDCARD_SEGMENT = "*";
|
|
6492
5425
|
const WINDOWS_DRIVE_ABS_RE = /^[A-Za-z]:\//;
|
|
6493
5426
|
const WINDOWS_DRIVE_ROOT_RE = /^[A-Za-z]:$/;
|
|
6494
|
-
const DEFAULT_IMESSAGE_ATTACHMENT_ROOTS = ["/Users/*/Library/Messages/Attachments"];
|
|
6495
5427
|
function normalizePosixAbsolutePath(value) {
|
|
6496
5428
|
const trimmed = value.trim();
|
|
6497
5429
|
if (!trimmed || trimmed.includes("\0")) return;
|
|
@@ -6511,31 +5443,64 @@ function isValidInboundPathRootPattern(value) {
|
|
|
6511
5443
|
if (segments.length === 0) return false;
|
|
6512
5444
|
return segments.every((segment) => segment === WILDCARD_SEGMENT || !segment.includes("*"));
|
|
6513
5445
|
}
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
const candidate = normalizePosixAbsolutePath(root);
|
|
6521
|
-
if (!candidate || seen.has(candidate)) continue;
|
|
6522
|
-
seen.add(candidate);
|
|
6523
|
-
normalized.push(candidate);
|
|
6524
|
-
}
|
|
6525
|
-
return normalized;
|
|
5446
|
+
|
|
5447
|
+
//#endregion
|
|
5448
|
+
//#region src/config/discord-preview-streaming.ts
|
|
5449
|
+
function normalizeStreamingMode(value) {
|
|
5450
|
+
if (typeof value !== "string") return null;
|
|
5451
|
+
return value.trim().toLowerCase() || null;
|
|
6526
5452
|
}
|
|
6527
|
-
function
|
|
6528
|
-
const
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
5453
|
+
function parseStreamingMode(value) {
|
|
5454
|
+
const normalized = normalizeStreamingMode(value);
|
|
5455
|
+
if (normalized === "off" || normalized === "partial" || normalized === "block" || normalized === "progress") return normalized;
|
|
5456
|
+
return null;
|
|
5457
|
+
}
|
|
5458
|
+
function parseDiscordPreviewStreamMode(value) {
|
|
5459
|
+
const parsed = parseStreamingMode(value);
|
|
5460
|
+
if (!parsed) return null;
|
|
5461
|
+
return parsed === "progress" ? "partial" : parsed;
|
|
5462
|
+
}
|
|
5463
|
+
function parseSlackLegacyDraftStreamMode(value) {
|
|
5464
|
+
const normalized = normalizeStreamingMode(value);
|
|
5465
|
+
if (normalized === "replace" || normalized === "status_final" || normalized === "append") return normalized;
|
|
5466
|
+
return null;
|
|
5467
|
+
}
|
|
5468
|
+
function mapSlackLegacyDraftStreamModeToStreaming(mode) {
|
|
5469
|
+
if (mode === "append") return "block";
|
|
5470
|
+
if (mode === "status_final") return "progress";
|
|
5471
|
+
return "partial";
|
|
5472
|
+
}
|
|
5473
|
+
function resolveTelegramPreviewStreamMode(params = {}) {
|
|
5474
|
+
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
5475
|
+
if (parsedStreaming) {
|
|
5476
|
+
if (parsedStreaming === "progress") return "partial";
|
|
5477
|
+
return parsedStreaming;
|
|
6537
5478
|
}
|
|
6538
|
-
|
|
5479
|
+
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
5480
|
+
if (legacy) return legacy;
|
|
5481
|
+
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
5482
|
+
return "off";
|
|
5483
|
+
}
|
|
5484
|
+
function resolveDiscordPreviewStreamMode(params = {}) {
|
|
5485
|
+
const parsedStreaming = parseDiscordPreviewStreamMode(params.streaming);
|
|
5486
|
+
if (parsedStreaming) return parsedStreaming;
|
|
5487
|
+
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
5488
|
+
if (legacy) return legacy;
|
|
5489
|
+
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
5490
|
+
return "off";
|
|
5491
|
+
}
|
|
5492
|
+
function resolveSlackStreamingMode(params = {}) {
|
|
5493
|
+
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
5494
|
+
if (parsedStreaming) return parsedStreaming;
|
|
5495
|
+
const legacyStreamMode = parseSlackLegacyDraftStreamMode(params.streamMode);
|
|
5496
|
+
if (legacyStreamMode) return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
|
|
5497
|
+
if (typeof params.streaming === "boolean") return "partial";
|
|
5498
|
+
return "partial";
|
|
5499
|
+
}
|
|
5500
|
+
function resolveSlackNativeStreaming(params = {}) {
|
|
5501
|
+
if (typeof params.nativeStreaming === "boolean") return params.nativeStreaming;
|
|
5502
|
+
if (typeof params.streaming === "boolean") return params.streaming;
|
|
5503
|
+
return true;
|
|
6539
5504
|
}
|
|
6540
5505
|
|
|
6541
5506
|
//#endregion
|
|
@@ -7606,6 +6571,30 @@ const ChannelsSchema = z.object({
|
|
|
7606
6571
|
msteams: MSTeamsConfigSchema.optional()
|
|
7607
6572
|
}).passthrough().optional();
|
|
7608
6573
|
|
|
6574
|
+
//#endregion
|
|
6575
|
+
//#region src/config/zod-schema.allowdeny.ts
|
|
6576
|
+
const AllowDenyActionSchema = z.union([z.literal("allow"), z.literal("deny")]);
|
|
6577
|
+
const AllowDenyChatTypeSchema = z.union([
|
|
6578
|
+
z.literal("direct"),
|
|
6579
|
+
z.literal("group"),
|
|
6580
|
+
z.literal("channel"),
|
|
6581
|
+
z.literal("dm")
|
|
6582
|
+
]).optional();
|
|
6583
|
+
function createAllowDenyChannelRulesSchema() {
|
|
6584
|
+
return z.object({
|
|
6585
|
+
default: AllowDenyActionSchema.optional(),
|
|
6586
|
+
rules: z.array(z.object({
|
|
6587
|
+
action: AllowDenyActionSchema,
|
|
6588
|
+
match: z.object({
|
|
6589
|
+
channel: z.string().optional(),
|
|
6590
|
+
chatType: AllowDenyChatTypeSchema,
|
|
6591
|
+
keyPrefix: z.string().optional(),
|
|
6592
|
+
rawKeyPrefix: z.string().optional()
|
|
6593
|
+
}).strict().optional()
|
|
6594
|
+
}).strict()).optional()
|
|
6595
|
+
}).strict().optional();
|
|
6596
|
+
}
|
|
6597
|
+
|
|
7609
6598
|
//#endregion
|
|
7610
6599
|
//#region src/config/zod-schema.session.ts
|
|
7611
6600
|
const SessionResetConfigSchema = z.object({
|
|
@@ -7744,8 +6733,6 @@ const MessagesSchema = z.object({
|
|
|
7744
6733
|
const CommandsSchema = z.object({
|
|
7745
6734
|
native: NativeCommandsSettingSchema.optional().default("auto"),
|
|
7746
6735
|
text: z.boolean().optional(),
|
|
7747
|
-
bash: z.boolean().optional(),
|
|
7748
|
-
bashForegroundMs: z.number().int().min(0).max(3e4).optional(),
|
|
7749
6736
|
config: z.boolean().optional(),
|
|
7750
6737
|
debug: z.boolean().optional(),
|
|
7751
6738
|
restart: z.boolean().optional().default(true),
|
|
@@ -7753,7 +6740,7 @@ const CommandsSchema = z.object({
|
|
|
7753
6740
|
ownerAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
7754
6741
|
ownerDisplay: z.enum(["raw", "hash"]).optional().default("raw"),
|
|
7755
6742
|
ownerDisplaySecret: z.string().optional().register(sensitive),
|
|
7756
|
-
allowFrom:
|
|
6743
|
+
allowFrom: z.record(z.string(), z.array(z.union([z.string(), z.number()]))).optional()
|
|
7757
6744
|
}).strict().optional().default(() => ({
|
|
7758
6745
|
native: "auto",
|
|
7759
6746
|
restart: true,
|
|
@@ -7850,7 +6837,7 @@ const RemoteClawSchema = z.object({
|
|
|
7850
6837
|
channel: z.union([
|
|
7851
6838
|
z.literal("stable"),
|
|
7852
6839
|
z.literal("beta"),
|
|
7853
|
-
z.literal("
|
|
6840
|
+
z.literal("next")
|
|
7854
6841
|
]).optional(),
|
|
7855
6842
|
checkOnStart: z.boolean().optional(),
|
|
7856
6843
|
auto: z.object({
|
|
@@ -8207,7 +7194,8 @@ function validateIdentityAvatar(config) {
|
|
|
8207
7194
|
});
|
|
8208
7195
|
continue;
|
|
8209
7196
|
}
|
|
8210
|
-
|
|
7197
|
+
const workspaceDir = resolveAgentWorkspaceDirOrNull(config, entry.id ?? resolveDefaultAgentId(config));
|
|
7198
|
+
if (workspaceDir != null && !isWorkspaceAvatarPath(avatar, workspaceDir)) issues.push({
|
|
8211
7199
|
path: `agents.list.${index}.identity.avatar`,
|
|
8212
7200
|
message: "identity.avatar must stay within the agent workspace."
|
|
8213
7201
|
});
|
|
@@ -8283,7 +7271,7 @@ function validateConfigObjectWithPluginsBase(raw, opts) {
|
|
|
8283
7271
|
if (registryInfo) return registryInfo;
|
|
8284
7272
|
const registry = loadPluginManifestRegistry({
|
|
8285
7273
|
config,
|
|
8286
|
-
workspaceDir:
|
|
7274
|
+
workspaceDir: resolveAgentWorkspaceDirOrNull(config, resolveDefaultAgentId(config)) ?? void 0
|
|
8287
7275
|
});
|
|
8288
7276
|
const knownIds = new Set(registry.plugins.map((record) => record.id));
|
|
8289
7277
|
const normalizedPlugins = normalizePluginsConfig(config.plugins);
|
|
@@ -8886,7 +7874,7 @@ function createConfigIO(overrides = {}) {
|
|
|
8886
7874
|
deps.logger.warn(`Config warnings:\\n${details}`);
|
|
8887
7875
|
}
|
|
8888
7876
|
warnIfConfigFromFuture(validated.config, deps.logger);
|
|
8889
|
-
const cfg = applyTalkConfigNormalization(applyModelDefaults(
|
|
7877
|
+
const cfg = applyTalkConfigNormalization(applyModelDefaults(applyContextPruningDefaults(applyAgentDefaults(applySessionDefaults(applyLoggingDefaults(applyMessageDefaults(validated.config)))))));
|
|
8890
7878
|
normalizeConfigPaths(cfg);
|
|
8891
7879
|
const duplicates = findDuplicateAgentDirs(cfg, {
|
|
8892
7880
|
env: deps.env,
|
|
@@ -8946,7 +7934,7 @@ function createConfigIO(overrides = {}) {
|
|
|
8946
7934
|
parsed: {},
|
|
8947
7935
|
resolved: {},
|
|
8948
7936
|
valid: true,
|
|
8949
|
-
config: applyTalkApiKey(applyTalkConfigNormalization(applyModelDefaults(
|
|
7937
|
+
config: applyTalkApiKey(applyTalkConfigNormalization(applyModelDefaults(applyContextPruningDefaults(applyAgentDefaults(applySessionDefaults(applyMessageDefaults({}))))))),
|
|
8950
7938
|
hash,
|
|
8951
7939
|
issues: [],
|
|
8952
7940
|
warnings: [],
|
|
@@ -9527,7 +8515,7 @@ function formatErrorMessage(err) {
|
|
|
9527
8515
|
|
|
9528
8516
|
//#endregion
|
|
9529
8517
|
//#region src/infra/retry-policy.ts
|
|
9530
|
-
const log$
|
|
8518
|
+
const log$10 = createSubsystemLogger("retry-policy");
|
|
9531
8519
|
|
|
9532
8520
|
//#endregion
|
|
9533
8521
|
//#region src/discord/client.ts
|
|
@@ -10971,9 +9959,9 @@ async function assertLocalMediaAllowed(mediaPath, localRoots) {
|
|
|
10971
9959
|
}
|
|
10972
9960
|
const HEIC_MIME_RE = /^image\/hei[cf]$/i;
|
|
10973
9961
|
const HEIC_EXT_RE = /\.(heic|heif)$/i;
|
|
10974
|
-
const MB$
|
|
9962
|
+
const MB$1 = 1024 * 1024;
|
|
10975
9963
|
function formatMb(bytes, digits = 2) {
|
|
10976
|
-
return (bytes / MB$
|
|
9964
|
+
return (bytes / MB$1).toFixed(digits);
|
|
10977
9965
|
}
|
|
10978
9966
|
function formatCapLimit(label, cap, size) {
|
|
10979
9967
|
return `${label} exceeds ${formatMb(cap, 0)}MB limit (got ${formatMb(size)}MB)`;
|
|
@@ -11490,7 +10478,7 @@ function resolveTelegramToken(cfg, opts = {}) {
|
|
|
11490
10478
|
|
|
11491
10479
|
//#endregion
|
|
11492
10480
|
//#region src/telegram/accounts.ts
|
|
11493
|
-
const log$
|
|
10481
|
+
const log$9 = createSubsystemLogger("telegram/accounts");
|
|
11494
10482
|
function formatDebugArg(value) {
|
|
11495
10483
|
if (typeof value === "string") return value;
|
|
11496
10484
|
if (value instanceof Error) return value.stack ?? value.message;
|
|
@@ -11504,7 +10492,7 @@ function formatDebugArg(value) {
|
|
|
11504
10492
|
const debugAccounts = (...args) => {
|
|
11505
10493
|
if (isTruthyEnvValue(process.env.REMOTECLAW_DEBUG_TELEGRAM_ACCOUNTS)) {
|
|
11506
10494
|
const parts = args.map((arg) => formatDebugArg(arg));
|
|
11507
|
-
log$
|
|
10495
|
+
log$9.warn(parts.join(" ").trim());
|
|
11508
10496
|
}
|
|
11509
10497
|
};
|
|
11510
10498
|
function listConfiguredAccountIds$1(cfg) {
|
|
@@ -12870,7 +11858,7 @@ const DEFAULT_IMAGE_MAX_BYTES = 5 * 1024 * 1024;
|
|
|
12870
11858
|
|
|
12871
11859
|
//#endregion
|
|
12872
11860
|
//#region src/agents/tool-images.ts
|
|
12873
|
-
const log$
|
|
11861
|
+
const log$8 = createSubsystemLogger("agents/tool-images");
|
|
12874
11862
|
|
|
12875
11863
|
//#endregion
|
|
12876
11864
|
//#region src/agents/tools/common.ts
|
|
@@ -14858,7 +13846,6 @@ const DOCKS = {
|
|
|
14858
13846
|
},
|
|
14859
13847
|
outbound: { textChunkLimit: 2e3 },
|
|
14860
13848
|
streaming: DEFAULT_BLOCK_STREAMING_COALESCE,
|
|
14861
|
-
elevated: { allowFromFallback: ({ cfg }) => cfg.channels?.discord?.allowFrom ?? cfg.channels?.discord?.dm?.allowFrom },
|
|
14862
13849
|
config: {
|
|
14863
13850
|
resolveAllowFrom: ({ cfg, accountId }) => {
|
|
14864
13851
|
const account = resolveDiscordAccount({
|
|
@@ -15083,7 +14070,6 @@ function buildDockFromPlugin(plugin) {
|
|
|
15083
14070
|
commands: plugin.commands,
|
|
15084
14071
|
outbound: plugin.outbound?.textChunkLimit ? { textChunkLimit: plugin.outbound.textChunkLimit } : void 0,
|
|
15085
14072
|
streaming: plugin.streaming ? { blockStreamingCoalesceDefaults: plugin.streaming.blockStreamingCoalesceDefaults } : void 0,
|
|
15086
|
-
elevated: plugin.elevated,
|
|
15087
14073
|
config: plugin.config ? {
|
|
15088
14074
|
resolveAllowFrom: plugin.config.resolveAllowFrom,
|
|
15089
14075
|
formatAllowFrom: plugin.config.formatAllowFrom,
|
|
@@ -15397,7 +14383,6 @@ function createReplyPrefixContext(params) {
|
|
|
15397
14383
|
prefixContext.provider = ctx.provider;
|
|
15398
14384
|
prefixContext.model = extractShortModelName(ctx.model);
|
|
15399
14385
|
prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
|
|
15400
|
-
prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
|
|
15401
14386
|
};
|
|
15402
14387
|
return {
|
|
15403
14388
|
prefixContext,
|
|
@@ -15436,15 +14421,15 @@ function logAckFailure(params) {
|
|
|
15436
14421
|
|
|
15437
14422
|
//#endregion
|
|
15438
14423
|
//#region src/channels/plugins/media-limits.ts
|
|
15439
|
-
const MB
|
|
14424
|
+
const MB = 1024 * 1024;
|
|
15440
14425
|
function resolveChannelMediaMaxBytes(params) {
|
|
15441
14426
|
const accountId = normalizeAccountId(params.accountId);
|
|
15442
14427
|
const channelLimit = params.resolveChannelLimitMb({
|
|
15443
14428
|
cfg: params.cfg,
|
|
15444
14429
|
accountId
|
|
15445
14430
|
});
|
|
15446
|
-
if (channelLimit) return channelLimit * MB
|
|
15447
|
-
if (params.cfg.agents?.defaults?.mediaMaxMb) return params.cfg.agents.defaults.mediaMaxMb * MB
|
|
14431
|
+
if (channelLimit) return channelLimit * MB;
|
|
14432
|
+
if (params.cfg.agents?.defaults?.mediaMaxMb) return params.cfg.agents.defaults.mediaMaxMb * MB;
|
|
15448
14433
|
}
|
|
15449
14434
|
|
|
15450
14435
|
//#endregion
|
|
@@ -16626,7 +15611,7 @@ async function enforceSessionDiskBudget(params) {
|
|
|
16626
15611
|
|
|
16627
15612
|
//#endregion
|
|
16628
15613
|
//#region src/config/sessions/store.ts
|
|
16629
|
-
const log$
|
|
15614
|
+
const log$7 = createSubsystemLogger("sessions/store");
|
|
16630
15615
|
const SESSION_STORE_CACHE = /* @__PURE__ */ new Map();
|
|
16631
15616
|
const DEFAULT_SESSION_STORE_TTL_MS = 45e3;
|
|
16632
15617
|
function isSessionStoreRecord(value) {
|
|
@@ -16738,22 +15723,6 @@ function loadSessionStore(storePath, opts = {}) {
|
|
|
16738
15723
|
continue;
|
|
16739
15724
|
}
|
|
16740
15725
|
}
|
|
16741
|
-
for (const entry of Object.values(store)) {
|
|
16742
|
-
if (!entry || typeof entry !== "object") continue;
|
|
16743
|
-
const rec = entry;
|
|
16744
|
-
if (typeof rec.channel !== "string" && typeof rec.provider === "string") {
|
|
16745
|
-
rec.channel = rec.provider;
|
|
16746
|
-
delete rec.provider;
|
|
16747
|
-
}
|
|
16748
|
-
if (typeof rec.lastChannel !== "string" && typeof rec.lastProvider === "string") {
|
|
16749
|
-
rec.lastChannel = rec.lastProvider;
|
|
16750
|
-
delete rec.lastProvider;
|
|
16751
|
-
}
|
|
16752
|
-
if (typeof rec.groupChannel !== "string" && typeof rec.room === "string") {
|
|
16753
|
-
rec.groupChannel = rec.room;
|
|
16754
|
-
delete rec.room;
|
|
16755
|
-
} else if ("room" in rec) delete rec.room;
|
|
16756
|
-
}
|
|
16757
15726
|
if (!opts.skipCache && isSessionStoreCacheEnabled()) SESSION_STORE_CACHE.set(storePath, {
|
|
16758
15727
|
store: structuredClone(store),
|
|
16759
15728
|
loadedAt: Date.now(),
|
|
@@ -16858,7 +15827,7 @@ function pruneStaleEntries(store, overrideMaxAgeMs, opts = {}) {
|
|
|
16858
15827
|
delete store[key];
|
|
16859
15828
|
pruned++;
|
|
16860
15829
|
}
|
|
16861
|
-
if (pruned > 0 && opts.log !== false) log$
|
|
15830
|
+
if (pruned > 0 && opts.log !== false) log$7.info("pruned stale session entries", {
|
|
16862
15831
|
pruned,
|
|
16863
15832
|
maxAgeMs
|
|
16864
15833
|
});
|
|
@@ -16908,7 +15877,7 @@ function capEntryCount(store, overrideMax, opts = {}) {
|
|
|
16908
15877
|
});
|
|
16909
15878
|
delete store[key];
|
|
16910
15879
|
}
|
|
16911
|
-
if (opts.log !== false) log$
|
|
15880
|
+
if (opts.log !== false) log$7.info("capped session entry count", {
|
|
16912
15881
|
removed: toRemove.length,
|
|
16913
15882
|
maxEntries
|
|
16914
15883
|
});
|
|
@@ -16934,7 +15903,7 @@ async function rotateSessionFile(storePath, overrideBytes) {
|
|
|
16934
15903
|
const backupPath = `${storePath}.bak.${Date.now()}`;
|
|
16935
15904
|
try {
|
|
16936
15905
|
await fs.promises.rename(storePath, backupPath);
|
|
16937
|
-
log$
|
|
15906
|
+
log$7.info("rotated session store file", {
|
|
16938
15907
|
backupPath: path.basename(backupPath),
|
|
16939
15908
|
sizeBytes: fileSize
|
|
16940
15909
|
});
|
|
@@ -16949,7 +15918,7 @@ async function rotateSessionFile(storePath, overrideBytes) {
|
|
|
16949
15918
|
if (backups.length > maxBackups) {
|
|
16950
15919
|
const toDelete = backups.slice(maxBackups);
|
|
16951
15920
|
for (const old of toDelete) await fs.promises.unlink(path.join(dir, old)).catch(() => void 0);
|
|
16952
|
-
log$
|
|
15921
|
+
log$7.info("cleaned up old session store backups", { deleted: toDelete.length });
|
|
16953
15922
|
}
|
|
16954
15923
|
} catch {}
|
|
16955
15924
|
return true;
|
|
@@ -16974,7 +15943,7 @@ async function saveSessionStoreUnlocked(storePath, store, opts) {
|
|
|
16974
15943
|
maxEntries: maintenance.maxEntries
|
|
16975
15944
|
});
|
|
16976
15945
|
if (warning) {
|
|
16977
|
-
log$
|
|
15946
|
+
log$7.warn("session maintenance would evict active session; skipping enforcement", {
|
|
16978
15947
|
activeSessionKey: warning.activeSessionKey,
|
|
16979
15948
|
wouldPrune: warning.wouldPrune,
|
|
16980
15949
|
wouldCap: warning.wouldCap,
|
|
@@ -16990,7 +15959,7 @@ async function saveSessionStoreUnlocked(storePath, store, opts) {
|
|
|
16990
15959
|
activeSessionKey: opts?.activeSessionKey,
|
|
16991
15960
|
maintenance,
|
|
16992
15961
|
warnOnly: true,
|
|
16993
|
-
log: log$
|
|
15962
|
+
log: log$7
|
|
16994
15963
|
});
|
|
16995
15964
|
await opts?.onMaintenanceApplied?.({
|
|
16996
15965
|
mode: maintenance.mode,
|
|
@@ -17041,7 +16010,7 @@ async function saveSessionStoreUnlocked(storePath, store, opts) {
|
|
|
17041
16010
|
activeSessionKey: opts?.activeSessionKey,
|
|
17042
16011
|
maintenance,
|
|
17043
16012
|
warnOnly: false,
|
|
17044
|
-
log: log$
|
|
16013
|
+
log: log$7
|
|
17045
16014
|
});
|
|
17046
16015
|
await opts?.onMaintenanceApplied?.({
|
|
17047
16016
|
mode: maintenance.mode,
|
|
@@ -17064,7 +16033,7 @@ async function saveSessionStoreUnlocked(storePath, store, opts) {
|
|
|
17064
16033
|
break;
|
|
17065
16034
|
} catch {
|
|
17066
16035
|
if (i < 4) await new Promise((r) => setTimeout(r, 50 * (i + 1)));
|
|
17067
|
-
if (i === 4) log$
|
|
16036
|
+
if (i === 4) log$7.warn(`rename failed after 5 attempts: ${storePath}`);
|
|
17068
16037
|
}
|
|
17069
16038
|
} catch (err) {
|
|
17070
16039
|
if ((err && typeof err === "object" && "code" in err ? String(err.code) : null) === "ENOENT") return;
|
|
@@ -19922,9 +18891,7 @@ const SessionsResolveParamsSchema = Type.Object({
|
|
|
19922
18891
|
const SessionsPatchParamsSchema = Type.Object({
|
|
19923
18892
|
key: NonEmptyString,
|
|
19924
18893
|
label: Type.Optional(Type.Union([SessionLabelString, Type.Null()])),
|
|
19925
|
-
thinkingLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19926
18894
|
verboseLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19927
|
-
reasoningLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19928
18895
|
responseUsage: Type.Optional(Type.Union([
|
|
19929
18896
|
Type.Literal("off"),
|
|
19930
18897
|
Type.Literal("tokens"),
|
|
@@ -19932,11 +18899,6 @@ const SessionsPatchParamsSchema = Type.Object({
|
|
|
19932
18899
|
Type.Literal("on"),
|
|
19933
18900
|
Type.Null()
|
|
19934
18901
|
])),
|
|
19935
|
-
elevatedLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19936
|
-
execHost: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19937
|
-
execSecurity: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19938
|
-
execAsk: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19939
|
-
execNode: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19940
18902
|
model: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19941
18903
|
spawnedBy: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
19942
18904
|
spawnDepth: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
@@ -20159,7 +19121,6 @@ const METHOD_SCOPE_GROUPS = {
|
|
|
20159
19121
|
"usage.cost",
|
|
20160
19122
|
"tts.status",
|
|
20161
19123
|
"tts.providers",
|
|
20162
|
-
"models.list",
|
|
20163
19124
|
"tools.catalog",
|
|
20164
19125
|
"plugin:tools:list",
|
|
20165
19126
|
"agents.list",
|
|
@@ -22221,52 +21182,314 @@ function resolveWhatsAppOutboundTarget(params) {
|
|
|
22221
21182
|
const DEFAULT_WEB_MEDIA_BYTES = 5 * 1024 * 1024;
|
|
22222
21183
|
|
|
22223
21184
|
//#endregion
|
|
22224
|
-
//#region src/
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
"github-copilot/gpt-5.2"
|
|
22233
|
-
];
|
|
22234
|
-
const XHIGH_MODEL_SET = new Set(XHIGH_MODEL_REFS.map((entry) => entry.toLowerCase()));
|
|
22235
|
-
const XHIGH_MODEL_IDS = new Set(XHIGH_MODEL_REFS.map((entry) => entry.split("/")[1]?.toLowerCase()).filter((entry) => Boolean(entry)));
|
|
21185
|
+
//#region src/plugins/hook-runner-global.ts
|
|
21186
|
+
/**
|
|
21187
|
+
* Global Plugin Hook Runner
|
|
21188
|
+
*
|
|
21189
|
+
* Singleton hook runner that's initialized when plugins are loaded
|
|
21190
|
+
* and can be called from anywhere in the codebase.
|
|
21191
|
+
*/
|
|
21192
|
+
const log$6 = createSubsystemLogger("plugins");
|
|
22236
21193
|
|
|
22237
21194
|
//#endregion
|
|
22238
|
-
//#region src/
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
21195
|
+
//#region src/utils/normalize-secret-input.ts
|
|
21196
|
+
/**
|
|
21197
|
+
* Secret normalization for copy/pasted credentials.
|
|
21198
|
+
*
|
|
21199
|
+
* Common footgun: line breaks (especially `\r`) embedded in API keys/tokens.
|
|
21200
|
+
* We strip line breaks anywhere, then trim whitespace at the ends.
|
|
21201
|
+
*
|
|
21202
|
+
* Intentionally does NOT remove ordinary spaces inside the string to avoid
|
|
21203
|
+
* silently altering "Bearer <token>" style values.
|
|
21204
|
+
*/
|
|
21205
|
+
function normalizeSecretInput(value) {
|
|
21206
|
+
if (typeof value !== "string") return "";
|
|
21207
|
+
return value.replace(/[\r\n\u2028\u2029]+/g, "").trim();
|
|
21208
|
+
}
|
|
21209
|
+
function normalizeOptionalSecretInput(value) {
|
|
21210
|
+
const normalized = normalizeSecretInput(value);
|
|
21211
|
+
return normalized ? normalized : void 0;
|
|
21212
|
+
}
|
|
22247
21213
|
|
|
22248
21214
|
//#endregion
|
|
22249
|
-
//#region src/
|
|
22250
|
-
const
|
|
22251
|
-
const
|
|
21215
|
+
//#region src/auth/constants.ts
|
|
21216
|
+
const AUTH_STORE_VERSION = 1;
|
|
21217
|
+
const AUTH_PROFILE_FILENAME = "auth-profiles.json";
|
|
21218
|
+
const log$5 = createSubsystemLogger("auth");
|
|
22252
21219
|
|
|
22253
21220
|
//#endregion
|
|
22254
|
-
//#region src/
|
|
22255
|
-
|
|
21221
|
+
//#region src/auth/paths.ts
|
|
21222
|
+
function resolveAuthStorePath() {
|
|
21223
|
+
return path.join(resolveStateDir(), AUTH_PROFILE_FILENAME);
|
|
21224
|
+
}
|
|
21225
|
+
function resolveAuthStorePathForDisplay() {
|
|
21226
|
+
return resolveAuthStorePath();
|
|
21227
|
+
}
|
|
22256
21228
|
|
|
22257
21229
|
//#endregion
|
|
22258
|
-
//#region src/
|
|
22259
|
-
|
|
21230
|
+
//#region src/auth/store.ts
|
|
21231
|
+
function coerceAuthStore(raw) {
|
|
21232
|
+
if (!raw || typeof raw !== "object") return null;
|
|
21233
|
+
const record = raw;
|
|
21234
|
+
if (!record.profiles || typeof record.profiles !== "object") return null;
|
|
21235
|
+
const profiles = record.profiles;
|
|
21236
|
+
const normalized = {};
|
|
21237
|
+
for (const [key, value] of Object.entries(profiles)) {
|
|
21238
|
+
if (!value || typeof value !== "object") continue;
|
|
21239
|
+
const typed = value;
|
|
21240
|
+
const provider = typeof typed.provider === "string" ? typed.provider : "";
|
|
21241
|
+
if (!provider) continue;
|
|
21242
|
+
const type = typed.type === "token" ? "token" : "api_key";
|
|
21243
|
+
normalized[key] = {
|
|
21244
|
+
...typed,
|
|
21245
|
+
type,
|
|
21246
|
+
provider
|
|
21247
|
+
};
|
|
21248
|
+
}
|
|
21249
|
+
const order = record.order && typeof record.order === "object" ? Object.entries(record.order).reduce((acc, [provider, value]) => {
|
|
21250
|
+
if (!Array.isArray(value)) return acc;
|
|
21251
|
+
const list = value.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean);
|
|
21252
|
+
if (list.length === 0) return acc;
|
|
21253
|
+
acc[provider] = list;
|
|
21254
|
+
return acc;
|
|
21255
|
+
}, {}) : void 0;
|
|
21256
|
+
return {
|
|
21257
|
+
version: Number(record.version ?? AUTH_STORE_VERSION),
|
|
21258
|
+
profiles: normalized,
|
|
21259
|
+
order,
|
|
21260
|
+
lastGood: record.lastGood && typeof record.lastGood === "object" ? record.lastGood : void 0,
|
|
21261
|
+
usageStats: record.usageStats && typeof record.usageStats === "object" ? record.usageStats : void 0
|
|
21262
|
+
};
|
|
21263
|
+
}
|
|
21264
|
+
function loadAuthProfileStore() {
|
|
21265
|
+
const asStore = coerceAuthStore(loadJsonFile(resolveAuthStorePath()));
|
|
21266
|
+
if (asStore) return asStore;
|
|
21267
|
+
return {
|
|
21268
|
+
version: AUTH_STORE_VERSION,
|
|
21269
|
+
profiles: {}
|
|
21270
|
+
};
|
|
21271
|
+
}
|
|
21272
|
+
function ensureAuthProfileStore() {
|
|
21273
|
+
return loadAuthProfileStore();
|
|
21274
|
+
}
|
|
22260
21275
|
|
|
22261
21276
|
//#endregion
|
|
22262
|
-
//#region src/
|
|
21277
|
+
//#region src/auth/profiles.ts
|
|
21278
|
+
function listProfilesForProvider(store, provider) {
|
|
21279
|
+
const providerKey = normalizeProviderId(provider);
|
|
21280
|
+
return Object.entries(store.profiles).filter(([, cred]) => normalizeProviderId(cred.provider) === providerKey).map(([id]) => id);
|
|
21281
|
+
}
|
|
21282
|
+
|
|
21283
|
+
//#endregion
|
|
21284
|
+
//#region src/auth/oauth.ts
|
|
21285
|
+
function isProfileConfigCompatible(params) {
|
|
21286
|
+
const profileConfig = params.cfg?.auth?.profiles?.[params.profileId];
|
|
21287
|
+
if (profileConfig && profileConfig.provider !== params.provider) return false;
|
|
21288
|
+
return true;
|
|
21289
|
+
}
|
|
21290
|
+
function buildApiKeyProfileResult(params) {
|
|
21291
|
+
return {
|
|
21292
|
+
apiKey: params.apiKey,
|
|
21293
|
+
provider: params.provider,
|
|
21294
|
+
email: params.email
|
|
21295
|
+
};
|
|
21296
|
+
}
|
|
21297
|
+
async function resolveApiKeyForProfile(params) {
|
|
21298
|
+
const { cfg, store, profileId } = params;
|
|
21299
|
+
const cred = store.profiles[profileId];
|
|
21300
|
+
if (!cred) return null;
|
|
21301
|
+
if (!isProfileConfigCompatible({
|
|
21302
|
+
cfg,
|
|
21303
|
+
profileId,
|
|
21304
|
+
provider: cred.provider
|
|
21305
|
+
})) return null;
|
|
21306
|
+
const key = (cred.type === "token" ? cred.token : cred.key)?.trim();
|
|
21307
|
+
if (!key) return null;
|
|
21308
|
+
return buildApiKeyProfileResult({
|
|
21309
|
+
apiKey: key,
|
|
21310
|
+
provider: cred.provider,
|
|
21311
|
+
email: cred.email
|
|
21312
|
+
});
|
|
21313
|
+
}
|
|
21314
|
+
|
|
21315
|
+
//#endregion
|
|
21316
|
+
//#region src/auth/usage.ts
|
|
21317
|
+
const FAILURE_REASON_PRIORITY = [
|
|
21318
|
+
"auth",
|
|
21319
|
+
"billing",
|
|
21320
|
+
"format",
|
|
21321
|
+
"model_not_found",
|
|
21322
|
+
"timeout",
|
|
21323
|
+
"rate_limit",
|
|
21324
|
+
"unknown"
|
|
21325
|
+
];
|
|
21326
|
+
const FAILURE_REASON_SET = new Set(FAILURE_REASON_PRIORITY);
|
|
21327
|
+
const FAILURE_REASON_ORDER = new Map(FAILURE_REASON_PRIORITY.map((reason, index) => [reason, index]));
|
|
21328
|
+
|
|
21329
|
+
//#endregion
|
|
21330
|
+
//#region src/auth/provider-auth.ts
|
|
22263
21331
|
/**
|
|
22264
|
-
*
|
|
21332
|
+
* Provider auth resolution extracted from model-auth.ts.
|
|
22265
21333
|
*
|
|
22266
|
-
*
|
|
22267
|
-
* and
|
|
21334
|
+
* Resolves API keys for providers via auth profiles, environment variables,
|
|
21335
|
+
* and AWS SDK credential chains. Used by media-understanding, onboarding,
|
|
21336
|
+
* and status display.
|
|
22268
21337
|
*/
|
|
22269
|
-
const
|
|
21338
|
+
const AWS_BEARER_ENV = "AWS_BEARER_TOKEN_BEDROCK";
|
|
21339
|
+
const AWS_ACCESS_KEY_ENV = "AWS_ACCESS_KEY_ID";
|
|
21340
|
+
const AWS_SECRET_KEY_ENV = "AWS_SECRET_ACCESS_KEY";
|
|
21341
|
+
const AWS_PROFILE_ENV = "AWS_PROFILE";
|
|
21342
|
+
function resolveEnvSourceLabel(params) {
|
|
21343
|
+
return `${params.envVars.some((envVar) => params.applied.has(envVar)) ? "shell env: " : "env: "}${params.label}`;
|
|
21344
|
+
}
|
|
21345
|
+
function resolveAwsSdkAuthInfo() {
|
|
21346
|
+
const applied = new Set(getShellEnvAppliedKeys());
|
|
21347
|
+
if (process.env[AWS_BEARER_ENV]?.trim()) return {
|
|
21348
|
+
mode: "api-key",
|
|
21349
|
+
source: resolveEnvSourceLabel({
|
|
21350
|
+
applied,
|
|
21351
|
+
envVars: [AWS_BEARER_ENV],
|
|
21352
|
+
label: AWS_BEARER_ENV
|
|
21353
|
+
})
|
|
21354
|
+
};
|
|
21355
|
+
if (process.env[AWS_ACCESS_KEY_ENV]?.trim() && process.env[AWS_SECRET_KEY_ENV]?.trim()) return {
|
|
21356
|
+
mode: "api-key",
|
|
21357
|
+
source: resolveEnvSourceLabel({
|
|
21358
|
+
applied,
|
|
21359
|
+
envVars: [AWS_ACCESS_KEY_ENV, AWS_SECRET_KEY_ENV],
|
|
21360
|
+
label: `${AWS_ACCESS_KEY_ENV} + ${AWS_SECRET_KEY_ENV}`
|
|
21361
|
+
})
|
|
21362
|
+
};
|
|
21363
|
+
if (process.env[AWS_PROFILE_ENV]?.trim()) return {
|
|
21364
|
+
mode: "api-key",
|
|
21365
|
+
source: resolveEnvSourceLabel({
|
|
21366
|
+
applied,
|
|
21367
|
+
envVars: [AWS_PROFILE_ENV],
|
|
21368
|
+
label: AWS_PROFILE_ENV
|
|
21369
|
+
})
|
|
21370
|
+
};
|
|
21371
|
+
return {
|
|
21372
|
+
mode: "api-key",
|
|
21373
|
+
source: "aws-sdk default chain"
|
|
21374
|
+
};
|
|
21375
|
+
}
|
|
21376
|
+
function hasVertexAdcCredentials() {
|
|
21377
|
+
const gacPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
21378
|
+
if (gacPath) return existsSync(gacPath);
|
|
21379
|
+
return existsSync(join(homedir(), ".config", "gcloud", "application_default_credentials.json"));
|
|
21380
|
+
}
|
|
21381
|
+
async function resolveApiKeyForProvider(params) {
|
|
21382
|
+
const { provider, cfg, profileId } = params;
|
|
21383
|
+
const store = params.store ?? ensureAuthProfileStore();
|
|
21384
|
+
if (profileId) {
|
|
21385
|
+
const resolved = await resolveApiKeyForProfile({
|
|
21386
|
+
cfg,
|
|
21387
|
+
store,
|
|
21388
|
+
profileId
|
|
21389
|
+
});
|
|
21390
|
+
if (!resolved) throw new Error(`No credentials found for profile "${profileId}".`);
|
|
21391
|
+
return {
|
|
21392
|
+
apiKey: resolved.apiKey,
|
|
21393
|
+
profileId,
|
|
21394
|
+
source: `profile:${profileId}`,
|
|
21395
|
+
mode: "api-key"
|
|
21396
|
+
};
|
|
21397
|
+
}
|
|
21398
|
+
const profiles = listProfilesForProvider(store, provider);
|
|
21399
|
+
const preferred = params.preferredProfile;
|
|
21400
|
+
const candidates = preferred && profiles.includes(preferred) ? [preferred, ...profiles.filter((id) => id !== preferred)] : profiles;
|
|
21401
|
+
for (const candidate of candidates) try {
|
|
21402
|
+
const resolved = await resolveApiKeyForProfile({
|
|
21403
|
+
cfg,
|
|
21404
|
+
store,
|
|
21405
|
+
profileId: candidate
|
|
21406
|
+
});
|
|
21407
|
+
if (resolved) return {
|
|
21408
|
+
apiKey: resolved.apiKey,
|
|
21409
|
+
profileId: candidate,
|
|
21410
|
+
source: `profile:${candidate}`,
|
|
21411
|
+
mode: "api-key"
|
|
21412
|
+
};
|
|
21413
|
+
} catch {}
|
|
21414
|
+
const envResolved = resolveEnvApiKey(provider);
|
|
21415
|
+
if (envResolved) return {
|
|
21416
|
+
apiKey: envResolved.apiKey,
|
|
21417
|
+
source: envResolved.source,
|
|
21418
|
+
mode: "api-key"
|
|
21419
|
+
};
|
|
21420
|
+
if (normalizeProviderId(provider) === "amazon-bedrock") return resolveAwsSdkAuthInfo();
|
|
21421
|
+
if (provider === "openai") {
|
|
21422
|
+
if (listProfilesForProvider(store, "openai-codex").length > 0) throw new Error("No API key found for provider \"openai\". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.3-codex (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.1-codex.");
|
|
21423
|
+
}
|
|
21424
|
+
const authStorePath = resolveAuthStorePathForDisplay();
|
|
21425
|
+
throw new Error([
|
|
21426
|
+
`No API key found for provider "${provider}".`,
|
|
21427
|
+
`Auth store: ${authStorePath}.`,
|
|
21428
|
+
`Configure auth via ${formatCliCommand("remoteclaw configure")} or ${formatCliCommand("remoteclaw onboard")}.`
|
|
21429
|
+
].join(" "));
|
|
21430
|
+
}
|
|
21431
|
+
function resolveEnvApiKey(provider) {
|
|
21432
|
+
const normalized = normalizeProviderId(provider);
|
|
21433
|
+
const applied = new Set(getShellEnvAppliedKeys());
|
|
21434
|
+
const pick = (envVar) => {
|
|
21435
|
+
const value = normalizeOptionalSecretInput(process.env[envVar]);
|
|
21436
|
+
if (!value) return null;
|
|
21437
|
+
return {
|
|
21438
|
+
apiKey: value,
|
|
21439
|
+
source: applied.has(envVar) ? `shell env: ${envVar}` : `env: ${envVar}`
|
|
21440
|
+
};
|
|
21441
|
+
};
|
|
21442
|
+
if (normalized === "github-copilot") return pick("COPILOT_GITHUB_TOKEN") ?? pick("GH_TOKEN") ?? pick("GITHUB_TOKEN");
|
|
21443
|
+
if (normalized === "anthropic") return pick("ANTHROPIC_OAUTH_TOKEN") ?? pick("ANTHROPIC_API_KEY");
|
|
21444
|
+
if (normalized === "chutes") return pick("CHUTES_OAUTH_TOKEN") ?? pick("CHUTES_API_KEY");
|
|
21445
|
+
if (normalized === "zai") return pick("ZAI_API_KEY") ?? pick("Z_AI_API_KEY");
|
|
21446
|
+
if (normalized === "google-vertex") {
|
|
21447
|
+
const hasCredentials = hasVertexAdcCredentials();
|
|
21448
|
+
const hasProject = !!(process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT);
|
|
21449
|
+
const hasLocation = !!process.env.GOOGLE_CLOUD_LOCATION;
|
|
21450
|
+
if (hasCredentials && hasProject && hasLocation) return {
|
|
21451
|
+
apiKey: "<authenticated>",
|
|
21452
|
+
source: "gcloud adc"
|
|
21453
|
+
};
|
|
21454
|
+
return null;
|
|
21455
|
+
}
|
|
21456
|
+
if (normalized === "opencode") return pick("OPENCODE_API_KEY") ?? pick("OPENCODE_ZEN_API_KEY");
|
|
21457
|
+
if (normalized === "qwen-portal") return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY");
|
|
21458
|
+
if (normalized === "volcengine" || normalized === "volcengine-plan") return pick("VOLCANO_ENGINE_API_KEY");
|
|
21459
|
+
if (normalized === "byteplus" || normalized === "byteplus-plan") return pick("BYTEPLUS_API_KEY");
|
|
21460
|
+
if (normalized === "minimax-portal") return pick("MINIMAX_OAUTH_TOKEN") ?? pick("MINIMAX_API_KEY");
|
|
21461
|
+
if (normalized === "kimi-coding") return pick("KIMI_API_KEY") ?? pick("KIMICODE_API_KEY");
|
|
21462
|
+
if (normalized === "huggingface") return pick("HUGGINGFACE_HUB_TOKEN") ?? pick("HF_TOKEN");
|
|
21463
|
+
if (normalized === "elevenlabs") return pick("ELEVENLABS_API_KEY") ?? pick("XI_API_KEY");
|
|
21464
|
+
const envVar = {
|
|
21465
|
+
openai: "OPENAI_API_KEY",
|
|
21466
|
+
google: "GEMINI_API_KEY",
|
|
21467
|
+
voyage: "VOYAGE_API_KEY",
|
|
21468
|
+
groq: "GROQ_API_KEY",
|
|
21469
|
+
deepgram: "DEEPGRAM_API_KEY",
|
|
21470
|
+
cerebras: "CEREBRAS_API_KEY",
|
|
21471
|
+
xai: "XAI_API_KEY",
|
|
21472
|
+
openrouter: "OPENROUTER_API_KEY",
|
|
21473
|
+
litellm: "LITELLM_API_KEY",
|
|
21474
|
+
"vercel-ai-gateway": "AI_GATEWAY_API_KEY",
|
|
21475
|
+
"cloudflare-ai-gateway": "CLOUDFLARE_AI_GATEWAY_API_KEY",
|
|
21476
|
+
moonshot: "MOONSHOT_API_KEY",
|
|
21477
|
+
minimax: "MINIMAX_API_KEY",
|
|
21478
|
+
nvidia: "NVIDIA_API_KEY",
|
|
21479
|
+
xiaomi: "XIAOMI_API_KEY",
|
|
21480
|
+
synthetic: "SYNTHETIC_API_KEY",
|
|
21481
|
+
venice: "VENICE_API_KEY",
|
|
21482
|
+
mistral: "MISTRAL_API_KEY",
|
|
21483
|
+
opencode: "OPENCODE_API_KEY",
|
|
21484
|
+
together: "TOGETHER_API_KEY",
|
|
21485
|
+
qianfan: "QIANFAN_API_KEY",
|
|
21486
|
+
ollama: "OLLAMA_API_KEY",
|
|
21487
|
+
vllm: "VLLM_API_KEY",
|
|
21488
|
+
kilocode: "KILOCODE_API_KEY"
|
|
21489
|
+
}[normalized];
|
|
21490
|
+
if (!envVar) return null;
|
|
21491
|
+
return pick(envVar);
|
|
21492
|
+
}
|
|
22270
21493
|
|
|
22271
21494
|
//#endregion
|
|
22272
21495
|
//#region src/line/flex-templates/common.ts
|
|
@@ -22937,6 +22160,136 @@ function hasMarkdownToConvert(text) {
|
|
|
22937
22160
|
//#region src/tts/tts-core.ts
|
|
22938
22161
|
const TEMP_FILE_CLEANUP_DELAY_MS = 300 * 1e3;
|
|
22939
22162
|
|
|
22163
|
+
//#endregion
|
|
22164
|
+
//#region src/tts/tts.ts
|
|
22165
|
+
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
22166
|
+
const DEFAULT_MAX_TEXT_LENGTH = 4096;
|
|
22167
|
+
const DEFAULT_ELEVENLABS_BASE_URL = "https://api.elevenlabs.io";
|
|
22168
|
+
const DEFAULT_ELEVENLABS_VOICE_ID = "pMsXgVXv3BLzUgSXRplE";
|
|
22169
|
+
const DEFAULT_ELEVENLABS_MODEL_ID = "eleven_multilingual_v2";
|
|
22170
|
+
const DEFAULT_OPENAI_MODEL = "gpt-4o-mini-tts";
|
|
22171
|
+
const DEFAULT_OPENAI_VOICE = "alloy";
|
|
22172
|
+
const DEFAULT_EDGE_VOICE = "en-US-MichelleNeural";
|
|
22173
|
+
const DEFAULT_EDGE_LANG = "en-US";
|
|
22174
|
+
const DEFAULT_EDGE_OUTPUT_FORMAT = "audio-24khz-48kbitrate-mono-mp3";
|
|
22175
|
+
const DEFAULT_ELEVENLABS_VOICE_SETTINGS = {
|
|
22176
|
+
stability: .5,
|
|
22177
|
+
similarityBoost: .75,
|
|
22178
|
+
style: 0,
|
|
22179
|
+
useSpeakerBoost: true,
|
|
22180
|
+
speed: 1
|
|
22181
|
+
};
|
|
22182
|
+
const TTS_AUTO_MODES = new Set([
|
|
22183
|
+
"off",
|
|
22184
|
+
"always",
|
|
22185
|
+
"inbound",
|
|
22186
|
+
"tagged"
|
|
22187
|
+
]);
|
|
22188
|
+
function normalizeTtsAutoMode(value) {
|
|
22189
|
+
if (typeof value !== "string") return;
|
|
22190
|
+
const normalized = value.trim().toLowerCase();
|
|
22191
|
+
if (TTS_AUTO_MODES.has(normalized)) return normalized;
|
|
22192
|
+
}
|
|
22193
|
+
function resolveModelOverridePolicy(overrides) {
|
|
22194
|
+
if (!(overrides?.enabled ?? true)) return {
|
|
22195
|
+
enabled: false,
|
|
22196
|
+
allowText: false,
|
|
22197
|
+
allowProvider: false,
|
|
22198
|
+
allowVoice: false,
|
|
22199
|
+
allowModelId: false,
|
|
22200
|
+
allowVoiceSettings: false,
|
|
22201
|
+
allowNormalization: false,
|
|
22202
|
+
allowSeed: false
|
|
22203
|
+
};
|
|
22204
|
+
const allow = (value, defaultValue = true) => value ?? defaultValue;
|
|
22205
|
+
return {
|
|
22206
|
+
enabled: true,
|
|
22207
|
+
allowText: allow(overrides?.allowText),
|
|
22208
|
+
allowProvider: allow(overrides?.allowProvider, false),
|
|
22209
|
+
allowVoice: allow(overrides?.allowVoice),
|
|
22210
|
+
allowModelId: allow(overrides?.allowModelId),
|
|
22211
|
+
allowVoiceSettings: allow(overrides?.allowVoiceSettings),
|
|
22212
|
+
allowNormalization: allow(overrides?.allowNormalization),
|
|
22213
|
+
allowSeed: allow(overrides?.allowSeed)
|
|
22214
|
+
};
|
|
22215
|
+
}
|
|
22216
|
+
function resolveTtsConfig(cfg) {
|
|
22217
|
+
const raw = cfg.messages?.tts ?? {};
|
|
22218
|
+
const providerSource = raw.provider ? "config" : "default";
|
|
22219
|
+
const edgeOutputFormat = raw.edge?.outputFormat?.trim();
|
|
22220
|
+
return {
|
|
22221
|
+
auto: normalizeTtsAutoMode(raw.auto) ?? (raw.enabled ? "always" : "off"),
|
|
22222
|
+
mode: raw.mode ?? "final",
|
|
22223
|
+
provider: raw.provider ?? "edge",
|
|
22224
|
+
providerSource,
|
|
22225
|
+
summaryModel: raw.summaryModel?.trim() || void 0,
|
|
22226
|
+
modelOverrides: resolveModelOverridePolicy(raw.modelOverrides),
|
|
22227
|
+
elevenlabs: {
|
|
22228
|
+
apiKey: raw.elevenlabs?.apiKey,
|
|
22229
|
+
baseUrl: raw.elevenlabs?.baseUrl?.trim() || DEFAULT_ELEVENLABS_BASE_URL,
|
|
22230
|
+
voiceId: raw.elevenlabs?.voiceId ?? DEFAULT_ELEVENLABS_VOICE_ID,
|
|
22231
|
+
modelId: raw.elevenlabs?.modelId ?? DEFAULT_ELEVENLABS_MODEL_ID,
|
|
22232
|
+
seed: raw.elevenlabs?.seed,
|
|
22233
|
+
applyTextNormalization: raw.elevenlabs?.applyTextNormalization,
|
|
22234
|
+
languageCode: raw.elevenlabs?.languageCode,
|
|
22235
|
+
voiceSettings: {
|
|
22236
|
+
stability: raw.elevenlabs?.voiceSettings?.stability ?? DEFAULT_ELEVENLABS_VOICE_SETTINGS.stability,
|
|
22237
|
+
similarityBoost: raw.elevenlabs?.voiceSettings?.similarityBoost ?? DEFAULT_ELEVENLABS_VOICE_SETTINGS.similarityBoost,
|
|
22238
|
+
style: raw.elevenlabs?.voiceSettings?.style ?? DEFAULT_ELEVENLABS_VOICE_SETTINGS.style,
|
|
22239
|
+
useSpeakerBoost: raw.elevenlabs?.voiceSettings?.useSpeakerBoost ?? DEFAULT_ELEVENLABS_VOICE_SETTINGS.useSpeakerBoost,
|
|
22240
|
+
speed: raw.elevenlabs?.voiceSettings?.speed ?? DEFAULT_ELEVENLABS_VOICE_SETTINGS.speed
|
|
22241
|
+
}
|
|
22242
|
+
},
|
|
22243
|
+
openai: {
|
|
22244
|
+
apiKey: raw.openai?.apiKey,
|
|
22245
|
+
model: raw.openai?.model ?? DEFAULT_OPENAI_MODEL,
|
|
22246
|
+
voice: raw.openai?.voice ?? DEFAULT_OPENAI_VOICE
|
|
22247
|
+
},
|
|
22248
|
+
edge: {
|
|
22249
|
+
enabled: raw.edge?.enabled ?? true,
|
|
22250
|
+
voice: raw.edge?.voice?.trim() || DEFAULT_EDGE_VOICE,
|
|
22251
|
+
lang: raw.edge?.lang?.trim() || DEFAULT_EDGE_LANG,
|
|
22252
|
+
outputFormat: edgeOutputFormat || DEFAULT_EDGE_OUTPUT_FORMAT,
|
|
22253
|
+
outputFormatConfigured: Boolean(edgeOutputFormat),
|
|
22254
|
+
pitch: raw.edge?.pitch?.trim() || void 0,
|
|
22255
|
+
rate: raw.edge?.rate?.trim() || void 0,
|
|
22256
|
+
volume: raw.edge?.volume?.trim() || void 0,
|
|
22257
|
+
saveSubtitles: raw.edge?.saveSubtitles ?? false,
|
|
22258
|
+
proxy: raw.edge?.proxy?.trim() || void 0,
|
|
22259
|
+
timeoutMs: raw.edge?.timeoutMs
|
|
22260
|
+
},
|
|
22261
|
+
prefsPath: raw.prefsPath,
|
|
22262
|
+
maxTextLength: raw.maxTextLength ?? DEFAULT_MAX_TEXT_LENGTH,
|
|
22263
|
+
timeoutMs: raw.timeoutMs ?? DEFAULT_TIMEOUT_MS
|
|
22264
|
+
};
|
|
22265
|
+
}
|
|
22266
|
+
function ttsProviderToAuthProvider(provider) {
|
|
22267
|
+
switch (provider) {
|
|
22268
|
+
case "openai": return "openai";
|
|
22269
|
+
case "elevenlabs": return "elevenlabs";
|
|
22270
|
+
default: return provider;
|
|
22271
|
+
}
|
|
22272
|
+
}
|
|
22273
|
+
async function resolveTtsApiKey(config, provider) {
|
|
22274
|
+
if (provider !== "edge") try {
|
|
22275
|
+
const auth = await resolveApiKeyForProvider({ provider: ttsProviderToAuthProvider(provider) });
|
|
22276
|
+
if (auth.apiKey) return auth.apiKey;
|
|
22277
|
+
} catch {}
|
|
22278
|
+
if (provider === "elevenlabs") return config.elevenlabs.apiKey || void 0;
|
|
22279
|
+
if (provider === "openai") return config.openai.apiKey || void 0;
|
|
22280
|
+
}
|
|
22281
|
+
const BUILTIN_TTS_PROVIDER_IDS = [
|
|
22282
|
+
"openai",
|
|
22283
|
+
"elevenlabs",
|
|
22284
|
+
"edge"
|
|
22285
|
+
];
|
|
22286
|
+
/** @deprecated Use BUILTIN_TTS_PROVIDER_IDS instead. */
|
|
22287
|
+
const TTS_PROVIDERS = BUILTIN_TTS_PROVIDER_IDS;
|
|
22288
|
+
async function isTtsProviderConfigured(config, provider) {
|
|
22289
|
+
if (provider === "edge") return config.edge.enabled;
|
|
22290
|
+
return Boolean(await resolveTtsApiKey(config, provider));
|
|
22291
|
+
}
|
|
22292
|
+
|
|
22940
22293
|
//#endregion
|
|
22941
22294
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
22942
22295
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
@@ -22962,7 +22315,7 @@ let CommandLane = /* @__PURE__ */ function(CommandLane) {
|
|
|
22962
22315
|
|
|
22963
22316
|
//#endregion
|
|
22964
22317
|
//#region src/agents/agent-helpers/errors.ts
|
|
22965
|
-
const log$
|
|
22318
|
+
const log$4 = createSubsystemLogger("errors");
|
|
22966
22319
|
function formatBillingErrorMessage(provider, model) {
|
|
22967
22320
|
const providerName = provider?.trim();
|
|
22968
22321
|
const modelName = model?.trim();
|
|
@@ -23599,15 +22952,17 @@ const ANNOUNCE_EXPIRY_MS = 5 * 6e4;
|
|
|
23599
22952
|
const restartLog = createSubsystemLogger("restart");
|
|
23600
22953
|
|
|
23601
22954
|
//#endregion
|
|
23602
|
-
//#region src/
|
|
23603
|
-
const
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
22955
|
+
//#region src/auth/env-injection.ts
|
|
22956
|
+
const log$3 = createSubsystemLogger("auth-env");
|
|
22957
|
+
|
|
22958
|
+
//#endregion
|
|
22959
|
+
//#region src/middleware/auth-key-retry.ts
|
|
22960
|
+
const log$2 = createSubsystemLogger("auth-retry");
|
|
22961
|
+
|
|
22962
|
+
//#endregion
|
|
22963
|
+
//#region src/middleware/media-resolver.ts
|
|
22964
|
+
/** Max download size for inbound channel media (100 MB). */
|
|
22965
|
+
const MAX_INBOUND_MEDIA_BYTES = 100 * 1024 * 1024;
|
|
23611
22966
|
|
|
23612
22967
|
//#endregion
|
|
23613
22968
|
//#region src/middleware/cli-runtime-base.ts
|
|
@@ -23625,6 +22980,12 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23625
22980
|
this.command = command;
|
|
23626
22981
|
this.timeoutMs = timeoutMs;
|
|
23627
22982
|
}
|
|
22983
|
+
/**
|
|
22984
|
+
* Construct a custom stdin payload for the subprocess.
|
|
22985
|
+
* When this returns a string, it is written to stdin instead of
|
|
22986
|
+
* the default large-prompt fallback. Subclasses may override.
|
|
22987
|
+
*/
|
|
22988
|
+
buildStdinPayload(_params) {}
|
|
23628
22989
|
/** Whether this CLI accepts prompts via stdin. Subclasses may override. */
|
|
23629
22990
|
get supportsStdinPrompt() {
|
|
23630
22991
|
return true;
|
|
@@ -23639,11 +23000,18 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23639
23000
|
}
|
|
23640
23001
|
async *execute(params) {
|
|
23641
23002
|
const args = this.buildArgs(params);
|
|
23003
|
+
if (params.extraArgs && params.extraArgs.length > 0) args.push(...params.extraArgs);
|
|
23004
|
+
const runtimeEnv = this.buildEnv(params);
|
|
23005
|
+
const callerEnv = params.env ?? {};
|
|
23642
23006
|
const env = {
|
|
23643
23007
|
...process.env,
|
|
23644
|
-
...
|
|
23645
|
-
...
|
|
23008
|
+
...runtimeEnv,
|
|
23009
|
+
...callerEnv
|
|
23646
23010
|
};
|
|
23011
|
+
logDebug(`[agent-runtime] spawn: ${this.command} ${args.map((a) => JSON.stringify(a)).join(" ")}`);
|
|
23012
|
+
logDebug(`[agent-runtime] cwd: ${params.workingDirectory ?? process.cwd()}`);
|
|
23013
|
+
if (Object.keys(runtimeEnv).length > 0) logDebug(`[agent-runtime] runtime env keys: ${Object.keys(runtimeEnv).join(", ")}`);
|
|
23014
|
+
if (Object.keys(callerEnv).length > 0) logDebug(`[agent-runtime] caller env keys: ${Object.keys(callerEnv).join(", ")}`);
|
|
23647
23015
|
const child = spawn(this.command, args, {
|
|
23648
23016
|
cwd: params.workingDirectory,
|
|
23649
23017
|
env,
|
|
@@ -23653,9 +23021,11 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23653
23021
|
"pipe"
|
|
23654
23022
|
]
|
|
23655
23023
|
});
|
|
23024
|
+
logDebug(`[agent-runtime] spawned pid=${child.pid}`);
|
|
23656
23025
|
const startMs = Date.now();
|
|
23657
23026
|
const stderrChunks = [];
|
|
23658
23027
|
let aborted = false;
|
|
23028
|
+
let yieldedEvents = false;
|
|
23659
23029
|
let escalationTimer;
|
|
23660
23030
|
const killWithEscalation = () => {
|
|
23661
23031
|
if (escalationTimer === void 0) escalationTimer = setTimeout(() => {
|
|
@@ -23677,6 +23047,7 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23677
23047
|
if (watchdogTimer !== void 0) clearTimeout(watchdogTimer);
|
|
23678
23048
|
watchdogTimer = setTimeout(() => {
|
|
23679
23049
|
watchdogFired = true;
|
|
23050
|
+
logDebug(`[agent-runtime] pid=${child.pid}: watchdog timeout after ${this.timeoutMs}ms`);
|
|
23680
23051
|
killWithEscalation();
|
|
23681
23052
|
}, this.timeoutMs);
|
|
23682
23053
|
};
|
|
@@ -23716,10 +23087,18 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23716
23087
|
});
|
|
23717
23088
|
});
|
|
23718
23089
|
});
|
|
23719
|
-
|
|
23090
|
+
const customStdin = this.buildStdinPayload(params);
|
|
23091
|
+
if (customStdin !== void 0 && child.stdin) {
|
|
23092
|
+
logDebug(`[agent-runtime] pid=${child.pid}: delivering custom stdin payload (${customStdin.length} chars)`);
|
|
23093
|
+
child.stdin.write(customStdin);
|
|
23094
|
+
} else if (this.supportsStdinPrompt && params.prompt.length > CLIRuntimeBase.STDIN_PROMPT_THRESHOLD && child.stdin) {
|
|
23095
|
+
logDebug(`[agent-runtime] pid=${child.pid}: delivering prompt via stdin (${params.prompt.length} chars)`);
|
|
23096
|
+
child.stdin.write(params.prompt);
|
|
23097
|
+
}
|
|
23720
23098
|
child.stdin?.end();
|
|
23721
23099
|
const onAbort = () => {
|
|
23722
23100
|
aborted = true;
|
|
23101
|
+
logDebug(`[agent-runtime] pid=${child.pid}: abort signal received`);
|
|
23723
23102
|
killWithEscalation();
|
|
23724
23103
|
};
|
|
23725
23104
|
if (params.abortSignal) if (params.abortSignal.aborted) {
|
|
@@ -23734,6 +23113,7 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23734
23113
|
while (eventQueue.length > 0) {
|
|
23735
23114
|
const event = eventQueue.shift();
|
|
23736
23115
|
if (event === null || event === void 0) break;
|
|
23116
|
+
yieldedEvents = true;
|
|
23737
23117
|
yield event;
|
|
23738
23118
|
}
|
|
23739
23119
|
}
|
|
@@ -23741,9 +23121,16 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23741
23121
|
if (watchdogTimer !== void 0) clearTimeout(watchdogTimer);
|
|
23742
23122
|
params.abortSignal?.removeEventListener("abort", onAbort);
|
|
23743
23123
|
}
|
|
23744
|
-
await exitPromise;
|
|
23124
|
+
const { code: exitCode, signal: exitSignal } = await exitPromise;
|
|
23745
23125
|
if (escalationTimer !== void 0) clearTimeout(escalationTimer);
|
|
23746
23126
|
const durationMs = Date.now() - startMs;
|
|
23127
|
+
logDebug(`[agent-runtime] pid=${child.pid}: exited code=${exitCode} signal=${exitSignal} duration=${durationMs}ms`);
|
|
23128
|
+
const stderr = stderrChunks.join("");
|
|
23129
|
+
if (stderr && (exitCode !== 0 || !yieldedEvents)) yield {
|
|
23130
|
+
type: "error",
|
|
23131
|
+
message: stderr.trim(),
|
|
23132
|
+
code: "CLI_STDERR"
|
|
23133
|
+
};
|
|
23747
23134
|
if (watchdogFired) yield {
|
|
23748
23135
|
type: "error",
|
|
23749
23136
|
message: `Watchdog timeout: no output for ${this.timeoutMs}ms`,
|
|
@@ -23761,7 +23148,8 @@ var CLIRuntimeBase = class CLIRuntimeBase {
|
|
|
23761
23148
|
sessionId: void 0,
|
|
23762
23149
|
durationMs,
|
|
23763
23150
|
usage: void 0,
|
|
23764
|
-
aborted
|
|
23151
|
+
aborted,
|
|
23152
|
+
stderr: stderr || void 0
|
|
23765
23153
|
}
|
|
23766
23154
|
};
|
|
23767
23155
|
}
|
|
@@ -24642,4 +24030,55 @@ const LineConfigSchema = LineCommonConfigSchema.extend({
|
|
|
24642
24030
|
}).strict();
|
|
24643
24031
|
|
|
24644
24032
|
//#endregion
|
|
24645
|
-
|
|
24033
|
+
//#region src/stt/defaults.ts
|
|
24034
|
+
const AUTO_AUDIO_KEY_PROVIDERS = [
|
|
24035
|
+
"openai",
|
|
24036
|
+
"groq",
|
|
24037
|
+
"deepgram",
|
|
24038
|
+
"google",
|
|
24039
|
+
"mistral"
|
|
24040
|
+
];
|
|
24041
|
+
|
|
24042
|
+
//#endregion
|
|
24043
|
+
//#region src/channels/voice-credentials.ts
|
|
24044
|
+
/**
|
|
24045
|
+
* Check whether at least one STT provider has valid auth credentials.
|
|
24046
|
+
*
|
|
24047
|
+
* STT has no free fallback — at least one provider must be configured
|
|
24048
|
+
* with a valid API key.
|
|
24049
|
+
*/
|
|
24050
|
+
async function checkSttCredentials() {
|
|
24051
|
+
for (const provider of AUTO_AUDIO_KEY_PROVIDERS) try {
|
|
24052
|
+
if ((await resolveApiKeyForProvider({ provider })).apiKey) return {
|
|
24053
|
+
available: true,
|
|
24054
|
+
provider
|
|
24055
|
+
};
|
|
24056
|
+
} catch {}
|
|
24057
|
+
return { available: false };
|
|
24058
|
+
}
|
|
24059
|
+
/**
|
|
24060
|
+
* Check whether at least one TTS provider has valid auth credentials.
|
|
24061
|
+
*
|
|
24062
|
+
* Edge TTS is free (no API key needed) and counts as a valid provider.
|
|
24063
|
+
*/
|
|
24064
|
+
async function checkTtsCredentials(cfg) {
|
|
24065
|
+
const ttsConfig = resolveTtsConfig(cfg);
|
|
24066
|
+
for (const provider of TTS_PROVIDERS) if (await isTtsProviderConfigured(ttsConfig, provider)) return {
|
|
24067
|
+
available: true,
|
|
24068
|
+
provider
|
|
24069
|
+
};
|
|
24070
|
+
return { available: false };
|
|
24071
|
+
}
|
|
24072
|
+
/**
|
|
24073
|
+
* Validate that both STT and TTS credentials are available for voice channels.
|
|
24074
|
+
*/
|
|
24075
|
+
async function validateVoiceCredentials(cfg) {
|
|
24076
|
+
const [tts, stt] = await Promise.all([checkTtsCredentials(cfg), checkSttCredentials()]);
|
|
24077
|
+
return {
|
|
24078
|
+
tts,
|
|
24079
|
+
stt
|
|
24080
|
+
};
|
|
24081
|
+
}
|
|
24082
|
+
|
|
24083
|
+
//#endregion
|
|
24084
|
+
export { BLUEBUBBLES_ACTIONS, BLUEBUBBLES_ACTION_NAMES, BLUEBUBBLES_GROUP_ACTIONS, BlockStreamingCoalesceSchema, CHANNEL_MESSAGE_ACTION_NAMES, DEFAULT_ACCOUNT_ID, DEFAULT_GROUP_HISTORY_LIMIT, DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, DEFAULT_WEBHOOK_MAX_BODY_BYTES, DiscordConfigSchema, DmConfigSchema, DmPolicySchema, GROUP_POLICY_BLOCKED_LABEL, GoogleChatConfigSchema, GroupPolicySchema, IMessageConfigSchema, LineConfigSchema, MSTeamsConfigSchema, MarkdownConfigSchema, MarkdownTableModeSchema, PAIRING_APPROVED_MESSAGE, ReplyRuntimeConfigSchemaShape, RequestBodyLimitError, SILENT_REPLY_TOKEN, SignalConfigSchema, SlackConfigSchema, SsrFBlockedError, TelegramConfigSchema, ToolPolicySchema, TtsAutoSchema, TtsConfigSchema, TtsModeSchema, TtsProviderSchema, WhatsAppConfigSchema, acquireFileLock, addWildcardAllowFrom, applyAccountNameToChannelSection, approveDevicePairing, autoBindSpawnedDiscordSubagent, buildAgentMediaPayload, buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary, buildChannelConfigSchema, buildChannelKeyCandidates, buildMediaPayload, buildPendingHistoryContextFromMap, buildRandomTempFilePath, buildSlackThreadingToolContext, buildTokenChannelStatusSummary, checkSttCredentials, checkTtsCredentials, chunkTextForOutbound, clamp, clearHistoryEntries, clearHistoryEntriesIfEnabled, collectBlueBubblesStatusIssues, collectDiscordAuditChannelIds, collectDiscordStatusIssues, collectStatusIssuesFromLastError, collectTelegramStatusIssues, collectWhatsAppStatusIssues, createAccountListHelpers, createActionCard, createActionGate, createDedupeCache, createDefaultChannelRuntimeState, createImageCard, createInfoCard, createListCard, createLoggerBackedRuntime, createNormalizedOutboundDeliverer, createPersistentDedupe, createReceiptCard, createReplyPrefixContext, createReplyPrefixOptions, createTypingCallbacks, deleteAccountFromConfigSection, detectMime, discordOnboardingAdapter, emitDiagnosticEvent, emptyPluginConfigSchema, escapeRegExp, evaluateSenderGroupAccess, evictOldHistoryKeys, extensionForMime, extractOriginalFilename, extractSlackToolSend, extractToolSend, fetchWithSsrFGuard, formatAllowFromLowercase, formatAllowlistMatchMeta, formatDocsLink, formatErrorMessage, formatInboundFromLabel, formatLocationText, formatPairingApproveHint, formatTextWithAttachmentLinks, getChatChannelMeta, getFileExtension, handleSlackMessageAction, hasMarkdownToConvert, imessageOnboardingAdapter, installRequestBodyLimitGuard, isAllowedParsedChatSender, isBlockedHostname, isBlockedHostnameOrIp, isDangerousNameMatchingEnabled, isDiagnosticsEnabled, isNormalizedSenderAllowed, isPrivateIpAddress, isRequestBodyLimitError, isSilentReplyText, isTruthyEnvValue, isWSL2Sync, isWSLEnv, isWSLSync, isWhatsAppGroupJid, jsonResult, listDevicePairing, listDiscordAccountIds, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, listEnabledSlackAccounts, listIMessageAccountIds, listLineAccountIds, listSignalAccountIds, listSlackAccountIds, listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig, listSlackMessageActions, listTelegramAccountIds, listTelegramDirectoryGroupsFromConfig, listTelegramDirectoryPeersFromConfig, listThreadBindingsBySessionKey, listWhatsAppAccountIds, listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig, loadWebMedia, logAckFailure, logInboundDrop, logTypingFailure, looksLikeDiscordTargetId, looksLikeIMessageTargetId, looksLikeSignalTargetId, looksLikeSlackTargetId, looksLikeTelegramTargetId, looksLikeWhatsAppTargetId, mergeAllowFromEntries, mergeAllowlist, migrateBaseNameToDefaultAccount, missingTargetError, normalizeAccountId, normalizeAllowFrom, normalizeChannelSlug, normalizeDiscordMessagingTarget, normalizeDiscordOutboundTarget, normalizeE164, normalizeIMessageMessagingTarget, normalizeAccountId$1 as normalizeLineAccountId, normalizeOutboundReplyPayload, normalizePluginHttpPath, normalizeSignalMessagingTarget, normalizeSlackMessagingTarget, normalizeTelegramMessagingTarget, normalizeWebhookPath, normalizeWhatsAppAllowFromEntries, normalizeWhatsAppMessagingTarget, normalizeWhatsAppTarget, onDiagnosticEvent, optionalStringEnum, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow, parseTelegramReplyToMessageId, parseTelegramThreadId, processLineMessage, promptAccountId, promptChannelAccessConfig, rawDataToString, readJsonBodyWithLimit, readJsonFileWithFallback, readNumberParam, readReactionParams, readRequestBodyWithLimit, readStringParam, recordInboundSession, recordPendingHistoryEntry, recordPendingHistoryEntryIfEnabled, redactSensitiveText, registerLogTransport, registerPluginHttpRoute, registerWebhookTarget, rejectDevicePairing, rejectNonPostWebhookRequest, removeAckReactionAfterReply, requestBodyErrorToText, requireOpenAllowFrom, resetMissingProviderGroupPolicyFallbackWarningsForTesting, resolveAckReaction, resolveAllowlistMatchSimple, resolveAllowlistProviderRuntimeGroupPolicy, resolveBlueBubblesGroupRequireMention, resolveBlueBubblesGroupToolPolicy, resolveChannelAccountConfigBasePath, resolveChannelEntryMatch, resolveChannelEntryMatchWithFallback, resolveChannelGroupPolicy, resolveChannelMediaMaxBytes, resolveControlCommandGate, resolveDefaultDiscordAccountId, resolveDefaultGroupPolicy, resolveDefaultIMessageAccountId, resolveDefaultLineAccountId, resolveDefaultSignalAccountId, resolveDefaultSlackAccountId, resolveDefaultTelegramAccountId, resolveDefaultWhatsAppAccountId, resolveDiscordAccount, resolveDiscordGroupRequireMention, resolveDiscordGroupToolPolicy, resolveDmAllowState, resolveDmGroupAccessDecision, resolveEffectiveAllowFromLists, resolveGatewayBindUrl, resolveGoogleChatGroupRequireMention, resolveGoogleChatGroupToolPolicy, resolveIMessageAccount, resolveIMessageGroupRequireMention, resolveIMessageGroupToolPolicy, resolveLineAccount, resolveMentionGating, resolveMentionGatingWithBypass, resolveNestedAllowlistDecision, resolveOpenProviderRuntimeGroupPolicy, resolveOutboundMediaUrls, resolvePreferredRemoteClawTmpDir, resolveRuntimeGroupPolicy, resolveSenderCommandAuthorization, resolveServicePrefixedAllowTarget, resolveServicePrefixedTarget, resolveSignalAccount, resolveSingleWebhookTarget, resolveSingleWebhookTargetAsync, resolveSlackAccount, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackReplyToMode, resolveTailnetHostWithRunner, resolveTelegramAccount, resolveTelegramGroupRequireMention, resolveTelegramGroupToolPolicy, resolveThreadSessionKeys, resolveToolsBySender, resolveWebhookPath, resolveWebhookTargets, resolveWhatsAppAccount, resolveWhatsAppGroupIntroHint, resolveWhatsAppGroupRequireMention, resolveWhatsAppGroupToolPolicy, resolveWhatsAppHeartbeatRecipients, resolveWhatsAppMentionStripPatterns, resolveWhatsAppOutboundTarget, runPluginCommandWithTimeout, safeParseJson, sendMediaWithLeadingCaption, setAccountEnabledInConfigSection, shouldAckReaction, shouldAckReactionForWhatsApp, signalOnboardingAdapter, slackOnboardingAdapter, sleep, stringEnum, stripAnsi, stripMarkdown, summarizeMapping, telegramOnboardingAdapter, toLocationContext, unbindThreadBindingsBySessionKey, validateVoiceCredentials, warnMissingProviderGroupPolicyFallbackOnce, whatsappOnboardingAdapter, withFileLock, withTempDownloadPath, writeJsonFileAtomically };
|