remoteclaw 0.1.0-next.2abd2fa → 0.1.0-next.2e9a6cd
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 +9 -7
- package/dist/accounts-A8jZK_v9.js +272 -0
- package/dist/accounts-BegPt5VR.js +36 -0
- package/dist/accounts-BmiimLpP.js +47 -0
- package/dist/accounts-Bomfgw0M.js +32 -0
- package/dist/accounts-Bpk-loA6.js +47 -0
- package/dist/accounts-DAdUdbPk.js +36 -0
- package/dist/accounts-WYyfAiie.js +270 -0
- package/dist/ack-reactions-CMDRj7fJ.js +446 -0
- package/dist/ack-reactions-D7VScSny.js +446 -0
- package/dist/acp-cli-BpMS0SsZ.js +1323 -0
- package/dist/acp-cli-DkXTlCpF.js +1317 -0
- package/dist/active-listener--FT8ewxl.js +37 -0
- package/dist/active-listener-C1StcdIA.js +37 -0
- package/dist/agent-C76P7tEr.js +703 -0
- package/dist/agent-helpers-CK3Obbsi.js +400 -0
- package/dist/agent-helpers-KHUla1K7.js +400 -0
- package/dist/agent-scope-BrDeaWWf.js +116 -0
- package/dist/agent-scope-DxqtYjuJ.js +114 -0
- package/dist/agent-ue8p9AIv.js +704 -0
- package/dist/agents--24oKN80.js +788 -0
- package/dist/agents.config-CWAUoPzG.js +116 -0
- package/dist/agents.config-Ck45E_ce.js +116 -0
- package/dist/audio-B85HoT7E.js +43 -0
- package/dist/audio-BbCUzndz.js +43 -0
- package/dist/audio-preflight-B3f0x3zu.js +69 -0
- package/dist/audio-preflight-Dv76vFTu.js +64 -0
- package/dist/audit-BAbBf2MU.js +3149 -0
- package/dist/audit-g55SYz1m.js +3149 -0
- package/dist/auth-Bq44qPUd.js +448 -0
- package/dist/auth-CVfoI--S.js +281 -0
- package/dist/auth-DTWpZJ1a.js +279 -0
- package/dist/auth-VItd2pwK.js +448 -0
- package/dist/banner-CyPQJybO.js +294 -0
- package/dist/binaries-DbgLoSWv.js +13 -0
- package/dist/bindings-6KojDoIi.js +69 -0
- package/dist/bindings-B6icMMUx.js +69 -0
- package/dist/bonjour-discovery-CQU4QbLK.js +378 -0
- package/dist/bonjour-discovery-D8aOnk3M.js +378 -0
- package/dist/boot/handler.js +42 -69
- package/dist/browser-cli-BH41geGr.js +1693 -0
- package/dist/browser-cli-u4nrjp1h.js +1688 -0
- package/dist/build-info.json +3 -3
- package/dist/call-CMDcRlGW.js +2826 -0
- package/dist/call-D5YKTYSM.js +2827 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/catalog-CUY_iTaG.js +185 -0
- package/dist/catalog-p6W09S2j.js +185 -0
- package/dist/channel-account-context-CA2m93Kt.js +550 -0
- package/dist/channel-account-context-Las-t6RP.js +550 -0
- package/dist/channel-activity-BD603ehL.js +94 -0
- package/dist/channel-activity-CwiF_QMr.js +94 -0
- package/dist/channel-activity-daCpxHdT.js +292 -0
- package/dist/channel-options-CAlClffy.js +33 -0
- package/dist/channel-options-Hl_ep3UG.js +32 -0
- package/dist/channel-selection-CHJ7TumC.js +51 -0
- package/dist/channel-selection-DR7eW8UG.js +51 -0
- package/dist/channel-web-B79j9fSC.js +2134 -0
- package/dist/channel-web-DHTTcipm.js +2136 -0
- package/dist/channels-cli-DeZ95hcx.js +1427 -0
- package/dist/channels-cli-eUCi6jXk.js +1422 -0
- package/dist/channels-status-issues-By77REbh.js +18 -0
- package/dist/channels-status-issues-DXyOO-KH.js +18 -0
- package/dist/chat-envelope-BEDutlnF.js +248 -0
- package/dist/chat-envelope-vJJUdDE7.js +248 -0
- package/dist/chrome-BuAi16Rq.js +1732 -0
- package/dist/chrome-IR-2ukph.js +1733 -0
- package/dist/chunk-C1mQSjas.js +341 -0
- package/dist/chunk-D7VX4pmT.js +341 -0
- package/dist/clack-prompter-BX8SVxtP.js +122 -0
- package/dist/clack-prompter-D6HhVlZW.js +121 -0
- package/dist/cleanup-utils-DNd0wdKZ.js +94 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-CK4Y43rx.js +131 -0
- package/dist/cli-Cha5Uk29.js +126 -0
- package/dist/clipboard-Cbj3McM_.js +31 -0
- package/dist/clipboard-Ne8gaWea.js +31 -0
- package/dist/command-format-D0vKipG9.js +32 -0
- package/dist/command-format-KkslAzwV.js +18 -0
- package/dist/command-logger/handler.js +3 -3
- package/dist/command-registry-07zlvSN8.js +215 -0
- package/dist/commands-DChC3pIF.js +41 -0
- package/dist/commands-DFHMoQgH.js +41 -0
- package/dist/commands-registry-BN04GIlJ.js +891 -0
- package/dist/commands-registry-DbS9NHeX.js +892 -0
- package/dist/common-DHHHAcmR.js +156 -0
- package/dist/common-De-Lakuh.js +156 -0
- package/dist/completion-cli--Jcg794c.js +452 -0
- package/dist/completion-cli-B8n7umme.js +452 -0
- package/dist/config-BupC6eiJ.js +4223 -0
- package/dist/config-CHDaGquZ.js +4225 -0
- package/dist/config-cli-Cu79BThx.js +242 -0
- package/dist/config-cli-DrJtiyW-.js +247 -0
- package/dist/config-guard-BLsqW1qt.js +98 -0
- package/dist/config-guard-NQ7jaYM4.js +75 -0
- package/dist/config-validation-BLllMW0t.js +18 -0
- package/dist/config-validation-DT29VEco.js +18 -0
- package/dist/configure-B25UEQnQ.js +889 -0
- package/dist/configure-CqMUE4Zw.js +891 -0
- package/dist/constants-BbAEYzFC.js +70 -0
- package/dist/constants-tLOgmZZ1.js +70 -0
- package/dist/control-auth-BFbDXKLK.js +397 -0
- package/dist/control-auth-BiiO-FNy.js +397 -0
- package/dist/control-ui/assets/index-CuY3pfh1.js +7716 -0
- package/dist/control-ui/assets/index-CuY3pfh1.js.map +1 -0
- package/dist/control-ui/assets/index-D_fjkN3g.css +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui-assets-BlpSXjlT.js +186 -0
- package/dist/control-ui-assets-eJU2-yvs.js +186 -0
- package/dist/conversation-label-Bn5j3lUT.js +36 -0
- package/dist/conversation-label-L0QTtKji.js +36 -0
- package/dist/cron-cli-BV1o0UgM.js +491 -0
- package/dist/cron-cli-C8j-P8GF.js +496 -0
- package/dist/daemon-cli-BDvU0Xv6.js +1199 -0
- package/dist/daemon-cli-CoNl2Ugf.js +1197 -0
- package/dist/daemon-cli.js +53 -97
- package/dist/daemon-install-BMEnzWwq.js +60 -0
- package/dist/daemon-install-BkUJbdPC.js +55 -0
- package/dist/daemon-install-helpers-B9kMxC1v.js +462 -0
- package/dist/daemon-install-helpers-DoYR5z4H.js +462 -0
- package/dist/deliver-D8P9_nk-.js +481 -0
- package/dist/deliver-F9ed3dhp.js +481 -0
- package/dist/delivery-queue-B6TuHppj.js +244 -0
- package/dist/delivery-queue-BZc3AiGu.js +244 -0
- package/dist/devices-cli-DZgxMNLD.js +322 -0
- package/dist/devices-cli-DlG9ehK0.js +317 -0
- package/dist/diagnostics-CK2HGAFw.js +46 -0
- package/dist/diagnostics-G-C-IuxO.js +46 -0
- package/dist/directory-cli-CY6tHRIZ.js +218 -0
- package/dist/directory-cli-HyvRJ1Ua.js +223 -0
- package/dist/dm-policy-shared-1FdjwGtJ.js +22 -0
- package/dist/dm-policy-shared-CT3er5HI.js +22 -0
- package/dist/dns-cli-Cu-wYvll.js +203 -0
- package/dist/dns-cli-DQdnNJh4.js +198 -0
- package/dist/dock-D038fZZl.js +929 -0
- package/dist/dock-D5pZ3a44.js +928 -0
- package/dist/doctor-completion-BrHnayfU.js +92 -0
- package/dist/doctor-completion-CoZP2KiR.js +92 -0
- package/dist/doctor-config-flow-DJ1nWCTZ.js +1935 -0
- package/dist/doctor-config-flow-DYhXUwEq.js +1934 -0
- package/dist/enable-B5dIjgnm.js +59 -0
- package/dist/enable-FmiEY4ng.js +59 -0
- package/dist/entry.js +14 -16
- package/dist/env-DUb5GiQe.js +60 -0
- package/dist/env-vars-C8WMB8Ix.js +93 -0
- package/dist/errors-CdmXrBic.js +35 -0
- package/dist/errors-DdLfwEVi.js +35 -0
- package/dist/exec-BhkXWg7V.js +164 -0
- package/dist/exec-ClUTXFZ9.js +164 -0
- package/dist/export-html/template.css +0 -36
- package/dist/export-html/template.js +1 -32
- package/dist/extensionAPI.js +1015 -142
- package/dist/fetch-CCuD0LYV.js +67 -0
- package/dist/fetch-JBWLkOpL.js +67 -0
- package/dist/fetch-oku6r8tJ.js +67 -0
- package/dist/file-lock-6NXMPZTT.js +107 -0
- package/dist/file-lock-Ks-RPU6W.js +107 -0
- package/dist/fs-safe-93aDW4mH.js +98 -0
- package/dist/fs-safe-ACrBwOF5.js +88 -0
- package/dist/gateway-cli-CJs4Mxlv.js +23730 -0
- package/dist/gateway-cli-gUVR20v7.js +23725 -0
- package/dist/gateway-rpc-CSdrtPzg.js +28 -0
- package/dist/gateway-rpc-PNA_wUoe.js +28 -0
- package/dist/gmail-setup-utils-DNZEf6T0.js +422 -0
- package/dist/gmail-setup-utils-KPAKWwGy.js +423 -0
- package/dist/health-BCidscV-.js +1417 -0
- package/dist/health-Cw2dr19V.js +1414 -0
- package/dist/health-format-DOhfU1rY.js +28 -0
- package/dist/heartbeat-visibility-C5Vxudi9.js +125 -0
- package/dist/heartbeat-visibility-DHeZ-ko1.js +125 -0
- package/dist/help-format-Ch0EWh7N.js +17 -0
- package/dist/helpers-B4NWktS8.js +10 -0
- package/dist/hook-runner-global-Vj-YQxeR.js +527 -0
- package/dist/hooks-cli---vy0V0j.js +1218 -0
- package/dist/hooks-cli-CX-JUHdJ.js +1223 -0
- package/dist/image-ops-DMl7j7f4.js +354 -0
- package/dist/image-ops-DpkTOzhI.js +354 -0
- package/dist/import-DIjlFm_Y.js +493 -0
- package/dist/import-DdQvVR-_.js +495 -0
- package/dist/inbound-context-CmmmT8IP.js +68 -0
- package/dist/inbound-context-oxIWzEgc.js +68 -0
- package/dist/inbound-path-policy-BdmTOUka.js +90 -0
- package/dist/inbound-path-policy-DYTLjca8.js +90 -0
- package/dist/index.js +106 -105
- package/dist/inspect-C9d1V-lI.js +559 -0
- package/dist/inspect-rHjRqr3W.js +559 -0
- package/dist/installs-QUjSL2ZA.js +325 -0
- package/dist/installs-vT5wnxC4.js +325 -0
- package/dist/ipv4-DdcyK1aU.js +46 -0
- package/dist/ipv4-OHvujh00.js +46 -0
- package/dist/ir-CnMQRFBu.js +940 -0
- package/dist/json-files-BiA_B-xm.js +46 -0
- package/dist/links-CIHbVNO_.js +15 -0
- package/dist/loader-CYigLbch.js +22404 -0
- package/dist/loader-ElWX62xE.js +22401 -0
- package/dist/local-roots-B0QcJDJI.js +313 -0
- package/dist/local-roots-BfXsZRkm.js +314 -0
- package/dist/logger-BtwpYD7c.js +49 -0
- package/dist/logging-CLc3Umm0.js +20 -0
- package/dist/login-C8jHYLxN.js +61 -0
- package/dist/login-D__FYZX9.js +62 -0
- package/dist/login-qr-C0Gd6ybl.js +323 -0
- package/dist/login-qr-D7dw54Yp.js +328 -0
- package/dist/logs-cli-CFOVARdJ.js +234 -0
- package/dist/logs-cli-DtAR__VH.js +239 -0
- package/dist/markdown-tables-ChBqQA_Q.js +29 -0
- package/dist/markdown-tables-xMuH3QnS.js +29 -0
- package/dist/media-CmiNXiOZ.js +10453 -0
- package/dist/media-DYopaoc0.js +940 -0
- package/dist/message-action-names-CACBi-HB.js +2521 -0
- package/dist/message-action-names-CFwlz01T.js +2521 -0
- package/dist/message-channel-DF4I2vOK.js +91 -0
- package/dist/net-COL170MG.js +225 -0
- package/dist/net-QZ8IHNXc.js +225 -0
- package/dist/node-cli-CW8jOcHO.js +24 -0
- package/dist/nodes-cli-B4lvU9N5.js +1349 -0
- package/dist/nodes-cli-B8iTBsI6.js +1344 -0
- package/dist/nodes-screen-CZCXHrWB.js +250 -0
- package/dist/nodes-screen-C_K1vcS5.js +250 -0
- package/dist/note-BVerR3D5.js +92 -0
- package/dist/note-Dk8-EaJg.js +92 -0
- package/dist/npm-registry-spec-Dma0KHft.js +786 -0
- package/dist/npm-registry-spec-vYkxZb6u.js +786 -0
- package/dist/npm-resolution-CcZYnzrL.js +86 -0
- package/dist/npm-resolution-DsATEEGx.js +86 -0
- package/dist/onboard-Csm4bDd_.js +438 -0
- package/dist/onboard-D1b535pC.js +436 -0
- package/dist/onboard-channels-5EIXyDZh.js +2547 -0
- package/dist/onboard-channels-bedB47Hs.js +2548 -0
- package/dist/onboard-config-CcPV3Cqz.js +39 -0
- package/dist/onboard-config-DcTaxmuf.js +39 -0
- package/dist/onboard-helpers-BHNXyhA4.js +364 -0
- package/dist/onboard-helpers-eTUU00t8.js +363 -0
- package/dist/onboard-remote-DwDKQk1K.js +127 -0
- package/dist/onboard-remote-TPbiye5m.js +127 -0
- package/dist/onboarding-D0YGZ_Ux.js +588 -0
- package/dist/onboarding-DCfmKzl2.js +586 -0
- package/dist/onboarding.finalize-BhpsVwME.js +399 -0
- package/dist/onboarding.finalize-CY8vgmi9.js +402 -0
- package/dist/onboarding.gateway-config-C_eqpJ7D.js +192 -0
- package/dist/onboarding.gateway-config-DR1ey6tU.js +199 -0
- package/dist/outbound-Be4BgVqF.js +220 -0
- package/dist/outbound-CXJLn8kn.js +221 -0
- package/dist/outbound-attachment-CbNLn0lk.js +18 -0
- package/dist/outbound-attachment-DNCMF74c.js +18 -0
- package/dist/outbound-attachment-DaStRTGv.js +18 -0
- package/dist/pairing-cli-CxGDUsLT.js +128 -0
- package/dist/pairing-cli-D83T3PG9.js +123 -0
- package/dist/pairing-labels-6f8FqSS5.js +9 -0
- package/dist/pairing-labels-CI5j-OUT.js +9 -0
- package/dist/pairing-store-DnTHRcnO.js +459 -0
- package/dist/pairing-store-ONzqxcNb.js +460 -0
- package/dist/path-env-D7VB7sOO.js +89 -0
- package/dist/path-env-DFiYvvI-.js +89 -0
- package/dist/path-safety-BshBsw4P.js +14 -0
- package/dist/path-safety-CZbhQciI.js +14 -0
- package/dist/plugin-auto-enable-BnCQKkIK.js +302 -0
- package/dist/plugin-auto-enable-CFRs-pcA.js +301 -0
- package/dist/plugin-registry-CV5pfXOU.js +33 -0
- package/dist/plugin-registry-CmG34W0u.js +33 -0
- package/dist/plugin-sdk/agents/agent-helpers.d.ts +0 -1
- package/dist/plugin-sdk/agents/agent-scope.d.ts +10 -0
- package/dist/plugin-sdk/agents/agent-types.d.ts +1 -6
- package/dist/plugin-sdk/agents/agent-utils.d.ts +0 -14
- package/dist/plugin-sdk/agents/provider-utils.d.ts +0 -1
- package/dist/plugin-sdk/agents/subagent-spawn.d.ts +0 -1
- package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +0 -1
- package/dist/plugin-sdk/auth/constants.d.ts +16 -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 +41 -0
- package/dist/plugin-sdk/auth/index.d.ts +8 -0
- package/dist/plugin-sdk/auth/oauth.d.ts +14 -0
- package/dist/plugin-sdk/auth/provider-auth.d.ts +40 -0
- package/dist/plugin-sdk/auth/session-override.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +0 -2
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +1 -7
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +1 -7
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +3 -15
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -5
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +1 -5
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +1 -5
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +1 -3
- package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +4 -6
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +0 -7
- package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +0 -10
- package/dist/plugin-sdk/auto-reply/reply.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/status.d.ts +2 -6
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +0 -11
- package/dist/plugin-sdk/auto-reply/types.d.ts +1 -2
- package/dist/plugin-sdk/commands/agent/session.d.ts +1 -2
- package/dist/plugin-sdk/config/defaults.d.ts +0 -1
- package/dist/plugin-sdk/config/sessions/types.d.ts +0 -8
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +28 -112
- package/dist/plugin-sdk/config/types.agents.d.ts +8 -0
- package/dist/plugin-sdk/config/types.messages.d.ts +1 -2
- package/dist/plugin-sdk/config/types.tools.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +9 -66
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +5 -13
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +12 -76
- package/dist/plugin-sdk/config/zod-schema.d.ts +12 -76
- package/dist/plugin-sdk/daemon/constants.d.ts +2 -2
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +1 -3
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +0 -2
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +0 -2
- package/dist/plugin-sdk/index.js +108 -134
- package/dist/plugin-sdk/middleware/auth-key-retry.d.ts +32 -0
- package/dist/plugin-sdk/middleware/channel-bridge.d.ts +4 -0
- package/dist/plugin-sdk/middleware/error-classifier.d.ts +5 -0
- package/dist/plugin-sdk/middleware/media-resolver.d.ts +12 -0
- package/dist/plugin-sdk/middleware/runtime-factory.d.ts +42 -0
- package/dist/plugin-sdk/middleware/types.d.ts +33 -1
- package/dist/plugin-sdk/plugins/types.d.ts +1 -1
- package/dist/plugin-sdk/terminal/palette.d.ts +2 -2
- package/dist/plugins-B4waLB_f.js +453 -0
- package/dist/plugins-D6-JJ1il.js +455 -0
- package/dist/plugins-cli-DG2zHgdP.js +799 -0
- package/dist/plugins-cli-DZvQzkWd.js +794 -0
- package/dist/ports-BcTKFlWl.js +96 -0
- package/dist/ports-DAc2AlZE.js +316 -0
- package/dist/ports-HiuYk3bt.js +96 -0
- package/dist/ports-dEePqmCq.js +370 -0
- package/dist/program-CX-EtQ9W.js +245 -0
- package/dist/program-context-R3wsjl2f.js +474 -0
- package/dist/progress-DQ1drugY.js +124 -0
- package/dist/prompt-edYTUtju.js +21 -0
- package/dist/prompt-select-styled-BzL7v1zQ.js +1647 -0
- package/dist/prompt-select-styled-g5q4srtu.js +1650 -0
- package/dist/prompt-style-CYEpbwXH.js +9 -0
- package/dist/provider-dispatcher-D7qFGoUR.js +660 -0
- package/dist/provider-dispatcher-dB_rm6tV.js +659 -0
- package/dist/push-apns-DQwR-i4_.js +713 -0
- package/dist/push-apns-Dj5RApCY.js +711 -0
- package/dist/pw-ai-DOQMJFB-.js +1911 -0
- package/dist/pw-ai-oqtYDmjQ.js +1907 -0
- package/dist/qr-cli-CBGm_Cik.js +353 -0
- package/dist/qr-cli-D2jZPdW9.js +348 -0
- package/dist/redact-gXuh8MFk.js +191 -0
- package/dist/redact-snapshot-B-2V56Yb.js +2016 -0
- package/dist/redact-snapshot-CD36XSYE.js +2016 -0
- package/dist/register.agent-DLSuiqWE.js +287 -0
- package/dist/register.agent-DcvEt3hG.js +1044 -0
- package/dist/register.configure-3edoYZai.js +131 -0
- package/dist/register.configure-CyOJCmnY.js +125 -0
- package/dist/register.import-Cku0T-PA.js +31 -0
- package/dist/register.import-Dr8TiUVx.js +28 -0
- package/dist/register.maintenance-5aaPQbJk.js +495 -0
- package/dist/register.maintenance-DPSswZDJ.js +498 -0
- package/dist/register.message-BaSVFv92.js +682 -0
- package/dist/register.message-FEI0RiNN.js +687 -0
- package/dist/register.onboard-CO1UZL-9.js +258 -0
- package/dist/register.onboard-DuLKxjXl.js +263 -0
- package/dist/register.setup-CFYYd_Ev.js +115 -0
- package/dist/register.setup-P0UHDBMS.js +110 -0
- package/dist/register.status-health-sessions-D_3vm2yw.js +424 -0
- package/dist/register.status-health-sessions-z9x79dmg.js +665 -0
- package/dist/register.subclis-B-d970d6.js +267 -0
- package/dist/replies-BvarRpHb.js +136 -0
- package/dist/replies-CSzm5168.js +136 -0
- package/dist/reply-CTgksTO1.js +13695 -0
- package/dist/reply-CUyafs4J.js +13692 -0
- package/dist/reply-directives-Caq4zVTg.js +182 -0
- package/dist/reply-directives-D91fapDF.js +182 -0
- package/dist/reply-payloads-te0YnESs.js +527 -0
- package/dist/reply-prefix-Bv8Mv9q8.js +37 -0
- package/dist/reply-prefix-Rk_UEaJa.js +37 -0
- package/dist/resolve-route-BPa6q23t.js +249 -0
- package/dist/resolve-route-CN9BEALz.js +249 -0
- package/dist/response-prefix-template-D-ptXREi.js +134 -0
- package/dist/response-prefix-template-Dckjdftg.js +134 -0
- package/dist/retry-BcZuGfnV.js +77 -0
- package/dist/retry-BzWBtFpP.js +77 -0
- package/dist/run-main-BugUkGES.js +303 -0
- package/dist/runner-CVMXkHe9.js +2295 -0
- package/dist/runner-DOWTBU0-.js +2295 -0
- package/dist/runtime-guard-CXt4yzo-.js +60 -0
- package/dist/secure-random-CBwDBdj1.js +44 -0
- package/dist/security-cli-BQzdzJUp.js +479 -0
- package/dist/security-cli-D2d8RvsT.js +485 -0
- package/dist/send-B3G3I3II.js +349 -0
- package/dist/send-B6IB6ELR.js +547 -0
- package/dist/send-BT8XEvZB.js +332 -0
- package/dist/send-BTupAHVX.js +2245 -0
- package/dist/send-BZCfto_I.js +1174 -0
- package/dist/send-C5EDjThR.js +492 -0
- package/dist/send-CBM54hgN.js +349 -0
- package/dist/send-CPBd6ItT.js +29 -0
- package/dist/send-CzYm7ULP.js +2245 -0
- package/dist/send-D2m_x8xM.js +374 -0
- package/dist/send-DmEBPE2S.js +1779 -0
- package/dist/send-Dt4iCx61.js +426 -0
- package/dist/send-MWjpLHEV.js +11 -0
- package/dist/send-qpwqt34s.js +547 -0
- package/dist/send-rW25uKNz.js +1776 -0
- package/dist/send-uqa6CNuP.js +492 -0
- package/dist/server-BhmYVCED.js +201 -0
- package/dist/server-DaUw1o2B.js +206 -0
- package/dist/server-lifecycle-BeZsBQwF.js +2437 -0
- package/dist/server-lifecycle-C2F1_TE2.js +2437 -0
- package/dist/server-node-events-DoRFbKCT.js +390 -0
- package/dist/server-node-events-jbbbt-4R.js +395 -0
- package/dist/service-BDt-zUvV.js +670 -0
- package/dist/service-Os7W1F2S.js +670 -0
- package/dist/session-B9KGKVrY.js +170 -0
- package/dist/session-DzAupDyj.js +170 -0
- package/dist/session-cost-usage-BYCI739a.js +627 -0
- package/dist/session-cost-usage-DGsPcuMj.js +627 -0
- package/dist/session-dirs-BIg5RHAh.js +947 -0
- package/dist/session-dirs-DwDxjK1p.js +947 -0
- package/dist/session-utils-BgWDCbyx.js +622 -0
- package/dist/session-utils-CxxOeC1M.js +622 -0
- package/dist/sessions-Bwu0l_CG.js +2569 -0
- package/dist/sessions-CiuFFCnt.js +247 -0
- package/dist/shell-env-CsV_IkJj.js +163 -0
- package/dist/shell-env-hZW9j-Uc.js +163 -0
- package/dist/ssrf-B-rF_tZB.js +183 -0
- package/dist/ssrf-D6fl_7ww.js +183 -0
- package/dist/status-BOFm7iyj.js +2065 -0
- package/dist/status-RI2y_M21.js +2061 -0
- package/dist/status.update-DbO7izip.js +79 -0
- package/dist/status.update-wXyvcztI.js +79 -0
- package/dist/store-BLGrRL_E.js +64 -0
- package/dist/store-BYhcsOLr.js +64 -0
- package/dist/store-Dv76bGHg.js +2571 -0
- package/dist/store-Dw93tSB-.js +53 -0
- package/dist/subagent-registry-DWL-tayF.js +4856 -0
- package/dist/subagent-registry-HjR1tO3-.js +4854 -0
- package/dist/subsystem-BCkt9Ocb.js +1079 -0
- package/dist/subsystem-BgxIzx7w.js +1137 -0
- package/dist/system-cli-DtrDDmCt.js +71 -0
- package/dist/system-cli-xDr_Yyaa.js +76 -0
- package/dist/systemd-BlbIQ1PV.js +547 -0
- package/dist/systemd-DzXePo7r.js +547 -0
- package/dist/systemd-linger-mLbBF4pa.js +75 -0
- package/dist/systemd-linger-qlGGW2JB.js +75 -0
- package/dist/table-V_9n7CjP.js +279 -0
- package/dist/tables-Cy3gObW7.js +55 -0
- package/dist/tables-DAuk-Y6F.js +55 -0
- package/dist/tables-DRh09aPZ.js +55 -0
- package/dist/tailnet-BoTa0e2q.js +40 -0
- package/dist/tailnet-Cy0Q27lj.js +40 -0
- package/dist/tailscale-CiWkh0vS.js +230 -0
- package/dist/tailscale-Driw3j8E.js +230 -0
- package/dist/targets-3hewwPvM.js +120 -0
- package/dist/targets-Bkw_co-B.js +220 -0
- package/dist/targets-C1Tt0ZWd.js +2406 -0
- package/dist/targets-CsrqF2M4.js +650 -0
- package/dist/targets-DKriCISG.js +53 -0
- package/dist/targets-DTM2OPnS.js +650 -0
- package/dist/targets-DhhaK2xG.js +53 -0
- package/dist/targets-tDrl_ioQ.js +46 -0
- package/dist/targets-yq1kGK1_.js +2407 -0
- package/dist/thinking-XA5P_zFw.js +88 -0
- package/dist/thinking-l-rrvZwu.js +88 -0
- package/dist/tokens-7ZtWRjA3.js +21 -0
- package/dist/tool-display-AxpSXZVq.js +785 -0
- package/dist/tool-display-D6GD-41Y.js +785 -0
- package/dist/tool-images-D16vIWPg.js +263 -0
- package/dist/tool-images-IVIZ29ID.js +263 -0
- package/dist/trash--8b4GDyV.js +125 -0
- package/dist/trash-ivbG2QWV.js +125 -0
- package/dist/tui-Cbe1EW-B.js +3319 -0
- package/dist/tui-Dj3XrTCV.js +3319 -0
- package/dist/tui-cli-EGqEcdfE.js +64 -0
- package/dist/tui-cli-KKmqnNs2.js +59 -0
- package/dist/update-DruVguh4.js +349 -0
- package/dist/update-cli-C5tdQeGG.js +1371 -0
- package/dist/update-cli-Canq11sh.js +1374 -0
- package/dist/update-y8nz-3OC.js +349 -0
- package/dist/usage-CAuX4vsd.js +5384 -0
- package/dist/utils-C5daYcFn.js +631 -0
- package/dist/web-B9gR_cGR.js +3071 -0
- package/dist/web-DZ8ahrhK.js +77 -0
- package/dist/web-DkYPsnyd.js +71 -0
- package/dist/webhooks-cli-DFqGwW1f.js +329 -0
- package/dist/webhooks-cli-y-E-q0Xo.js +334 -0
- package/dist/whatsapp-actions-BXIe-Uei.js +123 -0
- package/dist/whatsapp-actions-BictxOCB.js +129 -0
- package/dist/widearea-dns-fHQt5-Q3.js +127 -0
- package/dist/workspace-DvbSDgO_.js +449 -0
- package/dist/workspace-zLfKNRwR.js +447 -0
- package/dist/zod-schema-B9RGngMW.js +2696 -0
- package/dist/zod-schema-D3hQ5SKe.js +2696 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +0 -24
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +0 -1
- package/package.json +3 -3
- 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-DBohBlww.js +0 -32
- package/dist/accounts-DqRQ75w3.js +0 -36
- package/dist/accounts-iODF3SK2.js +0 -47
- package/dist/ack-reactions-B11TAC2D.js +0 -446
- package/dist/ack-reactions-BWVjL4H6.js +0 -446
- package/dist/acp-cli-CA1xMmVo.js +0 -1320
- package/dist/acp-cli-CGo6fJVZ.js +0 -1326
- package/dist/active-listener-VzhWW8W6.js +0 -37
- package/dist/active-listener-z0qVEcom.js +0 -37
- package/dist/agent-CTizRPIJ.js +0 -732
- package/dist/agent-D2RVoS5g.js +0 -731
- package/dist/agent-helpers-B6VfZ9_u.js +0 -606
- package/dist/agent-helpers-CTx5KKJu.js +0 -606
- package/dist/agent-scope-BGYzhtWQ.js +0 -121
- package/dist/agent-scope-C50VuLKh.js +0 -119
- package/dist/agents-BuYn-obw.js +0 -788
- package/dist/agents.config-BSTxuTVd.js +0 -116
- package/dist/agents.config-p3V3b9u6.js +0 -116
- package/dist/audio-DPOuhNq7.js +0 -43
- package/dist/audio-VBcVDa08.js +0 -43
- package/dist/audio-preflight-BwmCYeuM.js +0 -64
- package/dist/audio-preflight-co8gjlPX.js +0 -69
- package/dist/audit-oH4urD3G.js +0 -3138
- package/dist/audit-qgtCT3ik.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-Cf978khN.js +0 -294
- package/dist/binaries-DXW6oATV.js +0 -13
- package/dist/bindings-CRU_udk8.js +0 -69
- package/dist/bindings-DQZAu8Wv.js +0 -69
- package/dist/bonjour-discovery-DdAk1VyO.js +0 -378
- package/dist/bonjour-discovery-DuhiIZZx.js +0 -378
- package/dist/browser-cli-CZC4h5V4.js +0 -1687
- package/dist/browser-cli-DAgi_aQk.js +0 -1692
- package/dist/call-BbwtB9Y-.js +0 -2828
- package/dist/call-PivL7Uex.js +0 -2829
- package/dist/catalog-BqO6yem_.js +0 -185
- package/dist/catalog-DFmaYwfk.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-C-G4n9BK.js +0 -292
- package/dist/channel-activity-DTKGf3j5.js +0 -94
- package/dist/channel-options-Cyappik_.js +0 -32
- package/dist/channel-options-DFnypY5S.js +0 -33
- package/dist/channel-selection-BGl53D5K.js +0 -51
- package/dist/channel-selection-NNPbxnyZ.js +0 -51
- package/dist/channel-web-DmhVkWbP.js +0 -2134
- package/dist/channel-web-kRC3UYBJ.js +0 -2136
- package/dist/channels-cli-C5XRkPJl.js +0 -1421
- package/dist/channels-cli-D6TqCI0m.js +0 -1426
- package/dist/channels-status-issues-CUc9mpeW.js +0 -18
- package/dist/channels-status-issues-DwRDzwrV.js +0 -18
- package/dist/chat-envelope-DEZ-5RY8.js +0 -248
- package/dist/chat-envelope-el7Uo-Fe.js +0 -248
- package/dist/chrome-0QaGKb3L.js +0 -1732
- package/dist/chrome-CFeWdP0Y.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-BR2J3c4l.js +0 -125
- package/dist/cli-C1q1vSmN.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-CYjvOp8W.js +0 -215
- package/dist/commands-CDonBOrw.js +0 -41
- package/dist/commands-D_-bgTlO.js +0 -41
- package/dist/commands-registry-CWJv6xe2.js +0 -892
- package/dist/commands-registry-Ci8_cFk9.js +0 -893
- package/dist/common-CMI-qsF8.js +0 -156
- package/dist/common-DSVmydhm.js +0 -156
- package/dist/completion-cli-8iZJqfmX.js +0 -452
- package/dist/completion-cli-CYDjEZSt.js +0 -452
- package/dist/config-D5XU45KD.js +0 -6953
- package/dist/config-FHu9Bn4R.js +0 -6951
- package/dist/config-cli-Gehy4sav.js +0 -241
- package/dist/config-cli-RC9qMgJq.js +0 -246
- package/dist/config-guard-J-Q_DFWk.js +0 -97
- package/dist/config-guard-cB5a_ANg.js +0 -75
- package/dist/config-validation-BPNyd9_3.js +0 -18
- package/dist/config-validation-BPWuvhVe.js +0 -18
- package/dist/configure-CC2XdRRm.js +0 -891
- package/dist/configure-DxFBJuhZ.js +0 -889
- package/dist/constants-BmRFoHl0.js +0 -67
- package/dist/constants-C9WPAluB.js +0 -67
- package/dist/control-auth-D0tpV3ts.js +0 -397
- package/dist/control-auth-_-0PGRUs.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-BzERxhr5.js +0 -495
- package/dist/cron-cli-C8j_uslU.js +0 -490
- package/dist/daemon-cli-C95XNbX0.js +0 -1199
- package/dist/daemon-cli-e6sURMqd.js +0 -1197
- 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-912khjLK.js +0 -481
- package/dist/deliver-D56J4-1F.js +0 -481
- package/dist/delivery-queue-Cfa9Wmxp.js +0 -244
- package/dist/delivery-queue-CxVRi4tw.js +0 -244
- package/dist/devices-cli-0qDhTgZR.js +0 -316
- package/dist/devices-cli-6SKMR2bV.js +0 -321
- package/dist/diagnostics-99iCgBUh.js +0 -46
- package/dist/diagnostics-VC0cz7kX.js +0 -46
- package/dist/directory-cli-5YXdoVdn.js +0 -217
- package/dist/directory-cli-D3IKCHmn.js +0 -222
- package/dist/dm-policy-shared-4rkjhcrM.js +0 -22
- package/dist/dm-policy-shared-D8lgnmrC.js +0 -22
- package/dist/dns-cli-11CtErVU.js +0 -197
- package/dist/dns-cli-SiEd_1Lq.js +0 -202
- package/dist/dock-BqNINg7k.js +0 -928
- package/dist/dock-CQuu41bw.js +0 -929
- package/dist/doctor-completion-BR1SlAT3.js +0 -92
- package/dist/doctor-completion-CZwpEhIK.js +0 -92
- package/dist/doctor-config-flow-BVkHcvoj.js +0 -1933
- package/dist/doctor-config-flow-DVYRn0An.js +0 -1934
- 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/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-BFSBLBkA.js +0 -67
- package/dist/fetch-C6XKGA11.js +0 -67
- package/dist/fetch-CEDsOiql.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-BEEZhCHv.js +0 -23747
- package/dist/gateway-cli-Nob0g_4y.js +0 -23742
- package/dist/gateway-rpc-CksB-N83.js +0 -28
- package/dist/gateway-rpc-Dq44SkOv.js +0 -28
- package/dist/gmail-setup-utils-Cnx8A5pW.js +0 -422
- package/dist/gmail-setup-utils-nkabbKOE.js +0 -423
- package/dist/health-RT-F3hzT.js +0 -1423
- package/dist/health-SOuaKNRa.js +0 -1420
- package/dist/health-format-BG95OE6N.js +0 -28
- package/dist/heartbeat-visibility-BxkZjE5m.js +0 -125
- package/dist/heartbeat-visibility-CGG-G7px.js +0 -125
- package/dist/help-format-DAxf0l_h.js +0 -17
- package/dist/helpers-kkeXif0Q.js +0 -10
- package/dist/hook-runner-global-DJ14gXFP.js +0 -527
- package/dist/hooks-cli-DyEKryW8.js +0 -1217
- package/dist/hooks-cli-RuEn0-oy.js +0 -1222
- 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-aM5dWAyn.js +0 -325
- package/dist/installs-pWdqG8HL.js +0 -325
- package/dist/ipv4--2WXMVtE.js +0 -46
- package/dist/ipv4-CDQpx1A7.js +0 -46
- package/dist/ir-BpaAMTfW.js +0 -940
- package/dist/json-files-DzpTak5i.js +0 -46
- package/dist/links-C3soDNDH.js +0 -15
- package/dist/loader-Ccwsh8Sh.js +0 -22624
- package/dist/loader-y9MhJewT.js +0 -22621
- package/dist/local-roots-BrH0Q63K.js +0 -313
- package/dist/local-roots-nImrw2WR.js +0 -314
- package/dist/logger-Bw3cFE5t.js +0 -49
- package/dist/logging-C-nxX2fn.js +0 -20
- package/dist/login-C_Kt57nO.js +0 -62
- package/dist/login-DOmWDMeP.js +0 -61
- package/dist/login-qr-CXU0wC5K.js +0 -322
- package/dist/login-qr-D0u6fdeO.js +0 -327
- package/dist/logs-cli-CschwP4d.js +0 -238
- package/dist/logs-cli-D7ayUvz_.js +0 -233
- package/dist/markdown-tables-CrmghPAr.js +0 -29
- package/dist/markdown-tables-jrnSPvZ6.js +0 -29
- package/dist/media-CojxZ45J.js +0 -10492
- package/dist/media-DN7yRfrH.js +0 -940
- package/dist/message-action-names-CtEZcmlU.js +0 -2521
- package/dist/message-action-names-WglOO_DT.js +0 -2521
- package/dist/message-channel-DzJqHVZD.js +0 -91
- package/dist/net-Cg8AQeke.js +0 -225
- package/dist/net-D6D0wgcF.js +0 -225
- package/dist/node-cli-Q2-n3Fgv.js +0 -24
- package/dist/nodes-cli-C2SoKfCv.js +0 -1343
- package/dist/nodes-cli-CQmlfx0K.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-6v_Zm-9G.js +0 -86
- package/dist/npm-resolution-BFz7LeoN.js +0 -86
- package/dist/onboard-CgyU-mDL.js +0 -407
- package/dist/onboard-RI4vNTZd.js +0 -405
- package/dist/onboard-channels-DN5JoKPd.js +0 -2548
- package/dist/onboard-channels-DyAd1OZr.js +0 -2547
- package/dist/onboard-config-BCTthQ7J.js +0 -24
- package/dist/onboard-config-y-2cgT0V.js +0 -24
- package/dist/onboard-helpers-BCzZUD0z.js +0 -363
- package/dist/onboard-helpers-sDc2Ky6H.js +0 -362
- package/dist/onboard-remote-CJrMtttl.js +0 -127
- package/dist/onboard-remote-hyQIBguz.js +0 -127
- package/dist/onboarding-DCu1iBTV.js +0 -541
- package/dist/onboarding-zKMitzpb.js +0 -543
- package/dist/onboarding.finalize-ClHhYE2E.js +0 -401
- package/dist/onboarding.finalize-D5JkVJgg.js +0 -398
- package/dist/onboarding.gateway-config-DFh71Ndn.js +0 -198
- package/dist/onboarding.gateway-config-VBk6AP9U.js +0 -191
- package/dist/outbound-BYlZshIw.js +0 -221
- package/dist/outbound-CFfJC1j5.js +0 -220
- package/dist/outbound-attachment-BCNs1u1F.js +0 -18
- package/dist/outbound-attachment-B_0D60Yr.js +0 -18
- package/dist/outbound-attachment-o0seS0CP.js +0 -18
- package/dist/pairing-cli-BeydfoF9.js +0 -122
- package/dist/pairing-cli-DWzX866x.js +0 -127
- package/dist/pairing-labels-B-N8S5Fc.js +0 -9
- package/dist/pairing-labels-B_53dY5L.js +0 -9
- package/dist/pairing-store-BxdqFZGK.js +0 -460
- package/dist/pairing-store-CTkD51uW.js +0 -459
- package/dist/path-env-DR5vn3QL.js +0 -89
- package/dist/path-env-qRJbjJzj.js +0 -89
- package/dist/path-safety-DkT9RmTG.js +0 -14
- package/dist/path-safety-juI2XbO1.js +0 -14
- package/dist/plugin-auto-enable-D23gv7Aw.js +0 -302
- package/dist/plugin-auto-enable-DuPS9XiJ.js +0 -301
- package/dist/plugin-registry-CNu_1KZz.js +0 -33
- package/dist/plugin-registry-DeHwd2jk.js +0 -33
- package/dist/plugin-sdk/agents/agent-helpers/thinking.d.ts +0 -5
- 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/session-override.d.ts +0 -18
- package/dist/plugin-sdk/agents/auth-profiles.d.ts +0 -8
- package/dist/plugin-sdk/agents/defaults.d.ts +0 -3
- package/dist/plugin-sdk/agents/provider-auth.d.ts +0 -40
- package/dist/plugin-sdk/auto-reply/model-runtime.d.ts +0 -17
- package/dist/plugin-sdk/config/model-input.d.ts +0 -9
- package/dist/plugin-sdk/config/zod-schema.agent-model.d.ts +0 -5
- package/dist/plugin-sdk/sessions/model-overrides.d.ts +0 -14
- package/dist/plugin-sdk/telegram/reasoning-lane-coordinator.d.ts +0 -18
- package/dist/plugins-BflZz0sp.js +0 -453
- package/dist/plugins-cli-DV82scUw.js +0 -798
- package/dist/plugins-cli-Qj1UyIZO.js +0 -793
- package/dist/plugins-woGRXMzU.js +0 -455
- 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-CQmIaRUI.js +0 -244
- package/dist/program-context-DEU6ACnL.js +0 -474
- package/dist/progress-CBkSaM6z.js +0 -124
- package/dist/prompt-Bllj1dhc.js +0 -21
- package/dist/prompt-select-styled-BhTN6zE2.js +0 -1650
- package/dist/prompt-select-styled-WopXnjIy.js +0 -1647
- package/dist/prompt-style-DVEm3BZW.js +0 -9
- package/dist/provider-dispatcher-B4QMe-I6.js +0 -659
- package/dist/provider-dispatcher-Bfauw6zz.js +0 -660
- package/dist/push-apns-C0LyG-WB.js +0 -713
- package/dist/push-apns-DuG95AKC.js +0 -711
- package/dist/pw-ai-D9n6-Wa6.js +0 -1906
- package/dist/pw-ai-T280E6Mn.js +0 -1910
- package/dist/qr-cli-DVECWTHN.js +0 -352
- package/dist/qr-cli-hSLixZCe.js +0 -347
- package/dist/redact-eZq1uwNK.js +0 -191
- package/dist/redact-snapshot-BZYLIqe-.js +0 -2028
- package/dist/redact-snapshot-C6hVx_9I.js +0 -2028
- package/dist/register.agent-Dmj-sgEl.js +0 -1043
- package/dist/register.agent-IspcBFeD.js +0 -286
- package/dist/register.configure-BqJEqyGL.js +0 -130
- package/dist/register.configure-PPkU_4Ea.js +0 -124
- package/dist/register.import-Bs-UkOs-.js +0 -27
- package/dist/register.import-DLng8g-e.js +0 -30
- package/dist/register.maintenance-BbpkJil3.js +0 -497
- package/dist/register.maintenance-C5nkOQxa.js +0 -494
- package/dist/register.message-C83Hi1b3.js +0 -681
- package/dist/register.message-D16isu4u.js +0 -686
- package/dist/register.onboard-B8EzX3wY.js +0 -257
- package/dist/register.onboard-CyRbr_0V.js +0 -262
- package/dist/register.setup-DWyoowAz.js +0 -109
- package/dist/register.setup-Dz6GwMnu.js +0 -114
- package/dist/register.status-health-sessions-CbQOfycz.js +0 -423
- package/dist/register.status-health-sessions-DXIWG47y.js +0 -669
- package/dist/register.subclis-DeGP5UPU.js +0 -267
- package/dist/replies-BKrzM0QI.js +0 -136
- package/dist/replies-Cl2gYBVt.js +0 -136
- package/dist/reply-CCu_DY64.js +0 -13900
- package/dist/reply-DSKC8kyS.js +0 -13897
- package/dist/reply-directives-BHJKp1Du.js +0 -182
- package/dist/reply-directives-CD2WycBM.js +0 -182
- package/dist/reply-payloads-D_BM1Anb.js +0 -527
- package/dist/reply-prefix-DBLCYiup.js +0 -38
- package/dist/reply-prefix-Q4DOJSn_.js +0 -38
- package/dist/resolve-route-CBVbY0xS.js +0 -249
- package/dist/resolve-route-DGEgTEif.js +0 -249
- package/dist/response-prefix-template-rVZQOViK.js +0 -136
- package/dist/response-prefix-template-up4REfuR.js +0 -136
- package/dist/retry-BhuXOEVR.js +0 -77
- package/dist/retry-DUjAzOBy.js +0 -77
- package/dist/run-main-Um5xhxla.js +0 -320
- package/dist/runner-yVJ4HB2K.js +0 -2294
- package/dist/runner-z92MWZ3m.js +0 -2294
- package/dist/runtime-guard-DZ_xuCc4.js +0 -60
- package/dist/secure-random-Pl9rPl0l.js +0 -44
- package/dist/security-cli-CdwbWZUj.js +0 -484
- package/dist/security-cli-DP5QJpa5.js +0 -478
- package/dist/send-B1_Ymjb9.js +0 -1778
- package/dist/send-B84axiIa.js +0 -29
- package/dist/send-BN_zYVlx.js +0 -547
- package/dist/send-BqVOxAmK.js +0 -1174
- package/dist/send-Bx9bUGav.js +0 -492
- package/dist/send-C3pdJ6p-.js +0 -2245
- package/dist/send-CBGSXjfD.js +0 -2245
- package/dist/send-CGXyTF22.js +0 -426
- package/dist/send-CKavrhXj.js +0 -11
- package/dist/send-D08Je6DL.js +0 -374
- package/dist/send-D1aYEG-k.js +0 -332
- package/dist/send-DHldI3gf.js +0 -492
- package/dist/send-D_DUQJ6H.js +0 -349
- package/dist/send-Ds63eF4a.js +0 -349
- package/dist/send-YRVDWfSs.js +0 -547
- package/dist/send-xnwty9cY.js +0 -1775
- package/dist/server-BQFoyCRR.js +0 -200
- package/dist/server-DhXw25Jq.js +0 -205
- package/dist/server-lifecycle-BjCCyD3w.js +0 -2437
- package/dist/server-lifecycle-Coyr6Lda.js +0 -2437
- package/dist/server-node-events-De4WZQQD.js +0 -393
- package/dist/server-node-events-dXXayuqY.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-CEtEq6bi.js +0 -625
- package/dist/session-utils-WmlWAs1r.js +0 -625
- package/dist/session-xKIW6gL2.js +0 -170
- package/dist/sessions--PykPynp.js +0 -2593
- package/dist/sessions-Bw4LRnSr.js +0 -252
- package/dist/ssrf-Ck9HDZpv.js +0 -183
- package/dist/ssrf-m7kFIobZ.js +0 -183
- package/dist/status-CtzYFLLF.js +0 -2072
- package/dist/status-DiN1cq2p.js +0 -2068
- package/dist/status.update-C55QM2xs.js +0 -79
- package/dist/status.update-CBmPXwYN.js +0 -79
- package/dist/store-C3tOpizT.js +0 -64
- package/dist/store-CPJXuhvQ.js +0 -53
- package/dist/store-SusmIfz7.js +0 -2595
- package/dist/store-v3P-OWhi.js +0 -64
- package/dist/subagent-registry-Db4Ho_2Y.js +0 -4858
- package/dist/subagent-registry-Du_j0Fnt.js +0 -4860
- package/dist/subsystem-BUXAJwPD.js +0 -1079
- package/dist/subsystem-COd61u0P.js +0 -1139
- package/dist/system-cli-DYCpLO3T.js +0 -75
- package/dist/system-cli-eAk5wVbP.js +0 -70
- 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-DI5LGEr1.js +0 -55
- package/dist/tables-PxcSPSO0.js +0 -55
- package/dist/tables-TWiml6b1.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-C1NeMn2J.js +0 -220
- package/dist/targets-CcTME3bp.js +0 -46
- package/dist/targets-CmC5m7Ey.js +0 -53
- package/dist/targets-D-u6Kyio.js +0 -650
- package/dist/targets-D7OKVXMI.js +0 -650
- package/dist/targets-DB4vBpIQ.js +0 -2172
- package/dist/targets-DfqPGOmM.js +0 -2173
- package/dist/targets-DyybKefq.js +0 -53
- package/dist/targets-JCISV-hS.js +0 -120
- 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-CHc0EfJO.js +0 -3392
- package/dist/tui-CyHwc2uX.js +0 -3392
- package/dist/tui-cli-BvwbrIYO.js +0 -63
- package/dist/tui-cli-C9I18SfW.js +0 -58
- package/dist/update-DxyjwCL2.js +0 -349
- package/dist/update-IX7vdqA8.js +0 -349
- package/dist/update-cli-CBeXUSzq.js +0 -1373
- package/dist/update-cli-DkAWmUrp.js +0 -1370
- package/dist/usage-CYlQW4M2.js +0 -5279
- package/dist/utils-LBKvDoPx.js +0 -631
- package/dist/web-BUYUdnRH.js +0 -3065
- package/dist/web-Dquzwqf4.js +0 -70
- package/dist/web-tS8diboh.js +0 -76
- package/dist/webhooks-cli-B7Vw3CMz.js +0 -333
- package/dist/webhooks-cli-BpZHQlVd.js +0 -328
- package/dist/whatsapp-actions-D5HXezjp.js +0 -128
- package/dist/whatsapp-actions-DaA291Ya.js +0 -122
- package/dist/widearea-dns-DSoaA-eH.js +0 -127
- package/dist/workspace-B4ZvVYT9.js +0 -447
- package/dist/workspace-B8PA8oxJ.js +0 -449
- /package/dist/{account-lookup-0KDSp5Mj.js → account-lookup-BOCzCnir.js} +0 -0
- /package/dist/{account-lookup-zvANGr2x.js → account-lookup-DGscKBsr.js} +0 -0
- /package/dist/{ansi-D04X81yq.js → ansi-aRwLYlzD.js} +0 -0
- /package/dist/{api-BeQMq2iS.js → api-BDff51CS.js} +0 -0
- /package/dist/{api-CxX8-gGz.js → api-qWSMsT8m.js} +0 -0
- /package/dist/{argv-Co-b9Zsc.js → argv-neJY_Hxm.js} +0 -0
- /package/dist/{brew-C4zKZsHX.js → brew-ByYl36Mt.js} +0 -0
- /package/dist/{brew-DbSbN8sD.js → brew-CMSQ5Fek.js} +0 -0
- /package/dist/{chat-type-CYPyHAj-.js → chat-type-BKe459rw.js} +0 -0
- /package/dist/{chat-type-DKb2TlGZ.js → chat-type-DyovJwCt.js} +0 -0
- /package/dist/{cleanup-utils-CwQvD73q.js → cleanup-utils-S_P5Jebv.js} +0 -0
- /package/dist/{cli-name-BicfmwQX.js → cli-name-CRLBidNP.js} +0 -0
- /package/dist/{cli-name-C6rJGl18.js → cli-name-Yv30OygA.js} +0 -0
- /package/dist/{cli-utils-BhXbz2UF.js → cli-utils-C5nQDfa6.js} +0 -0
- /package/dist/{cli-utils-DZe_rVkZ.js → cli-utils-KcEwAsuZ.js} +0 -0
- /package/dist/{client-C61M8zI3.js → client-C7B0uFB0.js} +0 -0
- /package/dist/{client-DdpmATKq.js → client-Cd2HNUX0.js} +0 -0
- /package/dist/{command-options-C4paWSGf.js → command-options-1bi44p_B.js} +0 -0
- /package/dist/{command-options-CA30lfLK.js → command-options-7y5Zrv4M.js} +0 -0
- /package/dist/{config-eval-CjGZtLwx.js → config-eval-CJtk3Msr.js} +0 -0
- /package/dist/{config-eval-H_wlEYIG.js → config-eval-DQIwdWg7.js} +0 -0
- /package/dist/{constants-ChptG3d7.js → constants--3PuQVaS.js} +0 -0
- /package/dist/{constants-DY6b-_Wl.js → constants-DNWjlxZ5.js} +0 -0
- /package/dist/{credentials-BHWUBHMd.js → credentials-BhnauW0K.js} +0 -0
- /package/dist/{credentials-DFsi1_e8.js → credentials-eZcqWNG_.js} +0 -0
- /package/dist/{daemon-runtime-CMnbwryP.js → daemon-runtime-99xh1fGv.js} +0 -0
- /package/dist/{daemon-runtime-CvqE4ysg.js → daemon-runtime-BOcdJaFy.js} +0 -0
- /package/dist/{dangerous-name-matching-BzmiLXmA.js → dangerous-name-matching-YeatnYIA.js} +0 -0
- /package/dist/{dangerous-name-matching-DaVRgwer.js → dangerous-name-matching-oVb1EqYT.js} +0 -0
- /package/dist/{dangerous-tools-BOLoCRv4.js → dangerous-tools-BMt8-6jE.js} +0 -0
- /package/dist/{dangerous-tools-Baq7Q-i6.js → dangerous-tools-CripTfYv.js} +0 -0
- /package/dist/{fetch-timeout-DTIN7CGM.js → fetch-timeout-Db3da8yR.js} +0 -0
- /package/dist/{fetch-timeout-DoySHqfO.js → fetch-timeout-l_6RdoMw.js} +0 -0
- /package/dist/{file-identity-BxlKD8Ys.js → file-identity-Bs9zZOi2.js} +0 -0
- /package/dist/{format-duration-CqUERz51.js → format-duration-Bo-Mxi3E.js} +0 -0
- /package/dist/{format-duration-Ct-yiwkS.js → format-duration-CfrJ5T8k.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-8cNYQsqb.js} +0 -0
- /package/dist/{format-relative-CxLpEQOX.js → format-relative-CZOlQ2pA.js} +0 -0
- /package/dist/{health-format-B_QRD8Si.js → health-format-WMRp1BbP.js} +0 -0
- /package/dist/{heartbeat-wake-LGEgcXjs.js → heartbeat-wake-BtRrOB-t.js} +0 -0
- /package/dist/{heartbeat-wake-Y97geucO.js → heartbeat-wake-eRINROYK.js} +0 -0
- /package/dist/{help-format-NNm_Ov4H.js → help-format-BEb0SPHF.js} +0 -0
- /package/dist/{helpers-BAsMXprO.js → helpers-BJtPtu_2.js} +0 -0
- /package/dist/{helpers-DLgbkcEn.js → helpers-Cj6f8SPZ.js} +0 -0
- /package/dist/{helpers-R7bU5IBz.js → helpers-ryxLx-aM.js} +0 -0
- /package/dist/{host-env-security-szwfmhC4.js → host-env-security-CbiODGvQ.js} +0 -0
- /package/dist/{input-provenance-Bn6thJNm.js → input-provenance-CPhdY-0F.js} +0 -0
- /package/dist/{input-provenance-xUsSMOsz.js → input-provenance-DUNEQoFM.js} +0 -0
- /package/dist/{ip-C9q3Oq20.js → ip-BAhS4rY2.js} +0 -0
- /package/dist/{ip-D0zgNmBV.js → ip-BcdPcLiP.js} +0 -0
- /package/dist/{is-main-DN8-sNR5.js → is-main-KcWqINzy.js} +0 -0
- /package/dist/{json-file-ChO_R9yh.js → json-file-BVvmrQG3.js} +0 -0
- /package/dist/{json-file-B7l5-Xhr.js → json-file-Dbg7nZg1.js} +0 -0
- /package/dist/{json-files-CmpYSF4G.js → json-files-DSKEdz7x.js} +0 -0
- /package/dist/{lanes-ByWMUgrz.js → lanes-Brd-nf-Z.js} +0 -0
- /package/dist/{lanes-cHJ5arWg.js → lanes-COs3zODW.js} +0 -0
- /package/dist/{links-Bz4V7R_p.js → links-gse8sWn-.js} +0 -0
- /package/dist/{location-DBWCGNLq.js → location-D1FM_C63.js} +0 -0
- /package/dist/{location-GbZ0bBRU.js → location-LuzkqHGi.js} +0 -0
- /package/dist/{logger-DyL5G2DO.js → logger-BMP_j_Lx.js} +0 -0
- /package/dist/{logger-BWMPnILd.js → logger-DWbwXLjl.js} +0 -0
- /package/dist/{logger-GvipVDfh.js → logger-DXCDb7qu.js} +0 -0
- /package/dist/{logging-D8-Kozjc.js → logging-CAgCb3n3.js} +0 -0
- /package/dist/{message-channel-uWMAiywE.js → message-channel-D72Bc6Tb.js} +0 -0
- /package/dist/{mime-BS3jhcZE.js → mime-Cqg1jjia.js} +0 -0
- /package/dist/{mime-Cxh_64P6.js → mime-D4bQLMJL.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-NtI6s4TE.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-U5ThQr9V.js → mutable-allowlist-detectors-nAmo9v5u.js} +0 -0
- /package/dist/{node-cli-Uf6lAntf.js → node-cli-bNJbha3z.js} +0 -0
- /package/dist/{parse-log-line-enq8pduH.js → parse-log-line-BY9Vz72K.js} +0 -0
- /package/dist/{parse-log-line-mz9TG6ig.js → parse-log-line-BrrE4onI.js} +0 -0
- /package/dist/{parse-timeout-BMP8a0_a.js → parse-timeout-Dfyln-4M.js} +0 -0
- /package/dist/{path-guards-CIx4hURU.js → path-guards-D9LU0y9L.js} +0 -0
- /package/dist/{path-guards-CrQOUlsq.js → path-guards-crZaTVvq.js} +0 -0
- /package/dist/plugin-sdk/{agents → auth}/api-key-rotation.d.ts +0 -0
- /package/dist/plugin-sdk/{agents/auth-profiles → auth}/paths.d.ts +0 -0
- /package/dist/plugin-sdk/{agents/auth-profiles → auth}/profiles.d.ts +0 -0
- /package/dist/plugin-sdk/{agents/auth-profiles → auth}/store.d.ts +0 -0
- /package/dist/plugin-sdk/{agents/auth-profiles → auth}/types.d.ts +0 -0
- /package/dist/{plugins-allowlist-BbTQ5Z2k.js → plugins-allowlist-CD4oIJNk.js} +0 -0
- /package/dist/{plugins-allowlist-C20oaESO.js → plugins-allowlist-CUhk3GDh.js} +0 -0
- /package/dist/{polls-B0CCBDeR.js → polls-ChvH1OIW.js} +0 -0
- /package/dist/{polls-CwwHzYBM.js → polls-Dn1C2d1-.js} +0 -0
- /package/dist/{ports-lsof-Wteul3ju.js → ports-lsof-BDQWExpn.js} +0 -0
- /package/dist/{process-scoped-map-CV9kDvfG.js → process-scoped-map-BwUkYFQV.js} +0 -0
- /package/dist/{process-scoped-map-PEvnG75N.js → process-scoped-map-CBWcUvTa.js} +0 -0
- /package/dist/{program-context-jqeI5alP.js → program-context-DtsEOsdM.js} +0 -0
- /package/dist/{progress-C1kUfYL-.js → progress-BjGCAXH7.js} +0 -0
- /package/dist/{prompt-Yn2yClg1.js → prompt-FIISMuNm.js} +0 -0
- /package/dist/{prompt-style-DjEYC_s-.js → prompt-style-DL64_X-p.js} +0 -0
- /package/dist/{provider-utils-3JTMJroG.js → provider-utils-DiLhkKQp.js} +0 -0
- /package/dist/{proxy-DL3MD6-P.js → proxy-DUTF0OYE.js} +0 -0
- /package/dist/{proxy-DpNv2cSV.js → proxy-Dv0sbx6A.js} +0 -0
- /package/dist/{pw-ai-state-CGfLv6nV.js → pw-ai-state-DKhOTqDv.js} +0 -0
- /package/dist/{pw-ai-state-Dynx20hr.js → pw-ai-state-kkp06zyZ.js} +0 -0
- /package/dist/{redact-Dx1Fue21.js → redact-BTeK8lMZ.js} +0 -0
- /package/dist/{redact-identifier-BTIWtaa-.js → redact-identifier-F6t5pklx.js} +0 -0
- /package/dist/{redact-identifier-CAagcfWA.js → redact-identifier-VdOrq-IK.js} +0 -0
- /package/dist/{remoteclaw-root-C2HV2VeC.js → remoteclaw-root-DF8m3X4C.js} +0 -0
- /package/dist/{remoteclaw-root-DybYl8PL.js → remoteclaw-root-rJHOCwzo.js} +0 -0
- /package/dist/{render-CCLsW6Lz.js → render-e7fENCYH.js} +0 -0
- /package/dist/{render-uf6PvGMV.js → render-qcqmrHse.js} +0 -0
- /package/dist/{retry-DnqPAqWp.js → retry-CwZiwLDN.js} +0 -0
- /package/dist/{runtime-DJNp29jv.js → runtime-Ds3E9SqF.js} +0 -0
- /package/dist/{runtime-guard-U-ewY_QH.js → runtime-guard-CdJVmJc0.js} +0 -0
- /package/dist/{secret-equal-BbHdTtqY.js → secret-equal-CDUVxXmp.js} +0 -0
- /package/dist/{secret-equal-CXJEZiWb.js → secret-equal-d3sEnK98.js} +0 -0
- /package/dist/{secure-random-CS2mSdTn.js → secure-random-CJtykx_p.js} +0 -0
- /package/dist/{secure-random-_dzDDlFo.js → secure-random-y6N6Gted.js} +0 -0
- /package/dist/{session-key-5YLnn_qf.js → session-key-BF-9YzxC.js} +0 -0
- /package/dist/{stagger-BXv_apuy.js → stagger-B-_Wnofy.js} +0 -0
- /package/dist/{stagger-MI9gd2rQ.js → stagger-CjkdqPuN.js} +0 -0
- /package/dist/{status-BmtCS3T1.js → status-BFmH9Uge.js} +0 -0
- /package/dist/{status-BrwHRn2B.js → status-BIupzBh9.js} +0 -0
- /package/dist/{strip-inbound-meta-DjKcSFaW.js → strip-inbound-meta-BNXRYvmY.js} +0 -0
- /package/dist/{strip-inbound-meta-jy3bkUab.js → strip-inbound-meta-BtNFmc6V.js} +0 -0
- /package/dist/{table-C1rdyYl9.js → table-Au5EeKD6.js} +0 -0
- /package/dist/{target-errors-BDpPcwh5.js → target-errors-B6YON-5k.js} +0 -0
- /package/dist/{target-errors-DdIAPcMM.js → target-errors-sPHoHj73.js} +0 -0
- /package/dist/{targets-D-qLBpTA.js → targets-BtGRUQMa.js} +0 -0
- /package/dist/{targets-BMenhVHg.js → targets-D3r6Zgic.js} +0 -0
- /package/dist/{targets-C-2xwh9f.js → targets-DDdPVd12.js} +0 -0
- /package/dist/{targets-UncQvCVs.js → targets-Ds5eT_RZ.js} +0 -0
- /package/dist/{targets-D7PT_rdO.js → targets-DtvPW-B8.js} +0 -0
- /package/dist/{text-format-BQ3z_OXA.js → text-format-CFm4X8Ze.js} +0 -0
- /package/dist/{text-format-oWqzVmah.js → text-format-KHU3KzvQ.js} +0 -0
- /package/dist/{tokens-B-jmvNR9.js → tokens-BGw4xHhW.js} +0 -0
- /package/dist/{usage-BdhBT0Vz.js → usage-BEjWlD9A.js} +0 -0
- /package/dist/{usage-format-C3mNLfhI.js → usage-format-Cx3JveFn.js} +0 -0
- /package/dist/{usage-format-DAaPzr_z.js → usage-format-D-ZaYT_e.js} +0 -0
- /package/dist/{usage-BtQcAnf6.js → usage-o8O_TxA-.js} +0 -0
- /package/dist/{widearea-dns-CsmBVbez.js → widearea-dns-DUDYT3z2.js} +0 -0
- /package/dist/{workspace-BzPeZDew.js → workspace-9__vtmnA.js} +0 -0
- /package/dist/{wsl-B_sPlzWw.js → wsl-BLrG__iS.js} +0 -0
- /package/dist/{wsl-BCnYV9O0.js → wsl-C2dudsWt.js} +0 -0
|
@@ -0,0 +1,2696 @@
|
|
|
1
|
+
import { r as isValidInboundPathRootPattern } from "./inbound-path-policy-BdmTOUka.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/config/discord-preview-streaming.ts
|
|
6
|
+
function normalizeStreamingMode(value) {
|
|
7
|
+
if (typeof value !== "string") return null;
|
|
8
|
+
return value.trim().toLowerCase() || null;
|
|
9
|
+
}
|
|
10
|
+
function parseStreamingMode(value) {
|
|
11
|
+
const normalized = normalizeStreamingMode(value);
|
|
12
|
+
if (normalized === "off" || normalized === "partial" || normalized === "block" || normalized === "progress") return normalized;
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
function parseDiscordPreviewStreamMode(value) {
|
|
16
|
+
const parsed = parseStreamingMode(value);
|
|
17
|
+
if (!parsed) return null;
|
|
18
|
+
return parsed === "progress" ? "partial" : parsed;
|
|
19
|
+
}
|
|
20
|
+
function parseSlackLegacyDraftStreamMode(value) {
|
|
21
|
+
const normalized = normalizeStreamingMode(value);
|
|
22
|
+
if (normalized === "replace" || normalized === "status_final" || normalized === "append") return normalized;
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function mapSlackLegacyDraftStreamModeToStreaming(mode) {
|
|
26
|
+
if (mode === "append") return "block";
|
|
27
|
+
if (mode === "status_final") return "progress";
|
|
28
|
+
return "partial";
|
|
29
|
+
}
|
|
30
|
+
function mapStreamingModeToSlackLegacyDraftStreamMode(mode) {
|
|
31
|
+
if (mode === "block") return "append";
|
|
32
|
+
if (mode === "progress") return "status_final";
|
|
33
|
+
return "replace";
|
|
34
|
+
}
|
|
35
|
+
function resolveTelegramPreviewStreamMode(params = {}) {
|
|
36
|
+
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
37
|
+
if (parsedStreaming) {
|
|
38
|
+
if (parsedStreaming === "progress") return "partial";
|
|
39
|
+
return parsedStreaming;
|
|
40
|
+
}
|
|
41
|
+
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
42
|
+
if (legacy) return legacy;
|
|
43
|
+
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
44
|
+
return "off";
|
|
45
|
+
}
|
|
46
|
+
function resolveDiscordPreviewStreamMode(params = {}) {
|
|
47
|
+
const parsedStreaming = parseDiscordPreviewStreamMode(params.streaming);
|
|
48
|
+
if (parsedStreaming) return parsedStreaming;
|
|
49
|
+
const legacy = parseDiscordPreviewStreamMode(params.streamMode);
|
|
50
|
+
if (legacy) return legacy;
|
|
51
|
+
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
52
|
+
return "off";
|
|
53
|
+
}
|
|
54
|
+
function resolveSlackStreamingMode(params = {}) {
|
|
55
|
+
const parsedStreaming = parseStreamingMode(params.streaming);
|
|
56
|
+
if (parsedStreaming) return parsedStreaming;
|
|
57
|
+
const legacyStreamMode = parseSlackLegacyDraftStreamMode(params.streamMode);
|
|
58
|
+
if (legacyStreamMode) return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
|
|
59
|
+
if (typeof params.streaming === "boolean") return "partial";
|
|
60
|
+
return "partial";
|
|
61
|
+
}
|
|
62
|
+
function resolveSlackNativeStreaming(params = {}) {
|
|
63
|
+
if (typeof params.nativeStreaming === "boolean") return params.nativeStreaming;
|
|
64
|
+
if (typeof params.streaming === "boolean") return params.streaming;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/infra/safe-executable-value.ts
|
|
70
|
+
const SHELL_METACHARS = /[;&|`$<>]/;
|
|
71
|
+
const CONTROL_CHARS = /[\r\n]/;
|
|
72
|
+
const QUOTE_CHARS = /["']/;
|
|
73
|
+
const BARE_NAME_PATTERN = /^[A-Za-z0-9._+-]+$/;
|
|
74
|
+
function isLikelyPath(value) {
|
|
75
|
+
if (value.startsWith(".") || value.startsWith("~")) return true;
|
|
76
|
+
if (value.includes("/") || value.includes("\\")) return true;
|
|
77
|
+
return /^[A-Za-z]:[\\/]/.test(value);
|
|
78
|
+
}
|
|
79
|
+
function isSafeExecutableValue(value) {
|
|
80
|
+
if (!value) return false;
|
|
81
|
+
const trimmed = value.trim();
|
|
82
|
+
if (!trimmed) return false;
|
|
83
|
+
if (trimmed.includes("\0")) return false;
|
|
84
|
+
if (CONTROL_CHARS.test(trimmed)) return false;
|
|
85
|
+
if (SHELL_METACHARS.test(trimmed)) return false;
|
|
86
|
+
if (QUOTE_CHARS.test(trimmed)) return false;
|
|
87
|
+
if (isLikelyPath(trimmed)) return true;
|
|
88
|
+
if (trimmed.startsWith("-")) return false;
|
|
89
|
+
return BARE_NAME_PATTERN.test(trimmed);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/cli/parse-bytes.ts
|
|
94
|
+
const UNIT_MULTIPLIERS = {
|
|
95
|
+
b: 1,
|
|
96
|
+
kb: 1024,
|
|
97
|
+
k: 1024,
|
|
98
|
+
mb: 1024 ** 2,
|
|
99
|
+
m: 1024 ** 2,
|
|
100
|
+
gb: 1024 ** 3,
|
|
101
|
+
g: 1024 ** 3,
|
|
102
|
+
tb: 1024 ** 4,
|
|
103
|
+
t: 1024 ** 4
|
|
104
|
+
};
|
|
105
|
+
function parseByteSize(raw, opts) {
|
|
106
|
+
const trimmed = String(raw ?? "").trim().toLowerCase();
|
|
107
|
+
if (!trimmed) throw new Error("invalid byte size (empty)");
|
|
108
|
+
const m = /^(\d+(?:\.\d+)?)([a-z]+)?$/.exec(trimmed);
|
|
109
|
+
if (!m) throw new Error(`invalid byte size: ${raw}`);
|
|
110
|
+
const value = Number(m[1]);
|
|
111
|
+
if (!Number.isFinite(value) || value < 0) throw new Error(`invalid byte size: ${raw}`);
|
|
112
|
+
const multiplier = UNIT_MULTIPLIERS[(m[2] ?? opts?.defaultUnit ?? "b").toLowerCase()];
|
|
113
|
+
if (!multiplier) throw new Error(`invalid byte size unit: ${raw}`);
|
|
114
|
+
const bytes = Math.round(value * multiplier);
|
|
115
|
+
if (!Number.isFinite(bytes)) throw new Error(`invalid byte size: ${raw}`);
|
|
116
|
+
return bytes;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/cli/parse-duration.ts
|
|
121
|
+
const DURATION_MULTIPLIERS = {
|
|
122
|
+
ms: 1,
|
|
123
|
+
s: 1e3,
|
|
124
|
+
m: 6e4,
|
|
125
|
+
h: 36e5,
|
|
126
|
+
d: 864e5
|
|
127
|
+
};
|
|
128
|
+
function parseDurationMs(raw, opts) {
|
|
129
|
+
const trimmed = String(raw ?? "").trim().toLowerCase();
|
|
130
|
+
if (!trimmed) throw new Error("invalid duration (empty)");
|
|
131
|
+
const single = /^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/.exec(trimmed);
|
|
132
|
+
if (single) {
|
|
133
|
+
const value = Number(single[1]);
|
|
134
|
+
if (!Number.isFinite(value) || value < 0) throw new Error(`invalid duration: ${raw}`);
|
|
135
|
+
const unit = single[2] ?? opts?.defaultUnit ?? "ms";
|
|
136
|
+
const ms = Math.round(value * DURATION_MULTIPLIERS[unit]);
|
|
137
|
+
if (!Number.isFinite(ms)) throw new Error(`invalid duration: ${raw}`);
|
|
138
|
+
return ms;
|
|
139
|
+
}
|
|
140
|
+
let totalMs = 0;
|
|
141
|
+
let consumed = 0;
|
|
142
|
+
for (const match of trimmed.matchAll(/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g)) {
|
|
143
|
+
const [full, valueRaw, unitRaw] = match;
|
|
144
|
+
const index = match.index ?? -1;
|
|
145
|
+
if (!full || !valueRaw || !unitRaw || index < 0) throw new Error(`invalid duration: ${raw}`);
|
|
146
|
+
if (index !== consumed) throw new Error(`invalid duration: ${raw}`);
|
|
147
|
+
const value = Number(valueRaw);
|
|
148
|
+
if (!Number.isFinite(value) || value < 0) throw new Error(`invalid duration: ${raw}`);
|
|
149
|
+
const multiplier = DURATION_MULTIPLIERS[unitRaw];
|
|
150
|
+
if (!multiplier) throw new Error(`invalid duration: ${raw}`);
|
|
151
|
+
totalMs += value * multiplier;
|
|
152
|
+
consumed += full.length;
|
|
153
|
+
}
|
|
154
|
+
if (consumed !== trimmed.length || consumed === 0) throw new Error(`invalid duration: ${raw}`);
|
|
155
|
+
const ms = Math.round(totalMs);
|
|
156
|
+
if (!Number.isFinite(ms)) throw new Error(`invalid duration: ${raw}`);
|
|
157
|
+
return ms;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/config/zod-schema.allowdeny.ts
|
|
162
|
+
const AllowDenyActionSchema = z.union([z.literal("allow"), z.literal("deny")]);
|
|
163
|
+
const AllowDenyChatTypeSchema = z.union([
|
|
164
|
+
z.literal("direct"),
|
|
165
|
+
z.literal("group"),
|
|
166
|
+
z.literal("channel"),
|
|
167
|
+
z.literal("dm")
|
|
168
|
+
]).optional();
|
|
169
|
+
function createAllowDenyChannelRulesSchema() {
|
|
170
|
+
return z.object({
|
|
171
|
+
default: AllowDenyActionSchema.optional(),
|
|
172
|
+
rules: z.array(z.object({
|
|
173
|
+
action: AllowDenyActionSchema,
|
|
174
|
+
match: z.object({
|
|
175
|
+
channel: z.string().optional(),
|
|
176
|
+
chatType: AllowDenyChatTypeSchema,
|
|
177
|
+
keyPrefix: z.string().optional(),
|
|
178
|
+
rawKeyPrefix: z.string().optional()
|
|
179
|
+
}).strict().optional()
|
|
180
|
+
}).strict()).optional()
|
|
181
|
+
}).strict().optional();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/config/zod-schema.sensitive.ts
|
|
186
|
+
const sensitive = z.registry();
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/config/zod-schema.core.ts
|
|
190
|
+
const GroupChatSchema = z.object({
|
|
191
|
+
mentionPatterns: z.array(z.string()).optional(),
|
|
192
|
+
historyLimit: z.number().int().positive().optional()
|
|
193
|
+
}).strict().optional();
|
|
194
|
+
const DmConfigSchema = z.object({ historyLimit: z.number().int().min(0).optional() }).strict();
|
|
195
|
+
const IdentitySchema = z.object({
|
|
196
|
+
name: z.string().optional(),
|
|
197
|
+
theme: z.string().optional(),
|
|
198
|
+
emoji: z.string().optional(),
|
|
199
|
+
avatar: z.string().optional()
|
|
200
|
+
}).strict().optional();
|
|
201
|
+
const QueueModeSchema = z.union([
|
|
202
|
+
z.literal("steer"),
|
|
203
|
+
z.literal("followup"),
|
|
204
|
+
z.literal("collect"),
|
|
205
|
+
z.literal("steer-backlog"),
|
|
206
|
+
z.literal("steer+backlog"),
|
|
207
|
+
z.literal("queue"),
|
|
208
|
+
z.literal("interrupt")
|
|
209
|
+
]);
|
|
210
|
+
const QueueDropSchema = z.union([
|
|
211
|
+
z.literal("old"),
|
|
212
|
+
z.literal("new"),
|
|
213
|
+
z.literal("summarize")
|
|
214
|
+
]);
|
|
215
|
+
const ReplyToModeSchema = z.union([
|
|
216
|
+
z.literal("off"),
|
|
217
|
+
z.literal("first"),
|
|
218
|
+
z.literal("all")
|
|
219
|
+
]);
|
|
220
|
+
const TypingModeSchema = z.union([
|
|
221
|
+
z.literal("never"),
|
|
222
|
+
z.literal("instant"),
|
|
223
|
+
z.literal("thinking"),
|
|
224
|
+
z.literal("message")
|
|
225
|
+
]);
|
|
226
|
+
const GroupPolicySchema = z.enum([
|
|
227
|
+
"open",
|
|
228
|
+
"disabled",
|
|
229
|
+
"allowlist"
|
|
230
|
+
]);
|
|
231
|
+
const DmPolicySchema = z.enum([
|
|
232
|
+
"pairing",
|
|
233
|
+
"allowlist",
|
|
234
|
+
"open",
|
|
235
|
+
"disabled"
|
|
236
|
+
]);
|
|
237
|
+
const BlockStreamingCoalesceSchema = z.object({
|
|
238
|
+
minChars: z.number().int().positive().optional(),
|
|
239
|
+
maxChars: z.number().int().positive().optional(),
|
|
240
|
+
idleMs: z.number().int().nonnegative().optional()
|
|
241
|
+
}).strict();
|
|
242
|
+
const ReplyRuntimeConfigSchemaShape = {
|
|
243
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
244
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
245
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
246
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
247
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
248
|
+
blockStreaming: z.boolean().optional(),
|
|
249
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
250
|
+
responsePrefix: z.string().optional(),
|
|
251
|
+
mediaMaxMb: z.number().positive().optional()
|
|
252
|
+
};
|
|
253
|
+
const BlockStreamingChunkSchema = z.object({
|
|
254
|
+
minChars: z.number().int().positive().optional(),
|
|
255
|
+
maxChars: z.number().int().positive().optional(),
|
|
256
|
+
breakPreference: z.union([
|
|
257
|
+
z.literal("paragraph"),
|
|
258
|
+
z.literal("newline"),
|
|
259
|
+
z.literal("sentence")
|
|
260
|
+
]).optional()
|
|
261
|
+
}).strict();
|
|
262
|
+
const MarkdownTableModeSchema = z.enum([
|
|
263
|
+
"off",
|
|
264
|
+
"bullets",
|
|
265
|
+
"code"
|
|
266
|
+
]);
|
|
267
|
+
const MarkdownConfigSchema = z.object({ tables: MarkdownTableModeSchema.optional() }).strict().optional();
|
|
268
|
+
const TtsProviderSchema = z.enum([
|
|
269
|
+
"elevenlabs",
|
|
270
|
+
"openai",
|
|
271
|
+
"edge"
|
|
272
|
+
]);
|
|
273
|
+
const TtsModeSchema = z.enum(["final", "all"]);
|
|
274
|
+
const TtsAutoSchema = z.enum([
|
|
275
|
+
"off",
|
|
276
|
+
"always",
|
|
277
|
+
"inbound",
|
|
278
|
+
"tagged"
|
|
279
|
+
]);
|
|
280
|
+
const TtsConfigSchema = z.object({
|
|
281
|
+
auto: TtsAutoSchema.optional(),
|
|
282
|
+
enabled: z.boolean().optional(),
|
|
283
|
+
mode: TtsModeSchema.optional(),
|
|
284
|
+
provider: TtsProviderSchema.optional(),
|
|
285
|
+
summaryModel: z.string().optional(),
|
|
286
|
+
modelOverrides: z.object({
|
|
287
|
+
enabled: z.boolean().optional(),
|
|
288
|
+
allowText: z.boolean().optional(),
|
|
289
|
+
allowProvider: z.boolean().optional(),
|
|
290
|
+
allowVoice: z.boolean().optional(),
|
|
291
|
+
allowModelId: z.boolean().optional(),
|
|
292
|
+
allowVoiceSettings: z.boolean().optional(),
|
|
293
|
+
allowNormalization: z.boolean().optional(),
|
|
294
|
+
allowSeed: z.boolean().optional()
|
|
295
|
+
}).strict().optional(),
|
|
296
|
+
elevenlabs: z.object({
|
|
297
|
+
apiKey: z.string().optional().register(sensitive),
|
|
298
|
+
baseUrl: z.string().optional(),
|
|
299
|
+
voiceId: z.string().optional(),
|
|
300
|
+
modelId: z.string().optional(),
|
|
301
|
+
seed: z.number().int().min(0).max(4294967295).optional(),
|
|
302
|
+
applyTextNormalization: z.enum([
|
|
303
|
+
"auto",
|
|
304
|
+
"on",
|
|
305
|
+
"off"
|
|
306
|
+
]).optional(),
|
|
307
|
+
languageCode: z.string().optional(),
|
|
308
|
+
voiceSettings: z.object({
|
|
309
|
+
stability: z.number().min(0).max(1).optional(),
|
|
310
|
+
similarityBoost: z.number().min(0).max(1).optional(),
|
|
311
|
+
style: z.number().min(0).max(1).optional(),
|
|
312
|
+
useSpeakerBoost: z.boolean().optional(),
|
|
313
|
+
speed: z.number().min(.5).max(2).optional()
|
|
314
|
+
}).strict().optional()
|
|
315
|
+
}).strict().optional(),
|
|
316
|
+
openai: z.object({
|
|
317
|
+
apiKey: z.string().optional().register(sensitive),
|
|
318
|
+
model: z.string().optional(),
|
|
319
|
+
voice: z.string().optional()
|
|
320
|
+
}).strict().optional(),
|
|
321
|
+
edge: z.object({
|
|
322
|
+
enabled: z.boolean().optional(),
|
|
323
|
+
voice: z.string().optional(),
|
|
324
|
+
lang: z.string().optional(),
|
|
325
|
+
outputFormat: z.string().optional(),
|
|
326
|
+
pitch: z.string().optional(),
|
|
327
|
+
rate: z.string().optional(),
|
|
328
|
+
volume: z.string().optional(),
|
|
329
|
+
saveSubtitles: z.boolean().optional(),
|
|
330
|
+
proxy: z.string().optional(),
|
|
331
|
+
timeoutMs: z.number().int().min(1e3).max(12e4).optional()
|
|
332
|
+
}).strict().optional(),
|
|
333
|
+
prefsPath: z.string().optional(),
|
|
334
|
+
maxTextLength: z.number().int().min(1).optional(),
|
|
335
|
+
timeoutMs: z.number().int().min(1e3).max(12e4).optional()
|
|
336
|
+
}).strict().optional();
|
|
337
|
+
const HumanDelaySchema = z.object({
|
|
338
|
+
mode: z.union([
|
|
339
|
+
z.literal("off"),
|
|
340
|
+
z.literal("natural"),
|
|
341
|
+
z.literal("custom")
|
|
342
|
+
]).optional(),
|
|
343
|
+
minMs: z.number().int().nonnegative().optional(),
|
|
344
|
+
maxMs: z.number().int().nonnegative().optional()
|
|
345
|
+
}).strict();
|
|
346
|
+
const CliBackendWatchdogModeSchema = z.object({
|
|
347
|
+
noOutputTimeoutMs: z.number().int().min(1e3).optional(),
|
|
348
|
+
noOutputTimeoutRatio: z.number().min(.05).max(.95).optional(),
|
|
349
|
+
minMs: z.number().int().min(1e3).optional(),
|
|
350
|
+
maxMs: z.number().int().min(1e3).optional()
|
|
351
|
+
}).strict().optional();
|
|
352
|
+
const CliBackendSchema = z.object({
|
|
353
|
+
command: z.string(),
|
|
354
|
+
args: z.array(z.string()).optional(),
|
|
355
|
+
output: z.union([
|
|
356
|
+
z.literal("json"),
|
|
357
|
+
z.literal("text"),
|
|
358
|
+
z.literal("jsonl")
|
|
359
|
+
]).optional(),
|
|
360
|
+
resumeOutput: z.union([
|
|
361
|
+
z.literal("json"),
|
|
362
|
+
z.literal("text"),
|
|
363
|
+
z.literal("jsonl")
|
|
364
|
+
]).optional(),
|
|
365
|
+
input: z.union([z.literal("arg"), z.literal("stdin")]).optional(),
|
|
366
|
+
maxPromptArgChars: z.number().int().positive().optional(),
|
|
367
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
368
|
+
clearEnv: z.array(z.string()).optional(),
|
|
369
|
+
modelArg: z.string().optional(),
|
|
370
|
+
modelAliases: z.record(z.string(), z.string()).optional(),
|
|
371
|
+
sessionArg: z.string().optional(),
|
|
372
|
+
sessionArgs: z.array(z.string()).optional(),
|
|
373
|
+
resumeArgs: z.array(z.string()).optional(),
|
|
374
|
+
sessionMode: z.union([
|
|
375
|
+
z.literal("always"),
|
|
376
|
+
z.literal("existing"),
|
|
377
|
+
z.literal("none")
|
|
378
|
+
]).optional(),
|
|
379
|
+
sessionIdFields: z.array(z.string()).optional(),
|
|
380
|
+
systemPromptArg: z.string().optional(),
|
|
381
|
+
systemPromptMode: z.union([z.literal("append"), z.literal("replace")]).optional(),
|
|
382
|
+
systemPromptWhen: z.union([
|
|
383
|
+
z.literal("first"),
|
|
384
|
+
z.literal("always"),
|
|
385
|
+
z.literal("never")
|
|
386
|
+
]).optional(),
|
|
387
|
+
imageArg: z.string().optional(),
|
|
388
|
+
imageMode: z.union([z.literal("repeat"), z.literal("list")]).optional(),
|
|
389
|
+
serialize: z.boolean().optional(),
|
|
390
|
+
reliability: z.object({ watchdog: z.object({
|
|
391
|
+
fresh: CliBackendWatchdogModeSchema,
|
|
392
|
+
resume: CliBackendWatchdogModeSchema
|
|
393
|
+
}).strict().optional() }).strict().optional()
|
|
394
|
+
}).strict();
|
|
395
|
+
const normalizeAllowFrom = (values) => (values ?? []).map((v) => String(v).trim()).filter(Boolean);
|
|
396
|
+
const requireOpenAllowFrom = (params) => {
|
|
397
|
+
if (params.policy !== "open") return;
|
|
398
|
+
if (normalizeAllowFrom(params.allowFrom).includes("*")) return;
|
|
399
|
+
params.ctx.addIssue({
|
|
400
|
+
code: z.ZodIssueCode.custom,
|
|
401
|
+
path: params.path,
|
|
402
|
+
message: params.message
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
const MSTeamsReplyStyleSchema = z.enum(["thread", "top-level"]);
|
|
406
|
+
const RetryConfigSchema = z.object({
|
|
407
|
+
attempts: z.number().int().min(1).optional(),
|
|
408
|
+
minDelayMs: z.number().int().min(0).optional(),
|
|
409
|
+
maxDelayMs: z.number().int().min(0).optional(),
|
|
410
|
+
jitter: z.number().min(0).max(1).optional()
|
|
411
|
+
}).strict().optional();
|
|
412
|
+
const QueueModeBySurfaceSchema = z.object({
|
|
413
|
+
whatsapp: QueueModeSchema.optional(),
|
|
414
|
+
telegram: QueueModeSchema.optional(),
|
|
415
|
+
discord: QueueModeSchema.optional(),
|
|
416
|
+
irc: QueueModeSchema.optional(),
|
|
417
|
+
slack: QueueModeSchema.optional(),
|
|
418
|
+
mattermost: QueueModeSchema.optional(),
|
|
419
|
+
signal: QueueModeSchema.optional(),
|
|
420
|
+
imessage: QueueModeSchema.optional(),
|
|
421
|
+
msteams: QueueModeSchema.optional(),
|
|
422
|
+
webchat: QueueModeSchema.optional()
|
|
423
|
+
}).strict().optional();
|
|
424
|
+
const DebounceMsBySurfaceSchema = z.record(z.string(), z.number().int().nonnegative()).optional();
|
|
425
|
+
const QueueSchema = z.object({
|
|
426
|
+
mode: QueueModeSchema.optional(),
|
|
427
|
+
byChannel: QueueModeBySurfaceSchema,
|
|
428
|
+
debounceMs: z.number().int().nonnegative().optional(),
|
|
429
|
+
debounceMsByChannel: DebounceMsBySurfaceSchema,
|
|
430
|
+
cap: z.number().int().positive().optional(),
|
|
431
|
+
drop: QueueDropSchema.optional()
|
|
432
|
+
}).strict().optional();
|
|
433
|
+
const InboundDebounceSchema = z.object({
|
|
434
|
+
debounceMs: z.number().int().nonnegative().optional(),
|
|
435
|
+
byChannel: DebounceMsBySurfaceSchema
|
|
436
|
+
}).strict().optional();
|
|
437
|
+
const TranscribeAudioSchema = z.object({
|
|
438
|
+
command: z.array(z.string()).superRefine((value, ctx) => {
|
|
439
|
+
const executable = value[0];
|
|
440
|
+
if (!isSafeExecutableValue(executable)) ctx.addIssue({
|
|
441
|
+
code: z.ZodIssueCode.custom,
|
|
442
|
+
path: [0],
|
|
443
|
+
message: "expected safe executable name or path"
|
|
444
|
+
});
|
|
445
|
+
}),
|
|
446
|
+
timeoutSeconds: z.number().int().positive().optional()
|
|
447
|
+
}).strict().optional();
|
|
448
|
+
const HexColorSchema = z.string().regex(/^#?[0-9a-fA-F]{6}$/, "expected hex color (RRGGBB)");
|
|
449
|
+
const ExecutableTokenSchema = z.string().refine(isSafeExecutableValue, "expected safe executable name or path");
|
|
450
|
+
const MediaUnderstandingScopeSchema = createAllowDenyChannelRulesSchema();
|
|
451
|
+
const MediaUnderstandingCapabilitiesSchema = z.array(z.union([
|
|
452
|
+
z.literal("image"),
|
|
453
|
+
z.literal("audio"),
|
|
454
|
+
z.literal("video")
|
|
455
|
+
])).optional();
|
|
456
|
+
const MediaUnderstandingAttachmentsSchema = z.object({
|
|
457
|
+
mode: z.union([z.literal("first"), z.literal("all")]).optional(),
|
|
458
|
+
maxAttachments: z.number().int().positive().optional(),
|
|
459
|
+
prefer: z.union([
|
|
460
|
+
z.literal("first"),
|
|
461
|
+
z.literal("last"),
|
|
462
|
+
z.literal("path"),
|
|
463
|
+
z.literal("url")
|
|
464
|
+
]).optional()
|
|
465
|
+
}).strict().optional();
|
|
466
|
+
const DeepgramAudioSchema = z.object({
|
|
467
|
+
detectLanguage: z.boolean().optional(),
|
|
468
|
+
punctuate: z.boolean().optional(),
|
|
469
|
+
smartFormat: z.boolean().optional()
|
|
470
|
+
}).strict().optional();
|
|
471
|
+
const ProviderOptionValueSchema = z.union([
|
|
472
|
+
z.string(),
|
|
473
|
+
z.number(),
|
|
474
|
+
z.boolean()
|
|
475
|
+
]);
|
|
476
|
+
const ProviderOptionsSchema = z.record(z.string(), z.record(z.string(), ProviderOptionValueSchema)).optional();
|
|
477
|
+
const MediaUnderstandingRuntimeFields = {
|
|
478
|
+
prompt: z.string().optional(),
|
|
479
|
+
timeoutSeconds: z.number().int().positive().optional(),
|
|
480
|
+
language: z.string().optional(),
|
|
481
|
+
providerOptions: ProviderOptionsSchema,
|
|
482
|
+
deepgram: DeepgramAudioSchema,
|
|
483
|
+
baseUrl: z.string().optional(),
|
|
484
|
+
headers: z.record(z.string(), z.string()).optional()
|
|
485
|
+
};
|
|
486
|
+
const MediaUnderstandingModelSchema = z.object({
|
|
487
|
+
provider: z.string().optional(),
|
|
488
|
+
model: z.string().optional(),
|
|
489
|
+
capabilities: MediaUnderstandingCapabilitiesSchema,
|
|
490
|
+
type: z.union([z.literal("provider"), z.literal("cli")]).optional(),
|
|
491
|
+
command: z.string().optional(),
|
|
492
|
+
args: z.array(z.string()).optional(),
|
|
493
|
+
maxChars: z.number().int().positive().optional(),
|
|
494
|
+
maxBytes: z.number().int().positive().optional(),
|
|
495
|
+
...MediaUnderstandingRuntimeFields,
|
|
496
|
+
profile: z.string().optional(),
|
|
497
|
+
preferredProfile: z.string().optional()
|
|
498
|
+
}).strict().optional();
|
|
499
|
+
const ToolsMediaUnderstandingSchema = z.object({
|
|
500
|
+
enabled: z.boolean().optional(),
|
|
501
|
+
scope: MediaUnderstandingScopeSchema,
|
|
502
|
+
maxBytes: z.number().int().positive().optional(),
|
|
503
|
+
maxChars: z.number().int().positive().optional(),
|
|
504
|
+
...MediaUnderstandingRuntimeFields,
|
|
505
|
+
attachments: MediaUnderstandingAttachmentsSchema,
|
|
506
|
+
models: z.array(MediaUnderstandingModelSchema).optional()
|
|
507
|
+
}).strict().optional();
|
|
508
|
+
const ToolsMediaSchema = z.object({
|
|
509
|
+
models: z.array(MediaUnderstandingModelSchema).optional(),
|
|
510
|
+
concurrency: z.number().int().positive().optional(),
|
|
511
|
+
image: ToolsMediaUnderstandingSchema.optional(),
|
|
512
|
+
audio: ToolsMediaUnderstandingSchema.optional(),
|
|
513
|
+
video: ToolsMediaUnderstandingSchema.optional()
|
|
514
|
+
}).strict().optional();
|
|
515
|
+
const LinkModelSchema = z.object({
|
|
516
|
+
type: z.literal("cli").optional(),
|
|
517
|
+
command: z.string().min(1),
|
|
518
|
+
args: z.array(z.string()).optional(),
|
|
519
|
+
timeoutSeconds: z.number().int().positive().optional()
|
|
520
|
+
}).strict();
|
|
521
|
+
const ToolsLinksSchema = z.object({
|
|
522
|
+
enabled: z.boolean().optional(),
|
|
523
|
+
scope: MediaUnderstandingScopeSchema,
|
|
524
|
+
maxLinks: z.number().int().positive().optional(),
|
|
525
|
+
timeoutSeconds: z.number().int().positive().optional(),
|
|
526
|
+
models: z.array(LinkModelSchema).optional()
|
|
527
|
+
}).strict().optional();
|
|
528
|
+
const NativeCommandsSettingSchema = z.union([z.boolean(), z.literal("auto")]);
|
|
529
|
+
const ProviderCommandsSchema = z.object({ native: NativeCommandsSettingSchema.optional() }).strict().optional();
|
|
530
|
+
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/config/zod-schema.agent-runtime.ts
|
|
533
|
+
/** Auth profile ref: `false` (skip), single string, or string array (rotation). */
|
|
534
|
+
const AuthFieldSchema = z.union([
|
|
535
|
+
z.literal(false),
|
|
536
|
+
z.string(),
|
|
537
|
+
z.array(z.string())
|
|
538
|
+
]).optional();
|
|
539
|
+
const BootSchema = z.object({
|
|
540
|
+
prompt: z.string().optional(),
|
|
541
|
+
file: z.string().optional()
|
|
542
|
+
}).strict().optional();
|
|
543
|
+
const HeartbeatSchema = z.object({
|
|
544
|
+
every: z.string().optional(),
|
|
545
|
+
activeHours: z.object({
|
|
546
|
+
start: z.string().optional(),
|
|
547
|
+
end: z.string().optional(),
|
|
548
|
+
timezone: z.string().optional()
|
|
549
|
+
}).strict().optional(),
|
|
550
|
+
model: z.string().optional(),
|
|
551
|
+
session: z.string().optional(),
|
|
552
|
+
target: z.string().optional(),
|
|
553
|
+
to: z.string().optional(),
|
|
554
|
+
accountId: z.string().optional(),
|
|
555
|
+
prompt: z.string().optional(),
|
|
556
|
+
file: z.string().optional(),
|
|
557
|
+
suppressToolErrorWarnings: z.boolean().optional()
|
|
558
|
+
}).strict().superRefine((val, ctx) => {
|
|
559
|
+
if (!val.every) return;
|
|
560
|
+
try {
|
|
561
|
+
parseDurationMs(val.every, { defaultUnit: "m" });
|
|
562
|
+
} catch {
|
|
563
|
+
ctx.addIssue({
|
|
564
|
+
code: z.ZodIssueCode.custom,
|
|
565
|
+
path: ["every"],
|
|
566
|
+
message: "invalid duration (use ms, s, m, h)"
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
const active = val.activeHours;
|
|
570
|
+
if (!active) return;
|
|
571
|
+
const timePattern = /^([01]\d|2[0-3]|24):([0-5]\d)$/;
|
|
572
|
+
const validateTime = (raw, opts, path) => {
|
|
573
|
+
if (!raw) return;
|
|
574
|
+
if (!timePattern.test(raw)) {
|
|
575
|
+
ctx.addIssue({
|
|
576
|
+
code: z.ZodIssueCode.custom,
|
|
577
|
+
path: ["activeHours", path],
|
|
578
|
+
message: "invalid time (use \"HH:MM\" 24h format)"
|
|
579
|
+
});
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const [hourStr, minuteStr] = raw.split(":");
|
|
583
|
+
const hour = Number(hourStr);
|
|
584
|
+
if (hour === 24 && Number(minuteStr) !== 0) {
|
|
585
|
+
ctx.addIssue({
|
|
586
|
+
code: z.ZodIssueCode.custom,
|
|
587
|
+
path: ["activeHours", path],
|
|
588
|
+
message: "invalid time (24:00 is the only allowed 24:xx value)"
|
|
589
|
+
});
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
if (hour === 24 && !opts.allow24) ctx.addIssue({
|
|
593
|
+
code: z.ZodIssueCode.custom,
|
|
594
|
+
path: ["activeHours", path],
|
|
595
|
+
message: "invalid time (start cannot be 24:00)"
|
|
596
|
+
});
|
|
597
|
+
};
|
|
598
|
+
validateTime(active.start, { allow24: false }, "start");
|
|
599
|
+
validateTime(active.end, { allow24: true }, "end");
|
|
600
|
+
}).optional();
|
|
601
|
+
const ToolPolicyBaseSchema = z.object({
|
|
602
|
+
allow: z.array(z.string()).optional(),
|
|
603
|
+
alsoAllow: z.array(z.string()).optional(),
|
|
604
|
+
deny: z.array(z.string()).optional()
|
|
605
|
+
}).strict();
|
|
606
|
+
const ToolPolicySchema = ToolPolicyBaseSchema.superRefine((value, ctx) => {
|
|
607
|
+
if (value.allow && value.allow.length > 0 && value.alsoAllow && value.alsoAllow.length > 0) ctx.addIssue({
|
|
608
|
+
code: z.ZodIssueCode.custom,
|
|
609
|
+
message: "tools policy cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)"
|
|
610
|
+
});
|
|
611
|
+
}).optional();
|
|
612
|
+
const ToolProfileSchema = z.union([
|
|
613
|
+
z.literal("minimal"),
|
|
614
|
+
z.literal("coding"),
|
|
615
|
+
z.literal("messaging"),
|
|
616
|
+
z.literal("full")
|
|
617
|
+
]).optional();
|
|
618
|
+
function addAllowAlsoAllowConflictIssue(value, ctx, message) {
|
|
619
|
+
if (value.allow && value.allow.length > 0 && value.alsoAllow && value.alsoAllow.length > 0) ctx.addIssue({
|
|
620
|
+
code: z.ZodIssueCode.custom,
|
|
621
|
+
message
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
const ToolPolicyWithProfileSchema = z.object({
|
|
625
|
+
allow: z.array(z.string()).optional(),
|
|
626
|
+
alsoAllow: z.array(z.string()).optional(),
|
|
627
|
+
deny: z.array(z.string()).optional(),
|
|
628
|
+
profile: ToolProfileSchema
|
|
629
|
+
}).strict().superRefine((value, ctx) => {
|
|
630
|
+
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)");
|
|
631
|
+
});
|
|
632
|
+
const ElevatedAllowFromSchema = z.record(z.string(), z.array(z.union([z.string(), z.number()]))).optional();
|
|
633
|
+
const ToolExecSafeBinProfileSchema = z.object({
|
|
634
|
+
minPositional: z.number().int().nonnegative().optional(),
|
|
635
|
+
maxPositional: z.number().int().nonnegative().optional(),
|
|
636
|
+
allowedValueFlags: z.array(z.string()).optional(),
|
|
637
|
+
deniedFlags: z.array(z.string()).optional()
|
|
638
|
+
}).strict();
|
|
639
|
+
const ToolExecBaseShape = {
|
|
640
|
+
host: z.enum([
|
|
641
|
+
"sandbox",
|
|
642
|
+
"gateway",
|
|
643
|
+
"node"
|
|
644
|
+
]).optional(),
|
|
645
|
+
security: z.enum([
|
|
646
|
+
"deny",
|
|
647
|
+
"allowlist",
|
|
648
|
+
"full"
|
|
649
|
+
]).optional(),
|
|
650
|
+
ask: z.enum([
|
|
651
|
+
"off",
|
|
652
|
+
"on-miss",
|
|
653
|
+
"always"
|
|
654
|
+
]).optional(),
|
|
655
|
+
node: z.string().optional(),
|
|
656
|
+
pathPrepend: z.array(z.string()).optional(),
|
|
657
|
+
safeBins: z.array(z.string()).optional(),
|
|
658
|
+
safeBinTrustedDirs: z.array(z.string()).optional(),
|
|
659
|
+
safeBinProfiles: z.record(z.string(), ToolExecSafeBinProfileSchema).optional(),
|
|
660
|
+
backgroundMs: z.number().int().positive().optional(),
|
|
661
|
+
timeoutSec: z.number().int().positive().optional(),
|
|
662
|
+
cleanupMs: z.number().int().positive().optional(),
|
|
663
|
+
notifyOnExit: z.boolean().optional(),
|
|
664
|
+
notifyOnExitEmptySuccess: z.boolean().optional()
|
|
665
|
+
};
|
|
666
|
+
const AgentToolExecSchema = z.object({
|
|
667
|
+
...ToolExecBaseShape,
|
|
668
|
+
approvalRunningNoticeMs: z.number().int().nonnegative().optional()
|
|
669
|
+
}).strict().optional();
|
|
670
|
+
const ToolExecSchema = z.object(ToolExecBaseShape).strict().optional();
|
|
671
|
+
const ToolFsSchema = z.object({ workspaceOnly: z.boolean().optional() }).strict().optional();
|
|
672
|
+
const CommonToolPolicyFields = {
|
|
673
|
+
profile: ToolProfileSchema,
|
|
674
|
+
allow: z.array(z.string()).optional(),
|
|
675
|
+
alsoAllow: z.array(z.string()).optional(),
|
|
676
|
+
deny: z.array(z.string()).optional(),
|
|
677
|
+
byProvider: z.record(z.string(), ToolPolicyWithProfileSchema).optional()
|
|
678
|
+
};
|
|
679
|
+
const AgentToolsSchema = z.object({
|
|
680
|
+
...CommonToolPolicyFields,
|
|
681
|
+
elevated: z.object({
|
|
682
|
+
enabled: z.boolean().optional(),
|
|
683
|
+
allowFrom: ElevatedAllowFromSchema
|
|
684
|
+
}).strict().optional(),
|
|
685
|
+
exec: AgentToolExecSchema,
|
|
686
|
+
fs: ToolFsSchema
|
|
687
|
+
}).strict().superRefine((value, ctx) => {
|
|
688
|
+
addAllowAlsoAllowConflictIssue(value, ctx, "agent tools cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)");
|
|
689
|
+
}).optional();
|
|
690
|
+
const AgentEntrySchema = z.object({
|
|
691
|
+
id: z.string(),
|
|
692
|
+
default: z.boolean().optional(),
|
|
693
|
+
name: z.string().optional(),
|
|
694
|
+
workspace: z.string().optional(),
|
|
695
|
+
agentDir: z.string().optional(),
|
|
696
|
+
model: z.unknown().optional(),
|
|
697
|
+
skills: z.array(z.string()).optional(),
|
|
698
|
+
humanDelay: HumanDelaySchema.optional(),
|
|
699
|
+
heartbeat: HeartbeatSchema,
|
|
700
|
+
boot: BootSchema,
|
|
701
|
+
identity: IdentitySchema,
|
|
702
|
+
groupChat: GroupChatSchema,
|
|
703
|
+
subagents: z.object({
|
|
704
|
+
allowAgents: z.array(z.string()).optional(),
|
|
705
|
+
model: z.unknown().optional()
|
|
706
|
+
}).strict().optional(),
|
|
707
|
+
editableFiles: z.array(z.string()).optional(),
|
|
708
|
+
tools: AgentToolsSchema,
|
|
709
|
+
auth: AuthFieldSchema
|
|
710
|
+
}).strict();
|
|
711
|
+
const ToolsSchema = z.object({
|
|
712
|
+
...CommonToolPolicyFields,
|
|
713
|
+
media: ToolsMediaSchema,
|
|
714
|
+
links: ToolsLinksSchema,
|
|
715
|
+
sessions: z.object({ visibility: z.enum([
|
|
716
|
+
"self",
|
|
717
|
+
"tree",
|
|
718
|
+
"agent",
|
|
719
|
+
"all"
|
|
720
|
+
]).optional() }).strict().optional(),
|
|
721
|
+
message: z.object({
|
|
722
|
+
allowCrossContextSend: z.boolean().optional(),
|
|
723
|
+
crossContext: z.object({
|
|
724
|
+
allowWithinProvider: z.boolean().optional(),
|
|
725
|
+
allowAcrossProviders: z.boolean().optional(),
|
|
726
|
+
marker: z.object({
|
|
727
|
+
enabled: z.boolean().optional(),
|
|
728
|
+
prefix: z.string().optional(),
|
|
729
|
+
suffix: z.string().optional()
|
|
730
|
+
}).strict().optional()
|
|
731
|
+
}).strict().optional(),
|
|
732
|
+
broadcast: z.object({ enabled: z.boolean().optional() }).strict().optional()
|
|
733
|
+
}).strict().optional(),
|
|
734
|
+
agentToAgent: z.object({
|
|
735
|
+
enabled: z.boolean().optional(),
|
|
736
|
+
allow: z.array(z.string()).optional()
|
|
737
|
+
}).strict().optional(),
|
|
738
|
+
elevated: z.object({
|
|
739
|
+
enabled: z.boolean().optional(),
|
|
740
|
+
allowFrom: ElevatedAllowFromSchema
|
|
741
|
+
}).strict().optional(),
|
|
742
|
+
exec: ToolExecSchema,
|
|
743
|
+
fs: ToolFsSchema,
|
|
744
|
+
subagents: z.object({ tools: ToolPolicySchema }).strict().optional()
|
|
745
|
+
}).strict().superRefine((value, ctx) => {
|
|
746
|
+
addAllowAlsoAllowConflictIssue(value, ctx, "tools cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)");
|
|
747
|
+
}).optional();
|
|
748
|
+
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/config/zod-schema.agent-defaults.ts
|
|
751
|
+
const AgentDefaultsSchema = z.object({
|
|
752
|
+
model: z.unknown().optional(),
|
|
753
|
+
imageModel: z.unknown().optional(),
|
|
754
|
+
models: z.unknown().optional(),
|
|
755
|
+
workspace: z.string().optional(),
|
|
756
|
+
repoRoot: z.string().optional(),
|
|
757
|
+
skipBootstrap: z.boolean().optional(),
|
|
758
|
+
bootstrapMaxChars: z.number().int().positive().optional(),
|
|
759
|
+
bootstrapTotalMaxChars: z.number().int().positive().optional(),
|
|
760
|
+
userTimezone: z.string().optional(),
|
|
761
|
+
timeFormat: z.union([
|
|
762
|
+
z.literal("auto"),
|
|
763
|
+
z.literal("12"),
|
|
764
|
+
z.literal("24")
|
|
765
|
+
]).optional(),
|
|
766
|
+
envelopeTimezone: z.string().optional(),
|
|
767
|
+
envelopeTimestamp: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
768
|
+
envelopeElapsed: z.union([z.literal("on"), z.literal("off")]).optional(),
|
|
769
|
+
contextTokens: z.number().int().positive().optional(),
|
|
770
|
+
cliBackends: z.unknown().optional(),
|
|
771
|
+
contextPruning: z.object({
|
|
772
|
+
mode: z.union([z.literal("off"), z.literal("cache-ttl")]).optional(),
|
|
773
|
+
ttl: z.string().optional(),
|
|
774
|
+
keepLastAssistants: z.number().int().nonnegative().optional(),
|
|
775
|
+
softTrimRatio: z.number().min(0).max(1).optional(),
|
|
776
|
+
hardClearRatio: z.number().min(0).max(1).optional(),
|
|
777
|
+
minPrunableToolChars: z.number().int().nonnegative().optional(),
|
|
778
|
+
tools: z.object({
|
|
779
|
+
allow: z.array(z.string()).optional(),
|
|
780
|
+
deny: z.array(z.string()).optional()
|
|
781
|
+
}).strict().optional(),
|
|
782
|
+
softTrim: z.object({
|
|
783
|
+
maxChars: z.number().int().nonnegative().optional(),
|
|
784
|
+
headChars: z.number().int().nonnegative().optional(),
|
|
785
|
+
tailChars: z.number().int().nonnegative().optional()
|
|
786
|
+
}).strict().optional(),
|
|
787
|
+
hardClear: z.object({
|
|
788
|
+
enabled: z.boolean().optional(),
|
|
789
|
+
placeholder: z.string().optional()
|
|
790
|
+
}).strict().optional()
|
|
791
|
+
}).strict().optional(),
|
|
792
|
+
verboseDefault: z.union([
|
|
793
|
+
z.literal("off"),
|
|
794
|
+
z.literal("on"),
|
|
795
|
+
z.literal("full")
|
|
796
|
+
]).optional(),
|
|
797
|
+
elevatedDefault: z.union([
|
|
798
|
+
z.literal("off"),
|
|
799
|
+
z.literal("on"),
|
|
800
|
+
z.literal("ask"),
|
|
801
|
+
z.literal("full")
|
|
802
|
+
]).optional(),
|
|
803
|
+
blockStreamingDefault: z.union([z.literal("off"), z.literal("on")]).optional(),
|
|
804
|
+
blockStreamingBreak: z.union([z.literal("text_end"), z.literal("message_end")]).optional(),
|
|
805
|
+
blockStreamingChunk: BlockStreamingChunkSchema.optional(),
|
|
806
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
807
|
+
humanDelay: HumanDelaySchema.optional(),
|
|
808
|
+
timeoutSeconds: z.number().int().positive().optional(),
|
|
809
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
810
|
+
imageMaxDimensionPx: z.number().int().positive().optional(),
|
|
811
|
+
typingIntervalSeconds: z.number().int().positive().optional(),
|
|
812
|
+
typingMode: TypingModeSchema.optional(),
|
|
813
|
+
heartbeat: HeartbeatSchema,
|
|
814
|
+
boot: BootSchema,
|
|
815
|
+
maxConcurrent: z.number().int().positive().optional(),
|
|
816
|
+
subagents: z.object({
|
|
817
|
+
maxConcurrent: z.number().int().positive().optional(),
|
|
818
|
+
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."),
|
|
819
|
+
maxChildrenPerAgent: z.number().int().min(1).max(20).optional().describe("Maximum number of active children a single agent session can spawn (default: 5)."),
|
|
820
|
+
archiveAfterMinutes: z.number().int().positive().optional(),
|
|
821
|
+
model: z.unknown().optional(),
|
|
822
|
+
runTimeoutSeconds: z.number().int().min(0).optional(),
|
|
823
|
+
announceTimeoutMs: z.number().int().positive().optional()
|
|
824
|
+
}).strict().optional(),
|
|
825
|
+
editableFiles: z.array(z.string()).optional(),
|
|
826
|
+
sandbox: z.unknown().optional(),
|
|
827
|
+
runtime: z.union([
|
|
828
|
+
z.literal("claude"),
|
|
829
|
+
z.literal("gemini"),
|
|
830
|
+
z.literal("codex"),
|
|
831
|
+
z.literal("opencode")
|
|
832
|
+
]).optional(),
|
|
833
|
+
runtimeArgs: z.array(z.string()).optional(),
|
|
834
|
+
runtimeEnv: z.record(z.string(), z.string()).optional(),
|
|
835
|
+
auth: AuthFieldSchema
|
|
836
|
+
}).strict().optional();
|
|
837
|
+
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region src/config/zod-schema.agents.ts
|
|
840
|
+
const AgentsSchema = z.object({
|
|
841
|
+
defaults: z.lazy(() => AgentDefaultsSchema).optional(),
|
|
842
|
+
list: z.array(AgentEntrySchema).optional()
|
|
843
|
+
}).strict().optional();
|
|
844
|
+
const BindingsSchema = z.array(z.object({
|
|
845
|
+
agentId: z.string(),
|
|
846
|
+
comment: z.string().optional(),
|
|
847
|
+
match: z.object({
|
|
848
|
+
channel: z.string(),
|
|
849
|
+
accountId: z.string().optional(),
|
|
850
|
+
peer: z.object({
|
|
851
|
+
kind: z.union([
|
|
852
|
+
z.literal("direct"),
|
|
853
|
+
z.literal("group"),
|
|
854
|
+
z.literal("channel"),
|
|
855
|
+
z.literal("dm")
|
|
856
|
+
]),
|
|
857
|
+
id: z.string()
|
|
858
|
+
}).strict().optional(),
|
|
859
|
+
guildId: z.string().optional(),
|
|
860
|
+
teamId: z.string().optional(),
|
|
861
|
+
roles: z.array(z.string()).optional()
|
|
862
|
+
}).strict()
|
|
863
|
+
}).strict()).optional();
|
|
864
|
+
const BroadcastStrategySchema = z.enum(["parallel", "sequential"]);
|
|
865
|
+
const BroadcastSchema = z.object({ strategy: BroadcastStrategySchema.optional() }).catchall(z.array(z.string())).optional();
|
|
866
|
+
const AudioSchema = z.object({ transcription: TranscribeAudioSchema }).strict().optional();
|
|
867
|
+
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/config/zod-schema.approvals.ts
|
|
870
|
+
const ExecApprovalForwardTargetSchema = z.object({
|
|
871
|
+
channel: z.string().min(1),
|
|
872
|
+
to: z.string().min(1),
|
|
873
|
+
accountId: z.string().optional(),
|
|
874
|
+
threadId: z.union([z.string(), z.number()]).optional()
|
|
875
|
+
}).strict();
|
|
876
|
+
const ExecApprovalForwardingSchema = z.object({
|
|
877
|
+
enabled: z.boolean().optional(),
|
|
878
|
+
mode: z.union([
|
|
879
|
+
z.literal("session"),
|
|
880
|
+
z.literal("targets"),
|
|
881
|
+
z.literal("both")
|
|
882
|
+
]).optional(),
|
|
883
|
+
agentFilter: z.array(z.string()).optional(),
|
|
884
|
+
sessionFilter: z.array(z.string()).optional(),
|
|
885
|
+
targets: z.array(ExecApprovalForwardTargetSchema).optional()
|
|
886
|
+
}).strict().optional();
|
|
887
|
+
const ApprovalsSchema = z.object({ exec: ExecApprovalForwardingSchema }).strict().optional();
|
|
888
|
+
|
|
889
|
+
//#endregion
|
|
890
|
+
//#region src/config/zod-schema.installs.ts
|
|
891
|
+
const InstallSourceSchema = z.union([
|
|
892
|
+
z.literal("npm"),
|
|
893
|
+
z.literal("archive"),
|
|
894
|
+
z.literal("path")
|
|
895
|
+
]);
|
|
896
|
+
const InstallRecordShape = {
|
|
897
|
+
source: InstallSourceSchema,
|
|
898
|
+
spec: z.string().optional(),
|
|
899
|
+
sourcePath: z.string().optional(),
|
|
900
|
+
installPath: z.string().optional(),
|
|
901
|
+
version: z.string().optional(),
|
|
902
|
+
resolvedName: z.string().optional(),
|
|
903
|
+
resolvedVersion: z.string().optional(),
|
|
904
|
+
resolvedSpec: z.string().optional(),
|
|
905
|
+
integrity: z.string().optional(),
|
|
906
|
+
shasum: z.string().optional(),
|
|
907
|
+
resolvedAt: z.string().optional(),
|
|
908
|
+
installedAt: z.string().optional()
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/config/zod-schema.hooks.ts
|
|
913
|
+
function isSafeRelativeModulePath(raw) {
|
|
914
|
+
const value = raw.trim();
|
|
915
|
+
if (!value) return false;
|
|
916
|
+
if (path.isAbsolute(value)) return false;
|
|
917
|
+
if (value.startsWith("~")) return false;
|
|
918
|
+
if (value.includes(":")) return false;
|
|
919
|
+
if (value.split(/[\\/]+/g).some((part) => part === "..")) return false;
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
const SafeRelativeModulePathSchema = z.string().refine(isSafeRelativeModulePath, "module must be a safe relative path (no absolute paths)");
|
|
923
|
+
const HookMappingSchema = z.object({
|
|
924
|
+
id: z.string().optional(),
|
|
925
|
+
match: z.object({
|
|
926
|
+
path: z.string().optional(),
|
|
927
|
+
source: z.string().optional()
|
|
928
|
+
}).optional(),
|
|
929
|
+
action: z.union([z.literal("wake"), z.literal("agent")]).optional(),
|
|
930
|
+
wakeMode: z.union([z.literal("now"), z.literal("next-heartbeat")]).optional(),
|
|
931
|
+
name: z.string().optional(),
|
|
932
|
+
agentId: z.string().optional(),
|
|
933
|
+
sessionKey: z.string().optional().register(sensitive),
|
|
934
|
+
messageTemplate: z.string().optional(),
|
|
935
|
+
textTemplate: z.string().optional(),
|
|
936
|
+
deliver: z.boolean().optional(),
|
|
937
|
+
allowUnsafeExternalContent: z.boolean().optional(),
|
|
938
|
+
channel: z.union([
|
|
939
|
+
z.literal("last"),
|
|
940
|
+
z.literal("whatsapp"),
|
|
941
|
+
z.literal("telegram"),
|
|
942
|
+
z.literal("discord"),
|
|
943
|
+
z.literal("irc"),
|
|
944
|
+
z.literal("slack"),
|
|
945
|
+
z.literal("signal"),
|
|
946
|
+
z.literal("imessage"),
|
|
947
|
+
z.literal("msteams")
|
|
948
|
+
]).optional(),
|
|
949
|
+
to: z.string().optional(),
|
|
950
|
+
model: z.string().optional(),
|
|
951
|
+
thinking: z.string().optional(),
|
|
952
|
+
timeoutSeconds: z.number().int().positive().optional(),
|
|
953
|
+
transform: z.object({
|
|
954
|
+
module: SafeRelativeModulePathSchema,
|
|
955
|
+
export: z.string().optional()
|
|
956
|
+
}).strict().optional()
|
|
957
|
+
}).strict().optional();
|
|
958
|
+
const InternalHookHandlerSchema = z.object({
|
|
959
|
+
event: z.string(),
|
|
960
|
+
module: SafeRelativeModulePathSchema,
|
|
961
|
+
export: z.string().optional()
|
|
962
|
+
}).strict();
|
|
963
|
+
const HookConfigSchema = z.object({
|
|
964
|
+
enabled: z.boolean().optional(),
|
|
965
|
+
env: z.record(z.string(), z.string()).optional()
|
|
966
|
+
}).passthrough();
|
|
967
|
+
const HookInstallRecordSchema = z.object({
|
|
968
|
+
...InstallRecordShape,
|
|
969
|
+
hooks: z.array(z.string()).optional()
|
|
970
|
+
}).strict();
|
|
971
|
+
const InternalHooksSchema = z.object({
|
|
972
|
+
enabled: z.boolean().optional(),
|
|
973
|
+
handlers: z.array(InternalHookHandlerSchema).optional(),
|
|
974
|
+
entries: z.record(z.string(), HookConfigSchema).optional(),
|
|
975
|
+
load: z.object({ extraDirs: z.array(z.string()).optional() }).strict().optional(),
|
|
976
|
+
installs: z.record(z.string(), HookInstallRecordSchema).optional()
|
|
977
|
+
}).strict().optional();
|
|
978
|
+
const HooksGmailSchema = z.object({
|
|
979
|
+
account: z.string().optional(),
|
|
980
|
+
label: z.string().optional(),
|
|
981
|
+
topic: z.string().optional(),
|
|
982
|
+
subscription: z.string().optional(),
|
|
983
|
+
pushToken: z.string().optional().register(sensitive),
|
|
984
|
+
hookUrl: z.string().optional(),
|
|
985
|
+
includeBody: z.boolean().optional(),
|
|
986
|
+
maxBytes: z.number().int().positive().optional(),
|
|
987
|
+
renewEveryMinutes: z.number().int().positive().optional(),
|
|
988
|
+
allowUnsafeExternalContent: z.boolean().optional(),
|
|
989
|
+
serve: z.object({
|
|
990
|
+
bind: z.string().optional(),
|
|
991
|
+
port: z.number().int().positive().optional(),
|
|
992
|
+
path: z.string().optional()
|
|
993
|
+
}).strict().optional(),
|
|
994
|
+
tailscale: z.object({
|
|
995
|
+
mode: z.union([
|
|
996
|
+
z.literal("off"),
|
|
997
|
+
z.literal("serve"),
|
|
998
|
+
z.literal("funnel")
|
|
999
|
+
]).optional(),
|
|
1000
|
+
path: z.string().optional(),
|
|
1001
|
+
target: z.string().optional()
|
|
1002
|
+
}).strict().optional(),
|
|
1003
|
+
model: z.string().optional(),
|
|
1004
|
+
thinking: z.union([
|
|
1005
|
+
z.literal("off"),
|
|
1006
|
+
z.literal("minimal"),
|
|
1007
|
+
z.literal("low"),
|
|
1008
|
+
z.literal("medium"),
|
|
1009
|
+
z.literal("high")
|
|
1010
|
+
]).optional()
|
|
1011
|
+
}).strict().optional();
|
|
1012
|
+
|
|
1013
|
+
//#endregion
|
|
1014
|
+
//#region src/config/zod-schema.channels.ts
|
|
1015
|
+
const ChannelHeartbeatVisibilitySchema = z.object({
|
|
1016
|
+
showOk: z.boolean().optional(),
|
|
1017
|
+
showAlerts: z.boolean().optional(),
|
|
1018
|
+
useIndicator: z.boolean().optional()
|
|
1019
|
+
}).strict().optional();
|
|
1020
|
+
|
|
1021
|
+
//#endregion
|
|
1022
|
+
//#region src/infra/scp-host.ts
|
|
1023
|
+
const SSH_TOKEN = /^[A-Za-z0-9._-]+$/;
|
|
1024
|
+
const BRACKETED_IPV6 = /^\[[0-9A-Fa-f:.%]+\]$/;
|
|
1025
|
+
const WHITESPACE = /\s/;
|
|
1026
|
+
function hasControlOrWhitespace(value) {
|
|
1027
|
+
for (const char of value) {
|
|
1028
|
+
const code = char.charCodeAt(0);
|
|
1029
|
+
if (code <= 31 || code === 127 || WHITESPACE.test(char)) return true;
|
|
1030
|
+
}
|
|
1031
|
+
return false;
|
|
1032
|
+
}
|
|
1033
|
+
function normalizeScpRemoteHost(value) {
|
|
1034
|
+
if (typeof value !== "string") return;
|
|
1035
|
+
const trimmed = value.trim();
|
|
1036
|
+
if (!trimmed) return;
|
|
1037
|
+
if (hasControlOrWhitespace(trimmed)) return;
|
|
1038
|
+
if (trimmed.startsWith("-") || trimmed.includes("/") || trimmed.includes("\\")) return;
|
|
1039
|
+
const firstAt = trimmed.indexOf("@");
|
|
1040
|
+
const lastAt = trimmed.lastIndexOf("@");
|
|
1041
|
+
let user;
|
|
1042
|
+
let host = trimmed;
|
|
1043
|
+
if (firstAt !== -1) {
|
|
1044
|
+
if (firstAt !== lastAt || firstAt === 0 || firstAt === trimmed.length - 1) return;
|
|
1045
|
+
user = trimmed.slice(0, firstAt);
|
|
1046
|
+
host = trimmed.slice(firstAt + 1);
|
|
1047
|
+
if (!SSH_TOKEN.test(user)) return;
|
|
1048
|
+
}
|
|
1049
|
+
if (!host || host.startsWith("-") || host.includes("@")) return;
|
|
1050
|
+
if (host.includes(":") && !BRACKETED_IPV6.test(host)) return;
|
|
1051
|
+
if (!SSH_TOKEN.test(host) && !BRACKETED_IPV6.test(host)) return;
|
|
1052
|
+
return user ? `${user}@${host}` : host;
|
|
1053
|
+
}
|
|
1054
|
+
function isSafeScpRemoteHost(value) {
|
|
1055
|
+
return normalizeScpRemoteHost(value) !== void 0;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
//#endregion
|
|
1059
|
+
//#region src/config/telegram-custom-commands.ts
|
|
1060
|
+
const TELEGRAM_COMMAND_NAME_PATTERN = /^[a-z0-9_]{1,32}$/;
|
|
1061
|
+
function normalizeTelegramCommandName(value) {
|
|
1062
|
+
const trimmed = value.trim();
|
|
1063
|
+
if (!trimmed) return "";
|
|
1064
|
+
return (trimmed.startsWith("/") ? trimmed.slice(1) : trimmed).trim().toLowerCase().replace(/-/g, "_");
|
|
1065
|
+
}
|
|
1066
|
+
function normalizeTelegramCommandDescription(value) {
|
|
1067
|
+
return value.trim();
|
|
1068
|
+
}
|
|
1069
|
+
function resolveTelegramCustomCommands(params) {
|
|
1070
|
+
const entries = Array.isArray(params.commands) ? params.commands : [];
|
|
1071
|
+
const reserved = params.reservedCommands ?? /* @__PURE__ */ new Set();
|
|
1072
|
+
const checkReserved = params.checkReserved !== false;
|
|
1073
|
+
const checkDuplicates = params.checkDuplicates !== false;
|
|
1074
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1075
|
+
const resolved = [];
|
|
1076
|
+
const issues = [];
|
|
1077
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
1078
|
+
const entry = entries[index];
|
|
1079
|
+
const normalized = normalizeTelegramCommandName(String(entry?.command ?? ""));
|
|
1080
|
+
if (!normalized) {
|
|
1081
|
+
issues.push({
|
|
1082
|
+
index,
|
|
1083
|
+
field: "command",
|
|
1084
|
+
message: "Telegram custom command is missing a command name."
|
|
1085
|
+
});
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
if (!TELEGRAM_COMMAND_NAME_PATTERN.test(normalized)) {
|
|
1089
|
+
issues.push({
|
|
1090
|
+
index,
|
|
1091
|
+
field: "command",
|
|
1092
|
+
message: `Telegram custom command "/${normalized}" is invalid (use a-z, 0-9, underscore; max 32 chars).`
|
|
1093
|
+
});
|
|
1094
|
+
continue;
|
|
1095
|
+
}
|
|
1096
|
+
if (checkReserved && reserved.has(normalized)) {
|
|
1097
|
+
issues.push({
|
|
1098
|
+
index,
|
|
1099
|
+
field: "command",
|
|
1100
|
+
message: `Telegram custom command "/${normalized}" conflicts with a native command.`
|
|
1101
|
+
});
|
|
1102
|
+
continue;
|
|
1103
|
+
}
|
|
1104
|
+
if (checkDuplicates && seen.has(normalized)) {
|
|
1105
|
+
issues.push({
|
|
1106
|
+
index,
|
|
1107
|
+
field: "command",
|
|
1108
|
+
message: `Telegram custom command "/${normalized}" is duplicated.`
|
|
1109
|
+
});
|
|
1110
|
+
continue;
|
|
1111
|
+
}
|
|
1112
|
+
const description = normalizeTelegramCommandDescription(String(entry?.description ?? ""));
|
|
1113
|
+
if (!description) {
|
|
1114
|
+
issues.push({
|
|
1115
|
+
index,
|
|
1116
|
+
field: "description",
|
|
1117
|
+
message: `Telegram custom command "/${normalized}" is missing a description.`
|
|
1118
|
+
});
|
|
1119
|
+
continue;
|
|
1120
|
+
}
|
|
1121
|
+
if (checkDuplicates) seen.add(normalized);
|
|
1122
|
+
resolved.push({
|
|
1123
|
+
command: normalized,
|
|
1124
|
+
description
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
return {
|
|
1128
|
+
commands: resolved,
|
|
1129
|
+
issues
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
//#endregion
|
|
1134
|
+
//#region src/config/zod-schema.providers-core.ts
|
|
1135
|
+
const ToolPolicyBySenderSchema$1 = z.record(z.string(), ToolPolicySchema).optional();
|
|
1136
|
+
const DiscordIdSchema = z.union([z.string(), z.number()]).refine((value) => typeof value === "string", { message: "Discord IDs must be strings (wrap numeric IDs in quotes)." });
|
|
1137
|
+
const DiscordIdListSchema = z.array(DiscordIdSchema);
|
|
1138
|
+
const TelegramInlineButtonsScopeSchema = z.enum([
|
|
1139
|
+
"off",
|
|
1140
|
+
"dm",
|
|
1141
|
+
"group",
|
|
1142
|
+
"all",
|
|
1143
|
+
"allowlist"
|
|
1144
|
+
]);
|
|
1145
|
+
const TelegramCapabilitiesSchema = z.union([z.array(z.string()), z.object({ inlineButtons: TelegramInlineButtonsScopeSchema.optional() }).strict()]);
|
|
1146
|
+
const TelegramTopicSchema = z.object({
|
|
1147
|
+
requireMention: z.boolean().optional(),
|
|
1148
|
+
groupPolicy: GroupPolicySchema.optional(),
|
|
1149
|
+
skills: z.array(z.string()).optional(),
|
|
1150
|
+
enabled: z.boolean().optional(),
|
|
1151
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1152
|
+
systemPrompt: z.string().optional()
|
|
1153
|
+
}).strict();
|
|
1154
|
+
const TelegramGroupSchema = z.object({
|
|
1155
|
+
requireMention: z.boolean().optional(),
|
|
1156
|
+
groupPolicy: GroupPolicySchema.optional(),
|
|
1157
|
+
tools: ToolPolicySchema,
|
|
1158
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1159
|
+
skills: z.array(z.string()).optional(),
|
|
1160
|
+
enabled: z.boolean().optional(),
|
|
1161
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1162
|
+
systemPrompt: z.string().optional(),
|
|
1163
|
+
topics: z.record(z.string(), TelegramTopicSchema.optional()).optional()
|
|
1164
|
+
}).strict();
|
|
1165
|
+
const TelegramCustomCommandSchema = z.object({
|
|
1166
|
+
command: z.string().transform(normalizeTelegramCommandName),
|
|
1167
|
+
description: z.string().transform(normalizeTelegramCommandDescription)
|
|
1168
|
+
}).strict();
|
|
1169
|
+
const validateTelegramCustomCommands = (value, ctx) => {
|
|
1170
|
+
if (!value.customCommands || value.customCommands.length === 0) return;
|
|
1171
|
+
const { issues } = resolveTelegramCustomCommands({
|
|
1172
|
+
commands: value.customCommands,
|
|
1173
|
+
checkReserved: false,
|
|
1174
|
+
checkDuplicates: false
|
|
1175
|
+
});
|
|
1176
|
+
for (const issue of issues) ctx.addIssue({
|
|
1177
|
+
code: z.ZodIssueCode.custom,
|
|
1178
|
+
path: [
|
|
1179
|
+
"customCommands",
|
|
1180
|
+
issue.index,
|
|
1181
|
+
issue.field
|
|
1182
|
+
],
|
|
1183
|
+
message: issue.message
|
|
1184
|
+
});
|
|
1185
|
+
};
|
|
1186
|
+
function normalizeTelegramStreamingConfig(value) {
|
|
1187
|
+
value.streaming = resolveTelegramPreviewStreamMode(value);
|
|
1188
|
+
delete value.streamMode;
|
|
1189
|
+
}
|
|
1190
|
+
function normalizeDiscordStreamingConfig(value) {
|
|
1191
|
+
value.streaming = resolveDiscordPreviewStreamMode(value);
|
|
1192
|
+
delete value.streamMode;
|
|
1193
|
+
}
|
|
1194
|
+
function normalizeSlackStreamingConfig(value) {
|
|
1195
|
+
value.nativeStreaming = resolveSlackNativeStreaming(value);
|
|
1196
|
+
value.streaming = resolveSlackStreamingMode(value);
|
|
1197
|
+
delete value.streamMode;
|
|
1198
|
+
}
|
|
1199
|
+
const TelegramAccountSchemaBase = z.object({
|
|
1200
|
+
name: z.string().optional(),
|
|
1201
|
+
capabilities: TelegramCapabilitiesSchema.optional(),
|
|
1202
|
+
markdown: MarkdownConfigSchema,
|
|
1203
|
+
enabled: z.boolean().optional(),
|
|
1204
|
+
commands: ProviderCommandsSchema,
|
|
1205
|
+
customCommands: z.array(TelegramCustomCommandSchema).optional(),
|
|
1206
|
+
configWrites: z.boolean().optional(),
|
|
1207
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1208
|
+
botToken: z.string().optional().register(sensitive),
|
|
1209
|
+
tokenFile: z.string().optional(),
|
|
1210
|
+
replyToMode: ReplyToModeSchema.optional(),
|
|
1211
|
+
groups: z.record(z.string(), TelegramGroupSchema.optional()).optional(),
|
|
1212
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1213
|
+
defaultTo: z.union([z.string(), z.number()]).optional(),
|
|
1214
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1215
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1216
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1217
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1218
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1219
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1220
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1221
|
+
streaming: z.union([z.boolean(), z.enum([
|
|
1222
|
+
"off",
|
|
1223
|
+
"partial",
|
|
1224
|
+
"block",
|
|
1225
|
+
"progress"
|
|
1226
|
+
])]).optional(),
|
|
1227
|
+
blockStreaming: z.boolean().optional(),
|
|
1228
|
+
draftChunk: BlockStreamingChunkSchema.optional(),
|
|
1229
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1230
|
+
streamMode: z.enum([
|
|
1231
|
+
"off",
|
|
1232
|
+
"partial",
|
|
1233
|
+
"block"
|
|
1234
|
+
]).optional(),
|
|
1235
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
1236
|
+
timeoutSeconds: z.number().int().positive().optional(),
|
|
1237
|
+
retry: RetryConfigSchema,
|
|
1238
|
+
network: z.object({
|
|
1239
|
+
autoSelectFamily: z.boolean().optional(),
|
|
1240
|
+
dnsResultOrder: z.enum(["ipv4first", "verbatim"]).optional()
|
|
1241
|
+
}).strict().optional(),
|
|
1242
|
+
proxy: z.string().optional(),
|
|
1243
|
+
webhookUrl: z.string().optional(),
|
|
1244
|
+
webhookSecret: z.string().optional().register(sensitive),
|
|
1245
|
+
webhookPath: z.string().optional(),
|
|
1246
|
+
webhookHost: z.string().optional(),
|
|
1247
|
+
webhookPort: z.number().int().positive().optional(),
|
|
1248
|
+
actions: z.object({
|
|
1249
|
+
reactions: z.boolean().optional(),
|
|
1250
|
+
sendMessage: z.boolean().optional(),
|
|
1251
|
+
deleteMessage: z.boolean().optional(),
|
|
1252
|
+
sticker: z.boolean().optional()
|
|
1253
|
+
}).strict().optional(),
|
|
1254
|
+
reactionNotifications: z.enum([
|
|
1255
|
+
"off",
|
|
1256
|
+
"own",
|
|
1257
|
+
"all"
|
|
1258
|
+
]).optional(),
|
|
1259
|
+
reactionLevel: z.enum([
|
|
1260
|
+
"off",
|
|
1261
|
+
"ack",
|
|
1262
|
+
"minimal",
|
|
1263
|
+
"extensive"
|
|
1264
|
+
]).optional(),
|
|
1265
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1266
|
+
linkPreview: z.boolean().optional(),
|
|
1267
|
+
responsePrefix: z.string().optional(),
|
|
1268
|
+
ackReaction: z.string().optional()
|
|
1269
|
+
}).strict();
|
|
1270
|
+
const TelegramAccountSchema = TelegramAccountSchemaBase.superRefine((value, ctx) => {
|
|
1271
|
+
normalizeTelegramStreamingConfig(value);
|
|
1272
|
+
requireOpenAllowFrom({
|
|
1273
|
+
policy: value.dmPolicy,
|
|
1274
|
+
allowFrom: value.allowFrom,
|
|
1275
|
+
ctx,
|
|
1276
|
+
path: ["allowFrom"],
|
|
1277
|
+
message: "channels.telegram.dmPolicy=\"open\" requires channels.telegram.allowFrom to include \"*\""
|
|
1278
|
+
});
|
|
1279
|
+
validateTelegramCustomCommands(value, ctx);
|
|
1280
|
+
});
|
|
1281
|
+
const TelegramConfigSchema = TelegramAccountSchemaBase.extend({ accounts: z.record(z.string(), TelegramAccountSchema.optional()).optional() }).superRefine((value, ctx) => {
|
|
1282
|
+
normalizeTelegramStreamingConfig(value);
|
|
1283
|
+
requireOpenAllowFrom({
|
|
1284
|
+
policy: value.dmPolicy,
|
|
1285
|
+
allowFrom: value.allowFrom,
|
|
1286
|
+
ctx,
|
|
1287
|
+
path: ["allowFrom"],
|
|
1288
|
+
message: "channels.telegram.dmPolicy=\"open\" requires channels.telegram.allowFrom to include \"*\""
|
|
1289
|
+
});
|
|
1290
|
+
validateTelegramCustomCommands(value, ctx);
|
|
1291
|
+
const baseWebhookUrl = typeof value.webhookUrl === "string" ? value.webhookUrl.trim() : "";
|
|
1292
|
+
const baseWebhookSecret = typeof value.webhookSecret === "string" ? value.webhookSecret.trim() : "";
|
|
1293
|
+
if (baseWebhookUrl && !baseWebhookSecret) ctx.addIssue({
|
|
1294
|
+
code: z.ZodIssueCode.custom,
|
|
1295
|
+
message: "channels.telegram.webhookUrl requires channels.telegram.webhookSecret",
|
|
1296
|
+
path: ["webhookSecret"]
|
|
1297
|
+
});
|
|
1298
|
+
if (!value.accounts) return;
|
|
1299
|
+
for (const [accountId, account] of Object.entries(value.accounts)) {
|
|
1300
|
+
if (!account) continue;
|
|
1301
|
+
if (account.enabled === false) continue;
|
|
1302
|
+
if (!(typeof account.webhookUrl === "string" ? account.webhookUrl.trim() : "")) continue;
|
|
1303
|
+
if (!(typeof account.webhookSecret === "string" ? account.webhookSecret.trim() : "") && !baseWebhookSecret) ctx.addIssue({
|
|
1304
|
+
code: z.ZodIssueCode.custom,
|
|
1305
|
+
message: "channels.telegram.accounts.*.webhookUrl requires channels.telegram.webhookSecret or channels.telegram.accounts.*.webhookSecret",
|
|
1306
|
+
path: [
|
|
1307
|
+
"accounts",
|
|
1308
|
+
accountId,
|
|
1309
|
+
"webhookSecret"
|
|
1310
|
+
]
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
const DiscordDmSchema = z.object({
|
|
1315
|
+
enabled: z.boolean().optional(),
|
|
1316
|
+
policy: DmPolicySchema.optional(),
|
|
1317
|
+
allowFrom: DiscordIdListSchema.optional(),
|
|
1318
|
+
groupEnabled: z.boolean().optional(),
|
|
1319
|
+
groupChannels: DiscordIdListSchema.optional()
|
|
1320
|
+
}).strict();
|
|
1321
|
+
const DiscordGuildChannelSchema = z.object({
|
|
1322
|
+
allow: z.boolean().optional(),
|
|
1323
|
+
requireMention: z.boolean().optional(),
|
|
1324
|
+
tools: ToolPolicySchema,
|
|
1325
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1326
|
+
skills: z.array(z.string()).optional(),
|
|
1327
|
+
enabled: z.boolean().optional(),
|
|
1328
|
+
users: DiscordIdListSchema.optional(),
|
|
1329
|
+
roles: DiscordIdListSchema.optional(),
|
|
1330
|
+
systemPrompt: z.string().optional(),
|
|
1331
|
+
includeThreadStarter: z.boolean().optional(),
|
|
1332
|
+
autoThread: z.boolean().optional()
|
|
1333
|
+
}).strict();
|
|
1334
|
+
const DiscordGuildSchema = z.object({
|
|
1335
|
+
slug: z.string().optional(),
|
|
1336
|
+
requireMention: z.boolean().optional(),
|
|
1337
|
+
tools: ToolPolicySchema,
|
|
1338
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1339
|
+
reactionNotifications: z.enum([
|
|
1340
|
+
"off",
|
|
1341
|
+
"own",
|
|
1342
|
+
"all",
|
|
1343
|
+
"allowlist"
|
|
1344
|
+
]).optional(),
|
|
1345
|
+
users: DiscordIdListSchema.optional(),
|
|
1346
|
+
roles: DiscordIdListSchema.optional(),
|
|
1347
|
+
channels: z.record(z.string(), DiscordGuildChannelSchema.optional()).optional()
|
|
1348
|
+
}).strict();
|
|
1349
|
+
const DiscordUiSchema = z.object({ components: z.object({ accentColor: HexColorSchema.optional() }).strict().optional() }).strict().optional();
|
|
1350
|
+
const DiscordVoiceAutoJoinSchema = z.object({
|
|
1351
|
+
guildId: z.string().min(1),
|
|
1352
|
+
channelId: z.string().min(1)
|
|
1353
|
+
}).strict();
|
|
1354
|
+
const DiscordVoiceSchema = z.object({
|
|
1355
|
+
enabled: z.boolean().optional(),
|
|
1356
|
+
autoJoin: z.array(DiscordVoiceAutoJoinSchema).optional(),
|
|
1357
|
+
daveEncryption: z.boolean().optional(),
|
|
1358
|
+
decryptionFailureTolerance: z.number().int().min(0).optional(),
|
|
1359
|
+
tts: TtsConfigSchema.optional()
|
|
1360
|
+
}).strict().optional();
|
|
1361
|
+
const DiscordAccountSchema = z.object({
|
|
1362
|
+
name: z.string().optional(),
|
|
1363
|
+
capabilities: z.array(z.string()).optional(),
|
|
1364
|
+
markdown: MarkdownConfigSchema,
|
|
1365
|
+
enabled: z.boolean().optional(),
|
|
1366
|
+
commands: ProviderCommandsSchema,
|
|
1367
|
+
configWrites: z.boolean().optional(),
|
|
1368
|
+
token: z.string().optional().register(sensitive),
|
|
1369
|
+
proxy: z.string().optional(),
|
|
1370
|
+
allowBots: z.boolean().optional(),
|
|
1371
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
1372
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1373
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1374
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1375
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1376
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1377
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1378
|
+
blockStreaming: z.boolean().optional(),
|
|
1379
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1380
|
+
streaming: z.union([z.boolean(), z.enum([
|
|
1381
|
+
"off",
|
|
1382
|
+
"partial",
|
|
1383
|
+
"block",
|
|
1384
|
+
"progress"
|
|
1385
|
+
])]).optional(),
|
|
1386
|
+
streamMode: z.enum([
|
|
1387
|
+
"partial",
|
|
1388
|
+
"block",
|
|
1389
|
+
"off"
|
|
1390
|
+
]).optional(),
|
|
1391
|
+
draftChunk: BlockStreamingChunkSchema.optional(),
|
|
1392
|
+
maxLinesPerMessage: z.number().int().positive().optional(),
|
|
1393
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
1394
|
+
retry: RetryConfigSchema,
|
|
1395
|
+
actions: z.object({
|
|
1396
|
+
reactions: z.boolean().optional(),
|
|
1397
|
+
stickers: z.boolean().optional(),
|
|
1398
|
+
emojiUploads: z.boolean().optional(),
|
|
1399
|
+
stickerUploads: z.boolean().optional(),
|
|
1400
|
+
polls: z.boolean().optional(),
|
|
1401
|
+
permissions: z.boolean().optional(),
|
|
1402
|
+
messages: z.boolean().optional(),
|
|
1403
|
+
threads: z.boolean().optional(),
|
|
1404
|
+
pins: z.boolean().optional(),
|
|
1405
|
+
search: z.boolean().optional(),
|
|
1406
|
+
memberInfo: z.boolean().optional(),
|
|
1407
|
+
roleInfo: z.boolean().optional(),
|
|
1408
|
+
roles: z.boolean().optional(),
|
|
1409
|
+
channelInfo: z.boolean().optional(),
|
|
1410
|
+
voiceStatus: z.boolean().optional(),
|
|
1411
|
+
events: z.boolean().optional(),
|
|
1412
|
+
moderation: z.boolean().optional(),
|
|
1413
|
+
channels: z.boolean().optional(),
|
|
1414
|
+
presence: z.boolean().optional()
|
|
1415
|
+
}).strict().optional(),
|
|
1416
|
+
replyToMode: ReplyToModeSchema.optional(),
|
|
1417
|
+
dmPolicy: DmPolicySchema.optional(),
|
|
1418
|
+
allowFrom: DiscordIdListSchema.optional(),
|
|
1419
|
+
defaultTo: z.string().optional(),
|
|
1420
|
+
dm: DiscordDmSchema.optional(),
|
|
1421
|
+
guilds: z.record(z.string(), DiscordGuildSchema.optional()).optional(),
|
|
1422
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1423
|
+
execApprovals: z.object({
|
|
1424
|
+
enabled: z.boolean().optional(),
|
|
1425
|
+
approvers: DiscordIdListSchema.optional(),
|
|
1426
|
+
agentFilter: z.array(z.string()).optional(),
|
|
1427
|
+
sessionFilter: z.array(z.string()).optional(),
|
|
1428
|
+
cleanupAfterResolve: z.boolean().optional(),
|
|
1429
|
+
target: z.enum([
|
|
1430
|
+
"dm",
|
|
1431
|
+
"channel",
|
|
1432
|
+
"both"
|
|
1433
|
+
]).optional()
|
|
1434
|
+
}).strict().optional(),
|
|
1435
|
+
ui: DiscordUiSchema,
|
|
1436
|
+
slashCommand: z.object({ ephemeral: z.boolean().optional() }).strict().optional(),
|
|
1437
|
+
threadBindings: z.object({
|
|
1438
|
+
enabled: z.boolean().optional(),
|
|
1439
|
+
ttlHours: z.number().nonnegative().optional(),
|
|
1440
|
+
spawnSubagentSessions: z.boolean().optional()
|
|
1441
|
+
}).strict().optional(),
|
|
1442
|
+
intents: z.object({
|
|
1443
|
+
presence: z.boolean().optional(),
|
|
1444
|
+
guildMembers: z.boolean().optional()
|
|
1445
|
+
}).strict().optional(),
|
|
1446
|
+
voice: DiscordVoiceSchema,
|
|
1447
|
+
pluralkit: z.object({
|
|
1448
|
+
enabled: z.boolean().optional(),
|
|
1449
|
+
token: z.string().optional().register(sensitive)
|
|
1450
|
+
}).strict().optional(),
|
|
1451
|
+
responsePrefix: z.string().optional(),
|
|
1452
|
+
ackReaction: z.string().optional(),
|
|
1453
|
+
activity: z.string().optional(),
|
|
1454
|
+
status: z.enum([
|
|
1455
|
+
"online",
|
|
1456
|
+
"dnd",
|
|
1457
|
+
"idle",
|
|
1458
|
+
"invisible"
|
|
1459
|
+
]).optional(),
|
|
1460
|
+
activityType: z.union([
|
|
1461
|
+
z.literal(0),
|
|
1462
|
+
z.literal(1),
|
|
1463
|
+
z.literal(2),
|
|
1464
|
+
z.literal(3),
|
|
1465
|
+
z.literal(4),
|
|
1466
|
+
z.literal(5)
|
|
1467
|
+
]).optional(),
|
|
1468
|
+
activityUrl: z.string().url().optional()
|
|
1469
|
+
}).strict().superRefine((value, ctx) => {
|
|
1470
|
+
normalizeDiscordStreamingConfig(value);
|
|
1471
|
+
const activityText = typeof value.activity === "string" ? value.activity.trim() : "";
|
|
1472
|
+
const hasActivity = Boolean(activityText);
|
|
1473
|
+
const hasActivityType = value.activityType !== void 0;
|
|
1474
|
+
const activityUrl = typeof value.activityUrl === "string" ? value.activityUrl.trim() : "";
|
|
1475
|
+
const hasActivityUrl = Boolean(activityUrl);
|
|
1476
|
+
if ((hasActivityType || hasActivityUrl) && !hasActivity) ctx.addIssue({
|
|
1477
|
+
code: z.ZodIssueCode.custom,
|
|
1478
|
+
message: "channels.discord.activity is required when activityType or activityUrl is set",
|
|
1479
|
+
path: ["activity"]
|
|
1480
|
+
});
|
|
1481
|
+
if (value.activityType === 1 && !hasActivityUrl) ctx.addIssue({
|
|
1482
|
+
code: z.ZodIssueCode.custom,
|
|
1483
|
+
message: "channels.discord.activityUrl is required when activityType is 1 (Streaming)",
|
|
1484
|
+
path: ["activityUrl"]
|
|
1485
|
+
});
|
|
1486
|
+
if (hasActivityUrl && value.activityType !== 1) ctx.addIssue({
|
|
1487
|
+
code: z.ZodIssueCode.custom,
|
|
1488
|
+
message: "channels.discord.activityType must be 1 (Streaming) when activityUrl is set",
|
|
1489
|
+
path: ["activityType"]
|
|
1490
|
+
});
|
|
1491
|
+
requireOpenAllowFrom({
|
|
1492
|
+
policy: value.dmPolicy ?? value.dm?.policy ?? "pairing",
|
|
1493
|
+
allowFrom: value.allowFrom ?? value.dm?.allowFrom,
|
|
1494
|
+
ctx,
|
|
1495
|
+
path: [...value.allowFrom !== void 0 ? ["allowFrom"] : ["dm", "allowFrom"]],
|
|
1496
|
+
message: "channels.discord.dmPolicy=\"open\" requires channels.discord.allowFrom (or channels.discord.dm.allowFrom) to include \"*\""
|
|
1497
|
+
});
|
|
1498
|
+
});
|
|
1499
|
+
const DiscordConfigSchema = DiscordAccountSchema.extend({ accounts: z.record(z.string(), DiscordAccountSchema.optional()).optional() });
|
|
1500
|
+
const GoogleChatDmSchema = z.object({
|
|
1501
|
+
enabled: z.boolean().optional(),
|
|
1502
|
+
policy: DmPolicySchema.optional().default("pairing"),
|
|
1503
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional()
|
|
1504
|
+
}).strict().superRefine((value, ctx) => {
|
|
1505
|
+
requireOpenAllowFrom({
|
|
1506
|
+
policy: value.policy,
|
|
1507
|
+
allowFrom: value.allowFrom,
|
|
1508
|
+
ctx,
|
|
1509
|
+
path: ["allowFrom"],
|
|
1510
|
+
message: "channels.googlechat.dm.policy=\"open\" requires channels.googlechat.dm.allowFrom to include \"*\""
|
|
1511
|
+
});
|
|
1512
|
+
});
|
|
1513
|
+
const GoogleChatGroupSchema = z.object({
|
|
1514
|
+
enabled: z.boolean().optional(),
|
|
1515
|
+
allow: z.boolean().optional(),
|
|
1516
|
+
requireMention: z.boolean().optional(),
|
|
1517
|
+
users: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1518
|
+
systemPrompt: z.string().optional()
|
|
1519
|
+
}).strict();
|
|
1520
|
+
const GoogleChatAccountSchema = z.object({
|
|
1521
|
+
name: z.string().optional(),
|
|
1522
|
+
capabilities: z.array(z.string()).optional(),
|
|
1523
|
+
enabled: z.boolean().optional(),
|
|
1524
|
+
configWrites: z.boolean().optional(),
|
|
1525
|
+
allowBots: z.boolean().optional(),
|
|
1526
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
1527
|
+
requireMention: z.boolean().optional(),
|
|
1528
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1529
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1530
|
+
groups: z.record(z.string(), GoogleChatGroupSchema.optional()).optional(),
|
|
1531
|
+
defaultTo: z.string().optional(),
|
|
1532
|
+
serviceAccount: z.union([z.string(), z.record(z.string(), z.unknown())]).optional(),
|
|
1533
|
+
serviceAccountFile: z.string().optional(),
|
|
1534
|
+
audienceType: z.enum(["app-url", "project-number"]).optional(),
|
|
1535
|
+
audience: z.string().optional(),
|
|
1536
|
+
webhookPath: z.string().optional(),
|
|
1537
|
+
webhookUrl: z.string().optional(),
|
|
1538
|
+
botUser: z.string().optional(),
|
|
1539
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1540
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1541
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1542
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1543
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1544
|
+
blockStreaming: z.boolean().optional(),
|
|
1545
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1546
|
+
streamMode: z.enum([
|
|
1547
|
+
"replace",
|
|
1548
|
+
"status_final",
|
|
1549
|
+
"append"
|
|
1550
|
+
]).optional().default("replace"),
|
|
1551
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
1552
|
+
replyToMode: ReplyToModeSchema.optional(),
|
|
1553
|
+
actions: z.object({ reactions: z.boolean().optional() }).strict().optional(),
|
|
1554
|
+
dm: GoogleChatDmSchema.optional(),
|
|
1555
|
+
typingIndicator: z.enum([
|
|
1556
|
+
"none",
|
|
1557
|
+
"message",
|
|
1558
|
+
"reaction"
|
|
1559
|
+
]).optional(),
|
|
1560
|
+
responsePrefix: z.string().optional()
|
|
1561
|
+
}).strict();
|
|
1562
|
+
const GoogleChatConfigSchema = GoogleChatAccountSchema.extend({
|
|
1563
|
+
accounts: z.record(z.string(), GoogleChatAccountSchema.optional()).optional(),
|
|
1564
|
+
defaultAccount: z.string().optional()
|
|
1565
|
+
});
|
|
1566
|
+
const SlackDmSchema = z.object({
|
|
1567
|
+
enabled: z.boolean().optional(),
|
|
1568
|
+
policy: DmPolicySchema.optional(),
|
|
1569
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1570
|
+
groupEnabled: z.boolean().optional(),
|
|
1571
|
+
groupChannels: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1572
|
+
replyToMode: ReplyToModeSchema.optional()
|
|
1573
|
+
}).strict();
|
|
1574
|
+
const SlackChannelSchema = z.object({
|
|
1575
|
+
enabled: z.boolean().optional(),
|
|
1576
|
+
allow: z.boolean().optional(),
|
|
1577
|
+
requireMention: z.boolean().optional(),
|
|
1578
|
+
tools: ToolPolicySchema,
|
|
1579
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1580
|
+
allowBots: z.boolean().optional(),
|
|
1581
|
+
users: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1582
|
+
skills: z.array(z.string()).optional(),
|
|
1583
|
+
systemPrompt: z.string().optional()
|
|
1584
|
+
}).strict();
|
|
1585
|
+
const SlackThreadSchema = z.object({
|
|
1586
|
+
historyScope: z.enum(["thread", "channel"]).optional(),
|
|
1587
|
+
inheritParent: z.boolean().optional(),
|
|
1588
|
+
initialHistoryLimit: z.number().int().min(0).optional()
|
|
1589
|
+
}).strict();
|
|
1590
|
+
const SlackReplyToModeByChatTypeSchema = z.object({
|
|
1591
|
+
direct: ReplyToModeSchema.optional(),
|
|
1592
|
+
group: ReplyToModeSchema.optional(),
|
|
1593
|
+
channel: ReplyToModeSchema.optional()
|
|
1594
|
+
}).strict();
|
|
1595
|
+
const SlackAccountSchema = z.object({
|
|
1596
|
+
name: z.string().optional(),
|
|
1597
|
+
mode: z.enum(["socket", "http"]).optional(),
|
|
1598
|
+
signingSecret: z.string().optional().register(sensitive),
|
|
1599
|
+
webhookPath: z.string().optional(),
|
|
1600
|
+
capabilities: z.array(z.string()).optional(),
|
|
1601
|
+
markdown: MarkdownConfigSchema,
|
|
1602
|
+
enabled: z.boolean().optional(),
|
|
1603
|
+
commands: ProviderCommandsSchema,
|
|
1604
|
+
configWrites: z.boolean().optional(),
|
|
1605
|
+
botToken: z.string().optional().register(sensitive),
|
|
1606
|
+
appToken: z.string().optional().register(sensitive),
|
|
1607
|
+
userToken: z.string().optional().register(sensitive),
|
|
1608
|
+
userTokenReadOnly: z.boolean().optional().default(true),
|
|
1609
|
+
allowBots: z.boolean().optional(),
|
|
1610
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
1611
|
+
requireMention: z.boolean().optional(),
|
|
1612
|
+
groupPolicy: GroupPolicySchema.optional(),
|
|
1613
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1614
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1615
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1616
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1617
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1618
|
+
blockStreaming: z.boolean().optional(),
|
|
1619
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1620
|
+
streaming: z.union([z.boolean(), z.enum([
|
|
1621
|
+
"off",
|
|
1622
|
+
"partial",
|
|
1623
|
+
"block",
|
|
1624
|
+
"progress"
|
|
1625
|
+
])]).optional(),
|
|
1626
|
+
nativeStreaming: z.boolean().optional(),
|
|
1627
|
+
streamMode: z.enum([
|
|
1628
|
+
"replace",
|
|
1629
|
+
"status_final",
|
|
1630
|
+
"append"
|
|
1631
|
+
]).optional(),
|
|
1632
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
1633
|
+
reactionNotifications: z.enum([
|
|
1634
|
+
"off",
|
|
1635
|
+
"own",
|
|
1636
|
+
"all",
|
|
1637
|
+
"allowlist"
|
|
1638
|
+
]).optional(),
|
|
1639
|
+
reactionAllowlist: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1640
|
+
replyToMode: ReplyToModeSchema.optional(),
|
|
1641
|
+
replyToModeByChatType: SlackReplyToModeByChatTypeSchema.optional(),
|
|
1642
|
+
thread: SlackThreadSchema.optional(),
|
|
1643
|
+
actions: z.object({
|
|
1644
|
+
reactions: z.boolean().optional(),
|
|
1645
|
+
messages: z.boolean().optional(),
|
|
1646
|
+
pins: z.boolean().optional(),
|
|
1647
|
+
search: z.boolean().optional(),
|
|
1648
|
+
permissions: z.boolean().optional(),
|
|
1649
|
+
memberInfo: z.boolean().optional(),
|
|
1650
|
+
channelInfo: z.boolean().optional(),
|
|
1651
|
+
emojiList: z.boolean().optional()
|
|
1652
|
+
}).strict().optional(),
|
|
1653
|
+
slashCommand: z.object({
|
|
1654
|
+
enabled: z.boolean().optional(),
|
|
1655
|
+
name: z.string().optional(),
|
|
1656
|
+
sessionPrefix: z.string().optional(),
|
|
1657
|
+
ephemeral: z.boolean().optional()
|
|
1658
|
+
}).strict().optional(),
|
|
1659
|
+
dmPolicy: DmPolicySchema.optional(),
|
|
1660
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1661
|
+
defaultTo: z.string().optional(),
|
|
1662
|
+
dm: SlackDmSchema.optional(),
|
|
1663
|
+
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
1664
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1665
|
+
responsePrefix: z.string().optional(),
|
|
1666
|
+
ackReaction: z.string().optional()
|
|
1667
|
+
}).strict().superRefine((value, ctx) => {
|
|
1668
|
+
normalizeSlackStreamingConfig(value);
|
|
1669
|
+
requireOpenAllowFrom({
|
|
1670
|
+
policy: value.dmPolicy ?? value.dm?.policy ?? "pairing",
|
|
1671
|
+
allowFrom: value.allowFrom ?? value.dm?.allowFrom,
|
|
1672
|
+
ctx,
|
|
1673
|
+
path: [...value.allowFrom !== void 0 ? ["allowFrom"] : ["dm", "allowFrom"]],
|
|
1674
|
+
message: "channels.slack.dmPolicy=\"open\" requires channels.slack.allowFrom (or channels.slack.dm.allowFrom) to include \"*\""
|
|
1675
|
+
});
|
|
1676
|
+
});
|
|
1677
|
+
const SlackConfigSchema = SlackAccountSchema.safeExtend({
|
|
1678
|
+
mode: z.enum(["socket", "http"]).optional().default("socket"),
|
|
1679
|
+
signingSecret: z.string().optional().register(sensitive),
|
|
1680
|
+
webhookPath: z.string().optional().default("/slack/events"),
|
|
1681
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1682
|
+
accounts: z.record(z.string(), SlackAccountSchema.optional()).optional()
|
|
1683
|
+
}).superRefine((value, ctx) => {
|
|
1684
|
+
const baseMode = value.mode ?? "socket";
|
|
1685
|
+
if (baseMode === "http" && !value.signingSecret) ctx.addIssue({
|
|
1686
|
+
code: z.ZodIssueCode.custom,
|
|
1687
|
+
message: "channels.slack.mode=\"http\" requires channels.slack.signingSecret",
|
|
1688
|
+
path: ["signingSecret"]
|
|
1689
|
+
});
|
|
1690
|
+
if (!value.accounts) return;
|
|
1691
|
+
for (const [accountId, account] of Object.entries(value.accounts)) {
|
|
1692
|
+
if (!account) continue;
|
|
1693
|
+
if (account.enabled === false) continue;
|
|
1694
|
+
if ((account.mode ?? baseMode) !== "http") continue;
|
|
1695
|
+
if (!(account.signingSecret ?? value.signingSecret)) ctx.addIssue({
|
|
1696
|
+
code: z.ZodIssueCode.custom,
|
|
1697
|
+
message: "channels.slack.accounts.*.mode=\"http\" requires channels.slack.signingSecret or channels.slack.accounts.*.signingSecret",
|
|
1698
|
+
path: [
|
|
1699
|
+
"accounts",
|
|
1700
|
+
accountId,
|
|
1701
|
+
"signingSecret"
|
|
1702
|
+
]
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
const SignalAccountSchemaBase = z.object({
|
|
1707
|
+
name: z.string().optional(),
|
|
1708
|
+
capabilities: z.array(z.string()).optional(),
|
|
1709
|
+
markdown: MarkdownConfigSchema,
|
|
1710
|
+
enabled: z.boolean().optional(),
|
|
1711
|
+
configWrites: z.boolean().optional(),
|
|
1712
|
+
account: z.string().optional(),
|
|
1713
|
+
httpUrl: z.string().optional(),
|
|
1714
|
+
httpHost: z.string().optional(),
|
|
1715
|
+
httpPort: z.number().int().positive().optional(),
|
|
1716
|
+
cliPath: ExecutableTokenSchema.optional(),
|
|
1717
|
+
autoStart: z.boolean().optional(),
|
|
1718
|
+
startupTimeoutMs: z.number().int().min(1e3).max(12e4).optional(),
|
|
1719
|
+
receiveMode: z.union([z.literal("on-start"), z.literal("manual")]).optional(),
|
|
1720
|
+
ignoreAttachments: z.boolean().optional(),
|
|
1721
|
+
ignoreStories: z.boolean().optional(),
|
|
1722
|
+
sendReadReceipts: z.boolean().optional(),
|
|
1723
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1724
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1725
|
+
defaultTo: z.string().optional(),
|
|
1726
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1727
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1728
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1729
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1730
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1731
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1732
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1733
|
+
blockStreaming: z.boolean().optional(),
|
|
1734
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1735
|
+
mediaMaxMb: z.number().int().positive().optional(),
|
|
1736
|
+
reactionNotifications: z.enum([
|
|
1737
|
+
"off",
|
|
1738
|
+
"own",
|
|
1739
|
+
"all",
|
|
1740
|
+
"allowlist"
|
|
1741
|
+
]).optional(),
|
|
1742
|
+
reactionAllowlist: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1743
|
+
actions: z.object({ reactions: z.boolean().optional() }).strict().optional(),
|
|
1744
|
+
reactionLevel: z.enum([
|
|
1745
|
+
"off",
|
|
1746
|
+
"ack",
|
|
1747
|
+
"minimal",
|
|
1748
|
+
"extensive"
|
|
1749
|
+
]).optional(),
|
|
1750
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1751
|
+
responsePrefix: z.string().optional()
|
|
1752
|
+
}).strict();
|
|
1753
|
+
const SignalAccountSchema = SignalAccountSchemaBase.superRefine((value, ctx) => {
|
|
1754
|
+
requireOpenAllowFrom({
|
|
1755
|
+
policy: value.dmPolicy,
|
|
1756
|
+
allowFrom: value.allowFrom,
|
|
1757
|
+
ctx,
|
|
1758
|
+
path: ["allowFrom"],
|
|
1759
|
+
message: "channels.signal.dmPolicy=\"open\" requires channels.signal.allowFrom to include \"*\""
|
|
1760
|
+
});
|
|
1761
|
+
});
|
|
1762
|
+
const SignalConfigSchema = SignalAccountSchemaBase.extend({ accounts: z.record(z.string(), SignalAccountSchema.optional()).optional() }).superRefine((value, ctx) => {
|
|
1763
|
+
requireOpenAllowFrom({
|
|
1764
|
+
policy: value.dmPolicy,
|
|
1765
|
+
allowFrom: value.allowFrom,
|
|
1766
|
+
ctx,
|
|
1767
|
+
path: ["allowFrom"],
|
|
1768
|
+
message: "channels.signal.dmPolicy=\"open\" requires channels.signal.allowFrom to include \"*\""
|
|
1769
|
+
});
|
|
1770
|
+
});
|
|
1771
|
+
const IrcGroupSchema = z.object({
|
|
1772
|
+
requireMention: z.boolean().optional(),
|
|
1773
|
+
tools: ToolPolicySchema,
|
|
1774
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1775
|
+
skills: z.array(z.string()).optional(),
|
|
1776
|
+
enabled: z.boolean().optional(),
|
|
1777
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1778
|
+
systemPrompt: z.string().optional()
|
|
1779
|
+
}).strict();
|
|
1780
|
+
const IrcNickServSchema = z.object({
|
|
1781
|
+
enabled: z.boolean().optional(),
|
|
1782
|
+
service: z.string().optional(),
|
|
1783
|
+
password: z.string().optional().register(sensitive),
|
|
1784
|
+
passwordFile: z.string().optional(),
|
|
1785
|
+
register: z.boolean().optional(),
|
|
1786
|
+
registerEmail: z.string().optional()
|
|
1787
|
+
}).strict();
|
|
1788
|
+
const IrcAccountSchemaBase = z.object({
|
|
1789
|
+
name: z.string().optional(),
|
|
1790
|
+
capabilities: z.array(z.string()).optional(),
|
|
1791
|
+
markdown: MarkdownConfigSchema,
|
|
1792
|
+
enabled: z.boolean().optional(),
|
|
1793
|
+
configWrites: z.boolean().optional(),
|
|
1794
|
+
host: z.string().optional(),
|
|
1795
|
+
port: z.number().int().min(1).max(65535).optional(),
|
|
1796
|
+
tls: z.boolean().optional(),
|
|
1797
|
+
nick: z.string().optional(),
|
|
1798
|
+
username: z.string().optional(),
|
|
1799
|
+
realname: z.string().optional(),
|
|
1800
|
+
password: z.string().optional().register(sensitive),
|
|
1801
|
+
passwordFile: z.string().optional(),
|
|
1802
|
+
nickserv: IrcNickServSchema.optional(),
|
|
1803
|
+
channels: z.array(z.string()).optional(),
|
|
1804
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1805
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1806
|
+
defaultTo: z.string().optional(),
|
|
1807
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1808
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1809
|
+
groups: z.record(z.string(), IrcGroupSchema.optional()).optional(),
|
|
1810
|
+
mentionPatterns: z.array(z.string()).optional(),
|
|
1811
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1812
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1813
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1814
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1815
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1816
|
+
blockStreaming: z.boolean().optional(),
|
|
1817
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1818
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
1819
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1820
|
+
responsePrefix: z.string().optional()
|
|
1821
|
+
}).strict();
|
|
1822
|
+
function refineIrcAllowFromAndNickserv(value, ctx) {
|
|
1823
|
+
requireOpenAllowFrom({
|
|
1824
|
+
policy: value.dmPolicy,
|
|
1825
|
+
allowFrom: value.allowFrom,
|
|
1826
|
+
ctx,
|
|
1827
|
+
path: ["allowFrom"],
|
|
1828
|
+
message: "channels.irc.dmPolicy=\"open\" requires channels.irc.allowFrom to include \"*\""
|
|
1829
|
+
});
|
|
1830
|
+
if (value.nickserv?.register && !value.nickserv.registerEmail?.trim()) ctx.addIssue({
|
|
1831
|
+
code: z.ZodIssueCode.custom,
|
|
1832
|
+
path: ["nickserv", "registerEmail"],
|
|
1833
|
+
message: "channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail"
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
const IrcAccountSchema = IrcAccountSchemaBase.superRefine((value, ctx) => {
|
|
1837
|
+
refineIrcAllowFromAndNickserv(value, ctx);
|
|
1838
|
+
});
|
|
1839
|
+
const IrcConfigSchema = IrcAccountSchemaBase.extend({ accounts: z.record(z.string(), IrcAccountSchema.optional()).optional() }).superRefine((value, ctx) => {
|
|
1840
|
+
refineIrcAllowFromAndNickserv(value, ctx);
|
|
1841
|
+
});
|
|
1842
|
+
const IMessageAccountSchemaBase = z.object({
|
|
1843
|
+
name: z.string().optional(),
|
|
1844
|
+
capabilities: z.array(z.string()).optional(),
|
|
1845
|
+
markdown: MarkdownConfigSchema,
|
|
1846
|
+
enabled: z.boolean().optional(),
|
|
1847
|
+
configWrites: z.boolean().optional(),
|
|
1848
|
+
cliPath: ExecutableTokenSchema.optional(),
|
|
1849
|
+
dbPath: z.string().optional(),
|
|
1850
|
+
remoteHost: z.string().refine(isSafeScpRemoteHost, "expected SSH host or user@host (no spaces/options)").optional(),
|
|
1851
|
+
service: z.union([
|
|
1852
|
+
z.literal("imessage"),
|
|
1853
|
+
z.literal("sms"),
|
|
1854
|
+
z.literal("auto")
|
|
1855
|
+
]).optional(),
|
|
1856
|
+
region: z.string().optional(),
|
|
1857
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1858
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1859
|
+
defaultTo: z.string().optional(),
|
|
1860
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
1861
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1862
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1863
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1864
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1865
|
+
includeAttachments: z.boolean().optional(),
|
|
1866
|
+
attachmentRoots: z.array(z.string().refine(isValidInboundPathRootPattern, "expected absolute path root")).optional(),
|
|
1867
|
+
remoteAttachmentRoots: z.array(z.string().refine(isValidInboundPathRootPattern, "expected absolute path root")).optional(),
|
|
1868
|
+
mediaMaxMb: z.number().int().positive().optional(),
|
|
1869
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1870
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1871
|
+
blockStreaming: z.boolean().optional(),
|
|
1872
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1873
|
+
groups: z.record(z.string(), z.object({
|
|
1874
|
+
requireMention: z.boolean().optional(),
|
|
1875
|
+
tools: ToolPolicySchema,
|
|
1876
|
+
toolsBySender: ToolPolicyBySenderSchema$1
|
|
1877
|
+
}).strict().optional()).optional(),
|
|
1878
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1879
|
+
responsePrefix: z.string().optional()
|
|
1880
|
+
}).strict();
|
|
1881
|
+
const IMessageAccountSchema = IMessageAccountSchemaBase.superRefine((value, ctx) => {
|
|
1882
|
+
requireOpenAllowFrom({
|
|
1883
|
+
policy: value.dmPolicy,
|
|
1884
|
+
allowFrom: value.allowFrom,
|
|
1885
|
+
ctx,
|
|
1886
|
+
path: ["allowFrom"],
|
|
1887
|
+
message: "channels.imessage.dmPolicy=\"open\" requires channels.imessage.allowFrom to include \"*\""
|
|
1888
|
+
});
|
|
1889
|
+
});
|
|
1890
|
+
const IMessageConfigSchema = IMessageAccountSchemaBase.extend({ accounts: z.record(z.string(), IMessageAccountSchema.optional()).optional() }).superRefine((value, ctx) => {
|
|
1891
|
+
requireOpenAllowFrom({
|
|
1892
|
+
policy: value.dmPolicy,
|
|
1893
|
+
allowFrom: value.allowFrom,
|
|
1894
|
+
ctx,
|
|
1895
|
+
path: ["allowFrom"],
|
|
1896
|
+
message: "channels.imessage.dmPolicy=\"open\" requires channels.imessage.allowFrom to include \"*\""
|
|
1897
|
+
});
|
|
1898
|
+
});
|
|
1899
|
+
const BlueBubblesAllowFromEntry = z.union([z.string(), z.number()]);
|
|
1900
|
+
const BlueBubblesActionSchema = z.object({
|
|
1901
|
+
reactions: z.boolean().optional(),
|
|
1902
|
+
edit: z.boolean().optional(),
|
|
1903
|
+
unsend: z.boolean().optional(),
|
|
1904
|
+
reply: z.boolean().optional(),
|
|
1905
|
+
sendWithEffect: z.boolean().optional(),
|
|
1906
|
+
renameGroup: z.boolean().optional(),
|
|
1907
|
+
setGroupIcon: z.boolean().optional(),
|
|
1908
|
+
addParticipant: z.boolean().optional(),
|
|
1909
|
+
removeParticipant: z.boolean().optional(),
|
|
1910
|
+
leaveGroup: z.boolean().optional(),
|
|
1911
|
+
sendAttachment: z.boolean().optional()
|
|
1912
|
+
}).strict().optional();
|
|
1913
|
+
const BlueBubblesGroupConfigSchema = z.object({
|
|
1914
|
+
requireMention: z.boolean().optional(),
|
|
1915
|
+
tools: ToolPolicySchema,
|
|
1916
|
+
toolsBySender: ToolPolicyBySenderSchema$1
|
|
1917
|
+
}).strict();
|
|
1918
|
+
const BlueBubblesAccountSchemaBase = z.object({
|
|
1919
|
+
name: z.string().optional(),
|
|
1920
|
+
capabilities: z.array(z.string()).optional(),
|
|
1921
|
+
markdown: MarkdownConfigSchema,
|
|
1922
|
+
configWrites: z.boolean().optional(),
|
|
1923
|
+
enabled: z.boolean().optional(),
|
|
1924
|
+
serverUrl: z.string().optional(),
|
|
1925
|
+
password: z.string().optional().register(sensitive),
|
|
1926
|
+
webhookPath: z.string().optional(),
|
|
1927
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1928
|
+
allowFrom: z.array(BlueBubblesAllowFromEntry).optional(),
|
|
1929
|
+
groupAllowFrom: z.array(BlueBubblesAllowFromEntry).optional(),
|
|
1930
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1931
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
1932
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
1933
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
1934
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1935
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1936
|
+
mediaMaxMb: z.number().int().positive().optional(),
|
|
1937
|
+
mediaLocalRoots: z.array(z.string()).optional(),
|
|
1938
|
+
sendReadReceipts: z.boolean().optional(),
|
|
1939
|
+
blockStreaming: z.boolean().optional(),
|
|
1940
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
1941
|
+
groups: z.record(z.string(), BlueBubblesGroupConfigSchema.optional()).optional(),
|
|
1942
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
1943
|
+
responsePrefix: z.string().optional()
|
|
1944
|
+
}).strict();
|
|
1945
|
+
const BlueBubblesAccountSchema = BlueBubblesAccountSchemaBase.superRefine((value, ctx) => {
|
|
1946
|
+
requireOpenAllowFrom({
|
|
1947
|
+
policy: value.dmPolicy,
|
|
1948
|
+
allowFrom: value.allowFrom,
|
|
1949
|
+
ctx,
|
|
1950
|
+
path: ["allowFrom"],
|
|
1951
|
+
message: "channels.bluebubbles.accounts.*.dmPolicy=\"open\" requires allowFrom to include \"*\""
|
|
1952
|
+
});
|
|
1953
|
+
});
|
|
1954
|
+
const BlueBubblesConfigSchema = BlueBubblesAccountSchemaBase.extend({
|
|
1955
|
+
accounts: z.record(z.string(), BlueBubblesAccountSchema.optional()).optional(),
|
|
1956
|
+
actions: BlueBubblesActionSchema
|
|
1957
|
+
}).superRefine((value, ctx) => {
|
|
1958
|
+
requireOpenAllowFrom({
|
|
1959
|
+
policy: value.dmPolicy,
|
|
1960
|
+
allowFrom: value.allowFrom,
|
|
1961
|
+
ctx,
|
|
1962
|
+
path: ["allowFrom"],
|
|
1963
|
+
message: "channels.bluebubbles.dmPolicy=\"open\" requires channels.bluebubbles.allowFrom to include \"*\""
|
|
1964
|
+
});
|
|
1965
|
+
});
|
|
1966
|
+
const MSTeamsChannelSchema = z.object({
|
|
1967
|
+
requireMention: z.boolean().optional(),
|
|
1968
|
+
tools: ToolPolicySchema,
|
|
1969
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1970
|
+
replyStyle: MSTeamsReplyStyleSchema.optional()
|
|
1971
|
+
}).strict();
|
|
1972
|
+
const MSTeamsTeamSchema = z.object({
|
|
1973
|
+
requireMention: z.boolean().optional(),
|
|
1974
|
+
tools: ToolPolicySchema,
|
|
1975
|
+
toolsBySender: ToolPolicyBySenderSchema$1,
|
|
1976
|
+
replyStyle: MSTeamsReplyStyleSchema.optional(),
|
|
1977
|
+
channels: z.record(z.string(), MSTeamsChannelSchema.optional()).optional()
|
|
1978
|
+
}).strict();
|
|
1979
|
+
const MSTeamsConfigSchema = z.object({
|
|
1980
|
+
enabled: z.boolean().optional(),
|
|
1981
|
+
capabilities: z.array(z.string()).optional(),
|
|
1982
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
1983
|
+
markdown: MarkdownConfigSchema,
|
|
1984
|
+
configWrites: z.boolean().optional(),
|
|
1985
|
+
appId: z.string().optional(),
|
|
1986
|
+
appPassword: z.string().optional().register(sensitive),
|
|
1987
|
+
tenantId: z.string().optional(),
|
|
1988
|
+
webhook: z.object({
|
|
1989
|
+
port: z.number().int().positive().optional(),
|
|
1990
|
+
path: z.string().optional()
|
|
1991
|
+
}).strict().optional(),
|
|
1992
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
1993
|
+
allowFrom: z.array(z.string()).optional(),
|
|
1994
|
+
defaultTo: z.string().optional(),
|
|
1995
|
+
groupAllowFrom: z.array(z.string()).optional(),
|
|
1996
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
1997
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
1998
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
1999
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
2000
|
+
mediaAllowHosts: z.array(z.string()).optional(),
|
|
2001
|
+
mediaAuthAllowHosts: z.array(z.string()).optional(),
|
|
2002
|
+
requireMention: z.boolean().optional(),
|
|
2003
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
2004
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
2005
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
2006
|
+
replyStyle: MSTeamsReplyStyleSchema.optional(),
|
|
2007
|
+
teams: z.record(z.string(), MSTeamsTeamSchema.optional()).optional(),
|
|
2008
|
+
mediaMaxMb: z.number().positive().optional(),
|
|
2009
|
+
sharePointSiteId: z.string().optional(),
|
|
2010
|
+
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
2011
|
+
responsePrefix: z.string().optional()
|
|
2012
|
+
}).strict().superRefine((value, ctx) => {
|
|
2013
|
+
requireOpenAllowFrom({
|
|
2014
|
+
policy: value.dmPolicy,
|
|
2015
|
+
allowFrom: value.allowFrom,
|
|
2016
|
+
ctx,
|
|
2017
|
+
path: ["allowFrom"],
|
|
2018
|
+
message: "channels.msteams.dmPolicy=\"open\" requires channels.msteams.allowFrom to include \"*\""
|
|
2019
|
+
});
|
|
2020
|
+
});
|
|
2021
|
+
|
|
2022
|
+
//#endregion
|
|
2023
|
+
//#region src/config/zod-schema.providers-whatsapp.ts
|
|
2024
|
+
const ToolPolicyBySenderSchema = z.record(z.string(), ToolPolicySchema).optional();
|
|
2025
|
+
const WhatsAppGroupEntrySchema = z.object({
|
|
2026
|
+
requireMention: z.boolean().optional(),
|
|
2027
|
+
tools: ToolPolicySchema,
|
|
2028
|
+
toolsBySender: ToolPolicyBySenderSchema
|
|
2029
|
+
}).strict().optional();
|
|
2030
|
+
const WhatsAppGroupsSchema = z.record(z.string(), WhatsAppGroupEntrySchema).optional();
|
|
2031
|
+
const WhatsAppAckReactionSchema = z.object({
|
|
2032
|
+
emoji: z.string().optional(),
|
|
2033
|
+
direct: z.boolean().optional().default(true),
|
|
2034
|
+
group: z.enum([
|
|
2035
|
+
"always",
|
|
2036
|
+
"mentions",
|
|
2037
|
+
"never"
|
|
2038
|
+
]).optional().default("mentions")
|
|
2039
|
+
}).strict().optional();
|
|
2040
|
+
const WhatsAppSharedSchema = z.object({
|
|
2041
|
+
enabled: z.boolean().optional(),
|
|
2042
|
+
capabilities: z.array(z.string()).optional(),
|
|
2043
|
+
markdown: MarkdownConfigSchema,
|
|
2044
|
+
configWrites: z.boolean().optional(),
|
|
2045
|
+
sendReadReceipts: z.boolean().optional(),
|
|
2046
|
+
messagePrefix: z.string().optional(),
|
|
2047
|
+
responsePrefix: z.string().optional(),
|
|
2048
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
2049
|
+
selfChatMode: z.boolean().optional(),
|
|
2050
|
+
allowFrom: z.array(z.string()).optional(),
|
|
2051
|
+
defaultTo: z.string().optional(),
|
|
2052
|
+
groupAllowFrom: z.array(z.string()).optional(),
|
|
2053
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
2054
|
+
historyLimit: z.number().int().min(0).optional(),
|
|
2055
|
+
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
2056
|
+
dms: z.record(z.string(), DmConfigSchema.optional()).optional(),
|
|
2057
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
2058
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
2059
|
+
blockStreaming: z.boolean().optional(),
|
|
2060
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
2061
|
+
groups: WhatsAppGroupsSchema,
|
|
2062
|
+
ackReaction: WhatsAppAckReactionSchema,
|
|
2063
|
+
debounceMs: z.number().int().nonnegative().optional().default(0),
|
|
2064
|
+
heartbeat: ChannelHeartbeatVisibilitySchema
|
|
2065
|
+
});
|
|
2066
|
+
function enforceOpenDmPolicyAllowFromStar(params) {
|
|
2067
|
+
if (params.dmPolicy !== "open") return;
|
|
2068
|
+
if ((Array.isArray(params.allowFrom) ? params.allowFrom : []).map((v) => String(v).trim()).filter(Boolean).includes("*")) return;
|
|
2069
|
+
params.ctx.addIssue({
|
|
2070
|
+
code: z.ZodIssueCode.custom,
|
|
2071
|
+
path: ["allowFrom"],
|
|
2072
|
+
message: params.message
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
const WhatsAppAccountSchema = WhatsAppSharedSchema.extend({
|
|
2076
|
+
name: z.string().optional(),
|
|
2077
|
+
enabled: z.boolean().optional(),
|
|
2078
|
+
authDir: z.string().optional(),
|
|
2079
|
+
mediaMaxMb: z.number().int().positive().optional()
|
|
2080
|
+
}).strict().superRefine((value, ctx) => {
|
|
2081
|
+
enforceOpenDmPolicyAllowFromStar({
|
|
2082
|
+
dmPolicy: value.dmPolicy,
|
|
2083
|
+
allowFrom: value.allowFrom,
|
|
2084
|
+
ctx,
|
|
2085
|
+
message: "channels.whatsapp.accounts.*.dmPolicy=\"open\" requires allowFrom to include \"*\""
|
|
2086
|
+
});
|
|
2087
|
+
});
|
|
2088
|
+
const WhatsAppConfigSchema = WhatsAppSharedSchema.extend({
|
|
2089
|
+
accounts: z.record(z.string(), WhatsAppAccountSchema.optional()).optional(),
|
|
2090
|
+
mediaMaxMb: z.number().int().positive().optional().default(50),
|
|
2091
|
+
actions: z.object({
|
|
2092
|
+
reactions: z.boolean().optional(),
|
|
2093
|
+
sendMessage: z.boolean().optional(),
|
|
2094
|
+
polls: z.boolean().optional()
|
|
2095
|
+
}).strict().optional()
|
|
2096
|
+
}).strict().superRefine((value, ctx) => {
|
|
2097
|
+
enforceOpenDmPolicyAllowFromStar({
|
|
2098
|
+
dmPolicy: value.dmPolicy,
|
|
2099
|
+
allowFrom: value.allowFrom,
|
|
2100
|
+
ctx,
|
|
2101
|
+
message: "channels.whatsapp.dmPolicy=\"open\" requires channels.whatsapp.allowFrom to include \"*\""
|
|
2102
|
+
});
|
|
2103
|
+
});
|
|
2104
|
+
|
|
2105
|
+
//#endregion
|
|
2106
|
+
//#region src/config/zod-schema.providers.ts
|
|
2107
|
+
const ChannelModelByChannelSchema = z.record(z.string(), z.record(z.string(), z.string())).optional();
|
|
2108
|
+
const ChannelsSchema = z.object({
|
|
2109
|
+
defaults: z.object({
|
|
2110
|
+
groupPolicy: GroupPolicySchema.optional(),
|
|
2111
|
+
heartbeat: ChannelHeartbeatVisibilitySchema
|
|
2112
|
+
}).strict().optional(),
|
|
2113
|
+
modelByChannel: ChannelModelByChannelSchema,
|
|
2114
|
+
whatsapp: WhatsAppConfigSchema.optional(),
|
|
2115
|
+
telegram: TelegramConfigSchema.optional(),
|
|
2116
|
+
discord: DiscordConfigSchema.optional(),
|
|
2117
|
+
irc: IrcConfigSchema.optional(),
|
|
2118
|
+
googlechat: GoogleChatConfigSchema.optional(),
|
|
2119
|
+
slack: SlackConfigSchema.optional(),
|
|
2120
|
+
signal: SignalConfigSchema.optional(),
|
|
2121
|
+
imessage: IMessageConfigSchema.optional(),
|
|
2122
|
+
bluebubbles: BlueBubblesConfigSchema.optional(),
|
|
2123
|
+
msteams: MSTeamsConfigSchema.optional()
|
|
2124
|
+
}).passthrough().optional();
|
|
2125
|
+
|
|
2126
|
+
//#endregion
|
|
2127
|
+
//#region src/config/zod-schema.session.ts
|
|
2128
|
+
const SessionResetConfigSchema = z.object({
|
|
2129
|
+
mode: z.union([z.literal("daily"), z.literal("idle")]).optional(),
|
|
2130
|
+
atHour: z.number().int().min(0).max(23).optional(),
|
|
2131
|
+
idleMinutes: z.number().int().positive().optional()
|
|
2132
|
+
}).strict();
|
|
2133
|
+
const SessionSendPolicySchema = createAllowDenyChannelRulesSchema();
|
|
2134
|
+
const SessionSchema = z.object({
|
|
2135
|
+
scope: z.union([z.literal("per-sender"), z.literal("global")]).optional(),
|
|
2136
|
+
dmScope: z.union([
|
|
2137
|
+
z.literal("main"),
|
|
2138
|
+
z.literal("per-peer"),
|
|
2139
|
+
z.literal("per-channel-peer"),
|
|
2140
|
+
z.literal("per-account-channel-peer")
|
|
2141
|
+
]).optional(),
|
|
2142
|
+
identityLinks: z.record(z.string(), z.array(z.string())).optional(),
|
|
2143
|
+
resetTriggers: z.array(z.string()).optional(),
|
|
2144
|
+
idleMinutes: z.number().int().positive().optional(),
|
|
2145
|
+
reset: SessionResetConfigSchema.optional(),
|
|
2146
|
+
resetByType: z.object({
|
|
2147
|
+
direct: SessionResetConfigSchema.optional(),
|
|
2148
|
+
dm: SessionResetConfigSchema.optional(),
|
|
2149
|
+
group: SessionResetConfigSchema.optional(),
|
|
2150
|
+
thread: SessionResetConfigSchema.optional()
|
|
2151
|
+
}).strict().optional(),
|
|
2152
|
+
resetByChannel: z.record(z.string(), SessionResetConfigSchema).optional(),
|
|
2153
|
+
store: z.string().optional(),
|
|
2154
|
+
typingIntervalSeconds: z.number().int().positive().optional(),
|
|
2155
|
+
typingMode: TypingModeSchema.optional(),
|
|
2156
|
+
mainKey: z.string().optional(),
|
|
2157
|
+
sendPolicy: SessionSendPolicySchema.optional(),
|
|
2158
|
+
agentToAgent: z.object({ maxPingPongTurns: z.number().int().min(0).max(5).optional() }).strict().optional(),
|
|
2159
|
+
threadBindings: z.object({
|
|
2160
|
+
enabled: z.boolean().optional(),
|
|
2161
|
+
ttlHours: z.number().nonnegative().optional()
|
|
2162
|
+
}).strict().optional(),
|
|
2163
|
+
maintenance: z.object({
|
|
2164
|
+
mode: z.enum(["enforce", "warn"]).optional(),
|
|
2165
|
+
pruneAfter: z.union([z.string(), z.number()]).optional(),
|
|
2166
|
+
pruneDays: z.number().int().positive().optional(),
|
|
2167
|
+
maxEntries: z.number().int().positive().optional(),
|
|
2168
|
+
rotateBytes: z.union([z.string(), z.number()]).optional(),
|
|
2169
|
+
resetArchiveRetention: z.union([
|
|
2170
|
+
z.string(),
|
|
2171
|
+
z.number(),
|
|
2172
|
+
z.literal(false)
|
|
2173
|
+
]).optional(),
|
|
2174
|
+
maxDiskBytes: z.union([z.string(), z.number()]).optional(),
|
|
2175
|
+
highWaterBytes: z.union([z.string(), z.number()]).optional()
|
|
2176
|
+
}).strict().superRefine((val, ctx) => {
|
|
2177
|
+
if (val.pruneAfter !== void 0) try {
|
|
2178
|
+
parseDurationMs(String(val.pruneAfter).trim(), { defaultUnit: "d" });
|
|
2179
|
+
} catch {
|
|
2180
|
+
ctx.addIssue({
|
|
2181
|
+
code: z.ZodIssueCode.custom,
|
|
2182
|
+
path: ["pruneAfter"],
|
|
2183
|
+
message: "invalid duration (use ms, s, m, h, d)"
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
if (val.rotateBytes !== void 0) try {
|
|
2187
|
+
parseByteSize(String(val.rotateBytes).trim(), { defaultUnit: "b" });
|
|
2188
|
+
} catch {
|
|
2189
|
+
ctx.addIssue({
|
|
2190
|
+
code: z.ZodIssueCode.custom,
|
|
2191
|
+
path: ["rotateBytes"],
|
|
2192
|
+
message: "invalid size (use b, kb, mb, gb, tb)"
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
if (val.resetArchiveRetention !== void 0 && val.resetArchiveRetention !== false) try {
|
|
2196
|
+
parseDurationMs(String(val.resetArchiveRetention).trim(), { defaultUnit: "d" });
|
|
2197
|
+
} catch {
|
|
2198
|
+
ctx.addIssue({
|
|
2199
|
+
code: z.ZodIssueCode.custom,
|
|
2200
|
+
path: ["resetArchiveRetention"],
|
|
2201
|
+
message: "invalid duration (use ms, s, m, h, d)"
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
if (val.maxDiskBytes !== void 0) try {
|
|
2205
|
+
parseByteSize(String(val.maxDiskBytes).trim(), { defaultUnit: "b" });
|
|
2206
|
+
} catch {
|
|
2207
|
+
ctx.addIssue({
|
|
2208
|
+
code: z.ZodIssueCode.custom,
|
|
2209
|
+
path: ["maxDiskBytes"],
|
|
2210
|
+
message: "invalid size (use b, kb, mb, gb, tb)"
|
|
2211
|
+
});
|
|
2212
|
+
}
|
|
2213
|
+
if (val.highWaterBytes !== void 0) try {
|
|
2214
|
+
parseByteSize(String(val.highWaterBytes).trim(), { defaultUnit: "b" });
|
|
2215
|
+
} catch {
|
|
2216
|
+
ctx.addIssue({
|
|
2217
|
+
code: z.ZodIssueCode.custom,
|
|
2218
|
+
path: ["highWaterBytes"],
|
|
2219
|
+
message: "invalid size (use b, kb, mb, gb, tb)"
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
}).optional()
|
|
2223
|
+
}).strict().optional();
|
|
2224
|
+
const MessagesSchema = z.object({
|
|
2225
|
+
messagePrefix: z.string().optional(),
|
|
2226
|
+
responsePrefix: z.string().optional(),
|
|
2227
|
+
groupChat: GroupChatSchema,
|
|
2228
|
+
queue: QueueSchema,
|
|
2229
|
+
inbound: InboundDebounceSchema,
|
|
2230
|
+
ackReaction: z.string().optional(),
|
|
2231
|
+
ackReactionScope: z.enum([
|
|
2232
|
+
"group-mentions",
|
|
2233
|
+
"group-all",
|
|
2234
|
+
"direct",
|
|
2235
|
+
"all"
|
|
2236
|
+
]).optional(),
|
|
2237
|
+
removeAckAfterReply: z.boolean().optional(),
|
|
2238
|
+
statusReactions: z.object({
|
|
2239
|
+
enabled: z.boolean().optional(),
|
|
2240
|
+
emojis: z.object({
|
|
2241
|
+
thinking: z.string().optional(),
|
|
2242
|
+
tool: z.string().optional(),
|
|
2243
|
+
coding: z.string().optional(),
|
|
2244
|
+
web: z.string().optional(),
|
|
2245
|
+
done: z.string().optional(),
|
|
2246
|
+
error: z.string().optional(),
|
|
2247
|
+
stallSoft: z.string().optional(),
|
|
2248
|
+
stallHard: z.string().optional()
|
|
2249
|
+
}).strict().optional(),
|
|
2250
|
+
timing: z.object({
|
|
2251
|
+
debounceMs: z.number().int().min(0).optional(),
|
|
2252
|
+
stallSoftMs: z.number().int().min(0).optional(),
|
|
2253
|
+
stallHardMs: z.number().int().min(0).optional(),
|
|
2254
|
+
doneHoldMs: z.number().int().min(0).optional(),
|
|
2255
|
+
errorHoldMs: z.number().int().min(0).optional()
|
|
2256
|
+
}).strict().optional()
|
|
2257
|
+
}).strict().optional(),
|
|
2258
|
+
suppressToolErrors: z.boolean().optional(),
|
|
2259
|
+
tts: TtsConfigSchema
|
|
2260
|
+
}).strict().optional();
|
|
2261
|
+
const CommandsSchema = z.object({
|
|
2262
|
+
native: NativeCommandsSettingSchema.optional().default("auto"),
|
|
2263
|
+
text: z.boolean().optional(),
|
|
2264
|
+
bash: z.boolean().optional(),
|
|
2265
|
+
bashForegroundMs: z.number().int().min(0).max(3e4).optional(),
|
|
2266
|
+
config: z.boolean().optional(),
|
|
2267
|
+
debug: z.boolean().optional(),
|
|
2268
|
+
restart: z.boolean().optional().default(true),
|
|
2269
|
+
useAccessGroups: z.boolean().optional(),
|
|
2270
|
+
ownerAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
2271
|
+
ownerDisplay: z.enum(["raw", "hash"]).optional().default("raw"),
|
|
2272
|
+
ownerDisplaySecret: z.string().optional().register(sensitive),
|
|
2273
|
+
allowFrom: ElevatedAllowFromSchema.optional()
|
|
2274
|
+
}).strict().optional().default(() => ({
|
|
2275
|
+
native: "auto",
|
|
2276
|
+
restart: true,
|
|
2277
|
+
ownerDisplay: "raw"
|
|
2278
|
+
}));
|
|
2279
|
+
|
|
2280
|
+
//#endregion
|
|
2281
|
+
//#region src/config/zod-schema.ts
|
|
2282
|
+
const BrowserSnapshotDefaultsSchema = z.object({ mode: z.literal("efficient").optional() }).strict().optional();
|
|
2283
|
+
const NodeHostSchema = z.object({ browserProxy: z.object({
|
|
2284
|
+
enabled: z.boolean().optional(),
|
|
2285
|
+
allowProfiles: z.array(z.string()).optional()
|
|
2286
|
+
}).strict().optional() }).strict().optional();
|
|
2287
|
+
const LoggingLevelSchema = z.union([
|
|
2288
|
+
z.literal("silent"),
|
|
2289
|
+
z.literal("fatal"),
|
|
2290
|
+
z.literal("error"),
|
|
2291
|
+
z.literal("warn"),
|
|
2292
|
+
z.literal("info"),
|
|
2293
|
+
z.literal("debug"),
|
|
2294
|
+
z.literal("trace")
|
|
2295
|
+
]);
|
|
2296
|
+
const HttpUrlSchema = z.string().url().refine((value) => {
|
|
2297
|
+
const protocol = new URL(value).protocol;
|
|
2298
|
+
return protocol === "http:" || protocol === "https:";
|
|
2299
|
+
}, "Expected http:// or https:// URL");
|
|
2300
|
+
const RemoteClawSchema = z.object({
|
|
2301
|
+
$schema: z.string().optional(),
|
|
2302
|
+
meta: z.object({
|
|
2303
|
+
lastTouchedVersion: z.string().optional(),
|
|
2304
|
+
lastTouchedAt: z.union([z.string(), z.number().transform((n, ctx) => {
|
|
2305
|
+
const d = new Date(n);
|
|
2306
|
+
if (Number.isNaN(d.getTime())) {
|
|
2307
|
+
ctx.addIssue({
|
|
2308
|
+
code: z.ZodIssueCode.custom,
|
|
2309
|
+
message: "Invalid timestamp"
|
|
2310
|
+
});
|
|
2311
|
+
return z.NEVER;
|
|
2312
|
+
}
|
|
2313
|
+
return d.toISOString();
|
|
2314
|
+
})]).optional()
|
|
2315
|
+
}).strict().optional(),
|
|
2316
|
+
env: z.object({
|
|
2317
|
+
shellEnv: z.object({
|
|
2318
|
+
enabled: z.boolean().optional(),
|
|
2319
|
+
timeoutMs: z.number().int().nonnegative().optional()
|
|
2320
|
+
}).strict().optional(),
|
|
2321
|
+
vars: z.record(z.string(), z.string()).optional()
|
|
2322
|
+
}).catchall(z.string()).optional(),
|
|
2323
|
+
wizard: z.object({
|
|
2324
|
+
lastRunAt: z.string().optional(),
|
|
2325
|
+
lastRunVersion: z.string().optional(),
|
|
2326
|
+
lastRunCommit: z.string().optional(),
|
|
2327
|
+
lastRunCommand: z.string().optional(),
|
|
2328
|
+
lastRunMode: z.union([z.literal("local"), z.literal("remote")]).optional()
|
|
2329
|
+
}).strict().optional(),
|
|
2330
|
+
diagnostics: z.object({
|
|
2331
|
+
enabled: z.boolean().optional(),
|
|
2332
|
+
flags: z.array(z.string()).optional(),
|
|
2333
|
+
otel: z.object({
|
|
2334
|
+
enabled: z.boolean().optional(),
|
|
2335
|
+
endpoint: z.string().optional(),
|
|
2336
|
+
protocol: z.union([z.literal("http/protobuf"), z.literal("grpc")]).optional(),
|
|
2337
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
2338
|
+
serviceName: z.string().optional(),
|
|
2339
|
+
traces: z.boolean().optional(),
|
|
2340
|
+
metrics: z.boolean().optional(),
|
|
2341
|
+
logs: z.boolean().optional(),
|
|
2342
|
+
sampleRate: z.number().min(0).max(1).optional(),
|
|
2343
|
+
flushIntervalMs: z.number().int().nonnegative().optional()
|
|
2344
|
+
}).strict().optional(),
|
|
2345
|
+
cacheTrace: z.object({
|
|
2346
|
+
enabled: z.boolean().optional(),
|
|
2347
|
+
filePath: z.string().optional(),
|
|
2348
|
+
includeMessages: z.boolean().optional(),
|
|
2349
|
+
includePrompt: z.boolean().optional(),
|
|
2350
|
+
includeSystem: z.boolean().optional()
|
|
2351
|
+
}).strict().optional()
|
|
2352
|
+
}).strict().optional(),
|
|
2353
|
+
logging: z.object({
|
|
2354
|
+
level: LoggingLevelSchema.optional(),
|
|
2355
|
+
file: z.string().optional(),
|
|
2356
|
+
maxFileBytes: z.number().int().positive().optional(),
|
|
2357
|
+
consoleLevel: LoggingLevelSchema.optional(),
|
|
2358
|
+
consoleStyle: z.union([
|
|
2359
|
+
z.literal("pretty"),
|
|
2360
|
+
z.literal("compact"),
|
|
2361
|
+
z.literal("json")
|
|
2362
|
+
]).optional(),
|
|
2363
|
+
redactSensitive: z.union([z.literal("off"), z.literal("tools")]).optional(),
|
|
2364
|
+
redactPatterns: z.array(z.string()).optional()
|
|
2365
|
+
}).strict().optional(),
|
|
2366
|
+
update: z.object({
|
|
2367
|
+
channel: z.union([
|
|
2368
|
+
z.literal("stable"),
|
|
2369
|
+
z.literal("beta"),
|
|
2370
|
+
z.literal("dev")
|
|
2371
|
+
]).optional(),
|
|
2372
|
+
checkOnStart: z.boolean().optional(),
|
|
2373
|
+
auto: z.object({
|
|
2374
|
+
enabled: z.boolean().optional(),
|
|
2375
|
+
stableDelayHours: z.number().nonnegative().max(168).optional(),
|
|
2376
|
+
stableJitterHours: z.number().nonnegative().max(168).optional(),
|
|
2377
|
+
betaCheckIntervalHours: z.number().positive().max(24).optional()
|
|
2378
|
+
}).strict().optional()
|
|
2379
|
+
}).strict().optional(),
|
|
2380
|
+
browser: z.object({
|
|
2381
|
+
enabled: z.boolean().optional(),
|
|
2382
|
+
evaluateEnabled: z.boolean().optional(),
|
|
2383
|
+
cdpUrl: z.string().optional(),
|
|
2384
|
+
remoteCdpTimeoutMs: z.number().int().nonnegative().optional(),
|
|
2385
|
+
remoteCdpHandshakeTimeoutMs: z.number().int().nonnegative().optional(),
|
|
2386
|
+
color: z.string().optional(),
|
|
2387
|
+
executablePath: z.string().optional(),
|
|
2388
|
+
headless: z.boolean().optional(),
|
|
2389
|
+
noSandbox: z.boolean().optional(),
|
|
2390
|
+
attachOnly: z.boolean().optional(),
|
|
2391
|
+
defaultProfile: z.string().optional(),
|
|
2392
|
+
snapshotDefaults: BrowserSnapshotDefaultsSchema,
|
|
2393
|
+
ssrfPolicy: z.object({
|
|
2394
|
+
allowPrivateNetwork: z.boolean().optional(),
|
|
2395
|
+
dangerouslyAllowPrivateNetwork: z.boolean().optional(),
|
|
2396
|
+
allowedHostnames: z.array(z.string()).optional(),
|
|
2397
|
+
hostnameAllowlist: z.array(z.string()).optional()
|
|
2398
|
+
}).strict().optional(),
|
|
2399
|
+
profiles: z.record(z.string().regex(/^[a-z0-9-]+$/, "Profile names must be alphanumeric with hyphens only"), z.object({
|
|
2400
|
+
cdpPort: z.number().int().min(1).max(65535).optional(),
|
|
2401
|
+
cdpUrl: z.string().optional(),
|
|
2402
|
+
driver: z.union([z.literal("clawd"), z.literal("extension")]).optional(),
|
|
2403
|
+
color: HexColorSchema
|
|
2404
|
+
}).strict().refine((value) => value.cdpPort || value.cdpUrl, { message: "Profile must set cdpPort or cdpUrl" })).optional()
|
|
2405
|
+
}).strict().optional(),
|
|
2406
|
+
ui: z.object({
|
|
2407
|
+
seamColor: HexColorSchema.optional(),
|
|
2408
|
+
assistant: z.object({
|
|
2409
|
+
name: z.string().max(50).optional(),
|
|
2410
|
+
avatar: z.string().max(200).optional()
|
|
2411
|
+
}).strict().optional()
|
|
2412
|
+
}).strict().optional(),
|
|
2413
|
+
auth: z.object({
|
|
2414
|
+
profiles: z.record(z.string(), z.object({
|
|
2415
|
+
provider: z.string(),
|
|
2416
|
+
mode: z.union([
|
|
2417
|
+
z.literal("api_key"),
|
|
2418
|
+
z.literal("oauth"),
|
|
2419
|
+
z.literal("token")
|
|
2420
|
+
]),
|
|
2421
|
+
email: z.string().optional()
|
|
2422
|
+
}).strict()).optional(),
|
|
2423
|
+
order: z.record(z.string(), z.array(z.string())).optional(),
|
|
2424
|
+
cooldowns: z.object({
|
|
2425
|
+
billingBackoffHours: z.number().positive().optional(),
|
|
2426
|
+
billingBackoffHoursByProvider: z.record(z.string(), z.number().positive()).optional(),
|
|
2427
|
+
billingMaxHours: z.number().positive().optional(),
|
|
2428
|
+
failureWindowHours: z.number().positive().optional()
|
|
2429
|
+
}).strict().optional()
|
|
2430
|
+
}).strict().optional(),
|
|
2431
|
+
nodeHost: NodeHostSchema,
|
|
2432
|
+
agents: AgentsSchema,
|
|
2433
|
+
tools: ToolsSchema,
|
|
2434
|
+
bindings: BindingsSchema,
|
|
2435
|
+
broadcast: BroadcastSchema,
|
|
2436
|
+
audio: AudioSchema,
|
|
2437
|
+
media: z.object({ preserveFilenames: z.boolean().optional() }).strict().optional(),
|
|
2438
|
+
messages: MessagesSchema,
|
|
2439
|
+
commands: CommandsSchema,
|
|
2440
|
+
approvals: ApprovalsSchema,
|
|
2441
|
+
session: SessionSchema,
|
|
2442
|
+
cron: z.object({
|
|
2443
|
+
enabled: z.boolean().optional(),
|
|
2444
|
+
store: z.string().optional(),
|
|
2445
|
+
maxConcurrentRuns: z.number().int().positive().optional(),
|
|
2446
|
+
webhook: HttpUrlSchema.optional(),
|
|
2447
|
+
webhookToken: z.string().optional().register(sensitive),
|
|
2448
|
+
sessionRetention: z.union([z.string(), z.literal(false)]).optional(),
|
|
2449
|
+
runLog: z.object({
|
|
2450
|
+
maxBytes: z.union([z.string(), z.number()]).optional(),
|
|
2451
|
+
keepLines: z.number().int().positive().optional()
|
|
2452
|
+
}).strict().optional()
|
|
2453
|
+
}).strict().superRefine((val, ctx) => {
|
|
2454
|
+
if (val.sessionRetention !== void 0 && val.sessionRetention !== false) try {
|
|
2455
|
+
parseDurationMs(String(val.sessionRetention).trim(), { defaultUnit: "h" });
|
|
2456
|
+
} catch {
|
|
2457
|
+
ctx.addIssue({
|
|
2458
|
+
code: z.ZodIssueCode.custom,
|
|
2459
|
+
path: ["sessionRetention"],
|
|
2460
|
+
message: "invalid duration (use ms, s, m, h, d)"
|
|
2461
|
+
});
|
|
2462
|
+
}
|
|
2463
|
+
if (val.runLog?.maxBytes !== void 0) try {
|
|
2464
|
+
parseByteSize(String(val.runLog.maxBytes).trim(), { defaultUnit: "b" });
|
|
2465
|
+
} catch {
|
|
2466
|
+
ctx.addIssue({
|
|
2467
|
+
code: z.ZodIssueCode.custom,
|
|
2468
|
+
path: ["runLog", "maxBytes"],
|
|
2469
|
+
message: "invalid size (use b, kb, mb, gb, tb)"
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
}).optional(),
|
|
2473
|
+
hooks: z.object({
|
|
2474
|
+
enabled: z.boolean().optional(),
|
|
2475
|
+
path: z.string().optional(),
|
|
2476
|
+
token: z.string().optional().register(sensitive),
|
|
2477
|
+
defaultSessionKey: z.string().optional(),
|
|
2478
|
+
allowRequestSessionKey: z.boolean().optional(),
|
|
2479
|
+
allowedSessionKeyPrefixes: z.array(z.string()).optional(),
|
|
2480
|
+
allowedAgentIds: z.array(z.string()).optional(),
|
|
2481
|
+
maxBodyBytes: z.number().int().positive().optional(),
|
|
2482
|
+
presets: z.array(z.string()).optional(),
|
|
2483
|
+
transformsDir: z.string().optional(),
|
|
2484
|
+
mappings: z.array(HookMappingSchema).optional(),
|
|
2485
|
+
gmail: HooksGmailSchema,
|
|
2486
|
+
internal: InternalHooksSchema
|
|
2487
|
+
}).strict().optional(),
|
|
2488
|
+
web: z.object({
|
|
2489
|
+
enabled: z.boolean().optional(),
|
|
2490
|
+
heartbeatSeconds: z.number().int().positive().optional(),
|
|
2491
|
+
reconnect: z.object({
|
|
2492
|
+
initialMs: z.number().positive().optional(),
|
|
2493
|
+
maxMs: z.number().positive().optional(),
|
|
2494
|
+
factor: z.number().positive().optional(),
|
|
2495
|
+
jitter: z.number().min(0).max(1).optional(),
|
|
2496
|
+
maxAttempts: z.number().int().min(0).optional()
|
|
2497
|
+
}).strict().optional()
|
|
2498
|
+
}).strict().optional(),
|
|
2499
|
+
channels: ChannelsSchema,
|
|
2500
|
+
discovery: z.object({
|
|
2501
|
+
wideArea: z.object({ enabled: z.boolean().optional() }).strict().optional(),
|
|
2502
|
+
mdns: z.object({ mode: z.enum([
|
|
2503
|
+
"off",
|
|
2504
|
+
"minimal",
|
|
2505
|
+
"full"
|
|
2506
|
+
]).optional() }).strict().optional()
|
|
2507
|
+
}).strict().optional(),
|
|
2508
|
+
canvasHost: z.object({
|
|
2509
|
+
enabled: z.boolean().optional(),
|
|
2510
|
+
root: z.string().optional(),
|
|
2511
|
+
port: z.number().int().positive().optional(),
|
|
2512
|
+
liveReload: z.boolean().optional()
|
|
2513
|
+
}).strict().optional(),
|
|
2514
|
+
talk: z.object({
|
|
2515
|
+
provider: z.string().optional(),
|
|
2516
|
+
providers: z.record(z.string(), z.object({
|
|
2517
|
+
voiceId: z.string().optional(),
|
|
2518
|
+
voiceAliases: z.record(z.string(), z.string()).optional(),
|
|
2519
|
+
modelId: z.string().optional(),
|
|
2520
|
+
outputFormat: z.string().optional(),
|
|
2521
|
+
apiKey: z.string().optional().register(sensitive)
|
|
2522
|
+
}).catchall(z.unknown())).optional(),
|
|
2523
|
+
voiceId: z.string().optional(),
|
|
2524
|
+
voiceAliases: z.record(z.string(), z.string()).optional(),
|
|
2525
|
+
modelId: z.string().optional(),
|
|
2526
|
+
outputFormat: z.string().optional(),
|
|
2527
|
+
apiKey: z.string().optional().register(sensitive),
|
|
2528
|
+
interruptOnSpeech: z.boolean().optional()
|
|
2529
|
+
}).strict().optional(),
|
|
2530
|
+
gateway: z.object({
|
|
2531
|
+
port: z.number().int().positive().optional(),
|
|
2532
|
+
mode: z.union([z.literal("local"), z.literal("remote")]).optional(),
|
|
2533
|
+
bind: z.union([
|
|
2534
|
+
z.literal("auto"),
|
|
2535
|
+
z.literal("lan"),
|
|
2536
|
+
z.literal("loopback"),
|
|
2537
|
+
z.literal("custom"),
|
|
2538
|
+
z.literal("tailnet")
|
|
2539
|
+
]).optional(),
|
|
2540
|
+
customBindHost: z.string().optional(),
|
|
2541
|
+
controlUi: z.object({
|
|
2542
|
+
enabled: z.boolean().optional(),
|
|
2543
|
+
basePath: z.string().optional(),
|
|
2544
|
+
root: z.string().optional(),
|
|
2545
|
+
allowedOrigins: z.array(z.string()).optional(),
|
|
2546
|
+
dangerouslyAllowHostHeaderOriginFallback: z.boolean().optional(),
|
|
2547
|
+
allowInsecureAuth: z.boolean().optional(),
|
|
2548
|
+
dangerouslyDisableDeviceAuth: z.boolean().optional()
|
|
2549
|
+
}).strict().optional(),
|
|
2550
|
+
auth: z.object({
|
|
2551
|
+
mode: z.union([
|
|
2552
|
+
z.literal("none"),
|
|
2553
|
+
z.literal("token"),
|
|
2554
|
+
z.literal("password"),
|
|
2555
|
+
z.literal("trusted-proxy")
|
|
2556
|
+
]).optional(),
|
|
2557
|
+
token: z.string().optional().register(sensitive),
|
|
2558
|
+
password: z.string().optional().register(sensitive),
|
|
2559
|
+
allowTailscale: z.boolean().optional(),
|
|
2560
|
+
rateLimit: z.object({
|
|
2561
|
+
maxAttempts: z.number().optional(),
|
|
2562
|
+
windowMs: z.number().optional(),
|
|
2563
|
+
lockoutMs: z.number().optional(),
|
|
2564
|
+
exemptLoopback: z.boolean().optional()
|
|
2565
|
+
}).strict().optional(),
|
|
2566
|
+
trustedProxy: z.object({
|
|
2567
|
+
userHeader: z.string().min(1, "userHeader is required for trusted-proxy mode"),
|
|
2568
|
+
requiredHeaders: z.array(z.string()).optional(),
|
|
2569
|
+
allowUsers: z.array(z.string()).optional()
|
|
2570
|
+
}).strict().optional()
|
|
2571
|
+
}).strict().optional(),
|
|
2572
|
+
trustedProxies: z.array(z.string()).optional(),
|
|
2573
|
+
allowRealIpFallback: z.boolean().optional(),
|
|
2574
|
+
tools: z.object({
|
|
2575
|
+
deny: z.array(z.string()).optional(),
|
|
2576
|
+
allow: z.array(z.string()).optional()
|
|
2577
|
+
}).strict().optional(),
|
|
2578
|
+
channelHealthCheckMinutes: z.number().int().min(0).optional(),
|
|
2579
|
+
tailscale: z.object({
|
|
2580
|
+
mode: z.union([
|
|
2581
|
+
z.literal("off"),
|
|
2582
|
+
z.literal("serve"),
|
|
2583
|
+
z.literal("funnel")
|
|
2584
|
+
]).optional(),
|
|
2585
|
+
resetOnExit: z.boolean().optional()
|
|
2586
|
+
}).strict().optional(),
|
|
2587
|
+
remote: z.object({
|
|
2588
|
+
url: z.string().optional(),
|
|
2589
|
+
transport: z.union([z.literal("ssh"), z.literal("direct")]).optional(),
|
|
2590
|
+
token: z.string().optional().register(sensitive),
|
|
2591
|
+
password: z.string().optional().register(sensitive),
|
|
2592
|
+
tlsFingerprint: z.string().optional(),
|
|
2593
|
+
sshTarget: z.string().optional(),
|
|
2594
|
+
sshIdentity: z.string().optional()
|
|
2595
|
+
}).strict().optional(),
|
|
2596
|
+
reload: z.object({
|
|
2597
|
+
mode: z.union([
|
|
2598
|
+
z.literal("off"),
|
|
2599
|
+
z.literal("restart"),
|
|
2600
|
+
z.literal("hot"),
|
|
2601
|
+
z.literal("hybrid")
|
|
2602
|
+
]).optional(),
|
|
2603
|
+
debounceMs: z.number().int().min(0).optional()
|
|
2604
|
+
}).strict().optional(),
|
|
2605
|
+
tls: z.object({
|
|
2606
|
+
enabled: z.boolean().optional(),
|
|
2607
|
+
autoGenerate: z.boolean().optional(),
|
|
2608
|
+
certPath: z.string().optional(),
|
|
2609
|
+
keyPath: z.string().optional(),
|
|
2610
|
+
caPath: z.string().optional()
|
|
2611
|
+
}).optional(),
|
|
2612
|
+
http: z.object({
|
|
2613
|
+
endpoints: z.object({
|
|
2614
|
+
chatCompletions: z.object({ enabled: z.boolean().optional() }).strict().optional(),
|
|
2615
|
+
responses: z.object({
|
|
2616
|
+
enabled: z.boolean().optional(),
|
|
2617
|
+
maxBodyBytes: z.number().int().positive().optional(),
|
|
2618
|
+
maxUrlParts: z.number().int().nonnegative().optional(),
|
|
2619
|
+
files: z.object({
|
|
2620
|
+
allowUrl: z.boolean().optional(),
|
|
2621
|
+
urlAllowlist: z.array(z.string()).optional(),
|
|
2622
|
+
allowedMimes: z.array(z.string()).optional(),
|
|
2623
|
+
maxBytes: z.number().int().positive().optional(),
|
|
2624
|
+
maxChars: z.number().int().positive().optional(),
|
|
2625
|
+
maxRedirects: z.number().int().nonnegative().optional(),
|
|
2626
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
2627
|
+
pdf: z.object({
|
|
2628
|
+
maxPages: z.number().int().positive().optional(),
|
|
2629
|
+
maxPixels: z.number().int().positive().optional(),
|
|
2630
|
+
minTextChars: z.number().int().nonnegative().optional()
|
|
2631
|
+
}).strict().optional()
|
|
2632
|
+
}).strict().optional(),
|
|
2633
|
+
images: z.object({
|
|
2634
|
+
allowUrl: z.boolean().optional(),
|
|
2635
|
+
urlAllowlist: z.array(z.string()).optional(),
|
|
2636
|
+
allowedMimes: z.array(z.string()).optional(),
|
|
2637
|
+
maxBytes: z.number().int().positive().optional(),
|
|
2638
|
+
maxRedirects: z.number().int().nonnegative().optional(),
|
|
2639
|
+
timeoutMs: z.number().int().positive().optional()
|
|
2640
|
+
}).strict().optional()
|
|
2641
|
+
}).strict().optional()
|
|
2642
|
+
}).strict().optional(),
|
|
2643
|
+
securityHeaders: z.object({ strictTransportSecurity: z.union([z.string(), z.literal(false)]).optional() }).strict().optional()
|
|
2644
|
+
}).strict().optional(),
|
|
2645
|
+
nodes: z.object({
|
|
2646
|
+
browser: z.object({
|
|
2647
|
+
mode: z.union([
|
|
2648
|
+
z.literal("auto"),
|
|
2649
|
+
z.literal("manual"),
|
|
2650
|
+
z.literal("off")
|
|
2651
|
+
]).optional(),
|
|
2652
|
+
node: z.string().optional()
|
|
2653
|
+
}).strict().optional(),
|
|
2654
|
+
allowCommands: z.array(z.string()).optional(),
|
|
2655
|
+
denyCommands: z.array(z.string()).optional()
|
|
2656
|
+
}).strict().optional()
|
|
2657
|
+
}).strict().optional(),
|
|
2658
|
+
memory: z.unknown().optional(),
|
|
2659
|
+
plugins: z.object({
|
|
2660
|
+
enabled: z.boolean().optional(),
|
|
2661
|
+
allow: z.array(z.string()).optional(),
|
|
2662
|
+
deny: z.array(z.string()).optional(),
|
|
2663
|
+
load: z.object({ paths: z.array(z.string()).optional() }).strict().optional(),
|
|
2664
|
+
slots: z.object({ memory: z.string().optional() }).strict().optional(),
|
|
2665
|
+
entries: z.record(z.string(), z.object({
|
|
2666
|
+
enabled: z.boolean().optional(),
|
|
2667
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
2668
|
+
}).strict()).optional(),
|
|
2669
|
+
installs: z.record(z.string(), z.object({ ...InstallRecordShape }).strict()).optional()
|
|
2670
|
+
}).strict().optional()
|
|
2671
|
+
}).strict().superRefine((cfg, ctx) => {
|
|
2672
|
+
const agents = cfg.agents?.list ?? [];
|
|
2673
|
+
if (agents.length === 0) return;
|
|
2674
|
+
const agentIds = new Set(agents.map((agent) => agent.id));
|
|
2675
|
+
const broadcast = cfg.broadcast;
|
|
2676
|
+
if (!broadcast) return;
|
|
2677
|
+
for (const [peerId, ids] of Object.entries(broadcast)) {
|
|
2678
|
+
if (peerId === "strategy") continue;
|
|
2679
|
+
if (!Array.isArray(ids)) continue;
|
|
2680
|
+
for (let idx = 0; idx < ids.length; idx += 1) {
|
|
2681
|
+
const agentId = ids[idx];
|
|
2682
|
+
if (!agentIds.has(agentId)) ctx.addIssue({
|
|
2683
|
+
code: z.ZodIssueCode.custom,
|
|
2684
|
+
path: [
|
|
2685
|
+
"broadcast",
|
|
2686
|
+
peerId,
|
|
2687
|
+
idx
|
|
2688
|
+
],
|
|
2689
|
+
message: `Unknown agent id "${agentId}" (not in agents.list).`
|
|
2690
|
+
});
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
});
|
|
2694
|
+
|
|
2695
|
+
//#endregion
|
|
2696
|
+
export { normalizeScpRemoteHost as a, parseByteSize as c, resolveDiscordPreviewStreamMode as d, resolveSlackNativeStreaming as f, resolveTelegramCustomCommands as i, isSafeExecutableValue as l, resolveTelegramPreviewStreamMode as m, TELEGRAM_COMMAND_NAME_PATTERN as n, sensitive as o, resolveSlackStreamingMode as p, normalizeTelegramCommandName as r, parseDurationMs as s, RemoteClawSchema as t, mapStreamingModeToSlackLegacyDraftStreamMode as u };
|