kaijibot 2026.8.17 ā 2026.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.buildstamp +1 -1
- package/dist/abort-BA4i4CO6.js +202 -0
- package/dist/abort-cutoff.runtime-140Dy9Z_.js +20 -0
- package/dist/abort-cutoff.runtime.js +1 -1
- package/dist/abort-primitives-DqU6syXA.js +93 -0
- package/dist/abort.runtime-D2xd_Jxq.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/account-action-gate-w2MQyrck.js +114 -0
- package/dist/acp-cli-lUerPOt4.js +2171 -0
- package/dist/acp-spawn-CKu5HWZd.js +1024 -0
- package/dist/acp-stateful-target-driver-DNcDMame.js +88 -0
- package/dist/action-agents-bNO5zlxQ.js +67 -0
- package/dist/action-focus-BQH1yzA9.js +124 -0
- package/dist/action-help-Copk6G3d.js +7 -0
- package/dist/action-info-BUV_zoSU.js +58 -0
- package/dist/action-kill-BMDz9l_U.js +33 -0
- package/dist/action-list-CxkulhYF.js +21 -0
- package/dist/action-log-D0K9-YCV.js +30 -0
- package/dist/action-send-B8ggJVwC.js +39 -0
- package/dist/action-spawn-D9kSXA_K.js +46 -0
- package/dist/action-unfocus-bI4VBonB.js +28 -0
- package/dist/agent-CdxQT19_.js +2 -0
- package/dist/agent-command-Bu_cXSEL.js +1479 -0
- package/dist/agent-list-CPYyofv7.js +67 -0
- package/dist/agent-runner-utils--p6HAP6k.js +202 -0
- package/dist/agent-runner.runtime-BossnlL1.js +2825 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents/pi-model-discovery-runtime.js +1 -1
- package/dist/agents-DA2-qNUI.js +887 -0
- package/dist/agents-DaKVGj9F.js +5 -0
- package/dist/allow-from-p586L6ne.js +164 -0
- package/dist/anthropic-cache-control-payload-N8EtT94O.js +28 -0
- package/dist/anthropic-payload-policy-D6dpwqVe.js +136 -0
- package/dist/anthropic-vertex-stream-CrF-fPgb.js +5666 -0
- package/dist/api-BPByI3-X.js +2 -0
- package/dist/api-BRJq6Aya.js +2 -0
- package/dist/api-BpAm-eRQ.js +2 -0
- package/dist/api-BvFPt7b2.js +19 -0
- package/dist/api-C6IdzdoP.js +5 -0
- package/dist/api-CSOm-O9I.js +5 -0
- package/dist/api-ChQfiSmG.js +4 -0
- package/dist/api-Cm3n-2Iw.js +3 -0
- package/dist/api-CqBQhm6r.js +2 -0
- package/dist/api-D7SjdU34.js +4 -0
- package/dist/api-D7qSjVDS.js +3 -0
- package/dist/api-DbRoXBTn.js +45 -0
- package/dist/api-_HshnS5J.js +35 -0
- package/dist/apply-G86rau7x.js +493 -0
- package/dist/apply.runtime-BoYc09wu.js +166 -0
- package/dist/apply.runtime-Dmh02lO-.js +2 -0
- package/dist/apply.runtime.js +1 -1
- package/dist/approval-client-helpers-cyaJyAMz.js +82 -0
- package/dist/approval-gateway-resolver-bdX78er-.js +58 -0
- package/dist/approval-gateway-runtime-CJm68vrp.js +2 -0
- package/dist/approval-handler-runtime-CT08B2_a.js +439 -0
- package/dist/approval-native-helpers-DagoPLtW.js +33 -0
- package/dist/approval-native-runtime-CN4meUkM.js +709 -0
- package/dist/approval-renderers-CnmO8wke.js +64 -0
- package/dist/asr-Cz-FH-3c.js +196 -0
- package/dist/audit-Cbfv4nmn.js +885 -0
- package/dist/audit-channel.collect.runtime.js +1 -1
- package/dist/audit-extra.async-DQv_s9K0.js +847 -0
- package/dist/audit.deep.runtime-CAPtrWg1.js +2 -0
- package/dist/audit.deep.runtime.js +1 -1
- package/dist/audit.nondeep.runtime-HUJ6INiD.js +859 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-CAKbHyXK.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-CRAwpkC_.js +181 -0
- package/dist/auth-choice-Bhps2D29.js +3 -0
- package/dist/auth-choice-kMIs0xTd.js +71 -0
- package/dist/auth-choice-options-Bx_XsiW-.js +104 -0
- package/dist/auth-choice-prompt-B-koxVGL.js +2 -0
- package/dist/auth-choice-prompt-DytHsI5U.js +36 -0
- package/dist/auth-choice-vRXPONqL.js +353 -0
- package/dist/auth-choice.apply-helpers-D6x2bWVB.js +2 -0
- package/dist/auth-choice.plugin-providers.runtime-BNfpK_sp.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-BAxUQXZE.js +165 -0
- package/dist/auth-profiles-YXfmeEhu.js +438 -0
- package/dist/auth-profiles.runtime-CNNciZQU.js +7 -0
- package/dist/auth-profiles.runtime.js +1 -1
- package/dist/auto-disable-ABhUEc3O.js +69 -0
- package/dist/auto-disable-r26Mu7X0.js +2 -0
- package/dist/auto-recall-CsrNcQNa.js +78 -0
- package/dist/backup-create-DuIPhK_s.js +391 -0
- package/dist/banner-Bb9u_-IS.js +2 -0
- package/dist/banner-BkHTsqFt.js +281 -0
- package/dist/binding-routing-C6_mrNEN.js +50 -0
- package/dist/binding-targets-Cq2e7wRT.js +99 -0
- package/dist/block-streaming-BTtPFYsM.js +103 -0
- package/dist/bootstrap-files-DsmC0cJP.js +206 -0
- package/dist/bridge-server-Co3awCAM.js +103 -0
- package/dist/browser-config-runtime-BtkKPBMj.js +6 -0
- package/dist/browser-control-auth-Bqu1lakr.js +120 -0
- package/dist/browser-node-runtime-D8xut4fJ.js +12 -0
- package/dist/browser-open-BzpYLaas.js +94 -0
- package/dist/browser-profiles-gPG14SPk.js +170 -0
- package/dist/browser-runtime-BBkGI01q.js +377 -0
- package/dist/browser-security-runtime-CzhzXJ8D.js +10 -0
- package/dist/browser-setup-tools-CD_s48fd.js +12 -0
- package/dist/btw-command-Bgn_NviR.js +17 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +5 -5
- package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/call-CiUZqjsN.js +2 -0
- package/dist/call-k_nZXTJ3.js +495 -0
- package/dist/call.runtime-CZI7yxSF.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-CIm_YhHH.js +1357 -0
- package/dist/catalog-provider-Ch4CMHLl.js +40 -0
- package/dist/cdp.helpers-BVl3YwYe.js +372 -0
- package/dist/channel-config-helpers-BO9yY1Zu.js +462 -0
- package/dist/channel-core-BB7pTANC.js +5 -0
- package/dist/channel-feedback-c7a-Gb7w.js +259 -0
- package/dist/channel-plugin-resolution-DHgXIZV6.js +146 -0
- package/dist/channel-policy-DO-ZWErE.js +270 -0
- package/dist/channel-reply-pipeline-2KImYC85.js +26 -0
- package/dist/channel-runtime-Bqn7zFyT.js +6 -0
- package/dist/channel-selection.runtime.js +1 -1
- package/dist/channel-setup.status-XI51qJ8U.js +2 -0
- package/dist/channel-setup.status-bJBbVDcA.js +754 -0
- package/dist/channel-summary-TxoZjGPA.js +139 -0
- package/dist/channel-summary-dKkFDRbe.js +2 -0
- package/dist/channel.runtime-2WY9MkoH.js +399 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-D66hRVnR.js +1147 -0
- package/dist/channels-cli-0DjAVaKh.js +248 -0
- package/dist/chat-Fv3LkEfF.js +213 -0
- package/dist/chat-history-text-CZhwQ5__.js +42 -0
- package/dist/chrome-CEE9kYYR.js +1080 -0
- package/dist/chrome.executables-Dp7W-RgV.js +550 -0
- package/dist/chunk-B9X-O7Vw.js +267 -0
- package/dist/clack-prompter-BSVVLa7H.js +113 -0
- package/dist/clawhub-Ina62jCa.js +400 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-BsNkLoFI.js +57 -0
- package/dist/cli-DQH9X5IE.js +2 -0
- package/dist/cli-DW_ou4hw.js +2 -0
- package/dist/cli-DuoVlLKx.js +154 -0
- package/dist/cli-QG03g_im.js +191 -0
- package/dist/cli-auth-seam-BrijKBRQ.js +14 -0
- package/dist/cli-backend-CIs4F7ip.js +66 -0
- package/dist/cli-migration-CVktTGRI.js +127 -0
- package/dist/cli-runner-12iECISR.js +1662 -0
- package/dist/cli-runner.runtime-C5noDuQ-.js +3 -0
- package/dist/cli-runner.runtime-YrAg_h19.js +2 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-runtime-wB1rYZco.js +3 -0
- package/dist/cli-shared-BUW2okV2.js +142 -0
- package/dist/cli-startup-metadata.json +3 -3
- package/dist/cli.runtime-Bhxt80sB.js +819 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-bootstrap-BWo-ZK_j.js +28 -0
- package/dist/codex-native-web-search-C6s55zGf.js +2 -0
- package/dist/codex-native-web-search-Cxf1u7R-.js +156 -0
- package/dist/collector-CRTTihSY.js +349 -0
- package/dist/collector-tJxrYXuY.js +2 -0
- package/dist/command-auth-Dlrd5CYD.js +75 -0
- package/dist/command-config-resolution-B8pxzh3W.js +2 -0
- package/dist/command-config-resolution-BXSCDJTh.js +23 -0
- package/dist/command-detection-DFlZHBMC.js +50 -0
- package/dist/command-execution-startup-DYXpKpvc.js +269 -0
- package/dist/command-format-JYoGhCek.js +2 -0
- package/dist/command-poll-backoff.runtime.js +1 -1
- package/dist/command-queue-CmX7XAL1.js +260 -0
- package/dist/command-registry-BF51N12E.js +3 -0
- package/dist/command-registry-BqpfCBbW.js +113 -0
- package/dist/command-secret-gateway-DuuctECr.js +528 -0
- package/dist/command-status-builders-CnD1rvYb.js +145 -0
- package/dist/commands-acp-DiLJUV45.js +1017 -0
- package/dist/commands-compact.runtime-BOM8PsWH.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-context-C-jRwdK3.js +34 -0
- package/dist/commands-core.runtime-CH_aGeT-.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-Ca6xoeW5.js +3762 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-CRURuXR-.js +306 -0
- package/dist/commands-registry-CJw_6JDj.js +295 -0
- package/dist/commands-registry.runtime-78mbU8Il.js +2 -0
- package/dist/commands-registry.runtime.js +1 -1
- package/dist/commands-reset-hooks-D3RzsOIn.js +129 -0
- package/dist/commands-status-Cufj4x2j.js +223 -0
- package/dist/commands-status.runtime-C8Nz4Glk.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-DjhcmoRT.js +3 -0
- package/dist/commands-subagents-control.runtime-s_DYQWfW.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands.runtime-ChfYOBeV.js +103 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/comment-shared-DFEZzqhH.js +40 -0
- package/dist/compact-DEsHFhEL.js +11324 -0
- package/dist/compact.runtime-BzLFUSmk.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-CiWtzUFQ.js +2 -0
- package/dist/completion-cli-h3zgpXGM.js +468 -0
- package/dist/config-B3cxNRyw.js +8 -0
- package/dist/config-Bd1PtH4x.js +166 -0
- package/dist/config-D5YvYnSX.js +136 -0
- package/dist/config-DuLfQQvE.js +53 -0
- package/dist/config-cli-BiEmyiRa.js +948 -0
- package/dist/config-defaults-Bw9wwyo1.js +163 -0
- package/dist/config-guard-BGGjXg_Y.js +94 -0
- package/dist/config-runtime-Bvdi0W59.js +14 -0
- package/dist/config-validation-BDeuMlc1.js +279 -0
- package/dist/configure-CUSDnrHs.js +2 -0
- package/dist/configure-FDqT3i_9.js +1162 -0
- package/dist/connection-auth-7izNv08V.js +30 -0
- package/dist/context-B2wCjR9D.js +249 -0
- package/dist/context-builder-BTAOEMTs.js +2 -0
- package/dist/context-n8ANhlMJ.js +2 -0
- package/dist/context-visibility-d6FHLhsq.js +14 -0
- package/dist/context-writer-COhxMkVz.js +290 -0
- package/dist/control-auth-Csa4b5CR.js +122 -0
- package/dist/control-ui/assets/agents-CYCtph5J.js +767 -0
- package/dist/control-ui/assets/anthropic-B66S-tt5.js +40 -0
- package/dist/control-ui/assets/azure-openai-responses-CRJyPvrW.js +2 -0
- package/dist/control-ui/assets/cron-DPaLQLTR.js +744 -0
- package/dist/control-ui/assets/dialogues-DPJy1B4C.js +83 -0
- package/dist/control-ui/assets/history-CT3DjMa7.js +71 -0
- package/dist/control-ui/assets/index-Ci2oc-eJ.css +1 -0
- package/dist/control-ui/assets/index-Ua-cFlP6.js +2686 -0
- package/dist/control-ui/assets/mistral-DWkPN1WM.js +72 -0
- package/dist/control-ui/assets/openai-codex-responses-CSJ_tbUW.js +8 -0
- package/dist/control-ui/assets/openai-completions-QUhkmdlC.js +6 -0
- package/dist/control-ui/assets/openai-responses-CjthZA3L.js +2 -0
- package/dist/control-ui/assets/openai-responses-shared-tozh4HQx.js +13 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui-links-tILfT2Ek.js +70 -0
- package/dist/conversation-id-d7KXWjzV.js +140 -0
- package/dist/conversation-runtime-D-YmpVS2.js +31 -0
- package/dist/core-8TPCsNB-.js +210 -0
- package/dist/core-command-descriptors-CogWiUSt.js +112 -0
- package/dist/cron-cli-C5ok2iVK.js +637 -0
- package/dist/curator-9KwCnpXG.js +598 -0
- package/dist/curator-t_jLT3Ie.js +2 -0
- package/dist/daemon-cli-Cr_y38yv.js +476 -0
- package/dist/daemon-install-CrhzPiZ-.js +70 -0
- package/dist/delegate-r3VqUt34.js +61 -0
- package/dist/deliver-Cuu36rnv.js +3 -0
- package/dist/deliver-SAyi_F0e.js +782 -0
- package/dist/deliver-runtime-DKv9J6QE.js +2 -0
- package/dist/delivery-outbound.runtime-DDoInTnF.js +6 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-CWi3kUit.js +372 -0
- package/dist/delivery-queue-ecSu6ZNL.js +2 -0
- package/dist/deps-BIU2SScd.js +60 -0
- package/dist/detect-9KcxEkJd.js +113 -0
- package/dist/device-bootstrap---geQnCr.js +4 -0
- package/dist/device-bootstrap-BEWox6at.js +248 -0
- package/dist/device-bootstrap-profile-BR1NnTGX.js +36 -0
- package/dist/device-identity-huL1Exh1.js +2 -0
- package/dist/device-pairing-DSkkI5A-.js +600 -0
- package/dist/devices-cli-BUAuMOOj.js +336 -0
- package/dist/diagnostic-BLwuJXPT.js +311 -0
- package/dist/diagnostics-Bh0Gbi4L.js +33 -0
- package/dist/diagnostics-BsUG_otQ.js +2 -0
- package/dist/direct-dm-D_7_vKGq.js +139 -0
- package/dist/directive-handling.fast-lane-C91i_iZm.js +2 -0
- package/dist/directive-handling.fast-lane-F7l0XNwG.js +64 -0
- package/dist/directive-handling.impl-8RAWZiZE.js +659 -0
- package/dist/directive-handling.impl-BxAIWFS-.js +2 -0
- package/dist/directive-handling.parse-B3O0CfXY.js +376 -0
- package/dist/directive-handling.persist-QXt7GHcD.js +139 -0
- package/dist/directive-handling.persist.runtime-CPPm2qYQ.js +2 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directive-handling.shared-C5ywsGJd.js +159 -0
- package/dist/directory-cli-D9v1dSPr.js +240 -0
- package/dist/dispatch-DoyBs65s.js +1126 -0
- package/dist/dispatch-acp-Dz8rU6t9.js +969 -0
- package/dist/dispatch-acp-command-bypass-CJ5xdqXR.js +38 -0
- package/dist/dispatch-acp-manager.runtime-tPUGDjl3.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-rwYN3ewY.js +3 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-session.runtime-C9nyGih8.js +2 -0
- package/dist/dispatch-acp-session.runtime.js +1 -1
- package/dist/dispatch-acp-tts.runtime-B4jS8gyW.js +3 -0
- package/dist/dispatch-acp-tts.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-Co-JFuKU.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dns-cli-BRVJtnve.js +193 -0
- package/dist/docker-TZx6u2PT.js +826 -0
- package/dist/docs-cli-DvJd--iI.js +156 -0
- package/dist/doctor-completion-C46W5KI7.js +90 -0
- package/dist/doctor-config-preflight-B_UDrFsE.js +148 -0
- package/dist/doctor-config-preflight-DtvhOeuT.js +2 -0
- package/dist/doctor-state-migrations-Cd3yfnI1.js +2 -0
- package/dist/doctor-state-migrations-D3qorqjy.js +3 -0
- package/dist/drive-C2mxxJx5.js +718 -0
- package/dist/embedding-provider-C5S1sxvR.js +129 -0
- package/dist/embedding-provider-CNDA2uD3.js +26 -0
- package/dist/embedding-provider-CdVS1B85.js +33 -0
- package/dist/engine-B71iyBo0.js +72 -0
- package/dist/engine-CKgZ1obQ.js +82 -0
- package/dist/engine-embeddings-Bt1bTxtw.js +1489 -0
- package/dist/entry-capabilities-DrciJZn1.js +89 -0
- package/dist/entry.js +5 -5
- package/dist/env-overrides-DTd6EBBV.js +347 -0
- package/dist/env-overrides.runtime-Dxy8Shg7.js +7 -0
- package/dist/env-overrides.runtime.js +1 -1
- package/dist/exec-approval-forwarder.runtime-Dpa8Gi_P.js +3 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-reply-BaUWuhD6.js +292 -0
- package/dist/exec-approval-session-target-BYtddDF5.js +165 -0
- package/dist/exec-approvals-cli-BuOJPaPp.js +485 -0
- package/dist/exec-defaults-B5egc-6t.js +1440 -0
- package/dist/extensionAPI.js +5 -5
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/anthropic/api.js +2 -2
- package/dist/extensions/anthropic/cli-auth-seam.js +1 -1
- package/dist/extensions/anthropic/cli-backend-api.js +2 -2
- package/dist/extensions/anthropic/cli-backend.js +1 -1
- package/dist/extensions/anthropic/cli-migration.js +1 -1
- package/dist/extensions/anthropic/cli-shared.js +1 -1
- package/dist/extensions/anthropic/config-defaults.js +1 -1
- package/dist/extensions/anthropic/contract-api.js +1 -1
- package/dist/extensions/anthropic/index.js +1 -1
- package/dist/extensions/anthropic/media-understanding-provider.js +1 -1
- package/dist/extensions/anthropic/provider-policy-api.js +1 -1
- package/dist/extensions/anthropic/register.runtime.js +1 -1
- package/dist/extensions/anthropic/replay-policy.js +1 -1
- package/dist/extensions/anthropic/setup-api.js +1 -1
- package/dist/extensions/anthropic/stream-wrappers.js +1 -1
- package/dist/extensions/anthropic/test-api.js +3 -3
- package/dist/extensions/anthropic-vertex/api.js +3 -3
- package/dist/extensions/anthropic-vertex/index.js +3 -3
- package/dist/extensions/anthropic-vertex/provider-catalog.js +1 -1
- package/dist/extensions/anthropic-vertex/region.js +1 -1
- package/dist/extensions/anthropic-vertex/setup-api.js +1 -1
- package/dist/extensions/arcee/index.js +4 -4
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +1 -1
- package/dist/extensions/browser/browser-config.js +4 -4
- package/dist/extensions/browser/browser-control-auth.js +1 -1
- package/dist/extensions/browser/browser-doctor.js +5 -5
- package/dist/extensions/browser/browser-host-inspection.js +1 -1
- package/dist/extensions/browser/browser-maintenance.js +2 -2
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +12 -12
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +13 -13
- package/dist/extensions/browser/setup-api.js +2 -2
- package/dist/extensions/browser/test-support.js +2 -2
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/cerebras/index.js +1 -1
- package/dist/extensions/chutes/api.js +3 -3
- package/dist/extensions/chutes/index.js +9 -9
- package/dist/extensions/chutes/models.js +1 -1
- package/dist/extensions/chutes/onboard.js +2 -2
- package/dist/extensions/chutes/provider-catalog.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/api.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/catalog-provider.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +7 -7
- package/dist/extensions/deepinfra/api.js +8 -8
- package/dist/extensions/deepinfra/embedding-provider.js +2 -2
- package/dist/extensions/deepinfra/image-generation-provider.js +1 -1
- package/dist/extensions/deepinfra/index.js +9 -9
- package/dist/extensions/deepinfra/media-models.js +2 -2
- package/dist/extensions/deepinfra/media-understanding-provider.js +1 -1
- package/dist/extensions/deepinfra/memory-embedding-adapter.js +1 -1
- package/dist/extensions/deepinfra/onboard.js +2 -2
- package/dist/extensions/deepinfra/provider-catalog.js +1 -1
- package/dist/extensions/deepinfra/provider-models.js +1 -1
- package/dist/extensions/deepinfra/speech-provider.js +1 -1
- package/dist/extensions/deepinfra/video-generation-provider.js +1 -1
- package/dist/extensions/deepseek/index.js +3 -3
- package/dist/extensions/device-pair/api.js +6 -6
- package/dist/extensions/device-pair/index.js +9 -9
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/diffs/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/diffs/index.js +1 -1
- package/dist/extensions/diffs/node_modules/.package-lock.json +3 -3
- package/dist/extensions/diffs/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/diffs/node_modules/typebox/package.json +1 -1
- package/dist/extensions/diffs/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/exa/index.js +4 -4
- package/dist/extensions/feishu/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/feishu/api.js +21 -21
- package/dist/extensions/feishu/contract-api.js +2 -2
- package/dist/extensions/feishu/node_modules/.package-lock.json +3 -3
- package/dist/extensions/feishu/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/feishu/node_modules/typebox/package.json +1 -1
- package/dist/extensions/feishu/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/feishu/runtime-api.js +4 -4
- package/dist/extensions/feishu/security-contract-api.js +1 -1
- package/dist/extensions/feishu/session-key-api.js +1 -1
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/fireworks/index.js +4 -4
- package/dist/extensions/fireworks/stream.js +1 -1
- package/dist/extensions/github-copilot/api.js +1 -1
- package/dist/extensions/github-copilot/index.js +7 -7
- package/dist/extensions/github-copilot/login.js +1 -1
- package/dist/extensions/github-copilot/models-defaults.js +1 -1
- package/dist/extensions/github-copilot/models.js +1 -1
- package/dist/extensions/github-copilot/register.runtime.js +6 -6
- package/dist/extensions/github-copilot/replay-policy.js +1 -1
- package/dist/extensions/github-copilot/stream.js +1 -1
- package/dist/extensions/google/api.js +1 -1
- package/dist/extensions/google/gemini-cli-provider.js +1 -1
- package/dist/extensions/google/google-shared.test-helpers.js +1 -1
- package/dist/extensions/google/image-generation-provider.js +1 -1
- package/dist/extensions/google/index.js +5 -5
- package/dist/extensions/google/media-understanding-provider.js +1 -1
- package/dist/extensions/google/music-generation-provider.js +1 -1
- package/dist/extensions/google/oauth-token-shared.js +1 -1
- package/dist/extensions/google/oauth.credentials.js +1 -1
- package/dist/extensions/google/oauth.flow.js +1 -1
- package/dist/extensions/google/oauth.http.js +1 -1
- package/dist/extensions/google/oauth.js +2 -2
- package/dist/extensions/google/oauth.project.js +1 -1
- package/dist/extensions/google/oauth.runtime.js +1 -1
- package/dist/extensions/google/oauth.settings.js +1 -1
- package/dist/extensions/google/oauth.token.js +1 -1
- package/dist/extensions/google/provider-models.js +1 -1
- package/dist/extensions/google/provider-registration.js +1 -1
- package/dist/extensions/google/runtime-api.js +2 -2
- package/dist/extensions/google/test-api.js +2 -2
- package/dist/extensions/google/video-generation-provider.js +1 -1
- package/dist/extensions/google/web-search-contract-api.js +1 -1
- package/dist/extensions/google/web-search-provider.js +1 -1
- package/dist/extensions/gradium/index.js +1 -1
- package/dist/extensions/gradium/speech-provider.js +1 -1
- package/dist/extensions/gradium/tts.js +1 -1
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/groq/test-api.js +1 -1
- package/dist/extensions/huggingface/api.js +3 -3
- package/dist/extensions/huggingface/index.js +3 -3
- package/dist/extensions/huggingface/models.js +1 -1
- package/dist/extensions/huggingface/onboard.js +1 -1
- package/dist/extensions/huggingface/provider-catalog.js +2 -2
- package/dist/extensions/image-generation-core/api.js +2 -2
- package/dist/extensions/image-generation-core/runtime-api.js +2 -2
- package/dist/extensions/kilocode/api.js +2 -2
- package/dist/extensions/kilocode/index.js +8 -8
- package/dist/extensions/kilocode/onboard.js +2 -2
- package/dist/extensions/kilocode/provider-catalog.js +1 -1
- package/dist/extensions/kilocode/provider-models.js +1 -1
- package/dist/extensions/kilocode/shared.js +1 -1
- package/dist/extensions/kimi-coding/index.js +4 -4
- package/dist/extensions/kindle-portal/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/.package-lock.json +3 -3
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/engine/_stack.mjs +11 -12
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/package.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/readme.md +31 -31
- package/dist/extensions/knowledge-wiki/index.js +2 -2
- package/dist/extensions/litellm/index.js +1 -1
- package/dist/extensions/llm-task/index.js +1 -1
- package/dist/extensions/lmstudio/api.js +8 -8
- package/dist/extensions/lmstudio/index.js +3 -3
- package/dist/extensions/lmstudio/runtime-api.js +1 -1
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +12 -12
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +5 -5
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/memory-lancedb/index.js +3 -3
- package/dist/extensions/microsoft/index.js +1 -1
- package/dist/extensions/microsoft/kaijibot.plugin.json +4 -0
- package/dist/extensions/microsoft/speech-provider.js +1 -1
- package/dist/extensions/microsoft/test-api.js +1 -1
- package/dist/extensions/microsoft/tts.js +1 -1
- package/dist/extensions/microsoft-foundry/auth.js +1 -1
- package/dist/extensions/microsoft-foundry/cli.js +1 -1
- package/dist/extensions/microsoft-foundry/index.js +1 -1
- package/dist/extensions/microsoft-foundry/onboard.js +2 -2
- package/dist/extensions/microsoft-foundry/provider.js +1 -1
- package/dist/extensions/microsoft-foundry/runtime.js +1 -1
- package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
- package/dist/extensions/microsoft-foundry/shared.js +1 -1
- package/dist/extensions/minimax/api.js +5 -5
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +7 -7
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/model-definitions.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/minimax/onboard.js +1 -1
- package/dist/extensions/minimax/provider-catalog.js +1 -1
- package/dist/extensions/minimax/provider-http.test-helpers.js +1 -1
- package/dist/extensions/minimax/provider-models.js +1 -1
- package/dist/extensions/minimax/provider-registration.js +1 -1
- package/dist/extensions/minimax/speech-provider.js +1 -1
- package/dist/extensions/minimax/test-api.js +2 -2
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-contract-api.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/mistral/embedding-provider.js +1 -1
- package/dist/extensions/mistral/index.js +3 -3
- package/dist/extensions/mistral/media-understanding-provider.js +1 -1
- package/dist/extensions/mistral/memory-embedding-adapter.js +3 -3
- package/dist/extensions/mistral/provider-compat.js +1 -1
- package/dist/extensions/mistral/test-api.js +1 -1
- package/dist/extensions/moonshot/api.js +3 -3
- package/dist/extensions/moonshot/index.js +9 -9
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/moonshot/onboard.js +1 -1
- package/dist/extensions/moonshot/provider-catalog.js +1 -1
- package/dist/extensions/moonshot/test-api.js +2 -2
- package/dist/extensions/moonshot/web-search-contract-api.js +1 -1
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/nvidia/index.js +1 -1
- package/dist/extensions/ollama/api.js +4 -4
- package/dist/extensions/ollama/index.js +8 -8
- package/dist/extensions/ollama/provider-discovery.js +1 -1
- package/dist/extensions/ollama/runtime-api.js +2 -2
- package/dist/extensions/ollama/web-search-contract-api.js +1 -1
- package/dist/extensions/ollama/web-search-provider.js +1 -1
- package/dist/extensions/openai/api.js +3 -3
- package/dist/extensions/openai/image-generation-provider.js +1 -1
- package/dist/extensions/openai/index.js +9 -9
- package/dist/extensions/openai/media-understanding-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-auth-identity.js +1 -1
- package/dist/extensions/openai/openai-codex-cli-auth.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.runtime.js +2 -2
- package/dist/extensions/openai/openai-codex-shared.js +1 -1
- package/dist/extensions/openai/openai-provider.js +1 -1
- package/dist/extensions/openai/prompt-overlay.js +1 -1
- package/dist/extensions/openai/realtime-provider-shared.js +1 -1
- package/dist/extensions/openai/realtime-transcription-provider.js +1 -1
- package/dist/extensions/openai/realtime-voice-provider.js +1 -1
- package/dist/extensions/openai/register.runtime.js +8 -8
- package/dist/extensions/openai/shared.js +3 -3
- package/dist/extensions/openai/speech-provider.js +1 -1
- package/dist/extensions/openai/test-api.js +5 -5
- package/dist/extensions/openai/transport-policy.js +1 -1
- package/dist/extensions/openai/video-generation-provider.js +1 -1
- package/dist/extensions/opencode/index.js +4 -4
- package/dist/extensions/opencode-go/index.js +3 -3
- package/dist/extensions/openrouter/api.js +2 -2
- package/dist/extensions/openrouter/image-generation-provider.js +1 -1
- package/dist/extensions/openrouter/index.js +8 -8
- package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
- package/dist/extensions/openrouter/music-generation-provider.js +1 -1
- package/dist/extensions/openrouter/stream.js +1 -1
- package/dist/extensions/openrouter/test-api.js +3 -3
- package/dist/extensions/openrouter/video-generation-provider.js +6 -6
- package/dist/extensions/openrouter/video-http.js +1 -1
- package/dist/extensions/openrouter/video-model-catalog.js +1 -1
- package/dist/extensions/openshell/index.js +4 -4
- package/dist/extensions/perplexity/index.js +1 -1
- package/dist/extensions/perplexity/test-api.js +1 -1
- package/dist/extensions/perplexity/web-search-contract-api.js +1 -1
- package/dist/extensions/perplexity/web-search-provider.js +1 -1
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/api.js +4 -4
- package/dist/extensions/qwen/index.js +8 -8
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/model-definitions.js +1 -1
- package/dist/extensions/qwen/models.js +1 -1
- package/dist/extensions/qwen/onboard.js +1 -1
- package/dist/extensions/qwen/provider-catalog.js +1 -1
- package/dist/extensions/qwen/stream.js +1 -1
- package/dist/extensions/qwen/test-api.js +2 -2
- package/dist/extensions/qwen/video-generation-provider.js +1 -1
- package/dist/extensions/runway/index.js +1 -1
- package/dist/extensions/runway/video-generation-provider.js +1 -1
- package/dist/extensions/sglang/api.js +2 -2
- package/dist/extensions/sglang/index.js +2 -2
- package/dist/extensions/sglang/models.js +1 -1
- package/dist/extensions/sherpa-speech/asr.js +2 -0
- package/dist/extensions/sherpa-speech/engine.js +3 -0
- package/dist/extensions/sherpa-speech/index.js +36 -0
- package/dist/extensions/sherpa-speech/kaijibot.plugin.json +20 -0
- package/dist/extensions/sherpa-speech/model-manager.js +2 -0
- package/dist/extensions/sherpa-speech/models.js +2 -0
- package/dist/extensions/sherpa-speech/package.json +12 -0
- package/dist/extensions/sherpa-speech/runtime.js +2 -0
- package/dist/extensions/speech-core/api.js +3 -3
- package/dist/extensions/speech-core/runtime-api.js +5 -5
- package/dist/extensions/stepfun/index.js +4 -4
- package/dist/extensions/stepfun/onboard.js +1 -1
- package/dist/extensions/stepfun/provider-catalog.js +1 -1
- package/dist/extensions/talk-voice/api.js +1 -1
- package/dist/extensions/talk-voice/index.js +3 -3
- package/dist/extensions/tavily/index.js +5 -5
- package/dist/extensions/together/api.js +3 -3
- package/dist/extensions/together/index.js +3 -3
- package/dist/extensions/together/models.js +1 -1
- package/dist/extensions/together/onboard.js +1 -1
- package/dist/extensions/together/provider-catalog.js +1 -1
- package/dist/extensions/together/video-generation-provider.js +5 -5
- package/dist/extensions/venice/api.js +3 -3
- package/dist/extensions/venice/index.js +6 -6
- package/dist/extensions/venice/models.js +1 -1
- package/dist/extensions/venice/onboard.js +2 -2
- package/dist/extensions/venice/provider-catalog.js +1 -1
- package/dist/extensions/vercel-ai-gateway/api.js +3 -3
- package/dist/extensions/vercel-ai-gateway/index.js +3 -3
- package/dist/extensions/vercel-ai-gateway/models.js +1 -1
- package/dist/extensions/vercel-ai-gateway/onboard.js +1 -1
- package/dist/extensions/vercel-ai-gateway/provider-catalog.js +1 -1
- package/dist/extensions/vllm/api.js +3 -3
- package/dist/extensions/vllm/defaults.js +1 -1
- package/dist/extensions/vllm/index.js +3 -3
- package/dist/extensions/vllm/models.js +1 -1
- package/dist/extensions/vllm/register.runtime.js +3 -3
- package/dist/extensions/volcengine/api.js +2 -2
- package/dist/extensions/volcengine/index.js +4 -4
- package/dist/extensions/volcengine/models.js +1 -1
- package/dist/extensions/volcengine/provider-catalog.js +1 -1
- package/dist/extensions/vydra/image-generation-provider.js +1 -1
- package/dist/extensions/vydra/index.js +6 -6
- package/dist/extensions/vydra/onboard.js +1 -1
- package/dist/extensions/vydra/shared.js +1 -1
- package/dist/extensions/vydra/speech-provider.js +1 -1
- package/dist/extensions/vydra/video-generation-provider.js +1 -1
- package/dist/extensions/webhooks/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +4 -4
- package/dist/extensions/webhooks/runtime-api.js +1 -1
- package/dist/extensions/wechat/api.js +32 -10
- package/dist/extensions/xai/api.js +6 -6
- package/dist/extensions/xai/code-execution.js +6 -6
- package/dist/extensions/xai/index.js +15 -15
- package/dist/extensions/xai/model-definitions.js +1 -1
- package/dist/extensions/xai/model-id.js +1 -1
- package/dist/extensions/xai/onboard.js +1 -1
- package/dist/extensions/xai/provider-catalog.js +1 -1
- package/dist/extensions/xai/provider-models.js +1 -1
- package/dist/extensions/xai/setup-api.js +1 -1
- package/dist/extensions/xai/stream.js +1 -1
- package/dist/extensions/xai/video-generation-provider.js +1 -1
- package/dist/extensions/xai/web-search-contract-api.js +1 -1
- package/dist/extensions/xai/web-search.js +1 -1
- package/dist/extensions/xai/x-search-tool-shared.js +1 -1
- package/dist/extensions/xai/x-search.js +6 -6
- package/dist/extensions/xiaomi/api.js +2 -2
- package/dist/extensions/xiaomi/index.js +3 -3
- package/dist/extensions/xiaomi/onboard.js +1 -1
- package/dist/extensions/xiaomi/provider-catalog.js +1 -1
- package/dist/extensions/zai/api.js +3 -3
- package/dist/extensions/zai/detect.js +1 -1
- package/dist/extensions/zai/index.js +12 -12
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zai/model-definitions.js +1 -1
- package/dist/extensions/zai/onboard.js +1 -1
- package/dist/extensions/zai/runtime-api.js +1 -1
- package/dist/extensions/zai/test-api.js +1 -1
- package/dist/extra-params-Bfdm7Piq.js +295 -0
- package/dist/fetch-4HO0k3hc.js +65 -0
- package/dist/fetch-guard-BWtRcc5b.js +224 -0
- package/dist/fetch-jNI8hIPZ.js +256 -0
- package/dist/format-KzNAm6y6.js +245 -0
- package/dist/fragment-collector-DEW1fwlc.js +189 -0
- package/dist/fragment-store-C9tRSlBU.js +2 -0
- package/dist/fragment-store-F7KNJ21T.js +230 -0
- package/dist/gateway-CR7RtTbI.js +2 -0
- package/dist/gateway-CuQC7wph.js +119 -0
- package/dist/gateway-cli-CWHsIpm8.js +1532 -0
- package/dist/gateway-discovery-targets-Bww-Rx4g.js +431 -0
- package/dist/gateway-install-token-CcpoWcqs.js +284 -0
- package/dist/gateway-lock-B4umteJZ.js +238 -0
- package/dist/gateway-rpc-Do_3fQSm.js +14 -0
- package/dist/gateway-rpc.runtime-C4kzyrJj.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gateway-secret-options-DT6lYhI9.js +38 -0
- package/dist/gemini-cli-provider-YULRMcs8.js +106 -0
- package/dist/gemini-web-search-provider-D_QJZMM3.js +167 -0
- package/dist/get-reply-from-config.runtime-BpdriKtr.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/git-commit-Cblh675s.js +2 -0
- package/dist/gmail-setup-utils-D_e1q-h_.js +422 -0
- package/dist/group-policy-BxTxJeKP.js +202 -0
- package/dist/groups.runtime.js +1 -1
- package/dist/hard-trigger-D6Zoztuc.js +106 -0
- package/dist/health-B5YmS_bW.js +2 -0
- package/dist/health-CQ4zXQ-2.js +579 -0
- package/dist/heartbeat-B1UJqney.js +184 -0
- package/dist/heartbeat-runner--rVDmB2Z.js +1365 -0
- package/dist/heartbeat-runner-CwtXIPI-.js +4 -0
- package/dist/heartbeat-runner.runtime-D_5UeAsX.js +2 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/heartbeat-summary-Cf17FCYf.js +58 -0
- package/dist/heartbeat-visibility-BpEZ4Xf-.js +86 -0
- package/dist/help-CAj5xloH.js +76 -0
- package/dist/hooks-cli-BGDBJqzt.js +364 -0
- package/dist/hooks-status-DmEGo9Fp.js +86 -0
- package/dist/identity-Bwhl61jK.js +30 -0
- package/dist/identity-avatar-Bu5l4dFW.js +87 -0
- package/dist/image-DiK7kcmJ.js +152 -0
- package/dist/image-generation-core-Cwutmg_V.js +17 -0
- package/dist/image-generation-core.auth.runtime-DA7XD5V2.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-B-0SxnvJ.js +280 -0
- package/dist/image-generation-provider-B-UW3NU_.js +94 -0
- package/dist/image-generation-provider-BR1_oIU4.js +130 -0
- package/dist/image-generation-provider-BvAaZO7K.js +86 -0
- package/dist/image-generation-provider-CnGMLnE9.js +163 -0
- package/dist/image-generation-provider-DHvw6TSJ.js +136 -0
- package/dist/image-generation-runtime-DCWf9P6F.js +2 -0
- package/dist/image-runtime-DGNzvqkb.js +7 -0
- package/dist/images-BwT2L5zh.js +586 -0
- package/dist/inbound-reply-dispatch-DgEqNffL.js +73 -0
- package/dist/inbound.runtime-CloYEZJO.js +4 -0
- package/dist/inbound.runtime-DLbKJWOY.js +3 -0
- package/dist/inbound.runtime.js +1 -1
- package/dist/index.js +2 -2
- package/dist/infra-runtime-DE-Vi3Dn.js +25 -0
- package/dist/ingest-DbZJju1a.js +842 -0
- package/dist/ingest-Dyj9M3ZM.js +2 -0
- package/dist/input-files-tzSehEsO.js +252 -0
- package/dist/inspect-_4i1jBjC.js +2 -0
- package/dist/inspect-dprTBmSB.js +282 -0
- package/dist/install-DCsrCvd1.js +662 -0
- package/dist/install-security-scan-CckHbywU.js +22 -0
- package/dist/install-security-scan.runtime-BgROR-cq.js +299 -0
- package/dist/install-security-scan.runtime.js +1 -1
- package/dist/install-skills-BcVojHit.js +70 -0
- package/dist/install.runtime-C3_WB-H4.js +12 -0
- package/dist/install.runtime-CoXV-73Y.js +27 -0
- package/dist/install.runtime.js +1 -1
- package/dist/io-Bz-M35LC.js +7184 -0
- package/dist/io-DacBLjh1.js +5 -0
- package/dist/issue-format-CoEMThLD.js +2 -0
- package/dist/kaijibot-tools-Df_9YJcO.js +9434 -0
- package/dist/kaijibot-tools.runtime-CZId-V1O.js +2 -0
- package/dist/kaijibot-tools.runtime.js +1 -1
- package/dist/kill-tree-DerqhtJm.js +2 -0
- package/dist/kimi-web-search-provider-DunVVASJ.js +308 -0
- package/dist/launchd-Bh7KL8au.js +556 -0
- package/dist/library-BqMFzJMy.js +45 -0
- package/dist/lifecycle-core-DD_IXtH-.js +422 -0
- package/dist/list.runtime-DU0ctAjd.js +12 -0
- package/dist/list.runtime-DXWlaAJq.js +9 -0
- package/dist/list.runtime.js +1 -1
- package/dist/llm-draft-generator-B9jtO6H9.js +2 -0
- package/dist/llm-draft-generator-bfVpcuQF.js +567 -0
- package/dist/llm-engine-CMR9RxLA.js +1792 -0
- package/dist/llm-engine-VKRjaGY_.js +2 -0
- package/dist/llm-extractor-BCPvoWmb.js +445 -0
- package/dist/llm-slug-generator.js +2 -2
- package/dist/load-context-DV3B4twI.js +51 -0
- package/dist/logging-BMNGvpuz.js +13 -0
- package/dist/logging-CN3VAZ70.js +2 -0
- package/dist/login-Dex1JqnY.js +108 -0
- package/dist/logs-cli-BZFJyrsk.js +264 -0
- package/dist/logs-cli.runtime-bBS2Sbi6.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/manager-BmS2ofc4.js +2049 -0
- package/dist/manager-CabVEPeE.js +3314 -0
- package/dist/markdown-tables-DyVly8kN.js +51 -0
- package/dist/mcp/plugin-tools-serve.js +3 -3
- package/dist/mcp-cli-DGrmbpsu.js +733 -0
- package/dist/mcp-config-CY_3tJVi.js +115 -0
- package/dist/media-models-Dw0Y1LxG.js +49 -0
- package/dist/media-runtime-CAa8uHqv.js +312 -0
- package/dist/media-understanding-D_VRj6xY.js +83 -0
- package/dist/media-understanding-provider-B9Jfjq6L.js +13 -0
- package/dist/media-understanding-provider-BWksuEBw.js +30 -0
- package/dist/media-understanding-provider-Bhtq5Kpe.js +14 -0
- package/dist/media-understanding-provider-BzsmDAMk.js +67 -0
- package/dist/media-understanding-provider-C6_6yxvP.js +123 -0
- package/dist/media-understanding-provider-CdRlAb9s.js +18 -0
- package/dist/media-understanding-provider-D5m-2RW8.js +21 -0
- package/dist/media-understanding-provider-PmVmfI6p.js +112 -0
- package/dist/media-understanding-provider-cmLTPd8x.js +18 -0
- package/dist/media-understanding-provider-nPxfFv8l.js +37 -0
- package/dist/media-understanding-provider-yp9gxov6.js +69 -0
- package/dist/media-understanding-runtime-Bu7m-lVs.js +2 -0
- package/dist/memory-5jlpYBqx.js +242 -0
- package/dist/memory-BFKl6oSn.js +3 -0
- package/dist/memory-core-host-engine-embeddings-p06288xV.js +2 -0
- package/dist/memory-core-host-engine-foundation-DHbdNLgZ.js +11 -0
- package/dist/memory-core-host-runtime-cli-BnvAiNzO.js +9 -0
- package/dist/memory-core-host-runtime-core-CnVg69Uw.js +8 -0
- package/dist/memory-embedding-adapter-Cux48Bvk.js +33 -0
- package/dist/memory-host-search.runtime-D6ORyqHq.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-index-DSbV_yD0.js +2 -0
- package/dist/memory-index-EFkCRTeh.js +514 -0
- package/dist/memory-runtime-BKqNwQ9X.js +2 -0
- package/dist/memory-runtime-Cn41W0bC.js +26 -0
- package/dist/message-CMCdNyAT.js +223 -0
- package/dist/message-action-runner-CG2CcWaS.js +1628 -0
- package/dist/message-action-runner-DUZQ7nmt.js +2 -0
- package/dist/message.config.runtime-B3ztIjsr.js +3 -0
- package/dist/message.config.runtime.js +1 -1
- package/dist/message.gateway.runtime-COLMRCv4.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/metadata-registry-loader-BSyFpHop.js +15 -0
- package/dist/metadata-registry-loader-Ci3mcmNV.js +2 -0
- package/dist/method-scopes-BNjBMlqM.js +2883 -0
- package/dist/minimax-vlm-D1DbVSjC.js +183 -0
- package/dist/minimax-web-search-provider-BzgvahXM.js +165 -0
- package/dist/mmr-Clamw4uq.js +146 -0
- package/dist/model-CJIbRRp9.js +630 -0
- package/dist/model-auth-BQpkMtoP.js +427 -0
- package/dist/model-auth-env-BWJjZ_uc.js +53 -0
- package/dist/model-auth-env-CZXe-GO2.js +2 -0
- package/dist/model-auth-label-dLSkL9EI.js +45 -0
- package/dist/model-catalog-DgqowW_L.js +204 -0
- package/dist/model-definitions-BOTIDDWJ.js +258 -0
- package/dist/model-definitions-mx0Ogg9X.js +74 -0
- package/dist/model-discovery-live.runtime-D2J8zvfK.js +419 -0
- package/dist/model-discovery-live.runtime.js +1 -1
- package/dist/model-discovery-modelsdev-BKijFiV8.js +174 -0
- package/dist/model-manager-D6ZJxU6i.js +213 -0
- package/dist/model-picker-B4SuA28P.js +3 -0
- package/dist/model-picker-buwrc8kM.js +500 -0
- package/dist/model-picker.runtime-DXgS2Rab.js +15 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-selection-CBuo2hSg.js +381 -0
- package/dist/model-suppression-CthTVW_x.js +28 -0
- package/dist/model-suppression.runtime-R-qnGNBa.js +7 -0
- package/dist/model-suppression.runtime.js +1 -1
- package/dist/models-B3UnmjRf.js +18 -0
- package/dist/models-BmveqjOE.js +126 -0
- package/dist/models-BucP8NI1.js +760 -0
- package/dist/models-C3w7hz3K.js +18 -0
- package/dist/models-C4-eAnR7.js +157 -0
- package/dist/models-Ce7KsgeW.js +90 -0
- package/dist/models-DMLYOe4h.js +2 -0
- package/dist/models-DNNfkS3j.js +2584 -0
- package/dist/models-D_V6hTy-.js +166 -0
- package/dist/models-DkiHZi9S.js +47 -0
- package/dist/models-OhM18fW_.js +555 -0
- package/dist/models-cli-CfvtZXPd.js +198 -0
- package/dist/models-config-BLMZzgfx.js +900 -0
- package/dist/models-config.providers.secrets-rjdH8T5l.js +299 -0
- package/dist/models-yLN-WhXt.js +19 -0
- package/dist/models.fetch-D1o7sMO8.js +518 -0
- package/dist/monitor-CJdL31iS.js +4435 -0
- package/dist/monitor-DB732mUY.js +1023 -0
- package/dist/music-generation-provider-BrUTQBmG.js +169 -0
- package/dist/music-generation-provider-D6aYWSSm.js +238 -0
- package/dist/music-generation-provider-dpX_Oiuw.js +142 -0
- package/dist/node-cli-BSrC37hh.js +2374 -0
- package/dist/node-command-policy-J_sy6jJz.js +205 -0
- package/dist/node-service-Bz1OVtIc.js +69 -0
- package/dist/nodes-cli-uwgDIsqv.js +1046 -0
- package/dist/nodes-screen-EQaXZCHa.js +216 -0
- package/dist/nodes-utils-ChvZvxK1.js +196 -0
- package/dist/nodes.helpers-WGb2Q8DZ.js +34 -0
- package/dist/normalize-reply-B7T9vV8x.js +72 -0
- package/dist/note-9YcA8RtG.js +110 -0
- package/dist/notify-C9-q0Rdu.js +305 -0
- package/dist/oauth-CVAbqwnx.js +152 -0
- package/dist/oauth-RbN-L8pg.js +57 -0
- package/dist/oauth-token-shared-CCzflFLG.js +28 -0
- package/dist/oauth.credentials-BeCOUsTe.js +165 -0
- package/dist/oauth.flow-C2PFyq_h.js +122 -0
- package/dist/oauth.http-BgZeCfvj.js +23 -0
- package/dist/oauth.project-jFMmutMJ.js +123 -0
- package/dist/oauth.settings-CBmYrmAk.js +44 -0
- package/dist/oauth.token-DSow_5Ie.js +43 -0
- package/dist/onboard-8SmAjhIH.js +67 -0
- package/dist/onboard-B-ZJptUZ.js +25 -0
- package/dist/onboard-BXjJLJku.js +22 -0
- package/dist/onboard-Beu-mw_-.js +29 -0
- package/dist/onboard-BzUrcgZ5.js +25 -0
- package/dist/onboard-CPuf8esc.js +25 -0
- package/dist/onboard-CR4uUkKJ.js +36 -0
- package/dist/onboard-CRIds5S5.js +34 -0
- package/dist/onboard-CTfex1XR2.js +58 -0
- package/dist/onboard-CWwwe5B4.js +48 -0
- package/dist/onboard-Cksl3HNo.js +54 -0
- package/dist/onboard-D-ccZlbM.js +312 -0
- package/dist/onboard-DHXNhsF7.js +621 -0
- package/dist/onboard-Dd6X5k1s.js +25 -0
- package/dist/onboard-channels-BRKpgYQD.js +524 -0
- package/dist/onboard-channels-C1HMTw0C.js +3 -0
- package/dist/onboard-config-Crb6F0O5.js +2 -0
- package/dist/onboard-custom-9KIp_ybR.js +647 -0
- package/dist/onboard-custom-CbXUFVN6.js +2 -0
- package/dist/onboard-helpers-BFknCN7m.js +223 -0
- package/dist/onboard-helpers-DSJ_xWpL.js +5 -0
- package/dist/onboard-hooks-CDjwsD6n.js +35 -0
- package/dist/onboard-maT5oxKX.js +29 -0
- package/dist/onboard-remote-C28pAu4b.js +193 -0
- package/dist/onboard-remote-DQxyE18D.js +2 -0
- package/dist/onboard-search-CPHGVmos.js +324 -0
- package/dist/onboard-skills-B642NK1o.js +2 -0
- package/dist/onboard-skills-CI4B6Kx5.js +134 -0
- package/dist/openai-codex-auth-identity-PqpqYz4a.js +45 -0
- package/dist/openai-codex-cli-auth-cFTkwXjR.js +57 -0
- package/dist/openai-codex-provider-DjUpM_l9.js +299 -0
- package/dist/openai-codex-shared-o0pq7UkS.js +6 -0
- package/dist/openai-provider-ChZN4Q0c.js +283 -0
- package/dist/openai-transport-stream-DXBBlxJ9.js +1632 -0
- package/dist/openclaw-migrator-CMpCBNkK.js +2 -0
- package/dist/operator-approvals-client-RJESCyw4.js +68 -0
- package/dist/order-D863tCt-.js +794 -0
- package/dist/outbound-runtime-Bhs-eGEn.js +2 -0
- package/dist/pair-command-approve-5Jr6xo-1.js +34 -0
- package/dist/pairing-cli-BF3jieZo.js +118 -0
- package/dist/parse-DH0T3Cu9.js +168 -0
- package/dist/perplexity-web-search-provider-DqEogUCL.js +92 -0
- package/dist/perplexity-web-search-provider.runtime-Clsvb0kX.js +332 -0
- package/dist/perplexity-web-search-provider.runtime-bOr3A0b4.js +2 -0
- package/dist/perplexity-web-search-provider.runtime.js +1 -1
- package/dist/perplexity-web-search-provider.shared-DzXnzvHH.js +73 -0
- package/dist/persistent-bindings.lifecycle-CjXEQUMz.js +94 -0
- package/dist/pi-bundle-mcp-tools-DPVGNVRw.js +709 -0
- package/dist/pi-embedded-Cp3OIZy9.js +2 -0
- package/dist/pi-embedded-DJN2vlNF.js +6 -0
- package/dist/pi-embedded-runner-DXHhhGRS.js +8348 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-D1jUEg-R.js +23 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime.js +1 -1
- package/dist/pi-embedded-utils-CtraRgVx.js +212 -0
- package/dist/pi-embedded.runtime-DQPfEvkF.js +5 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-model-discovery-B9q9ykaA.js +232 -0
- package/dist/pi-tools.before-tool-call.runtime-vGvkJ6V9.js +354 -0
- package/dist/pi-tools.before-tool-call.runtime.js +1 -1
- package/dist/plugin-enabled-CMdiRqJS.js +71 -0
- package/dist/plugin-install-Cgd9nFeK.js +2 -0
- package/dist/plugin-install-DpYtmnGU.js +227 -0
- package/dist/plugin-install-config-policy-32D2JJMl.js +137 -0
- package/dist/plugin-install-plan-DR1__A8c.js +50 -0
- package/dist/plugin-registration-BhPJI7wp.js +23 -0
- package/dist/plugin-registry-Bo4RF_Fn.js +2 -0
- package/dist/plugin-registry-C4M8QkVh.js +3 -0
- package/dist/plugin-registry-loader-ZzUapRh3.js +22 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/account-core.js +2 -2
- package/dist/plugin-sdk/account-helpers.js +1 -1
- package/dist/plugin-sdk/account-resolution.js +2 -2
- package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +3 -3
- package/dist/plugin-sdk/agent-harness-runtime.js +9 -9
- package/dist/plugin-sdk/agent-runtime.js +16 -16
- package/dist/plugin-sdk/allow-from.js +1 -1
- package/dist/plugin-sdk/approval-client-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-native-runtime.js +2 -2
- package/dist/plugin-sdk/approval-reply-runtime.js +2 -2
- package/dist/plugin-sdk/approval-runtime.js +7 -7
- package/dist/plugin-sdk/browser-config-runtime.js +2 -2
- package/dist/plugin-sdk/browser-config.js +2 -2
- package/dist/plugin-sdk/browser-control-auth.js +1 -1
- package/dist/plugin-sdk/browser-node-runtime.js +6 -6
- package/dist/plugin-sdk/browser-profiles.js +1 -1
- package/dist/plugin-sdk/browser-security-runtime.js +2 -2
- package/dist/plugin-sdk/browser-setup-tools.js +3 -3
- package/dist/plugin-sdk/browser-support.js +13 -13
- package/dist/plugin-sdk/channel-config-helpers.js +1 -1
- package/dist/plugin-sdk/channel-config-writes.js +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-feedback.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +4 -4
- package/dist/plugin-sdk/channel-message.js +2 -2
- package/dist/plugin-sdk/channel-policy.js +2 -2
- package/dist/plugin-sdk/channel-reply-pipeline.js +2 -2
- package/dist/plugin-sdk/channel-runtime.js +4 -4
- package/dist/plugin-sdk/channel-setup.js +1 -1
- package/dist/plugin-sdk/cli-runtime.js +2 -2
- package/dist/plugin-sdk/command-auth-native.js +1 -1
- package/dist/plugin-sdk/command-auth.js +6 -6
- package/dist/plugin-sdk/command-detection.js +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/command-surface.js +1 -1
- package/dist/plugin-sdk/compat.js +6 -6
- package/dist/plugin-sdk/config-mutation.js +4 -4
- package/dist/plugin-sdk/config-runtime.js +10 -10
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +4 -4
- package/dist/plugin-sdk/core.js +4 -4
- package/dist/plugin-sdk/device-bootstrap.js +4 -4
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/extension-shared.js +1 -1
- package/dist/plugin-sdk/feishu.js +5 -5
- package/dist/plugin-sdk/fetch-runtime.js +2 -2
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +2 -2
- package/dist/plugin-sdk/generate-text.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +2 -2
- package/dist/plugin-sdk/image-generation-runtime.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +17 -17
- package/dist/plugin-sdk/markdown-table-runtime.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +7 -7
- package/dist/plugin-sdk/media-understanding-runtime.js +2 -2
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +3 -3
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +3 -3
- package/dist/plugin-sdk/memory-core.js +5 -5
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/native-command-registry.js +1 -1
- package/dist/plugin-sdk/outbound-media.js +2 -2
- package/dist/plugin-sdk/outbound-runtime.js +2 -2
- package/dist/plugin-sdk/plugin-test-contracts.js +1 -1
- package/dist/plugin-sdk/plugin-test-runtime.js +4 -4
- package/dist/plugin-sdk/provider-auth-api-key.js +5 -5
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth-runtime.js +4 -4
- package/dist/plugin-sdk/provider-auth.js +10 -10
- package/dist/plugin-sdk/provider-catalog-shared.js +1 -1
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-http-test-mocks.js +1 -1
- package/dist/plugin-sdk/provider-http.js +3 -3
- package/dist/plugin-sdk/provider-model-shared.js +2 -2
- package/dist/plugin-sdk/provider-setup.js +2 -2
- package/dist/plugin-sdk/provider-stream-family.js +5 -5
- package/dist/plugin-sdk/provider-stream-shared.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +4 -4
- package/dist/plugin-sdk/provider-test-contracts.js +4 -4
- package/dist/plugin-sdk/provider-tools.js +1 -1
- package/dist/plugin-sdk/provider-transport-runtime.js +2 -2
- package/dist/plugin-sdk/provider-web-fetch.js +1 -1
- package/dist/plugin-sdk/provider-web-search-config-contract.js +2 -2
- package/dist/plugin-sdk/provider-web-search-contract.js +2 -2
- package/dist/plugin-sdk/provider-web-search.js +4 -4
- package/dist/plugin-sdk/provider-zai-endpoint.js +1 -1
- package/dist/plugin-sdk/reply-chunking.js +2 -2
- package/dist/plugin-sdk/reply-dispatch-runtime.js +2 -2
- package/dist/plugin-sdk/reply-runtime.js +13 -13
- package/dist/plugin-sdk/retry-runtime.js +2 -2
- package/dist/plugin-sdk/routing.js +1 -1
- package/dist/plugin-sdk/runtime-doctor.js +1 -1
- package/dist/plugin-sdk/runtime-env.js +5 -5
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +4 -4
- package/dist/plugin-sdk/sandbox.js +2 -2
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/session-store-runtime.js +2 -2
- package/dist/plugin-sdk/setup-runtime.js +1 -1
- package/dist/plugin-sdk/setup-tools.js +2 -2
- package/dist/plugin-sdk/setup.js +3 -3
- package/dist/plugin-sdk/simple-completion-runtime.js +2 -2
- package/dist/plugin-sdk/skill-commands-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +2 -2
- package/dist/plugin-sdk/speech.js +1 -1
- package/dist/plugin-sdk/src/config/sessions/transcript.d.ts +5 -0
- package/dist/plugin-sdk/src/gateway/server-methods/stt.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/heartbeat-degeneration-guard.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/heartbeat-events.d.ts +6 -0
- package/dist/plugin-sdk/ssrf-runtime.js +2 -2
- package/dist/plugin-sdk/test-env.js +1 -1
- package/dist/plugin-sdk/testing.js +6 -6
- package/dist/plugin-sdk/text-runtime.js +5 -5
- package/dist/plugin-sdk/text-utility-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation-core.js +1 -1
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation.js +1 -1
- package/dist/plugin-sdk/web-media.js +2 -2
- package/dist/plugin-service-31XQtuZr.js +2494 -0
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins-cli-20A8dYUN.js +576 -0
- package/dist/plugins-command-helpers-C3Qls10N.js +117 -0
- package/dist/plugins-install-persist-DEr-zA4G.js +121 -0
- package/dist/plugins-update-command-D0Iv4BPb.js +1009 -0
- package/dist/policy-BEVsx7jw.js +172 -0
- package/dist/ports-CwmEcxRS.js +433 -0
- package/dist/ports-Dr-FwKZD.js +263 -0
- package/dist/preemptive-compaction-DlRJt7Zq.js +430 -0
- package/dist/proactive-scheduler-B3w5rW0h.js +1444 -0
- package/dist/probe-BY1GUZvs.js +178 -0
- package/dist/probe-CCTEVLB2.js +54 -0
- package/dist/probe-CcQ1ucSE.js +2 -0
- package/dist/probe-DcSW0ngD.js +426 -0
- package/dist/probe-auth-C7DjgU_m.js +69 -0
- package/dist/probe-auth-Cfwc8qaj.js +3 -0
- package/dist/profiles-BYudUysD.js +117 -0
- package/dist/program-E_Dt_QTp.js +111 -0
- package/dist/program-context-mb1YzlIX.js +2 -0
- package/dist/prompt-overlay-DsEnjhTn.js +72 -0
- package/dist/prompt-select-styled-Dtw90p2J.js +5305 -0
- package/dist/provider-api-key-auth-CerNsquw.js +113 -0
- package/dist/provider-api-key-auth.runtime-B0BpFkRm.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-DwgUXcgu.js +36 -0
- package/dist/provider-auth-api-key-BQfXwqgU.js +5 -0
- package/dist/provider-auth-choice-BKxMQwxd.js +134 -0
- package/dist/provider-auth-choice-preference-DeDdHlsY.js +62 -0
- package/dist/provider-auth-choice.runtime-BJxc73Ex.js +2 -0
- package/dist/provider-auth-choice.runtime-DBcrr0Ab.js +14 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-Cqo9An-I.js +34 -0
- package/dist/provider-auth-helpers-r9kVb6L3.js +168 -0
- package/dist/provider-auth-input-BfXB22nt.js +117 -0
- package/dist/provider-auth-login-BYMTrXdl.js +8 -0
- package/dist/provider-auth-login.runtime-CCwO-k5h.js +206 -0
- package/dist/provider-auth-login.runtime.js +1 -1
- package/dist/provider-auth-runtime-p93v7b23.js +36 -0
- package/dist/provider-catalog-BA7O6Faq.js +18 -0
- package/dist/provider-catalog-BZJt3Ew2.js +75 -0
- package/dist/provider-catalog-CjNAbR9b.js +12 -0
- package/dist/provider-catalog-CpTP4D3p.js +56 -0
- package/dist/provider-catalog-CzVEmVzS.js +11 -0
- package/dist/provider-catalog-D1iJW59q.js +11 -0
- package/dist/provider-catalog-Dc48HHhB.js +11 -0
- package/dist/provider-catalog-KHD3te_R.js +61 -0
- package/dist/provider-catalog-jKq2UIeG.js +17 -0
- package/dist/provider-catalog-pmlFBXYr.js +26 -0
- package/dist/provider-catalog-shared-Cra7j-_m.js +104 -0
- package/dist/provider-catalog-vjgVLYrd.js +18 -0
- package/dist/provider-catalog-xzYpukvK.js +13 -0
- package/dist/provider-catalog-yaur8Igb.js +16 -0
- package/dist/provider-compat-CCwXKQGq.js +37 -0
- package/dist/provider-discovery-DubIrc_R.js +2 -0
- package/dist/provider-dispatcher-Dl07uV70.js +22 -0
- package/dist/provider-entry-DkwXZuZY.js +97 -0
- package/dist/provider-flow-CmI4jkWV.js +66 -0
- package/dist/provider-http-CHFd_hrC.js +26 -0
- package/dist/provider-iVtrs6XY.js +70 -0
- package/dist/provider-model-shared-CxQysvS-.js +171 -0
- package/dist/provider-models-B3FlcSqf.js +225 -0
- package/dist/provider-models-B63rx638.js +22 -0
- package/dist/provider-models-BXMZj2p1.js +119 -0
- package/dist/provider-models-Bq_MZ0xR.js +35 -0
- package/dist/provider-models-CsUYkHTw.js +116 -0
- package/dist/provider-models-DCvjBHoV.js +169 -0
- package/dist/provider-openai-codex-oauth-tls-DbmKevdp.js +99 -0
- package/dist/provider-registration-DkqLtXSj.js +57 -0
- package/dist/provider-registration-vrLHkywc.js +238 -0
- package/dist/provider-runtime-C_ebc-4l.js +2 -0
- package/dist/provider-runtime-Czioyn5w.js +366 -0
- package/dist/provider-runtime.runtime-lPuF4lqy.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-Bjk91HZ7.js +249 -0
- package/dist/provider-setup-hUbxRciz.js +2 -0
- package/dist/provider-stream-DTbeHqKf.js +285 -0
- package/dist/provider-stream-family-Cz7SHqeS.js +2 -0
- package/dist/provider-stream-shared-CTpijFfV.js +80 -0
- package/dist/provider-tools-X4kNlvXF.js +332 -0
- package/dist/provider-usage-4x0im5xP.js +3 -0
- package/dist/provider-usage-CdkW3Bkb.js +289 -0
- package/dist/provider-web-search-CyGNmODH.js +55 -0
- package/dist/provider-web-search-contract-BEZzFHD8.js +12 -0
- package/dist/provider-web-search-contract-fields-DNH2_b3H.js +38 -0
- package/dist/provider-wizard-BPkIa2bk.js +166 -0
- package/dist/providers.runtime-CawuCJXc.js +125 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-stream-wrappers-BcJuaE24.js +480 -0
- package/dist/push-apns-CO3sqbX3.js +1061 -0
- package/dist/pw-ai-DEf5tZLp.js +2268 -0
- package/dist/qmd-manager-CrqmeTuY.js +1799 -0
- package/dist/qr-cli-g_Pkqstu.js +359 -0
- package/dist/qr-image-DcG1bUox.js +2 -0
- package/dist/queue-BveCZpTb.js +636 -0
- package/dist/realtime-provider-shared-BIili3oc.js +21 -0
- package/dist/realtime-transcription-provider-DqEHy_Jr.js +180 -0
- package/dist/realtime-voice-provider-Dau1KlKK.js +342 -0
- package/dist/record-shared-CC55xbFE.js +10 -0
- package/dist/refresh-BXJ80ji4.js +115 -0
- package/dist/region-CPFmncMW.js +74 -0
- package/dist/register-command-groups-9L1b4CbV.js +121 -0
- package/dist/register.agent-D5el253o.js +241 -0
- package/dist/register.backup-CBhoChp-.js +234 -0
- package/dist/register.configure-DeqUaelp.js +15 -0
- package/dist/register.maintenance-Dv5x9ZE6.js +443 -0
- package/dist/register.message-e2Pbh8A_.js +601 -0
- package/dist/register.migrate-B4iac1EW.js +195 -0
- package/dist/register.onboard-COuTKpAw.js +83 -0
- package/dist/register.runtime-BjOIl4eF.js +81 -0
- package/dist/register.runtime-BzJ6RkQN.js +343 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-DQYY7K4K.js +104 -0
- package/dist/register.status-health-sessions-CXNGQh_O.js +1211 -0
- package/dist/register.subclis-B6uy_ogx.js +232 -0
- package/dist/register.subclis-Cmdrfiej.js +3 -0
- package/dist/remote-env-DU45InJB.js +12 -0
- package/dist/repair-C8v1vNU-.js +112 -0
- package/dist/replay-policy-BKyiI8sk.js +10 -0
- package/dist/replay-policy-C6igC4nS.js +8 -0
- package/dist/reply-Bd8ShNWW.js +3523 -0
- package/dist/reply-payloads-CFKnBOGu.js +78 -0
- package/dist/reply-payloads-dedupe.runtime.js +1 -1
- package/dist/reply-prefix-D43zayDn.js +33 -0
- package/dist/reply.runtime-ByKwE5dg.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-CSTOvc_c.js +280 -0
- package/dist/restart-C0QhPXk1.js +454 -0
- package/dist/restart-handoff-Dd9C10Ns.js +2 -0
- package/dist/restart-health-BAtQdyZh.js +203 -0
- package/dist/restart-health-CnQMSvvJ.js +2 -0
- package/dist/restart-stale-pids-CiBNQGrr.js +529 -0
- package/dist/retry-C1lmuHl8.js +76 -0
- package/dist/retry-policy-B_7wH7D2.js +58 -0
- package/dist/root-help-D2vz4lbV.js +44 -0
- package/dist/route-reply-CXZFXlfK.js +141 -0
- package/dist/route-reply.runtime-BK8V9NEg.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/rpc-f0OkPaI1.js +61 -0
- package/dist/rpc.runtime-BQ78T_pB.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-main-CkwrrhfI.js +453 -0
- package/dist/run-wait-B4pXPLkF.js +118 -0
- package/dist/runner-BSA9M_M9.js +1497 -0
- package/dist/runs-CEDW87Fd.js +495 -0
- package/dist/runtime-C18YgW822.js +242 -0
- package/dist/runtime-C3OJQ1Xd.js +200 -0
- package/dist/runtime-CDNVtwVk.js +72 -0
- package/dist/runtime-CMNHfJtF.js +725 -0
- package/dist/runtime-C_o_otMV.js +355 -0
- package/dist/runtime-CiJWy5Ce.js +9 -0
- package/dist/runtime-D-PNDlkm.js +35 -0
- package/dist/runtime-D8bLKXLh.js +253 -0
- package/dist/runtime-DM4z9RVx.js +2 -0
- package/dist/runtime-Di50Fr1z.js +191 -0
- package/dist/runtime-W3qG5LHM.js +2 -0
- package/dist/runtime-api-Bx7nlc4w.js +12 -0
- package/dist/runtime-api-DCNC_FTy2.js +2 -0
- package/dist/runtime-api-_Z8MjR0l.js +3 -0
- package/dist/runtime-embedded-pi.runtime-Cv0MW9ps.js +3 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-env-BeD13rEG.js +9 -0
- package/dist/runtime-internal-DclGtT-e.js +2 -0
- package/dist/runtime-manifest.runtime.js +1 -1
- package/dist/runtime-model-auth.runtime-Bjl23_fr.js +39 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-oEwr_zQb.js +107 -0
- package/dist/runtime-plugins-CwWhqXLJ.js +69 -0
- package/dist/runtime-prepare.runtime-Bi-YD5R-.js +80 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-CSEDbSxr.js +21 -0
- package/dist/runtime-registry-loader-CbbaZCXY.js +58 -0
- package/dist/runtime-registry-loader-kqiMFCUa.js +2 -0
- package/dist/runtime-schema-CDuvvU7B.js +28383 -0
- package/dist/runtime-shared-BxJFDFe6.js +249 -0
- package/dist/runtime-taskflow-RwpXng2l.js +250 -0
- package/dist/runtime-web-channel-plugin-Bw74Ar_q.js +215 -0
- package/dist/runtime-web-tools-CEaAGeYr.js +1467 -0
- package/dist/runtime-web-tools-fallback.runtime-DU8Hp_QZ.js +9 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/runtime-web-tools-manifest.runtime.js +1 -1
- package/dist/runtime-web-tools-public-artifacts.runtime.js +1 -1
- package/dist/sandbox-BC2XUWcW.js +4 -0
- package/dist/sandbox-cli-ain0MYTB.js +447 -0
- package/dist/sandbox-epLgxWBQ.js +2586 -0
- package/dist/schtasks-CL3tJAH5.js +785 -0
- package/dist/secrets-cli-iLwRZbRt.js +2114 -0
- package/dist/security-audit-DfrokBuq.js +34 -0
- package/dist/security-cli-BqsMM550.js +486 -0
- package/dist/semantic-dedup-BBpIPaSV.js +95 -0
- package/dist/send-C5LHdZqP.js +993 -0
- package/dist/send-media-Df0E2Z_m.js +2123 -0
- package/dist/server-2CD2yd73.js +13 -0
- package/dist/server-B44RMlVT.js +77 -0
- package/dist/server-context-SulhWpXY.js +4164 -0
- package/dist/server-methods-BPzzX5VC.js +11937 -0
- package/dist/server-middleware-WQzQIrD4.js +110 -0
- package/dist/server-node-events-Ug_Atc7G.js +451 -0
- package/dist/server.impl-InfVdwPj.js +19765 -0
- package/dist/service-CK-XuLCu.js +132 -0
- package/dist/service-D9X-uqEA.js +2 -0
- package/dist/service-audit-BQx1zTWD.js +2 -0
- package/dist/service-audit-CQC1FeD7.js +254 -0
- package/dist/session-B5RmIL21.js +48 -0
- package/dist/session-archive.runtime-B1x5wHBw.js +2 -0
- package/dist/session-archive.runtime.js +1 -1
- package/dist/session-conversation-CFty7VTc.js +27 -0
- package/dist/session-cost-usage-CckjvorH.js +2 -0
- package/dist/session-cost-usage-DMRjhi4B.js +648 -0
- package/dist/session-file-DGJqy_ea.js +44 -0
- package/dist/session-fork.runtime.js +1 -1
- package/dist/session-key-D-jBcxEp.js +65 -0
- package/dist/session-meta-BijZlLS3.js +109 -0
- package/dist/session-override-1YQHEAlz.js +103 -0
- package/dist/session-reset-model.runtime-CEWrfXLr.js +120 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-Dphtb16d.js +474 -0
- package/dist/session-subagent-reactivation.runtime-CF4aqSpn.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-system-events-BSVIh760.js +63 -0
- package/dist/session-tab-registry-DG9SGi0I.js +553 -0
- package/dist/session-updates-BRFvmIoC.js +234 -0
- package/dist/session-updates.runtime-CiHARWGr.js +2 -0
- package/dist/session-updates.runtime.js +1 -1
- package/dist/session-utils-Cai4P9ih.js +930 -0
- package/dist/session-utils.fs-DV8bxCEw.js +537 -0
- package/dist/sessions-BTcXDmCA.js +2 -0
- package/dist/sessions-CyYVTseV.js +45 -0
- package/dist/sessions-Fb0ep3uj.js +231 -0
- package/dist/sessions.runtime-BGyynSR4.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-CjEjg8Ci.js +505 -0
- package/dist/setup-D-ypxGnK.js +329 -0
- package/dist/setup-DjympYIJ.js +15 -0
- package/dist/setup-binary-BKTpThn7.js +2 -0
- package/dist/setup-surface-QaubzT60.js +586 -0
- package/dist/setup-tools-6s2MNbj0.js +4 -0
- package/dist/setup-wizard-proxy-BscKn1FO.js +139 -0
- package/dist/setup.finalize-B3MWkUF9.js +436 -0
- package/dist/setup.gateway-config-BdK0tA_r.js +246 -0
- package/dist/shared-0JcWj8-R.js +224 -0
- package/dist/shared-BAqqhcWT.js +127 -0
- package/dist/shared-BOd3OCF0.js +36 -0
- package/dist/shared-D5_A7-ng.js +219 -0
- package/dist/shared-DICWV0-6.js +218 -0
- package/dist/shared-DiGX-JK8.js +137 -0
- package/dist/shared-DktX3NHd.js +175 -0
- package/dist/shared-runtime-BltNIfGY.js +7 -0
- package/dist/short-term-promotion-CT1zdD1r.js +1631 -0
- package/dist/simple-completion-runtime-CZyp8rJ3.js +131 -0
- package/dist/simple-completion-transport-BWyoXghG.js +32 -0
- package/dist/skill-commands-BC_2IdwF.js +82 -0
- package/dist/skill-commands.runtime-BP6BnOeq.js +2 -0
- package/dist/skill-commands.runtime.js +1 -1
- package/dist/skill-lifecycle-DssJKfEF.js +105 -0
- package/dist/skill-quality-gate-CNGgGfsz.js +127 -0
- package/dist/skill-usage-tracker-BXJov40v.js +31 -0
- package/dist/skills-BQX1AsbM.js +4 -0
- package/dist/skills-D7XPR8N-.js +1075 -0
- package/dist/skills-cli-CxmgxC7X.js +382 -0
- package/dist/skills-install-CHUWYiLs.js +822 -0
- package/dist/skills-status-DRTnP8E3.js +170 -0
- package/dist/skills-status-v28wm8HD.js +2 -0
- package/dist/soul-cli-B1-3BHbA.js +110 -0
- package/dist/speech-core-aXx4I3sB.js +126 -0
- package/dist/speech-provider-B2yBILHX.js +101 -0
- package/dist/speech-provider-BTBQ5VOv.js +103 -0
- package/dist/speech-provider-BciszvJf.js +184 -0
- package/dist/speech-provider-BoQDEC_Y.js +167 -0
- package/dist/speech-provider-C-wTEx8k.js +182 -0
- package/dist/speech-provider-DYJcz4pW.js +39 -0
- package/dist/ssh-tunnel-B-uzzPcH.js +2 -0
- package/dist/ssh-tunnel-Bu9s0zUo.js +159 -0
- package/dist/ssrf-runtime-D1skzXnx.js +6 -0
- package/dist/stage-sandbox-media.runtime-DhlTQjXA.js +230 -0
- package/dist/stage-sandbox-media.runtime.js +1 -1
- package/dist/standalone-generate-BRvNW_O7.js +2 -0
- package/dist/standalone-generate-CDfZss4x.js +217 -0
- package/dist/startup-auth-B5V0AaIU.js +151 -0
- package/dist/state-dir-env-Deo1QHMe.js +156 -0
- package/dist/state-migrations-BNib6l8O.js +823 -0
- package/dist/status-8clcfnN0.js +473 -0
- package/dist/status-C9YBVOov.js +278 -0
- package/dist/status-CNcOKUs2.js +500 -0
- package/dist/status-D1l9Tu3s.js +399 -0
- package/dist/status-DKth_wbp.js +2 -0
- package/dist/status-P3bvFirO.js +3 -0
- package/dist/status-TmH9qSMG.js +2 -0
- package/dist/status-all-BeyVXDNT.js +495 -0
- package/dist/status-json-Cj42CVZZ.js +14 -0
- package/dist/status-json-command-DWk5RiyN.js +92 -0
- package/dist/status-runtime-shared-orzti3tZ.js +271 -0
- package/dist/status.agent-local-BEtIuLEr.js +58 -0
- package/dist/status.command.text-runtime-B-tNLc3T.js +15 -0
- package/dist/status.format-VfGIeDvx.js +60 -0
- package/dist/status.gateway-connection.runtime-BrkaJ2f5.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gateway-probe-BwuiZk1h.js +16 -0
- package/dist/status.link-channel-CxzAOOKY.js +35 -0
- package/dist/status.node-mode-D0ZTWhza.js +2 -0
- package/dist/status.node-mode-DS1aLs_t.js +32 -0
- package/dist/status.scan-DegSjLE2.js +62 -0
- package/dist/status.scan-overview-CrSELCru.js +395 -0
- package/dist/status.scan.deps.runtime-DrUvBz4e.js +18 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-Bm5lN6IK.js +2 -0
- package/dist/status.scan.fast-json-Ch2Zw813.js +128 -0
- package/dist/status.scan.runtime-D-LvzBYN.js +417 -0
- package/dist/status.scan.runtime.js +1 -1
- package/dist/status.summary-OB-43Bvk.js +2 -0
- package/dist/status.summary-gJukahkb.js +209 -0
- package/dist/status.update-BFj-9E8m.js +79 -0
- package/dist/status.update-DYICl5t8.js +2 -0
- package/dist/store-CB-0r9De.js +296 -0
- package/dist/store-D5JODeba.js +421 -0
- package/dist/store-D_vXZ7m9.js +1112 -0
- package/dist/store-yc7MvXdd.js +1075 -0
- package/dist/store.runtime-6eaZtPq6.js +2 -0
- package/dist/store.runtime.js +1 -1
- package/dist/stream-B84y4XQY.js +76 -0
- package/dist/stream-BgcqyefI.js +649 -0
- package/dist/stream-C_VJaXT6.js +26 -0
- package/dist/stream-D5lrRuHb.js +129 -0
- package/dist/stream-DXG7L3j5.js +27 -0
- package/dist/stream-UtEiCziE.js +153 -0
- package/dist/stream-wrappers-B7-5gN0i.js +144 -0
- package/dist/strip-inbound-meta-BSHFFiJd.js +155 -0
- package/dist/subagent-announce.registry.runtime-R2bop0gW.js +3 -0
- package/dist/subagent-announce.registry.runtime.js +1 -1
- package/dist/subagent-control-UyMtkJwo.js +485 -0
- package/dist/subagent-followup.runtime-bTK0TymS.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-list-c0JKZR0g.js +168 -0
- package/dist/subagent-orphan-recovery-CSEzwva5.js +214 -0
- package/dist/subagent-registry-Be219RP1.js +2889 -0
- package/dist/subagent-registry-read-IQtTTWj3.js +57 -0
- package/dist/subagent-registry-runtime-Dk57Y91p.js +2 -0
- package/dist/subagent-registry.runtime-D6h_BK2i.js +3 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-spawn-BeyYZuFf.js +782 -0
- package/dist/subagents-format-ZcZBg1Vh.js +629 -0
- package/dist/subcli-descriptors-GyzJF8gS.js +174 -0
- package/dist/supervisor-DVGQ2rPX.js +737 -0
- package/dist/supervisor-log.runtime.js +1 -1
- package/dist/system-cli-_3czEwa7.js +60 -0
- package/dist/system-prompt-BBrWR8Ef.js +711 -0
- package/dist/system-prompt-Dc6Xr30m.js +2 -0
- package/dist/system-prompt-cache-boundary-BqVZ8lnu.js +25 -0
- package/dist/system-run-command-W-wf2HqZ.js +300 -0
- package/dist/systemd-BeYwG5kN.js +591 -0
- package/dist/systemd-hints-BpWajEeA.js +76 -0
- package/dist/systemd-linger-DsTUkfUn.js +68 -0
- package/dist/systemd-linger-X-aDLDla.js +2 -0
- package/dist/tables-BGTNKk6h.js +832 -0
- package/dist/tailscale-status-CCyq-VvN.js +72 -0
- package/dist/targets-BN0-h0GJ.js +300 -0
- package/dist/targets-CXrDP8_l.js +595 -0
- package/dist/targets.runtime-BvBk-CQ8.js +2 -0
- package/dist/targets.runtime.js +1 -1
- package/dist/task-executor-DNUNtRg8.js +350 -0
- package/dist/task-owner-access--E5Vkg9U.js +48 -0
- package/dist/task-registry-COE-B6MO.js +2346 -0
- package/dist/task-registry-control.runtime-BzsTfRw1.js +3 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/task-registry-delivery-runtime-Cv6xz8KP.js +2 -0
- package/dist/task-registry-delivery-runtime-DSfcd2LA.js +3 -0
- package/dist/task-registry.maintenance-Bhd9abl9.js +2 -0
- package/dist/task-registry.maintenance-W3lTkY0l.js +425 -0
- package/dist/test.DNmyFkvJ-CWD5psK-.js +13549 -0
- package/dist/testing-CQ_-oCQB.js +441 -0
- package/dist/text-report-BgqWDKJR.js +587 -0
- package/dist/text-runtime-asv4kIxS.js +313 -0
- package/dist/thread-bindings-BCRWofo_.js +223 -0
- package/dist/tool-auth-shared-BWZwTobX.js +53 -0
- package/dist/tool-config-shared-BleK697I.js +19 -0
- package/dist/tool-schema-runtime-DZsW_KR4.js +1892 -0
- package/dist/tools-C7lv9rSD.js +110 -0
- package/dist/tools-effective-inventory-SB9JwX-y.js +152 -0
- package/dist/tools.runtime-J5rhfXQp.js +4 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-B8bIvyol.js +2 -0
- package/dist/transcript-CxdKo8Wl.js +222 -0
- package/dist/transcript-DxWx6dVc.js +233 -0
- package/dist/transcript.runtime-CmBnobSv.js +2 -0
- package/dist/transcript.runtime.js +1 -1
- package/dist/transport-policy-BGfaKNz0.js +75 -0
- package/dist/transport-ready-MwpvBxBB.js +36 -0
- package/dist/tts-C1GyTLOi.js +31 -0
- package/dist/tts-JSdoZrZA.js +40 -0
- package/dist/tts.runtime-Bz1k778L.js +3 -0
- package/dist/tts.runtime.js +1 -1
- package/dist/tui-Cqdp1x16.js +4018 -0
- package/dist/tui-cli-BC4O3H6r.js +31 -0
- package/dist/typing-mode-BoJYxUas.js +84 -0
- package/dist/undici-global-dispatcher-BLnQvRel.js +99 -0
- package/dist/uninstall-BIQ5bjBC.js +172 -0
- package/dist/update-BrD8yWSp.js +1253 -0
- package/dist/update-check-gcnsxBqT.js +431 -0
- package/dist/update-cli-BzaCTuax.js +1779 -0
- package/dist/update-runner-Cvxezvhf.js +1492 -0
- package/dist/usage-CG1Nshi3.js +71 -0
- package/dist/usage-format-DQTT4pqY.js +507 -0
- package/dist/usage-format-sR4xu0xw.js +2 -0
- package/dist/utils-CBnbWiRL.js +189 -0
- package/dist/video-generation-CksImGdK.js +167 -0
- package/dist/video-generation-provider-7YR4_ldd.js +171 -0
- package/dist/video-generation-provider-AlAZkYIW.js +181 -0
- package/dist/video-generation-provider-BEqi4pUJ.js +104 -0
- package/dist/video-generation-provider-CraaZaR7.js +77 -0
- package/dist/video-generation-provider-CuvO2Hzh.js +246 -0
- package/dist/video-generation-provider-D-t16ACe.js +240 -0
- package/dist/video-generation-provider-DeowxvLt.js +233 -0
- package/dist/video-generation-provider-HbOZ3qzI.js +227 -0
- package/dist/video-generation-provider-_apx1yFE.js +263 -0
- package/dist/video-generation-provider-bvpb6cdV.js +64 -0
- package/dist/video-http-DRLB0lIA.js +29 -0
- package/dist/video-model-catalog-BE5LhQSo.js +187 -0
- package/dist/web-fetch-providers.runtime-m66rypbB.js +33 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-media-BYZC5tOg.js +330 -0
- package/dist/web-media-DKpK9EDb.js +2 -0
- package/dist/web-search-DSDz1iyf.js +221 -0
- package/dist/web-search-provider-DnYRRBVM.js +155 -0
- package/dist/web-search-provider-common-B9jozd8T.js +206 -0
- package/dist/web-search-provider-config-DCqeS6ct.js +52 -0
- package/dist/web-search-providers.runtime-Cv56XIGr.js +206 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/dist/web-shared--44LWgiH.js +414 -0
- package/dist/webhooks-cli-DQ_JTSNA.js +321 -0
- package/dist/workspace-CuBIOQ7n.js +306 -0
- package/dist/x-search-shared-DKPdPR5_.js +109 -0
- package/docs/platforms/termux.md +47 -0
- package/package.json +1 -1
- package/scripts/postinstall-bundled-plugins.mjs +1 -1
- package/dist/abort-cutoff.runtime-D-lbC9pe.js +0 -20
- package/dist/abort-f4MVTGHG.js +0 -202
- package/dist/abort-primitives-B6Qmun6I.js +0 -93
- package/dist/abort.runtime-CT-b0BZ6.js +0 -2
- package/dist/account-action-gate-BT_vXl45.js +0 -114
- package/dist/acp-cli-BIxxrCHO.js +0 -2171
- package/dist/acp-spawn-BAWg4qLm.js +0 -1024
- package/dist/acp-stateful-target-driver-8BC9cYRV.js +0 -88
- package/dist/action-agents-DvCfYb6Z.js +0 -67
- package/dist/action-focus-CbhWsRP9.js +0 -124
- package/dist/action-help-C851nJ6a.js +0 -7
- package/dist/action-info-Dds2t3iQ.js +0 -58
- package/dist/action-kill-B37zrHxb.js +0 -33
- package/dist/action-list-IuwtwBeu.js +0 -21
- package/dist/action-log-C8PlZdLy.js +0 -30
- package/dist/action-send-BNxBDuTc.js +0 -39
- package/dist/action-spawn-DlOYaba6.js +0 -46
- package/dist/action-unfocus-BIqluT1T.js +0 -28
- package/dist/agent-3PHkVvAe.js +0 -2
- package/dist/agent-command-C5Xt1hn0.js +0 -1479
- package/dist/agent-list-3PG6_Efg.js +0 -67
- package/dist/agent-runner-utils-DJvfzu40.js +0 -202
- package/dist/agent-runner.runtime-CMkbJlNP.js +0 -2825
- package/dist/agents-DKfujTrw.js +0 -887
- package/dist/agents-zm3fl28x.js +0 -5
- package/dist/allow-from-REaY_RBI.js +0 -164
- package/dist/anthropic-cache-control-payload-CvmvKgnD.js +0 -28
- package/dist/anthropic-payload-policy-CANcBjYh.js +0 -136
- package/dist/anthropic-vertex-stream-BaVLrx0V.js +0 -5666
- package/dist/api-2zjn_e7O.js +0 -19
- package/dist/api-BQr2q6_t.js +0 -4
- package/dist/api-BUgkRX8J.js +0 -2
- package/dist/api-Bt3NjHXq.js +0 -2
- package/dist/api-Bx2CFNaV.js +0 -45
- package/dist/api-CGjh29Sn.js +0 -3
- package/dist/api-CafX9ntL.js +0 -5
- package/dist/api-Cg5HZ6tl.js +0 -35
- package/dist/api-Cl6p3xM5.js +0 -2
- package/dist/api-CvN3buT5.js +0 -3
- package/dist/api-D0lK_Z09.js +0 -4
- package/dist/api-D7OkY2ha.js +0 -5
- package/dist/api-jjRkd0P3.js +0 -2
- package/dist/apply-BsZfM6Et.js +0 -493
- package/dist/apply.runtime-5whx300m.js +0 -166
- package/dist/apply.runtime-CLuFK3gk.js +0 -2
- package/dist/approval-client-helpers-Zaq3P9hT.js +0 -82
- package/dist/approval-gateway-resolver-DR-gkHMR.js +0 -58
- package/dist/approval-gateway-runtime-Bik0UBZF.js +0 -2
- package/dist/approval-handler-runtime-ChSsiysV.js +0 -439
- package/dist/approval-native-helpers-Dy60ZISZ.js +0 -33
- package/dist/approval-native-runtime-CXWGiUWA.js +0 -709
- package/dist/approval-renderers-DIuHRnBC.js +0 -64
- package/dist/audit-B6y81bdh.js +0 -885
- package/dist/audit-extra.async-Ck--K1W3.js +0 -847
- package/dist/audit.deep.runtime-C-cBrm0D.js +0 -2
- package/dist/audit.nondeep.runtime-DoE__Egq.js +0 -859
- package/dist/audit.runtime-IolMbix9.js +0 -7
- package/dist/auth-Bn4U0W36.js +0 -181
- package/dist/auth-choice-CFCE2lnL.js +0 -353
- package/dist/auth-choice-DNT3vqLj.js +0 -71
- package/dist/auth-choice-DSvRrafM.js +0 -3
- package/dist/auth-choice-options-CjOGl86G.js +0 -104
- package/dist/auth-choice-prompt-DethoDfy.js +0 -2
- package/dist/auth-choice-prompt-gzfGxEDS.js +0 -36
- package/dist/auth-choice.apply-helpers-Dj-d59IP.js +0 -2
- package/dist/auth-choice.plugin-providers.runtime-CX8AYJqj.js +0 -11
- package/dist/auth-health-DRSKAT80.js +0 -165
- package/dist/auth-profiles-BCAAlKMo.js +0 -438
- package/dist/auth-profiles.runtime-DsG_oD9s.js +0 -7
- package/dist/auto-disable-BQOHkr64.js +0 -2
- package/dist/auto-disable-DjpDISYk.js +0 -69
- package/dist/auto-recall-D-NhJBRA.js +0 -78
- package/dist/backup-create-DOXA9k65.js +0 -391
- package/dist/banner--gau7tjH.js +0 -2
- package/dist/banner-hOncQFT2.js +0 -281
- package/dist/binding-routing-DTW9nxjk.js +0 -50
- package/dist/binding-targets-l8eRvEwa.js +0 -99
- package/dist/block-streaming-CEz8_YvV.js +0 -103
- package/dist/bootstrap-files-MSqLqaFY.js +0 -206
- package/dist/bridge-server-DwE8zfJM.js +0 -103
- package/dist/browser-config-runtime-Dh8sLJM5.js +0 -6
- package/dist/browser-control-auth-1ZBLoiPo.js +0 -120
- package/dist/browser-node-runtime-pJbk47Fh.js +0 -12
- package/dist/browser-open-BP0tUM0r.js +0 -94
- package/dist/browser-profiles-23asqolb.js +0 -170
- package/dist/browser-runtime-H_R2tXVt.js +0 -377
- package/dist/browser-security-runtime-Ci12HfND.js +0 -10
- package/dist/browser-setup-tools-Dqro1AjE.js +0 -12
- package/dist/btw-command-YUgszbXM.js +0 -17
- package/dist/call-DL6LtukH.js +0 -2
- package/dist/call-DOfj00l8.js +0 -495
- package/dist/call.runtime-TvKrmg7B.js +0 -2
- package/dist/capability-cli-D-kRACJl.js +0 -1357
- package/dist/catalog-provider-DLOYEKT0.js +0 -40
- package/dist/cdp.helpers-Bpj6w6qw.js +0 -372
- package/dist/channel-config-helpers-XmE0KJZk.js +0 -462
- package/dist/channel-core-D7a3TBGx.js +0 -5
- package/dist/channel-feedback-1aAUqgjY.js +0 -259
- package/dist/channel-plugin-resolution-Bg9imchm.js +0 -146
- package/dist/channel-policy-B4aZ_llS.js +0 -270
- package/dist/channel-reply-pipeline-CKLpE2fN.js +0 -26
- package/dist/channel-runtime-B5LPKA4v.js +0 -6
- package/dist/channel-summary-CKKb_Yip.js +0 -2
- package/dist/channel-summary-qu8GdDSR.js +0 -139
- package/dist/channel.runtime-BQ2sQS76.js +0 -399
- package/dist/channels-Dnebu-Z2.js +0 -1146
- package/dist/channels-cli-CrrYDwyP.js +0 -248
- package/dist/chat-C7d4yEQj.js +0 -213
- package/dist/chat-history-text-BzdTyI1F.js +0 -42
- package/dist/chrome-BrX1X-Xu.js +0 -1080
- package/dist/chrome.executables-D9AsUrzE.js +0 -550
- package/dist/chunk-DgPObAqu.js +0 -267
- package/dist/clack-prompter-dDhoBpFq.js +0 -113
- package/dist/clawhub-BZ4uIkf9.js +0 -400
- package/dist/cli-CbzczoYW.js +0 -57
- package/dist/cli-DUHNTnCc.js +0 -2
- package/dist/cli-DWdaFLjz.js +0 -2
- package/dist/cli-DdsJJ5_Z.js +0 -191
- package/dist/cli-DgxZqXoY.js +0 -154
- package/dist/cli-auth-seam-ms_Y9P0q.js +0 -14
- package/dist/cli-backend-8ivUo47l.js +0 -66
- package/dist/cli-migration-D4Ed8qCX.js +0 -127
- package/dist/cli-runner-Crv7rNhq.js +0 -1662
- package/dist/cli-runner.runtime-CCXup5Mk.js +0 -3
- package/dist/cli-runner.runtime-CXhvyxfI.js +0 -2
- package/dist/cli-runtime-BTdQg8Pm.js +0 -3
- package/dist/cli-shared-BlHdVi2I.js +0 -142
- package/dist/cli.runtime-DM1J_Mdq.js +0 -819
- package/dist/client-bootstrap-C-meQM4y.js +0 -28
- package/dist/codex-native-web-search-2aA4uR0A.js +0 -149
- package/dist/codex-native-web-search-Dcc5Voe_.js +0 -2
- package/dist/collector-CM6e07XI.js +0 -2
- package/dist/collector-D2Y5qkIr.js +0 -349
- package/dist/command-auth-SFBdAt8s.js +0 -75
- package/dist/command-config-resolution-00LeDa9E.js +0 -23
- package/dist/command-config-resolution-CFoxxgJv.js +0 -2
- package/dist/command-detection-q0CJzVXY.js +0 -50
- package/dist/command-execution-startup-CDFlXP-H.js +0 -269
- package/dist/command-format-C4Pb3hfN.js +0 -2
- package/dist/command-queue-pXNZboyT.js +0 -260
- package/dist/command-registry-Bo7XSe1Q.js +0 -3
- package/dist/command-registry-CIJHAcQl.js +0 -113
- package/dist/command-secret-gateway-Dge_nif2.js +0 -528
- package/dist/command-status-builders-DykmScCm.js +0 -145
- package/dist/commands-acp-DMtvZXhv.js +0 -1017
- package/dist/commands-compact.runtime-DVcam08G.js +0 -10
- package/dist/commands-context-B5MBVGe2.js +0 -34
- package/dist/commands-core.runtime-hitqnxeE.js +0 -2
- package/dist/commands-handlers.runtime-bzi2wxAt.js +0 -3762
- package/dist/commands-models-DUISkN0p.js +0 -306
- package/dist/commands-registry-vcJhtPD2.js +0 -295
- package/dist/commands-registry.runtime-BYfD9VYg.js +0 -2
- package/dist/commands-reset-hooks-Dh86NTWQ.js +0 -129
- package/dist/commands-status-BSy7MtCk.js +0 -223
- package/dist/commands-status.runtime-Ck7v0LZJ.js +0 -2
- package/dist/commands-subagents-control.runtime-BeqJMQDW.js +0 -2
- package/dist/commands-subagents-control.runtime-BqdBqL9t.js +0 -3
- package/dist/commands.runtime-Gc7qJA-c.js +0 -103
- package/dist/comment-shared-DH9DoH_x.js +0 -40
- package/dist/compact-3ebI-sS9.js +0 -11324
- package/dist/compact.runtime-BPETvMY-.js +0 -7
- package/dist/completion-cli-CjXlpMci.js +0 -468
- package/dist/completion-cli-vslfbC9X.js +0 -2
- package/dist/config-B8yp5kYn.js +0 -136
- package/dist/config-CCY-pig0.js +0 -8
- package/dist/config-DNuLuSsf.js +0 -166
- package/dist/config-DSwbWXI1.js +0 -53
- package/dist/config-cli-VD6OEYW6.js +0 -948
- package/dist/config-defaults-qktW8sQ3.js +0 -163
- package/dist/config-guard-BSmnvKrj.js +0 -94
- package/dist/config-runtime-C6I-HVna.js +0 -14
- package/dist/config-validation-1MYzzOwN.js +0 -279
- package/dist/configure-DR28xSJH.js +0 -1161
- package/dist/configure-DlDeWMkO.js +0 -2
- package/dist/connection-auth-D-SqlhKg.js +0 -30
- package/dist/context-B5SnLjZO.js +0 -249
- package/dist/context-DFv9P-FH.js +0 -2
- package/dist/context-builder-D_FDDuDM.js +0 -2
- package/dist/context-visibility-2p0h1zWp.js +0 -14
- package/dist/context-writer-CeQDqgjO.js +0 -290
- package/dist/control-auth-DnYOaHsI.js +0 -122
- package/dist/control-ui/assets/agents-C1zCMAtn.js +0 -767
- package/dist/control-ui/assets/anthropic-CJRRuMgc.js +0 -40
- package/dist/control-ui/assets/azure-openai-responses-Di59_Cmp.js +0 -2
- package/dist/control-ui/assets/cron-D6g52nqI.js +0 -744
- package/dist/control-ui/assets/dialogues-DYAUErGq.js +0 -83
- package/dist/control-ui/assets/history-DYm34nRN.js +0 -71
- package/dist/control-ui/assets/index-B2vTvM2B.js +0 -2622
- package/dist/control-ui/assets/index-d3bUvw-B.css +0 -1
- package/dist/control-ui/assets/mistral-BZ0vS_iC.js +0 -72
- package/dist/control-ui/assets/openai-codex-responses-DzDPSQ5h.js +0 -8
- package/dist/control-ui/assets/openai-completions-QU8QkVDL.js +0 -6
- package/dist/control-ui/assets/openai-responses-CcWHDwZi.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-CM1nnVm8.js +0 -13
- package/dist/control-ui-links-DEuG_GSl.js +0 -70
- package/dist/conversation-id-YKsAPevE.js +0 -140
- package/dist/conversation-runtime-CbQInS0o.js +0 -31
- package/dist/core-Ci2tfNDf.js +0 -210
- package/dist/core-command-descriptors-D4olju_R.js +0 -112
- package/dist/cron-cli-CZOqbORC.js +0 -637
- package/dist/curator-CNQLoxP-.js +0 -2
- package/dist/curator-CS2qQobF.js +0 -598
- package/dist/daemon-cli-C5yHexZ5.js +0 -476
- package/dist/daemon-install-CTt5WwKP.js +0 -70
- package/dist/delegate-DtePi541.js +0 -61
- package/dist/deliver-Ckh3gTn8.js +0 -782
- package/dist/deliver-OgIjEM9H.js +0 -3
- package/dist/deliver-runtime-Bkv7BCow.js +0 -2
- package/dist/delivery-outbound.runtime-BCeIkXYz.js +0 -6
- package/dist/delivery-queue-DkWo6Ph_.js +0 -372
- package/dist/delivery-queue-W1vbRb8L.js +0 -2
- package/dist/deps-DbatnFkY.js +0 -60
- package/dist/detect-CzoDsq6C.js +0 -113
- package/dist/device-bootstrap-D8veEU4x.js +0 -4
- package/dist/device-bootstrap-DyTx6egK.js +0 -248
- package/dist/device-bootstrap-profile-I2zbsVdf.js +0 -36
- package/dist/device-identity-HSVRQkzQ.js +0 -2
- package/dist/device-pairing-BCo5v6N5.js +0 -600
- package/dist/devices-cli-B1O89aja.js +0 -336
- package/dist/diagnostic-Ds3dY4QI.js +0 -311
- package/dist/diagnostics-DPXDETG1.js +0 -2
- package/dist/diagnostics-QjuefiNT.js +0 -33
- package/dist/direct-dm-C8F1_e3A.js +0 -139
- package/dist/directive-handling.fast-lane-C8OicY17.js +0 -64
- package/dist/directive-handling.fast-lane-Dpi7fuWl.js +0 -2
- package/dist/directive-handling.impl-C1LcSNWm.js +0 -659
- package/dist/directive-handling.impl-DkIUEEHV.js +0 -2
- package/dist/directive-handling.parse-BLNxH-OL.js +0 -376
- package/dist/directive-handling.persist-Blk7POiT.js +0 -139
- package/dist/directive-handling.persist.runtime-DfgDPqlm.js +0 -2
- package/dist/directive-handling.shared-BTc8BSk8.js +0 -159
- package/dist/directory-cli-p4-6gL8K.js +0 -240
- package/dist/dispatch-CTsZMdlK.js +0 -1126
- package/dist/dispatch-acp-D_YySGLh.js +0 -969
- package/dist/dispatch-acp-command-bypass-DxDV0zYx.js +0 -38
- package/dist/dispatch-acp-manager.runtime-BFUXpAra.js +0 -3
- package/dist/dispatch-acp-media.runtime-DTMhMdh7.js +0 -3
- package/dist/dispatch-acp-session.runtime-Bv71yGqh.js +0 -2
- package/dist/dispatch-acp-tts.runtime-C7s5Bvqa.js +0 -3
- package/dist/dispatch-acp.runtime-BRB1Cg-T.js +0 -19
- package/dist/dns-cli-C7kZ35HQ.js +0 -193
- package/dist/docker-WeeHs5I_.js +0 -826
- package/dist/docs-cli-RFkNh5UP.js +0 -156
- package/dist/doctor-completion-B0xrCws1.js +0 -90
- package/dist/doctor-config-preflight-DUoMyrCF.js +0 -148
- package/dist/doctor-config-preflight-DWWImrXw.js +0 -2
- package/dist/doctor-state-migrations-B4I2_V16.js +0 -2
- package/dist/doctor-state-migrations-nhfeI2B0.js +0 -3
- package/dist/drive--6to33M3.js +0 -718
- package/dist/embedding-provider-BtkFLfRN.js +0 -26
- package/dist/embedding-provider-DgONMEgu.js +0 -33
- package/dist/embedding-provider-ZLwH2prV.js +0 -129
- package/dist/engine-CsT7VerD.js +0 -72
- package/dist/engine-embeddings-BpEydMJi.js +0 -1489
- package/dist/entry-capabilities-DuKEdmG2.js +0 -89
- package/dist/env-overrides-6Wa5Xk0N.js +0 -347
- package/dist/env-overrides.runtime-DH3Daeun.js +0 -7
- package/dist/exec-approval-forwarder.runtime-Au-VUhpk.js +0 -3
- package/dist/exec-approval-reply-2-xn0vFY.js +0 -292
- package/dist/exec-approval-session-target-B9-fNjez.js +0 -165
- package/dist/exec-approvals-cli-DWNqy_yE.js +0 -485
- package/dist/exec-defaults-3zZOuu5Q.js +0 -1440
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/diffs/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/feishu/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -4
- package/dist/extensions/kindle-portal/node_modules/typebox/build/schema/resolve/ref.mjs +0 -156
- package/dist/extra-params-Ujx7IlOq.js +0 -295
- package/dist/fetch-DnGnGfIj.js +0 -65
- package/dist/fetch-PlNhlY1D.js +0 -256
- package/dist/fetch-guard-DjigeYAg.js +0 -224
- package/dist/format-CcwaoG_5.js +0 -245
- package/dist/fragment-collector-BxoA9LrO.js +0 -189
- package/dist/fragment-store-CH-ruSJT.js +0 -2
- package/dist/fragment-store-lmF5kmGt.js +0 -230
- package/dist/gateway-DML9FbXS.js +0 -2
- package/dist/gateway-cli-DdtDWIYS.js +0 -1532
- package/dist/gateway-discovery-targets-D2lBNlv8.js +0 -431
- package/dist/gateway-install-token-DzTk4pqb.js +0 -284
- package/dist/gateway-lock-CeDiGyTv.js +0 -238
- package/dist/gateway-mGyPIOuQ.js +0 -119
- package/dist/gateway-rpc-DSe_1f9v.js +0 -14
- package/dist/gateway-rpc.runtime-7zGvUGmX.js +0 -23
- package/dist/gateway-secret-options-C4M1UPRj.js +0 -38
- package/dist/gemini-cli-provider-CxLrsVzr.js +0 -106
- package/dist/gemini-web-search-provider-CXr5noNb.js +0 -167
- package/dist/get-reply-from-config.runtime-22OaqrkY.js +0 -2
- package/dist/git-commit-CmbQ0R7l.js +0 -2
- package/dist/gmail-setup-utils-CYfpQJf3.js +0 -422
- package/dist/group-policy-F3YMiMAb.js +0 -202
- package/dist/hard-trigger-Cj2nYtiI.js +0 -106
- package/dist/health-BOflqD4z.js +0 -2
- package/dist/health-DJr5eOoL.js +0 -579
- package/dist/heartbeat-OI7GfQHK.js +0 -184
- package/dist/heartbeat-runner-DoT-pE2K.js +0 -4
- package/dist/heartbeat-runner-Urusnt52.js +0 -1289
- package/dist/heartbeat-runner.runtime-CyMxa8lC.js +0 -2
- package/dist/heartbeat-summary-Brqv8KYX.js +0 -58
- package/dist/heartbeat-visibility-D03CCH71.js +0 -81
- package/dist/help-DsZQFu6h.js +0 -76
- package/dist/hooks-cli-CL7QLMtO.js +0 -364
- package/dist/hooks-status-B5Zkfd83.js +0 -86
- package/dist/identity-Bxp0hRpo.js +0 -30
- package/dist/identity-avatar-Di47l4kX.js +0 -87
- package/dist/image-E9tFaoF0.js +0 -152
- package/dist/image-generation-core-BFD6kQaR.js +0 -17
- package/dist/image-generation-core.auth.runtime-BXxkxK67.js +0 -2
- package/dist/image-generation-provider-B6Mys52b.js +0 -280
- package/dist/image-generation-provider-Bkh8lMdL.js +0 -163
- package/dist/image-generation-provider-BsUqjrhi.js +0 -130
- package/dist/image-generation-provider-C_Gpk9aj.js +0 -136
- package/dist/image-generation-provider-ClCCfRD1.js +0 -94
- package/dist/image-generation-provider-CvFrycEI.js +0 -86
- package/dist/image-generation-runtime-DF454sB4.js +0 -2
- package/dist/image-runtime-Bz6kPBoi.js +0 -7
- package/dist/images-DKmW2P-z.js +0 -586
- package/dist/inbound-reply-dispatch-Bc1Q_xbX.js +0 -73
- package/dist/inbound.runtime-BBS9vn45.js +0 -4
- package/dist/inbound.runtime-CRXEfsJb.js +0 -3
- package/dist/infra-runtime-D2zkJhi6.js +0 -25
- package/dist/ingest-CaRlpNoI.js +0 -842
- package/dist/ingest-DVDjSnJ2.js +0 -2
- package/dist/input-files-CoHcEEch.js +0 -252
- package/dist/inspect-DOgFXMYn.js +0 -2
- package/dist/inspect-Ysjfnqlj.js +0 -282
- package/dist/install-8dxMsCGR.js +0 -662
- package/dist/install-security-scan-BGKx7npE.js +0 -22
- package/dist/install-security-scan.runtime-CM3pdRz_.js +0 -299
- package/dist/install-skills-CcCqsJDw.js +0 -70
- package/dist/install.runtime-BcE_gljl.js +0 -12
- package/dist/install.runtime-CXaroKqa.js +0 -27
- package/dist/io-CFug8sfU.js +0 -5
- package/dist/io-jqC0nnCj.js +0 -7181
- package/dist/issue-format-DjVI0gtD.js +0 -2
- package/dist/kaijibot-tools-CWU_rxa1.js +0 -9434
- package/dist/kaijibot-tools.runtime-BdkiUHPr.js +0 -2
- package/dist/kill-tree-0Qfa0fPs.js +0 -2
- package/dist/kimi-web-search-provider-D88yKthU.js +0 -308
- package/dist/launchd-upj2lSvL.js +0 -556
- package/dist/library-DupTA6t-.js +0 -45
- package/dist/lifecycle-core-BgkN5Ivp.js +0 -422
- package/dist/list.runtime-AlXBW4vo.js +0 -12
- package/dist/list.runtime-DayQOc4X.js +0 -9
- package/dist/llm-draft-generator-Bm97qKX4.js +0 -2
- package/dist/llm-draft-generator-DNcNszu5.js +0 -567
- package/dist/llm-engine-CiiuwTwC.js +0 -1792
- package/dist/llm-engine-Ur1T1MqO.js +0 -2
- package/dist/llm-extractor-De2TMG0s.js +0 -445
- package/dist/load-context-DegYZsvB.js +0 -51
- package/dist/logging-Cye_Xa4w.js +0 -13
- package/dist/logging-DTZsIROt.js +0 -2
- package/dist/login-B8M7ZMjk.js +0 -108
- package/dist/logs-cli-BOmoQIQo.js +0 -264
- package/dist/logs-cli.runtime-eBdNRC2O.js +0 -2
- package/dist/manager-BK_yf4TA.js +0 -3314
- package/dist/manager-D9txET8l.js +0 -2049
- package/dist/markdown-tables-DQxQ2v3M.js +0 -51
- package/dist/mcp-cli-BjyTsaR8.js +0 -733
- package/dist/mcp-config-C1hTLHpm.js +0 -115
- package/dist/media-models-CuHKr-jc.js +0 -49
- package/dist/media-runtime-to7sOM_Y.js +0 -312
- package/dist/media-understanding-BUPY06pW.js +0 -83
- package/dist/media-understanding-provider-2O5CWfpE.js +0 -21
- package/dist/media-understanding-provider-B27RH58K.js +0 -67
- package/dist/media-understanding-provider-B9cOLnSy.js +0 -13
- package/dist/media-understanding-provider-BBBobR_S.js +0 -14
- package/dist/media-understanding-provider-Btuo9DtU.js +0 -18
- package/dist/media-understanding-provider-D25JjKp6.js +0 -18
- package/dist/media-understanding-provider-D2MPF86c.js +0 -30
- package/dist/media-understanding-provider-DZRMrC7u.js +0 -123
- package/dist/media-understanding-provider-Dn1_mRNP.js +0 -112
- package/dist/media-understanding-provider-Q0qUL2Xc.js +0 -69
- package/dist/media-understanding-provider-SbIinVQB.js +0 -37
- package/dist/media-understanding-runtime-mR4yaZPY.js +0 -2
- package/dist/memory-BSChYKnu.js +0 -242
- package/dist/memory-CS0PpaBY.js +0 -3
- package/dist/memory-core-host-engine-embeddings-CwflR2IF.js +0 -2
- package/dist/memory-core-host-engine-foundation-CT4BWopI.js +0 -11
- package/dist/memory-core-host-runtime-cli-RmKhX5yL.js +0 -9
- package/dist/memory-core-host-runtime-core-CHMXUkUu.js +0 -8
- package/dist/memory-embedding-adapter-Be7sgtnM.js +0 -33
- package/dist/memory-host-search.runtime-BgQBV8Fk.js +0 -2
- package/dist/memory-index-CtBBLME7.js +0 -514
- package/dist/memory-index-DNq40JEQ.js +0 -2
- package/dist/memory-runtime-CPNFah1O.js +0 -26
- package/dist/memory-runtime-xc6oO34R.js +0 -2
- package/dist/message-BjXihlGd.js +0 -223
- package/dist/message-action-runner-BxfzjS-u.js +0 -1628
- package/dist/message-action-runner-C_LnF0uN.js +0 -2
- package/dist/message.config.runtime-DT-WFPwG.js +0 -3
- package/dist/message.gateway.runtime-D-4ACz7z.js +0 -2
- package/dist/metadata-registry-loader-Cq9GeiUK.js +0 -15
- package/dist/metadata-registry-loader-DKg37M29.js +0 -2
- package/dist/method-scopes-BNCaRohy.js +0 -2882
- package/dist/minimax-vlm-XkKlqE0H.js +0 -183
- package/dist/minimax-web-search-provider-Baj_6j_7.js +0 -165
- package/dist/mmr-CUCGW0Nx.js +0 -146
- package/dist/model-CZ_a3HtW.js +0 -630
- package/dist/model-auth-BZ5kt-1f.js +0 -427
- package/dist/model-auth-env-Ckzim7ba.js +0 -2
- package/dist/model-auth-env-qNUE5jbD.js +0 -53
- package/dist/model-auth-label-LN4o5uqO.js +0 -45
- package/dist/model-catalog-DIUg3n77.js +0 -204
- package/dist/model-definitions-DJm7w6s6.js +0 -74
- package/dist/model-definitions-DgGu9VIM.js +0 -258
- package/dist/model-discovery-live.runtime-B_7x6hLb.js +0 -419
- package/dist/model-discovery-modelsdev-B_Cpy5zK.js +0 -174
- package/dist/model-picker-D4_-5f9B.js +0 -3
- package/dist/model-picker-DvArjhst.js +0 -490
- package/dist/model-picker.runtime-Dj3FkZ-S.js +0 -15
- package/dist/model-selection-ByfoGmCG.js +0 -381
- package/dist/model-suppression-D2CmPrIy.js +0 -28
- package/dist/model-suppression.runtime-CIjX9NlA.js +0 -7
- package/dist/models-9mxq_QiD.js +0 -2
- package/dist/models-B5klbRNl.js +0 -18
- package/dist/models-BEEXc36p.js +0 -166
- package/dist/models-BcADhq5N.js +0 -126
- package/dist/models-CM9-QkVe.js +0 -19
- package/dist/models-CjYlowYN.js +0 -555
- package/dist/models-DG2rsESP.js +0 -157
- package/dist/models-DR12QL2c.js +0 -47
- package/dist/models-DaLjq4r0.js +0 -18
- package/dist/models-cli-CeRr4GDr.js +0 -198
- package/dist/models-config-BFlDXU_f.js +0 -900
- package/dist/models-config.providers.secrets-BzYBOrUA.js +0 -299
- package/dist/models-pvzUdDkE.js +0 -2584
- package/dist/models-qhmey5pY.js +0 -760
- package/dist/models.fetch-M6V7bcX_.js +0 -518
- package/dist/monitor-BLmIpjr8.js +0 -4435
- package/dist/monitor-DsXA1TBF.js +0 -1023
- package/dist/music-generation-provider-BxRuGWj1.js +0 -169
- package/dist/music-generation-provider-ByrJF4DP.js +0 -238
- package/dist/music-generation-provider-CLvSbBFV.js +0 -142
- package/dist/node-cli-CSl9YNEF.js +0 -2374
- package/dist/node-command-policy-NrFO7Yy5.js +0 -205
- package/dist/node-service-C5TgmiSv.js +0 -69
- package/dist/nodes-cli-CYYhr2Cr.js +0 -1046
- package/dist/nodes-screen-DXF9W1E2.js +0 -216
- package/dist/nodes-utils-DitAVxex.js +0 -196
- package/dist/nodes.helpers-3JZhoraJ.js +0 -34
- package/dist/normalize-reply-lOvnPpkZ.js +0 -72
- package/dist/note-C-MCr2CR.js +0 -110
- package/dist/notify-Bnyw52y9.js +0 -305
- package/dist/oauth-CPq7fFbG.js +0 -152
- package/dist/oauth-sCynaMs_.js +0 -57
- package/dist/oauth-token-shared-DsL6dJB_.js +0 -28
- package/dist/oauth.credentials-CxmXx187.js +0 -165
- package/dist/oauth.flow-BaDaI2a6.js +0 -122
- package/dist/oauth.http-BWxW_gXO.js +0 -23
- package/dist/oauth.project-Cb5OEIsJ.js +0 -123
- package/dist/oauth.settings-DTKwg34C.js +0 -44
- package/dist/oauth.token-Cq9_Mlsz.js +0 -43
- package/dist/onboard-BWi2goQe.js +0 -22
- package/dist/onboard-BX_UVeJs.js +0 -48
- package/dist/onboard-BaDvNiGt.js +0 -29
- package/dist/onboard-BmpPXiqN2.js +0 -58
- package/dist/onboard-Bxlop59E.js +0 -25
- package/dist/onboard-C1B08y2Y.js +0 -25
- package/dist/onboard-CKEn2xHD.js +0 -29
- package/dist/onboard-CRczKKEG.js +0 -621
- package/dist/onboard-CWW99Rzj.js +0 -25
- package/dist/onboard-CfYR_NXu.js +0 -25
- package/dist/onboard-DIMihTCh.js +0 -36
- package/dist/onboard-DVhexP5q.js +0 -54
- package/dist/onboard-Dpzl4IRI.js +0 -34
- package/dist/onboard-R8-I3hmu.js +0 -67
- package/dist/onboard-channels-B_4jowIn.js +0 -1260
- package/dist/onboard-channels-DHEFgumO.js +0 -2
- package/dist/onboard-config-fkSSjbwz.js +0 -2
- package/dist/onboard-custom-D6Uop5na.js +0 -647
- package/dist/onboard-custom-oMh6NPfh.js +0 -2
- package/dist/onboard-helpers-Lgk8IMHf.js +0 -223
- package/dist/onboard-helpers-Mj_BIThw.js +0 -5
- package/dist/onboard-hooks-kzEmZp3M.js +0 -35
- package/dist/onboard-nkBC9Zpi.js +0 -312
- package/dist/onboard-remote-BWvP49_r.js +0 -2
- package/dist/onboard-remote-OM6MI7-n.js +0 -193
- package/dist/onboard-search-C_yMehYl.js +0 -324
- package/dist/onboard-skills-B7QaCIP8.js +0 -2
- package/dist/onboard-skills-DnTH5fGc.js +0 -134
- package/dist/openai-codex-auth-identity-B17fKWEn.js +0 -45
- package/dist/openai-codex-cli-auth-Cl-PMKNs.js +0 -57
- package/dist/openai-codex-provider-BO9QBMyI.js +0 -299
- package/dist/openai-codex-shared-khAwBJ9v.js +0 -6
- package/dist/openai-provider-BJZNCGfx.js +0 -283
- package/dist/openai-transport-stream-Bfwyx0DL.js +0 -1632
- package/dist/openclaw-migrator-a2Mc7WOU.js +0 -2
- package/dist/operator-approvals-client-CWSFLEWa.js +0 -68
- package/dist/order-B6fzFCuC.js +0 -794
- package/dist/outbound-runtime-DhL6nVw0.js +0 -2
- package/dist/pair-command-approve-G0uqjCOh.js +0 -34
- package/dist/pairing-cli-BTMScFNF.js +0 -118
- package/dist/parse-DLTK-NVk.js +0 -168
- package/dist/perplexity-web-search-provider-uU3my6N4.js +0 -92
- package/dist/perplexity-web-search-provider.runtime-4zsB5_nx.js +0 -2
- package/dist/perplexity-web-search-provider.runtime-C7OOMB_b.js +0 -332
- package/dist/perplexity-web-search-provider.shared-BXQXODBs.js +0 -73
- package/dist/persistent-bindings.lifecycle-DZoj-DF8.js +0 -94
- package/dist/pi-bundle-mcp-tools-o-CMfj6F.js +0 -709
- package/dist/pi-embedded-CcN4r2lN.js +0 -2
- package/dist/pi-embedded-DpCl1xxW.js +0 -6
- package/dist/pi-embedded-runner-BH8m5Ek2.js +0 -8348
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-CL42c7j6.js +0 -23
- package/dist/pi-embedded-utils-qmoBiSxI.js +0 -212
- package/dist/pi-embedded.runtime-DH07ZQfG.js +0 -5
- package/dist/pi-model-discovery-DAdZXCcr.js +0 -232
- package/dist/pi-tools.before-tool-call.runtime-oD9VtK_r.js +0 -354
- package/dist/plugin-enabled-Bat2sClf.js +0 -71
- package/dist/plugin-install-BfwsbbEi.js +0 -2
- package/dist/plugin-install-Dx94fIXT.js +0 -227
- package/dist/plugin-install-config-policy-6tSijL5D.js +0 -137
- package/dist/plugin-install-plan-BmZAE503.js +0 -50
- package/dist/plugin-registration-DBPyjT8A.js +0 -23
- package/dist/plugin-registry-BxkQz7gt.js +0 -2
- package/dist/plugin-registry-Do_oXBB1.js +0 -3
- package/dist/plugin-registry-loader-2_-yHVmz.js +0 -22
- package/dist/plugin-service-DS-pRdlU.js +0 -2494
- package/dist/plugins-cli-sRXCzuRw.js +0 -576
- package/dist/plugins-command-helpers-Bj7EktUT.js +0 -117
- package/dist/plugins-install-persist-89YNeDu5.js +0 -121
- package/dist/plugins-update-command-d7lz3MHq.js +0 -1009
- package/dist/policy-aIhvOunx.js +0 -172
- package/dist/ports-2fHnkw5y.js +0 -433
- package/dist/ports-y2MKuVvs.js +0 -263
- package/dist/preemptive-compaction-BR6IYUQv.js +0 -430
- package/dist/proactive-scheduler-Du3kRlQb.js +0 -1444
- package/dist/probe-C7GwSpDS.js +0 -426
- package/dist/probe-CZ6BUVJj.js +0 -178
- package/dist/probe-auth-BB6Ja95k.js +0 -3
- package/dist/probe-auth-pWGpURUh.js +0 -69
- package/dist/probe-hJkDixY1.js +0 -2
- package/dist/probe-rf98dB-3.js +0 -54
- package/dist/profiles-BPDe8qb5.js +0 -117
- package/dist/program-context-Bk8VQcWK.js +0 -2
- package/dist/program-sIPk-Phn.js +0 -111
- package/dist/prompt-overlay-0RLiIIBU.js +0 -72
- package/dist/prompt-select-styled-CIhWc-jk.js +0 -5305
- package/dist/provider-api-key-auth-DDNqXzKj.js +0 -113
- package/dist/provider-api-key-auth.runtime-BXQ6_jmJ.js +0 -14
- package/dist/provider-auth-DTXed4qC.js +0 -36
- package/dist/provider-auth-api-key-BBpwvslY.js +0 -5
- package/dist/provider-auth-choice-CY2jmJCu.js +0 -134
- package/dist/provider-auth-choice-preference-Dr0IDF93.js +0 -62
- package/dist/provider-auth-choice.runtime-CUFjn3Mi.js +0 -14
- package/dist/provider-auth-choice.runtime-d4FyinH1.js +0 -2
- package/dist/provider-auth-guidance-DeOBKjFe.js +0 -34
- package/dist/provider-auth-helpers-Cae0FJpz.js +0 -168
- package/dist/provider-auth-input-Duh7v6fc.js +0 -117
- package/dist/provider-auth-login-BzpkiJ8a.js +0 -8
- package/dist/provider-auth-login.runtime-ClFDC4RN.js +0 -206
- package/dist/provider-auth-runtime-Bep_6xgO.js +0 -36
- package/dist/provider-catalog-BgakmlJX.js +0 -17
- package/dist/provider-catalog-Biq45Yem.js +0 -26
- package/dist/provider-catalog-BpAgZBb5.js +0 -11
- package/dist/provider-catalog-Bpqcb1Lf.js +0 -56
- package/dist/provider-catalog-Bs11UuqM.js +0 -11
- package/dist/provider-catalog-COSwNV9M.js +0 -61
- package/dist/provider-catalog-DUa_pOgJ.js +0 -75
- package/dist/provider-catalog-D_y8my55.js +0 -12
- package/dist/provider-catalog-DeCIvPpR.js +0 -18
- package/dist/provider-catalog-_qlQKmNX.js +0 -13
- package/dist/provider-catalog-e5v0B4DI.js +0 -11
- package/dist/provider-catalog-kLIlcQiR.js +0 -18
- package/dist/provider-catalog-qzO3WA-y.js +0 -16
- package/dist/provider-catalog-shared-CUCxLlCb.js +0 -104
- package/dist/provider-compat-CFb-paAS.js +0 -37
- package/dist/provider-discovery-D9udizRd.js +0 -2
- package/dist/provider-dispatcher-CpobYXeH.js +0 -22
- package/dist/provider-entry-DPuHH8KZ.js +0 -97
- package/dist/provider-flow-DpxAVxAq.js +0 -66
- package/dist/provider-http-CCWzhnsk.js +0 -26
- package/dist/provider-model-shared-TaFcxfzp.js +0 -171
- package/dist/provider-models-3mIjIjQp.js +0 -22
- package/dist/provider-models-CS0wJZJ5.js +0 -116
- package/dist/provider-models-CaZ-Aeoj.js +0 -119
- package/dist/provider-models-CvYgNrs5.js +0 -225
- package/dist/provider-models-D3D1lxRx.js +0 -169
- package/dist/provider-models-DfvyA63S.js +0 -35
- package/dist/provider-openai-codex-oauth-tls-ml4vKShG.js +0 -99
- package/dist/provider-rGfXjuTP.js +0 -70
- package/dist/provider-registration-BiwyYM-G.js +0 -57
- package/dist/provider-registration-ar6a4KcO.js +0 -238
- package/dist/provider-runtime-D60YrjWV.js +0 -2
- package/dist/provider-runtime-DlsEjiuo.js +0 -366
- package/dist/provider-runtime.runtime-BPeSkHxR.js +0 -26
- package/dist/provider-self-hosted-setup-5OmWafub.js +0 -249
- package/dist/provider-setup-tqWc26t1.js +0 -2
- package/dist/provider-stream-Dy9CFOxw.js +0 -285
- package/dist/provider-stream-family-CWsJY6l5.js +0 -2
- package/dist/provider-stream-shared-DiqyLpmc.js +0 -80
- package/dist/provider-tools-C8ePitIe.js +0 -332
- package/dist/provider-usage-DHBq1-N_.js +0 -3
- package/dist/provider-usage-DZ4vVbP6.js +0 -289
- package/dist/provider-web-search-DNrh74o2.js +0 -55
- package/dist/provider-web-search-contract-CD7a3E_j.js +0 -12
- package/dist/provider-web-search-contract-fields-CZpi7HIW.js +0 -38
- package/dist/provider-wizard-BlIgoAui.js +0 -166
- package/dist/providers.runtime-DUpqP3f8.js +0 -125
- package/dist/proxy-stream-wrappers-BBuH4e3Y.js +0 -480
- package/dist/push-apns-datkwHqM.js +0 -1061
- package/dist/pw-ai-ZAeid36y.js +0 -2268
- package/dist/qmd-manager-BFoyv6wl.js +0 -1799
- package/dist/qr-cli-CsVWBjvI.js +0 -359
- package/dist/qr-image-Clh1VoO8.js +0 -2
- package/dist/queue-D5a9w4iL.js +0 -636
- package/dist/realtime-provider-shared-CcJJy5LG.js +0 -21
- package/dist/realtime-transcription-provider-DJZBEHdh.js +0 -180
- package/dist/realtime-voice-provider-D_HLsBY-.js +0 -342
- package/dist/record-shared-CqhYuBoa.js +0 -10
- package/dist/refresh-CwNiDzvO.js +0 -115
- package/dist/region-FRlBzDc1.js +0 -74
- package/dist/register-command-groups-gxjHRBzB.js +0 -121
- package/dist/register.agent-QYak9Grv.js +0 -241
- package/dist/register.backup-BcFdIDsf.js +0 -234
- package/dist/register.configure-D20bnjIf.js +0 -15
- package/dist/register.maintenance-CFEcGADj.js +0 -443
- package/dist/register.message-CA_IJdMR.js +0 -601
- package/dist/register.migrate-CyHs2gyJ.js +0 -195
- package/dist/register.onboard-BTe7yt58.js +0 -83
- package/dist/register.runtime-CHJaT--O.js +0 -81
- package/dist/register.runtime-CjmIn42C.js +0 -343
- package/dist/register.setup-fcq_hZCH.js +0 -104
- package/dist/register.status-health-sessions-BBLhNnfs.js +0 -1211
- package/dist/register.subclis-BMKAZCX_.js +0 -232
- package/dist/register.subclis-JVDnA5Ih.js +0 -3
- package/dist/remote-env-2q04LuwQ.js +0 -12
- package/dist/repair-DNxJbWq8.js +0 -112
- package/dist/replay-policy-D4RdgaIZ.js +0 -10
- package/dist/replay-policy-DF668ume.js +0 -8
- package/dist/reply-Dp41LlFy.js +0 -3523
- package/dist/reply-payloads-DaWnvZFb.js +0 -78
- package/dist/reply-prefix-D_x6MM3Q.js +0 -33
- package/dist/reply.runtime-B3qMXkAa.js +0 -2
- package/dist/resolve-BxnY1Y0P.js +0 -280
- package/dist/restart-BTemxlpT.js +0 -454
- package/dist/restart-handoff-lV2xM09Z.js +0 -2
- package/dist/restart-health-CbsvDtnk.js +0 -2
- package/dist/restart-health-CvoNg6kT.js +0 -203
- package/dist/restart-stale-pids-DCtlWGBh.js +0 -529
- package/dist/retry-DSboRh9T.js +0 -76
- package/dist/retry-policy-CkDNftgh.js +0 -58
- package/dist/root-help-CbP63X2B.js +0 -44
- package/dist/route-reply-D4iLWqi8.js +0 -141
- package/dist/route-reply.runtime-DfhDlYwI.js +0 -2
- package/dist/rpc-BzxGDKQi.js +0 -61
- package/dist/rpc.runtime-B8npXano.js +0 -21
- package/dist/run-main-B_3B444F.js +0 -453
- package/dist/run-wait-DfwJbctd.js +0 -118
- package/dist/runner-Bq--JOxW.js +0 -1497
- package/dist/runs-B8BkTE5s.js +0 -495
- package/dist/runtime-9nd5Vnqo.js +0 -725
- package/dist/runtime-AzBVm8GH.js +0 -9
- package/dist/runtime-BsL8SByk.js +0 -253
- package/dist/runtime-Bt0p-8KG.js +0 -2
- package/dist/runtime-Czi9LJYu.js +0 -355
- package/dist/runtime-D4VTGXfu.js +0 -72
- package/dist/runtime-D4fBMloE.js +0 -200
- package/dist/runtime-DfBJ2CUS.js +0 -2
- package/dist/runtime-Di4Vh6yT2.js +0 -242
- package/dist/runtime-Gw1LMmF3.js +0 -191
- package/dist/runtime-api-38YAKTr3.js +0 -12
- package/dist/runtime-api-DVNSx5RM2.js +0 -2
- package/dist/runtime-api-DVxb5CCl.js +0 -3
- package/dist/runtime-cNtCXDff.js +0 -107
- package/dist/runtime-embedded-pi.runtime-Ca9Iylv7.js +0 -3
- package/dist/runtime-env-Clh0MW-d.js +0 -9
- package/dist/runtime-internal-D_EVbLoq.js +0 -2
- package/dist/runtime-model-auth.runtime-Db4xdojg.js +0 -39
- package/dist/runtime-plugins-CTXfWYb_.js +0 -69
- package/dist/runtime-prepare.runtime-C3ZR1iU5.js +0 -80
- package/dist/runtime-provider-DDeE81mK.js +0 -21
- package/dist/runtime-registry-loader-B2xOXVPK.js +0 -58
- package/dist/runtime-registry-loader-C5xxOfM0.js +0 -2
- package/dist/runtime-schema-Rce5jii6.js +0 -28383
- package/dist/runtime-shared-VTsPwExD.js +0 -249
- package/dist/runtime-taskflow-CHmtjSlF.js +0 -250
- package/dist/runtime-web-channel-plugin-DSXA1lnD.js +0 -215
- package/dist/runtime-web-tools-BBCJl629.js +0 -1467
- package/dist/runtime-web-tools-fallback.runtime-B2dwt38I.js +0 -9
- package/dist/sandbox-Bs4qtn7i.js +0 -4
- package/dist/sandbox-CwQ1zNXr.js +0 -2586
- package/dist/sandbox-cli-CFR4xMj0.js +0 -447
- package/dist/schtasks-jmQncr1-.js +0 -785
- package/dist/secrets-cli-D2MzNlq9.js +0 -2114
- package/dist/security-audit-MSBFxuZO.js +0 -34
- package/dist/security-cli-CyLFEXFK.js +0 -486
- package/dist/semantic-dedup-Bqflyeek.js +0 -95
- package/dist/send-D9izwSy3.js +0 -993
- package/dist/send-media-BjiwwtZH.js +0 -2123
- package/dist/server-DApOCk9r.js +0 -13
- package/dist/server-context-LZDbgxn5.js +0 -4164
- package/dist/server-methods-DLDI8rlu.js +0 -11827
- package/dist/server-middleware-B5ZNhGV1.js +0 -110
- package/dist/server-node-events-COo9ihwW.js +0 -451
- package/dist/server-wWM1a8y_.js +0 -77
- package/dist/server.impl-BhBceUhA.js +0 -19758
- package/dist/service-BI1Vz4Xe.js +0 -132
- package/dist/service-CHv4oM_x.js +0 -2
- package/dist/service-audit-DUt5vf5G.js +0 -254
- package/dist/service-audit-VJKA2Zjk.js +0 -2
- package/dist/session-BM6MJ_fx.js +0 -48
- package/dist/session-archive.runtime-6wxi7NBr.js +0 -2
- package/dist/session-conversation-CaxN7-m4.js +0 -27
- package/dist/session-cost-usage-CKgDTfyK.js +0 -2
- package/dist/session-cost-usage-rtoddk_D.js +0 -648
- package/dist/session-file-BaS8wO2e.js +0 -44
- package/dist/session-key-D12IZ26p.js +0 -65
- package/dist/session-meta-C7zPXGyf.js +0 -109
- package/dist/session-override-BWMnmq9K.js +0 -103
- package/dist/session-reset-model.runtime-BJekjjZ1.js +0 -120
- package/dist/session-reset-service-Clx7kNoI.js +0 -474
- package/dist/session-subagent-reactivation.runtime-B5VMaUf4.js +0 -2
- package/dist/session-system-events-DqUwf4D8.js +0 -63
- package/dist/session-tab-registry-a-_FAPhD.js +0 -553
- package/dist/session-updates-jTsbd65U.js +0 -234
- package/dist/session-updates.runtime-CJs2Wmpc.js +0 -2
- package/dist/session-utils-HYCaRwDS.js +0 -930
- package/dist/session-utils.fs-CYcamwPP.js +0 -537
- package/dist/sessions-D-EL9xre.js +0 -2
- package/dist/sessions-DFZL16O4.js +0 -45
- package/dist/sessions-FoJWLJgu.js +0 -226
- package/dist/sessions.runtime-DHIyM7E1.js +0 -2
- package/dist/setup-BQ53YXTC.js +0 -500
- package/dist/setup-Dm1kEe1b.js +0 -15
- package/dist/setup-DuAMFbAI.js +0 -329
- package/dist/setup-binary-BJMUy4FP.js +0 -2
- package/dist/setup-surface-D-In43nb.js +0 -586
- package/dist/setup-tools-B1DDAQcl.js +0 -4
- package/dist/setup-wizard-proxy-CXecAj2f.js +0 -139
- package/dist/setup.finalize-BSDCkR15.js +0 -436
- package/dist/setup.gateway-config-BKiYKvWk.js +0 -246
- package/dist/shared-Bzi2E64E.js +0 -218
- package/dist/shared-CIgFLTPv.js +0 -127
- package/dist/shared-CQhbwWcx.js +0 -219
- package/dist/shared-DP3EPmNx.js +0 -137
- package/dist/shared-GP6OsDGm.js +0 -224
- package/dist/shared-Kg0ysUjM.js +0 -175
- package/dist/shared-runtime-C857iT_Z.js +0 -7
- package/dist/shared-wJu1HSpr.js +0 -36
- package/dist/short-term-promotion-NMHC7sF-.js +0 -1631
- package/dist/simple-completion-runtime-CODXf2KQ.js +0 -131
- package/dist/simple-completion-transport-BqHYWL_H.js +0 -32
- package/dist/skill-commands-n4P37TTT.js +0 -82
- package/dist/skill-commands.runtime-euFmRZmn.js +0 -2
- package/dist/skill-lifecycle-ChEI3HEu.js +0 -105
- package/dist/skill-quality-gate-DYGJHgD_.js +0 -127
- package/dist/skill-usage-tracker-DOTutd6c.js +0 -31
- package/dist/skills-CDbNigal.js +0 -4
- package/dist/skills-CyZVptCK.js +0 -1075
- package/dist/skills-cli-QKIPu7mf.js +0 -382
- package/dist/skills-install-C_wDr3Yn.js +0 -822
- package/dist/skills-status-CRAMSqYC.js +0 -170
- package/dist/skills-status-Cidl9y_f.js +0 -2
- package/dist/soul-cli-BLzmjdCC.js +0 -110
- package/dist/speech-core-D6gbwLzS.js +0 -126
- package/dist/speech-provider-B9cT4Gjm.js +0 -39
- package/dist/speech-provider-BWGp5zle.js +0 -103
- package/dist/speech-provider-BraysNbH.js +0 -167
- package/dist/speech-provider-CZSo12LO.js +0 -101
- package/dist/speech-provider-ccV7I8Ix.js +0 -182
- package/dist/speech-provider-fldQqtyB.js +0 -184
- package/dist/ssh-tunnel-dSVKikW0.js +0 -159
- package/dist/ssh-tunnel-tfx0yANN.js +0 -2
- package/dist/ssrf-runtime-CGgU7d_A.js +0 -6
- package/dist/stage-sandbox-media.runtime-BFJ3cI5E.js +0 -230
- package/dist/standalone-generate-BKcScCKr.js +0 -217
- package/dist/standalone-generate-yEOzazHq.js +0 -2
- package/dist/startup-auth-DMhNYQWZ.js +0 -151
- package/dist/state-dir-env-Lo02ozFZ.js +0 -156
- package/dist/state-migrations-Dh_7NcB_.js +0 -823
- package/dist/status-BHNQZCLW.js +0 -2
- package/dist/status-BLL9siSW.js +0 -3
- package/dist/status-DEDZAhkE.js +0 -473
- package/dist/status-Dx7ATP7d.js +0 -278
- package/dist/status-Dy-2gjX4.js +0 -2
- package/dist/status-DyESaQIF.js +0 -399
- package/dist/status-all-Df45B-IL.js +0 -495
- package/dist/status-json-D4OQ-0cB.js +0 -14
- package/dist/status-json-command-BF5Ubpet.js +0 -92
- package/dist/status-pEsGMlCT.js +0 -500
- package/dist/status-runtime-shared-DBFbh_4j.js +0 -271
- package/dist/status.agent-local-DaJwHpO-.js +0 -58
- package/dist/status.command.text-runtime-DL5JjKUM.js +0 -15
- package/dist/status.format-BB7s3jni.js +0 -60
- package/dist/status.gateway-connection.runtime-DWgn4d1k.js +0 -2
- package/dist/status.gateway-probe-BpvLQ-KZ.js +0 -16
- package/dist/status.link-channel-DBwS2rj0.js +0 -35
- package/dist/status.node-mode-B7rN-_mc.js +0 -32
- package/dist/status.node-mode-CiGZWgis.js +0 -2
- package/dist/status.scan-BCSiOHpj.js +0 -62
- package/dist/status.scan-overview-CWvqkRRi.js +0 -395
- package/dist/status.scan.deps.runtime-OxqqgpNN.js +0 -18
- package/dist/status.scan.fast-json-At2BL9pr.js +0 -128
- package/dist/status.scan.fast-json-DUKoMAxG.js +0 -2
- package/dist/status.scan.runtime-CPzkdkBL.js +0 -417
- package/dist/status.summary-BJOdPDru.js +0 -209
- package/dist/status.summary-DRHwbpBE.js +0 -2
- package/dist/status.update-D0v2dhjh.js +0 -2
- package/dist/status.update-fG9weCeY.js +0 -79
- package/dist/store-CnbV_v4i.js +0 -1075
- package/dist/store-DEH_mAUq.js +0 -421
- package/dist/store-UtXO-V4U.js +0 -1112
- package/dist/store-wIjWeFYl.js +0 -296
- package/dist/store.runtime-CDPwlRWv.js +0 -2
- package/dist/stream-Cj2d1y0c.js +0 -129
- package/dist/stream-CxHR78zN.js +0 -26
- package/dist/stream-DBSqjZK_.js +0 -153
- package/dist/stream-DnQfYsj6.js +0 -27
- package/dist/stream-W2dOHnSg.js +0 -76
- package/dist/stream-pDP7GUBb.js +0 -649
- package/dist/stream-wrappers-BRVvwnDu.js +0 -144
- package/dist/strip-inbound-meta-BltI8kVf.js +0 -155
- package/dist/subagent-announce.registry.runtime-BH63IC3w.js +0 -3
- package/dist/subagent-control-Cy2-30UQ.js +0 -485
- package/dist/subagent-followup.runtime-Bv4Ek4Am.js +0 -68
- package/dist/subagent-list-Wz1QeiD7.js +0 -168
- package/dist/subagent-orphan-recovery-Dc03y0FO.js +0 -214
- package/dist/subagent-registry-I3k-o-Nd.js +0 -2889
- package/dist/subagent-registry-read-C8xgeh3J.js +0 -57
- package/dist/subagent-registry-runtime-B8EcVp4z.js +0 -2
- package/dist/subagent-registry.runtime-J1wFiENA.js +0 -3
- package/dist/subagent-spawn-B_YkzMDM.js +0 -782
- package/dist/subagents-format-mYISVAR0.js +0 -629
- package/dist/subcli-descriptors-BcYaj0tK.js +0 -174
- package/dist/supervisor-eA5CZ9ni.js +0 -737
- package/dist/system-cli-Bmr6iKmB.js +0 -60
- package/dist/system-prompt-C414pRhO.js +0 -2
- package/dist/system-prompt-T5mXJ7TP.js +0 -711
- package/dist/system-prompt-cache-boundary-NtELRwVL.js +0 -25
- package/dist/system-run-command-DKJXglyj.js +0 -300
- package/dist/systemd-CuaTSaBa.js +0 -591
- package/dist/systemd-hints-B_h09Mzm.js +0 -76
- package/dist/systemd-linger-DE_Fg46b.js +0 -68
- package/dist/systemd-linger-Mr1QtLLn.js +0 -2
- package/dist/tables-DFdELq_3.js +0 -832
- package/dist/tailscale-status-PTtL7jnj.js +0 -72
- package/dist/targets-CNCX90Yv.js +0 -595
- package/dist/targets-CRHINrER.js +0 -300
- package/dist/targets.runtime-NhznjXPy.js +0 -2
- package/dist/task-executor-esRPaf9b.js +0 -350
- package/dist/task-owner-access-DrWYhRWd.js +0 -48
- package/dist/task-registry-99Z_Z9h2.js +0 -2346
- package/dist/task-registry-control.runtime-B6ince9b.js +0 -3
- package/dist/task-registry-delivery-runtime-CvNHgv_t.js +0 -2
- package/dist/task-registry-delivery-runtime-DvtrlNwu.js +0 -3
- package/dist/task-registry.maintenance-BYQsqVxN.js +0 -425
- package/dist/task-registry.maintenance-ZYzfHTTq.js +0 -2
- package/dist/test.DNmyFkvJ-k8NJ4Bmh.js +0 -13549
- package/dist/testing-D_bofHRA.js +0 -441
- package/dist/text-report-CkkKmBEq.js +0 -587
- package/dist/text-runtime-mBCqEES4.js +0 -313
- package/dist/thread-bindings-iTrRkLzQ.js +0 -223
- package/dist/tool-auth-shared-D-QPgeom.js +0 -53
- package/dist/tool-config-shared-D6_m3gGr.js +0 -19
- package/dist/tool-schema-runtime-B_exwg7V.js +0 -1892
- package/dist/tools-DOCf-D1O.js +0 -110
- package/dist/tools-effective-inventory-ByTHgwZ3.js +0 -152
- package/dist/tools.runtime-B91t6gA1.js +0 -4
- package/dist/transcript-0fLDbW8-.js +0 -222
- package/dist/transcript-B0nNP1bi.js +0 -191
- package/dist/transcript-DQsKeQyR.js +0 -2
- package/dist/transcript.runtime-CsPaloHz.js +0 -2
- package/dist/transport-policy-BFNf1-9h.js +0 -75
- package/dist/transport-ready-CjD7QFVT.js +0 -36
- package/dist/tts-BKZmS4xr.js +0 -40
- package/dist/tts-Br2otWLy.js +0 -31
- package/dist/tts.runtime-pJ42sd4M.js +0 -3
- package/dist/tui-Dvbh1BOb.js +0 -4018
- package/dist/tui-cli-frG91oxp.js +0 -31
- package/dist/typing-mode-BueK7uiv.js +0 -84
- package/dist/undici-global-dispatcher-eRWmqD02.js +0 -99
- package/dist/uninstall-CQxsblrz.js +0 -172
- package/dist/update-CqprWvFy.js +0 -1253
- package/dist/update-check-JM7VVIJX.js +0 -431
- package/dist/update-cli-4oFlMshW.js +0 -1779
- package/dist/update-runner-BLsea7TF.js +0 -1492
- package/dist/usage-AvsukxPf.js +0 -71
- package/dist/usage-format-CxKKzsv8.js +0 -2
- package/dist/usage-format-DVbAh1EI.js +0 -507
- package/dist/utils-BwORcPSF.js +0 -189
- package/dist/video-generation-D4NjX7OM.js +0 -167
- package/dist/video-generation-provider-B6dkZGU2.js +0 -171
- package/dist/video-generation-provider-BIqnhibW.js +0 -263
- package/dist/video-generation-provider-BfUmxHum.js +0 -233
- package/dist/video-generation-provider-C2FSvm96.js +0 -181
- package/dist/video-generation-provider-C_fy5kYb.js +0 -240
- package/dist/video-generation-provider-Cqvdmy-7.js +0 -104
- package/dist/video-generation-provider-Cr5dQ5-Y.js +0 -77
- package/dist/video-generation-provider-DZF-F5Ao.js +0 -64
- package/dist/video-generation-provider-PuCcXFdo.js +0 -227
- package/dist/video-generation-provider-e-M9VqII.js +0 -246
- package/dist/video-http-CqiFyKro.js +0 -29
- package/dist/video-model-catalog-Dujyv6aJ.js +0 -187
- package/dist/web-fetch-providers.runtime-ayN9rZBJ.js +0 -33
- package/dist/web-media-B770i-06.js +0 -2
- package/dist/web-media-CfbPpWDK.js +0 -330
- package/dist/web-search-C2oRdo-K.js +0 -221
- package/dist/web-search-provider-ChE5ssV7.js +0 -155
- package/dist/web-search-provider-common-DxHMfm5S.js +0 -206
- package/dist/web-search-provider-config-DopQHA3M.js +0 -52
- package/dist/web-search-providers.runtime-Co-XwN8c.js +0 -206
- package/dist/web-shared-BQmfD1uO.js +0 -414
- package/dist/webhooks-cli-BPynigdk.js +0 -321
- package/dist/workspace-BbNiOKCq.js +0 -306
- package/dist/x-search-shared-B6nTB07f.js +0 -109
- /package/dist/{account-lookup-44DR0qFz.js ā account-lookup-DvZ7IbyB.js} +0 -0
- /package/dist/{api-Bscnsaay.js ā api-o6w96t-n.js} +0 -0
- /package/dist/{audit-channel.collect.runtime-BAK_7igU.js ā audit-channel.collect.runtime-CmRt-Vtg.js} +0 -0
- /package/dist/{audit-log-BDrZBg3k.js ā audit-log-C8AUJlPm.js} +0 -0
- /package/dist/{auth-choice-legacy-CYu9EVM5.js ā auth-choice-legacy-DBeZmOvF.js} +0 -0
- /package/dist/{auth-surface-resolution-CPk6looU.js ā auth-surface-resolution-8mDG-EDa.js} +0 -0
- /package/dist/{backoff-CoEL_G0O.js ā backoff-D10eQVn6.js} +0 -0
- /package/dist/{block-reply-pipeline-CP-hIXtp.js ā block-reply-pipeline-BFCpQM1A.js} +0 -0
- /package/dist/{channel-account-context-ChXT_QXz.js ā channel-account-context-CLJUy3h3.js} +0 -0
- /package/dist/{channel-options-Gu8RxE7y.js ā channel-options-BiNEyim3.js} +0 -0
- /package/dist/{channel-plugin-ids-Cdh34d9L.js ā channel-plugin-ids-C_TPz1Uu.js} +0 -0
- /package/dist/{channel-selection.runtime-Dh6-3MJD.js ā channel-selection.runtime-DxtxDaqe.js} +0 -0
- /package/dist/{channels-status-issues-nqyQ0Evv.js ā channels-status-issues-DZCoj3wt.js} +0 -0
- /package/dist/{chat-envelope-C8CaVGEc.js ā chat-envelope-C14DhfdY.js} +0 -0
- /package/dist/{chat-message-content-BmiUVjys.js ā chat-message-content-N9aXPKj0.js} +0 -0
- /package/dist/{close-reason-DgNNQTUr.js ā close-reason-BUP99WO2.js} +0 -0
- /package/dist/{cognitive-delivery-BQ21zS8V.js ā cognitive-delivery-2v98ODTY.js} +0 -0
- /package/dist/{command-poll-backoff.runtime-BS9_DhCh.js ā command-poll-backoff.runtime-CT-as2yH.js} +0 -0
- /package/dist/{command-registration-policy-CBGSxVcp.js ā command-registration-policy-Cic6BBCo.js} +0 -0
- /package/dist/{commands-H3Ab0eU8.js ā commands-BNMz19sX.js} +0 -0
- /package/dist/{config-xqDcwygz.js ā config-Cf9PwxU0.js} +0 -0
- /package/dist/{config-value-DrQEX08M.js ā config-value-CFTkgtE_.js} +0 -0
- /package/dist/{consolidation-userid-CWW9Rg3G.js ā consolidation-userid-BIPR4Xb3.js} +0 -0
- /package/dist/{context-builder-Bf6cYQGQ.js ā context-builder-qhLwO35b.js} +0 -0
- /package/dist/{context-manifest-AkIidQ_d.js ā context-manifest-DJgFhmvf.js} +0 -0
- /package/dist/{control-ui-shared-upny-T3O.js ā control-ui-shared-Bdc3sIMw.js} +0 -0
- /package/dist/{dangerous-tools-GRkSUsw5.js ā dangerous-tools-Bh7pfw4x.js} +0 -0
- /package/dist/{defaults-CkfIX_lg.js ā defaults-DW-KEml1.js} +0 -0
- /package/dist/{detect-binary-BF7GWFFn.js ā detect-binary-DykWiFpV.js} +0 -0
- /package/dist/{device-auth-ChMjC2OY.js ā device-auth-Co78c3Fk.js} +0 -0
- /package/dist/{device-identity-CnWSzhCW.js ā device-identity-BbqzkeXB.js} +0 -0
- /package/dist/{device-metadata-normalization-BCk_oevU.js ā device-metadata-normalization-_VVweA-R.js} +0 -0
- /package/dist/{directive-tags-C-tVOPf_.js ā directive-tags-DISVLDCp.js} +0 -0
- /package/dist/{dotenv-B0Ninvzt.js ā dotenv-BVFKHTQc.js} +0 -0
- /package/dist/{exec-approvals-effective-8HnjEtIL.js ā exec-approvals-effective-CLbTYTav.js} +0 -0
- /package/dist/{exec-file-CMG8z0ly.js ā exec-file-CJGGCNuX.js} +0 -0
- /package/dist/{extractor-zuZXdT3R.js ā extractor-BB1zo9Wy.js} +0 -0
- /package/dist/{fallback-state-DxOz1LA0.js ā fallback-state-DcYqyCEy.js} +0 -0
- /package/dist/{fetch-timeout-BAjBTvFf.js ā fetch-timeout-BCovYv8d.js} +0 -0
- /package/dist/{fingerprint-vRPYSVrE.js ā fingerprint-Dl8U2WD6.js} +0 -0
- /package/dist/{fragment-types-DaQY3JTf.js ā fragment-types-D5gnAz5U.js} +0 -0
- /package/dist/{frontmatter-CtMG8SHH.js ā frontmatter-BlXOniKN.js} +0 -0
- /package/dist/{gateway-presence-C9CVPS3M.js ā gateway-presence-BOHdope3.js} +0 -0
- /package/dist/{gaxios-fetch-compat-C7uLN0yt.js ā gaxios-fetch-compat-DBQ2FOTr.js} +0 -0
- /package/dist/{git-commit-BlgTui6o.js ā git-commit-C0NqDaJx.js} +0 -0
- /package/dist/{groups.runtime-CDspPvbm.js ā groups.runtime-Biyz6BVj.js} +0 -0
- /package/dist/{health-format-Dr-28EXc.js ā health-format-BAdMOv0G.js} +0 -0
- /package/dist/{helpers-CbJsWCnj.js ā helpers-2xO4B-57.js} +0 -0
- /package/dist/{hooks-policy-Dx4ZMX1n.js ā hooks-policy-Co4GDvwp.js} +0 -0
- /package/dist/{identity-BtgZsd-F.js ā identity-Dplh_aWR.js} +0 -0
- /package/dist/{includes-scan-dP1_GHm1.js ā includes-scan-DQ58cU6W.js} +0 -0
- /package/dist/{info-scan-source-B7go_Oc2.js ā info-scan-source-CJZU0g-3.js} +0 -0
- /package/dist/{input-provenance-CqVg_UvP.js ā input-provenance-DXlFriXS.js} +0 -0
- /package/dist/{install-target-CEzsONC0.js ā install-target-BePL4Kza.js} +0 -0
- /package/dist/{installs-TINOTdOb.js ā installs-6mOb-tQ-.js} +0 -0
- /package/dist/{ipv4-Crsp1rWd.js ā ipv4-CTuRjRc8.js} +0 -0
- /package/dist/{issue-format-BJCe7wW8.js ā issue-format-CxtLa4Cu.js} +0 -0
- /package/dist/{json-mode-KT6243ws.js ā json-mode-7wpPHQL6.js} +0 -0
- /package/dist/{kaijibot.plugin-DO7iROUw.js ā kaijibot.plugin-DlbL2Ru2.js} +0 -0
- /package/dist/{kill-tree-cyGT7uvN.js ā kill-tree-DCyfVQx0.js} +0 -0
- /package/dist/{lib-Ml3xh0LZ.js ā lib-D8A9tlN-.js} +0 -0
- /package/dist/{lifecycle-DaUmjkGK.js ā lifecycle-lZ5BtT_X.js} +0 -0
- /package/dist/{llm-key-probe-taLN8k5G.js ā llm-key-probe-DEQ2jygx.js} +0 -0
- /package/dist/{magic-string.es-CFjqKY18.js ā magic-string.es-NXfdbfy9.js} +0 -0
- /package/dist/{model-auth-markers-CrDTQj4i.js ā model-auth-markers-BR92KCie.js} +0 -0
- /package/dist/{model-auth-runtime-shared-Dlg_9I8x.js ā model-auth-runtime-shared-7sMIRCy3.js} +0 -0
- /package/dist/{model-definitions-DUm9_cBo.js ā model-definitions-DTmWdph5.js} +0 -0
- /package/dist/{model-id-ClMKKyMX.js ā model-id-josvS7_f.js} +0 -0
- /package/dist/{model-param-b-C1zLPOVI.js ā model-param-b-BA2a8ys5.js} +0 -0
- /package/dist/{models-C6zeLda-.js ā models-DafdVx4b.js} +0 -0
- /package/dist/{number-coercion-D1JCit9l.js ā number-coercion-Cmu1aJr8.js} +0 -0
- /package/dist/{oauth-refresh-failure-Bm7PU-lI.js ā oauth-refresh-failure-D4qLGlz9.js} +0 -0
- /package/dist/{onboard-DxdyhKkv.js ā onboard-BQDmoIfO.js} +0 -0
- /package/dist/{onboard-z2i2uWin.js ā onboard-DQ3NotUx.js} +0 -0
- /package/dist/{onboard-config-D6HSppfR.js ā onboard-config-BaBypGxb.js} +0 -0
- /package/dist/{openclaw-migrator-U-BFS_Y3.js ā openclaw-migrator-DDJDf_fP.js} +0 -0
- /package/dist/{package-update-utils-CPAScCHs.js ā package-update-utils-CriM_ABA.js} +0 -0
- /package/dist/{parse-log-line-CC2WEGwM.js ā parse-log-line-BGXLvgmK.js} +0 -0
- /package/dist/{path-env-D0YqoJmh.js ā path-env-BqQ62jS8.js} +0 -0
- /package/dist/{persona-change-source-DPNY1vyZ.js ā persona-change-source-BayRH7Yd.js} +0 -0
- /package/dist/{plugin-approvals-D2nSmWGQ.js ā plugin-approvals-BVOH9uWd.js} +0 -0
- /package/dist/{plugin-web-search-config-CM7ac77h.js ā plugin-web-search-config-Vy4SBasR.js} +0 -0
- /package/dist/{ports-lsof-rC3_YG8t.js ā ports-lsof-C7nTF2Et.js} +0 -0
- /package/dist/{ports-probe-CKr2RdYw.js ā ports-probe-BFA3MD3-.js} +0 -0
- /package/dist/{preference-learner-D-x6hOZc.js ā preference-learner-BDRd2YZ7.js} +0 -0
- /package/dist/{probe-target-BCTuiZqm.js ā probe-target-LcJauh0W.js} +0 -0
- /package/dist/{program-context-beQs52o_.js ā program-context-B3G__AI_.js} +0 -0
- /package/dist/{prompt-cache-stability-DdwE3HeP.js ā prompt-cache-stability-CgXAu47S.js} +0 -0
- /package/dist/{prompt-style-BCo80D6m.js ā prompt-style-BCVDnx1C.js} +0 -0
- /package/dist/{provider-auth-choice-helpers-iOfeFAnv.js ā provider-auth-choice-helpers-wXOAgzFT.js} +0 -0
- /package/dist/{provider-catalog-Cj1om2Fk.js ā provider-catalog-CFmQ4vw9.js} +0 -0
- /package/dist/{provider-catalog-CjqnxOnp.js ā provider-catalog-CSp5wIkO.js} +0 -0
- /package/dist/{provider-discovery-RmybjjET.js ā provider-discovery-DfcBjamA.js} +0 -0
- /package/dist/{provider-model-compat-CsF2NGa6.js ā provider-model-compat-DfOMY_2L.js} +0 -0
- /package/dist/{provider-oauth-flow-Dyp5m-iG.js ā provider-oauth-flow-BlUhVfpW.js} +0 -0
- /package/dist/{qa-cli-Czvxw_Gf.js ā qa-cli-DNHouwrc.js} +0 -0
- /package/dist/{register.android-install-CFC21hJx.js ā register.android-install-BKTH5mXO.js} +0 -0
- /package/dist/{reply-payloads-dedupe.runtime-CQRYt4cT.js ā reply-payloads-dedupe.runtime-Y6x_m1r3.js} +0 -0
- /package/dist/{resolve-CziruFEe.js ā resolve-B-YGj7MS.js} +0 -0
- /package/dist/{responses-tool-shared-DQ-w_2Ok.js ā responses-tool-shared-Bp63wGvZ.js} +0 -0
- /package/dist/{restart-handoff-B3HMjoAC.js ā restart-handoff-CUig5xgo.js} +0 -0
- /package/dist/{root-help-metadata-B56QuaDg.js ā root-help-metadata-DKln3V98.js} +0 -0
- /package/dist/{runtime-manifest.runtime-DgzvTWxI.js ā runtime-manifest.runtime-BMhOQl1D.js} +0 -0
- /package/dist/{runtime-parse-D4az8KIY.js ā runtime-parse-DYEtqXT6.js} +0 -0
- /package/dist/{runtime-status-Di5Hf2P6.js ā runtime-status-Cph8qA_2.js} +0 -0
- /package/dist/{runtime-web-tools-manifest.runtime-9Feh8w--.js ā runtime-web-tools-manifest.runtime-C9TRV0jQ.js} +0 -0
- /package/dist/{runtime-web-tools-public-artifacts.runtime-CBOtSULk.js ā runtime-web-tools-public-artifacts.runtime-Pll_c9Y7.js} +0 -0
- /package/dist/{schedule-Cc2eXy4A.js ā schedule-Dbhedkt2.js} +0 -0
- /package/dist/{schtasks-exec-BgQqxhbL.js ā schtasks-exec-wK5FEC9N.js} +0 -0
- /package/dist/{secret-file-_eFsf9j0.js ā secret-file-Da3YlfBp.js} +0 -0
- /package/dist/{session-fork.runtime-Jwj0bXs7.js ā session-fork.runtime-B_FyKI81.js} +0 -0
- /package/dist/{session-transcript-files.fs-CTjDzbyc.js ā session-transcript-files.fs-98DIXUOq.js} +0 -0
- /package/dist/{setup.plugin-config-CyzblkGd.js ā setup.plugin-config-DicRLpNt.js} +0 -0
- /package/dist/{setup.secret-input-K_qSH6id.js ā setup.secret-input-_xfjuFpR.js} +0 -0
- /package/dist/{skill-draft-generator-BdEjPAqk.js ā skill-draft-generator-CEnZCApW.js} +0 -0
- /package/dist/{skill-reviewer-YJgdYe4X.js ā skill-reviewer-BJ0eED6E.js} +0 -0
- /package/dist/{skill-scanner-BVHCxyxt.js ā skill-scanner-4eRxi2qj.js} +0 -0
- /package/dist/{skill-writer-CrrWOMGT.js ā skill-writer-CGbRGRnJ.js} +0 -0
- /package/dist/{ssh-config-BU3F9f2c.js ā ssh-config-Bq3o6jik.js} +0 -0
- /package/dist/{status-config-UwTO8Wvv.js ā status-config-oMZ_A68q.js} +0 -0
- /package/dist/{store-DK_u7Vxr.js ā store-BqlEtQMW.js} +0 -0
- /package/dist/{store-VNDZK044.js ā store-xR8gNpX6.js} +0 -0
- /package/dist/{subagent-followup-hints-BlYKyyQ0.js ā subagent-followup-hints-DUbpIh2D.js} +0 -0
- /package/dist/{subagent-registry-state-zLMA_MzM.js ā subagent-registry-state-CjRrrVgp.js} +0 -0
- /package/dist/{subagent-session-metrics-BgoCTpFX.js ā subagent-session-metrics-8IQoh3DH.js} +0 -0
- /package/dist/{supervisor-log.runtime-D53IonaD.js ā supervisor-log.runtime-DTqzZ8Bv.js} +0 -0
- /package/dist/{table-CeEBFHtM.js ā table-BUbO1fqP.js} +0 -0
- /package/dist/{targets-DOJmrCN8.js ā targets-uT1GHLfz.js} +0 -0
- /package/dist/{task-registry.audit.shared-DPSVqAxg.js ā task-registry.audit.shared-BvC-fQTz.js} +0 -0
- /package/dist/{text-similarity-CII8oAS-.js ā text-similarity-ckJcEBCN.js} +0 -0
- /package/dist/{thread-info-BvQiu1xr.js ā thread-info-DjVKrfI6.js} +0 -0
- /package/dist/{tokens-DIzGgGwL.js ā tokens-CB2-NTu5.js} +0 -0
- /package/dist/{transcript-events-BC4_m8-c.js ā transcript-events-B4kB35M0.js} +0 -0
- /package/dist/{transcript-mirror-BlMhpuHP.js ā transcript-mirror-BQwPaEwA.js} +0 -0
- /package/dist/{trust-calculator-BebDau66.js ā trust-calculator-ehG2IihQ.js} +0 -0
- /package/dist/{tts.runtime-DBX6LFeO.js ā tts.runtime-Bgfon7Cb.js} +0 -0
- /package/dist/{types-D-x2Rbid.js ā types-DvE7xIVm.js} +0 -0
- /package/dist/{widearea-dns-atdAOupV.js ā widearea-dns-BFgpZSmq.js} +0 -0
- /package/dist/{wsl-DQ0RgjjQ.js ā wsl-084fnhGP.js} +0 -0
- /package/dist/{x-search-tool-shared-DX-6O1NP.js ā x-search-tool-shared-BKwKoAM7.js} +0 -0
- /package/dist/{zod-parse-Cu9hgbVC.js ā zod-parse-DRCmgWgX.js} +0 -0
|
@@ -0,0 +1,3762 @@
|
|
|
1
|
+
import { i as normalizeLowercaseStringOrEmpty, o as normalizeOptionalLowercaseString, s as normalizeOptionalString } from "./string-coerce-xZwG7Dq8.js";
|
|
2
|
+
import { r as formatErrorMessage } from "./errors-Ez4cKI2Y.js";
|
|
3
|
+
import { m as resolveUserPath, r as clampInt } from "./utils-C8dt4mi-.js";
|
|
4
|
+
import { s as normalizeStringEntries } from "./string-normalization-BlAM8fvN.js";
|
|
5
|
+
import { C as normalizeChannelId, _ as GATEWAY_CLIENT_NAMES, d as normalizeMessageChannel, g as GATEWAY_CLIENT_MODES, o as isInternalMessageChannel } from "./message-channel-DOJZxe6w.js";
|
|
6
|
+
import { d as resolveResponseUsageMode, l as normalizeUsageDisplay, o as normalizeFastMode } from "./thinking.shared-lXIMjxJI.js";
|
|
7
|
+
import { p as resolveDefaultModelForAgent } from "./model-selection-Bq91MzO2.js";
|
|
8
|
+
import { t as clearPluginManifestRegistryCache } from "./manifest-registry-DXkSaKeF.js";
|
|
9
|
+
import { r as normalizeOptionalAccountId } from "./account-id-QKaaEf0c.js";
|
|
10
|
+
import { a as resolveAgentDir, v as resolveSessionAgentId, y as resolveSessionAgentIds } from "./agent-scope-z3lpbLWu.js";
|
|
11
|
+
import { r as logVerbose } from "./globals-CwigADVM.js";
|
|
12
|
+
import { A as setConfigOverride, F as unsetConfigValueAtPath, M as getConfigValueAtPath, N as parseConfigPath, O as getConfigOverrides, P as setConfigValueAtPath, S as validateConfigObjectWithPlugins, g as writeConfigFile, j as unsetConfigOverride, k as resetConfigOverrides, u as readConfigFileSnapshot } from "./io-Bz-M35LC.js";
|
|
13
|
+
import { i as normalizeChannelId$1, t as getChannelPlugin } from "./registry-oQjdISx1.js";
|
|
14
|
+
import { t as parseDurationMs } from "./parse-duration-Bjee977D.js";
|
|
15
|
+
import "./config-DuLfQQvE.js";
|
|
16
|
+
import { n as resolveChannelApprovalCapability } from "./plugins-Dvy8KJPp.js";
|
|
17
|
+
import { n as createInternalHookEvent, p as triggerInternalHook } from "./internal-hooks-kuG4QrrP.js";
|
|
18
|
+
import { c as updateSessionStore } from "./store-D_vXZ7m9.js";
|
|
19
|
+
import "./sessions-CyYVTseV.js";
|
|
20
|
+
import { i as resolveSessionFilePathOptions, n as resolveDefaultSessionStorePath, r as resolveSessionFilePath } from "./paths-DrQr2my6.js";
|
|
21
|
+
import { a as resolveFreshSessionTotalTokens } from "./types-BCUhyLRe.js";
|
|
22
|
+
import { t as loadSessionStore } from "./store-load-5DAj5ABj.js";
|
|
23
|
+
import { r as isRestartEnabled, t as isCommandFlagEnabled } from "./commands-BNMz19sX.js";
|
|
24
|
+
import { t as ensureKaijiBotModelsJson } from "./models-config-BLMZzgfx.js";
|
|
25
|
+
import { t as requireApiKey } from "./model-auth-runtime-shared-7sMIRCy3.js";
|
|
26
|
+
import { a as discoverModels, i as discoverAuthStorage } from "./pi-model-discovery-B9q9ykaA.js";
|
|
27
|
+
import { B as createKaijiBotCodingTools, J as createExecTool } from "./compact-DEsHFhEL.js";
|
|
28
|
+
import { i as formatUsd, r as formatTokenCount } from "./usage-format-DQTT4pqY.js";
|
|
29
|
+
import { n as stripInboundMetadata } from "./strip-inbound-meta-BSHFFiJd.js";
|
|
30
|
+
import { t as diag } from "./diagnostic-BLwuJXPT.js";
|
|
31
|
+
import { S as setTtsProvider, _ as setLastTtsAttempt, a as getTtsMaxLength, b as setTtsEnabled, c as isTtsEnabled, h as resolveTtsPrefsPath, i as getResolvedSpeechProviderConfig, l as isTtsProviderConfigured, m as resolveTtsConfig, n as buildTtsSystemPromptHint, o as getTtsProvider, r as getLastTtsAttempt, s as isSummarizationEnabled, v as setSummarizationEnabled, w as textToSpeech, x as setTtsMaxLength } from "./tts-CLcD9M9-.js";
|
|
32
|
+
import { i as resolveBootstrapContextForRun } from "./bootstrap-files-DsmC0cJP.js";
|
|
33
|
+
import { g as resolveBootstrapMaxChars, v as resolveBootstrapTotalMaxChars } from "./pi-embedded-helpers-y7PopKx-.js";
|
|
34
|
+
import { n as resolveSandboxRuntimeStatus } from "./runtime-status-BGBO_3JB.js";
|
|
35
|
+
import "./thinking-CHPwc2Q0.js";
|
|
36
|
+
import { r as getApiKeyForModel } from "./model-auth-BQpkMtoP.js";
|
|
37
|
+
import { x as stripToolResultDetails } from "./tool-schema-runtime-DZsW_KR4.js";
|
|
38
|
+
import { i as unsetConfiguredMcpServer, r as setConfiguredMcpServer, t as listConfiguredMcpServers } from "./mcp-config-CY_3tJVi.js";
|
|
39
|
+
import { J as getSession, q as getFinishedSession, r as getRemoteSkillEligibility, t as canExecRequestNode } from "./exec-defaults-B5egc-6t.js";
|
|
40
|
+
import { r as callGateway } from "./call-k_nZXTJ3.js";
|
|
41
|
+
import { i as resolveReplyToMode } from "./reply-threading-WuEtpU4C.js";
|
|
42
|
+
import { b as formatConfigWriteDeniedMessageShared, v as authorizeConfigWriteShared, x as resolveConfigWriteTargetFromPathShared, y as canBypassConfigWritePolicyShared } from "./channel-config-helpers-BO9yY1Zu.js";
|
|
43
|
+
import { t as formatDurationCompact } from "./format-duration-B0hjKqUJ.js";
|
|
44
|
+
import { l as triggerKaijiBotRestart, o as scheduleGatewaySigusr1Restart } from "./restart-C0QhPXk1.js";
|
|
45
|
+
import { n as formatTaskStatusDetail, r as formatTaskStatusTitle, t as buildTaskStatusSnapshot } from "./task-status-DDGIH7lj.js";
|
|
46
|
+
import { i as clearSessionQueues } from "./queue-BveCZpTb.js";
|
|
47
|
+
import { r as getSessionBindingService } from "./session-binding-service-BdDm07I2.js";
|
|
48
|
+
import { h as replyRunRegistry, i as getActiveEmbeddedRunSnapshot, t as abortEmbeddedPiRun } from "./runs-CEDW87Fd.js";
|
|
49
|
+
import { t as formatThreadBindingDurationLabel } from "./thread-bindings-messages-DX9YBEdF.js";
|
|
50
|
+
import { n as getSkillsSnapshotVersion } from "./refresh-state-BDAg5lfY.js";
|
|
51
|
+
import { r as buildWorkspaceSkillSnapshot } from "./skills-D7XPR8N-.js";
|
|
52
|
+
import "./sandbox-epLgxWBQ.js";
|
|
53
|
+
import { t as buildAgentSystemPrompt } from "./system-prompt-BBrWR8Ef.js";
|
|
54
|
+
import { n as estimateTokensFromChars } from "./cjk-chars-Mm2E-yDG.js";
|
|
55
|
+
import { r as resolveModelWithRegistry } from "./model-CJIbRRp9.js";
|
|
56
|
+
import { a as buildSystemPromptParams, i as buildSystemPromptReport } from "./images-BwT2L5zh.js";
|
|
57
|
+
import { t as analyzeBootstrapBudget } from "./bootstrap-budget-zHsa4DnA.js";
|
|
58
|
+
import { t as EmbeddedBlockChunker } from "./pi-embedded-block-chunker-BTIDhWI6.js";
|
|
59
|
+
import "./pi-embedded-Cp3OIZy9.js";
|
|
60
|
+
import { i as matchPluginCommand, n as executePluginCommand } from "./commands-CdwfEWBd.js";
|
|
61
|
+
import { p as normalizeCommandBody } from "./commands-registry-CJw_6JDj.js";
|
|
62
|
+
import { i as setAbortMemory, r as isAbortTrigger } from "./abort-primitives-DqU6syXA.js";
|
|
63
|
+
import { n as formatTimeAgo } from "./format-relative-D1KMnyru.js";
|
|
64
|
+
import { o as stripMentions, s as stripStructuralPrefixes } from "./mentions-DLP3Al9F.js";
|
|
65
|
+
import { n as setChannelConversationBindingMaxAgeBySessionKey, t as setChannelConversationBindingIdleTimeoutBySessionKey } from "./conversation-bindings-DpL5oHBW.js";
|
|
66
|
+
import { a as readChannelAllowFromStore, l as removeChannelAllowFromStoreEntry, t as addChannelAllowFromStoreEntry } from "./pairing-store-Djx9HRyf.js";
|
|
67
|
+
import { i as installPluginFromPath, r as installPluginFromNpmSpec } from "./install-DCsrCvd1.js";
|
|
68
|
+
import { l as resolveArchiveKind } from "./archive-Bx14ie2R.js";
|
|
69
|
+
import { t as isApprovalNotFoundError } from "./approval-errors-DwJE3DiA.js";
|
|
70
|
+
import { n as parseActivationCommand } from "./group-activation-BT5UFjTt.js";
|
|
71
|
+
import { t as resolveFastModeState } from "./fast-mode-CQK85C10.js";
|
|
72
|
+
import { n as extractExplicitGroupId, t as formatElevatedUnavailableMessage } from "./elevated-unavailable-BbVJiJw7.js";
|
|
73
|
+
import { n as resolveSessionAuthProfileOverride } from "./session-override-1YQHEAlz.js";
|
|
74
|
+
import { a as shouldPersistAbortCutoff, i as resolveAbortCutoffFromContext, t as applyAbortCutoffToSessionEntry } from "./abort-cutoff-BptR8dUG.js";
|
|
75
|
+
import { r as resolveConversationBindingContextFromAcpCommand } from "./conversation-binding-input-BFDOo5Tc.js";
|
|
76
|
+
import { n as resolveSessionEntryForKey, r as stopSubagentsForRequester, t as formatAbortReplyText } from "./abort-BA4i4CO6.js";
|
|
77
|
+
import { t as extractBtwQuestion } from "./btw-command-Bgn_NviR.js";
|
|
78
|
+
import "./refresh-BXJ80ji4.js";
|
|
79
|
+
import { n as getSpeechProvider, r as listSpeechProviders, t as canonicalizeSpeechProviderId } from "./provider-registry-alkFLa5_.js";
|
|
80
|
+
import { a as buildDisabledCommandReply, c as requireCommandFlagEnabled, l as requireGatewayClientScopeForInternalChannel, o as rejectNonOwnerCommand, r as handleModelsCommand, s as rejectUnauthorizedCommand } from "./commands-models-CRURuXR-.js";
|
|
81
|
+
import { f as resolveSubagentsAction, h as resolveCommandSurfaceChannel, l as resolveHandledPrefix, m as resolveChannelAccountId, p as stopWithText, u as resolveRequesterSessionKey } from "./shared-0JcWj8-R.js";
|
|
82
|
+
import { t as handleAcpCommand } from "./commands-acp-DiLJUV45.js";
|
|
83
|
+
import { n as buildCommandsMessagePaginated, r as buildHelpMessage, t as buildCommandsMessage } from "./command-status-builders-CnD1rvYb.js";
|
|
84
|
+
import { t as listSkillCommandsForAgents } from "./skill-commands-BC_2IdwF.js";
|
|
85
|
+
import { n as setPluginEnabledInConfig } from "./enable-peOvblG8.js";
|
|
86
|
+
import { l as parseClawHubPluginSpec } from "./clawhub-CGPJNgZN.js";
|
|
87
|
+
import { t as resolveEffectiveToolInventory } from "./tools-effective-inventory-SB9JwX-y.js";
|
|
88
|
+
import { n as loadCostUsageSummary, r as loadSessionCostSummary } from "./session-cost-usage-DMRjhi4B.js";
|
|
89
|
+
import { n as buildThreadingToolContext } from "./agent-runner-utils--p6HAP6k.js";
|
|
90
|
+
import { n as buildToolsMessage } from "./status-8clcfnN0.js";
|
|
91
|
+
import { t as parseConfigValue } from "./config-value-CFTkgtE_.js";
|
|
92
|
+
import { i as listTasksForSessionKeyForStatus, r as listTasksForAgentIdForStatus, t as buildStatusReply } from "./commands-status-Cufj4x2j.js";
|
|
93
|
+
import { i as buildNpmInstallRecordFields, n as persistPluginInstall } from "./plugins-install-persist-DEr-zA4G.js";
|
|
94
|
+
import { r as installPluginFromClawHub } from "./clawhub-Ina62jCa.js";
|
|
95
|
+
import { a as buildPluginInspectReport, i as buildPluginDiagnosticsReport, o as buildPluginSnapshotReport, s as formatPluginCompatibilityNotice, t as buildAllPluginInspectReports } from "./status-C9YBVOov.js";
|
|
96
|
+
import { a as decidePreferredClawHubFallback, f as resolveFileNpmSpecToLocalPath, i as createPluginInstallLogger, n as buildPreferredClawHubSpec } from "./plugins-command-helpers-C3Qls10N.js";
|
|
97
|
+
import { fileURLToPath } from "node:url";
|
|
98
|
+
import fs from "node:fs";
|
|
99
|
+
import path from "node:path";
|
|
100
|
+
import { SessionManager } from "@earendil-works/pi-coding-agent";
|
|
101
|
+
import { streamSimple } from "@earendil-works/pi-ai";
|
|
102
|
+
//#region src/channels/plugins/config-writes.ts
|
|
103
|
+
function authorizeConfigWrite(params) {
|
|
104
|
+
return authorizeConfigWriteShared(params);
|
|
105
|
+
}
|
|
106
|
+
function resolveConfigWriteTargetFromPath(path) {
|
|
107
|
+
return resolveConfigWriteTargetFromPathShared({
|
|
108
|
+
path,
|
|
109
|
+
normalizeChannelId: (raw) => normalizeLowercaseStringOrEmpty(raw)
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function canBypassConfigWritePolicy(params) {
|
|
113
|
+
return canBypassConfigWritePolicyShared({
|
|
114
|
+
...params,
|
|
115
|
+
isInternalMessageChannel
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function formatConfigWriteDeniedMessage(params) {
|
|
119
|
+
return formatConfigWriteDeniedMessageShared(params);
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/auto-reply/reply/config-write-authorization.ts
|
|
123
|
+
function resolveConfigWriteDeniedText(params) {
|
|
124
|
+
const writeAuth = authorizeConfigWrite({
|
|
125
|
+
cfg: params.cfg,
|
|
126
|
+
origin: {
|
|
127
|
+
channelId: params.channelId,
|
|
128
|
+
accountId: params.accountId
|
|
129
|
+
},
|
|
130
|
+
target: params.target,
|
|
131
|
+
allowBypass: canBypassConfigWritePolicy({
|
|
132
|
+
channel: params.channel ?? "",
|
|
133
|
+
gatewayClientScopes: params.gatewayClientScopes
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
if (writeAuth.allowed) return null;
|
|
137
|
+
return formatConfigWriteDeniedMessage({
|
|
138
|
+
result: writeAuth,
|
|
139
|
+
fallbackChannelId: params.channelId
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/auto-reply/reply/commands-allowlist.ts
|
|
144
|
+
const ACTIONS = new Set([
|
|
145
|
+
"list",
|
|
146
|
+
"add",
|
|
147
|
+
"remove"
|
|
148
|
+
]);
|
|
149
|
+
const SCOPES = new Set([
|
|
150
|
+
"dm",
|
|
151
|
+
"group",
|
|
152
|
+
"all"
|
|
153
|
+
]);
|
|
154
|
+
function resolveAllowlistAccountId(params) {
|
|
155
|
+
const explicitAccountId = normalizeOptionalAccountId(params.parsedAccount);
|
|
156
|
+
if (explicitAccountId) return explicitAccountId;
|
|
157
|
+
const configuredDefaultAccountId = normalizeOptionalString(getChannelPlugin(params.channelId)?.config.defaultAccountId?.(params.cfg));
|
|
158
|
+
const ctxAccountId = normalizeOptionalAccountId(params.ctxAccountId);
|
|
159
|
+
return configuredDefaultAccountId || ctxAccountId || "default";
|
|
160
|
+
}
|
|
161
|
+
function parseAllowlistCommand(raw) {
|
|
162
|
+
const trimmed = raw.trim();
|
|
163
|
+
if (!(normalizeOptionalLowercaseString(trimmed) ?? "").startsWith("/allowlist")) return null;
|
|
164
|
+
const rest = trimmed.slice(10).trim();
|
|
165
|
+
if (!rest) return {
|
|
166
|
+
action: "list",
|
|
167
|
+
scope: "dm"
|
|
168
|
+
};
|
|
169
|
+
const tokens = rest.split(/\s+/);
|
|
170
|
+
let action = "list";
|
|
171
|
+
let scope = "dm";
|
|
172
|
+
let resolve = false;
|
|
173
|
+
let target = "both";
|
|
174
|
+
let channel;
|
|
175
|
+
let account;
|
|
176
|
+
const entryTokens = [];
|
|
177
|
+
let i = 0;
|
|
178
|
+
const firstAction = normalizeOptionalLowercaseString(tokens[i]);
|
|
179
|
+
if (firstAction && ACTIONS.has(firstAction)) {
|
|
180
|
+
action = firstAction;
|
|
181
|
+
i += 1;
|
|
182
|
+
}
|
|
183
|
+
const firstScope = normalizeOptionalLowercaseString(tokens[i]);
|
|
184
|
+
if (firstScope && SCOPES.has(firstScope)) {
|
|
185
|
+
scope = firstScope;
|
|
186
|
+
i += 1;
|
|
187
|
+
}
|
|
188
|
+
for (; i < tokens.length; i += 1) {
|
|
189
|
+
const token = tokens[i];
|
|
190
|
+
const lowered = normalizeOptionalLowercaseString(token) ?? "";
|
|
191
|
+
if (lowered === "--resolve" || lowered === "resolve") {
|
|
192
|
+
resolve = true;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (lowered === "--config" || lowered === "config") {
|
|
196
|
+
target = "config";
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (lowered === "--store" || lowered === "store") {
|
|
200
|
+
target = "store";
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (lowered === "--channel" && tokens[i + 1]) {
|
|
204
|
+
channel = tokens[i + 1];
|
|
205
|
+
i += 1;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (lowered === "--account" && tokens[i + 1]) {
|
|
209
|
+
account = tokens[i + 1];
|
|
210
|
+
i += 1;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const kv = token.split("=");
|
|
214
|
+
if (kv.length === 2) {
|
|
215
|
+
const key = normalizeOptionalLowercaseString(kv[0]);
|
|
216
|
+
const value = normalizeOptionalString(kv[1]);
|
|
217
|
+
if (key === "channel") {
|
|
218
|
+
if (value) channel = value;
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (key === "account") {
|
|
222
|
+
if (value) account = value;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
const normalizedValue = normalizeOptionalLowercaseString(value);
|
|
226
|
+
if (key === "scope" && normalizedValue && SCOPES.has(normalizedValue)) {
|
|
227
|
+
scope = normalizedValue;
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
entryTokens.push(token);
|
|
232
|
+
}
|
|
233
|
+
if (action === "add" || action === "remove") {
|
|
234
|
+
const entry = entryTokens.join(" ").trim();
|
|
235
|
+
if (!entry) return {
|
|
236
|
+
action: "error",
|
|
237
|
+
message: "Usage: /allowlist add|remove <entry>"
|
|
238
|
+
};
|
|
239
|
+
return {
|
|
240
|
+
action,
|
|
241
|
+
scope,
|
|
242
|
+
entry,
|
|
243
|
+
channel,
|
|
244
|
+
account,
|
|
245
|
+
resolve,
|
|
246
|
+
target
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
action: "list",
|
|
251
|
+
scope,
|
|
252
|
+
channel,
|
|
253
|
+
account,
|
|
254
|
+
resolve
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function normalizeAllowFrom(params) {
|
|
258
|
+
const plugin = getChannelPlugin(params.channelId);
|
|
259
|
+
if (plugin?.config.formatAllowFrom) return plugin.config.formatAllowFrom({
|
|
260
|
+
cfg: params.cfg,
|
|
261
|
+
accountId: params.accountId,
|
|
262
|
+
allowFrom: params.values
|
|
263
|
+
});
|
|
264
|
+
return normalizeStringEntries(params.values);
|
|
265
|
+
}
|
|
266
|
+
function formatEntryList(entries, resolved) {
|
|
267
|
+
if (entries.length === 0) return "(none)";
|
|
268
|
+
return entries.map((entry) => {
|
|
269
|
+
const name = resolved?.get(entry);
|
|
270
|
+
return name ? `${entry} (${name})` : entry;
|
|
271
|
+
}).join(", ");
|
|
272
|
+
}
|
|
273
|
+
async function updatePairingStoreAllowlist(params) {
|
|
274
|
+
const storeEntry = {
|
|
275
|
+
channel: params.channelId,
|
|
276
|
+
entry: params.entry,
|
|
277
|
+
accountId: params.accountId
|
|
278
|
+
};
|
|
279
|
+
if (params.action === "add") {
|
|
280
|
+
await addChannelAllowFromStoreEntry(storeEntry);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
await removeChannelAllowFromStoreEntry(storeEntry);
|
|
284
|
+
if (params.accountId === "default") await removeChannelAllowFromStoreEntry({
|
|
285
|
+
channel: params.channelId,
|
|
286
|
+
entry: params.entry
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
function mapResolvedAllowlistNames(entries) {
|
|
290
|
+
const map = /* @__PURE__ */ new Map();
|
|
291
|
+
for (const entry of entries) if (entry.resolved && entry.name) map.set(entry.input, entry.name);
|
|
292
|
+
return map;
|
|
293
|
+
}
|
|
294
|
+
async function resolveAllowlistNames(params) {
|
|
295
|
+
return mapResolvedAllowlistNames(await getChannelPlugin(params.channelId)?.allowlist?.resolveNames?.({
|
|
296
|
+
cfg: params.cfg,
|
|
297
|
+
accountId: params.accountId,
|
|
298
|
+
scope: params.scope,
|
|
299
|
+
entries: params.entries
|
|
300
|
+
}) ?? []);
|
|
301
|
+
}
|
|
302
|
+
async function readAllowlistConfig(params) {
|
|
303
|
+
return await getChannelPlugin(params.channelId)?.allowlist?.readConfig?.({
|
|
304
|
+
cfg: params.cfg,
|
|
305
|
+
accountId: params.accountId
|
|
306
|
+
}) ?? {};
|
|
307
|
+
}
|
|
308
|
+
const handleAllowlistCommand = async (params, allowTextCommands) => {
|
|
309
|
+
if (!allowTextCommands) return null;
|
|
310
|
+
const parsed = parseAllowlistCommand(params.command.commandBodyNormalized);
|
|
311
|
+
if (!parsed) return null;
|
|
312
|
+
if (parsed.action === "error") return {
|
|
313
|
+
shouldContinue: false,
|
|
314
|
+
reply: { text: `ā ļø ${parsed.message}` }
|
|
315
|
+
};
|
|
316
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/allowlist");
|
|
317
|
+
if (unauthorized) return unauthorized;
|
|
318
|
+
if (parsed.action !== "list") {
|
|
319
|
+
const nonOwner = rejectNonOwnerCommand(params, "/allowlist");
|
|
320
|
+
if (nonOwner) return nonOwner;
|
|
321
|
+
}
|
|
322
|
+
const channelId = normalizeChannelId(parsed.channel) ?? params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
323
|
+
if (!channelId) return {
|
|
324
|
+
shouldContinue: false,
|
|
325
|
+
reply: { text: "ā ļø Unknown channel. Add channel=<id> to the command." }
|
|
326
|
+
};
|
|
327
|
+
if (normalizeOptionalString(parsed.account) && !normalizeOptionalAccountId(parsed.account)) return {
|
|
328
|
+
shouldContinue: false,
|
|
329
|
+
reply: { text: "ā ļø Invalid account id. Reserved keys (__proto__, constructor, prototype) are blocked." }
|
|
330
|
+
};
|
|
331
|
+
const accountId = resolveAllowlistAccountId({
|
|
332
|
+
cfg: params.cfg,
|
|
333
|
+
channelId,
|
|
334
|
+
parsedAccount: parsed.account,
|
|
335
|
+
ctxAccountId: params.ctx.AccountId
|
|
336
|
+
});
|
|
337
|
+
const plugin = getChannelPlugin(channelId);
|
|
338
|
+
if (parsed.action === "list") {
|
|
339
|
+
const supportsStore = Boolean(plugin?.pairing);
|
|
340
|
+
if (!plugin?.allowlist?.readConfig && !supportsStore) return {
|
|
341
|
+
shouldContinue: false,
|
|
342
|
+
reply: { text: `ā ļø ${channelId} does not expose allowlist configuration.` }
|
|
343
|
+
};
|
|
344
|
+
const storeAllowFrom = supportsStore ? await readChannelAllowFromStore(channelId, process.env, accountId).catch(() => []) : [];
|
|
345
|
+
const configState = await readAllowlistConfig({
|
|
346
|
+
cfg: params.cfg,
|
|
347
|
+
channelId,
|
|
348
|
+
accountId
|
|
349
|
+
});
|
|
350
|
+
const dmAllowFrom = (configState.dmAllowFrom ?? []).map(String);
|
|
351
|
+
const groupAllowFrom = (configState.groupAllowFrom ?? []).map(String);
|
|
352
|
+
const groupOverrides = (configState.groupOverrides ?? []).map((entry) => ({
|
|
353
|
+
label: entry.label,
|
|
354
|
+
entries: entry.entries.map(String).filter(Boolean)
|
|
355
|
+
}));
|
|
356
|
+
const dmDisplay = normalizeAllowFrom({
|
|
357
|
+
cfg: params.cfg,
|
|
358
|
+
channelId,
|
|
359
|
+
accountId,
|
|
360
|
+
values: dmAllowFrom
|
|
361
|
+
});
|
|
362
|
+
const groupDisplay = normalizeAllowFrom({
|
|
363
|
+
cfg: params.cfg,
|
|
364
|
+
channelId,
|
|
365
|
+
accountId,
|
|
366
|
+
values: groupAllowFrom
|
|
367
|
+
});
|
|
368
|
+
const groupOverrideEntries = groupOverrides.flatMap((entry) => entry.entries);
|
|
369
|
+
const groupOverrideDisplay = normalizeAllowFrom({
|
|
370
|
+
cfg: params.cfg,
|
|
371
|
+
channelId,
|
|
372
|
+
accountId,
|
|
373
|
+
values: groupOverrideEntries
|
|
374
|
+
});
|
|
375
|
+
const resolvedDm = parsed.resolve && dmDisplay.length > 0 ? await resolveAllowlistNames({
|
|
376
|
+
cfg: params.cfg,
|
|
377
|
+
channelId,
|
|
378
|
+
accountId,
|
|
379
|
+
scope: "dm",
|
|
380
|
+
entries: dmDisplay
|
|
381
|
+
}) : void 0;
|
|
382
|
+
const resolvedGroup = parsed.resolve && groupOverrideDisplay.length > 0 ? await resolveAllowlistNames({
|
|
383
|
+
cfg: params.cfg,
|
|
384
|
+
channelId,
|
|
385
|
+
accountId,
|
|
386
|
+
scope: "group",
|
|
387
|
+
entries: groupOverrideDisplay
|
|
388
|
+
}) : void 0;
|
|
389
|
+
const lines = ["š§¾ Allowlist"];
|
|
390
|
+
lines.push(`Channel: ${channelId}${accountId ? ` (account ${accountId})` : ""}`);
|
|
391
|
+
if (configState.dmPolicy) lines.push(`DM policy: ${configState.dmPolicy}`);
|
|
392
|
+
if (configState.groupPolicy) lines.push(`Group policy: ${configState.groupPolicy}`);
|
|
393
|
+
const showDm = parsed.scope === "dm" || parsed.scope === "all";
|
|
394
|
+
const showGroup = parsed.scope === "group" || parsed.scope === "all";
|
|
395
|
+
if (showDm) lines.push(`DM allowFrom (config): ${formatEntryList(dmDisplay, resolvedDm)}`);
|
|
396
|
+
if (supportsStore && storeAllowFrom.length > 0) {
|
|
397
|
+
const storeLabel = normalizeAllowFrom({
|
|
398
|
+
cfg: params.cfg,
|
|
399
|
+
channelId,
|
|
400
|
+
accountId,
|
|
401
|
+
values: storeAllowFrom
|
|
402
|
+
});
|
|
403
|
+
lines.push(`Paired allowFrom (store): ${formatEntryList(storeLabel)}`);
|
|
404
|
+
}
|
|
405
|
+
if (showGroup) {
|
|
406
|
+
if (groupAllowFrom.length > 0) lines.push(`Group allowFrom (config): ${formatEntryList(groupDisplay, resolvedGroup)}`);
|
|
407
|
+
if (groupOverrides.length > 0) {
|
|
408
|
+
lines.push("Group overrides:");
|
|
409
|
+
for (const entry of groupOverrides) {
|
|
410
|
+
const normalized = normalizeAllowFrom({
|
|
411
|
+
cfg: params.cfg,
|
|
412
|
+
channelId,
|
|
413
|
+
accountId,
|
|
414
|
+
values: entry.entries
|
|
415
|
+
});
|
|
416
|
+
lines.push(`- ${entry.label}: ${formatEntryList(normalized, resolvedGroup)}`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
shouldContinue: false,
|
|
422
|
+
reply: { text: lines.join("\n") }
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
426
|
+
label: "/allowlist write",
|
|
427
|
+
allowedScopes: ["operator.admin"],
|
|
428
|
+
missingText: "ā /allowlist add|remove requires operator.admin for gateway clients."
|
|
429
|
+
});
|
|
430
|
+
if (missingAdminScope) return missingAdminScope;
|
|
431
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
432
|
+
label: "/allowlist edits",
|
|
433
|
+
configKey: "config",
|
|
434
|
+
disabledVerb: "are"
|
|
435
|
+
});
|
|
436
|
+
if (disabled) return disabled;
|
|
437
|
+
const shouldUpdateConfig = parsed.target !== "store";
|
|
438
|
+
const shouldTouchStore = parsed.target !== "config" && Boolean(plugin?.pairing);
|
|
439
|
+
if (shouldUpdateConfig) {
|
|
440
|
+
if (parsed.scope === "all") return {
|
|
441
|
+
shouldContinue: false,
|
|
442
|
+
reply: { text: "ā ļø /allowlist add|remove requires scope dm or group." }
|
|
443
|
+
};
|
|
444
|
+
if (!plugin?.allowlist?.applyConfigEdit) return {
|
|
445
|
+
shouldContinue: false,
|
|
446
|
+
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
447
|
+
};
|
|
448
|
+
const snapshot = await readConfigFileSnapshot();
|
|
449
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
450
|
+
shouldContinue: false,
|
|
451
|
+
reply: { text: "ā ļø Config file is invalid; fix it before using /allowlist." }
|
|
452
|
+
};
|
|
453
|
+
const parsedConfig = structuredClone(snapshot.parsed);
|
|
454
|
+
const editResult = await plugin.allowlist.applyConfigEdit({
|
|
455
|
+
cfg: params.cfg,
|
|
456
|
+
parsedConfig,
|
|
457
|
+
accountId,
|
|
458
|
+
scope: parsed.scope,
|
|
459
|
+
action: parsed.action,
|
|
460
|
+
entry: parsed.entry
|
|
461
|
+
});
|
|
462
|
+
if (!editResult) return {
|
|
463
|
+
shouldContinue: false,
|
|
464
|
+
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
465
|
+
};
|
|
466
|
+
if (editResult.kind === "invalid-entry") return {
|
|
467
|
+
shouldContinue: false,
|
|
468
|
+
reply: { text: "ā ļø Invalid allowlist entry." }
|
|
469
|
+
};
|
|
470
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
471
|
+
cfg: params.cfg,
|
|
472
|
+
channel: params.command.channel,
|
|
473
|
+
channelId,
|
|
474
|
+
accountId,
|
|
475
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
476
|
+
target: editResult.writeTarget
|
|
477
|
+
});
|
|
478
|
+
if (deniedText) return {
|
|
479
|
+
shouldContinue: false,
|
|
480
|
+
reply: { text: deniedText }
|
|
481
|
+
};
|
|
482
|
+
const configChanged = editResult.changed;
|
|
483
|
+
if (configChanged) {
|
|
484
|
+
const validated = validateConfigObjectWithPlugins(parsedConfig);
|
|
485
|
+
if (!validated.ok) {
|
|
486
|
+
const issue = validated.issues[0];
|
|
487
|
+
return {
|
|
488
|
+
shouldContinue: false,
|
|
489
|
+
reply: { text: `ā ļø Config invalid after update (${issue.path}: ${issue.message}).` }
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
await writeConfigFile(validated.config);
|
|
493
|
+
}
|
|
494
|
+
if (!configChanged && !shouldTouchStore) return {
|
|
495
|
+
shouldContinue: false,
|
|
496
|
+
reply: { text: parsed.action === "add" ? "ā
Already allowlisted." : "ā ļø Entry not found." }
|
|
497
|
+
};
|
|
498
|
+
if (shouldTouchStore) await updatePairingStoreAllowlist({
|
|
499
|
+
action: parsed.action,
|
|
500
|
+
channelId,
|
|
501
|
+
accountId,
|
|
502
|
+
entry: parsed.entry
|
|
503
|
+
});
|
|
504
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
505
|
+
const scopeLabel = parsed.scope === "dm" ? "DM" : "group";
|
|
506
|
+
const locations = [];
|
|
507
|
+
if (configChanged) locations.push(editResult.pathLabel);
|
|
508
|
+
if (shouldTouchStore) locations.push("pairing store");
|
|
509
|
+
return {
|
|
510
|
+
shouldContinue: false,
|
|
511
|
+
reply: { text: `ā
${scopeLabel} allowlist ${actionLabel}: ${locations.length > 0 ? locations.join(" + ") : "no-op"}.` }
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
if (!shouldTouchStore) return {
|
|
515
|
+
shouldContinue: false,
|
|
516
|
+
reply: { text: "ā ļø This channel does not support allowlist storage." }
|
|
517
|
+
};
|
|
518
|
+
await updatePairingStoreAllowlist({
|
|
519
|
+
action: parsed.action,
|
|
520
|
+
channelId,
|
|
521
|
+
accountId,
|
|
522
|
+
entry: parsed.entry
|
|
523
|
+
});
|
|
524
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
525
|
+
return {
|
|
526
|
+
shouldContinue: false,
|
|
527
|
+
reply: { text: `ā
${parsed.scope === "dm" ? "DM" : "group"} allowlist ${actionLabel} in pairing store.` }
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region src/infra/channel-approval-auth.ts
|
|
532
|
+
function resolveApprovalCommandAuthorization(params) {
|
|
533
|
+
const channel = normalizeMessageChannel(params.channel);
|
|
534
|
+
if (!channel) return {
|
|
535
|
+
authorized: true,
|
|
536
|
+
explicit: false
|
|
537
|
+
};
|
|
538
|
+
const approvalCapability = resolveChannelApprovalCapability(getChannelPlugin(channel));
|
|
539
|
+
const resolved = approvalCapability?.authorizeActorAction?.({
|
|
540
|
+
cfg: params.cfg,
|
|
541
|
+
accountId: params.accountId,
|
|
542
|
+
senderId: params.senderId,
|
|
543
|
+
action: "approve",
|
|
544
|
+
approvalKind: params.kind
|
|
545
|
+
});
|
|
546
|
+
if (!resolved) return {
|
|
547
|
+
authorized: true,
|
|
548
|
+
explicit: false
|
|
549
|
+
};
|
|
550
|
+
const availability = approvalCapability?.getActionAvailabilityState?.({
|
|
551
|
+
cfg: params.cfg,
|
|
552
|
+
accountId: params.accountId,
|
|
553
|
+
action: "approve",
|
|
554
|
+
approvalKind: params.kind
|
|
555
|
+
});
|
|
556
|
+
return {
|
|
557
|
+
authorized: resolved.authorized,
|
|
558
|
+
reason: resolved.reason,
|
|
559
|
+
explicit: resolved.authorized ? availability?.kind !== "disabled" : true
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/auto-reply/reply/commands-approve.ts
|
|
564
|
+
const COMMAND_REGEX = /^\/?approve(?:\s|$)/i;
|
|
565
|
+
const FOREIGN_COMMAND_MENTION_REGEX = /^\/approve@([^\s]+)(?:\s|$)/i;
|
|
566
|
+
const DECISION_ALIASES = {
|
|
567
|
+
allow: "allow-once",
|
|
568
|
+
once: "allow-once",
|
|
569
|
+
"allow-once": "allow-once",
|
|
570
|
+
allowonce: "allow-once",
|
|
571
|
+
always: "allow-always",
|
|
572
|
+
"allow-always": "allow-always",
|
|
573
|
+
allowalways: "allow-always",
|
|
574
|
+
deny: "deny",
|
|
575
|
+
reject: "deny",
|
|
576
|
+
block: "deny"
|
|
577
|
+
};
|
|
578
|
+
const APPROVE_USAGE_TEXT = "Usage: /approve <id> <decision> (see the pending approval message for available decisions)";
|
|
579
|
+
function parseApproveCommand(raw) {
|
|
580
|
+
const trimmed = raw.trim();
|
|
581
|
+
if (FOREIGN_COMMAND_MENTION_REGEX.test(trimmed)) return {
|
|
582
|
+
ok: false,
|
|
583
|
+
error: "ā This /approve command targets a different Telegram bot."
|
|
584
|
+
};
|
|
585
|
+
const commandMatch = trimmed.match(COMMAND_REGEX);
|
|
586
|
+
if (!commandMatch) return null;
|
|
587
|
+
const rest = trimmed.slice(commandMatch[0].length).trim();
|
|
588
|
+
if (!rest) return {
|
|
589
|
+
ok: false,
|
|
590
|
+
error: APPROVE_USAGE_TEXT
|
|
591
|
+
};
|
|
592
|
+
const tokens = rest.split(/\s+/).filter(Boolean);
|
|
593
|
+
if (tokens.length < 2) return {
|
|
594
|
+
ok: false,
|
|
595
|
+
error: APPROVE_USAGE_TEXT
|
|
596
|
+
};
|
|
597
|
+
const first = normalizeLowercaseStringOrEmpty(tokens[0]);
|
|
598
|
+
const second = normalizeLowercaseStringOrEmpty(tokens[1]);
|
|
599
|
+
if (DECISION_ALIASES[first]) return {
|
|
600
|
+
ok: true,
|
|
601
|
+
decision: DECISION_ALIASES[first],
|
|
602
|
+
id: tokens.slice(1).join(" ").trim()
|
|
603
|
+
};
|
|
604
|
+
if (DECISION_ALIASES[second]) return {
|
|
605
|
+
ok: true,
|
|
606
|
+
decision: DECISION_ALIASES[second],
|
|
607
|
+
id: tokens[0]
|
|
608
|
+
};
|
|
609
|
+
return {
|
|
610
|
+
ok: false,
|
|
611
|
+
error: APPROVE_USAGE_TEXT
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
function buildResolvedByLabel(params) {
|
|
615
|
+
return `${params.command.channel}:${params.command.senderId ?? "unknown"}`;
|
|
616
|
+
}
|
|
617
|
+
function formatApprovalSubmitError(error) {
|
|
618
|
+
return formatErrorMessage(error);
|
|
619
|
+
}
|
|
620
|
+
function resolveApprovalMethods(params) {
|
|
621
|
+
if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.authorized ? ["plugin.approval.resolve"] : [];
|
|
622
|
+
if (params.execAuthorization.authorized && params.pluginAuthorization.authorized) return ["exec.approval.resolve", "plugin.approval.resolve"];
|
|
623
|
+
if (params.execAuthorization.authorized) return ["exec.approval.resolve"];
|
|
624
|
+
if (params.pluginAuthorization.authorized) return ["plugin.approval.resolve"];
|
|
625
|
+
return [];
|
|
626
|
+
}
|
|
627
|
+
function resolveApprovalAuthorizationError(params) {
|
|
628
|
+
if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.reason ?? "ā You are not authorized to approve this request.";
|
|
629
|
+
return params.execAuthorization.reason ?? params.pluginAuthorization.reason ?? "ā You are not authorized to approve this request.";
|
|
630
|
+
}
|
|
631
|
+
const handleApproveCommand = async (params, allowTextCommands) => {
|
|
632
|
+
if (!allowTextCommands) return null;
|
|
633
|
+
const normalized = params.command.commandBodyNormalized;
|
|
634
|
+
const parsed = parseApproveCommand(normalized);
|
|
635
|
+
if (!parsed) return null;
|
|
636
|
+
if (!parsed.ok) return {
|
|
637
|
+
shouldContinue: false,
|
|
638
|
+
reply: { text: parsed.error }
|
|
639
|
+
};
|
|
640
|
+
const isPluginId = parsed.id.startsWith("plugin:");
|
|
641
|
+
const effectiveAccountId = resolveChannelAccountId({
|
|
642
|
+
cfg: params.cfg,
|
|
643
|
+
ctx: params.ctx,
|
|
644
|
+
command: params.command
|
|
645
|
+
});
|
|
646
|
+
const approveCommandBehavior = resolveChannelApprovalCapability(getChannelPlugin(params.command.channel))?.resolveApproveCommandBehavior?.({
|
|
647
|
+
cfg: params.cfg,
|
|
648
|
+
accountId: effectiveAccountId,
|
|
649
|
+
senderId: params.command.senderId,
|
|
650
|
+
approvalKind: isPluginId ? "plugin" : "exec"
|
|
651
|
+
});
|
|
652
|
+
if (approveCommandBehavior?.kind === "ignore") return { shouldContinue: false };
|
|
653
|
+
if (approveCommandBehavior?.kind === "reply") return {
|
|
654
|
+
shouldContinue: false,
|
|
655
|
+
reply: { text: approveCommandBehavior.text }
|
|
656
|
+
};
|
|
657
|
+
const execApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
658
|
+
cfg: params.cfg,
|
|
659
|
+
channel: params.command.channel,
|
|
660
|
+
accountId: effectiveAccountId,
|
|
661
|
+
senderId: params.command.senderId,
|
|
662
|
+
kind: "exec"
|
|
663
|
+
});
|
|
664
|
+
const pluginApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
665
|
+
cfg: params.cfg,
|
|
666
|
+
channel: params.command.channel,
|
|
667
|
+
accountId: effectiveAccountId,
|
|
668
|
+
senderId: params.command.senderId,
|
|
669
|
+
kind: "plugin"
|
|
670
|
+
});
|
|
671
|
+
const hasExplicitApprovalAuthorization = execApprovalAuthorization.explicit && execApprovalAuthorization.authorized || pluginApprovalAuthorization.explicit && pluginApprovalAuthorization.authorized;
|
|
672
|
+
if (!params.command.isAuthorizedSender && !hasExplicitApprovalAuthorization) {
|
|
673
|
+
logVerbose(`Ignoring /approve from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
674
|
+
return { shouldContinue: false };
|
|
675
|
+
}
|
|
676
|
+
const missingScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
677
|
+
label: "/approve",
|
|
678
|
+
allowedScopes: ["operator.approvals", "operator.admin"],
|
|
679
|
+
missingText: "ā /approve requires operator.approvals for gateway clients."
|
|
680
|
+
});
|
|
681
|
+
if (missingScope) return missingScope;
|
|
682
|
+
const resolvedBy = buildResolvedByLabel(params);
|
|
683
|
+
const callApprovalMethod = async (method) => {
|
|
684
|
+
await callGateway({
|
|
685
|
+
method,
|
|
686
|
+
params: {
|
|
687
|
+
id: parsed.id,
|
|
688
|
+
decision: parsed.decision
|
|
689
|
+
},
|
|
690
|
+
clientName: GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
691
|
+
clientDisplayName: `Chat approval (${resolvedBy})`,
|
|
692
|
+
mode: GATEWAY_CLIENT_MODES.BACKEND
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
const methods = resolveApprovalMethods({
|
|
696
|
+
approvalId: parsed.id,
|
|
697
|
+
execAuthorization: execApprovalAuthorization,
|
|
698
|
+
pluginAuthorization: pluginApprovalAuthorization
|
|
699
|
+
});
|
|
700
|
+
if (methods.length === 0) return {
|
|
701
|
+
shouldContinue: false,
|
|
702
|
+
reply: { text: resolveApprovalAuthorizationError({
|
|
703
|
+
approvalId: parsed.id,
|
|
704
|
+
execAuthorization: execApprovalAuthorization,
|
|
705
|
+
pluginAuthorization: pluginApprovalAuthorization
|
|
706
|
+
}) }
|
|
707
|
+
};
|
|
708
|
+
let lastError = null;
|
|
709
|
+
for (const [index, method] of methods.entries()) try {
|
|
710
|
+
await callApprovalMethod(method);
|
|
711
|
+
lastError = null;
|
|
712
|
+
break;
|
|
713
|
+
} catch (error) {
|
|
714
|
+
lastError = error;
|
|
715
|
+
const isLastMethod = index === methods.length - 1;
|
|
716
|
+
if (!isApprovalNotFoundError(error) || isLastMethod) return {
|
|
717
|
+
shouldContinue: false,
|
|
718
|
+
reply: { text: `ā Failed to submit approval: ${formatApprovalSubmitError(error)}` }
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
if (lastError) return {
|
|
722
|
+
shouldContinue: false,
|
|
723
|
+
reply: { text: `ā Failed to submit approval: ${formatApprovalSubmitError(lastError)}` }
|
|
724
|
+
};
|
|
725
|
+
return {
|
|
726
|
+
shouldContinue: false,
|
|
727
|
+
reply: { text: `ā
Approval ${parsed.decision} submitted for ${parsed.id}.` }
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region src/auto-reply/reply/bash-command.ts
|
|
732
|
+
const CHAT_BASH_SCOPE_KEY = "chat:bash";
|
|
733
|
+
const DEFAULT_FOREGROUND_MS = 2e3;
|
|
734
|
+
const MAX_FOREGROUND_MS = 3e4;
|
|
735
|
+
let activeJob = null;
|
|
736
|
+
function resolveForegroundMs(cfg) {
|
|
737
|
+
const raw = cfg.commands?.bashForegroundMs;
|
|
738
|
+
if (typeof raw !== "number" || Number.isNaN(raw)) return DEFAULT_FOREGROUND_MS;
|
|
739
|
+
return clampInt(raw, 0, MAX_FOREGROUND_MS);
|
|
740
|
+
}
|
|
741
|
+
function formatSessionSnippet(sessionId) {
|
|
742
|
+
const trimmed = sessionId.trim();
|
|
743
|
+
if (trimmed.length <= 12) return trimmed;
|
|
744
|
+
return `${trimmed.slice(0, 8)}ā¦`;
|
|
745
|
+
}
|
|
746
|
+
function formatOutputBlock(text) {
|
|
747
|
+
const trimmed = text.trim();
|
|
748
|
+
if (!trimmed) return "(no output)";
|
|
749
|
+
return `\`\`\`txt\n${trimmed}\n\`\`\``;
|
|
750
|
+
}
|
|
751
|
+
function parseBashRequest(raw) {
|
|
752
|
+
const trimmed = raw.trimStart();
|
|
753
|
+
let restSource = "";
|
|
754
|
+
if (normalizeLowercaseStringOrEmpty(trimmed).startsWith("/bash")) {
|
|
755
|
+
const match = trimmed.match(/^\/bash(?:\s*:\s*|\s+|$)([\s\S]*)$/i);
|
|
756
|
+
if (!match) return null;
|
|
757
|
+
restSource = match[1] ?? "";
|
|
758
|
+
} else if (trimmed.startsWith("!")) {
|
|
759
|
+
restSource = trimmed.slice(1);
|
|
760
|
+
if (restSource.trimStart().startsWith(":")) restSource = restSource.trimStart().slice(1);
|
|
761
|
+
} else return null;
|
|
762
|
+
const rest = restSource.trimStart();
|
|
763
|
+
if (!rest) return { action: "help" };
|
|
764
|
+
const tokenMatch = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
765
|
+
const token = normalizeOptionalString(tokenMatch?.[1]) ?? "";
|
|
766
|
+
const remainder = normalizeOptionalString(tokenMatch?.[2]) ?? "";
|
|
767
|
+
const lowered = normalizeLowercaseStringOrEmpty(token);
|
|
768
|
+
if (lowered === "poll") return {
|
|
769
|
+
action: "poll",
|
|
770
|
+
sessionId: remainder || void 0
|
|
771
|
+
};
|
|
772
|
+
if (lowered === "stop") return {
|
|
773
|
+
action: "stop",
|
|
774
|
+
sessionId: remainder || void 0
|
|
775
|
+
};
|
|
776
|
+
if (lowered === "help") return { action: "help" };
|
|
777
|
+
return {
|
|
778
|
+
action: "run",
|
|
779
|
+
command: rest
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
function resolveRawCommandBody(params) {
|
|
783
|
+
const stripped = stripStructuralPrefixes(params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body ?? "");
|
|
784
|
+
return params.isGroup ? stripMentions(stripped, params.ctx, params.cfg, params.agentId) : stripped;
|
|
785
|
+
}
|
|
786
|
+
function getScopedSession(sessionId) {
|
|
787
|
+
const running = getSession(sessionId);
|
|
788
|
+
if (running && running.scopeKey === CHAT_BASH_SCOPE_KEY) return { running };
|
|
789
|
+
const finished = getFinishedSession(sessionId);
|
|
790
|
+
if (finished && finished.scopeKey === CHAT_BASH_SCOPE_KEY) return { finished };
|
|
791
|
+
return {};
|
|
792
|
+
}
|
|
793
|
+
function ensureActiveJobState() {
|
|
794
|
+
if (!activeJob) return null;
|
|
795
|
+
if (activeJob.state === "starting") return activeJob;
|
|
796
|
+
const { running, finished } = getScopedSession(activeJob.sessionId);
|
|
797
|
+
if (running) return activeJob;
|
|
798
|
+
if (finished) {
|
|
799
|
+
activeJob = null;
|
|
800
|
+
return null;
|
|
801
|
+
}
|
|
802
|
+
activeJob = null;
|
|
803
|
+
return null;
|
|
804
|
+
}
|
|
805
|
+
function attachActiveWatcher(sessionId) {
|
|
806
|
+
if (!activeJob || activeJob.state !== "running") return;
|
|
807
|
+
if (activeJob.sessionId !== sessionId) return;
|
|
808
|
+
if (activeJob.watcherAttached) return;
|
|
809
|
+
const { running } = getScopedSession(sessionId);
|
|
810
|
+
const child = running?.child;
|
|
811
|
+
if (!child) return;
|
|
812
|
+
activeJob.watcherAttached = true;
|
|
813
|
+
child.once("close", () => {
|
|
814
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
function buildUsageReply() {
|
|
818
|
+
return { text: [
|
|
819
|
+
"āļø Usage:",
|
|
820
|
+
"- ! <command>",
|
|
821
|
+
"- !poll | ! poll",
|
|
822
|
+
"- !stop | ! stop",
|
|
823
|
+
"- /bash ... (alias; same subcommands as !)"
|
|
824
|
+
].join("\n") };
|
|
825
|
+
}
|
|
826
|
+
async function handleBashChatCommand(params) {
|
|
827
|
+
if (!isCommandFlagEnabled(params.cfg, "bash")) return buildDisabledCommandReply({
|
|
828
|
+
label: "bash",
|
|
829
|
+
configKey: "bash",
|
|
830
|
+
docsUrl: "https://gitee.com/kaiji1126/kaijibot/blob/main/docs/tools/slash-commands.md#config"
|
|
831
|
+
});
|
|
832
|
+
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
833
|
+
sessionKey: params.sessionKey,
|
|
834
|
+
config: params.cfg
|
|
835
|
+
});
|
|
836
|
+
if (!params.elevated.enabled || !params.elevated.allowed) {
|
|
837
|
+
const runtimeSandboxed = resolveSandboxRuntimeStatus({
|
|
838
|
+
cfg: params.cfg,
|
|
839
|
+
sessionKey: params.ctx.SessionKey
|
|
840
|
+
}).sandboxed;
|
|
841
|
+
return { text: formatElevatedUnavailableMessage({
|
|
842
|
+
runtimeSandboxed,
|
|
843
|
+
failures: params.elevated.failures,
|
|
844
|
+
sessionKey: params.ctx.SessionKey
|
|
845
|
+
}) };
|
|
846
|
+
}
|
|
847
|
+
const request = parseBashRequest(resolveRawCommandBody({
|
|
848
|
+
ctx: params.ctx,
|
|
849
|
+
cfg: params.cfg,
|
|
850
|
+
agentId,
|
|
851
|
+
isGroup: params.isGroup
|
|
852
|
+
}).trim());
|
|
853
|
+
if (!request) return { text: "ā ļø Unrecognized bash request." };
|
|
854
|
+
const liveJob = ensureActiveJobState();
|
|
855
|
+
if (request.action === "help") return buildUsageReply();
|
|
856
|
+
if (request.action === "poll") {
|
|
857
|
+
const sessionId = normalizeOptionalString(request.sessionId) || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
858
|
+
if (!sessionId) return { text: "āļø No active bash job." };
|
|
859
|
+
const { running, finished } = getScopedSession(sessionId);
|
|
860
|
+
if (running) {
|
|
861
|
+
attachActiveWatcher(sessionId);
|
|
862
|
+
const runtimeSec = Math.max(0, Math.floor((Date.now() - running.startedAt) / 1e3));
|
|
863
|
+
const tail = running.tail || "(no output yet)";
|
|
864
|
+
return { text: [
|
|
865
|
+
`āļø bash still running (session ${formatSessionSnippet(sessionId)}, ${runtimeSec}s).`,
|
|
866
|
+
formatOutputBlock(tail),
|
|
867
|
+
"Hint: !stop (or /bash stop)"
|
|
868
|
+
].join("\n") };
|
|
869
|
+
}
|
|
870
|
+
if (finished) {
|
|
871
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
872
|
+
const exitLabel = finished.exitSignal ? `signal ${String(finished.exitSignal)}` : `code ${String(finished.exitCode ?? 0)}`;
|
|
873
|
+
return { text: [
|
|
874
|
+
`${finished.status === "completed" ? "āļø" : "ā ļø"} bash finished (session ${formatSessionSnippet(sessionId)}).`,
|
|
875
|
+
`Exit: ${exitLabel}`,
|
|
876
|
+
formatOutputBlock(finished.aggregated || finished.tail)
|
|
877
|
+
].join("\n") };
|
|
878
|
+
}
|
|
879
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
880
|
+
return { text: `āļø No bash session found for ${formatSessionSnippet(sessionId)}.` };
|
|
881
|
+
}
|
|
882
|
+
if (request.action === "stop") {
|
|
883
|
+
const sessionId = normalizeOptionalString(request.sessionId) || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
884
|
+
if (!sessionId) return { text: "āļø No active bash job." };
|
|
885
|
+
const { running } = getScopedSession(sessionId);
|
|
886
|
+
if (!running) {
|
|
887
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
888
|
+
return { text: `āļø No running bash job found for ${formatSessionSnippet(sessionId)}.` };
|
|
889
|
+
}
|
|
890
|
+
if (!running.backgrounded) return { text: `ā ļø Session ${formatSessionSnippet(sessionId)} is not backgrounded.` };
|
|
891
|
+
const pid = running.pid ?? running.child?.pid;
|
|
892
|
+
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.` };
|
|
893
|
+
const { killProcessTree } = await import("./kill-tree-DerqhtJm.js");
|
|
894
|
+
killProcessTree(pid);
|
|
895
|
+
return { text: `āļø bash stopping (session ${formatSessionSnippet(sessionId)}). Use !poll ${sessionId} to confirm exit.` };
|
|
896
|
+
}
|
|
897
|
+
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).` };
|
|
898
|
+
const commandText = request.command.trim();
|
|
899
|
+
if (!commandText) return buildUsageReply();
|
|
900
|
+
activeJob = {
|
|
901
|
+
state: "starting",
|
|
902
|
+
startedAt: Date.now(),
|
|
903
|
+
command: commandText
|
|
904
|
+
};
|
|
905
|
+
try {
|
|
906
|
+
const foregroundMs = resolveForegroundMs(params.cfg);
|
|
907
|
+
const shouldBackgroundImmediately = foregroundMs <= 0;
|
|
908
|
+
const timeoutSec = params.cfg.tools?.exec?.timeoutSec;
|
|
909
|
+
const notifyOnExit = params.cfg.tools?.exec?.notifyOnExit;
|
|
910
|
+
const notifyOnExitEmptySuccess = params.cfg.tools?.exec?.notifyOnExitEmptySuccess;
|
|
911
|
+
const result = await createExecTool({
|
|
912
|
+
scopeKey: CHAT_BASH_SCOPE_KEY,
|
|
913
|
+
allowBackground: true,
|
|
914
|
+
timeoutSec,
|
|
915
|
+
sessionKey: params.sessionKey,
|
|
916
|
+
notifyOnExit,
|
|
917
|
+
notifyOnExitEmptySuccess,
|
|
918
|
+
elevated: {
|
|
919
|
+
enabled: params.elevated.enabled,
|
|
920
|
+
allowed: params.elevated.allowed,
|
|
921
|
+
defaultLevel: "on"
|
|
922
|
+
}
|
|
923
|
+
}).execute("chat-bash", {
|
|
924
|
+
command: commandText,
|
|
925
|
+
background: shouldBackgroundImmediately,
|
|
926
|
+
yieldMs: shouldBackgroundImmediately ? void 0 : foregroundMs,
|
|
927
|
+
timeout: timeoutSec,
|
|
928
|
+
elevated: true
|
|
929
|
+
});
|
|
930
|
+
if (result.details?.status === "running") {
|
|
931
|
+
const sessionId = result.details.sessionId;
|
|
932
|
+
activeJob = {
|
|
933
|
+
state: "running",
|
|
934
|
+
sessionId,
|
|
935
|
+
startedAt: result.details.startedAt,
|
|
936
|
+
command: commandText,
|
|
937
|
+
watcherAttached: false
|
|
938
|
+
};
|
|
939
|
+
attachActiveWatcher(sessionId);
|
|
940
|
+
logVerbose(`Started bash session ${formatSessionSnippet(sessionId)}: ${commandText}`);
|
|
941
|
+
return { text: `āļø bash started (session ${sessionId}). Still running; use !poll / !stop (or /bash poll / /bash stop).` };
|
|
942
|
+
}
|
|
943
|
+
activeJob = null;
|
|
944
|
+
const exitCode = result.details?.status === "completed" ? result.details.exitCode : 0;
|
|
945
|
+
const output = result.details?.status === "completed" ? result.details.aggregated : result.content.map((chunk) => chunk.type === "text" ? chunk.text : "").join("\n");
|
|
946
|
+
return { text: [
|
|
947
|
+
`āļø bash: ${commandText}`,
|
|
948
|
+
`Exit: ${exitCode}`,
|
|
949
|
+
formatOutputBlock(output || "(no output)")
|
|
950
|
+
].join("\n") };
|
|
951
|
+
} catch (err) {
|
|
952
|
+
activeJob = null;
|
|
953
|
+
const message = formatErrorMessage(err);
|
|
954
|
+
return { text: [`ā ļø bash failed: ${commandText}`, formatOutputBlock(message)].join("\n") };
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/auto-reply/reply/commands-bash.ts
|
|
959
|
+
const handleBashCommand = async (params, allowTextCommands) => {
|
|
960
|
+
if (!allowTextCommands) return null;
|
|
961
|
+
const { command } = params;
|
|
962
|
+
const bashSlashRequested = command.commandBodyNormalized === "/bash" || command.commandBodyNormalized.startsWith("/bash ");
|
|
963
|
+
const bashBangRequested = command.commandBodyNormalized.startsWith("!");
|
|
964
|
+
if (!bashSlashRequested && !(bashBangRequested && command.isAuthorizedSender)) return null;
|
|
965
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/bash");
|
|
966
|
+
if (unauthorized) return unauthorized;
|
|
967
|
+
return {
|
|
968
|
+
shouldContinue: false,
|
|
969
|
+
reply: await handleBashChatCommand({
|
|
970
|
+
ctx: params.ctx,
|
|
971
|
+
cfg: params.cfg,
|
|
972
|
+
agentId: params.agentId,
|
|
973
|
+
sessionKey: params.sessionKey,
|
|
974
|
+
isGroup: params.isGroup,
|
|
975
|
+
elevated: params.elevated
|
|
976
|
+
})
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/agents/btw.ts
|
|
981
|
+
function collectTextContent(content) {
|
|
982
|
+
return content.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
983
|
+
}
|
|
984
|
+
function collectThinkingContent(content) {
|
|
985
|
+
return content.filter((part) => part.type === "thinking").map((part) => part.thinking).join("");
|
|
986
|
+
}
|
|
987
|
+
function buildBtwSystemPrompt() {
|
|
988
|
+
return [
|
|
989
|
+
"You are answering an ephemeral /btw side question about the current conversation.",
|
|
990
|
+
"Use the conversation only as background context.",
|
|
991
|
+
"Answer only the side question in the last user message.",
|
|
992
|
+
"Do not continue, resume, or complete any unfinished task from the conversation.",
|
|
993
|
+
"Do not emit tool calls, pseudo-tool calls, shell commands, file writes, patches, or code unless the side question explicitly asks for them.",
|
|
994
|
+
"Do not say you will continue the main task after answering.",
|
|
995
|
+
"If the question can be answered briefly, answer briefly."
|
|
996
|
+
].join("\n");
|
|
997
|
+
}
|
|
998
|
+
function buildBtwQuestionPrompt(question, inFlightPrompt) {
|
|
999
|
+
const lines = ["Answer this side question only.", "Ignore any unfinished task in the conversation while answering it."];
|
|
1000
|
+
const trimmedPrompt = inFlightPrompt?.trim();
|
|
1001
|
+
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.");
|
|
1002
|
+
lines.push("", "<btw_side_question>", question.trim(), "</btw_side_question>");
|
|
1003
|
+
return lines.join("\n");
|
|
1004
|
+
}
|
|
1005
|
+
function toSimpleContextMessages(messages) {
|
|
1006
|
+
return stripToolResultDetails(messages.filter((message) => {
|
|
1007
|
+
if (!message || typeof message !== "object") return false;
|
|
1008
|
+
const role = message.role;
|
|
1009
|
+
return role === "user" || role === "assistant";
|
|
1010
|
+
}));
|
|
1011
|
+
}
|
|
1012
|
+
function resolveSessionTranscriptPath(params) {
|
|
1013
|
+
try {
|
|
1014
|
+
const agentId = params.sessionKey?.split(":")[1];
|
|
1015
|
+
const pathOpts = resolveSessionFilePathOptions({
|
|
1016
|
+
agentId,
|
|
1017
|
+
storePath: params.storePath
|
|
1018
|
+
});
|
|
1019
|
+
return resolveSessionFilePath(params.sessionId, params.sessionEntry, pathOpts);
|
|
1020
|
+
} catch (error) {
|
|
1021
|
+
diag.debug(`resolveSessionTranscriptPath failed: sessionId=${params.sessionId} err=${String(error)}`);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
async function resolveRuntimeModel(params) {
|
|
1026
|
+
await ensureKaijiBotModelsJson(params.cfg, params.agentDir);
|
|
1027
|
+
const modelRegistry = discoverModels(discoverAuthStorage(params.agentDir), params.agentDir);
|
|
1028
|
+
const model = resolveModelWithRegistry({
|
|
1029
|
+
provider: params.provider,
|
|
1030
|
+
modelId: params.model,
|
|
1031
|
+
modelRegistry,
|
|
1032
|
+
cfg: params.cfg
|
|
1033
|
+
});
|
|
1034
|
+
if (!model) throw new Error(`Unknown model: ${params.provider}/${params.model}`);
|
|
1035
|
+
return {
|
|
1036
|
+
model,
|
|
1037
|
+
authProfileId: await resolveSessionAuthProfileOverride({
|
|
1038
|
+
cfg: params.cfg,
|
|
1039
|
+
provider: params.provider,
|
|
1040
|
+
agentDir: params.agentDir,
|
|
1041
|
+
sessionEntry: params.sessionEntry,
|
|
1042
|
+
sessionStore: params.sessionStore,
|
|
1043
|
+
sessionKey: params.sessionKey,
|
|
1044
|
+
storePath: params.storePath,
|
|
1045
|
+
isNewSession: params.isNewSession
|
|
1046
|
+
}),
|
|
1047
|
+
authProfileIdSource: params.sessionEntry?.authProfileOverrideSource
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
async function runBtwSideQuestion(params) {
|
|
1051
|
+
const sessionId = params.sessionEntry.sessionId?.trim();
|
|
1052
|
+
if (!sessionId) throw new Error("No active session context.");
|
|
1053
|
+
const sessionFile = resolveSessionTranscriptPath({
|
|
1054
|
+
sessionId,
|
|
1055
|
+
sessionEntry: params.sessionEntry,
|
|
1056
|
+
sessionKey: params.sessionKey,
|
|
1057
|
+
storePath: params.storePath
|
|
1058
|
+
});
|
|
1059
|
+
if (!sessionFile) throw new Error("No active session transcript.");
|
|
1060
|
+
const sessionManager = SessionManager.open(sessionFile);
|
|
1061
|
+
const activeRunSnapshot = getActiveEmbeddedRunSnapshot(sessionId);
|
|
1062
|
+
let messages = [];
|
|
1063
|
+
let inFlightPrompt;
|
|
1064
|
+
if (Array.isArray(activeRunSnapshot?.messages) && activeRunSnapshot.messages.length > 0) {
|
|
1065
|
+
messages = toSimpleContextMessages(activeRunSnapshot.messages);
|
|
1066
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1067
|
+
} else if (activeRunSnapshot) {
|
|
1068
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1069
|
+
if (activeRunSnapshot.transcriptLeafId && sessionManager.branch) try {
|
|
1070
|
+
sessionManager.branch(activeRunSnapshot.transcriptLeafId);
|
|
1071
|
+
} catch (error) {
|
|
1072
|
+
diag.debug(`btw snapshot leaf unavailable: sessionId=${sessionId} leaf=${activeRunSnapshot.transcriptLeafId} err=${String(error)}`);
|
|
1073
|
+
sessionManager.resetLeaf?.();
|
|
1074
|
+
}
|
|
1075
|
+
else sessionManager.resetLeaf?.();
|
|
1076
|
+
} else {
|
|
1077
|
+
const leafEntry = sessionManager.getLeafEntry?.();
|
|
1078
|
+
if (leafEntry?.type === "message" && leafEntry.message?.role === "user") if (leafEntry.parentId && sessionManager.branch) sessionManager.branch(leafEntry.parentId);
|
|
1079
|
+
else sessionManager.resetLeaf?.();
|
|
1080
|
+
}
|
|
1081
|
+
if (messages.length === 0) {
|
|
1082
|
+
const sessionContext = sessionManager.buildSessionContext();
|
|
1083
|
+
messages = toSimpleContextMessages(Array.isArray(sessionContext.messages) ? sessionContext.messages : []);
|
|
1084
|
+
}
|
|
1085
|
+
if (messages.length === 0 && !inFlightPrompt?.trim()) throw new Error("No active session context.");
|
|
1086
|
+
const { model, authProfileId } = await resolveRuntimeModel({
|
|
1087
|
+
cfg: params.cfg,
|
|
1088
|
+
provider: params.provider,
|
|
1089
|
+
model: params.model,
|
|
1090
|
+
agentDir: params.agentDir,
|
|
1091
|
+
sessionEntry: params.sessionEntry,
|
|
1092
|
+
sessionStore: params.sessionStore,
|
|
1093
|
+
sessionKey: params.sessionKey,
|
|
1094
|
+
storePath: params.storePath,
|
|
1095
|
+
isNewSession: params.isNewSession
|
|
1096
|
+
});
|
|
1097
|
+
const apiKey = requireApiKey(await getApiKeyForModel({
|
|
1098
|
+
model,
|
|
1099
|
+
cfg: params.cfg,
|
|
1100
|
+
profileId: authProfileId,
|
|
1101
|
+
agentDir: params.agentDir
|
|
1102
|
+
}), model.provider);
|
|
1103
|
+
const chunker = params.opts?.onBlockReply && params.blockReplyChunking ? new EmbeddedBlockChunker(params.blockReplyChunking) : void 0;
|
|
1104
|
+
let emittedBlocks = 0;
|
|
1105
|
+
let blockEmitChain = Promise.resolve();
|
|
1106
|
+
let answerText = "";
|
|
1107
|
+
let reasoningText = "";
|
|
1108
|
+
let assistantStarted = false;
|
|
1109
|
+
let sawTextEvent = false;
|
|
1110
|
+
const emitBlockChunk = async (text) => {
|
|
1111
|
+
if (!text.trim() || !params.opts?.onBlockReply) return;
|
|
1112
|
+
emittedBlocks += 1;
|
|
1113
|
+
blockEmitChain = blockEmitChain.then(async () => {
|
|
1114
|
+
await params.opts?.onBlockReply?.({
|
|
1115
|
+
text,
|
|
1116
|
+
btw: { question: params.question }
|
|
1117
|
+
});
|
|
1118
|
+
});
|
|
1119
|
+
await blockEmitChain;
|
|
1120
|
+
};
|
|
1121
|
+
const stream = streamSimple(model, {
|
|
1122
|
+
systemPrompt: buildBtwSystemPrompt(),
|
|
1123
|
+
messages: [...messages, {
|
|
1124
|
+
role: "user",
|
|
1125
|
+
content: [{
|
|
1126
|
+
type: "text",
|
|
1127
|
+
text: buildBtwQuestionPrompt(params.question, inFlightPrompt)
|
|
1128
|
+
}],
|
|
1129
|
+
timestamp: Date.now()
|
|
1130
|
+
}]
|
|
1131
|
+
}, {
|
|
1132
|
+
apiKey,
|
|
1133
|
+
reasoning: void 0,
|
|
1134
|
+
signal: params.opts?.abortSignal
|
|
1135
|
+
});
|
|
1136
|
+
let finalEvent;
|
|
1137
|
+
for await (const event of stream) {
|
|
1138
|
+
finalEvent = event.type === "done" || event.type === "error" ? event : finalEvent;
|
|
1139
|
+
if (!assistantStarted && (event.type === "text_start" || event.type === "start")) {
|
|
1140
|
+
assistantStarted = true;
|
|
1141
|
+
await params.opts?.onAssistantMessageStart?.();
|
|
1142
|
+
}
|
|
1143
|
+
if (event.type === "text_delta") {
|
|
1144
|
+
sawTextEvent = true;
|
|
1145
|
+
answerText += event.delta;
|
|
1146
|
+
chunker?.append(event.delta);
|
|
1147
|
+
if (chunker && params.resolvedBlockStreamingBreak === "text_end") chunker.drain({
|
|
1148
|
+
force: false,
|
|
1149
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1150
|
+
});
|
|
1151
|
+
continue;
|
|
1152
|
+
}
|
|
1153
|
+
if (event.type === "text_end" && chunker && params.resolvedBlockStreamingBreak === "text_end") {
|
|
1154
|
+
chunker.drain({
|
|
1155
|
+
force: true,
|
|
1156
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1157
|
+
});
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
if (event.type === "thinking_delta") {
|
|
1161
|
+
reasoningText += event.delta;
|
|
1162
|
+
if (params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningStream?.({
|
|
1163
|
+
text: reasoningText,
|
|
1164
|
+
isReasoning: true
|
|
1165
|
+
});
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
if (event.type === "thinking_end" && params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningEnd?.();
|
|
1169
|
+
}
|
|
1170
|
+
if (chunker && params.resolvedBlockStreamingBreak !== "text_end" && chunker.hasBuffered()) chunker.drain({
|
|
1171
|
+
force: true,
|
|
1172
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1173
|
+
});
|
|
1174
|
+
await blockEmitChain;
|
|
1175
|
+
if (finalEvent?.type === "error") {
|
|
1176
|
+
const message = collectTextContent(finalEvent.error.content);
|
|
1177
|
+
throw new Error(message || finalEvent.error.errorMessage || "BTW failed.");
|
|
1178
|
+
}
|
|
1179
|
+
const finalMessage = finalEvent?.type === "done" ? finalEvent.message : void 0;
|
|
1180
|
+
if (finalMessage) {
|
|
1181
|
+
if (!sawTextEvent) answerText = collectTextContent(finalMessage.content);
|
|
1182
|
+
if (!reasoningText) reasoningText = collectThinkingContent(finalMessage.content);
|
|
1183
|
+
}
|
|
1184
|
+
const answer = answerText.trim();
|
|
1185
|
+
if (!answer) throw new Error("No BTW response generated.");
|
|
1186
|
+
if (emittedBlocks > 0) return;
|
|
1187
|
+
return { text: answer };
|
|
1188
|
+
}
|
|
1189
|
+
//#endregion
|
|
1190
|
+
//#region src/auto-reply/reply/commands-btw.ts
|
|
1191
|
+
const BTW_USAGE = "Usage: /btw <side question>";
|
|
1192
|
+
const handleBtwCommand = async (params, allowTextCommands) => {
|
|
1193
|
+
if (!allowTextCommands) return null;
|
|
1194
|
+
const question = extractBtwQuestion(params.command.commandBodyNormalized);
|
|
1195
|
+
if (question === null) return null;
|
|
1196
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/btw");
|
|
1197
|
+
if (unauthorized) return unauthorized;
|
|
1198
|
+
if (!question) return {
|
|
1199
|
+
shouldContinue: false,
|
|
1200
|
+
reply: { text: BTW_USAGE }
|
|
1201
|
+
};
|
|
1202
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
1203
|
+
shouldContinue: false,
|
|
1204
|
+
reply: { text: "ā ļø /btw requires an active session with existing context." }
|
|
1205
|
+
};
|
|
1206
|
+
const agentDir = params.agentDir ?? (params.agentId ? resolveAgentDir(params.cfg, params.agentId) : void 0);
|
|
1207
|
+
if (!agentDir) return {
|
|
1208
|
+
shouldContinue: false,
|
|
1209
|
+
reply: { text: "ā ļø /btw is unavailable because the active agent directory could not be resolved." }
|
|
1210
|
+
};
|
|
1211
|
+
try {
|
|
1212
|
+
await params.typing?.startTypingLoop();
|
|
1213
|
+
const reply = await runBtwSideQuestion({
|
|
1214
|
+
cfg: params.cfg,
|
|
1215
|
+
agentDir,
|
|
1216
|
+
provider: params.provider,
|
|
1217
|
+
model: params.model,
|
|
1218
|
+
question,
|
|
1219
|
+
sessionEntry: params.sessionEntry,
|
|
1220
|
+
sessionStore: params.sessionStore,
|
|
1221
|
+
sessionKey: params.sessionKey,
|
|
1222
|
+
storePath: params.storePath,
|
|
1223
|
+
resolvedThinkLevel: "off",
|
|
1224
|
+
resolvedReasoningLevel: "off",
|
|
1225
|
+
blockReplyChunking: params.blockReplyChunking,
|
|
1226
|
+
resolvedBlockStreamingBreak: params.resolvedBlockStreamingBreak,
|
|
1227
|
+
opts: params.opts,
|
|
1228
|
+
isNewSession: false
|
|
1229
|
+
});
|
|
1230
|
+
return {
|
|
1231
|
+
shouldContinue: false,
|
|
1232
|
+
reply: reply ? {
|
|
1233
|
+
...reply,
|
|
1234
|
+
btw: { question }
|
|
1235
|
+
} : reply
|
|
1236
|
+
};
|
|
1237
|
+
} catch (error) {
|
|
1238
|
+
const message = error instanceof Error ? error.message.trim() : "";
|
|
1239
|
+
return {
|
|
1240
|
+
shouldContinue: false,
|
|
1241
|
+
reply: {
|
|
1242
|
+
text: `ā ļø /btw failed${message ? `: ${message}` : "."}`,
|
|
1243
|
+
btw: { question },
|
|
1244
|
+
isError: true
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
//#endregion
|
|
1250
|
+
//#region src/auto-reply/reply/commands-compact.ts
|
|
1251
|
+
function extractCompactInstructions(params) {
|
|
1252
|
+
const raw = stripStructuralPrefixes(params.rawBody ?? "");
|
|
1253
|
+
const trimmed = (params.isGroup ? stripMentions(raw, params.ctx, params.cfg, params.agentId) : raw).trim();
|
|
1254
|
+
if (!trimmed) return;
|
|
1255
|
+
const prefix = normalizeLowercaseStringOrEmpty(trimmed).startsWith("/compact") ? "/compact" : null;
|
|
1256
|
+
if (!prefix) return;
|
|
1257
|
+
let rest = trimmed.slice(prefix.length).trimStart();
|
|
1258
|
+
if (rest.startsWith(":")) rest = rest.slice(1).trimStart();
|
|
1259
|
+
return rest.length ? rest : void 0;
|
|
1260
|
+
}
|
|
1261
|
+
function isCompactionSkipReason(reason) {
|
|
1262
|
+
const text = normalizeOptionalLowercaseString(reason) ?? "";
|
|
1263
|
+
return text.includes("nothing to compact") || text.includes("below threshold") || text.includes("already compacted") || text.includes("no real conversation messages");
|
|
1264
|
+
}
|
|
1265
|
+
function formatCompactionReason(reason) {
|
|
1266
|
+
const text = normalizeOptionalString(reason);
|
|
1267
|
+
if (!text) return;
|
|
1268
|
+
const lower = normalizeLowercaseStringOrEmpty(text);
|
|
1269
|
+
if (lower.includes("nothing to compact")) return "nothing compactable in this session yet";
|
|
1270
|
+
if (lower.includes("below threshold")) return "context is below the compaction threshold";
|
|
1271
|
+
if (lower.includes("already compacted")) return "session was already compacted recently";
|
|
1272
|
+
if (lower.includes("no real conversation messages")) return "no real conversation messages yet";
|
|
1273
|
+
return text;
|
|
1274
|
+
}
|
|
1275
|
+
const handleCompactCommand = async (params) => {
|
|
1276
|
+
if (!(params.command.commandBodyNormalized === "/compact" || params.command.commandBodyNormalized.startsWith("/compact "))) return null;
|
|
1277
|
+
if (!params.command.isAuthorizedSender) {
|
|
1278
|
+
logVerbose(`Ignoring /compact from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
1279
|
+
return { shouldContinue: false };
|
|
1280
|
+
}
|
|
1281
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
1282
|
+
shouldContinue: false,
|
|
1283
|
+
reply: { text: "āļø Compaction unavailable (missing session id)." }
|
|
1284
|
+
};
|
|
1285
|
+
const runtime = await import("./commands-compact.runtime-BOM8PsWH.js");
|
|
1286
|
+
const sessionId = params.sessionEntry.sessionId;
|
|
1287
|
+
if (runtime.isEmbeddedPiRunActive(sessionId)) {
|
|
1288
|
+
runtime.abortEmbeddedPiRun(sessionId);
|
|
1289
|
+
await runtime.waitForEmbeddedPiRunEnd(sessionId, 15e3);
|
|
1290
|
+
}
|
|
1291
|
+
const customInstructions = extractCompactInstructions({
|
|
1292
|
+
rawBody: params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body,
|
|
1293
|
+
ctx: params.ctx,
|
|
1294
|
+
cfg: params.cfg,
|
|
1295
|
+
agentId: params.agentId,
|
|
1296
|
+
isGroup: params.isGroup
|
|
1297
|
+
});
|
|
1298
|
+
const result = await runtime.compactEmbeddedPiSession({
|
|
1299
|
+
sessionId,
|
|
1300
|
+
sessionKey: params.sessionKey,
|
|
1301
|
+
allowGatewaySubagentBinding: true,
|
|
1302
|
+
messageChannel: params.command.channel,
|
|
1303
|
+
groupId: params.sessionEntry.groupId,
|
|
1304
|
+
groupChannel: params.sessionEntry.groupChannel,
|
|
1305
|
+
groupSpace: params.sessionEntry.space,
|
|
1306
|
+
spawnedBy: params.sessionEntry.spawnedBy,
|
|
1307
|
+
sessionFile: runtime.resolveSessionFilePath(sessionId, params.sessionEntry, runtime.resolveSessionFilePathOptions({
|
|
1308
|
+
agentId: params.agentId,
|
|
1309
|
+
storePath: params.storePath
|
|
1310
|
+
})),
|
|
1311
|
+
workspaceDir: params.workspaceDir,
|
|
1312
|
+
agentDir: params.agentDir,
|
|
1313
|
+
config: params.cfg,
|
|
1314
|
+
skillsSnapshot: params.sessionEntry.skillsSnapshot,
|
|
1315
|
+
provider: params.provider,
|
|
1316
|
+
model: params.model,
|
|
1317
|
+
thinkLevel: params.resolvedThinkLevel ?? await params.resolveDefaultThinkingLevel(),
|
|
1318
|
+
bashElevated: {
|
|
1319
|
+
enabled: false,
|
|
1320
|
+
allowed: false,
|
|
1321
|
+
defaultLevel: "off"
|
|
1322
|
+
},
|
|
1323
|
+
customInstructions,
|
|
1324
|
+
trigger: "manual",
|
|
1325
|
+
senderIsOwner: params.command.senderIsOwner,
|
|
1326
|
+
ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : void 0
|
|
1327
|
+
});
|
|
1328
|
+
const compactLabel = result.ok || isCompactionSkipReason(result.reason) ? result.compacted ? result.result?.tokensBefore != null && result.result?.tokensAfter != null ? `Compacted (${runtime.formatTokenCount(result.result.tokensBefore)} ā ${runtime.formatTokenCount(result.result.tokensAfter)})` : result.result?.tokensBefore ? `Compacted (${runtime.formatTokenCount(result.result.tokensBefore)} before)` : "Compacted" : "Compaction skipped" : "Compaction failed";
|
|
1329
|
+
if (result.ok && result.compacted) await runtime.incrementCompactionCount({
|
|
1330
|
+
cfg: params.cfg,
|
|
1331
|
+
sessionEntry: params.sessionEntry,
|
|
1332
|
+
sessionStore: params.sessionStore,
|
|
1333
|
+
sessionKey: params.sessionKey,
|
|
1334
|
+
storePath: params.storePath,
|
|
1335
|
+
tokensAfter: result.result?.tokensAfter
|
|
1336
|
+
});
|
|
1337
|
+
const totalTokens = result.result?.tokensAfter ?? runtime.resolveFreshSessionTotalTokens(params.sessionEntry);
|
|
1338
|
+
const contextSummary = runtime.formatContextUsageShort(typeof totalTokens === "number" && totalTokens > 0 ? totalTokens : null, params.contextTokens ?? params.sessionEntry.contextTokens ?? null);
|
|
1339
|
+
const reason = formatCompactionReason(result.reason);
|
|
1340
|
+
const line = reason ? `${compactLabel}: ${reason} ⢠${contextSummary}` : `${compactLabel} ⢠${contextSummary}`;
|
|
1341
|
+
runtime.enqueueSystemEvent(line, { sessionKey: params.sessionKey });
|
|
1342
|
+
return {
|
|
1343
|
+
shouldContinue: false,
|
|
1344
|
+
reply: { text: `āļø ${line}` }
|
|
1345
|
+
};
|
|
1346
|
+
};
|
|
1347
|
+
//#endregion
|
|
1348
|
+
//#region src/auto-reply/reply/commands-slash-parse.ts
|
|
1349
|
+
function parseSlashCommandActionArgs(raw, slash) {
|
|
1350
|
+
const trimmed = raw.trim();
|
|
1351
|
+
const slashLower = normalizeLowercaseStringOrEmpty(slash);
|
|
1352
|
+
if (!normalizeLowercaseStringOrEmpty(trimmed).startsWith(slashLower)) return { kind: "no-match" };
|
|
1353
|
+
const charAfter = trimmed.charAt(slash.length);
|
|
1354
|
+
if (charAfter && !/[\s:]/.test(charAfter)) return { kind: "no-match" };
|
|
1355
|
+
const rest = trimmed.slice(slash.length).trim();
|
|
1356
|
+
if (!rest) return { kind: "empty" };
|
|
1357
|
+
const match = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
1358
|
+
if (!match) return { kind: "invalid" };
|
|
1359
|
+
return {
|
|
1360
|
+
kind: "parsed",
|
|
1361
|
+
action: normalizeLowercaseStringOrEmpty(match[1]),
|
|
1362
|
+
args: (match[2] ?? "").trim()
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
function parseSlashCommandOrNull(raw, slash, opts) {
|
|
1366
|
+
const parsed = parseSlashCommandActionArgs(raw, slash);
|
|
1367
|
+
if (parsed.kind === "no-match") return null;
|
|
1368
|
+
if (parsed.kind === "invalid") return {
|
|
1369
|
+
ok: false,
|
|
1370
|
+
message: opts.invalidMessage
|
|
1371
|
+
};
|
|
1372
|
+
if (parsed.kind === "empty") return {
|
|
1373
|
+
ok: true,
|
|
1374
|
+
action: opts.defaultAction ?? "show",
|
|
1375
|
+
args: ""
|
|
1376
|
+
};
|
|
1377
|
+
return {
|
|
1378
|
+
ok: true,
|
|
1379
|
+
action: parsed.action,
|
|
1380
|
+
args: parsed.args
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
//#endregion
|
|
1384
|
+
//#region src/auto-reply/reply/commands-setunset.ts
|
|
1385
|
+
function parseSetUnsetCommand(params) {
|
|
1386
|
+
const action = params.action;
|
|
1387
|
+
const args = params.args.trim();
|
|
1388
|
+
if (action === "unset") {
|
|
1389
|
+
if (!args) return {
|
|
1390
|
+
kind: "error",
|
|
1391
|
+
message: `Usage: ${params.slash} unset path`
|
|
1392
|
+
};
|
|
1393
|
+
return {
|
|
1394
|
+
kind: "unset",
|
|
1395
|
+
path: args
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
if (!args) return {
|
|
1399
|
+
kind: "error",
|
|
1400
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1401
|
+
};
|
|
1402
|
+
const eqIndex = args.indexOf("=");
|
|
1403
|
+
if (eqIndex <= 0) return {
|
|
1404
|
+
kind: "error",
|
|
1405
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1406
|
+
};
|
|
1407
|
+
const path = args.slice(0, eqIndex).trim();
|
|
1408
|
+
const rawValue = args.slice(eqIndex + 1);
|
|
1409
|
+
if (!path) return {
|
|
1410
|
+
kind: "error",
|
|
1411
|
+
message: `Usage: ${params.slash} set path=value`
|
|
1412
|
+
};
|
|
1413
|
+
const parsed = parseConfigValue(rawValue);
|
|
1414
|
+
if (parsed.error) return {
|
|
1415
|
+
kind: "error",
|
|
1416
|
+
message: parsed.error
|
|
1417
|
+
};
|
|
1418
|
+
return {
|
|
1419
|
+
kind: "set",
|
|
1420
|
+
path,
|
|
1421
|
+
value: parsed.value
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
function parseSetUnsetCommandAction(params) {
|
|
1425
|
+
if (params.action !== "set" && params.action !== "unset") return null;
|
|
1426
|
+
const parsed = parseSetUnsetCommand({
|
|
1427
|
+
slash: params.slash,
|
|
1428
|
+
action: params.action,
|
|
1429
|
+
args: params.args
|
|
1430
|
+
});
|
|
1431
|
+
if (parsed.kind === "error") return params.onError(parsed.message);
|
|
1432
|
+
return parsed.kind === "set" ? params.onSet(parsed.path, parsed.value) : params.onUnset(parsed.path);
|
|
1433
|
+
}
|
|
1434
|
+
function parseSlashCommandWithSetUnset(params) {
|
|
1435
|
+
const parsed = parseSlashCommandOrNull(params.raw, params.slash, { invalidMessage: params.invalidMessage });
|
|
1436
|
+
if (!parsed) return null;
|
|
1437
|
+
if (!parsed.ok) return params.onError(parsed.message);
|
|
1438
|
+
const { action, args } = parsed;
|
|
1439
|
+
const setUnset = parseSetUnsetCommandAction({
|
|
1440
|
+
slash: params.slash,
|
|
1441
|
+
action,
|
|
1442
|
+
args,
|
|
1443
|
+
onSet: params.onSet,
|
|
1444
|
+
onUnset: params.onUnset,
|
|
1445
|
+
onError: params.onError
|
|
1446
|
+
});
|
|
1447
|
+
if (setUnset) return setUnset;
|
|
1448
|
+
const knownAction = params.onKnownAction(action, args);
|
|
1449
|
+
if (knownAction) return knownAction;
|
|
1450
|
+
return params.onError(params.usageMessage);
|
|
1451
|
+
}
|
|
1452
|
+
//#endregion
|
|
1453
|
+
//#region src/auto-reply/reply/commands-setunset-standard.ts
|
|
1454
|
+
function parseStandardSetUnsetSlashCommand(params) {
|
|
1455
|
+
return parseSlashCommandWithSetUnset({
|
|
1456
|
+
raw: params.raw,
|
|
1457
|
+
slash: params.slash,
|
|
1458
|
+
invalidMessage: params.invalidMessage,
|
|
1459
|
+
usageMessage: params.usageMessage,
|
|
1460
|
+
onKnownAction: params.onKnownAction,
|
|
1461
|
+
onSet: params.onSet ?? ((path, value) => ({
|
|
1462
|
+
action: "set",
|
|
1463
|
+
path,
|
|
1464
|
+
value
|
|
1465
|
+
})),
|
|
1466
|
+
onUnset: params.onUnset ?? ((path) => ({
|
|
1467
|
+
action: "unset",
|
|
1468
|
+
path
|
|
1469
|
+
})),
|
|
1470
|
+
onError: params.onError ?? ((message) => ({
|
|
1471
|
+
action: "error",
|
|
1472
|
+
message
|
|
1473
|
+
}))
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
//#endregion
|
|
1477
|
+
//#region src/auto-reply/reply/config-commands.ts
|
|
1478
|
+
function parseConfigCommand(raw) {
|
|
1479
|
+
return parseStandardSetUnsetSlashCommand({
|
|
1480
|
+
raw,
|
|
1481
|
+
slash: "/config",
|
|
1482
|
+
invalidMessage: "Invalid /config syntax.",
|
|
1483
|
+
usageMessage: "Usage: /config show|set|unset",
|
|
1484
|
+
onKnownAction: (action, args) => {
|
|
1485
|
+
if (action === "show" || action === "get") return {
|
|
1486
|
+
action: "show",
|
|
1487
|
+
path: args || void 0
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region src/auto-reply/reply/debug-commands.ts
|
|
1494
|
+
function parseDebugCommand(raw) {
|
|
1495
|
+
return parseStandardSetUnsetSlashCommand({
|
|
1496
|
+
raw,
|
|
1497
|
+
slash: "/debug",
|
|
1498
|
+
invalidMessage: "Invalid /debug syntax.",
|
|
1499
|
+
usageMessage: "Usage: /debug show|set|unset|reset",
|
|
1500
|
+
onKnownAction: (action) => {
|
|
1501
|
+
if (action === "show") return { action: "show" };
|
|
1502
|
+
if (action === "reset") return { action: "reset" };
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region src/auto-reply/reply/commands-config.ts
|
|
1508
|
+
const handleConfigCommand = async (params, allowTextCommands) => {
|
|
1509
|
+
if (!allowTextCommands) return null;
|
|
1510
|
+
const configCommand = parseConfigCommand(params.command.commandBodyNormalized);
|
|
1511
|
+
if (!configCommand) return null;
|
|
1512
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/config");
|
|
1513
|
+
if (unauthorized) return unauthorized;
|
|
1514
|
+
const nonOwner = configCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/config");
|
|
1515
|
+
if (nonOwner) return nonOwner;
|
|
1516
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1517
|
+
label: "/config",
|
|
1518
|
+
configKey: "config"
|
|
1519
|
+
});
|
|
1520
|
+
if (disabled) return disabled;
|
|
1521
|
+
if (configCommand.action === "error") return {
|
|
1522
|
+
shouldContinue: false,
|
|
1523
|
+
reply: { text: `ā ļø ${configCommand.message}` }
|
|
1524
|
+
};
|
|
1525
|
+
let parsedWritePath;
|
|
1526
|
+
if (configCommand.action === "set" || configCommand.action === "unset") {
|
|
1527
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
1528
|
+
label: "/config write",
|
|
1529
|
+
allowedScopes: ["operator.admin"],
|
|
1530
|
+
missingText: "ā /config set|unset requires operator.admin for gateway clients."
|
|
1531
|
+
});
|
|
1532
|
+
if (missingAdminScope) return missingAdminScope;
|
|
1533
|
+
const parsedPath = parseConfigPath(configCommand.path);
|
|
1534
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1535
|
+
shouldContinue: false,
|
|
1536
|
+
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1537
|
+
};
|
|
1538
|
+
parsedWritePath = parsedPath.path;
|
|
1539
|
+
const channelId = params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
1540
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
1541
|
+
cfg: params.cfg,
|
|
1542
|
+
channel: params.command.channel,
|
|
1543
|
+
channelId,
|
|
1544
|
+
accountId: resolveChannelAccountId({
|
|
1545
|
+
cfg: params.cfg,
|
|
1546
|
+
ctx: params.ctx,
|
|
1547
|
+
command: params.command
|
|
1548
|
+
}),
|
|
1549
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
1550
|
+
target: resolveConfigWriteTargetFromPath(parsedWritePath)
|
|
1551
|
+
});
|
|
1552
|
+
if (deniedText) return {
|
|
1553
|
+
shouldContinue: false,
|
|
1554
|
+
reply: { text: deniedText }
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
const snapshot = await readConfigFileSnapshot();
|
|
1558
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
1559
|
+
shouldContinue: false,
|
|
1560
|
+
reply: { text: "ā ļø Config file is invalid; fix it before using /config." }
|
|
1561
|
+
};
|
|
1562
|
+
const parsedBase = structuredClone(snapshot.parsed);
|
|
1563
|
+
if (configCommand.action === "show") {
|
|
1564
|
+
const pathRaw = normalizeOptionalString(configCommand.path);
|
|
1565
|
+
if (pathRaw) {
|
|
1566
|
+
const parsedPath = parseConfigPath(pathRaw);
|
|
1567
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1568
|
+
shouldContinue: false,
|
|
1569
|
+
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1570
|
+
};
|
|
1571
|
+
const value = getConfigValueAtPath(parsedBase, parsedPath.path);
|
|
1572
|
+
return {
|
|
1573
|
+
shouldContinue: false,
|
|
1574
|
+
reply: { text: `āļø Config ${pathRaw}:\n\`\`\`json\n${JSON.stringify(value ?? null, null, 2)}\n\`\`\`` }
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
return {
|
|
1578
|
+
shouldContinue: false,
|
|
1579
|
+
reply: { text: `āļø Config (raw):\n\`\`\`json\n${JSON.stringify(parsedBase, null, 2)}\n\`\`\`` }
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
if (configCommand.action === "unset") {
|
|
1583
|
+
if (!unsetConfigValueAtPath(parsedBase, parsedWritePath ?? [])) return {
|
|
1584
|
+
shouldContinue: false,
|
|
1585
|
+
reply: { text: `āļø No config value found for ${configCommand.path}.` }
|
|
1586
|
+
};
|
|
1587
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1588
|
+
if (!validated.ok) {
|
|
1589
|
+
const issue = validated.issues[0];
|
|
1590
|
+
return {
|
|
1591
|
+
shouldContinue: false,
|
|
1592
|
+
reply: { text: `ā ļø Config invalid after unset (${issue.path}: ${issue.message}).` }
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
await writeConfigFile(validated.config);
|
|
1596
|
+
return {
|
|
1597
|
+
shouldContinue: false,
|
|
1598
|
+
reply: { text: `āļø Config updated: ${configCommand.path} removed.` }
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
if (configCommand.action === "set") {
|
|
1602
|
+
setConfigValueAtPath(parsedBase, parsedWritePath ?? [], configCommand.value);
|
|
1603
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1604
|
+
if (!validated.ok) {
|
|
1605
|
+
const issue = validated.issues[0];
|
|
1606
|
+
return {
|
|
1607
|
+
shouldContinue: false,
|
|
1608
|
+
reply: { text: `ā ļø Config invalid after set (${issue.path}: ${issue.message}).` }
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
await writeConfigFile(validated.config);
|
|
1612
|
+
const valueLabel = typeof configCommand.value === "string" ? `"${configCommand.value}"` : JSON.stringify(configCommand.value);
|
|
1613
|
+
return {
|
|
1614
|
+
shouldContinue: false,
|
|
1615
|
+
reply: { text: `āļø Config updated: ${configCommand.path}=${valueLabel ?? "null"}` }
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
return null;
|
|
1619
|
+
};
|
|
1620
|
+
const handleDebugCommand = async (params, allowTextCommands) => {
|
|
1621
|
+
if (!allowTextCommands) return null;
|
|
1622
|
+
const debugCommand = parseDebugCommand(params.command.commandBodyNormalized);
|
|
1623
|
+
if (!debugCommand) return null;
|
|
1624
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/debug");
|
|
1625
|
+
if (unauthorized) return unauthorized;
|
|
1626
|
+
const nonOwner = rejectNonOwnerCommand(params, "/debug");
|
|
1627
|
+
if (nonOwner) return nonOwner;
|
|
1628
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1629
|
+
label: "/debug",
|
|
1630
|
+
configKey: "debug"
|
|
1631
|
+
});
|
|
1632
|
+
if (disabled) return disabled;
|
|
1633
|
+
if (debugCommand.action === "error") return {
|
|
1634
|
+
shouldContinue: false,
|
|
1635
|
+
reply: { text: `ā ļø ${debugCommand.message}` }
|
|
1636
|
+
};
|
|
1637
|
+
if (debugCommand.action === "show") {
|
|
1638
|
+
const overrides = getConfigOverrides();
|
|
1639
|
+
if (!(Object.keys(overrides).length > 0)) return {
|
|
1640
|
+
shouldContinue: false,
|
|
1641
|
+
reply: { text: "āļø Debug overrides: (none)" }
|
|
1642
|
+
};
|
|
1643
|
+
return {
|
|
1644
|
+
shouldContinue: false,
|
|
1645
|
+
reply: { text: `āļø Debug overrides (memory-only):\n\`\`\`json\n${JSON.stringify(overrides, null, 2)}\n\`\`\`` }
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
if (debugCommand.action === "reset") {
|
|
1649
|
+
resetConfigOverrides();
|
|
1650
|
+
return {
|
|
1651
|
+
shouldContinue: false,
|
|
1652
|
+
reply: { text: "āļø Debug overrides cleared; using config on disk." }
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
if (debugCommand.action === "unset") {
|
|
1656
|
+
const result = unsetConfigOverride(debugCommand.path);
|
|
1657
|
+
if (!result.ok) return {
|
|
1658
|
+
shouldContinue: false,
|
|
1659
|
+
reply: { text: `ā ļø ${result.error ?? "Invalid path."}` }
|
|
1660
|
+
};
|
|
1661
|
+
if (!result.removed) return {
|
|
1662
|
+
shouldContinue: false,
|
|
1663
|
+
reply: { text: `āļø No debug override found for ${debugCommand.path}.` }
|
|
1664
|
+
};
|
|
1665
|
+
return {
|
|
1666
|
+
shouldContinue: false,
|
|
1667
|
+
reply: { text: `āļø Debug override removed for ${debugCommand.path}.` }
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1670
|
+
if (debugCommand.action === "set") {
|
|
1671
|
+
const result = setConfigOverride(debugCommand.path, debugCommand.value);
|
|
1672
|
+
if (!result.ok) return {
|
|
1673
|
+
shouldContinue: false,
|
|
1674
|
+
reply: { text: `ā ļø ${result.error ?? "Invalid override."}` }
|
|
1675
|
+
};
|
|
1676
|
+
const valueLabel = typeof debugCommand.value === "string" ? `"${debugCommand.value}"` : JSON.stringify(debugCommand.value);
|
|
1677
|
+
return {
|
|
1678
|
+
shouldContinue: false,
|
|
1679
|
+
reply: { text: `āļø Debug override set: ${debugCommand.path}=${valueLabel ?? "null"}` }
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
return null;
|
|
1683
|
+
};
|
|
1684
|
+
//#endregion
|
|
1685
|
+
//#region src/auto-reply/reply/commands-system-prompt.ts
|
|
1686
|
+
async function resolveCommandsSystemPromptBundle(params) {
|
|
1687
|
+
const workspaceDir = params.workspaceDir;
|
|
1688
|
+
const { sessionAgentId } = resolveSessionAgentIds({
|
|
1689
|
+
sessionKey: params.sessionKey,
|
|
1690
|
+
config: params.cfg,
|
|
1691
|
+
agentId: params.agentId
|
|
1692
|
+
});
|
|
1693
|
+
const { bootstrapFiles, contextFiles: injectedFiles } = await resolveBootstrapContextForRun({
|
|
1694
|
+
workspaceDir,
|
|
1695
|
+
config: params.cfg,
|
|
1696
|
+
sessionKey: params.sessionKey,
|
|
1697
|
+
sessionId: params.sessionEntry?.sessionId
|
|
1698
|
+
});
|
|
1699
|
+
const sandboxRuntime = resolveSandboxRuntimeStatus({
|
|
1700
|
+
cfg: params.cfg,
|
|
1701
|
+
sessionKey: params.ctx.SessionKey ?? params.sessionKey
|
|
1702
|
+
});
|
|
1703
|
+
const skillsPrompt = (() => {
|
|
1704
|
+
try {
|
|
1705
|
+
return buildWorkspaceSkillSnapshot(workspaceDir, {
|
|
1706
|
+
config: params.cfg,
|
|
1707
|
+
agentId: sessionAgentId,
|
|
1708
|
+
eligibility: { remote: getRemoteSkillEligibility({ advertiseExecNode: canExecRequestNode({
|
|
1709
|
+
cfg: params.cfg,
|
|
1710
|
+
sessionEntry: params.sessionEntry,
|
|
1711
|
+
sessionKey: params.sessionKey,
|
|
1712
|
+
agentId: sessionAgentId
|
|
1713
|
+
}) }) },
|
|
1714
|
+
snapshotVersion: getSkillsSnapshotVersion(workspaceDir)
|
|
1715
|
+
});
|
|
1716
|
+
} catch {
|
|
1717
|
+
return {
|
|
1718
|
+
prompt: "",
|
|
1719
|
+
skills: [],
|
|
1720
|
+
resolvedSkills: []
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
})().prompt ?? "";
|
|
1724
|
+
const tools = (() => {
|
|
1725
|
+
try {
|
|
1726
|
+
return createKaijiBotCodingTools({
|
|
1727
|
+
config: params.cfg,
|
|
1728
|
+
agentId: params.agentId,
|
|
1729
|
+
workspaceDir,
|
|
1730
|
+
sessionKey: params.sessionKey,
|
|
1731
|
+
allowGatewaySubagentBinding: true,
|
|
1732
|
+
messageProvider: params.command.channel,
|
|
1733
|
+
groupId: params.sessionEntry?.groupId ?? void 0,
|
|
1734
|
+
groupChannel: params.sessionEntry?.groupChannel ?? void 0,
|
|
1735
|
+
groupSpace: params.sessionEntry?.space ?? void 0,
|
|
1736
|
+
spawnedBy: params.sessionEntry?.spawnedBy ?? void 0,
|
|
1737
|
+
senderIsOwner: params.command.senderIsOwner,
|
|
1738
|
+
modelProvider: params.provider,
|
|
1739
|
+
modelId: params.model
|
|
1740
|
+
});
|
|
1741
|
+
} catch {
|
|
1742
|
+
return [];
|
|
1743
|
+
}
|
|
1744
|
+
})();
|
|
1745
|
+
const toolNames = tools.map((t) => t.name);
|
|
1746
|
+
const defaultModelRef = resolveDefaultModelForAgent({
|
|
1747
|
+
cfg: params.cfg,
|
|
1748
|
+
agentId: sessionAgentId
|
|
1749
|
+
});
|
|
1750
|
+
const defaultModelLabel = `${defaultModelRef.provider}/${defaultModelRef.model}`;
|
|
1751
|
+
const { runtimeInfo, userTimezone, userTime, userTimeFormat } = buildSystemPromptParams({
|
|
1752
|
+
config: params.cfg,
|
|
1753
|
+
agentId: sessionAgentId,
|
|
1754
|
+
workspaceDir,
|
|
1755
|
+
cwd: process.cwd(),
|
|
1756
|
+
runtime: {
|
|
1757
|
+
host: "unknown",
|
|
1758
|
+
os: "unknown",
|
|
1759
|
+
arch: "unknown",
|
|
1760
|
+
node: process.version,
|
|
1761
|
+
model: `${params.provider}/${params.model}`,
|
|
1762
|
+
defaultModel: defaultModelLabel
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
const sandboxInfo = sandboxRuntime.sandboxed ? {
|
|
1766
|
+
enabled: true,
|
|
1767
|
+
workspaceDir,
|
|
1768
|
+
workspaceAccess: "rw",
|
|
1769
|
+
elevated: {
|
|
1770
|
+
allowed: params.elevated.allowed,
|
|
1771
|
+
defaultLevel: params.resolvedElevatedLevel ?? "off"
|
|
1772
|
+
}
|
|
1773
|
+
} : { enabled: false };
|
|
1774
|
+
const ttsHint = params.cfg ? buildTtsSystemPromptHint(params.cfg) : void 0;
|
|
1775
|
+
return {
|
|
1776
|
+
systemPrompt: buildAgentSystemPrompt({
|
|
1777
|
+
workspaceDir,
|
|
1778
|
+
defaultThinkLevel: params.resolvedThinkLevel,
|
|
1779
|
+
reasoningLevel: params.resolvedReasoningLevel,
|
|
1780
|
+
extraSystemPrompt: void 0,
|
|
1781
|
+
ownerNumbers: void 0,
|
|
1782
|
+
reasoningTagHint: false,
|
|
1783
|
+
toolNames,
|
|
1784
|
+
modelAliasLines: [],
|
|
1785
|
+
userTimezone,
|
|
1786
|
+
userTime,
|
|
1787
|
+
userTimeFormat,
|
|
1788
|
+
contextFiles: injectedFiles,
|
|
1789
|
+
skillsPrompt,
|
|
1790
|
+
heartbeatPrompt: void 0,
|
|
1791
|
+
ttsHint,
|
|
1792
|
+
acpEnabled: params.cfg?.acp?.enabled !== false,
|
|
1793
|
+
runtimeInfo,
|
|
1794
|
+
sandboxInfo,
|
|
1795
|
+
memoryCitationsMode: params.cfg?.memory?.citations
|
|
1796
|
+
}),
|
|
1797
|
+
tools,
|
|
1798
|
+
skillsPrompt,
|
|
1799
|
+
bootstrapFiles,
|
|
1800
|
+
injectedFiles,
|
|
1801
|
+
sandboxRuntime
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
//#endregion
|
|
1805
|
+
//#region src/auto-reply/reply/commands-context-report.ts
|
|
1806
|
+
function formatInt(n) {
|
|
1807
|
+
return new Intl.NumberFormat("en-US").format(n);
|
|
1808
|
+
}
|
|
1809
|
+
function formatCharsAndTokens(chars) {
|
|
1810
|
+
return `${formatInt(chars)} chars (~${formatInt(estimateTokensFromChars(chars))} tok)`;
|
|
1811
|
+
}
|
|
1812
|
+
function parseContextArgs(commandBodyNormalized) {
|
|
1813
|
+
if (commandBodyNormalized === "/context") return "";
|
|
1814
|
+
if (commandBodyNormalized.startsWith("/context ")) return commandBodyNormalized.slice(8).trim();
|
|
1815
|
+
return "";
|
|
1816
|
+
}
|
|
1817
|
+
function formatListTop(entries, cap) {
|
|
1818
|
+
const sorted = [...entries].toSorted((a, b) => b.value - a.value);
|
|
1819
|
+
const top = sorted.slice(0, cap);
|
|
1820
|
+
const omitted = Math.max(0, sorted.length - top.length);
|
|
1821
|
+
return {
|
|
1822
|
+
lines: top.map((e) => `- ${e.name}: ${formatCharsAndTokens(e.value)}`),
|
|
1823
|
+
omitted
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
async function resolveContextReport(params) {
|
|
1827
|
+
const existing = params.sessionEntry?.systemPromptReport;
|
|
1828
|
+
if (existing && existing.source === "run") return existing;
|
|
1829
|
+
const bootstrapMaxChars = resolveBootstrapMaxChars(params.cfg);
|
|
1830
|
+
const bootstrapTotalMaxChars = resolveBootstrapTotalMaxChars(params.cfg);
|
|
1831
|
+
const { systemPrompt, tools, skillsPrompt, bootstrapFiles, injectedFiles, sandboxRuntime } = await resolveCommandsSystemPromptBundle(params);
|
|
1832
|
+
return buildSystemPromptReport({
|
|
1833
|
+
source: "estimate",
|
|
1834
|
+
generatedAt: Date.now(),
|
|
1835
|
+
sessionId: params.sessionEntry?.sessionId,
|
|
1836
|
+
sessionKey: params.sessionKey,
|
|
1837
|
+
provider: params.provider,
|
|
1838
|
+
model: params.model,
|
|
1839
|
+
workspaceDir: params.workspaceDir,
|
|
1840
|
+
bootstrapMaxChars,
|
|
1841
|
+
bootstrapTotalMaxChars,
|
|
1842
|
+
sandbox: {
|
|
1843
|
+
mode: sandboxRuntime.mode,
|
|
1844
|
+
sandboxed: sandboxRuntime.sandboxed
|
|
1845
|
+
},
|
|
1846
|
+
systemPrompt,
|
|
1847
|
+
bootstrapFiles,
|
|
1848
|
+
injectedFiles,
|
|
1849
|
+
skillsPrompt,
|
|
1850
|
+
tools
|
|
1851
|
+
});
|
|
1852
|
+
}
|
|
1853
|
+
async function buildContextReply(params) {
|
|
1854
|
+
const sub = normalizeLowercaseStringOrEmpty(parseContextArgs(params.command.commandBodyNormalized).split(/\s+/).filter(Boolean)[0]);
|
|
1855
|
+
if (!sub || sub === "help") return { text: [
|
|
1856
|
+
"š¾ /context",
|
|
1857
|
+
"",
|
|
1858
|
+
"What counts as context (high-level), plus a breakdown mode.",
|
|
1859
|
+
"",
|
|
1860
|
+
"Try:",
|
|
1861
|
+
"- /context list (short breakdown)",
|
|
1862
|
+
"- /context detail (per-file + per-tool + per-skill + system prompt size)",
|
|
1863
|
+
"- /context json (same, machine-readable)",
|
|
1864
|
+
"",
|
|
1865
|
+
"Inline shortcut = a command token inside a normal message (e.g. āhey /statusā). It runs immediately (allowlisted senders only) and is stripped before the model sees the remaining text."
|
|
1866
|
+
].join("\n") };
|
|
1867
|
+
const report = await resolveContextReport(params);
|
|
1868
|
+
const cachedContextUsageTokens = resolveFreshSessionTotalTokens(params.sessionEntry);
|
|
1869
|
+
const session = {
|
|
1870
|
+
totalTokens: params.sessionEntry?.totalTokens ?? null,
|
|
1871
|
+
totalTokensFresh: params.sessionEntry?.totalTokensFresh ?? null,
|
|
1872
|
+
inputTokens: params.sessionEntry?.inputTokens ?? null,
|
|
1873
|
+
outputTokens: params.sessionEntry?.outputTokens ?? null,
|
|
1874
|
+
contextTokens: params.contextTokens ?? null
|
|
1875
|
+
};
|
|
1876
|
+
if (sub === "json") return { text: JSON.stringify({
|
|
1877
|
+
report,
|
|
1878
|
+
session
|
|
1879
|
+
}, null, 2) };
|
|
1880
|
+
if (sub !== "list" && sub !== "show" && sub !== "detail" && sub !== "deep") return { text: ["Unknown /context mode.", "Use: /context, /context list, /context detail, or /context json"].join("\n") };
|
|
1881
|
+
const fileLines = report.injectedWorkspaceFiles.map((f) => {
|
|
1882
|
+
const status = f.missing ? "MISSING" : f.truncated ? "TRUNCATED" : "OK";
|
|
1883
|
+
const raw = f.missing ? "0" : formatCharsAndTokens(f.rawChars);
|
|
1884
|
+
const injected = f.missing ? "0" : formatCharsAndTokens(f.injectedChars);
|
|
1885
|
+
return `- ${f.name}: ${status} | raw ${raw} | injected ${injected}`;
|
|
1886
|
+
});
|
|
1887
|
+
const sandboxLine = `Sandbox: mode=${report.sandbox?.mode ?? "unknown"} sandboxed=${report.sandbox?.sandboxed ?? false}`;
|
|
1888
|
+
const toolSchemaLine = `Tool schemas (JSON): ${formatCharsAndTokens(report.tools.schemaChars)} (counts toward context; not shown as text)`;
|
|
1889
|
+
const toolListLine = `Tool list (system prompt text): ${formatCharsAndTokens(report.tools.listChars)}`;
|
|
1890
|
+
const skillNameSet = new Set(report.skills.entries.map((s) => s.name));
|
|
1891
|
+
const skillNames = Array.from(skillNameSet);
|
|
1892
|
+
const toolNames = report.tools.entries.map((t) => t.name);
|
|
1893
|
+
const formatNameList = (names, cap) => names.length <= cap ? names.join(", ") : `${names.slice(0, cap).join(", ")}, ⦠(+${names.length - cap} more)`;
|
|
1894
|
+
const skillsLine = `Skills list (system prompt text): ${formatCharsAndTokens(report.skills.promptChars)} (${skillNameSet.size} skills)`;
|
|
1895
|
+
const skillsNamesLine = skillNameSet.size ? `Skills: ${formatNameList(skillNames, 20)}` : "Skills: (none)";
|
|
1896
|
+
const toolsNamesLine = toolNames.length ? `Tools: ${formatNameList(toolNames, 30)}` : "Tools: (none)";
|
|
1897
|
+
const systemPromptLine = `System prompt (${report.source}): ${formatCharsAndTokens(report.systemPrompt.chars)} (Project Context ${formatCharsAndTokens(report.systemPrompt.projectContextChars)})`;
|
|
1898
|
+
const workspaceLabel = report.workspaceDir ?? params.workspaceDir;
|
|
1899
|
+
const bootstrapMaxChars = typeof report.bootstrapMaxChars === "number" && Number.isFinite(report.bootstrapMaxChars) && report.bootstrapMaxChars > 0 ? report.bootstrapMaxChars : resolveBootstrapMaxChars(params.cfg);
|
|
1900
|
+
const bootstrapTotalMaxChars = typeof report.bootstrapTotalMaxChars === "number" && Number.isFinite(report.bootstrapTotalMaxChars) && report.bootstrapTotalMaxChars > 0 ? report.bootstrapTotalMaxChars : resolveBootstrapTotalMaxChars(params.cfg);
|
|
1901
|
+
const bootstrapMaxLabel = `${formatInt(bootstrapMaxChars)} chars`;
|
|
1902
|
+
const bootstrapTotalLabel = `${formatInt(bootstrapTotalMaxChars)} chars`;
|
|
1903
|
+
const bootstrapAnalysis = analyzeBootstrapBudget({
|
|
1904
|
+
files: report.injectedWorkspaceFiles,
|
|
1905
|
+
bootstrapMaxChars,
|
|
1906
|
+
bootstrapTotalMaxChars
|
|
1907
|
+
});
|
|
1908
|
+
const truncatedBootstrapFiles = bootstrapAnalysis.truncatedFiles;
|
|
1909
|
+
const truncationCauseCounts = truncatedBootstrapFiles.reduce((acc, file) => {
|
|
1910
|
+
for (const cause of file.causes) if (cause === "per-file-limit") acc.perFile += 1;
|
|
1911
|
+
else if (cause === "total-limit") acc.total += 1;
|
|
1912
|
+
return acc;
|
|
1913
|
+
}, {
|
|
1914
|
+
perFile: 0,
|
|
1915
|
+
total: 0
|
|
1916
|
+
});
|
|
1917
|
+
const truncationCauseParts = [truncationCauseCounts.perFile > 0 ? `${truncationCauseCounts.perFile} file(s) exceeded max/file` : null, truncationCauseCounts.total > 0 ? `${truncationCauseCounts.total} file(s) hit max/total` : null].filter(Boolean);
|
|
1918
|
+
const bootstrapWarningLines = truncatedBootstrapFiles.length > 0 ? [
|
|
1919
|
+
`ā Bootstrap context is over configured limits: ${truncatedBootstrapFiles.length} file(s) truncated (${formatInt(bootstrapAnalysis.totals.rawChars)} raw chars -> ${formatInt(bootstrapAnalysis.totals.injectedChars)} injected chars).`,
|
|
1920
|
+
...truncationCauseParts.length ? [`Causes: ${truncationCauseParts.join("; ")}.`] : [],
|
|
1921
|
+
"Tip: increase `agents.defaults.bootstrapMaxChars` and/or `agents.defaults.bootstrapTotalMaxChars` if this truncation is not intentional."
|
|
1922
|
+
] : [];
|
|
1923
|
+
const contextWindowLabel = session.contextTokens != null ? formatInt(session.contextTokens) : "?";
|
|
1924
|
+
const totalsLine = cachedContextUsageTokens != null ? `Session tokens (cached): ${formatInt(cachedContextUsageTokens)} total / ctx=${contextWindowLabel}` : `Session tokens (cached): unknown / ctx=${contextWindowLabel}`;
|
|
1925
|
+
const sharedContextLines = [
|
|
1926
|
+
`Workspace: ${workspaceLabel}`,
|
|
1927
|
+
`Bootstrap max/file: ${bootstrapMaxLabel}`,
|
|
1928
|
+
`Bootstrap max/total: ${bootstrapTotalLabel}`,
|
|
1929
|
+
sandboxLine,
|
|
1930
|
+
systemPromptLine,
|
|
1931
|
+
...bootstrapWarningLines.length ? ["", ...bootstrapWarningLines] : [],
|
|
1932
|
+
"",
|
|
1933
|
+
"Injected workspace files:",
|
|
1934
|
+
...fileLines,
|
|
1935
|
+
"",
|
|
1936
|
+
skillsLine,
|
|
1937
|
+
skillsNamesLine
|
|
1938
|
+
];
|
|
1939
|
+
if (sub === "detail" || sub === "deep") {
|
|
1940
|
+
const perSkill = formatListTop(report.skills.entries.map((s) => ({
|
|
1941
|
+
name: s.name,
|
|
1942
|
+
value: s.blockChars
|
|
1943
|
+
})), 30);
|
|
1944
|
+
const perToolSchema = formatListTop(report.tools.entries.map((t) => ({
|
|
1945
|
+
name: t.name,
|
|
1946
|
+
value: t.schemaChars
|
|
1947
|
+
})), 30);
|
|
1948
|
+
const perToolSummary = formatListTop(report.tools.entries.map((t) => ({
|
|
1949
|
+
name: t.name,
|
|
1950
|
+
value: t.summaryChars
|
|
1951
|
+
})), 30);
|
|
1952
|
+
const toolPropsLines = report.tools.entries.filter((t) => t.propertiesCount != null).toSorted((a, b) => (b.propertiesCount ?? 0) - (a.propertiesCount ?? 0)).slice(0, 30).map((t) => `- ${t.name}: ${t.propertiesCount} params`);
|
|
1953
|
+
const trackedPromptChars = report.systemPrompt.chars + report.tools.schemaChars;
|
|
1954
|
+
const trackedPromptLine = `Tracked prompt estimate: ${formatCharsAndTokens(trackedPromptChars)}`;
|
|
1955
|
+
const actualContextLine = cachedContextUsageTokens != null ? `Actual context usage (cached): ${formatInt(cachedContextUsageTokens)} tok` : "Actual context usage (cached): unavailable";
|
|
1956
|
+
const overheadTokens = cachedContextUsageTokens != null ? cachedContextUsageTokens - estimateTokensFromChars(trackedPromptChars) : null;
|
|
1957
|
+
const overheadLine = overheadTokens == null ? null : overheadTokens > 0 ? `Untracked provider/runtime overhead: ~${formatInt(overheadTokens)} tok` : "Untracked provider/runtime overhead: not observed in cached usage";
|
|
1958
|
+
return { text: [
|
|
1959
|
+
"š¾ Context breakdown (detailed)",
|
|
1960
|
+
...sharedContextLines,
|
|
1961
|
+
...perSkill.lines.length ? ["Top skills (prompt entry size):", ...perSkill.lines] : [],
|
|
1962
|
+
...perSkill.omitted ? [`⦠(+${perSkill.omitted} more skills)`] : [],
|
|
1963
|
+
"",
|
|
1964
|
+
toolListLine,
|
|
1965
|
+
toolSchemaLine,
|
|
1966
|
+
toolsNamesLine,
|
|
1967
|
+
"Top tools (schema size):",
|
|
1968
|
+
...perToolSchema.lines,
|
|
1969
|
+
...perToolSchema.omitted ? [`⦠(+${perToolSchema.omitted} more tools)`] : [],
|
|
1970
|
+
"",
|
|
1971
|
+
"Top tools (summary text size):",
|
|
1972
|
+
...perToolSummary.lines,
|
|
1973
|
+
...perToolSummary.omitted ? [`⦠(+${perToolSummary.omitted} more tools)`] : [],
|
|
1974
|
+
...toolPropsLines.length ? [
|
|
1975
|
+
"",
|
|
1976
|
+
"Tools (param count):",
|
|
1977
|
+
...toolPropsLines
|
|
1978
|
+
] : [],
|
|
1979
|
+
"",
|
|
1980
|
+
trackedPromptLine,
|
|
1981
|
+
actualContextLine,
|
|
1982
|
+
...overheadLine ? [overheadLine] : [],
|
|
1983
|
+
"",
|
|
1984
|
+
totalsLine,
|
|
1985
|
+
"",
|
|
1986
|
+
"Inline shortcut: a command token inside normal text (e.g. āhey /statusā) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message."
|
|
1987
|
+
].filter(Boolean).join("\n") };
|
|
1988
|
+
}
|
|
1989
|
+
return { text: [
|
|
1990
|
+
"š¾ Context breakdown",
|
|
1991
|
+
...sharedContextLines,
|
|
1992
|
+
toolListLine,
|
|
1993
|
+
toolSchemaLine,
|
|
1994
|
+
toolsNamesLine,
|
|
1995
|
+
"",
|
|
1996
|
+
totalsLine,
|
|
1997
|
+
"",
|
|
1998
|
+
"Inline shortcut: a command token inside normal text (e.g. āhey /statusā) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message."
|
|
1999
|
+
].join("\n") };
|
|
2000
|
+
}
|
|
2001
|
+
//#endregion
|
|
2002
|
+
//#region src/auto-reply/reply/commands-context-command.ts
|
|
2003
|
+
const handleContextCommand = async (params, allowTextCommands) => {
|
|
2004
|
+
if (!allowTextCommands) return null;
|
|
2005
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2006
|
+
if (normalized !== "/context" && !normalized.startsWith("/context ")) return null;
|
|
2007
|
+
if (!params.command.isAuthorizedSender) {
|
|
2008
|
+
logVerbose(`Ignoring /context from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2009
|
+
return { shouldContinue: false };
|
|
2010
|
+
}
|
|
2011
|
+
return {
|
|
2012
|
+
shouldContinue: false,
|
|
2013
|
+
reply: await buildContextReply(params)
|
|
2014
|
+
};
|
|
2015
|
+
};
|
|
2016
|
+
//#endregion
|
|
2017
|
+
//#region src/auto-reply/reply/commands-export-session.ts
|
|
2018
|
+
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
2019
|
+
function loadTemplate(fileName) {
|
|
2020
|
+
return fs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
2021
|
+
}
|
|
2022
|
+
function generateHtml(sessionData) {
|
|
2023
|
+
const template = loadTemplate("template.html");
|
|
2024
|
+
const templateCss = loadTemplate("template.css");
|
|
2025
|
+
const templateJs = loadTemplate("template.js");
|
|
2026
|
+
const markedJs = loadTemplate(path.join("vendor", "marked.min.js"));
|
|
2027
|
+
const hljsJs = loadTemplate(path.join("vendor", "highlight.min.js"));
|
|
2028
|
+
const themeVars = `
|
|
2029
|
+
--cyan: #00d7ff;
|
|
2030
|
+
--blue: #5f87ff;
|
|
2031
|
+
--green: #b5bd68;
|
|
2032
|
+
--red: #cc6666;
|
|
2033
|
+
--yellow: #ffff00;
|
|
2034
|
+
--gray: #808080;
|
|
2035
|
+
--dimGray: #666666;
|
|
2036
|
+
--darkGray: #505050;
|
|
2037
|
+
--accent: #8abeb7;
|
|
2038
|
+
--selectedBg: #3a3a4a;
|
|
2039
|
+
--userMsgBg: #343541;
|
|
2040
|
+
--toolPendingBg: #282832;
|
|
2041
|
+
--toolSuccessBg: #283228;
|
|
2042
|
+
--toolErrorBg: #3c2828;
|
|
2043
|
+
--customMsgBg: #2d2838;
|
|
2044
|
+
--text: #e0e0e0;
|
|
2045
|
+
--dim: #666666;
|
|
2046
|
+
--muted: #808080;
|
|
2047
|
+
--border: #5f87ff;
|
|
2048
|
+
--borderAccent: #00d7ff;
|
|
2049
|
+
--borderMuted: #505050;
|
|
2050
|
+
--success: #b5bd68;
|
|
2051
|
+
--error: #cc6666;
|
|
2052
|
+
--warning: #ffff00;
|
|
2053
|
+
--thinkingText: #808080;
|
|
2054
|
+
--userMessageBg: #343541;
|
|
2055
|
+
--userMessageText: #e0e0e0;
|
|
2056
|
+
--customMessageBg: #2d2838;
|
|
2057
|
+
--customMessageText: #e0e0e0;
|
|
2058
|
+
--customMessageLabel: #9575cd;
|
|
2059
|
+
--toolTitle: #e0e0e0;
|
|
2060
|
+
--toolOutput: #808080;
|
|
2061
|
+
--mdHeading: #f0c674;
|
|
2062
|
+
--mdLink: #81a2be;
|
|
2063
|
+
--mdLinkUrl: #666666;
|
|
2064
|
+
--mdCode: #8abeb7;
|
|
2065
|
+
--mdCodeBlock: #b5bd68;
|
|
2066
|
+
`;
|
|
2067
|
+
const bodyBg = "#1e1e28";
|
|
2068
|
+
const containerBg = "#282832";
|
|
2069
|
+
const infoBg = "#343541";
|
|
2070
|
+
const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString("base64");
|
|
2071
|
+
const css = templateCss.replace("/* {{THEME_VARS}} */", themeVars.trim()).replace("/* {{BODY_BG_DECL}} */", `--body-bg: ${bodyBg};`).replace("/* {{CONTAINER_BG_DECL}} */", `--container-bg: ${containerBg};`).replace("/* {{INFO_BG_DECL}} */", `--info-bg: ${infoBg};`);
|
|
2072
|
+
return template.replace("{{CSS}}", css).replace("{{JS}}", templateJs).replace("{{SESSION_DATA}}", sessionDataBase64).replace("{{MARKED_JS}}", markedJs).replace("{{HIGHLIGHT_JS}}", hljsJs);
|
|
2073
|
+
}
|
|
2074
|
+
function parseExportArgs(commandBodyNormalized) {
|
|
2075
|
+
const normalized = commandBodyNormalized.trim();
|
|
2076
|
+
if (normalized === "/export-session" || normalized === "/export") return {};
|
|
2077
|
+
return { outputPath: normalized.replace(/^\/(export-session|export)\s*/, "").trim().split(/\s+/).find((part) => !part.startsWith("-")) };
|
|
2078
|
+
}
|
|
2079
|
+
async function buildExportSessionReply(params) {
|
|
2080
|
+
const args = parseExportArgs(params.command.commandBodyNormalized);
|
|
2081
|
+
if (!params.sessionEntry?.sessionId) return { text: "ā No active session found." };
|
|
2082
|
+
const storePath = resolveDefaultSessionStorePath(params.agentId);
|
|
2083
|
+
const entry = loadSessionStore(storePath, { skipCache: true })[params.sessionKey];
|
|
2084
|
+
if (!entry?.sessionId) return { text: `ā Session not found: ${params.sessionKey}` };
|
|
2085
|
+
let sessionFile;
|
|
2086
|
+
try {
|
|
2087
|
+
sessionFile = resolveSessionFilePath(entry.sessionId, entry, resolveSessionFilePathOptions({
|
|
2088
|
+
agentId: params.agentId,
|
|
2089
|
+
storePath
|
|
2090
|
+
}));
|
|
2091
|
+
} catch (err) {
|
|
2092
|
+
return { text: `ā Failed to resolve session file: ${formatErrorMessage(err)}` };
|
|
2093
|
+
}
|
|
2094
|
+
if (!fs.existsSync(sessionFile)) return { text: `ā Session file not found: ${sessionFile}` };
|
|
2095
|
+
const sessionManager = SessionManager.open(sessionFile);
|
|
2096
|
+
const entries = sessionManager.getEntries();
|
|
2097
|
+
const header = sessionManager.getHeader();
|
|
2098
|
+
const leafId = sessionManager.getLeafId();
|
|
2099
|
+
const { systemPrompt, tools } = await resolveCommandsSystemPromptBundle(params);
|
|
2100
|
+
const html = generateHtml({
|
|
2101
|
+
header,
|
|
2102
|
+
entries,
|
|
2103
|
+
leafId,
|
|
2104
|
+
systemPrompt,
|
|
2105
|
+
tools: tools.map((t) => ({
|
|
2106
|
+
name: t.name,
|
|
2107
|
+
description: t.description,
|
|
2108
|
+
parameters: t.parameters
|
|
2109
|
+
}))
|
|
2110
|
+
});
|
|
2111
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2112
|
+
const defaultFileName = `kaijibot-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
2113
|
+
const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
2114
|
+
const outputDir = path.dirname(outputPath);
|
|
2115
|
+
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });
|
|
2116
|
+
fs.writeFileSync(outputPath, html, "utf-8");
|
|
2117
|
+
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
2118
|
+
return { text: [
|
|
2119
|
+
"ā
Session exported!",
|
|
2120
|
+
"",
|
|
2121
|
+
`š File: ${relativePath.startsWith("..") ? outputPath : relativePath}`,
|
|
2122
|
+
`š Entries: ${entries.length}`,
|
|
2123
|
+
`š¾ System prompt: ${systemPrompt.length.toLocaleString()} chars`,
|
|
2124
|
+
`š§ Tools: ${tools.length}`
|
|
2125
|
+
].join("\n") };
|
|
2126
|
+
}
|
|
2127
|
+
//#endregion
|
|
2128
|
+
//#region src/auto-reply/reply/commands-whoami.ts
|
|
2129
|
+
const handleWhoamiCommand = async (params, allowTextCommands) => {
|
|
2130
|
+
if (!allowTextCommands) return null;
|
|
2131
|
+
if (params.command.commandBodyNormalized !== "/whoami") return null;
|
|
2132
|
+
if (!params.command.isAuthorizedSender) {
|
|
2133
|
+
logVerbose(`Ignoring /whoami from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2134
|
+
return { shouldContinue: false };
|
|
2135
|
+
}
|
|
2136
|
+
const senderId = params.ctx.SenderId ?? "";
|
|
2137
|
+
const senderUsername = params.ctx.SenderUsername ?? "";
|
|
2138
|
+
const lines = ["š§ Identity", `Channel: ${params.command.channel}`];
|
|
2139
|
+
if (senderId) lines.push(`User id: ${senderId}`);
|
|
2140
|
+
if (senderUsername) {
|
|
2141
|
+
const handle = senderUsername.startsWith("@") ? senderUsername : `@${senderUsername}`;
|
|
2142
|
+
lines.push(`Username: ${handle}`);
|
|
2143
|
+
}
|
|
2144
|
+
if (params.ctx.ChatType === "group" && params.ctx.From) lines.push(`Chat: ${params.ctx.From}`);
|
|
2145
|
+
if (params.ctx.MessageThreadId != null) lines.push(`Thread: ${params.ctx.MessageThreadId}`);
|
|
2146
|
+
if (senderId) lines.push(`AllowFrom: ${senderId}`);
|
|
2147
|
+
return {
|
|
2148
|
+
shouldContinue: false,
|
|
2149
|
+
reply: { text: lines.join("\n") }
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
//#endregion
|
|
2153
|
+
//#region src/auto-reply/reply/commands-info.ts
|
|
2154
|
+
const handleHelpCommand = async (params, allowTextCommands) => {
|
|
2155
|
+
if (!allowTextCommands) return null;
|
|
2156
|
+
if (params.command.commandBodyNormalized !== "/help") return null;
|
|
2157
|
+
if (!params.command.isAuthorizedSender) {
|
|
2158
|
+
logVerbose(`Ignoring /help from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2159
|
+
return { shouldContinue: false };
|
|
2160
|
+
}
|
|
2161
|
+
return {
|
|
2162
|
+
shouldContinue: false,
|
|
2163
|
+
reply: { text: buildHelpMessage(params.cfg) }
|
|
2164
|
+
};
|
|
2165
|
+
};
|
|
2166
|
+
const handleCommandsListCommand = async (params, allowTextCommands) => {
|
|
2167
|
+
if (!allowTextCommands) return null;
|
|
2168
|
+
if (params.command.commandBodyNormalized !== "/commands") return null;
|
|
2169
|
+
if (!params.command.isAuthorizedSender) {
|
|
2170
|
+
logVerbose(`Ignoring /commands from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2171
|
+
return { shouldContinue: false };
|
|
2172
|
+
}
|
|
2173
|
+
const skillCommands = params.skillCommands ?? listSkillCommandsForAgents({
|
|
2174
|
+
cfg: params.cfg,
|
|
2175
|
+
agentIds: params.agentId ? [params.agentId] : void 0
|
|
2176
|
+
});
|
|
2177
|
+
const surface = params.ctx.Surface;
|
|
2178
|
+
const commandPlugin = surface ? getChannelPlugin(surface) : null;
|
|
2179
|
+
const paginated = buildCommandsMessagePaginated(params.cfg, skillCommands, {
|
|
2180
|
+
page: 1,
|
|
2181
|
+
surface
|
|
2182
|
+
});
|
|
2183
|
+
const channelData = commandPlugin?.commands?.buildCommandsListChannelData?.({
|
|
2184
|
+
currentPage: paginated.currentPage,
|
|
2185
|
+
totalPages: paginated.totalPages,
|
|
2186
|
+
agentId: params.agentId
|
|
2187
|
+
});
|
|
2188
|
+
if (channelData) return {
|
|
2189
|
+
shouldContinue: false,
|
|
2190
|
+
reply: {
|
|
2191
|
+
text: paginated.text,
|
|
2192
|
+
channelData
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
return {
|
|
2196
|
+
shouldContinue: false,
|
|
2197
|
+
reply: { text: buildCommandsMessage(params.cfg, skillCommands, { surface }) }
|
|
2198
|
+
};
|
|
2199
|
+
};
|
|
2200
|
+
const handleToolsCommand = async (params, allowTextCommands) => {
|
|
2201
|
+
if (!allowTextCommands) return null;
|
|
2202
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2203
|
+
let verbose = false;
|
|
2204
|
+
if (normalized === "/tools" || normalized === "/tools compact") verbose = false;
|
|
2205
|
+
else if (normalized === "/tools verbose") verbose = true;
|
|
2206
|
+
else if (normalized.startsWith("/tools ")) return {
|
|
2207
|
+
shouldContinue: false,
|
|
2208
|
+
reply: { text: "Usage: /tools [compact|verbose]" }
|
|
2209
|
+
};
|
|
2210
|
+
else return null;
|
|
2211
|
+
if (!params.command.isAuthorizedSender) {
|
|
2212
|
+
logVerbose(`Ignoring /tools from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2213
|
+
return { shouldContinue: false };
|
|
2214
|
+
}
|
|
2215
|
+
try {
|
|
2216
|
+
const effectiveAccountId = resolveChannelAccountId({
|
|
2217
|
+
cfg: params.cfg,
|
|
2218
|
+
ctx: params.ctx,
|
|
2219
|
+
command: params.command
|
|
2220
|
+
});
|
|
2221
|
+
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
2222
|
+
sessionKey: params.sessionKey,
|
|
2223
|
+
config: params.cfg
|
|
2224
|
+
});
|
|
2225
|
+
const threadingContext = buildThreadingToolContext({
|
|
2226
|
+
sessionCtx: params.ctx,
|
|
2227
|
+
config: params.cfg,
|
|
2228
|
+
hasRepliedRef: void 0
|
|
2229
|
+
});
|
|
2230
|
+
return {
|
|
2231
|
+
shouldContinue: false,
|
|
2232
|
+
reply: { text: buildToolsMessage(resolveEffectiveToolInventory({
|
|
2233
|
+
cfg: params.cfg,
|
|
2234
|
+
agentId,
|
|
2235
|
+
sessionKey: params.sessionKey,
|
|
2236
|
+
workspaceDir: params.workspaceDir,
|
|
2237
|
+
agentDir: params.agentDir,
|
|
2238
|
+
modelProvider: params.provider,
|
|
2239
|
+
modelId: params.model,
|
|
2240
|
+
messageProvider: params.command.channel,
|
|
2241
|
+
senderIsOwner: params.command.senderIsOwner,
|
|
2242
|
+
senderId: params.command.senderId,
|
|
2243
|
+
senderName: params.ctx.SenderName,
|
|
2244
|
+
senderUsername: params.ctx.SenderUsername,
|
|
2245
|
+
senderE164: params.ctx.SenderE164,
|
|
2246
|
+
accountId: effectiveAccountId,
|
|
2247
|
+
currentChannelId: threadingContext.currentChannelId,
|
|
2248
|
+
currentThreadTs: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? String(params.ctx.MessageThreadId) : void 0,
|
|
2249
|
+
currentMessageId: threadingContext.currentMessageId,
|
|
2250
|
+
groupId: params.sessionEntry?.groupId ?? extractExplicitGroupId(params.ctx.From),
|
|
2251
|
+
groupChannel: params.sessionEntry?.groupChannel ?? params.ctx.GroupChannel ?? params.ctx.GroupSubject,
|
|
2252
|
+
groupSpace: params.sessionEntry?.space ?? params.ctx.GroupSpace,
|
|
2253
|
+
replyToMode: resolveReplyToMode(params.cfg, params.ctx.OriginatingChannel ?? params.ctx.Provider, effectiveAccountId, params.ctx.ChatType)
|
|
2254
|
+
}), { verbose }) }
|
|
2255
|
+
};
|
|
2256
|
+
} catch (err) {
|
|
2257
|
+
return {
|
|
2258
|
+
shouldContinue: false,
|
|
2259
|
+
reply: { text: String(err).includes("missing scope:") ? "You do not have permission to view available tools." : "Couldn't load available tools right now. Try again in a moment." }
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
};
|
|
2263
|
+
const handleStatusCommand = async (params, allowTextCommands) => {
|
|
2264
|
+
if (!allowTextCommands) return null;
|
|
2265
|
+
if (!(params.directives.hasStatusDirective || params.command.commandBodyNormalized === "/status")) return null;
|
|
2266
|
+
if (!params.command.isAuthorizedSender) {
|
|
2267
|
+
logVerbose(`Ignoring /status from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2268
|
+
return { shouldContinue: false };
|
|
2269
|
+
}
|
|
2270
|
+
return {
|
|
2271
|
+
shouldContinue: false,
|
|
2272
|
+
reply: await buildStatusReply({
|
|
2273
|
+
cfg: params.cfg,
|
|
2274
|
+
command: params.command,
|
|
2275
|
+
sessionEntry: params.sessionEntry,
|
|
2276
|
+
sessionKey: params.sessionKey,
|
|
2277
|
+
parentSessionKey: params.ctx.ParentSessionKey,
|
|
2278
|
+
sessionScope: params.sessionScope,
|
|
2279
|
+
provider: params.provider,
|
|
2280
|
+
model: params.model,
|
|
2281
|
+
contextTokens: params.contextTokens,
|
|
2282
|
+
resolvedThinkLevel: params.resolvedThinkLevel,
|
|
2283
|
+
resolvedVerboseLevel: params.resolvedVerboseLevel,
|
|
2284
|
+
resolvedReasoningLevel: params.resolvedReasoningLevel,
|
|
2285
|
+
resolvedElevatedLevel: params.resolvedElevatedLevel,
|
|
2286
|
+
resolveDefaultThinkingLevel: params.resolveDefaultThinkingLevel,
|
|
2287
|
+
isGroup: params.isGroup,
|
|
2288
|
+
defaultGroupActivation: params.defaultGroupActivation,
|
|
2289
|
+
mediaDecisions: params.ctx.MediaUnderstandingDecisions
|
|
2290
|
+
})
|
|
2291
|
+
};
|
|
2292
|
+
};
|
|
2293
|
+
const handleExportSessionCommand = async (params, allowTextCommands) => {
|
|
2294
|
+
if (!allowTextCommands) return null;
|
|
2295
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2296
|
+
if (normalized !== "/export-session" && !normalized.startsWith("/export-session ") && normalized !== "/export" && !normalized.startsWith("/export ")) return null;
|
|
2297
|
+
if (!params.command.isAuthorizedSender) {
|
|
2298
|
+
logVerbose(`Ignoring /export-session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2299
|
+
return { shouldContinue: false };
|
|
2300
|
+
}
|
|
2301
|
+
return {
|
|
2302
|
+
shouldContinue: false,
|
|
2303
|
+
reply: await buildExportSessionReply(params)
|
|
2304
|
+
};
|
|
2305
|
+
};
|
|
2306
|
+
//#endregion
|
|
2307
|
+
//#region src/auto-reply/reply/mcp-commands.ts
|
|
2308
|
+
function parseMcpCommand(raw) {
|
|
2309
|
+
return parseStandardSetUnsetSlashCommand({
|
|
2310
|
+
raw,
|
|
2311
|
+
slash: "/mcp",
|
|
2312
|
+
invalidMessage: "Invalid /mcp syntax.",
|
|
2313
|
+
usageMessage: "Usage: /mcp show|set|unset",
|
|
2314
|
+
onKnownAction: (action, args) => {
|
|
2315
|
+
if (action === "show" || action === "get") return {
|
|
2316
|
+
action: "show",
|
|
2317
|
+
name: args || void 0
|
|
2318
|
+
};
|
|
2319
|
+
},
|
|
2320
|
+
onSet: (name, value) => ({
|
|
2321
|
+
action: "set",
|
|
2322
|
+
name,
|
|
2323
|
+
value
|
|
2324
|
+
}),
|
|
2325
|
+
onUnset: (name) => ({
|
|
2326
|
+
action: "unset",
|
|
2327
|
+
name
|
|
2328
|
+
})
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
//#endregion
|
|
2332
|
+
//#region src/auto-reply/reply/commands-mcp.ts
|
|
2333
|
+
function renderJsonBlock$1(label, value) {
|
|
2334
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
2335
|
+
}
|
|
2336
|
+
const handleMcpCommand = async (params, allowTextCommands) => {
|
|
2337
|
+
if (!allowTextCommands) return null;
|
|
2338
|
+
const mcpCommand = parseMcpCommand(params.command.commandBodyNormalized);
|
|
2339
|
+
if (!mcpCommand) return null;
|
|
2340
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/mcp");
|
|
2341
|
+
if (unauthorized) return unauthorized;
|
|
2342
|
+
const nonOwner = mcpCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/mcp");
|
|
2343
|
+
if (nonOwner) return nonOwner;
|
|
2344
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
2345
|
+
label: "/mcp",
|
|
2346
|
+
configKey: "mcp"
|
|
2347
|
+
});
|
|
2348
|
+
if (disabled) return disabled;
|
|
2349
|
+
if (mcpCommand.action === "error") return {
|
|
2350
|
+
shouldContinue: false,
|
|
2351
|
+
reply: { text: `ā ļø ${mcpCommand.message}` }
|
|
2352
|
+
};
|
|
2353
|
+
if (mcpCommand.action === "show") {
|
|
2354
|
+
const loaded = await listConfiguredMcpServers();
|
|
2355
|
+
if (!loaded.ok) return {
|
|
2356
|
+
shouldContinue: false,
|
|
2357
|
+
reply: { text: `ā ļø ${loaded.error}` }
|
|
2358
|
+
};
|
|
2359
|
+
if (mcpCommand.name) {
|
|
2360
|
+
const server = loaded.mcpServers[mcpCommand.name];
|
|
2361
|
+
if (!server) return {
|
|
2362
|
+
shouldContinue: false,
|
|
2363
|
+
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${loaded.path}.` }
|
|
2364
|
+
};
|
|
2365
|
+
return {
|
|
2366
|
+
shouldContinue: false,
|
|
2367
|
+
reply: { text: renderJsonBlock$1(`š MCP server "${mcpCommand.name}" (${loaded.path})`, server) }
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
if (Object.keys(loaded.mcpServers).length === 0) return {
|
|
2371
|
+
shouldContinue: false,
|
|
2372
|
+
reply: { text: `š No MCP servers configured in ${loaded.path}.` }
|
|
2373
|
+
};
|
|
2374
|
+
return {
|
|
2375
|
+
shouldContinue: false,
|
|
2376
|
+
reply: { text: renderJsonBlock$1(`š MCP servers (${loaded.path})`, loaded.mcpServers) }
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2380
|
+
label: "/mcp write",
|
|
2381
|
+
allowedScopes: ["operator.admin"],
|
|
2382
|
+
missingText: "ā /mcp set|unset requires operator.admin for gateway clients."
|
|
2383
|
+
});
|
|
2384
|
+
if (missingAdminScope) return missingAdminScope;
|
|
2385
|
+
if (mcpCommand.action === "set") {
|
|
2386
|
+
const result = await setConfiguredMcpServer({
|
|
2387
|
+
name: mcpCommand.name,
|
|
2388
|
+
server: mcpCommand.value
|
|
2389
|
+
});
|
|
2390
|
+
if (!result.ok) return {
|
|
2391
|
+
shouldContinue: false,
|
|
2392
|
+
reply: { text: `ā ļø ${result.error}` }
|
|
2393
|
+
};
|
|
2394
|
+
return {
|
|
2395
|
+
shouldContinue: false,
|
|
2396
|
+
reply: { text: `š MCP server "${mcpCommand.name}" saved to ${result.path}.` }
|
|
2397
|
+
};
|
|
2398
|
+
}
|
|
2399
|
+
const result = await unsetConfiguredMcpServer({ name: mcpCommand.name });
|
|
2400
|
+
if (!result.ok) return {
|
|
2401
|
+
shouldContinue: false,
|
|
2402
|
+
reply: { text: `ā ļø ${result.error}` }
|
|
2403
|
+
};
|
|
2404
|
+
if (!result.removed) return {
|
|
2405
|
+
shouldContinue: false,
|
|
2406
|
+
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${result.path}.` }
|
|
2407
|
+
};
|
|
2408
|
+
return {
|
|
2409
|
+
shouldContinue: false,
|
|
2410
|
+
reply: { text: `š MCP server "${mcpCommand.name}" removed from ${result.path}.` }
|
|
2411
|
+
};
|
|
2412
|
+
};
|
|
2413
|
+
//#endregion
|
|
2414
|
+
//#region src/auto-reply/reply/commands-plugin.ts
|
|
2415
|
+
/**
|
|
2416
|
+
* Plugin Command Handler
|
|
2417
|
+
*
|
|
2418
|
+
* Handles commands registered by plugins, bypassing the LLM agent.
|
|
2419
|
+
* This handler is called before built-in command handlers.
|
|
2420
|
+
*/
|
|
2421
|
+
/**
|
|
2422
|
+
* Handle plugin-registered commands.
|
|
2423
|
+
* Returns a result if a plugin command was matched and executed,
|
|
2424
|
+
* or null to continue to the next handler.
|
|
2425
|
+
*/
|
|
2426
|
+
const handlePluginCommand = async (params, allowTextCommands) => {
|
|
2427
|
+
const { command, cfg } = params;
|
|
2428
|
+
if (!allowTextCommands) return null;
|
|
2429
|
+
const match = matchPluginCommand(command.commandBodyNormalized);
|
|
2430
|
+
if (!match) return null;
|
|
2431
|
+
return {
|
|
2432
|
+
shouldContinue: false,
|
|
2433
|
+
reply: await executePluginCommand({
|
|
2434
|
+
command: match.command,
|
|
2435
|
+
args: match.args,
|
|
2436
|
+
senderId: command.senderId,
|
|
2437
|
+
channel: command.channel,
|
|
2438
|
+
channelId: command.channelId,
|
|
2439
|
+
isAuthorizedSender: command.isAuthorizedSender,
|
|
2440
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
2441
|
+
sessionKey: params.sessionKey,
|
|
2442
|
+
sessionId: params.sessionEntry?.sessionId,
|
|
2443
|
+
commandBody: command.commandBodyNormalized,
|
|
2444
|
+
config: cfg,
|
|
2445
|
+
from: command.from,
|
|
2446
|
+
to: command.to,
|
|
2447
|
+
accountId: params.ctx.AccountId ?? void 0,
|
|
2448
|
+
messageThreadId: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? params.ctx.MessageThreadId : void 0,
|
|
2449
|
+
threadParentId: normalizeOptionalString(params.ctx.ThreadParentId)
|
|
2450
|
+
})
|
|
2451
|
+
};
|
|
2452
|
+
};
|
|
2453
|
+
//#endregion
|
|
2454
|
+
//#region src/auto-reply/reply/plugins-commands.ts
|
|
2455
|
+
function parsePluginsCommand(raw) {
|
|
2456
|
+
const match = raw.match(/^\/plugins?(?:\s+(.*))?$/i);
|
|
2457
|
+
if (!match) return null;
|
|
2458
|
+
const tail = normalizeOptionalString(match?.[1]) ?? "";
|
|
2459
|
+
if (!tail) return { action: "list" };
|
|
2460
|
+
const [rawAction, ...rest] = tail.split(/\s+/);
|
|
2461
|
+
const action = normalizeOptionalLowercaseString(rawAction);
|
|
2462
|
+
const name = rest.join(" ").trim();
|
|
2463
|
+
if (action === "list") return name ? {
|
|
2464
|
+
action: "error",
|
|
2465
|
+
message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
|
|
2466
|
+
} : { action: "list" };
|
|
2467
|
+
if (action === "inspect" || action === "show" || action === "get") return {
|
|
2468
|
+
action: "inspect",
|
|
2469
|
+
name: name || void 0
|
|
2470
|
+
};
|
|
2471
|
+
if (action === "install" || action === "add") {
|
|
2472
|
+
if (!name) return {
|
|
2473
|
+
action: "error",
|
|
2474
|
+
message: "Usage: /plugins install <path|archive|npm-spec|clawhub:pkg>"
|
|
2475
|
+
};
|
|
2476
|
+
return {
|
|
2477
|
+
action: "install",
|
|
2478
|
+
spec: name
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2481
|
+
if (action === "enable" || action === "disable") {
|
|
2482
|
+
if (!name) return {
|
|
2483
|
+
action: "error",
|
|
2484
|
+
message: `Usage: /plugins ${action} <plugin-id-or-name>`
|
|
2485
|
+
};
|
|
2486
|
+
return {
|
|
2487
|
+
action,
|
|
2488
|
+
name
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
return {
|
|
2492
|
+
action: "error",
|
|
2493
|
+
message: "Usage: /plugins list|inspect|show|get|install|enable|disable [plugin]"
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
//#endregion
|
|
2497
|
+
//#region src/auto-reply/reply/commands-plugins.ts
|
|
2498
|
+
function renderJsonBlock(label, value) {
|
|
2499
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
2500
|
+
}
|
|
2501
|
+
function buildPluginInspectJson(params) {
|
|
2502
|
+
const inspect = buildPluginInspectReport({
|
|
2503
|
+
id: params.id,
|
|
2504
|
+
config: params.config,
|
|
2505
|
+
report: params.report
|
|
2506
|
+
});
|
|
2507
|
+
if (!inspect) return null;
|
|
2508
|
+
return {
|
|
2509
|
+
inspect,
|
|
2510
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
2511
|
+
code: warning.code,
|
|
2512
|
+
severity: warning.severity,
|
|
2513
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
2514
|
+
})),
|
|
2515
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
2516
|
+
};
|
|
2517
|
+
}
|
|
2518
|
+
function buildAllPluginInspectJson(params) {
|
|
2519
|
+
return buildAllPluginInspectReports({
|
|
2520
|
+
config: params.config,
|
|
2521
|
+
report: params.report
|
|
2522
|
+
}).map((inspect) => ({
|
|
2523
|
+
inspect,
|
|
2524
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
2525
|
+
code: warning.code,
|
|
2526
|
+
severity: warning.severity,
|
|
2527
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
2528
|
+
})),
|
|
2529
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
2530
|
+
}));
|
|
2531
|
+
}
|
|
2532
|
+
function formatPluginLabel(plugin) {
|
|
2533
|
+
if (!plugin.name || plugin.name === plugin.id) return plugin.id;
|
|
2534
|
+
return `${plugin.name} (${plugin.id})`;
|
|
2535
|
+
}
|
|
2536
|
+
function formatPluginsList(report) {
|
|
2537
|
+
if (report.plugins.length === 0) return `š No plugins found for workspace ${report.workspaceDir ?? "(unknown workspace)"}.`;
|
|
2538
|
+
return [`š Plugins (${report.plugins.filter((plugin) => plugin.status === "loaded").length}/${report.plugins.length} loaded)`, ...report.plugins.map((plugin) => {
|
|
2539
|
+
const format = plugin.bundleFormat ? `${plugin.format ?? "kaijibot"}/${plugin.bundleFormat}` : plugin.format ?? "kaijibot";
|
|
2540
|
+
return `- ${formatPluginLabel(plugin)} [${plugin.status}] ${format}`;
|
|
2541
|
+
})].join("\n");
|
|
2542
|
+
}
|
|
2543
|
+
function findPlugin(report, rawName) {
|
|
2544
|
+
const target = normalizeOptionalLowercaseString(rawName);
|
|
2545
|
+
if (!target) return;
|
|
2546
|
+
return report.plugins.find((plugin) => normalizeOptionalLowercaseString(plugin.id) === target || normalizeOptionalLowercaseString(plugin.name) === target);
|
|
2547
|
+
}
|
|
2548
|
+
function looksLikeLocalPluginInstallSpec(raw) {
|
|
2549
|
+
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");
|
|
2550
|
+
}
|
|
2551
|
+
async function installPluginFromPluginsCommand(params) {
|
|
2552
|
+
const fileSpec = resolveFileNpmSpecToLocalPath(params.raw);
|
|
2553
|
+
if (fileSpec && !fileSpec.ok) return {
|
|
2554
|
+
ok: false,
|
|
2555
|
+
error: fileSpec.error
|
|
2556
|
+
};
|
|
2557
|
+
const resolved = resolveUserPath(fileSpec && fileSpec.ok ? fileSpec.path : params.raw);
|
|
2558
|
+
if (fs.existsSync(resolved)) {
|
|
2559
|
+
const result = await installPluginFromPath({
|
|
2560
|
+
path: resolved,
|
|
2561
|
+
logger: createPluginInstallLogger()
|
|
2562
|
+
});
|
|
2563
|
+
if (!result.ok) return {
|
|
2564
|
+
ok: false,
|
|
2565
|
+
error: result.error
|
|
2566
|
+
};
|
|
2567
|
+
clearPluginManifestRegistryCache();
|
|
2568
|
+
const source = resolveArchiveKind(resolved) ? "archive" : "path";
|
|
2569
|
+
await persistPluginInstall({
|
|
2570
|
+
config: params.config,
|
|
2571
|
+
pluginId: result.pluginId,
|
|
2572
|
+
install: {
|
|
2573
|
+
source,
|
|
2574
|
+
sourcePath: resolved,
|
|
2575
|
+
installPath: result.targetDir,
|
|
2576
|
+
version: result.version
|
|
2577
|
+
}
|
|
2578
|
+
});
|
|
2579
|
+
return {
|
|
2580
|
+
ok: true,
|
|
2581
|
+
pluginId: result.pluginId
|
|
2582
|
+
};
|
|
2583
|
+
}
|
|
2584
|
+
if (looksLikeLocalPluginInstallSpec(params.raw)) return {
|
|
2585
|
+
ok: false,
|
|
2586
|
+
error: `Path not found: ${resolved}`
|
|
2587
|
+
};
|
|
2588
|
+
if (parseClawHubPluginSpec(params.raw)) {
|
|
2589
|
+
const result = await installPluginFromClawHub({
|
|
2590
|
+
spec: params.raw,
|
|
2591
|
+
logger: createPluginInstallLogger()
|
|
2592
|
+
});
|
|
2593
|
+
if (!result.ok) return {
|
|
2594
|
+
ok: false,
|
|
2595
|
+
error: result.error
|
|
2596
|
+
};
|
|
2597
|
+
clearPluginManifestRegistryCache();
|
|
2598
|
+
await persistPluginInstall({
|
|
2599
|
+
config: params.config,
|
|
2600
|
+
pluginId: result.pluginId,
|
|
2601
|
+
install: {
|
|
2602
|
+
source: "clawhub",
|
|
2603
|
+
spec: params.raw,
|
|
2604
|
+
installPath: result.targetDir,
|
|
2605
|
+
version: result.version,
|
|
2606
|
+
integrity: result.clawhub.integrity,
|
|
2607
|
+
resolvedAt: result.clawhub.resolvedAt,
|
|
2608
|
+
clawhubUrl: result.clawhub.clawhubUrl,
|
|
2609
|
+
clawhubPackage: result.clawhub.clawhubPackage,
|
|
2610
|
+
clawhubFamily: result.clawhub.clawhubFamily,
|
|
2611
|
+
clawhubChannel: result.clawhub.clawhubChannel
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
return {
|
|
2615
|
+
ok: true,
|
|
2616
|
+
pluginId: result.pluginId
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
const preferredClawHubSpec = buildPreferredClawHubSpec(params.raw);
|
|
2620
|
+
if (preferredClawHubSpec) {
|
|
2621
|
+
const clawhubResult = await installPluginFromClawHub({
|
|
2622
|
+
spec: preferredClawHubSpec,
|
|
2623
|
+
logger: createPluginInstallLogger()
|
|
2624
|
+
});
|
|
2625
|
+
if (clawhubResult.ok) {
|
|
2626
|
+
clearPluginManifestRegistryCache();
|
|
2627
|
+
await persistPluginInstall({
|
|
2628
|
+
config: params.config,
|
|
2629
|
+
pluginId: clawhubResult.pluginId,
|
|
2630
|
+
install: {
|
|
2631
|
+
source: "clawhub",
|
|
2632
|
+
spec: preferredClawHubSpec,
|
|
2633
|
+
installPath: clawhubResult.targetDir,
|
|
2634
|
+
version: clawhubResult.version,
|
|
2635
|
+
integrity: clawhubResult.clawhub.integrity,
|
|
2636
|
+
resolvedAt: clawhubResult.clawhub.resolvedAt,
|
|
2637
|
+
clawhubUrl: clawhubResult.clawhub.clawhubUrl,
|
|
2638
|
+
clawhubPackage: clawhubResult.clawhub.clawhubPackage,
|
|
2639
|
+
clawhubFamily: clawhubResult.clawhub.clawhubFamily,
|
|
2640
|
+
clawhubChannel: clawhubResult.clawhub.clawhubChannel
|
|
2641
|
+
}
|
|
2642
|
+
});
|
|
2643
|
+
return {
|
|
2644
|
+
ok: true,
|
|
2645
|
+
pluginId: clawhubResult.pluginId
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
if (decidePreferredClawHubFallback(clawhubResult) !== "fallback_to_npm") return {
|
|
2649
|
+
ok: false,
|
|
2650
|
+
error: clawhubResult.error
|
|
2651
|
+
};
|
|
2652
|
+
}
|
|
2653
|
+
const result = await installPluginFromNpmSpec({
|
|
2654
|
+
spec: params.raw,
|
|
2655
|
+
logger: createPluginInstallLogger()
|
|
2656
|
+
});
|
|
2657
|
+
if (!result.ok) return {
|
|
2658
|
+
ok: false,
|
|
2659
|
+
error: result.error
|
|
2660
|
+
};
|
|
2661
|
+
clearPluginManifestRegistryCache();
|
|
2662
|
+
const installRecord = buildNpmInstallRecordFields({
|
|
2663
|
+
spec: params.raw,
|
|
2664
|
+
installPath: result.targetDir,
|
|
2665
|
+
version: result.version,
|
|
2666
|
+
resolution: result.npmResolution
|
|
2667
|
+
});
|
|
2668
|
+
await persistPluginInstall({
|
|
2669
|
+
config: params.config,
|
|
2670
|
+
pluginId: result.pluginId,
|
|
2671
|
+
install: installRecord
|
|
2672
|
+
});
|
|
2673
|
+
return {
|
|
2674
|
+
ok: true,
|
|
2675
|
+
pluginId: result.pluginId
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
async function loadPluginCommandState(workspaceDir, options) {
|
|
2679
|
+
const snapshot = await readConfigFileSnapshot();
|
|
2680
|
+
if (!snapshot.valid) return {
|
|
2681
|
+
ok: false,
|
|
2682
|
+
path: snapshot.path,
|
|
2683
|
+
error: "Config file is invalid; fix it before using /plugins."
|
|
2684
|
+
};
|
|
2685
|
+
const config = structuredClone(snapshot.resolved);
|
|
2686
|
+
return {
|
|
2687
|
+
ok: true,
|
|
2688
|
+
path: snapshot.path,
|
|
2689
|
+
config,
|
|
2690
|
+
report: options?.loadModules === true ? buildPluginDiagnosticsReport({
|
|
2691
|
+
config,
|
|
2692
|
+
workspaceDir
|
|
2693
|
+
}) : buildPluginSnapshotReport({
|
|
2694
|
+
config,
|
|
2695
|
+
workspaceDir
|
|
2696
|
+
})
|
|
2697
|
+
};
|
|
2698
|
+
}
|
|
2699
|
+
async function loadPluginCommandConfig() {
|
|
2700
|
+
const snapshot = await readConfigFileSnapshot();
|
|
2701
|
+
if (!snapshot.valid) return {
|
|
2702
|
+
ok: false,
|
|
2703
|
+
path: snapshot.path,
|
|
2704
|
+
error: "Config file is invalid; fix it before using /plugins."
|
|
2705
|
+
};
|
|
2706
|
+
return {
|
|
2707
|
+
ok: true,
|
|
2708
|
+
path: snapshot.path,
|
|
2709
|
+
config: structuredClone(snapshot.resolved)
|
|
2710
|
+
};
|
|
2711
|
+
}
|
|
2712
|
+
const handlePluginsCommand = async (params, allowTextCommands) => {
|
|
2713
|
+
if (!allowTextCommands) return null;
|
|
2714
|
+
const pluginsCommand = parsePluginsCommand(params.command.commandBodyNormalized);
|
|
2715
|
+
if (!pluginsCommand) return null;
|
|
2716
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/plugins");
|
|
2717
|
+
if (unauthorized) return unauthorized;
|
|
2718
|
+
const nonOwner = (pluginsCommand.action === "list" || pluginsCommand.action === "inspect") && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/plugins");
|
|
2719
|
+
if (nonOwner) return nonOwner;
|
|
2720
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
2721
|
+
label: "/plugins",
|
|
2722
|
+
configKey: "plugins"
|
|
2723
|
+
});
|
|
2724
|
+
if (disabled) return disabled;
|
|
2725
|
+
if (pluginsCommand.action === "error") return {
|
|
2726
|
+
shouldContinue: false,
|
|
2727
|
+
reply: { text: `ā ļø ${pluginsCommand.message}` }
|
|
2728
|
+
};
|
|
2729
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2730
|
+
label: "/plugins write",
|
|
2731
|
+
allowedScopes: ["operator.admin"],
|
|
2732
|
+
missingText: "ā /plugins install|enable|disable requires operator.admin for gateway clients."
|
|
2733
|
+
});
|
|
2734
|
+
if (missingAdminScope) return missingAdminScope;
|
|
2735
|
+
if (pluginsCommand.action === "install") {
|
|
2736
|
+
const loadedConfig = await loadPluginCommandConfig();
|
|
2737
|
+
if (!loadedConfig.ok) return {
|
|
2738
|
+
shouldContinue: false,
|
|
2739
|
+
reply: { text: `ā ļø ${loadedConfig.error}` }
|
|
2740
|
+
};
|
|
2741
|
+
const installed = await installPluginFromPluginsCommand({
|
|
2742
|
+
raw: pluginsCommand.spec,
|
|
2743
|
+
config: loadedConfig.config
|
|
2744
|
+
});
|
|
2745
|
+
if (!installed.ok) return {
|
|
2746
|
+
shouldContinue: false,
|
|
2747
|
+
reply: { text: `ā ļø ${installed.error}` }
|
|
2748
|
+
};
|
|
2749
|
+
return {
|
|
2750
|
+
shouldContinue: false,
|
|
2751
|
+
reply: { text: `š Installed plugin "${installed.pluginId}". Restart the gateway to load plugins.` }
|
|
2752
|
+
};
|
|
2753
|
+
}
|
|
2754
|
+
const loaded = await loadPluginCommandState(params.workspaceDir, { loadModules: pluginsCommand.action !== "list" });
|
|
2755
|
+
if (!loaded.ok) return {
|
|
2756
|
+
shouldContinue: false,
|
|
2757
|
+
reply: { text: `ā ļø ${loaded.error}` }
|
|
2758
|
+
};
|
|
2759
|
+
if (pluginsCommand.action === "list") return {
|
|
2760
|
+
shouldContinue: false,
|
|
2761
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
2762
|
+
};
|
|
2763
|
+
if (pluginsCommand.action === "inspect") {
|
|
2764
|
+
if (!pluginsCommand.name) return {
|
|
2765
|
+
shouldContinue: false,
|
|
2766
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
2767
|
+
};
|
|
2768
|
+
if (normalizeOptionalLowercaseString(pluginsCommand.name) === "all") return {
|
|
2769
|
+
shouldContinue: false,
|
|
2770
|
+
reply: { text: renderJsonBlock("š Plugins", buildAllPluginInspectJson(loaded)) }
|
|
2771
|
+
};
|
|
2772
|
+
const payload = buildPluginInspectJson({
|
|
2773
|
+
id: pluginsCommand.name,
|
|
2774
|
+
config: loaded.config,
|
|
2775
|
+
report: loaded.report
|
|
2776
|
+
});
|
|
2777
|
+
if (!payload) return {
|
|
2778
|
+
shouldContinue: false,
|
|
2779
|
+
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2780
|
+
};
|
|
2781
|
+
return {
|
|
2782
|
+
shouldContinue: false,
|
|
2783
|
+
reply: { text: renderJsonBlock(`š Plugin "${payload.inspect.plugin.id}"`, {
|
|
2784
|
+
...payload.inspect,
|
|
2785
|
+
compatibilityWarnings: payload.compatibilityWarnings,
|
|
2786
|
+
install: payload.install
|
|
2787
|
+
}) }
|
|
2788
|
+
};
|
|
2789
|
+
}
|
|
2790
|
+
const plugin = findPlugin(loaded.report, pluginsCommand.name);
|
|
2791
|
+
if (!plugin) return {
|
|
2792
|
+
shouldContinue: false,
|
|
2793
|
+
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2794
|
+
};
|
|
2795
|
+
const validated = validateConfigObjectWithPlugins(setPluginEnabledInConfig(structuredClone(loaded.config), plugin.id, pluginsCommand.action === "enable"));
|
|
2796
|
+
if (!validated.ok) {
|
|
2797
|
+
const issue = validated.issues[0];
|
|
2798
|
+
return {
|
|
2799
|
+
shouldContinue: false,
|
|
2800
|
+
reply: { text: `ā ļø Config invalid after /plugins ${pluginsCommand.action} (${issue.path}: ${issue.message}).` }
|
|
2801
|
+
};
|
|
2802
|
+
}
|
|
2803
|
+
await writeConfigFile(validated.config);
|
|
2804
|
+
return {
|
|
2805
|
+
shouldContinue: false,
|
|
2806
|
+
reply: { text: `š Plugin "${plugin.id}" ${pluginsCommand.action}d in ${loaded.path}. Restart the gateway to apply.` }
|
|
2807
|
+
};
|
|
2808
|
+
};
|
|
2809
|
+
//#endregion
|
|
2810
|
+
//#region src/auto-reply/send-policy.ts
|
|
2811
|
+
function normalizeSendPolicyOverride(raw) {
|
|
2812
|
+
const value = normalizeOptionalLowercaseString(raw);
|
|
2813
|
+
if (!value) return;
|
|
2814
|
+
if (value === "allow" || value === "on") return "allow";
|
|
2815
|
+
if (value === "deny" || value === "off") return "deny";
|
|
2816
|
+
}
|
|
2817
|
+
function parseSendPolicyCommand(raw) {
|
|
2818
|
+
if (!raw) return { hasCommand: false };
|
|
2819
|
+
const trimmed = raw.trim();
|
|
2820
|
+
if (!trimmed) return { hasCommand: false };
|
|
2821
|
+
const match = normalizeCommandBody(stripInboundMetadata(trimmed)).match(/^\/send(?:\s+([a-zA-Z]+))?\s*$/i);
|
|
2822
|
+
if (!match) return { hasCommand: false };
|
|
2823
|
+
const token = normalizeOptionalLowercaseString(match[1]);
|
|
2824
|
+
if (!token) return { hasCommand: true };
|
|
2825
|
+
if (token === "inherit" || token === "default" || token === "reset") return {
|
|
2826
|
+
hasCommand: true,
|
|
2827
|
+
mode: "inherit"
|
|
2828
|
+
};
|
|
2829
|
+
return {
|
|
2830
|
+
hasCommand: true,
|
|
2831
|
+
mode: normalizeSendPolicyOverride(token)
|
|
2832
|
+
};
|
|
2833
|
+
}
|
|
2834
|
+
//#endregion
|
|
2835
|
+
//#region src/auto-reply/reply/commands-session-store.ts
|
|
2836
|
+
async function persistSessionEntry(params) {
|
|
2837
|
+
if (!params.sessionEntry || !params.sessionStore || !params.sessionKey) return false;
|
|
2838
|
+
params.sessionEntry.updatedAt = Date.now();
|
|
2839
|
+
params.sessionStore[params.sessionKey] = params.sessionEntry;
|
|
2840
|
+
if (params.storePath) await updateSessionStore(params.storePath, (store) => {
|
|
2841
|
+
store[params.sessionKey] = params.sessionEntry;
|
|
2842
|
+
});
|
|
2843
|
+
return true;
|
|
2844
|
+
}
|
|
2845
|
+
async function persistAbortTargetEntry(params) {
|
|
2846
|
+
const { entry, key, sessionStore, storePath, abortCutoff } = params;
|
|
2847
|
+
if (!entry || !key || !sessionStore) return false;
|
|
2848
|
+
entry.abortedLastRun = true;
|
|
2849
|
+
applyAbortCutoffToSessionEntry(entry, abortCutoff);
|
|
2850
|
+
entry.updatedAt = Date.now();
|
|
2851
|
+
sessionStore[key] = entry;
|
|
2852
|
+
if (storePath) await updateSessionStore(storePath, (store) => {
|
|
2853
|
+
const nextEntry = store[key] ?? entry;
|
|
2854
|
+
if (!nextEntry) return;
|
|
2855
|
+
nextEntry.abortedLastRun = true;
|
|
2856
|
+
applyAbortCutoffToSessionEntry(nextEntry, abortCutoff);
|
|
2857
|
+
nextEntry.updatedAt = Date.now();
|
|
2858
|
+
store[key] = nextEntry;
|
|
2859
|
+
});
|
|
2860
|
+
return true;
|
|
2861
|
+
}
|
|
2862
|
+
//#endregion
|
|
2863
|
+
//#region src/auto-reply/reply/commands-session-abort.ts
|
|
2864
|
+
function resolveAbortTarget(params) {
|
|
2865
|
+
const targetSessionKey = normalizeOptionalString(params.ctx.CommandTargetSessionKey) || params.sessionKey;
|
|
2866
|
+
const { entry, key } = resolveSessionEntryForKey(params.sessionStore, targetSessionKey);
|
|
2867
|
+
if (entry && key) return {
|
|
2868
|
+
entry,
|
|
2869
|
+
key,
|
|
2870
|
+
sessionId: replyRunRegistry.resolveSessionId(key) ?? entry.sessionId
|
|
2871
|
+
};
|
|
2872
|
+
if (params.sessionEntry && params.sessionKey) return {
|
|
2873
|
+
entry: params.sessionEntry,
|
|
2874
|
+
key: params.sessionKey,
|
|
2875
|
+
sessionId: replyRunRegistry.resolveSessionId(params.sessionKey) ?? params.sessionEntry.sessionId
|
|
2876
|
+
};
|
|
2877
|
+
return {
|
|
2878
|
+
entry: void 0,
|
|
2879
|
+
key: targetSessionKey,
|
|
2880
|
+
sessionId: targetSessionKey ? replyRunRegistry.resolveSessionId(targetSessionKey) : void 0
|
|
2881
|
+
};
|
|
2882
|
+
}
|
|
2883
|
+
function resolveAbortCutoffForTarget(params) {
|
|
2884
|
+
if (!shouldPersistAbortCutoff({
|
|
2885
|
+
commandSessionKey: params.commandSessionKey,
|
|
2886
|
+
targetSessionKey: params.targetSessionKey
|
|
2887
|
+
})) return;
|
|
2888
|
+
return resolveAbortCutoffFromContext(params.ctx);
|
|
2889
|
+
}
|
|
2890
|
+
async function applyAbortTarget(params) {
|
|
2891
|
+
const { abortTarget } = params;
|
|
2892
|
+
if (abortTarget.key) replyRunRegistry.abort(abortTarget.key);
|
|
2893
|
+
if (abortTarget.sessionId) abortEmbeddedPiRun(abortTarget.sessionId);
|
|
2894
|
+
if (!await persistAbortTargetEntry({
|
|
2895
|
+
entry: abortTarget.entry,
|
|
2896
|
+
key: abortTarget.key,
|
|
2897
|
+
sessionStore: params.sessionStore,
|
|
2898
|
+
storePath: params.storePath,
|
|
2899
|
+
abortCutoff: params.abortCutoff
|
|
2900
|
+
}) && params.abortKey) setAbortMemory(params.abortKey, true);
|
|
2901
|
+
}
|
|
2902
|
+
function buildAbortTargetApplyParams(params, abortTarget) {
|
|
2903
|
+
return {
|
|
2904
|
+
abortTarget,
|
|
2905
|
+
sessionStore: params.sessionStore,
|
|
2906
|
+
storePath: params.storePath,
|
|
2907
|
+
abortKey: params.command.abortKey,
|
|
2908
|
+
abortCutoff: resolveAbortCutoffForTarget({
|
|
2909
|
+
ctx: params.ctx,
|
|
2910
|
+
commandSessionKey: params.sessionKey,
|
|
2911
|
+
targetSessionKey: abortTarget.key
|
|
2912
|
+
})
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
const handleStopCommand = async (params, allowTextCommands) => {
|
|
2916
|
+
if (!allowTextCommands) return null;
|
|
2917
|
+
if (params.command.commandBodyNormalized !== "/stop") return null;
|
|
2918
|
+
const unauthorizedStop = rejectUnauthorizedCommand(params, "/stop");
|
|
2919
|
+
if (unauthorizedStop) return unauthorizedStop;
|
|
2920
|
+
const abortTarget = resolveAbortTarget({
|
|
2921
|
+
ctx: params.ctx,
|
|
2922
|
+
sessionKey: params.sessionKey,
|
|
2923
|
+
sessionEntry: params.sessionEntry,
|
|
2924
|
+
sessionStore: params.sessionStore
|
|
2925
|
+
});
|
|
2926
|
+
const cleared = clearSessionQueues([abortTarget.key, abortTarget.sessionId]);
|
|
2927
|
+
if (cleared.followupCleared > 0 || cleared.laneCleared > 0) logVerbose(`stop: cleared followups=${cleared.followupCleared} lane=${cleared.laneCleared} keys=${cleared.keys.join(",")}`);
|
|
2928
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, abortTarget));
|
|
2929
|
+
await triggerInternalHook(createInternalHookEvent("command", "stop", abortTarget.key ?? params.sessionKey ?? "", {
|
|
2930
|
+
sessionEntry: abortTarget.entry ?? params.sessionEntry,
|
|
2931
|
+
sessionId: abortTarget.sessionId,
|
|
2932
|
+
commandSource: params.command.surface,
|
|
2933
|
+
senderId: params.command.senderId
|
|
2934
|
+
}));
|
|
2935
|
+
const { stopped } = stopSubagentsForRequester({
|
|
2936
|
+
cfg: params.cfg,
|
|
2937
|
+
requesterSessionKey: abortTarget.key ?? params.sessionKey
|
|
2938
|
+
});
|
|
2939
|
+
return {
|
|
2940
|
+
shouldContinue: false,
|
|
2941
|
+
reply: { text: formatAbortReplyText(stopped) }
|
|
2942
|
+
};
|
|
2943
|
+
};
|
|
2944
|
+
const handleAbortTrigger = async (params, allowTextCommands) => {
|
|
2945
|
+
if (!allowTextCommands) return null;
|
|
2946
|
+
if (!isAbortTrigger(params.command.rawBodyNormalized)) return null;
|
|
2947
|
+
const unauthorizedAbortTrigger = rejectUnauthorizedCommand(params, "abort trigger");
|
|
2948
|
+
if (unauthorizedAbortTrigger) return unauthorizedAbortTrigger;
|
|
2949
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, resolveAbortTarget({
|
|
2950
|
+
ctx: params.ctx,
|
|
2951
|
+
sessionKey: params.sessionKey,
|
|
2952
|
+
sessionEntry: params.sessionEntry,
|
|
2953
|
+
sessionStore: params.sessionStore
|
|
2954
|
+
})));
|
|
2955
|
+
return {
|
|
2956
|
+
shouldContinue: false,
|
|
2957
|
+
reply: { text: "āļø Agent was aborted." }
|
|
2958
|
+
};
|
|
2959
|
+
};
|
|
2960
|
+
//#endregion
|
|
2961
|
+
//#region src/auto-reply/reply/commands-session.ts
|
|
2962
|
+
const SESSION_DURATION_OFF_VALUES = new Set([
|
|
2963
|
+
"off",
|
|
2964
|
+
"disable",
|
|
2965
|
+
"disabled",
|
|
2966
|
+
"none",
|
|
2967
|
+
"0"
|
|
2968
|
+
]);
|
|
2969
|
+
const SESSION_ACTION_IDLE = "idle";
|
|
2970
|
+
const SESSION_ACTION_MAX_AGE = "max-age";
|
|
2971
|
+
function resolveSessionCommandUsage() {
|
|
2972
|
+
return "Usage: /session idle <duration|off> | /session max-age <duration|off> (example: /session idle 24h)";
|
|
2973
|
+
}
|
|
2974
|
+
function parseSessionDurationMs(raw) {
|
|
2975
|
+
const normalized = normalizeOptionalLowercaseString(raw);
|
|
2976
|
+
if (!normalized) throw new Error("missing duration");
|
|
2977
|
+
if (SESSION_DURATION_OFF_VALUES.has(normalized)) return 0;
|
|
2978
|
+
if (/^\d+(?:\.\d+)?$/.test(normalized)) {
|
|
2979
|
+
const hours = Number(normalized);
|
|
2980
|
+
if (!Number.isFinite(hours) || hours < 0) throw new Error("invalid duration");
|
|
2981
|
+
return Math.round(hours * 60 * 60 * 1e3);
|
|
2982
|
+
}
|
|
2983
|
+
return parseDurationMs(normalized, { defaultUnit: "h" });
|
|
2984
|
+
}
|
|
2985
|
+
function formatSessionExpiry(expiresAt) {
|
|
2986
|
+
return new Date(expiresAt).toISOString();
|
|
2987
|
+
}
|
|
2988
|
+
function resolveSessionBindingDurationMs(binding, key, fallbackMs) {
|
|
2989
|
+
const raw = binding.metadata?.[key];
|
|
2990
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return fallbackMs;
|
|
2991
|
+
return Math.max(0, Math.floor(raw));
|
|
2992
|
+
}
|
|
2993
|
+
function resolveSessionBindingLastActivityAt(binding) {
|
|
2994
|
+
const raw = binding.metadata?.lastActivityAt;
|
|
2995
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return binding.boundAt;
|
|
2996
|
+
return Math.max(Math.floor(raw), binding.boundAt);
|
|
2997
|
+
}
|
|
2998
|
+
function resolveSessionBindingBoundBy(binding) {
|
|
2999
|
+
const raw = binding.metadata?.boundBy;
|
|
3000
|
+
return normalizeOptionalString(raw) ?? "";
|
|
3001
|
+
}
|
|
3002
|
+
function isSessionBindingRecord(binding) {
|
|
3003
|
+
return "bindingId" in binding;
|
|
3004
|
+
}
|
|
3005
|
+
function resolveUpdatedLifecycleDurationMs(binding, key) {
|
|
3006
|
+
if (!isSessionBindingRecord(binding)) {
|
|
3007
|
+
const raw = binding[key];
|
|
3008
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return Math.max(0, Math.floor(raw));
|
|
3009
|
+
}
|
|
3010
|
+
if (!isSessionBindingRecord(binding)) return;
|
|
3011
|
+
const raw = binding.metadata?.[key];
|
|
3012
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return;
|
|
3013
|
+
return Math.max(0, Math.floor(raw));
|
|
3014
|
+
}
|
|
3015
|
+
function toUpdatedLifecycleBinding(binding) {
|
|
3016
|
+
const lastActivityAt = isSessionBindingRecord(binding) ? resolveSessionBindingLastActivityAt(binding) : Math.max(Math.floor(binding.lastActivityAt), binding.boundAt);
|
|
3017
|
+
return {
|
|
3018
|
+
boundAt: binding.boundAt,
|
|
3019
|
+
lastActivityAt,
|
|
3020
|
+
idleTimeoutMs: resolveUpdatedLifecycleDurationMs(binding, "idleTimeoutMs"),
|
|
3021
|
+
maxAgeMs: resolveUpdatedLifecycleDurationMs(binding, "maxAgeMs")
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
3024
|
+
function resolveUpdatedBindingExpiry(params) {
|
|
3025
|
+
const expiries = params.bindings.map((binding) => {
|
|
3026
|
+
if (params.action === SESSION_ACTION_IDLE) {
|
|
3027
|
+
const idleTimeoutMs = typeof binding.idleTimeoutMs === "number" && Number.isFinite(binding.idleTimeoutMs) ? Math.max(0, Math.floor(binding.idleTimeoutMs)) : 0;
|
|
3028
|
+
if (idleTimeoutMs <= 0) return;
|
|
3029
|
+
return Math.max(binding.lastActivityAt, binding.boundAt) + idleTimeoutMs;
|
|
3030
|
+
}
|
|
3031
|
+
const maxAgeMs = typeof binding.maxAgeMs === "number" && Number.isFinite(binding.maxAgeMs) ? Math.max(0, Math.floor(binding.maxAgeMs)) : 0;
|
|
3032
|
+
if (maxAgeMs <= 0) return;
|
|
3033
|
+
return binding.boundAt + maxAgeMs;
|
|
3034
|
+
}).filter((expiresAt) => typeof expiresAt === "number");
|
|
3035
|
+
if (expiries.length === 0) return;
|
|
3036
|
+
return Math.min(...expiries);
|
|
3037
|
+
}
|
|
3038
|
+
const handleActivationCommand = async (params, allowTextCommands) => {
|
|
3039
|
+
if (!allowTextCommands) return null;
|
|
3040
|
+
const activationCommand = parseActivationCommand(params.command.commandBodyNormalized);
|
|
3041
|
+
if (!activationCommand.hasCommand) return null;
|
|
3042
|
+
if (!params.isGroup) return {
|
|
3043
|
+
shouldContinue: false,
|
|
3044
|
+
reply: { text: "āļø Group activation only applies to group chats." }
|
|
3045
|
+
};
|
|
3046
|
+
if (!params.command.isAuthorizedSender) {
|
|
3047
|
+
logVerbose(`Ignoring /activation from unauthorized sender in group: ${params.command.senderId || "<unknown>"}`);
|
|
3048
|
+
return { shouldContinue: false };
|
|
3049
|
+
}
|
|
3050
|
+
if (!activationCommand.mode) return {
|
|
3051
|
+
shouldContinue: false,
|
|
3052
|
+
reply: { text: "āļø Usage: /activation mention|always" }
|
|
3053
|
+
};
|
|
3054
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3055
|
+
params.sessionEntry.groupActivation = activationCommand.mode;
|
|
3056
|
+
params.sessionEntry.groupActivationNeedsSystemIntro = true;
|
|
3057
|
+
await persistSessionEntry(params);
|
|
3058
|
+
}
|
|
3059
|
+
return {
|
|
3060
|
+
shouldContinue: false,
|
|
3061
|
+
reply: { text: `āļø Group activation set to ${activationCommand.mode}.` }
|
|
3062
|
+
};
|
|
3063
|
+
};
|
|
3064
|
+
const handleSendPolicyCommand = async (params, allowTextCommands) => {
|
|
3065
|
+
if (!allowTextCommands) return null;
|
|
3066
|
+
const sendPolicyCommand = parseSendPolicyCommand(params.command.commandBodyNormalized);
|
|
3067
|
+
if (!sendPolicyCommand.hasCommand) return null;
|
|
3068
|
+
const unauthorizedResult = rejectUnauthorizedCommand(params, "/send");
|
|
3069
|
+
if (unauthorizedResult) return unauthorizedResult;
|
|
3070
|
+
const nonOwnerResult = rejectNonOwnerCommand(params, "/send");
|
|
3071
|
+
if (nonOwnerResult) return nonOwnerResult;
|
|
3072
|
+
if (!sendPolicyCommand.mode) return {
|
|
3073
|
+
shouldContinue: false,
|
|
3074
|
+
reply: { text: "āļø Usage: /send on|off|inherit" }
|
|
3075
|
+
};
|
|
3076
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3077
|
+
if (sendPolicyCommand.mode === "inherit") delete params.sessionEntry.sendPolicy;
|
|
3078
|
+
else params.sessionEntry.sendPolicy = sendPolicyCommand.mode;
|
|
3079
|
+
await persistSessionEntry(params);
|
|
3080
|
+
}
|
|
3081
|
+
return {
|
|
3082
|
+
shouldContinue: false,
|
|
3083
|
+
reply: { text: `āļø Send policy set to ${sendPolicyCommand.mode === "inherit" ? "inherit" : sendPolicyCommand.mode === "allow" ? "on" : "off"}.` }
|
|
3084
|
+
};
|
|
3085
|
+
};
|
|
3086
|
+
const handleUsageCommand = async (params, allowTextCommands) => {
|
|
3087
|
+
if (!allowTextCommands) return null;
|
|
3088
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3089
|
+
if (normalized !== "/usage" && !normalized.startsWith("/usage ")) return null;
|
|
3090
|
+
if (!params.command.isAuthorizedSender) {
|
|
3091
|
+
logVerbose(`Ignoring /usage from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3092
|
+
return { shouldContinue: false };
|
|
3093
|
+
}
|
|
3094
|
+
const rawArgs = normalized === "/usage" ? "" : normalized.slice(6).trim();
|
|
3095
|
+
const requested = rawArgs ? normalizeUsageDisplay(rawArgs) : void 0;
|
|
3096
|
+
if (normalizeLowercaseStringOrEmpty(rawArgs).startsWith("cost")) {
|
|
3097
|
+
const sessionSummary = await loadSessionCostSummary({
|
|
3098
|
+
sessionId: params.sessionEntry?.sessionId,
|
|
3099
|
+
sessionEntry: params.sessionEntry,
|
|
3100
|
+
sessionFile: params.sessionEntry?.sessionFile,
|
|
3101
|
+
config: params.cfg,
|
|
3102
|
+
agentId: params.agentId
|
|
3103
|
+
});
|
|
3104
|
+
const summary = await loadCostUsageSummary({
|
|
3105
|
+
days: 30,
|
|
3106
|
+
config: params.cfg
|
|
3107
|
+
});
|
|
3108
|
+
const sessionCost = formatUsd(sessionSummary?.totalCost);
|
|
3109
|
+
const sessionTokens = sessionSummary?.totalTokens ? formatTokenCount(sessionSummary.totalTokens) : void 0;
|
|
3110
|
+
const sessionSuffix = (sessionSummary?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
3111
|
+
const sessionLine = sessionCost || sessionTokens ? `Session ${sessionCost ?? "n/a"}${sessionSuffix}${sessionTokens ? ` Ā· ${sessionTokens} tokens` : ""}` : "Session n/a";
|
|
3112
|
+
const todayKey = (/* @__PURE__ */ new Date()).toLocaleDateString("en-CA");
|
|
3113
|
+
const todayEntry = summary.daily.find((entry) => entry.date === todayKey);
|
|
3114
|
+
const todayCost = formatUsd(todayEntry?.totalCost);
|
|
3115
|
+
const todaySuffix = (todayEntry?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
3116
|
+
const todayLine = `Today ${todayCost ?? "n/a"}${todaySuffix}`;
|
|
3117
|
+
const last30Cost = formatUsd(summary.totals.totalCost);
|
|
3118
|
+
const last30Suffix = summary.totals.missingCostEntries > 0 ? " (partial)" : "";
|
|
3119
|
+
return {
|
|
3120
|
+
shouldContinue: false,
|
|
3121
|
+
reply: { text: `šø Usage cost\n${sessionLine}\n${todayLine}\n${`Last 30d ${last30Cost ?? "n/a"}${last30Suffix}`}` }
|
|
3122
|
+
};
|
|
3123
|
+
}
|
|
3124
|
+
if (rawArgs && !requested) return {
|
|
3125
|
+
shouldContinue: false,
|
|
3126
|
+
reply: { text: "āļø Usage: /usage off|tokens|full|cost" }
|
|
3127
|
+
};
|
|
3128
|
+
const current = resolveResponseUsageMode(params.sessionEntry?.responseUsage ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey]?.responseUsage : void 0));
|
|
3129
|
+
const next = requested ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
|
|
3130
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3131
|
+
if (next === "off") delete params.sessionEntry.responseUsage;
|
|
3132
|
+
else params.sessionEntry.responseUsage = next;
|
|
3133
|
+
await persistSessionEntry(params);
|
|
3134
|
+
}
|
|
3135
|
+
return {
|
|
3136
|
+
shouldContinue: false,
|
|
3137
|
+
reply: { text: `āļø Usage footer: ${next}.` }
|
|
3138
|
+
};
|
|
3139
|
+
};
|
|
3140
|
+
const handleFastCommand = async (params, allowTextCommands) => {
|
|
3141
|
+
if (!allowTextCommands) return null;
|
|
3142
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3143
|
+
if (normalized !== "/fast" && !normalized.startsWith("/fast ")) return null;
|
|
3144
|
+
if (!params.command.isAuthorizedSender) {
|
|
3145
|
+
logVerbose(`Ignoring /fast from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3146
|
+
return { shouldContinue: false };
|
|
3147
|
+
}
|
|
3148
|
+
const rawMode = normalizeLowercaseStringOrEmpty(normalized === "/fast" ? "" : normalized.slice(5).trim());
|
|
3149
|
+
if (!rawMode || rawMode === "status") {
|
|
3150
|
+
const state = resolveFastModeState({
|
|
3151
|
+
cfg: params.cfg,
|
|
3152
|
+
provider: params.provider,
|
|
3153
|
+
model: params.model,
|
|
3154
|
+
agentId: params.agentId,
|
|
3155
|
+
sessionEntry: params.sessionEntry
|
|
3156
|
+
});
|
|
3157
|
+
const suffix = state.source === "agent" ? " (agent)" : state.source === "config" ? " (config)" : state.source === "default" ? " (default)" : "";
|
|
3158
|
+
return {
|
|
3159
|
+
shouldContinue: false,
|
|
3160
|
+
reply: { text: `āļø Current fast mode: ${state.enabled ? "on" : "off"}${suffix}.` }
|
|
3161
|
+
};
|
|
3162
|
+
}
|
|
3163
|
+
const nextMode = normalizeFastMode(rawMode);
|
|
3164
|
+
if (nextMode === void 0) return {
|
|
3165
|
+
shouldContinue: false,
|
|
3166
|
+
reply: { text: "āļø Usage: /fast status|on|off" }
|
|
3167
|
+
};
|
|
3168
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3169
|
+
params.sessionEntry.fastMode = nextMode;
|
|
3170
|
+
await persistSessionEntry(params);
|
|
3171
|
+
}
|
|
3172
|
+
return {
|
|
3173
|
+
shouldContinue: false,
|
|
3174
|
+
reply: { text: `āļø Fast mode ${nextMode ? "enabled" : "disabled"}.` }
|
|
3175
|
+
};
|
|
3176
|
+
};
|
|
3177
|
+
const handleSessionCommand = async (params, allowTextCommands) => {
|
|
3178
|
+
if (!allowTextCommands) return null;
|
|
3179
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3180
|
+
if (!/^\/session(?:\s|$)/.test(normalized)) return null;
|
|
3181
|
+
if (!params.command.isAuthorizedSender) {
|
|
3182
|
+
logVerbose(`Ignoring /session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3183
|
+
return { shouldContinue: false };
|
|
3184
|
+
}
|
|
3185
|
+
const tokens = normalized.slice(8).trim().split(/\s+/).filter(Boolean);
|
|
3186
|
+
const action = normalizeOptionalLowercaseString(tokens[0]);
|
|
3187
|
+
if (action !== SESSION_ACTION_IDLE && action !== SESSION_ACTION_MAX_AGE) return {
|
|
3188
|
+
shouldContinue: false,
|
|
3189
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
3190
|
+
};
|
|
3191
|
+
const channelId = params.command.channelId ?? normalizeChannelId$1(resolveCommandSurfaceChannel(params)) ?? void 0;
|
|
3192
|
+
const commandConversationBindings = channelId ? getChannelPlugin(channelId)?.conversationBindings : void 0;
|
|
3193
|
+
const commandSupportsCurrentConversationBinding = Boolean(commandConversationBindings?.supportsCurrentConversationBinding);
|
|
3194
|
+
const commandSupportsLifecycleUpdate = action === SESSION_ACTION_IDLE ? typeof commandConversationBindings?.setIdleTimeoutBySessionKey === "function" : typeof commandConversationBindings?.setMaxAgeBySessionKey === "function";
|
|
3195
|
+
const bindingContext = resolveConversationBindingContextFromAcpCommand(params);
|
|
3196
|
+
if (!bindingContext) {
|
|
3197
|
+
if (!channelId || !commandSupportsCurrentConversationBinding || !commandSupportsLifecycleUpdate) return {
|
|
3198
|
+
shouldContinue: false,
|
|
3199
|
+
reply: { text: "ā ļø /session idle and /session max-age are currently available only on channels that support focused conversation bindings." }
|
|
3200
|
+
};
|
|
3201
|
+
return {
|
|
3202
|
+
shouldContinue: false,
|
|
3203
|
+
reply: { text: "ā ļø /session idle and /session max-age must be run inside a focused conversation." }
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
const resolvedChannelId = bindingContext.channel || channelId;
|
|
3207
|
+
const conversationBindings = resolvedChannelId ? getChannelPlugin(resolvedChannelId)?.conversationBindings : void 0;
|
|
3208
|
+
const supportsCurrentConversationBinding = Boolean(conversationBindings?.supportsCurrentConversationBinding);
|
|
3209
|
+
const supportsLifecycleUpdate = action === SESSION_ACTION_IDLE ? typeof conversationBindings?.setIdleTimeoutBySessionKey === "function" : typeof conversationBindings?.setMaxAgeBySessionKey === "function";
|
|
3210
|
+
if (!resolvedChannelId || !supportsCurrentConversationBinding || !supportsLifecycleUpdate) return {
|
|
3211
|
+
shouldContinue: false,
|
|
3212
|
+
reply: { text: "ā ļø /session idle and /session max-age are currently available only on channels that support focused conversation bindings." }
|
|
3213
|
+
};
|
|
3214
|
+
const activeBinding = getSessionBindingService().resolveByConversation(bindingContext);
|
|
3215
|
+
if (!activeBinding) return {
|
|
3216
|
+
shouldContinue: false,
|
|
3217
|
+
reply: { text: "ā¹ļø This conversation is not currently focused." }
|
|
3218
|
+
};
|
|
3219
|
+
const idleTimeoutMs = resolveSessionBindingDurationMs(activeBinding, "idleTimeoutMs", 1440 * 60 * 1e3);
|
|
3220
|
+
const idleExpiresAt = idleTimeoutMs > 0 ? resolveSessionBindingLastActivityAt(activeBinding) + idleTimeoutMs : void 0;
|
|
3221
|
+
const maxAgeMs = resolveSessionBindingDurationMs(activeBinding, "maxAgeMs", 0);
|
|
3222
|
+
const maxAgeExpiresAt = maxAgeMs > 0 ? activeBinding.boundAt + maxAgeMs : void 0;
|
|
3223
|
+
const durationArgRaw = tokens.slice(1).join("");
|
|
3224
|
+
if (!durationArgRaw) {
|
|
3225
|
+
if (action === SESSION_ACTION_IDLE) {
|
|
3226
|
+
if (typeof idleExpiresAt === "number" && Number.isFinite(idleExpiresAt) && idleExpiresAt > Date.now()) return {
|
|
3227
|
+
shouldContinue: false,
|
|
3228
|
+
reply: { text: `ā¹ļø Idle timeout active (${formatThreadBindingDurationLabel(idleTimeoutMs)}, next auto-unfocus at ${formatSessionExpiry(idleExpiresAt)}).` }
|
|
3229
|
+
};
|
|
3230
|
+
return {
|
|
3231
|
+
shouldContinue: false,
|
|
3232
|
+
reply: { text: "ā¹ļø Idle timeout is currently disabled for this focused session." }
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
if (typeof maxAgeExpiresAt === "number" && Number.isFinite(maxAgeExpiresAt) && maxAgeExpiresAt > Date.now()) return {
|
|
3236
|
+
shouldContinue: false,
|
|
3237
|
+
reply: { text: `ā¹ļø Max age active (${formatThreadBindingDurationLabel(maxAgeMs)}, hard auto-unfocus at ${formatSessionExpiry(maxAgeExpiresAt)}).` }
|
|
3238
|
+
};
|
|
3239
|
+
return {
|
|
3240
|
+
shouldContinue: false,
|
|
3241
|
+
reply: { text: "ā¹ļø Max age is currently disabled for this focused session." }
|
|
3242
|
+
};
|
|
3243
|
+
}
|
|
3244
|
+
const senderId = normalizeOptionalString(params.command.senderId) ?? "";
|
|
3245
|
+
const boundBy = resolveSessionBindingBoundBy(activeBinding);
|
|
3246
|
+
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
|
|
3247
|
+
shouldContinue: false,
|
|
3248
|
+
reply: { text: `ā ļø Only ${boundBy} can update session lifecycle settings for this conversation.` }
|
|
3249
|
+
};
|
|
3250
|
+
let durationMs;
|
|
3251
|
+
try {
|
|
3252
|
+
durationMs = parseSessionDurationMs(durationArgRaw);
|
|
3253
|
+
} catch {
|
|
3254
|
+
return {
|
|
3255
|
+
shouldContinue: false,
|
|
3256
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3259
|
+
const updatedBindings = action === SESSION_ACTION_IDLE ? setChannelConversationBindingIdleTimeoutBySessionKey({
|
|
3260
|
+
channelId: bindingContext.channel,
|
|
3261
|
+
targetSessionKey: activeBinding.targetSessionKey,
|
|
3262
|
+
accountId: bindingContext.accountId,
|
|
3263
|
+
idleTimeoutMs: durationMs
|
|
3264
|
+
}) : setChannelConversationBindingMaxAgeBySessionKey({
|
|
3265
|
+
channelId: bindingContext.channel,
|
|
3266
|
+
targetSessionKey: activeBinding.targetSessionKey,
|
|
3267
|
+
accountId: bindingContext.accountId,
|
|
3268
|
+
maxAgeMs: durationMs
|
|
3269
|
+
});
|
|
3270
|
+
if (updatedBindings.length === 0) return {
|
|
3271
|
+
shouldContinue: false,
|
|
3272
|
+
reply: { text: action === SESSION_ACTION_IDLE ? "ā ļø Failed to update idle timeout for the current binding." : "ā ļø Failed to update max age for the current binding." }
|
|
3273
|
+
};
|
|
3274
|
+
if (durationMs <= 0) return {
|
|
3275
|
+
shouldContinue: false,
|
|
3276
|
+
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"}.` }
|
|
3277
|
+
};
|
|
3278
|
+
const nextExpiry = resolveUpdatedBindingExpiry({
|
|
3279
|
+
action,
|
|
3280
|
+
bindings: updatedBindings.map((binding) => toUpdatedLifecycleBinding(binding))
|
|
3281
|
+
});
|
|
3282
|
+
const expiryLabel = typeof nextExpiry === "number" && Number.isFinite(nextExpiry) ? formatSessionExpiry(nextExpiry) : "n/a";
|
|
3283
|
+
return {
|
|
3284
|
+
shouldContinue: false,
|
|
3285
|
+
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}).` }
|
|
3286
|
+
};
|
|
3287
|
+
};
|
|
3288
|
+
const handleRestartCommand = async (params, allowTextCommands) => {
|
|
3289
|
+
if (!allowTextCommands) return null;
|
|
3290
|
+
if (params.command.commandBodyNormalized !== "/restart") return null;
|
|
3291
|
+
if (!params.command.isAuthorizedSender) {
|
|
3292
|
+
logVerbose(`Ignoring /restart from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3293
|
+
return { shouldContinue: false };
|
|
3294
|
+
}
|
|
3295
|
+
if (!isRestartEnabled(params.cfg)) return {
|
|
3296
|
+
shouldContinue: false,
|
|
3297
|
+
reply: { text: "ā ļø /restart is disabled (commands.restart=false)." }
|
|
3298
|
+
};
|
|
3299
|
+
if (process.listenerCount("SIGUSR1") > 0) {
|
|
3300
|
+
scheduleGatewaySigusr1Restart({ reason: "/restart" });
|
|
3301
|
+
return {
|
|
3302
|
+
shouldContinue: false,
|
|
3303
|
+
reply: { text: "āļø Restarting KaijiBot in-process (SIGUSR1); back in a few seconds." }
|
|
3304
|
+
};
|
|
3305
|
+
}
|
|
3306
|
+
const restartMethod = triggerKaijiBotRestart();
|
|
3307
|
+
if (!restartMethod.ok) {
|
|
3308
|
+
const detail = restartMethod.detail ? ` Details: ${restartMethod.detail}` : "";
|
|
3309
|
+
return {
|
|
3310
|
+
shouldContinue: false,
|
|
3311
|
+
reply: { text: `ā ļø Restart failed (${restartMethod.method}).${detail}` }
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
return {
|
|
3315
|
+
shouldContinue: false,
|
|
3316
|
+
reply: { text: `āļø Restarting KaijiBot via ${restartMethod.method}; give me a few seconds to come back online.` }
|
|
3317
|
+
};
|
|
3318
|
+
};
|
|
3319
|
+
//#endregion
|
|
3320
|
+
//#region src/auto-reply/reply/commands-subagents.ts
|
|
3321
|
+
let actionAgentsPromise = null;
|
|
3322
|
+
let actionFocusPromise = null;
|
|
3323
|
+
let actionHelpPromise = null;
|
|
3324
|
+
let actionInfoPromise = null;
|
|
3325
|
+
let actionKillPromise = null;
|
|
3326
|
+
let actionListPromise = null;
|
|
3327
|
+
let actionLogPromise = null;
|
|
3328
|
+
let actionSendPromise = null;
|
|
3329
|
+
let actionSpawnPromise = null;
|
|
3330
|
+
let actionUnfocusPromise = null;
|
|
3331
|
+
let controlRuntimePromise = null;
|
|
3332
|
+
function loadAgentsAction() {
|
|
3333
|
+
actionAgentsPromise ??= import("./action-agents-bNO5zlxQ.js");
|
|
3334
|
+
return actionAgentsPromise;
|
|
3335
|
+
}
|
|
3336
|
+
function loadFocusAction() {
|
|
3337
|
+
actionFocusPromise ??= import("./action-focus-BQH1yzA9.js");
|
|
3338
|
+
return actionFocusPromise;
|
|
3339
|
+
}
|
|
3340
|
+
function loadHelpAction() {
|
|
3341
|
+
actionHelpPromise ??= import("./action-help-Copk6G3d.js");
|
|
3342
|
+
return actionHelpPromise;
|
|
3343
|
+
}
|
|
3344
|
+
function loadInfoAction() {
|
|
3345
|
+
actionInfoPromise ??= import("./action-info-BUV_zoSU.js");
|
|
3346
|
+
return actionInfoPromise;
|
|
3347
|
+
}
|
|
3348
|
+
function loadKillAction() {
|
|
3349
|
+
actionKillPromise ??= import("./action-kill-BMDz9l_U.js");
|
|
3350
|
+
return actionKillPromise;
|
|
3351
|
+
}
|
|
3352
|
+
function loadListAction() {
|
|
3353
|
+
actionListPromise ??= import("./action-list-CxkulhYF.js");
|
|
3354
|
+
return actionListPromise;
|
|
3355
|
+
}
|
|
3356
|
+
function loadLogAction() {
|
|
3357
|
+
actionLogPromise ??= import("./action-log-D0K9-YCV.js");
|
|
3358
|
+
return actionLogPromise;
|
|
3359
|
+
}
|
|
3360
|
+
function loadSendAction() {
|
|
3361
|
+
actionSendPromise ??= import("./action-send-B8ggJVwC.js");
|
|
3362
|
+
return actionSendPromise;
|
|
3363
|
+
}
|
|
3364
|
+
function loadSpawnAction() {
|
|
3365
|
+
actionSpawnPromise ??= import("./action-spawn-D9kSXA_K.js");
|
|
3366
|
+
return actionSpawnPromise;
|
|
3367
|
+
}
|
|
3368
|
+
function loadUnfocusAction() {
|
|
3369
|
+
actionUnfocusPromise ??= import("./action-unfocus-bI4VBonB.js");
|
|
3370
|
+
return actionUnfocusPromise;
|
|
3371
|
+
}
|
|
3372
|
+
function loadControlRuntime() {
|
|
3373
|
+
controlRuntimePromise ??= import("./commands-subagents-control.runtime-DjhcmoRT.js");
|
|
3374
|
+
return controlRuntimePromise;
|
|
3375
|
+
}
|
|
3376
|
+
const handleSubagentsCommand = async (params, allowTextCommands) => {
|
|
3377
|
+
if (!allowTextCommands) return null;
|
|
3378
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3379
|
+
const handledPrefix = resolveHandledPrefix(normalized);
|
|
3380
|
+
if (!handledPrefix) return null;
|
|
3381
|
+
if (!params.command.isAuthorizedSender) {
|
|
3382
|
+
logVerbose(`Ignoring ${handledPrefix} from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3383
|
+
return { shouldContinue: false };
|
|
3384
|
+
}
|
|
3385
|
+
const restTokens = normalized.slice(handledPrefix.length).trim().split(/\s+/).filter(Boolean);
|
|
3386
|
+
const action = resolveSubagentsAction({
|
|
3387
|
+
handledPrefix,
|
|
3388
|
+
restTokens
|
|
3389
|
+
});
|
|
3390
|
+
if (!action) return (await loadHelpAction()).handleSubagentsHelpAction();
|
|
3391
|
+
const requesterKey = action === "spawn" ? resolveRequesterSessionKey(params, { preferCommandTarget: true }) : resolveRequesterSessionKey(params);
|
|
3392
|
+
if (!requesterKey) return stopWithText("ā ļø Missing session key.");
|
|
3393
|
+
const ctx = {
|
|
3394
|
+
params,
|
|
3395
|
+
handledPrefix,
|
|
3396
|
+
requesterKey,
|
|
3397
|
+
runs: (await loadControlRuntime()).listControlledSubagentRuns(requesterKey),
|
|
3398
|
+
restTokens
|
|
3399
|
+
};
|
|
3400
|
+
switch (action) {
|
|
3401
|
+
case "help": return (await loadHelpAction()).handleSubagentsHelpAction();
|
|
3402
|
+
case "agents": return (await loadAgentsAction()).handleSubagentsAgentsAction(ctx);
|
|
3403
|
+
case "focus": return await (await loadFocusAction()).handleSubagentsFocusAction(ctx);
|
|
3404
|
+
case "unfocus": return await (await loadUnfocusAction()).handleSubagentsUnfocusAction(ctx);
|
|
3405
|
+
case "list": return (await loadListAction()).handleSubagentsListAction(ctx);
|
|
3406
|
+
case "kill": return await (await loadKillAction()).handleSubagentsKillAction(ctx);
|
|
3407
|
+
case "info": return (await loadInfoAction()).handleSubagentsInfoAction(ctx);
|
|
3408
|
+
case "log": return await (await loadLogAction()).handleSubagentsLogAction(ctx);
|
|
3409
|
+
case "send": return await (await loadSendAction()).handleSubagentsSendAction(ctx, false);
|
|
3410
|
+
case "steer": return await (await loadSendAction()).handleSubagentsSendAction(ctx, true);
|
|
3411
|
+
case "spawn": return await (await loadSpawnAction()).handleSubagentsSpawnAction(ctx);
|
|
3412
|
+
default: return (await loadHelpAction()).handleSubagentsHelpAction();
|
|
3413
|
+
}
|
|
3414
|
+
};
|
|
3415
|
+
//#endregion
|
|
3416
|
+
//#region src/auto-reply/reply/commands-tasks.ts
|
|
3417
|
+
const MAX_VISIBLE_TASKS = 5;
|
|
3418
|
+
const TASK_STATUS_ICONS = {
|
|
3419
|
+
queued: "š”",
|
|
3420
|
+
running: "š¢",
|
|
3421
|
+
succeeded: "ā
",
|
|
3422
|
+
failed: "š“",
|
|
3423
|
+
timed_out: "ā±ļø",
|
|
3424
|
+
cancelled: "āŖļø",
|
|
3425
|
+
lost: "ā ļø"
|
|
3426
|
+
};
|
|
3427
|
+
const TASK_RUNTIME_LABELS = {
|
|
3428
|
+
subagent: "Subagent",
|
|
3429
|
+
acp: "ACP",
|
|
3430
|
+
cli: "CLI",
|
|
3431
|
+
cron: "Cron"
|
|
3432
|
+
};
|
|
3433
|
+
function formatTaskHeadline(snapshot) {
|
|
3434
|
+
if (snapshot.totalCount === 0) return "All clear - nothing linked to this session right now.";
|
|
3435
|
+
return `Current session: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
|
|
3436
|
+
}
|
|
3437
|
+
function formatAgentFallbackLine(agentId) {
|
|
3438
|
+
const snapshot = buildTaskStatusSnapshot(listTasksForAgentIdForStatus(agentId));
|
|
3439
|
+
if (snapshot.totalCount === 0) return;
|
|
3440
|
+
return `Agent-local: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
|
|
3441
|
+
}
|
|
3442
|
+
function formatTaskTiming(task) {
|
|
3443
|
+
if (task.status === "running") {
|
|
3444
|
+
const startedAt = task.startedAt ?? task.createdAt;
|
|
3445
|
+
return `elapsed ${formatDurationCompact(Date.now() - startedAt, { spaced: true }) ?? "0s"}`;
|
|
3446
|
+
}
|
|
3447
|
+
if (task.status === "queued") return `queued ${formatTimeAgo(Date.now() - task.createdAt)}`;
|
|
3448
|
+
const endedAt = task.endedAt ?? task.lastEventAt ?? task.createdAt;
|
|
3449
|
+
return `finished ${formatTimeAgo(Date.now() - endedAt)}`;
|
|
3450
|
+
}
|
|
3451
|
+
function formatTaskDetail(task) {
|
|
3452
|
+
return formatTaskStatusDetail(task);
|
|
3453
|
+
}
|
|
3454
|
+
function formatVisibleTask(task, index) {
|
|
3455
|
+
const title = formatTaskStatusTitle(task);
|
|
3456
|
+
const status = task.status.replaceAll("_", " ");
|
|
3457
|
+
const timing = formatTaskTiming(task);
|
|
3458
|
+
const detail = formatTaskDetail(task);
|
|
3459
|
+
const meta = [
|
|
3460
|
+
TASK_RUNTIME_LABELS[task.runtime],
|
|
3461
|
+
status,
|
|
3462
|
+
timing
|
|
3463
|
+
].filter(Boolean).join(" Ā· ");
|
|
3464
|
+
const lines = [`${index + 1}. ${TASK_STATUS_ICONS[task.status]} ${title}`, ` ${meta}`];
|
|
3465
|
+
if (detail) lines.push(` ${detail}`);
|
|
3466
|
+
return lines.join("\n");
|
|
3467
|
+
}
|
|
3468
|
+
function buildTasksText(params) {
|
|
3469
|
+
const sessionSnapshot = buildTaskStatusSnapshot(listTasksForSessionKeyForStatus(params.sessionKey));
|
|
3470
|
+
const lines = ["š Tasks", formatTaskHeadline(sessionSnapshot)];
|
|
3471
|
+
if (sessionSnapshot.totalCount > 0) {
|
|
3472
|
+
const visible = sessionSnapshot.visible.slice(0, MAX_VISIBLE_TASKS);
|
|
3473
|
+
lines.push("");
|
|
3474
|
+
for (const [index, task] of visible.entries()) {
|
|
3475
|
+
lines.push(formatVisibleTask(task, index));
|
|
3476
|
+
if (index < visible.length - 1) lines.push("");
|
|
3477
|
+
}
|
|
3478
|
+
const hiddenCount = sessionSnapshot.visible.length - visible.length;
|
|
3479
|
+
if (hiddenCount > 0) lines.push("", `+${hiddenCount} more recent task${hiddenCount === 1 ? "" : "s"}`);
|
|
3480
|
+
return lines.join("\n");
|
|
3481
|
+
}
|
|
3482
|
+
const agentFallback = formatAgentFallbackLine(params.agentId);
|
|
3483
|
+
if (agentFallback) lines.push(agentFallback);
|
|
3484
|
+
return lines.join("\n");
|
|
3485
|
+
}
|
|
3486
|
+
async function buildTasksReply(params) {
|
|
3487
|
+
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
3488
|
+
sessionKey: params.sessionKey,
|
|
3489
|
+
config: params.cfg
|
|
3490
|
+
});
|
|
3491
|
+
return { text: buildTasksText({
|
|
3492
|
+
sessionKey: params.sessionKey,
|
|
3493
|
+
agentId
|
|
3494
|
+
}) };
|
|
3495
|
+
}
|
|
3496
|
+
const handleTasksCommand = async (params, allowTextCommands) => {
|
|
3497
|
+
if (!allowTextCommands) return null;
|
|
3498
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3499
|
+
if (normalized !== "/tasks" && !normalized.startsWith("/tasks ")) return null;
|
|
3500
|
+
if (!params.command.isAuthorizedSender) {
|
|
3501
|
+
logVerbose(`Ignoring /tasks from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3502
|
+
return { shouldContinue: false };
|
|
3503
|
+
}
|
|
3504
|
+
if (normalized !== "/tasks") return {
|
|
3505
|
+
shouldContinue: false,
|
|
3506
|
+
reply: { text: "Usage: /tasks" }
|
|
3507
|
+
};
|
|
3508
|
+
return {
|
|
3509
|
+
shouldContinue: false,
|
|
3510
|
+
reply: await buildTasksReply(params)
|
|
3511
|
+
};
|
|
3512
|
+
};
|
|
3513
|
+
//#endregion
|
|
3514
|
+
//#region src/auto-reply/reply/commands-tts.ts
|
|
3515
|
+
function parseTtsCommand(normalized) {
|
|
3516
|
+
if (normalized === "/tts") return {
|
|
3517
|
+
action: "status",
|
|
3518
|
+
args: ""
|
|
3519
|
+
};
|
|
3520
|
+
if (!normalized.startsWith("/tts ")) return null;
|
|
3521
|
+
const rest = normalized.slice(5).trim();
|
|
3522
|
+
if (!rest) return {
|
|
3523
|
+
action: "status",
|
|
3524
|
+
args: ""
|
|
3525
|
+
};
|
|
3526
|
+
const [action, ...tail] = rest.split(/\s+/);
|
|
3527
|
+
return {
|
|
3528
|
+
action: normalizeOptionalLowercaseString(action) ?? "",
|
|
3529
|
+
args: normalizeOptionalString(tail.join(" ")) ?? ""
|
|
3530
|
+
};
|
|
3531
|
+
}
|
|
3532
|
+
function formatAttemptDetails(attempts) {
|
|
3533
|
+
if (!attempts || attempts.length === 0) return;
|
|
3534
|
+
return attempts.map((attempt) => {
|
|
3535
|
+
const reason = attempt.reasonCode === "success" ? "ok" : attempt.reasonCode;
|
|
3536
|
+
const latency = Number.isFinite(attempt.latencyMs) ? ` ${attempt.latencyMs}ms` : "";
|
|
3537
|
+
return `${attempt.provider}:${attempt.outcome}(${reason})${latency}`;
|
|
3538
|
+
}).join(", ");
|
|
3539
|
+
}
|
|
3540
|
+
function ttsUsage() {
|
|
3541
|
+
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!" };
|
|
3542
|
+
}
|
|
3543
|
+
const handleTtsCommands = async (params, allowTextCommands) => {
|
|
3544
|
+
if (!allowTextCommands) return null;
|
|
3545
|
+
const parsed = parseTtsCommand(params.command.commandBodyNormalized);
|
|
3546
|
+
if (!parsed) return null;
|
|
3547
|
+
if (!params.command.isAuthorizedSender) {
|
|
3548
|
+
logVerbose(`Ignoring TTS command from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3549
|
+
return { shouldContinue: false };
|
|
3550
|
+
}
|
|
3551
|
+
const config = resolveTtsConfig(params.cfg);
|
|
3552
|
+
const prefsPath = resolveTtsPrefsPath(config);
|
|
3553
|
+
const action = parsed.action;
|
|
3554
|
+
const args = parsed.args;
|
|
3555
|
+
if (action === "help") return {
|
|
3556
|
+
shouldContinue: false,
|
|
3557
|
+
reply: ttsUsage()
|
|
3558
|
+
};
|
|
3559
|
+
if (action === "on") {
|
|
3560
|
+
setTtsEnabled(prefsPath, true);
|
|
3561
|
+
return {
|
|
3562
|
+
shouldContinue: false,
|
|
3563
|
+
reply: { text: "š TTS enabled." }
|
|
3564
|
+
};
|
|
3565
|
+
}
|
|
3566
|
+
if (action === "off") {
|
|
3567
|
+
setTtsEnabled(prefsPath, false);
|
|
3568
|
+
return {
|
|
3569
|
+
shouldContinue: false,
|
|
3570
|
+
reply: { text: "š TTS disabled." }
|
|
3571
|
+
};
|
|
3572
|
+
}
|
|
3573
|
+
if (action === "audio") {
|
|
3574
|
+
if (!args.trim()) return {
|
|
3575
|
+
shouldContinue: false,
|
|
3576
|
+
reply: { text: "š¤ Generate audio from text.\n\nUsage: /tts audio <text>\nExample: /tts audio Hello, this is a test!" }
|
|
3577
|
+
};
|
|
3578
|
+
const start = Date.now();
|
|
3579
|
+
const result = await textToSpeech({
|
|
3580
|
+
text: args,
|
|
3581
|
+
cfg: params.cfg,
|
|
3582
|
+
channel: params.command.channel,
|
|
3583
|
+
prefsPath
|
|
3584
|
+
});
|
|
3585
|
+
if (result.success && result.audioPath) {
|
|
3586
|
+
setLastTtsAttempt({
|
|
3587
|
+
timestamp: Date.now(),
|
|
3588
|
+
success: true,
|
|
3589
|
+
textLength: args.length,
|
|
3590
|
+
summarized: false,
|
|
3591
|
+
provider: result.provider,
|
|
3592
|
+
fallbackFrom: result.fallbackFrom,
|
|
3593
|
+
attemptedProviders: result.attemptedProviders,
|
|
3594
|
+
attempts: result.attempts,
|
|
3595
|
+
latencyMs: result.latencyMs
|
|
3596
|
+
});
|
|
3597
|
+
return {
|
|
3598
|
+
shouldContinue: false,
|
|
3599
|
+
reply: {
|
|
3600
|
+
mediaUrl: result.audioPath,
|
|
3601
|
+
audioAsVoice: result.voiceCompatible === true
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3605
|
+
setLastTtsAttempt({
|
|
3606
|
+
timestamp: Date.now(),
|
|
3607
|
+
success: false,
|
|
3608
|
+
textLength: args.length,
|
|
3609
|
+
summarized: false,
|
|
3610
|
+
attemptedProviders: result.attemptedProviders,
|
|
3611
|
+
attempts: result.attempts,
|
|
3612
|
+
error: result.error,
|
|
3613
|
+
latencyMs: Date.now() - start
|
|
3614
|
+
});
|
|
3615
|
+
return {
|
|
3616
|
+
shouldContinue: false,
|
|
3617
|
+
reply: { text: `ā Error generating audio: ${result.error ?? "unknown error"}` }
|
|
3618
|
+
};
|
|
3619
|
+
}
|
|
3620
|
+
if (action === "provider") {
|
|
3621
|
+
const currentProvider = getTtsProvider(config, prefsPath);
|
|
3622
|
+
if (!args.trim()) {
|
|
3623
|
+
const providers = listSpeechProviders(params.cfg);
|
|
3624
|
+
return {
|
|
3625
|
+
shouldContinue: false,
|
|
3626
|
+
reply: { text: `šļø TTS provider\nPrimary: ${currentProvider}\n` + providers.map((provider) => `${provider.label}: ${provider.isConfigured({
|
|
3627
|
+
cfg: params.cfg,
|
|
3628
|
+
providerConfig: getResolvedSpeechProviderConfig(config, provider.id, params.cfg),
|
|
3629
|
+
timeoutMs: config.timeoutMs
|
|
3630
|
+
}) ? "ā
" : "ā"}`).join("\n") + `\nUsage: /tts provider <id>` }
|
|
3631
|
+
};
|
|
3632
|
+
}
|
|
3633
|
+
const requested = normalizeOptionalLowercaseString(args) ?? "";
|
|
3634
|
+
const resolvedProvider = getSpeechProvider(requested, params.cfg);
|
|
3635
|
+
if (!resolvedProvider) return {
|
|
3636
|
+
shouldContinue: false,
|
|
3637
|
+
reply: ttsUsage()
|
|
3638
|
+
};
|
|
3639
|
+
const nextProvider = canonicalizeSpeechProviderId(requested, params.cfg) ?? resolvedProvider.id;
|
|
3640
|
+
setTtsProvider(prefsPath, nextProvider);
|
|
3641
|
+
return {
|
|
3642
|
+
shouldContinue: false,
|
|
3643
|
+
reply: { text: `ā
TTS provider set to ${nextProvider}.` }
|
|
3644
|
+
};
|
|
3645
|
+
}
|
|
3646
|
+
if (action === "limit") {
|
|
3647
|
+
if (!args.trim()) return {
|
|
3648
|
+
shouldContinue: false,
|
|
3649
|
+
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` }
|
|
3650
|
+
};
|
|
3651
|
+
const next = Number.parseInt(args.trim(), 10);
|
|
3652
|
+
if (!Number.isFinite(next) || next < 100 || next > 4096) return {
|
|
3653
|
+
shouldContinue: false,
|
|
3654
|
+
reply: { text: "ā Limit must be between 100 and 4096 characters." }
|
|
3655
|
+
};
|
|
3656
|
+
setTtsMaxLength(prefsPath, next);
|
|
3657
|
+
return {
|
|
3658
|
+
shouldContinue: false,
|
|
3659
|
+
reply: { text: `ā
TTS limit set to ${next} characters.` }
|
|
3660
|
+
};
|
|
3661
|
+
}
|
|
3662
|
+
if (action === "summary") {
|
|
3663
|
+
if (!args.trim()) {
|
|
3664
|
+
const enabled = isSummarizationEnabled(prefsPath);
|
|
3665
|
+
const maxLen = getTtsMaxLength(prefsPath);
|
|
3666
|
+
return {
|
|
3667
|
+
shouldContinue: false,
|
|
3668
|
+
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` }
|
|
3669
|
+
};
|
|
3670
|
+
}
|
|
3671
|
+
const requested = normalizeOptionalLowercaseString(args) ?? "";
|
|
3672
|
+
if (requested !== "on" && requested !== "off") return {
|
|
3673
|
+
shouldContinue: false,
|
|
3674
|
+
reply: ttsUsage()
|
|
3675
|
+
};
|
|
3676
|
+
setSummarizationEnabled(prefsPath, requested === "on");
|
|
3677
|
+
return {
|
|
3678
|
+
shouldContinue: false,
|
|
3679
|
+
reply: { text: requested === "on" ? "ā
TTS auto-summary enabled." : "ā TTS auto-summary disabled." }
|
|
3680
|
+
};
|
|
3681
|
+
}
|
|
3682
|
+
if (action === "status") {
|
|
3683
|
+
const enabled = isTtsEnabled(config, prefsPath);
|
|
3684
|
+
const provider = getTtsProvider(config, prefsPath);
|
|
3685
|
+
const hasKey = isTtsProviderConfigured(config, provider, params.cfg);
|
|
3686
|
+
const maxLength = getTtsMaxLength(prefsPath);
|
|
3687
|
+
const summarize = isSummarizationEnabled(prefsPath);
|
|
3688
|
+
const last = getLastTtsAttempt();
|
|
3689
|
+
const lines = [
|
|
3690
|
+
"š TTS status",
|
|
3691
|
+
`State: ${enabled ? "ā
enabled" : "ā disabled"}`,
|
|
3692
|
+
`Provider: ${provider} (${hasKey ? "ā
configured" : "ā not configured"})`,
|
|
3693
|
+
`Text limit: ${maxLength} chars`,
|
|
3694
|
+
`Auto-summary: ${summarize ? "on" : "off"}`
|
|
3695
|
+
];
|
|
3696
|
+
if (last) {
|
|
3697
|
+
const timeAgo = Math.round((Date.now() - last.timestamp) / 1e3);
|
|
3698
|
+
lines.push("");
|
|
3699
|
+
lines.push(`Last attempt (${timeAgo}s ago): ${last.success ? "ā
" : "ā"}`);
|
|
3700
|
+
lines.push(`Text: ${last.textLength} chars${last.summarized ? " (summarized)" : ""}`);
|
|
3701
|
+
if (last.success) {
|
|
3702
|
+
lines.push(`Provider: ${last.provider ?? "unknown"}`);
|
|
3703
|
+
if (last.fallbackFrom && last.provider && last.fallbackFrom !== last.provider) lines.push(`Fallback: ${last.fallbackFrom} -> ${last.provider}`);
|
|
3704
|
+
if (last.attemptedProviders && last.attemptedProviders.length > 1) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3705
|
+
const details = formatAttemptDetails(last.attempts);
|
|
3706
|
+
if (details) lines.push(`Attempt details: ${details}`);
|
|
3707
|
+
lines.push(`Latency: ${last.latencyMs ?? 0}ms`);
|
|
3708
|
+
} else if (last.error) {
|
|
3709
|
+
lines.push(`Error: ${last.error}`);
|
|
3710
|
+
if (last.attemptedProviders && last.attemptedProviders.length > 0) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3711
|
+
const details = formatAttemptDetails(last.attempts);
|
|
3712
|
+
if (details) lines.push(`Attempt details: ${details}`);
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
return {
|
|
3716
|
+
shouldContinue: false,
|
|
3717
|
+
reply: { text: lines.join("\n") }
|
|
3718
|
+
};
|
|
3719
|
+
}
|
|
3720
|
+
return {
|
|
3721
|
+
shouldContinue: false,
|
|
3722
|
+
reply: ttsUsage()
|
|
3723
|
+
};
|
|
3724
|
+
};
|
|
3725
|
+
//#endregion
|
|
3726
|
+
//#region src/auto-reply/reply/commands-handlers.runtime.ts
|
|
3727
|
+
function loadCommandHandlers() {
|
|
3728
|
+
return [
|
|
3729
|
+
handlePluginCommand,
|
|
3730
|
+
handleBtwCommand,
|
|
3731
|
+
handleBashCommand,
|
|
3732
|
+
handleActivationCommand,
|
|
3733
|
+
handleSendPolicyCommand,
|
|
3734
|
+
handleFastCommand,
|
|
3735
|
+
handleUsageCommand,
|
|
3736
|
+
handleSessionCommand,
|
|
3737
|
+
handleRestartCommand,
|
|
3738
|
+
handleTtsCommands,
|
|
3739
|
+
handleHelpCommand,
|
|
3740
|
+
handleCommandsListCommand,
|
|
3741
|
+
handleToolsCommand,
|
|
3742
|
+
handleStatusCommand,
|
|
3743
|
+
handleTasksCommand,
|
|
3744
|
+
handleAllowlistCommand,
|
|
3745
|
+
handleApproveCommand,
|
|
3746
|
+
handleContextCommand,
|
|
3747
|
+
handleExportSessionCommand,
|
|
3748
|
+
handleWhoamiCommand,
|
|
3749
|
+
handleSubagentsCommand,
|
|
3750
|
+
handleAcpCommand,
|
|
3751
|
+
handleMcpCommand,
|
|
3752
|
+
handlePluginsCommand,
|
|
3753
|
+
handleConfigCommand,
|
|
3754
|
+
handleDebugCommand,
|
|
3755
|
+
handleModelsCommand,
|
|
3756
|
+
handleStopCommand,
|
|
3757
|
+
handleCompactCommand,
|
|
3758
|
+
handleAbortTrigger
|
|
3759
|
+
];
|
|
3760
|
+
}
|
|
3761
|
+
//#endregion
|
|
3762
|
+
export { loadCommandHandlers };
|