remoteclaw 0.1.0-next.cd6ddde → 0.1.0-next.cf9ccbe
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/dist/accounts-79XhjwAj.js +32 -0
- package/dist/accounts-B1M3fOxL.js +272 -0
- package/dist/accounts-BwbvnKsW.js +205 -0
- package/dist/accounts-CIVjmTg9.js +270 -0
- package/dist/accounts-D1awQXKu.js +36 -0
- package/dist/accounts-DHkGVGUR.js +36 -0
- package/dist/accounts-P7cmIXUM.js +206 -0
- package/dist/accounts-XFgBY644.js +47 -0
- package/dist/accounts-_ZuNC5bz.js +47 -0
- package/dist/ack-reactions-BGJ9Vigf.js +621 -0
- package/dist/ack-reactions-Diu9O24z.js +621 -0
- package/dist/acp-cli-BwZ-va2P.js +1316 -0
- package/dist/acp-cli-eVKByz-j.js +1311 -0
- package/dist/active-listener--jrUO-8L.js +37 -0
- package/dist/active-listener-C7SyMcNY.js +37 -0
- package/dist/agent-BAxK2KQW.js +688 -0
- package/dist/agent-Dd5Yfhmq.js +687 -0
- package/dist/agent-helpers-5F0tdxud.js +400 -0
- package/dist/agent-scope-BA1HP4K6.js +114 -0
- package/dist/agent-scope-CAQLm3LP.js +116 -0
- package/dist/agents-2VlLHxv-.js +754 -0
- package/dist/agents.config-CmyzLYqW.js +116 -0
- package/dist/agents.config-DerBqRzk.js +116 -0
- package/dist/audio-ClIuKwkl.js +43 -0
- package/dist/audio-DqlIYYTb.js +43 -0
- package/dist/audit-Cn0cNCE4.js +3114 -0
- package/dist/audit-DXY4NHBC.js +3114 -0
- package/dist/auth-B-QK8JhI.js +315 -0
- package/dist/auth-C1zx1O24.js +314 -0
- package/dist/auth-DDmNYVMW.js +448 -0
- package/dist/auth-DH1wEw0w.js +448 -0
- package/dist/banner-CBWZhANO.js +294 -0
- package/dist/binaries-CYwLdubd.js +13 -0
- package/dist/bindings-DFAFatwT.js +69 -0
- package/dist/bindings-GUKIzFCp.js +69 -0
- package/dist/bonjour-discovery-AQMJqY4V.js +378 -0
- package/dist/bonjour-discovery-BLcPWHFJ.js +378 -0
- package/dist/boot/handler.js +28 -28
- package/dist/browser-cli-8Dv5ogFT.js +1690 -0
- package/dist/browser-cli-wNLo8SOy.js +1694 -0
- package/dist/build-info.json +3 -3
- package/dist/call-BTHzKFbN.js +518 -0
- package/dist/call-D_NchaCs.js +517 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/catalog-DgpN5jxU.js +186 -0
- package/dist/catalog-k056Nh93.js +186 -0
- package/dist/channel-account-context-BHIy71Yh.js +133 -0
- package/dist/channel-account-context-DXU_-EkJ.js +133 -0
- package/dist/channel-activity-BatlvP_U.js +292 -0
- package/dist/channel-activity-BhT7NQ_v.js +94 -0
- package/dist/channel-activity-CvjEwpJz.js +94 -0
- package/dist/channel-options-BCccA2WC.js +32 -0
- package/dist/channel-options-VPR_pNyS.js +33 -0
- package/dist/channel-selection-AH6_y6RS.js +51 -0
- package/dist/channel-selection-ovohyJQZ.js +51 -0
- package/dist/channel-web-APDaQ_wp.js +2134 -0
- package/dist/channel-web-BW_YuNlT.js +2132 -0
- package/dist/channels-cli-BBkHQtBI.js +1440 -0
- package/dist/channels-cli-CKcOwL-Q.js +1436 -0
- package/dist/channels-status-issues-BbYNzwLp.js +18 -0
- package/dist/channels-status-issues-DRybAijg.js +18 -0
- package/dist/chat-envelope-AJFUAuBM.js +248 -0
- package/dist/chat-envelope-BrfcPlDM.js +248 -0
- package/dist/chrome-Bv2UtAMQ.js +1732 -0
- package/dist/chrome-C6Vc_7su.js +1733 -0
- package/dist/chunk-BzVoFUZL.js +341 -0
- package/dist/clack-prompter-C6mBTOzE.js +122 -0
- package/dist/clack-prompter-DKcYqv3o.js +121 -0
- package/dist/cleanup-utils-Cb-leJcy.js +94 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-Cs1n6-eD.js +135 -0
- package/dist/cli-Di3p1tLN.js +131 -0
- package/dist/client-B6h7bgbF.js +2311 -0
- package/dist/client-CMtdm9Ii.js +2311 -0
- package/dist/clipboard-A06eV_5C.js +31 -0
- package/dist/clipboard-DQBl3coj.js +31 -0
- package/dist/command-format-BiiNHkWG.js +18 -0
- package/dist/command-format-Dntg_tnC.js +32 -0
- package/dist/command-logger/handler.js +1 -1
- package/dist/command-registry-BV2MH_iw.js +215 -0
- package/dist/commands-D93TXYhv.js +41 -0
- package/dist/commands-UD7V7QC9.js +41 -0
- package/dist/commands-registry-CCbTtSSK.js +891 -0
- package/dist/commands-registry-De8JhZLG.js +890 -0
- package/dist/common-D4fL3S2m.js +156 -0
- package/dist/common-DXNisGxw.js +156 -0
- package/dist/completion-cli-319xyosV.js +452 -0
- package/dist/completion-cli-B6Zimnek.js +452 -0
- package/dist/config-BTH7fB_v.js +3345 -0
- package/dist/config-DwuBnd6D.js +3347 -0
- package/dist/config-cli-c_Itt86J.js +247 -0
- package/dist/config-cli-rcMB3A3B.js +243 -0
- package/dist/config-guard-BcT7soTj.js +92 -0
- package/dist/config-guard-Bqak3bDc.js +75 -0
- package/dist/config-validation-CHEjSJ5K.js +18 -0
- package/dist/config-validation-CvgqLhyG.js +18 -0
- package/dist/configure-Cb3bbYnh.js +891 -0
- package/dist/configure-R2gWNv5y.js +889 -0
- package/dist/control-auth-DrGYtMJM.js +397 -0
- package/dist/control-auth-KY4Qdr2I.js +397 -0
- package/dist/control-ui-assets-DO1L6M0S.js +186 -0
- package/dist/control-ui-assets-S_TLo6Fs.js +186 -0
- package/dist/conversation-label-CMOfgCVl.js +36 -0
- package/dist/cron-cli-C7h_hLHu.js +495 -0
- package/dist/cron-cli-DTNg0Uvl.js +499 -0
- package/dist/daemon-cli-BlJS9zWM.js +737 -0
- package/dist/daemon-cli-Cfc1yszp.js +735 -0
- package/dist/daemon-cli.js +124 -1071
- package/dist/daemon-install-BbBLuLWg.js +60 -0
- package/dist/daemon-install-WEBvqVOj.js +56 -0
- package/dist/daemon-install-helpers-BVtPC2TK.js +504 -0
- package/dist/daemon-install-helpers-DVr51zvE.js +504 -0
- package/dist/deliver-EB272zWh.js +481 -0
- package/dist/deliver-iGD_woru.js +481 -0
- package/dist/delivery-queue-BDvalA10.js +244 -0
- package/dist/delivery-queue-BimvYz5E.js +244 -0
- package/dist/devices-cli-BXCOsNFc.js +323 -0
- package/dist/devices-cli-CHGdYfrz.js +319 -0
- package/dist/diagnostics-BzzhTQzK.js +35 -0
- package/dist/diagnostics-DILtxtcE.js +35 -0
- package/dist/directory-cli-COS40yI9.js +221 -0
- package/dist/directory-cli-Cb5j1JTC.js +225 -0
- package/dist/dispatcher-BUqxh_mA.js +174 -0
- package/dist/dispatcher-By-KZRWZ.js +173 -0
- package/dist/dm-policy-shared-BCp9_z3w.js +22 -0
- package/dist/dm-policy-shared-DgeKqjOu.js +22 -0
- package/dist/dns-cli-B8yyXB2N.js +203 -0
- package/dist/dns-cli-DAkTk-gM.js +199 -0
- package/dist/dock-B0bIIDS3.js +906 -0
- package/dist/dock-C3PzQ6CS.js +907 -0
- package/dist/doctor-completion-B_Zp4fZk.js +92 -0
- package/dist/doctor-completion-CZ1P5laQ.js +92 -0
- package/dist/doctor-config-flow-BDDsR2J1.js +978 -0
- package/dist/doctor-config-flow-CwFFRUic.js +979 -0
- package/dist/enable-C3I9dWel.js +59 -0
- package/dist/enable-DnwKeWnR.js +59 -0
- package/dist/entry.js +62 -6
- package/dist/env-DyyqmxSM.js +60 -0
- package/dist/errors-0dfGxeYQ.js +35 -0
- package/dist/errors-C1kDByVU.js +35 -0
- package/dist/exec-CAk1dxq_.js +164 -0
- package/dist/exec-epNpA1aU.js +164 -0
- package/dist/extensionAPI.js +263 -1088
- package/dist/fetch-BMQq41sB.js +281 -0
- package/dist/fetch-Cky99wYB.js +281 -0
- package/dist/fetch-D3tw4B4n.js +67 -0
- package/dist/fetch-Dgm9ZHFm.js +67 -0
- package/dist/file-lock-DWH0TfVu.js +107 -0
- package/dist/file-lock-DXW9h9ek.js +107 -0
- package/dist/fs-safe-BjSd07M4.js +115 -0
- package/dist/fs-safe-aWIhCWlb.js +125 -0
- package/dist/gateway-cli-BLeY_1DX.js +24154 -0
- package/dist/gateway-cli-Cu4vwhmi.js +24150 -0
- package/dist/gateway-rpc-B92CH0D3.js +28 -0
- package/dist/gateway-rpc-DZNlWapO.js +28 -0
- package/dist/gmail-setup-utils-CKyh29_R.js +422 -0
- package/dist/gmail-setup-utils-DquflkMR.js +423 -0
- package/dist/health-BYl7T-4m.js +1417 -0
- package/dist/health-DdviISKg.js +1414 -0
- package/dist/health-format-BE5TK5bs.js +28 -0
- package/dist/heartbeat-visibility-BO3iRpB6.js +125 -0
- package/dist/heartbeat-visibility-Cwp4TrTv.js +125 -0
- package/dist/help-format-D3JhWp1E.js +17 -0
- package/dist/hook-runner-global-C1thol1d.js +527 -0
- package/dist/hooks-cli-BKS9uZ0H.js +1221 -0
- package/dist/hooks-cli-FLWcCr9q.js +1217 -0
- package/dist/image-ops-CX41n0v5.js +354 -0
- package/dist/image-ops-DSL3eFfQ.js +354 -0
- package/dist/import-BSFgt760.js +604 -0
- package/dist/import-Da1CHJJg.js +606 -0
- package/dist/inbound-context-a5bzQvRt.js +68 -0
- package/dist/index.js +127 -101
- package/dist/inspect-BEpFbi0c.js +286 -0
- package/dist/inspect-BeNNpWna.js +286 -0
- package/dist/installs-CH7Qq_m_.js +319 -0
- package/dist/installs-CcM8H2YA.js +319 -0
- package/dist/ipv4-DNo9AFDu.js +46 -0
- package/dist/ipv4-VfoVR5uR.js +46 -0
- package/dist/ir-BPwP8hIc.js +972 -0
- package/dist/lifecycle-core-5Zxqwa6V.js +476 -0
- package/dist/lifecycle-core-C1bGeLby.js +474 -0
- package/dist/links-CtGBIrG8.js +15 -0
- package/dist/loader-BoP3JA-r.js +22411 -0
- package/dist/loader-DXbpue-L.js +22414 -0
- package/dist/logger-ASsO5Nz-.js +49 -0
- package/dist/logging-Cd9y2AdQ.js +20 -0
- package/dist/login-B2UXzgaB.js +61 -0
- package/dist/login-BEFL3xY9.js +62 -0
- package/dist/login-qr-C7wAz2fe.js +329 -0
- package/dist/login-qr-DWpUP1Ud.js +325 -0
- package/dist/logs-cli-CAcd-pXA.js +240 -0
- package/dist/logs-cli-D7Bzarht.js +236 -0
- package/dist/markdown-tables-BBNUZp4n.js +29 -0
- package/dist/markdown-tables-NgPcfXoF.js +29 -0
- package/dist/media-4-qOIjO-.js +971 -0
- package/dist/media-DTwJhAbE.js +9481 -0
- package/dist/message-action-names-BsNTjuBE.js +2520 -0
- package/dist/message-action-names-ocKcq8_3.js +2520 -0
- package/dist/message-channel-CtcVHawF.js +91 -0
- package/dist/mime-CAqaK3kp.js +146 -0
- package/dist/mime-ViuhRuMM.js +146 -0
- package/dist/net-DSkFMHJ8.js +225 -0
- package/dist/net-DTqfFYzt.js +225 -0
- package/dist/node-cli-BeXU67eQ.js +1458 -0
- package/dist/node-cli-i2aCtnmM.js +1462 -0
- package/dist/node-service-RyMlWp8N.js +67 -0
- package/dist/node-service-TL9b6Qfz.js +67 -0
- package/dist/nodes-cli-CtqnXBMD.js +1346 -0
- package/dist/nodes-cli-DgQU3LrG.js +1350 -0
- package/dist/nodes-screen-B7HJugJ0.js +250 -0
- package/dist/nodes-screen-nCRd71Mk.js +250 -0
- package/dist/note-B6142LyJ.js +92 -0
- package/dist/note-D-EI0czq.js +92 -0
- package/dist/npm-registry-spec-PPyRXSpx.js +786 -0
- package/dist/npm-registry-spec-uUmDWe6v.js +786 -0
- package/dist/npm-resolution-BC1LqCm2.js +86 -0
- package/dist/npm-resolution-DhlhUmRF.js +86 -0
- package/dist/onboard-CHowLVEG.js +647 -0
- package/dist/onboard-D_eCnKjt.js +649 -0
- package/dist/onboard-auth-cNtb3FTP.js +211 -0
- package/dist/onboard-auth-gwz-0mZ6.js +207 -0
- package/dist/onboard-channels-CFsUIDWq.js +2618 -0
- package/dist/onboard-channels-ZCML5CWb.js +2619 -0
- package/dist/onboard-helpers-8afRV_Tm.js +364 -0
- package/dist/onboard-helpers-DTRrJLj-.js +363 -0
- package/dist/onboard-remote-CFkvVAYg.js +127 -0
- package/dist/onboard-remote-JfBnmK70.js +127 -0
- package/dist/onboarding-DIxNghyi.js +586 -0
- package/dist/onboarding-Dhh0bjrb.js +588 -0
- package/dist/onboarding.finalize-5uipJuOl.js +403 -0
- package/dist/onboarding.finalize-De4etQul.js +405 -0
- package/dist/onboarding.gateway-config-DolBTXWT.js +196 -0
- package/dist/onboarding.gateway-config-rJkIamlG.js +202 -0
- package/dist/outbound-CPMaDtgC.js +220 -0
- package/dist/outbound-CYSuCMiW.js +221 -0
- package/dist/outbound-attachment-Ci02LXoq.js +18 -0
- package/dist/outbound-attachment-CqZ7Qc_o.js +18 -0
- package/dist/outbound-attachment-CuqWdsdV.js +18 -0
- package/dist/pairing-cli-B9JKvvST.js +126 -0
- package/dist/pairing-cli-C4HrfIHe.js +130 -0
- package/dist/pairing-labels-CBmGQ31P.js +9 -0
- package/dist/pairing-labels-D0xwC7Xb.js +9 -0
- package/dist/pairing-store-BoF0g-iN.js +459 -0
- package/dist/pairing-store-CseXj-5p.js +460 -0
- package/dist/path-env-CPZbb7me.js +89 -0
- package/dist/path-safety-BFE0XmGC.js +14 -0
- package/dist/path-safety-BJ8ge6Ho.js +14 -0
- package/dist/paths-DHuXVC00.js +229 -0
- package/dist/plugin-auto-enable-B_9J1XED.js +302 -0
- package/dist/plugin-auto-enable-DghjlFCL.js +301 -0
- package/dist/plugin-registry-68h2T8vi.js +33 -0
- package/dist/plugin-registry-BitdVPb4.js +33 -0
- package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +0 -11
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/shared.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +1 -10
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +1 -8
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +1 -23
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +0 -2
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +0 -22
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +2 -29
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +0 -8
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +0 -1
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -15
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +1 -8
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +1 -11
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +1 -13
- package/dist/plugin-sdk/auto-reply/reply.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/status.d.ts +1 -4
- package/dist/plugin-sdk/auto-reply/templating.d.ts +0 -4
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +0 -4
- package/dist/plugin-sdk/channels/dock.d.ts +1 -2
- package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +0 -6
- package/dist/plugin-sdk/channels/plugins/types.d.ts +1 -1
- package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +1 -2
- package/dist/plugin-sdk/commands/onboard-helpers.d.ts +0 -1
- package/dist/plugin-sdk/commands/onboard-types.d.ts +0 -2
- package/dist/plugin-sdk/config/legacy.migrations.d.ts +2 -1
- package/dist/plugin-sdk/config/legacy.shared.d.ts +0 -9
- package/dist/plugin-sdk/config/sessions/types.d.ts +0 -7
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +0 -8
- package/dist/plugin-sdk/config/types.base.d.ts +0 -1
- package/dist/plugin-sdk/config/types.messages.d.ts +0 -4
- package/dist/plugin-sdk/config/types.tools.d.ts +0 -73
- package/dist/plugin-sdk/config/types.tts.d.ts +2 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +0 -4
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +7 -197
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +2 -10
- package/dist/plugin-sdk/config/zod-schema.core.d.ts +6 -234
- package/dist/plugin-sdk/config/zod-schema.d.ts +98 -301
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +148 -160
- package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +12 -12
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +88 -96
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +4 -10
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +11 -16
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +0 -5
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +0 -1
- package/dist/plugin-sdk/index.js +295 -1236
- package/dist/plugin-sdk/line/config-schema.d.ts +4 -4
- package/dist/plugin-sdk/logging/levels.d.ts +1 -1
- package/dist/plugin-sdk/middleware/cli-runtime-base.d.ts +6 -0
- package/dist/plugin-sdk/middleware/runtimes/claude.d.ts +6 -0
- package/dist/plugin-sdk/middleware/runtimes/codex.d.ts +2 -2
- package/dist/plugin-sdk/middleware/runtimes/gemini.d.ts +8 -1
- package/dist/plugin-sdk/plugin-sdk/index.d.ts +3 -1
- package/dist/plugin-sdk/plugins/manifest-registry.d.ts +2 -0
- package/dist/plugin-sdk/plugins/manifest.d.ts +4 -4
- package/dist/plugin-sdk/plugins/registry.d.ts +18 -0
- package/dist/plugin-sdk/plugins/types.d.ts +4 -0
- package/dist/plugin-sdk/slack/manifest.d.ts +17 -0
- package/dist/plugin-sdk/stt/preflight.d.ts +2 -4
- package/dist/plugin-sdk/stt/providers/index.d.ts +1 -1
- package/dist/plugin-sdk/stt/providers/shared.d.ts +20 -1
- package/dist/plugin-sdk/tts/providers/edge.d.ts +2 -0
- package/dist/plugin-sdk/tts/providers/elevenlabs.d.ts +2 -0
- package/dist/plugin-sdk/tts/providers/index.d.ts +4 -0
- package/dist/plugin-sdk/tts/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/tts/tts.d.ts +13 -5
- package/dist/plugin-sdk/tts/types.d.ts +21 -0
- package/dist/plugins-BviLFPLV.js +255 -0
- package/dist/plugins-CaudBUbl.js +254 -0
- package/dist/plugins-cli-CsLhphNr.js +803 -0
- package/dist/plugins-cli-CujSP9NS.js +807 -0
- package/dist/ports-BtuzUQHl.js +370 -0
- package/dist/ports-CMcHia07.js +96 -0
- package/dist/ports-gRBeuUtp.js +316 -0
- package/dist/preflight-Bq8rimP-.js +667 -0
- package/dist/preflight-DyYbEp9X.js +667 -0
- package/dist/program-G8cGMPuz.js +250 -0
- package/dist/program-context-B9BwrbSx.js +474 -0
- package/dist/progress-BcwxtM9Q.js +124 -0
- package/dist/prompt-DtWGd43j.js +21 -0
- package/dist/prompt-select-styled-CpOsmtZi.js +1672 -0
- package/dist/prompt-select-styled-D-qBqrEJ.js +1669 -0
- package/dist/prompt-style-BpUMhEHC.js +9 -0
- package/dist/provider-auth-B7QgxlKt.js +187 -0
- package/dist/provider-auth-j-EQvvIk.js +187 -0
- package/dist/provider-dispatcher-Bx6CaIoV.js +660 -0
- package/dist/provider-dispatcher-DhkvjhO5.js +659 -0
- package/dist/push-apns--nEiZmEN.js +711 -0
- package/dist/push-apns-BtS6B6lb.js +713 -0
- package/dist/pw-ai-BpCsXF-x.js +1908 -0
- package/dist/pw-ai-ud_Kbn5S.js +1911 -0
- package/dist/qr-cli-BCeVLGfz.js +353 -0
- package/dist/qr-cli-Crsqtw01.js +349 -0
- package/dist/redact-Ci96Gj0O.js +191 -0
- package/dist/redact-snapshot-B9nof-Pb.js +1952 -0
- package/dist/redact-snapshot-BKiS91Mj.js +1952 -0
- package/dist/register.agent-GnCbOS2U.js +1014 -0
- package/dist/register.agent-Mwu5hgjA.js +292 -0
- package/dist/register.configure-By-Re240.js +130 -0
- package/dist/register.configure-rB-Q0WKu.js +135 -0
- package/dist/register.import-B83Dn36B.js +29 -0
- package/dist/register.import-wIYU2cVW.js +31 -0
- package/dist/register.maintenance-D5KctP9K.js +503 -0
- package/dist/register.maintenance-Er88Oxcm.js +501 -0
- package/dist/register.message-BQhRoEQQ.js +687 -0
- package/dist/register.message-CvZKWeGb.js +691 -0
- package/dist/register.onboard-BG064oHg.js +94 -0
- package/dist/register.onboard-CAKyc1Fc.js +98 -0
- package/dist/register.setup-C9sZLS_P.js +114 -0
- package/dist/register.setup-CVsZdhkJ.js +118 -0
- package/dist/register.status-health-sessions-BZJ0wTSa.js +429 -0
- package/dist/register.status-health-sessions-CyrUwwtB.js +667 -0
- package/dist/register.subclis-CQ_Pjkyv.js +267 -0
- package/dist/replies-BIx-MbQ7.js +136 -0
- package/dist/replies-DVU655H4.js +136 -0
- package/dist/reply-CL5VMSKN.js +12372 -0
- package/dist/reply-XKyfU3rS.js +12375 -0
- package/dist/reply-directives-DQfJ001O.js +182 -0
- package/dist/reply-directives-DfUITt7C.js +182 -0
- package/dist/reply-payloads-ZHo6kfTS.js +527 -0
- package/dist/reply-prefix-BSf3PC0x.js +37 -0
- package/dist/reply-prefix-DBTlMHLK.js +37 -0
- package/dist/resolve-route-B-_IgETc.js +249 -0
- package/dist/resolve-route-C8ZsgWDQ.js +249 -0
- package/dist/response-prefix-template-3LeqJx2X.js +134 -0
- package/dist/response-prefix-template-DBrUVx5V.js +134 -0
- package/dist/retry-CDrH81GP.js +77 -0
- package/dist/retry-Dar_7pCv.js +77 -0
- package/dist/run-main-DBFpx1kt.js +308 -0
- package/dist/secure-random-CLWSvf8A.js +44 -0
- package/dist/security-cli-B8lXw9ke.js +488 -0
- package/dist/security-cli-CRkS3VAf.js +483 -0
- package/dist/send-6g8QKfWj.js +374 -0
- package/dist/send-B5Hz1PIn.js +29 -0
- package/dist/send-B8eIlA1u.js +349 -0
- package/dist/send-BFZPQE4j.js +492 -0
- package/dist/send-BpTDvE0D.js +1779 -0
- package/dist/send-BxOrO1Wv.js +1776 -0
- package/dist/send-C6gPJu-Z.js +11 -0
- package/dist/send-C7MoKtkN.js +426 -0
- package/dist/send-CXzq2LI6.js +2245 -0
- package/dist/send-CYOZoObr.js +547 -0
- package/dist/send-CfQyIvcC.js +332 -0
- package/dist/send-DUtuuwhw.js +492 -0
- package/dist/send-DbafVwxp.js +2245 -0
- package/dist/send-DeZg8K7y.js +349 -0
- package/dist/send-DwkjxJlv.js +547 -0
- package/dist/send-iX9xbxlU.js +1178 -0
- package/dist/server-BKfCzEzd.js +206 -0
- package/dist/server-fmO4eo7K.js +202 -0
- package/dist/server-lifecycle-CgPpP10P.js +2437 -0
- package/dist/server-lifecycle-Cn8yY5MW.js +2437 -0
- package/dist/server-node-events-C-ZzSBYh.js +391 -0
- package/dist/server-node-events-DYlyfDHM.js +395 -0
- package/dist/service-C2j81L86.js +670 -0
- package/dist/service-C8a0SXHD.js +670 -0
- package/dist/session-AulYhqOb.js +170 -0
- package/dist/session-C6VKWvx6.js +170 -0
- package/dist/session-cost-usage-0Vs4hgMe.js +627 -0
- package/dist/session-cost-usage-C-DsaOfN.js +627 -0
- package/dist/session-dirs-CO1f2ArM.js +318 -0
- package/dist/session-dirs-DoboH7Oy.js +318 -0
- package/dist/session-utils-CRK8ToKG.js +621 -0
- package/dist/session-utils-DWlkmCX8.js +621 -0
- package/dist/sessions-DtqrmUJS.js +2553 -0
- package/dist/sessions-gT-4fcX-.js +245 -0
- package/dist/shell-env-c3j5zcU9.js +163 -0
- package/dist/ssrf-8wNqPNzN.js +183 -0
- package/dist/ssrf-CJIdPXuS.js +183 -0
- package/dist/status-BI_-xpDt.js +1947 -0
- package/dist/status-PZVwjKjl.js +1943 -0
- package/dist/status.update-BmuDZ7E7.js +449 -0
- package/dist/status.update-Mf6HSRvU.js +449 -0
- package/dist/store-B7PGEdFf.js +2555 -0
- package/dist/store-CzhBjUCN.js +64 -0
- package/dist/store-YkSxKAey.js +53 -0
- package/dist/store-ZNeFv2Q7.js +64 -0
- package/dist/subagent-registry-R1DiAM4R.js +4839 -0
- package/dist/subagent-registry-xLRXC8Bg.js +4841 -0
- package/dist/subsystem-BAW_f3DI.js +1195 -0
- package/dist/subsystem-DGSHVL8I.js +1081 -0
- package/dist/system-cli-9SvRrT9D.js +77 -0
- package/dist/system-cli-yCa5Q1YM.js +73 -0
- package/dist/systemd-40Rij3QR.js +547 -0
- package/dist/systemd-5C97CSzd.js +547 -0
- package/dist/systemd-hints-3iQteJw-.js +278 -0
- package/dist/systemd-hints-CyQqHq1i.js +278 -0
- package/dist/systemd-linger-B2rPbnAi.js +75 -0
- package/dist/systemd-linger-DDvkfxH-.js +75 -0
- package/dist/table-DFx25vNb.js +279 -0
- package/dist/tables-C5fI0PmT.js +55 -0
- package/dist/tables-Cm9qvQ9D.js +55 -0
- package/dist/tables-fRe01eP1.js +55 -0
- package/dist/tailnet-Da-_9e8E.js +40 -0
- package/dist/tailnet-xt92Yaop.js +40 -0
- package/dist/tailscale-CnV0JWca.js +230 -0
- package/dist/tailscale-VkEC8dzj.js +230 -0
- package/dist/targets-C99szk_e.js +114 -0
- package/dist/targets-CPaTjbpp.js +2607 -0
- package/dist/targets-CmC5m7Ey.js +53 -0
- package/dist/targets-D-p4rJVS.js +650 -0
- package/dist/targets-D2OQt8-7.js +650 -0
- package/dist/targets-D94MtTiZ.js +2606 -0
- package/dist/targets-RajrXTl7.js +220 -0
- package/dist/targets-_UWmnyI9.js +53 -0
- package/dist/thinking-4nOZPunr.js +60 -0
- package/dist/thinking-ZfH2V9Os.js +60 -0
- package/dist/tokens-TtJJxzRr.js +21 -0
- package/dist/tool-display-Bxs_1jIn.js +785 -0
- package/dist/tool-display-D9p_Ttkq.js +785 -0
- package/dist/tool-images-9Ron321Q.js +263 -0
- package/dist/tool-images-BWhy6WRN.js +263 -0
- package/dist/trash-B5xyvBDf.js +125 -0
- package/dist/trash-BpB96kHe.js +125 -0
- package/dist/tui-Ba0uZDrg.js +3237 -0
- package/dist/tui-Biz0HqDj.js +3237 -0
- package/dist/tui-cli-C-UV6o2v.js +63 -0
- package/dist/tui-cli-Ds_bLT-h.js +67 -0
- package/dist/types.tools-BBb2rl3g.js +23 -0
- package/dist/types.tools-BDJw1yFx.js +23 -0
- package/dist/update-Barj5dsg.js +349 -0
- package/dist/update-D839Q8su.js +349 -0
- package/dist/update-cli-2I4hm0Gy.js +1150 -0
- package/dist/update-cli-CcwXmMKB.js +1148 -0
- package/dist/usage-BI9kergH.js +5465 -0
- package/dist/utils-DPoNpP7D.js +631 -0
- package/dist/voice-credentials-64XAMSJm.js +46 -0
- package/dist/voice-credentials-v-CQkTpD.js +46 -0
- package/dist/web-63IbbidQ.js +3051 -0
- package/dist/web-D9N764Da.js +80 -0
- package/dist/web-DUvNYLzr.js +75 -0
- package/dist/webhooks-cli-owhVNNkz.js +334 -0
- package/dist/webhooks-cli-zlvka6QD.js +330 -0
- package/dist/whatsapp-actions-8DejyRG5.js +126 -0
- package/dist/whatsapp-actions-DCzp5LKe.js +131 -0
- package/dist/widearea-dns-CQqZIeu8.js +127 -0
- package/dist/workspace-CB7pVojf.js +441 -0
- package/dist/workspace-DWEyzM0F.js +439 -0
- package/dist/zod-schema-CvFqwpNE.js +2719 -0
- package/dist/zod-schema-Y5SQgJLm.js +2719 -0
- package/package.json +1 -1
- package/dist/accounts-Aqbb2_Fn.js +0 -270
- package/dist/accounts-Bo2bX8jP.js +0 -272
- package/dist/accounts-CJUdvsIZ.js +0 -32
- package/dist/accounts-D3fAPVzU.js +0 -36
- package/dist/accounts-DZmv4bXS.js +0 -47
- package/dist/accounts-DmB4SVPK.js +0 -47
- package/dist/accounts-DtkyfvwR.js +0 -36
- package/dist/ack-reactions-BqcZUQJ3.js +0 -446
- package/dist/ack-reactions-DXHaDBH-.js +0 -446
- package/dist/acp-cli-DVXhDMc6.js +0 -1324
- package/dist/acp-cli-QBL4_qcW.js +0 -1319
- package/dist/active-listener-CwxZ24bZ.js +0 -37
- package/dist/active-listener-v2sItamh.js +0 -37
- package/dist/agent-C5PZDKE1.js +0 -687
- package/dist/agent-helpers-BSGqeJr-.js +0 -400
- package/dist/agent-qCBPcUcF.js +0 -688
- package/dist/agent-scope-CJW7vnF8.js +0 -114
- package/dist/agent-scope-_ND_-bJy.js +0 -116
- package/dist/agents-Byc39Y4A.js +0 -760
- package/dist/agents.config-BgDBcY4h.js +0 -116
- package/dist/agents.config-D8gLHPWo.js +0 -116
- package/dist/audio-BIvUsncf.js +0 -43
- package/dist/audio-CQ8TfmVN.js +0 -43
- package/dist/audit-C0x7Cm6K.js +0 -3150
- package/dist/audit-CAY-uzWP.js +0 -3150
- package/dist/auth-DGqCLaQq.js +0 -448
- package/dist/auth-DLTRySEi.js +0 -314
- package/dist/auth-Drf91ntw.js +0 -315
- package/dist/auth-ku2khJyQ.js +0 -448
- package/dist/banner-CGI3XOm4.js +0 -294
- package/dist/binaries-BTvHIrCr.js +0 -13
- package/dist/bindings-Dr0bGRst.js +0 -69
- package/dist/bindings-DsWJQVKh.js +0 -69
- package/dist/bonjour-discovery-BElR62fH.js +0 -378
- package/dist/bonjour-discovery-C8XyVsjb.js +0 -378
- package/dist/browser-cli-DxJew43l.js +0 -1694
- package/dist/browser-cli-p0nakrjO.js +0 -1690
- package/dist/call-BrTmlOx3.js +0 -518
- package/dist/call-ChdUdwb4.js +0 -517
- package/dist/catalog-DTlcfTT9.js +0 -185
- package/dist/catalog-PixZqhZK.js +0 -185
- package/dist/channel-account-context-BO245Tcn.js +0 -133
- package/dist/channel-account-context-BgK0hm-I.js +0 -133
- package/dist/channel-activity-B0qlUR5e.js +0 -292
- package/dist/channel-activity-C-L6rDrQ.js +0 -94
- package/dist/channel-activity-DdgLBZ7M.js +0 -94
- package/dist/channel-options-C1Q9SUhv.js +0 -33
- package/dist/channel-options-zANFhRx_.js +0 -32
- package/dist/channel-selection-DW21dXB1.js +0 -51
- package/dist/channel-selection-wK_6S2Ku.js +0 -51
- package/dist/channel-web-DCSjrtlh.js +0 -2136
- package/dist/channel-web-JCgegBgG.js +0 -2134
- package/dist/channels-cli-D48ytzLq.js +0 -1438
- package/dist/channels-cli-hZbUcB3G.js +0 -1434
- package/dist/channels-status-issues-B6I2l7Sm.js +0 -18
- package/dist/channels-status-issues-DhDH2fWp.js +0 -18
- package/dist/chat-envelope-BIujl9Cj.js +0 -248
- package/dist/chat-envelope-CrM0X4sl.js +0 -248
- package/dist/chrome-Dqtq7zCc.js +0 -1733
- package/dist/chrome-XeSY99Z_.js +0 -1732
- package/dist/chunk-LUabyS9k.js +0 -341
- package/dist/clack-prompter-fAgbvPW4.js +0 -122
- package/dist/clack-prompter-kf9qTN5p.js +0 -121
- package/dist/cleanup-utils-CNwlTKyR.js +0 -94
- package/dist/cli-BTLaY8q4.js +0 -133
- package/dist/cli-CZV23GbW.js +0 -129
- package/dist/client-B9u3JdT_.js +0 -2316
- package/dist/client-DEEOhx0w.js +0 -2316
- package/dist/clipboard-B2nstLx7.js +0 -31
- package/dist/clipboard-C8QI9fes.js +0 -31
- package/dist/command-format-D0vKipG9.js +0 -32
- package/dist/command-format-LFmgWzKJ.js +0 -18
- package/dist/command-registry-BPXqH4ST.js +0 -215
- package/dist/commands-BAYwlS3d.js +0 -41
- package/dist/commands-D842kCjj.js +0 -41
- package/dist/commands-registry-Cg2GTT2J.js +0 -892
- package/dist/commands-registry-Yz-uV5oG.js +0 -891
- package/dist/common-B67cBSew.js +0 -156
- package/dist/common-DEoiTqOr.js +0 -156
- package/dist/completion-cli-D5J3fPka.js +0 -452
- package/dist/completion-cli-Dd1g-p7S.js +0 -452
- package/dist/config-CAa0rZSx.js +0 -4225
- package/dist/config-W0w-gi2j.js +0 -4223
- package/dist/config-cli-Ddz-yCdQ.js +0 -247
- package/dist/config-cli-shgSFYig.js +0 -243
- package/dist/config-guard-BI85dxHR.js +0 -99
- package/dist/config-guard-DQqnigKh.js +0 -75
- package/dist/config-validation-D-h4LHyA.js +0 -18
- package/dist/config-validation-Df_kroIQ.js +0 -18
- package/dist/configure-BnFwpZ3l.js +0 -891
- package/dist/configure-Cj4mlKSH.js +0 -889
- package/dist/control-auth-BrBr2xb8.js +0 -397
- package/dist/control-auth-CehjYKnL.js +0 -397
- package/dist/control-ui-assets-D8F383Mo.js +0 -186
- package/dist/control-ui-assets-DYKtRIm0.js +0 -186
- package/dist/conversation-label-Bn5j3lUT.js +0 -36
- package/dist/cron-cli-DVzDHzAX.js +0 -494
- package/dist/cron-cli-gkH2qKM4.js +0 -498
- package/dist/daemon-cli-BTdNO1vH.js +0 -737
- package/dist/daemon-cli-DNNqI2LD.js +0 -735
- package/dist/daemon-install-CaEHG92p.js +0 -56
- package/dist/daemon-install-DbpDSDfW.js +0 -60
- package/dist/daemon-install-helpers-DjE_WnlY.js +0 -504
- package/dist/daemon-install-helpers-DocTUxqQ.js +0 -504
- package/dist/deliver-CDcL8ok6.js +0 -481
- package/dist/deliver-CS8JsevV.js +0 -481
- package/dist/delivery-queue-CTaYZQ_8.js +0 -244
- package/dist/delivery-queue-DMZ7mH8P.js +0 -244
- package/dist/devices-cli-BBJ4His-.js +0 -319
- package/dist/devices-cli-DHSJSFW1.js +0 -323
- package/dist/diagnostics-BSvCaLNs.js +0 -35
- package/dist/diagnostics-mWFAsFeo.js +0 -35
- package/dist/directory-cli-C-oHD_XE.js +0 -224
- package/dist/directory-cli-Cw99VGvr.js +0 -220
- package/dist/dispatcher-C8d1NNLZ.js +0 -174
- package/dist/dispatcher-DY6Ga60j.js +0 -173
- package/dist/dm-policy-shared-CRQ-Wr5g.js +0 -22
- package/dist/dm-policy-shared-CXXf2ltd.js +0 -22
- package/dist/dns-cli-BOqx9qo1.js +0 -199
- package/dist/dns-cli-WfqSC3JU.js +0 -203
- package/dist/dock-Big-J2VN.js +0 -929
- package/dist/dock-Cj4PKiUh.js +0 -928
- package/dist/doctor-completion-B9RsNJKh.js +0 -92
- package/dist/doctor-completion-DhNvADTs.js +0 -92
- package/dist/doctor-config-flow-BUuADMDa.js +0 -1935
- package/dist/doctor-config-flow-yOUpQC2B.js +0 -1934
- package/dist/enable-DC9V0nTO.js +0 -59
- package/dist/enable-DzXMQJ-o.js +0 -59
- package/dist/env-B3zr72vQ.js +0 -60
- package/dist/errors-CdmXrBic.js +0 -35
- package/dist/errors-Cr_NbOb4.js +0 -35
- package/dist/exec-D_s-zAtY.js +0 -164
- package/dist/exec-Zz6eJ6YU.js +0 -164
- package/dist/fetch-C8pdlo4-.js +0 -67
- package/dist/fetch-DRVdxxEj.js +0 -67
- package/dist/file-lock-6NXMPZTT.js +0 -107
- package/dist/file-lock-C_KRlR7M.js +0 -107
- package/dist/fs-safe-DZHpH7TI.js +0 -98
- package/dist/fs-safe-vm3JMUkq.js +0 -88
- package/dist/gateway-cli-CebjflhZ.js +0 -24337
- package/dist/gateway-cli-Y9U6rbPB.js +0 -24333
- package/dist/gateway-rpc-BCFkQPa2.js +0 -28
- package/dist/gateway-rpc-DOgYbsOG.js +0 -28
- package/dist/gmail-setup-utils-DMeA1UM1.js +0 -423
- package/dist/gmail-setup-utils-FHWSAur3.js +0 -422
- package/dist/health-CXWQZGNz.js +0 -1414
- package/dist/health-DCC6hoLO.js +0 -1417
- package/dist/health-format-CVgQD-z9.js +0 -28
- package/dist/heartbeat-visibility-Cv0ejWJ-.js +0 -125
- package/dist/heartbeat-visibility-Da3TDQp2.js +0 -125
- package/dist/help-format-DM6-OBt-.js +0 -17
- package/dist/hook-runner-global-C0DFQmQw.js +0 -527
- package/dist/hooks-cli-CB5rKhHe.js +0 -1221
- package/dist/hooks-cli-Dy7m9hzM.js +0 -1225
- package/dist/image-ops-B9ofmzSq.js +0 -354
- package/dist/image-ops-CMuvRsMY.js +0 -354
- package/dist/import-BH13F5mT.js +0 -606
- package/dist/import-D8HVcDqO.js +0 -604
- package/dist/inbound-context-CmmmT8IP.js +0 -68
- package/dist/inbound-path-policy-BdmTOUka.js +0 -90
- package/dist/inbound-path-policy-BurOAu44.js +0 -90
- package/dist/inspect-nW8LAukU.js +0 -286
- package/dist/inspect-xy2EHy8G.js +0 -286
- package/dist/installs-CpfHmKY1.js +0 -325
- package/dist/installs-DebiMrGj.js +0 -325
- package/dist/ipv4-ysiNGssl.js +0 -46
- package/dist/ipv4-zc_Hfvbp.js +0 -46
- package/dist/ir-CaxTklDC.js +0 -940
- package/dist/lifecycle-core-Z5SScMlU.js +0 -476
- package/dist/lifecycle-core-pPwYSt7m.js +0 -474
- package/dist/links-D5vtq30Q.js +0 -15
- package/dist/loader-BVHaRcP7.js +0 -22404
- package/dist/loader-CxSGgugQ.js +0 -22401
- package/dist/local-roots-CrJ_Jv_G.js +0 -314
- package/dist/local-roots-n_Y4iYwb.js +0 -313
- package/dist/logger-B8yHnzPl.js +0 -49
- package/dist/logging-FctZEleJ.js +0 -20
- package/dist/login-C99fsB0N.js +0 -61
- package/dist/login-cLvGPjeO.js +0 -62
- package/dist/login-qr-CGqRFwgl.js +0 -329
- package/dist/login-qr-dnY5DC2C.js +0 -325
- package/dist/logs-cli-Bda7xY4N.js +0 -236
- package/dist/logs-cli-HzR-vnpD.js +0 -240
- package/dist/markdown-tables-58Hq__7K.js +0 -29
- package/dist/markdown-tables-GFEX0OR6.js +0 -29
- package/dist/media-C1SIfGTn.js +0 -10452
- package/dist/media-CFsyXs3H.js +0 -940
- package/dist/message-action-names-BgsKGLDS.js +0 -2521
- package/dist/message-action-names-DkZwEFhU.js +0 -2521
- package/dist/message-channel-FMNRI5Ax.js +0 -91
- package/dist/mime-AuIDUZPG.js +0 -149
- package/dist/mime-Cqg1jjia.js +0 -149
- package/dist/net-BEFkF-nI.js +0 -225
- package/dist/net-CNsUGiSw.js +0 -225
- package/dist/node-cli-Bu-InsO9.js +0 -1462
- package/dist/node-cli-DE7Pm7Fr.js +0 -1458
- package/dist/node-service-CumFZc9L.js +0 -67
- package/dist/node-service-DY1gG06I.js +0 -67
- package/dist/nodes-cli-B5aAExN0.js +0 -1350
- package/dist/nodes-cli-eKRqlKuO.js +0 -1346
- package/dist/nodes-screen-B3Sij1uT.js +0 -250
- package/dist/nodes-screen-DEvpoFmH.js +0 -250
- package/dist/note-CPFJCWJJ.js +0 -92
- package/dist/note-DHUJACHE.js +0 -92
- package/dist/npm-registry-spec-BgMtTHvq.js +0 -786
- package/dist/npm-registry-spec-Dz3z1Zpd.js +0 -786
- package/dist/npm-resolution-BXiQH99t.js +0 -86
- package/dist/npm-resolution-CqE0nhxJ.js +0 -86
- package/dist/onboard-DK2z3w1P.js +0 -649
- package/dist/onboard-auth-C_wHkop1.js +0 -207
- package/dist/onboard-auth-CkCBLvTg.js +0 -211
- package/dist/onboard-channels-C8_OLbPk.js +0 -2547
- package/dist/onboard-channels-w_tnOhVu.js +0 -2548
- package/dist/onboard-helpers-Q7M6vdzh.js +0 -363
- package/dist/onboard-helpers-SCO3k5Y8.js +0 -364
- package/dist/onboard-remote-Co2hv1AD.js +0 -127
- package/dist/onboard-remote-Dl3BFSg2.js +0 -127
- package/dist/onboard-rioH3DW6.js +0 -647
- package/dist/onboarding-CsXVuzFP.js +0 -586
- package/dist/onboarding-r5RCkc-Z.js +0 -588
- package/dist/onboarding.finalize-BY8uN1nD.js +0 -402
- package/dist/onboarding.finalize-C-kfj-aR.js +0 -404
- package/dist/onboarding.gateway-config-BL0Q7Wpg.js +0 -201
- package/dist/onboarding.gateway-config-D2QsXMYO.js +0 -195
- package/dist/outbound-CcaPcetn.js +0 -220
- package/dist/outbound-CeiW8z3a.js +0 -221
- package/dist/outbound-attachment-BLSGI2dJ.js +0 -18
- package/dist/outbound-attachment-Bfm5-JYe.js +0 -18
- package/dist/outbound-attachment-CZ7zoYxB.js +0 -18
- package/dist/pairing-cli-CgX79ujL.js +0 -125
- package/dist/pairing-cli-DvbbXFgC.js +0 -129
- package/dist/pairing-labels-3wDxaApH.js +0 -9
- package/dist/pairing-labels-DCbWnbWk.js +0 -9
- package/dist/pairing-store-CdY7iRS0.js +0 -459
- package/dist/pairing-store-DykkYpQ7.js +0 -460
- package/dist/path-env-Cqo5LZmw.js +0 -89
- package/dist/path-guards-DOpzcMXz.js +0 -31
- package/dist/path-guards-DipYoPVw.js +0 -31
- package/dist/path-safety-CXKAVpMp.js +0 -14
- package/dist/path-safety-DGB91qBk.js +0 -14
- package/dist/paths-BTaH3rLn.js +0 -232
- package/dist/plugin-auto-enable-C6FPGg_-.js +0 -301
- package/dist/plugin-auto-enable-L8eOc8iC.js +0 -302
- package/dist/plugin-registry-BTycBIix.js +0 -33
- package/dist/plugin-registry-CFty9Gym.js +0 -33
- package/dist/plugin-sdk/auto-reply/reply/elevated-allowlist-matcher.d.ts +0 -20
- package/dist/plugin-sdk/auto-reply/reply/elevated-unavailable.d.ts +0 -8
- package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +0 -16
- package/dist/plugin-sdk/compat/legacy-names.d.ts +0 -8
- package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +0 -2
- package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +0 -2
- package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +0 -2
- package/dist/plugin-sdk/cron/legacy-delivery.d.ts +0 -3
- package/dist/plugin-sdk/cron/payload-migration.d.ts +0 -3
- package/dist/plugin-sdk/link-understanding/apply.d.ts +0 -10
- package/dist/plugin-sdk/link-understanding/defaults.d.ts +0 -2
- package/dist/plugin-sdk/link-understanding/detect.d.ts +0 -3
- package/dist/plugin-sdk/link-understanding/format.d.ts +0 -4
- package/dist/plugin-sdk/link-understanding/runner.d.ts +0 -11
- package/dist/plugin-sdk/media/input-files.d.ts +0 -95
- package/dist/plugin-sdk/media-understanding/apply.d.ts +0 -19
- package/dist/plugin-sdk/media-understanding/attachments.d.ts +0 -49
- package/dist/plugin-sdk/media-understanding/concurrency.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/defaults.d.ts +0 -11
- package/dist/plugin-sdk/media-understanding/errors.d.ts +0 -6
- package/dist/plugin-sdk/media-understanding/format.d.ts +0 -7
- package/dist/plugin-sdk/media-understanding/fs.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/output-extract.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +0 -3
- package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/index.d.ts +0 -4
- package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/mistral/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/moonshot/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/moonshot/video.d.ts +0 -3
- package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +0 -20
- package/dist/plugin-sdk/media-understanding/providers/zai/index.d.ts +0 -2
- package/dist/plugin-sdk/media-understanding/resolve.d.ts +0 -44
- package/dist/plugin-sdk/media-understanding/runner.d.ts +0 -34
- package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +0 -33
- package/dist/plugin-sdk/media-understanding/scope.d.ts +0 -9
- package/dist/plugin-sdk/media-understanding/types.d.ts +0 -59
- package/dist/plugin-sdk/media-understanding/video.d.ts +0 -2
- package/dist/plugin-sdk/utils/run-with-concurrency.d.ts +0 -11
- package/dist/plugins-7B167wIj.js +0 -453
- package/dist/plugins-BRHOfy1Z.js +0 -455
- package/dist/plugins-cli-CQGW40I-.js +0 -797
- package/dist/plugins-cli-D-ZfWRTw.js +0 -801
- package/dist/ports-CAqyeQYZ.js +0 -316
- package/dist/ports-CTUgXF2d.js +0 -96
- package/dist/ports-DqfnVnCw.js +0 -370
- package/dist/preflight-CJqKHCYa.js +0 -64
- package/dist/preflight-TR92sc61.js +0 -68
- package/dist/program-_SGrjcuG.js +0 -248
- package/dist/program-context-B6yIPfYd.js +0 -474
- package/dist/progress-BOdRbOHD.js +0 -124
- package/dist/prompt-WEkXwIMT.js +0 -21
- package/dist/prompt-select-styled-BiBnOTh8.js +0 -1669
- package/dist/prompt-select-styled-DQacku67.js +0 -1672
- package/dist/prompt-style-B4Cq4PyQ.js +0 -9
- package/dist/provider-dispatcher-BjsUFEpi.js +0 -659
- package/dist/provider-dispatcher-BxNDRVIT.js +0 -660
- package/dist/push-apns-Cj0Ryn18.js +0 -713
- package/dist/push-apns-fFfYCqda.js +0 -711
- package/dist/pw-ai-CnN2sITD.js +0 -1908
- package/dist/pw-ai-fnX3cecw.js +0 -1911
- package/dist/qr-cli-CriPg41m.js +0 -349
- package/dist/qr-cli-DSURqD0D.js +0 -353
- package/dist/redact-gXuh8MFk.js +0 -191
- package/dist/redact-snapshot-BecRL_h6.js +0 -2016
- package/dist/redact-snapshot-pTdzSrex.js +0 -2016
- package/dist/register.agent-Bpwvc5By.js +0 -1018
- package/dist/register.agent-DQFcnOVQ.js +0 -290
- package/dist/register.configure-C5CK8tgd.js +0 -133
- package/dist/register.configure-CEJ5Wrkl.js +0 -128
- package/dist/register.import-CPQqqdje.js +0 -31
- package/dist/register.import-D1UaH1QV.js +0 -29
- package/dist/register.maintenance-Bpz-NOhG.js +0 -499
- package/dist/register.maintenance-DDwlfAfw.js +0 -501
- package/dist/register.message-BoNswT8e.js +0 -685
- package/dist/register.message-pvz70g_-.js +0 -689
- package/dist/register.onboard-BvcVLNp3.js +0 -93
- package/dist/register.onboard-CZV7LvZI.js +0 -97
- package/dist/register.setup-Cgv2uSPG.js +0 -117
- package/dist/register.setup-yTqvTinY.js +0 -113
- package/dist/register.status-health-sessions-LK50hWDT.js +0 -428
- package/dist/register.status-health-sessions-kDGDihye.js +0 -668
- package/dist/register.subclis-DSr7AHAr.js +0 -267
- package/dist/replies-IpiCq1Ht.js +0 -136
- package/dist/replies-LSx_XhsP.js +0 -136
- package/dist/reply-B8It91bP.js +0 -13652
- package/dist/reply-CbgHVTv2.js +0 -13649
- package/dist/reply-directives-Cz7622Qx.js +0 -182
- package/dist/reply-directives-ssnaPNiU.js +0 -182
- package/dist/reply-payloads-CQMtrphw.js +0 -527
- package/dist/reply-prefix-CWcAZKhE.js +0 -37
- package/dist/reply-prefix-Drq7Pf3A.js +0 -37
- package/dist/resolve-route-B8uIc2H3.js +0 -249
- package/dist/resolve-route-C8ooNlI4.js +0 -249
- package/dist/response-prefix-template-D3ZcJP4E.js +0 -134
- package/dist/response-prefix-template-DPOggmPO.js +0 -134
- package/dist/retry-B19gMxS7.js +0 -77
- package/dist/retry-BdhJlZQI.js +0 -77
- package/dist/run-main-BP3UHEJa.js +0 -306
- package/dist/runner-CD3YycXx.js +0 -2365
- package/dist/runner-D74Wiza_.js +0 -2365
- package/dist/secure-random-CQa3H-OL.js +0 -44
- package/dist/security-cli-05blEYyC.js +0 -482
- package/dist/security-cli-DYbt8duB.js +0 -487
- package/dist/send-7O3-bRtl.js +0 -547
- package/dist/send-9Huf62k3.js +0 -2245
- package/dist/send-B0C42B2A.js +0 -426
- package/dist/send-B9mIJdUo.js +0 -547
- package/dist/send-BHm9dk6D.js +0 -1178
- package/dist/send-BetMntNc.js +0 -11
- package/dist/send-Bj0RXr-a.js +0 -492
- package/dist/send-COuVtZ4b.js +0 -374
- package/dist/send-CXNuhYA-.js +0 -332
- package/dist/send-Ce_BDa8P.js +0 -349
- package/dist/send-ChvasRSh.js +0 -1779
- package/dist/send-DNVRlTEF.js +0 -29
- package/dist/send-DWf7BCPe.js +0 -492
- package/dist/send-Dd2_MykI.js +0 -2245
- package/dist/send-IJaUAa8H.js +0 -1776
- package/dist/send-vvZXksNU.js +0 -349
- package/dist/server-BrzR9JmX.js +0 -206
- package/dist/server-_h27-uP_.js +0 -202
- package/dist/server-lifecycle-CUdA6Far.js +0 -2437
- package/dist/server-lifecycle-DQZWL8iP.js +0 -2437
- package/dist/server-node-events-DSefRBGC.js +0 -394
- package/dist/server-node-events-jDiG1-M2.js +0 -390
- package/dist/service-9le8AnC-.js +0 -670
- package/dist/service-Drb0kx6I.js +0 -670
- package/dist/session-BIAOl5QR.js +0 -170
- package/dist/session-Wu00pCn_.js +0 -170
- package/dist/session-cost-usage-7plmOKbs.js +0 -627
- package/dist/session-cost-usage-CPFxBFUg.js +0 -627
- package/dist/session-dirs-CfIrIJxG.js +0 -318
- package/dist/session-dirs-DlPpWt5Q.js +0 -318
- package/dist/session-utils-Sd9w4vc1.js +0 -622
- package/dist/session-utils-iL47hYmZ.js +0 -622
- package/dist/sessions-6pKQ3gN3.js +0 -247
- package/dist/sessions-ZRmCDdj1.js +0 -2569
- package/dist/shell-env-DYZq9PqC.js +0 -163
- package/dist/ssrf-B-rF_tZB.js +0 -183
- package/dist/ssrf-DJW14Wkh.js +0 -183
- package/dist/status-BGM-EJGk.js +0 -1983
- package/dist/status-CGkrO9om.js +0 -1979
- package/dist/status.update-DlBReI5-.js +0 -449
- package/dist/status.update-v7fEQ7R9.js +0 -449
- package/dist/store-B5989JkX.js +0 -64
- package/dist/store-BpXxa0Uf.js +0 -53
- package/dist/store-DCrrxHyS.js +0 -2571
- package/dist/store-Ql6vAcsg.js +0 -64
- package/dist/subagent-registry-BGknZEUI.js +0 -4856
- package/dist/subagent-registry-CWeRBjfn.js +0 -4854
- package/dist/subsystem-Ct6qOOqZ.js +0 -1079
- package/dist/subsystem-PQ64_nsu.js +0 -1136
- package/dist/system-cli-CmO-4Rju.js +0 -77
- package/dist/system-cli-VBsa18K6.js +0 -73
- package/dist/systemd-CqFpK30Y.js +0 -547
- package/dist/systemd-fK9AV5bP.js +0 -547
- package/dist/systemd-hints-D3rr0j14.js +0 -278
- package/dist/systemd-hints-DNOSRaqA.js +0 -278
- package/dist/systemd-linger-B907NVVy.js +0 -75
- package/dist/systemd-linger-wYksBbM7.js +0 -75
- package/dist/table-C-dba-5-.js +0 -279
- package/dist/tables-CO_kxD0e.js +0 -55
- package/dist/tables-Rd6ZUH0u.js +0 -55
- package/dist/tables-WZp8Vt9n.js +0 -55
- package/dist/tailnet-CfZhpSnt.js +0 -40
- package/dist/tailnet-D0NV0tRJ.js +0 -40
- package/dist/tailscale-B__xvMjA.js +0 -230
- package/dist/tailscale-q_ZrxUCc.js +0 -230
- package/dist/targets-B4rMyQFJ.js +0 -53
- package/dist/targets-BEBzTa22.js +0 -114
- package/dist/targets-BjWhDMJM.js +0 -650
- package/dist/targets-BlEVuFSt.js +0 -2474
- package/dist/targets-CHwGDIgO.js +0 -650
- package/dist/targets-CbbmgMRV.js +0 -2473
- package/dist/targets-SpN-MPBH.js +0 -220
- package/dist/targets-mqj9GNg1.js +0 -53
- package/dist/thinking-BqJmU6Zp.js +0 -88
- package/dist/thinking-l-rrvZwu.js +0 -88
- package/dist/tokens-DAFBx5qr.js +0 -21
- package/dist/tool-display-C0hpLmkw.js +0 -785
- package/dist/tool-display-CQTRHo3Z.js +0 -785
- package/dist/tool-images-BYY11Gw3.js +0 -263
- package/dist/tool-images-CnJ0R8Fo.js +0 -263
- package/dist/trash-C0mjnHuW.js +0 -125
- package/dist/trash-Cgwc9mLD.js +0 -125
- package/dist/tui-9cJnR1dN.js +0 -3282
- package/dist/tui-BR3egaFJ.js +0 -3282
- package/dist/tui-cli-BYpkhE6J.js +0 -66
- package/dist/tui-cli-DndeZyup.js +0 -62
- package/dist/update-BJVdkzk7.js +0 -349
- package/dist/update-DjI6KTA5.js +0 -349
- package/dist/update-cli-DR-zFdCm.js +0 -1146
- package/dist/update-cli-EuHV_AUf.js +0 -1148
- package/dist/usage-BQUMGgBj.js +0 -5350
- package/dist/utils-C5daYcFn.js +0 -631
- package/dist/voice-credentials-CXdoE4IF.js +0 -45
- package/dist/voice-credentials-Cu7htUQq.js +0 -45
- package/dist/web-6WVkqhtO.js +0 -3087
- package/dist/web-BfSXKISl.js +0 -74
- package/dist/web-Cngqu3vs.js +0 -79
- package/dist/webhooks-cli-0yQha2yj.js +0 -334
- package/dist/webhooks-cli-ula0bTX-.js +0 -330
- package/dist/whatsapp-actions-3NdzsNg1.js +0 -130
- package/dist/whatsapp-actions-y_1vjkYY.js +0 -125
- package/dist/widearea-dns-C-0P7TRi.js +0 -127
- package/dist/workspace-BT3X-qCZ.js +0 -449
- package/dist/workspace-D5hHXubL.js +0 -447
- package/dist/zod-schema-CbqZAIYy.js +0 -2696
- package/dist/zod-schema-YGQJEcnj.js +0 -2696
- /package/dist/{account-lookup-BOCzCnir.js → account-lookup-CIY_RKhi.js} +0 -0
- /package/dist/{agent-helpers-eEHy5uX2.js → agent-helpers-Bs2nBXeI.js} +0 -0
- /package/dist/{api-Cd_7aESj.js → api-BE4ZCWWB.js} +0 -0
- /package/dist/{api-DJ_oWYus.js → api-wsk9zRVi.js} +0 -0
- /package/dist/{chat-type-DyovJwCt.js → chat-type-BP9akbag.js} +0 -0
- /package/dist/{chunk-CWD_zrz_.js → chunk-BAMyFYtF.js} +0 -0
- /package/dist/{cleanup-utils-gNzIs9yk.js → cleanup-utils-ZC2zvntc.js} +0 -0
- /package/dist/{cli-name-3MdfbvIR.js → cli-name-BZsYSp9l.js} +0 -0
- /package/dist/{cli-name-CRLBidNP.js → cli-name-CRe5Ow_t.js} +0 -0
- /package/dist/{cli-utils-5ZIfXAfM.js → cli-utils-CGB3cBZm.js} +0 -0
- /package/dist/{client-D5m46AuY.js → client-9dK56xly.js} +0 -0
- /package/dist/{client-DFyI5I0n.js → client-D-R1YdRD.js} +0 -0
- /package/dist/{command-options-Cn2fc1Of.js → command-options-CnHA4TzR.js} +0 -0
- /package/dist/{config-eval-BCKpAS_K.js → config-eval-BQIR-wSg.js} +0 -0
- /package/dist/{config-eval-CU2G7a83.js → config-eval-Bh82JoXK.js} +0 -0
- /package/dist/{constants-CRGAZ2ow.js → constants-C7j1VA2S.js} +0 -0
- /package/dist/{constants-BAZuhSRm.js → constants-PMRtHBHU.js} +0 -0
- /package/dist/{credentials-DMAWNZdV.js → credentials-C_RoJFmK.js} +0 -0
- /package/dist/{credentials-Dmc3H-jd.js → credentials-DM_Dj0m8.js} +0 -0
- /package/dist/{daemon-runtime-aQhinwSL.js → daemon-runtime-9oDBR7YW.js} +0 -0
- /package/dist/{dangerous-name-matching-BCaPvXy_.js → dangerous-name-matching-CSq9sJDG.js} +0 -0
- /package/dist/{dangerous-tools-E1i3IoxZ.js → dangerous-tools-D4jtl72G.js} +0 -0
- /package/dist/{fetch-DTR2MlOk.js → fetch-DTsU2XnC.js} +0 -0
- /package/dist/{fetch-timeout-l_6RdoMw.js → fetch-timeout-CytN1wiO.js} +0 -0
- /package/dist/{file-identity-BnGA6wyc.js → file-identity-CeRK5CJC.js} +0 -0
- /package/dist/{format-relative-Cywx6ldk.js → format-relative-Czf5fUjn.js} +0 -0
- /package/dist/{format-relative-DcQZUAYl.js → format-relative-zwkkXJvs.js} +0 -0
- /package/dist/{health-format-CL2Xq92A.js → health-format-DF54wvUU.js} +0 -0
- /package/dist/{heartbeat-wake-DjsTDzF3.js → heartbeat-wake-CvHncCjP.js} +0 -0
- /package/dist/{helpers-D-r6yhnI.js → helpers-DAEoFkbn.js} +0 -0
- /package/dist/{helpers-DSMIGYx2.js → helpers-n2CtWpm9.js} +0 -0
- /package/dist/{helpers-CRrn7Err.js → helpers-ndPQWl6m.js} +0 -0
- /package/dist/{input-provenance-BgfeDgck.js → input-provenance-gIfDn1ki.js} +0 -0
- /package/dist/{input-provenance-xUsSMOsz.js → input-provenance-wkso1o5V.js} +0 -0
- /package/dist/{ip-BAhS4rY2.js → ip-D4VG5EJO.js} +0 -0
- /package/dist/{ip-BUhsZdJu.js → ip-MwCwRA7c.js} +0 -0
- /package/dist/{json-file-Dbg7nZg1.js → json-file-BW22hGtf.js} +0 -0
- /package/dist/{json-file-B5WEJJye.js → json-file-DwRAfAAy.js} +0 -0
- /package/dist/{json-files-CfhnuGaC.js → json-files-BI20PLIm.js} +0 -0
- /package/dist/{json-files-BFGbyEzL.js → json-files-Dy52honG.js} +0 -0
- /package/dist/{lanes-4FoQemog.js → lanes-1CBKdsiR.js} +0 -0
- /package/dist/{lanes-BhdzrAIa.js → lanes-DqVYfPRG.js} +0 -0
- /package/dist/{logger-IA_Dr_BT.js → logger-B8BE0PyS.js} +0 -0
- /package/dist/{logger-nEdVxm5D.js → logger-CPvz-aPM.js} +0 -0
- /package/dist/{logger-O6JX52kK.js → logger-cL0D2DCr.js} +0 -0
- /package/dist/{logging-BiuZwq5D.js → logging-DRwtiLIS.js} +0 -0
- /package/dist/{logging-Bs1VqVFL.js → logging-DTEoeoa3.js} +0 -0
- /package/dist/{logging-JZEg5nDp.js → logging-fywhKCmE.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-TCG6mnbz.js → mutable-allowlist-detectors-BXE7Hr7F.js} +0 -0
- /package/dist/{onboard-config-BxfgUqk6.js → onboard-config-DOmXYEvJ.js} +0 -0
- /package/dist/{onboard-config-DNzlo8Cg.js → onboard-config-JmR21VYa.js} +0 -0
- /package/dist/{parse-log-line-CT0H1-oQ.js → parse-log-line-GisaZn5H.js} +0 -0
- /package/dist/{parse-log-line-pij_xhtE.js → parse-log-line-ZsbwG_u7.js} +0 -0
- /package/dist/{parse-timeout-CvODy9RC.js → parse-timeout-BpphuwYl.js} +0 -0
- /package/dist/{parse-timeout-CxYHsZWc.js → parse-timeout-CE6BjmGU.js} +0 -0
- /package/dist/plugin-sdk/{media-understanding → stt}/providers/google/inline-data.d.ts +0 -0
- /package/dist/{plugins-allowlist-Bcqe9Gd8.js → plugins-allowlist-A38nxBRG.js} +0 -0
- /package/dist/{plugins-allowlist-ptAp-oPY.js → plugins-allowlist-D2tS9tcu.js} +0 -0
- /package/dist/{polls-DQrR-qT3.js → polls-BLyT08ZI.js} +0 -0
- /package/dist/{polls-ybwcqkWt.js → polls-BmymsJEe.js} +0 -0
- /package/dist/{ports-BS8kQkd9.js → ports-DALdfBQy.js} +0 -0
- /package/dist/{process-scoped-map-BwUkYFQV.js → process-scoped-map-BCJR56ZB.js} +0 -0
- /package/dist/{process-scoped-map-_zxf_kLz.js → process-scoped-map-Cb1EHPyN.js} +0 -0
- /package/dist/{program-context-CG-t6Yp-.js → program-context-DlXnmuB7.js} +0 -0
- /package/dist/{prompt-style-B1740PBl.js → prompt-style-CUuA6OCy.js} +0 -0
- /package/dist/{proxy-BdjLhNln.js → proxy-D-qGA1vm.js} +0 -0
- /package/dist/{pw-ai-state-DaISdsXY.js → pw-ai-state--TxTVwRW.js} +0 -0
- /package/dist/{redact-CqWx9rpK.js → redact-BW8tobyp.js} +0 -0
- /package/dist/{redact-identifier-DR54qsoT.js → redact-identifier-Bv5SUUw-.js} +0 -0
- /package/dist/{remoteclaw-root-u8dAeHID.js → remoteclaw-root-BfPjgewe.js} +0 -0
- /package/dist/{remoteclaw-root-CgNyrbxc.js → remoteclaw-root-E4-hmb4E.js} +0 -0
- /package/dist/{render-CDCvpfhh.js → render-BhKzKdV0.js} +0 -0
- /package/dist/{render-CJl4GK1B.js → render-e7fENCYH.js} +0 -0
- /package/dist/{retry-cXXk2j6_.js → retry-BWv_fy4u.js} +0 -0
- /package/dist/{runtime-guard-BS55uiSW.js → runtime-guard-Bhx-pb8_.js} +0 -0
- /package/dist/{runtime-status-BhW7hP_U.js → runtime-status-CR9445g5.js} +0 -0
- /package/dist/{secret-equal-CJzes24Z.js → secret-equal-D6AoXne1.js} +0 -0
- /package/dist/{secret-equal-CQAmGfGc.js → secret-equal-DLnUuWM3.js} +0 -0
- /package/dist/{secure-random-B3f7Ri2X.js → secure-random-CJtykx_p.js} +0 -0
- /package/dist/{secure-random-BkZFG9cd.js → secure-random-CRVHgtmO.js} +0 -0
- /package/dist/{stagger-B-_Wnofy.js → stagger--wvODnNe.js} +0 -0
- /package/dist/{stagger-B2ORDHsP.js → stagger-BLmTO4cK.js} +0 -0
- /package/dist/{status-C6YNwimj.js → status-1zVD-Clq.js} +0 -0
- /package/dist/{status-yrDGXYZM.js → status-BtRY0nXQ.js} +0 -0
- /package/dist/{strip-inbound-meta-0cvL6itU.js → strip-inbound-meta-zmUXypSS.js} +0 -0
- /package/dist/{strip-inbound-meta-DjKcSFaW.js → strip-inbound-meta-zqtN9FTK.js} +0 -0
- /package/dist/{table-ByMyHTh_.js → table-On3hkCqi.js} +0 -0
- /package/dist/{targets-DOJXjN1U.js → targets-B46m7u5J.js} +0 -0
- /package/dist/{targets-WSwPflb6.js → targets-D7PT_rdO.js} +0 -0
- /package/dist/{text-format-mr5bZq0f.js → text-format-Ds92M9UT.js} +0 -0
- /package/dist/{tokens-C8yGxAcR.js → tokens-Dw7ZdYwT.js} +0 -0
- /package/dist/{usage-BXi79Rq6.js → usage-BIzKZ5dT.js} +0 -0
- /package/dist/{usage-C1lHaofV.js → usage-BvZOzIC7.js} +0 -0
- /package/dist/{usage-format-CD5jsZY1.js → usage-format-CmniSPCG.js} +0 -0
- /package/dist/{usage-format-CRVpDVj1.js → usage-format-D_KQYQ-w.js} +0 -0
- /package/dist/{widearea-dns-DFZMcfLf.js → widearea-dns-D01FFYZ8.js} +0 -0
- /package/dist/{wsl-D28w2jQC.js → wsl-PDLKeX04.js} +0 -0
package/dist/web-6WVkqhtO.js
DELETED
|
@@ -1,3087 +0,0 @@
|
|
|
1
|
-
import { C as getChildLogger, g as toWhatsappJid, i as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as escapeRegExp } from "./subsystem-Ct6qOOqZ.js";
|
|
2
|
-
import { $ as resolveDiscordAccount, A as GATEWAY_CLIENT_IDS, C as INTERNAL_MESSAGE_CHANNEL, F as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, I as mergeInboundPathRoots, M as loadConfig, et as normalizeDiscordToken, j as GATEWAY_CLIENT_MODES, l as chunkMarkdownTextWithMode, mt as normalizeAccountId, o as getDefaultMediaLocalRoots, pt as DEFAULT_ACCOUNT_ID, rt as formatCliCommand, s as resolveMarkdownTableMode, t as loadWebMedia, u as resolveChunkMode } from "./media-C1SIfGTn.js";
|
|
3
|
-
import { D as INPUT_PROVENANCE_KIND_VALUES } from "./usage-BQUMGgBj.js";
|
|
4
|
-
import "./accounts-CJUdvsIZ.js";
|
|
5
|
-
import { t as generateSecureUuid } from "./secure-random-CQa3H-OL.js";
|
|
6
|
-
import "./fetch-C8pdlo4-.js";
|
|
7
|
-
import "./retry-BdhJlZQI.js";
|
|
8
|
-
import { n as resolveDiscordTarget, t as parseDiscordTarget } from "./targets-SpN-MPBH.js";
|
|
9
|
-
import "./store-BpXxa0Uf.js";
|
|
10
|
-
import "./send-DNVRlTEF.js";
|
|
11
|
-
import { n as createDiscordRetryRunner, t as recordChannelActivity } from "./channel-activity-B0qlUR5e.js";
|
|
12
|
-
import "./render-6ahYfPwj.js";
|
|
13
|
-
import { t as convertMarkdownTables } from "./tables-Rd6ZUH0u.js";
|
|
14
|
-
import "./send-BHm9dk6D.js";
|
|
15
|
-
import path, { join } from "node:path";
|
|
16
|
-
import fsSync, { constants, readFileSync } from "node:fs";
|
|
17
|
-
import os, { homedir } from "node:os";
|
|
18
|
-
import JSON5 from "json5";
|
|
19
|
-
import { promisify } from "node:util";
|
|
20
|
-
import fs from "node:fs/promises";
|
|
21
|
-
import crypto, { randomUUID } from "node:crypto";
|
|
22
|
-
import { execFile } from "node:child_process";
|
|
23
|
-
import { fileURLToPath } from "node:url";
|
|
24
|
-
import AjvPkg from "ajv";
|
|
25
|
-
import "ws";
|
|
26
|
-
import { Type } from "@sinclair/typebox";
|
|
27
|
-
import process$1 from "node:process";
|
|
28
|
-
import "node-edge-tts";
|
|
29
|
-
import { ChannelType, PermissionFlagsBits, Routes } from "discord-api-types/v10";
|
|
30
|
-
import { Embed, RequestClient, serializePayload } from "@buape/carbon";
|
|
31
|
-
import "discord-api-types/payloads/v10";
|
|
32
|
-
import "@whiskeysockets/baileys";
|
|
33
|
-
import "qrcode-terminal";
|
|
34
|
-
|
|
35
|
-
//#region src/infra/device-identity.ts
|
|
36
|
-
const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/infra/tls/gateway.ts
|
|
40
|
-
const execFileAsync$1 = promisify(execFile);
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/infra/json-files.ts
|
|
44
|
-
function createAsyncLock() {
|
|
45
|
-
let lock = Promise.resolve();
|
|
46
|
-
return async function withLock(fn) {
|
|
47
|
-
const prev = lock;
|
|
48
|
-
let release;
|
|
49
|
-
lock = new Promise((resolve) => {
|
|
50
|
-
release = resolve;
|
|
51
|
-
});
|
|
52
|
-
await prev;
|
|
53
|
-
try {
|
|
54
|
-
return await fn();
|
|
55
|
-
} finally {
|
|
56
|
-
release?.();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/infra/device-pairing.ts
|
|
63
|
-
const PENDING_TTL_MS = 300 * 1e3;
|
|
64
|
-
const withLock = createAsyncLock();
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/sessions/session-label.ts
|
|
68
|
-
const SESSION_LABEL_MAX_LENGTH = 64;
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/gateway/protocol/schema/primitives.ts
|
|
72
|
-
const NonEmptyString = Type.String({ minLength: 1 });
|
|
73
|
-
const SessionLabelString = Type.String({
|
|
74
|
-
minLength: 1,
|
|
75
|
-
maxLength: SESSION_LABEL_MAX_LENGTH
|
|
76
|
-
});
|
|
77
|
-
const GatewayClientIdSchema = Type.Union(Object.values(GATEWAY_CLIENT_IDS).map((value) => Type.Literal(value)));
|
|
78
|
-
const GatewayClientModeSchema = Type.Union(Object.values(GATEWAY_CLIENT_MODES).map((value) => Type.Literal(value)));
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/gateway/protocol/schema/agent.ts
|
|
82
|
-
const AgentEventSchema = Type.Object({
|
|
83
|
-
runId: NonEmptyString,
|
|
84
|
-
seq: Type.Integer({ minimum: 0 }),
|
|
85
|
-
stream: NonEmptyString,
|
|
86
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
87
|
-
data: Type.Record(Type.String(), Type.Unknown())
|
|
88
|
-
}, { additionalProperties: false });
|
|
89
|
-
const SendParamsSchema = Type.Object({
|
|
90
|
-
to: NonEmptyString,
|
|
91
|
-
message: Type.Optional(Type.String()),
|
|
92
|
-
mediaUrl: Type.Optional(Type.String()),
|
|
93
|
-
mediaUrls: Type.Optional(Type.Array(Type.String())),
|
|
94
|
-
gifPlayback: Type.Optional(Type.Boolean()),
|
|
95
|
-
channel: Type.Optional(Type.String()),
|
|
96
|
-
accountId: Type.Optional(Type.String()),
|
|
97
|
-
threadId: Type.Optional(Type.String()),
|
|
98
|
-
sessionKey: Type.Optional(Type.String()),
|
|
99
|
-
idempotencyKey: NonEmptyString
|
|
100
|
-
}, { additionalProperties: false });
|
|
101
|
-
const PollParamsSchema = Type.Object({
|
|
102
|
-
to: NonEmptyString,
|
|
103
|
-
question: NonEmptyString,
|
|
104
|
-
options: Type.Array(NonEmptyString, {
|
|
105
|
-
minItems: 2,
|
|
106
|
-
maxItems: 12
|
|
107
|
-
}),
|
|
108
|
-
maxSelections: Type.Optional(Type.Integer({
|
|
109
|
-
minimum: 1,
|
|
110
|
-
maximum: 12
|
|
111
|
-
})),
|
|
112
|
-
durationSeconds: Type.Optional(Type.Integer({
|
|
113
|
-
minimum: 1,
|
|
114
|
-
maximum: 604800
|
|
115
|
-
})),
|
|
116
|
-
durationHours: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
117
|
-
silent: Type.Optional(Type.Boolean()),
|
|
118
|
-
isAnonymous: Type.Optional(Type.Boolean()),
|
|
119
|
-
threadId: Type.Optional(Type.String()),
|
|
120
|
-
channel: Type.Optional(Type.String()),
|
|
121
|
-
accountId: Type.Optional(Type.String()),
|
|
122
|
-
idempotencyKey: NonEmptyString
|
|
123
|
-
}, { additionalProperties: false });
|
|
124
|
-
const AgentParamsSchema = Type.Object({
|
|
125
|
-
message: NonEmptyString,
|
|
126
|
-
agentId: Type.Optional(NonEmptyString),
|
|
127
|
-
to: Type.Optional(Type.String()),
|
|
128
|
-
replyTo: Type.Optional(Type.String()),
|
|
129
|
-
sessionId: Type.Optional(Type.String()),
|
|
130
|
-
sessionKey: Type.Optional(Type.String()),
|
|
131
|
-
thinking: Type.Optional(Type.String()),
|
|
132
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
133
|
-
attachments: Type.Optional(Type.Array(Type.Unknown())),
|
|
134
|
-
channel: Type.Optional(Type.String()),
|
|
135
|
-
replyChannel: Type.Optional(Type.String()),
|
|
136
|
-
accountId: Type.Optional(Type.String()),
|
|
137
|
-
replyAccountId: Type.Optional(Type.String()),
|
|
138
|
-
threadId: Type.Optional(Type.String()),
|
|
139
|
-
groupId: Type.Optional(Type.String()),
|
|
140
|
-
groupChannel: Type.Optional(Type.String()),
|
|
141
|
-
groupSpace: Type.Optional(Type.String()),
|
|
142
|
-
timeout: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
143
|
-
bestEffortDeliver: Type.Optional(Type.Boolean()),
|
|
144
|
-
lane: Type.Optional(Type.String()),
|
|
145
|
-
extraSystemPrompt: Type.Optional(Type.String()),
|
|
146
|
-
inputProvenance: Type.Optional(Type.Object({
|
|
147
|
-
kind: Type.String({ enum: [...INPUT_PROVENANCE_KIND_VALUES] }),
|
|
148
|
-
sourceSessionKey: Type.Optional(Type.String()),
|
|
149
|
-
sourceChannel: Type.Optional(Type.String()),
|
|
150
|
-
sourceTool: Type.Optional(Type.String())
|
|
151
|
-
}, { additionalProperties: false })),
|
|
152
|
-
idempotencyKey: NonEmptyString,
|
|
153
|
-
label: Type.Optional(SessionLabelString),
|
|
154
|
-
spawnedBy: Type.Optional(Type.String())
|
|
155
|
-
}, { additionalProperties: false });
|
|
156
|
-
const AgentIdentityParamsSchema = Type.Object({
|
|
157
|
-
agentId: Type.Optional(NonEmptyString),
|
|
158
|
-
sessionKey: Type.Optional(Type.String())
|
|
159
|
-
}, { additionalProperties: false });
|
|
160
|
-
const AgentIdentityResultSchema = Type.Object({
|
|
161
|
-
agentId: NonEmptyString,
|
|
162
|
-
name: Type.Optional(NonEmptyString),
|
|
163
|
-
avatar: Type.Optional(NonEmptyString),
|
|
164
|
-
emoji: Type.Optional(NonEmptyString)
|
|
165
|
-
}, { additionalProperties: false });
|
|
166
|
-
const AgentWaitParamsSchema = Type.Object({
|
|
167
|
-
runId: NonEmptyString,
|
|
168
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
169
|
-
}, { additionalProperties: false });
|
|
170
|
-
const WakeParamsSchema = Type.Object({
|
|
171
|
-
mode: Type.Union([Type.Literal("now"), Type.Literal("next-heartbeat")]),
|
|
172
|
-
text: NonEmptyString
|
|
173
|
-
}, { additionalProperties: false });
|
|
174
|
-
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region src/gateway/protocol/schema/agents-models-skills.ts
|
|
177
|
-
const ModelChoiceSchema = Type.Object({
|
|
178
|
-
id: NonEmptyString,
|
|
179
|
-
name: NonEmptyString,
|
|
180
|
-
provider: NonEmptyString,
|
|
181
|
-
contextWindow: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
182
|
-
reasoning: Type.Optional(Type.Boolean())
|
|
183
|
-
}, { additionalProperties: false });
|
|
184
|
-
const AgentSummarySchema = Type.Object({
|
|
185
|
-
id: NonEmptyString,
|
|
186
|
-
name: Type.Optional(NonEmptyString),
|
|
187
|
-
identity: Type.Optional(Type.Object({
|
|
188
|
-
name: Type.Optional(NonEmptyString),
|
|
189
|
-
theme: Type.Optional(NonEmptyString),
|
|
190
|
-
emoji: Type.Optional(NonEmptyString),
|
|
191
|
-
avatar: Type.Optional(NonEmptyString),
|
|
192
|
-
avatarUrl: Type.Optional(NonEmptyString)
|
|
193
|
-
}, { additionalProperties: false }))
|
|
194
|
-
}, { additionalProperties: false });
|
|
195
|
-
const AgentsListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
196
|
-
const AgentsListResultSchema = Type.Object({
|
|
197
|
-
defaultId: NonEmptyString,
|
|
198
|
-
mainKey: NonEmptyString,
|
|
199
|
-
scope: Type.Union([Type.Literal("per-sender"), Type.Literal("global")]),
|
|
200
|
-
agents: Type.Array(AgentSummarySchema)
|
|
201
|
-
}, { additionalProperties: false });
|
|
202
|
-
const AgentsCreateParamsSchema = Type.Object({
|
|
203
|
-
name: NonEmptyString,
|
|
204
|
-
workspace: NonEmptyString,
|
|
205
|
-
emoji: Type.Optional(Type.String()),
|
|
206
|
-
avatar: Type.Optional(Type.String())
|
|
207
|
-
}, { additionalProperties: false });
|
|
208
|
-
const AgentsCreateResultSchema = Type.Object({
|
|
209
|
-
ok: Type.Literal(true),
|
|
210
|
-
agentId: NonEmptyString,
|
|
211
|
-
name: NonEmptyString,
|
|
212
|
-
workspace: NonEmptyString
|
|
213
|
-
}, { additionalProperties: false });
|
|
214
|
-
const AgentsUpdateParamsSchema = Type.Object({
|
|
215
|
-
agentId: NonEmptyString,
|
|
216
|
-
name: Type.Optional(NonEmptyString),
|
|
217
|
-
workspace: Type.Optional(NonEmptyString),
|
|
218
|
-
model: Type.Optional(NonEmptyString),
|
|
219
|
-
avatar: Type.Optional(Type.String())
|
|
220
|
-
}, { additionalProperties: false });
|
|
221
|
-
const AgentsUpdateResultSchema = Type.Object({
|
|
222
|
-
ok: Type.Literal(true),
|
|
223
|
-
agentId: NonEmptyString
|
|
224
|
-
}, { additionalProperties: false });
|
|
225
|
-
const AgentsDeleteParamsSchema = Type.Object({
|
|
226
|
-
agentId: NonEmptyString,
|
|
227
|
-
deleteFiles: Type.Optional(Type.Boolean())
|
|
228
|
-
}, { additionalProperties: false });
|
|
229
|
-
const AgentsDeleteResultSchema = Type.Object({
|
|
230
|
-
ok: Type.Literal(true),
|
|
231
|
-
agentId: NonEmptyString,
|
|
232
|
-
removedBindings: Type.Integer({ minimum: 0 })
|
|
233
|
-
}, { additionalProperties: false });
|
|
234
|
-
const AgentsFileEntrySchema = Type.Object({
|
|
235
|
-
name: NonEmptyString,
|
|
236
|
-
path: NonEmptyString,
|
|
237
|
-
missing: Type.Boolean(),
|
|
238
|
-
size: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
239
|
-
updatedAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
240
|
-
content: Type.Optional(Type.String())
|
|
241
|
-
}, { additionalProperties: false });
|
|
242
|
-
const AgentsFilesListParamsSchema = Type.Object({ agentId: NonEmptyString }, { additionalProperties: false });
|
|
243
|
-
const AgentsFilesListResultSchema = Type.Object({
|
|
244
|
-
agentId: NonEmptyString,
|
|
245
|
-
workspace: NonEmptyString,
|
|
246
|
-
files: Type.Array(AgentsFileEntrySchema)
|
|
247
|
-
}, { additionalProperties: false });
|
|
248
|
-
const AgentsFilesGetParamsSchema = Type.Object({
|
|
249
|
-
agentId: NonEmptyString,
|
|
250
|
-
name: NonEmptyString
|
|
251
|
-
}, { additionalProperties: false });
|
|
252
|
-
const AgentsFilesGetResultSchema = Type.Object({
|
|
253
|
-
agentId: NonEmptyString,
|
|
254
|
-
workspace: NonEmptyString,
|
|
255
|
-
file: AgentsFileEntrySchema
|
|
256
|
-
}, { additionalProperties: false });
|
|
257
|
-
const AgentsFilesSetParamsSchema = Type.Object({
|
|
258
|
-
agentId: NonEmptyString,
|
|
259
|
-
name: NonEmptyString,
|
|
260
|
-
content: Type.String()
|
|
261
|
-
}, { additionalProperties: false });
|
|
262
|
-
const AgentsFilesSetResultSchema = Type.Object({
|
|
263
|
-
ok: Type.Literal(true),
|
|
264
|
-
agentId: NonEmptyString,
|
|
265
|
-
workspace: NonEmptyString,
|
|
266
|
-
file: AgentsFileEntrySchema
|
|
267
|
-
}, { additionalProperties: false });
|
|
268
|
-
const ModelsListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
269
|
-
const ModelsListResultSchema = Type.Object({ models: Type.Array(ModelChoiceSchema) }, { additionalProperties: false });
|
|
270
|
-
const ToolsCatalogParamsSchema = Type.Object({
|
|
271
|
-
agentId: Type.Optional(NonEmptyString),
|
|
272
|
-
includePlugins: Type.Optional(Type.Boolean())
|
|
273
|
-
}, { additionalProperties: false });
|
|
274
|
-
const ToolCatalogProfileSchema = Type.Object({
|
|
275
|
-
id: Type.Union([
|
|
276
|
-
Type.Literal("minimal"),
|
|
277
|
-
Type.Literal("coding"),
|
|
278
|
-
Type.Literal("messaging"),
|
|
279
|
-
Type.Literal("full")
|
|
280
|
-
]),
|
|
281
|
-
label: NonEmptyString
|
|
282
|
-
}, { additionalProperties: false });
|
|
283
|
-
const ToolCatalogEntrySchema = Type.Object({
|
|
284
|
-
id: NonEmptyString,
|
|
285
|
-
label: NonEmptyString,
|
|
286
|
-
description: Type.String(),
|
|
287
|
-
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
|
288
|
-
pluginId: Type.Optional(NonEmptyString),
|
|
289
|
-
optional: Type.Optional(Type.Boolean()),
|
|
290
|
-
defaultProfiles: Type.Array(Type.Union([
|
|
291
|
-
Type.Literal("minimal"),
|
|
292
|
-
Type.Literal("coding"),
|
|
293
|
-
Type.Literal("messaging"),
|
|
294
|
-
Type.Literal("full")
|
|
295
|
-
]))
|
|
296
|
-
}, { additionalProperties: false });
|
|
297
|
-
const ToolCatalogGroupSchema = Type.Object({
|
|
298
|
-
id: NonEmptyString,
|
|
299
|
-
label: NonEmptyString,
|
|
300
|
-
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
|
301
|
-
pluginId: Type.Optional(NonEmptyString),
|
|
302
|
-
tools: Type.Array(ToolCatalogEntrySchema)
|
|
303
|
-
}, { additionalProperties: false });
|
|
304
|
-
const ToolsCatalogResultSchema = Type.Object({
|
|
305
|
-
agentId: NonEmptyString,
|
|
306
|
-
profiles: Type.Array(ToolCatalogProfileSchema),
|
|
307
|
-
groups: Type.Array(ToolCatalogGroupSchema)
|
|
308
|
-
}, { additionalProperties: false });
|
|
309
|
-
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/gateway/protocol/schema/channels.ts
|
|
312
|
-
const TalkModeParamsSchema = Type.Object({
|
|
313
|
-
enabled: Type.Boolean(),
|
|
314
|
-
phase: Type.Optional(Type.String())
|
|
315
|
-
}, { additionalProperties: false });
|
|
316
|
-
const TalkConfigParamsSchema = Type.Object({ includeSecrets: Type.Optional(Type.Boolean()) }, { additionalProperties: false });
|
|
317
|
-
const TalkProviderConfigSchema = Type.Object({
|
|
318
|
-
voiceId: Type.Optional(Type.String()),
|
|
319
|
-
voiceAliases: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
320
|
-
modelId: Type.Optional(Type.String()),
|
|
321
|
-
outputFormat: Type.Optional(Type.String()),
|
|
322
|
-
apiKey: Type.Optional(Type.String())
|
|
323
|
-
}, { additionalProperties: true });
|
|
324
|
-
const TalkConfigResultSchema = Type.Object({ config: Type.Object({
|
|
325
|
-
talk: Type.Optional(Type.Object({
|
|
326
|
-
provider: Type.Optional(Type.String()),
|
|
327
|
-
providers: Type.Optional(Type.Record(Type.String(), TalkProviderConfigSchema)),
|
|
328
|
-
voiceId: Type.Optional(Type.String()),
|
|
329
|
-
voiceAliases: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
330
|
-
modelId: Type.Optional(Type.String()),
|
|
331
|
-
outputFormat: Type.Optional(Type.String()),
|
|
332
|
-
apiKey: Type.Optional(Type.String()),
|
|
333
|
-
interruptOnSpeech: Type.Optional(Type.Boolean())
|
|
334
|
-
}, { additionalProperties: false })),
|
|
335
|
-
session: Type.Optional(Type.Object({ mainKey: Type.Optional(Type.String()) }, { additionalProperties: false })),
|
|
336
|
-
ui: Type.Optional(Type.Object({ seamColor: Type.Optional(Type.String()) }, { additionalProperties: false }))
|
|
337
|
-
}, { additionalProperties: false }) }, { additionalProperties: false });
|
|
338
|
-
const ChannelsStatusParamsSchema = Type.Object({
|
|
339
|
-
probe: Type.Optional(Type.Boolean()),
|
|
340
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
341
|
-
}, { additionalProperties: false });
|
|
342
|
-
const ChannelAccountSnapshotSchema = Type.Object({
|
|
343
|
-
accountId: NonEmptyString,
|
|
344
|
-
name: Type.Optional(Type.String()),
|
|
345
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
346
|
-
configured: Type.Optional(Type.Boolean()),
|
|
347
|
-
linked: Type.Optional(Type.Boolean()),
|
|
348
|
-
running: Type.Optional(Type.Boolean()),
|
|
349
|
-
connected: Type.Optional(Type.Boolean()),
|
|
350
|
-
reconnectAttempts: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
351
|
-
lastConnectedAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
352
|
-
lastError: Type.Optional(Type.String()),
|
|
353
|
-
lastStartAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
354
|
-
lastStopAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
355
|
-
lastInboundAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
356
|
-
lastOutboundAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
357
|
-
lastProbeAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
358
|
-
mode: Type.Optional(Type.String()),
|
|
359
|
-
dmPolicy: Type.Optional(Type.String()),
|
|
360
|
-
allowFrom: Type.Optional(Type.Array(Type.String())),
|
|
361
|
-
tokenSource: Type.Optional(Type.String()),
|
|
362
|
-
botTokenSource: Type.Optional(Type.String()),
|
|
363
|
-
appTokenSource: Type.Optional(Type.String()),
|
|
364
|
-
baseUrl: Type.Optional(Type.String()),
|
|
365
|
-
allowUnmentionedGroups: Type.Optional(Type.Boolean()),
|
|
366
|
-
cliPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
367
|
-
dbPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
368
|
-
port: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
369
|
-
probe: Type.Optional(Type.Unknown()),
|
|
370
|
-
audit: Type.Optional(Type.Unknown()),
|
|
371
|
-
application: Type.Optional(Type.Unknown())
|
|
372
|
-
}, { additionalProperties: true });
|
|
373
|
-
const ChannelUiMetaSchema = Type.Object({
|
|
374
|
-
id: NonEmptyString,
|
|
375
|
-
label: NonEmptyString,
|
|
376
|
-
detailLabel: NonEmptyString,
|
|
377
|
-
systemImage: Type.Optional(Type.String())
|
|
378
|
-
}, { additionalProperties: false });
|
|
379
|
-
const ChannelsStatusResultSchema = Type.Object({
|
|
380
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
381
|
-
channelOrder: Type.Array(NonEmptyString),
|
|
382
|
-
channelLabels: Type.Record(NonEmptyString, NonEmptyString),
|
|
383
|
-
channelDetailLabels: Type.Optional(Type.Record(NonEmptyString, NonEmptyString)),
|
|
384
|
-
channelSystemImages: Type.Optional(Type.Record(NonEmptyString, NonEmptyString)),
|
|
385
|
-
channelMeta: Type.Optional(Type.Array(ChannelUiMetaSchema)),
|
|
386
|
-
channels: Type.Record(NonEmptyString, Type.Unknown()),
|
|
387
|
-
channelAccounts: Type.Record(NonEmptyString, Type.Array(ChannelAccountSnapshotSchema)),
|
|
388
|
-
channelDefaultAccountId: Type.Record(NonEmptyString, NonEmptyString)
|
|
389
|
-
}, { additionalProperties: false });
|
|
390
|
-
const ChannelsLogoutParamsSchema = Type.Object({
|
|
391
|
-
channel: NonEmptyString,
|
|
392
|
-
accountId: Type.Optional(Type.String())
|
|
393
|
-
}, { additionalProperties: false });
|
|
394
|
-
const WebLoginStartParamsSchema = Type.Object({
|
|
395
|
-
force: Type.Optional(Type.Boolean()),
|
|
396
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
397
|
-
verbose: Type.Optional(Type.Boolean()),
|
|
398
|
-
accountId: Type.Optional(Type.String())
|
|
399
|
-
}, { additionalProperties: false });
|
|
400
|
-
const WebLoginWaitParamsSchema = Type.Object({
|
|
401
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
402
|
-
accountId: Type.Optional(Type.String())
|
|
403
|
-
}, { additionalProperties: false });
|
|
404
|
-
|
|
405
|
-
//#endregion
|
|
406
|
-
//#region src/gateway/protocol/schema/config.ts
|
|
407
|
-
const ConfigGetParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
408
|
-
const ConfigSetParamsSchema = Type.Object({
|
|
409
|
-
raw: NonEmptyString,
|
|
410
|
-
baseHash: Type.Optional(NonEmptyString)
|
|
411
|
-
}, { additionalProperties: false });
|
|
412
|
-
const ConfigApplyLikeParamsSchema = Type.Object({
|
|
413
|
-
raw: NonEmptyString,
|
|
414
|
-
baseHash: Type.Optional(NonEmptyString),
|
|
415
|
-
sessionKey: Type.Optional(Type.String()),
|
|
416
|
-
note: Type.Optional(Type.String()),
|
|
417
|
-
restartDelayMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
418
|
-
}, { additionalProperties: false });
|
|
419
|
-
const ConfigApplyParamsSchema = ConfigApplyLikeParamsSchema;
|
|
420
|
-
const ConfigPatchParamsSchema = ConfigApplyLikeParamsSchema;
|
|
421
|
-
const ConfigSchemaParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
422
|
-
const UpdateRunParamsSchema = Type.Object({
|
|
423
|
-
sessionKey: Type.Optional(Type.String()),
|
|
424
|
-
note: Type.Optional(Type.String()),
|
|
425
|
-
restartDelayMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
426
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
427
|
-
}, { additionalProperties: false });
|
|
428
|
-
const ConfigUiHintSchema = Type.Object({
|
|
429
|
-
label: Type.Optional(Type.String()),
|
|
430
|
-
help: Type.Optional(Type.String()),
|
|
431
|
-
tags: Type.Optional(Type.Array(Type.String())),
|
|
432
|
-
group: Type.Optional(Type.String()),
|
|
433
|
-
order: Type.Optional(Type.Integer()),
|
|
434
|
-
advanced: Type.Optional(Type.Boolean()),
|
|
435
|
-
sensitive: Type.Optional(Type.Boolean()),
|
|
436
|
-
placeholder: Type.Optional(Type.String()),
|
|
437
|
-
itemTemplate: Type.Optional(Type.Unknown())
|
|
438
|
-
}, { additionalProperties: false });
|
|
439
|
-
const ConfigSchemaResponseSchema = Type.Object({
|
|
440
|
-
schema: Type.Unknown(),
|
|
441
|
-
uiHints: Type.Record(Type.String(), ConfigUiHintSchema),
|
|
442
|
-
version: NonEmptyString,
|
|
443
|
-
generatedAt: NonEmptyString
|
|
444
|
-
}, { additionalProperties: false });
|
|
445
|
-
|
|
446
|
-
//#endregion
|
|
447
|
-
//#region src/gateway/protocol/schema/cron.ts
|
|
448
|
-
function cronAgentTurnPayloadSchema(params) {
|
|
449
|
-
return Type.Object({
|
|
450
|
-
kind: Type.Literal("agentTurn"),
|
|
451
|
-
message: params.message,
|
|
452
|
-
model: Type.Optional(Type.String()),
|
|
453
|
-
thinking: Type.Optional(Type.String()),
|
|
454
|
-
timeoutSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
455
|
-
allowUnsafeExternalContent: Type.Optional(Type.Boolean()),
|
|
456
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
457
|
-
channel: Type.Optional(Type.String()),
|
|
458
|
-
to: Type.Optional(Type.String()),
|
|
459
|
-
bestEffortDeliver: Type.Optional(Type.Boolean())
|
|
460
|
-
}, { additionalProperties: false });
|
|
461
|
-
}
|
|
462
|
-
const CronSessionTargetSchema = Type.Union([Type.Literal("main"), Type.Literal("isolated")]);
|
|
463
|
-
const CronWakeModeSchema = Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]);
|
|
464
|
-
const CronRunStatusSchema = Type.Union([
|
|
465
|
-
Type.Literal("ok"),
|
|
466
|
-
Type.Literal("error"),
|
|
467
|
-
Type.Literal("skipped")
|
|
468
|
-
]);
|
|
469
|
-
const CronSortDirSchema = Type.Union([Type.Literal("asc"), Type.Literal("desc")]);
|
|
470
|
-
const CronJobsEnabledFilterSchema = Type.Union([
|
|
471
|
-
Type.Literal("all"),
|
|
472
|
-
Type.Literal("enabled"),
|
|
473
|
-
Type.Literal("disabled")
|
|
474
|
-
]);
|
|
475
|
-
const CronJobsSortBySchema = Type.Union([
|
|
476
|
-
Type.Literal("nextRunAtMs"),
|
|
477
|
-
Type.Literal("updatedAtMs"),
|
|
478
|
-
Type.Literal("name")
|
|
479
|
-
]);
|
|
480
|
-
const CronRunsStatusFilterSchema = Type.Union([
|
|
481
|
-
Type.Literal("all"),
|
|
482
|
-
Type.Literal("ok"),
|
|
483
|
-
Type.Literal("error"),
|
|
484
|
-
Type.Literal("skipped")
|
|
485
|
-
]);
|
|
486
|
-
const CronRunsStatusValueSchema = Type.Union([
|
|
487
|
-
Type.Literal("ok"),
|
|
488
|
-
Type.Literal("error"),
|
|
489
|
-
Type.Literal("skipped")
|
|
490
|
-
]);
|
|
491
|
-
const CronDeliveryStatusSchema = Type.Union([
|
|
492
|
-
Type.Literal("delivered"),
|
|
493
|
-
Type.Literal("not-delivered"),
|
|
494
|
-
Type.Literal("unknown"),
|
|
495
|
-
Type.Literal("not-requested")
|
|
496
|
-
]);
|
|
497
|
-
const CronCommonOptionalFields = {
|
|
498
|
-
agentId: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
499
|
-
sessionKey: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
500
|
-
description: Type.Optional(Type.String()),
|
|
501
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
502
|
-
deleteAfterRun: Type.Optional(Type.Boolean())
|
|
503
|
-
};
|
|
504
|
-
function cronIdOrJobIdParams(extraFields) {
|
|
505
|
-
return Type.Union([Type.Object({
|
|
506
|
-
id: NonEmptyString,
|
|
507
|
-
...extraFields
|
|
508
|
-
}, { additionalProperties: false }), Type.Object({
|
|
509
|
-
jobId: NonEmptyString,
|
|
510
|
-
...extraFields
|
|
511
|
-
}, { additionalProperties: false })]);
|
|
512
|
-
}
|
|
513
|
-
const CronRunLogJobIdSchema = Type.String({
|
|
514
|
-
minLength: 1,
|
|
515
|
-
pattern: "^[^/\\\\]+$"
|
|
516
|
-
});
|
|
517
|
-
const CronScheduleSchema = Type.Union([
|
|
518
|
-
Type.Object({
|
|
519
|
-
kind: Type.Literal("at"),
|
|
520
|
-
at: NonEmptyString
|
|
521
|
-
}, { additionalProperties: false }),
|
|
522
|
-
Type.Object({
|
|
523
|
-
kind: Type.Literal("every"),
|
|
524
|
-
everyMs: Type.Integer({ minimum: 1 }),
|
|
525
|
-
anchorMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
526
|
-
}, { additionalProperties: false }),
|
|
527
|
-
Type.Object({
|
|
528
|
-
kind: Type.Literal("cron"),
|
|
529
|
-
expr: NonEmptyString,
|
|
530
|
-
tz: Type.Optional(Type.String()),
|
|
531
|
-
staggerMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
532
|
-
}, { additionalProperties: false })
|
|
533
|
-
]);
|
|
534
|
-
const CronPayloadSchema = Type.Union([Type.Object({
|
|
535
|
-
kind: Type.Literal("systemEvent"),
|
|
536
|
-
text: NonEmptyString
|
|
537
|
-
}, { additionalProperties: false }), cronAgentTurnPayloadSchema({ message: NonEmptyString })]);
|
|
538
|
-
const CronPayloadPatchSchema = Type.Union([Type.Object({
|
|
539
|
-
kind: Type.Literal("systemEvent"),
|
|
540
|
-
text: Type.Optional(NonEmptyString)
|
|
541
|
-
}, { additionalProperties: false }), cronAgentTurnPayloadSchema({ message: Type.Optional(NonEmptyString) })]);
|
|
542
|
-
const CronDeliverySharedProperties = {
|
|
543
|
-
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
|
544
|
-
bestEffort: Type.Optional(Type.Boolean())
|
|
545
|
-
};
|
|
546
|
-
const CronDeliveryNoopSchema = Type.Object({
|
|
547
|
-
mode: Type.Literal("none"),
|
|
548
|
-
...CronDeliverySharedProperties,
|
|
549
|
-
to: Type.Optional(Type.String())
|
|
550
|
-
}, { additionalProperties: false });
|
|
551
|
-
const CronDeliveryAnnounceSchema = Type.Object({
|
|
552
|
-
mode: Type.Literal("announce"),
|
|
553
|
-
...CronDeliverySharedProperties,
|
|
554
|
-
to: Type.Optional(Type.String())
|
|
555
|
-
}, { additionalProperties: false });
|
|
556
|
-
const CronDeliveryWebhookSchema = Type.Object({
|
|
557
|
-
mode: Type.Literal("webhook"),
|
|
558
|
-
...CronDeliverySharedProperties,
|
|
559
|
-
to: NonEmptyString
|
|
560
|
-
}, { additionalProperties: false });
|
|
561
|
-
const CronDeliverySchema = Type.Union([
|
|
562
|
-
CronDeliveryNoopSchema,
|
|
563
|
-
CronDeliveryAnnounceSchema,
|
|
564
|
-
CronDeliveryWebhookSchema
|
|
565
|
-
]);
|
|
566
|
-
const CronDeliveryPatchSchema = Type.Object({
|
|
567
|
-
mode: Type.Optional(Type.Union([
|
|
568
|
-
Type.Literal("none"),
|
|
569
|
-
Type.Literal("announce"),
|
|
570
|
-
Type.Literal("webhook")
|
|
571
|
-
])),
|
|
572
|
-
...CronDeliverySharedProperties,
|
|
573
|
-
to: Type.Optional(Type.String())
|
|
574
|
-
}, { additionalProperties: false });
|
|
575
|
-
const CronJobStateSchema = Type.Object({
|
|
576
|
-
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
577
|
-
runningAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
578
|
-
lastRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
579
|
-
lastRunStatus: Type.Optional(CronRunStatusSchema),
|
|
580
|
-
lastStatus: Type.Optional(CronRunStatusSchema),
|
|
581
|
-
lastError: Type.Optional(Type.String()),
|
|
582
|
-
lastDurationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
583
|
-
consecutiveErrors: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
584
|
-
lastDelivered: Type.Optional(Type.Boolean()),
|
|
585
|
-
lastDeliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
586
|
-
lastDeliveryError: Type.Optional(Type.String())
|
|
587
|
-
}, { additionalProperties: false });
|
|
588
|
-
const CronJobSchema = Type.Object({
|
|
589
|
-
id: NonEmptyString,
|
|
590
|
-
agentId: Type.Optional(NonEmptyString),
|
|
591
|
-
sessionKey: Type.Optional(NonEmptyString),
|
|
592
|
-
name: NonEmptyString,
|
|
593
|
-
description: Type.Optional(Type.String()),
|
|
594
|
-
enabled: Type.Boolean(),
|
|
595
|
-
deleteAfterRun: Type.Optional(Type.Boolean()),
|
|
596
|
-
createdAtMs: Type.Integer({ minimum: 0 }),
|
|
597
|
-
updatedAtMs: Type.Integer({ minimum: 0 }),
|
|
598
|
-
schedule: CronScheduleSchema,
|
|
599
|
-
sessionTarget: CronSessionTargetSchema,
|
|
600
|
-
wakeMode: CronWakeModeSchema,
|
|
601
|
-
payload: CronPayloadSchema,
|
|
602
|
-
delivery: Type.Optional(CronDeliverySchema),
|
|
603
|
-
state: CronJobStateSchema
|
|
604
|
-
}, { additionalProperties: false });
|
|
605
|
-
const CronListParamsSchema = Type.Object({
|
|
606
|
-
includeDisabled: Type.Optional(Type.Boolean()),
|
|
607
|
-
limit: Type.Optional(Type.Integer({
|
|
608
|
-
minimum: 1,
|
|
609
|
-
maximum: 200
|
|
610
|
-
})),
|
|
611
|
-
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
612
|
-
query: Type.Optional(Type.String()),
|
|
613
|
-
enabled: Type.Optional(CronJobsEnabledFilterSchema),
|
|
614
|
-
sortBy: Type.Optional(CronJobsSortBySchema),
|
|
615
|
-
sortDir: Type.Optional(CronSortDirSchema)
|
|
616
|
-
}, { additionalProperties: false });
|
|
617
|
-
const CronStatusParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
618
|
-
const CronAddParamsSchema = Type.Object({
|
|
619
|
-
name: NonEmptyString,
|
|
620
|
-
...CronCommonOptionalFields,
|
|
621
|
-
schedule: CronScheduleSchema,
|
|
622
|
-
sessionTarget: CronSessionTargetSchema,
|
|
623
|
-
wakeMode: CronWakeModeSchema,
|
|
624
|
-
payload: CronPayloadSchema,
|
|
625
|
-
delivery: Type.Optional(CronDeliverySchema)
|
|
626
|
-
}, { additionalProperties: false });
|
|
627
|
-
const CronJobPatchSchema = Type.Object({
|
|
628
|
-
name: Type.Optional(NonEmptyString),
|
|
629
|
-
...CronCommonOptionalFields,
|
|
630
|
-
schedule: Type.Optional(CronScheduleSchema),
|
|
631
|
-
sessionTarget: Type.Optional(CronSessionTargetSchema),
|
|
632
|
-
wakeMode: Type.Optional(CronWakeModeSchema),
|
|
633
|
-
payload: Type.Optional(CronPayloadPatchSchema),
|
|
634
|
-
delivery: Type.Optional(CronDeliveryPatchSchema),
|
|
635
|
-
state: Type.Optional(Type.Partial(CronJobStateSchema))
|
|
636
|
-
}, { additionalProperties: false });
|
|
637
|
-
const CronUpdateParamsSchema = cronIdOrJobIdParams({ patch: CronJobPatchSchema });
|
|
638
|
-
const CronRemoveParamsSchema = cronIdOrJobIdParams({});
|
|
639
|
-
const CronRunParamsSchema = cronIdOrJobIdParams({ mode: Type.Optional(Type.Union([Type.Literal("due"), Type.Literal("force")])) });
|
|
640
|
-
const CronRunsParamsSchema = Type.Object({
|
|
641
|
-
scope: Type.Optional(Type.Union([Type.Literal("job"), Type.Literal("all")])),
|
|
642
|
-
id: Type.Optional(CronRunLogJobIdSchema),
|
|
643
|
-
jobId: Type.Optional(CronRunLogJobIdSchema),
|
|
644
|
-
limit: Type.Optional(Type.Integer({
|
|
645
|
-
minimum: 1,
|
|
646
|
-
maximum: 200
|
|
647
|
-
})),
|
|
648
|
-
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
649
|
-
statuses: Type.Optional(Type.Array(CronRunsStatusValueSchema, {
|
|
650
|
-
minItems: 1,
|
|
651
|
-
maxItems: 3
|
|
652
|
-
})),
|
|
653
|
-
status: Type.Optional(CronRunsStatusFilterSchema),
|
|
654
|
-
deliveryStatuses: Type.Optional(Type.Array(CronDeliveryStatusSchema, {
|
|
655
|
-
minItems: 1,
|
|
656
|
-
maxItems: 4
|
|
657
|
-
})),
|
|
658
|
-
deliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
659
|
-
query: Type.Optional(Type.String()),
|
|
660
|
-
sortDir: Type.Optional(CronSortDirSchema)
|
|
661
|
-
}, { additionalProperties: false });
|
|
662
|
-
const CronRunLogEntrySchema = Type.Object({
|
|
663
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
664
|
-
jobId: NonEmptyString,
|
|
665
|
-
action: Type.Literal("finished"),
|
|
666
|
-
status: Type.Optional(CronRunStatusSchema),
|
|
667
|
-
error: Type.Optional(Type.String()),
|
|
668
|
-
summary: Type.Optional(Type.String()),
|
|
669
|
-
delivered: Type.Optional(Type.Boolean()),
|
|
670
|
-
deliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
671
|
-
deliveryError: Type.Optional(Type.String()),
|
|
672
|
-
sessionId: Type.Optional(NonEmptyString),
|
|
673
|
-
sessionKey: Type.Optional(NonEmptyString),
|
|
674
|
-
runAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
675
|
-
durationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
676
|
-
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
677
|
-
model: Type.Optional(Type.String()),
|
|
678
|
-
provider: Type.Optional(Type.String()),
|
|
679
|
-
usage: Type.Optional(Type.Object({
|
|
680
|
-
input_tokens: Type.Optional(Type.Number()),
|
|
681
|
-
output_tokens: Type.Optional(Type.Number()),
|
|
682
|
-
total_tokens: Type.Optional(Type.Number()),
|
|
683
|
-
cache_read_tokens: Type.Optional(Type.Number()),
|
|
684
|
-
cache_write_tokens: Type.Optional(Type.Number())
|
|
685
|
-
}, { additionalProperties: false })),
|
|
686
|
-
jobName: Type.Optional(Type.String())
|
|
687
|
-
}, { additionalProperties: false });
|
|
688
|
-
|
|
689
|
-
//#endregion
|
|
690
|
-
//#region src/gateway/protocol/schema/devices.ts
|
|
691
|
-
const DevicePairListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
692
|
-
const DevicePairApproveParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
693
|
-
const DevicePairRejectParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
694
|
-
const DevicePairRemoveParamsSchema = Type.Object({ deviceId: NonEmptyString }, { additionalProperties: false });
|
|
695
|
-
const DeviceTokenRotateParamsSchema = Type.Object({
|
|
696
|
-
deviceId: NonEmptyString,
|
|
697
|
-
role: NonEmptyString,
|
|
698
|
-
scopes: Type.Optional(Type.Array(NonEmptyString))
|
|
699
|
-
}, { additionalProperties: false });
|
|
700
|
-
const DeviceTokenRevokeParamsSchema = Type.Object({
|
|
701
|
-
deviceId: NonEmptyString,
|
|
702
|
-
role: NonEmptyString
|
|
703
|
-
}, { additionalProperties: false });
|
|
704
|
-
const DevicePairRequestedEventSchema = Type.Object({
|
|
705
|
-
requestId: NonEmptyString,
|
|
706
|
-
deviceId: NonEmptyString,
|
|
707
|
-
publicKey: NonEmptyString,
|
|
708
|
-
displayName: Type.Optional(NonEmptyString),
|
|
709
|
-
platform: Type.Optional(NonEmptyString),
|
|
710
|
-
clientId: Type.Optional(NonEmptyString),
|
|
711
|
-
clientMode: Type.Optional(NonEmptyString),
|
|
712
|
-
role: Type.Optional(NonEmptyString),
|
|
713
|
-
roles: Type.Optional(Type.Array(NonEmptyString)),
|
|
714
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
715
|
-
remoteIp: Type.Optional(NonEmptyString),
|
|
716
|
-
silent: Type.Optional(Type.Boolean()),
|
|
717
|
-
isRepair: Type.Optional(Type.Boolean()),
|
|
718
|
-
ts: Type.Integer({ minimum: 0 })
|
|
719
|
-
}, { additionalProperties: false });
|
|
720
|
-
const DevicePairResolvedEventSchema = Type.Object({
|
|
721
|
-
requestId: NonEmptyString,
|
|
722
|
-
deviceId: NonEmptyString,
|
|
723
|
-
decision: NonEmptyString,
|
|
724
|
-
ts: Type.Integer({ minimum: 0 })
|
|
725
|
-
}, { additionalProperties: false });
|
|
726
|
-
|
|
727
|
-
//#endregion
|
|
728
|
-
//#region src/gateway/protocol/schema/snapshot.ts
|
|
729
|
-
const PresenceEntrySchema = Type.Object({
|
|
730
|
-
host: Type.Optional(NonEmptyString),
|
|
731
|
-
ip: Type.Optional(NonEmptyString),
|
|
732
|
-
version: Type.Optional(NonEmptyString),
|
|
733
|
-
platform: Type.Optional(NonEmptyString),
|
|
734
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
735
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
736
|
-
mode: Type.Optional(NonEmptyString),
|
|
737
|
-
lastInputSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
738
|
-
reason: Type.Optional(NonEmptyString),
|
|
739
|
-
tags: Type.Optional(Type.Array(NonEmptyString)),
|
|
740
|
-
text: Type.Optional(Type.String()),
|
|
741
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
742
|
-
deviceId: Type.Optional(NonEmptyString),
|
|
743
|
-
roles: Type.Optional(Type.Array(NonEmptyString)),
|
|
744
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
745
|
-
instanceId: Type.Optional(NonEmptyString)
|
|
746
|
-
}, { additionalProperties: false });
|
|
747
|
-
const HealthSnapshotSchema = Type.Any();
|
|
748
|
-
const SessionDefaultsSchema = Type.Object({
|
|
749
|
-
defaultAgentId: NonEmptyString,
|
|
750
|
-
mainKey: NonEmptyString,
|
|
751
|
-
mainSessionKey: NonEmptyString,
|
|
752
|
-
scope: Type.Optional(NonEmptyString)
|
|
753
|
-
}, { additionalProperties: false });
|
|
754
|
-
const StateVersionSchema = Type.Object({
|
|
755
|
-
presence: Type.Integer({ minimum: 0 }),
|
|
756
|
-
health: Type.Integer({ minimum: 0 })
|
|
757
|
-
}, { additionalProperties: false });
|
|
758
|
-
const SnapshotSchema = Type.Object({
|
|
759
|
-
presence: Type.Array(PresenceEntrySchema),
|
|
760
|
-
health: HealthSnapshotSchema,
|
|
761
|
-
stateVersion: StateVersionSchema,
|
|
762
|
-
uptimeMs: Type.Integer({ minimum: 0 }),
|
|
763
|
-
configPath: Type.Optional(NonEmptyString),
|
|
764
|
-
stateDir: Type.Optional(NonEmptyString),
|
|
765
|
-
sessionDefaults: Type.Optional(SessionDefaultsSchema),
|
|
766
|
-
authMode: Type.Optional(Type.Union([
|
|
767
|
-
Type.Literal("none"),
|
|
768
|
-
Type.Literal("token"),
|
|
769
|
-
Type.Literal("password"),
|
|
770
|
-
Type.Literal("trusted-proxy")
|
|
771
|
-
])),
|
|
772
|
-
updateAvailable: Type.Optional(Type.Object({
|
|
773
|
-
currentVersion: NonEmptyString,
|
|
774
|
-
latestVersion: NonEmptyString,
|
|
775
|
-
channel: NonEmptyString
|
|
776
|
-
}))
|
|
777
|
-
}, { additionalProperties: false });
|
|
778
|
-
|
|
779
|
-
//#endregion
|
|
780
|
-
//#region src/gateway/protocol/schema/frames.ts
|
|
781
|
-
const TickEventSchema = Type.Object({ ts: Type.Integer({ minimum: 0 }) }, { additionalProperties: false });
|
|
782
|
-
const ShutdownEventSchema = Type.Object({
|
|
783
|
-
reason: NonEmptyString,
|
|
784
|
-
restartExpectedMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
785
|
-
}, { additionalProperties: false });
|
|
786
|
-
const ConnectParamsSchema = Type.Object({
|
|
787
|
-
minProtocol: Type.Integer({ minimum: 1 }),
|
|
788
|
-
maxProtocol: Type.Integer({ minimum: 1 }),
|
|
789
|
-
client: Type.Object({
|
|
790
|
-
id: GatewayClientIdSchema,
|
|
791
|
-
displayName: Type.Optional(NonEmptyString),
|
|
792
|
-
version: NonEmptyString,
|
|
793
|
-
platform: NonEmptyString,
|
|
794
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
795
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
796
|
-
mode: GatewayClientModeSchema,
|
|
797
|
-
instanceId: Type.Optional(NonEmptyString)
|
|
798
|
-
}, { additionalProperties: false }),
|
|
799
|
-
caps: Type.Optional(Type.Array(NonEmptyString, { default: [] })),
|
|
800
|
-
commands: Type.Optional(Type.Array(NonEmptyString)),
|
|
801
|
-
permissions: Type.Optional(Type.Record(NonEmptyString, Type.Boolean())),
|
|
802
|
-
pathEnv: Type.Optional(Type.String()),
|
|
803
|
-
role: Type.Optional(NonEmptyString),
|
|
804
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
805
|
-
device: Type.Optional(Type.Object({
|
|
806
|
-
id: NonEmptyString,
|
|
807
|
-
publicKey: NonEmptyString,
|
|
808
|
-
signature: NonEmptyString,
|
|
809
|
-
signedAt: Type.Integer({ minimum: 0 }),
|
|
810
|
-
nonce: NonEmptyString
|
|
811
|
-
}, { additionalProperties: false })),
|
|
812
|
-
auth: Type.Optional(Type.Object({
|
|
813
|
-
token: Type.Optional(Type.String()),
|
|
814
|
-
deviceToken: Type.Optional(Type.String()),
|
|
815
|
-
password: Type.Optional(Type.String())
|
|
816
|
-
}, { additionalProperties: false })),
|
|
817
|
-
locale: Type.Optional(Type.String()),
|
|
818
|
-
userAgent: Type.Optional(Type.String())
|
|
819
|
-
}, { additionalProperties: false });
|
|
820
|
-
const HelloOkSchema = Type.Object({
|
|
821
|
-
type: Type.Literal("hello-ok"),
|
|
822
|
-
protocol: Type.Integer({ minimum: 1 }),
|
|
823
|
-
server: Type.Object({
|
|
824
|
-
version: NonEmptyString,
|
|
825
|
-
connId: NonEmptyString
|
|
826
|
-
}, { additionalProperties: false }),
|
|
827
|
-
features: Type.Object({
|
|
828
|
-
methods: Type.Array(NonEmptyString),
|
|
829
|
-
events: Type.Array(NonEmptyString)
|
|
830
|
-
}, { additionalProperties: false }),
|
|
831
|
-
snapshot: SnapshotSchema,
|
|
832
|
-
canvasHostUrl: Type.Optional(NonEmptyString),
|
|
833
|
-
auth: Type.Optional(Type.Object({
|
|
834
|
-
deviceToken: NonEmptyString,
|
|
835
|
-
role: NonEmptyString,
|
|
836
|
-
scopes: Type.Array(NonEmptyString),
|
|
837
|
-
issuedAtMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
838
|
-
}, { additionalProperties: false })),
|
|
839
|
-
policy: Type.Object({
|
|
840
|
-
maxPayload: Type.Integer({ minimum: 1 }),
|
|
841
|
-
maxBufferedBytes: Type.Integer({ minimum: 1 }),
|
|
842
|
-
tickIntervalMs: Type.Integer({ minimum: 1 })
|
|
843
|
-
}, { additionalProperties: false })
|
|
844
|
-
}, { additionalProperties: false });
|
|
845
|
-
const ErrorShapeSchema = Type.Object({
|
|
846
|
-
code: NonEmptyString,
|
|
847
|
-
message: NonEmptyString,
|
|
848
|
-
details: Type.Optional(Type.Unknown()),
|
|
849
|
-
retryable: Type.Optional(Type.Boolean()),
|
|
850
|
-
retryAfterMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
851
|
-
}, { additionalProperties: false });
|
|
852
|
-
const RequestFrameSchema = Type.Object({
|
|
853
|
-
type: Type.Literal("req"),
|
|
854
|
-
id: NonEmptyString,
|
|
855
|
-
method: NonEmptyString,
|
|
856
|
-
params: Type.Optional(Type.Unknown())
|
|
857
|
-
}, { additionalProperties: false });
|
|
858
|
-
const ResponseFrameSchema = Type.Object({
|
|
859
|
-
type: Type.Literal("res"),
|
|
860
|
-
id: NonEmptyString,
|
|
861
|
-
ok: Type.Boolean(),
|
|
862
|
-
payload: Type.Optional(Type.Unknown()),
|
|
863
|
-
error: Type.Optional(ErrorShapeSchema)
|
|
864
|
-
}, { additionalProperties: false });
|
|
865
|
-
const EventFrameSchema = Type.Object({
|
|
866
|
-
type: Type.Literal("event"),
|
|
867
|
-
event: NonEmptyString,
|
|
868
|
-
payload: Type.Optional(Type.Unknown()),
|
|
869
|
-
seq: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
870
|
-
stateVersion: Type.Optional(StateVersionSchema)
|
|
871
|
-
}, { additionalProperties: false });
|
|
872
|
-
const GatewayFrameSchema = Type.Union([
|
|
873
|
-
RequestFrameSchema,
|
|
874
|
-
ResponseFrameSchema,
|
|
875
|
-
EventFrameSchema
|
|
876
|
-
], { discriminator: "type" });
|
|
877
|
-
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region src/gateway/protocol/schema/logs-chat.ts
|
|
880
|
-
const LogsTailParamsSchema = Type.Object({
|
|
881
|
-
cursor: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
882
|
-
limit: Type.Optional(Type.Integer({
|
|
883
|
-
minimum: 1,
|
|
884
|
-
maximum: 5e3
|
|
885
|
-
})),
|
|
886
|
-
maxBytes: Type.Optional(Type.Integer({
|
|
887
|
-
minimum: 1,
|
|
888
|
-
maximum: 1e6
|
|
889
|
-
}))
|
|
890
|
-
}, { additionalProperties: false });
|
|
891
|
-
const LogsTailResultSchema = Type.Object({
|
|
892
|
-
file: NonEmptyString,
|
|
893
|
-
cursor: Type.Integer({ minimum: 0 }),
|
|
894
|
-
size: Type.Integer({ minimum: 0 }),
|
|
895
|
-
lines: Type.Array(Type.String()),
|
|
896
|
-
truncated: Type.Optional(Type.Boolean()),
|
|
897
|
-
reset: Type.Optional(Type.Boolean())
|
|
898
|
-
}, { additionalProperties: false });
|
|
899
|
-
const ChatHistoryParamsSchema = Type.Object({
|
|
900
|
-
sessionKey: NonEmptyString,
|
|
901
|
-
limit: Type.Optional(Type.Integer({
|
|
902
|
-
minimum: 1,
|
|
903
|
-
maximum: 1e3
|
|
904
|
-
}))
|
|
905
|
-
}, { additionalProperties: false });
|
|
906
|
-
const ChatSendParamsSchema = Type.Object({
|
|
907
|
-
sessionKey: NonEmptyString,
|
|
908
|
-
message: Type.String(),
|
|
909
|
-
thinking: Type.Optional(Type.String()),
|
|
910
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
911
|
-
attachments: Type.Optional(Type.Array(Type.Unknown())),
|
|
912
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
913
|
-
idempotencyKey: NonEmptyString
|
|
914
|
-
}, { additionalProperties: false });
|
|
915
|
-
const ChatAbortParamsSchema = Type.Object({
|
|
916
|
-
sessionKey: NonEmptyString,
|
|
917
|
-
runId: Type.Optional(NonEmptyString)
|
|
918
|
-
}, { additionalProperties: false });
|
|
919
|
-
const ChatInjectParamsSchema = Type.Object({
|
|
920
|
-
sessionKey: NonEmptyString,
|
|
921
|
-
message: NonEmptyString,
|
|
922
|
-
label: Type.Optional(Type.String({ maxLength: 100 }))
|
|
923
|
-
}, { additionalProperties: false });
|
|
924
|
-
const ChatEventSchema = Type.Object({
|
|
925
|
-
runId: NonEmptyString,
|
|
926
|
-
sessionKey: NonEmptyString,
|
|
927
|
-
seq: Type.Integer({ minimum: 0 }),
|
|
928
|
-
state: Type.Union([
|
|
929
|
-
Type.Literal("delta"),
|
|
930
|
-
Type.Literal("final"),
|
|
931
|
-
Type.Literal("aborted"),
|
|
932
|
-
Type.Literal("error")
|
|
933
|
-
]),
|
|
934
|
-
message: Type.Optional(Type.Unknown()),
|
|
935
|
-
errorMessage: Type.Optional(Type.String()),
|
|
936
|
-
usage: Type.Optional(Type.Unknown()),
|
|
937
|
-
stopReason: Type.Optional(Type.String())
|
|
938
|
-
}, { additionalProperties: false });
|
|
939
|
-
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region src/gateway/protocol/schema/nodes.ts
|
|
942
|
-
const NodePairRequestParamsSchema = Type.Object({
|
|
943
|
-
nodeId: NonEmptyString,
|
|
944
|
-
displayName: Type.Optional(NonEmptyString),
|
|
945
|
-
platform: Type.Optional(NonEmptyString),
|
|
946
|
-
version: Type.Optional(NonEmptyString),
|
|
947
|
-
coreVersion: Type.Optional(NonEmptyString),
|
|
948
|
-
uiVersion: Type.Optional(NonEmptyString),
|
|
949
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
950
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
951
|
-
caps: Type.Optional(Type.Array(NonEmptyString)),
|
|
952
|
-
commands: Type.Optional(Type.Array(NonEmptyString)),
|
|
953
|
-
remoteIp: Type.Optional(NonEmptyString),
|
|
954
|
-
silent: Type.Optional(Type.Boolean())
|
|
955
|
-
}, { additionalProperties: false });
|
|
956
|
-
const NodePairListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
957
|
-
const NodePairApproveParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
958
|
-
const NodePairRejectParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
959
|
-
const NodePairVerifyParamsSchema = Type.Object({
|
|
960
|
-
nodeId: NonEmptyString,
|
|
961
|
-
token: NonEmptyString
|
|
962
|
-
}, { additionalProperties: false });
|
|
963
|
-
const NodeRenameParamsSchema = Type.Object({
|
|
964
|
-
nodeId: NonEmptyString,
|
|
965
|
-
displayName: NonEmptyString
|
|
966
|
-
}, { additionalProperties: false });
|
|
967
|
-
const NodeListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
968
|
-
const NodeDescribeParamsSchema = Type.Object({ nodeId: NonEmptyString }, { additionalProperties: false });
|
|
969
|
-
const NodeInvokeParamsSchema = Type.Object({
|
|
970
|
-
nodeId: NonEmptyString,
|
|
971
|
-
command: NonEmptyString,
|
|
972
|
-
params: Type.Optional(Type.Unknown()),
|
|
973
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
974
|
-
idempotencyKey: NonEmptyString
|
|
975
|
-
}, { additionalProperties: false });
|
|
976
|
-
const NodeInvokeResultParamsSchema = Type.Object({
|
|
977
|
-
id: NonEmptyString,
|
|
978
|
-
nodeId: NonEmptyString,
|
|
979
|
-
ok: Type.Boolean(),
|
|
980
|
-
payload: Type.Optional(Type.Unknown()),
|
|
981
|
-
payloadJSON: Type.Optional(Type.String()),
|
|
982
|
-
error: Type.Optional(Type.Object({
|
|
983
|
-
code: Type.Optional(NonEmptyString),
|
|
984
|
-
message: Type.Optional(NonEmptyString)
|
|
985
|
-
}, { additionalProperties: false }))
|
|
986
|
-
}, { additionalProperties: false });
|
|
987
|
-
const NodeEventParamsSchema = Type.Object({
|
|
988
|
-
event: NonEmptyString,
|
|
989
|
-
payload: Type.Optional(Type.Unknown()),
|
|
990
|
-
payloadJSON: Type.Optional(Type.String())
|
|
991
|
-
}, { additionalProperties: false });
|
|
992
|
-
const NodeInvokeRequestEventSchema = Type.Object({
|
|
993
|
-
id: NonEmptyString,
|
|
994
|
-
nodeId: NonEmptyString,
|
|
995
|
-
command: NonEmptyString,
|
|
996
|
-
paramsJSON: Type.Optional(Type.String()),
|
|
997
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
998
|
-
idempotencyKey: Type.Optional(NonEmptyString)
|
|
999
|
-
}, { additionalProperties: false });
|
|
1000
|
-
|
|
1001
|
-
//#endregion
|
|
1002
|
-
//#region src/gateway/protocol/schema/push.ts
|
|
1003
|
-
const ApnsEnvironmentSchema = Type.String({ enum: ["sandbox", "production"] });
|
|
1004
|
-
const PushTestParamsSchema = Type.Object({
|
|
1005
|
-
nodeId: NonEmptyString,
|
|
1006
|
-
title: Type.Optional(Type.String()),
|
|
1007
|
-
body: Type.Optional(Type.String()),
|
|
1008
|
-
environment: Type.Optional(ApnsEnvironmentSchema)
|
|
1009
|
-
}, { additionalProperties: false });
|
|
1010
|
-
const PushTestResultSchema = Type.Object({
|
|
1011
|
-
ok: Type.Boolean(),
|
|
1012
|
-
status: Type.Integer(),
|
|
1013
|
-
apnsId: Type.Optional(Type.String()),
|
|
1014
|
-
reason: Type.Optional(Type.String()),
|
|
1015
|
-
tokenSuffix: Type.String(),
|
|
1016
|
-
topic: Type.String(),
|
|
1017
|
-
environment: ApnsEnvironmentSchema
|
|
1018
|
-
}, { additionalProperties: false });
|
|
1019
|
-
|
|
1020
|
-
//#endregion
|
|
1021
|
-
//#region src/gateway/protocol/schema/sessions.ts
|
|
1022
|
-
const SessionsListParamsSchema = Type.Object({
|
|
1023
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1024
|
-
activeMinutes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1025
|
-
includeGlobal: Type.Optional(Type.Boolean()),
|
|
1026
|
-
includeUnknown: Type.Optional(Type.Boolean()),
|
|
1027
|
-
includeDerivedTitles: Type.Optional(Type.Boolean()),
|
|
1028
|
-
includeLastMessage: Type.Optional(Type.Boolean()),
|
|
1029
|
-
label: Type.Optional(SessionLabelString),
|
|
1030
|
-
spawnedBy: Type.Optional(NonEmptyString),
|
|
1031
|
-
agentId: Type.Optional(NonEmptyString),
|
|
1032
|
-
search: Type.Optional(Type.String())
|
|
1033
|
-
}, { additionalProperties: false });
|
|
1034
|
-
const SessionsPreviewParamsSchema = Type.Object({
|
|
1035
|
-
keys: Type.Array(NonEmptyString, { minItems: 1 }),
|
|
1036
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1037
|
-
maxChars: Type.Optional(Type.Integer({ minimum: 20 }))
|
|
1038
|
-
}, { additionalProperties: false });
|
|
1039
|
-
const SessionsResolveParamsSchema = Type.Object({
|
|
1040
|
-
key: Type.Optional(NonEmptyString),
|
|
1041
|
-
sessionId: Type.Optional(NonEmptyString),
|
|
1042
|
-
label: Type.Optional(SessionLabelString),
|
|
1043
|
-
agentId: Type.Optional(NonEmptyString),
|
|
1044
|
-
spawnedBy: Type.Optional(NonEmptyString),
|
|
1045
|
-
includeGlobal: Type.Optional(Type.Boolean()),
|
|
1046
|
-
includeUnknown: Type.Optional(Type.Boolean())
|
|
1047
|
-
}, { additionalProperties: false });
|
|
1048
|
-
const SessionsPatchParamsSchema = Type.Object({
|
|
1049
|
-
key: NonEmptyString,
|
|
1050
|
-
label: Type.Optional(Type.Union([SessionLabelString, Type.Null()])),
|
|
1051
|
-
verboseLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1052
|
-
responseUsage: Type.Optional(Type.Union([
|
|
1053
|
-
Type.Literal("off"),
|
|
1054
|
-
Type.Literal("tokens"),
|
|
1055
|
-
Type.Literal("full"),
|
|
1056
|
-
Type.Literal("on"),
|
|
1057
|
-
Type.Null()
|
|
1058
|
-
])),
|
|
1059
|
-
elevatedLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1060
|
-
execHost: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1061
|
-
execSecurity: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1062
|
-
execAsk: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1063
|
-
execNode: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1064
|
-
model: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1065
|
-
spawnedBy: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1066
|
-
spawnDepth: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
1067
|
-
sendPolicy: Type.Optional(Type.Union([
|
|
1068
|
-
Type.Literal("allow"),
|
|
1069
|
-
Type.Literal("deny"),
|
|
1070
|
-
Type.Null()
|
|
1071
|
-
])),
|
|
1072
|
-
groupActivation: Type.Optional(Type.Union([
|
|
1073
|
-
Type.Literal("mention"),
|
|
1074
|
-
Type.Literal("always"),
|
|
1075
|
-
Type.Null()
|
|
1076
|
-
]))
|
|
1077
|
-
}, { additionalProperties: false });
|
|
1078
|
-
const SessionsResetParamsSchema = Type.Object({
|
|
1079
|
-
key: NonEmptyString,
|
|
1080
|
-
reason: Type.Optional(Type.Union([Type.Literal("new"), Type.Literal("reset")]))
|
|
1081
|
-
}, { additionalProperties: false });
|
|
1082
|
-
const SessionsDeleteParamsSchema = Type.Object({
|
|
1083
|
-
key: NonEmptyString,
|
|
1084
|
-
deleteTranscript: Type.Optional(Type.Boolean()),
|
|
1085
|
-
emitLifecycleHooks: Type.Optional(Type.Boolean())
|
|
1086
|
-
}, { additionalProperties: false });
|
|
1087
|
-
const SessionsCompactParamsSchema = Type.Object({
|
|
1088
|
-
key: NonEmptyString,
|
|
1089
|
-
maxLines: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
1090
|
-
}, { additionalProperties: false });
|
|
1091
|
-
const SessionsUsageParamsSchema = Type.Object({
|
|
1092
|
-
key: Type.Optional(NonEmptyString),
|
|
1093
|
-
startDate: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
1094
|
-
endDate: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
1095
|
-
mode: Type.Optional(Type.Union([
|
|
1096
|
-
Type.Literal("utc"),
|
|
1097
|
-
Type.Literal("gateway"),
|
|
1098
|
-
Type.Literal("specific")
|
|
1099
|
-
])),
|
|
1100
|
-
utcOffset: Type.Optional(Type.String({ pattern: "^UTC[+-]\\d{1,2}(?::[0-5]\\d)?$" })),
|
|
1101
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1102
|
-
includeContextWeight: Type.Optional(Type.Boolean())
|
|
1103
|
-
}, { additionalProperties: false });
|
|
1104
|
-
|
|
1105
|
-
//#endregion
|
|
1106
|
-
//#region src/gateway/protocol/schema/wizard.ts
|
|
1107
|
-
const WizardRunStatusSchema = Type.Union([
|
|
1108
|
-
Type.Literal("running"),
|
|
1109
|
-
Type.Literal("done"),
|
|
1110
|
-
Type.Literal("cancelled"),
|
|
1111
|
-
Type.Literal("error")
|
|
1112
|
-
]);
|
|
1113
|
-
const WizardStartParamsSchema = Type.Object({
|
|
1114
|
-
mode: Type.Optional(Type.Union([Type.Literal("local"), Type.Literal("remote")])),
|
|
1115
|
-
workspace: Type.Optional(Type.String())
|
|
1116
|
-
}, { additionalProperties: false });
|
|
1117
|
-
const WizardAnswerSchema = Type.Object({
|
|
1118
|
-
stepId: NonEmptyString,
|
|
1119
|
-
value: Type.Optional(Type.Unknown())
|
|
1120
|
-
}, { additionalProperties: false });
|
|
1121
|
-
const WizardNextParamsSchema = Type.Object({
|
|
1122
|
-
sessionId: NonEmptyString,
|
|
1123
|
-
answer: Type.Optional(WizardAnswerSchema)
|
|
1124
|
-
}, { additionalProperties: false });
|
|
1125
|
-
const WizardSessionIdParamsSchema = Type.Object({ sessionId: NonEmptyString }, { additionalProperties: false });
|
|
1126
|
-
const WizardCancelParamsSchema = WizardSessionIdParamsSchema;
|
|
1127
|
-
const WizardStatusParamsSchema = WizardSessionIdParamsSchema;
|
|
1128
|
-
const WizardStepOptionSchema = Type.Object({
|
|
1129
|
-
value: Type.Unknown(),
|
|
1130
|
-
label: NonEmptyString,
|
|
1131
|
-
hint: Type.Optional(Type.String())
|
|
1132
|
-
}, { additionalProperties: false });
|
|
1133
|
-
const WizardStepSchema = Type.Object({
|
|
1134
|
-
id: NonEmptyString,
|
|
1135
|
-
type: Type.Union([
|
|
1136
|
-
Type.Literal("note"),
|
|
1137
|
-
Type.Literal("select"),
|
|
1138
|
-
Type.Literal("text"),
|
|
1139
|
-
Type.Literal("confirm"),
|
|
1140
|
-
Type.Literal("multiselect"),
|
|
1141
|
-
Type.Literal("progress"),
|
|
1142
|
-
Type.Literal("action")
|
|
1143
|
-
]),
|
|
1144
|
-
title: Type.Optional(Type.String()),
|
|
1145
|
-
message: Type.Optional(Type.String()),
|
|
1146
|
-
options: Type.Optional(Type.Array(WizardStepOptionSchema)),
|
|
1147
|
-
initialValue: Type.Optional(Type.Unknown()),
|
|
1148
|
-
placeholder: Type.Optional(Type.String()),
|
|
1149
|
-
sensitive: Type.Optional(Type.Boolean()),
|
|
1150
|
-
executor: Type.Optional(Type.Union([Type.Literal("gateway"), Type.Literal("client")]))
|
|
1151
|
-
}, { additionalProperties: false });
|
|
1152
|
-
const WizardResultFields = {
|
|
1153
|
-
done: Type.Boolean(),
|
|
1154
|
-
step: Type.Optional(WizardStepSchema),
|
|
1155
|
-
status: Type.Optional(WizardRunStatusSchema),
|
|
1156
|
-
error: Type.Optional(Type.String())
|
|
1157
|
-
};
|
|
1158
|
-
const WizardNextResultSchema = Type.Object(WizardResultFields, { additionalProperties: false });
|
|
1159
|
-
const WizardStartResultSchema = Type.Object({
|
|
1160
|
-
sessionId: NonEmptyString,
|
|
1161
|
-
...WizardResultFields
|
|
1162
|
-
}, { additionalProperties: false });
|
|
1163
|
-
const WizardStatusResultSchema = Type.Object({
|
|
1164
|
-
status: WizardRunStatusSchema,
|
|
1165
|
-
error: Type.Optional(Type.String())
|
|
1166
|
-
}, { additionalProperties: false });
|
|
1167
|
-
|
|
1168
|
-
//#endregion
|
|
1169
|
-
//#region src/gateway/protocol/index.ts
|
|
1170
|
-
const ajv = new AjvPkg({
|
|
1171
|
-
allErrors: true,
|
|
1172
|
-
strict: false,
|
|
1173
|
-
removeAdditional: false
|
|
1174
|
-
});
|
|
1175
|
-
const validateConnectParams = ajv.compile(ConnectParamsSchema);
|
|
1176
|
-
const validateRequestFrame = ajv.compile(RequestFrameSchema);
|
|
1177
|
-
const validateResponseFrame = ajv.compile(ResponseFrameSchema);
|
|
1178
|
-
const validateEventFrame = ajv.compile(EventFrameSchema);
|
|
1179
|
-
const validateSendParams = ajv.compile(SendParamsSchema);
|
|
1180
|
-
const validatePollParams = ajv.compile(PollParamsSchema);
|
|
1181
|
-
const validateAgentParams = ajv.compile(AgentParamsSchema);
|
|
1182
|
-
const validateAgentIdentityParams = ajv.compile(AgentIdentityParamsSchema);
|
|
1183
|
-
const validateAgentWaitParams = ajv.compile(AgentWaitParamsSchema);
|
|
1184
|
-
const validateWakeParams = ajv.compile(WakeParamsSchema);
|
|
1185
|
-
const validateAgentsListParams = ajv.compile(AgentsListParamsSchema);
|
|
1186
|
-
const validateAgentsCreateParams = ajv.compile(AgentsCreateParamsSchema);
|
|
1187
|
-
const validateAgentsUpdateParams = ajv.compile(AgentsUpdateParamsSchema);
|
|
1188
|
-
const validateAgentsDeleteParams = ajv.compile(AgentsDeleteParamsSchema);
|
|
1189
|
-
const validateAgentsFilesListParams = ajv.compile(AgentsFilesListParamsSchema);
|
|
1190
|
-
const validateAgentsFilesGetParams = ajv.compile(AgentsFilesGetParamsSchema);
|
|
1191
|
-
const validateAgentsFilesSetParams = ajv.compile(AgentsFilesSetParamsSchema);
|
|
1192
|
-
const validateNodePairRequestParams = ajv.compile(NodePairRequestParamsSchema);
|
|
1193
|
-
const validateNodePairListParams = ajv.compile(NodePairListParamsSchema);
|
|
1194
|
-
const validateNodePairApproveParams = ajv.compile(NodePairApproveParamsSchema);
|
|
1195
|
-
const validateNodePairRejectParams = ajv.compile(NodePairRejectParamsSchema);
|
|
1196
|
-
const validateNodePairVerifyParams = ajv.compile(NodePairVerifyParamsSchema);
|
|
1197
|
-
const validateNodeRenameParams = ajv.compile(NodeRenameParamsSchema);
|
|
1198
|
-
const validateNodeListParams = ajv.compile(NodeListParamsSchema);
|
|
1199
|
-
const validateNodeDescribeParams = ajv.compile(NodeDescribeParamsSchema);
|
|
1200
|
-
const validateNodeInvokeParams = ajv.compile(NodeInvokeParamsSchema);
|
|
1201
|
-
const validateNodeInvokeResultParams = ajv.compile(NodeInvokeResultParamsSchema);
|
|
1202
|
-
const validateNodeEventParams = ajv.compile(NodeEventParamsSchema);
|
|
1203
|
-
const validatePushTestParams = ajv.compile(PushTestParamsSchema);
|
|
1204
|
-
const validateSessionsListParams = ajv.compile(SessionsListParamsSchema);
|
|
1205
|
-
const validateSessionsPreviewParams = ajv.compile(SessionsPreviewParamsSchema);
|
|
1206
|
-
const validateSessionsResolveParams = ajv.compile(SessionsResolveParamsSchema);
|
|
1207
|
-
const validateSessionsPatchParams = ajv.compile(SessionsPatchParamsSchema);
|
|
1208
|
-
const validateSessionsResetParams = ajv.compile(SessionsResetParamsSchema);
|
|
1209
|
-
const validateSessionsDeleteParams = ajv.compile(SessionsDeleteParamsSchema);
|
|
1210
|
-
const validateSessionsCompactParams = ajv.compile(SessionsCompactParamsSchema);
|
|
1211
|
-
const validateSessionsUsageParams = ajv.compile(SessionsUsageParamsSchema);
|
|
1212
|
-
const validateConfigGetParams = ajv.compile(ConfigGetParamsSchema);
|
|
1213
|
-
const validateConfigSetParams = ajv.compile(ConfigSetParamsSchema);
|
|
1214
|
-
const validateConfigApplyParams = ajv.compile(ConfigApplyParamsSchema);
|
|
1215
|
-
const validateConfigPatchParams = ajv.compile(ConfigPatchParamsSchema);
|
|
1216
|
-
const validateConfigSchemaParams = ajv.compile(ConfigSchemaParamsSchema);
|
|
1217
|
-
const validateWizardStartParams = ajv.compile(WizardStartParamsSchema);
|
|
1218
|
-
const validateWizardNextParams = ajv.compile(WizardNextParamsSchema);
|
|
1219
|
-
const validateWizardCancelParams = ajv.compile(WizardCancelParamsSchema);
|
|
1220
|
-
const validateWizardStatusParams = ajv.compile(WizardStatusParamsSchema);
|
|
1221
|
-
const validateTalkModeParams = ajv.compile(TalkModeParamsSchema);
|
|
1222
|
-
const validateTalkConfigParams = ajv.compile(TalkConfigParamsSchema);
|
|
1223
|
-
const validateChannelsStatusParams = ajv.compile(ChannelsStatusParamsSchema);
|
|
1224
|
-
const validateChannelsLogoutParams = ajv.compile(ChannelsLogoutParamsSchema);
|
|
1225
|
-
const validateModelsListParams = ajv.compile(ModelsListParamsSchema);
|
|
1226
|
-
const validateToolsCatalogParams = ajv.compile(ToolsCatalogParamsSchema);
|
|
1227
|
-
const validateCronListParams = ajv.compile(CronListParamsSchema);
|
|
1228
|
-
const validateCronStatusParams = ajv.compile(CronStatusParamsSchema);
|
|
1229
|
-
const validateCronAddParams = ajv.compile(CronAddParamsSchema);
|
|
1230
|
-
const validateCronUpdateParams = ajv.compile(CronUpdateParamsSchema);
|
|
1231
|
-
const validateCronRemoveParams = ajv.compile(CronRemoveParamsSchema);
|
|
1232
|
-
const validateCronRunParams = ajv.compile(CronRunParamsSchema);
|
|
1233
|
-
const validateCronRunsParams = ajv.compile(CronRunsParamsSchema);
|
|
1234
|
-
const validateDevicePairListParams = ajv.compile(DevicePairListParamsSchema);
|
|
1235
|
-
const validateDevicePairApproveParams = ajv.compile(DevicePairApproveParamsSchema);
|
|
1236
|
-
const validateDevicePairRejectParams = ajv.compile(DevicePairRejectParamsSchema);
|
|
1237
|
-
const validateDevicePairRemoveParams = ajv.compile(DevicePairRemoveParamsSchema);
|
|
1238
|
-
const validateDeviceTokenRotateParams = ajv.compile(DeviceTokenRotateParamsSchema);
|
|
1239
|
-
const validateDeviceTokenRevokeParams = ajv.compile(DeviceTokenRevokeParamsSchema);
|
|
1240
|
-
const validateLogsTailParams = ajv.compile(LogsTailParamsSchema);
|
|
1241
|
-
const validateChatHistoryParams = ajv.compile(ChatHistoryParamsSchema);
|
|
1242
|
-
const validateChatSendParams = ajv.compile(ChatSendParamsSchema);
|
|
1243
|
-
const validateChatAbortParams = ajv.compile(ChatAbortParamsSchema);
|
|
1244
|
-
const validateChatInjectParams = ajv.compile(ChatInjectParamsSchema);
|
|
1245
|
-
const validateChatEvent = ajv.compile(ChatEventSchema);
|
|
1246
|
-
const validateUpdateRunParams = ajv.compile(UpdateRunParamsSchema);
|
|
1247
|
-
const validateWebLoginStartParams = ajv.compile(WebLoginStartParamsSchema);
|
|
1248
|
-
const validateWebLoginWaitParams = ajv.compile(WebLoginWaitParamsSchema);
|
|
1249
|
-
|
|
1250
|
-
//#endregion
|
|
1251
|
-
//#region src/gateway/method-scopes.ts
|
|
1252
|
-
const ADMIN_SCOPE = "operator.admin";
|
|
1253
|
-
const READ_SCOPE = "operator.read";
|
|
1254
|
-
const WRITE_SCOPE = "operator.write";
|
|
1255
|
-
const APPROVALS_SCOPE = "operator.approvals";
|
|
1256
|
-
const PAIRING_SCOPE = "operator.pairing";
|
|
1257
|
-
const METHOD_SCOPE_GROUPS = {
|
|
1258
|
-
[APPROVALS_SCOPE]: [
|
|
1259
|
-
"exec.approval.request",
|
|
1260
|
-
"exec.approval.waitDecision",
|
|
1261
|
-
"exec.approval.resolve"
|
|
1262
|
-
],
|
|
1263
|
-
[PAIRING_SCOPE]: [
|
|
1264
|
-
"node.pair.request",
|
|
1265
|
-
"node.pair.list",
|
|
1266
|
-
"node.pair.approve",
|
|
1267
|
-
"node.pair.reject",
|
|
1268
|
-
"node.pair.verify",
|
|
1269
|
-
"device.pair.list",
|
|
1270
|
-
"device.pair.approve",
|
|
1271
|
-
"device.pair.reject",
|
|
1272
|
-
"device.pair.remove",
|
|
1273
|
-
"device.token.rotate",
|
|
1274
|
-
"device.token.revoke",
|
|
1275
|
-
"node.rename"
|
|
1276
|
-
],
|
|
1277
|
-
[READ_SCOPE]: [
|
|
1278
|
-
"health",
|
|
1279
|
-
"logs.tail",
|
|
1280
|
-
"channels.status",
|
|
1281
|
-
"status",
|
|
1282
|
-
"usage.status",
|
|
1283
|
-
"usage.cost",
|
|
1284
|
-
"tts.status",
|
|
1285
|
-
"tts.providers",
|
|
1286
|
-
"tools.catalog",
|
|
1287
|
-
"plugin:tools:list",
|
|
1288
|
-
"agents.list",
|
|
1289
|
-
"agent.identity.get",
|
|
1290
|
-
"voicewake.get",
|
|
1291
|
-
"sessions.list",
|
|
1292
|
-
"sessions.preview",
|
|
1293
|
-
"sessions.resolve",
|
|
1294
|
-
"sessions.usage",
|
|
1295
|
-
"sessions.usage.timeseries",
|
|
1296
|
-
"sessions.usage.logs",
|
|
1297
|
-
"cron.list",
|
|
1298
|
-
"cron.status",
|
|
1299
|
-
"cron.runs",
|
|
1300
|
-
"system-presence",
|
|
1301
|
-
"last-heartbeat",
|
|
1302
|
-
"node.list",
|
|
1303
|
-
"node.describe",
|
|
1304
|
-
"chat.history",
|
|
1305
|
-
"config.get",
|
|
1306
|
-
"talk.config",
|
|
1307
|
-
"agents.files.list",
|
|
1308
|
-
"agents.files.get"
|
|
1309
|
-
],
|
|
1310
|
-
[WRITE_SCOPE]: [
|
|
1311
|
-
"send",
|
|
1312
|
-
"poll",
|
|
1313
|
-
"agent",
|
|
1314
|
-
"agent.wait",
|
|
1315
|
-
"wake",
|
|
1316
|
-
"talk.mode",
|
|
1317
|
-
"tts.enable",
|
|
1318
|
-
"tts.disable",
|
|
1319
|
-
"tts.convert",
|
|
1320
|
-
"tts.setProvider",
|
|
1321
|
-
"voicewake.set",
|
|
1322
|
-
"node.invoke",
|
|
1323
|
-
"sessions.spawn",
|
|
1324
|
-
"sessions.subagents",
|
|
1325
|
-
"chat.send",
|
|
1326
|
-
"chat.abort",
|
|
1327
|
-
"browser.request",
|
|
1328
|
-
"push.test",
|
|
1329
|
-
"hooks.tool.before",
|
|
1330
|
-
"hooks.tool.after",
|
|
1331
|
-
"plugin:tools:invoke",
|
|
1332
|
-
"message:send",
|
|
1333
|
-
"message:reply",
|
|
1334
|
-
"message:thread-reply",
|
|
1335
|
-
"message:broadcast",
|
|
1336
|
-
"message:sendAttachment",
|
|
1337
|
-
"message:sendWithEffect"
|
|
1338
|
-
],
|
|
1339
|
-
[ADMIN_SCOPE]: [
|
|
1340
|
-
"channels.logout",
|
|
1341
|
-
"agents.create",
|
|
1342
|
-
"agents.update",
|
|
1343
|
-
"agents.delete",
|
|
1344
|
-
"cron.add",
|
|
1345
|
-
"cron.update",
|
|
1346
|
-
"cron.remove",
|
|
1347
|
-
"cron.run",
|
|
1348
|
-
"sessions.patch",
|
|
1349
|
-
"sessions.reset",
|
|
1350
|
-
"sessions.delete",
|
|
1351
|
-
"sessions.compact",
|
|
1352
|
-
"connect",
|
|
1353
|
-
"chat.inject",
|
|
1354
|
-
"web.login.start",
|
|
1355
|
-
"web.login.wait",
|
|
1356
|
-
"set-heartbeats",
|
|
1357
|
-
"system-event",
|
|
1358
|
-
"agents.files.set",
|
|
1359
|
-
"message:delete",
|
|
1360
|
-
"message:react",
|
|
1361
|
-
"message:pin",
|
|
1362
|
-
"message:readMessages"
|
|
1363
|
-
]
|
|
1364
|
-
};
|
|
1365
|
-
const METHOD_SCOPE_BY_NAME = new Map(Object.entries(METHOD_SCOPE_GROUPS).flatMap(([scope, methods]) => methods.map((method) => [method, scope])));
|
|
1366
|
-
|
|
1367
|
-
//#endregion
|
|
1368
|
-
//#region src/logging/diagnostic-session-state.ts
|
|
1369
|
-
const SESSION_STATE_TTL_MS = 1800 * 1e3;
|
|
1370
|
-
const SESSION_STATE_PRUNE_INTERVAL_MS = 60 * 1e3;
|
|
1371
|
-
|
|
1372
|
-
//#endregion
|
|
1373
|
-
//#region src/logging/diagnostic.ts
|
|
1374
|
-
const diag = createSubsystemLogger("diagnostic");
|
|
1375
|
-
|
|
1376
|
-
//#endregion
|
|
1377
|
-
//#region src/infra/outbound/session-binding-service.ts
|
|
1378
|
-
function normalizeConversationRef(ref) {
|
|
1379
|
-
return {
|
|
1380
|
-
channel: ref.channel.trim().toLowerCase(),
|
|
1381
|
-
accountId: normalizeAccountId(ref.accountId),
|
|
1382
|
-
conversationId: ref.conversationId.trim(),
|
|
1383
|
-
parentConversationId: ref.parentConversationId?.trim() || void 0
|
|
1384
|
-
};
|
|
1385
|
-
}
|
|
1386
|
-
function toAdapterKey(params) {
|
|
1387
|
-
return `${params.channel.trim().toLowerCase()}:${normalizeAccountId(params.accountId)}`;
|
|
1388
|
-
}
|
|
1389
|
-
const ADAPTERS_BY_CHANNEL_ACCOUNT = /* @__PURE__ */ new Map();
|
|
1390
|
-
function resolveAdapterForConversation(ref) {
|
|
1391
|
-
const normalized = normalizeConversationRef(ref);
|
|
1392
|
-
const key = toAdapterKey({
|
|
1393
|
-
channel: normalized.channel,
|
|
1394
|
-
accountId: normalized.accountId
|
|
1395
|
-
});
|
|
1396
|
-
return ADAPTERS_BY_CHANNEL_ACCOUNT.get(key) ?? null;
|
|
1397
|
-
}
|
|
1398
|
-
function dedupeBindings(records) {
|
|
1399
|
-
const byId = /* @__PURE__ */ new Map();
|
|
1400
|
-
for (const record of records) {
|
|
1401
|
-
if (!record?.bindingId) continue;
|
|
1402
|
-
byId.set(record.bindingId, record);
|
|
1403
|
-
}
|
|
1404
|
-
return [...byId.values()];
|
|
1405
|
-
}
|
|
1406
|
-
function createDefaultSessionBindingService() {
|
|
1407
|
-
return {
|
|
1408
|
-
bind: async (input) => {
|
|
1409
|
-
const normalizedConversation = normalizeConversationRef(input.conversation);
|
|
1410
|
-
const adapter = resolveAdapterForConversation(normalizedConversation);
|
|
1411
|
-
if (!adapter?.bind) throw new Error(`Session binding adapter unavailable for ${normalizedConversation.channel}:${normalizedConversation.accountId}`);
|
|
1412
|
-
const bound = await adapter.bind({
|
|
1413
|
-
...input,
|
|
1414
|
-
conversation: normalizedConversation
|
|
1415
|
-
});
|
|
1416
|
-
if (!bound) throw new Error("Session binding adapter failed to bind target conversation");
|
|
1417
|
-
return bound;
|
|
1418
|
-
},
|
|
1419
|
-
listBySession: (targetSessionKey) => {
|
|
1420
|
-
const key = targetSessionKey.trim();
|
|
1421
|
-
if (!key) return [];
|
|
1422
|
-
const results = [];
|
|
1423
|
-
for (const adapter of ADAPTERS_BY_CHANNEL_ACCOUNT.values()) {
|
|
1424
|
-
const entries = adapter.listBySession(key);
|
|
1425
|
-
if (entries.length > 0) results.push(...entries);
|
|
1426
|
-
}
|
|
1427
|
-
return dedupeBindings(results);
|
|
1428
|
-
},
|
|
1429
|
-
resolveByConversation: (ref) => {
|
|
1430
|
-
const normalized = normalizeConversationRef(ref);
|
|
1431
|
-
if (!normalized.channel || !normalized.conversationId) return null;
|
|
1432
|
-
const adapter = resolveAdapterForConversation(normalized);
|
|
1433
|
-
if (!adapter) return null;
|
|
1434
|
-
return adapter.resolveByConversation(normalized);
|
|
1435
|
-
},
|
|
1436
|
-
touch: (bindingId, at) => {
|
|
1437
|
-
const normalizedBindingId = bindingId.trim();
|
|
1438
|
-
if (!normalizedBindingId) return;
|
|
1439
|
-
for (const adapter of ADAPTERS_BY_CHANNEL_ACCOUNT.values()) adapter.touch?.(normalizedBindingId, at);
|
|
1440
|
-
},
|
|
1441
|
-
unbind: async (input) => {
|
|
1442
|
-
const removed = [];
|
|
1443
|
-
for (const adapter of ADAPTERS_BY_CHANNEL_ACCOUNT.values()) {
|
|
1444
|
-
if (!adapter.unbind) continue;
|
|
1445
|
-
const entries = await adapter.unbind(input);
|
|
1446
|
-
if (entries.length > 0) removed.push(...entries);
|
|
1447
|
-
}
|
|
1448
|
-
return dedupeBindings(removed);
|
|
1449
|
-
}
|
|
1450
|
-
};
|
|
1451
|
-
}
|
|
1452
|
-
const DEFAULT_SESSION_BINDING_SERVICE = createDefaultSessionBindingService();
|
|
1453
|
-
|
|
1454
|
-
//#endregion
|
|
1455
|
-
//#region src/agents/tool-display.json
|
|
1456
|
-
var tool_display_default = {
|
|
1457
|
-
version: 1,
|
|
1458
|
-
fallback: {
|
|
1459
|
-
"emoji": "🧩",
|
|
1460
|
-
"detailKeys": [
|
|
1461
|
-
"command",
|
|
1462
|
-
"path",
|
|
1463
|
-
"url",
|
|
1464
|
-
"targetUrl",
|
|
1465
|
-
"targetId",
|
|
1466
|
-
"ref",
|
|
1467
|
-
"element",
|
|
1468
|
-
"node",
|
|
1469
|
-
"nodeId",
|
|
1470
|
-
"id",
|
|
1471
|
-
"requestId",
|
|
1472
|
-
"to",
|
|
1473
|
-
"channelId",
|
|
1474
|
-
"guildId",
|
|
1475
|
-
"userId",
|
|
1476
|
-
"name",
|
|
1477
|
-
"query",
|
|
1478
|
-
"pattern",
|
|
1479
|
-
"messageId"
|
|
1480
|
-
]
|
|
1481
|
-
},
|
|
1482
|
-
tools: {
|
|
1483
|
-
"attach": {
|
|
1484
|
-
"emoji": "📎",
|
|
1485
|
-
"title": "Attach",
|
|
1486
|
-
"detailKeys": [
|
|
1487
|
-
"path",
|
|
1488
|
-
"url",
|
|
1489
|
-
"fileName"
|
|
1490
|
-
]
|
|
1491
|
-
},
|
|
1492
|
-
"browser": {
|
|
1493
|
-
"emoji": "🌐",
|
|
1494
|
-
"title": "Browser",
|
|
1495
|
-
"actions": {
|
|
1496
|
-
"status": { "label": "status" },
|
|
1497
|
-
"start": { "label": "start" },
|
|
1498
|
-
"stop": { "label": "stop" },
|
|
1499
|
-
"tabs": { "label": "tabs" },
|
|
1500
|
-
"open": {
|
|
1501
|
-
"label": "open",
|
|
1502
|
-
"detailKeys": ["targetUrl"]
|
|
1503
|
-
},
|
|
1504
|
-
"focus": {
|
|
1505
|
-
"label": "focus",
|
|
1506
|
-
"detailKeys": ["targetId"]
|
|
1507
|
-
},
|
|
1508
|
-
"close": {
|
|
1509
|
-
"label": "close",
|
|
1510
|
-
"detailKeys": ["targetId"]
|
|
1511
|
-
},
|
|
1512
|
-
"snapshot": {
|
|
1513
|
-
"label": "snapshot",
|
|
1514
|
-
"detailKeys": [
|
|
1515
|
-
"targetUrl",
|
|
1516
|
-
"targetId",
|
|
1517
|
-
"ref",
|
|
1518
|
-
"element",
|
|
1519
|
-
"format"
|
|
1520
|
-
]
|
|
1521
|
-
},
|
|
1522
|
-
"screenshot": {
|
|
1523
|
-
"label": "screenshot",
|
|
1524
|
-
"detailKeys": [
|
|
1525
|
-
"targetUrl",
|
|
1526
|
-
"targetId",
|
|
1527
|
-
"ref",
|
|
1528
|
-
"element"
|
|
1529
|
-
]
|
|
1530
|
-
},
|
|
1531
|
-
"navigate": {
|
|
1532
|
-
"label": "navigate",
|
|
1533
|
-
"detailKeys": ["targetUrl", "targetId"]
|
|
1534
|
-
},
|
|
1535
|
-
"console": {
|
|
1536
|
-
"label": "console",
|
|
1537
|
-
"detailKeys": ["level", "targetId"]
|
|
1538
|
-
},
|
|
1539
|
-
"pdf": {
|
|
1540
|
-
"label": "pdf",
|
|
1541
|
-
"detailKeys": ["targetId"]
|
|
1542
|
-
},
|
|
1543
|
-
"upload": {
|
|
1544
|
-
"label": "upload",
|
|
1545
|
-
"detailKeys": [
|
|
1546
|
-
"paths",
|
|
1547
|
-
"ref",
|
|
1548
|
-
"inputRef",
|
|
1549
|
-
"element",
|
|
1550
|
-
"targetId"
|
|
1551
|
-
]
|
|
1552
|
-
},
|
|
1553
|
-
"dialog": {
|
|
1554
|
-
"label": "dialog",
|
|
1555
|
-
"detailKeys": [
|
|
1556
|
-
"accept",
|
|
1557
|
-
"promptText",
|
|
1558
|
-
"targetId"
|
|
1559
|
-
]
|
|
1560
|
-
},
|
|
1561
|
-
"act": {
|
|
1562
|
-
"label": "act",
|
|
1563
|
-
"detailKeys": [
|
|
1564
|
-
"request.kind",
|
|
1565
|
-
"request.ref",
|
|
1566
|
-
"request.selector",
|
|
1567
|
-
"request.text",
|
|
1568
|
-
"request.value"
|
|
1569
|
-
]
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
},
|
|
1573
|
-
"canvas": {
|
|
1574
|
-
"emoji": "🖼️",
|
|
1575
|
-
"title": "Canvas",
|
|
1576
|
-
"actions": {
|
|
1577
|
-
"present": {
|
|
1578
|
-
"label": "present",
|
|
1579
|
-
"detailKeys": [
|
|
1580
|
-
"target",
|
|
1581
|
-
"node",
|
|
1582
|
-
"nodeId"
|
|
1583
|
-
]
|
|
1584
|
-
},
|
|
1585
|
-
"hide": {
|
|
1586
|
-
"label": "hide",
|
|
1587
|
-
"detailKeys": ["node", "nodeId"]
|
|
1588
|
-
},
|
|
1589
|
-
"navigate": {
|
|
1590
|
-
"label": "navigate",
|
|
1591
|
-
"detailKeys": [
|
|
1592
|
-
"url",
|
|
1593
|
-
"node",
|
|
1594
|
-
"nodeId"
|
|
1595
|
-
]
|
|
1596
|
-
},
|
|
1597
|
-
"eval": {
|
|
1598
|
-
"label": "eval",
|
|
1599
|
-
"detailKeys": [
|
|
1600
|
-
"javaScript",
|
|
1601
|
-
"node",
|
|
1602
|
-
"nodeId"
|
|
1603
|
-
]
|
|
1604
|
-
},
|
|
1605
|
-
"snapshot": {
|
|
1606
|
-
"label": "snapshot",
|
|
1607
|
-
"detailKeys": [
|
|
1608
|
-
"format",
|
|
1609
|
-
"node",
|
|
1610
|
-
"nodeId"
|
|
1611
|
-
]
|
|
1612
|
-
},
|
|
1613
|
-
"a2ui_push": {
|
|
1614
|
-
"label": "A2UI push",
|
|
1615
|
-
"detailKeys": [
|
|
1616
|
-
"jsonlPath",
|
|
1617
|
-
"node",
|
|
1618
|
-
"nodeId"
|
|
1619
|
-
]
|
|
1620
|
-
},
|
|
1621
|
-
"a2ui_reset": {
|
|
1622
|
-
"label": "A2UI reset",
|
|
1623
|
-
"detailKeys": ["node", "nodeId"]
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
},
|
|
1627
|
-
"nodes": {
|
|
1628
|
-
"emoji": "📱",
|
|
1629
|
-
"title": "Nodes",
|
|
1630
|
-
"actions": {
|
|
1631
|
-
"status": { "label": "status" },
|
|
1632
|
-
"describe": {
|
|
1633
|
-
"label": "describe",
|
|
1634
|
-
"detailKeys": ["node", "nodeId"]
|
|
1635
|
-
},
|
|
1636
|
-
"pending": { "label": "pending" },
|
|
1637
|
-
"approve": {
|
|
1638
|
-
"label": "approve",
|
|
1639
|
-
"detailKeys": ["requestId"]
|
|
1640
|
-
},
|
|
1641
|
-
"reject": {
|
|
1642
|
-
"label": "reject",
|
|
1643
|
-
"detailKeys": ["requestId"]
|
|
1644
|
-
},
|
|
1645
|
-
"notify": {
|
|
1646
|
-
"label": "notify",
|
|
1647
|
-
"detailKeys": [
|
|
1648
|
-
"node",
|
|
1649
|
-
"nodeId",
|
|
1650
|
-
"title",
|
|
1651
|
-
"body"
|
|
1652
|
-
]
|
|
1653
|
-
},
|
|
1654
|
-
"camera_snap": {
|
|
1655
|
-
"label": "camera snap",
|
|
1656
|
-
"detailKeys": [
|
|
1657
|
-
"node",
|
|
1658
|
-
"nodeId",
|
|
1659
|
-
"facing",
|
|
1660
|
-
"deviceId"
|
|
1661
|
-
]
|
|
1662
|
-
},
|
|
1663
|
-
"camera_list": {
|
|
1664
|
-
"label": "camera list",
|
|
1665
|
-
"detailKeys": ["node", "nodeId"]
|
|
1666
|
-
},
|
|
1667
|
-
"camera_clip": {
|
|
1668
|
-
"label": "camera clip",
|
|
1669
|
-
"detailKeys": [
|
|
1670
|
-
"node",
|
|
1671
|
-
"nodeId",
|
|
1672
|
-
"facing",
|
|
1673
|
-
"duration",
|
|
1674
|
-
"durationMs"
|
|
1675
|
-
]
|
|
1676
|
-
},
|
|
1677
|
-
"screen_record": {
|
|
1678
|
-
"label": "screen record",
|
|
1679
|
-
"detailKeys": [
|
|
1680
|
-
"node",
|
|
1681
|
-
"nodeId",
|
|
1682
|
-
"duration",
|
|
1683
|
-
"durationMs",
|
|
1684
|
-
"fps",
|
|
1685
|
-
"screenIndex"
|
|
1686
|
-
]
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
},
|
|
1690
|
-
"cron": {
|
|
1691
|
-
"emoji": "⏰",
|
|
1692
|
-
"title": "Cron",
|
|
1693
|
-
"actions": {
|
|
1694
|
-
"status": { "label": "status" },
|
|
1695
|
-
"list": { "label": "list" },
|
|
1696
|
-
"add": {
|
|
1697
|
-
"label": "add",
|
|
1698
|
-
"detailKeys": [
|
|
1699
|
-
"job.name",
|
|
1700
|
-
"job.id",
|
|
1701
|
-
"job.schedule",
|
|
1702
|
-
"job.cron"
|
|
1703
|
-
]
|
|
1704
|
-
},
|
|
1705
|
-
"update": {
|
|
1706
|
-
"label": "update",
|
|
1707
|
-
"detailKeys": ["id"]
|
|
1708
|
-
},
|
|
1709
|
-
"remove": {
|
|
1710
|
-
"label": "remove",
|
|
1711
|
-
"detailKeys": ["id"]
|
|
1712
|
-
},
|
|
1713
|
-
"run": {
|
|
1714
|
-
"label": "run",
|
|
1715
|
-
"detailKeys": ["id"]
|
|
1716
|
-
},
|
|
1717
|
-
"runs": {
|
|
1718
|
-
"label": "runs",
|
|
1719
|
-
"detailKeys": ["id"]
|
|
1720
|
-
},
|
|
1721
|
-
"wake": {
|
|
1722
|
-
"label": "wake",
|
|
1723
|
-
"detailKeys": ["text", "mode"]
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
},
|
|
1727
|
-
"gateway": {
|
|
1728
|
-
"emoji": "🔌",
|
|
1729
|
-
"title": "Gateway",
|
|
1730
|
-
"actions": { "restart": {
|
|
1731
|
-
"label": "restart",
|
|
1732
|
-
"detailKeys": ["reason", "delayMs"]
|
|
1733
|
-
} }
|
|
1734
|
-
},
|
|
1735
|
-
"message": {
|
|
1736
|
-
"emoji": "✉️",
|
|
1737
|
-
"title": "Message",
|
|
1738
|
-
"actions": {
|
|
1739
|
-
"send": {
|
|
1740
|
-
"label": "send",
|
|
1741
|
-
"detailKeys": [
|
|
1742
|
-
"provider",
|
|
1743
|
-
"to",
|
|
1744
|
-
"media",
|
|
1745
|
-
"replyTo",
|
|
1746
|
-
"threadId"
|
|
1747
|
-
]
|
|
1748
|
-
},
|
|
1749
|
-
"poll": {
|
|
1750
|
-
"label": "poll",
|
|
1751
|
-
"detailKeys": [
|
|
1752
|
-
"provider",
|
|
1753
|
-
"to",
|
|
1754
|
-
"pollQuestion"
|
|
1755
|
-
]
|
|
1756
|
-
},
|
|
1757
|
-
"react": {
|
|
1758
|
-
"label": "react",
|
|
1759
|
-
"detailKeys": [
|
|
1760
|
-
"provider",
|
|
1761
|
-
"to",
|
|
1762
|
-
"messageId",
|
|
1763
|
-
"emoji",
|
|
1764
|
-
"remove"
|
|
1765
|
-
]
|
|
1766
|
-
},
|
|
1767
|
-
"reactions": {
|
|
1768
|
-
"label": "reactions",
|
|
1769
|
-
"detailKeys": [
|
|
1770
|
-
"provider",
|
|
1771
|
-
"to",
|
|
1772
|
-
"messageId",
|
|
1773
|
-
"limit"
|
|
1774
|
-
]
|
|
1775
|
-
},
|
|
1776
|
-
"read": {
|
|
1777
|
-
"label": "read",
|
|
1778
|
-
"detailKeys": [
|
|
1779
|
-
"provider",
|
|
1780
|
-
"to",
|
|
1781
|
-
"limit"
|
|
1782
|
-
]
|
|
1783
|
-
},
|
|
1784
|
-
"edit": {
|
|
1785
|
-
"label": "edit",
|
|
1786
|
-
"detailKeys": [
|
|
1787
|
-
"provider",
|
|
1788
|
-
"to",
|
|
1789
|
-
"messageId"
|
|
1790
|
-
]
|
|
1791
|
-
},
|
|
1792
|
-
"delete": {
|
|
1793
|
-
"label": "delete",
|
|
1794
|
-
"detailKeys": [
|
|
1795
|
-
"provider",
|
|
1796
|
-
"to",
|
|
1797
|
-
"messageId"
|
|
1798
|
-
]
|
|
1799
|
-
},
|
|
1800
|
-
"pin": {
|
|
1801
|
-
"label": "pin",
|
|
1802
|
-
"detailKeys": [
|
|
1803
|
-
"provider",
|
|
1804
|
-
"to",
|
|
1805
|
-
"messageId"
|
|
1806
|
-
]
|
|
1807
|
-
},
|
|
1808
|
-
"unpin": {
|
|
1809
|
-
"label": "unpin",
|
|
1810
|
-
"detailKeys": [
|
|
1811
|
-
"provider",
|
|
1812
|
-
"to",
|
|
1813
|
-
"messageId"
|
|
1814
|
-
]
|
|
1815
|
-
},
|
|
1816
|
-
"list-pins": {
|
|
1817
|
-
"label": "list pins",
|
|
1818
|
-
"detailKeys": ["provider", "to"]
|
|
1819
|
-
},
|
|
1820
|
-
"permissions": {
|
|
1821
|
-
"label": "permissions",
|
|
1822
|
-
"detailKeys": [
|
|
1823
|
-
"provider",
|
|
1824
|
-
"channelId",
|
|
1825
|
-
"to"
|
|
1826
|
-
]
|
|
1827
|
-
},
|
|
1828
|
-
"thread-create": {
|
|
1829
|
-
"label": "thread create",
|
|
1830
|
-
"detailKeys": [
|
|
1831
|
-
"provider",
|
|
1832
|
-
"channelId",
|
|
1833
|
-
"threadName"
|
|
1834
|
-
]
|
|
1835
|
-
},
|
|
1836
|
-
"thread-list": {
|
|
1837
|
-
"label": "thread list",
|
|
1838
|
-
"detailKeys": [
|
|
1839
|
-
"provider",
|
|
1840
|
-
"guildId",
|
|
1841
|
-
"channelId"
|
|
1842
|
-
]
|
|
1843
|
-
},
|
|
1844
|
-
"thread-reply": {
|
|
1845
|
-
"label": "thread reply",
|
|
1846
|
-
"detailKeys": [
|
|
1847
|
-
"provider",
|
|
1848
|
-
"channelId",
|
|
1849
|
-
"messageId"
|
|
1850
|
-
]
|
|
1851
|
-
},
|
|
1852
|
-
"search": {
|
|
1853
|
-
"label": "search",
|
|
1854
|
-
"detailKeys": [
|
|
1855
|
-
"provider",
|
|
1856
|
-
"guildId",
|
|
1857
|
-
"query"
|
|
1858
|
-
]
|
|
1859
|
-
},
|
|
1860
|
-
"sticker": {
|
|
1861
|
-
"label": "sticker",
|
|
1862
|
-
"detailKeys": [
|
|
1863
|
-
"provider",
|
|
1864
|
-
"to",
|
|
1865
|
-
"stickerId"
|
|
1866
|
-
]
|
|
1867
|
-
},
|
|
1868
|
-
"member-info": {
|
|
1869
|
-
"label": "member",
|
|
1870
|
-
"detailKeys": [
|
|
1871
|
-
"provider",
|
|
1872
|
-
"guildId",
|
|
1873
|
-
"userId"
|
|
1874
|
-
]
|
|
1875
|
-
},
|
|
1876
|
-
"role-info": {
|
|
1877
|
-
"label": "roles",
|
|
1878
|
-
"detailKeys": ["provider", "guildId"]
|
|
1879
|
-
},
|
|
1880
|
-
"emoji-list": {
|
|
1881
|
-
"label": "emoji list",
|
|
1882
|
-
"detailKeys": ["provider", "guildId"]
|
|
1883
|
-
},
|
|
1884
|
-
"emoji-upload": {
|
|
1885
|
-
"label": "emoji upload",
|
|
1886
|
-
"detailKeys": [
|
|
1887
|
-
"provider",
|
|
1888
|
-
"guildId",
|
|
1889
|
-
"emojiName"
|
|
1890
|
-
]
|
|
1891
|
-
},
|
|
1892
|
-
"sticker-upload": {
|
|
1893
|
-
"label": "sticker upload",
|
|
1894
|
-
"detailKeys": [
|
|
1895
|
-
"provider",
|
|
1896
|
-
"guildId",
|
|
1897
|
-
"stickerName"
|
|
1898
|
-
]
|
|
1899
|
-
},
|
|
1900
|
-
"role-add": {
|
|
1901
|
-
"label": "role add",
|
|
1902
|
-
"detailKeys": [
|
|
1903
|
-
"provider",
|
|
1904
|
-
"guildId",
|
|
1905
|
-
"userId",
|
|
1906
|
-
"roleId"
|
|
1907
|
-
]
|
|
1908
|
-
},
|
|
1909
|
-
"role-remove": {
|
|
1910
|
-
"label": "role remove",
|
|
1911
|
-
"detailKeys": [
|
|
1912
|
-
"provider",
|
|
1913
|
-
"guildId",
|
|
1914
|
-
"userId",
|
|
1915
|
-
"roleId"
|
|
1916
|
-
]
|
|
1917
|
-
},
|
|
1918
|
-
"channel-info": {
|
|
1919
|
-
"label": "channel",
|
|
1920
|
-
"detailKeys": ["provider", "channelId"]
|
|
1921
|
-
},
|
|
1922
|
-
"channel-list": {
|
|
1923
|
-
"label": "channels",
|
|
1924
|
-
"detailKeys": ["provider", "guildId"]
|
|
1925
|
-
},
|
|
1926
|
-
"voice-status": {
|
|
1927
|
-
"label": "voice",
|
|
1928
|
-
"detailKeys": [
|
|
1929
|
-
"provider",
|
|
1930
|
-
"guildId",
|
|
1931
|
-
"userId"
|
|
1932
|
-
]
|
|
1933
|
-
},
|
|
1934
|
-
"event-list": {
|
|
1935
|
-
"label": "events",
|
|
1936
|
-
"detailKeys": ["provider", "guildId"]
|
|
1937
|
-
},
|
|
1938
|
-
"event-create": {
|
|
1939
|
-
"label": "event create",
|
|
1940
|
-
"detailKeys": [
|
|
1941
|
-
"provider",
|
|
1942
|
-
"guildId",
|
|
1943
|
-
"eventName"
|
|
1944
|
-
]
|
|
1945
|
-
},
|
|
1946
|
-
"timeout": {
|
|
1947
|
-
"label": "timeout",
|
|
1948
|
-
"detailKeys": [
|
|
1949
|
-
"provider",
|
|
1950
|
-
"guildId",
|
|
1951
|
-
"userId"
|
|
1952
|
-
]
|
|
1953
|
-
},
|
|
1954
|
-
"kick": {
|
|
1955
|
-
"label": "kick",
|
|
1956
|
-
"detailKeys": [
|
|
1957
|
-
"provider",
|
|
1958
|
-
"guildId",
|
|
1959
|
-
"userId"
|
|
1960
|
-
]
|
|
1961
|
-
},
|
|
1962
|
-
"ban": {
|
|
1963
|
-
"label": "ban",
|
|
1964
|
-
"detailKeys": [
|
|
1965
|
-
"provider",
|
|
1966
|
-
"guildId",
|
|
1967
|
-
"userId"
|
|
1968
|
-
]
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
},
|
|
1972
|
-
"agents_list": {
|
|
1973
|
-
"emoji": "🧭",
|
|
1974
|
-
"title": "Agents",
|
|
1975
|
-
"detailKeys": []
|
|
1976
|
-
},
|
|
1977
|
-
"sessions_list": {
|
|
1978
|
-
"emoji": "🗂️",
|
|
1979
|
-
"title": "Sessions",
|
|
1980
|
-
"detailKeys": [
|
|
1981
|
-
"kinds",
|
|
1982
|
-
"limit",
|
|
1983
|
-
"activeMinutes",
|
|
1984
|
-
"messageLimit"
|
|
1985
|
-
]
|
|
1986
|
-
},
|
|
1987
|
-
"sessions_history": {
|
|
1988
|
-
"emoji": "🧾",
|
|
1989
|
-
"title": "Session History",
|
|
1990
|
-
"detailKeys": [
|
|
1991
|
-
"sessionKey",
|
|
1992
|
-
"limit",
|
|
1993
|
-
"includeTools"
|
|
1994
|
-
]
|
|
1995
|
-
},
|
|
1996
|
-
"sessions_send": {
|
|
1997
|
-
"emoji": "📨",
|
|
1998
|
-
"title": "Session Send",
|
|
1999
|
-
"detailKeys": [
|
|
2000
|
-
"label",
|
|
2001
|
-
"sessionKey",
|
|
2002
|
-
"agentId",
|
|
2003
|
-
"timeoutSeconds"
|
|
2004
|
-
]
|
|
2005
|
-
},
|
|
2006
|
-
"sessions_spawn": {
|
|
2007
|
-
"emoji": "🧑🔧",
|
|
2008
|
-
"title": "Sub-agent",
|
|
2009
|
-
"detailKeys": [
|
|
2010
|
-
"label",
|
|
2011
|
-
"task",
|
|
2012
|
-
"agentId",
|
|
2013
|
-
"model",
|
|
2014
|
-
"thinking",
|
|
2015
|
-
"runTimeoutSeconds",
|
|
2016
|
-
"cleanup"
|
|
2017
|
-
]
|
|
2018
|
-
},
|
|
2019
|
-
"subagents": {
|
|
2020
|
-
"emoji": "🤖",
|
|
2021
|
-
"title": "Subagents",
|
|
2022
|
-
"actions": {
|
|
2023
|
-
"list": {
|
|
2024
|
-
"label": "list",
|
|
2025
|
-
"detailKeys": ["recentMinutes"]
|
|
2026
|
-
},
|
|
2027
|
-
"kill": {
|
|
2028
|
-
"label": "kill",
|
|
2029
|
-
"detailKeys": ["target"]
|
|
2030
|
-
},
|
|
2031
|
-
"steer": {
|
|
2032
|
-
"label": "steer",
|
|
2033
|
-
"detailKeys": ["target"]
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
"session_status": {
|
|
2038
|
-
"emoji": "📊",
|
|
2039
|
-
"title": "Session Status",
|
|
2040
|
-
"detailKeys": ["sessionKey", "model"]
|
|
2041
|
-
},
|
|
2042
|
-
"whatsapp_login": {
|
|
2043
|
-
"emoji": "🟢",
|
|
2044
|
-
"title": "WhatsApp Login",
|
|
2045
|
-
"actions": {
|
|
2046
|
-
"start": { "label": "start" },
|
|
2047
|
-
"wait": { "label": "wait" }
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
};
|
|
2052
|
-
|
|
2053
|
-
//#endregion
|
|
2054
|
-
//#region src/agents/tool-display.ts
|
|
2055
|
-
const TOOL_DISPLAY_CONFIG = tool_display_default;
|
|
2056
|
-
const FALLBACK = TOOL_DISPLAY_CONFIG.fallback ?? { emoji: "🧩" };
|
|
2057
|
-
const TOOL_MAP = TOOL_DISPLAY_CONFIG.tools ?? {};
|
|
2058
|
-
|
|
2059
|
-
//#endregion
|
|
2060
|
-
//#region src/agents/subagent-announce.ts
|
|
2061
|
-
const FAST_TEST_MODE = process.env.REMOTECLAW_TEST_FAST === "1";
|
|
2062
|
-
|
|
2063
|
-
//#endregion
|
|
2064
|
-
//#region src/agents/subagent-registry.ts
|
|
2065
|
-
/**
|
|
2066
|
-
* Announce entries older than this are force-expired even if delivery never
|
|
2067
|
-
* succeeded. Guards against stale registry entries surviving gateway restarts.
|
|
2068
|
-
*/
|
|
2069
|
-
const ANNOUNCE_EXPIRY_MS = 5 * 6e4;
|
|
2070
|
-
|
|
2071
|
-
//#endregion
|
|
2072
|
-
//#region src/web/auto-reply/constants.ts
|
|
2073
|
-
const DEFAULT_WEB_MEDIA_BYTES = 5 * 1024 * 1024;
|
|
2074
|
-
|
|
2075
|
-
//#endregion
|
|
2076
|
-
//#region src/media-understanding/defaults.ts
|
|
2077
|
-
const MB = 1024 * 1024;
|
|
2078
|
-
const DEFAULT_MAX_BYTES = {
|
|
2079
|
-
image: 10 * MB,
|
|
2080
|
-
audio: 20 * MB,
|
|
2081
|
-
video: 50 * MB
|
|
2082
|
-
};
|
|
2083
|
-
const DEFAULT_VIDEO_MAX_BASE64_BYTES = 70 * MB;
|
|
2084
|
-
const CLI_OUTPUT_MAX_BUFFER = 5 * MB;
|
|
2085
|
-
|
|
2086
|
-
//#endregion
|
|
2087
|
-
//#region src/media/input-files.ts
|
|
2088
|
-
const DEFAULT_INPUT_IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
2089
|
-
const DEFAULT_INPUT_FILE_MAX_BYTES = 5 * 1024 * 1024;
|
|
2090
|
-
|
|
2091
|
-
//#endregion
|
|
2092
|
-
//#region src/media-understanding/attachments.ts
|
|
2093
|
-
const DEFAULT_LOCAL_PATH_ROOTS = mergeInboundPathRoots(getDefaultMediaLocalRoots(), DEFAULT_IMESSAGE_ATTACHMENT_ROOTS);
|
|
2094
|
-
|
|
2095
|
-
//#endregion
|
|
2096
|
-
//#region src/auth/constants.ts
|
|
2097
|
-
const log$4 = createSubsystemLogger("auth");
|
|
2098
|
-
|
|
2099
|
-
//#endregion
|
|
2100
|
-
//#region src/auth/usage.ts
|
|
2101
|
-
const FAILURE_REASON_PRIORITY = [
|
|
2102
|
-
"auth",
|
|
2103
|
-
"billing",
|
|
2104
|
-
"format",
|
|
2105
|
-
"model_not_found",
|
|
2106
|
-
"timeout",
|
|
2107
|
-
"rate_limit",
|
|
2108
|
-
"unknown"
|
|
2109
|
-
];
|
|
2110
|
-
const FAILURE_REASON_SET = new Set(FAILURE_REASON_PRIORITY);
|
|
2111
|
-
const FAILURE_REASON_ORDER = new Map(FAILURE_REASON_PRIORITY.map((reason, index) => [reason, index]));
|
|
2112
|
-
|
|
2113
|
-
//#endregion
|
|
2114
|
-
//#region src/tts/tts-core.ts
|
|
2115
|
-
const TEMP_FILE_CLEANUP_DELAY_MS = 300 * 1e3;
|
|
2116
|
-
|
|
2117
|
-
//#endregion
|
|
2118
|
-
//#region src/auto-reply/reply/commands-export-session.ts
|
|
2119
|
-
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
2120
|
-
|
|
2121
|
-
//#endregion
|
|
2122
|
-
//#region src/discord/monitor/thread-bindings.types.ts
|
|
2123
|
-
const DEFAULT_THREAD_BINDING_TTL_MS = 1440 * 60 * 1e3;
|
|
2124
|
-
|
|
2125
|
-
//#endregion
|
|
2126
|
-
//#region src/discord/monitor/thread-bindings.state.ts
|
|
2127
|
-
const THREAD_BINDINGS_STATE_KEY = "__remoteclawDiscordThreadBindingsState";
|
|
2128
|
-
function createThreadBindingsGlobalState() {
|
|
2129
|
-
return {
|
|
2130
|
-
managersByAccountId: /* @__PURE__ */ new Map(),
|
|
2131
|
-
bindingsByThreadId: /* @__PURE__ */ new Map(),
|
|
2132
|
-
bindingsBySessionKey: /* @__PURE__ */ new Map(),
|
|
2133
|
-
tokensByAccountId: /* @__PURE__ */ new Map(),
|
|
2134
|
-
recentUnboundWebhookEchoesByBindingKey: /* @__PURE__ */ new Map(),
|
|
2135
|
-
reusableWebhooksByAccountChannel: /* @__PURE__ */ new Map(),
|
|
2136
|
-
persistByAccountId: /* @__PURE__ */ new Map(),
|
|
2137
|
-
loadedBindings: false
|
|
2138
|
-
};
|
|
2139
|
-
}
|
|
2140
|
-
function resolveThreadBindingsGlobalState() {
|
|
2141
|
-
const runtimeGlobal = globalThis;
|
|
2142
|
-
if (!runtimeGlobal[THREAD_BINDINGS_STATE_KEY]) runtimeGlobal[THREAD_BINDINGS_STATE_KEY] = createThreadBindingsGlobalState();
|
|
2143
|
-
return runtimeGlobal[THREAD_BINDINGS_STATE_KEY];
|
|
2144
|
-
}
|
|
2145
|
-
const THREAD_BINDINGS_STATE = resolveThreadBindingsGlobalState();
|
|
2146
|
-
const MANAGERS_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.managersByAccountId;
|
|
2147
|
-
const BINDINGS_BY_THREAD_ID = THREAD_BINDINGS_STATE.bindingsByThreadId;
|
|
2148
|
-
const BINDINGS_BY_SESSION_KEY = THREAD_BINDINGS_STATE.bindingsBySessionKey;
|
|
2149
|
-
const TOKENS_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.tokensByAccountId;
|
|
2150
|
-
const RECENT_UNBOUND_WEBHOOK_ECHOES_BY_BINDING_KEY = THREAD_BINDINGS_STATE.recentUnboundWebhookEchoesByBindingKey;
|
|
2151
|
-
const REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL = THREAD_BINDINGS_STATE.reusableWebhooksByAccountChannel;
|
|
2152
|
-
const PERSIST_BY_ACCOUNT_ID = THREAD_BINDINGS_STATE.persistByAccountId;
|
|
2153
|
-
|
|
2154
|
-
//#endregion
|
|
2155
|
-
//#region src/discord/client.ts
|
|
2156
|
-
function resolveToken(params) {
|
|
2157
|
-
const explicit = normalizeDiscordToken(params.explicit);
|
|
2158
|
-
if (explicit) return explicit;
|
|
2159
|
-
const fallback = normalizeDiscordToken(params.fallbackToken);
|
|
2160
|
-
if (!fallback) throw new Error(`Discord bot token missing for account "${params.accountId}" (set discord.accounts.${params.accountId}.token or DISCORD_BOT_TOKEN for default).`);
|
|
2161
|
-
return fallback;
|
|
2162
|
-
}
|
|
2163
|
-
function resolveRest(token, rest) {
|
|
2164
|
-
return rest ?? new RequestClient(token);
|
|
2165
|
-
}
|
|
2166
|
-
function createDiscordRestClient(opts, cfg = loadConfig()) {
|
|
2167
|
-
const account = resolveDiscordAccount({
|
|
2168
|
-
cfg,
|
|
2169
|
-
accountId: opts.accountId
|
|
2170
|
-
});
|
|
2171
|
-
const token = resolveToken({
|
|
2172
|
-
explicit: opts.token,
|
|
2173
|
-
accountId: account.accountId,
|
|
2174
|
-
fallbackToken: account.token
|
|
2175
|
-
});
|
|
2176
|
-
return {
|
|
2177
|
-
token,
|
|
2178
|
-
rest: resolveRest(token, opts.rest),
|
|
2179
|
-
account
|
|
2180
|
-
};
|
|
2181
|
-
}
|
|
2182
|
-
function createDiscordClient(opts, cfg = loadConfig()) {
|
|
2183
|
-
const { token, rest, account } = createDiscordRestClient(opts, cfg);
|
|
2184
|
-
return {
|
|
2185
|
-
token,
|
|
2186
|
-
rest,
|
|
2187
|
-
request: createDiscordRetryRunner({
|
|
2188
|
-
retry: opts.retry,
|
|
2189
|
-
configRetry: account.config.retry,
|
|
2190
|
-
verbose: opts.verbose
|
|
2191
|
-
})
|
|
2192
|
-
};
|
|
2193
|
-
}
|
|
2194
|
-
function resolveDiscordRest(opts) {
|
|
2195
|
-
return createDiscordRestClient(opts).rest;
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
//#endregion
|
|
2199
|
-
//#region src/discord/chunk.ts
|
|
2200
|
-
const DEFAULT_MAX_CHARS = 2e3;
|
|
2201
|
-
const DEFAULT_MAX_LINES = 17;
|
|
2202
|
-
const FENCE_RE = /^( {0,3})(`{3,}|~{3,})(.*)$/;
|
|
2203
|
-
function countLines(text) {
|
|
2204
|
-
if (!text) return 0;
|
|
2205
|
-
return text.split("\n").length;
|
|
2206
|
-
}
|
|
2207
|
-
function parseFenceLine(line) {
|
|
2208
|
-
const match = line.match(FENCE_RE);
|
|
2209
|
-
if (!match) return null;
|
|
2210
|
-
const indent = match[1] ?? "";
|
|
2211
|
-
const marker = match[2] ?? "";
|
|
2212
|
-
return {
|
|
2213
|
-
indent,
|
|
2214
|
-
markerChar: marker[0] ?? "`",
|
|
2215
|
-
markerLen: marker.length,
|
|
2216
|
-
openLine: line
|
|
2217
|
-
};
|
|
2218
|
-
}
|
|
2219
|
-
function closeFenceLine(openFence) {
|
|
2220
|
-
return `${openFence.indent}${openFence.markerChar.repeat(openFence.markerLen)}`;
|
|
2221
|
-
}
|
|
2222
|
-
function closeFenceIfNeeded(text, openFence) {
|
|
2223
|
-
if (!openFence) return text;
|
|
2224
|
-
const closeLine = closeFenceLine(openFence);
|
|
2225
|
-
if (!text) return closeLine;
|
|
2226
|
-
if (!text.endsWith("\n")) return `${text}\n${closeLine}`;
|
|
2227
|
-
return `${text}${closeLine}`;
|
|
2228
|
-
}
|
|
2229
|
-
function splitLongLine(line, maxChars, opts) {
|
|
2230
|
-
const limit = Math.max(1, Math.floor(maxChars));
|
|
2231
|
-
if (line.length <= limit) return [line];
|
|
2232
|
-
const out = [];
|
|
2233
|
-
let remaining = line;
|
|
2234
|
-
while (remaining.length > limit) {
|
|
2235
|
-
if (opts.preserveWhitespace) {
|
|
2236
|
-
out.push(remaining.slice(0, limit));
|
|
2237
|
-
remaining = remaining.slice(limit);
|
|
2238
|
-
continue;
|
|
2239
|
-
}
|
|
2240
|
-
const window = remaining.slice(0, limit);
|
|
2241
|
-
let breakIdx = -1;
|
|
2242
|
-
for (let i = window.length - 1; i >= 0; i--) if (/\s/.test(window[i])) {
|
|
2243
|
-
breakIdx = i;
|
|
2244
|
-
break;
|
|
2245
|
-
}
|
|
2246
|
-
if (breakIdx <= 0) breakIdx = limit;
|
|
2247
|
-
out.push(remaining.slice(0, breakIdx));
|
|
2248
|
-
remaining = remaining.slice(breakIdx);
|
|
2249
|
-
}
|
|
2250
|
-
if (remaining.length) out.push(remaining);
|
|
2251
|
-
return out;
|
|
2252
|
-
}
|
|
2253
|
-
/**
|
|
2254
|
-
* Chunks outbound Discord text by both character count and (soft) line count,
|
|
2255
|
-
* while keeping fenced code blocks balanced across chunks.
|
|
2256
|
-
*/
|
|
2257
|
-
function chunkDiscordText(text, opts = {}) {
|
|
2258
|
-
const maxChars = Math.max(1, Math.floor(opts.maxChars ?? DEFAULT_MAX_CHARS));
|
|
2259
|
-
const maxLines = Math.max(1, Math.floor(opts.maxLines ?? DEFAULT_MAX_LINES));
|
|
2260
|
-
const body = text ?? "";
|
|
2261
|
-
if (!body) return [];
|
|
2262
|
-
if (body.length <= maxChars && countLines(body) <= maxLines) return [body];
|
|
2263
|
-
const lines = body.split("\n");
|
|
2264
|
-
const chunks = [];
|
|
2265
|
-
let current = "";
|
|
2266
|
-
let currentLines = 0;
|
|
2267
|
-
let openFence = null;
|
|
2268
|
-
const flush = () => {
|
|
2269
|
-
if (!current) return;
|
|
2270
|
-
const payload = closeFenceIfNeeded(current, openFence);
|
|
2271
|
-
if (payload.trim().length) chunks.push(payload);
|
|
2272
|
-
current = "";
|
|
2273
|
-
currentLines = 0;
|
|
2274
|
-
if (openFence) {
|
|
2275
|
-
current = openFence.openLine;
|
|
2276
|
-
currentLines = 1;
|
|
2277
|
-
}
|
|
2278
|
-
};
|
|
2279
|
-
for (const originalLine of lines) {
|
|
2280
|
-
const fenceInfo = parseFenceLine(originalLine);
|
|
2281
|
-
const wasInsideFence = openFence !== null;
|
|
2282
|
-
let nextOpenFence = openFence;
|
|
2283
|
-
if (fenceInfo) {
|
|
2284
|
-
if (!openFence) nextOpenFence = fenceInfo;
|
|
2285
|
-
else if (openFence.markerChar === fenceInfo.markerChar && fenceInfo.markerLen >= openFence.markerLen) nextOpenFence = null;
|
|
2286
|
-
}
|
|
2287
|
-
const reserveChars = nextOpenFence ? closeFenceLine(nextOpenFence).length + 1 : 0;
|
|
2288
|
-
const reserveLines = nextOpenFence ? 1 : 0;
|
|
2289
|
-
const effectiveMaxChars = maxChars - reserveChars;
|
|
2290
|
-
const effectiveMaxLines = maxLines - reserveLines;
|
|
2291
|
-
const charLimit = effectiveMaxChars > 0 ? effectiveMaxChars : maxChars;
|
|
2292
|
-
const lineLimit = effectiveMaxLines > 0 ? effectiveMaxLines : maxLines;
|
|
2293
|
-
const prefixLen = current.length > 0 ? current.length + 1 : 0;
|
|
2294
|
-
const segments = splitLongLine(originalLine, Math.max(1, charLimit - prefixLen), { preserveWhitespace: wasInsideFence });
|
|
2295
|
-
for (let segIndex = 0; segIndex < segments.length; segIndex++) {
|
|
2296
|
-
const segment = segments[segIndex];
|
|
2297
|
-
const isLineContinuation = segIndex > 0;
|
|
2298
|
-
const addition = `${isLineContinuation ? "" : current.length > 0 ? "\n" : ""}${segment}`;
|
|
2299
|
-
const nextLen = current.length + addition.length;
|
|
2300
|
-
const nextLines = currentLines + (isLineContinuation ? 0 : 1);
|
|
2301
|
-
if ((nextLen > charLimit || nextLines > lineLimit) && current.length > 0) flush();
|
|
2302
|
-
if (current.length > 0) {
|
|
2303
|
-
current += addition;
|
|
2304
|
-
if (!isLineContinuation) currentLines += 1;
|
|
2305
|
-
} else {
|
|
2306
|
-
current = segment;
|
|
2307
|
-
currentLines = 1;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
openFence = nextOpenFence;
|
|
2311
|
-
}
|
|
2312
|
-
if (current.length) {
|
|
2313
|
-
const payload = closeFenceIfNeeded(current, openFence);
|
|
2314
|
-
if (payload.trim().length) chunks.push(payload);
|
|
2315
|
-
}
|
|
2316
|
-
return rebalanceReasoningItalics(text, chunks);
|
|
2317
|
-
}
|
|
2318
|
-
function chunkDiscordTextWithMode(text, opts) {
|
|
2319
|
-
if ((opts.chunkMode ?? "length") !== "newline") return chunkDiscordText(text, opts);
|
|
2320
|
-
const lineChunks = chunkMarkdownTextWithMode(text, Math.max(1, Math.floor(opts.maxChars ?? DEFAULT_MAX_CHARS)), "newline");
|
|
2321
|
-
const chunks = [];
|
|
2322
|
-
for (const line of lineChunks) {
|
|
2323
|
-
const nested = chunkDiscordText(line, opts);
|
|
2324
|
-
if (!nested.length && line) {
|
|
2325
|
-
chunks.push(line);
|
|
2326
|
-
continue;
|
|
2327
|
-
}
|
|
2328
|
-
chunks.push(...nested);
|
|
2329
|
-
}
|
|
2330
|
-
return chunks;
|
|
2331
|
-
}
|
|
2332
|
-
function rebalanceReasoningItalics(source, chunks) {
|
|
2333
|
-
if (chunks.length <= 1) return chunks;
|
|
2334
|
-
if (!(source.startsWith("Reasoning:\n_") && source.trimEnd().endsWith("_"))) return chunks;
|
|
2335
|
-
const adjusted = [...chunks];
|
|
2336
|
-
for (let i = 0; i < adjusted.length; i++) {
|
|
2337
|
-
const isLast = i === adjusted.length - 1;
|
|
2338
|
-
const current = adjusted[i];
|
|
2339
|
-
if (!current.trimEnd().endsWith("_")) adjusted[i] = `${current}_`;
|
|
2340
|
-
if (isLast) break;
|
|
2341
|
-
const next = adjusted[i + 1];
|
|
2342
|
-
const leadingWhitespaceLen = next.length - next.trimStart().length;
|
|
2343
|
-
const leadingWhitespace = next.slice(0, leadingWhitespaceLen);
|
|
2344
|
-
const nextBody = next.slice(leadingWhitespaceLen);
|
|
2345
|
-
if (!nextBody.startsWith("_")) adjusted[i + 1] = `${leadingWhitespace}_${nextBody}`;
|
|
2346
|
-
}
|
|
2347
|
-
return adjusted;
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
//#endregion
|
|
2351
|
-
//#region src/discord/send.permissions.ts
|
|
2352
|
-
const PERMISSION_ENTRIES = Object.entries(PermissionFlagsBits).filter(([, value]) => typeof value === "bigint");
|
|
2353
|
-
const ALL_PERMISSIONS = PERMISSION_ENTRIES.reduce((acc, [, value]) => acc | value, 0n);
|
|
2354
|
-
const ADMINISTRATOR_BIT = PermissionFlagsBits.Administrator;
|
|
2355
|
-
function addPermissionBits(base, add) {
|
|
2356
|
-
if (!add) return base;
|
|
2357
|
-
return base | BigInt(add);
|
|
2358
|
-
}
|
|
2359
|
-
function removePermissionBits(base, deny) {
|
|
2360
|
-
if (!deny) return base;
|
|
2361
|
-
return base & ~BigInt(deny);
|
|
2362
|
-
}
|
|
2363
|
-
function bitfieldToPermissions(bitfield) {
|
|
2364
|
-
return PERMISSION_ENTRIES.filter(([, value]) => (bitfield & value) === value).map(([name]) => name).toSorted();
|
|
2365
|
-
}
|
|
2366
|
-
function hasAdministrator(bitfield) {
|
|
2367
|
-
return (bitfield & ADMINISTRATOR_BIT) === ADMINISTRATOR_BIT;
|
|
2368
|
-
}
|
|
2369
|
-
function isThreadChannelType(channelType) {
|
|
2370
|
-
return channelType === ChannelType.GuildNewsThread || channelType === ChannelType.GuildPublicThread || channelType === ChannelType.GuildPrivateThread;
|
|
2371
|
-
}
|
|
2372
|
-
async function fetchBotUserId(rest) {
|
|
2373
|
-
const me = await rest.get(Routes.user("@me"));
|
|
2374
|
-
if (!me?.id) throw new Error("Failed to resolve bot user id");
|
|
2375
|
-
return me.id;
|
|
2376
|
-
}
|
|
2377
|
-
async function fetchChannelPermissionsDiscord(channelId, opts = {}) {
|
|
2378
|
-
const rest = resolveDiscordRest(opts);
|
|
2379
|
-
const channel = await rest.get(Routes.channel(channelId));
|
|
2380
|
-
const channelType = "type" in channel ? channel.type : void 0;
|
|
2381
|
-
const guildId = "guild_id" in channel ? channel.guild_id : void 0;
|
|
2382
|
-
if (!guildId) return {
|
|
2383
|
-
channelId,
|
|
2384
|
-
permissions: [],
|
|
2385
|
-
raw: "0",
|
|
2386
|
-
isDm: true,
|
|
2387
|
-
channelType
|
|
2388
|
-
};
|
|
2389
|
-
const botId = await fetchBotUserId(rest);
|
|
2390
|
-
const [guild, member] = await Promise.all([rest.get(Routes.guild(guildId)), rest.get(Routes.guildMember(guildId, botId))]);
|
|
2391
|
-
const rolesById = new Map((guild.roles ?? []).map((role) => [role.id, role]));
|
|
2392
|
-
const everyoneRole = rolesById.get(guildId);
|
|
2393
|
-
let base = 0n;
|
|
2394
|
-
if (everyoneRole?.permissions) base = addPermissionBits(base, everyoneRole.permissions);
|
|
2395
|
-
for (const roleId of member.roles ?? []) {
|
|
2396
|
-
const role = rolesById.get(roleId);
|
|
2397
|
-
if (role?.permissions) base = addPermissionBits(base, role.permissions);
|
|
2398
|
-
}
|
|
2399
|
-
if (hasAdministrator(base)) return {
|
|
2400
|
-
channelId,
|
|
2401
|
-
guildId,
|
|
2402
|
-
permissions: bitfieldToPermissions(ALL_PERMISSIONS),
|
|
2403
|
-
raw: ALL_PERMISSIONS.toString(),
|
|
2404
|
-
isDm: false,
|
|
2405
|
-
channelType
|
|
2406
|
-
};
|
|
2407
|
-
let permissions = base;
|
|
2408
|
-
const overwrites = "permission_overwrites" in channel ? channel.permission_overwrites ?? [] : [];
|
|
2409
|
-
for (const overwrite of overwrites) if (overwrite.id === guildId) {
|
|
2410
|
-
permissions = removePermissionBits(permissions, overwrite.deny ?? "0");
|
|
2411
|
-
permissions = addPermissionBits(permissions, overwrite.allow ?? "0");
|
|
2412
|
-
}
|
|
2413
|
-
for (const overwrite of overwrites) if (member.roles?.includes(overwrite.id)) {
|
|
2414
|
-
permissions = removePermissionBits(permissions, overwrite.deny ?? "0");
|
|
2415
|
-
permissions = addPermissionBits(permissions, overwrite.allow ?? "0");
|
|
2416
|
-
}
|
|
2417
|
-
for (const overwrite of overwrites) if (overwrite.id === botId) {
|
|
2418
|
-
permissions = removePermissionBits(permissions, overwrite.deny ?? "0");
|
|
2419
|
-
permissions = addPermissionBits(permissions, overwrite.allow ?? "0");
|
|
2420
|
-
}
|
|
2421
|
-
return {
|
|
2422
|
-
channelId,
|
|
2423
|
-
guildId,
|
|
2424
|
-
permissions: bitfieldToPermissions(permissions),
|
|
2425
|
-
raw: permissions.toString(),
|
|
2426
|
-
isDm: false,
|
|
2427
|
-
channelType
|
|
2428
|
-
};
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
//#endregion
|
|
2432
|
-
//#region src/discord/send.types.ts
|
|
2433
|
-
var DiscordSendError = class extends Error {
|
|
2434
|
-
constructor(message, opts) {
|
|
2435
|
-
super(message);
|
|
2436
|
-
this.name = "DiscordSendError";
|
|
2437
|
-
if (opts) Object.assign(this, opts);
|
|
2438
|
-
}
|
|
2439
|
-
toString() {
|
|
2440
|
-
return this.message;
|
|
2441
|
-
}
|
|
2442
|
-
};
|
|
2443
|
-
const DISCORD_MAX_EMOJI_BYTES = 256 * 1024;
|
|
2444
|
-
const DISCORD_MAX_STICKER_BYTES = 512 * 1024;
|
|
2445
|
-
|
|
2446
|
-
//#endregion
|
|
2447
|
-
//#region src/discord/send.shared.ts
|
|
2448
|
-
const DISCORD_TEXT_LIMIT = 2e3;
|
|
2449
|
-
const DISCORD_MISSING_PERMISSIONS = 50013;
|
|
2450
|
-
const DISCORD_CANNOT_DM = 50007;
|
|
2451
|
-
/**
|
|
2452
|
-
* Parse and resolve Discord recipient, including username lookup.
|
|
2453
|
-
* This enables sending DMs by username (e.g., "john.doe") by querying
|
|
2454
|
-
* the Discord directory to resolve usernames to user IDs.
|
|
2455
|
-
*
|
|
2456
|
-
* @param raw - The recipient string (username, ID, or known format)
|
|
2457
|
-
* @param accountId - Discord account ID to use for directory lookup
|
|
2458
|
-
* @returns Parsed DiscordRecipient with resolved user ID if applicable
|
|
2459
|
-
*/
|
|
2460
|
-
async function parseAndResolveRecipient(raw, accountId) {
|
|
2461
|
-
const cfg = loadConfig();
|
|
2462
|
-
const accountInfo = resolveDiscordAccount({
|
|
2463
|
-
cfg,
|
|
2464
|
-
accountId
|
|
2465
|
-
});
|
|
2466
|
-
const trimmed = raw.trim();
|
|
2467
|
-
const parseOptions = { ambiguousMessage: `Ambiguous Discord recipient "${trimmed}". Use "user:${trimmed}" for DMs or "channel:${trimmed}" for channel messages.` };
|
|
2468
|
-
const resolved = await resolveDiscordTarget(raw, {
|
|
2469
|
-
cfg,
|
|
2470
|
-
accountId: accountInfo.accountId
|
|
2471
|
-
}, parseOptions);
|
|
2472
|
-
if (resolved) return {
|
|
2473
|
-
kind: resolved.kind,
|
|
2474
|
-
id: resolved.id
|
|
2475
|
-
};
|
|
2476
|
-
const parsed = parseDiscordTarget(raw, parseOptions);
|
|
2477
|
-
if (!parsed) throw new Error("Recipient is required for Discord sends");
|
|
2478
|
-
return {
|
|
2479
|
-
kind: parsed.kind,
|
|
2480
|
-
id: parsed.id
|
|
2481
|
-
};
|
|
2482
|
-
}
|
|
2483
|
-
function getDiscordErrorCode(err) {
|
|
2484
|
-
if (!err || typeof err !== "object") return;
|
|
2485
|
-
const candidate = "code" in err && err.code !== void 0 ? err.code : "rawError" in err && err.rawError && typeof err.rawError === "object" ? err.rawError.code : void 0;
|
|
2486
|
-
if (typeof candidate === "number") return candidate;
|
|
2487
|
-
if (typeof candidate === "string" && /^\d+$/.test(candidate)) return Number(candidate);
|
|
2488
|
-
}
|
|
2489
|
-
async function buildDiscordSendError(err, ctx) {
|
|
2490
|
-
if (err instanceof DiscordSendError) return err;
|
|
2491
|
-
const code = getDiscordErrorCode(err);
|
|
2492
|
-
if (code === DISCORD_CANNOT_DM) return new DiscordSendError("discord dm failed: user blocks dms or privacy settings disallow it", { kind: "dm-blocked" });
|
|
2493
|
-
if (code !== DISCORD_MISSING_PERMISSIONS) return err;
|
|
2494
|
-
let missing = [];
|
|
2495
|
-
try {
|
|
2496
|
-
const permissions = await fetchChannelPermissionsDiscord(ctx.channelId, {
|
|
2497
|
-
rest: ctx.rest,
|
|
2498
|
-
token: ctx.token
|
|
2499
|
-
});
|
|
2500
|
-
const current = new Set(permissions.permissions);
|
|
2501
|
-
const required = ["ViewChannel", "SendMessages"];
|
|
2502
|
-
if (isThreadChannelType(permissions.channelType)) required.push("SendMessagesInThreads");
|
|
2503
|
-
if (ctx.hasMedia) required.push("AttachFiles");
|
|
2504
|
-
missing = required.filter((permission) => !current.has(permission));
|
|
2505
|
-
} catch {}
|
|
2506
|
-
return new DiscordSendError(`${missing.length ? `missing permissions in channel ${ctx.channelId}: ${missing.join(", ")}` : `missing permissions in channel ${ctx.channelId}`}. bot might be muted or blocked by role/channel overrides`, {
|
|
2507
|
-
kind: "missing-permissions",
|
|
2508
|
-
channelId: ctx.channelId,
|
|
2509
|
-
missingPermissions: missing
|
|
2510
|
-
});
|
|
2511
|
-
}
|
|
2512
|
-
async function resolveChannelId(rest, recipient, request) {
|
|
2513
|
-
if (recipient.kind === "channel") return { channelId: recipient.id };
|
|
2514
|
-
const dmChannel = await request(() => rest.post(Routes.userChannels(), { body: { recipient_id: recipient.id } }), "dm-channel");
|
|
2515
|
-
if (!dmChannel?.id) throw new Error("Failed to create Discord DM channel");
|
|
2516
|
-
return {
|
|
2517
|
-
channelId: dmChannel.id,
|
|
2518
|
-
dm: true
|
|
2519
|
-
};
|
|
2520
|
-
}
|
|
2521
|
-
async function resolveDiscordChannelType(rest, channelId) {
|
|
2522
|
-
try {
|
|
2523
|
-
return (await rest.get(Routes.channel(channelId)))?.type;
|
|
2524
|
-
} catch {
|
|
2525
|
-
return;
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2528
|
-
const SUPPRESS_NOTIFICATIONS_FLAG = 4096;
|
|
2529
|
-
function buildDiscordTextChunks(text, opts = {}) {
|
|
2530
|
-
if (!text) return [];
|
|
2531
|
-
const chunks = chunkDiscordTextWithMode(text, {
|
|
2532
|
-
maxChars: opts.maxChars ?? DISCORD_TEXT_LIMIT,
|
|
2533
|
-
maxLines: opts.maxLinesPerMessage,
|
|
2534
|
-
chunkMode: opts.chunkMode
|
|
2535
|
-
});
|
|
2536
|
-
if (!chunks.length && text) chunks.push(text);
|
|
2537
|
-
return chunks;
|
|
2538
|
-
}
|
|
2539
|
-
function hasV2Components(components) {
|
|
2540
|
-
return Boolean(components?.some((component) => "isV2" in component && component.isV2));
|
|
2541
|
-
}
|
|
2542
|
-
function resolveDiscordSendComponents(params) {
|
|
2543
|
-
if (!params.components || !params.isFirst) return;
|
|
2544
|
-
return typeof params.components === "function" ? params.components(params.text) : params.components;
|
|
2545
|
-
}
|
|
2546
|
-
function normalizeDiscordEmbeds(embeds) {
|
|
2547
|
-
if (!embeds?.length) return;
|
|
2548
|
-
return embeds.map((embed) => embed instanceof Embed ? embed : new Embed(embed));
|
|
2549
|
-
}
|
|
2550
|
-
function resolveDiscordSendEmbeds(params) {
|
|
2551
|
-
if (!params.embeds || !params.isFirst) return;
|
|
2552
|
-
return normalizeDiscordEmbeds(params.embeds);
|
|
2553
|
-
}
|
|
2554
|
-
function buildDiscordMessagePayload(params) {
|
|
2555
|
-
const payload = {};
|
|
2556
|
-
const hasV2 = hasV2Components(params.components);
|
|
2557
|
-
const trimmed = params.text.trim();
|
|
2558
|
-
if (!hasV2 && trimmed) payload.content = params.text;
|
|
2559
|
-
if (params.components?.length) payload.components = params.components;
|
|
2560
|
-
if (!hasV2 && params.embeds?.length) payload.embeds = params.embeds;
|
|
2561
|
-
if (params.flags !== void 0) payload.flags = params.flags;
|
|
2562
|
-
if (params.files?.length) payload.files = params.files;
|
|
2563
|
-
return payload;
|
|
2564
|
-
}
|
|
2565
|
-
function stripUndefinedFields(value) {
|
|
2566
|
-
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
2567
|
-
}
|
|
2568
|
-
function toDiscordFileBlob(data) {
|
|
2569
|
-
if (data instanceof Blob) return data;
|
|
2570
|
-
const arrayBuffer = new ArrayBuffer(data.byteLength);
|
|
2571
|
-
new Uint8Array(arrayBuffer).set(data);
|
|
2572
|
-
return new Blob([arrayBuffer]);
|
|
2573
|
-
}
|
|
2574
|
-
async function sendDiscordText(rest, channelId, text, replyTo, request, maxLinesPerMessage, components, embeds, chunkMode, silent) {
|
|
2575
|
-
if (!text.trim()) throw new Error("Message must be non-empty for Discord sends");
|
|
2576
|
-
const messageReference = replyTo ? {
|
|
2577
|
-
message_id: replyTo,
|
|
2578
|
-
fail_if_not_exists: false
|
|
2579
|
-
} : void 0;
|
|
2580
|
-
const flags = silent ? SUPPRESS_NOTIFICATIONS_FLAG : void 0;
|
|
2581
|
-
const chunks = buildDiscordTextChunks(text, {
|
|
2582
|
-
maxLinesPerMessage,
|
|
2583
|
-
chunkMode
|
|
2584
|
-
});
|
|
2585
|
-
const sendChunk = async (chunk, isFirst) => {
|
|
2586
|
-
const body = stripUndefinedFields({
|
|
2587
|
-
...serializePayload(buildDiscordMessagePayload({
|
|
2588
|
-
text: chunk,
|
|
2589
|
-
components: resolveDiscordSendComponents({
|
|
2590
|
-
components,
|
|
2591
|
-
text: chunk,
|
|
2592
|
-
isFirst
|
|
2593
|
-
}),
|
|
2594
|
-
embeds: resolveDiscordSendEmbeds({
|
|
2595
|
-
embeds,
|
|
2596
|
-
isFirst
|
|
2597
|
-
}),
|
|
2598
|
-
flags
|
|
2599
|
-
})),
|
|
2600
|
-
...messageReference ? { message_reference: messageReference } : {}
|
|
2601
|
-
});
|
|
2602
|
-
return await request(() => rest.post(Routes.channelMessages(channelId), { body }), "text");
|
|
2603
|
-
};
|
|
2604
|
-
if (chunks.length === 1) return await sendChunk(chunks[0], true);
|
|
2605
|
-
let last = null;
|
|
2606
|
-
for (const [index, chunk] of chunks.entries()) last = await sendChunk(chunk, index === 0);
|
|
2607
|
-
if (!last) throw new Error("Discord send failed (empty chunk result)");
|
|
2608
|
-
return last;
|
|
2609
|
-
}
|
|
2610
|
-
async function sendDiscordMedia(rest, channelId, text, mediaUrl, mediaLocalRoots, replyTo, request, maxLinesPerMessage, components, embeds, chunkMode, silent) {
|
|
2611
|
-
const media = await loadWebMedia(mediaUrl, { localRoots: mediaLocalRoots });
|
|
2612
|
-
const chunks = text ? buildDiscordTextChunks(text, {
|
|
2613
|
-
maxLinesPerMessage,
|
|
2614
|
-
chunkMode
|
|
2615
|
-
}) : [];
|
|
2616
|
-
const caption = chunks[0] ?? "";
|
|
2617
|
-
const messageReference = replyTo ? {
|
|
2618
|
-
message_id: replyTo,
|
|
2619
|
-
fail_if_not_exists: false
|
|
2620
|
-
} : void 0;
|
|
2621
|
-
const flags = silent ? SUPPRESS_NOTIFICATIONS_FLAG : void 0;
|
|
2622
|
-
const fileData = toDiscordFileBlob(media.buffer);
|
|
2623
|
-
const payload = buildDiscordMessagePayload({
|
|
2624
|
-
text: caption,
|
|
2625
|
-
components: resolveDiscordSendComponents({
|
|
2626
|
-
components,
|
|
2627
|
-
text: caption,
|
|
2628
|
-
isFirst: true
|
|
2629
|
-
}),
|
|
2630
|
-
embeds: resolveDiscordSendEmbeds({
|
|
2631
|
-
embeds,
|
|
2632
|
-
isFirst: true
|
|
2633
|
-
}),
|
|
2634
|
-
flags,
|
|
2635
|
-
files: [{
|
|
2636
|
-
data: fileData,
|
|
2637
|
-
name: media.fileName ?? "upload"
|
|
2638
|
-
}]
|
|
2639
|
-
});
|
|
2640
|
-
const res = await request(() => rest.post(Routes.channelMessages(channelId), { body: stripUndefinedFields({
|
|
2641
|
-
...serializePayload(payload),
|
|
2642
|
-
...messageReference ? { message_reference: messageReference } : {}
|
|
2643
|
-
}) }), "media");
|
|
2644
|
-
for (const chunk of chunks.slice(1)) {
|
|
2645
|
-
if (!chunk.trim()) continue;
|
|
2646
|
-
await sendDiscordText(rest, channelId, chunk, replyTo, request, maxLinesPerMessage, void 0, void 0, chunkMode, silent);
|
|
2647
|
-
}
|
|
2648
|
-
return res;
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
//#endregion
|
|
2652
|
-
//#region src/discord/voice-message.ts
|
|
2653
|
-
/**
|
|
2654
|
-
* Discord Voice Message Support
|
|
2655
|
-
*
|
|
2656
|
-
* Implements sending voice messages via Discord's API.
|
|
2657
|
-
* Voice messages require:
|
|
2658
|
-
* - OGG/Opus format audio
|
|
2659
|
-
* - Waveform data (base64 encoded, up to 256 samples, 0-255 values)
|
|
2660
|
-
* - Duration in seconds
|
|
2661
|
-
* - Message flag 8192 (IS_VOICE_MESSAGE)
|
|
2662
|
-
* - No other content (text, embeds, etc.)
|
|
2663
|
-
*/
|
|
2664
|
-
const execFileAsync = promisify(execFile);
|
|
2665
|
-
|
|
2666
|
-
//#endregion
|
|
2667
|
-
//#region src/discord/send.outbound.ts
|
|
2668
|
-
async function sendDiscordThreadTextChunks(params) {
|
|
2669
|
-
for (const chunk of params.chunks) await sendDiscordText(params.rest, params.threadId, chunk, void 0, params.request, params.maxLinesPerMessage, void 0, void 0, params.chunkMode, params.silent);
|
|
2670
|
-
}
|
|
2671
|
-
/** Discord thread names are capped at 100 characters. */
|
|
2672
|
-
const DISCORD_THREAD_NAME_LIMIT = 100;
|
|
2673
|
-
/** Derive a thread title from the first non-empty line of the message text. */
|
|
2674
|
-
function deriveForumThreadName(text) {
|
|
2675
|
-
return (text.split("\n").find((l) => l.trim())?.trim() ?? "").slice(0, DISCORD_THREAD_NAME_LIMIT) || (/* @__PURE__ */ new Date()).toISOString().slice(0, 16);
|
|
2676
|
-
}
|
|
2677
|
-
/** Forum/Media channels cannot receive regular messages; detect them here. */
|
|
2678
|
-
function isForumLikeType(channelType) {
|
|
2679
|
-
return channelType === ChannelType.GuildForum || channelType === ChannelType.GuildMedia;
|
|
2680
|
-
}
|
|
2681
|
-
function toDiscordSendResult(result, fallbackChannelId) {
|
|
2682
|
-
return {
|
|
2683
|
-
messageId: result.id ? String(result.id) : "unknown",
|
|
2684
|
-
channelId: String(result.channel_id ?? fallbackChannelId)
|
|
2685
|
-
};
|
|
2686
|
-
}
|
|
2687
|
-
async function sendMessageDiscord(to, text, opts = {}) {
|
|
2688
|
-
const cfg = loadConfig();
|
|
2689
|
-
const accountInfo = resolveDiscordAccount({
|
|
2690
|
-
cfg,
|
|
2691
|
-
accountId: opts.accountId
|
|
2692
|
-
});
|
|
2693
|
-
const tableMode = resolveMarkdownTableMode({
|
|
2694
|
-
cfg,
|
|
2695
|
-
channel: "discord",
|
|
2696
|
-
accountId: accountInfo.accountId
|
|
2697
|
-
});
|
|
2698
|
-
const chunkMode = resolveChunkMode(cfg, "discord", accountInfo.accountId);
|
|
2699
|
-
const textWithTables = convertMarkdownTables(text ?? "", tableMode);
|
|
2700
|
-
const { token, rest, request } = createDiscordClient(opts, cfg);
|
|
2701
|
-
const { channelId } = await resolveChannelId(rest, await parseAndResolveRecipient(to, opts.accountId), request);
|
|
2702
|
-
if (isForumLikeType(await resolveDiscordChannelType(rest, channelId))) {
|
|
2703
|
-
const threadName = deriveForumThreadName(textWithTables);
|
|
2704
|
-
const chunks = buildDiscordTextChunks(textWithTables, {
|
|
2705
|
-
maxLinesPerMessage: accountInfo.config.maxLinesPerMessage,
|
|
2706
|
-
chunkMode
|
|
2707
|
-
});
|
|
2708
|
-
const starterContent = chunks[0]?.trim() ? chunks[0] : threadName;
|
|
2709
|
-
const starterPayload = buildDiscordMessagePayload({
|
|
2710
|
-
text: starterContent,
|
|
2711
|
-
components: resolveDiscordSendComponents({
|
|
2712
|
-
components: opts.components,
|
|
2713
|
-
text: starterContent,
|
|
2714
|
-
isFirst: true
|
|
2715
|
-
}),
|
|
2716
|
-
embeds: resolveDiscordSendEmbeds({
|
|
2717
|
-
embeds: opts.embeds,
|
|
2718
|
-
isFirst: true
|
|
2719
|
-
}),
|
|
2720
|
-
flags: opts.silent ? 4096 : void 0
|
|
2721
|
-
});
|
|
2722
|
-
let threadRes;
|
|
2723
|
-
try {
|
|
2724
|
-
threadRes = await request(() => rest.post(Routes.threads(channelId), { body: {
|
|
2725
|
-
name: threadName,
|
|
2726
|
-
message: stripUndefinedFields(serializePayload(starterPayload))
|
|
2727
|
-
} }), "forum-thread");
|
|
2728
|
-
} catch (err) {
|
|
2729
|
-
throw await buildDiscordSendError(err, {
|
|
2730
|
-
channelId,
|
|
2731
|
-
rest,
|
|
2732
|
-
token,
|
|
2733
|
-
hasMedia: Boolean(opts.mediaUrl)
|
|
2734
|
-
});
|
|
2735
|
-
}
|
|
2736
|
-
const threadId = threadRes.id;
|
|
2737
|
-
const messageId = threadRes.message?.id ?? threadId;
|
|
2738
|
-
const resultChannelId = threadRes.message?.channel_id ?? threadId;
|
|
2739
|
-
const remainingChunks = chunks.slice(1);
|
|
2740
|
-
try {
|
|
2741
|
-
if (opts.mediaUrl) {
|
|
2742
|
-
const [mediaCaption, ...afterMediaChunks] = remainingChunks;
|
|
2743
|
-
await sendDiscordMedia(rest, threadId, mediaCaption ?? "", opts.mediaUrl, opts.mediaLocalRoots, void 0, request, accountInfo.config.maxLinesPerMessage, void 0, void 0, chunkMode, opts.silent);
|
|
2744
|
-
await sendDiscordThreadTextChunks({
|
|
2745
|
-
rest,
|
|
2746
|
-
threadId,
|
|
2747
|
-
chunks: afterMediaChunks,
|
|
2748
|
-
request,
|
|
2749
|
-
maxLinesPerMessage: accountInfo.config.maxLinesPerMessage,
|
|
2750
|
-
chunkMode,
|
|
2751
|
-
silent: opts.silent
|
|
2752
|
-
});
|
|
2753
|
-
} else await sendDiscordThreadTextChunks({
|
|
2754
|
-
rest,
|
|
2755
|
-
threadId,
|
|
2756
|
-
chunks: remainingChunks,
|
|
2757
|
-
request,
|
|
2758
|
-
maxLinesPerMessage: accountInfo.config.maxLinesPerMessage,
|
|
2759
|
-
chunkMode,
|
|
2760
|
-
silent: opts.silent
|
|
2761
|
-
});
|
|
2762
|
-
} catch (err) {
|
|
2763
|
-
throw await buildDiscordSendError(err, {
|
|
2764
|
-
channelId: threadId,
|
|
2765
|
-
rest,
|
|
2766
|
-
token,
|
|
2767
|
-
hasMedia: Boolean(opts.mediaUrl)
|
|
2768
|
-
});
|
|
2769
|
-
}
|
|
2770
|
-
recordChannelActivity({
|
|
2771
|
-
channel: "discord",
|
|
2772
|
-
accountId: accountInfo.accountId,
|
|
2773
|
-
direction: "outbound"
|
|
2774
|
-
});
|
|
2775
|
-
return toDiscordSendResult({
|
|
2776
|
-
id: messageId,
|
|
2777
|
-
channel_id: resultChannelId
|
|
2778
|
-
}, channelId);
|
|
2779
|
-
}
|
|
2780
|
-
let result;
|
|
2781
|
-
try {
|
|
2782
|
-
if (opts.mediaUrl) result = await sendDiscordMedia(rest, channelId, textWithTables, opts.mediaUrl, opts.mediaLocalRoots, opts.replyTo, request, accountInfo.config.maxLinesPerMessage, opts.components, opts.embeds, chunkMode, opts.silent);
|
|
2783
|
-
else result = await sendDiscordText(rest, channelId, textWithTables, opts.replyTo, request, accountInfo.config.maxLinesPerMessage, opts.components, opts.embeds, chunkMode, opts.silent);
|
|
2784
|
-
} catch (err) {
|
|
2785
|
-
throw await buildDiscordSendError(err, {
|
|
2786
|
-
channelId,
|
|
2787
|
-
rest,
|
|
2788
|
-
token,
|
|
2789
|
-
hasMedia: Boolean(opts.mediaUrl)
|
|
2790
|
-
});
|
|
2791
|
-
}
|
|
2792
|
-
recordChannelActivity({
|
|
2793
|
-
channel: "discord",
|
|
2794
|
-
accountId: accountInfo.accountId,
|
|
2795
|
-
direction: "outbound"
|
|
2796
|
-
});
|
|
2797
|
-
return toDiscordSendResult(result, channelId);
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
//#endregion
|
|
2801
|
-
//#region src/discord/components-registry.ts
|
|
2802
|
-
const DEFAULT_COMPONENT_TTL_MS = 1800 * 1e3;
|
|
2803
|
-
|
|
2804
|
-
//#endregion
|
|
2805
|
-
//#region src/discord/send.components.ts
|
|
2806
|
-
const DISCORD_FORUM_LIKE_TYPES = new Set([ChannelType.GuildForum, ChannelType.GuildMedia]);
|
|
2807
|
-
|
|
2808
|
-
//#endregion
|
|
2809
|
-
//#region src/infra/restart.ts
|
|
2810
|
-
const restartLog = createSubsystemLogger("restart");
|
|
2811
|
-
|
|
2812
|
-
//#endregion
|
|
2813
|
-
//#region src/auto-reply/reply/elevated-allowlist-matcher.ts
|
|
2814
|
-
const SENDER_PREFIXES = [
|
|
2815
|
-
...CHAT_CHANNEL_ORDER,
|
|
2816
|
-
INTERNAL_MESSAGE_CHANNEL,
|
|
2817
|
-
"user",
|
|
2818
|
-
"group",
|
|
2819
|
-
"channel"
|
|
2820
|
-
];
|
|
2821
|
-
const SENDER_PREFIX_RE = new RegExp(`^(${SENDER_PREFIXES.join("|")}):`, "i");
|
|
2822
|
-
|
|
2823
|
-
//#endregion
|
|
2824
|
-
//#region src/auth/env-injection.ts
|
|
2825
|
-
const log$3 = createSubsystemLogger("auth-env");
|
|
2826
|
-
|
|
2827
|
-
//#endregion
|
|
2828
|
-
//#region src/middleware/auth-key-retry.ts
|
|
2829
|
-
const log$2 = createSubsystemLogger("auth-retry");
|
|
2830
|
-
|
|
2831
|
-
//#endregion
|
|
2832
|
-
//#region src/infra/session-maintenance-warning.ts
|
|
2833
|
-
const log$1 = createSubsystemLogger("session-maintenance-warning");
|
|
2834
|
-
|
|
2835
|
-
//#endregion
|
|
2836
|
-
//#region src/auto-reply/reply/session.ts
|
|
2837
|
-
const log = createSubsystemLogger("session-init");
|
|
2838
|
-
|
|
2839
|
-
//#endregion
|
|
2840
|
-
//#region src/logging/redact-identifier.ts
|
|
2841
|
-
function sha256HexPrefix(value, len = 12) {
|
|
2842
|
-
const safeLen = Number.isFinite(len) ? Math.max(1, Math.floor(len)) : 12;
|
|
2843
|
-
return crypto.createHash("sha256").update(value).digest("hex").slice(0, safeLen);
|
|
2844
|
-
}
|
|
2845
|
-
function redactIdentifier(value, opts) {
|
|
2846
|
-
const trimmed = value?.trim();
|
|
2847
|
-
if (!trimmed) return "-";
|
|
2848
|
-
return `sha256:${sha256HexPrefix(trimmed, opts?.len ?? 12)}`;
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
//#endregion
|
|
2852
|
-
//#region src/markdown/whatsapp.ts
|
|
2853
|
-
/**
|
|
2854
|
-
* Convert standard Markdown formatting to WhatsApp-compatible markup.
|
|
2855
|
-
*
|
|
2856
|
-
* WhatsApp uses its own formatting syntax:
|
|
2857
|
-
* bold: *text*
|
|
2858
|
-
* italic: _text_
|
|
2859
|
-
* strikethrough: ~text~
|
|
2860
|
-
* monospace: ```text```
|
|
2861
|
-
*
|
|
2862
|
-
* Standard Markdown uses:
|
|
2863
|
-
* bold: **text** or __text__
|
|
2864
|
-
* italic: *text* or _text_
|
|
2865
|
-
* strikethrough: ~~text~~
|
|
2866
|
-
* code: `text` (inline) or ```text``` (block)
|
|
2867
|
-
*
|
|
2868
|
-
* The conversion preserves fenced code blocks and inline code,
|
|
2869
|
-
* then converts bold and strikethrough markers.
|
|
2870
|
-
*/
|
|
2871
|
-
/** Placeholder tokens used during conversion to protect code spans. */
|
|
2872
|
-
const FENCE_PLACEHOLDER = "\0FENCE";
|
|
2873
|
-
const INLINE_CODE_PLACEHOLDER = "\0CODE";
|
|
2874
|
-
/**
|
|
2875
|
-
* Convert standard Markdown bold/italic/strikethrough to WhatsApp formatting.
|
|
2876
|
-
*
|
|
2877
|
-
* Order of operations matters:
|
|
2878
|
-
* 1. Protect fenced code blocks (```...```) — already WhatsApp-compatible
|
|
2879
|
-
* 2. Protect inline code (`...`) — leave as-is
|
|
2880
|
-
* 3. Convert **bold** → *bold* and __bold__ → *bold*
|
|
2881
|
-
* 4. Convert ~~strike~~ → ~strike~
|
|
2882
|
-
* 5. Restore protected spans
|
|
2883
|
-
*
|
|
2884
|
-
* Italic *text* and _text_ are left alone since WhatsApp uses _text_ for italic
|
|
2885
|
-
* and single * is already WhatsApp bold — no conversion needed for single markers.
|
|
2886
|
-
*/
|
|
2887
|
-
function markdownToWhatsApp(text) {
|
|
2888
|
-
if (!text) return text;
|
|
2889
|
-
const fences = [];
|
|
2890
|
-
let result = text.replace(/```[\s\S]*?```/g, (match) => {
|
|
2891
|
-
fences.push(match);
|
|
2892
|
-
return `${FENCE_PLACEHOLDER}${fences.length - 1}`;
|
|
2893
|
-
});
|
|
2894
|
-
const inlineCodes = [];
|
|
2895
|
-
result = result.replace(/`[^`\n]+`/g, (match) => {
|
|
2896
|
-
inlineCodes.push(match);
|
|
2897
|
-
return `${INLINE_CODE_PLACEHOLDER}${inlineCodes.length - 1}`;
|
|
2898
|
-
});
|
|
2899
|
-
result = result.replace(/\*\*(.+?)\*\*/g, "*$1*");
|
|
2900
|
-
result = result.replace(/__(.+?)__/g, "*$1*");
|
|
2901
|
-
result = result.replace(/~~(.+?)~~/g, "~$1~");
|
|
2902
|
-
result = result.replace(new RegExp(`${escapeRegExp(INLINE_CODE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => inlineCodes[Number(idx)] ?? "");
|
|
2903
|
-
result = result.replace(new RegExp(`${escapeRegExp(FENCE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => fences[Number(idx)] ?? "");
|
|
2904
|
-
return result;
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
//#endregion
|
|
2908
|
-
//#region src/web/active-listener.ts
|
|
2909
|
-
const listeners = /* @__PURE__ */ new Map();
|
|
2910
|
-
function resolveWebAccountId(accountId) {
|
|
2911
|
-
return (accountId ?? "").trim() || DEFAULT_ACCOUNT_ID;
|
|
2912
|
-
}
|
|
2913
|
-
function requireActiveWebListener(accountId) {
|
|
2914
|
-
const id = resolveWebAccountId(accountId);
|
|
2915
|
-
const listener = listeners.get(id) ?? null;
|
|
2916
|
-
if (!listener) throw new Error(`No active WhatsApp Web listener (account: ${id}). Start the gateway, then link WhatsApp with: ${formatCliCommand(`remoteclaw channels login --channel whatsapp --account ${id}`)}.`);
|
|
2917
|
-
return {
|
|
2918
|
-
accountId: id,
|
|
2919
|
-
listener
|
|
2920
|
-
};
|
|
2921
|
-
}
|
|
2922
|
-
|
|
2923
|
-
//#endregion
|
|
2924
|
-
//#region src/web/outbound.ts
|
|
2925
|
-
const outboundLog = createSubsystemLogger("gateway/channels/whatsapp").child("outbound");
|
|
2926
|
-
async function sendMessageWhatsApp(to, body, options) {
|
|
2927
|
-
let text = body;
|
|
2928
|
-
const correlationId = generateSecureUuid();
|
|
2929
|
-
const startedAt = Date.now();
|
|
2930
|
-
const { listener: active, accountId: resolvedAccountId } = requireActiveWebListener(options.accountId);
|
|
2931
|
-
const tableMode = resolveMarkdownTableMode({
|
|
2932
|
-
cfg: loadConfig(),
|
|
2933
|
-
channel: "whatsapp",
|
|
2934
|
-
accountId: resolvedAccountId ?? options.accountId
|
|
2935
|
-
});
|
|
2936
|
-
text = convertMarkdownTables(text ?? "", tableMode);
|
|
2937
|
-
text = markdownToWhatsApp(text);
|
|
2938
|
-
const redactedTo = redactIdentifier(to);
|
|
2939
|
-
const logger = getChildLogger({
|
|
2940
|
-
module: "web-outbound",
|
|
2941
|
-
correlationId,
|
|
2942
|
-
to: redactedTo
|
|
2943
|
-
});
|
|
2944
|
-
try {
|
|
2945
|
-
const jid = toWhatsappJid(to);
|
|
2946
|
-
const redactedJid = redactIdentifier(jid);
|
|
2947
|
-
let mediaBuffer;
|
|
2948
|
-
let mediaType;
|
|
2949
|
-
let documentFileName;
|
|
2950
|
-
if (options.mediaUrl) {
|
|
2951
|
-
const media = await loadWebMedia(options.mediaUrl, { localRoots: options.mediaLocalRoots });
|
|
2952
|
-
const caption = text || void 0;
|
|
2953
|
-
mediaBuffer = media.buffer;
|
|
2954
|
-
mediaType = media.contentType;
|
|
2955
|
-
if (media.kind === "audio") mediaType = media.contentType === "audio/ogg" ? "audio/ogg; codecs=opus" : media.contentType ?? "application/octet-stream";
|
|
2956
|
-
else if (media.kind === "video") text = caption ?? "";
|
|
2957
|
-
else if (media.kind === "image") text = caption ?? "";
|
|
2958
|
-
else {
|
|
2959
|
-
text = caption ?? "";
|
|
2960
|
-
documentFileName = media.fileName;
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
outboundLog.info(`Sending message -> ${redactedJid}${options.mediaUrl ? " (media)" : ""}`);
|
|
2964
|
-
logger.info({
|
|
2965
|
-
jid: redactedJid,
|
|
2966
|
-
hasMedia: Boolean(options.mediaUrl)
|
|
2967
|
-
}, "sending message");
|
|
2968
|
-
await active.sendComposingTo(to);
|
|
2969
|
-
const accountId = Boolean(options.accountId?.trim()) ? resolvedAccountId : void 0;
|
|
2970
|
-
const sendOptions = options.gifPlayback || accountId || documentFileName ? {
|
|
2971
|
-
...options.gifPlayback ? { gifPlayback: true } : {},
|
|
2972
|
-
...documentFileName ? { fileName: documentFileName } : {},
|
|
2973
|
-
accountId
|
|
2974
|
-
} : void 0;
|
|
2975
|
-
const messageId = (sendOptions ? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions) : await active.sendMessage(to, text, mediaBuffer, mediaType))?.messageId ?? "unknown";
|
|
2976
|
-
const durationMs = Date.now() - startedAt;
|
|
2977
|
-
outboundLog.info(`Sent message ${messageId} -> ${redactedJid}${options.mediaUrl ? " (media)" : ""} (${durationMs}ms)`);
|
|
2978
|
-
logger.info({
|
|
2979
|
-
jid: redactedJid,
|
|
2980
|
-
messageId
|
|
2981
|
-
}, "sent message");
|
|
2982
|
-
return {
|
|
2983
|
-
messageId,
|
|
2984
|
-
toJid: jid
|
|
2985
|
-
};
|
|
2986
|
-
} catch (err) {
|
|
2987
|
-
logger.error({
|
|
2988
|
-
err: String(err),
|
|
2989
|
-
to: redactedTo,
|
|
2990
|
-
hasMedia: Boolean(options.mediaUrl)
|
|
2991
|
-
}, "failed to send via web session");
|
|
2992
|
-
throw err;
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
|
|
2996
|
-
//#endregion
|
|
2997
|
-
//#region src/web/session.ts
|
|
2998
|
-
let credsSaveQueue = Promise.resolve();
|
|
2999
|
-
|
|
3000
|
-
//#endregion
|
|
3001
|
-
//#region src/web/auto-reply/loggers.ts
|
|
3002
|
-
const whatsappLog = createSubsystemLogger("gateway/channels/whatsapp");
|
|
3003
|
-
const whatsappInboundLog = whatsappLog.child("inbound");
|
|
3004
|
-
const whatsappOutboundLog = whatsappLog.child("outbound");
|
|
3005
|
-
const whatsappHeartbeatLog = whatsappLog.child("heartbeat");
|
|
3006
|
-
|
|
3007
|
-
//#endregion
|
|
3008
|
-
//#region src/infra/map-size.ts
|
|
3009
|
-
function pruneMapToMaxSize(map, maxSize) {
|
|
3010
|
-
const limit = Math.max(0, Math.floor(maxSize));
|
|
3011
|
-
if (limit <= 0) {
|
|
3012
|
-
map.clear();
|
|
3013
|
-
return;
|
|
3014
|
-
}
|
|
3015
|
-
while (map.size > limit) {
|
|
3016
|
-
const oldest = map.keys().next();
|
|
3017
|
-
if (oldest.done) break;
|
|
3018
|
-
map.delete(oldest.value);
|
|
3019
|
-
}
|
|
3020
|
-
}
|
|
3021
|
-
|
|
3022
|
-
//#endregion
|
|
3023
|
-
//#region src/infra/dedupe.ts
|
|
3024
|
-
function createDedupeCache(options) {
|
|
3025
|
-
const ttlMs = Math.max(0, options.ttlMs);
|
|
3026
|
-
const maxSize = Math.max(0, Math.floor(options.maxSize));
|
|
3027
|
-
const cache = /* @__PURE__ */ new Map();
|
|
3028
|
-
const touch = (key, now) => {
|
|
3029
|
-
cache.delete(key);
|
|
3030
|
-
cache.set(key, now);
|
|
3031
|
-
};
|
|
3032
|
-
const prune = (now) => {
|
|
3033
|
-
const cutoff = ttlMs > 0 ? now - ttlMs : void 0;
|
|
3034
|
-
if (cutoff !== void 0) {
|
|
3035
|
-
for (const [entryKey, entryTs] of cache) if (entryTs < cutoff) cache.delete(entryKey);
|
|
3036
|
-
}
|
|
3037
|
-
if (maxSize <= 0) {
|
|
3038
|
-
cache.clear();
|
|
3039
|
-
return;
|
|
3040
|
-
}
|
|
3041
|
-
pruneMapToMaxSize(cache, maxSize);
|
|
3042
|
-
};
|
|
3043
|
-
const hasUnexpired = (key, now, touchOnRead) => {
|
|
3044
|
-
const existing = cache.get(key);
|
|
3045
|
-
if (existing === void 0) return false;
|
|
3046
|
-
if (ttlMs > 0 && now - existing >= ttlMs) {
|
|
3047
|
-
cache.delete(key);
|
|
3048
|
-
return false;
|
|
3049
|
-
}
|
|
3050
|
-
if (touchOnRead) touch(key, now);
|
|
3051
|
-
return true;
|
|
3052
|
-
};
|
|
3053
|
-
return {
|
|
3054
|
-
check: (key, now = Date.now()) => {
|
|
3055
|
-
if (!key) return false;
|
|
3056
|
-
if (hasUnexpired(key, now, true)) return true;
|
|
3057
|
-
touch(key, now);
|
|
3058
|
-
prune(now);
|
|
3059
|
-
return false;
|
|
3060
|
-
},
|
|
3061
|
-
peek: (key, now = Date.now()) => {
|
|
3062
|
-
if (!key) return false;
|
|
3063
|
-
return hasUnexpired(key, now, false);
|
|
3064
|
-
},
|
|
3065
|
-
clear: () => {
|
|
3066
|
-
cache.clear();
|
|
3067
|
-
},
|
|
3068
|
-
size: () => cache.size
|
|
3069
|
-
};
|
|
3070
|
-
}
|
|
3071
|
-
|
|
3072
|
-
//#endregion
|
|
3073
|
-
//#region src/web/inbound/dedupe.ts
|
|
3074
|
-
const recentInboundMessages = createDedupeCache({
|
|
3075
|
-
ttlMs: 20 * 6e4,
|
|
3076
|
-
maxSize: 5e3
|
|
3077
|
-
});
|
|
3078
|
-
|
|
3079
|
-
//#endregion
|
|
3080
|
-
//#region src/auto-reply/reply/inbound-dedupe.ts
|
|
3081
|
-
const inboundDedupeCache = createDedupeCache({
|
|
3082
|
-
ttlMs: 20 * 6e4,
|
|
3083
|
-
maxSize: 5e3
|
|
3084
|
-
});
|
|
3085
|
-
|
|
3086
|
-
//#endregion
|
|
3087
|
-
export { DiscordSendError as n, fetchChannelPermissionsDiscord as r, sendMessageWhatsApp, sendMessageDiscord as t };
|