vora-ai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +606 -0
- package/assets/avatar-placeholder.svg +19 -0
- package/assets/chrome-extension/icons/icon128.png +0 -0
- package/assets/chrome-extension/icons/icon16.png +0 -0
- package/assets/chrome-extension/icons/icon32.png +0 -0
- package/assets/chrome-extension/icons/icon48.png +0 -0
- package/assets/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/dist/abort-bAEt3OX0.js +192 -0
- package/dist/abort-cutoff-BW9X8atp.js +56 -0
- package/dist/abort-cutoff.runtime-BTdcverG.js +20 -0
- package/dist/abort-primitives-BkLaStf6.js +92 -0
- package/dist/abort-signal-OQ0B1Hsw.js +13 -0
- package/dist/abort.runtime-Bk-WTrsH.js +2 -0
- package/dist/access-DUWbTdtq.js +82 -0
- package/dist/account-action-gate-BhV8CpjB.js +12 -0
- package/dist/account-core-BxpV-R9y.js +26 -0
- package/dist/account-helpers-D1v4-R4z.js +102 -0
- package/dist/account-helpers-DsRxse98.js +1 -0
- package/dist/account-id-Da7aL0Gd.js +1 -0
- package/dist/account-inspect-CAOMlXxX.js +158 -0
- package/dist/account-inspect-sHk3NdqU.js +81 -0
- package/dist/account-lookup-C6jbidQL.js +17 -0
- package/dist/account-resolution-DKAWqmga.js +30 -0
- package/dist/account-snapshot-fields-D7AI5hQQ.js +130 -0
- package/dist/account-summary-BgeGcB_3.js +36 -0
- package/dist/accounts-Db4FI6Zz.js +58 -0
- package/dist/accounts-qrnlKu1q.js +137 -0
- package/dist/ack-reactions-BZ-o06GS.js +43 -0
- package/dist/acp-cli-BvaZntRI.js +88 -0
- package/dist/acp-runtime-JWaJYUhz.js +8 -0
- package/dist/acp-stateful-target-driver-Bw7044NV.js +60 -0
- package/dist/action-runtime-api-Oe9YXMPW.js +1026 -0
- package/dist/agent-B1rpctfA.js +2 -0
- package/dist/agent-command-Ca6TUUTc.js +1462 -0
- package/dist/agent-events-DvBJWaR9.js +51 -0
- package/dist/agent-list-BLH_azHg.js +52 -0
- package/dist/agent-media-payload-DJHM1u8B.js +17 -0
- package/dist/agent-paths-A_P9FLsb.js +12 -0
- package/dist/agent-runner-utils-9OoCJtjv.js +178 -0
- package/dist/agent-runner.runtime-CBOjZZGX.js +2205 -0
- package/dist/agent-runtime-DUidz-g-.js +142 -0
- package/dist/agent-scope-BsqFyt8u.js +203 -0
- package/dist/agents/auth-profiles.runtime.js +7 -0
- package/dist/agents/pi-model-discovery-runtime.js +2 -0
- package/dist/agents-BalJcJ6y.js +5 -0
- package/dist/agents-C3mHfRHd.js +888 -0
- package/dist/agents.config-BDTgYzjf.js +3 -0
- package/dist/agents.config-CD4kuH-_.js +121 -0
- package/dist/allow-from-Bj0HDNYh.js +20 -0
- package/dist/allow-from-D-rvXQ8h.js +9 -0
- package/dist/allow-from-xOap1t02.js +62 -0
- package/dist/allow-list-BFJp0pl8.js +341 -0
- package/dist/allowlist-config-edit-Cm1yBM1Z.js +279 -0
- package/dist/allowlist-match-CvP7M2nU.js +63 -0
- package/dist/ansi-B_0KjIJj.js +54 -0
- package/dist/anthropic-vertex-CmYuMVC4.js +21 -0
- package/dist/anthropic-vertex-stream-CDum4sTM.js +631 -0
- package/dist/api-C8PGNlY8.js +10 -0
- package/dist/api-CUkBKFva.js +74 -0
- package/dist/api-builder-Dxtk0Cjs.js +172 -0
- package/dist/api-fetch-D1Orij33.js +35 -0
- package/dist/api-key-rotation-BgD2ZwFB.js +150 -0
- package/dist/apply-uNQmdYrd.js +485 -0
- package/dist/apply.runtime-CDBPl8wO.js +166 -0
- package/dist/apply.runtime-DXzYQs7u.js +2 -0
- package/dist/approval-renderers-D-qQquHC.js +83 -0
- package/dist/approval-runtime-DodHpuxq.js +122 -0
- package/dist/archive-BUHAoH49.js +537 -0
- package/dist/arg-split-ShoVtQWt.js +38 -0
- package/dist/artifacts-UsJTFgjT.js +52 -0
- package/dist/assistant-error-format-KDZ_osDM.js +109 -0
- package/dist/audio-DFt2UJ9l.js +41 -0
- package/dist/audit-234llk_L.js +85 -0
- package/dist/audit-BzzkNrPw.js +893 -0
- package/dist/audit-D8ikC9Ex.js +54 -0
- package/dist/audit-channel.allow-from.runtime-todwwiYs.js +5 -0
- package/dist/audit-channel.collect.runtime-DmpUSGTW.js +528 -0
- package/dist/audit-channel.discord.runtime-eztVMsVi.js +5 -0
- package/dist/audit-channel.telegram.runtime-C1XTQaXt.js +8 -0
- package/dist/audit-channel.zalouser.runtime-0HM10car.js +5 -0
- package/dist/audit-extra.async-CSQaJlTH.js +820 -0
- package/dist/audit-fs-ClsvRCTg.js +375 -0
- package/dist/audit-membership-runtime-ByM59rIs.js +55 -0
- package/dist/audit.deep.runtime-DXGK_1J_.js +2 -0
- package/dist/audit.nondeep.runtime-DJXN9aBX.js +831 -0
- package/dist/audit.runtime-BS7_g95e.js +7 -0
- package/dist/auth-DEuZoVpN.js +371 -0
- package/dist/auth-choice-9Go6Q-oV.js +3 -0
- package/dist/auth-choice-BQBEikSW.js +69 -0
- package/dist/auth-choice-CbU_5K03.js +341 -0
- package/dist/auth-choice-legacy-D9rcQsLS.js +44 -0
- package/dist/auth-choice-options-DzvdP-W5.js +98 -0
- package/dist/auth-choice-prompt-CAt3z9Wn.js +2 -0
- package/dist/auth-choice-prompt-DfuSZB7t.js +36 -0
- package/dist/auth-choice.apply-helpers-CxPMo6aR.js +2 -0
- package/dist/auth-choice.plugin-providers.runtime-C4iPKNWh.js +11 -0
- package/dist/auth-health-CztAfAX3.js +165 -0
- package/dist/auth-mode-policy-C2dpPPMZ.js +18 -0
- package/dist/auth-profiles-DgsNxC4M.js +431 -0
- package/dist/auth-rate-limit-B3HOQz3U.js +119 -0
- package/dist/avatar-policy-D_F2Olbt.js +67 -0
- package/dist/backend-config-DRYC_KQP.js +311 -0
- package/dist/backoff-C-fId8Y0.js +18 -0
- package/dist/backup-create-CWffgs90.js +462 -0
- package/dist/banner-BJJQ_jor.js +2 -0
- package/dist/banner-CzYuF1AM.js +369 -0
- package/dist/base-session-key-yPDY2ReX.js +14 -0
- package/dist/binaries-D04aDwRb.js +2 -0
- package/dist/binaries-UyZ8gKvx.js +11 -0
- package/dist/binding-registry-DeW6GWl7.js +422 -0
- package/dist/binding-targets-Dew-Cmhe.js +99 -0
- package/dist/bindings-Be6kpbqd.js +21 -0
- package/dist/bindings-C415Adm_.js +69 -0
- package/dist/block-reply-pipeline-DOyiLrmk.js +266 -0
- package/dist/block-streaming-irtDjCPX.js +107 -0
- package/dist/bluebubbles-cpaV8DUH.js +64 -0
- package/dist/bluebubbles-policy-DO-t7OnD.js +13 -0
- package/dist/boolean-BRxEL2pT.js +29 -0
- package/dist/boolean-param-B3tzmZ3k.js +13 -0
- package/dist/bootstrap-budget-lNGYv_xu.js +314 -0
- package/dist/bootstrap-cache-CwL_mvEY.js +19 -0
- package/dist/bot-message-context-BDfCxJZs.js +1213 -0
- package/dist/bot-message-context-C-8RvNrP.js +2 -0
- package/dist/bot-native-commands.delivery.runtime-z0viWrSs.js +3 -0
- package/dist/boundary-file-read-DzY137L0.js +192 -0
- package/dist/brave-web-search-provider-Bab38BrX.js +441 -0
- package/dist/brew-CTkvvpxg.js +44 -0
- package/dist/browser-open-BU6ETbQQ.js +94 -0
- package/dist/browser-runtime-C9uxHbGW.js +76 -0
- package/dist/browser-support-Bb_k0jpF.js +34 -0
- package/dist/btw-command-NOqYNWtX.js +16 -0
- package/dist/bundle-lsp-BeRKY2JZ.js +93 -0
- package/dist/bundle-mcp-Bx8MNFO5.js +263 -0
- package/dist/bundled/boot-md/handler.js +180 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +42 -0
- package/dist/bundled/command-logger/handler.js +56 -0
- package/dist/bundled/session-memory/handler.js +196 -0
- package/dist/bundled-capability-metadata-BJSb_HDr.js +38 -0
- package/dist/bundled-compat-CAM7KkKK.js +64 -0
- package/dist/bundled-plugin-metadata-DuQVm9f5.js +621 -0
- package/dist/bundled-sources-cwLmVfLO.js +53 -0
- package/dist/cache-controls-CpBpLE7o.js +40 -0
- package/dist/call-CYGZtInt.js +649 -0
- package/dist/call-DNl9zM74.js +2 -0
- package/dist/capability-provider-runtime-yc24eaUD.js +40 -0
- package/dist/catalog-CTTRbG9P.js +272 -0
- package/dist/channel-Ur_UNzw2.js +679 -0
- package/dist/channel-account-context-BWgKFgVH.js +104 -0
- package/dist/channel-actions-BOFC-_zU.js +39 -0
- package/dist/channel-catalog.json +26 -0
- package/dist/channel-config-B-7hYcg1.js +115 -0
- package/dist/channel-config-helpers-C1S4WfJJ.js +482 -0
- package/dist/channel-config-schema-2huPMu2x.js +6 -0
- package/dist/channel-feedback-Ro-BTZzh.js +257 -0
- package/dist/channel-inbound-_DJyFgZs.js +30 -0
- package/dist/channel-issues-BPmcKiOr.js +13 -0
- package/dist/channel-lifecycle-tykcw1CK.js +286 -0
- package/dist/channel-lifecycle.core-3OcmXTam.js +69 -0
- package/dist/channel-options-DgOdpBj-.js +39 -0
- package/dist/channel-pairing-Dx7NU9a4.js +68 -0
- package/dist/channel-plugin-common-B7gWshwF.js +4 -0
- package/dist/channel-plugin-ids-DGJsaNeP.js +230 -0
- package/dist/channel-plugin-resolution-B3C2B0Xc.js +113 -0
- package/dist/channel-policy-BiAdlZRY.js +32 -0
- package/dist/channel-reply-pipeline-DZQu_Smr.js +16 -0
- package/dist/channel-resolution-BRpGejEv.js +57 -0
- package/dist/channel-runtime-B3OwaSIN.js +8 -0
- package/dist/channel-selection-CJiUKode.js +125 -0
- package/dist/channel-send-result-C4cfMY3q.js +40 -0
- package/dist/channel-setup-CVb_d9r3.js +51 -0
- package/dist/channel-status-is1j_O8T.js +2 -0
- package/dist/channel-summary-CcHbPriu.js +2 -0
- package/dist/channel-summary-ChMRan7Y.js +139 -0
- package/dist/channel-target-B2-JZuxb.js +157 -0
- package/dist/channel-targets-C7I-yneV.js +173 -0
- package/dist/channel.runtime-DPqGWQMI.js +5 -0
- package/dist/channels-BLrLpPbs.js +1134 -0
- package/dist/channels-ClZdlIAP.js +409 -0
- package/dist/channels-cli-CxyDo24U.js +246 -0
- package/dist/channels-status-issues-DOvoiysl.js +17 -0
- package/dist/chat-envelope-BKa8gVwt.js +158 -0
- package/dist/chat-meta-CxxUMjgT.js +77 -0
- package/dist/chat-type-D66QkgK0.js +10 -0
- package/dist/chunk-BRNunu6m.js +334 -0
- package/dist/chunk-DBEY4PJZ.js +16 -0
- package/dist/chutes-oauth-df1s-ETh.js +127 -0
- package/dist/cjk-chars-nOH-kRF8.js +50 -0
- package/dist/clack-prompter-ByYhQnEc.js +112 -0
- package/dist/clawbot-cli-B1PP3cQS.js +9 -0
- package/dist/clawhub-BlNkstQC.js +163 -0
- package/dist/clawhub-PHPunBYA.js +263 -0
- package/dist/cli/daemon-cli.js +3 -0
- package/dist/cli-BVs9q78-.js +2 -0
- package/dist/cli-backend-BY5ACL_R.js +1 -0
- package/dist/cli-backend-MiCoOt1Y.js +44 -0
- package/dist/cli-eS9_49Ka.js +153 -0
- package/dist/cli-name-l1qeysOp.js +21 -0
- package/dist/cli-runner-rgKmST01.js +1010 -0
- package/dist/cli-utils-CMfpS8SF.js +40 -0
- package/dist/cli-watchdog-defaults-3Qs4l3Yf.js +14 -0
- package/dist/cmd-argv-BafMhhA4.js +68 -0
- package/dist/codex-native-web-search-CWYqRu9M.js +2 -0
- package/dist/codex-native-web-search-CbRntg-q.js +155 -0
- package/dist/command-auth-CJsP4GL7.js +64 -0
- package/dist/command-auth-Dfgmp_6_.js +356 -0
- package/dist/command-auth-native-CdgZoflY.js +3 -0
- package/dist/command-detection-CyrUVnod.js +46 -0
- package/dist/command-format-CfBy_-A6.js +2 -0
- package/dist/command-format-DmvS76BD.js +22 -0
- package/dist/command-gating-HO-bVa6h.js +40 -0
- package/dist/command-options-BUoAEXAi.js +25 -0
- package/dist/command-poll-backoff-BbGeC12t.js +56 -0
- package/dist/command-poll-backoff.runtime-BDcejg_n.js +7 -0
- package/dist/command-registry-C0kFYtIa.js +199 -0
- package/dist/command-registry-VUV6Y6SA.js +3 -0
- package/dist/command-secret-gateway-B2PsoqGE.js +2 -0
- package/dist/command-secret-gateway-rXrG4_xf.js +449 -0
- package/dist/command-secret-targets-BMcCyKKM.js +85 -0
- package/dist/command-secret-targets-DYLJqbik.js +2 -0
- package/dist/commands/status.summary.runtime.js +146 -0
- package/dist/commands-BNN8qnEq.js +42 -0
- package/dist/commands-D905e2TE.js +4 -0
- package/dist/commands-acp-DxpRaS_2.js +994 -0
- package/dist/commands-context-DYfg86cW.js +33 -0
- package/dist/commands-core-BkTgFXRe.js +185 -0
- package/dist/commands-core.runtime-DL4UA7LO.js +2 -0
- package/dist/commands-handlers.runtime-Dnqn4WRI.js +3597 -0
- package/dist/commands-info-9qXzZJZy.js +638 -0
- package/dist/commands-models-DaGXLYpI.js +395 -0
- package/dist/commands-rHJt1A27.js +192 -0
- package/dist/commands-registry-DsvlObRs.js +295 -0
- package/dist/commands-registry.data-D4mfAJVD.js +928 -0
- package/dist/commands-registry.runtime-CvK5vfUk.js +2 -0
- package/dist/commands-status.runtime-Biqry_fJ.js +2 -0
- package/dist/commands.runtime-BQNIS1_C.js +4 -0
- package/dist/common-B8KXadTs.js +206 -0
- package/dist/compact.runtime-DrIYPOe_.js +7 -0
- package/dist/completion-cli-DADmFZNY.js +2 -0
- package/dist/completion-cli-Xpp8XJNt.js +466 -0
- package/dist/config-B8J_0cJd.js +41 -0
- package/dist/config-BeMghpRW.js +136 -0
- package/dist/config-C6sbf2mt.js +7 -0
- package/dist/config-CKbWnj3S.js +52 -0
- package/dist/config-DUHgkJzn.js +421 -0
- package/dist/config-cli-CwphzfyS.js +944 -0
- package/dist/config-eval-DM9FHTGd.js +100 -0
- package/dist/config-guard-BQvfMpPf.js +94 -0
- package/dist/config-helpers-DiGV2z9-.js +117 -0
- package/dist/config-paths-h016qQJq.js +8 -0
- package/dist/config-presence-C16x_f3x.js +79 -0
- package/dist/config-regex-CvZFnWkO.js +39 -0
- package/dist/config-runtime-CGUisiU5.js +12 -0
- package/dist/config-schema-5JUAk8XL.js +202 -0
- package/dist/config-schema-BRTDDWFV.js +65 -0
- package/dist/config-schema-B_uHmf_j.js +133 -0
- package/dist/config-schema-dV8ghEVQ.js +85 -0
- package/dist/config-state-CiYvCzdZ.js +185 -0
- package/dist/config-validation-CzH2O_-H.js +276 -0
- package/dist/config-value-B0LE9l8u.js +25 -0
- package/dist/configure-BUZKW20U.js +1140 -0
- package/dist/configure-CFbHMkXc.js +2 -0
- package/dist/configured-provider-fallback-HW8QhjlX.js +15 -0
- package/dist/connection-auth-Cs3qTX0J.js +30 -0
- package/dist/connection-details-GqZVX1_1.js +56 -0
- package/dist/constants-lHqfjBOu.js +71 -0
- package/dist/content-blocks-DdN51R-1.js +1640 -0
- package/dist/context-Bv7BKF9l.js +227 -0
- package/dist/context-window-guard-BKQgasN7.js +46 -0
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/agents-sN8RQ1eS.js +813 -0
- package/dist/control-ui/assets/anthropic-ZDTkKd9P.js +37 -0
- package/dist/control-ui/assets/azure-openai-responses-CQjyuM35.js +2 -0
- package/dist/control-ui/assets/channel-config-extras-DNCeHtEf.js +2 -0
- package/dist/control-ui/assets/channels-LecGHhYY.js +349 -0
- package/dist/control-ui/assets/cron-BCSmuADd.js +928 -0
- package/dist/control-ui/assets/de-BhrN2Nih.js +2 -0
- package/dist/control-ui/assets/debug-DIDwUeSi.js +94 -0
- package/dist/control-ui/assets/directive-C6NBp6xJ.js +2 -0
- package/dist/control-ui/assets/dist-D8DZLmCF.js +18 -0
- package/dist/control-ui/assets/es-D2hTJirx.js +2 -0
- package/dist/control-ui/assets/event-stream-B8X6sYaV.js +2 -0
- package/dist/control-ui/assets/format-Cbj45nru.js +2 -0
- package/dist/control-ui/assets/github-copilot-headers-CrI0CIJ7.js +2 -0
- package/dist/control-ui/assets/google-gemini-cli-BpxbH95Q.js +3 -0
- package/dist/control-ui/assets/google-shared-CbPHVnPr.js +12 -0
- package/dist/control-ui/assets/google-vertex-lQwbjEII.js +2 -0
- package/dist/control-ui/assets/google-xtjMQAen.js +2 -0
- package/dist/control-ui/assets/hash-Bt1aVMQ3.js +2 -0
- package/dist/control-ui/assets/index-DqTClMaZ.js +4714 -0
- package/dist/control-ui/assets/index-yaW_F-Wi.css +1 -0
- package/dist/control-ui/assets/instances-CMgIM69b.js +57 -0
- package/dist/control-ui/assets/lit-zdTgzAJI.js +3 -0
- package/dist/control-ui/assets/logs-vVeVJ0CI.js +74 -0
- package/dist/control-ui/assets/mistral-u1o8NcCM.js +8 -0
- package/dist/control-ui/assets/nodes-B1R45Hyv.js +430 -0
- package/dist/control-ui/assets/openai-Cn7eGqwa.js +17 -0
- package/dist/control-ui/assets/openai-codex-responses-o0Z3RMWa.js +8 -0
- package/dist/control-ui/assets/openai-completions-7V2Ovprv.js +6 -0
- package/dist/control-ui/assets/openai-responses-oNxOx3Q1.js +2 -0
- package/dist/control-ui/assets/openai-responses-shared-OKpfrZ-q.js +11 -0
- package/dist/control-ui/assets/preload-helper-xBbMyY7u.js +1 -0
- package/dist/control-ui/assets/pt-BR-Bd9tFPER.js +2 -0
- package/dist/control-ui/assets/sessions-Lc0IvBNe.js +236 -0
- package/dist/control-ui/assets/skills-k1ptbgMP.js +216 -0
- package/dist/control-ui/assets/skills-shared-D4l2M8cL.js +11 -0
- package/dist/control-ui/assets/transform-messages-XKqwKV3D.js +2 -0
- package/dist/control-ui/assets/zh-CN-DvLwUwA1.js +2 -0
- package/dist/control-ui/assets/zh-TW-BXT7QT3h.js +2 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +22 -0
- package/dist/control-ui/index.html +75 -0
- package/dist/control-ui-assets-DbOOvjtb.js +233 -0
- package/dist/control-ui-shared-DsqkrmmN.js +29 -0
- package/dist/conversation-binding-input-BGI5gsf7.js +250 -0
- package/dist/conversation-binding-xxmmj56H.js +520 -0
- package/dist/conversation-id-B2-7oYz5.js +9 -0
- package/dist/conversation-label-CDBJEzqs.js +32 -0
- package/dist/conversation-runtime-CPXVzEGP.js +85 -0
- package/dist/core-DidBIGEJ.js +195 -0
- package/dist/core-api-VzeJYIaC.js +670 -0
- package/dist/core-command-descriptors-OO8iMaXR.js +91 -0
- package/dist/credential-planner-B6V18E6X.js +109 -0
- package/dist/credentials-T7b82ytT.js +135 -0
- package/dist/cron-cli-D2epg2QX.js +643 -0
- package/dist/current-time-AvIq1E3O.js +20 -0
- package/dist/daemon-cli-Be7LAwcB.js +368 -0
- package/dist/daemon-install-CfvYrNa-.js +63 -0
- package/dist/daemon-install-plan.shared-Dm6sK7Lg.js +222 -0
- package/dist/daemon-runtime-DPejcJWG.js +12 -0
- package/dist/dangerous-config-flags-DyYwhFd-.js +38 -0
- package/dist/dangerous-name-matching-DJGvHcqL.js +48 -0
- package/dist/date-time-ChwO2p0r.js +118 -0
- package/dist/dedupe-ClGH5AD-.js +59 -0
- package/dist/default-account-warnings-DhrBUOxe.js +15 -0
- package/dist/default-models-p_jLxv9h.js +35 -0
- package/dist/defaults-DAt--D9n.js +6 -0
- package/dist/delegate-D_a6-aW6.js +43 -0
- package/dist/deliver-NyzvqqW3.js +954 -0
- package/dist/deliver-YFpAT2Gv.js +3 -0
- package/dist/deliver-runtime-CDYmnxXC.js +2 -0
- package/dist/delivery-DHz1_gua.js +819 -0
- package/dist/delivery-context-wkeob4lC.js +106 -0
- package/dist/delivery-info-0NXZH054.js +36 -0
- package/dist/delivery-queue-BceSoMom.js +2 -0
- package/dist/delivery-queue-Dij4z9yQ.js +289 -0
- package/dist/deps-xJ6d5mcR.js +67 -0
- package/dist/detect-binary-D5oXUD9C.js +30 -0
- package/dist/device-auth-BPeQrfAM.js +19 -0
- package/dist/device-bootstrap-IW2esZhx.js +176 -0
- package/dist/device-identity-2GhXUC5d.js +2 -0
- package/dist/device-identity-DH-dBXN2.js +140 -0
- package/dist/device-metadata-normalization-DesKWnX9.js +21 -0
- package/dist/device-pairing-D-eXc4mS.js +543 -0
- package/dist/devices-cli-CUkbtT5k.js +328 -0
- package/dist/diagnostic-BYcJF51S.js +311 -0
- package/dist/diagnostic-events-R6R0hsS8.js +48 -0
- package/dist/diagnostic-flags-DI1-YJxA.js +64 -0
- package/dist/diagnostic-runtime-iwrls2oi.js +1 -0
- package/dist/diagnostics-Bn7WBAMb.js +2 -0
- package/dist/diagnostics-CNOhNbiG.js +33 -0
- package/dist/direct-dm-DX9Sqse3.js +139 -0
- package/dist/directive-handling.defaults-CiM3zY4c.js +19 -0
- package/dist/directive-handling.fast-lane-CBsRyqm9.js +64 -0
- package/dist/directive-handling.fast-lane-CkLifH7t.js +2 -0
- package/dist/directive-handling.impl-DDDo9_pC.js +2 -0
- package/dist/directive-handling.impl-Rcgo5SCg.js +674 -0
- package/dist/directive-handling.levels-Dlk68wUB.js +2 -0
- package/dist/directive-handling.levels-Y1fuvRYT.js +12 -0
- package/dist/directive-handling.parse-CMEE0kEW.js +375 -0
- package/dist/directive-handling.persist-CvEtXaAd.js +133 -0
- package/dist/directive-handling.persist.runtime-Cdksoe_I.js +2 -0
- package/dist/directive-handling.shared-8kteIv4q.js +158 -0
- package/dist/directive-tags-B4NiUGng.js +109 -0
- package/dist/directives-DLcHC9jG.js +209 -0
- package/dist/directory-cache-KFfoEzq3.js +62 -0
- package/dist/directory-cli-DUY3BGGz.js +238 -0
- package/dist/directory-config-helpers-DBmVJY3U.js +141 -0
- package/dist/directory-runtime-DWVDd3A5.js +20 -0
- package/dist/discord-2uEduGX9.js +6 -0
- package/dist/discord-BMCiYFK_.js +11 -0
- package/dist/discord-account-HmxkZycn.js +11 -0
- package/dist/discord-core-Pl5ukuXB.js +5 -0
- package/dist/discord-runtime-surface-DNQNbA29.js +67 -0
- package/dist/discord-session-key-DoaFTAH3.js +11 -0
- package/dist/discord-surface-Cn77ggmj.js +30 -0
- package/dist/discord-thread-bindings-DRMbWo4Q.js +21 -0
- package/dist/discord-timeouts-Cv7cpmLu.js +12 -0
- package/dist/dispatch-CZypQktI.js +842 -0
- package/dist/dispatch-acp.runtime-DVu2VG71.js +887 -0
- package/dist/dist-C22HbjJn.js +3 -0
- package/dist/dist-C26-w-eb.js +14245 -0
- package/dist/dist-_cqaGkQM.js +503 -0
- package/dist/dm-policy-shared-BsSmWpF_.js +188 -0
- package/dist/dns-cli-CypS3rSW.js +192 -0
- package/dist/docker-e3sy4uxj.js +837 -0
- package/dist/docs-cli-CAc6XPQ1.js +156 -0
- package/dist/doctor-completion-D1GX1eYy.js +90 -0
- package/dist/doctor-config-preflight-BIjpCYLH.js +2 -0
- package/dist/doctor-config-preflight-C5YWG1Il.js +147 -0
- package/dist/doctor-state-migrations-C4JRWbB5.js +2 -0
- package/dist/doctor-state-migrations-Hkw1WYQh.js +3 -0
- package/dist/dotenv-5B3Ltg5m.js +11 -0
- package/dist/dotenv-C-ipPVRV.js +91 -0
- package/dist/enable-1JBZrsl3.js +57 -0
- package/dist/entry-status-8GZhSwz9.js +172 -0
- package/dist/entry.js +209 -0
- package/dist/env-DAI7QbHD.js +40 -0
- package/dist/env-substitution-D4FvNwAw.js +136 -0
- package/dist/envelope-BT4nxsRe.js +137 -0
- package/dist/error-runtime-BWR3edBz.js +2 -0
- package/dist/error-text-Dz9S7qeJ.js +9 -0
- package/dist/errors-BVF4CQJh.js +15 -0
- package/dist/errors-BxyFnvP3.js +58 -0
- package/dist/exa-web-search-provider-YdwhKG_r.js +355 -0
- package/dist/exec-DBEtpL4G.js +2 -0
- package/dist/exec-DNTgEe82.js +375 -0
- package/dist/exec-approval-reply-CIaFux57.js +161 -0
- package/dist/exec-approval-session-target-BsD_thnK.js +159 -0
- package/dist/exec-approvals-D6Kd1FHX.js +120 -0
- package/dist/exec-approvals-XWl5Qihe.js +394 -0
- package/dist/exec-approvals-allowlist-B90zHMFx.js +771 -0
- package/dist/exec-approvals-cli-CBwEU5lx.js +375 -0
- package/dist/exec-safe-bin-runtime-policy-CQ_6FV8z.js +90 -0
- package/dist/exec-safety-FkFR1qf5.js +24 -0
- package/dist/extensionAPI.js +17 -0
- package/dist/extensions/brave/index.js +13 -0
- package/dist/extensions/brave/package.json +12 -0
- package/dist/extensions/brave/test-api.js +2 -0
- package/dist/extensions/brave/vora.plugin.json +50 -0
- package/dist/extensions/brave/web-search-provider.js +2 -0
- package/dist/extensions/browser/browser-runtime-api.js +4 -0
- package/dist/extensions/browser/index.js +20 -0
- package/dist/extensions/browser/package.json +12 -0
- package/dist/extensions/browser/runtime-api.js +6 -0
- package/dist/extensions/browser/test-support.js +19 -0
- package/dist/extensions/browser/vora.plugin.json +9 -0
- package/dist/extensions/discord/action-runtime-api.js +2 -0
- package/dist/extensions/discord/api.js +14 -0
- package/dist/extensions/discord/channel-config-api.js +2 -0
- package/dist/extensions/discord/index.js +615 -0
- package/dist/extensions/discord/package.json +40 -0
- package/dist/extensions/discord/runtime-api.js +229 -0
- package/dist/extensions/discord/session-key-api.js +2 -0
- package/dist/extensions/discord/setup-entry.js +10 -0
- package/dist/extensions/discord/test-api.js +45 -0
- package/dist/extensions/discord/timeouts.js +2 -0
- package/dist/extensions/discord/vora.plugin.json +11 -0
- package/dist/extensions/exa/index.js +13 -0
- package/dist/extensions/exa/package.json +12 -0
- package/dist/extensions/exa/vora.plugin.json +39 -0
- package/dist/extensions/exa/web-search-provider.js +2 -0
- package/dist/extensions/openai/api.js +4 -0
- package/dist/extensions/openai/cli-backend.js +2 -0
- package/dist/extensions/openai/default-models.js +2 -0
- package/dist/extensions/openai/image-generation-provider.js +2 -0
- package/dist/extensions/openai/index.js +24 -0
- package/dist/extensions/openai/media-understanding-provider.js +2 -0
- package/dist/extensions/openai/openai-codex-auth-identity.js +2 -0
- package/dist/extensions/openai/openai-codex-catalog.js +2 -0
- package/dist/extensions/openai/openai-codex-provider.js +2 -0
- package/dist/extensions/openai/openai-codex-provider.runtime.js +14 -0
- package/dist/extensions/openai/openai-provider.js +2 -0
- package/dist/extensions/openai/package.json +12 -0
- package/dist/extensions/openai/shared.js +4 -0
- package/dist/extensions/openai/speech-provider.js +2 -0
- package/dist/extensions/openai/test-api.js +5 -0
- package/dist/extensions/openai/tts.js +2 -0
- package/dist/extensions/openai/vora.plugin.json +61 -0
- package/dist/extensions/tavily/index.js +128 -0
- package/dist/extensions/tavily/package.json +12 -0
- package/dist/extensions/tavily/skills/tavily/SKILL.md +94 -0
- package/dist/extensions/tavily/vora.plugin.json +53 -0
- package/dist/extensions/tavily/web-search-provider.js +2 -0
- package/dist/extensions/telegram/allow-from.js +2 -0
- package/dist/extensions/telegram/api.js +13 -0
- package/dist/extensions/telegram/channel-config-api.js +2 -0
- package/dist/extensions/telegram/index.js +12 -0
- package/dist/extensions/telegram/package.json +37 -0
- package/dist/extensions/telegram/runtime-api.js +24 -0
- package/dist/extensions/telegram/session-key-api.js +2 -0
- package/dist/extensions/telegram/setup-entry.js +13 -0
- package/dist/extensions/telegram/test-api.js +87 -0
- package/dist/extensions/telegram/test-support.js +72 -0
- package/dist/extensions/telegram/update-offset-runtime-api.js +2 -0
- package/dist/extensions/telegram/vora.plugin.json +11 -0
- package/dist/external-content-CCU3ADB4.js +242 -0
- package/dist/facade-runtime-FE2gvW08.js +183 -0
- package/dist/failover-error-Bv6ZpTGn.js +194 -0
- package/dist/feishu-conversation-CRGPLs2e.js +17 -0
- package/dist/feishu-setup-D3qBPVeH.js +12 -0
- package/dist/fetch-B7l-vxJ5.js +65 -0
- package/dist/fetch-BlEbs4zu.js +416 -0
- package/dist/fetch-guard-DECxJSgV.js +132 -0
- package/dist/fetch-mock-Y15aY-vX.js +6 -0
- package/dist/fetch-runtime-DfJc8pAb.js +4 -0
- package/dist/fetch-timeout-DlhFJxaz.js +58 -0
- package/dist/file-identity-CFjEVvlD.js +567 -0
- package/dist/file-lock-I_Ef85iM.js +141 -0
- package/dist/file-lock-_Bv5Z0H8.js +2 -0
- package/dist/format-Cmirp0jV.js +19 -0
- package/dist/format-DTr5MrB3.js +787 -0
- package/dist/format-datetime-BzFsOTtu.js +73 -0
- package/dist/format-duration-3-yx54b_.js +57 -0
- package/dist/format-relative-CKRrUR_e.js +54 -0
- package/dist/frontmatter-7NzkXiTl.js +45 -0
- package/dist/frontmatter-BruYJzuJ.js +210 -0
- package/dist/fs-safe-C7Y0npoY.js +999 -0
- package/dist/gateway-cli-CL9kkVgP.js +25330 -0
- package/dist/gateway-discovery-targets-Nj88oSf4.js +430 -0
- package/dist/gateway-install-token-DT4JSzW6.js +231 -0
- package/dist/gateway-presence-C9FNv0wz.js +15 -0
- package/dist/gateway-registry-bOE6bwiW.js +74 -0
- package/dist/gateway-rpc-EUERnNbW.js +26 -0
- package/dist/gateway-runtime-DA85e49x.js +12 -0
- package/dist/gaxios-fetch-compat-TyJGVB6l.js +180 -0
- package/dist/gemini-auth-DU9RM3Fo.js +29 -0
- package/dist/get-reply-from-config.runtime-BTZAHGwc.js +2 -0
- package/dist/git-commit-B_DkJ7LE.js +177 -0
- package/dist/git-commit-Bx0Yma3I.js +2 -0
- package/dist/github-copilot-login-BiqEMA_7.js +11 -0
- package/dist/github-copilot-token-BMHm0urT.js +2 -0
- package/dist/github-copilot-token-CGpIsMSL.js +77 -0
- package/dist/global-singleton-54zT3rCn.js +13 -0
- package/dist/global-singleton-o2ArPCEw.js +1 -0
- package/dist/global-state-DUuMGgts.js +17 -0
- package/dist/globals-DNhziPZz.js +25 -0
- package/dist/gmail-setup-utils-B4xK25jT.js +421 -0
- package/dist/google-CPRZDTjq.js +24 -0
- package/dist/group-access-Cd6mU7Ys.js +113 -0
- package/dist/group-activation-BwfaA0gP.js +22 -0
- package/dist/group-id-vLZLwNVz.js +11 -0
- package/dist/group-policy-Cr7UXkoj.js +201 -0
- package/dist/group-policy-warnings-DmIDYgw8.js +196 -0
- package/dist/groups.runtime-DKOqtNQC.js +7 -0
- package/dist/handle-action-DsH0nVWk.js +500 -0
- package/dist/health-B3O0HygG.js +577 -0
- package/dist/health-CojrwX7m.js +2 -0
- package/dist/health-format-JFM9rFJB.js +26 -0
- package/dist/heartbeat-C1Xvupsk.js +122 -0
- package/dist/heartbeat-reply-payload-C-Rlp4k5.js +13 -0
- package/dist/heartbeat-summary-D5pDHsmN.js +57 -0
- package/dist/heartbeat-visibility-kNXllOIC.js +102 -0
- package/dist/heartbeat-wake-DfVExPSU.js +188 -0
- package/dist/help-CpuviX5S.js +81 -0
- package/dist/help-format-Dad85O74.js +15 -0
- package/dist/helpers-4IKdDZX5.js +24 -0
- package/dist/helpers-fNw5R_YT.js +32 -0
- package/dist/history-CK-v5j98.js +102 -0
- package/dist/home-dir-BXPtwSCY.js +83 -0
- package/dist/hook-runner-global-DEn0PCL0.js +602 -0
- package/dist/hook-runtime-Dn-Congb.js +3 -0
- package/dist/hooks-cli-DNKW70lO.js +353 -0
- package/dist/hooks-policy-Ad8y_Dfl.js +20 -0
- package/dist/hooks-status-Cb31D01g.js +86 -0
- package/dist/host-env-security-Cks-ZF3X.js +285 -0
- package/dist/hostname-BYGiBG2v.js +8 -0
- package/dist/http-body-DoRUn0Id.js +238 -0
- package/dist/http-registry-1oFXUjVZ.js +54 -0
- package/dist/http-route-overlap-CRbY2bBV.js +101 -0
- package/dist/identity-BBfQnFMg.js +29 -0
- package/dist/identity-BoQQh6Y8.js +26 -0
- package/dist/identity-D7VGm34b.js +84 -0
- package/dist/identity-avatar-CBJpFxtc.js +86 -0
- package/dist/identity-file-9bBicCze.js +60 -0
- package/dist/image-UFatuV93.js +152 -0
- package/dist/image-generation-CB1-VO0n.js +1 -0
- package/dist/image-generation-provider-CoHdiPC_.js +86 -0
- package/dist/image-ops-EABsGjsc.js +476 -0
- package/dist/image-runtime-ZZOiUbiY.js +7 -0
- package/dist/imessage-UUBzYSCn.js +19 -0
- package/dist/inbound-context-BxNfypB6.js +59 -0
- package/dist/inbound-context-DQ_fXNSa.js +38 -0
- package/dist/inbound-debounce-YEtyt_k_.js +159 -0
- package/dist/inbound-envelope-B6C8FhsE.js +61 -0
- package/dist/inbound-reply-dispatch-BP3sajLc.js +73 -0
- package/dist/inbound-text-DibnKFqn.js +14 -0
- package/dist/inbound.runtime-SCcR_etw.js +3 -0
- package/dist/includes-CHoL4g8x.js +188 -0
- package/dist/includes-scan-rcUlg6Nq.js +55 -0
- package/dist/index.js +56 -0
- package/dist/infra/warning-filter.js +2 -0
- package/dist/infra-runtime-D1S_mYfO.js +326 -0
- package/dist/input-files-BJKZz7LU.js +251 -0
- package/dist/input-provenance-DqtZ-oaB.js +44 -0
- package/dist/inspect-BdrrX2i3.js +282 -0
- package/dist/install-BwbpybtH.js +588 -0
- package/dist/install-package-dir-DhoPrQ04.js +284 -0
- package/dist/install-safe-path-BK_5xK2H.js +69 -0
- package/dist/install-security-scan-qS3b3qEq.js +22 -0
- package/dist/install-security-scan.runtime-BChyO9J8.js +166 -0
- package/dist/install-source-utils-BvLftGQS.js +167 -0
- package/dist/install-target-CTg66IIO.js +175 -0
- package/dist/install.runtime-BTSq91Fr.js +27 -0
- package/dist/install.runtime-D4V_unI1.js +11 -0
- package/dist/installs-CRoSOFIQ.js +28 -0
- package/dist/interactive-C3NpHdfG.js +8 -0
- package/dist/interactive-runtime-ihi8xJat.js +1 -0
- package/dist/internal-DBQug4hL.js +411 -0
- package/dist/internal-hooks-BbEvCG0I.js +155 -0
- package/dist/io-B07IaARR.js +20276 -0
- package/dist/io-CNajM2P9.js +4 -0
- package/dist/ip-B9fdE2gz.js +208 -0
- package/dist/ipv4-C3dcphoh.js +82 -0
- package/dist/irc-surface-76sLILVt.js +15 -0
- package/dist/is-main-Bv5ej4lF.js +27 -0
- package/dist/issue-format-BSF24W54.js +31 -0
- package/dist/issue-format-DOmwnG2e.js +2 -0
- package/dist/json-file-BWMSefn1.js +23 -0
- package/dist/json-files-BTzholfl.js +72 -0
- package/dist/json-mode-BSMgY7a9.js +34 -0
- package/dist/json-pointer-jqlJaexT.js +43 -0
- package/dist/json-store-BMjN0M0e.js +37 -0
- package/dist/keyed-async-queue-BThh1lNJ.js +32 -0
- package/dist/kill-tree-B6ozo-AE.js +82 -0
- package/dist/kill-tree-Cqktd2UA.js +2 -0
- package/dist/launchd-D65d45MJ.js +517 -0
- package/dist/lazy-runtime-CeSDvNOX.js +29 -0
- package/dist/lazy-service-module-BfNSCPnr.js +24 -0
- package/dist/legacy-names-alNfx9uv.js +7 -0
- package/dist/legacy-web-search-PlL5wfRE.js +140 -0
- package/dist/legacy.shared-BdJdF_Ji.js +45 -0
- package/dist/level-overrides-DkpAP8Z5.js +36 -0
- package/dist/library-D0LkGi9S.js +44 -0
- package/dist/lifecycle-core-LQrm8n7o.js +401 -0
- package/dist/line-C7MzXHd9.js +4 -0
- package/dist/line-runtime-D0TK2zdy.js +60 -0
- package/dist/line-surface-CN8Lvuud.js +27 -0
- package/dist/links-Dew9XRNK.js +17 -0
- package/dist/listeners-CUHNPyTB.js +14 -0
- package/dist/llm-slug-generator-DdO4_-IV.js +68 -0
- package/dist/llm-slug-generator.js +2 -0
- package/dist/load-CadZ3tcc.js +28 -0
- package/dist/loader-CbUrcgTY.js +2096 -0
- package/dist/local-file-access-BKg2BnYT.js +49 -0
- package/dist/location-DAl2Dv-o.js +42 -0
- package/dist/logger-BOH4EG1g.js +75 -0
- package/dist/logger-DXmZnecR.js +582 -0
- package/dist/logger-hR5Nn0oR.js +11 -0
- package/dist/logging-BVrQyk5K.js +13 -0
- package/dist/logging-BoyMPDyh.js +16 -0
- package/dist/logging-DPN6sRQx.js +3 -0
- package/dist/logging-core-BOrwsQp5.js +3 -0
- package/dist/logging-x8ySQJz4.js +2 -0
- package/dist/logs-cli-DUKwlDzr.js +221 -0
- package/dist/magic-string.es-CnHiwmBJ.js +1011 -0
- package/dist/main-session-BQ1fLshb.js +38 -0
- package/dist/manager-BfZUkAlZ.js +7 -0
- package/dist/manager.runtime-CiRcAT_V.js +670 -0
- package/dist/manifest-D49j8zhq.js +231 -0
- package/dist/manifest-registry-CVwreH55.js +955 -0
- package/dist/map-size-CHeGE-Hu.js +15 -0
- package/dist/markdown-tables-D2sUymqZ.js +31 -0
- package/dist/mask-api-key-Dxw856id.js +10 -0
- package/dist/matrix-Ds9X7gxo.js +340 -0
- package/dist/matrix-config-helpers-CXItIHIe.js +153 -0
- package/dist/matrix-helper-dQNUz9y1.js +20 -0
- package/dist/matrix-migration-snapshot-BSPlCZpf.js +714 -0
- package/dist/matrix-runtime-surface-Dggb-0DD.js +12 -0
- package/dist/matrix-surface-CxJ9TM8l.js +13 -0
- package/dist/matrix-thread-bindings-CT4Dqsid.js +12 -0
- package/dist/mcp/plugin-tools-serve.js +105 -0
- package/dist/mcp-cli-IzvP-l2E.js +768 -0
- package/dist/mcp-config-Bul9F_lO.js +117 -0
- package/dist/media-limits-CfgImPSH.js +14 -0
- package/dist/media-runtime-D2qFlSNy.js +293 -0
- package/dist/media-understanding-D930-yxA.js +43 -0
- package/dist/media-understanding-provider-WeSvV5Jz.js +27 -0
- package/dist/media-understanding-runtime-C2xB_w9c.js +15 -0
- package/dist/media-understanding.runtime-Cad8YO-5.js +7 -0
- package/dist/memory-core-engine-runtime-e08xLNwK.js +14 -0
- package/dist/memory-core-host-engine-embeddings-CeqjF8mF.js +1369 -0
- package/dist/memory-core-host-engine-qmd-2rX9HR2g.js +375 -0
- package/dist/memory-core-host-engine-storage-BocZ6yow.js +109 -0
- package/dist/memory-core-host-multimodal-DgBuQzZm.js +1 -0
- package/dist/memory-core-host-query-Cekrv97-.js +2 -0
- package/dist/memory-core-host-runtime-cli--EQHw17R.js +10 -0
- package/dist/memory-core-host-runtime-core-DX17el9Z.js +8 -0
- package/dist/memory-core-host-runtime-files-CeDFldc-.js +3 -0
- package/dist/memory-core-host-secret-BUGjwboV.js +1 -0
- package/dist/memory-core-host-status-C7nF33J8.js +44 -0
- package/dist/memory-embedding-providers-C8KLZUqC.js +34 -0
- package/dist/memory-runtime-D2rQY7mY.js +2 -0
- package/dist/memory-runtime-WuWYrOU9.js +30 -0
- package/dist/memory-search-BQs_twVs.js +2 -0
- package/dist/memory-search-L16IM5VZ.js +202 -0
- package/dist/memory-state-BPOopEhZ.js +41 -0
- package/dist/mention-gating-BJSMiJu8.js +25 -0
- package/dist/mentions-D0fLhfbe.js +155 -0
- package/dist/mentions-Ksl6lu1X.js +65 -0
- package/dist/merge-patch-CY3S-7zE.js +240 -0
- package/dist/message-D1nCeSGV.js +205 -0
- package/dist/message-action-discovery-Bp_zFTg1.js +133 -0
- package/dist/message-action-runner-DOaZ7jbV.js +1601 -0
- package/dist/message-channel-Di9LQZCg.js +105 -0
- package/dist/message-handler-CVxycGRP.js +1759 -0
- package/dist/message-hook-mappers-CgJovp_6.js +255 -0
- package/dist/message-secret-scope-BsvGcXOU.js +104 -0
- package/dist/method-scopes-1fMDkPgy.js +2608 -0
- package/dist/mime-CPj5mSwT.js +150 -0
- package/dist/min-host-version-BROqyGiT.js +348 -0
- package/dist/minimax-vlm-ciXgon3-.js +502 -0
- package/dist/model-auth-FAjaPIyj.js +330 -0
- package/dist/model-auth-env-aXebmtnO.js +42 -0
- package/dist/model-auth-label-BdkmYsfL.js +45 -0
- package/dist/model-auth-markers-CAxoOhNr.js +70 -0
- package/dist/model-auth-runtime-shared-C6EfNsiC.js +18 -0
- package/dist/model-catalog-DcYmAWnK.js +208 -0
- package/dist/model-catalog.runtime-BnfcWBe6.js +2 -0
- package/dist/model-input-shLH7pnZ.js +20 -0
- package/dist/model-overrides-CCPXEsf4.js +61 -0
- package/dist/model-overrides-CbljEHPO.js +84 -0
- package/dist/model-param-b-C9Se0GAW.js +15 -0
- package/dist/model-picker-7YHY1_DM.js +439 -0
- package/dist/model-picker-cAVRu3J8.js +3 -0
- package/dist/model-picker.runtime-DbCF7jcT.js +15 -0
- package/dist/model-selection-DLV9QudA.js +486 -0
- package/dist/model-selection-teaznyVt.js +407 -0
- package/dist/model-suppression-DxU9Wl3w.js +24 -0
- package/dist/model-suppression.runtime-DdJpj7Pn.js +7 -0
- package/dist/models-BktgoCTN.js +3 -0
- package/dist/models-DxC1yWIR.js +2550 -0
- package/dist/models-cli-BQJGDwlZ.js +197 -0
- package/dist/models-config-BrM95ZWn.js +2 -0
- package/dist/models-config-WznILp-f.js +1106 -0
- package/dist/models-config.runtime-DKvV7dBw.js +2 -0
- package/dist/monitor-B7Wimfc0.js +6004 -0
- package/dist/moonshot-stream-wrappers-CAVTNNIV.js +27 -0
- package/dist/moonshot-thinking-stream-wrappers-DSGFaY0P.js +69 -0
- package/dist/multimodal-fHfIB02R.js +66 -0
- package/dist/mutable-allowlist-detectors-Cz3_rHTS.js +62 -0
- package/dist/native-command-session-targets-YEwzYdBY.js +10 -0
- package/dist/net-DV8cgxeU.js +264 -0
- package/dist/network-mode-DlVi9UOI.js +17 -0
- package/dist/node-cli-BOOTFx0A.js +2201 -0
- package/dist/node-command-policy-H9JvUbqw.js +190 -0
- package/dist/node-commands-CtUW-J-z.js +11 -0
- package/dist/node-require-BgDD9bTi.js +14 -0
- package/dist/node-resolve-r0n2qCFZ.js +110 -0
- package/dist/node-service-BTIQHcIe.js +68 -0
- package/dist/node-startup-env-CVMjxAUF.js +50 -0
- package/dist/nodes-cli-DSe8_891.js +1050 -0
- package/dist/nodes-screen-BFBwMK0F.js +219 -0
- package/dist/nodes.helpers-C5_joVF0.js +204 -0
- package/dist/normalize-TCHtmmQz.js +35 -0
- package/dist/normalize-reply-D3AZv-Ku.js +500 -0
- package/dist/normalize-secret-input-Botsab7G.js +32 -0
- package/dist/note-BopuvWl0.js +109 -0
- package/dist/npm-registry-spec-C04c6qSA.js +100 -0
- package/dist/ollama-DHGG2Bt4.js +26 -0
- package/dist/ollama-surface-C297W-Hb.js +24 -0
- package/dist/onboard-BLF26Ra3.js +591 -0
- package/dist/onboard-channels-C7VwUlqL.js +2 -0
- package/dist/onboard-channels-CNYuwk6A.js +705 -0
- package/dist/onboard-config-BHR99vFk.js +2 -0
- package/dist/onboard-config-CDwd7KFG.js +29 -0
- package/dist/onboard-custom-B-SjrGJ_.js +2 -0
- package/dist/onboard-custom-BYciMnUV.js +646 -0
- package/dist/onboard-helpers-CXSVhHmw.js +4 -0
- package/dist/onboard-helpers-DQzH15KX.js +272 -0
- package/dist/onboard-hooks-dbSmp47O.js +52 -0
- package/dist/onboard-remote-76zO-wtV.js +2 -0
- package/dist/onboard-remote-CV8CYWRk.js +193 -0
- package/dist/onboard-search-CR1tclPf.js +339 -0
- package/dist/onboard-skills-B3nol3_I.js +2 -0
- package/dist/onboard-skills-BWzgYZiw.js +134 -0
- package/dist/openai-CYdnp7Xp.js +21 -0
- package/dist/openai-codex-auth-identity-DYIekza3.js +40 -0
- package/dist/openai-codex-catalog-C9jNVPkk.js +11 -0
- package/dist/openai-codex-provider-CihFFdms.js +254 -0
- package/dist/openai-provider-CY9og1U4.js +272 -0
- package/dist/openai-stream-wrappers-DMltslUP.js +453 -0
- package/dist/operator-approvals-client-CrZARXVS.js +33 -0
- package/dist/order-EE5jGs_C.js +744 -0
- package/dist/origin-routing-IIB1gZNP.js +15 -0
- package/dist/os-summary-B2xVpxVk.js +26 -0
- package/dist/outbound-adapter-BXuNyLX4.js +181 -0
- package/dist/outbound-media-Do8el7w-.js +48 -0
- package/dist/outbound-runtime-BsrPMYQX.js +2 -0
- package/dist/outbound-send-deps-RCYokJDu.js +7 -0
- package/dist/pairing-challenge-C6zO1O_e.js +33 -0
- package/dist/pairing-cli-lSGiQegx.js +116 -0
- package/dist/pairing-labels-CqTzyQv4.js +7 -0
- package/dist/pairing-message-CLV_7GCg.js +4 -0
- package/dist/pairing-messages-Bms_bews.js +23 -0
- package/dist/pairing-pending-CymkYopg.js +14 -0
- package/dist/pairing-store-BgSXc67b.js +617 -0
- package/dist/pairing-token-trqjnXaR.js +80 -0
- package/dist/parse-duration-FGYGEVrK.js +41 -0
- package/dist/parse-finite-number-CpMi4ac9.js +30 -0
- package/dist/parse-log-line-DB02BPsG.js +43 -0
- package/dist/parse-port-CfkrReDG.js +8 -0
- package/dist/parse-timeout-CqVxIetA.js +27 -0
- package/dist/path-alias-guards-CTG--JDv.js +40 -0
- package/dist/path-env-Coe9j6U3.js +87 -0
- package/dist/path-safety-BtrNm8CZ.js +12 -0
- package/dist/paths-dFp6bjkV.js +180 -0
- package/dist/paths-voC5pD8X.js +201 -0
- package/dist/payload-BiCTL_Go.js +90 -0
- package/dist/pdf-extract-DYqhcrys.js +73 -0
- package/dist/persistent-bindings.resolve-BG1W2wH2.js +12 -0
- package/dist/persistent-bindings.types-yg27a-LN.js +6 -0
- package/dist/persistent-dedupe-DeJFOp8F.js +116 -0
- package/dist/pi-model-discovery-4V1cP6C-.js +188 -0
- package/dist/pi-settings-tFYTni5h.js +57 -0
- package/dist/plugin-approvals-BBS3Vgt6.js +34 -0
- package/dist/plugin-auto-enable-B4gIDfiP.js +349 -0
- package/dist/plugin-entry-D7EjsbGL.js +25 -0
- package/dist/plugin-install-CBe57uiZ.js +2 -0
- package/dist/plugin-install-PbQ6ukY-.js +191 -0
- package/dist/plugin-install-config-policy-MQbVt-fA.js +93 -0
- package/dist/plugin-install-path-warnings-BfBOA9nm.js +40 -0
- package/dist/plugin-install-plan-DKH1Osjr.js +50 -0
- package/dist/plugin-registry-D2DvWTxI.js +2 -0
- package/dist/plugin-registry-t_GnpNNe.js +70 -0
- package/dist/plugin-runtime-kxm6OF3O.js +6 -0
- package/dist/plugin-sdk/account-core.js +8 -0
- package/dist/plugin-sdk/account-helpers.js +4 -0
- package/dist/plugin-sdk/account-id.js +3 -0
- package/dist/plugin-sdk/account-resolution.js +12 -0
- package/dist/plugin-sdk/acp-runtime.js +6 -0
- package/dist/plugin-sdk/agent-config-primitives.js +3 -0
- package/dist/plugin-sdk/agent-runtime.js +29 -0
- package/dist/plugin-sdk/allow-from.js +5 -0
- package/dist/plugin-sdk/allowlist-config-edit.js +2 -0
- package/dist/plugin-sdk/amazon-bedrock.js +15 -0
- package/dist/plugin-sdk/anthropic-vertex.js +2 -0
- package/dist/plugin-sdk/approval-runtime.js +7 -0
- package/dist/plugin-sdk/bluebubbles-policy.js +2 -0
- package/dist/plugin-sdk/bluebubbles.js +255 -0
- package/dist/plugin-sdk/boolean-param.js +2 -0
- package/dist/plugin-sdk/browser-runtime.js +2 -0
- package/dist/plugin-sdk/browser-support.js +44 -0
- package/dist/plugin-sdk/browser.js +15 -0
- package/dist/plugin-sdk/byteplus.js +17 -0
- package/dist/plugin-sdk/channel-actions.js +3 -0
- package/dist/plugin-sdk/channel-config-helpers.js +2 -0
- package/dist/plugin-sdk/channel-config-primitives.js +3 -0
- package/dist/plugin-sdk/channel-config-schema.js +7 -0
- package/dist/plugin-sdk/channel-config-writes.js +2 -0
- package/dist/plugin-sdk/channel-contract.js +1 -0
- package/dist/plugin-sdk/channel-feedback.js +5 -0
- package/dist/plugin-sdk/channel-inbound.js +10 -0
- package/dist/plugin-sdk/channel-lifecycle.js +3 -0
- package/dist/plugin-sdk/channel-pairing.js +2 -0
- package/dist/plugin-sdk/channel-policy.js +6 -0
- package/dist/plugin-sdk/channel-reply-pipeline.js +2 -0
- package/dist/plugin-sdk/channel-runtime.js +15 -0
- package/dist/plugin-sdk/channel-send-result.js +2 -0
- package/dist/plugin-sdk/channel-setup.js +5 -0
- package/dist/plugin-sdk/channel-status.js +5 -0
- package/dist/plugin-sdk/channel-targets.js +4 -0
- package/dist/plugin-sdk/chutes.js +20 -0
- package/dist/plugin-sdk/cli-backend.js +3 -0
- package/dist/plugin-sdk/cli-runtime.js +6 -0
- package/dist/plugin-sdk/cloudflare-ai-gateway.js +18 -0
- package/dist/plugin-sdk/collection-runtime.js +2 -0
- package/dist/plugin-sdk/command-auth-native.js +6 -0
- package/dist/plugin-sdk/command-auth.js +14 -0
- package/dist/plugin-sdk/compat.js +35 -0
- package/dist/plugin-sdk/config-runtime.js +22 -0
- package/dist/plugin-sdk/conversation-runtime.js +15 -0
- package/dist/plugin-sdk/core.js +22 -0
- package/dist/plugin-sdk/deepseek.js +14 -0
- package/dist/plugin-sdk/device-bootstrap.js +3 -0
- package/dist/plugin-sdk/diagnostic-runtime.js +4 -0
- package/dist/plugin-sdk/diagnostics-otel.js +5 -0
- package/dist/plugin-sdk/diffs.js +3 -0
- package/dist/plugin-sdk/direct-dm.js +2 -0
- package/dist/plugin-sdk/directory-runtime.js +5 -0
- package/dist/plugin-sdk/discord-account.js +2 -0
- package/dist/plugin-sdk/discord-core.js +9 -0
- package/dist/plugin-sdk/discord-runtime-surface.js +2 -0
- package/dist/plugin-sdk/discord-session-key.js +2 -0
- package/dist/plugin-sdk/discord-surface.js +2 -0
- package/dist/plugin-sdk/discord-thread-bindings.js +2 -0
- package/dist/plugin-sdk/discord-timeouts.js +2 -0
- package/dist/plugin-sdk/discord.js +21 -0
- package/dist/plugin-sdk/error-runtime.js +3 -0
- package/dist/plugin-sdk/extension-shared.js +75 -0
- package/dist/plugin-sdk/feishu-conversation.js +2 -0
- package/dist/plugin-sdk/feishu-setup.js +2 -0
- package/dist/plugin-sdk/feishu.js +33 -0
- package/dist/plugin-sdk/fetch-runtime.js +7 -0
- package/dist/plugin-sdk/file-lock.js +2 -0
- package/dist/plugin-sdk/gateway-runtime.js +4 -0
- package/dist/plugin-sdk/github-copilot-login.js +2 -0
- package/dist/plugin-sdk/github-copilot-token.js +2 -0
- package/dist/plugin-sdk/global-singleton.js +4 -0
- package/dist/plugin-sdk/google.js +2 -0
- package/dist/plugin-sdk/googlechat.js +58 -0
- package/dist/plugin-sdk/group-access.js +2 -0
- package/dist/plugin-sdk/hook-runtime.js +4 -0
- package/dist/plugin-sdk/host-runtime.js +3 -0
- package/dist/plugin-sdk/huggingface.js +18 -0
- package/dist/plugin-sdk/image-generation-core.js +63 -0
- package/dist/plugin-sdk/image-generation.js +2 -0
- package/dist/plugin-sdk/index.js +5 -0
- package/dist/plugin-sdk/infra-runtime.js +45 -0
- package/dist/plugin-sdk/interactive-runtime.js +4 -0
- package/dist/plugin-sdk/irc-surface.js +2 -0
- package/dist/plugin-sdk/irc.js +30 -0
- package/dist/plugin-sdk/json-store.js +3 -0
- package/dist/plugin-sdk/keyed-async-queue.js +2 -0
- package/dist/plugin-sdk/kilocode.js +23 -0
- package/dist/plugin-sdk/kimi-coding.js +11 -0
- package/dist/plugin-sdk/lazy-runtime.js +2 -0
- package/dist/plugin-sdk/line-core.js +6 -0
- package/dist/plugin-sdk/line-runtime.js +2 -0
- package/dist/plugin-sdk/line-surface.js +2 -0
- package/dist/plugin-sdk/line.js +9 -0
- package/dist/plugin-sdk/llm-task.js +5 -0
- package/dist/plugin-sdk/logging-core.js +5 -0
- package/dist/plugin-sdk/matrix-helper.js +2 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.js +4 -0
- package/dist/plugin-sdk/matrix-runtime-shared.js +2 -0
- package/dist/plugin-sdk/matrix-runtime-surface.js +2 -0
- package/dist/plugin-sdk/matrix-surface.js +2 -0
- package/dist/plugin-sdk/matrix-thread-bindings.js +2 -0
- package/dist/plugin-sdk/matrix.js +64 -0
- package/dist/plugin-sdk/mattermost-policy.js +11 -0
- package/dist/plugin-sdk/mattermost.js +42 -0
- package/dist/plugin-sdk/media-runtime.js +15 -0
- package/dist/plugin-sdk/media-understanding-runtime.js +2 -0
- package/dist/plugin-sdk/media-understanding.js +3 -0
- package/dist/plugin-sdk/memory-core-engine-runtime.js +2 -0
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +6 -0
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +17 -0
- package/dist/plugin-sdk/memory-core-host-engine-qmd.js +3 -0
- package/dist/plugin-sdk/memory-core-host-engine-storage.js +4 -0
- package/dist/plugin-sdk/memory-core-host-multimodal.js +3 -0
- package/dist/plugin-sdk/memory-core-host-query.js +3 -0
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +12 -0
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +13 -0
- package/dist/plugin-sdk/memory-core-host-runtime-files.js +4 -0
- package/dist/plugin-sdk/memory-core-host-secret.js +3 -0
- package/dist/plugin-sdk/memory-core-host-status.js +2 -0
- package/dist/plugin-sdk/memory-core.js +28 -0
- package/dist/plugin-sdk/memory-lancedb.js +4 -0
- package/dist/plugin-sdk/minimax.js +24 -0
- package/dist/plugin-sdk/mistral.js +17 -0
- package/dist/plugin-sdk/modelstudio-definitions.js +19 -0
- package/dist/plugin-sdk/modelstudio.js +24 -0
- package/dist/plugin-sdk/moonshot.js +17 -0
- package/dist/plugin-sdk/msteams.js +54 -0
- package/dist/plugin-sdk/nextcloud-talk.js +35 -0
- package/dist/plugin-sdk/nostr.js +24 -0
- package/dist/plugin-sdk/nvidia.js +11 -0
- package/dist/plugin-sdk/ollama-surface.js +2 -0
- package/dist/plugin-sdk/ollama.js +2 -0
- package/dist/plugin-sdk/openai.js +2 -0
- package/dist/plugin-sdk/opencode-go.js +14 -0
- package/dist/plugin-sdk/opencode.js +15 -0
- package/dist/plugin-sdk/outbound-runtime.js +5 -0
- package/dist/plugin-sdk/param-readers.js +2 -0
- package/dist/plugin-sdk/plugin-entry.js +3 -0
- package/dist/plugin-sdk/plugin-runtime.js +8 -0
- package/dist/plugin-sdk/process-runtime.js +2 -0
- package/dist/plugin-sdk/provider-auth-api-key.js +9 -0
- package/dist/plugin-sdk/provider-auth-login.js +2 -0
- package/dist/plugin-sdk/provider-auth-result.js +2 -0
- package/dist/plugin-sdk/provider-auth-runtime.js +5 -0
- package/dist/plugin-sdk/provider-auth.js +17 -0
- package/dist/plugin-sdk/provider-catalog-shared.js +2 -0
- package/dist/plugin-sdk/provider-entry.js +86 -0
- package/dist/plugin-sdk/provider-env-vars.js +2 -0
- package/dist/plugin-sdk/provider-http.js +3 -0
- package/dist/plugin-sdk/provider-model-shared.js +5 -0
- package/dist/plugin-sdk/provider-moonshot.js +3 -0
- package/dist/plugin-sdk/provider-onboard.js +3 -0
- package/dist/plugin-sdk/provider-setup.js +2 -0
- package/dist/plugin-sdk/provider-stream.js +4 -0
- package/dist/plugin-sdk/provider-tools.js +2 -0
- package/dist/plugin-sdk/provider-usage.js +3 -0
- package/dist/plugin-sdk/provider-web-search.js +6 -0
- package/dist/plugin-sdk/provider-zai-endpoint.js +116 -0
- package/dist/plugin-sdk/qianfan.js +13 -0
- package/dist/plugin-sdk/reply-chunking.js +3 -0
- package/dist/plugin-sdk/reply-dispatch-runtime.js +5 -0
- package/dist/plugin-sdk/reply-history.js +3 -0
- package/dist/plugin-sdk/reply-payload.js +2 -0
- package/dist/plugin-sdk/reply-runtime.js +14 -0
- package/dist/plugin-sdk/request-url.js +2 -0
- package/dist/plugin-sdk/retry-runtime.js +4 -0
- package/dist/plugin-sdk/root-alias.cjs +347 -0
- package/dist/plugin-sdk/routing.js +9 -0
- package/dist/plugin-sdk/runtime-env.js +17 -0
- package/dist/plugin-sdk/runtime-store.js +2 -0
- package/dist/plugin-sdk/runtime.js +9 -0
- package/dist/plugin-sdk/sandbox.js +5 -0
- package/dist/plugin-sdk/secret-input.js +4 -0
- package/dist/plugin-sdk/security-runtime.js +5 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.js +2 -0
- package/dist/plugin-sdk/setup-adapter-runtime.js +3 -0
- package/dist/plugin-sdk/setup-runtime.js +6 -0
- package/dist/plugin-sdk/setup-tools.js +6 -0
- package/dist/plugin-sdk/setup.js +13 -0
- package/dist/plugin-sdk/sglang.js +15 -0
- package/dist/plugin-sdk/signal-account.js +2 -0
- package/dist/plugin-sdk/signal-surface.js +2 -0
- package/dist/plugin-sdk/signal.js +24 -0
- package/dist/plugin-sdk/slack-account.js +2 -0
- package/dist/plugin-sdk/slack-core.js +7 -0
- package/dist/plugin-sdk/slack-runtime-surface.js +2 -0
- package/dist/plugin-sdk/slack-surface.js +2 -0
- package/dist/plugin-sdk/slack-target-parser.js +2 -0
- package/dist/plugin-sdk/slack-targets.js +3 -0
- package/dist/plugin-sdk/slack.js +20 -0
- package/dist/plugin-sdk/speech-core.js +4 -0
- package/dist/plugin-sdk/speech-runtime.js +2 -0
- package/dist/plugin-sdk/speech.js +5 -0
- package/dist/plugin-sdk/ssrf-runtime.js +6 -0
- package/dist/plugin-sdk/state-paths.js +3 -0
- package/dist/plugin-sdk/status-helpers.js +4 -0
- package/dist/plugin-sdk/synthetic.js +17 -0
- package/dist/plugin-sdk/telegram-account.js +2 -0
- package/dist/plugin-sdk/telegram-allow-from.js +12 -0
- package/dist/plugin-sdk/telegram-core.js +18 -0
- package/dist/plugin-sdk/telegram-surface.js +42 -0
- package/dist/plugin-sdk/temp-path.js +4 -0
- package/dist/plugin-sdk/testing.js +11 -0
- package/dist/plugin-sdk/text-runtime.js +20 -0
- package/dist/plugin-sdk/thread-bindings-runtime.js +3 -0
- package/dist/plugin-sdk/thread-ownership.js +4 -0
- package/dist/plugin-sdk/tlon.js +23 -0
- package/dist/plugin-sdk/together.js +16 -0
- package/dist/plugin-sdk/tool-send.js +2 -0
- package/dist/plugin-sdk/twitch.js +17 -0
- package/dist/plugin-sdk/venice.js +16 -0
- package/dist/plugin-sdk/vllm.js +15 -0
- package/dist/plugin-sdk/voice-call.js +6 -0
- package/dist/plugin-sdk/volcengine.js +17 -0
- package/dist/plugin-sdk/web-media.js +3 -0
- package/dist/plugin-sdk/webhook-ingress.js +9 -0
- package/dist/plugin-sdk/webhook-path.js +2 -0
- package/dist/plugin-sdk/webhook-request-guards.js +3 -0
- package/dist/plugin-sdk/whatsapp-auth-presence.js +3 -0
- package/dist/plugin-sdk/whatsapp-core.js +11 -0
- package/dist/plugin-sdk/whatsapp-shared.js +3 -0
- package/dist/plugin-sdk/whatsapp-surface.js +2 -0
- package/dist/plugin-sdk/whatsapp-targets.js +2 -0
- package/dist/plugin-sdk/windows-spawn.js +2 -0
- package/dist/plugin-sdk/xai.js +2 -0
- package/dist/plugin-sdk/zalo-setup.js +2 -0
- package/dist/plugin-sdk/zalo.js +37 -0
- package/dist/plugin-sdk/zalouser.js +39 -0
- package/dist/plugin-sdk/zod.js +2 -0
- package/dist/plugins/build-smoke-entry.js +4 -0
- package/dist/plugins/provider-runtime.runtime.js +2 -0
- package/dist/plugins/runtime/index.js +2 -0
- package/dist/plugins/runtime/runtime-line.contract.js +23 -0
- package/dist/plugins-BUhqQahf.js +7 -0
- package/dist/plugins-D3E9gBoB.js +5 -0
- package/dist/plugins-allowlist-BsE4VUd6.js +14 -0
- package/dist/plugins-cli-DNIRlpEw.js +551 -0
- package/dist/plugins-command-helpers-D0cHWZ8k.js +116 -0
- package/dist/plugins-install-persist-B4VRDkMW.js +121 -0
- package/dist/plugins-update-command-CVpqSCHk.js +974 -0
- package/dist/pluralkit-BLAFsOsu.js +21 -0
- package/dist/poll-params-BRovIMUP.js +52 -0
- package/dist/polls-BJAJSaiP.js +35 -0
- package/dist/port-defaults-BSVMFkjY.js +30 -0
- package/dist/ports-Bc5Ccog1.js +262 -0
- package/dist/ports-C4UXOMrf.js +432 -0
- package/dist/ports-lsof-BGtOoYbU.js +25 -0
- package/dist/ports-probe-BsWR8TFT.js +14 -0
- package/dist/preflight-audio.runtime-C9Vy2rmC.js +7 -0
- package/dist/probe-BQag0DWb.js +178 -0
- package/dist/probe-Ba_tzX9A.js +383 -0
- package/dist/probe-CU89zpYY.js +2 -0
- package/dist/probe-DqrD8L5s.js +137 -0
- package/dist/probe-auth-B_8xyHva.js +63 -0
- package/dist/probe-auth-ynM8e9Ac.js +2 -0
- package/dist/probe.runtime-CJ9xp7YD.js +2 -0
- package/dist/process-scoped-map-DSo5-USL.js +61 -0
- package/dist/profile-utils-C7uzTwgJ.js +15 -0
- package/dist/profiles-bHSSYfJl.js +79 -0
- package/dist/program-context-87EEruZh.js +10 -0
- package/dist/program-context-D14SwQxo.js +2 -0
- package/dist/program-wvgzSxLY.js +158 -0
- package/dist/progress-BvK_oMpz.js +132 -0
- package/dist/prompt-CtkpPKiX.js +2 -0
- package/dist/prompt-DOBS3BID.js +20 -0
- package/dist/prompt-select-styled-c91_PlKW.js +5468 -0
- package/dist/prompt-style-DRmsfagi.js +7 -0
- package/dist/prompts-DAJPf5yB.js +9 -0
- package/dist/prototype-keys-BWjW0VW8.js +11 -0
- package/dist/provider-C6dmSPJE.js +7237 -0
- package/dist/provider-api-key-auth-BBRnMefH.js +109 -0
- package/dist/provider-api-key-auth.runtime-obo7wOYn.js +14 -0
- package/dist/provider-auth-BTrDFsFt.js +43 -0
- package/dist/provider-auth-api-key-BhD_cXM7.js +5 -0
- package/dist/provider-auth-choice-2fsBmYtb.js +134 -0
- package/dist/provider-auth-choice-helpers-DLlNwVwg.js +58 -0
- package/dist/provider-auth-choice-preference-BkZTzT1J.js +44 -0
- package/dist/provider-auth-choice.runtime-BHkXn7WH.js +14 -0
- package/dist/provider-auth-choice.runtime-r6ydqD_o.js +2 -0
- package/dist/provider-auth-choices-AHFkSF9C.js +65 -0
- package/dist/provider-auth-guidance-Bo67Hboq.js +35 -0
- package/dist/provider-auth-helpers-Bk-AB5Wp.js +92 -0
- package/dist/provider-auth-input-kKdGWlxc.js +116 -0
- package/dist/provider-auth-login-dOLrU5NV.js +8 -0
- package/dist/provider-auth-login.runtime-C_GzFGmF.js +196 -0
- package/dist/provider-auth-mode-B8uz1z07.js +20 -0
- package/dist/provider-auth-ref-Bq-MejeL.js +2 -0
- package/dist/provider-auth-ref-DRl66ULG.js +171 -0
- package/dist/provider-auth-result-CkUVvE5c.js +31 -0
- package/dist/provider-auth-runtime-BRAnqbBW.js +32 -0
- package/dist/provider-catalog-shared-BdXDqt2_.js +28 -0
- package/dist/provider-discovery.runtime-BKQXZvW1.js +10 -0
- package/dist/provider-dispatcher-Cic3Zvgm.js +22 -0
- package/dist/provider-env-vars-X-m-m1cR.js +119 -0
- package/dist/provider-flow-rMDy096Q.js +93 -0
- package/dist/provider-id-CTiEzT1T.js +30 -0
- package/dist/provider-model-primary-QC1J1e8s.js +26 -0
- package/dist/provider-model-shared-YwZtB78q.js +104 -0
- package/dist/provider-oauth-flow-DGhuMjqj.js +33 -0
- package/dist/provider-onboard-Dhee14q4.js +264 -0
- package/dist/provider-openai-codex-oauth-tls-CExxHKyb.js +101 -0
- package/dist/provider-registry-7IbNpklR.js +49 -0
- package/dist/provider-runtime-C3NxbOtm.js +2 -0
- package/dist/provider-runtime-DWDjorB4.js +275 -0
- package/dist/provider-runtime.runtime-BYVCPiGA.js +26 -0
- package/dist/provider-self-hosted-setup-Cr4L3fdW.js +272 -0
- package/dist/provider-session.runtime-BHtGAIna.js +8 -0
- package/dist/provider-stream-DpUrpHvN.js +266 -0
- package/dist/provider-tools-L23YSx8p.js +37 -0
- package/dist/provider-usage-BWLu6XJt.js +375 -0
- package/dist/provider-usage-BwHu9Ee_.js +3 -0
- package/dist/provider-usage-CfYpxnUD.js +2 -0
- package/dist/provider-usage.fetch-BCNscJcf.js +633 -0
- package/dist/provider-web-search-CJBYgiMq.js +717 -0
- package/dist/provider-wizard-BGXsleZZ.js +209 -0
- package/dist/provider.runtime-BS0qB3qa.js +2 -0
- package/dist/providers-DTi5kDSF.js +59 -0
- package/dist/providers.runtime-7kqrRLzO.js +55 -0
- package/dist/proxy-env-CEq84zdW.js +40 -0
- package/dist/proxy-fetch-BI4S6OOr.js +55 -0
- package/dist/push-apns-btlZ1qmo.js +921 -0
- package/dist/pw-ai-Crk1oU2c.js +1827 -0
- package/dist/qr-cli-CBrnKR40.js +368 -0
- package/dist/qr-cli-D35IbCMe.js +2 -0
- package/dist/query-expansion-CTVRVJBc.js +633 -0
- package/dist/read-only-account-inspect-CtMAYZjJ.js +9 -0
- package/dist/read-only-account-inspect.telegram-DsWhEWsi.js +202 -0
- package/dist/reasoning-tags-C0A8lJGB.js +77 -0
- package/dist/redact-BDinS1q9.js +102 -0
- package/dist/redact-identifier-CIxwZTyq.js +13 -0
- package/dist/redact-sensitive-url-BYqi2BEL.js +50 -0
- package/dist/redirect-headers-BX_akPpf.js +25 -0
- package/dist/ref-contract-D5ynmOGd.js +53 -0
- package/dist/register-lazy-command-C1up25zY.js +43 -0
- package/dist/register.agent-BoS4J17I.js +239 -0
- package/dist/register.backup-CJxtB0Qd.js +236 -0
- package/dist/register.configure-a7pFaHfe.js +15 -0
- package/dist/register.maintenance-BtI8X-uf.js +450 -0
- package/dist/register.message-BQRkPLq3.js +643 -0
- package/dist/register.onboard-CthiWQxu.js +79 -0
- package/dist/register.setup-BnxRKFDi.js +104 -0
- package/dist/register.status-health-sessions-CHaa5NX0.js +705 -0
- package/dist/register.subclis-DKmBSSCn.js +3 -0
- package/dist/register.subclis-TJY--uPt.js +287 -0
- package/dist/registry-8eF_COje.js +667 -0
- package/dist/registry-B84vjqPA.js +11 -0
- package/dist/registry-CJH_346k.js +60 -0
- package/dist/registry-CiuAeUhZ.js +50 -0
- package/dist/registry-DrnXCaTU.js +219 -0
- package/dist/repair-bIiF2iJn.js +112 -0
- package/dist/reply-B1wBiwTS.js +3134 -0
- package/dist/reply-dispatch-runtime-nSg-l3YV.js +3 -0
- package/dist/reply-history-DiOD0MK2.js +2 -0
- package/dist/reply-payload-D0XXyIHC.js +232 -0
- package/dist/reply-payloads-DW1w7Ckr.js +116 -0
- package/dist/reply-payloads-dedupe-BEPyuQQJ.js +135 -0
- package/dist/reply-payloads-dedupe.runtime-ClraIPuB.js +2 -0
- package/dist/reply-prefix-Bmqt3err.js +39 -0
- package/dist/reply-runtime-bbaSgEmi.js +123 -0
- package/dist/reply.runtime-leqfq1BG.js +2 -0
- package/dist/request-url-B5e58odi.js +10 -0
- package/dist/resolve-B-OthG4M.js +2 -0
- package/dist/resolve-BjvAwAfZ.js +619 -0
- package/dist/resolve-bBpW2W5z.js +174 -0
- package/dist/resolve-channels-543uTQ-Q.js +263 -0
- package/dist/resolve-configured-secret-input-string-CcNZQ54A.js +112 -0
- package/dist/resolve-route-CCHWflcJ.js +486 -0
- package/dist/resolve-system-bin-M8rzqZWg.js +120 -0
- package/dist/resolve-users-B2hIFlh6.js +145 -0
- package/dist/resolve-utils-B34dER9i.js +102 -0
- package/dist/response-prefix-template-CmRtMrPn.js +50 -0
- package/dist/restart-sentinel-BEGeUiKE.js +70 -0
- package/dist/restart-stale-pids-Co_AHlf1.js +187 -0
- package/dist/retry-DB6rKQUK.js +76 -0
- package/dist/retry-policy-vpZZs4Ql.js +58 -0
- package/dist/retry-runtime-BwFtUlOC.js +3 -0
- package/dist/root-help-BKc92COf.js +53 -0
- package/dist/route-reply-BhwCACur.js +133 -0
- package/dist/route-reply.runtime-CR3o0GzY.js +2 -0
- package/dist/route-resolution-C30ccEVA.js +1222 -0
- package/dist/routes-BkjFgytb.js +6880 -0
- package/dist/routing-B6ZVsl1G.js +16 -0
- package/dist/rpc-Ceg29ThW.js +67 -0
- package/dist/run-command-Bec0f6Qx.js +32 -0
- package/dist/run-main-B5ZRlNEV.js +425 -0
- package/dist/run-with-concurrency-oNPuq9N9.js +41 -0
- package/dist/runner-BEbGymO4.js +1478 -0
- package/dist/runtime-B3T4VytJ.js +1627 -0
- package/dist/runtime-CiU2aDgB.js +42 -0
- package/dist/runtime-D0VpiCHi.js +125 -0
- package/dist/runtime-Dtd5v6Gj.js +153 -0
- package/dist/runtime-Fhelf5Qd.js +126 -0
- package/dist/runtime-api-B0fBYyFa.js +241 -0
- package/dist/runtime-api-JdnJolgR.js +2484 -0
- package/dist/runtime-discord-ops.runtime-Cc-Clbrs.js +26 -0
- package/dist/runtime-embedded-pi.runtime-CAq8BTmS.js +2 -0
- package/dist/runtime-env-CkoJ2p8u.js +9 -0
- package/dist/runtime-forwarders-BwQHD11s.js +44 -0
- package/dist/runtime-gaN3vB28.js +284 -0
- package/dist/runtime-group-policy-BPxHuPda.js +59 -0
- package/dist/runtime-guard-VWNtYR4l.js +70 -0
- package/dist/runtime-media-understanding.runtime-BnfH3VZb.js +2 -0
- package/dist/runtime-model-auth.runtime-Bd2GMW6W.js +2 -0
- package/dist/runtime-parse-DFyJekfB.js +83 -0
- package/dist/runtime-paths-C22j-CNR.js +333 -0
- package/dist/runtime-schema-Bft9ccja.js +14524 -0
- package/dist/runtime-slack-ops.runtime-qCe8vp_N.js +15 -0
- package/dist/runtime-status-C7QK-Xow.js +109 -0
- package/dist/runtime-status-SEjcftwu.js +15 -0
- package/dist/runtime-store-j5RNDQBQ.js +22 -0
- package/dist/runtime-tts.runtime-IxRggKLH.js +2 -0
- package/dist/runtime-web-tools-Lf22Il6X.js +1891 -0
- package/dist/runtime-whatsapp-boundary-BQeud5Kv.js +6 -0
- package/dist/runtime-whatsapp-boundary-DbAJ9jGX.js +2 -0
- package/dist/safe-regex-tLlDZYfM.js +244 -0
- package/dist/safe-text-CRAu9RDR.js +16 -0
- package/dist/sandbox-DxQGIkI1.js +2698 -0
- package/dist/sandbox-cli-Bd8ECmMx.js +443 -0
- package/dist/sandbox-paths-ui_vqw2W.js +146 -0
- package/dist/sanitize-env-vars-DpPdECQ9.js +82 -0
- package/dist/scan-paths-VhLKL5WT.js +28 -0
- package/dist/scoped-expiring-id-cache-BmlyFPPR.js +35 -0
- package/dist/scp-host-C5NgDe_6.js +62 -0
- package/dist/secret-equal-fMR1DjSl.js +9 -0
- package/dist/secret-file-COQ7QNO9.js +4 -0
- package/dist/secret-file-Dv42g1FG.js +92 -0
- package/dist/secret-input-CzbdxXxu.js +13 -0
- package/dist/secret-input-DJ-sTcOE.js +38 -0
- package/dist/secrets-cli-OoRkxItP.js +2112 -0
- package/dist/secure-random-DJ9MB_Og.js +20 -0
- package/dist/security-cli-CQ4HiQLb.js +477 -0
- package/dist/security-runtime-CU_gbsBJ.js +51 -0
- package/dist/semver-compare-aGN2MIqz.js +53 -0
- package/dist/send-COItao1A.js +2473 -0
- package/dist/send-deps-K4k6Myst.js +19 -0
- package/dist/send-policy-B1t4c2Ab.js +60 -0
- package/dist/server-BPOSwT-c.js +67 -0
- package/dist/server-middleware-QGnAuw-H.js +108 -0
- package/dist/server-node-events-CoM4XGHV.js +454 -0
- package/dist/server-startup-matrix-migration-CMLAopuE.js +1255 -0
- package/dist/service-8Ef_HfQd.js +2 -0
- package/dist/service-DzXqyjgG.js +849 -0
- package/dist/session-DNTpr0A7.js +50 -0
- package/dist/session-archive.runtime-Bz20yPKg.js +2 -0
- package/dist/session-binding-service-BqY1J7gs.js +421 -0
- package/dist/session-context-D4ioj_ZC.js +23 -0
- package/dist/session-conversation-D3BLZCjg.js +15 -0
- package/dist/session-conversation-SDN1QbLK.js +135 -0
- package/dist/session-cost-usage-5D6Kkthv.js +650 -0
- package/dist/session-cost-usage-CqniZ9Q3.js +2 -0
- package/dist/session-envelope-DdZaP6iS.js +18 -0
- package/dist/session-file-SVifvwcV.js +120 -0
- package/dist/session-fork.runtime-Bhgl-_lq.js +50 -0
- package/dist/session-key-BIrdMs11.js +279 -0
- package/dist/session-key-CCQ4ZS9B.js +53 -0
- package/dist/session-key-normalization-DGxkxG3U.js +22 -0
- package/dist/session-meta-5PkRqQxG.js +9 -0
- package/dist/session-override-CqiOQ4Om.js +100 -0
- package/dist/session-reset-model.runtime-DFL5rk1J.js +119 -0
- package/dist/session-subagent-reactivation.runtime-DIIFdc6I.js +2 -0
- package/dist/session-system-events-BrXQQl_c.js +62 -0
- package/dist/session-transcript-files.fs-BltD5xvW.js +124 -0
- package/dist/session-updates-Dd6r5vhZ.js +177 -0
- package/dist/session-updates.runtime-CTmXpESa.js +2 -0
- package/dist/session-utils-CYh1zGmy.js +1735 -0
- package/dist/session-write-lock-D_1twm3Q.js +343 -0
- package/dist/sessions-BBObTITM.js +2 -0
- package/dist/sessions-BLL-TKEv.js +224 -0
- package/dist/sessions-zgiFsm1E.js +381 -0
- package/dist/setup-BnAbcoEP.js +15 -0
- package/dist/setup-CDUb3AWu.js +427 -0
- package/dist/setup-adapter-runtime-kV6aLMzB.js +2 -0
- package/dist/setup-binary-C35NJX1i.js +2 -0
- package/dist/setup-core-C-0ynF1r.js +256 -0
- package/dist/setup-group-access-BrKTGyeK.js +70 -0
- package/dist/setup-helpers-CNcOI9ct.js +390 -0
- package/dist/setup-runtime-CZF60tJ1.js +4 -0
- package/dist/setup-surface-BcZenSzA.js +237 -0
- package/dist/setup-surface-BwZZukYI.js +97 -0
- package/dist/setup-tools-DB-J75x8.js +4 -0
- package/dist/setup-wizard-helpers-u8iQ-OcY.js +841 -0
- package/dist/setup-wizard-proxy-DiI-Brmi.js +127 -0
- package/dist/setup.finalize-L3P2sSFi.js +443 -0
- package/dist/setup.gateway-config-ISaEE7wH.js +246 -0
- package/dist/setup.secret-input-DCxgkYJ3.js +25 -0
- package/dist/shared-B0P4kmoP.js +50 -0
- package/dist/shared-BOaKRLRY.js +64 -0
- package/dist/shared-BXUt8yQc.js +160 -0
- package/dist/shared-BZ338OsD.js +64 -0
- package/dist/shared-BjU08Pt_.js +54 -0
- package/dist/shared-BsFd7tT-.js +136 -0
- package/dist/shared-CvC-RYap.js +37 -0
- package/dist/shared-dXZZGNhj.js +10 -0
- package/dist/shared-rGax8vC3.js +221 -0
- package/dist/shell-argv-Z5ptFecq.js +72 -0
- package/dist/shell-env-BSJycHpS.js +181 -0
- package/dist/signal-BSV2xBJt.js +46 -0
- package/dist/signal-BZDASWHO.js +13 -0
- package/dist/signal-CId8sMA8.js +6 -0
- package/dist/signal-account-DcEiRyli.js +11 -0
- package/dist/signal-cli-install-CzSdr2VM.js +188 -0
- package/dist/signal-surface-DrUgouip.js +21 -0
- package/dist/simple-completion-transport-BNMmn163.js +24 -0
- package/dist/skill-commands-CZ_x2Cqy.js +77 -0
- package/dist/skill-commands-base-wY_Bsohb.js +60 -0
- package/dist/skill-commands.runtime-BV7uDCJx.js +2 -0
- package/dist/skill-scanner-B27VLIIq.js +354 -0
- package/dist/skills-BTiQjfVL.js +1310 -0
- package/dist/skills-CIF8vVlP.js +3 -0
- package/dist/skills-clawhub-BDym_41x.js +274 -0
- package/dist/skills-cli-C8m1I_bL.js +369 -0
- package/dist/skills-install-B_gFFO8I.js +818 -0
- package/dist/skills-remote-QuF4recE.js +550 -0
- package/dist/skills-status-BEZWIOBR.js +2 -0
- package/dist/skills-status-Dm_Jhtes.js +169 -0
- package/dist/slack-Cs63YrE6.js +6 -0
- package/dist/slack-account-5pXdcCaK.js +11 -0
- package/dist/slack-liv3adei.js +9 -0
- package/dist/slack-runtime-surface-B5JYrWWf.js +18 -0
- package/dist/slack-surface-DpNHDOit.js +44 -0
- package/dist/slack-target-parser-CErq1YCw.js +12 -0
- package/dist/slack-targets-xF6pth_v.js +45 -0
- package/dist/slots-PFLvT1Kq.js +93 -0
- package/dist/speech-BY_tUO7g.js +46 -0
- package/dist/speech-provider-S9O0XAp5.js +154 -0
- package/dist/speech-runtime-oxmNRw3Z.js +34 -0
- package/dist/ssh-config-BDfMcgtS.js +77 -0
- package/dist/ssh-tunnel-DG9ZYGsa.js +159 -0
- package/dist/ssh-tunnel-D_XZfkBV.js +2 -0
- package/dist/ssrf-BRA26Q75.js +246 -0
- package/dist/ssrf-policy-BIG3iChD.js +69 -0
- package/dist/ssrf-runtime-BPxpSyiW.js +5 -0
- package/dist/stage-sandbox-media.runtime-DOOiTZkt.js +229 -0
- package/dist/state-migrations-cqOvSXP-.js +845 -0
- package/dist/state-paths-CudqznX-.js +2 -0
- package/dist/status-B5sZUURG.js +3 -0
- package/dist/status-BXjWA90V.js +608 -0
- package/dist/status-Biw1EIdt.js +2 -0
- package/dist/status-CgHjqeMn.js +650 -0
- package/dist/status-DQZ0kLxk.js +44 -0
- package/dist/status-VHq1HAMM.js +240 -0
- package/dist/status-all-DhEDLGP9.js +798 -0
- package/dist/status-helpers-B7-UgIy8.js +170 -0
- package/dist/status-issues-BFrNHsVn.js +335 -0
- package/dist/status-issues-BUaLeYpi.js +187 -0
- package/dist/status-json-DOnh1xDZ.js +86 -0
- package/dist/status.agent-local-CaYKjhhX.js +59 -0
- package/dist/status.command.text-runtime-DsOhXWI5.js +18 -0
- package/dist/status.daemon-CriBgB61.js +25 -0
- package/dist/status.format-c9WFxqY6.js +44 -0
- package/dist/status.gateway-probe-FD9wNXhY.js +15 -0
- package/dist/status.link-channel-DYBN8KV3.js +35 -0
- package/dist/status.node-mode-FwHcEfkE.js +2 -0
- package/dist/status.node-mode-dPc3mfqx.js +32 -0
- package/dist/status.scan-DTGuZcAs.js +264 -0
- package/dist/status.scan.deps.runtime-BlestHMC.js +18 -0
- package/dist/status.scan.fast-json-Co7nNA_T.js +97 -0
- package/dist/status.scan.fast-json-DRsEwD_h.js +2 -0
- package/dist/status.scan.json-core-DaBuCMzr.js +254 -0
- package/dist/status.scan.runtime-Dp_UkjfG.js +9 -0
- package/dist/status.service-summary-BmHN_sIt.js +32 -0
- package/dist/status.summary-C0Jn9d8y.js +2 -0
- package/dist/status.summary-C3KHSLR1.js +210 -0
- package/dist/status.update-DiRYpvwE.js +2 -0
- package/dist/status.update-DjXE_PsH.js +79 -0
- package/dist/sticker-cache-kEcJqycr.js +1516 -0
- package/dist/sticker-vision.runtime-DdnhPS7k.js +16 -0
- package/dist/store-DKzOIKqx.js +1342 -0
- package/dist/store-DwAEHdgR.js +749 -0
- package/dist/store-HBHyNMRe.js +10 -0
- package/dist/store-NoUggnB3.js +365 -0
- package/dist/store-read-BHYG1WxT.js +16 -0
- package/dist/store.runtime-jT-JoPV1.js +2 -0
- package/dist/string-normalization-k4ilMPRu.js +19 -0
- package/dist/string-sample-BIWt11jp.js +11 -0
- package/dist/strip-inbound-meta-DuOzaKMB.js +665 -0
- package/dist/subagent-orphan-recovery-BaGPnDpY.js +206 -0
- package/dist/subagent-registry-runtime-C0hklxy4.js +2 -0
- package/dist/subcli-descriptors-Ccul9RKX.js +151 -0
- package/dist/subsystem-CpBs2R1c.js +582 -0
- package/dist/supervisor-log.runtime-BbxSpWqa.js +8 -0
- package/dist/system-cli-rGgbAbhD.js +58 -0
- package/dist/system-events-CkTr2pVV.js +93 -0
- package/dist/system-message-BwHVKRn-.js +16 -0
- package/dist/system-run-command-CeFzgmkE.js +295 -0
- package/dist/systemd-aS57J-tg.js +588 -0
- package/dist/systemd-hints-DexZGkZU.js +325 -0
- package/dist/systemd-linger-Dum_Ly5E.js +68 -0
- package/dist/systemd-linger-a109c27V.js +2 -0
- package/dist/table-BNAxmbtm.js +305 -0
- package/dist/tables-AGjErT3Z.js +832 -0
- package/dist/tailnet-CtCjQNPK.js +76 -0
- package/dist/tailscale-IqBQ_JBD.js +232 -0
- package/dist/tailscale-status-SUYxe8DO.js +71 -0
- package/dist/target-errors-Dd5ygAn4.js +26 -0
- package/dist/target-parsing-DsTnx9-F.js +14 -0
- package/dist/target-registry-Je8d-VjB.js +1280 -0
- package/dist/targets-B5CwzJUC.js +748 -0
- package/dist/targets-CsuOrZri.js +269 -0
- package/dist/targets-CwnVSfRA.js +70 -0
- package/dist/targets-DuUFEzKS.js +78 -0
- package/dist/task-registry-delivery-runtime-DqP8eooO.js +2 -0
- package/dist/task-registry.audit.shared-C4RGABy7.js +18 -0
- package/dist/task-registry.maintenance-Bu37anXR.js +281 -0
- package/dist/task-registry.maintenance-DOsnDSZk.js +2 -0
- package/dist/task-registry.summary-DxVk_l3y.js +44 -0
- package/dist/tavily-search-provider-CJqkM2Pl.js +226 -0
- package/dist/telegram/audit.js +2 -0
- package/dist/telegram/token.js +2 -0
- package/dist/telegram-DYAW3Sfk.js +23 -0
- package/dist/telegram-account-BJWXAeS3.js +11 -0
- package/dist/telegram-core-BB-oqWi1.js +6 -0
- package/dist/temp-download-vS-txIoM.js +62 -0
- package/dist/temp-path-DfCfU6WG.js +2 -0
- package/dist/templating-NXIs4v5N.js +24 -0
- package/dist/terminal-link-TU0E45HO.js +10 -0
- package/dist/testing-BnS6kfoS.js +575 -0
- package/dist/text-chunking-90VX7tgk.js +12 -0
- package/dist/text-chunking-BVps1926.js +20 -0
- package/dist/text-format-B1S_nIVb.js +8 -0
- package/dist/text-runtime-vMYWZmQD.js +398 -0
- package/dist/theme-BJIQPogA.js +34 -0
- package/dist/theme-SO8WovMK.js +2 -0
- package/dist/thinking-uI0siSaD.js +68 -0
- package/dist/thinking.shared-C4SN38qn.js +243 -0
- package/dist/thread-bindings-policy-BcpXmcKL.js +172 -0
- package/dist/thread-bindings-u1VyUaZn.js +778 -0
- package/dist/thread-bindings.discord-api-Cq6oEKwK.js +486 -0
- package/dist/threading-helpers-PW95yLIC.js +14 -0
- package/dist/timeouts-CTDvzc8O.js +72 -0
- package/dist/tmp-vora-dir-D2qk7W45.js +102 -0
- package/dist/token-CHFyaNO5.js +45 -0
- package/dist/token-D6h_ZVJn.js +82 -0
- package/dist/tokens-shGOmvyA.js +66 -0
- package/dist/tool-display-DqKeDkdg.js +1607 -0
- package/dist/tool-images-Dk60Ug5h.js +270 -0
- package/dist/tool-policy-CQHL2-I3.js +515 -0
- package/dist/tool-policy-match-DL8JY2vg.js +48 -0
- package/dist/tool-send-hJCuDJfS.js +16 -0
- package/dist/tools-effective-inventory-CWzIubjU.js +148 -0
- package/dist/tools-pE9BlK9y.js +119 -0
- package/dist/transcript-events-DRsDmwmp.js +29 -0
- package/dist/transport-ready-f6mdQOwn.js +36 -0
- package/dist/tts-B1m3C2Az.js +102 -0
- package/dist/tts-DUrUS0mZ.js +85 -0
- package/dist/tts-auto-mode-C8_kw3FV.js +14 -0
- package/dist/tts.runtime-BoqipRLV.js +2 -0
- package/dist/tui-CQLplrBK.js +3898 -0
- package/dist/tui-cli-DT0FyMjs.js +31 -0
- package/dist/typebox-DR5b98DT.js +22 -0
- package/dist/types-CGCTcpfm.js +465 -0
- package/dist/types-DDSZHm1L.js +12 -0
- package/dist/types-KyI2zD1Y.js +83 -0
- package/dist/types.secrets-CxoujPzV.js +80 -0
- package/dist/types.tools-DbA37tJ5.js +22 -0
- package/dist/typing-Dz7FaNst.js +68 -0
- package/dist/typing-mode-D3dtTRFq.js +75 -0
- package/dist/typing-policy-DNdXa4aP.js +11 -0
- package/dist/typing-start-guard-Bd69zP69.js +73 -0
- package/dist/ui-DBzDVf5Z.js +182 -0
- package/dist/undici-global-dispatcher-jevw8Gzz.js +99 -0
- package/dist/unhandled-rejections-D0HD8aaS.js +2 -0
- package/dist/unhandled-rejections-yZafPL2A.js +241 -0
- package/dist/update-Bof-SJAQ.js +1253 -0
- package/dist/update-channels-d8te77R1.js +78 -0
- package/dist/update-check-DK2tfDQH.js +354 -0
- package/dist/update-cli-Ck2vsRAq.js +1446 -0
- package/dist/update-offset-store-DzcRNELt.js +75 -0
- package/dist/utils-BiWzD1kh.js +230 -0
- package/dist/utils-QayXenI0.js +3 -0
- package/dist/version-B8PcQo5n.js +79 -0
- package/dist/version-DBzWIScg.js +2 -0
- package/dist/vora-embedded-block-chunker-3yyZObTq.js +258 -0
- package/dist/vora-embedded-helpers-CcpQ4UhE.js +1451 -0
- package/dist/vora-embedded-runner-CtRc9sK4.js +35200 -0
- package/dist/vora-embedded.runtime-DnQSqL4C.js +3 -0
- package/dist/vora-exec-env-D4Xwhvu2.js +14 -0
- package/dist/vora-root-LrpnxvkN.js +88 -0
- package/dist/vora-tools.before-tool-call.runtime-DMDQZj3b.js +354 -0
- package/dist/vora-tools.runtime-CRE3qINm.js +2 -0
- package/dist/wait-DINWFDZY.js +7 -0
- package/dist/warning-filter-SAevhKdH.js +57 -0
- package/dist/web-media-xqpNAEze.js +630 -0
- package/dist/web-search-providers-Dzq6HxbB.js +21 -0
- package/dist/web-search-providers.runtime-CtA0c8j7.js +110 -0
- package/dist/web-search-providers.shared-BDbtn1DP.js +404 -0
- package/dist/webhook-ingress-VjrwfCEq.js +164 -0
- package/dist/webhook-memory-guards-B-_GNMqp.js +129 -0
- package/dist/webhook-path-KmDDjLxH.js +22 -0
- package/dist/webhook-request-guards-RvZR0xOr.js +178 -0
- package/dist/webhooks-cli-DW2licxV.js +325 -0
- package/dist/whatsapp-BdBhDmjG.js +4 -0
- package/dist/whatsapp-DrWLgII5.js +33 -0
- package/dist/whatsapp-heartbeat-B9ic2dUo.js +114 -0
- package/dist/whatsapp-shared-CCB6ISPU.js +56 -0
- package/dist/whatsapp-surface-Dj75n55B.js +26 -0
- package/dist/whatsapp-targets-DC3kH_Ao.js +13 -0
- package/dist/widearea-dns-CQmUW5IF.js +125 -0
- package/dist/windows-argv-Dp3PZAV0.js +345 -0
- package/dist/windows-install-roots-XI3CvO9O.js +149 -0
- package/dist/windows-spawn-Bo5J7nQU.js +154 -0
- package/dist/with-timeout-82_4MKPJ.js +13 -0
- package/dist/with-timeout-C9cQCRMB.js +215 -0
- package/dist/workspace-Byy6tyA9.js +479 -0
- package/dist/workspace-dirs-DD2rvoad.js +13 -0
- package/dist/workspace-rZgvKsfA.js +306 -0
- package/dist/ws-H_UxQmDV.js +11 -0
- package/dist/ws-log-Colefm0_.js +289 -0
- package/dist/wsl-Cja5t6Cg.js +57 -0
- package/dist/xai-G_qBZ2Uy.js +27 -0
- package/dist/zalo-setup-DhLwoxOU.js +14 -0
- package/dist/zod-parse-CoS4Cf-k.js +14 -0
- package/dist/zod-schema.agent-runtime-DvpP4fxf.js +602 -0
- package/dist/zod-schema.channels-BAf89d5l.js +10 -0
- package/dist/zod-schema.core-BTG8QVOn.js +514 -0
- package/dist/zod-schema.providers-core-CBsF2dSN.js +1569 -0
- package/dist/zod-schema.providers-whatsapp-BORKPdar.js +125 -0
- package/dist/zod-schema.sensitive-bgI4eB_k.js +5 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.ja-JP.json +14 -0
- package/docs/.i18n/glossary.zh-CN.json +306 -0
- package/docs/.i18n/ja-JP.tm.jsonl +0 -0
- package/docs/assets/install-script.svg +1 -0
- package/docs/assets/macos-onboarding/01-macos-warning.jpeg +0 -0
- package/docs/assets/macos-onboarding/02-local-networks.jpeg +0 -0
- package/docs/assets/macos-onboarding/03-security-notice.png +0 -0
- package/docs/assets/macos-onboarding/04-choose-gateway.png +0 -0
- package/docs/assets/macos-onboarding/05-permissions.png +0 -0
- package/docs/assets/pixel-lobster.svg +60 -0
- package/docs/assets/showcase/agents-ui.jpg +0 -0
- package/docs/assets/showcase/bambu-cli.png +0 -0
- package/docs/assets/showcase/codexmonitor.png +0 -0
- package/docs/assets/showcase/gohome-grafana.png +0 -0
- package/docs/assets/showcase/ios-testflight.jpg +0 -0
- package/docs/assets/showcase/oura-health.png +0 -0
- package/docs/assets/showcase/padel-cli.svg +11 -0
- package/docs/assets/showcase/padel-screenshot.jpg +0 -0
- package/docs/assets/showcase/papla-tts.jpg +0 -0
- package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
- package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
- package/docs/assets/showcase/roborock-status.svg +13 -0
- package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
- package/docs/assets/showcase/snag.png +0 -0
- package/docs/assets/showcase/tesco-shop.jpg +0 -0
- package/docs/assets/showcase/wienerlinien.png +0 -0
- package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
- package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
- package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
- package/docs/assets/sponsors/blacksmith-light.svg +14 -0
- package/docs/assets/sponsors/blacksmith.svg +14 -0
- package/docs/assets/sponsors/convex-light.svg +16 -0
- package/docs/assets/sponsors/convex.svg +16 -0
- package/docs/assets/sponsors/nvidia-dark.svg +9 -0
- package/docs/assets/sponsors/nvidia.svg +9 -0
- package/docs/assets/sponsors/openai-light.svg +3 -0
- package/docs/assets/sponsors/openai.svg +3 -0
- package/docs/assets/sponsors/vercel-light.svg +5 -0
- package/docs/assets/sponsors/vercel.svg +5 -0
- package/docs/assets/vora-logo-text-dark.png +0 -0
- package/docs/assets/vora-logo-text-dark.svg +418 -0
- package/docs/assets/vora-logo-text.png +0 -0
- package/docs/assets/vora-logo-text.svg +418 -0
- package/docs/auth-credential-semantics.md +60 -0
- package/docs/automation/auth-monitoring.md +44 -0
- package/docs/automation/clawflow.md +109 -0
- package/docs/automation/cron-jobs.md +744 -0
- package/docs/automation/cron-vs-heartbeat.md +299 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/hooks.md +1375 -0
- package/docs/automation/index.md +69 -0
- package/docs/automation/poll.md +86 -0
- package/docs/automation/standing-orders.md +254 -0
- package/docs/automation/tasks.md +247 -0
- package/docs/automation/troubleshooting.md +122 -0
- package/docs/automation/webhook.md +217 -0
- package/docs/brave-search.md +93 -0
- package/docs/channels/bluebubbles.md +430 -0
- package/docs/channels/broadcast-groups.md +442 -0
- package/docs/channels/channel-routing.md +139 -0
- package/docs/channels/discord.md +1240 -0
- package/docs/channels/feishu.md +760 -0
- package/docs/channels/googlechat.md +270 -0
- package/docs/channels/group-messages.md +84 -0
- package/docs/channels/groups.md +385 -0
- package/docs/channels/imessage.md +427 -0
- package/docs/channels/index.md +50 -0
- package/docs/channels/irc.md +250 -0
- package/docs/channels/line.md +221 -0
- package/docs/channels/location.md +56 -0
- package/docs/channels/matrix.md +779 -0
- package/docs/channels/mattermost.md +435 -0
- package/docs/channels/msteams.md +802 -0
- package/docs/channels/nextcloud-talk.md +146 -0
- package/docs/channels/nostr.md +257 -0
- package/docs/channels/pairing.md +114 -0
- package/docs/channels/qqbot.md +193 -0
- package/docs/channels/signal.md +337 -0
- package/docs/channels/slack.md +607 -0
- package/docs/channels/synology-chat.md +150 -0
- package/docs/channels/telegram.md +991 -0
- package/docs/channels/tlon.md +284 -0
- package/docs/channels/troubleshooting.md +118 -0
- package/docs/channels/twitch.md +387 -0
- package/docs/channels/whatsapp.md +462 -0
- package/docs/channels/zalo.md +251 -0
- package/docs/channels/zalouser.md +189 -0
- package/docs/ci.md +57 -0
- package/docs/cli/acp.md +297 -0
- package/docs/cli/agent.md +29 -0
- package/docs/cli/agents.md +123 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/backup.md +76 -0
- package/docs/cli/browser.md +127 -0
- package/docs/cli/channels.md +102 -0
- package/docs/cli/clawbot.md +21 -0
- package/docs/cli/completion.md +35 -0
- package/docs/cli/config.md +317 -0
- package/docs/cli/configure.md +42 -0
- package/docs/cli/cron.md +80 -0
- package/docs/cli/daemon.md +55 -0
- package/docs/cli/dashboard.md +22 -0
- package/docs/cli/devices.md +139 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +48 -0
- package/docs/cli/flows.md +54 -0
- package/docs/cli/gateway.md +238 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +330 -0
- package/docs/cli/index.md +1239 -0
- package/docs/cli/logs.md +28 -0
- package/docs/cli/mcp.md +467 -0
- package/docs/cli/memory.md +66 -0
- package/docs/cli/message.md +280 -0
- package/docs/cli/models.md +90 -0
- package/docs/cli/node.md +132 -0
- package/docs/cli/nodes.md +55 -0
- package/docs/cli/onboard.md +160 -0
- package/docs/cli/pairing.md +32 -0
- package/docs/cli/plugins.md +229 -0
- package/docs/cli/qr.md +46 -0
- package/docs/cli/reset.md +20 -0
- package/docs/cli/sandbox.md +197 -0
- package/docs/cli/secrets.md +188 -0
- package/docs/cli/security.md +79 -0
- package/docs/cli/sessions.md +110 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +40 -0
- package/docs/cli/status.md +30 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +30 -0
- package/docs/cli/uninstall.md +20 -0
- package/docs/cli/update.md +103 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +166 -0
- package/docs/concepts/agent-workspace.md +243 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +144 -0
- package/docs/concepts/compaction.md +93 -0
- package/docs/concepts/context-engine.md +274 -0
- package/docs/concepts/context.md +179 -0
- package/docs/concepts/delegate-architecture.md +296 -0
- package/docs/concepts/features.md +73 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory-builtin.md +105 -0
- package/docs/concepts/memory-honcho.md +140 -0
- package/docs/concepts/memory-qmd.md +163 -0
- package/docs/concepts/memory-search.md +141 -0
- package/docs/concepts/memory.md +102 -0
- package/docs/concepts/messages.md +161 -0
- package/docs/concepts/model-failover.md +160 -0
- package/docs/concepts/model-providers.md +599 -0
- package/docs/concepts/models.md +232 -0
- package/docs/concepts/multi-agent.md +602 -0
- package/docs/concepts/oauth.md +193 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/session-pruning.md +80 -0
- package/docs/concepts/session-tool.md +84 -0
- package/docs/concepts/session.md +116 -0
- package/docs/concepts/streaming.md +161 -0
- package/docs/concepts/system-prompt.md +132 -0
- package/docs/concepts/timezone.md +97 -0
- package/docs/concepts/typebox.md +291 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/date-time.md +128 -0
- package/docs/debug/node-issue.md +85 -0
- package/docs/diagnostics/flags.md +91 -0
- package/docs/docs.json +2143 -0
- package/docs/gateway/authentication.md +204 -0
- package/docs/gateway/background-process.md +97 -0
- package/docs/gateway/bonjour.md +177 -0
- package/docs/gateway/bridge-protocol.md +86 -0
- package/docs/gateway/cli-backends.md +249 -0
- package/docs/gateway/configuration-examples.md +652 -0
- package/docs/gateway/configuration-reference.md +3384 -0
- package/docs/gateway/configuration.md +633 -0
- package/docs/gateway/discovery.md +127 -0
- package/docs/gateway/doctor.md +463 -0
- package/docs/gateway/gateway-lock.md +37 -0
- package/docs/gateway/health.md +53 -0
- package/docs/gateway/heartbeat.md +407 -0
- package/docs/gateway/index.md +286 -0
- package/docs/gateway/local-models.md +153 -0
- package/docs/gateway/logging.md +113 -0
- package/docs/gateway/multiple-gateways.md +112 -0
- package/docs/gateway/network-model.md +24 -0
- package/docs/gateway/openai-http-api.md +266 -0
- package/docs/gateway/openresponses-http-api.md +322 -0
- package/docs/gateway/openshell.md +307 -0
- package/docs/gateway/pairing.md +99 -0
- package/docs/gateway/protocol.md +280 -0
- package/docs/gateway/remote-gateway-readme.md +160 -0
- package/docs/gateway/remote.md +248 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +134 -0
- package/docs/gateway/sandboxing.md +469 -0
- package/docs/gateway/secrets-plan-contract.md +116 -0
- package/docs/gateway/secrets.md +541 -0
- package/docs/gateway/security/index.md +1216 -0
- package/docs/gateway/tailscale.md +132 -0
- package/docs/gateway/tools-invoke-http-api.md +147 -0
- package/docs/gateway/troubleshooting.md +382 -0
- package/docs/gateway/trusted-proxy-auth.md +342 -0
- package/docs/help/debugging.md +168 -0
- package/docs/help/environment.md +163 -0
- package/docs/help/faq.md +3002 -0
- package/docs/help/index.md +28 -0
- package/docs/help/scripts.md +28 -0
- package/docs/help/testing.md +664 -0
- package/docs/help/troubleshooting.md +352 -0
- package/docs/images/configure-model-picker-unsearchable.png +0 -0
- package/docs/images/feishu-step2-create-app.png +0 -0
- package/docs/images/feishu-step3-credentials.png +0 -0
- package/docs/images/feishu-step4-permissions.png +0 -0
- package/docs/images/feishu-step5-bot-capability.png +0 -0
- package/docs/images/feishu-step6-event-subscription.png +0 -0
- package/docs/images/feishu-verification-token.png +0 -0
- package/docs/images/groups-flow.svg +52 -0
- package/docs/images/mobile-ui-screenshot.png +0 -0
- package/docs/index.md +196 -0
- package/docs/install/ansible.md +230 -0
- package/docs/install/azure.md +311 -0
- package/docs/install/bun.md +55 -0
- package/docs/install/clawdock.md +105 -0
- package/docs/install/development-channels.md +120 -0
- package/docs/install/digitalocean.md +129 -0
- package/docs/install/docker-vm-runtime.md +142 -0
- package/docs/install/docker.md +404 -0
- package/docs/install/exe-dev.md +126 -0
- package/docs/install/fly.md +501 -0
- package/docs/install/gcp.md +402 -0
- package/docs/install/hetzner.md +251 -0
- package/docs/install/index.md +183 -0
- package/docs/install/installer.md +421 -0
- package/docs/install/kubernetes.md +191 -0
- package/docs/install/macos-vm.md +281 -0
- package/docs/install/migrating-matrix.md +346 -0
- package/docs/install/migrating.md +110 -0
- package/docs/install/nix.md +89 -0
- package/docs/install/node.md +144 -0
- package/docs/install/northflank.mdx +40 -0
- package/docs/install/oracle.md +156 -0
- package/docs/install/podman.md +269 -0
- package/docs/install/railway.mdx +87 -0
- package/docs/install/raspberry-pi.md +159 -0
- package/docs/install/render.mdx +159 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +134 -0
- package/docs/ja-JP/index.md +186 -0
- package/docs/ja-JP/start/getting-started.md +125 -0
- package/docs/ja-JP/start/wizard.md +77 -0
- package/docs/logging.md +357 -0
- package/docs/nav-tabs-underline.js +100 -0
- package/docs/network.md +63 -0
- package/docs/nodes/audio.md +187 -0
- package/docs/nodes/camera.md +162 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +395 -0
- package/docs/nodes/location-command.md +98 -0
- package/docs/nodes/media-understanding.md +394 -0
- package/docs/nodes/talk.md +92 -0
- package/docs/nodes/troubleshooting.md +114 -0
- package/docs/nodes/voicewake.md +66 -0
- package/docs/perplexity.md +174 -0
- package/docs/pi-dev.md +80 -0
- package/docs/pi.md +567 -0
- package/docs/platforms/android.md +168 -0
- package/docs/platforms/digitalocean.md +266 -0
- package/docs/platforms/index.md +54 -0
- package/docs/platforms/ios.md +220 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +104 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +50 -0
- package/docs/platforms/mac/remote.md +84 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +34 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +43 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos.md +228 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +412 -0
- package/docs/platforms/windows.md +241 -0
- package/docs/plugins/agent-tools.md +10 -0
- package/docs/plugins/architecture.md +1400 -0
- package/docs/plugins/building-extensions.md +10 -0
- package/docs/plugins/building-plugins.md +283 -0
- package/docs/plugins/bundles.md +278 -0
- package/docs/plugins/community.md +145 -0
- package/docs/plugins/manifest.md +284 -0
- package/docs/plugins/sdk-channel-plugins.md +419 -0
- package/docs/plugins/sdk-entrypoints.md +184 -0
- package/docs/plugins/sdk-migration.md +180 -0
- package/docs/plugins/sdk-overview.md +287 -0
- package/docs/plugins/sdk-provider-plugins.md +440 -0
- package/docs/plugins/sdk-runtime.md +347 -0
- package/docs/plugins/sdk-setup.md +365 -0
- package/docs/plugins/sdk-testing.md +263 -0
- package/docs/plugins/voice-call.md +397 -0
- package/docs/plugins/zalouser.md +78 -0
- package/docs/prose.md +134 -0
- package/docs/providers/anthropic.md +375 -0
- package/docs/providers/bedrock.md +217 -0
- package/docs/providers/claude-max-api-proxy.md +154 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/deepseek.md +53 -0
- package/docs/providers/github-copilot.md +72 -0
- package/docs/providers/glm.md +43 -0
- package/docs/providers/google.md +78 -0
- package/docs/providers/groq.md +96 -0
- package/docs/providers/huggingface.md +209 -0
- package/docs/providers/index.md +72 -0
- package/docs/providers/kilocode.md +74 -0
- package/docs/providers/litellm.md +154 -0
- package/docs/providers/minimax.md +183 -0
- package/docs/providers/mistral.md +54 -0
- package/docs/providers/models.md +45 -0
- package/docs/providers/moonshot.md +175 -0
- package/docs/providers/nvidia.md +55 -0
- package/docs/providers/ollama.md +352 -0
- package/docs/providers/openai.md +319 -0
- package/docs/providers/opencode-go.md +45 -0
- package/docs/providers/opencode.md +64 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/perplexity-provider.md +62 -0
- package/docs/providers/qianfan.md +38 -0
- package/docs/providers/qwen.md +33 -0
- package/docs/providers/qwen_modelstudio.md +85 -0
- package/docs/providers/sglang.md +104 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/together.md +66 -0
- package/docs/providers/venice.md +282 -0
- package/docs/providers/vercel-ai-gateway.md +60 -0
- package/docs/providers/vllm.md +92 -0
- package/docs/providers/volcengine.md +74 -0
- package/docs/providers/xai.md +69 -0
- package/docs/providers/xiaomi.md +86 -0
- package/docs/providers/zai.md +46 -0
- package/docs/reference/AGENTS.default.md +126 -0
- package/docs/reference/RELEASING.md +80 -0
- package/docs/reference/api-usage-costs.md +144 -0
- package/docs/reference/credits.md +30 -0
- package/docs/reference/device-models.md +47 -0
- package/docs/reference/memory-config.md +370 -0
- package/docs/reference/prompt-caching.md +195 -0
- package/docs/reference/rpc.md +43 -0
- package/docs/reference/secretref-credential-surface.md +137 -0
- package/docs/reference/secretref-user-supplied-credentials-matrix.json +535 -0
- package/docs/reference/session-management-compaction.md +326 -0
- package/docs/reference/templates/AGENTS.dev.md +84 -0
- package/docs/reference/templates/AGENTS.md +219 -0
- package/docs/reference/templates/BOOT.md +11 -0
- package/docs/reference/templates/BOOTSTRAP.md +62 -0
- package/docs/reference/templates/HEARTBEAT.md +14 -0
- package/docs/reference/templates/IDENTITY.dev.md +48 -0
- package/docs/reference/templates/IDENTITY.md +30 -0
- package/docs/reference/templates/SOUL.dev.md +77 -0
- package/docs/reference/templates/SOUL.md +43 -0
- package/docs/reference/templates/TOOLS.dev.md +25 -0
- package/docs/reference/templates/TOOLS.md +47 -0
- package/docs/reference/templates/USER.dev.md +19 -0
- package/docs/reference/templates/USER.md +24 -0
- package/docs/reference/test.md +120 -0
- package/docs/reference/token-use.md +175 -0
- package/docs/reference/transcript-hygiene.md +151 -0
- package/docs/reference/wizard.md +235 -0
- package/docs/security/CONTRIBUTING-THREAT-MODEL.md +98 -0
- package/docs/security/THREAT-MODEL-ATLAS.md +608 -0
- package/docs/security/formal-verification.md +167 -0
- package/docs/snippets/plugin-publish/minimal-package.json +16 -0
- package/docs/snippets/plugin-publish/minimal-vora.plugin.json +9 -0
- package/docs/start/bootstrapping.md +41 -0
- package/docs/start/docs-directory.md +66 -0
- package/docs/start/getting-started.md +116 -0
- package/docs/start/hubs.md +198 -0
- package/docs/start/lore.md +219 -0
- package/docs/start/onboarding-overview.md +67 -0
- package/docs/start/onboarding.md +91 -0
- package/docs/start/quickstart.md +22 -0
- package/docs/start/setup.md +164 -0
- package/docs/start/showcase.md +418 -0
- package/docs/start/vora.md +224 -0
- package/docs/start/wizard-cli-automation.md +215 -0
- package/docs/start/wizard-cli-reference.md +302 -0
- package/docs/start/wizard.md +125 -0
- package/docs/style.css +37 -0
- package/docs/tools/acp-agents.md +772 -0
- package/docs/tools/agent-send.md +100 -0
- package/docs/tools/apply-patch.md +52 -0
- package/docs/tools/brave-search.md +97 -0
- package/docs/tools/browser-linux-troubleshooting.md +138 -0
- package/docs/tools/browser-login.md +73 -0
- package/docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +211 -0
- package/docs/tools/browser.md +824 -0
- package/docs/tools/btw.md +142 -0
- package/docs/tools/capability-cookbook.md +119 -0
- package/docs/tools/clawhub.md +336 -0
- package/docs/tools/code-execution.md +90 -0
- package/docs/tools/creating-skills.md +117 -0
- package/docs/tools/diffs.md +388 -0
- package/docs/tools/duckduckgo-search.md +101 -0
- package/docs/tools/elevated.md +114 -0
- package/docs/tools/exa-search.md +127 -0
- package/docs/tools/exec-approvals.md +502 -0
- package/docs/tools/exec.md +217 -0
- package/docs/tools/firecrawl.md +144 -0
- package/docs/tools/gemini-search.md +93 -0
- package/docs/tools/grok-search.md +98 -0
- package/docs/tools/image-generation.md +125 -0
- package/docs/tools/index.md +140 -0
- package/docs/tools/kimi-search.md +73 -0
- package/docs/tools/llm-task.md +119 -0
- package/docs/tools/lobster.md +348 -0
- package/docs/tools/loop-detection.md +100 -0
- package/docs/tools/multi-agent-sandbox-tools.md +364 -0
- package/docs/tools/pdf.md +161 -0
- package/docs/tools/perplexity-search.md +178 -0
- package/docs/tools/plugin.md +291 -0
- package/docs/tools/reactions.md +64 -0
- package/docs/tools/skills-config.md +95 -0
- package/docs/tools/skills.md +331 -0
- package/docs/tools/slash-commands.md +315 -0
- package/docs/tools/subagents.md +296 -0
- package/docs/tools/tavily.md +129 -0
- package/docs/tools/thinking.md +96 -0
- package/docs/tools/tts.md +416 -0
- package/docs/tools/web-fetch.md +135 -0
- package/docs/tools/web.md +362 -0
- package/docs/tts.md +416 -0
- package/docs/vps.md +112 -0
- package/docs/web/control-ui.md +285 -0
- package/docs/web/dashboard.md +56 -0
- package/docs/web/index.md +120 -0
- package/docs/web/tui.md +175 -0
- package/docs/web/webchat.md +65 -0
- package/docs/whatsapp-vora-ai-zh.jpg +0 -0
- package/docs/whatsapp-vora.jpg +0 -0
- package/docs/zh-CN/AGENTS.md +61 -0
- package/docs/zh-CN/automation/auth-monitoring.md +47 -0
- package/docs/zh-CN/automation/cron-jobs.md +435 -0
- package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
- package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
- package/docs/zh-CN/automation/hooks.md +1051 -0
- package/docs/zh-CN/automation/poll.md +76 -0
- package/docs/zh-CN/automation/troubleshooting.md +8 -0
- package/docs/zh-CN/automation/webhook.md +163 -0
- package/docs/zh-CN/brave-search.md +60 -0
- package/docs/zh-CN/channels/bluebubbles.md +354 -0
- package/docs/zh-CN/channels/broadcast-groups.md +449 -0
- package/docs/zh-CN/channels/channel-routing.md +117 -0
- package/docs/zh-CN/channels/discord.md +468 -0
- package/docs/zh-CN/channels/feishu.md +728 -0
- package/docs/zh-CN/channels/googlechat.md +257 -0
- package/docs/zh-CN/channels/grammy.md +38 -0
- package/docs/zh-CN/channels/group-messages.md +91 -0
- package/docs/zh-CN/channels/groups.md +379 -0
- package/docs/zh-CN/channels/imessage.md +302 -0
- package/docs/zh-CN/channels/index.md +53 -0
- package/docs/zh-CN/channels/line.md +180 -0
- package/docs/zh-CN/channels/location.md +63 -0
- package/docs/zh-CN/channels/matrix.md +221 -0
- package/docs/zh-CN/channels/mattermost.md +144 -0
- package/docs/zh-CN/channels/msteams.md +775 -0
- package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
- package/docs/zh-CN/channels/nostr.md +249 -0
- package/docs/zh-CN/channels/pairing.md +89 -0
- package/docs/zh-CN/channels/signal.md +209 -0
- package/docs/zh-CN/channels/slack.md +531 -0
- package/docs/zh-CN/channels/synology-chat.md +138 -0
- package/docs/zh-CN/channels/telegram.md +751 -0
- package/docs/zh-CN/channels/tlon.md +136 -0
- package/docs/zh-CN/channels/troubleshooting.md +36 -0
- package/docs/zh-CN/channels/twitch.md +385 -0
- package/docs/zh-CN/channels/whatsapp.md +411 -0
- package/docs/zh-CN/channels/zalo.md +196 -0
- package/docs/zh-CN/channels/zalouser.md +147 -0
- package/docs/zh-CN/cli/acp.md +173 -0
- package/docs/zh-CN/cli/agent.md +30 -0
- package/docs/zh-CN/cli/agents.md +82 -0
- package/docs/zh-CN/cli/approvals.md +57 -0
- package/docs/zh-CN/cli/browser.md +114 -0
- package/docs/zh-CN/cli/channels.md +86 -0
- package/docs/zh-CN/cli/config.md +57 -0
- package/docs/zh-CN/cli/configure.md +38 -0
- package/docs/zh-CN/cli/cron.md +43 -0
- package/docs/zh-CN/cli/dashboard.md +23 -0
- package/docs/zh-CN/cli/devices.md +74 -0
- package/docs/zh-CN/cli/directory.md +70 -0
- package/docs/zh-CN/cli/dns.md +30 -0
- package/docs/zh-CN/cli/docs.md +22 -0
- package/docs/zh-CN/cli/doctor.md +48 -0
- package/docs/zh-CN/cli/gateway.md +206 -0
- package/docs/zh-CN/cli/health.md +28 -0
- package/docs/zh-CN/cli/hooks.md +298 -0
- package/docs/zh-CN/cli/index.md +1142 -0
- package/docs/zh-CN/cli/logs.md +31 -0
- package/docs/zh-CN/cli/memory.md +52 -0
- package/docs/zh-CN/cli/message.md +246 -0
- package/docs/zh-CN/cli/models.md +85 -0
- package/docs/zh-CN/cli/node.md +115 -0
- package/docs/zh-CN/cli/nodes.md +62 -0
- package/docs/zh-CN/cli/onboard.md +164 -0
- package/docs/zh-CN/cli/pairing.md +28 -0
- package/docs/zh-CN/cli/plugins.md +66 -0
- package/docs/zh-CN/cli/reset.md +24 -0
- package/docs/zh-CN/cli/sandbox.md +158 -0
- package/docs/zh-CN/cli/security.md +33 -0
- package/docs/zh-CN/cli/sessions.md +23 -0
- package/docs/zh-CN/cli/setup.md +36 -0
- package/docs/zh-CN/cli/skills.md +33 -0
- package/docs/zh-CN/cli/status.md +33 -0
- package/docs/zh-CN/cli/system.md +63 -0
- package/docs/zh-CN/cli/tui.md +30 -0
- package/docs/zh-CN/cli/uninstall.md +24 -0
- package/docs/zh-CN/cli/update.md +101 -0
- package/docs/zh-CN/cli/voicecall.md +41 -0
- package/docs/zh-CN/cli/webhooks.md +32 -0
- package/docs/zh-CN/concepts/agent-loop.md +146 -0
- package/docs/zh-CN/concepts/agent-workspace.md +219 -0
- package/docs/zh-CN/concepts/agent.md +115 -0
- package/docs/zh-CN/concepts/architecture.md +123 -0
- package/docs/zh-CN/concepts/compaction.md +67 -0
- package/docs/zh-CN/concepts/context.md +168 -0
- package/docs/zh-CN/concepts/features.md +59 -0
- package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
- package/docs/zh-CN/concepts/memory.md +412 -0
- package/docs/zh-CN/concepts/messages.md +141 -0
- package/docs/zh-CN/concepts/model-failover.md +145 -0
- package/docs/zh-CN/concepts/model-providers.md +589 -0
- package/docs/zh-CN/concepts/models.md +225 -0
- package/docs/zh-CN/concepts/multi-agent.md +372 -0
- package/docs/zh-CN/concepts/oauth.md +164 -0
- package/docs/zh-CN/concepts/presence.md +99 -0
- package/docs/zh-CN/concepts/queue.md +94 -0
- package/docs/zh-CN/concepts/retry.md +76 -0
- package/docs/zh-CN/concepts/session-pruning.md +129 -0
- package/docs/zh-CN/concepts/session-tool.md +200 -0
- package/docs/zh-CN/concepts/session.md +166 -0
- package/docs/zh-CN/concepts/streaming.md +133 -0
- package/docs/zh-CN/concepts/system-prompt.md +101 -0
- package/docs/zh-CN/concepts/timezone.md +96 -0
- package/docs/zh-CN/concepts/typebox.md +284 -0
- package/docs/zh-CN/concepts/typing-indicators.md +74 -0
- package/docs/zh-CN/concepts/usage-tracking.md +42 -0
- package/docs/zh-CN/date-time.md +129 -0
- package/docs/zh-CN/debug/node-issue.md +90 -0
- package/docs/zh-CN/diagnostics/flags.md +98 -0
- package/docs/zh-CN/gateway/authentication.md +184 -0
- package/docs/zh-CN/gateway/background-process.md +100 -0
- package/docs/zh-CN/gateway/bonjour.md +174 -0
- package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
- package/docs/zh-CN/gateway/cli-backends.md +213 -0
- package/docs/zh-CN/gateway/configuration-examples.md +587 -0
- package/docs/zh-CN/gateway/configuration-reference.md +3103 -0
- package/docs/zh-CN/gateway/configuration.md +640 -0
- package/docs/zh-CN/gateway/discovery.md +123 -0
- package/docs/zh-CN/gateway/doctor.md +238 -0
- package/docs/zh-CN/gateway/gateway-lock.md +41 -0
- package/docs/zh-CN/gateway/health.md +42 -0
- package/docs/zh-CN/gateway/heartbeat.md +274 -0
- package/docs/zh-CN/gateway/index.md +335 -0
- package/docs/zh-CN/gateway/local-models.md +159 -0
- package/docs/zh-CN/gateway/logging.md +114 -0
- package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
- package/docs/zh-CN/gateway/network-model.md +23 -0
- package/docs/zh-CN/gateway/openai-http-api.md +125 -0
- package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
- package/docs/zh-CN/gateway/pairing.md +99 -0
- package/docs/zh-CN/gateway/protocol.md +220 -0
- package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
- package/docs/zh-CN/gateway/remote.md +133 -0
- package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
- package/docs/zh-CN/gateway/sandboxing.md +188 -0
- package/docs/zh-CN/gateway/security/index.md +777 -0
- package/docs/zh-CN/gateway/tailscale.md +124 -0
- package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
- package/docs/zh-CN/gateway/troubleshooting.md +771 -0
- package/docs/zh-CN/help/debugging.md +160 -0
- package/docs/zh-CN/help/environment.md +88 -0
- package/docs/zh-CN/help/faq.md +2640 -0
- package/docs/zh-CN/help/index.md +28 -0
- package/docs/zh-CN/help/scripts.md +35 -0
- package/docs/zh-CN/help/testing.md +375 -0
- package/docs/zh-CN/help/troubleshooting.md +104 -0
- package/docs/zh-CN/index.md +186 -0
- package/docs/zh-CN/install/ansible.md +215 -0
- package/docs/zh-CN/install/bun.md +65 -0
- package/docs/zh-CN/install/development-channels.md +81 -0
- package/docs/zh-CN/install/docker.md +532 -0
- package/docs/zh-CN/install/exe-dev.md +133 -0
- package/docs/zh-CN/install/fly.md +490 -0
- package/docs/zh-CN/install/gcp.md +510 -0
- package/docs/zh-CN/install/hetzner.md +337 -0
- package/docs/zh-CN/install/index.md +235 -0
- package/docs/zh-CN/install/installer.md +422 -0
- package/docs/zh-CN/install/macos-vm.md +288 -0
- package/docs/zh-CN/install/migrating.md +199 -0
- package/docs/zh-CN/install/nix.md +99 -0
- package/docs/zh-CN/install/node.md +8 -0
- package/docs/zh-CN/install/northflank.mdx +60 -0
- package/docs/zh-CN/install/railway.mdx +106 -0
- package/docs/zh-CN/install/render.mdx +169 -0
- package/docs/zh-CN/install/uninstall.md +135 -0
- package/docs/zh-CN/install/updating.md +233 -0
- package/docs/zh-CN/logging.md +329 -0
- package/docs/zh-CN/network.md +59 -0
- package/docs/zh-CN/nodes/audio.md +120 -0
- package/docs/zh-CN/nodes/camera.md +162 -0
- package/docs/zh-CN/nodes/images.md +79 -0
- package/docs/zh-CN/nodes/index.md +350 -0
- package/docs/zh-CN/nodes/location-command.md +120 -0
- package/docs/zh-CN/nodes/media-understanding.md +380 -0
- package/docs/zh-CN/nodes/talk.md +97 -0
- package/docs/zh-CN/nodes/troubleshooting.md +8 -0
- package/docs/zh-CN/nodes/voicewake.md +72 -0
- package/docs/zh-CN/perplexity.md +102 -0
- package/docs/zh-CN/pi-dev.md +87 -0
- package/docs/zh-CN/pi.md +571 -0
- package/docs/zh-CN/platforms/android.md +155 -0
- package/docs/zh-CN/platforms/digitalocean.md +273 -0
- package/docs/zh-CN/platforms/index.md +60 -0
- package/docs/zh-CN/platforms/ios.md +114 -0
- package/docs/zh-CN/platforms/linux.md +100 -0
- package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
- package/docs/zh-CN/platforms/mac/canvas.md +128 -0
- package/docs/zh-CN/platforms/mac/child-process.md +73 -0
- package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
- package/docs/zh-CN/platforms/mac/health.md +41 -0
- package/docs/zh-CN/platforms/mac/icon.md +38 -0
- package/docs/zh-CN/platforms/mac/logging.md +64 -0
- package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
- package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
- package/docs/zh-CN/platforms/mac/permissions.md +46 -0
- package/docs/zh-CN/platforms/mac/remote.md +90 -0
- package/docs/zh-CN/platforms/mac/signing.md +54 -0
- package/docs/zh-CN/platforms/mac/skills.md +40 -0
- package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
- package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
- package/docs/zh-CN/platforms/mac/webchat.md +43 -0
- package/docs/zh-CN/platforms/mac/xpc.md +68 -0
- package/docs/zh-CN/platforms/macos.md +193 -0
- package/docs/zh-CN/platforms/oracle.md +310 -0
- package/docs/zh-CN/platforms/raspberry-pi.md +416 -0
- package/docs/zh-CN/platforms/windows.md +247 -0
- package/docs/zh-CN/plugins/agent-tools.md +99 -0
- package/docs/zh-CN/plugins/manifest.md +68 -0
- package/docs/zh-CN/plugins/voice-call.md +250 -0
- package/docs/zh-CN/plugins/zalouser.md +88 -0
- package/docs/zh-CN/prose.md +141 -0
- package/docs/zh-CN/providers/anthropic.md +265 -0
- package/docs/zh-CN/providers/bedrock.md +170 -0
- package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
- package/docs/zh-CN/providers/cloudflare-ai-gateway.md +78 -0
- package/docs/zh-CN/providers/deepgram.md +97 -0
- package/docs/zh-CN/providers/github-copilot.md +67 -0
- package/docs/zh-CN/providers/glm.md +50 -0
- package/docs/zh-CN/providers/huggingface.md +216 -0
- package/docs/zh-CN/providers/index.md +69 -0
- package/docs/zh-CN/providers/kilocode.md +80 -0
- package/docs/zh-CN/providers/litellm.md +160 -0
- package/docs/zh-CN/providers/minimax.md +222 -0
- package/docs/zh-CN/providers/mistral.md +61 -0
- package/docs/zh-CN/providers/models.md +51 -0
- package/docs/zh-CN/providers/moonshot.md +182 -0
- package/docs/zh-CN/providers/nvidia.md +62 -0
- package/docs/zh-CN/providers/ollama.md +359 -0
- package/docs/zh-CN/providers/openai.md +308 -0
- package/docs/zh-CN/providers/opencode-go.md +52 -0
- package/docs/zh-CN/providers/opencode.md +71 -0
- package/docs/zh-CN/providers/openrouter.md +44 -0
- package/docs/zh-CN/providers/qianfan.md +45 -0
- package/docs/zh-CN/providers/qwen.md +36 -0
- package/docs/zh-CN/providers/sglang.md +111 -0
- package/docs/zh-CN/providers/synthetic.md +106 -0
- package/docs/zh-CN/providers/together.md +72 -0
- package/docs/zh-CN/providers/venice.md +289 -0
- package/docs/zh-CN/providers/vercel-ai-gateway.md +66 -0
- package/docs/zh-CN/providers/xiaomi.md +93 -0
- package/docs/zh-CN/providers/zai.md +53 -0
- package/docs/zh-CN/reference/AGENTS.default.md +131 -0
- package/docs/zh-CN/reference/RELEASING.md +48 -0
- package/docs/zh-CN/reference/api-usage-costs.md +141 -0
- package/docs/zh-CN/reference/credits.md +34 -0
- package/docs/zh-CN/reference/device-models.md +54 -0
- package/docs/zh-CN/reference/rpc.md +48 -0
- package/docs/zh-CN/reference/session-management-compaction.md +287 -0
- package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
- package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
- package/docs/zh-CN/reference/templates/BOOT.md +17 -0
- package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
- package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
- package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
- package/docs/zh-CN/reference/templates/IDENTITY.md +36 -0
- package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
- package/docs/zh-CN/reference/templates/SOUL.md +49 -0
- package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
- package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
- package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
- package/docs/zh-CN/reference/templates/USER.md +30 -0
- package/docs/zh-CN/reference/test.md +57 -0
- package/docs/zh-CN/reference/token-use.md +119 -0
- package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
- package/docs/zh-CN/reference/wizard.md +242 -0
- package/docs/zh-CN/security/formal-verification.md +171 -0
- package/docs/zh-CN/start/bootstrapping.md +9 -0
- package/docs/zh-CN/start/docs-directory.md +70 -0
- package/docs/zh-CN/start/getting-started.md +143 -0
- package/docs/zh-CN/start/hubs.md +194 -0
- package/docs/zh-CN/start/lore.md +226 -0
- package/docs/zh-CN/start/onboarding-overview.md +58 -0
- package/docs/zh-CN/start/onboarding.md +105 -0
- package/docs/zh-CN/start/quickstart.md +88 -0
- package/docs/zh-CN/start/setup.md +153 -0
- package/docs/zh-CN/start/showcase.md +423 -0
- package/docs/zh-CN/start/vora.md +248 -0
- package/docs/zh-CN/start/wizard-cli-automation.md +222 -0
- package/docs/zh-CN/start/wizard-cli-reference.md +306 -0
- package/docs/zh-CN/start/wizard.md +132 -0
- package/docs/zh-CN/tools/agent-send.md +59 -0
- package/docs/zh-CN/tools/apply-patch.md +57 -0
- package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
- package/docs/zh-CN/tools/browser-login.md +75 -0
- package/docs/zh-CN/tools/browser.md +553 -0
- package/docs/zh-CN/tools/chrome-extension.md +183 -0
- package/docs/zh-CN/tools/clawhub.md +225 -0
- package/docs/zh-CN/tools/creating-skills.md +61 -0
- package/docs/zh-CN/tools/diffs.md +393 -0
- package/docs/zh-CN/tools/elevated.md +64 -0
- package/docs/zh-CN/tools/exec-approvals.md +234 -0
- package/docs/zh-CN/tools/exec.md +169 -0
- package/docs/zh-CN/tools/firecrawl.md +68 -0
- package/docs/zh-CN/tools/index.md +514 -0
- package/docs/zh-CN/tools/llm-task.md +117 -0
- package/docs/zh-CN/tools/lobster.md +349 -0
- package/docs/zh-CN/tools/multi-agent-sandbox-tools.md +401 -0
- package/docs/zh-CN/tools/plugin.md +1610 -0
- package/docs/zh-CN/tools/reactions.md +29 -0
- package/docs/zh-CN/tools/skills-config.md +78 -0
- package/docs/zh-CN/tools/skills.md +279 -0
- package/docs/zh-CN/tools/slash-commands.md +205 -0
- package/docs/zh-CN/tools/subagents.md +167 -0
- package/docs/zh-CN/tools/thinking.md +80 -0
- package/docs/zh-CN/tools/web.md +289 -0
- package/docs/zh-CN/tts.md +375 -0
- package/docs/zh-CN/vps.md +47 -0
- package/docs/zh-CN/web/control-ui.md +191 -0
- package/docs/zh-CN/web/dashboard.md +53 -0
- package/docs/zh-CN/web/index.md +118 -0
- package/docs/zh-CN/web/tui.md +166 -0
- package/docs/zh-CN/web/webchat.md +56 -0
- package/package.json +1305 -0
- package/scripts/postinstall-bundled-plugins.mjs +166 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +199 -0
- package/skills/clawflow/SKILL.md +76 -0
- package/skills/clawflow/examples/inbox-triage.lobster +33 -0
- package/skills/clawflow/examples/pr-intake.lobster +32 -0
- package/skills/clawflow-inbox-triage/SKILL.md +62 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +316 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +885 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +320 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +62 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +88 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +151 -0
- package/skills/sherpa-onnx-tts/SKILL.md +109 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +170 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +108 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +129 -0
- package/skills/xurl/SKILL.md +461 -0
- package/vora.mjs +183 -0
|
@@ -0,0 +1,3597 @@
|
|
|
1
|
+
import { d as normalizeUsageDisplay, p as resolveResponseUsageMode, s as normalizeFastMode } from "./thinking.shared-C4SN38qn.js";
|
|
2
|
+
import { r as logVerbose } from "./globals-DNhziPZz.js";
|
|
3
|
+
import { i as clampInt, v as resolveUserPath } from "./utils-BiWzD1kh.js";
|
|
4
|
+
import { _ as normalizeAccountId, v as normalizeOptionalAccountId } from "./session-key-BIrdMs11.js";
|
|
5
|
+
import { r as normalizeStringEntries } from "./string-normalization-k4ilMPRu.js";
|
|
6
|
+
import { v as resolveSessionAgentId } from "./agent-scope-BsqFyt8u.js";
|
|
7
|
+
import { A as setConfigValueAtPath, D as unsetConfigOverride, E as setConfigOverride, L as validateConfigObjectWithPlugins, O as getConfigValueAtPath, T as resetConfigOverrides, f as readConfigFileSnapshot, j as unsetConfigValueAtPath, k as parseConfigPath, w as getConfigOverrides, x as writeConfigFile } from "./io-B07IaARR.js";
|
|
8
|
+
import { o as normalizeChannelId } from "./registry-CiuAeUhZ.js";
|
|
9
|
+
import { t as clearPluginManifestRegistryCache } from "./manifest-registry-CVwreH55.js";
|
|
10
|
+
import { t as parseDurationMs } from "./parse-duration-FGYGEVrK.js";
|
|
11
|
+
import { t as resolveAccountEntry } from "./account-lookup-C6jbidQL.js";
|
|
12
|
+
import "./config-CKbWnj3S.js";
|
|
13
|
+
import { _ as GATEWAY_CLIENT_NAMES, d as normalizeMessageChannel, g as GATEWAY_CLIENT_MODES, o as isInternalMessageChannel } from "./message-channel-Di9LQZCg.js";
|
|
14
|
+
import { r as loadSessionStore, u as updateSessionStore } from "./store-DKzOIKqx.js";
|
|
15
|
+
import { t as getChannelPlugin } from "./registry-CJH_346k.js";
|
|
16
|
+
import "./plugins-BUhqQahf.js";
|
|
17
|
+
import "./sessions-zgiFsm1E.js";
|
|
18
|
+
import { i as resolveSessionFilePathOptions, l as resolveStorePath, r as resolveSessionFilePath } from "./paths-dFp6bjkV.js";
|
|
19
|
+
import { a as resolveFreshSessionTotalTokens } from "./types-KyI2zD1Y.js";
|
|
20
|
+
import { tn as ErrorCodes } from "./method-scopes-1fMDkPgy.js";
|
|
21
|
+
import { r as callGateway } from "./call-CYGZtInt.js";
|
|
22
|
+
import { r as isRestartEnabled, t as isCommandFlagEnabled } from "./commands-BNN8qnEq.js";
|
|
23
|
+
import { a as readChannelAllowFromStore, l as removeChannelAllowFromStoreEntry, t as addChannelAllowFromStoreEntry } from "./pairing-store-BgSXc67b.js";
|
|
24
|
+
import { r as getSessionBindingService } from "./session-binding-service-BqY1J7gs.js";
|
|
25
|
+
import { n as createInternalHookEvent, p as triggerInternalHook } from "./internal-hooks-BbEvCG0I.js";
|
|
26
|
+
import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-4V1cP6C-.js";
|
|
27
|
+
import { D as spawnSubagentDirect, G as buildSubagentList, It as abortEmbeddedPiRun, K as killAllControlledSubagentRuns, M as findTaskByRunIdForOwner, Ot as formatRunLabel, Q as steerControlledSubagentRun, Qt as triggerVoraRestart, R as formatContextUsageShort, Rt as getActiveEmbeddedRunSnapshot, Ut as waitForEmbeddedPiRunEnd, Y as listControlledSubagentRuns, Yt as scheduleGatewaySigusr1Restart, Z as sendControlledSubagentMessage, et as countPendingDescendantRuns, gn as getSession, h as stripToolResultDetails, hn as getFinishedSession, jt as sortSubagentRuns, l as compactEmbeddedPiSession, on as createExecTool, q as killControlledSubagentRun, tn as stripToolMessages, z as formatTokenCount, zt as isEmbeddedPiRunActive } from "./vora-embedded-runner-CtRc9sK4.js";
|
|
28
|
+
import { t as diag } from "./diagnostic-BYcJF51S.js";
|
|
29
|
+
import { D as resolveFastModeState, s as clearSessionQueues } from "./content-blocks-DdN51R-1.js";
|
|
30
|
+
import { C as textToSpeech, _ as setSummarizationEnabled, a as getTtsMaxLength, b as setTtsMaxLength, c as isTtsEnabled, g as setLastTtsAttempt, i as getResolvedSpeechProviderConfig, l as isTtsProviderConfigured, m as resolveTtsPrefsPath, o as getTtsProvider, p as resolveTtsConfig, r as getLastTtsAttempt, s as isSummarizationEnabled, x as setTtsProvider, y as setTtsEnabled } from "./tts-DUrUS0mZ.js";
|
|
31
|
+
import { n as resolveSandboxRuntimeStatus } from "./runtime-status-C7QK-Xow.js";
|
|
32
|
+
import "./thinking-uI0siSaD.js";
|
|
33
|
+
import { t as requireApiKey } from "./model-auth-runtime-shared-C6EfNsiC.js";
|
|
34
|
+
import { n as getApiKeyForModel } from "./model-auth-FAjaPIyj.js";
|
|
35
|
+
import { t as ensureVoraModelsJson } from "./models-config-WznILp-f.js";
|
|
36
|
+
import { n as setPluginEnabledInConfig } from "./enable-1JBZrsl3.js";
|
|
37
|
+
import { i as unsetConfiguredMcpServer, r as setConfiguredMcpServer, t as listConfiguredMcpServers } from "./mcp-config-Bul9F_lO.js";
|
|
38
|
+
import { r as enqueueSystemEvent } from "./system-events-CkTr2pVV.js";
|
|
39
|
+
import "./sandbox-DxQGIkI1.js";
|
|
40
|
+
import { t as formatDurationCompact } from "./format-duration-3-yx54b_.js";
|
|
41
|
+
import { n as parseActivationCommand } from "./group-activation-BwfaA0gP.js";
|
|
42
|
+
import { i as matchPluginCommand, n as executePluginCommand } from "./commands-rHJt1A27.js";
|
|
43
|
+
import { a as formatTokenCount$1, o as formatUsd } from "./strip-inbound-meta-DuOzaKMB.js";
|
|
44
|
+
import { p as normalizeCommandBody } from "./commands-registry-DsvlObRs.js";
|
|
45
|
+
import { r as resolveAcpThreadSessionDetailLines, t as EmbeddedBlockChunker } from "./vora-embedded-block-chunker-3yyZObTq.js";
|
|
46
|
+
import { c as resolveThreadBindingIdleTimeoutMsForChannel, d as resolveThreadBindingMaxAgeMsForChannel, g as formatThreadBindingDurationLabel, i as formatThreadBindingSpawnDisabledError, p as resolveThreadBindingSpawnPolicy, r as formatThreadBindingDisabledError, v as resolveThreadBindingIntroText, y as resolveThreadBindingThreadName } from "./thread-bindings-policy-BcpXmcKL.js";
|
|
47
|
+
import { t as readAcpSessionEntry } from "./session-meta-5PkRqQxG.js";
|
|
48
|
+
import { i as resolveModelWithRegistry } from "./anthropic-vertex-stream-CDum4sTM.js";
|
|
49
|
+
import { n as createPluginRuntime } from "./runtime-B3T4VytJ.js";
|
|
50
|
+
import { i as setAbortMemory, r as isAbortTrigger } from "./abort-primitives-BkLaStf6.js";
|
|
51
|
+
import { o as stripMentions, s as stripStructuralPrefixes } from "./mentions-D0fLhfbe.js";
|
|
52
|
+
import { a as resolveArchiveKind } from "./archive-BUHAoH49.js";
|
|
53
|
+
import { r as formatElevatedUnavailableMessage } from "./reply-B1wBiwTS.js";
|
|
54
|
+
import { n as resolveSessionAuthProfileOverride } from "./session-override-CqiOQ4Om.js";
|
|
55
|
+
import { a as shouldPersistAbortCutoff, i as resolveAbortCutoffFromContext, t as applyAbortCutoffToSessionEntry } from "./abort-cutoff-BW9X8atp.js";
|
|
56
|
+
import { n as resolveSessionEntryForKey, r as stopSubagentsForRequester, t as formatAbortReplyText } from "./abort-bAEt3OX0.js";
|
|
57
|
+
import { t as extractBtwQuestion } from "./btw-command-NOqYNWtX.js";
|
|
58
|
+
import { n as getSpeechProvider, r as listSpeechProviders, t as canonicalizeSpeechProviderId } from "./provider-registry-7IbNpklR.js";
|
|
59
|
+
import { c as rejectUnauthorizedCommand, l as requireCommandFlagEnabled, o as buildDisabledCommandReply, r as handleModelsCommand, s as rejectNonOwnerCommand, u as requireGatewayClientScopeForInternalChannel } from "./commands-models-DaGXLYpI.js";
|
|
60
|
+
import { S as resolveCommandSurfaceChannel, _ as resolveTelegramConversationId, a as formatLogLines, b as isTelegramSurface, c as resolveCommandSubagentController, d as resolveFocusTargetSession, f as resolveHandledPrefix, g as stopWithText, h as resolveSubagentsAction, i as buildSubagentsHelp, l as resolveDiscordChannelIdForFocus, m as resolveSubagentEntryForToken, o as formatTimestampWithAge, p as resolveRequesterSessionKey, s as loadSubagentSessionEntry, u as resolveDisplayStatus, v as isDiscordSurface, x as resolveChannelAccountId, y as isMatrixSurface } from "./targets-B5CwzJUC.js";
|
|
61
|
+
import { t as handleAcpCommand } from "./commands-acp-DxpRaS_2.js";
|
|
62
|
+
import { a as handleHelpCommand, c as handleWhoamiCommand, i as handleExportSessionCommand, n as handleCommandsListCommand, o as handleStatusCommand, r as handleContextCommand, s as handleToolsCommand } from "./commands-info-9qXzZJZy.js";
|
|
63
|
+
import { i as isTelegramExecApprovalClientEnabled, r as isTelegramExecApprovalAuthorizedSender } from "./exec-approvals-D6Kd1FHX.js";
|
|
64
|
+
import "./api-C8PGNlY8.js";
|
|
65
|
+
import { n as incrementCompactionCount } from "./session-updates-Dd6r5vhZ.js";
|
|
66
|
+
import { t as parseConfigValue } from "./config-value-B0LE9l8u.js";
|
|
67
|
+
import { i as buildNpmInstallRecordFields, n as persistPluginInstall } from "./plugins-install-persist-B4VRDkMW.js";
|
|
68
|
+
import { s as parseClawHubPluginSpec } from "./clawhub-PHPunBYA.js";
|
|
69
|
+
import { i as installPluginFromPath, r as installPluginFromNpmSpec } from "./install-BwbpybtH.js";
|
|
70
|
+
import { r as installPluginFromClawHub } from "./clawhub-BlNkstQC.js";
|
|
71
|
+
import { a as buildPluginStatusReport, i as buildPluginInspectReport, o as formatPluginCompatibilityNotice, t as buildAllPluginInspectReports } from "./status-VHq1HAMM.js";
|
|
72
|
+
import { a as decidePreferredClawHubFallback, f as resolveFileNpmSpecToLocalPath, i as createPluginInstallLogger, n as buildPreferredClawHubSpec } from "./plugins-command-helpers-D0cHWZ8k.js";
|
|
73
|
+
import { n as loadCostUsageSummary, r as loadSessionCostSummary } from "./session-cost-usage-5D6Kkthv.js";
|
|
74
|
+
import fsSync from "node:fs";
|
|
75
|
+
import { streamSimple } from "@mariozechner/pi-ai";
|
|
76
|
+
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
77
|
+
//#region src/channels/plugins/config-writes.ts
|
|
78
|
+
function resolveChannelConfigWrites(params) {
|
|
79
|
+
const channelConfig = resolveChannelConfig(params.cfg, params.channelId);
|
|
80
|
+
if (!channelConfig) return true;
|
|
81
|
+
return (resolveChannelAccountConfig(channelConfig, params.accountId)?.configWrites ?? channelConfig.configWrites) !== false;
|
|
82
|
+
}
|
|
83
|
+
function authorizeConfigWrite(params) {
|
|
84
|
+
if (params.allowBypass) return { allowed: true };
|
|
85
|
+
if (params.target?.kind === "ambiguous") return {
|
|
86
|
+
allowed: false,
|
|
87
|
+
reason: "ambiguous-target"
|
|
88
|
+
};
|
|
89
|
+
if (params.origin?.channelId && !resolveChannelConfigWrites({
|
|
90
|
+
cfg: params.cfg,
|
|
91
|
+
channelId: params.origin.channelId,
|
|
92
|
+
accountId: params.origin.accountId
|
|
93
|
+
})) return {
|
|
94
|
+
allowed: false,
|
|
95
|
+
reason: "origin-disabled",
|
|
96
|
+
blockedScope: {
|
|
97
|
+
kind: "origin",
|
|
98
|
+
scope: params.origin
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const seen = /* @__PURE__ */ new Set();
|
|
102
|
+
for (const target of listConfigWriteTargetScopes(params.target)) {
|
|
103
|
+
if (!target.channelId) continue;
|
|
104
|
+
const key = `${target.channelId}:${normalizeAccountId(target.accountId)}`;
|
|
105
|
+
if (seen.has(key)) continue;
|
|
106
|
+
seen.add(key);
|
|
107
|
+
if (!resolveChannelConfigWrites({
|
|
108
|
+
cfg: params.cfg,
|
|
109
|
+
channelId: target.channelId,
|
|
110
|
+
accountId: target.accountId
|
|
111
|
+
})) return {
|
|
112
|
+
allowed: false,
|
|
113
|
+
reason: "target-disabled",
|
|
114
|
+
blockedScope: {
|
|
115
|
+
kind: "target",
|
|
116
|
+
scope: target
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return { allowed: true };
|
|
121
|
+
}
|
|
122
|
+
function resolveExplicitConfigWriteTarget(scope) {
|
|
123
|
+
if (!scope.channelId) return { kind: "global" };
|
|
124
|
+
const accountId = normalizeAccountId(scope.accountId);
|
|
125
|
+
if (!accountId || accountId === "default") return {
|
|
126
|
+
kind: "channel",
|
|
127
|
+
scope: { channelId: scope.channelId }
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
kind: "account",
|
|
131
|
+
scope: {
|
|
132
|
+
channelId: scope.channelId,
|
|
133
|
+
accountId
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function resolveConfigWriteTargetFromPath(path) {
|
|
138
|
+
if (path[0] !== "channels") return { kind: "global" };
|
|
139
|
+
if (path.length < 2) return {
|
|
140
|
+
kind: "ambiguous",
|
|
141
|
+
scopes: []
|
|
142
|
+
};
|
|
143
|
+
const channelId = path[1].trim().toLowerCase();
|
|
144
|
+
if (!channelId) return {
|
|
145
|
+
kind: "ambiguous",
|
|
146
|
+
scopes: []
|
|
147
|
+
};
|
|
148
|
+
if (path.length === 2) return {
|
|
149
|
+
kind: "ambiguous",
|
|
150
|
+
scopes: [{ channelId }]
|
|
151
|
+
};
|
|
152
|
+
if (path[2] !== "accounts") return {
|
|
153
|
+
kind: "channel",
|
|
154
|
+
scope: { channelId }
|
|
155
|
+
};
|
|
156
|
+
if (path.length < 4) return {
|
|
157
|
+
kind: "ambiguous",
|
|
158
|
+
scopes: [{ channelId }]
|
|
159
|
+
};
|
|
160
|
+
return resolveExplicitConfigWriteTarget({
|
|
161
|
+
channelId,
|
|
162
|
+
accountId: normalizeAccountId(path[3])
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function canBypassConfigWritePolicy(params) {
|
|
166
|
+
return isInternalMessageChannel(params.channel) && params.gatewayClientScopes?.includes("operator.admin") === true;
|
|
167
|
+
}
|
|
168
|
+
function formatConfigWriteDeniedMessage(params) {
|
|
169
|
+
if (params.result.reason === "ambiguous-target") return "ā ļø Channel-initiated /config writes cannot replace channels, channel roots, or accounts collections. Use a more specific path or gateway operator.admin.";
|
|
170
|
+
const blocked = params.result.blockedScope?.scope;
|
|
171
|
+
return `ā ļø Config writes are disabled for ${blocked?.channelId ?? params.fallbackChannelId ?? "this channel"}. Set ${blocked?.channelId ? blocked.accountId ? `channels.${blocked.channelId}.accounts.${blocked.accountId}.configWrites=true` : `channels.${blocked.channelId}.configWrites=true` : params.fallbackChannelId ? `channels.${params.fallbackChannelId}.configWrites=true` : "channels.<channel>.configWrites=true"} to enable.`;
|
|
172
|
+
}
|
|
173
|
+
function listConfigWriteTargetScopes(target) {
|
|
174
|
+
if (!target || target.kind === "global") return [];
|
|
175
|
+
if (target.kind === "ambiguous") return target.scopes;
|
|
176
|
+
return [target.scope];
|
|
177
|
+
}
|
|
178
|
+
function resolveChannelConfig(cfg, channelId) {
|
|
179
|
+
if (!channelId) return;
|
|
180
|
+
return cfg.channels?.[channelId];
|
|
181
|
+
}
|
|
182
|
+
function resolveChannelAccountConfig(channelConfig, accountId) {
|
|
183
|
+
return resolveAccountEntry(channelConfig.accounts, normalizeAccountId(accountId));
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/auto-reply/reply/config-write-authorization.ts
|
|
187
|
+
function resolveConfigWriteDeniedText(params) {
|
|
188
|
+
const writeAuth = authorizeConfigWrite({
|
|
189
|
+
cfg: params.cfg,
|
|
190
|
+
origin: {
|
|
191
|
+
channelId: params.channelId,
|
|
192
|
+
accountId: params.accountId
|
|
193
|
+
},
|
|
194
|
+
target: params.target,
|
|
195
|
+
allowBypass: canBypassConfigWritePolicy({
|
|
196
|
+
channel: params.channel ?? "",
|
|
197
|
+
gatewayClientScopes: params.gatewayClientScopes
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
if (writeAuth.allowed) return null;
|
|
201
|
+
return formatConfigWriteDeniedMessage({
|
|
202
|
+
result: writeAuth,
|
|
203
|
+
fallbackChannelId: params.channelId
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/auto-reply/reply/commands-allowlist.ts
|
|
208
|
+
const ACTIONS = new Set([
|
|
209
|
+
"list",
|
|
210
|
+
"add",
|
|
211
|
+
"remove"
|
|
212
|
+
]);
|
|
213
|
+
const SCOPES = new Set([
|
|
214
|
+
"dm",
|
|
215
|
+
"group",
|
|
216
|
+
"all"
|
|
217
|
+
]);
|
|
218
|
+
function parseAllowlistCommand(raw) {
|
|
219
|
+
const trimmed = raw.trim();
|
|
220
|
+
if (!trimmed.toLowerCase().startsWith("/allowlist")) return null;
|
|
221
|
+
const rest = trimmed.slice(10).trim();
|
|
222
|
+
if (!rest) return {
|
|
223
|
+
action: "list",
|
|
224
|
+
scope: "dm"
|
|
225
|
+
};
|
|
226
|
+
const tokens = rest.split(/\s+/);
|
|
227
|
+
let action = "list";
|
|
228
|
+
let scope = "dm";
|
|
229
|
+
let resolve = false;
|
|
230
|
+
let target = "both";
|
|
231
|
+
let channel;
|
|
232
|
+
let account;
|
|
233
|
+
const entryTokens = [];
|
|
234
|
+
let i = 0;
|
|
235
|
+
if (tokens[i] && ACTIONS.has(tokens[i].toLowerCase())) {
|
|
236
|
+
action = tokens[i].toLowerCase();
|
|
237
|
+
i += 1;
|
|
238
|
+
}
|
|
239
|
+
if (tokens[i] && SCOPES.has(tokens[i].toLowerCase())) {
|
|
240
|
+
scope = tokens[i].toLowerCase();
|
|
241
|
+
i += 1;
|
|
242
|
+
}
|
|
243
|
+
for (; i < tokens.length; i += 1) {
|
|
244
|
+
const token = tokens[i];
|
|
245
|
+
const lowered = token.toLowerCase();
|
|
246
|
+
if (lowered === "--resolve" || lowered === "resolve") {
|
|
247
|
+
resolve = true;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (lowered === "--config" || lowered === "config") {
|
|
251
|
+
target = "config";
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (lowered === "--store" || lowered === "store") {
|
|
255
|
+
target = "store";
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (lowered === "--channel" && tokens[i + 1]) {
|
|
259
|
+
channel = tokens[i + 1];
|
|
260
|
+
i += 1;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (lowered === "--account" && tokens[i + 1]) {
|
|
264
|
+
account = tokens[i + 1];
|
|
265
|
+
i += 1;
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
const kv = token.split("=");
|
|
269
|
+
if (kv.length === 2) {
|
|
270
|
+
const key = kv[0]?.trim().toLowerCase();
|
|
271
|
+
const value = kv[1]?.trim();
|
|
272
|
+
if (key === "channel") {
|
|
273
|
+
if (value) channel = value;
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
if (key === "account") {
|
|
277
|
+
if (value) account = value;
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (key === "scope" && value && SCOPES.has(value.toLowerCase())) {
|
|
281
|
+
scope = value.toLowerCase();
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
entryTokens.push(token);
|
|
286
|
+
}
|
|
287
|
+
if (action === "add" || action === "remove") {
|
|
288
|
+
const entry = entryTokens.join(" ").trim();
|
|
289
|
+
if (!entry) return {
|
|
290
|
+
action: "error",
|
|
291
|
+
message: "Usage: /allowlist add|remove <entry>"
|
|
292
|
+
};
|
|
293
|
+
return {
|
|
294
|
+
action,
|
|
295
|
+
scope,
|
|
296
|
+
entry,
|
|
297
|
+
channel,
|
|
298
|
+
account,
|
|
299
|
+
resolve,
|
|
300
|
+
target
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
action: "list",
|
|
305
|
+
scope,
|
|
306
|
+
channel,
|
|
307
|
+
account,
|
|
308
|
+
resolve
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function normalizeAllowFrom(params) {
|
|
312
|
+
const plugin = getChannelPlugin(params.channelId);
|
|
313
|
+
if (plugin?.config.formatAllowFrom) return plugin.config.formatAllowFrom({
|
|
314
|
+
cfg: params.cfg,
|
|
315
|
+
accountId: params.accountId,
|
|
316
|
+
allowFrom: params.values
|
|
317
|
+
});
|
|
318
|
+
return normalizeStringEntries(params.values);
|
|
319
|
+
}
|
|
320
|
+
function formatEntryList(entries, resolved) {
|
|
321
|
+
if (entries.length === 0) return "(none)";
|
|
322
|
+
return entries.map((entry) => {
|
|
323
|
+
const name = resolved?.get(entry);
|
|
324
|
+
return name ? `${entry} (${name})` : entry;
|
|
325
|
+
}).join(", ");
|
|
326
|
+
}
|
|
327
|
+
async function updatePairingStoreAllowlist(params) {
|
|
328
|
+
const storeEntry = {
|
|
329
|
+
channel: params.channelId,
|
|
330
|
+
entry: params.entry,
|
|
331
|
+
accountId: params.accountId
|
|
332
|
+
};
|
|
333
|
+
if (params.action === "add") {
|
|
334
|
+
await addChannelAllowFromStoreEntry(storeEntry);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
await removeChannelAllowFromStoreEntry(storeEntry);
|
|
338
|
+
if (params.accountId === "default") await removeChannelAllowFromStoreEntry({
|
|
339
|
+
channel: params.channelId,
|
|
340
|
+
entry: params.entry
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function mapResolvedAllowlistNames(entries) {
|
|
344
|
+
const map = /* @__PURE__ */ new Map();
|
|
345
|
+
for (const entry of entries) if (entry.resolved && entry.name) map.set(entry.input, entry.name);
|
|
346
|
+
return map;
|
|
347
|
+
}
|
|
348
|
+
async function resolveAllowlistNames(params) {
|
|
349
|
+
return mapResolvedAllowlistNames(await getChannelPlugin(params.channelId)?.allowlist?.resolveNames?.({
|
|
350
|
+
cfg: params.cfg,
|
|
351
|
+
accountId: params.accountId,
|
|
352
|
+
scope: params.scope,
|
|
353
|
+
entries: params.entries
|
|
354
|
+
}) ?? []);
|
|
355
|
+
}
|
|
356
|
+
async function readAllowlistConfig(params) {
|
|
357
|
+
return await getChannelPlugin(params.channelId)?.allowlist?.readConfig?.({
|
|
358
|
+
cfg: params.cfg,
|
|
359
|
+
accountId: params.accountId
|
|
360
|
+
}) ?? {};
|
|
361
|
+
}
|
|
362
|
+
const handleAllowlistCommand = async (params, allowTextCommands) => {
|
|
363
|
+
if (!allowTextCommands) return null;
|
|
364
|
+
const parsed = parseAllowlistCommand(params.command.commandBodyNormalized);
|
|
365
|
+
if (!parsed) return null;
|
|
366
|
+
if (parsed.action === "error") return {
|
|
367
|
+
shouldContinue: false,
|
|
368
|
+
reply: { text: `ā ļø ${parsed.message}` }
|
|
369
|
+
};
|
|
370
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/allowlist");
|
|
371
|
+
if (unauthorized) return unauthorized;
|
|
372
|
+
const channelId = normalizeChannelId(parsed.channel) ?? params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
373
|
+
if (!channelId) return {
|
|
374
|
+
shouldContinue: false,
|
|
375
|
+
reply: { text: "ā ļø Unknown channel. Add channel=<id> to the command." }
|
|
376
|
+
};
|
|
377
|
+
if (parsed.account?.trim() && !normalizeOptionalAccountId(parsed.account)) return {
|
|
378
|
+
shouldContinue: false,
|
|
379
|
+
reply: { text: "ā ļø Invalid account id. Reserved keys (__proto__, constructor, prototype) are blocked." }
|
|
380
|
+
};
|
|
381
|
+
const accountId = normalizeAccountId(parsed.account ?? params.ctx.AccountId);
|
|
382
|
+
const plugin = getChannelPlugin(channelId);
|
|
383
|
+
if (parsed.action === "list") {
|
|
384
|
+
const supportsStore = Boolean(plugin?.pairing);
|
|
385
|
+
if (!plugin?.allowlist?.readConfig && !supportsStore) return {
|
|
386
|
+
shouldContinue: false,
|
|
387
|
+
reply: { text: `ā ļø ${channelId} does not expose allowlist configuration.` }
|
|
388
|
+
};
|
|
389
|
+
const storeAllowFrom = supportsStore ? await readChannelAllowFromStore(channelId, process.env, accountId).catch(() => []) : [];
|
|
390
|
+
const configState = await readAllowlistConfig({
|
|
391
|
+
cfg: params.cfg,
|
|
392
|
+
channelId,
|
|
393
|
+
accountId
|
|
394
|
+
});
|
|
395
|
+
const dmAllowFrom = (configState.dmAllowFrom ?? []).map(String);
|
|
396
|
+
const groupAllowFrom = (configState.groupAllowFrom ?? []).map(String);
|
|
397
|
+
const groupOverrides = (configState.groupOverrides ?? []).map((entry) => ({
|
|
398
|
+
label: entry.label,
|
|
399
|
+
entries: entry.entries.map(String).filter(Boolean)
|
|
400
|
+
}));
|
|
401
|
+
const dmDisplay = normalizeAllowFrom({
|
|
402
|
+
cfg: params.cfg,
|
|
403
|
+
channelId,
|
|
404
|
+
accountId,
|
|
405
|
+
values: dmAllowFrom
|
|
406
|
+
});
|
|
407
|
+
const groupDisplay = normalizeAllowFrom({
|
|
408
|
+
cfg: params.cfg,
|
|
409
|
+
channelId,
|
|
410
|
+
accountId,
|
|
411
|
+
values: groupAllowFrom
|
|
412
|
+
});
|
|
413
|
+
const groupOverrideEntries = groupOverrides.flatMap((entry) => entry.entries);
|
|
414
|
+
const groupOverrideDisplay = normalizeAllowFrom({
|
|
415
|
+
cfg: params.cfg,
|
|
416
|
+
channelId,
|
|
417
|
+
accountId,
|
|
418
|
+
values: groupOverrideEntries
|
|
419
|
+
});
|
|
420
|
+
const resolvedDm = parsed.resolve && dmDisplay.length > 0 ? await resolveAllowlistNames({
|
|
421
|
+
cfg: params.cfg,
|
|
422
|
+
channelId,
|
|
423
|
+
accountId,
|
|
424
|
+
scope: "dm",
|
|
425
|
+
entries: dmDisplay
|
|
426
|
+
}) : void 0;
|
|
427
|
+
const resolvedGroup = parsed.resolve && groupOverrideDisplay.length > 0 ? await resolveAllowlistNames({
|
|
428
|
+
cfg: params.cfg,
|
|
429
|
+
channelId,
|
|
430
|
+
accountId,
|
|
431
|
+
scope: "group",
|
|
432
|
+
entries: groupOverrideDisplay
|
|
433
|
+
}) : void 0;
|
|
434
|
+
const lines = ["š§¾ Allowlist"];
|
|
435
|
+
lines.push(`Channel: ${channelId}${accountId ? ` (account ${accountId})` : ""}`);
|
|
436
|
+
if (configState.dmPolicy) lines.push(`DM policy: ${configState.dmPolicy}`);
|
|
437
|
+
if (configState.groupPolicy) lines.push(`Group policy: ${configState.groupPolicy}`);
|
|
438
|
+
const showDm = parsed.scope === "dm" || parsed.scope === "all";
|
|
439
|
+
const showGroup = parsed.scope === "group" || parsed.scope === "all";
|
|
440
|
+
if (showDm) lines.push(`DM allowFrom (config): ${formatEntryList(dmDisplay, resolvedDm)}`);
|
|
441
|
+
if (supportsStore && storeAllowFrom.length > 0) {
|
|
442
|
+
const storeLabel = normalizeAllowFrom({
|
|
443
|
+
cfg: params.cfg,
|
|
444
|
+
channelId,
|
|
445
|
+
accountId,
|
|
446
|
+
values: storeAllowFrom
|
|
447
|
+
});
|
|
448
|
+
lines.push(`Paired allowFrom (store): ${formatEntryList(storeLabel)}`);
|
|
449
|
+
}
|
|
450
|
+
if (showGroup) {
|
|
451
|
+
if (groupAllowFrom.length > 0) lines.push(`Group allowFrom (config): ${formatEntryList(groupDisplay, resolvedGroup)}`);
|
|
452
|
+
if (groupOverrides.length > 0) {
|
|
453
|
+
lines.push("Group overrides:");
|
|
454
|
+
for (const entry of groupOverrides) {
|
|
455
|
+
const normalized = normalizeAllowFrom({
|
|
456
|
+
cfg: params.cfg,
|
|
457
|
+
channelId,
|
|
458
|
+
accountId,
|
|
459
|
+
values: entry.entries
|
|
460
|
+
});
|
|
461
|
+
lines.push(`- ${entry.label}: ${formatEntryList(normalized, resolvedGroup)}`);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
shouldContinue: false,
|
|
467
|
+
reply: { text: lines.join("\n") }
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
471
|
+
label: "/allowlist write",
|
|
472
|
+
allowedScopes: ["operator.admin"],
|
|
473
|
+
missingText: "ā /allowlist add|remove requires operator.admin for gateway clients."
|
|
474
|
+
});
|
|
475
|
+
if (missingAdminScope) return missingAdminScope;
|
|
476
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
477
|
+
label: "/allowlist edits",
|
|
478
|
+
configKey: "config",
|
|
479
|
+
disabledVerb: "are"
|
|
480
|
+
});
|
|
481
|
+
if (disabled) return disabled;
|
|
482
|
+
const shouldUpdateConfig = parsed.target !== "store";
|
|
483
|
+
const shouldTouchStore = parsed.target !== "config" && Boolean(plugin?.pairing);
|
|
484
|
+
if (shouldUpdateConfig) {
|
|
485
|
+
if (parsed.scope === "all") return {
|
|
486
|
+
shouldContinue: false,
|
|
487
|
+
reply: { text: "ā ļø /allowlist add|remove requires scope dm or group." }
|
|
488
|
+
};
|
|
489
|
+
if (!plugin?.allowlist?.applyConfigEdit) return {
|
|
490
|
+
shouldContinue: false,
|
|
491
|
+
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
492
|
+
};
|
|
493
|
+
const snapshot = await readConfigFileSnapshot();
|
|
494
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
495
|
+
shouldContinue: false,
|
|
496
|
+
reply: { text: "ā ļø Config file is invalid; fix it before using /allowlist." }
|
|
497
|
+
};
|
|
498
|
+
const parsedConfig = structuredClone(snapshot.parsed);
|
|
499
|
+
const editResult = await plugin.allowlist.applyConfigEdit({
|
|
500
|
+
cfg: params.cfg,
|
|
501
|
+
parsedConfig,
|
|
502
|
+
accountId,
|
|
503
|
+
scope: parsed.scope,
|
|
504
|
+
action: parsed.action,
|
|
505
|
+
entry: parsed.entry
|
|
506
|
+
});
|
|
507
|
+
if (!editResult) return {
|
|
508
|
+
shouldContinue: false,
|
|
509
|
+
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
510
|
+
};
|
|
511
|
+
if (editResult.kind === "invalid-entry") return {
|
|
512
|
+
shouldContinue: false,
|
|
513
|
+
reply: { text: "ā ļø Invalid allowlist entry." }
|
|
514
|
+
};
|
|
515
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
516
|
+
cfg: params.cfg,
|
|
517
|
+
channel: params.command.channel,
|
|
518
|
+
channelId,
|
|
519
|
+
accountId: params.ctx.AccountId,
|
|
520
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
521
|
+
target: editResult.writeTarget
|
|
522
|
+
});
|
|
523
|
+
if (deniedText) return {
|
|
524
|
+
shouldContinue: false,
|
|
525
|
+
reply: { text: deniedText }
|
|
526
|
+
};
|
|
527
|
+
const configChanged = editResult.changed;
|
|
528
|
+
if (configChanged) {
|
|
529
|
+
const validated = validateConfigObjectWithPlugins(parsedConfig);
|
|
530
|
+
if (!validated.ok) {
|
|
531
|
+
const issue = validated.issues[0];
|
|
532
|
+
return {
|
|
533
|
+
shouldContinue: false,
|
|
534
|
+
reply: { text: `ā ļø Config invalid after update (${issue.path}: ${issue.message}).` }
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
await writeConfigFile(validated.config);
|
|
538
|
+
}
|
|
539
|
+
if (!configChanged && !shouldTouchStore) return {
|
|
540
|
+
shouldContinue: false,
|
|
541
|
+
reply: { text: parsed.action === "add" ? "ā
Already allowlisted." : "ā ļø Entry not found." }
|
|
542
|
+
};
|
|
543
|
+
if (shouldTouchStore) await updatePairingStoreAllowlist({
|
|
544
|
+
action: parsed.action,
|
|
545
|
+
channelId,
|
|
546
|
+
accountId,
|
|
547
|
+
entry: parsed.entry
|
|
548
|
+
});
|
|
549
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
550
|
+
const scopeLabel = parsed.scope === "dm" ? "DM" : "group";
|
|
551
|
+
const locations = [];
|
|
552
|
+
if (configChanged) locations.push(editResult.pathLabel);
|
|
553
|
+
if (shouldTouchStore) locations.push("pairing store");
|
|
554
|
+
return {
|
|
555
|
+
shouldContinue: false,
|
|
556
|
+
reply: { text: `ā
${scopeLabel} allowlist ${actionLabel}: ${locations.length > 0 ? locations.join(" + ") : "no-op"}.` }
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
if (!shouldTouchStore) return {
|
|
560
|
+
shouldContinue: false,
|
|
561
|
+
reply: { text: "ā ļø This channel does not support allowlist storage." }
|
|
562
|
+
};
|
|
563
|
+
await updatePairingStoreAllowlist({
|
|
564
|
+
action: parsed.action,
|
|
565
|
+
channelId,
|
|
566
|
+
accountId,
|
|
567
|
+
entry: parsed.entry
|
|
568
|
+
});
|
|
569
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
570
|
+
return {
|
|
571
|
+
shouldContinue: false,
|
|
572
|
+
reply: { text: `ā
${parsed.scope === "dm" ? "DM" : "group"} allowlist ${actionLabel} in pairing store.` }
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/infra/channel-approval-auth.ts
|
|
577
|
+
function resolveApprovalCommandAuthorization(params) {
|
|
578
|
+
const channel = normalizeMessageChannel(params.channel);
|
|
579
|
+
if (!channel) return {
|
|
580
|
+
authorized: true,
|
|
581
|
+
explicit: false
|
|
582
|
+
};
|
|
583
|
+
const channelPlugin = getChannelPlugin(channel);
|
|
584
|
+
const resolved = channelPlugin?.auth?.authorizeActorAction?.({
|
|
585
|
+
cfg: params.cfg,
|
|
586
|
+
accountId: params.accountId,
|
|
587
|
+
senderId: params.senderId,
|
|
588
|
+
action: "approve",
|
|
589
|
+
approvalKind: params.kind
|
|
590
|
+
});
|
|
591
|
+
if (!resolved) return {
|
|
592
|
+
authorized: true,
|
|
593
|
+
explicit: false
|
|
594
|
+
};
|
|
595
|
+
const availability = channelPlugin?.auth?.getActionAvailabilityState?.({
|
|
596
|
+
cfg: params.cfg,
|
|
597
|
+
accountId: params.accountId,
|
|
598
|
+
action: "approve"
|
|
599
|
+
});
|
|
600
|
+
return {
|
|
601
|
+
authorized: resolved.authorized,
|
|
602
|
+
reason: resolved.reason,
|
|
603
|
+
explicit: resolved.authorized ? availability?.kind !== "disabled" : true
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/auto-reply/reply/commands-approve.ts
|
|
608
|
+
const COMMAND_REGEX = /^\/?approve(?:\s|$)/i;
|
|
609
|
+
const FOREIGN_COMMAND_MENTION_REGEX = /^\/approve@([^\s]+)(?:\s|$)/i;
|
|
610
|
+
const DECISION_ALIASES = {
|
|
611
|
+
allow: "allow-once",
|
|
612
|
+
once: "allow-once",
|
|
613
|
+
"allow-once": "allow-once",
|
|
614
|
+
allowonce: "allow-once",
|
|
615
|
+
always: "allow-always",
|
|
616
|
+
"allow-always": "allow-always",
|
|
617
|
+
allowalways: "allow-always",
|
|
618
|
+
deny: "deny",
|
|
619
|
+
reject: "deny",
|
|
620
|
+
block: "deny"
|
|
621
|
+
};
|
|
622
|
+
function parseApproveCommand(raw) {
|
|
623
|
+
const trimmed = raw.trim();
|
|
624
|
+
if (FOREIGN_COMMAND_MENTION_REGEX.test(trimmed)) return {
|
|
625
|
+
ok: false,
|
|
626
|
+
error: "ā This /approve command targets a different Telegram bot."
|
|
627
|
+
};
|
|
628
|
+
const commandMatch = trimmed.match(COMMAND_REGEX);
|
|
629
|
+
if (!commandMatch) return null;
|
|
630
|
+
const rest = trimmed.slice(commandMatch[0].length).trim();
|
|
631
|
+
if (!rest) return {
|
|
632
|
+
ok: false,
|
|
633
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
634
|
+
};
|
|
635
|
+
const tokens = rest.split(/\s+/).filter(Boolean);
|
|
636
|
+
if (tokens.length < 2) return {
|
|
637
|
+
ok: false,
|
|
638
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
639
|
+
};
|
|
640
|
+
const first = tokens[0].toLowerCase();
|
|
641
|
+
const second = tokens[1].toLowerCase();
|
|
642
|
+
if (DECISION_ALIASES[first]) return {
|
|
643
|
+
ok: true,
|
|
644
|
+
decision: DECISION_ALIASES[first],
|
|
645
|
+
id: tokens.slice(1).join(" ").trim()
|
|
646
|
+
};
|
|
647
|
+
if (DECISION_ALIASES[second]) return {
|
|
648
|
+
ok: true,
|
|
649
|
+
decision: DECISION_ALIASES[second],
|
|
650
|
+
id: tokens[0]
|
|
651
|
+
};
|
|
652
|
+
return {
|
|
653
|
+
ok: false,
|
|
654
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function buildResolvedByLabel(params) {
|
|
658
|
+
return `${params.command.channel}:${params.command.senderId ?? "unknown"}`;
|
|
659
|
+
}
|
|
660
|
+
function isAuthorizedTelegramExecSender(params) {
|
|
661
|
+
if (params.command.channel !== "telegram") return false;
|
|
662
|
+
return isTelegramExecApprovalAuthorizedSender({
|
|
663
|
+
cfg: params.cfg,
|
|
664
|
+
accountId: params.ctx.AccountId,
|
|
665
|
+
senderId: params.command.senderId
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
function readErrorCode(value) {
|
|
669
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
670
|
+
}
|
|
671
|
+
function readApprovalNotFoundDetailsReason(value) {
|
|
672
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
673
|
+
const reason = value.reason;
|
|
674
|
+
return typeof reason === "string" && reason.trim() ? reason : null;
|
|
675
|
+
}
|
|
676
|
+
function isApprovalNotFoundError(err) {
|
|
677
|
+
if (!(err instanceof Error)) return false;
|
|
678
|
+
const gatewayCode = readErrorCode(err.gatewayCode);
|
|
679
|
+
if (gatewayCode === ErrorCodes.APPROVAL_NOT_FOUND) return true;
|
|
680
|
+
const detailsReason = readApprovalNotFoundDetailsReason(err.details);
|
|
681
|
+
if (gatewayCode === ErrorCodes.INVALID_REQUEST && detailsReason === ErrorCodes.APPROVAL_NOT_FOUND) return true;
|
|
682
|
+
return /unknown or expired approval id/i.test(err.message);
|
|
683
|
+
}
|
|
684
|
+
const handleApproveCommand = async (params, allowTextCommands) => {
|
|
685
|
+
if (!allowTextCommands) return null;
|
|
686
|
+
const normalized = params.command.commandBodyNormalized;
|
|
687
|
+
const parsed = parseApproveCommand(normalized);
|
|
688
|
+
if (!parsed) return null;
|
|
689
|
+
if (!parsed.ok) return {
|
|
690
|
+
shouldContinue: false,
|
|
691
|
+
reply: { text: parsed.error }
|
|
692
|
+
};
|
|
693
|
+
const isPluginId = parsed.id.startsWith("plugin:");
|
|
694
|
+
const telegramExecAuthorizedSender = isAuthorizedTelegramExecSender(params);
|
|
695
|
+
const execApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
696
|
+
cfg: params.cfg,
|
|
697
|
+
channel: params.command.channel,
|
|
698
|
+
accountId: params.ctx.AccountId,
|
|
699
|
+
senderId: params.command.senderId,
|
|
700
|
+
kind: "exec"
|
|
701
|
+
});
|
|
702
|
+
const pluginApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
703
|
+
cfg: params.cfg,
|
|
704
|
+
channel: params.command.channel,
|
|
705
|
+
accountId: params.ctx.AccountId,
|
|
706
|
+
senderId: params.command.senderId,
|
|
707
|
+
kind: "plugin"
|
|
708
|
+
});
|
|
709
|
+
const hasExplicitApprovalAuthorization = execApprovalAuthorization.explicit && execApprovalAuthorization.authorized || pluginApprovalAuthorization.explicit && pluginApprovalAuthorization.authorized;
|
|
710
|
+
if (!params.command.isAuthorizedSender && !hasExplicitApprovalAuthorization) {
|
|
711
|
+
logVerbose(`Ignoring /approve from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
712
|
+
return { shouldContinue: false };
|
|
713
|
+
}
|
|
714
|
+
if (params.command.channel === "telegram" && !isPluginId && !telegramExecAuthorizedSender && !isTelegramExecApprovalClientEnabled({
|
|
715
|
+
cfg: params.cfg,
|
|
716
|
+
accountId: params.ctx.AccountId
|
|
717
|
+
})) return {
|
|
718
|
+
shouldContinue: false,
|
|
719
|
+
reply: { text: "ā Telegram exec approvals are not enabled for this bot account." }
|
|
720
|
+
};
|
|
721
|
+
if (isPluginId && !pluginApprovalAuthorization.authorized) return {
|
|
722
|
+
shouldContinue: false,
|
|
723
|
+
reply: { text: pluginApprovalAuthorization.reason ?? "ā You are not authorized to approve this request." }
|
|
724
|
+
};
|
|
725
|
+
const missingScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
726
|
+
label: "/approve",
|
|
727
|
+
allowedScopes: ["operator.approvals", "operator.admin"],
|
|
728
|
+
missingText: "ā /approve requires operator.approvals for gateway clients."
|
|
729
|
+
});
|
|
730
|
+
if (missingScope) return missingScope;
|
|
731
|
+
const resolvedBy = buildResolvedByLabel(params);
|
|
732
|
+
const callApprovalMethod = async (method) => {
|
|
733
|
+
await callGateway({
|
|
734
|
+
method,
|
|
735
|
+
params: {
|
|
736
|
+
id: parsed.id,
|
|
737
|
+
decision: parsed.decision
|
|
738
|
+
},
|
|
739
|
+
clientName: GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
740
|
+
clientDisplayName: `Chat approval (${resolvedBy})`,
|
|
741
|
+
mode: GATEWAY_CLIENT_MODES.BACKEND
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
if (isPluginId) try {
|
|
745
|
+
await callApprovalMethod("plugin.approval.resolve");
|
|
746
|
+
} catch (err) {
|
|
747
|
+
return {
|
|
748
|
+
shouldContinue: false,
|
|
749
|
+
reply: { text: `ā Failed to submit approval: ${String(err)}` }
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
else if (execApprovalAuthorization.authorized) try {
|
|
753
|
+
await callApprovalMethod("exec.approval.resolve");
|
|
754
|
+
} catch (err) {
|
|
755
|
+
if (isApprovalNotFoundError(err)) {
|
|
756
|
+
if (!pluginApprovalAuthorization.authorized) return {
|
|
757
|
+
shouldContinue: false,
|
|
758
|
+
reply: { text: `ā Failed to submit approval: ${String(err)}` }
|
|
759
|
+
};
|
|
760
|
+
try {
|
|
761
|
+
await callApprovalMethod("plugin.approval.resolve");
|
|
762
|
+
} catch (pluginErr) {
|
|
763
|
+
return {
|
|
764
|
+
shouldContinue: false,
|
|
765
|
+
reply: { text: `ā Failed to submit approval: ${String(pluginErr)}` }
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
} else return {
|
|
769
|
+
shouldContinue: false,
|
|
770
|
+
reply: { text: `ā Failed to submit approval: ${String(err)}` }
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
else if (pluginApprovalAuthorization.authorized) try {
|
|
774
|
+
await callApprovalMethod("plugin.approval.resolve");
|
|
775
|
+
} catch (err) {
|
|
776
|
+
if (isApprovalNotFoundError(err)) return {
|
|
777
|
+
shouldContinue: false,
|
|
778
|
+
reply: { text: `ā Failed to submit approval: ${String(err)}` }
|
|
779
|
+
};
|
|
780
|
+
return {
|
|
781
|
+
shouldContinue: false,
|
|
782
|
+
reply: { text: `ā Failed to submit approval: ${String(err)}` }
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
else return {
|
|
786
|
+
shouldContinue: false,
|
|
787
|
+
reply: { text: execApprovalAuthorization.reason ?? "ā You are not authorized to approve this request." }
|
|
788
|
+
};
|
|
789
|
+
return {
|
|
790
|
+
shouldContinue: false,
|
|
791
|
+
reply: { text: `ā
Approval ${parsed.decision} submitted for ${parsed.id}.` }
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region src/auto-reply/reply/bash-command.ts
|
|
796
|
+
const CHAT_BASH_SCOPE_KEY = "chat:bash";
|
|
797
|
+
const DEFAULT_FOREGROUND_MS = 2e3;
|
|
798
|
+
const MAX_FOREGROUND_MS = 3e4;
|
|
799
|
+
let activeJob = null;
|
|
800
|
+
function resolveForegroundMs(cfg) {
|
|
801
|
+
const raw = cfg.commands?.bashForegroundMs;
|
|
802
|
+
if (typeof raw !== "number" || Number.isNaN(raw)) return DEFAULT_FOREGROUND_MS;
|
|
803
|
+
return clampInt(raw, 0, MAX_FOREGROUND_MS);
|
|
804
|
+
}
|
|
805
|
+
function formatSessionSnippet(sessionId) {
|
|
806
|
+
const trimmed = sessionId.trim();
|
|
807
|
+
if (trimmed.length <= 12) return trimmed;
|
|
808
|
+
return `${trimmed.slice(0, 8)}ā¦`;
|
|
809
|
+
}
|
|
810
|
+
function formatOutputBlock(text) {
|
|
811
|
+
const trimmed = text.trim();
|
|
812
|
+
if (!trimmed) return "(no output)";
|
|
813
|
+
return `\`\`\`txt\n${trimmed}\n\`\`\``;
|
|
814
|
+
}
|
|
815
|
+
function parseBashRequest(raw) {
|
|
816
|
+
const trimmed = raw.trimStart();
|
|
817
|
+
let restSource = "";
|
|
818
|
+
if (trimmed.toLowerCase().startsWith("/bash")) {
|
|
819
|
+
const match = trimmed.match(/^\/bash(?:\s*:\s*|\s+|$)([\s\S]*)$/i);
|
|
820
|
+
if (!match) return null;
|
|
821
|
+
restSource = match[1] ?? "";
|
|
822
|
+
} else if (trimmed.startsWith("!")) {
|
|
823
|
+
restSource = trimmed.slice(1);
|
|
824
|
+
if (restSource.trimStart().startsWith(":")) restSource = restSource.trimStart().slice(1);
|
|
825
|
+
} else return null;
|
|
826
|
+
const rest = restSource.trimStart();
|
|
827
|
+
if (!rest) return { action: "help" };
|
|
828
|
+
const tokenMatch = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
829
|
+
const token = tokenMatch?.[1]?.trim() ?? "";
|
|
830
|
+
const remainder = tokenMatch?.[2]?.trim() ?? "";
|
|
831
|
+
const lowered = token.toLowerCase();
|
|
832
|
+
if (lowered === "poll") return {
|
|
833
|
+
action: "poll",
|
|
834
|
+
sessionId: remainder || void 0
|
|
835
|
+
};
|
|
836
|
+
if (lowered === "stop") return {
|
|
837
|
+
action: "stop",
|
|
838
|
+
sessionId: remainder || void 0
|
|
839
|
+
};
|
|
840
|
+
if (lowered === "help") return { action: "help" };
|
|
841
|
+
return {
|
|
842
|
+
action: "run",
|
|
843
|
+
command: rest
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
function resolveRawCommandBody(params) {
|
|
847
|
+
const stripped = stripStructuralPrefixes(params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body ?? "");
|
|
848
|
+
return params.isGroup ? stripMentions(stripped, params.ctx, params.cfg, params.agentId) : stripped;
|
|
849
|
+
}
|
|
850
|
+
function getScopedSession(sessionId) {
|
|
851
|
+
const running = getSession(sessionId);
|
|
852
|
+
if (running && running.scopeKey === CHAT_BASH_SCOPE_KEY) return { running };
|
|
853
|
+
const finished = getFinishedSession(sessionId);
|
|
854
|
+
if (finished && finished.scopeKey === CHAT_BASH_SCOPE_KEY) return { finished };
|
|
855
|
+
return {};
|
|
856
|
+
}
|
|
857
|
+
function ensureActiveJobState() {
|
|
858
|
+
if (!activeJob) return null;
|
|
859
|
+
if (activeJob.state === "starting") return activeJob;
|
|
860
|
+
const { running, finished } = getScopedSession(activeJob.sessionId);
|
|
861
|
+
if (running) return activeJob;
|
|
862
|
+
if (finished) {
|
|
863
|
+
activeJob = null;
|
|
864
|
+
return null;
|
|
865
|
+
}
|
|
866
|
+
activeJob = null;
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
function attachActiveWatcher(sessionId) {
|
|
870
|
+
if (!activeJob || activeJob.state !== "running") return;
|
|
871
|
+
if (activeJob.sessionId !== sessionId) return;
|
|
872
|
+
if (activeJob.watcherAttached) return;
|
|
873
|
+
const { running } = getScopedSession(sessionId);
|
|
874
|
+
const child = running?.child;
|
|
875
|
+
if (!child) return;
|
|
876
|
+
activeJob.watcherAttached = true;
|
|
877
|
+
child.once("close", () => {
|
|
878
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
function buildUsageReply() {
|
|
882
|
+
return { text: [
|
|
883
|
+
"āļø Usage:",
|
|
884
|
+
"- ! <command>",
|
|
885
|
+
"- !poll | ! poll",
|
|
886
|
+
"- !stop | ! stop",
|
|
887
|
+
"- /bash ... (alias; same subcommands as !)"
|
|
888
|
+
].join("\n") };
|
|
889
|
+
}
|
|
890
|
+
async function handleBashChatCommand(params) {
|
|
891
|
+
if (!isCommandFlagEnabled(params.cfg, "bash")) return buildDisabledCommandReply({
|
|
892
|
+
label: "bash",
|
|
893
|
+
configKey: "bash",
|
|
894
|
+
docsUrl: "https://docs.vora.ai/tools/slash-commands#config"
|
|
895
|
+
});
|
|
896
|
+
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
897
|
+
sessionKey: params.sessionKey,
|
|
898
|
+
config: params.cfg
|
|
899
|
+
});
|
|
900
|
+
if (!params.elevated.enabled || !params.elevated.allowed) {
|
|
901
|
+
const runtimeSandboxed = resolveSandboxRuntimeStatus({
|
|
902
|
+
cfg: params.cfg,
|
|
903
|
+
sessionKey: params.ctx.SessionKey
|
|
904
|
+
}).sandboxed;
|
|
905
|
+
return { text: formatElevatedUnavailableMessage({
|
|
906
|
+
runtimeSandboxed,
|
|
907
|
+
failures: params.elevated.failures,
|
|
908
|
+
sessionKey: params.ctx.SessionKey
|
|
909
|
+
}) };
|
|
910
|
+
}
|
|
911
|
+
const request = parseBashRequest(resolveRawCommandBody({
|
|
912
|
+
ctx: params.ctx,
|
|
913
|
+
cfg: params.cfg,
|
|
914
|
+
agentId,
|
|
915
|
+
isGroup: params.isGroup
|
|
916
|
+
}).trim());
|
|
917
|
+
if (!request) return { text: "ā ļø Unrecognized bash request." };
|
|
918
|
+
const liveJob = ensureActiveJobState();
|
|
919
|
+
if (request.action === "help") return buildUsageReply();
|
|
920
|
+
if (request.action === "poll") {
|
|
921
|
+
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
922
|
+
if (!sessionId) return { text: "āļø No active bash job." };
|
|
923
|
+
const { running, finished } = getScopedSession(sessionId);
|
|
924
|
+
if (running) {
|
|
925
|
+
attachActiveWatcher(sessionId);
|
|
926
|
+
const runtimeSec = Math.max(0, Math.floor((Date.now() - running.startedAt) / 1e3));
|
|
927
|
+
const tail = running.tail || "(no output yet)";
|
|
928
|
+
return { text: [
|
|
929
|
+
`āļø bash still running (session ${formatSessionSnippet(sessionId)}, ${runtimeSec}s).`,
|
|
930
|
+
formatOutputBlock(tail),
|
|
931
|
+
"Hint: !stop (or /bash stop)"
|
|
932
|
+
].join("\n") };
|
|
933
|
+
}
|
|
934
|
+
if (finished) {
|
|
935
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
936
|
+
const exitLabel = finished.exitSignal ? `signal ${String(finished.exitSignal)}` : `code ${String(finished.exitCode ?? 0)}`;
|
|
937
|
+
return { text: [
|
|
938
|
+
`${finished.status === "completed" ? "āļø" : "ā ļø"} bash finished (session ${formatSessionSnippet(sessionId)}).`,
|
|
939
|
+
`Exit: ${exitLabel}`,
|
|
940
|
+
formatOutputBlock(finished.aggregated || finished.tail)
|
|
941
|
+
].join("\n") };
|
|
942
|
+
}
|
|
943
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
944
|
+
return { text: `āļø No bash session found for ${formatSessionSnippet(sessionId)}.` };
|
|
945
|
+
}
|
|
946
|
+
if (request.action === "stop") {
|
|
947
|
+
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
948
|
+
if (!sessionId) return { text: "āļø No active bash job." };
|
|
949
|
+
const { running } = getScopedSession(sessionId);
|
|
950
|
+
if (!running) {
|
|
951
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
952
|
+
return { text: `āļø No running bash job found for ${formatSessionSnippet(sessionId)}.` };
|
|
953
|
+
}
|
|
954
|
+
if (!running.backgrounded) return { text: `ā ļø Session ${formatSessionSnippet(sessionId)} is not backgrounded.` };
|
|
955
|
+
const pid = running.pid ?? running.child?.pid;
|
|
956
|
+
if (!pid) return { text: `ā ļø Unable to stop bash session ${formatSessionSnippet(sessionId)} because no process ID is available. Use !poll ${sessionId} to check whether it exits on its own.` };
|
|
957
|
+
const { killProcessTree } = await import("./kill-tree-Cqktd2UA.js");
|
|
958
|
+
killProcessTree(pid);
|
|
959
|
+
return { text: `āļø bash stopping (session ${formatSessionSnippet(sessionId)}). Use !poll ${sessionId} to confirm exit.` };
|
|
960
|
+
}
|
|
961
|
+
if (liveJob) return { text: `ā ļø A bash job is already running (${liveJob.state === "running" ? formatSessionSnippet(liveJob.sessionId) : "starting"}). Use !poll / !stop (or /bash poll / /bash stop).` };
|
|
962
|
+
const commandText = request.command.trim();
|
|
963
|
+
if (!commandText) return buildUsageReply();
|
|
964
|
+
activeJob = {
|
|
965
|
+
state: "starting",
|
|
966
|
+
startedAt: Date.now(),
|
|
967
|
+
command: commandText
|
|
968
|
+
};
|
|
969
|
+
try {
|
|
970
|
+
const foregroundMs = resolveForegroundMs(params.cfg);
|
|
971
|
+
const shouldBackgroundImmediately = foregroundMs <= 0;
|
|
972
|
+
const timeoutSec = params.cfg.tools?.exec?.timeoutSec;
|
|
973
|
+
const notifyOnExit = params.cfg.tools?.exec?.notifyOnExit;
|
|
974
|
+
const notifyOnExitEmptySuccess = params.cfg.tools?.exec?.notifyOnExitEmptySuccess;
|
|
975
|
+
const result = await createExecTool({
|
|
976
|
+
scopeKey: CHAT_BASH_SCOPE_KEY,
|
|
977
|
+
allowBackground: true,
|
|
978
|
+
timeoutSec,
|
|
979
|
+
sessionKey: params.sessionKey,
|
|
980
|
+
notifyOnExit,
|
|
981
|
+
notifyOnExitEmptySuccess,
|
|
982
|
+
elevated: {
|
|
983
|
+
enabled: params.elevated.enabled,
|
|
984
|
+
allowed: params.elevated.allowed,
|
|
985
|
+
defaultLevel: "on"
|
|
986
|
+
}
|
|
987
|
+
}).execute("chat-bash", {
|
|
988
|
+
command: commandText,
|
|
989
|
+
background: shouldBackgroundImmediately,
|
|
990
|
+
yieldMs: shouldBackgroundImmediately ? void 0 : foregroundMs,
|
|
991
|
+
timeout: timeoutSec,
|
|
992
|
+
elevated: true
|
|
993
|
+
});
|
|
994
|
+
if (result.details?.status === "running") {
|
|
995
|
+
const sessionId = result.details.sessionId;
|
|
996
|
+
activeJob = {
|
|
997
|
+
state: "running",
|
|
998
|
+
sessionId,
|
|
999
|
+
startedAt: result.details.startedAt,
|
|
1000
|
+
command: commandText,
|
|
1001
|
+
watcherAttached: false
|
|
1002
|
+
};
|
|
1003
|
+
attachActiveWatcher(sessionId);
|
|
1004
|
+
logVerbose(`Started bash session ${formatSessionSnippet(sessionId)}: ${commandText}`);
|
|
1005
|
+
return { text: `āļø bash started (session ${sessionId}). Still running; use !poll / !stop (or /bash poll / /bash stop).` };
|
|
1006
|
+
}
|
|
1007
|
+
activeJob = null;
|
|
1008
|
+
const exitCode = result.details?.status === "completed" ? result.details.exitCode : 0;
|
|
1009
|
+
const output = result.details?.status === "completed" ? result.details.aggregated : result.content.map((chunk) => chunk.type === "text" ? chunk.text : "").join("\n");
|
|
1010
|
+
return { text: [
|
|
1011
|
+
`āļø bash: ${commandText}`,
|
|
1012
|
+
`Exit: ${exitCode}`,
|
|
1013
|
+
formatOutputBlock(output || "(no output)")
|
|
1014
|
+
].join("\n") };
|
|
1015
|
+
} catch (err) {
|
|
1016
|
+
activeJob = null;
|
|
1017
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1018
|
+
return { text: [`ā ļø bash failed: ${commandText}`, formatOutputBlock(message)].join("\n") };
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
//#endregion
|
|
1022
|
+
//#region src/auto-reply/reply/commands-bash.ts
|
|
1023
|
+
const handleBashCommand = async (params, allowTextCommands) => {
|
|
1024
|
+
if (!allowTextCommands) return null;
|
|
1025
|
+
const { command } = params;
|
|
1026
|
+
const bashSlashRequested = command.commandBodyNormalized === "/bash" || command.commandBodyNormalized.startsWith("/bash ");
|
|
1027
|
+
const bashBangRequested = command.commandBodyNormalized.startsWith("!");
|
|
1028
|
+
if (!bashSlashRequested && !(bashBangRequested && command.isAuthorizedSender)) return null;
|
|
1029
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/bash");
|
|
1030
|
+
if (unauthorized) return unauthorized;
|
|
1031
|
+
return {
|
|
1032
|
+
shouldContinue: false,
|
|
1033
|
+
reply: await handleBashChatCommand({
|
|
1034
|
+
ctx: params.ctx,
|
|
1035
|
+
cfg: params.cfg,
|
|
1036
|
+
agentId: params.agentId,
|
|
1037
|
+
sessionKey: params.sessionKey,
|
|
1038
|
+
isGroup: params.isGroup,
|
|
1039
|
+
elevated: params.elevated
|
|
1040
|
+
})
|
|
1041
|
+
};
|
|
1042
|
+
};
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region src/agents/btw.ts
|
|
1045
|
+
function collectTextContent(content) {
|
|
1046
|
+
return content.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
1047
|
+
}
|
|
1048
|
+
function collectThinkingContent(content) {
|
|
1049
|
+
return content.filter((part) => part.type === "thinking").map((part) => part.thinking).join("");
|
|
1050
|
+
}
|
|
1051
|
+
function buildBtwSystemPrompt() {
|
|
1052
|
+
return [
|
|
1053
|
+
"You are answering an ephemeral /btw side question about the current conversation.",
|
|
1054
|
+
"Use the conversation only as background context.",
|
|
1055
|
+
"Answer only the side question in the last user message.",
|
|
1056
|
+
"Do not continue, resume, or complete any unfinished task from the conversation.",
|
|
1057
|
+
"Do not emit tool calls, pseudo-tool calls, shell commands, file writes, patches, or code unless the side question explicitly asks for them.",
|
|
1058
|
+
"Do not say you will continue the main task after answering.",
|
|
1059
|
+
"If the question can be answered briefly, answer briefly."
|
|
1060
|
+
].join("\n");
|
|
1061
|
+
}
|
|
1062
|
+
function buildBtwQuestionPrompt(question, inFlightPrompt) {
|
|
1063
|
+
const lines = ["Answer this side question only.", "Ignore any unfinished task in the conversation while answering it."];
|
|
1064
|
+
const trimmedPrompt = inFlightPrompt?.trim();
|
|
1065
|
+
if (trimmedPrompt) lines.push("", "Current in-flight main task request for background context only:", "<in_flight_main_task>", trimmedPrompt, "</in_flight_main_task>", "Do not continue or complete that task while answering the side question.");
|
|
1066
|
+
lines.push("", "<btw_side_question>", question.trim(), "</btw_side_question>");
|
|
1067
|
+
return lines.join("\n");
|
|
1068
|
+
}
|
|
1069
|
+
function toSimpleContextMessages(messages) {
|
|
1070
|
+
return stripToolResultDetails(messages.filter((message) => {
|
|
1071
|
+
if (!message || typeof message !== "object") return false;
|
|
1072
|
+
const role = message.role;
|
|
1073
|
+
return role === "user" || role === "assistant";
|
|
1074
|
+
}));
|
|
1075
|
+
}
|
|
1076
|
+
function resolveSessionTranscriptPath(params) {
|
|
1077
|
+
try {
|
|
1078
|
+
const agentId = params.sessionKey?.split(":")[1];
|
|
1079
|
+
const pathOpts = resolveSessionFilePathOptions({
|
|
1080
|
+
agentId,
|
|
1081
|
+
storePath: params.storePath
|
|
1082
|
+
});
|
|
1083
|
+
return resolveSessionFilePath(params.sessionId, params.sessionEntry, pathOpts);
|
|
1084
|
+
} catch (error) {
|
|
1085
|
+
diag.debug(`resolveSessionTranscriptPath failed: sessionId=${params.sessionId} err=${String(error)}`);
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
async function resolveRuntimeModel(params) {
|
|
1090
|
+
await ensureVoraModelsJson(params.cfg, params.agentDir);
|
|
1091
|
+
const modelRegistry = discoverModels(discoverAuthStorage(params.agentDir), params.agentDir);
|
|
1092
|
+
const model = resolveModelWithRegistry({
|
|
1093
|
+
provider: params.provider,
|
|
1094
|
+
modelId: params.model,
|
|
1095
|
+
modelRegistry,
|
|
1096
|
+
cfg: params.cfg
|
|
1097
|
+
});
|
|
1098
|
+
if (!model) throw new Error(`Unknown model: ${params.provider}/${params.model}`);
|
|
1099
|
+
return {
|
|
1100
|
+
model,
|
|
1101
|
+
authProfileId: await resolveSessionAuthProfileOverride({
|
|
1102
|
+
cfg: params.cfg,
|
|
1103
|
+
provider: params.provider,
|
|
1104
|
+
agentDir: params.agentDir,
|
|
1105
|
+
sessionEntry: params.sessionEntry,
|
|
1106
|
+
sessionStore: params.sessionStore,
|
|
1107
|
+
sessionKey: params.sessionKey,
|
|
1108
|
+
storePath: params.storePath,
|
|
1109
|
+
isNewSession: params.isNewSession
|
|
1110
|
+
}),
|
|
1111
|
+
authProfileIdSource: params.sessionEntry?.authProfileOverrideSource
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
async function runBtwSideQuestion(params) {
|
|
1115
|
+
const sessionId = params.sessionEntry.sessionId?.trim();
|
|
1116
|
+
if (!sessionId) throw new Error("No active session context.");
|
|
1117
|
+
const sessionFile = resolveSessionTranscriptPath({
|
|
1118
|
+
sessionId,
|
|
1119
|
+
sessionEntry: params.sessionEntry,
|
|
1120
|
+
sessionKey: params.sessionKey,
|
|
1121
|
+
storePath: params.storePath
|
|
1122
|
+
});
|
|
1123
|
+
if (!sessionFile) throw new Error("No active session transcript.");
|
|
1124
|
+
const sessionManager = SessionManager.open(sessionFile);
|
|
1125
|
+
const activeRunSnapshot = getActiveEmbeddedRunSnapshot(sessionId);
|
|
1126
|
+
let messages = [];
|
|
1127
|
+
let inFlightPrompt;
|
|
1128
|
+
if (Array.isArray(activeRunSnapshot?.messages) && activeRunSnapshot.messages.length > 0) {
|
|
1129
|
+
messages = toSimpleContextMessages(activeRunSnapshot.messages);
|
|
1130
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1131
|
+
} else if (activeRunSnapshot) {
|
|
1132
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1133
|
+
if (activeRunSnapshot.transcriptLeafId && sessionManager.branch) try {
|
|
1134
|
+
sessionManager.branch(activeRunSnapshot.transcriptLeafId);
|
|
1135
|
+
} catch (error) {
|
|
1136
|
+
diag.debug(`btw snapshot leaf unavailable: sessionId=${sessionId} leaf=${activeRunSnapshot.transcriptLeafId} err=${String(error)}`);
|
|
1137
|
+
sessionManager.resetLeaf?.();
|
|
1138
|
+
}
|
|
1139
|
+
else sessionManager.resetLeaf?.();
|
|
1140
|
+
} else {
|
|
1141
|
+
const leafEntry = sessionManager.getLeafEntry?.();
|
|
1142
|
+
if (leafEntry?.type === "message" && leafEntry.message?.role === "user") if (leafEntry.parentId && sessionManager.branch) sessionManager.branch(leafEntry.parentId);
|
|
1143
|
+
else sessionManager.resetLeaf?.();
|
|
1144
|
+
}
|
|
1145
|
+
if (messages.length === 0) {
|
|
1146
|
+
const sessionContext = sessionManager.buildSessionContext();
|
|
1147
|
+
messages = toSimpleContextMessages(Array.isArray(sessionContext.messages) ? sessionContext.messages : []);
|
|
1148
|
+
}
|
|
1149
|
+
if (messages.length === 0 && !inFlightPrompt?.trim()) throw new Error("No active session context.");
|
|
1150
|
+
const { model, authProfileId } = await resolveRuntimeModel({
|
|
1151
|
+
cfg: params.cfg,
|
|
1152
|
+
provider: params.provider,
|
|
1153
|
+
model: params.model,
|
|
1154
|
+
agentDir: params.agentDir,
|
|
1155
|
+
sessionEntry: params.sessionEntry,
|
|
1156
|
+
sessionStore: params.sessionStore,
|
|
1157
|
+
sessionKey: params.sessionKey,
|
|
1158
|
+
storePath: params.storePath,
|
|
1159
|
+
isNewSession: params.isNewSession
|
|
1160
|
+
});
|
|
1161
|
+
const apiKey = requireApiKey(await getApiKeyForModel({
|
|
1162
|
+
model,
|
|
1163
|
+
cfg: params.cfg,
|
|
1164
|
+
profileId: authProfileId,
|
|
1165
|
+
agentDir: params.agentDir
|
|
1166
|
+
}), model.provider);
|
|
1167
|
+
const chunker = params.opts?.onBlockReply && params.blockReplyChunking ? new EmbeddedBlockChunker(params.blockReplyChunking) : void 0;
|
|
1168
|
+
let emittedBlocks = 0;
|
|
1169
|
+
let blockEmitChain = Promise.resolve();
|
|
1170
|
+
let answerText = "";
|
|
1171
|
+
let reasoningText = "";
|
|
1172
|
+
let assistantStarted = false;
|
|
1173
|
+
let sawTextEvent = false;
|
|
1174
|
+
const emitBlockChunk = async (text) => {
|
|
1175
|
+
if (!text.trim() || !params.opts?.onBlockReply) return;
|
|
1176
|
+
emittedBlocks += 1;
|
|
1177
|
+
blockEmitChain = blockEmitChain.then(async () => {
|
|
1178
|
+
await params.opts?.onBlockReply?.({
|
|
1179
|
+
text,
|
|
1180
|
+
btw: { question: params.question }
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
await blockEmitChain;
|
|
1184
|
+
};
|
|
1185
|
+
const stream = streamSimple(model, {
|
|
1186
|
+
systemPrompt: buildBtwSystemPrompt(),
|
|
1187
|
+
messages: [...messages, {
|
|
1188
|
+
role: "user",
|
|
1189
|
+
content: [{
|
|
1190
|
+
type: "text",
|
|
1191
|
+
text: buildBtwQuestionPrompt(params.question, inFlightPrompt)
|
|
1192
|
+
}],
|
|
1193
|
+
timestamp: Date.now()
|
|
1194
|
+
}]
|
|
1195
|
+
}, {
|
|
1196
|
+
apiKey,
|
|
1197
|
+
reasoning: void 0,
|
|
1198
|
+
signal: params.opts?.abortSignal
|
|
1199
|
+
});
|
|
1200
|
+
let finalEvent;
|
|
1201
|
+
for await (const event of stream) {
|
|
1202
|
+
finalEvent = event.type === "done" || event.type === "error" ? event : finalEvent;
|
|
1203
|
+
if (!assistantStarted && (event.type === "text_start" || event.type === "start")) {
|
|
1204
|
+
assistantStarted = true;
|
|
1205
|
+
await params.opts?.onAssistantMessageStart?.();
|
|
1206
|
+
}
|
|
1207
|
+
if (event.type === "text_delta") {
|
|
1208
|
+
sawTextEvent = true;
|
|
1209
|
+
answerText += event.delta;
|
|
1210
|
+
chunker?.append(event.delta);
|
|
1211
|
+
if (chunker && params.resolvedBlockStreamingBreak === "text_end") chunker.drain({
|
|
1212
|
+
force: false,
|
|
1213
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1214
|
+
});
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
if (event.type === "text_end" && chunker && params.resolvedBlockStreamingBreak === "text_end") {
|
|
1218
|
+
chunker.drain({
|
|
1219
|
+
force: true,
|
|
1220
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1221
|
+
});
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
if (event.type === "thinking_delta") {
|
|
1225
|
+
reasoningText += event.delta;
|
|
1226
|
+
if (params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningStream?.({
|
|
1227
|
+
text: reasoningText,
|
|
1228
|
+
isReasoning: true
|
|
1229
|
+
});
|
|
1230
|
+
continue;
|
|
1231
|
+
}
|
|
1232
|
+
if (event.type === "thinking_end" && params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningEnd?.();
|
|
1233
|
+
}
|
|
1234
|
+
if (chunker && params.resolvedBlockStreamingBreak !== "text_end" && chunker.hasBuffered()) chunker.drain({
|
|
1235
|
+
force: true,
|
|
1236
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1237
|
+
});
|
|
1238
|
+
await blockEmitChain;
|
|
1239
|
+
if (finalEvent?.type === "error") {
|
|
1240
|
+
const message = collectTextContent(finalEvent.error.content);
|
|
1241
|
+
throw new Error(message || finalEvent.error.errorMessage || "BTW failed.");
|
|
1242
|
+
}
|
|
1243
|
+
const finalMessage = finalEvent?.type === "done" ? finalEvent.message : void 0;
|
|
1244
|
+
if (finalMessage) {
|
|
1245
|
+
if (!sawTextEvent) answerText = collectTextContent(finalMessage.content);
|
|
1246
|
+
if (!reasoningText) reasoningText = collectThinkingContent(finalMessage.content);
|
|
1247
|
+
}
|
|
1248
|
+
const answer = answerText.trim();
|
|
1249
|
+
if (!answer) throw new Error("No BTW response generated.");
|
|
1250
|
+
if (emittedBlocks > 0) return;
|
|
1251
|
+
return { text: answer };
|
|
1252
|
+
}
|
|
1253
|
+
//#endregion
|
|
1254
|
+
//#region src/auto-reply/reply/commands-btw.ts
|
|
1255
|
+
const BTW_USAGE = "Usage: /btw <side question>";
|
|
1256
|
+
const handleBtwCommand = async (params, allowTextCommands) => {
|
|
1257
|
+
if (!allowTextCommands) return null;
|
|
1258
|
+
const question = extractBtwQuestion(params.command.commandBodyNormalized);
|
|
1259
|
+
if (question === null) return null;
|
|
1260
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/btw");
|
|
1261
|
+
if (unauthorized) return unauthorized;
|
|
1262
|
+
if (!question) return {
|
|
1263
|
+
shouldContinue: false,
|
|
1264
|
+
reply: { text: BTW_USAGE }
|
|
1265
|
+
};
|
|
1266
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
1267
|
+
shouldContinue: false,
|
|
1268
|
+
reply: { text: "ā ļø /btw requires an active session with existing context." }
|
|
1269
|
+
};
|
|
1270
|
+
if (!params.agentDir) return {
|
|
1271
|
+
shouldContinue: false,
|
|
1272
|
+
reply: { text: "ā ļø /btw is unavailable because the active agent directory could not be resolved." }
|
|
1273
|
+
};
|
|
1274
|
+
try {
|
|
1275
|
+
await params.typing?.startTypingLoop();
|
|
1276
|
+
const reply = await runBtwSideQuestion({
|
|
1277
|
+
cfg: params.cfg,
|
|
1278
|
+
agentDir: params.agentDir,
|
|
1279
|
+
provider: params.provider,
|
|
1280
|
+
model: params.model,
|
|
1281
|
+
question,
|
|
1282
|
+
sessionEntry: params.sessionEntry,
|
|
1283
|
+
sessionStore: params.sessionStore,
|
|
1284
|
+
sessionKey: params.sessionKey,
|
|
1285
|
+
storePath: params.storePath,
|
|
1286
|
+
resolvedThinkLevel: "off",
|
|
1287
|
+
resolvedReasoningLevel: "off",
|
|
1288
|
+
blockReplyChunking: params.blockReplyChunking,
|
|
1289
|
+
resolvedBlockStreamingBreak: params.resolvedBlockStreamingBreak,
|
|
1290
|
+
opts: params.opts,
|
|
1291
|
+
isNewSession: false
|
|
1292
|
+
});
|
|
1293
|
+
return {
|
|
1294
|
+
shouldContinue: false,
|
|
1295
|
+
reply: reply ? {
|
|
1296
|
+
...reply,
|
|
1297
|
+
btw: { question }
|
|
1298
|
+
} : reply
|
|
1299
|
+
};
|
|
1300
|
+
} catch (error) {
|
|
1301
|
+
const message = error instanceof Error ? error.message.trim() : "";
|
|
1302
|
+
return {
|
|
1303
|
+
shouldContinue: false,
|
|
1304
|
+
reply: {
|
|
1305
|
+
text: `ā ļø /btw failed${message ? `: ${message}` : "."}`,
|
|
1306
|
+
btw: { question },
|
|
1307
|
+
isError: true
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/auto-reply/reply/commands-compact.ts
|
|
1314
|
+
function extractCompactInstructions(params) {
|
|
1315
|
+
const raw = stripStructuralPrefixes(params.rawBody ?? "");
|
|
1316
|
+
const trimmed = (params.isGroup ? stripMentions(raw, params.ctx, params.cfg, params.agentId) : raw).trim();
|
|
1317
|
+
if (!trimmed) return;
|
|
1318
|
+
const prefix = trimmed.toLowerCase().startsWith("/compact") ? "/compact" : null;
|
|
1319
|
+
if (!prefix) return;
|
|
1320
|
+
let rest = trimmed.slice(prefix.length).trimStart();
|
|
1321
|
+
if (rest.startsWith(":")) rest = rest.slice(1).trimStart();
|
|
1322
|
+
return rest.length ? rest : void 0;
|
|
1323
|
+
}
|
|
1324
|
+
function isCompactionSkipReason(reason) {
|
|
1325
|
+
const text = reason?.trim().toLowerCase() ?? "";
|
|
1326
|
+
return text.includes("nothing to compact") || text.includes("below threshold") || text.includes("already compacted") || text.includes("no real conversation messages");
|
|
1327
|
+
}
|
|
1328
|
+
function formatCompactionReason(reason) {
|
|
1329
|
+
const text = reason?.trim();
|
|
1330
|
+
if (!text) return;
|
|
1331
|
+
const lower = text.toLowerCase();
|
|
1332
|
+
if (lower.includes("nothing to compact")) return "nothing compactable in this session yet";
|
|
1333
|
+
if (lower.includes("below threshold")) return "context is below the compaction threshold";
|
|
1334
|
+
if (lower.includes("already compacted")) return "session was already compacted recently";
|
|
1335
|
+
if (lower.includes("no real conversation messages")) return "no real conversation messages yet";
|
|
1336
|
+
return text;
|
|
1337
|
+
}
|
|
1338
|
+
const handleCompactCommand = async (params) => {
|
|
1339
|
+
if (!(params.command.commandBodyNormalized === "/compact" || params.command.commandBodyNormalized.startsWith("/compact "))) return null;
|
|
1340
|
+
if (!params.command.isAuthorizedSender) {
|
|
1341
|
+
logVerbose(`Ignoring /compact from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
1342
|
+
return { shouldContinue: false };
|
|
1343
|
+
}
|
|
1344
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
1345
|
+
shouldContinue: false,
|
|
1346
|
+
reply: { text: "āļø Compaction unavailable (missing session id)." }
|
|
1347
|
+
};
|
|
1348
|
+
const sessionId = params.sessionEntry.sessionId;
|
|
1349
|
+
if (isEmbeddedPiRunActive(sessionId)) {
|
|
1350
|
+
abortEmbeddedPiRun(sessionId);
|
|
1351
|
+
await waitForEmbeddedPiRunEnd(sessionId, 15e3);
|
|
1352
|
+
}
|
|
1353
|
+
const customInstructions = extractCompactInstructions({
|
|
1354
|
+
rawBody: params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body,
|
|
1355
|
+
ctx: params.ctx,
|
|
1356
|
+
cfg: params.cfg,
|
|
1357
|
+
agentId: params.agentId,
|
|
1358
|
+
isGroup: params.isGroup
|
|
1359
|
+
});
|
|
1360
|
+
const result = await compactEmbeddedPiSession({
|
|
1361
|
+
sessionId,
|
|
1362
|
+
sessionKey: params.sessionKey,
|
|
1363
|
+
allowGatewaySubagentBinding: true,
|
|
1364
|
+
messageChannel: params.command.channel,
|
|
1365
|
+
groupId: params.sessionEntry.groupId,
|
|
1366
|
+
groupChannel: params.sessionEntry.groupChannel,
|
|
1367
|
+
groupSpace: params.sessionEntry.space,
|
|
1368
|
+
spawnedBy: params.sessionEntry.spawnedBy,
|
|
1369
|
+
sessionFile: resolveSessionFilePath(sessionId, params.sessionEntry, resolveSessionFilePathOptions({
|
|
1370
|
+
agentId: params.agentId,
|
|
1371
|
+
storePath: params.storePath
|
|
1372
|
+
})),
|
|
1373
|
+
workspaceDir: params.workspaceDir,
|
|
1374
|
+
agentDir: params.agentDir,
|
|
1375
|
+
config: params.cfg,
|
|
1376
|
+
skillsSnapshot: params.sessionEntry.skillsSnapshot,
|
|
1377
|
+
provider: params.provider,
|
|
1378
|
+
model: params.model,
|
|
1379
|
+
thinkLevel: params.resolvedThinkLevel ?? await params.resolveDefaultThinkingLevel(),
|
|
1380
|
+
bashElevated: {
|
|
1381
|
+
enabled: false,
|
|
1382
|
+
allowed: false,
|
|
1383
|
+
defaultLevel: "off"
|
|
1384
|
+
},
|
|
1385
|
+
customInstructions,
|
|
1386
|
+
trigger: "manual",
|
|
1387
|
+
senderIsOwner: params.command.senderIsOwner,
|
|
1388
|
+
ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : void 0
|
|
1389
|
+
});
|
|
1390
|
+
const compactLabel = result.ok || isCompactionSkipReason(result.reason) ? result.compacted ? result.result?.tokensBefore != null && result.result?.tokensAfter != null ? `Compacted (${formatTokenCount(result.result.tokensBefore)} ā ${formatTokenCount(result.result.tokensAfter)})` : result.result?.tokensBefore ? `Compacted (${formatTokenCount(result.result.tokensBefore)} before)` : "Compacted" : "Compaction skipped" : "Compaction failed";
|
|
1391
|
+
if (result.ok && result.compacted) await incrementCompactionCount({
|
|
1392
|
+
sessionEntry: params.sessionEntry,
|
|
1393
|
+
sessionStore: params.sessionStore,
|
|
1394
|
+
sessionKey: params.sessionKey,
|
|
1395
|
+
storePath: params.storePath,
|
|
1396
|
+
tokensAfter: result.result?.tokensAfter
|
|
1397
|
+
});
|
|
1398
|
+
const totalTokens = result.result?.tokensAfter ?? resolveFreshSessionTotalTokens(params.sessionEntry);
|
|
1399
|
+
const contextSummary = formatContextUsageShort(typeof totalTokens === "number" && totalTokens > 0 ? totalTokens : null, params.contextTokens ?? params.sessionEntry.contextTokens ?? null);
|
|
1400
|
+
const reason = formatCompactionReason(result.reason);
|
|
1401
|
+
const line = reason ? `${compactLabel}: ${reason} ⢠${contextSummary}` : `${compactLabel} ⢠${contextSummary}`;
|
|
1402
|
+
enqueueSystemEvent(line, { sessionKey: params.sessionKey });
|
|
1403
|
+
return {
|
|
1404
|
+
shouldContinue: false,
|
|
1405
|
+
reply: { text: `āļø ${line}` }
|
|
1406
|
+
};
|
|
1407
|
+
};
|
|
1408
|
+
//#endregion
|
|
1409
|
+
//#region src/auto-reply/reply/commands-slash-parse.ts
|
|
1410
|
+
function parseSlashCommandActionArgs(raw, slash) {
|
|
1411
|
+
const trimmed = raw.trim();
|
|
1412
|
+
const slashLower = slash.toLowerCase();
|
|
1413
|
+
if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" };
|
|
1414
|
+
const rest = trimmed.slice(slash.length).trim();
|
|
1415
|
+
if (!rest) return { kind: "empty" };
|
|
1416
|
+
const match = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
1417
|
+
if (!match) return { kind: "invalid" };
|
|
1418
|
+
return {
|
|
1419
|
+
kind: "parsed",
|
|
1420
|
+
action: match[1]?.toLowerCase() ?? "",
|
|
1421
|
+
args: (match[2] ?? "").trim()
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
function parseSlashCommandOrNull(raw, slash, opts) {
|
|
1425
|
+
const parsed = parseSlashCommandActionArgs(raw, slash);
|
|
1426
|
+
if (parsed.kind === "no-match") return null;
|
|
1427
|
+
if (parsed.kind === "invalid") return {
|
|
1428
|
+
ok: false,
|
|
1429
|
+
message: opts.invalidMessage
|
|
1430
|
+
};
|
|
1431
|
+
if (parsed.kind === "empty") return {
|
|
1432
|
+
ok: true,
|
|
1433
|
+
action: opts.defaultAction ?? "show",
|
|
1434
|
+
args: ""
|
|
1435
|
+
};
|
|
1436
|
+
return {
|
|
1437
|
+
ok: true,
|
|
1438
|
+
action: parsed.action,
|
|
1439
|
+
args: parsed.args
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
//#endregion
|
|
1443
|
+
//#region src/auto-reply/reply/commands-setunset.ts
|
|
1444
|
+
function parseSetUnsetCommand(params) {
|
|
1445
|
+
const action = params.action;
|
|
1446
|
+
const args = params.args.trim();
|
|
1447
|
+
if (action === "unset") {
|
|
1448
|
+
if (!args) return {
|
|
1449
|
+
kind: "error",
|
|
1450
|
+
message: `Usage: ${params.slash} unset path`
|
|
1451
|
+
};
|
|
1452
|
+
return {
|
|
1453
|
+
kind: "unset",
|
|
1454
|
+
path: args
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
if (!args) return {
|
|
1458
|
+
kind: "error",
|
|
1459
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1460
|
+
};
|
|
1461
|
+
const eqIndex = args.indexOf("=");
|
|
1462
|
+
if (eqIndex <= 0) return {
|
|
1463
|
+
kind: "error",
|
|
1464
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1465
|
+
};
|
|
1466
|
+
const path = args.slice(0, eqIndex).trim();
|
|
1467
|
+
const rawValue = args.slice(eqIndex + 1);
|
|
1468
|
+
if (!path) return {
|
|
1469
|
+
kind: "error",
|
|
1470
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1471
|
+
};
|
|
1472
|
+
const parsed = parseConfigValue(rawValue);
|
|
1473
|
+
if (parsed.error) return {
|
|
1474
|
+
kind: "error",
|
|
1475
|
+
message: parsed.error
|
|
1476
|
+
};
|
|
1477
|
+
return {
|
|
1478
|
+
kind: "set",
|
|
1479
|
+
path,
|
|
1480
|
+
value: parsed.value
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
function parseSetUnsetCommandAction(params) {
|
|
1484
|
+
if (params.action !== "set" && params.action !== "unset") return null;
|
|
1485
|
+
const parsed = parseSetUnsetCommand({
|
|
1486
|
+
slash: params.slash,
|
|
1487
|
+
action: params.action,
|
|
1488
|
+
args: params.args
|
|
1489
|
+
});
|
|
1490
|
+
if (parsed.kind === "error") return params.onError(parsed.message);
|
|
1491
|
+
return parsed.kind === "set" ? params.onSet(parsed.path, parsed.value) : params.onUnset(parsed.path);
|
|
1492
|
+
}
|
|
1493
|
+
function parseSlashCommandWithSetUnset(params) {
|
|
1494
|
+
const parsed = parseSlashCommandOrNull(params.raw, params.slash, { invalidMessage: params.invalidMessage });
|
|
1495
|
+
if (!parsed) return null;
|
|
1496
|
+
if (!parsed.ok) return params.onError(parsed.message);
|
|
1497
|
+
const { action, args } = parsed;
|
|
1498
|
+
const setUnset = parseSetUnsetCommandAction({
|
|
1499
|
+
slash: params.slash,
|
|
1500
|
+
action,
|
|
1501
|
+
args,
|
|
1502
|
+
onSet: params.onSet,
|
|
1503
|
+
onUnset: params.onUnset,
|
|
1504
|
+
onError: params.onError
|
|
1505
|
+
});
|
|
1506
|
+
if (setUnset) return setUnset;
|
|
1507
|
+
const knownAction = params.onKnownAction(action, args);
|
|
1508
|
+
if (knownAction) return knownAction;
|
|
1509
|
+
return params.onError(params.usageMessage);
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region src/auto-reply/reply/commands-setunset-standard.ts
|
|
1513
|
+
function parseStandardSetUnsetSlashCommand(params) {
|
|
1514
|
+
return parseSlashCommandWithSetUnset({
|
|
1515
|
+
raw: params.raw,
|
|
1516
|
+
slash: params.slash,
|
|
1517
|
+
invalidMessage: params.invalidMessage,
|
|
1518
|
+
usageMessage: params.usageMessage,
|
|
1519
|
+
onKnownAction: params.onKnownAction,
|
|
1520
|
+
onSet: params.onSet ?? ((path, value) => ({
|
|
1521
|
+
action: "set",
|
|
1522
|
+
path,
|
|
1523
|
+
value
|
|
1524
|
+
})),
|
|
1525
|
+
onUnset: params.onUnset ?? ((path) => ({
|
|
1526
|
+
action: "unset",
|
|
1527
|
+
path
|
|
1528
|
+
})),
|
|
1529
|
+
onError: params.onError ?? ((message) => ({
|
|
1530
|
+
action: "error",
|
|
1531
|
+
message
|
|
1532
|
+
}))
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region src/auto-reply/reply/config-commands.ts
|
|
1537
|
+
function parseConfigCommand(raw) {
|
|
1538
|
+
return parseStandardSetUnsetSlashCommand({
|
|
1539
|
+
raw,
|
|
1540
|
+
slash: "/config",
|
|
1541
|
+
invalidMessage: "Invalid /config syntax.",
|
|
1542
|
+
usageMessage: "Usage: /config show|set|unset",
|
|
1543
|
+
onKnownAction: (action, args) => {
|
|
1544
|
+
if (action === "show" || action === "get") return {
|
|
1545
|
+
action: "show",
|
|
1546
|
+
path: args || void 0
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
//#endregion
|
|
1552
|
+
//#region src/auto-reply/reply/debug-commands.ts
|
|
1553
|
+
function parseDebugCommand(raw) {
|
|
1554
|
+
return parseStandardSetUnsetSlashCommand({
|
|
1555
|
+
raw,
|
|
1556
|
+
slash: "/debug",
|
|
1557
|
+
invalidMessage: "Invalid /debug syntax.",
|
|
1558
|
+
usageMessage: "Usage: /debug show|set|unset|reset",
|
|
1559
|
+
onKnownAction: (action) => {
|
|
1560
|
+
if (action === "show") return { action: "show" };
|
|
1561
|
+
if (action === "reset") return { action: "reset" };
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
//#endregion
|
|
1566
|
+
//#region src/auto-reply/reply/commands-config.ts
|
|
1567
|
+
const handleConfigCommand = async (params, allowTextCommands) => {
|
|
1568
|
+
if (!allowTextCommands) return null;
|
|
1569
|
+
const configCommand = parseConfigCommand(params.command.commandBodyNormalized);
|
|
1570
|
+
if (!configCommand) return null;
|
|
1571
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/config");
|
|
1572
|
+
if (unauthorized) return unauthorized;
|
|
1573
|
+
const nonOwner = configCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/config");
|
|
1574
|
+
if (nonOwner) return nonOwner;
|
|
1575
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1576
|
+
label: "/config",
|
|
1577
|
+
configKey: "config"
|
|
1578
|
+
});
|
|
1579
|
+
if (disabled) return disabled;
|
|
1580
|
+
if (configCommand.action === "error") return {
|
|
1581
|
+
shouldContinue: false,
|
|
1582
|
+
reply: { text: `ā ļø ${configCommand.message}` }
|
|
1583
|
+
};
|
|
1584
|
+
let parsedWritePath;
|
|
1585
|
+
if (configCommand.action === "set" || configCommand.action === "unset") {
|
|
1586
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
1587
|
+
label: "/config write",
|
|
1588
|
+
allowedScopes: ["operator.admin"],
|
|
1589
|
+
missingText: "ā /config set|unset requires operator.admin for gateway clients."
|
|
1590
|
+
});
|
|
1591
|
+
if (missingAdminScope) return missingAdminScope;
|
|
1592
|
+
const parsedPath = parseConfigPath(configCommand.path);
|
|
1593
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1594
|
+
shouldContinue: false,
|
|
1595
|
+
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1596
|
+
};
|
|
1597
|
+
parsedWritePath = parsedPath.path;
|
|
1598
|
+
const channelId = params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
1599
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
1600
|
+
cfg: params.cfg,
|
|
1601
|
+
channel: params.command.channel,
|
|
1602
|
+
channelId,
|
|
1603
|
+
accountId: params.ctx.AccountId,
|
|
1604
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
1605
|
+
target: resolveConfigWriteTargetFromPath(parsedWritePath)
|
|
1606
|
+
});
|
|
1607
|
+
if (deniedText) return {
|
|
1608
|
+
shouldContinue: false,
|
|
1609
|
+
reply: { text: deniedText }
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
const snapshot = await readConfigFileSnapshot();
|
|
1613
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
1614
|
+
shouldContinue: false,
|
|
1615
|
+
reply: { text: "ā ļø Config file is invalid; fix it before using /config." }
|
|
1616
|
+
};
|
|
1617
|
+
const parsedBase = structuredClone(snapshot.parsed);
|
|
1618
|
+
if (configCommand.action === "show") {
|
|
1619
|
+
const pathRaw = configCommand.path?.trim();
|
|
1620
|
+
if (pathRaw) {
|
|
1621
|
+
const parsedPath = parseConfigPath(pathRaw);
|
|
1622
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1623
|
+
shouldContinue: false,
|
|
1624
|
+
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1625
|
+
};
|
|
1626
|
+
const value = getConfigValueAtPath(parsedBase, parsedPath.path);
|
|
1627
|
+
return {
|
|
1628
|
+
shouldContinue: false,
|
|
1629
|
+
reply: { text: `āļø Config ${pathRaw}:\n\`\`\`json\n${JSON.stringify(value ?? null, null, 2)}\n\`\`\`` }
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
return {
|
|
1633
|
+
shouldContinue: false,
|
|
1634
|
+
reply: { text: `āļø Config (raw):\n\`\`\`json\n${JSON.stringify(parsedBase, null, 2)}\n\`\`\`` }
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
if (configCommand.action === "unset") {
|
|
1638
|
+
if (!unsetConfigValueAtPath(parsedBase, parsedWritePath ?? [])) return {
|
|
1639
|
+
shouldContinue: false,
|
|
1640
|
+
reply: { text: `āļø No config value found for ${configCommand.path}.` }
|
|
1641
|
+
};
|
|
1642
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1643
|
+
if (!validated.ok) {
|
|
1644
|
+
const issue = validated.issues[0];
|
|
1645
|
+
return {
|
|
1646
|
+
shouldContinue: false,
|
|
1647
|
+
reply: { text: `ā ļø Config invalid after unset (${issue.path}: ${issue.message}).` }
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
await writeConfigFile(validated.config);
|
|
1651
|
+
return {
|
|
1652
|
+
shouldContinue: false,
|
|
1653
|
+
reply: { text: `āļø Config updated: ${configCommand.path} removed.` }
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
if (configCommand.action === "set") {
|
|
1657
|
+
setConfigValueAtPath(parsedBase, parsedWritePath ?? [], configCommand.value);
|
|
1658
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1659
|
+
if (!validated.ok) {
|
|
1660
|
+
const issue = validated.issues[0];
|
|
1661
|
+
return {
|
|
1662
|
+
shouldContinue: false,
|
|
1663
|
+
reply: { text: `ā ļø Config invalid after set (${issue.path}: ${issue.message}).` }
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
await writeConfigFile(validated.config);
|
|
1667
|
+
const valueLabel = typeof configCommand.value === "string" ? `"${configCommand.value}"` : JSON.stringify(configCommand.value);
|
|
1668
|
+
return {
|
|
1669
|
+
shouldContinue: false,
|
|
1670
|
+
reply: { text: `āļø Config updated: ${configCommand.path}=${valueLabel ?? "null"}` }
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
return null;
|
|
1674
|
+
};
|
|
1675
|
+
const handleDebugCommand = async (params, allowTextCommands) => {
|
|
1676
|
+
if (!allowTextCommands) return null;
|
|
1677
|
+
const debugCommand = parseDebugCommand(params.command.commandBodyNormalized);
|
|
1678
|
+
if (!debugCommand) return null;
|
|
1679
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/debug");
|
|
1680
|
+
if (unauthorized) return unauthorized;
|
|
1681
|
+
const nonOwner = rejectNonOwnerCommand(params, "/debug");
|
|
1682
|
+
if (nonOwner) return nonOwner;
|
|
1683
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1684
|
+
label: "/debug",
|
|
1685
|
+
configKey: "debug"
|
|
1686
|
+
});
|
|
1687
|
+
if (disabled) return disabled;
|
|
1688
|
+
if (debugCommand.action === "error") return {
|
|
1689
|
+
shouldContinue: false,
|
|
1690
|
+
reply: { text: `ā ļø ${debugCommand.message}` }
|
|
1691
|
+
};
|
|
1692
|
+
if (debugCommand.action === "show") {
|
|
1693
|
+
const overrides = getConfigOverrides();
|
|
1694
|
+
if (!(Object.keys(overrides).length > 0)) return {
|
|
1695
|
+
shouldContinue: false,
|
|
1696
|
+
reply: { text: "āļø Debug overrides: (none)" }
|
|
1697
|
+
};
|
|
1698
|
+
return {
|
|
1699
|
+
shouldContinue: false,
|
|
1700
|
+
reply: { text: `āļø Debug overrides (memory-only):\n\`\`\`json\n${JSON.stringify(overrides, null, 2)}\n\`\`\`` }
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
if (debugCommand.action === "reset") {
|
|
1704
|
+
resetConfigOverrides();
|
|
1705
|
+
return {
|
|
1706
|
+
shouldContinue: false,
|
|
1707
|
+
reply: { text: "āļø Debug overrides cleared; using config on disk." }
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1710
|
+
if (debugCommand.action === "unset") {
|
|
1711
|
+
const result = unsetConfigOverride(debugCommand.path);
|
|
1712
|
+
if (!result.ok) return {
|
|
1713
|
+
shouldContinue: false,
|
|
1714
|
+
reply: { text: `ā ļø ${result.error ?? "Invalid path."}` }
|
|
1715
|
+
};
|
|
1716
|
+
if (!result.removed) return {
|
|
1717
|
+
shouldContinue: false,
|
|
1718
|
+
reply: { text: `āļø No debug override found for ${debugCommand.path}.` }
|
|
1719
|
+
};
|
|
1720
|
+
return {
|
|
1721
|
+
shouldContinue: false,
|
|
1722
|
+
reply: { text: `āļø Debug override removed for ${debugCommand.path}.` }
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
if (debugCommand.action === "set") {
|
|
1726
|
+
const result = setConfigOverride(debugCommand.path, debugCommand.value);
|
|
1727
|
+
if (!result.ok) return {
|
|
1728
|
+
shouldContinue: false,
|
|
1729
|
+
reply: { text: `ā ļø ${result.error ?? "Invalid override."}` }
|
|
1730
|
+
};
|
|
1731
|
+
const valueLabel = typeof debugCommand.value === "string" ? `"${debugCommand.value}"` : JSON.stringify(debugCommand.value);
|
|
1732
|
+
return {
|
|
1733
|
+
shouldContinue: false,
|
|
1734
|
+
reply: { text: `āļø Debug override set: ${debugCommand.path}=${valueLabel ?? "null"}` }
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
return null;
|
|
1738
|
+
};
|
|
1739
|
+
//#endregion
|
|
1740
|
+
//#region src/auto-reply/reply/mcp-commands.ts
|
|
1741
|
+
function parseMcpCommand(raw) {
|
|
1742
|
+
return parseStandardSetUnsetSlashCommand({
|
|
1743
|
+
raw,
|
|
1744
|
+
slash: "/mcp",
|
|
1745
|
+
invalidMessage: "Invalid /mcp syntax.",
|
|
1746
|
+
usageMessage: "Usage: /mcp show|set|unset",
|
|
1747
|
+
onKnownAction: (action, args) => {
|
|
1748
|
+
if (action === "show" || action === "get") return {
|
|
1749
|
+
action: "show",
|
|
1750
|
+
name: args || void 0
|
|
1751
|
+
};
|
|
1752
|
+
},
|
|
1753
|
+
onSet: (name, value) => ({
|
|
1754
|
+
action: "set",
|
|
1755
|
+
name,
|
|
1756
|
+
value
|
|
1757
|
+
}),
|
|
1758
|
+
onUnset: (name) => ({
|
|
1759
|
+
action: "unset",
|
|
1760
|
+
name
|
|
1761
|
+
})
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region src/auto-reply/reply/commands-mcp.ts
|
|
1766
|
+
function renderJsonBlock$1(label, value) {
|
|
1767
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
1768
|
+
}
|
|
1769
|
+
const handleMcpCommand = async (params, allowTextCommands) => {
|
|
1770
|
+
if (!allowTextCommands) return null;
|
|
1771
|
+
const mcpCommand = parseMcpCommand(params.command.commandBodyNormalized);
|
|
1772
|
+
if (!mcpCommand) return null;
|
|
1773
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/mcp");
|
|
1774
|
+
if (unauthorized) return unauthorized;
|
|
1775
|
+
const nonOwner = mcpCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/mcp");
|
|
1776
|
+
if (nonOwner) return nonOwner;
|
|
1777
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1778
|
+
label: "/mcp",
|
|
1779
|
+
configKey: "mcp"
|
|
1780
|
+
});
|
|
1781
|
+
if (disabled) return disabled;
|
|
1782
|
+
if (mcpCommand.action === "error") return {
|
|
1783
|
+
shouldContinue: false,
|
|
1784
|
+
reply: { text: `ā ļø ${mcpCommand.message}` }
|
|
1785
|
+
};
|
|
1786
|
+
if (mcpCommand.action === "show") {
|
|
1787
|
+
const loaded = await listConfiguredMcpServers();
|
|
1788
|
+
if (!loaded.ok) return {
|
|
1789
|
+
shouldContinue: false,
|
|
1790
|
+
reply: { text: `ā ļø ${loaded.error}` }
|
|
1791
|
+
};
|
|
1792
|
+
if (mcpCommand.name) {
|
|
1793
|
+
const server = loaded.mcpServers[mcpCommand.name];
|
|
1794
|
+
if (!server) return {
|
|
1795
|
+
shouldContinue: false,
|
|
1796
|
+
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${loaded.path}.` }
|
|
1797
|
+
};
|
|
1798
|
+
return {
|
|
1799
|
+
shouldContinue: false,
|
|
1800
|
+
reply: { text: renderJsonBlock$1(`š MCP server "${mcpCommand.name}" (${loaded.path})`, server) }
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
if (Object.keys(loaded.mcpServers).length === 0) return {
|
|
1804
|
+
shouldContinue: false,
|
|
1805
|
+
reply: { text: `š No MCP servers configured in ${loaded.path}.` }
|
|
1806
|
+
};
|
|
1807
|
+
return {
|
|
1808
|
+
shouldContinue: false,
|
|
1809
|
+
reply: { text: renderJsonBlock$1(`š MCP servers (${loaded.path})`, loaded.mcpServers) }
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
1813
|
+
label: "/mcp write",
|
|
1814
|
+
allowedScopes: ["operator.admin"],
|
|
1815
|
+
missingText: "ā /mcp set|unset requires operator.admin for gateway clients."
|
|
1816
|
+
});
|
|
1817
|
+
if (missingAdminScope) return missingAdminScope;
|
|
1818
|
+
if (mcpCommand.action === "set") {
|
|
1819
|
+
const result = await setConfiguredMcpServer({
|
|
1820
|
+
name: mcpCommand.name,
|
|
1821
|
+
server: mcpCommand.value
|
|
1822
|
+
});
|
|
1823
|
+
if (!result.ok) return {
|
|
1824
|
+
shouldContinue: false,
|
|
1825
|
+
reply: { text: `ā ļø ${result.error}` }
|
|
1826
|
+
};
|
|
1827
|
+
return {
|
|
1828
|
+
shouldContinue: false,
|
|
1829
|
+
reply: { text: `š MCP server "${mcpCommand.name}" saved to ${result.path}.` }
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
const result = await unsetConfiguredMcpServer({ name: mcpCommand.name });
|
|
1833
|
+
if (!result.ok) return {
|
|
1834
|
+
shouldContinue: false,
|
|
1835
|
+
reply: { text: `ā ļø ${result.error}` }
|
|
1836
|
+
};
|
|
1837
|
+
if (!result.removed) return {
|
|
1838
|
+
shouldContinue: false,
|
|
1839
|
+
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${result.path}.` }
|
|
1840
|
+
};
|
|
1841
|
+
return {
|
|
1842
|
+
shouldContinue: false,
|
|
1843
|
+
reply: { text: `š MCP server "${mcpCommand.name}" removed from ${result.path}.` }
|
|
1844
|
+
};
|
|
1845
|
+
};
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region src/auto-reply/reply/commands-plugin.ts
|
|
1848
|
+
/**
|
|
1849
|
+
* Plugin Command Handler
|
|
1850
|
+
*
|
|
1851
|
+
* Handles commands registered by plugins, bypassing the LLM agent.
|
|
1852
|
+
* This handler is called before built-in command handlers.
|
|
1853
|
+
*/
|
|
1854
|
+
/**
|
|
1855
|
+
* Handle plugin-registered commands.
|
|
1856
|
+
* Returns a result if a plugin command was matched and executed,
|
|
1857
|
+
* or null to continue to the next handler.
|
|
1858
|
+
*/
|
|
1859
|
+
const handlePluginCommand = async (params, allowTextCommands) => {
|
|
1860
|
+
const { command, cfg } = params;
|
|
1861
|
+
if (!allowTextCommands) return null;
|
|
1862
|
+
const match = matchPluginCommand(command.commandBodyNormalized);
|
|
1863
|
+
if (!match) return null;
|
|
1864
|
+
return {
|
|
1865
|
+
shouldContinue: false,
|
|
1866
|
+
reply: await executePluginCommand({
|
|
1867
|
+
command: match.command,
|
|
1868
|
+
args: match.args,
|
|
1869
|
+
senderId: command.senderId,
|
|
1870
|
+
channel: command.channel,
|
|
1871
|
+
channelId: command.channelId,
|
|
1872
|
+
isAuthorizedSender: command.isAuthorizedSender,
|
|
1873
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
1874
|
+
commandBody: command.commandBodyNormalized,
|
|
1875
|
+
config: cfg,
|
|
1876
|
+
from: command.from,
|
|
1877
|
+
to: command.to,
|
|
1878
|
+
accountId: params.ctx.AccountId ?? void 0,
|
|
1879
|
+
messageThreadId: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? params.ctx.MessageThreadId : void 0,
|
|
1880
|
+
threadParentId: params.ctx.ThreadParentId?.trim() || void 0
|
|
1881
|
+
})
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region src/auto-reply/reply/plugins-commands.ts
|
|
1886
|
+
function parsePluginsCommand(raw) {
|
|
1887
|
+
const match = raw.match(/^\/plugins?(?:\s+(.*))?$/i);
|
|
1888
|
+
if (!match) return null;
|
|
1889
|
+
const tail = match[1]?.trim() ?? "";
|
|
1890
|
+
if (!tail) return { action: "list" };
|
|
1891
|
+
const [rawAction, ...rest] = tail.split(/\s+/);
|
|
1892
|
+
const action = rawAction?.trim().toLowerCase();
|
|
1893
|
+
const name = rest.join(" ").trim();
|
|
1894
|
+
if (action === "list") return name ? {
|
|
1895
|
+
action: "error",
|
|
1896
|
+
message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
|
|
1897
|
+
} : { action: "list" };
|
|
1898
|
+
if (action === "inspect" || action === "show" || action === "get") return {
|
|
1899
|
+
action: "inspect",
|
|
1900
|
+
name: name || void 0
|
|
1901
|
+
};
|
|
1902
|
+
if (action === "install" || action === "add") {
|
|
1903
|
+
if (!name) return {
|
|
1904
|
+
action: "error",
|
|
1905
|
+
message: "Usage: /plugins install <path|archive|npm-spec|clawhub:pkg>"
|
|
1906
|
+
};
|
|
1907
|
+
return {
|
|
1908
|
+
action: "install",
|
|
1909
|
+
spec: name
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
if (action === "enable" || action === "disable") {
|
|
1913
|
+
if (!name) return {
|
|
1914
|
+
action: "error",
|
|
1915
|
+
message: `Usage: /plugins ${action} <plugin-id-or-name>`
|
|
1916
|
+
};
|
|
1917
|
+
return {
|
|
1918
|
+
action,
|
|
1919
|
+
name
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
return {
|
|
1923
|
+
action: "error",
|
|
1924
|
+
message: "Usage: /plugins list|inspect|show|get|install|enable|disable [plugin]"
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
//#endregion
|
|
1928
|
+
//#region src/auto-reply/reply/commands-plugins.ts
|
|
1929
|
+
function renderJsonBlock(label, value) {
|
|
1930
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
1931
|
+
}
|
|
1932
|
+
function buildPluginInspectJson(params) {
|
|
1933
|
+
const inspect = buildPluginInspectReport({
|
|
1934
|
+
id: params.id,
|
|
1935
|
+
config: params.config,
|
|
1936
|
+
report: params.report
|
|
1937
|
+
});
|
|
1938
|
+
if (!inspect) return null;
|
|
1939
|
+
return {
|
|
1940
|
+
inspect,
|
|
1941
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
1942
|
+
code: warning.code,
|
|
1943
|
+
severity: warning.severity,
|
|
1944
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
1945
|
+
})),
|
|
1946
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
function buildAllPluginInspectJson(params) {
|
|
1950
|
+
return buildAllPluginInspectReports({
|
|
1951
|
+
config: params.config,
|
|
1952
|
+
report: params.report
|
|
1953
|
+
}).map((inspect) => ({
|
|
1954
|
+
inspect,
|
|
1955
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
1956
|
+
code: warning.code,
|
|
1957
|
+
severity: warning.severity,
|
|
1958
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
1959
|
+
})),
|
|
1960
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
1961
|
+
}));
|
|
1962
|
+
}
|
|
1963
|
+
function formatPluginLabel(plugin) {
|
|
1964
|
+
if (!plugin.name || plugin.name === plugin.id) return plugin.id;
|
|
1965
|
+
return `${plugin.name} (${plugin.id})`;
|
|
1966
|
+
}
|
|
1967
|
+
function formatPluginsList(report) {
|
|
1968
|
+
if (report.plugins.length === 0) return `š No plugins found for workspace ${report.workspaceDir ?? "(unknown workspace)"}.`;
|
|
1969
|
+
return [`š Plugins (${report.plugins.filter((plugin) => plugin.status === "loaded").length}/${report.plugins.length} loaded)`, ...report.plugins.map((plugin) => {
|
|
1970
|
+
const format = plugin.bundleFormat ? `${plugin.format ?? "vora"}/${plugin.bundleFormat}` : plugin.format ?? "vora";
|
|
1971
|
+
return `- ${formatPluginLabel(plugin)} [${plugin.status}] ${format}`;
|
|
1972
|
+
})].join("\n");
|
|
1973
|
+
}
|
|
1974
|
+
function findPlugin(report, rawName) {
|
|
1975
|
+
const target = rawName.trim().toLowerCase();
|
|
1976
|
+
if (!target) return;
|
|
1977
|
+
return report.plugins.find((plugin) => plugin.id.toLowerCase() === target || plugin.name.toLowerCase() === target);
|
|
1978
|
+
}
|
|
1979
|
+
function looksLikeLocalPluginInstallSpec(raw) {
|
|
1980
|
+
return raw.startsWith(".") || raw.startsWith("~") || raw.startsWith("/") || raw.endsWith(".ts") || raw.endsWith(".js") || raw.endsWith(".mjs") || raw.endsWith(".cjs") || raw.endsWith(".tgz") || raw.endsWith(".tar.gz") || raw.endsWith(".tar") || raw.endsWith(".zip");
|
|
1981
|
+
}
|
|
1982
|
+
async function installPluginFromPluginsCommand(params) {
|
|
1983
|
+
const fileSpec = resolveFileNpmSpecToLocalPath(params.raw);
|
|
1984
|
+
if (fileSpec && !fileSpec.ok) return {
|
|
1985
|
+
ok: false,
|
|
1986
|
+
error: fileSpec.error
|
|
1987
|
+
};
|
|
1988
|
+
const resolved = resolveUserPath(fileSpec && fileSpec.ok ? fileSpec.path : params.raw);
|
|
1989
|
+
if (fsSync.existsSync(resolved)) {
|
|
1990
|
+
const result = await installPluginFromPath({
|
|
1991
|
+
path: resolved,
|
|
1992
|
+
logger: createPluginInstallLogger()
|
|
1993
|
+
});
|
|
1994
|
+
if (!result.ok) return {
|
|
1995
|
+
ok: false,
|
|
1996
|
+
error: result.error
|
|
1997
|
+
};
|
|
1998
|
+
clearPluginManifestRegistryCache();
|
|
1999
|
+
const source = resolveArchiveKind(resolved) ? "archive" : "path";
|
|
2000
|
+
await persistPluginInstall({
|
|
2001
|
+
config: params.config,
|
|
2002
|
+
pluginId: result.pluginId,
|
|
2003
|
+
install: {
|
|
2004
|
+
source,
|
|
2005
|
+
sourcePath: resolved,
|
|
2006
|
+
installPath: result.targetDir,
|
|
2007
|
+
version: result.version
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
return {
|
|
2011
|
+
ok: true,
|
|
2012
|
+
pluginId: result.pluginId
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
if (looksLikeLocalPluginInstallSpec(params.raw)) return {
|
|
2016
|
+
ok: false,
|
|
2017
|
+
error: `Path not found: ${resolved}`
|
|
2018
|
+
};
|
|
2019
|
+
if (parseClawHubPluginSpec(params.raw)) {
|
|
2020
|
+
const result = await installPluginFromClawHub({
|
|
2021
|
+
spec: params.raw,
|
|
2022
|
+
logger: createPluginInstallLogger()
|
|
2023
|
+
});
|
|
2024
|
+
if (!result.ok) return {
|
|
2025
|
+
ok: false,
|
|
2026
|
+
error: result.error
|
|
2027
|
+
};
|
|
2028
|
+
clearPluginManifestRegistryCache();
|
|
2029
|
+
await persistPluginInstall({
|
|
2030
|
+
config: params.config,
|
|
2031
|
+
pluginId: result.pluginId,
|
|
2032
|
+
install: {
|
|
2033
|
+
source: "clawhub",
|
|
2034
|
+
spec: params.raw,
|
|
2035
|
+
installPath: result.targetDir,
|
|
2036
|
+
version: result.version,
|
|
2037
|
+
integrity: result.clawhub.integrity,
|
|
2038
|
+
resolvedAt: result.clawhub.resolvedAt,
|
|
2039
|
+
clawhubUrl: result.clawhub.clawhubUrl,
|
|
2040
|
+
clawhubPackage: result.clawhub.clawhubPackage,
|
|
2041
|
+
clawhubFamily: result.clawhub.clawhubFamily,
|
|
2042
|
+
clawhubChannel: result.clawhub.clawhubChannel
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
return {
|
|
2046
|
+
ok: true,
|
|
2047
|
+
pluginId: result.pluginId
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
const preferredClawHubSpec = buildPreferredClawHubSpec(params.raw);
|
|
2051
|
+
if (preferredClawHubSpec) {
|
|
2052
|
+
const clawhubResult = await installPluginFromClawHub({
|
|
2053
|
+
spec: preferredClawHubSpec,
|
|
2054
|
+
logger: createPluginInstallLogger()
|
|
2055
|
+
});
|
|
2056
|
+
if (clawhubResult.ok) {
|
|
2057
|
+
clearPluginManifestRegistryCache();
|
|
2058
|
+
await persistPluginInstall({
|
|
2059
|
+
config: params.config,
|
|
2060
|
+
pluginId: clawhubResult.pluginId,
|
|
2061
|
+
install: {
|
|
2062
|
+
source: "clawhub",
|
|
2063
|
+
spec: preferredClawHubSpec,
|
|
2064
|
+
installPath: clawhubResult.targetDir,
|
|
2065
|
+
version: clawhubResult.version,
|
|
2066
|
+
integrity: clawhubResult.clawhub.integrity,
|
|
2067
|
+
resolvedAt: clawhubResult.clawhub.resolvedAt,
|
|
2068
|
+
clawhubUrl: clawhubResult.clawhub.clawhubUrl,
|
|
2069
|
+
clawhubPackage: clawhubResult.clawhub.clawhubPackage,
|
|
2070
|
+
clawhubFamily: clawhubResult.clawhub.clawhubFamily,
|
|
2071
|
+
clawhubChannel: clawhubResult.clawhub.clawhubChannel
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
return {
|
|
2075
|
+
ok: true,
|
|
2076
|
+
pluginId: clawhubResult.pluginId
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
if (decidePreferredClawHubFallback(clawhubResult) !== "fallback_to_npm") return {
|
|
2080
|
+
ok: false,
|
|
2081
|
+
error: clawhubResult.error
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
const result = await installPluginFromNpmSpec({
|
|
2085
|
+
spec: params.raw,
|
|
2086
|
+
logger: createPluginInstallLogger()
|
|
2087
|
+
});
|
|
2088
|
+
if (!result.ok) return {
|
|
2089
|
+
ok: false,
|
|
2090
|
+
error: result.error
|
|
2091
|
+
};
|
|
2092
|
+
clearPluginManifestRegistryCache();
|
|
2093
|
+
const installRecord = buildNpmInstallRecordFields({
|
|
2094
|
+
spec: params.raw,
|
|
2095
|
+
installPath: result.targetDir,
|
|
2096
|
+
version: result.version,
|
|
2097
|
+
resolution: result.npmResolution
|
|
2098
|
+
});
|
|
2099
|
+
await persistPluginInstall({
|
|
2100
|
+
config: params.config,
|
|
2101
|
+
pluginId: result.pluginId,
|
|
2102
|
+
install: installRecord
|
|
2103
|
+
});
|
|
2104
|
+
return {
|
|
2105
|
+
ok: true,
|
|
2106
|
+
pluginId: result.pluginId
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
async function loadPluginCommandState(workspaceDir) {
|
|
2110
|
+
const snapshot = await readConfigFileSnapshot();
|
|
2111
|
+
if (!snapshot.valid) return {
|
|
2112
|
+
ok: false,
|
|
2113
|
+
path: snapshot.path,
|
|
2114
|
+
error: "Config file is invalid; fix it before using /plugins."
|
|
2115
|
+
};
|
|
2116
|
+
const config = structuredClone(snapshot.resolved);
|
|
2117
|
+
return {
|
|
2118
|
+
ok: true,
|
|
2119
|
+
path: snapshot.path,
|
|
2120
|
+
config,
|
|
2121
|
+
report: buildPluginStatusReport({
|
|
2122
|
+
config,
|
|
2123
|
+
workspaceDir
|
|
2124
|
+
})
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
const handlePluginsCommand = async (params, allowTextCommands) => {
|
|
2128
|
+
if (!allowTextCommands) return null;
|
|
2129
|
+
const pluginsCommand = parsePluginsCommand(params.command.commandBodyNormalized);
|
|
2130
|
+
if (!pluginsCommand) return null;
|
|
2131
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/plugins");
|
|
2132
|
+
if (unauthorized) return unauthorized;
|
|
2133
|
+
const nonOwner = (pluginsCommand.action === "list" || pluginsCommand.action === "inspect") && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/plugins");
|
|
2134
|
+
if (nonOwner) return nonOwner;
|
|
2135
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
2136
|
+
label: "/plugins",
|
|
2137
|
+
configKey: "plugins"
|
|
2138
|
+
});
|
|
2139
|
+
if (disabled) return disabled;
|
|
2140
|
+
if (pluginsCommand.action === "error") return {
|
|
2141
|
+
shouldContinue: false,
|
|
2142
|
+
reply: { text: `ā ļø ${pluginsCommand.message}` }
|
|
2143
|
+
};
|
|
2144
|
+
const loaded = await loadPluginCommandState(params.workspaceDir);
|
|
2145
|
+
if (!loaded.ok) return {
|
|
2146
|
+
shouldContinue: false,
|
|
2147
|
+
reply: { text: `ā ļø ${loaded.error}` }
|
|
2148
|
+
};
|
|
2149
|
+
if (pluginsCommand.action === "list") return {
|
|
2150
|
+
shouldContinue: false,
|
|
2151
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
2152
|
+
};
|
|
2153
|
+
if (pluginsCommand.action === "inspect") {
|
|
2154
|
+
if (!pluginsCommand.name) return {
|
|
2155
|
+
shouldContinue: false,
|
|
2156
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
2157
|
+
};
|
|
2158
|
+
if (pluginsCommand.name.toLowerCase() === "all") return {
|
|
2159
|
+
shouldContinue: false,
|
|
2160
|
+
reply: { text: renderJsonBlock("š Plugins", buildAllPluginInspectJson(loaded)) }
|
|
2161
|
+
};
|
|
2162
|
+
const payload = buildPluginInspectJson({
|
|
2163
|
+
id: pluginsCommand.name,
|
|
2164
|
+
config: loaded.config,
|
|
2165
|
+
report: loaded.report
|
|
2166
|
+
});
|
|
2167
|
+
if (!payload) return {
|
|
2168
|
+
shouldContinue: false,
|
|
2169
|
+
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2170
|
+
};
|
|
2171
|
+
return {
|
|
2172
|
+
shouldContinue: false,
|
|
2173
|
+
reply: { text: renderJsonBlock(`š Plugin "${payload.inspect.plugin.id}"`, {
|
|
2174
|
+
...payload.inspect,
|
|
2175
|
+
compatibilityWarnings: payload.compatibilityWarnings,
|
|
2176
|
+
install: payload.install
|
|
2177
|
+
}) }
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2181
|
+
label: "/plugins write",
|
|
2182
|
+
allowedScopes: ["operator.admin"],
|
|
2183
|
+
missingText: "ā /plugins install|enable|disable requires operator.admin for gateway clients."
|
|
2184
|
+
});
|
|
2185
|
+
if (missingAdminScope) return missingAdminScope;
|
|
2186
|
+
if (pluginsCommand.action === "install") {
|
|
2187
|
+
const installed = await installPluginFromPluginsCommand({
|
|
2188
|
+
raw: pluginsCommand.spec,
|
|
2189
|
+
config: structuredClone(loaded.config)
|
|
2190
|
+
});
|
|
2191
|
+
if (!installed.ok) return {
|
|
2192
|
+
shouldContinue: false,
|
|
2193
|
+
reply: { text: `ā ļø ${installed.error}` }
|
|
2194
|
+
};
|
|
2195
|
+
return {
|
|
2196
|
+
shouldContinue: false,
|
|
2197
|
+
reply: { text: `š Installed plugin "${installed.pluginId}". Restart the gateway to load plugins.` }
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
const plugin = findPlugin(loaded.report, pluginsCommand.name);
|
|
2201
|
+
if (!plugin) return {
|
|
2202
|
+
shouldContinue: false,
|
|
2203
|
+
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2204
|
+
};
|
|
2205
|
+
const validated = validateConfigObjectWithPlugins(setPluginEnabledInConfig(structuredClone(loaded.config), plugin.id, pluginsCommand.action === "enable"));
|
|
2206
|
+
if (!validated.ok) {
|
|
2207
|
+
const issue = validated.issues[0];
|
|
2208
|
+
return {
|
|
2209
|
+
shouldContinue: false,
|
|
2210
|
+
reply: { text: `ā ļø Config invalid after /plugins ${pluginsCommand.action} (${issue.path}: ${issue.message}).` }
|
|
2211
|
+
};
|
|
2212
|
+
}
|
|
2213
|
+
await writeConfigFile(validated.config);
|
|
2214
|
+
return {
|
|
2215
|
+
shouldContinue: false,
|
|
2216
|
+
reply: { text: `š Plugin "${plugin.id}" ${pluginsCommand.action}d in ${loaded.path}. Restart the gateway to apply.` }
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
//#endregion
|
|
2220
|
+
//#region src/auto-reply/send-policy.ts
|
|
2221
|
+
function normalizeSendPolicyOverride(raw) {
|
|
2222
|
+
const value = raw?.trim().toLowerCase();
|
|
2223
|
+
if (!value) return;
|
|
2224
|
+
if (value === "allow" || value === "on") return "allow";
|
|
2225
|
+
if (value === "deny" || value === "off") return "deny";
|
|
2226
|
+
}
|
|
2227
|
+
function parseSendPolicyCommand(raw) {
|
|
2228
|
+
if (!raw) return { hasCommand: false };
|
|
2229
|
+
const trimmed = raw.trim();
|
|
2230
|
+
if (!trimmed) return { hasCommand: false };
|
|
2231
|
+
const match = normalizeCommandBody(trimmed).match(/^\/send(?:\s+([a-zA-Z]+))?\s*$/i);
|
|
2232
|
+
if (!match) return { hasCommand: false };
|
|
2233
|
+
const token = match[1]?.trim().toLowerCase();
|
|
2234
|
+
if (!token) return { hasCommand: true };
|
|
2235
|
+
if (token === "inherit" || token === "default" || token === "reset") return {
|
|
2236
|
+
hasCommand: true,
|
|
2237
|
+
mode: "inherit"
|
|
2238
|
+
};
|
|
2239
|
+
return {
|
|
2240
|
+
hasCommand: true,
|
|
2241
|
+
mode: normalizeSendPolicyOverride(token)
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
//#endregion
|
|
2245
|
+
//#region src/auto-reply/reply/commands-session-store.ts
|
|
2246
|
+
async function persistSessionEntry(params) {
|
|
2247
|
+
if (!params.sessionEntry || !params.sessionStore || !params.sessionKey) return false;
|
|
2248
|
+
params.sessionEntry.updatedAt = Date.now();
|
|
2249
|
+
params.sessionStore[params.sessionKey] = params.sessionEntry;
|
|
2250
|
+
if (params.storePath) await updateSessionStore(params.storePath, (store) => {
|
|
2251
|
+
store[params.sessionKey] = params.sessionEntry;
|
|
2252
|
+
});
|
|
2253
|
+
return true;
|
|
2254
|
+
}
|
|
2255
|
+
async function persistAbortTargetEntry(params) {
|
|
2256
|
+
const { entry, key, sessionStore, storePath, abortCutoff } = params;
|
|
2257
|
+
if (!entry || !key || !sessionStore) return false;
|
|
2258
|
+
entry.abortedLastRun = true;
|
|
2259
|
+
applyAbortCutoffToSessionEntry(entry, abortCutoff);
|
|
2260
|
+
entry.updatedAt = Date.now();
|
|
2261
|
+
sessionStore[key] = entry;
|
|
2262
|
+
if (storePath) await updateSessionStore(storePath, (store) => {
|
|
2263
|
+
const nextEntry = store[key] ?? entry;
|
|
2264
|
+
if (!nextEntry) return;
|
|
2265
|
+
nextEntry.abortedLastRun = true;
|
|
2266
|
+
applyAbortCutoffToSessionEntry(nextEntry, abortCutoff);
|
|
2267
|
+
nextEntry.updatedAt = Date.now();
|
|
2268
|
+
store[key] = nextEntry;
|
|
2269
|
+
});
|
|
2270
|
+
return true;
|
|
2271
|
+
}
|
|
2272
|
+
//#endregion
|
|
2273
|
+
//#region src/auto-reply/reply/commands-session-abort.ts
|
|
2274
|
+
function resolveAbortTarget(params) {
|
|
2275
|
+
const targetSessionKey = params.ctx.CommandTargetSessionKey?.trim() || params.sessionKey;
|
|
2276
|
+
const { entry, key } = resolveSessionEntryForKey(params.sessionStore, targetSessionKey);
|
|
2277
|
+
if (entry && key) return {
|
|
2278
|
+
entry,
|
|
2279
|
+
key,
|
|
2280
|
+
sessionId: entry.sessionId
|
|
2281
|
+
};
|
|
2282
|
+
if (params.sessionEntry && params.sessionKey) return {
|
|
2283
|
+
entry: params.sessionEntry,
|
|
2284
|
+
key: params.sessionKey,
|
|
2285
|
+
sessionId: params.sessionEntry.sessionId
|
|
2286
|
+
};
|
|
2287
|
+
return {
|
|
2288
|
+
entry: void 0,
|
|
2289
|
+
key: targetSessionKey,
|
|
2290
|
+
sessionId: void 0
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
function resolveAbortCutoffForTarget(params) {
|
|
2294
|
+
if (!shouldPersistAbortCutoff({
|
|
2295
|
+
commandSessionKey: params.commandSessionKey,
|
|
2296
|
+
targetSessionKey: params.targetSessionKey
|
|
2297
|
+
})) return;
|
|
2298
|
+
return resolveAbortCutoffFromContext(params.ctx);
|
|
2299
|
+
}
|
|
2300
|
+
async function applyAbortTarget(params) {
|
|
2301
|
+
const { abortTarget } = params;
|
|
2302
|
+
if (abortTarget.sessionId) abortEmbeddedPiRun(abortTarget.sessionId);
|
|
2303
|
+
if (!await persistAbortTargetEntry({
|
|
2304
|
+
entry: abortTarget.entry,
|
|
2305
|
+
key: abortTarget.key,
|
|
2306
|
+
sessionStore: params.sessionStore,
|
|
2307
|
+
storePath: params.storePath,
|
|
2308
|
+
abortCutoff: params.abortCutoff
|
|
2309
|
+
}) && params.abortKey) setAbortMemory(params.abortKey, true);
|
|
2310
|
+
}
|
|
2311
|
+
function buildAbortTargetApplyParams(params, abortTarget) {
|
|
2312
|
+
return {
|
|
2313
|
+
abortTarget,
|
|
2314
|
+
sessionStore: params.sessionStore,
|
|
2315
|
+
storePath: params.storePath,
|
|
2316
|
+
abortKey: params.command.abortKey,
|
|
2317
|
+
abortCutoff: resolveAbortCutoffForTarget({
|
|
2318
|
+
ctx: params.ctx,
|
|
2319
|
+
commandSessionKey: params.sessionKey,
|
|
2320
|
+
targetSessionKey: abortTarget.key
|
|
2321
|
+
})
|
|
2322
|
+
};
|
|
2323
|
+
}
|
|
2324
|
+
const handleStopCommand = async (params, allowTextCommands) => {
|
|
2325
|
+
if (!allowTextCommands) return null;
|
|
2326
|
+
if (params.command.commandBodyNormalized !== "/stop") return null;
|
|
2327
|
+
const unauthorizedStop = rejectUnauthorizedCommand(params, "/stop");
|
|
2328
|
+
if (unauthorizedStop) return unauthorizedStop;
|
|
2329
|
+
const abortTarget = resolveAbortTarget({
|
|
2330
|
+
ctx: params.ctx,
|
|
2331
|
+
sessionKey: params.sessionKey,
|
|
2332
|
+
sessionEntry: params.sessionEntry,
|
|
2333
|
+
sessionStore: params.sessionStore
|
|
2334
|
+
});
|
|
2335
|
+
const cleared = clearSessionQueues([abortTarget.key, abortTarget.sessionId]);
|
|
2336
|
+
if (cleared.followupCleared > 0 || cleared.laneCleared > 0) logVerbose(`stop: cleared followups=${cleared.followupCleared} lane=${cleared.laneCleared} keys=${cleared.keys.join(",")}`);
|
|
2337
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, abortTarget));
|
|
2338
|
+
await triggerInternalHook(createInternalHookEvent("command", "stop", abortTarget.key ?? params.sessionKey ?? "", {
|
|
2339
|
+
sessionEntry: abortTarget.entry ?? params.sessionEntry,
|
|
2340
|
+
sessionId: abortTarget.sessionId,
|
|
2341
|
+
commandSource: params.command.surface,
|
|
2342
|
+
senderId: params.command.senderId
|
|
2343
|
+
}));
|
|
2344
|
+
const { stopped } = stopSubagentsForRequester({
|
|
2345
|
+
cfg: params.cfg,
|
|
2346
|
+
requesterSessionKey: abortTarget.key ?? params.sessionKey
|
|
2347
|
+
});
|
|
2348
|
+
return {
|
|
2349
|
+
shouldContinue: false,
|
|
2350
|
+
reply: { text: formatAbortReplyText(stopped) }
|
|
2351
|
+
};
|
|
2352
|
+
};
|
|
2353
|
+
const handleAbortTrigger = async (params, allowTextCommands) => {
|
|
2354
|
+
if (!allowTextCommands) return null;
|
|
2355
|
+
if (!isAbortTrigger(params.command.rawBodyNormalized)) return null;
|
|
2356
|
+
const unauthorizedAbortTrigger = rejectUnauthorizedCommand(params, "abort trigger");
|
|
2357
|
+
if (unauthorizedAbortTrigger) return unauthorizedAbortTrigger;
|
|
2358
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, resolveAbortTarget({
|
|
2359
|
+
ctx: params.ctx,
|
|
2360
|
+
sessionKey: params.sessionKey,
|
|
2361
|
+
sessionEntry: params.sessionEntry,
|
|
2362
|
+
sessionStore: params.sessionStore
|
|
2363
|
+
})));
|
|
2364
|
+
return {
|
|
2365
|
+
shouldContinue: false,
|
|
2366
|
+
reply: { text: "āļø Agent was aborted." }
|
|
2367
|
+
};
|
|
2368
|
+
};
|
|
2369
|
+
//#endregion
|
|
2370
|
+
//#region src/auto-reply/reply/matrix-context.ts
|
|
2371
|
+
function normalizeMatrixTarget(value) {
|
|
2372
|
+
return typeof value === "string" ? value.trim() : "";
|
|
2373
|
+
}
|
|
2374
|
+
function resolveMatrixRoomIdFromTarget(raw) {
|
|
2375
|
+
let target = normalizeMatrixTarget(raw);
|
|
2376
|
+
if (!target) return;
|
|
2377
|
+
if (target.toLowerCase().startsWith("matrix:")) target = target.slice(7).trim();
|
|
2378
|
+
if (/^(room|channel):/i.test(target)) return target.replace(/^(room|channel):/i, "").trim() || void 0;
|
|
2379
|
+
if (target.startsWith("!") || target.startsWith("#")) return target;
|
|
2380
|
+
}
|
|
2381
|
+
function resolveMatrixParentConversationId(params) {
|
|
2382
|
+
const targets = [
|
|
2383
|
+
params.ctx.OriginatingTo,
|
|
2384
|
+
params.command.to,
|
|
2385
|
+
params.ctx.To
|
|
2386
|
+
];
|
|
2387
|
+
for (const candidate of targets) {
|
|
2388
|
+
const roomId = resolveMatrixRoomIdFromTarget(candidate ?? "");
|
|
2389
|
+
if (roomId) return roomId;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
function resolveMatrixConversationId(params) {
|
|
2393
|
+
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2394
|
+
if (threadId) return threadId;
|
|
2395
|
+
return resolveMatrixParentConversationId(params);
|
|
2396
|
+
}
|
|
2397
|
+
//#endregion
|
|
2398
|
+
//#region src/auto-reply/reply/commands-session.ts
|
|
2399
|
+
const SESSION_DURATION_OFF_VALUES = new Set([
|
|
2400
|
+
"off",
|
|
2401
|
+
"disable",
|
|
2402
|
+
"disabled",
|
|
2403
|
+
"none",
|
|
2404
|
+
"0"
|
|
2405
|
+
]);
|
|
2406
|
+
const SESSION_ACTION_IDLE = "idle";
|
|
2407
|
+
const SESSION_ACTION_MAX_AGE = "max-age";
|
|
2408
|
+
let cachedChannelRuntime;
|
|
2409
|
+
function getChannelRuntime() {
|
|
2410
|
+
cachedChannelRuntime ??= createPluginRuntime().channel;
|
|
2411
|
+
return cachedChannelRuntime;
|
|
2412
|
+
}
|
|
2413
|
+
function resolveSessionCommandUsage() {
|
|
2414
|
+
return "Usage: /session idle <duration|off> | /session max-age <duration|off> (example: /session idle 24h)";
|
|
2415
|
+
}
|
|
2416
|
+
function parseSessionDurationMs(raw) {
|
|
2417
|
+
const normalized = raw.trim().toLowerCase();
|
|
2418
|
+
if (!normalized) throw new Error("missing duration");
|
|
2419
|
+
if (SESSION_DURATION_OFF_VALUES.has(normalized)) return 0;
|
|
2420
|
+
if (/^\d+(?:\.\d+)?$/.test(normalized)) {
|
|
2421
|
+
const hours = Number(normalized);
|
|
2422
|
+
if (!Number.isFinite(hours) || hours < 0) throw new Error("invalid duration");
|
|
2423
|
+
return Math.round(hours * 60 * 60 * 1e3);
|
|
2424
|
+
}
|
|
2425
|
+
return parseDurationMs(normalized, { defaultUnit: "h" });
|
|
2426
|
+
}
|
|
2427
|
+
function formatSessionExpiry(expiresAt) {
|
|
2428
|
+
return new Date(expiresAt).toISOString();
|
|
2429
|
+
}
|
|
2430
|
+
function resolveSessionBindingDurationMs(binding, key, fallbackMs) {
|
|
2431
|
+
const raw = binding.metadata?.[key];
|
|
2432
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return fallbackMs;
|
|
2433
|
+
return Math.max(0, Math.floor(raw));
|
|
2434
|
+
}
|
|
2435
|
+
function resolveSessionBindingLastActivityAt(binding) {
|
|
2436
|
+
const raw = binding.metadata?.lastActivityAt;
|
|
2437
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return binding.boundAt;
|
|
2438
|
+
return Math.max(Math.floor(raw), binding.boundAt);
|
|
2439
|
+
}
|
|
2440
|
+
function resolveSessionBindingBoundBy(binding) {
|
|
2441
|
+
const raw = binding.metadata?.boundBy;
|
|
2442
|
+
return typeof raw === "string" ? raw.trim() : "";
|
|
2443
|
+
}
|
|
2444
|
+
function isSessionBindingRecord(binding) {
|
|
2445
|
+
return "bindingId" in binding;
|
|
2446
|
+
}
|
|
2447
|
+
function resolveUpdatedLifecycleDurationMs(binding, key) {
|
|
2448
|
+
if (!isSessionBindingRecord(binding)) {
|
|
2449
|
+
const raw = binding[key];
|
|
2450
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return Math.max(0, Math.floor(raw));
|
|
2451
|
+
}
|
|
2452
|
+
if (!isSessionBindingRecord(binding)) return;
|
|
2453
|
+
const raw = binding.metadata?.[key];
|
|
2454
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return;
|
|
2455
|
+
return Math.max(0, Math.floor(raw));
|
|
2456
|
+
}
|
|
2457
|
+
function toUpdatedLifecycleBinding(binding) {
|
|
2458
|
+
const lastActivityAt = isSessionBindingRecord(binding) ? resolveSessionBindingLastActivityAt(binding) : Math.max(Math.floor(binding.lastActivityAt), binding.boundAt);
|
|
2459
|
+
return {
|
|
2460
|
+
boundAt: binding.boundAt,
|
|
2461
|
+
lastActivityAt,
|
|
2462
|
+
idleTimeoutMs: resolveUpdatedLifecycleDurationMs(binding, "idleTimeoutMs"),
|
|
2463
|
+
maxAgeMs: resolveUpdatedLifecycleDurationMs(binding, "maxAgeMs")
|
|
2464
|
+
};
|
|
2465
|
+
}
|
|
2466
|
+
function resolveUpdatedBindingExpiry(params) {
|
|
2467
|
+
const expiries = params.bindings.map((binding) => {
|
|
2468
|
+
if (params.action === SESSION_ACTION_IDLE) {
|
|
2469
|
+
const idleTimeoutMs = typeof binding.idleTimeoutMs === "number" && Number.isFinite(binding.idleTimeoutMs) ? Math.max(0, Math.floor(binding.idleTimeoutMs)) : 0;
|
|
2470
|
+
if (idleTimeoutMs <= 0) return;
|
|
2471
|
+
return Math.max(binding.lastActivityAt, binding.boundAt) + idleTimeoutMs;
|
|
2472
|
+
}
|
|
2473
|
+
const maxAgeMs = typeof binding.maxAgeMs === "number" && Number.isFinite(binding.maxAgeMs) ? Math.max(0, Math.floor(binding.maxAgeMs)) : 0;
|
|
2474
|
+
if (maxAgeMs <= 0) return;
|
|
2475
|
+
return binding.boundAt + maxAgeMs;
|
|
2476
|
+
}).filter((expiresAt) => typeof expiresAt === "number");
|
|
2477
|
+
if (expiries.length === 0) return;
|
|
2478
|
+
return Math.min(...expiries);
|
|
2479
|
+
}
|
|
2480
|
+
const handleActivationCommand = async (params, allowTextCommands) => {
|
|
2481
|
+
if (!allowTextCommands) return null;
|
|
2482
|
+
const activationCommand = parseActivationCommand(params.command.commandBodyNormalized);
|
|
2483
|
+
if (!activationCommand.hasCommand) return null;
|
|
2484
|
+
if (!params.isGroup) return {
|
|
2485
|
+
shouldContinue: false,
|
|
2486
|
+
reply: { text: "āļø Group activation only applies to group chats." }
|
|
2487
|
+
};
|
|
2488
|
+
if (!params.command.isAuthorizedSender) {
|
|
2489
|
+
logVerbose(`Ignoring /activation from unauthorized sender in group: ${params.command.senderId || "<unknown>"}`);
|
|
2490
|
+
return { shouldContinue: false };
|
|
2491
|
+
}
|
|
2492
|
+
if (!activationCommand.mode) return {
|
|
2493
|
+
shouldContinue: false,
|
|
2494
|
+
reply: { text: "āļø Usage: /activation mention|always" }
|
|
2495
|
+
};
|
|
2496
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2497
|
+
params.sessionEntry.groupActivation = activationCommand.mode;
|
|
2498
|
+
params.sessionEntry.groupActivationNeedsSystemIntro = true;
|
|
2499
|
+
await persistSessionEntry(params);
|
|
2500
|
+
}
|
|
2501
|
+
return {
|
|
2502
|
+
shouldContinue: false,
|
|
2503
|
+
reply: { text: `āļø Group activation set to ${activationCommand.mode}.` }
|
|
2504
|
+
};
|
|
2505
|
+
};
|
|
2506
|
+
const handleSendPolicyCommand = async (params, allowTextCommands) => {
|
|
2507
|
+
if (!allowTextCommands) return null;
|
|
2508
|
+
const sendPolicyCommand = parseSendPolicyCommand(params.command.commandBodyNormalized);
|
|
2509
|
+
if (!sendPolicyCommand.hasCommand) return null;
|
|
2510
|
+
const unauthorizedResult = rejectUnauthorizedCommand(params, "/send");
|
|
2511
|
+
if (unauthorizedResult) return unauthorizedResult;
|
|
2512
|
+
const nonOwnerResult = rejectNonOwnerCommand(params, "/send");
|
|
2513
|
+
if (nonOwnerResult) return nonOwnerResult;
|
|
2514
|
+
if (!sendPolicyCommand.mode) return {
|
|
2515
|
+
shouldContinue: false,
|
|
2516
|
+
reply: { text: "āļø Usage: /send on|off|inherit" }
|
|
2517
|
+
};
|
|
2518
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2519
|
+
if (sendPolicyCommand.mode === "inherit") delete params.sessionEntry.sendPolicy;
|
|
2520
|
+
else params.sessionEntry.sendPolicy = sendPolicyCommand.mode;
|
|
2521
|
+
await persistSessionEntry(params);
|
|
2522
|
+
}
|
|
2523
|
+
return {
|
|
2524
|
+
shouldContinue: false,
|
|
2525
|
+
reply: { text: `āļø Send policy set to ${sendPolicyCommand.mode === "inherit" ? "inherit" : sendPolicyCommand.mode === "allow" ? "on" : "off"}.` }
|
|
2526
|
+
};
|
|
2527
|
+
};
|
|
2528
|
+
const handleUsageCommand = async (params, allowTextCommands) => {
|
|
2529
|
+
if (!allowTextCommands) return null;
|
|
2530
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2531
|
+
if (normalized !== "/usage" && !normalized.startsWith("/usage ")) return null;
|
|
2532
|
+
if (!params.command.isAuthorizedSender) {
|
|
2533
|
+
logVerbose(`Ignoring /usage from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2534
|
+
return { shouldContinue: false };
|
|
2535
|
+
}
|
|
2536
|
+
const rawArgs = normalized === "/usage" ? "" : normalized.slice(6).trim();
|
|
2537
|
+
const requested = rawArgs ? normalizeUsageDisplay(rawArgs) : void 0;
|
|
2538
|
+
if (rawArgs.toLowerCase().startsWith("cost")) {
|
|
2539
|
+
const sessionSummary = await loadSessionCostSummary({
|
|
2540
|
+
sessionId: params.sessionEntry?.sessionId,
|
|
2541
|
+
sessionEntry: params.sessionEntry,
|
|
2542
|
+
sessionFile: params.sessionEntry?.sessionFile,
|
|
2543
|
+
config: params.cfg,
|
|
2544
|
+
agentId: params.agentId
|
|
2545
|
+
});
|
|
2546
|
+
const summary = await loadCostUsageSummary({
|
|
2547
|
+
days: 30,
|
|
2548
|
+
config: params.cfg
|
|
2549
|
+
});
|
|
2550
|
+
const sessionCost = formatUsd(sessionSummary?.totalCost);
|
|
2551
|
+
const sessionTokens = sessionSummary?.totalTokens ? formatTokenCount$1(sessionSummary.totalTokens) : void 0;
|
|
2552
|
+
const sessionSuffix = (sessionSummary?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
2553
|
+
const sessionLine = sessionCost || sessionTokens ? `Session ${sessionCost ?? "n/a"}${sessionSuffix}${sessionTokens ? ` Ā· ${sessionTokens} tokens` : ""}` : "Session n/a";
|
|
2554
|
+
const todayKey = (/* @__PURE__ */ new Date()).toLocaleDateString("en-CA");
|
|
2555
|
+
const todayEntry = summary.daily.find((entry) => entry.date === todayKey);
|
|
2556
|
+
const todayCost = formatUsd(todayEntry?.totalCost);
|
|
2557
|
+
const todaySuffix = (todayEntry?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
2558
|
+
const todayLine = `Today ${todayCost ?? "n/a"}${todaySuffix}`;
|
|
2559
|
+
const last30Cost = formatUsd(summary.totals.totalCost);
|
|
2560
|
+
const last30Suffix = summary.totals.missingCostEntries > 0 ? " (partial)" : "";
|
|
2561
|
+
return {
|
|
2562
|
+
shouldContinue: false,
|
|
2563
|
+
reply: { text: `šø Usage cost\n${sessionLine}\n${todayLine}\n${`Last 30d ${last30Cost ?? "n/a"}${last30Suffix}`}` }
|
|
2564
|
+
};
|
|
2565
|
+
}
|
|
2566
|
+
if (rawArgs && !requested) return {
|
|
2567
|
+
shouldContinue: false,
|
|
2568
|
+
reply: { text: "āļø Usage: /usage off|tokens|full|cost" }
|
|
2569
|
+
};
|
|
2570
|
+
const current = resolveResponseUsageMode(params.sessionEntry?.responseUsage ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey]?.responseUsage : void 0));
|
|
2571
|
+
const next = requested ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
|
|
2572
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2573
|
+
if (next === "off") delete params.sessionEntry.responseUsage;
|
|
2574
|
+
else params.sessionEntry.responseUsage = next;
|
|
2575
|
+
await persistSessionEntry(params);
|
|
2576
|
+
}
|
|
2577
|
+
return {
|
|
2578
|
+
shouldContinue: false,
|
|
2579
|
+
reply: { text: `āļø Usage footer: ${next}.` }
|
|
2580
|
+
};
|
|
2581
|
+
};
|
|
2582
|
+
const handleFastCommand = async (params, allowTextCommands) => {
|
|
2583
|
+
if (!allowTextCommands) return null;
|
|
2584
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2585
|
+
if (normalized !== "/fast" && !normalized.startsWith("/fast ")) return null;
|
|
2586
|
+
if (!params.command.isAuthorizedSender) {
|
|
2587
|
+
logVerbose(`Ignoring /fast from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2588
|
+
return { shouldContinue: false };
|
|
2589
|
+
}
|
|
2590
|
+
const rawMode = (normalized === "/fast" ? "" : normalized.slice(5).trim()).toLowerCase();
|
|
2591
|
+
if (!rawMode || rawMode === "status") {
|
|
2592
|
+
const state = resolveFastModeState({
|
|
2593
|
+
cfg: params.cfg,
|
|
2594
|
+
provider: params.provider,
|
|
2595
|
+
model: params.model,
|
|
2596
|
+
agentId: params.agentId,
|
|
2597
|
+
sessionEntry: params.sessionEntry
|
|
2598
|
+
});
|
|
2599
|
+
const suffix = state.source === "agent" ? " (agent)" : state.source === "config" ? " (config)" : state.source === "default" ? " (default)" : "";
|
|
2600
|
+
return {
|
|
2601
|
+
shouldContinue: false,
|
|
2602
|
+
reply: { text: `āļø Current fast mode: ${state.enabled ? "on" : "off"}${suffix}.` }
|
|
2603
|
+
};
|
|
2604
|
+
}
|
|
2605
|
+
const nextMode = normalizeFastMode(rawMode);
|
|
2606
|
+
if (nextMode === void 0) return {
|
|
2607
|
+
shouldContinue: false,
|
|
2608
|
+
reply: { text: "āļø Usage: /fast status|on|off" }
|
|
2609
|
+
};
|
|
2610
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2611
|
+
params.sessionEntry.fastMode = nextMode;
|
|
2612
|
+
await persistSessionEntry(params);
|
|
2613
|
+
}
|
|
2614
|
+
return {
|
|
2615
|
+
shouldContinue: false,
|
|
2616
|
+
reply: { text: `āļø Fast mode ${nextMode ? "enabled" : "disabled"}.` }
|
|
2617
|
+
};
|
|
2618
|
+
};
|
|
2619
|
+
const handleSessionCommand = async (params, allowTextCommands) => {
|
|
2620
|
+
if (!allowTextCommands) return null;
|
|
2621
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2622
|
+
if (!/^\/session(?:\s|$)/.test(normalized)) return null;
|
|
2623
|
+
if (!params.command.isAuthorizedSender) {
|
|
2624
|
+
logVerbose(`Ignoring /session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2625
|
+
return { shouldContinue: false };
|
|
2626
|
+
}
|
|
2627
|
+
const tokens = normalized.slice(8).trim().split(/\s+/).filter(Boolean);
|
|
2628
|
+
const action = tokens[0]?.toLowerCase();
|
|
2629
|
+
if (action !== SESSION_ACTION_IDLE && action !== SESSION_ACTION_MAX_AGE) return {
|
|
2630
|
+
shouldContinue: false,
|
|
2631
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
2632
|
+
};
|
|
2633
|
+
const onDiscord = isDiscordSurface(params);
|
|
2634
|
+
const onMatrix = isMatrixSurface(params);
|
|
2635
|
+
const onTelegram = isTelegramSurface(params);
|
|
2636
|
+
if (!onDiscord && !onMatrix && !onTelegram) return {
|
|
2637
|
+
shouldContinue: false,
|
|
2638
|
+
reply: { text: "ā ļø /session idle and /session max-age are currently available for Discord, Matrix, and Telegram bound sessions." }
|
|
2639
|
+
};
|
|
2640
|
+
const accountId = resolveChannelAccountId(params);
|
|
2641
|
+
const sessionBindingService = getSessionBindingService();
|
|
2642
|
+
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2643
|
+
const matrixConversationId = onMatrix ? resolveMatrixConversationId({
|
|
2644
|
+
ctx: {
|
|
2645
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
2646
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
2647
|
+
To: params.ctx.To
|
|
2648
|
+
},
|
|
2649
|
+
command: { to: params.command.to }
|
|
2650
|
+
}) : void 0;
|
|
2651
|
+
const matrixParentConversationId = onMatrix ? resolveMatrixParentConversationId({
|
|
2652
|
+
ctx: {
|
|
2653
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
2654
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
2655
|
+
To: params.ctx.To
|
|
2656
|
+
},
|
|
2657
|
+
command: { to: params.command.to }
|
|
2658
|
+
}) : void 0;
|
|
2659
|
+
const telegramConversationId = onTelegram ? resolveTelegramConversationId(params) : void 0;
|
|
2660
|
+
const channelRuntime = getChannelRuntime();
|
|
2661
|
+
const discordManager = onDiscord ? channelRuntime.discord.threadBindings.getManager(accountId) : null;
|
|
2662
|
+
if (onDiscord && !discordManager) return {
|
|
2663
|
+
shouldContinue: false,
|
|
2664
|
+
reply: { text: "ā ļø Discord thread bindings are unavailable for this account." }
|
|
2665
|
+
};
|
|
2666
|
+
const discordBinding = onDiscord && threadId ? discordManager?.getByThreadId(threadId) : void 0;
|
|
2667
|
+
const telegramBinding = onTelegram && telegramConversationId ? sessionBindingService.resolveByConversation({
|
|
2668
|
+
channel: "telegram",
|
|
2669
|
+
accountId,
|
|
2670
|
+
conversationId: telegramConversationId
|
|
2671
|
+
}) : null;
|
|
2672
|
+
const matrixBinding = onMatrix && matrixConversationId ? sessionBindingService.resolveByConversation({
|
|
2673
|
+
channel: "matrix",
|
|
2674
|
+
accountId,
|
|
2675
|
+
conversationId: matrixConversationId,
|
|
2676
|
+
...matrixParentConversationId && matrixParentConversationId !== matrixConversationId ? { parentConversationId: matrixParentConversationId } : {}
|
|
2677
|
+
}) : null;
|
|
2678
|
+
if (onDiscord && !discordBinding) {
|
|
2679
|
+
if (onDiscord && !threadId) return {
|
|
2680
|
+
shouldContinue: false,
|
|
2681
|
+
reply: { text: "ā ļø /session idle and /session max-age must be run inside a focused Discord thread." }
|
|
2682
|
+
};
|
|
2683
|
+
return {
|
|
2684
|
+
shouldContinue: false,
|
|
2685
|
+
reply: { text: "ā¹ļø This thread is not currently focused." }
|
|
2686
|
+
};
|
|
2687
|
+
}
|
|
2688
|
+
if (onMatrix && !matrixBinding) {
|
|
2689
|
+
if (!threadId) return {
|
|
2690
|
+
shouldContinue: false,
|
|
2691
|
+
reply: { text: "ā ļø /session idle and /session max-age must be run inside a focused Matrix thread." }
|
|
2692
|
+
};
|
|
2693
|
+
return {
|
|
2694
|
+
shouldContinue: false,
|
|
2695
|
+
reply: { text: "ā¹ļø This thread is not currently focused." }
|
|
2696
|
+
};
|
|
2697
|
+
}
|
|
2698
|
+
if (onTelegram && !telegramBinding) {
|
|
2699
|
+
if (!telegramConversationId) return {
|
|
2700
|
+
shouldContinue: false,
|
|
2701
|
+
reply: { text: "ā ļø /session idle and /session max-age on Telegram require a topic context in groups, or a direct-message conversation." }
|
|
2702
|
+
};
|
|
2703
|
+
return {
|
|
2704
|
+
shouldContinue: false,
|
|
2705
|
+
reply: { text: "ā¹ļø This conversation is not currently focused." }
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
const idleTimeoutMs = onDiscord ? channelRuntime.discord.threadBindings.resolveIdleTimeoutMs({
|
|
2709
|
+
record: discordBinding,
|
|
2710
|
+
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
2711
|
+
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "idleTimeoutMs", 1440 * 60 * 1e3);
|
|
2712
|
+
const idleExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveInactivityExpiresAt({
|
|
2713
|
+
record: discordBinding,
|
|
2714
|
+
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
2715
|
+
}) : idleTimeoutMs > 0 ? resolveSessionBindingLastActivityAt(onMatrix ? matrixBinding : telegramBinding) + idleTimeoutMs : void 0;
|
|
2716
|
+
const maxAgeMs = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeMs({
|
|
2717
|
+
record: discordBinding,
|
|
2718
|
+
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
2719
|
+
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "maxAgeMs", 0);
|
|
2720
|
+
const maxAgeExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeExpiresAt({
|
|
2721
|
+
record: discordBinding,
|
|
2722
|
+
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
2723
|
+
}) : maxAgeMs > 0 ? (onMatrix ? matrixBinding : telegramBinding).boundAt + maxAgeMs : void 0;
|
|
2724
|
+
const durationArgRaw = tokens.slice(1).join("");
|
|
2725
|
+
if (!durationArgRaw) {
|
|
2726
|
+
if (action === SESSION_ACTION_IDLE) {
|
|
2727
|
+
if (typeof idleExpiresAt === "number" && Number.isFinite(idleExpiresAt) && idleExpiresAt > Date.now()) return {
|
|
2728
|
+
shouldContinue: false,
|
|
2729
|
+
reply: { text: `ā¹ļø Idle timeout active (${formatThreadBindingDurationLabel(idleTimeoutMs)}, next auto-unfocus at ${formatSessionExpiry(idleExpiresAt)}).` }
|
|
2730
|
+
};
|
|
2731
|
+
return {
|
|
2732
|
+
shouldContinue: false,
|
|
2733
|
+
reply: { text: "ā¹ļø Idle timeout is currently disabled for this focused session." }
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
if (typeof maxAgeExpiresAt === "number" && Number.isFinite(maxAgeExpiresAt) && maxAgeExpiresAt > Date.now()) return {
|
|
2737
|
+
shouldContinue: false,
|
|
2738
|
+
reply: { text: `ā¹ļø Max age active (${formatThreadBindingDurationLabel(maxAgeMs)}, hard auto-unfocus at ${formatSessionExpiry(maxAgeExpiresAt)}).` }
|
|
2739
|
+
};
|
|
2740
|
+
return {
|
|
2741
|
+
shouldContinue: false,
|
|
2742
|
+
reply: { text: "ā¹ļø Max age is currently disabled for this focused session." }
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2745
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
2746
|
+
const boundBy = onDiscord ? discordBinding.boundBy : resolveSessionBindingBoundBy(onMatrix ? matrixBinding : telegramBinding);
|
|
2747
|
+
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
|
|
2748
|
+
shouldContinue: false,
|
|
2749
|
+
reply: { text: onDiscord ? `ā ļø Only ${boundBy} can update session lifecycle settings for this thread.` : onMatrix ? `ā ļø Only ${boundBy} can update session lifecycle settings for this thread.` : `ā ļø Only ${boundBy} can update session lifecycle settings for this conversation.` }
|
|
2750
|
+
};
|
|
2751
|
+
let durationMs;
|
|
2752
|
+
try {
|
|
2753
|
+
durationMs = parseSessionDurationMs(durationArgRaw);
|
|
2754
|
+
} catch {
|
|
2755
|
+
return {
|
|
2756
|
+
shouldContinue: false,
|
|
2757
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
const updatedBindings = (() => {
|
|
2761
|
+
if (onDiscord) return action === SESSION_ACTION_IDLE ? channelRuntime.discord.threadBindings.setIdleTimeoutBySessionKey({
|
|
2762
|
+
targetSessionKey: discordBinding.targetSessionKey,
|
|
2763
|
+
accountId,
|
|
2764
|
+
idleTimeoutMs: durationMs
|
|
2765
|
+
}) : channelRuntime.discord.threadBindings.setMaxAgeBySessionKey({
|
|
2766
|
+
targetSessionKey: discordBinding.targetSessionKey,
|
|
2767
|
+
accountId,
|
|
2768
|
+
maxAgeMs: durationMs
|
|
2769
|
+
});
|
|
2770
|
+
if (onMatrix) return action === SESSION_ACTION_IDLE ? channelRuntime.matrix.threadBindings.setIdleTimeoutBySessionKey({
|
|
2771
|
+
targetSessionKey: matrixBinding.targetSessionKey,
|
|
2772
|
+
accountId,
|
|
2773
|
+
idleTimeoutMs: durationMs
|
|
2774
|
+
}) : channelRuntime.matrix.threadBindings.setMaxAgeBySessionKey({
|
|
2775
|
+
targetSessionKey: matrixBinding.targetSessionKey,
|
|
2776
|
+
accountId,
|
|
2777
|
+
maxAgeMs: durationMs
|
|
2778
|
+
});
|
|
2779
|
+
return action === SESSION_ACTION_IDLE ? channelRuntime.threadBindings.setIdleTimeoutBySessionKey({
|
|
2780
|
+
channelId: "telegram",
|
|
2781
|
+
targetSessionKey: telegramBinding.targetSessionKey,
|
|
2782
|
+
accountId,
|
|
2783
|
+
idleTimeoutMs: durationMs
|
|
2784
|
+
}) : channelRuntime.threadBindings.setMaxAgeBySessionKey({
|
|
2785
|
+
channelId: "telegram",
|
|
2786
|
+
targetSessionKey: telegramBinding.targetSessionKey,
|
|
2787
|
+
accountId,
|
|
2788
|
+
maxAgeMs: durationMs
|
|
2789
|
+
});
|
|
2790
|
+
})();
|
|
2791
|
+
if (updatedBindings.length === 0) return {
|
|
2792
|
+
shouldContinue: false,
|
|
2793
|
+
reply: { text: action === SESSION_ACTION_IDLE ? "ā ļø Failed to update idle timeout for the current binding." : "ā ļø Failed to update max age for the current binding." }
|
|
2794
|
+
};
|
|
2795
|
+
if (durationMs <= 0) return {
|
|
2796
|
+
shouldContinue: false,
|
|
2797
|
+
reply: { text: action === SESSION_ACTION_IDLE ? `ā
Idle timeout disabled for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"}.` : `ā
Max age disabled for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"}.` }
|
|
2798
|
+
};
|
|
2799
|
+
const nextExpiry = resolveUpdatedBindingExpiry({
|
|
2800
|
+
action,
|
|
2801
|
+
bindings: updatedBindings.map((binding) => toUpdatedLifecycleBinding(binding))
|
|
2802
|
+
});
|
|
2803
|
+
const expiryLabel = typeof nextExpiry === "number" && Number.isFinite(nextExpiry) ? formatSessionExpiry(nextExpiry) : "n/a";
|
|
2804
|
+
return {
|
|
2805
|
+
shouldContinue: false,
|
|
2806
|
+
reply: { text: action === SESSION_ACTION_IDLE ? `ā
Idle timeout set to ${formatThreadBindingDurationLabel(durationMs)} for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"} (next auto-unfocus at ${expiryLabel}).` : `ā
Max age set to ${formatThreadBindingDurationLabel(durationMs)} for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"} (hard auto-unfocus at ${expiryLabel}).` }
|
|
2807
|
+
};
|
|
2808
|
+
};
|
|
2809
|
+
const handleRestartCommand = async (params, allowTextCommands) => {
|
|
2810
|
+
if (!allowTextCommands) return null;
|
|
2811
|
+
if (params.command.commandBodyNormalized !== "/restart") return null;
|
|
2812
|
+
if (!params.command.isAuthorizedSender) {
|
|
2813
|
+
logVerbose(`Ignoring /restart from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2814
|
+
return { shouldContinue: false };
|
|
2815
|
+
}
|
|
2816
|
+
if (!isRestartEnabled(params.cfg)) return {
|
|
2817
|
+
shouldContinue: false,
|
|
2818
|
+
reply: { text: "ā ļø /restart is disabled (commands.restart=false)." }
|
|
2819
|
+
};
|
|
2820
|
+
if (process.listenerCount("SIGUSR1") > 0) {
|
|
2821
|
+
scheduleGatewaySigusr1Restart({ reason: "/restart" });
|
|
2822
|
+
return {
|
|
2823
|
+
shouldContinue: false,
|
|
2824
|
+
reply: { text: "āļø Restarting Vora in-process (SIGUSR1); back in a few seconds." }
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
2827
|
+
const restartMethod = triggerVoraRestart();
|
|
2828
|
+
if (!restartMethod.ok) {
|
|
2829
|
+
const detail = restartMethod.detail ? ` Details: ${restartMethod.detail}` : "";
|
|
2830
|
+
return {
|
|
2831
|
+
shouldContinue: false,
|
|
2832
|
+
reply: { text: `ā ļø Restart failed (${restartMethod.method}).${detail}` }
|
|
2833
|
+
};
|
|
2834
|
+
}
|
|
2835
|
+
return {
|
|
2836
|
+
shouldContinue: false,
|
|
2837
|
+
reply: { text: `āļø Restarting Vora via ${restartMethod.method}; give me a few seconds to come back online.` }
|
|
2838
|
+
};
|
|
2839
|
+
};
|
|
2840
|
+
//#endregion
|
|
2841
|
+
//#region src/auto-reply/reply/commands-subagents/action-agents.ts
|
|
2842
|
+
function formatConversationBindingText(params) {
|
|
2843
|
+
if (params.channel === "discord" || params.channel === "matrix") return `thread:${params.conversationId}`;
|
|
2844
|
+
if (params.channel === "telegram") return `conversation:${params.conversationId}`;
|
|
2845
|
+
return `binding:${params.conversationId}`;
|
|
2846
|
+
}
|
|
2847
|
+
function handleSubagentsAgentsAction(ctx) {
|
|
2848
|
+
const { params, requesterKey, runs } = ctx;
|
|
2849
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
2850
|
+
const accountId = resolveChannelAccountId(params);
|
|
2851
|
+
const bindingService = getSessionBindingService();
|
|
2852
|
+
const bindingsBySession = /* @__PURE__ */ new Map();
|
|
2853
|
+
const resolveSessionBindings = (sessionKey) => {
|
|
2854
|
+
const cached = bindingsBySession.get(sessionKey);
|
|
2855
|
+
if (cached) return cached;
|
|
2856
|
+
const resolved = bindingService.listBySession(sessionKey).filter((entry) => entry.status === "active" && entry.conversation.channel === channel && entry.conversation.accountId === accountId);
|
|
2857
|
+
bindingsBySession.set(sessionKey, resolved);
|
|
2858
|
+
return resolved;
|
|
2859
|
+
};
|
|
2860
|
+
const dedupedRuns = [];
|
|
2861
|
+
const seenChildSessionKeys = /* @__PURE__ */ new Set();
|
|
2862
|
+
for (const entry of sortSubagentRuns(runs)) {
|
|
2863
|
+
if (seenChildSessionKeys.has(entry.childSessionKey)) continue;
|
|
2864
|
+
seenChildSessionKeys.add(entry.childSessionKey);
|
|
2865
|
+
dedupedRuns.push(entry);
|
|
2866
|
+
}
|
|
2867
|
+
const recentCutoff = Date.now() - 30 * 6e4;
|
|
2868
|
+
const numericOrder = [...dedupedRuns.filter((entry) => !entry.endedAt || countPendingDescendantRuns(entry.childSessionKey) > 0), ...dedupedRuns.filter((entry) => entry.endedAt && countPendingDescendantRuns(entry.childSessionKey) === 0 && entry.endedAt >= recentCutoff)];
|
|
2869
|
+
const indexByChildSessionKey = new Map(numericOrder.map((entry, idx) => [entry.childSessionKey, idx + 1]));
|
|
2870
|
+
const visibleRuns = [];
|
|
2871
|
+
for (const entry of dedupedRuns) {
|
|
2872
|
+
if (!(!entry.endedAt || countPendingDescendantRuns(entry.childSessionKey) > 0 || resolveSessionBindings(entry.childSessionKey).length > 0)) continue;
|
|
2873
|
+
visibleRuns.push(entry);
|
|
2874
|
+
}
|
|
2875
|
+
const lines = ["agents:", "-----"];
|
|
2876
|
+
if (visibleRuns.length === 0) lines.push("(none)");
|
|
2877
|
+
else for (const entry of visibleRuns) {
|
|
2878
|
+
const binding = resolveSessionBindings(entry.childSessionKey)[0];
|
|
2879
|
+
const bindingText = binding ? formatConversationBindingText({
|
|
2880
|
+
channel,
|
|
2881
|
+
conversationId: binding.conversation.conversationId
|
|
2882
|
+
}) : channel === "discord" || channel === "telegram" || channel === "matrix" ? "unbound" : "bindings available on discord/telegram";
|
|
2883
|
+
const resolvedIndex = indexByChildSessionKey.get(entry.childSessionKey);
|
|
2884
|
+
const prefix = resolvedIndex ? `${resolvedIndex}.` : "-";
|
|
2885
|
+
lines.push(`${prefix} ${formatRunLabel(entry)} (${bindingText})`);
|
|
2886
|
+
}
|
|
2887
|
+
const requesterBindings = resolveSessionBindings(requesterKey).filter((entry) => entry.targetKind === "session");
|
|
2888
|
+
if (requesterBindings.length > 0) {
|
|
2889
|
+
lines.push("", "acp/session bindings:", "-----");
|
|
2890
|
+
for (const binding of requesterBindings) {
|
|
2891
|
+
const label = typeof binding.metadata?.label === "string" && binding.metadata.label.trim() ? binding.metadata.label.trim() : binding.targetSessionKey;
|
|
2892
|
+
lines.push(`- ${label} (${formatConversationBindingText({
|
|
2893
|
+
channel,
|
|
2894
|
+
conversationId: binding.conversation.conversationId
|
|
2895
|
+
})}, session:${binding.targetSessionKey})`);
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
return stopWithText(lines.join("\n"));
|
|
2899
|
+
}
|
|
2900
|
+
//#endregion
|
|
2901
|
+
//#region src/auto-reply/reply/commands-subagents/action-focus.ts
|
|
2902
|
+
function resolveFocusBindingContext(params) {
|
|
2903
|
+
if (isDiscordSurface(params)) {
|
|
2904
|
+
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2905
|
+
const parentChannelId = currentThreadId ? void 0 : resolveDiscordChannelIdForFocus(params);
|
|
2906
|
+
const conversationId = currentThreadId || parentChannelId;
|
|
2907
|
+
if (!conversationId) return null;
|
|
2908
|
+
return {
|
|
2909
|
+
channel: "discord",
|
|
2910
|
+
accountId: resolveChannelAccountId(params),
|
|
2911
|
+
conversationId,
|
|
2912
|
+
placement: currentThreadId ? "current" : "child",
|
|
2913
|
+
labelNoun: "thread"
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
if (isTelegramSurface(params)) {
|
|
2917
|
+
const conversationId = resolveTelegramConversationId(params);
|
|
2918
|
+
if (!conversationId) return null;
|
|
2919
|
+
return {
|
|
2920
|
+
channel: "telegram",
|
|
2921
|
+
accountId: resolveChannelAccountId(params),
|
|
2922
|
+
conversationId,
|
|
2923
|
+
placement: "current",
|
|
2924
|
+
labelNoun: "conversation"
|
|
2925
|
+
};
|
|
2926
|
+
}
|
|
2927
|
+
if (isMatrixSurface(params)) {
|
|
2928
|
+
const conversationId = resolveMatrixConversationId({
|
|
2929
|
+
ctx: {
|
|
2930
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
2931
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
2932
|
+
To: params.ctx.To
|
|
2933
|
+
},
|
|
2934
|
+
command: { to: params.command.to }
|
|
2935
|
+
});
|
|
2936
|
+
if (!conversationId) return null;
|
|
2937
|
+
const parentConversationId = resolveMatrixParentConversationId({
|
|
2938
|
+
ctx: {
|
|
2939
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
2940
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
2941
|
+
To: params.ctx.To
|
|
2942
|
+
},
|
|
2943
|
+
command: { to: params.command.to }
|
|
2944
|
+
});
|
|
2945
|
+
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2946
|
+
return {
|
|
2947
|
+
channel: "matrix",
|
|
2948
|
+
accountId: resolveChannelAccountId(params),
|
|
2949
|
+
conversationId,
|
|
2950
|
+
...parentConversationId ? { parentConversationId } : {},
|
|
2951
|
+
placement: currentThreadId ? "current" : "child",
|
|
2952
|
+
labelNoun: "thread"
|
|
2953
|
+
};
|
|
2954
|
+
}
|
|
2955
|
+
return null;
|
|
2956
|
+
}
|
|
2957
|
+
async function handleSubagentsFocusAction(ctx) {
|
|
2958
|
+
const { params, runs, restTokens } = ctx;
|
|
2959
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
2960
|
+
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("ā ļø /focus is only available on Discord, Matrix, and Telegram.");
|
|
2961
|
+
const token = restTokens.join(" ").trim();
|
|
2962
|
+
if (!token) return stopWithText("Usage: /focus <subagent-label|session-key|session-id|session-label>");
|
|
2963
|
+
const accountId = resolveChannelAccountId(params);
|
|
2964
|
+
const bindingService = getSessionBindingService();
|
|
2965
|
+
const capabilities = bindingService.getCapabilities({
|
|
2966
|
+
channel,
|
|
2967
|
+
accountId
|
|
2968
|
+
});
|
|
2969
|
+
if (!capabilities.adapterAvailable || !capabilities.bindSupported) return stopWithText(`ā ļø ${channel === "discord" ? "Discord thread" : channel === "matrix" ? "Matrix thread" : "Telegram conversation"} bindings are unavailable for this account.`);
|
|
2970
|
+
const focusTarget = await resolveFocusTargetSession({
|
|
2971
|
+
runs,
|
|
2972
|
+
token
|
|
2973
|
+
});
|
|
2974
|
+
if (!focusTarget) return stopWithText(`ā ļø Unable to resolve focus target: ${token}`);
|
|
2975
|
+
const bindingContext = resolveFocusBindingContext(params);
|
|
2976
|
+
if (!bindingContext) {
|
|
2977
|
+
if (channel === "telegram") return stopWithText("ā ļø /focus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
2978
|
+
if (channel === "matrix") return stopWithText("ā ļø Could not resolve a Matrix room for /focus.");
|
|
2979
|
+
return stopWithText("ā ļø Could not resolve a Discord channel for /focus.");
|
|
2980
|
+
}
|
|
2981
|
+
if (channel === "matrix") {
|
|
2982
|
+
const spawnPolicy = resolveThreadBindingSpawnPolicy({
|
|
2983
|
+
cfg: params.cfg,
|
|
2984
|
+
channel,
|
|
2985
|
+
accountId: bindingContext.accountId,
|
|
2986
|
+
kind: "subagent"
|
|
2987
|
+
});
|
|
2988
|
+
if (!spawnPolicy.enabled) return stopWithText(`ā ļø ${formatThreadBindingDisabledError({
|
|
2989
|
+
channel: spawnPolicy.channel,
|
|
2990
|
+
accountId: spawnPolicy.accountId,
|
|
2991
|
+
kind: "subagent"
|
|
2992
|
+
})}`);
|
|
2993
|
+
if (bindingContext.placement === "child" && !spawnPolicy.spawnEnabled) return stopWithText(`ā ļø ${formatThreadBindingSpawnDisabledError({
|
|
2994
|
+
channel: spawnPolicy.channel,
|
|
2995
|
+
accountId: spawnPolicy.accountId,
|
|
2996
|
+
kind: "subagent"
|
|
2997
|
+
})}`);
|
|
2998
|
+
}
|
|
2999
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
3000
|
+
const existingBinding = bindingService.resolveByConversation({
|
|
3001
|
+
channel: bindingContext.channel,
|
|
3002
|
+
accountId: bindingContext.accountId,
|
|
3003
|
+
conversationId: bindingContext.conversationId,
|
|
3004
|
+
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
3005
|
+
});
|
|
3006
|
+
const boundBy = typeof existingBinding?.metadata?.boundBy === "string" ? existingBinding.metadata.boundBy.trim() : "";
|
|
3007
|
+
if (existingBinding && boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return stopWithText(`ā ļø Only ${boundBy} can refocus this ${bindingContext.labelNoun}.`);
|
|
3008
|
+
const label = focusTarget.label || token;
|
|
3009
|
+
const acpMeta = focusTarget.targetKind === "acp" ? readAcpSessionEntry({
|
|
3010
|
+
cfg: params.cfg,
|
|
3011
|
+
sessionKey: focusTarget.targetSessionKey
|
|
3012
|
+
})?.acp : void 0;
|
|
3013
|
+
if (!capabilities.placements.includes(bindingContext.placement)) return stopWithText(`ā ļø ${channel} bindings are unavailable for this account.`);
|
|
3014
|
+
let binding;
|
|
3015
|
+
try {
|
|
3016
|
+
binding = await bindingService.bind({
|
|
3017
|
+
targetSessionKey: focusTarget.targetSessionKey,
|
|
3018
|
+
targetKind: focusTarget.targetKind === "acp" ? "session" : "subagent",
|
|
3019
|
+
conversation: {
|
|
3020
|
+
channel: bindingContext.channel,
|
|
3021
|
+
accountId: bindingContext.accountId,
|
|
3022
|
+
conversationId: bindingContext.conversationId,
|
|
3023
|
+
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
3024
|
+
},
|
|
3025
|
+
placement: bindingContext.placement,
|
|
3026
|
+
metadata: {
|
|
3027
|
+
threadName: resolveThreadBindingThreadName({
|
|
3028
|
+
agentId: focusTarget.agentId,
|
|
3029
|
+
label
|
|
3030
|
+
}),
|
|
3031
|
+
agentId: focusTarget.agentId,
|
|
3032
|
+
label,
|
|
3033
|
+
boundBy: senderId || "unknown",
|
|
3034
|
+
introText: resolveThreadBindingIntroText({
|
|
3035
|
+
agentId: focusTarget.agentId,
|
|
3036
|
+
label,
|
|
3037
|
+
idleTimeoutMs: resolveThreadBindingIdleTimeoutMsForChannel({
|
|
3038
|
+
cfg: params.cfg,
|
|
3039
|
+
channel: bindingContext.channel,
|
|
3040
|
+
accountId
|
|
3041
|
+
}),
|
|
3042
|
+
maxAgeMs: resolveThreadBindingMaxAgeMsForChannel({
|
|
3043
|
+
cfg: params.cfg,
|
|
3044
|
+
channel: bindingContext.channel,
|
|
3045
|
+
accountId
|
|
3046
|
+
}),
|
|
3047
|
+
sessionCwd: focusTarget.targetKind === "acp" ? resolveAcpSessionCwd(acpMeta) : void 0,
|
|
3048
|
+
sessionDetails: focusTarget.targetKind === "acp" ? resolveAcpThreadSessionDetailLines({
|
|
3049
|
+
sessionKey: focusTarget.targetSessionKey,
|
|
3050
|
+
meta: acpMeta
|
|
3051
|
+
}) : []
|
|
3052
|
+
})
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
} catch {
|
|
3056
|
+
return stopWithText(`ā ļø Failed to bind this ${bindingContext.labelNoun} to the target session.`);
|
|
3057
|
+
}
|
|
3058
|
+
return stopWithText(`ā
${bindingContext.placement === "child" ? `created thread ${binding.conversation.conversationId} and bound it to ${binding.targetSessionKey}` : `bound this ${bindingContext.labelNoun} to ${binding.targetSessionKey}`} (${focusTarget.targetKind}).`);
|
|
3059
|
+
}
|
|
3060
|
+
//#endregion
|
|
3061
|
+
//#region src/auto-reply/reply/commands-subagents/action-help.ts
|
|
3062
|
+
function handleSubagentsHelpAction() {
|
|
3063
|
+
return stopWithText(buildSubagentsHelp());
|
|
3064
|
+
}
|
|
3065
|
+
//#endregion
|
|
3066
|
+
//#region src/auto-reply/reply/commands-subagents/action-info.ts
|
|
3067
|
+
function handleSubagentsInfoAction(ctx) {
|
|
3068
|
+
const { params, runs, restTokens } = ctx;
|
|
3069
|
+
const target = restTokens[0];
|
|
3070
|
+
if (!target) return stopWithText("ā¹ļø Usage: /subagents info <id|#>");
|
|
3071
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3072
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3073
|
+
const run = targetResolution.entry;
|
|
3074
|
+
const { entry: sessionEntry } = loadSubagentSessionEntry(params, run.childSessionKey, {
|
|
3075
|
+
loadSessionStore,
|
|
3076
|
+
resolveStorePath
|
|
3077
|
+
});
|
|
3078
|
+
const runtime = run.startedAt && Number.isFinite(run.startedAt) ? formatDurationCompact((run.endedAt ?? Date.now()) - run.startedAt) ?? "n/a" : "n/a";
|
|
3079
|
+
const outcome = run.outcome ? `${run.outcome.status}${run.outcome.error ? ` (${run.outcome.error})` : ""}` : "n/a";
|
|
3080
|
+
const linkedTask = findTaskByRunIdForOwner({
|
|
3081
|
+
runId: run.runId,
|
|
3082
|
+
callerOwnerKey: params.sessionKey
|
|
3083
|
+
});
|
|
3084
|
+
return stopWithText([
|
|
3085
|
+
"ā¹ļø Subagent info",
|
|
3086
|
+
`Status: ${resolveDisplayStatus(run, { pendingDescendants: countPendingDescendantRuns(run.childSessionKey) })}`,
|
|
3087
|
+
`Label: ${formatRunLabel(run)}`,
|
|
3088
|
+
`Task: ${run.task}`,
|
|
3089
|
+
`Run: ${run.runId}`,
|
|
3090
|
+
linkedTask ? `TaskId: ${linkedTask.taskId}` : void 0,
|
|
3091
|
+
linkedTask ? `TaskStatus: ${linkedTask.status}` : void 0,
|
|
3092
|
+
`Session: ${run.childSessionKey}`,
|
|
3093
|
+
`SessionId: ${sessionEntry?.sessionId ?? "n/a"}`,
|
|
3094
|
+
`Transcript: ${sessionEntry?.sessionFile ?? "n/a"}`,
|
|
3095
|
+
`Runtime: ${runtime}`,
|
|
3096
|
+
`Created: ${formatTimestampWithAge(run.createdAt)}`,
|
|
3097
|
+
`Started: ${formatTimestampWithAge(run.startedAt)}`,
|
|
3098
|
+
`Ended: ${formatTimestampWithAge(run.endedAt)}`,
|
|
3099
|
+
`Cleanup: ${run.cleanup}`,
|
|
3100
|
+
run.archiveAtMs ? `Archive: ${formatTimestampWithAge(run.archiveAtMs)}` : void 0,
|
|
3101
|
+
run.cleanupHandled ? "Cleanup handled: yes" : void 0,
|
|
3102
|
+
`Outcome: ${outcome}`,
|
|
3103
|
+
linkedTask?.progressSummary ? `Progress: ${linkedTask.progressSummary}` : void 0,
|
|
3104
|
+
linkedTask?.terminalSummary ? `Task summary: ${linkedTask.terminalSummary}` : void 0,
|
|
3105
|
+
linkedTask?.error ? `Task error: ${linkedTask.error}` : void 0,
|
|
3106
|
+
linkedTask ? `Delivery: ${linkedTask.deliveryStatus}` : void 0
|
|
3107
|
+
].filter(Boolean).join("\n"));
|
|
3108
|
+
}
|
|
3109
|
+
//#endregion
|
|
3110
|
+
//#region src/auto-reply/reply/commands-subagents/action-kill.ts
|
|
3111
|
+
async function handleSubagentsKillAction(ctx) {
|
|
3112
|
+
const { params, handledPrefix, requesterKey, runs, restTokens } = ctx;
|
|
3113
|
+
const target = restTokens[0];
|
|
3114
|
+
if (!target) return stopWithText(handledPrefix === "/subagents" ? "Usage: /subagents kill <id|#|all>" : "Usage: /kill <id|#|all>");
|
|
3115
|
+
if (target === "all" || target === "*") {
|
|
3116
|
+
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
3117
|
+
const result = await killAllControlledSubagentRuns({
|
|
3118
|
+
cfg: params.cfg,
|
|
3119
|
+
controller,
|
|
3120
|
+
runs
|
|
3121
|
+
});
|
|
3122
|
+
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error}`);
|
|
3123
|
+
if (result.killed > 0) return { shouldContinue: false };
|
|
3124
|
+
return { shouldContinue: false };
|
|
3125
|
+
}
|
|
3126
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3127
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3128
|
+
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
3129
|
+
const result = await killControlledSubagentRun({
|
|
3130
|
+
cfg: params.cfg,
|
|
3131
|
+
controller,
|
|
3132
|
+
entry: targetResolution.entry
|
|
3133
|
+
});
|
|
3134
|
+
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error}`);
|
|
3135
|
+
if (result.status === "done") return stopWithText(result.text);
|
|
3136
|
+
return { shouldContinue: false };
|
|
3137
|
+
}
|
|
3138
|
+
//#endregion
|
|
3139
|
+
//#region src/auto-reply/reply/commands-subagents/action-list.ts
|
|
3140
|
+
function handleSubagentsListAction(ctx) {
|
|
3141
|
+
const { params, runs } = ctx;
|
|
3142
|
+
const list = buildSubagentList({
|
|
3143
|
+
cfg: params.cfg,
|
|
3144
|
+
runs,
|
|
3145
|
+
recentMinutes: 30,
|
|
3146
|
+
taskMaxChars: 110
|
|
3147
|
+
});
|
|
3148
|
+
const lines = ["active subagents:", "-----"];
|
|
3149
|
+
if (list.active.length === 0) lines.push("(none)");
|
|
3150
|
+
else lines.push(list.active.map((entry) => entry.line).join("\n"));
|
|
3151
|
+
lines.push("", `recent subagents (last 30m):`, "-----");
|
|
3152
|
+
if (list.recent.length === 0) lines.push("(none)");
|
|
3153
|
+
else lines.push(list.recent.map((entry) => entry.line).join("\n"));
|
|
3154
|
+
return stopWithText(lines.join("\n"));
|
|
3155
|
+
}
|
|
3156
|
+
//#endregion
|
|
3157
|
+
//#region src/auto-reply/reply/commands-subagents/action-log.ts
|
|
3158
|
+
async function handleSubagentsLogAction(ctx) {
|
|
3159
|
+
const { runs, restTokens } = ctx;
|
|
3160
|
+
const target = restTokens[0];
|
|
3161
|
+
if (!target) return stopWithText("š Usage: /subagents log <id|#> [limit]");
|
|
3162
|
+
const includeTools = restTokens.some((token) => token.toLowerCase() === "tools");
|
|
3163
|
+
const limitToken = restTokens.find((token) => /^\d+$/.test(token));
|
|
3164
|
+
const limit = limitToken ? Math.min(200, Math.max(1, Number.parseInt(limitToken, 10))) : 20;
|
|
3165
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3166
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3167
|
+
const history = await callGateway({
|
|
3168
|
+
method: "chat.history",
|
|
3169
|
+
params: {
|
|
3170
|
+
sessionKey: targetResolution.entry.childSessionKey,
|
|
3171
|
+
limit
|
|
3172
|
+
}
|
|
3173
|
+
});
|
|
3174
|
+
const rawMessages = Array.isArray(history?.messages) ? history.messages : [];
|
|
3175
|
+
const lines = formatLogLines(includeTools ? rawMessages : stripToolMessages(rawMessages));
|
|
3176
|
+
const header = `š Subagent log: ${formatRunLabel(targetResolution.entry)}`;
|
|
3177
|
+
if (lines.length === 0) return stopWithText(`${header}\n(no messages)`);
|
|
3178
|
+
return stopWithText([header, ...lines].join("\n"));
|
|
3179
|
+
}
|
|
3180
|
+
//#endregion
|
|
3181
|
+
//#region src/auto-reply/reply/commands-subagents/action-send.ts
|
|
3182
|
+
async function handleSubagentsSendAction(ctx, steerRequested) {
|
|
3183
|
+
const { params, handledPrefix, runs, restTokens } = ctx;
|
|
3184
|
+
const target = restTokens[0];
|
|
3185
|
+
const message = restTokens.slice(1).join(" ").trim();
|
|
3186
|
+
if (!target || !message) return stopWithText(steerRequested ? handledPrefix === "/subagents" ? "Usage: /subagents steer <id|#> <message>" : `Usage: ${handledPrefix} <id|#> <message>` : "Usage: /subagents send <id|#> <message>");
|
|
3187
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3188
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3189
|
+
const controller = resolveCommandSubagentController(params, ctx.requesterKey);
|
|
3190
|
+
if (steerRequested) {
|
|
3191
|
+
const result = await steerControlledSubagentRun({
|
|
3192
|
+
cfg: params.cfg,
|
|
3193
|
+
controller,
|
|
3194
|
+
entry: targetResolution.entry,
|
|
3195
|
+
message
|
|
3196
|
+
});
|
|
3197
|
+
if (result.status === "accepted") return stopWithText(`steered ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
3198
|
+
if (result.status === "done" && result.text) return stopWithText(result.text);
|
|
3199
|
+
if (result.status === "error") return stopWithText(`send failed: ${result.error ?? "error"}`);
|
|
3200
|
+
return stopWithText(`ā ļø ${result.error ?? "send failed"}`);
|
|
3201
|
+
}
|
|
3202
|
+
const result = await sendControlledSubagentMessage({
|
|
3203
|
+
cfg: params.cfg,
|
|
3204
|
+
controller,
|
|
3205
|
+
entry: targetResolution.entry,
|
|
3206
|
+
message
|
|
3207
|
+
});
|
|
3208
|
+
if (result.status === "timeout") return stopWithText(`ā³ Subagent still running (run ${result.runId.slice(0, 8)}).`);
|
|
3209
|
+
if (result.status === "error") return stopWithText(`ā ļø Subagent error: ${result.error} (run ${result.runId.slice(0, 8)}).`);
|
|
3210
|
+
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error ?? "send failed"}`);
|
|
3211
|
+
if (result.status === "done") return stopWithText(result.text);
|
|
3212
|
+
return stopWithText(result.replyText ?? `ā
Sent to ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
3213
|
+
}
|
|
3214
|
+
//#endregion
|
|
3215
|
+
//#region src/auto-reply/reply/commands-subagents/action-spawn.ts
|
|
3216
|
+
async function handleSubagentsSpawnAction(ctx) {
|
|
3217
|
+
const { params, requesterKey, restTokens } = ctx;
|
|
3218
|
+
const agentId = restTokens[0];
|
|
3219
|
+
const taskParts = [];
|
|
3220
|
+
let model;
|
|
3221
|
+
let thinking;
|
|
3222
|
+
for (let i = 1; i < restTokens.length; i++) if (restTokens[i] === "--model" && i + 1 < restTokens.length) {
|
|
3223
|
+
i += 1;
|
|
3224
|
+
model = restTokens[i];
|
|
3225
|
+
} else if (restTokens[i] === "--thinking" && i + 1 < restTokens.length) {
|
|
3226
|
+
i += 1;
|
|
3227
|
+
thinking = restTokens[i];
|
|
3228
|
+
} else taskParts.push(restTokens[i]);
|
|
3229
|
+
const task = taskParts.join(" ").trim();
|
|
3230
|
+
if (!agentId || !task) return stopWithText("Usage: /subagents spawn <agentId> <task> [--model <model>] [--thinking <level>]");
|
|
3231
|
+
const commandTo = typeof params.command.to === "string" ? params.command.to.trim() : "";
|
|
3232
|
+
const originatingTo = typeof params.ctx.OriginatingTo === "string" ? params.ctx.OriginatingTo.trim() : "";
|
|
3233
|
+
const fallbackTo = typeof params.ctx.To === "string" ? params.ctx.To.trim() : "";
|
|
3234
|
+
const normalizedTo = originatingTo || commandTo || fallbackTo || void 0;
|
|
3235
|
+
const result = await spawnSubagentDirect({
|
|
3236
|
+
task,
|
|
3237
|
+
agentId,
|
|
3238
|
+
model,
|
|
3239
|
+
thinking,
|
|
3240
|
+
mode: "run",
|
|
3241
|
+
cleanup: "keep",
|
|
3242
|
+
expectsCompletionMessage: true
|
|
3243
|
+
}, {
|
|
3244
|
+
agentSessionKey: requesterKey,
|
|
3245
|
+
agentChannel: params.ctx.OriginatingChannel ?? params.command.channel,
|
|
3246
|
+
agentAccountId: params.ctx.AccountId,
|
|
3247
|
+
agentTo: normalizedTo,
|
|
3248
|
+
agentThreadId: params.ctx.MessageThreadId,
|
|
3249
|
+
agentGroupId: params.sessionEntry?.groupId ?? null,
|
|
3250
|
+
agentGroupChannel: params.sessionEntry?.groupChannel ?? null,
|
|
3251
|
+
agentGroupSpace: params.sessionEntry?.space ?? null
|
|
3252
|
+
});
|
|
3253
|
+
if (result.status === "accepted") return stopWithText(`Spawned subagent ${agentId} (session ${result.childSessionKey}, run ${result.runId?.slice(0, 8)}).`);
|
|
3254
|
+
return stopWithText(`Spawn failed: ${result.error ?? result.status}`);
|
|
3255
|
+
}
|
|
3256
|
+
//#endregion
|
|
3257
|
+
//#region src/auto-reply/reply/commands-subagents/action-unfocus.ts
|
|
3258
|
+
async function handleSubagentsUnfocusAction(ctx) {
|
|
3259
|
+
const { params } = ctx;
|
|
3260
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
3261
|
+
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("ā ļø /unfocus is only available on Discord, Matrix, and Telegram.");
|
|
3262
|
+
const accountId = resolveChannelAccountId(params);
|
|
3263
|
+
const bindingService = getSessionBindingService();
|
|
3264
|
+
const conversationId = (() => {
|
|
3265
|
+
if (isDiscordSurface(params)) return (params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId) : "").trim() || void 0;
|
|
3266
|
+
if (isTelegramSurface(params)) return resolveTelegramConversationId(params);
|
|
3267
|
+
if (isMatrixSurface(params)) return resolveMatrixConversationId({
|
|
3268
|
+
ctx: {
|
|
3269
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
3270
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
3271
|
+
To: params.ctx.To
|
|
3272
|
+
},
|
|
3273
|
+
command: { to: params.command.to }
|
|
3274
|
+
});
|
|
3275
|
+
})();
|
|
3276
|
+
const parentConversationId = (() => {
|
|
3277
|
+
if (!isMatrixSurface(params)) return;
|
|
3278
|
+
return resolveMatrixParentConversationId({
|
|
3279
|
+
ctx: {
|
|
3280
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
3281
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
3282
|
+
To: params.ctx.To
|
|
3283
|
+
},
|
|
3284
|
+
command: { to: params.command.to }
|
|
3285
|
+
});
|
|
3286
|
+
})();
|
|
3287
|
+
if (!conversationId) {
|
|
3288
|
+
if (channel === "discord") return stopWithText("ā ļø /unfocus must be run inside a Discord thread.");
|
|
3289
|
+
if (channel === "matrix") return stopWithText("ā ļø /unfocus must be run inside a Matrix thread.");
|
|
3290
|
+
return stopWithText("ā ļø /unfocus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
3291
|
+
}
|
|
3292
|
+
const binding = bindingService.resolveByConversation({
|
|
3293
|
+
channel,
|
|
3294
|
+
accountId,
|
|
3295
|
+
conversationId,
|
|
3296
|
+
...parentConversationId && parentConversationId !== conversationId ? { parentConversationId } : {}
|
|
3297
|
+
});
|
|
3298
|
+
if (!binding) return stopWithText(channel === "discord" ? "ā¹ļø This thread is not currently focused." : channel === "matrix" ? "ā¹ļø This thread is not currently focused." : "ā¹ļø This conversation is not currently focused.");
|
|
3299
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
3300
|
+
const boundBy = typeof binding.metadata?.boundBy === "string" ? binding.metadata.boundBy.trim() : "";
|
|
3301
|
+
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return stopWithText(channel === "discord" ? `ā ļø Only ${boundBy} can unfocus this thread.` : channel === "matrix" ? `ā ļø Only ${boundBy} can unfocus this thread.` : `ā ļø Only ${boundBy} can unfocus this conversation.`);
|
|
3302
|
+
await bindingService.unbind({
|
|
3303
|
+
bindingId: binding.bindingId,
|
|
3304
|
+
reason: "manual"
|
|
3305
|
+
});
|
|
3306
|
+
return stopWithText(channel === "discord" || channel === "matrix" ? "ā
Thread unfocused." : "ā
Conversation unfocused.");
|
|
3307
|
+
}
|
|
3308
|
+
//#endregion
|
|
3309
|
+
//#region src/auto-reply/reply/commands-subagents.ts
|
|
3310
|
+
const handleSubagentsCommand = async (params, allowTextCommands) => {
|
|
3311
|
+
if (!allowTextCommands) return null;
|
|
3312
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3313
|
+
const handledPrefix = resolveHandledPrefix(normalized);
|
|
3314
|
+
if (!handledPrefix) return null;
|
|
3315
|
+
if (!params.command.isAuthorizedSender) {
|
|
3316
|
+
logVerbose(`Ignoring ${handledPrefix} from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3317
|
+
return { shouldContinue: false };
|
|
3318
|
+
}
|
|
3319
|
+
const restTokens = normalized.slice(handledPrefix.length).trim().split(/\s+/).filter(Boolean);
|
|
3320
|
+
const action = resolveSubagentsAction({
|
|
3321
|
+
handledPrefix,
|
|
3322
|
+
restTokens
|
|
3323
|
+
});
|
|
3324
|
+
if (!action) return handleSubagentsHelpAction();
|
|
3325
|
+
const requesterKey = action === "spawn" ? resolveRequesterSessionKey(params, { preferCommandTarget: true }) : resolveRequesterSessionKey(params);
|
|
3326
|
+
if (!requesterKey) return stopWithText("ā ļø Missing session key.");
|
|
3327
|
+
const ctx = {
|
|
3328
|
+
params,
|
|
3329
|
+
handledPrefix,
|
|
3330
|
+
requesterKey,
|
|
3331
|
+
runs: listControlledSubagentRuns(requesterKey),
|
|
3332
|
+
restTokens
|
|
3333
|
+
};
|
|
3334
|
+
switch (action) {
|
|
3335
|
+
case "help": return handleSubagentsHelpAction();
|
|
3336
|
+
case "agents": return handleSubagentsAgentsAction(ctx);
|
|
3337
|
+
case "focus": return await handleSubagentsFocusAction(ctx);
|
|
3338
|
+
case "unfocus": return await handleSubagentsUnfocusAction(ctx);
|
|
3339
|
+
case "list": return handleSubagentsListAction(ctx);
|
|
3340
|
+
case "kill": return await handleSubagentsKillAction(ctx);
|
|
3341
|
+
case "info": return handleSubagentsInfoAction(ctx);
|
|
3342
|
+
case "log": return await handleSubagentsLogAction(ctx);
|
|
3343
|
+
case "send": return await handleSubagentsSendAction(ctx, false);
|
|
3344
|
+
case "steer": return await handleSubagentsSendAction(ctx, true);
|
|
3345
|
+
case "spawn": return await handleSubagentsSpawnAction(ctx);
|
|
3346
|
+
default: return handleSubagentsHelpAction();
|
|
3347
|
+
}
|
|
3348
|
+
};
|
|
3349
|
+
//#endregion
|
|
3350
|
+
//#region src/auto-reply/reply/commands-tts.ts
|
|
3351
|
+
function parseTtsCommand(normalized) {
|
|
3352
|
+
if (normalized === "/tts") return {
|
|
3353
|
+
action: "status",
|
|
3354
|
+
args: ""
|
|
3355
|
+
};
|
|
3356
|
+
if (!normalized.startsWith("/tts ")) return null;
|
|
3357
|
+
const rest = normalized.slice(5).trim();
|
|
3358
|
+
if (!rest) return {
|
|
3359
|
+
action: "status",
|
|
3360
|
+
args: ""
|
|
3361
|
+
};
|
|
3362
|
+
const [action, ...tail] = rest.split(/\s+/);
|
|
3363
|
+
return {
|
|
3364
|
+
action: action.toLowerCase(),
|
|
3365
|
+
args: tail.join(" ").trim()
|
|
3366
|
+
};
|
|
3367
|
+
}
|
|
3368
|
+
function formatAttemptDetails(attempts) {
|
|
3369
|
+
if (!attempts || attempts.length === 0) return;
|
|
3370
|
+
return attempts.map((attempt) => {
|
|
3371
|
+
const reason = attempt.reasonCode === "success" ? "ok" : attempt.reasonCode;
|
|
3372
|
+
const latency = Number.isFinite(attempt.latencyMs) ? ` ${attempt.latencyMs}ms` : "";
|
|
3373
|
+
return `${attempt.provider}:${attempt.outcome}(${reason})${latency}`;
|
|
3374
|
+
}).join(", ");
|
|
3375
|
+
}
|
|
3376
|
+
function ttsUsage() {
|
|
3377
|
+
return { text: "š **TTS (Text-to-Speech) Help**\n\n**Commands:**\n⢠/tts on ā Enable automatic TTS for replies\n⢠/tts off ā Disable TTS\n⢠/tts status ā Show current settings\n⢠/tts provider [name] ā View/change provider\n⢠/tts limit [number] ā View/change text limit\n⢠/tts summary [on|off] ā View/change auto-summary\n⢠/tts audio <text> ā Generate audio from text\n\n**Providers:**\nUse /tts provider to list the registered speech providers and their status.\n\n**Text Limit (default: 1500, max: 4096):**\nWhen text exceeds the limit:\n⢠Summary ON: AI summarizes, then generates audio\n⢠Summary OFF: Truncates text, then generates audio\n\n**Examples:**\n/tts provider <id>\n/tts limit 2000\n/tts audio Hello, this is a test!" };
|
|
3378
|
+
}
|
|
3379
|
+
const handleTtsCommands = async (params, allowTextCommands) => {
|
|
3380
|
+
if (!allowTextCommands) return null;
|
|
3381
|
+
const parsed = parseTtsCommand(params.command.commandBodyNormalized);
|
|
3382
|
+
if (!parsed) return null;
|
|
3383
|
+
if (!params.command.isAuthorizedSender) {
|
|
3384
|
+
logVerbose(`Ignoring TTS command from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3385
|
+
return { shouldContinue: false };
|
|
3386
|
+
}
|
|
3387
|
+
const config = resolveTtsConfig(params.cfg);
|
|
3388
|
+
const prefsPath = resolveTtsPrefsPath(config);
|
|
3389
|
+
const action = parsed.action;
|
|
3390
|
+
const args = parsed.args;
|
|
3391
|
+
if (action === "help") return {
|
|
3392
|
+
shouldContinue: false,
|
|
3393
|
+
reply: ttsUsage()
|
|
3394
|
+
};
|
|
3395
|
+
if (action === "on") {
|
|
3396
|
+
setTtsEnabled(prefsPath, true);
|
|
3397
|
+
return {
|
|
3398
|
+
shouldContinue: false,
|
|
3399
|
+
reply: { text: "š TTS enabled." }
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
if (action === "off") {
|
|
3403
|
+
setTtsEnabled(prefsPath, false);
|
|
3404
|
+
return {
|
|
3405
|
+
shouldContinue: false,
|
|
3406
|
+
reply: { text: "š TTS disabled." }
|
|
3407
|
+
};
|
|
3408
|
+
}
|
|
3409
|
+
if (action === "audio") {
|
|
3410
|
+
if (!args.trim()) return {
|
|
3411
|
+
shouldContinue: false,
|
|
3412
|
+
reply: { text: "š¤ Generate audio from text.\n\nUsage: /tts audio <text>\nExample: /tts audio Hello, this is a test!" }
|
|
3413
|
+
};
|
|
3414
|
+
const start = Date.now();
|
|
3415
|
+
const result = await textToSpeech({
|
|
3416
|
+
text: args,
|
|
3417
|
+
cfg: params.cfg,
|
|
3418
|
+
channel: params.command.channel,
|
|
3419
|
+
prefsPath
|
|
3420
|
+
});
|
|
3421
|
+
if (result.success && result.audioPath) {
|
|
3422
|
+
setLastTtsAttempt({
|
|
3423
|
+
timestamp: Date.now(),
|
|
3424
|
+
success: true,
|
|
3425
|
+
textLength: args.length,
|
|
3426
|
+
summarized: false,
|
|
3427
|
+
provider: result.provider,
|
|
3428
|
+
fallbackFrom: result.fallbackFrom,
|
|
3429
|
+
attemptedProviders: result.attemptedProviders,
|
|
3430
|
+
attempts: result.attempts,
|
|
3431
|
+
latencyMs: result.latencyMs
|
|
3432
|
+
});
|
|
3433
|
+
return {
|
|
3434
|
+
shouldContinue: false,
|
|
3435
|
+
reply: {
|
|
3436
|
+
mediaUrl: result.audioPath,
|
|
3437
|
+
audioAsVoice: result.voiceCompatible === true
|
|
3438
|
+
}
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
setLastTtsAttempt({
|
|
3442
|
+
timestamp: Date.now(),
|
|
3443
|
+
success: false,
|
|
3444
|
+
textLength: args.length,
|
|
3445
|
+
summarized: false,
|
|
3446
|
+
attemptedProviders: result.attemptedProviders,
|
|
3447
|
+
attempts: result.attempts,
|
|
3448
|
+
error: result.error,
|
|
3449
|
+
latencyMs: Date.now() - start
|
|
3450
|
+
});
|
|
3451
|
+
return {
|
|
3452
|
+
shouldContinue: false,
|
|
3453
|
+
reply: { text: `ā Error generating audio: ${result.error ?? "unknown error"}` }
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
if (action === "provider") {
|
|
3457
|
+
const currentProvider = getTtsProvider(config, prefsPath);
|
|
3458
|
+
if (!args.trim()) {
|
|
3459
|
+
const providers = listSpeechProviders(params.cfg);
|
|
3460
|
+
return {
|
|
3461
|
+
shouldContinue: false,
|
|
3462
|
+
reply: { text: `šļø TTS provider\nPrimary: ${currentProvider}\n` + providers.map((provider) => `${provider.label}: ${provider.isConfigured({
|
|
3463
|
+
cfg: params.cfg,
|
|
3464
|
+
providerConfig: getResolvedSpeechProviderConfig(config, provider.id, params.cfg),
|
|
3465
|
+
timeoutMs: config.timeoutMs
|
|
3466
|
+
}) ? "ā
" : "ā"}`).join("\n") + `\nUsage: /tts provider <id>` }
|
|
3467
|
+
};
|
|
3468
|
+
}
|
|
3469
|
+
const requested = args.trim().toLowerCase();
|
|
3470
|
+
const resolvedProvider = getSpeechProvider(requested, params.cfg);
|
|
3471
|
+
if (!resolvedProvider) return {
|
|
3472
|
+
shouldContinue: false,
|
|
3473
|
+
reply: ttsUsage()
|
|
3474
|
+
};
|
|
3475
|
+
const nextProvider = canonicalizeSpeechProviderId(requested, params.cfg) ?? resolvedProvider.id;
|
|
3476
|
+
setTtsProvider(prefsPath, nextProvider);
|
|
3477
|
+
return {
|
|
3478
|
+
shouldContinue: false,
|
|
3479
|
+
reply: { text: `ā
TTS provider set to ${nextProvider}.` }
|
|
3480
|
+
};
|
|
3481
|
+
}
|
|
3482
|
+
if (action === "limit") {
|
|
3483
|
+
if (!args.trim()) return {
|
|
3484
|
+
shouldContinue: false,
|
|
3485
|
+
reply: { text: `š TTS limit: ${getTtsMaxLength(prefsPath)} characters.\n\nText longer than this triggers summary (if enabled).\nRange: 100-4096 chars (Telegram max).\n\nTo change: /tts limit <number>\nExample: /tts limit 2000` }
|
|
3486
|
+
};
|
|
3487
|
+
const next = Number.parseInt(args.trim(), 10);
|
|
3488
|
+
if (!Number.isFinite(next) || next < 100 || next > 4096) return {
|
|
3489
|
+
shouldContinue: false,
|
|
3490
|
+
reply: { text: "ā Limit must be between 100 and 4096 characters." }
|
|
3491
|
+
};
|
|
3492
|
+
setTtsMaxLength(prefsPath, next);
|
|
3493
|
+
return {
|
|
3494
|
+
shouldContinue: false,
|
|
3495
|
+
reply: { text: `ā
TTS limit set to ${next} characters.` }
|
|
3496
|
+
};
|
|
3497
|
+
}
|
|
3498
|
+
if (action === "summary") {
|
|
3499
|
+
if (!args.trim()) {
|
|
3500
|
+
const enabled = isSummarizationEnabled(prefsPath);
|
|
3501
|
+
const maxLen = getTtsMaxLength(prefsPath);
|
|
3502
|
+
return {
|
|
3503
|
+
shouldContinue: false,
|
|
3504
|
+
reply: { text: `š TTS auto-summary: ${enabled ? "on" : "off"}.\n\nWhen text exceeds ${maxLen} chars:\n⢠ON: summarizes text, then generates audio\n⢠OFF: truncates text, then generates audio\n\nTo change: /tts summary on | off` }
|
|
3505
|
+
};
|
|
3506
|
+
}
|
|
3507
|
+
const requested = args.trim().toLowerCase();
|
|
3508
|
+
if (requested !== "on" && requested !== "off") return {
|
|
3509
|
+
shouldContinue: false,
|
|
3510
|
+
reply: ttsUsage()
|
|
3511
|
+
};
|
|
3512
|
+
setSummarizationEnabled(prefsPath, requested === "on");
|
|
3513
|
+
return {
|
|
3514
|
+
shouldContinue: false,
|
|
3515
|
+
reply: { text: requested === "on" ? "ā
TTS auto-summary enabled." : "ā TTS auto-summary disabled." }
|
|
3516
|
+
};
|
|
3517
|
+
}
|
|
3518
|
+
if (action === "status") {
|
|
3519
|
+
const enabled = isTtsEnabled(config, prefsPath);
|
|
3520
|
+
const provider = getTtsProvider(config, prefsPath);
|
|
3521
|
+
const hasKey = isTtsProviderConfigured(config, provider, params.cfg);
|
|
3522
|
+
const maxLength = getTtsMaxLength(prefsPath);
|
|
3523
|
+
const summarize = isSummarizationEnabled(prefsPath);
|
|
3524
|
+
const last = getLastTtsAttempt();
|
|
3525
|
+
const lines = [
|
|
3526
|
+
"š TTS status",
|
|
3527
|
+
`State: ${enabled ? "ā
enabled" : "ā disabled"}`,
|
|
3528
|
+
`Provider: ${provider} (${hasKey ? "ā
configured" : "ā not configured"})`,
|
|
3529
|
+
`Text limit: ${maxLength} chars`,
|
|
3530
|
+
`Auto-summary: ${summarize ? "on" : "off"}`
|
|
3531
|
+
];
|
|
3532
|
+
if (last) {
|
|
3533
|
+
const timeAgo = Math.round((Date.now() - last.timestamp) / 1e3);
|
|
3534
|
+
lines.push("");
|
|
3535
|
+
lines.push(`Last attempt (${timeAgo}s ago): ${last.success ? "ā
" : "ā"}`);
|
|
3536
|
+
lines.push(`Text: ${last.textLength} chars${last.summarized ? " (summarized)" : ""}`);
|
|
3537
|
+
if (last.success) {
|
|
3538
|
+
lines.push(`Provider: ${last.provider ?? "unknown"}`);
|
|
3539
|
+
if (last.fallbackFrom && last.provider && last.fallbackFrom !== last.provider) lines.push(`Fallback: ${last.fallbackFrom} -> ${last.provider}`);
|
|
3540
|
+
if (last.attemptedProviders && last.attemptedProviders.length > 1) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3541
|
+
const details = formatAttemptDetails(last.attempts);
|
|
3542
|
+
if (details) lines.push(`Attempt details: ${details}`);
|
|
3543
|
+
lines.push(`Latency: ${last.latencyMs ?? 0}ms`);
|
|
3544
|
+
} else if (last.error) {
|
|
3545
|
+
lines.push(`Error: ${last.error}`);
|
|
3546
|
+
if (last.attemptedProviders && last.attemptedProviders.length > 0) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3547
|
+
const details = formatAttemptDetails(last.attempts);
|
|
3548
|
+
if (details) lines.push(`Attempt details: ${details}`);
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3551
|
+
return {
|
|
3552
|
+
shouldContinue: false,
|
|
3553
|
+
reply: { text: lines.join("\n") }
|
|
3554
|
+
};
|
|
3555
|
+
}
|
|
3556
|
+
return {
|
|
3557
|
+
shouldContinue: false,
|
|
3558
|
+
reply: ttsUsage()
|
|
3559
|
+
};
|
|
3560
|
+
};
|
|
3561
|
+
//#endregion
|
|
3562
|
+
//#region src/auto-reply/reply/commands-handlers.runtime.ts
|
|
3563
|
+
function loadCommandHandlers() {
|
|
3564
|
+
return [
|
|
3565
|
+
handlePluginCommand,
|
|
3566
|
+
handleBtwCommand,
|
|
3567
|
+
handleBashCommand,
|
|
3568
|
+
handleActivationCommand,
|
|
3569
|
+
handleSendPolicyCommand,
|
|
3570
|
+
handleFastCommand,
|
|
3571
|
+
handleUsageCommand,
|
|
3572
|
+
handleSessionCommand,
|
|
3573
|
+
handleRestartCommand,
|
|
3574
|
+
handleTtsCommands,
|
|
3575
|
+
handleHelpCommand,
|
|
3576
|
+
handleCommandsListCommand,
|
|
3577
|
+
handleToolsCommand,
|
|
3578
|
+
handleStatusCommand,
|
|
3579
|
+
handleAllowlistCommand,
|
|
3580
|
+
handleApproveCommand,
|
|
3581
|
+
handleContextCommand,
|
|
3582
|
+
handleExportSessionCommand,
|
|
3583
|
+
handleWhoamiCommand,
|
|
3584
|
+
handleSubagentsCommand,
|
|
3585
|
+
handleAcpCommand,
|
|
3586
|
+
handleMcpCommand,
|
|
3587
|
+
handlePluginsCommand,
|
|
3588
|
+
handleConfigCommand,
|
|
3589
|
+
handleDebugCommand,
|
|
3590
|
+
handleModelsCommand,
|
|
3591
|
+
handleStopCommand,
|
|
3592
|
+
handleCompactCommand,
|
|
3593
|
+
handleAbortTrigger
|
|
3594
|
+
];
|
|
3595
|
+
}
|
|
3596
|
+
//#endregion
|
|
3597
|
+
export { loadCommandHandlers };
|