stableclaw 2026.4.6 ā 2026.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -290
- package/package.json +1 -73
- package/dist/.buildstamp +0 -1
- package/dist/abort-C9luPDzM.js +0 -192
- package/dist/abort-cutoff-B1ws4nOb.js +0 -56
- package/dist/abort-cutoff.runtime-DyRUNN6p.js +0 -20
- package/dist/abort-cutoff.runtime.js +0 -1
- package/dist/abort-primitives-CGyFwJ93.js +0 -92
- package/dist/abort-signal-CrrraMAi.js +0 -13
- package/dist/abort.runtime-oBiooAFx.js +0 -2
- package/dist/abort.runtime.js +0 -1
- package/dist/access-DIqrGWVo.js +0 -81
- package/dist/access-control-DfV6HWO9.js +0 -152
- package/dist/account-action-gate-eHi2MB4J.js +0 -12
- package/dist/account-core-DOelA7Wl.js +0 -26
- package/dist/account-helpers-CafpxP7V.js +0 -1
- package/dist/account-helpers-jJOgsae3.js +0 -102
- package/dist/account-id-DXal1kRJ.js +0 -1
- package/dist/account-inspect-CfagweUE.js +0 -158
- package/dist/account-inspect-DOt4IDX6.js +0 -92
- package/dist/account-inspect-pnXre-7b.js +0 -81
- package/dist/account-lookup-CLJxpfHr.js +0 -17
- package/dist/account-resolution-CbKUJkzG.js +0 -30
- package/dist/account-selection-B8a_DqXo.js +0 -222
- package/dist/account-snapshot-fields-mr-1u321.js +0 -130
- package/dist/account-summary-DA6ds0Hk.js +0 -36
- package/dist/accounts-CO-lK8jJ.js +0 -150
- package/dist/accounts-D419O6Gq.js +0 -2
- package/dist/accounts-DKMLcV4g.js +0 -132
- package/dist/accounts-DdiZwn14.js +0 -57
- package/dist/accounts-SWhOQhoA.js +0 -58
- package/dist/accounts-iR2U_Vs4.js +0 -41
- package/dist/accounts-jsSym1md.js +0 -102
- package/dist/accounts-p4Eir-wB.js +0 -107
- package/dist/accounts-uAWNlC7q.js +0 -94
- package/dist/accounts-x23pAGjm.js +0 -137
- package/dist/accounts.runtime-PJOhs60R.js +0 -2
- package/dist/accounts.runtime.js +0 -1
- package/dist/ack-reactions-fcKs7CQ_.js +0 -43
- package/dist/acp-cli-ByWTIhFx.js +0 -2207
- package/dist/acp-runtime-D7wrReOP.js +0 -8
- package/dist/acp-stateful-target-driver-DY2EfkQt.js +0 -60
- package/dist/action-runtime-BdRtmydq.js +0 -318
- package/dist/action-runtime-DvNB5A61.js +0 -72
- package/dist/action-runtime-api-BnVs42oX.js +0 -1028
- package/dist/actions-CUYHtUqe.js +0 -531
- package/dist/actions.runtime-BBrSlYkH.js +0 -18
- package/dist/actions.runtime-DB4aKmBO.js +0 -5
- package/dist/actions.runtime-bdKprwSE.js +0 -2
- package/dist/actions.runtime.js +0 -1
- package/dist/active-listener-SB9ihcaC.js +0 -46
- package/dist/agent-command-C_MGil8o.js +0 -1457
- package/dist/agent-list-MRXQwyo0.js +0 -52
- package/dist/agent-media-payload-DDTSvr-n.js +0 -17
- package/dist/agent-paths-D711oayD.js +0 -12
- package/dist/agent-runner-utils-DEYzwZHa.js +0 -182
- package/dist/agent-runner.runtime-v2uIsAVy.js +0 -2218
- package/dist/agent-runner.runtime.js +0 -1
- package/dist/agent-runtime-Cz19IsmJ.js +0 -142
- package/dist/agent-s4m0Xp6V.js +0 -2
- package/dist/agent-scope-rWWUivuC.js +0 -215
- package/dist/agent-tools-login-DU1gQC9-.js +0 -57
- package/dist/agents/auth-profiles.runtime.js +0 -7
- package/dist/agents/pi-model-discovery-runtime.js +0 -2
- package/dist/agents-B2W3IoEe.js +0 -888
- package/dist/agents-DmE3LRim.js +0 -5
- package/dist/agents.config-D6XoJFQ-.js +0 -3
- package/dist/agents.config-Ui_tQc3C.js +0 -121
- package/dist/allow-from-Bj0HDNYh.js +0 -20
- package/dist/allow-from-CJwSUt_K.js +0 -9
- package/dist/allow-from-xOap1t02.js +0 -62
- package/dist/allow-list-DeRUbyj4.js +0 -319
- package/dist/allowed-updates-aOgPxM0g.js +0 -31
- package/dist/allowlist-config-edit-Ch2EvAYo.js +0 -279
- package/dist/allowlist-match-Dm6AqFEs.js +0 -63
- package/dist/ansi-B_0KjIJj.js +0 -54
- package/dist/anthropic-vertex-Stff_3_3.js +0 -21
- package/dist/anthropic-vertex-stream-DgR8-m-G.js +0 -653
- package/dist/api-7Pf2fGBp.js +0 -11
- package/dist/api-B80kCRiV.js +0 -11
- package/dist/api-B8_Wwelx.js +0 -2
- package/dist/api-BLI24uxW.js +0 -2
- package/dist/api-BLSg8PM8.js +0 -2
- package/dist/api-BRy2h4ZA.js +0 -2
- package/dist/api-BU_YBaOK.js +0 -3
- package/dist/api-BXQjqvPC.js +0 -2
- package/dist/api-BY9iT-AK.js +0 -106
- package/dist/api-BipiQQoS.js +0 -2
- package/dist/api-Bk5mFOju.js +0 -10
- package/dist/api-BrsLZRXn.js +0 -3
- package/dist/api-C16j1Xno.js +0 -2
- package/dist/api-CGtiPyfv.js +0 -8358
- package/dist/api-CHIsf5Wl.js +0 -21
- package/dist/api-CP9q4gi6.js +0 -19
- package/dist/api-CWPDpJCM.js +0 -2
- package/dist/api-CaMdAP9T.js +0 -2
- package/dist/api-CftMlodx.js +0 -5
- package/dist/api-Cpj_QQAF.js +0 -5
- package/dist/api-D13mhDzE.js +0 -33
- package/dist/api-DGcbqpSh.js +0 -2
- package/dist/api-DIGFhGqm.js +0 -30
- package/dist/api-DNxTJAiA.js +0 -5
- package/dist/api-DasNTWRo.js +0 -2
- package/dist/api-Dn7n2sWC.js +0 -74
- package/dist/api-Drq06O1M2.js +0 -6
- package/dist/api-OOJHubHS.js +0 -77
- package/dist/api-XH46JouJ.js +0 -2
- package/dist/api-builder-uuKvRs_O.js +0 -66
- package/dist/api-e3cIcFaV.js +0 -1
- package/dist/api-fetch-CvBBI8q8.js +0 -35
- package/dist/api-key-rotation-BCssmYGp.js +0 -150
- package/dist/api-rPpH8518.js +0 -322
- package/dist/api-w-46PN0B.js +0 -2
- package/dist/apply-DfjUTAkv.js +0 -485
- package/dist/apply.runtime-B-srtEUl.js +0 -2
- package/dist/apply.runtime-DOG87kW8.js +0 -166
- package/dist/apply.runtime.js +0 -1
- package/dist/approval-native-CI9-iVJa.js +0 -79
- package/dist/approval-native-runtime-2AVlvrdL.js +0 -399
- package/dist/approval-renderers-BTKeDNRo.js +0 -87
- package/dist/approval-runtime-DIA8ohXa.js +0 -262
- package/dist/archive-BaCqqQP1.js +0 -537
- package/dist/arg-split-get0R_Yr.js +0 -38
- package/dist/artifacts-DXKlQp1z.js +0 -52
- package/dist/assistant-error-format-CFSPB8qt.js +0 -109
- package/dist/async-lock-QqhPYwhW.js +0 -19
- package/dist/attachment-normalize-CMMyswNa.js +0 -921
- package/dist/audio-BxqNDSFq.js +0 -53
- package/dist/audio-DZWA6M9B.js +0 -41
- package/dist/audit-86J-sIQq.js +0 -54
- package/dist/audit-D9O3O-41.js +0 -86
- package/dist/audit-DwAT-Kzg.js +0 -892
- package/dist/audit-channel.allow-from.runtime-DmuUvr2f.js +0 -5
- package/dist/audit-channel.allow-from.runtime.js +0 -1
- package/dist/audit-channel.collect.runtime-B76LAkrF.js +0 -528
- package/dist/audit-channel.collect.runtime.js +0 -1
- package/dist/audit-channel.discord.runtime-qM5u1Hnl.js +0 -5
- package/dist/audit-channel.discord.runtime.js +0 -1
- package/dist/audit-channel.telegram.runtime-DpwmRUPy.js +0 -8
- package/dist/audit-channel.telegram.runtime.js +0 -1
- package/dist/audit-channel.zalouser.runtime-CzlFZYsv.js +0 -5
- package/dist/audit-channel.zalouser.runtime.js +0 -1
- package/dist/audit-extra.async-BupKW2BB.js +0 -820
- package/dist/audit-fs-B3GdTjId.js +0 -375
- package/dist/audit-membership-runtime-n195y1jy.js +0 -55
- package/dist/audit.deep.runtime-2gZPpwj8.js +0 -2
- package/dist/audit.deep.runtime.js +0 -1
- package/dist/audit.nondeep.runtime-6MT8p_25.js +0 -831
- package/dist/audit.nondeep.runtime.js +0 -1
- package/dist/audit.runtime-jdG0-1Bq.js +0 -7
- package/dist/audit.runtime.js +0 -1
- package/dist/auth-CmL8nlqP.js +0 -371
- package/dist/auth-Zya_1BCc.js +0 -181
- package/dist/auth-choice-CSSk-2VN.js +0 -69
- package/dist/auth-choice-Uyll2O8p.js +0 -341
- package/dist/auth-choice-legacy-5XgU4yCZ.js +0 -44
- package/dist/auth-choice-options-DTRb6fq4.js +0 -98
- package/dist/auth-choice-prompt-BAQTSD2R.js +0 -36
- package/dist/auth-choice-prompt-D6qkTw8h.js +0 -2
- package/dist/auth-choice-x5Cm9EXp.js +0 -3
- package/dist/auth-choice.apply-helpers-CtKCiOT4.js +0 -2
- package/dist/auth-choice.plugin-providers.runtime-BVH7Kq_W.js +0 -11
- package/dist/auth-choice.plugin-providers.runtime.js +0 -1
- package/dist/auth-health-BBleirOY.js +0 -165
- package/dist/auth-mode-policy-BD7_M2AG.js +0 -18
- package/dist/auth-profiles-B0SpzBJv.js +0 -440
- package/dist/auth-rate-limit-OkMcM1wH.js +0 -119
- package/dist/auth-store-Bro-SY1-.js +0 -242
- package/dist/avatar-policy-pho6U35i.js +0 -67
- package/dist/backend-config-CNAjcjho.js +0 -311
- package/dist/backoff-nvVV-tHk.js +0 -18
- package/dist/backup-create-CkkM1HNg.js +0 -462
- package/dist/backup-health-BWSliymu.js +0 -59
- package/dist/banner-DPWatUan.js +0 -370
- package/dist/banner-lDKgB6uE.js +0 -2
- package/dist/base-session-key-CRSigEPk.js +0 -14
- package/dist/binaries-CWBYavgU.js +0 -2
- package/dist/binaries-sPf-9aLM.js +0 -11
- package/dist/binding-registry-BkSvI4jO.js +0 -520
- package/dist/binding-targets-CdIq3brX.js +0 -99
- package/dist/bindings-AuReyzvX.js +0 -21
- package/dist/bindings-CYhLRcr8.js +0 -69
- package/dist/block-reply-pipeline-GSCCinHx.js +0 -266
- package/dist/block-streaming-4outFa6R.js +0 -107
- package/dist/bluebubbles-CorTCHc9.js +0 -64
- package/dist/bluebubbles-D2WymlOg.js +0 -235
- package/dist/bluebubbles-policy-C3d8eqhQ.js +0 -13
- package/dist/bonjour-cache-cleanup-BZJ-GrdX.js +0 -126
- package/dist/boolean-BEhDlAk_.js +0 -29
- package/dist/boolean-param-B807dWHx.js +0 -13
- package/dist/bot-BM1bybV7.js +0 -4268
- package/dist/bot-message-context-CdedyAq_.js +0 -2
- package/dist/bot-message-context-DKGx6N8p.js +0 -1175
- package/dist/bot-message-context.runtime-ClW1x1V5.js +0 -7
- package/dist/bot-message-context.runtime.js +0 -1
- package/dist/bot-message-context.session.runtime-BWjdkRuf.js +0 -12
- package/dist/bot-message-context.session.runtime.js +0 -1
- package/dist/bot-native-commands.delivery.runtime-CgfbR-Nj.js +0 -3
- package/dist/bot-native-commands.delivery.runtime.js +0 -1
- package/dist/bot-native-commands.runtime-DCz7w0aK.js +0 -11
- package/dist/bot-native-commands.runtime.js +0 -1
- package/dist/boundary-file-read-DB4ibbUg.js +0 -192
- package/dist/brave-web-search-provider-B7m_Mprt.js +0 -441
- package/dist/brew-B9JEV5Jj.js +0 -44
- package/dist/browser-config-D_OlwMzh.js +0 -226
- package/dist/browser-open-C9FOO4U_.js +0 -94
- package/dist/browser-runtime-CnWZ_eLQ.js +0 -185
- package/dist/browser-support-Cdp2Gr_6.js +0 -34
- package/dist/btw-command-CPUGSdlD.js +0 -16
- package/dist/build-info.json +0 -5
- package/dist/bundle-lsp-CCIAK1od.js +0 -93
- package/dist/bundled/boot-md/HOOK.md +0 -20
- package/dist/bundled/boot-md/handler.js +0 -180
- package/dist/bundled/bootstrap-extra-files/HOOK.md +0 -53
- package/dist/bundled/bootstrap-extra-files/handler.js +0 -42
- package/dist/bundled/command-logger/HOOK.md +0 -122
- package/dist/bundled/command-logger/handler.js +0 -56
- package/dist/bundled/session-memory/HOOK.md +0 -108
- package/dist/bundled/session-memory/handler.js +0 -196
- package/dist/bundled/workflow-summary/HOOK.md +0 -123
- package/dist/bundled/workflow-summary/handler.js +0 -115
- package/dist/bundled-capability-metadata-BpPgIy_5.js +0 -40
- package/dist/bundled-compat-BLlVmkDi.js +0 -64
- package/dist/bundled-sources-BQTCt2mJ.js +0 -53
- package/dist/button-types-B3_mzf8P.js +0 -54
- package/dist/cache-controls-DBdT4I-H.js +0 -40
- package/dist/call-dy-GwrXS.js +0 -649
- package/dist/call-ti-nPnzT.js +0 -2
- package/dist/canvas-host/a2ui/.bundle.hash +0 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +0 -14896
- package/dist/canvas-host/a2ui/index.html +0 -307
- package/dist/capability-provider-runtime-CFUC5NbJ.js +0 -40
- package/dist/catalog-5PPtilI5.js +0 -274
- package/dist/channel-2EW4xzvV.js +0 -788
- package/dist/channel-BiRtGLF8.js +0 -1135
- package/dist/channel-C3AVw0Nl.js +0 -883
- package/dist/channel-CPe2XmyD.js +0 -1217
- package/dist/channel-CVFWRvjf.js +0 -337
- package/dist/channel-Cs0onQ6d.js +0 -4976
- package/dist/channel-D18v9r53.js +0 -1661
- package/dist/channel-D2n2s8Le.js +0 -208
- package/dist/channel-DWKApPW2.js +0 -454
- package/dist/channel-Depm5C-f.js +0 -800
- package/dist/channel-DwTcZxFU.js +0 -1129
- package/dist/channel-LT5vI3EK.js +0 -361
- package/dist/channel-XgThIGmf.js +0 -698
- package/dist/channel-account-context-CWd3uN_m.js +0 -104
- package/dist/channel-actions-DSvaYD1T.js +0 -39
- package/dist/channel-bQKtZIt6.js +0 -599
- package/dist/channel-catalog.json +0 -3
- package/dist/channel-config-D0eO5f5m.js +0 -115
- package/dist/channel-config-helpers-CLFL8FLU.js +0 -482
- package/dist/channel-config-primitives-DwsP66Ak.js +0 -3
- package/dist/channel-config-schema-DsguzRfd.js +0 -6
- package/dist/channel-config-writes-DQZOOZZ8.js +0 -1
- package/dist/channel-configured-B6WgvouH.js +0 -108
- package/dist/channel-feedback-DiLm9hqS.js +0 -257
- package/dist/channel-inbound-CXD3aSAK.js +0 -30
- package/dist/channel-issues-C-49e607.js +0 -13
- package/dist/channel-lifecycle-BnjeZxB6.js +0 -286
- package/dist/channel-lifecycle.core-Cn3zeU0h.js +0 -69
- package/dist/channel-options-DXJ7b7Ye.js +0 -39
- package/dist/channel-pairing-Byr3MFbN.js +0 -68
- package/dist/channel-plugin-common-D2EFcTg8.js +0 -4
- package/dist/channel-plugin-ids-DiOSWlnO.js +0 -56
- package/dist/channel-plugin-resolution-SMHmHx5v.js +0 -144
- package/dist/channel-policy-B-XKjrjK.js +0 -32
- package/dist/channel-reply-pipeline-BtBcBCNu.js +0 -16
- package/dist/channel-resolution-Du3EtWh1.js +0 -60
- package/dist/channel-runtime-F8_51GPp.js +0 -9
- package/dist/channel-selection-Bz3pl14y.js +0 -125
- package/dist/channel-send-result-CyfDCXJG.js +0 -40
- package/dist/channel-setup-yWpuHwhm.js +0 -51
- package/dist/channel-shared-gHcJ8n-f.js +0 -58
- package/dist/channel-status-CyoeLEnj.js +0 -2
- package/dist/channel-summary-5zHt-z1E.js +0 -139
- package/dist/channel-summary-B_fbXZ3l.js +0 -2
- package/dist/channel-target-DHO43h-I.js +0 -157
- package/dist/channel-targets-C8ZPfJmV.js +0 -18
- package/dist/channel-y-bXwYi3.js +0 -783
- package/dist/channel.runtime-B2SEUCf0.js +0 -14
- package/dist/channel.runtime-BF5qdBeA.js +0 -5
- package/dist/channel.runtime-BPaq6EO_.js +0 -108
- package/dist/channel.runtime-BV8FGxyb.js +0 -373
- package/dist/channel.runtime-CGnamSTC.js +0 -125
- package/dist/channel.runtime-CRNf20Ct.js +0 -80
- package/dist/channel.runtime-CRSWVexY.js +0 -335
- package/dist/channel.runtime-Cg6DmoTp.js +0 -783
- package/dist/channel.runtime-CpHTHeFR.js +0 -309
- package/dist/channel.runtime-ZdhCn8XI.js +0 -3315
- package/dist/channel.runtime-cXufT2kW.js +0 -61
- package/dist/channel.runtime.js +0 -1
- package/dist/channel.setup-Bq1vgxXZ.js +0 -279
- package/dist/channels-BZC2kp_G.js +0 -409
- package/dist/channels-CMeYB3bY.js +0 -1134
- package/dist/channels-cli-BIzqRmuu.js +0 -246
- package/dist/channels-status-issues-DqTdy1lq.js +0 -17
- package/dist/chat-envelope-DlGbh8k2.js +0 -158
- package/dist/chat-meta-wVbKo1sw.js +0 -700
- package/dist/chat-target-prefixes-DCF8a_Lp.js +0 -156
- package/dist/chat-type-DXjGtE-S.js +0 -10
- package/dist/chunk-CW-a7Cfh.js +0 -334
- package/dist/chunk-CrysgU_F.js +0 -36
- package/dist/chutes-oauth-Bh3BTMMG.js +0 -127
- package/dist/cjk-chars-Dl_Ko7yI.js +0 -50
- package/dist/clack-prompter-C5PtKpUH.js +0 -112
- package/dist/clawbot-cli-CgHyabtp.js +0 -9
- package/dist/clawhub-CDs2LE11.js +0 -263
- package/dist/clawhub-CO6YnoQZ.js +0 -163
- package/dist/cli/daemon-cli.js +0 -9
- package/dist/cli-CoOwN-V4.js +0 -164
- package/dist/cli-CpOL_jWZ.js +0 -152
- package/dist/cli-DCp06hI2.js +0 -2
- package/dist/cli-DVSDSUQm.js +0 -695
- package/dist/cli-backend-B20k67rv.js +0 -44
- package/dist/cli-backend-CcuyEMrq.js +0 -1
- package/dist/cli-backend-DMTxL8mq.js +0 -40
- package/dist/cli-backend-M4CTb3mq.js +0 -49
- package/dist/cli-migration-BwqQvUer.js +0 -100
- package/dist/cli-name-C3PA6Rhs.js +0 -21
- package/dist/cli-runner-8SNo1pKS.js +0 -1014
- package/dist/cli-runtime-ChUqI2f-.js +0 -3
- package/dist/cli-shared-01J1LZRE.js +0 -72
- package/dist/cli-startup-metadata.json +0 -14
- package/dist/cli-utils-eYXt_xAg.js +0 -40
- package/dist/cli-watchdog-defaults-Dff-MFUz.js +0 -14
- package/dist/cli.runtime-WWGaX6X6.js +0 -547
- package/dist/cli.runtime.js +0 -1
- package/dist/client-BFxjGELJ.js +0 -5
- package/dist/client-C8_DsF-r.js +0 -7
- package/dist/client-bootstrap-BiVps8T6.js +0 -2
- package/dist/client-bootstrap-CFGCltAu.js +0 -121
- package/dist/client-lEilgam1.js +0 -87
- package/dist/cmd-argv-BbyQhzAC.js +0 -68
- package/dist/code-execution-CPcuE0sX.js +0 -142
- package/dist/codex-native-web-search-CyrsDBZ2.js +0 -155
- package/dist/codex-native-web-search-PFJu8fcM.js +0 -2
- package/dist/collection-runtime-DJjFReXJ.js +0 -1
- package/dist/command-auth-BAkZv3cP.js +0 -356
- package/dist/command-auth-native-Bsp5Doyd.js +0 -3
- package/dist/command-auth-tqFmaIaJ.js +0 -64
- package/dist/command-detection-BV7Ipg_0.js +0 -49
- package/dist/command-detection-DyqWl5Nq.js +0 -2
- package/dist/command-format-CX1xXtgB.js +0 -22
- package/dist/command-format-DwYoemR9.js +0 -2
- package/dist/command-gating-NyDk7t84.js +0 -40
- package/dist/command-options-BUoAEXAi.js +0 -25
- package/dist/command-poll-backoff-B7RiSvcV.js +0 -56
- package/dist/command-poll-backoff.runtime-DX9gobB0.js +0 -7
- package/dist/command-poll-backoff.runtime.js +0 -1
- package/dist/command-queue-CxEmvSGT.js +0 -253
- package/dist/command-registry-CaJXKNoO.js +0 -3
- package/dist/command-registry-Ct0qor9d.js +0 -199
- package/dist/command-secret-gateway-43O-1Hnf.js +0 -2
- package/dist/command-secret-gateway-C39SFGHd.js +0 -442
- package/dist/command-secret-targets-Bns-l1xV.js +0 -2
- package/dist/command-secret-targets-CTrFghcj.js +0 -87
- package/dist/command-surface-CfP1vask.js +0 -2
- package/dist/commands/status.summary.runtime.js +0 -146
- package/dist/commands-BxWe27p0.js +0 -42
- package/dist/commands-CiyPyNRY.js +0 -194
- package/dist/commands-acp-BeCm2Wnq.js +0 -990
- package/dist/commands-context-DbfMrVv4.js +0 -33
- package/dist/commands-core-CEmQydIV.js +0 -241
- package/dist/commands-core.runtime-BYooAQbc.js +0 -2
- package/dist/commands-core.runtime.js +0 -1
- package/dist/commands-handlers.runtime-CEAP4Yv2.js +0 -3707
- package/dist/commands-handlers.runtime.js +0 -1
- package/dist/commands-info-COwAtIWb.js +0 -651
- package/dist/commands-models-B4EJh5Fy.js +0 -395
- package/dist/commands-o21Y9Xck.js +0 -4
- package/dist/commands-registry-DgMc5_jk.js +0 -295
- package/dist/commands-registry.data-5O2FOeZl.js +0 -935
- package/dist/commands-registry.runtime-CT_YXpwM.js +0 -2
- package/dist/commands-registry.runtime.js +0 -1
- package/dist/commands-status.runtime-D4F4iVUh.js +0 -2
- package/dist/commands-status.runtime.js +0 -1
- package/dist/commands.runtime-_ALsMFcS.js +0 -4
- package/dist/commands.runtime.js +0 -1
- package/dist/common-Dbmo0I1E.js +0 -206
- package/dist/compact.runtime-CBfyBJbR.js +0 -7
- package/dist/compact.runtime.js +0 -1
- package/dist/completion-cli-COhEd9CF.js +0 -2
- package/dist/completion-cli-DHe4Rit5.js +0 -466
- package/dist/components-CamLdbbq.js +0 -797
- package/dist/components-DPbtLC3x.js +0 -2
- package/dist/config-CKJA2kAO.js +0 -53
- package/dist/config-D7-9dK3i.js +0 -138
- package/dist/config-DJ29sg5U.js +0 -475
- package/dist/config-DJNI2tTK.js +0 -136
- package/dist/config-Dr2GRT3y.js +0 -135
- package/dist/config-DsqKYjeo.js +0 -421
- package/dist/config-Q9kc32gz.js +0 -41
- package/dist/config-RUefx-_1.js +0 -8
- package/dist/config-cli-BqlYHmPA.js +0 -945
- package/dist/config-error-handler-BKRR0_j_.js +0 -197
- package/dist/config-error-handler-CT1igiX6.js +0 -2
- package/dist/config-eval-hTWq4IVy.js +0 -100
- package/dist/config-guard-Bk3_wSTH.js +0 -113
- package/dist/config-helpers-DLVbtn1B.js +0 -117
- package/dist/config-paths-BKYh__Ga.js +0 -8
- package/dist/config-paths-DP5yXXo2.js +0 -102
- package/dist/config-presence-omlqvhAQ.js +0 -79
- package/dist/config-regex-CvZFnWkO.js +0 -39
- package/dist/config-runtime-ngoccXmP.js +0 -13
- package/dist/config-schema-B3sQY5B_.js +0 -133
- package/dist/config-schema-B_2MhEQY.js +0 -71
- package/dist/config-schema-BpIXBNbc.js +0 -202
- package/dist/config-schema-BtfQOmdV.js +0 -115
- package/dist/config-schema-Bw-Xbo_T.js +0 -85
- package/dist/config-schema-Cqj-Mugi.js +0 -105
- package/dist/config-schema-DQSj_ZL_.js +0 -29
- package/dist/config-schema-Pe1Vn9kb.js +0 -17
- package/dist/config-schema-f7nntJMh.js +0 -25
- package/dist/config-schema-lBqODOnr.js +0 -25
- package/dist/config-schema-mfJ91WLf.js +0 -65
- package/dist/config-secret-input.runtime-B_HyRtgE.js +0 -3
- package/dist/config-secret-input.runtime.js +0 -1
- package/dist/config-state-DfIk9ME6.js +0 -289
- package/dist/config-status-Bnobp1-p.js +0 -2
- package/dist/config-status-Db93sFQB.js +0 -109
- package/dist/config-update-B_S0YQ_Y.js +0 -3
- package/dist/config-update-CK4EDDeD.js +0 -127
- package/dist/config-validation-Bh_sg7RW.js +0 -276
- package/dist/config-value-CMTdBw5q.js +0 -25
- package/dist/configure-CGDY1YR7.js +0 -1140
- package/dist/configure-V8jejRHr.js +0 -2
- package/dist/configured-provider-fallback-DWYDg0L7.js +0 -15
- package/dist/connection-auth-CKM60o55.js +0 -30
- package/dist/connection-details-DyVOoGG6.js +0 -56
- package/dist/constants-Bq55qi82.js +0 -71
- package/dist/constants-CimYBSye.js +0 -4
- package/dist/content-blocks-DuKJNUtm.js +0 -785
- package/dist/context-D-9a98Zk.js +0 -227
- package/dist/context-visibility-DTMZdcAH.js +0 -14
- package/dist/context-visibility-vOvLMUrZ.js +0 -35
- package/dist/context-window-guard-WE0ENAeQ.js +0 -46
- package/dist/control-ui-assets-DVYAF-2p.js +0 -240
- package/dist/control-ui-shared-BKXkFsA7.js +0 -29
- package/dist/conversation-binding-C2nuZ3Eg.js +0 -520
- package/dist/conversation-binding-input-CBwdWDC4.js +0 -250
- package/dist/conversation-bindings-Cq4z4vhr.js +0 -210
- package/dist/conversation-id-4JeHag0a.js +0 -168
- package/dist/conversation-id-CXuzm-Ub.js +0 -116
- package/dist/conversation-id-DCTwJCZF.js +0 -43
- package/dist/conversation-label-C2xTELop.js +0 -32
- package/dist/conversation-runtime-bArk0IjJ.js +0 -85
- package/dist/core-DaMVvavf.js +0 -195
- package/dist/core-api-D0U2iGRK.js +0 -670
- package/dist/core-command-descriptors-DxRm2H1p.js +0 -91
- package/dist/create-client-BOKOxyiu.js +0 -58
- package/dist/create-client-Bzn467Jo.js +0 -2
- package/dist/credentials-BGPs1gIX.js +0 -242
- package/dist/credentials-DUoYFiLk.js +0 -22
- package/dist/credentials-read-CDYtvkBt.js +0 -74
- package/dist/credentials-read-KB395CbD.js +0 -2
- package/dist/credentials-write.runtime-Bx7mKj4E.js +0 -9
- package/dist/credentials-write.runtime.js +0 -1
- package/dist/creds-files-CTtTs6zG.js +0 -19
- package/dist/cron-cli-Di3TakVa.js +0 -644
- package/dist/crypto-node.runtime-DI0fQ6wI.js +0 -5
- package/dist/crypto-node.runtime.js +0 -1
- package/dist/crypto-runtime-Bc-jKPlv.js +0 -1036
- package/dist/current-time--aIDbABZ.js +0 -20
- package/dist/daemon-cli-Cnry1ft1.js +0 -370
- package/dist/daemon-install-de_bWPuS.js +0 -63
- package/dist/daemon-install-plan.shared-u00bwv47.js +0 -222
- package/dist/daemon-runtime-DPejcJWG.js +0 -12
- package/dist/dangerous-name-matching-DnCDaXzP.js +0 -48
- package/dist/dangerous-name-runtime-Dinw00TZ.js +0 -1
- package/dist/dangerous-tools-C3RlQe7u.js +0 -38
- package/dist/date-time-DRQ0-oaw.js +0 -118
- package/dist/ddg-search-provider-B0zLjcDN.js +0 -182
- package/dist/dedupe-DZbQYOSD.js +0 -59
- package/dist/default-account-warnings-BCrmijcz.js +0 -15
- package/dist/default-models-Br0v8QOH.js +0 -35
- package/dist/defaults-DAt--D9n.js +0 -6
- package/dist/defaults-D_Y_lvUP.js +0 -7
- package/dist/defaults-MkMfnGzi.js +0 -7
- package/dist/delegate-CLP7zDS_.js +0 -43
- package/dist/deliver-CIUEKe4q.js +0 -954
- package/dist/deliver-LN-Yg8wS.js +0 -3
- package/dist/deliver-reply-DL-CSF43.js +0 -238
- package/dist/deliver-runtime-CoqXhxlS.js +0 -2
- package/dist/delivery-CL_3vFSl.js +0 -834
- package/dist/delivery-context-CoAL-jTI.js +0 -106
- package/dist/delivery-info-DTAUApso.js +0 -40
- package/dist/delivery-queue-DBW69jH4.js +0 -2
- package/dist/delivery-queue-DMubgaLa.js +0 -289
- package/dist/deps-34N0Nmbl.js +0 -67
- package/dist/deps-BVogrCia.js +0 -2
- package/dist/deps-DZJpA4XG.js +0 -153
- package/dist/detect-Zrcrs8SP.js +0 -12
- package/dist/detect-binary-CEX186X6.js +0 -30
- package/dist/device-auth-D_0GUMYY.js +0 -19
- package/dist/device-bootstrap-Bnn4K3fQ.js +0 -3
- package/dist/device-bootstrap-bwpHYQhY.js +0 -176
- package/dist/device-health-B3q7Cmqn.js +0 -2
- package/dist/device-health-DhmPD0gq.js +0 -16
- package/dist/device-identity-Cak311si.js +0 -2
- package/dist/device-identity-Doxo0HJx.js +0 -140
- package/dist/device-metadata-normalization-B5_zplC_.js +0 -21
- package/dist/device-pairing-BCpR-Vtb.js +0 -520
- package/dist/devices-cli-DYPkfzsG.js +0 -328
- package/dist/diagnostic-DfKz60Xk.js +0 -311
- package/dist/diagnostic-events-CUSmY-rn.js +0 -48
- package/dist/diagnostic-flags-DLDDycUv.js +0 -64
- package/dist/diagnostic-runtime-ZQC4AswI.js +0 -1
- package/dist/diagnostics-Cxl1bFGj.js +0 -33
- package/dist/diagnostics-GjF7wpY9.js +0 -2
- package/dist/diagnostics-otel-C2RQUlQT.js +0 -3
- package/dist/diffs-DsHt689X.js +0 -2
- package/dist/direct-dm-ByuWacLn.js +0 -139
- package/dist/direct-management-DEtuCcDL.js +0 -2
- package/dist/direct-management-DMp7MOnt.js +0 -300
- package/dist/direct-room-ARYWsCbX.js +0 -2
- package/dist/direct-room-DYlSJOU_.js +0 -67
- package/dist/directive-handling.defaults-BMh2DXTA.js +0 -19
- package/dist/directive-handling.fast-lane-CBX4jbax.js +0 -2
- package/dist/directive-handling.fast-lane-DRvycpgg.js +0 -64
- package/dist/directive-handling.impl-BKJf5Ltu.js +0 -672
- package/dist/directive-handling.impl-BkdGnm-T.js +0 -2
- package/dist/directive-handling.levels-BHOBnnn8.js +0 -2
- package/dist/directive-handling.levels-CecoBNlK.js +0 -12
- package/dist/directive-handling.parse-BuTiWmrT.js +0 -375
- package/dist/directive-handling.persist-D9RYevoA.js +0 -133
- package/dist/directive-handling.persist.runtime-Cb_unTVH.js +0 -2
- package/dist/directive-handling.persist.runtime.js +0 -1
- package/dist/directive-handling.shared-_Zvt3-ej.js +0 -158
- package/dist/directive-tags-Cm0H6Dn_.js +0 -109
- package/dist/directives-f-UxcP8D.js +0 -209
- package/dist/directory-cache-CM_EUchr.js +0 -62
- package/dist/directory-cli-D6N59tzr.js +0 -238
- package/dist/directory-config-helpers-BCrssKbI.js +0 -141
- package/dist/directory-runtime-CAabZ_XW.js +0 -20
- package/dist/directory.static-TKo2MeNR.js +0 -45
- package/dist/discord-BOpl5w4U.js +0 -5
- package/dist/discord-account-wyFuLDq_.js +0 -11
- package/dist/discord-core-BpzKxDZ7.js +0 -5
- package/dist/discord-lOPvIxp4.js +0 -11
- package/dist/discord-runtime-surface-Dm5WUtCV.js +0 -67
- package/dist/discord-session-key-DaPto1yr.js +0 -11
- package/dist/discord-surface-Cg_Mu9MI.js +0 -30
- package/dist/discord-thread-bindings-zIOp1Tj4.js +0 -29
- package/dist/discord-timeouts-Di5n5LAU.js +0 -12
- package/dist/discovery-DLbFJLD_.js +0 -171
- package/dist/dispatch-C4gGGYZt.js +0 -858
- package/dist/dispatch-acp.runtime-DUHj6bP-.js +0 -884
- package/dist/dispatch-acp.runtime.js +0 -1
- package/dist/dist-7JNqoGV7.js +0 -3
- package/dist/dist-BqJPEiV8.js +0 -14245
- package/dist/dist-DdE56Pmi.js +0 -503
- package/dist/dist-shQCTuJB.js +0 -1239
- package/dist/dm-policy-shared-C99GNVxp.js +0 -188
- package/dist/dns-cli-vQBAzTmg.js +0 -192
- package/dist/docker-BN7sQKCb.js +0 -789
- package/dist/docs-cli-Br6cfKoS.js +0 -156
- package/dist/doctor-completion-Cf0GcTXR.js +0 -90
- package/dist/doctor-config-preflight-C2cKYiKe.js +0 -2
- package/dist/doctor-config-preflight-DNbO-_N8.js +0 -148
- package/dist/doctor-state-migrations-BXkbeSFy.js +0 -2
- package/dist/doctor-state-migrations-G3shZ-W_.js +0 -3
- package/dist/dotenv-CelghjA4.js +0 -11
- package/dist/dotenv-Csg1Xj8n.js +0 -113
- package/dist/embedding-provider-Aey9VsDb.js +0 -129
- package/dist/enable-BgSxsKp_.js +0 -57
- package/dist/encryption-guidance-62xAQFP4.js +0 -33
- package/dist/entry-status-3ymZYX2l.js +0 -172
- package/dist/entry.js +0 -209
- package/dist/env-CK3eZNIX.js +0 -40
- package/dist/env-overrides-CcDOWo0Y.js +0 -346
- package/dist/env-overrides.runtime-CKb7-Q72.js +0 -7
- package/dist/env-overrides.runtime.js +0 -1
- package/dist/env-substitution-UhJwb0ys.js +0 -136
- package/dist/envelope-CrC9AdBL.js +0 -137
- package/dist/error-runtime-D-gKufd_.js +0 -2
- package/dist/error-text-BC9WfvfX.js +0 -24
- package/dist/errors-Bs2h5H8p.js +0 -71
- package/dist/errors-CjFsF-QY.js +0 -9
- package/dist/exa-web-search-provider-DUUlmDcV.js +0 -355
- package/dist/exec-BO6vYjRf.js +0 -368
- package/dist/exec-CD7C9g-b.js +0 -2
- package/dist/exec-approval-reply-CFOEcmIv.js +0 -189
- package/dist/exec-approval-session-target-BbsAlD1Q.js +0 -159
- package/dist/exec-approvals-3UDrE7Q9.js +0 -1565
- package/dist/exec-approvals-CW5axvaY.js +0 -121
- package/dist/exec-approvals-cli-BPYvtJv-.js +0 -483
- package/dist/exec-approvals-effective-DbLJfkpe.js +0 -140
- package/dist/exec-safe-bin-runtime-policy-218hHVyc.js +0 -90
- package/dist/exec-safety-XzKkUSvE.js +0 -24
- package/dist/export-html/template.css +0 -1060
- package/dist/export-html/template.html +0 -88
- package/dist/export-html/template.js +0 -1875
- package/dist/export-html/vendor/highlight.min.js +0 -1213
- package/dist/export-html/vendor/marked.min.js +0 -6
- package/dist/extension-shared-V_4IXpRU.js +0 -74
- package/dist/extensionAPI.js +0 -17
- package/dist/extensions/acpx/index.js +0 -1855
- package/dist/extensions/acpx/mcp-proxy.mjs +0 -151
- package/dist/extensions/acpx/openclaw.plugin.json +0 -132
- package/dist/extensions/acpx/package.json +0 -14
- package/dist/extensions/acpx/runtime-api.js +0 -5
- package/dist/extensions/acpx/skills/acp-router/SKILL.md +0 -245
- package/dist/extensions/aicq-chat/index.js +0 -284
- package/dist/extensions/aicq-chat/openclaw.plugin.json +0 -30
- package/dist/extensions/amazon-bedrock/api.js +0 -3
- package/dist/extensions/amazon-bedrock/discovery.js +0 -2
- package/dist/extensions/amazon-bedrock/index.js +0 -65
- package/dist/extensions/amazon-bedrock/openclaw.plugin.json +0 -44
- package/dist/extensions/amazon-bedrock/package.json +0 -23
- package/dist/extensions/anthropic/api.js +0 -3
- package/dist/extensions/anthropic/cli-backend.js +0 -2
- package/dist/extensions/anthropic/cli-migration.js +0 -2
- package/dist/extensions/anthropic/cli-shared.js +0 -2
- package/dist/extensions/anthropic/index.js +0 -357
- package/dist/extensions/anthropic/media-understanding-provider.js +0 -2
- package/dist/extensions/anthropic/openclaw.plugin.json +0 -64
- package/dist/extensions/anthropic/package.json +0 -12
- package/dist/extensions/anthropic/stream-wrappers.js +0 -2
- package/dist/extensions/anthropic/test-api.js +0 -2
- package/dist/extensions/anthropic-vertex/api.js +0 -4
- package/dist/extensions/anthropic-vertex/index.js +0 -36
- package/dist/extensions/anthropic-vertex/openclaw.plugin.json +0 -12
- package/dist/extensions/anthropic-vertex/package.json +0 -12
- package/dist/extensions/anthropic-vertex/provider-catalog.js +0 -2
- package/dist/extensions/anthropic-vertex/region.js +0 -2
- package/dist/extensions/bluebubbles/api.js +0 -5
- package/dist/extensions/bluebubbles/channel-config-api.js +0 -2
- package/dist/extensions/bluebubbles/index.js +0 -13
- package/dist/extensions/bluebubbles/openclaw.plugin.json +0 -11
- package/dist/extensions/bluebubbles/package.json +0 -48
- package/dist/extensions/bluebubbles/runtime-api.js +0 -2
- package/dist/extensions/bluebubbles/setup-entry.js +0 -26
- package/dist/extensions/brave/index.js +0 -13
- package/dist/extensions/brave/openclaw.plugin.json +0 -50
- package/dist/extensions/brave/package.json +0 -12
- package/dist/extensions/brave/test-api.js +0 -2
- package/dist/extensions/brave/web-search-provider.js +0 -2
- package/dist/extensions/browser/browser-runtime-api.js +0 -4
- package/dist/extensions/browser/index.js +0 -20
- package/dist/extensions/browser/openclaw.plugin.json +0 -9
- package/dist/extensions/browser/package.json +0 -12
- package/dist/extensions/browser/runtime-api.js +0 -6
- package/dist/extensions/browser/test-support.js +0 -50
- package/dist/extensions/byteplus/api.js +0 -3
- package/dist/extensions/byteplus/index.js +0 -63
- package/dist/extensions/byteplus/models.js +0 -2
- package/dist/extensions/byteplus/openclaw.plugin.json +0 -33
- package/dist/extensions/byteplus/package.json +0 -12
- package/dist/extensions/byteplus/provider-catalog.js +0 -2
- package/dist/extensions/chutes/api.js +0 -3
- package/dist/extensions/chutes/index.js +0 -143
- package/dist/extensions/chutes/models.js +0 -2
- package/dist/extensions/chutes/onboard.js +0 -3
- package/dist/extensions/chutes/openclaw.plugin.json +0 -44
- package/dist/extensions/chutes/package.json +0 -12
- package/dist/extensions/chutes/provider-catalog.js +0 -2
- package/dist/extensions/cloudflare-ai-gateway/api.js +0 -3
- package/dist/extensions/cloudflare-ai-gateway/index.js +0 -188
- package/dist/extensions/cloudflare-ai-gateway/models.js +0 -2
- package/dist/extensions/cloudflare-ai-gateway/onboard.js +0 -2
- package/dist/extensions/cloudflare-ai-gateway/openclaw.plugin.json +0 -33
- package/dist/extensions/cloudflare-ai-gateway/package.json +0 -12
- package/dist/extensions/copilot-proxy/index.js +0 -125
- package/dist/extensions/copilot-proxy/openclaw.plugin.json +0 -27
- package/dist/extensions/copilot-proxy/package.json +0 -12
- package/dist/extensions/copilot-proxy/runtime-api.js +0 -3
- package/dist/extensions/deepgram/audio.js +0 -2
- package/dist/extensions/deepgram/index.js +0 -13
- package/dist/extensions/deepgram/media-understanding-provider.js +0 -2
- package/dist/extensions/deepgram/openclaw.plugin.json +0 -13
- package/dist/extensions/deepgram/package.json +0 -12
- package/dist/extensions/deepseek/api.js +0 -3
- package/dist/extensions/deepseek/index.js +0 -33
- package/dist/extensions/deepseek/models.js +0 -2
- package/dist/extensions/deepseek/onboard.js +0 -2
- package/dist/extensions/deepseek/openclaw.plugin.json +0 -32
- package/dist/extensions/deepseek/package.json +0 -12
- package/dist/extensions/deepseek/provider-catalog.js +0 -2
- package/dist/extensions/device-pair/api.js +0 -10
- package/dist/extensions/device-pair/index.js +0 -483
- package/dist/extensions/device-pair/notify.js +0 -2
- package/dist/extensions/device-pair/openclaw.plugin.json +0 -21
- package/dist/extensions/device-pair/qr-image.js +0 -3
- package/dist/extensions/diagnostics-otel/api.js +0 -6
- package/dist/extensions/diagnostics-otel/index.js +0 -485
- package/dist/extensions/diagnostics-otel/openclaw.plugin.json +0 -8
- package/dist/extensions/diagnostics-otel/package.json +0 -27
- package/dist/extensions/diffs/api.js +0 -4
- package/dist/extensions/diffs/assets/viewer-runtime.js +0 -1888
- package/dist/extensions/diffs/index.js +0 -2058
- package/dist/extensions/diffs/openclaw.plugin.json +0 -226
- package/dist/extensions/diffs/package.json +0 -24
- package/dist/extensions/diffs/runtime-api.js +0 -3
- package/dist/extensions/diffs/skills/diffs/SKILL.md +0 -23
- package/dist/extensions/discord/action-runtime-api.js +0 -2
- package/dist/extensions/discord/api.js +0 -14
- package/dist/extensions/discord/channel-config-api.js +0 -2
- package/dist/extensions/discord/index.js +0 -612
- package/dist/extensions/discord/openclaw.plugin.json +0 -11
- package/dist/extensions/discord/package.json +0 -52
- package/dist/extensions/discord/runtime-api.js +0 -230
- package/dist/extensions/discord/session-key-api.js +0 -2
- package/dist/extensions/discord/setup-entry.js +0 -10
- package/dist/extensions/discord/test-api.js +0 -45
- package/dist/extensions/discord/timeouts.js +0 -2
- package/dist/extensions/duckduckgo/index.js +0 -13
- package/dist/extensions/duckduckgo/openclaw.plugin.json +0 -41
- package/dist/extensions/duckduckgo/package.json +0 -12
- package/dist/extensions/duckduckgo/web-search-provider.js +0 -2
- package/dist/extensions/elevenlabs/index.js +0 -13
- package/dist/extensions/elevenlabs/openclaw.plugin.json +0 -13
- package/dist/extensions/elevenlabs/package.json +0 -12
- package/dist/extensions/elevenlabs/speech-provider.js +0 -2
- package/dist/extensions/elevenlabs/test-api.js +0 -2
- package/dist/extensions/elevenlabs/tts.js +0 -2
- package/dist/extensions/exa/index.js +0 -13
- package/dist/extensions/exa/openclaw.plugin.json +0 -39
- package/dist/extensions/exa/package.json +0 -12
- package/dist/extensions/exa/web-search-provider.js +0 -2
- package/dist/extensions/fal/image-generation-provider.js +0 -2
- package/dist/extensions/fal/index.js +0 -45
- package/dist/extensions/fal/onboard.js +0 -2
- package/dist/extensions/fal/openclaw.plugin.json +0 -40
- package/dist/extensions/fal/package.json +0 -12
- package/dist/extensions/feishu/api.js +0 -7
- package/dist/extensions/feishu/index.js +0 -2531
- package/dist/extensions/feishu/openclaw.plugin.json +0 -14
- package/dist/extensions/feishu/package.json +0 -52
- package/dist/extensions/feishu/runtime-api.js +0 -34
- package/dist/extensions/feishu/session-key-api.js +0 -2
- package/dist/extensions/feishu/setup-api.js +0 -2
- package/dist/extensions/feishu/setup-entry.js +0 -6
- package/dist/extensions/feishu/skills/feishu-doc/SKILL.md +0 -211
- package/dist/extensions/feishu/skills/feishu-doc/references/block-types.md +0 -103
- package/dist/extensions/feishu/skills/feishu-drive/SKILL.md +0 -97
- package/dist/extensions/feishu/skills/feishu-perm/SKILL.md +0 -119
- package/dist/extensions/feishu/skills/feishu-wiki/SKILL.md +0 -111
- package/dist/extensions/firecrawl/api.js +0 -33
- package/dist/extensions/firecrawl/index.js +0 -184
- package/dist/extensions/firecrawl/openclaw.plugin.json +0 -87
- package/dist/extensions/firecrawl/package.json +0 -12
- package/dist/extensions/firecrawl/web-search-provider.js +0 -2
- package/dist/extensions/github-copilot/api.js +0 -2
- package/dist/extensions/github-copilot/index.js +0 -138
- package/dist/extensions/github-copilot/login.js +0 -2
- package/dist/extensions/github-copilot/models-defaults.js +0 -38
- package/dist/extensions/github-copilot/models.js +0 -2
- package/dist/extensions/github-copilot/openclaw.plugin.json +0 -31
- package/dist/extensions/github-copilot/package.json +0 -12
- package/dist/extensions/github-copilot/token.js +0 -3
- package/dist/extensions/github-copilot/usage.js +0 -2
- package/dist/extensions/google/api.js +0 -3
- package/dist/extensions/google/cli-backend.js +0 -2
- package/dist/extensions/google/gemini-cli-provider.js +0 -110
- package/dist/extensions/google/google-shared.test-helpers.js +0 -92
- package/dist/extensions/google/image-generation-provider.js +0 -162
- package/dist/extensions/google/index.js +0 -213
- package/dist/extensions/google/media-understanding-provider.js +0 -104
- package/dist/extensions/google/model-id.js +0 -2
- package/dist/extensions/google/oauth.credentials.js +0 -2
- package/dist/extensions/google/oauth.flow.js +0 -2
- package/dist/extensions/google/oauth.http.js +0 -2
- package/dist/extensions/google/oauth.js +0 -3
- package/dist/extensions/google/oauth.project.js +0 -2
- package/dist/extensions/google/oauth.runtime.js +0 -2
- package/dist/extensions/google/oauth.shared.js +0 -2
- package/dist/extensions/google/oauth.token.js +0 -2
- package/dist/extensions/google/openclaw.plugin.json +0 -89
- package/dist/extensions/google/package.json +0 -12
- package/dist/extensions/google/provider-models.js +0 -2
- package/dist/extensions/google/runtime-api.js +0 -4
- package/dist/extensions/google/test-api.js +0 -2
- package/dist/extensions/google/web-search-provider.js +0 -2
- package/dist/extensions/googlechat/api.js +0 -2
- package/dist/extensions/googlechat/channel-config-api.js +0 -7
- package/dist/extensions/googlechat/index.js +0 -13
- package/dist/extensions/googlechat/openclaw.plugin.json +0 -11
- package/dist/extensions/googlechat/package.json +0 -48
- package/dist/extensions/googlechat/runtime-api.js +0 -39
- package/dist/extensions/googlechat/setup-entry.js +0 -6
- package/dist/extensions/googlechat/test-api.js +0 -3
- package/dist/extensions/groq/index.js +0 -13
- package/dist/extensions/groq/media-understanding-provider.js +0 -2
- package/dist/extensions/groq/openclaw.plugin.json +0 -13
- package/dist/extensions/groq/package.json +0 -12
- package/dist/extensions/huggingface/api.js +0 -4
- package/dist/extensions/huggingface/index.js +0 -54
- package/dist/extensions/huggingface/models.js +0 -2
- package/dist/extensions/huggingface/onboard.js +0 -2
- package/dist/extensions/huggingface/openclaw.plugin.json +0 -34
- package/dist/extensions/huggingface/package.json +0 -12
- package/dist/extensions/huggingface/provider-catalog.js +0 -3
- package/dist/extensions/imessage/api.js +0 -4
- package/dist/extensions/imessage/channel-config-api.js +0 -2
- package/dist/extensions/imessage/index.js +0 -211
- package/dist/extensions/imessage/openclaw.plugin.json +0 -11
- package/dist/extensions/imessage/package.json +0 -26
- package/dist/extensions/imessage/runtime-api.js +0 -11
- package/dist/extensions/imessage/setup-entry.js +0 -13
- package/dist/extensions/irc/api.js +0 -2
- package/dist/extensions/irc/channel-config-api.js +0 -2
- package/dist/extensions/irc/index.js +0 -12
- package/dist/extensions/irc/openclaw.plugin.json +0 -11
- package/dist/extensions/irc/package.json +0 -28
- package/dist/extensions/irc/setup-entry.js +0 -6
- package/dist/extensions/kilocode/api.js +0 -3
- package/dist/extensions/kilocode/index.js +0 -37
- package/dist/extensions/kilocode/onboard.js +0 -3
- package/dist/extensions/kilocode/openclaw.plugin.json +0 -33
- package/dist/extensions/kilocode/package.json +0 -12
- package/dist/extensions/kilocode/provider-catalog.js +0 -2
- package/dist/extensions/kilocode/provider-models.js +0 -2
- package/dist/extensions/kilocode/shared.js +0 -2
- package/dist/extensions/kimi-coding/api.js +0 -3
- package/dist/extensions/kimi-coding/index.js +0 -81
- package/dist/extensions/kimi-coding/onboard.js +0 -2
- package/dist/extensions/kimi-coding/openclaw.plugin.json +0 -38
- package/dist/extensions/kimi-coding/package.json +0 -12
- package/dist/extensions/kimi-coding/provider-catalog.js +0 -2
- package/dist/extensions/kimi-coding/stream.js +0 -2
- package/dist/extensions/line/api.js +0 -13
- package/dist/extensions/line/index.js +0 -815
- package/dist/extensions/line/openclaw.plugin.json +0 -11
- package/dist/extensions/line/package.json +0 -41
- package/dist/extensions/line/runtime-api.js +0 -11
- package/dist/extensions/line/setup-api.js +0 -3
- package/dist/extensions/line/setup-entry.js +0 -15
- package/dist/extensions/litellm/api.js +0 -2
- package/dist/extensions/litellm/index.js +0 -36
- package/dist/extensions/litellm/onboard.js +0 -2
- package/dist/extensions/litellm/openclaw.plugin.json +0 -33
- package/dist/extensions/litellm/package.json +0 -12
- package/dist/extensions/litellm/provider-catalog.js +0 -2
- package/dist/extensions/llm-task/api.js +0 -6
- package/dist/extensions/llm-task/index.js +0 -156
- package/dist/extensions/llm-task/openclaw.plugin.json +0 -33
- package/dist/extensions/llm-task/package.json +0 -16
- package/dist/extensions/lobster/index.js +0 -232
- package/dist/extensions/lobster/openclaw.plugin.json +0 -10
- package/dist/extensions/lobster/package.json +0 -17
- package/dist/extensions/lobster/runtime-api.js +0 -4
- package/dist/extensions/matrix/api.js +0 -10
- package/dist/extensions/matrix/helper-api.js +0 -3
- package/dist/extensions/matrix/index.js +0 -44
- package/dist/extensions/matrix/legacy-crypto-inspector.js +0 -41
- package/dist/extensions/matrix/openclaw.plugin.json +0 -11
- package/dist/extensions/matrix/package.json +0 -53
- package/dist/extensions/matrix/plugin-entry.handlers.runtime.js +0 -48
- package/dist/extensions/matrix/runtime-api.js +0 -25
- package/dist/extensions/matrix/setup-entry.js +0 -6
- package/dist/extensions/matrix/test-api.js +0 -3
- package/dist/extensions/matrix/thread-bindings-runtime.js +0 -2
- package/dist/extensions/mattermost/api.js +0 -2
- package/dist/extensions/mattermost/index.js +0 -15
- package/dist/extensions/mattermost/openclaw.plugin.json +0 -11
- package/dist/extensions/mattermost/package.json +0 -41
- package/dist/extensions/mattermost/runtime-api.js +0 -41
- package/dist/extensions/mattermost/setup-entry.js +0 -6
- package/dist/extensions/memory-core/api.js +0 -1
- package/dist/extensions/memory-core/index.js +0 -440
- package/dist/extensions/memory-core/openclaw.plugin.json +0 -9
- package/dist/extensions/memory-core/package.json +0 -23
- package/dist/extensions/memory-core/runtime-api.js +0 -3
- package/dist/extensions/memory-lancedb/api.js +0 -4
- package/dist/extensions/memory-lancedb/config.js +0 -2
- package/dist/extensions/memory-lancedb/index.js +0 -7037
- package/dist/extensions/memory-lancedb/lancedb-runtime.js +0 -2
- package/dist/extensions/memory-lancedb/openclaw.plugin.json +0 -92
- package/dist/extensions/memory-lancedb/package.json +0 -24
- package/dist/extensions/microsoft/index.js +0 -13
- package/dist/extensions/microsoft/openclaw.plugin.json +0 -13
- package/dist/extensions/microsoft/package.json +0 -15
- package/dist/extensions/microsoft/speech-provider.js +0 -2
- package/dist/extensions/microsoft/test-api.js +0 -2
- package/dist/extensions/microsoft/tts.js +0 -2
- package/dist/extensions/microsoft-foundry/auth.js +0 -2
- package/dist/extensions/microsoft-foundry/cli.js +0 -2
- package/dist/extensions/microsoft-foundry/index.js +0 -13
- package/dist/extensions/microsoft-foundry/onboard.js +0 -3
- package/dist/extensions/microsoft-foundry/openclaw.plugin.json +0 -39
- package/dist/extensions/microsoft-foundry/package.json +0 -12
- package/dist/extensions/microsoft-foundry/provider.js +0 -2
- package/dist/extensions/microsoft-foundry/runtime.js +0 -2
- package/dist/extensions/microsoft-foundry/shared-runtime.js +0 -3
- package/dist/extensions/microsoft-foundry/shared.js +0 -2
- package/dist/extensions/minimax/api.js +0 -6
- package/dist/extensions/minimax/image-generation-provider.js +0 -2
- package/dist/extensions/minimax/index.js +0 -219
- package/dist/extensions/minimax/media-understanding-provider.js +0 -2
- package/dist/extensions/minimax/model-definitions.js +0 -2
- package/dist/extensions/minimax/oauth.js +0 -2
- package/dist/extensions/minimax/oauth.runtime.js +0 -2
- package/dist/extensions/minimax/onboard.js +0 -2
- package/dist/extensions/minimax/openclaw.plugin.json +0 -98
- package/dist/extensions/minimax/package.json +0 -12
- package/dist/extensions/minimax/provider-catalog.js +0 -2
- package/dist/extensions/minimax/provider-models.js +0 -2
- package/dist/extensions/mistral/api.js +0 -5
- package/dist/extensions/mistral/index.js +0 -79
- package/dist/extensions/mistral/media-understanding-provider.js +0 -2
- package/dist/extensions/mistral/model-definitions.js +0 -2
- package/dist/extensions/mistral/onboard.js +0 -2
- package/dist/extensions/mistral/openclaw.plugin.json +0 -37
- package/dist/extensions/mistral/package.json +0 -12
- package/dist/extensions/mistral/provider-catalog.js +0 -2
- package/dist/extensions/modelstudio/api.js +0 -4
- package/dist/extensions/modelstudio/index.js +0 -111
- package/dist/extensions/modelstudio/model-definitions.js +0 -2
- package/dist/extensions/modelstudio/models.js +0 -2
- package/dist/extensions/modelstudio/onboard.js +0 -3
- package/dist/extensions/modelstudio/openclaw.plugin.json +0 -75
- package/dist/extensions/modelstudio/package.json +0 -12
- package/dist/extensions/modelstudio/provider-catalog.js +0 -2
- package/dist/extensions/moonshot/api.js +0 -4
- package/dist/extensions/moonshot/index.js +0 -58
- package/dist/extensions/moonshot/media-understanding-provider.js +0 -2
- package/dist/extensions/moonshot/onboard.js +0 -2
- package/dist/extensions/moonshot/openclaw.plugin.json +0 -87
- package/dist/extensions/moonshot/package.json +0 -12
- package/dist/extensions/moonshot/provider-catalog.js +0 -2
- package/dist/extensions/moonshot/test-api.js +0 -2
- package/dist/extensions/moonshot/web-search-provider.js +0 -2
- package/dist/extensions/msteams/api.js +0 -2
- package/dist/extensions/msteams/channel-config-api.js +0 -2
- package/dist/extensions/msteams/index.js +0 -13
- package/dist/extensions/msteams/openclaw.plugin.json +0 -11
- package/dist/extensions/msteams/package.json +0 -48
- package/dist/extensions/msteams/runtime-api.js +0 -47
- package/dist/extensions/msteams/setup-entry.js +0 -6
- package/dist/extensions/msteams/test-api.js +0 -2
- package/dist/extensions/nextcloud-talk/api.js +0 -2
- package/dist/extensions/nextcloud-talk/index.js +0 -12
- package/dist/extensions/nextcloud-talk/openclaw.plugin.json +0 -11
- package/dist/extensions/nextcloud-talk/package.json +0 -45
- package/dist/extensions/nextcloud-talk/runtime-api.js +0 -35
- package/dist/extensions/nextcloud-talk/setup-entry.js +0 -6
- package/dist/extensions/nostr/api.js +0 -15
- package/dist/extensions/nostr/index.js +0 -559
- package/dist/extensions/nostr/openclaw.plugin.json +0 -11
- package/dist/extensions/nostr/package.json +0 -44
- package/dist/extensions/nostr/runtime-api.js +0 -15
- package/dist/extensions/nostr/setup-api.js +0 -2
- package/dist/extensions/nostr/setup-entry.js +0 -6
- package/dist/extensions/nostr/test-api.js +0 -2
- package/dist/extensions/nvidia/api.js +0 -2
- package/dist/extensions/nvidia/index.js +0 -16
- package/dist/extensions/nvidia/openclaw.plugin.json +0 -17
- package/dist/extensions/nvidia/package.json +0 -12
- package/dist/extensions/nvidia/provider-catalog.js +0 -2
- package/dist/extensions/ollama/api.js +0 -3
- package/dist/extensions/ollama/index.js +0 -139
- package/dist/extensions/ollama/openclaw.plugin.json +0 -29
- package/dist/extensions/ollama/package.json +0 -12
- package/dist/extensions/ollama/runtime-api.js +0 -3
- package/dist/extensions/open-prose/index.js +0 -10
- package/dist/extensions/open-prose/openclaw.plugin.json +0 -13
- package/dist/extensions/open-prose/package.json +0 -12
- package/dist/extensions/open-prose/runtime-api.js +0 -3
- package/dist/extensions/open-prose/skills/prose/LICENSE +0 -21
- package/dist/extensions/open-prose/skills/prose/SKILL.md +0 -323
- package/dist/extensions/open-prose/skills/prose/alt-borges.md +0 -141
- package/dist/extensions/open-prose/skills/prose/alts/arabian-nights.md +0 -229
- package/dist/extensions/open-prose/skills/prose/alts/borges.md +0 -360
- package/dist/extensions/open-prose/skills/prose/alts/folk.md +0 -322
- package/dist/extensions/open-prose/skills/prose/alts/homer.md +0 -217
- package/dist/extensions/open-prose/skills/prose/alts/kafka.md +0 -373
- package/dist/extensions/open-prose/skills/prose/alts/shared-appendix.md +0 -35
- package/dist/extensions/open-prose/skills/prose/compiler.md +0 -2971
- package/dist/extensions/open-prose/skills/prose/examples/01-hello-world.prose +0 -4
- package/dist/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +0 -6
- package/dist/extensions/open-prose/skills/prose/examples/03-code-review.prose +0 -17
- package/dist/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +0 -14
- package/dist/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +0 -20
- package/dist/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +0 -17
- package/dist/extensions/open-prose/skills/prose/examples/07-refactor.prose +0 -20
- package/dist/extensions/open-prose/skills/prose/examples/08-blog-post.prose +0 -20
- package/dist/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +0 -25
- package/dist/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +0 -32
- package/dist/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +0 -27
- package/dist/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +0 -43
- package/dist/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +0 -51
- package/dist/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +0 -48
- package/dist/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +0 -23
- package/dist/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +0 -19
- package/dist/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +0 -19
- package/dist/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +0 -36
- package/dist/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +0 -71
- package/dist/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +0 -20
- package/dist/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +0 -35
- package/dist/extensions/open-prose/skills/prose/examples/22-error-handling.prose +0 -51
- package/dist/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +0 -63
- package/dist/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +0 -86
- package/dist/extensions/open-prose/skills/prose/examples/25-conditionals.prose +0 -114
- package/dist/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +0 -100
- package/dist/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +0 -105
- package/dist/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +0 -37
- package/dist/extensions/open-prose/skills/prose/examples/28-gas-town.prose +0 -1572
- package/dist/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +0 -218
- package/dist/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +0 -42
- package/dist/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +0 -145
- package/dist/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +0 -168
- package/dist/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +0 -204
- package/dist/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +0 -296
- package/dist/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +0 -237
- package/dist/extensions/open-prose/skills/prose/examples/37-the-forge.prose +0 -1474
- package/dist/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +0 -455
- package/dist/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +0 -277
- package/dist/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +0 -32
- package/dist/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +0 -38
- package/dist/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +0 -46
- package/dist/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +0 -50
- package/dist/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +0 -261
- package/dist/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +0 -159
- package/dist/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +0 -637
- package/dist/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +0 -148
- package/dist/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +0 -225
- package/dist/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +0 -356
- package/dist/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +0 -445
- package/dist/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +0 -210
- package/dist/extensions/open-prose/skills/prose/examples/README.md +0 -391
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/README.md +0 -22
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +0 -20
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +0 -18
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +0 -17
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +0 -223
- package/dist/extensions/open-prose/skills/prose/guidance/antipatterns.md +0 -951
- package/dist/extensions/open-prose/skills/prose/guidance/patterns.md +0 -700
- package/dist/extensions/open-prose/skills/prose/guidance/system-prompt.md +0 -180
- package/dist/extensions/open-prose/skills/prose/help.md +0 -144
- package/dist/extensions/open-prose/skills/prose/lib/README.md +0 -108
- package/dist/extensions/open-prose/skills/prose/lib/calibrator.prose +0 -215
- package/dist/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +0 -174
- package/dist/extensions/open-prose/skills/prose/lib/error-forensics.prose +0 -250
- package/dist/extensions/open-prose/skills/prose/lib/inspector.prose +0 -196
- package/dist/extensions/open-prose/skills/prose/lib/profiler.prose +0 -460
- package/dist/extensions/open-prose/skills/prose/lib/program-improver.prose +0 -275
- package/dist/extensions/open-prose/skills/prose/lib/project-memory.prose +0 -118
- package/dist/extensions/open-prose/skills/prose/lib/user-memory.prose +0 -93
- package/dist/extensions/open-prose/skills/prose/lib/vm-improver.prose +0 -243
- package/dist/extensions/open-prose/skills/prose/primitives/session.md +0 -593
- package/dist/extensions/open-prose/skills/prose/prose.md +0 -1237
- package/dist/extensions/open-prose/skills/prose/state/filesystem.md +0 -498
- package/dist/extensions/open-prose/skills/prose/state/in-context.md +0 -384
- package/dist/extensions/open-prose/skills/prose/state/postgres.md +0 -880
- package/dist/extensions/open-prose/skills/prose/state/sqlite.md +0 -531
- package/dist/extensions/openai/api.js +0 -4
- package/dist/extensions/openai/cli-backend.js +0 -2
- package/dist/extensions/openai/default-models.js +0 -2
- package/dist/extensions/openai/image-generation-provider.js +0 -2
- package/dist/extensions/openai/index.js +0 -24
- package/dist/extensions/openai/media-understanding-provider.js +0 -2
- package/dist/extensions/openai/openai-codex-auth-identity.js +0 -2
- package/dist/extensions/openai/openai-codex-catalog.js +0 -2
- package/dist/extensions/openai/openai-codex-provider.js +0 -2
- package/dist/extensions/openai/openai-codex-provider.runtime.js +0 -14
- package/dist/extensions/openai/openai-provider.js +0 -2
- package/dist/extensions/openai/openclaw.plugin.json +0 -61
- package/dist/extensions/openai/package.json +0 -12
- package/dist/extensions/openai/shared.js +0 -4
- package/dist/extensions/openai/speech-provider.js +0 -2
- package/dist/extensions/openai/test-api.js +0 -5
- package/dist/extensions/openai/tts.js +0 -2
- package/dist/extensions/opencode/api.js +0 -3
- package/dist/extensions/opencode/index.js +0 -63
- package/dist/extensions/opencode/onboard.js +0 -2
- package/dist/extensions/opencode/openclaw.plugin.json +0 -33
- package/dist/extensions/opencode/package.json +0 -12
- package/dist/extensions/opencode-go/api.js +0 -3
- package/dist/extensions/opencode-go/index.js +0 -54
- package/dist/extensions/opencode-go/onboard.js +0 -2
- package/dist/extensions/opencode-go/openclaw.plugin.json +0 -33
- package/dist/extensions/opencode-go/package.json +0 -12
- package/dist/extensions/openrouter/api.js +0 -3
- package/dist/extensions/openrouter/index.js +0 -121
- package/dist/extensions/openrouter/media-understanding-provider.js +0 -2
- package/dist/extensions/openrouter/onboard.js +0 -2
- package/dist/extensions/openrouter/openclaw.plugin.json +0 -37
- package/dist/extensions/openrouter/package.json +0 -12
- package/dist/extensions/openrouter/provider-catalog.js +0 -2
- package/dist/extensions/openshell/index.js +0 -919
- package/dist/extensions/openshell/openclaw.plugin.json +0 -118
- package/dist/extensions/openshell/package.json +0 -12
- package/dist/extensions/perplexity/index.js +0 -13
- package/dist/extensions/perplexity/openclaw.plugin.json +0 -54
- package/dist/extensions/perplexity/package.json +0 -12
- package/dist/extensions/perplexity/test-api.js +0 -2
- package/dist/extensions/perplexity/web-search-provider.js +0 -2
- package/dist/extensions/phone-control/index.js +0 -283
- package/dist/extensions/phone-control/openclaw.plugin.json +0 -11
- package/dist/extensions/phone-control/runtime-api.js +0 -3
- package/dist/extensions/qianfan/api.js +0 -3
- package/dist/extensions/qianfan/index.js +0 -26
- package/dist/extensions/qianfan/onboard.js +0 -2
- package/dist/extensions/qianfan/openclaw.plugin.json +0 -32
- package/dist/extensions/qianfan/package.json +0 -12
- package/dist/extensions/qianfan/provider-catalog.js +0 -2
- package/dist/extensions/qqbot/api.js +0 -173
- package/dist/extensions/qqbot/index.js +0 -445
- package/dist/extensions/qqbot/openclaw.plugin.json +0 -257
- package/dist/extensions/qqbot/package.json +0 -52
- package/dist/extensions/qqbot/runtime-api.js +0 -2
- package/dist/extensions/qqbot/setup-entry.js +0 -6
- package/dist/extensions/qqbot/skills/qqbot-channel/SKILL.md +0 -262
- package/dist/extensions/qqbot/skills/qqbot-channel/references/api_references.md +0 -521
- package/dist/extensions/qqbot/skills/qqbot-media/SKILL.md +0 -36
- package/dist/extensions/qqbot/skills/qqbot-remind/SKILL.md +0 -149
- package/dist/extensions/searxng/index.js +0 -13
- package/dist/extensions/searxng/openclaw.plugin.json +0 -46
- package/dist/extensions/searxng/package.json +0 -12
- package/dist/extensions/searxng/web-search-provider.js +0 -2
- package/dist/extensions/sglang/api.js +0 -4
- package/dist/extensions/sglang/defaults.js +0 -2
- package/dist/extensions/sglang/index.js +0 -77
- package/dist/extensions/sglang/models.js +0 -2
- package/dist/extensions/sglang/openclaw.plugin.json +0 -29
- package/dist/extensions/sglang/package.json +0 -12
- package/dist/extensions/signal/api.js +0 -7
- package/dist/extensions/signal/channel-config-api.js +0 -2
- package/dist/extensions/signal/index.js +0 -319
- package/dist/extensions/signal/openclaw.plugin.json +0 -11
- package/dist/extensions/signal/package.json +0 -24
- package/dist/extensions/signal/reaction-runtime-api.js +0 -2
- package/dist/extensions/signal/runtime-api.js +0 -24
- package/dist/extensions/signal/setup-entry.js +0 -13
- package/dist/extensions/signal/test-api.js +0 -111
- package/dist/extensions/slack/api.js +0 -10
- package/dist/extensions/slack/channel-config-api.js +0 -2
- package/dist/extensions/slack/index.js +0 -12
- package/dist/extensions/slack/openclaw.plugin.json +0 -11
- package/dist/extensions/slack/package.json +0 -31
- package/dist/extensions/slack/runtime-api.js +0 -110
- package/dist/extensions/slack/setup-entry.js +0 -12
- package/dist/extensions/slack/test-api.js +0 -47
- package/dist/extensions/stepfun/index.js +0 -163
- package/dist/extensions/stepfun/onboard.js +0 -3
- package/dist/extensions/stepfun/openclaw.plugin.json +0 -83
- package/dist/extensions/stepfun/package.json +0 -12
- package/dist/extensions/stepfun/provider-catalog.js +0 -2
- package/dist/extensions/synology-chat/index.js +0 -12
- package/dist/extensions/synology-chat/openclaw.plugin.json +0 -11
- package/dist/extensions/synology-chat/package.json +0 -26
- package/dist/extensions/synology-chat/setup-api.js +0 -2
- package/dist/extensions/synology-chat/setup-entry.js +0 -6
- package/dist/extensions/synthetic/api.js +0 -4
- package/dist/extensions/synthetic/index.js +0 -27
- package/dist/extensions/synthetic/models.js +0 -2
- package/dist/extensions/synthetic/onboard.js +0 -3
- package/dist/extensions/synthetic/openclaw.plugin.json +0 -32
- package/dist/extensions/synthetic/package.json +0 -12
- package/dist/extensions/synthetic/provider-catalog.js +0 -2
- package/dist/extensions/talk-voice/api.js +0 -3
- package/dist/extensions/talk-voice/index.js +0 -160
- package/dist/extensions/talk-voice/openclaw.plugin.json +0 -11
- package/dist/extensions/tavily/index.js +0 -128
- package/dist/extensions/tavily/openclaw.plugin.json +0 -53
- package/dist/extensions/tavily/package.json +0 -12
- package/dist/extensions/tavily/skills/tavily/SKILL.md +0 -94
- package/dist/extensions/tavily/web-search-provider.js +0 -2
- package/dist/extensions/telegram/allow-from.js +0 -2
- package/dist/extensions/telegram/api.js +0 -14
- package/dist/extensions/telegram/channel-config-api.js +0 -2
- package/dist/extensions/telegram/index.js +0 -12
- package/dist/extensions/telegram/openclaw.plugin.json +0 -11
- package/dist/extensions/telegram/package.json +0 -37
- package/dist/extensions/telegram/runtime-api.js +0 -25
- package/dist/extensions/telegram/session-key-api.js +0 -2
- package/dist/extensions/telegram/setup-entry.js +0 -13
- package/dist/extensions/telegram/test-api.js +0 -88
- package/dist/extensions/telegram/test-support.js +0 -46
- package/dist/extensions/telegram/update-offset-runtime-api.js +0 -2
- package/dist/extensions/thread-ownership/api.js +0 -5
- package/dist/extensions/thread-ownership/index.js +0 -82
- package/dist/extensions/thread-ownership/openclaw.plugin.json +0 -30
- package/dist/extensions/tlon/api.js +0 -14
- package/dist/extensions/tlon/index.js +0 -150
- package/dist/extensions/tlon/openclaw.plugin.json +0 -12
- package/dist/extensions/tlon/package.json +0 -44
- package/dist/extensions/tlon/runtime-api.js +0 -14
- package/dist/extensions/tlon/setup-api.js +0 -3
- package/dist/extensions/tlon/setup-entry.js +0 -6
- package/dist/extensions/tlon/test-api.js +0 -2
- package/dist/extensions/together/api.js +0 -3
- package/dist/extensions/together/index.js +0 -26
- package/dist/extensions/together/models.js +0 -2
- package/dist/extensions/together/onboard.js +0 -2
- package/dist/extensions/together/openclaw.plugin.json +0 -32
- package/dist/extensions/together/package.json +0 -12
- package/dist/extensions/together/provider-catalog.js +0 -2
- package/dist/extensions/twitch/api.js +0 -9
- package/dist/extensions/twitch/index.js +0 -1090
- package/dist/extensions/twitch/openclaw.plugin.json +0 -11
- package/dist/extensions/twitch/package.json +0 -29
- package/dist/extensions/twitch/runtime-api.js +0 -9
- package/dist/extensions/venice/api.js +0 -3
- package/dist/extensions/venice/index.js +0 -55
- package/dist/extensions/venice/models.js +0 -2
- package/dist/extensions/venice/onboard.js +0 -3
- package/dist/extensions/venice/openclaw.plugin.json +0 -32
- package/dist/extensions/venice/package.json +0 -12
- package/dist/extensions/venice/provider-catalog.js +0 -2
- package/dist/extensions/vercel-ai-gateway/api.js +0 -4
- package/dist/extensions/vercel-ai-gateway/index.js +0 -30
- package/dist/extensions/vercel-ai-gateway/models.js +0 -2
- package/dist/extensions/vercel-ai-gateway/onboard.js +0 -2
- package/dist/extensions/vercel-ai-gateway/openclaw.plugin.json +0 -32
- package/dist/extensions/vercel-ai-gateway/package.json +0 -12
- package/dist/extensions/vercel-ai-gateway/provider-catalog.js +0 -2
- package/dist/extensions/vllm/api.js +0 -4
- package/dist/extensions/vllm/defaults.js +0 -2
- package/dist/extensions/vllm/index.js +0 -78
- package/dist/extensions/vllm/models.js +0 -2
- package/dist/extensions/vllm/openclaw.plugin.json +0 -29
- package/dist/extensions/vllm/package.json +0 -12
- package/dist/extensions/voice-call/api.js +0 -7
- package/dist/extensions/voice-call/index.js +0 -698
- package/dist/extensions/voice-call/openclaw.plugin.json +0 -700
- package/dist/extensions/voice-call/package.json +0 -33
- package/dist/extensions/voice-call/runtime-api.js +0 -7
- package/dist/extensions/voice-call/runtime-entry.js +0 -2
- package/dist/extensions/volcengine/api.js +0 -3
- package/dist/extensions/volcengine/index.js +0 -63
- package/dist/extensions/volcengine/models.js +0 -2
- package/dist/extensions/volcengine/openclaw.plugin.json +0 -33
- package/dist/extensions/volcengine/package.json +0 -12
- package/dist/extensions/volcengine/provider-catalog.js +0 -2
- package/dist/extensions/whatsapp/action-runtime-api.js +0 -2
- package/dist/extensions/whatsapp/action-runtime.runtime.js +0 -2
- package/dist/extensions/whatsapp/api.js +0 -8
- package/dist/extensions/whatsapp/auth-presence.js +0 -2
- package/dist/extensions/whatsapp/channel-config-api.js +0 -2
- package/dist/extensions/whatsapp/constants.js +0 -2
- package/dist/extensions/whatsapp/index.js +0 -12
- package/dist/extensions/whatsapp/light-runtime-api.js +0 -5
- package/dist/extensions/whatsapp/login-qr-api.js +0 -2
- package/dist/extensions/whatsapp/openclaw.plugin.json +0 -11
- package/dist/extensions/whatsapp/package.json +0 -45
- package/dist/extensions/whatsapp/runtime-api.js +0 -334
- package/dist/extensions/whatsapp/setup-entry.js +0 -23
- package/dist/extensions/whatsapp/test-api.js +0 -76
- package/dist/extensions/xai/api.js +0 -6
- package/dist/extensions/xai/code-execution.js +0 -2
- package/dist/extensions/xai/index.js +0 -122
- package/dist/extensions/xai/model-definitions.js +0 -2
- package/dist/extensions/xai/model-id.js +0 -2
- package/dist/extensions/xai/onboard.js +0 -2
- package/dist/extensions/xai/openclaw.plugin.json +0 -157
- package/dist/extensions/xai/package.json +0 -12
- package/dist/extensions/xai/provider-catalog.js +0 -2
- package/dist/extensions/xai/provider-models.js +0 -2
- package/dist/extensions/xai/stream.js +0 -2
- package/dist/extensions/xai/web-search.js +0 -2
- package/dist/extensions/xai/x-search.js +0 -2
- package/dist/extensions/xiaomi/api.js +0 -3
- package/dist/extensions/xiaomi/index.js +0 -37
- package/dist/extensions/xiaomi/onboard.js +0 -2
- package/dist/extensions/xiaomi/openclaw.plugin.json +0 -32
- package/dist/extensions/xiaomi/package.json +0 -12
- package/dist/extensions/xiaomi/provider-catalog.js +0 -2
- package/dist/extensions/zai/api.js +0 -3
- package/dist/extensions/zai/detect.js +0 -2
- package/dist/extensions/zai/index.js +0 -239
- package/dist/extensions/zai/media-understanding-provider.js +0 -2
- package/dist/extensions/zai/model-definitions.js +0 -2
- package/dist/extensions/zai/onboard.js +0 -2
- package/dist/extensions/zai/openclaw.plugin.json +0 -94
- package/dist/extensions/zai/package.json +0 -12
- package/dist/extensions/zai/runtime-api.js +0 -3
- package/dist/extensions/zalo/api.js +0 -3
- package/dist/extensions/zalo/index.js +0 -13
- package/dist/extensions/zalo/openclaw.plugin.json +0 -11
- package/dist/extensions/zalo/package.json +0 -47
- package/dist/extensions/zalo/runtime-api.js +0 -38
- package/dist/extensions/zalo/setup-entry.js +0 -6
- package/dist/extensions/zalo/test-api.js +0 -2
- package/dist/extensions/zalouser/api.js +0 -2
- package/dist/extensions/zalouser/index.js +0 -599
- package/dist/extensions/zalouser/openclaw.plugin.json +0 -11
- package/dist/extensions/zalouser/package.json +0 -48
- package/dist/extensions/zalouser/runtime-api.js +0 -30
- package/dist/extensions/zalouser/setup-entry.js +0 -13
- package/dist/extensions/zalouser/test-api.js +0 -5
- package/dist/external-content-DtoRY-d1.js +0 -242
- package/dist/facade-runtime-Bpi4Gy-u.js +0 -263
- package/dist/failover-error-BrdBIFg2.js +0 -180
- package/dist/feishu-81Iv8tqF.js +0 -18
- package/dist/feishu-conversation-NmEqAxSA.js +0 -17
- package/dist/feishu-setup-DXAK6GqE.js +0 -12
- package/dist/fetch-7dbKQPT5.js +0 -256
- package/dist/fetch-BjiGl865.js +0 -418
- package/dist/fetch-Bp23aO5S.js +0 -65
- package/dist/fetch-guard-BnhVFBtf.js +0 -150
- package/dist/fetch-mock-WghRRNpK.js +0 -6
- package/dist/fetch-runtime-DfFmkkZH.js +0 -4
- package/dist/fetch-timeout-BKMGkHu9.js +0 -58
- package/dist/file-identity-DPm-6kp0.js +0 -567
- package/dist/file-lock-CH0V9dhL.js +0 -141
- package/dist/file-lock-D292sbfa.js +0 -2
- package/dist/firecrawl-client-GOGPuEeg.js +0 -338
- package/dist/firecrawl-search-provider-ptp7GNAt.js +0 -47
- package/dist/format-BwzSM9vY.js +0 -24
- package/dist/format-D38w0aKT.js +0 -817
- package/dist/format-DCFsK8oa.js +0 -19
- package/dist/format-datetime-Bl6-b7G1.js +0 -73
- package/dist/format-duration-DqcpDYkZ.js +0 -57
- package/dist/format-relative-CYrRyrT7.js +0 -54
- package/dist/frontmatter-Ba2Hn11b.js +0 -45
- package/dist/frontmatter-Cjxy4vX8.js +0 -210
- package/dist/fs-safe-BQ59ttjX.js +0 -999
- package/dist/gateway-CWPyH-P7.js +0 -2575
- package/dist/gateway-cli-BmPBPCcJ.js +0 -1572
- package/dist/gateway-discovery-targets--oNzWOVw.js +0 -430
- package/dist/gateway-install-token-tyQyR2ED.js +0 -230
- package/dist/gateway-lock-BbUQuUet.js +0 -292
- package/dist/gateway-presence-BVCIm1hy.js +0 -15
- package/dist/gateway-registry-tQcIThkV.js +0 -74
- package/dist/gateway-rpc-BXdoSPN7.js +0 -26
- package/dist/gateway-runtime-C7EhkU_c.js +0 -12
- package/dist/gaxios-fetch-compat-D4gl5582.js +0 -180
- package/dist/gemini-auth-Dlpcd9MB.js +0 -29
- package/dist/gemini-web-search-provider-CkNEl2du.js +0 -162
- package/dist/get-reply-from-config.runtime-vBmBttxw.js +0 -2
- package/dist/get-reply-from-config.runtime.js +0 -1
- package/dist/git-commit-BS28SZVT.js +0 -2
- package/dist/git-commit-ChiOoWyK.js +0 -177
- package/dist/github-copilot-login-B8s4OVQ4.js +0 -11
- package/dist/github-copilot-token-BwXtH-ZJ.js +0 -2
- package/dist/github-copilot-token-D81Wvm8b.js +0 -2
- package/dist/github-copilot-token-beHjQGOp.js +0 -91
- package/dist/global-singleton-54zT3rCn.js +0 -13
- package/dist/global-singleton-iOq2_-p8.js +0 -1
- package/dist/global-state-DUuMGgts.js +0 -17
- package/dist/globals-CDtV0ht8.js +0 -25
- package/dist/gmail-setup-utils-CxXfU7cy.js +0 -421
- package/dist/google-Cx1_z3Q3.js +0 -24
- package/dist/googlechat-CoiMNDC2.js +0 -37
- package/dist/graph-users-BmZWavVH.js +0 -917
- package/dist/group-access-BZZ3FNmb.js +0 -32
- package/dist/group-access-BjveEAjz.js +0 -113
- package/dist/group-access-owHLoCWX.js +0 -119
- package/dist/group-activation-ClEb7qwj.js +0 -22
- package/dist/group-id-CcsUNOct.js +0 -11
- package/dist/group-policy-Bb8dxOpM.js +0 -25
- package/dist/group-policy-G9GcSyph.js +0 -201
- package/dist/group-policy-wS9F8Y_i.js +0 -51
- package/dist/group-policy-warnings-CL2gHsXM.js +0 -196
- package/dist/groups.runtime-K758xQFV.js +0 -6
- package/dist/groups.runtime.js +0 -1
- package/dist/handle-action-CE4vpa7G.js +0 -500
- package/dist/health-D_KQbqQY.js +0 -577
- package/dist/health-a1VPtSyV.js +0 -2
- package/dist/health-format-COR93f8W.js +0 -26
- package/dist/heartbeat-C_TrErgd.js +0 -122
- package/dist/heartbeat-reply-payload-C7Ac3fOZ.js +0 -13
- package/dist/heartbeat-summary-v5gPj5bd.js +0 -57
- package/dist/heartbeat-visibility-CHMO4pmJ.js +0 -102
- package/dist/help-CyR1Oo4X.js +0 -81
- package/dist/help-format-l1phKNA8.js +0 -15
- package/dist/helpers-COHnQbWX.js +0 -32
- package/dist/helpers-DNpD7VMo.js +0 -24
- package/dist/history-B4mW8GfY.js +0 -102
- package/dist/home-dir-n9onX5PG.js +0 -83
- package/dist/hook-runner-global-C9GhdBtf.js +0 -632
- package/dist/hook-runner-global-Cr_Pthp4.js +0 -2
- package/dist/hook-runtime-DK8QF-2x.js +0 -3
- package/dist/hooks-cli-XCo-7nz9.js +0 -353
- package/dist/hooks-policy-BmULXBcp.js +0 -20
- package/dist/hooks-status-D_ZxRD0H.js +0 -86
- package/dist/host-env-security-SlXI58bc.js +0 -290
- package/dist/host-runtime-BGHb06HN.js +0 -1
- package/dist/hostname-BRYLr_mh.js +0 -8
- package/dist/http-body-CfdQSEp0.js +0 -238
- package/dist/http-client-_3i4-nw5.js +0 -294
- package/dist/http-registry-ZGSBfYSe.js +0 -54
- package/dist/http-route-overlap-C8lbolN5.js +0 -101
- package/dist/identity-BoQQh6Y8.js +0 -26
- package/dist/identity-D64Wfv_s.js +0 -29
- package/dist/identity-DvwF6Yix.js +0 -84
- package/dist/identity-avatar-DPBgVwpU.js +0 -86
- package/dist/identity-file-BtIJI4dn.js +0 -60
- package/dist/image-C4V19x9x.js +0 -152
- package/dist/image-generation-BbOnazXi.js +0 -1
- package/dist/image-generation-provider-CQK8HA0O.js +0 -136
- package/dist/image-generation-provider-CWUvRxmv.js +0 -131
- package/dist/image-generation-provider-F2sfNjcr.js +0 -281
- package/dist/image-ops-BJKjhMAu.js +0 -476
- package/dist/image-runtime-DodXcK2e.js +0 -7
- package/dist/imessage-2ukkzufG.js +0 -19
- package/dist/inbound-context-Cxvd3JHZ.js +0 -59
- package/dist/inbound-context-Czd3FdNb.js +0 -52
- package/dist/inbound-debounce-CI7l3R36.js +0 -159
- package/dist/inbound-envelope-LyHTUTue.js +0 -61
- package/dist/inbound-reply-dispatch-BdeY6N-k.js +0 -73
- package/dist/inbound-text-CacimZtw.js +0 -14
- package/dist/inbound.runtime-CqX3n132.js +0 -3
- package/dist/inbound.runtime.js +0 -1
- package/dist/includes-Ccr-Q5DB.js +0 -188
- package/dist/includes-scan-DVvYLj4S.js +0 -55
- package/dist/index.js +0 -56
- package/dist/infra/warning-filter.js +0 -2
- package/dist/infra-runtime-Cl0iZpRS.js +0 -22
- package/dist/input-files-PZC6ZR4W.js +0 -251
- package/dist/input-provenance-8GBFuk0Q.js +0 -44
- package/dist/inspect-B8dw6NVJ.js +0 -286
- package/dist/install-Bk7XyvtC.js +0 -590
- package/dist/install-package-dir-C2ba2toB.js +0 -284
- package/dist/install-safe-path-CkCd0rWS.js +0 -69
- package/dist/install-security-scan-C02VaEU9.js +0 -22
- package/dist/install-security-scan.runtime-CDUuS6Dl.js +0 -299
- package/dist/install-security-scan.runtime.js +0 -1
- package/dist/install-source-utils-2tdWQmwI.js +0 -167
- package/dist/install-target-CBNysuiP.js +0 -175
- package/dist/install.runtime-D_zKCpnB.js +0 -11
- package/dist/install.runtime-DjQozvMe.js +0 -27
- package/dist/install.runtime.js +0 -1
- package/dist/installs-BnAbQ70v.js +0 -28
- package/dist/interactive-CEnsu1RT.js +0 -8
- package/dist/interactive-runtime-Bxq5ztle.js +0 -1
- package/dist/internal-Lk0wFTNq.js +0 -411
- package/dist/internal-hooks-C3ziA7w_.js +0 -155
- package/dist/io-BUxKr33U.js +0 -2236
- package/dist/io-BuMkfjp3.js +0 -4
- package/dist/ip-BZP18dDl.js +0 -208
- package/dist/ipv4-Xiyu1rvD.js +0 -82
- package/dist/irc-DXfYh-Sd.js +0 -14
- package/dist/irc-surface-Di-joPuc.js +0 -15
- package/dist/is-main-Bv5ej4lF.js +0 -27
- package/dist/issue-format-8Eylt-2O.js +0 -2
- package/dist/issue-format-DLZczJ0U.js +0 -31
- package/dist/json-file-5xJqyXrK.js +0 -23
- package/dist/json-files-C4lsZ_HR.js +0 -72
- package/dist/json-mode-4O1xL2fT.js +0 -34
- package/dist/json-pointer-C30cknnZ.js +0 -43
- package/dist/json-store-FUgu1pyj.js +0 -37
- package/dist/keyed-async-queue-BTOTBE8n.js +0 -32
- package/dist/kill-tree-CIfAbzdN.js +0 -2
- package/dist/kill-tree-CUPpLbeq.js +0 -82
- package/dist/kimi-web-search-provider-Cb3F9_Da.js +0 -224
- package/dist/known-users-DjerpGCB.js +0 -167
- package/dist/lancedb-runtime-DTb_mDUG.js +0 -201
- package/dist/launchd-cp98MUhz.js +0 -517
- package/dist/lazy-runtime-C6LCAM-L.js +0 -29
- package/dist/lazy-runtime-yh_WT4on.js +0 -1
- package/dist/lazy-service-module-CeifO9oo.js +0 -24
- package/dist/legacy-crypto-restore-CsHmLVjY.js +0 -85
- package/dist/legacy-names-CFo8Oe-2.js +0 -9
- package/dist/legacy-web-search-Bn8F2jrN.js +0 -140
- package/dist/legacy.shared-oZM32end.js +0 -45
- package/dist/level-overrides-gqc8xfh2.js +0 -36
- package/dist/library-ChjjeniJ.js +0 -44
- package/dist/lifecycle-core-Ce_ZEvjl.js +0 -402
- package/dist/line-Be0jY3CU.js +0 -4
- package/dist/line-runtime-B0ZGTK81.js +0 -60
- package/dist/line-surface-BTopinac.js +0 -27
- package/dist/links-D7o22Ygt.js +0 -17
- package/dist/listeners-_47QWN8-.js +0 -14
- package/dist/llm-slug-generator-Dv-sLOW9.js +0 -68
- package/dist/llm-slug-generator.js +0 -2
- package/dist/llm-task-BDA3i86A.js +0 -3
- package/dist/load-BXSzQ8YA.js +0 -28
- package/dist/load-options-BqszWkkN.js +0 -36
- package/dist/loader-DsZDoLQ6.js +0 -2519
- package/dist/local-file-access-PajXzDdK.js +0 -49
- package/dist/local-roots-DrpNBv4b.js +0 -46
- package/dist/location-CtMHXE-d.js +0 -42
- package/dist/logger-Bc2lC3X3.js +0 -79
- package/dist/logger-CIV9WBoa.js +0 -11
- package/dist/logger-DdGvppaE.js +0 -75
- package/dist/logger-MWEZrHUL.js +0 -582
- package/dist/logging-B1QD0DRq.js +0 -2
- package/dist/logging-CAfgK7sj.js +0 -3
- package/dist/logging-ColPHIDT.js +0 -16
- package/dist/logging-D4xyCEzZ.js +0 -85
- package/dist/logging-Dt_aiHur.js +0 -13
- package/dist/logging-Dywye6yZ.js +0 -2
- package/dist/logging-core-hw7Df6Hl.js +0 -3
- package/dist/login-BrqdQcNh.js +0 -108
- package/dist/login-DSqrZNW-.js +0 -2333
- package/dist/login-qr-Dm3iC25_.js +0 -212
- package/dist/login-qr-api-BxRDJKkp.js +0 -16
- package/dist/logs-cli-CxjV80As.js +0 -221
- package/dist/magic-string.es-CVHNyqW1.js +0 -1011
- package/dist/main-session-BbO0A-No.js +0 -38
- package/dist/manager-c_fEco8X.js +0 -2773
- package/dist/manager-runtime-Vy_F8ORR.js +0 -2
- package/dist/manager.runtime-Bm1Knq-3.js +0 -670
- package/dist/manager.runtime.js +0 -1
- package/dist/manifest-f_gihArl.js +0 -237
- package/dist/manifest-registry-Kx5Z2lJL.js +0 -1069
- package/dist/map-size-BBQq2RPq.js +0 -15
- package/dist/markdown-table-runtime-Dx12DQTq.js +0 -2
- package/dist/markdown-tables-CSlyhQVP.js +0 -31
- package/dist/mask-api-key-BYVFDQdo.js +0 -10
- package/dist/matrix-NDa-FoaE.js +0 -351
- package/dist/matrix-config-helpers-D0D-oL7I.js +0 -153
- package/dist/matrix-helper-DioFIiaO.js +0 -20
- package/dist/matrix-migration-snapshot-DAOFFSgM.js +0 -714
- package/dist/matrix-ouiFsVI1.js +0 -39
- package/dist/matrix-runtime-heavy-KUEg_MfD.js +0 -4
- package/dist/matrix-runtime-shared-B6aE5Uu6.js +0 -1
- package/dist/matrix-runtime-surface-R78Hde6Q.js +0 -12
- package/dist/matrix-surface-B-nU-e0B.js +0 -13
- package/dist/matrix-thread-bindings-B77Krs8r.js +0 -12
- package/dist/mattermost-Cg2PI71s.js +0 -18
- package/dist/mcp/plugin-tools-serve.js +0 -105
- package/dist/mcp-cli-BMNT4RIm.js +0 -768
- package/dist/mcp-config-3y1z3N2x.js +0 -118
- package/dist/media-CUdiVhEt.js +0 -1691
- package/dist/media-limits-DmcT5KnO.js +0 -14
- package/dist/media-runtime-8QR_uTs0.js +0 -295
- package/dist/media-understanding-CpMkSmKj.js +0 -51
- package/dist/media-understanding-provider-C0xVBaas.js +0 -11
- package/dist/media-understanding-provider-C8RSrdEy.js +0 -16
- package/dist/media-understanding-provider-CCB6_bwc2.js +0 -9
- package/dist/media-understanding-provider-CZ83ep6L.js +0 -16
- package/dist/media-understanding-provider-Cmcg82YY.js +0 -28
- package/dist/media-understanding-provider-D1_z5Kwx.js +0 -11
- package/dist/media-understanding-provider-DC9bhcFj.js +0 -11
- package/dist/media-understanding-provider-DbMV-bHu.js +0 -17
- package/dist/media-understanding-provider-Drg3Vyoe.js +0 -86
- package/dist/media-understanding-runtime-JIhXSD7e.js +0 -15
- package/dist/media-understanding.runtime-2Muvvak4.js +0 -7
- package/dist/media-understanding.runtime.js +0 -1
- package/dist/memory-DPYsR3Cn.js +0 -228
- package/dist/memory-core-engine-runtime-DP_nzKMm.js +0 -14
- package/dist/memory-core-host-engine-embeddings-BhsmnP-6.js +0 -1370
- package/dist/memory-core-host-engine-foundation-CtFD8jpc.js +0 -10
- package/dist/memory-core-host-engine-qmd-DCvmid82.js +0 -375
- package/dist/memory-core-host-engine-storage-N3YflxjF.js +0 -109
- package/dist/memory-core-host-multimodal-BVd6eEE3.js +0 -1
- package/dist/memory-core-host-query-Bxzu0mAD.js +0 -2
- package/dist/memory-core-host-runtime-cli-nz5fxbbn.js +0 -10
- package/dist/memory-core-host-runtime-core-BcGQFQUw.js +0 -8
- package/dist/memory-core-host-runtime-files-DO5A0pY5.js +0 -3
- package/dist/memory-core-host-secret-CQAiTACg.js +0 -1
- package/dist/memory-core-host-status-0g2XexDn.js +0 -44
- package/dist/memory-embedding-providers-BOMS0u3X.js +0 -34
- package/dist/memory-lancedb-kZBcB07O.js +0 -2
- package/dist/memory-runtime-BIGGpmaC.js +0 -2
- package/dist/memory-runtime-XyiDon5w.js +0 -34
- package/dist/memory-search-CQFSugEg.js +0 -2
- package/dist/memory-search-DpAYXyjc.js +0 -202
- package/dist/memory-state-DDJh6L4-.js +0 -41
- package/dist/mention-gating-_kzByrvM.js +0 -25
- package/dist/mentions-BCBF5Klg.js +0 -65
- package/dist/mentions-BKYgZd-C.js +0 -155
- package/dist/merge-patch-CtvE2OP0.js +0 -65
- package/dist/message-Dna6Vsdg.js +0 -205
- package/dist/message-action-discovery-CPTCAl8K.js +0 -133
- package/dist/message-action-runner-Byldnjex.js +0 -1703
- package/dist/message-channel-bEWdw4ul.js +0 -105
- package/dist/message-handler-C9TRy9hy.js +0 -1771
- package/dist/message-hook-mappers-CzwFvq_c.js +0 -255
- package/dist/messages-CQT2FDZ3.js +0 -270
- package/dist/method-scopes-B6e_KuRU.js +0 -2663
- package/dist/migrate-cli-C_iDle77.js +0 -500
- package/dist/migration-snapshot.runtime-DAzTUgU-.js +0 -3
- package/dist/migration-snapshot.runtime.js +0 -1
- package/dist/mime-DkaKoCVP.js +0 -156
- package/dist/min-host-version-CIhgRq0c.js +0 -349
- package/dist/minimax-vlm-Dh6g-MLh.js +0 -512
- package/dist/model-auth-DcCyGs_6.js +0 -377
- package/dist/model-auth-env-OT6ucjoP.js +0 -63
- package/dist/model-auth-label-fGtOs2u-.js +0 -45
- package/dist/model-auth-markers-D2z_AIuC.js +0 -70
- package/dist/model-auth-runtime-shared-DnhseQ_3.js +0 -18
- package/dist/model-buttons-zQ-cRhqo.js +0 -187
- package/dist/model-catalog-f9zO4b6C.js +0 -208
- package/dist/model-catalog.runtime-iRu_OMJS.js +0 -2
- package/dist/model-catalog.runtime.js +0 -1
- package/dist/model-definitions-BGWurJeM.js +0 -49
- package/dist/model-definitions-C-e07VgA.js +0 -255
- package/dist/model-definitions-DUANiLUG.js +0 -126
- package/dist/model-definitions-DrxdjAkB.js +0 -202
- package/dist/model-id-9W_sHLHy.js +0 -12
- package/dist/model-id-DEv7HEyl.js +0 -20
- package/dist/model-input-DwbpFRYm.js +0 -20
- package/dist/model-overrides-BaecXmMv.js +0 -84
- package/dist/model-overrides-UUODi1G1.js +0 -91
- package/dist/model-param-b-BHlbSl5R.js +0 -15
- package/dist/model-picker-BgVMnja3.js +0 -439
- package/dist/model-picker-D8elZqN_.js +0 -3
- package/dist/model-picker.runtime-BUfgRpvT.js +0 -15
- package/dist/model-picker.runtime.js +0 -1
- package/dist/model-runtime-CkjgxQmB.js +0 -1772
- package/dist/model-selection-DXY5nwui.js +0 -407
- package/dist/model-selection-Dx6Ag-ZE.js +0 -505
- package/dist/model-suppression-C8XSEnsv.js +0 -24
- package/dist/model-suppression.runtime-Dqra9AAF.js +0 -7
- package/dist/model-suppression.runtime.js +0 -1
- package/dist/models--Ze_o5z6.js +0 -193
- package/dist/models-7_w_ynp7.js +0 -35
- package/dist/models-BMmB_oQc.js +0 -130
- package/dist/models-B_TKM4gG.js +0 -18
- package/dist/models-B_UROL5b.js +0 -3
- package/dist/models-BmDGSZCK.js +0 -31
- package/dist/models-BywIyTzh.js +0 -126
- package/dist/models-C5GB-E7D.js +0 -154
- package/dist/models-DU3Lv10g.js +0 -754
- package/dist/models-VgpjMiqM.js +0 -138
- package/dist/models-_DZVZ2Na.js +0 -18
- package/dist/models-bBe0FFJe.js +0 -2550
- package/dist/models-cli-kZR11PgM.js +0 -197
- package/dist/models-config-D6j7jkCN.js +0 -2
- package/dist/models-config-lYKxSxLo.js +0 -1106
- package/dist/models-config.runtime-D2tdVUsi.js +0 -2
- package/dist/models-config.runtime.js +0 -1
- package/dist/models-emJUoDsF.js +0 -40
- package/dist/models-gPCm0Fco.js +0 -122
- package/dist/models-mi7nu17U.js +0 -99
- package/dist/models-nUP9ZPV8.js +0 -552
- package/dist/models-provider-runtime-DfIZ0cvV.js +0 -2
- package/dist/monitor-BEjwRY59.js +0 -3622
- package/dist/monitor-BiwufaF7.js +0 -718
- package/dist/monitor-BqwlHm94.js +0 -3660
- package/dist/monitor-Cj6Atk8I.js +0 -676
- package/dist/monitor-D2qBnOYz.js +0 -666
- package/dist/monitor-DZmBV1Nj2.js +0 -2
- package/dist/monitor-RMoB6sGQ.js +0 -4067
- package/dist/monitor-auth-EvlH1zbN.js +0 -192
- package/dist/monitor-lbUydC5_.js +0 -1525
- package/dist/monitor-polling.runtime-O6ZG6yYv.js +0 -307
- package/dist/monitor-polling.runtime.js +0 -1
- package/dist/monitor-provider-x4TUmYNN.js +0 -1782
- package/dist/monitor-vE0skDM1.js +0 -687
- package/dist/monitor-webhook.runtime-DoTv_oZv.js +0 -297
- package/dist/monitor-webhook.runtime.js +0 -1
- package/dist/moonshot-stream-wrappers-Csssd6kW.js +0 -24
- package/dist/moonshot-thinking-stream-wrappers-D3j6Q9Yk.js +0 -69
- package/dist/msteams-DsFLaFEV.js +0 -33
- package/dist/multimodal-DoXQtvBl.js +0 -66
- package/dist/mutable-allowlist-detectors-CbFK2eTK.js +0 -62
- package/dist/native-command-registry-B4BAqmAW.js +0 -2
- package/dist/native-command-session-targets-DfUCBY63.js +0 -10
- package/dist/net-DjzoSxQo.js +0 -265
- package/dist/network-discovery-display-h8MqTMCI.js +0 -48
- package/dist/network-mode-QjJNOXMa.js +0 -17
- package/dist/nextcloud-talk-COZ5YrPY.js +0 -18
- package/dist/node-cli-z8LHYl1w.js +0 -2323
- package/dist/node-command-policy-DoeXKD1V.js +0 -205
- package/dist/node-commands-ycnRypMq.js +0 -11
- package/dist/node-require-BgDD9bTi.js +0 -14
- package/dist/node-resolve-Drr1RIcN.js +0 -110
- package/dist/node-service-Nyf8eLc4.js +0 -68
- package/dist/node-startup-env-CVMjxAUF.js +0 -50
- package/dist/nodes-cli-BMyafV_R.js +0 -1044
- package/dist/nodes-screen-oyGHNlY5.js +0 -219
- package/dist/nodes.helpers-DKBA9twS.js +0 -203
- package/dist/normalize-C46CugdT.js +0 -35
- package/dist/normalize-reply-VrMa_PA2.js +0 -500
- package/dist/normalize-secret-input-CC9iFcnK.js +0 -32
- package/dist/nostr-DGfd-Skj.js +0 -19
- package/dist/note-B5R9zt2K.js +0 -109
- package/dist/notify-CKEt6MKY.js +0 -298
- package/dist/npm-registry-spec-dWUFCqDk.js +0 -100
- package/dist/oauth-BBIy_OBl.js +0 -152
- package/dist/oauth-DzMUt9ZO.js +0 -56
- package/dist/oauth.credentials-CKrXIXPf.js +0 -119
- package/dist/oauth.flow-Dd6MZcHS.js +0 -122
- package/dist/oauth.http-CZlbXoZD.js +0 -23
- package/dist/oauth.project-DAVNbct7.js +0 -125
- package/dist/oauth.shared-D1_wwlyt.js +0 -26
- package/dist/oauth.token-CnB-w_v2.js +0 -42
- package/dist/ollama-EE_SvO8P.js +0 -26
- package/dist/onboard-2otvb4-n.js +0 -307
- package/dist/onboard-72nGEzpd.js +0 -25
- package/dist/onboard-B14oDS4M.js +0 -23
- package/dist/onboard-BH5hcOyK.js +0 -39
- package/dist/onboard-BRkQIFt_.js +0 -25
- package/dist/onboard-BSArlkkq.js +0 -73
- package/dist/onboard-Bau_HSmO.js +0 -36
- package/dist/onboard-BsqpQhXj.js +0 -591
- package/dist/onboard-CBa7u1iZ.js +0 -25
- package/dist/onboard-CLKZrJow.js +0 -29
- package/dist/onboard-COaMJ5wS.js +0 -28
- package/dist/onboard-CbTQZti9.js +0 -48
- package/dist/onboard-Ce3rcBNR.js +0 -29
- package/dist/onboard-CiMzgSvO.js +0 -67
- package/dist/onboard-DNuWjUOg.js +0 -17
- package/dist/onboard-DY3JtOcX.js +0 -47
- package/dist/onboard-Dd_eFJ7g.js +0 -25
- package/dist/onboard-DgMI-C3P.js +0 -24
- package/dist/onboard-Dj3Kkl9C.js +0 -49
- package/dist/onboard-Djne8OY8.js +0 -34
- package/dist/onboard-DnNU28xK.js +0 -48
- package/dist/onboard-MFS79j1I.js +0 -23
- package/dist/onboard-REHqRyQm.js +0 -26
- package/dist/onboard-VVnzyvuh.js +0 -46
- package/dist/onboard-channels-B8UocRdo.js +0 -705
- package/dist/onboard-channels-Ci5QQyQ0.js +0 -2
- package/dist/onboard-config-7edS4yYd.js +0 -2
- package/dist/onboard-config-C-6p2HNL.js +0 -29
- package/dist/onboard-custom-BREC7K0s.js +0 -2
- package/dist/onboard-custom-D7oXiV6u.js +0 -646
- package/dist/onboard-helpers-BCIfy96O.js +0 -4
- package/dist/onboard-helpers-CLedS83g.js +0 -227
- package/dist/onboard-hooks-DW0gav3i.js +0 -52
- package/dist/onboard-lh38uUOa.js +0 -25
- package/dist/onboard-rH_HA9v-.js +0 -34
- package/dist/onboard-remote-DG5Rb2y7.js +0 -2
- package/dist/onboard-remote-DgDwHLCW.js +0 -193
- package/dist/onboard-search-Bz78SAON.js +0 -339
- package/dist/onboard-skills-BK1iF6NI.js +0 -2
- package/dist/onboard-skills-Cfs4Gz-d.js +0 -134
- package/dist/openai-B3atWWiZ.js +0 -21
- package/dist/openai-codex-auth-identity-blYgqX5I.js +0 -40
- package/dist/openai-codex-catalog-DQoW5ntP.js +0 -11
- package/dist/openai-codex-provider-BeX3_fQL.js +0 -254
- package/dist/openai-provider-DfSRc815.js +0 -272
- package/dist/openai-stream-wrappers-Cmn9nSYj.js +0 -338
- package/dist/openclaw-exec-env-DnTrPIdx.js +0 -17
- package/dist/openclaw-root-F1SOdmJ0.js +0 -88
- package/dist/openclaw-tools.runtime-Dx73yE1V.js +0 -2
- package/dist/openclaw-tools.runtime.js +0 -1
- package/dist/operator-approvals-client-NQtGN5k_.js +0 -33
- package/dist/order-DNBhjW6F.js +0 -744
- package/dist/origin-routing-BC2EzQqM.js +0 -15
- package/dist/origin-routing-BVUTLJGu.js +0 -2
- package/dist/os-summary-CdlXkpL1.js +0 -26
- package/dist/outbound-adapter-D6WGzS7P.js +0 -183
- package/dist/outbound-ek4CqhT2.js +0 -2
- package/dist/outbound-hgMEZIU9.js +0 -2739
- package/dist/outbound-media-B2ZrkOxl.js +0 -15
- package/dist/outbound-runtime-CtDmQy3z.js +0 -2
- package/dist/outbound-send-deps-COPf3lwV.js +0 -7
- package/dist/outbound-session-DHKvttsz.js +0 -41
- package/dist/pairing-challenge-O7jo1Q5R.js +0 -33
- package/dist/pairing-cli-BEUxC5EH.js +0 -116
- package/dist/pairing-labels-Cj1fFxG9.js +0 -7
- package/dist/pairing-message-FaqHPEFk.js +0 -4
- package/dist/pairing-messages-DxLpe0GE.js +0 -23
- package/dist/pairing-pending-DGyUpmjC.js +0 -14
- package/dist/pairing-store-B171dUVa.js +0 -617
- package/dist/pairing-token-CnyXOU__.js +0 -88
- package/dist/param-readers-CqAoT2n2.js +0 -2
- package/dist/parse-duration-D9q1V0xx.js +0 -41
- package/dist/parse-finite-number-CzdLC_gQ.js +0 -30
- package/dist/parse-json-compat-DfjRYtKX.js +0 -11
- package/dist/parse-log-line-Cd0JHPGg.js +0 -43
- package/dist/parse-port-BFmNhrtE.js +0 -8
- package/dist/parse-timeout-bktz0495.js +0 -27
- package/dist/path-alias-guards-BeOn9PZR.js +0 -40
- package/dist/path-env-C2F1kvna.js +0 -87
- package/dist/path-safety-2mfHCe0n.js +0 -12
- package/dist/paths-Bw8Ci57u.js +0 -2
- package/dist/paths-GWMNxnBn.js +0 -201
- package/dist/paths-xpks599B.js +0 -180
- package/dist/payload-S8niBCaz.js +0 -90
- package/dist/pdf-extract-Cm83kt2M.js +0 -73
- package/dist/perplexity-web-search-provider-Cgr2BYVk.js +0 -423
- package/dist/persistent-bindings.lifecycle-CAOm8v8I.js +0 -159
- package/dist/persistent-dedupe-DoNHVMWs.js +0 -116
- package/dist/pi-embedded-DEAtCIdT.js +0 -40616
- package/dist/pi-embedded-helpers-BVjvCsor.js +0 -1733
- package/dist/pi-embedded.runtime-Ctj3QFs-.js +0 -4
- package/dist/pi-embedded.runtime.js +0 -1
- package/dist/pi-model-discovery-KjI5xf8m.js +0 -188
- package/dist/pi-settings-BJzoHYF9.js +0 -57
- package/dist/pi-tools.before-tool-call.runtime-DJ6s0GDV.js +0 -354
- package/dist/pi-tools.before-tool-call.runtime.js +0 -1
- package/dist/plugin-auto-enable-BZvicayR.js +0 -400
- package/dist/plugin-entry-D0vhddM4.js +0 -25
- package/dist/plugin-entry.runtime-Xd644UDA.js +0 -112
- package/dist/plugin-entry.runtime.js +0 -1
- package/dist/plugin-error-boundary-RI4ByQoA.js +0 -55
- package/dist/plugin-error-handler-DWUTf_UF.js +0 -109
- package/dist/plugin-health-checker-2c6LyJwr.js +0 -125
- package/dist/plugin-hot-reload-CA3__dZN.js +0 -215
- package/dist/plugin-install-BjVLwj7-.js +0 -230
- package/dist/plugin-install-CjwMt13j.js +0 -2
- package/dist/plugin-install-config-policy-MApev-w-.js +0 -93
- package/dist/plugin-install-path-warnings-BkBH-k4n.js +0 -40
- package/dist/plugin-install-plan-0fWhyVBN.js +0 -50
- package/dist/plugin-registry-CORVyKHv.js +0 -74
- package/dist/plugin-registry-Dl1iIh7W.js +0 -2
- package/dist/plugin-runtime-Dd1YN95W.js +0 -6
- package/dist/plugin-sdk/account-core.js +0 -8
- package/dist/plugin-sdk/account-helpers.js +0 -4
- package/dist/plugin-sdk/account-id.js +0 -3
- package/dist/plugin-sdk/account-resolution.js +0 -12
- package/dist/plugin-sdk/acp-runtime.js +0 -3
- package/dist/plugin-sdk/agent-config-primitives.js +0 -3
- package/dist/plugin-sdk/agent-runtime.js +0 -29
- package/dist/plugin-sdk/allow-from.js +0 -5
- package/dist/plugin-sdk/allowlist-config-edit.js +0 -2
- package/dist/plugin-sdk/amazon-bedrock.js +0 -15
- package/dist/plugin-sdk/anthropic-vertex.js +0 -2
- package/dist/plugin-sdk/approval-runtime.js +0 -8
- package/dist/plugin-sdk/bluebubbles-policy.js +0 -2
- package/dist/plugin-sdk/bluebubbles.js +0 -39
- package/dist/plugin-sdk/boolean-param.js +0 -2
- package/dist/plugin-sdk/browser-runtime.js +0 -3
- package/dist/plugin-sdk/browser-support.js +0 -44
- package/dist/plugin-sdk/browser.js +0 -15
- package/dist/plugin-sdk/byteplus.js +0 -17
- package/dist/plugin-sdk/channel-actions.js +0 -3
- package/dist/plugin-sdk/channel-config-helpers.js +0 -2
- package/dist/plugin-sdk/channel-config-primitives.js +0 -4
- package/dist/plugin-sdk/channel-config-schema.js +0 -7
- package/dist/plugin-sdk/channel-config-writes.js +0 -3
- package/dist/plugin-sdk/channel-contract.js +0 -1
- package/dist/plugin-sdk/channel-feedback.js +0 -5
- package/dist/plugin-sdk/channel-inbound.js +0 -10
- package/dist/plugin-sdk/channel-lifecycle.js +0 -3
- package/dist/plugin-sdk/channel-pairing.js +0 -2
- package/dist/plugin-sdk/channel-policy.js +0 -6
- package/dist/plugin-sdk/channel-reply-pipeline.js +0 -2
- package/dist/plugin-sdk/channel-runtime.js +0 -16
- package/dist/plugin-sdk/channel-send-result.js +0 -2
- package/dist/plugin-sdk/channel-setup.js +0 -5
- package/dist/plugin-sdk/channel-status.js +0 -5
- package/dist/plugin-sdk/channel-targets.js +0 -5
- package/dist/plugin-sdk/chutes.js +0 -20
- package/dist/plugin-sdk/cli-backend.js +0 -3
- package/dist/plugin-sdk/cli-runtime.js +0 -7
- package/dist/plugin-sdk/cloudflare-ai-gateway.js +0 -18
- package/dist/plugin-sdk/collection-runtime.js +0 -3
- package/dist/plugin-sdk/command-auth-native.js +0 -6
- package/dist/plugin-sdk/command-auth.js +0 -14
- package/dist/plugin-sdk/command-detection.js +0 -3
- package/dist/plugin-sdk/command-surface.js +0 -3
- package/dist/plugin-sdk/compat.js +0 -35
- package/dist/plugin-sdk/config-runtime.js +0 -25
- package/dist/plugin-sdk/conversation-runtime.js +0 -15
- package/dist/plugin-sdk/core.js +0 -22
- package/dist/plugin-sdk/dangerous-name-runtime.js +0 -3
- package/dist/plugin-sdk/deepseek.js +0 -14
- package/dist/plugin-sdk/device-bootstrap.js +0 -4
- package/dist/plugin-sdk/diagnostic-runtime.js +0 -4
- package/dist/plugin-sdk/diagnostics-otel.js +0 -6
- package/dist/plugin-sdk/diffs.js +0 -4
- package/dist/plugin-sdk/direct-dm.js +0 -2
- package/dist/plugin-sdk/directory-runtime.js +0 -5
- package/dist/plugin-sdk/discord-account.js +0 -2
- package/dist/plugin-sdk/discord-core.js +0 -9
- package/dist/plugin-sdk/discord-runtime-surface.js +0 -2
- package/dist/plugin-sdk/discord-session-key.js +0 -2
- package/dist/plugin-sdk/discord-surface.js +0 -2
- package/dist/plugin-sdk/discord-thread-bindings.js +0 -2
- package/dist/plugin-sdk/discord-timeouts.js +0 -2
- package/dist/plugin-sdk/discord.js +0 -21
- package/dist/plugin-sdk/error-runtime.js +0 -3
- package/dist/plugin-sdk/extension-shared.js +0 -3
- package/dist/plugin-sdk/feishu-conversation.js +0 -2
- package/dist/plugin-sdk/feishu-setup.js +0 -2
- package/dist/plugin-sdk/feishu.js +0 -34
- package/dist/plugin-sdk/fetch-runtime.js +0 -7
- package/dist/plugin-sdk/file-lock.js +0 -2
- package/dist/plugin-sdk/gateway-runtime.js +0 -4
- package/dist/plugin-sdk/github-copilot-login.js +0 -2
- package/dist/plugin-sdk/github-copilot-token.js +0 -3
- package/dist/plugin-sdk/global-singleton.js +0 -4
- package/dist/plugin-sdk/google.js +0 -2
- package/dist/plugin-sdk/googlechat.js +0 -38
- package/dist/plugin-sdk/group-access.js +0 -2
- package/dist/plugin-sdk/hook-runtime.js +0 -4
- package/dist/plugin-sdk/host-runtime.js +0 -4
- package/dist/plugin-sdk/huggingface.js +0 -18
- package/dist/plugin-sdk/image-generation-core.js +0 -63
- package/dist/plugin-sdk/image-generation.js +0 -2
- package/dist/plugin-sdk/index.js +0 -5
- package/dist/plugin-sdk/infra-runtime.js +0 -45
- package/dist/plugin-sdk/interactive-runtime.js +0 -4
- package/dist/plugin-sdk/irc-surface.js +0 -2
- package/dist/plugin-sdk/irc.js +0 -30
- package/dist/plugin-sdk/json-store.js +0 -3
- package/dist/plugin-sdk/keyed-async-queue.js +0 -2
- package/dist/plugin-sdk/kilocode.js +0 -23
- package/dist/plugin-sdk/kimi-coding.js +0 -11
- package/dist/plugin-sdk/lazy-runtime.js +0 -3
- package/dist/plugin-sdk/line-core.js +0 -6
- package/dist/plugin-sdk/line-runtime.js +0 -2
- package/dist/plugin-sdk/line-surface.js +0 -2
- package/dist/plugin-sdk/line.js +0 -9
- package/dist/plugin-sdk/llm-task.js +0 -6
- package/dist/plugin-sdk/logging-core.js +0 -5
- package/dist/plugin-sdk/markdown-table-runtime.js +0 -3
- package/dist/plugin-sdk/matrix-helper.js +0 -2
- package/dist/plugin-sdk/matrix-runtime-heavy.js +0 -5
- package/dist/plugin-sdk/matrix-runtime-shared.js +0 -3
- package/dist/plugin-sdk/matrix-runtime-surface.js +0 -2
- package/dist/plugin-sdk/matrix-surface.js +0 -2
- package/dist/plugin-sdk/matrix-thread-bindings.js +0 -2
- package/dist/plugin-sdk/matrix.js +0 -53
- package/dist/plugin-sdk/mattermost-policy.js +0 -11
- package/dist/plugin-sdk/mattermost.js +0 -41
- package/dist/plugin-sdk/media-runtime.js +0 -17
- package/dist/plugin-sdk/media-understanding-runtime.js +0 -2
- package/dist/plugin-sdk/media-understanding.js +0 -3
- package/dist/plugin-sdk/memory-core-engine-runtime.js +0 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +0 -6
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +0 -17
- package/dist/plugin-sdk/memory-core-host-engine-qmd.js +0 -3
- package/dist/plugin-sdk/memory-core-host-engine-storage.js +0 -4
- package/dist/plugin-sdk/memory-core-host-multimodal.js +0 -3
- package/dist/plugin-sdk/memory-core-host-query.js +0 -3
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +0 -12
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +0 -14
- package/dist/plugin-sdk/memory-core-host-runtime-files.js +0 -4
- package/dist/plugin-sdk/memory-core-host-secret.js +0 -3
- package/dist/plugin-sdk/memory-core-host-status.js +0 -2
- package/dist/plugin-sdk/memory-core.js +0 -29
- package/dist/plugin-sdk/memory-lancedb.js +0 -4
- package/dist/plugin-sdk/minimax.js +0 -24
- package/dist/plugin-sdk/mistral.js +0 -17
- package/dist/plugin-sdk/models-provider-runtime.js +0 -3
- package/dist/plugin-sdk/modelstudio-definitions.js +0 -19
- package/dist/plugin-sdk/modelstudio.js +0 -24
- package/dist/plugin-sdk/moonshot.js +0 -17
- package/dist/plugin-sdk/msteams.js +0 -46
- package/dist/plugin-sdk/native-command-registry.js +0 -3
- package/dist/plugin-sdk/nextcloud-talk.js +0 -35
- package/dist/plugin-sdk/nostr.js +0 -14
- package/dist/plugin-sdk/nvidia.js +0 -11
- package/dist/plugin-sdk/ollama-surface.js +0 -24
- package/dist/plugin-sdk/ollama.js +0 -2
- package/dist/plugin-sdk/openai.js +0 -2
- package/dist/plugin-sdk/opencode-go.js +0 -14
- package/dist/plugin-sdk/opencode.js +0 -15
- package/dist/plugin-sdk/outbound-runtime.js +0 -5
- package/dist/plugin-sdk/param-readers.js +0 -3
- package/dist/plugin-sdk/plugin-entry.js +0 -3
- package/dist/plugin-sdk/plugin-runtime.js +0 -8
- package/dist/plugin-sdk/process-runtime.js +0 -3
- package/dist/plugin-sdk/provider-auth-api-key.js +0 -9
- package/dist/plugin-sdk/provider-auth-login.js +0 -2
- package/dist/plugin-sdk/provider-auth-result.js +0 -2
- package/dist/plugin-sdk/provider-auth-runtime.js +0 -5
- package/dist/plugin-sdk/provider-auth.js +0 -17
- package/dist/plugin-sdk/provider-catalog-shared.js +0 -2
- package/dist/plugin-sdk/provider-entry.js +0 -2
- package/dist/plugin-sdk/provider-env-vars.js +0 -3
- package/dist/plugin-sdk/provider-http.js +0 -6
- package/dist/plugin-sdk/provider-model-shared.js +0 -5
- package/dist/plugin-sdk/provider-moonshot.js +0 -3
- package/dist/plugin-sdk/provider-onboard.js +0 -3
- package/dist/plugin-sdk/provider-setup.js +0 -3
- package/dist/plugin-sdk/provider-stream.js +0 -4
- package/dist/plugin-sdk/provider-tools.js +0 -2
- package/dist/plugin-sdk/provider-usage.js +0 -3
- package/dist/plugin-sdk/provider-web-fetch.js +0 -6
- package/dist/plugin-sdk/provider-web-search.js +0 -7
- package/dist/plugin-sdk/provider-zai-endpoint.js +0 -2
- package/dist/plugin-sdk/qianfan.js +0 -13
- package/dist/plugin-sdk/reply-chunking.js +0 -4
- package/dist/plugin-sdk/reply-dispatch-runtime.js +0 -5
- package/dist/plugin-sdk/reply-history.js +0 -3
- package/dist/plugin-sdk/reply-payload.js +0 -2
- package/dist/plugin-sdk/reply-runtime.js +0 -14
- package/dist/plugin-sdk/request-url.js +0 -2
- package/dist/plugin-sdk/retry-runtime.js +0 -4
- package/dist/plugin-sdk/root-alias.cjs +0 -347
- package/dist/plugin-sdk/routing.js +0 -9
- package/dist/plugin-sdk/runtime-config-snapshot.js +0 -3
- package/dist/plugin-sdk/runtime-env.js +0 -17
- package/dist/plugin-sdk/runtime-group-policy.js +0 -3
- package/dist/plugin-sdk/runtime-store.js +0 -2
- package/dist/plugin-sdk/runtime.js +0 -9
- package/dist/plugin-sdk/sandbox.js +0 -6
- package/dist/plugin-sdk/secret-input.js +0 -4
- package/dist/plugin-sdk/security-runtime.js +0 -6
- package/dist/plugin-sdk/self-hosted-provider-setup.js +0 -2
- package/dist/plugin-sdk/session-store-runtime.js +0 -4
- package/dist/plugin-sdk/setup-adapter-runtime.js +0 -3
- package/dist/plugin-sdk/setup-runtime.js +0 -6
- package/dist/plugin-sdk/setup-tools.js +0 -6
- package/dist/plugin-sdk/setup.js +0 -13
- package/dist/plugin-sdk/sglang.js +0 -15
- package/dist/plugin-sdk/signal-account.js +0 -2
- package/dist/plugin-sdk/signal-surface.js +0 -2
- package/dist/plugin-sdk/signal.js +0 -24
- package/dist/plugin-sdk/skill-commands-runtime.js +0 -3
- package/dist/plugin-sdk/slack-account.js +0 -2
- package/dist/plugin-sdk/slack-core.js +0 -7
- package/dist/plugin-sdk/slack-runtime-surface.js +0 -2
- package/dist/plugin-sdk/slack-surface.js +0 -2
- package/dist/plugin-sdk/slack-target-parser.js +0 -2
- package/dist/plugin-sdk/slack-targets.js +0 -3
- package/dist/plugin-sdk/slack.js +0 -20
- package/dist/plugin-sdk/speech-core.js +0 -4
- package/dist/plugin-sdk/speech-runtime.js +0 -2
- package/dist/plugin-sdk/speech.js +0 -5
- package/dist/plugin-sdk/ssrf-runtime.js +0 -6
- package/dist/plugin-sdk/state-paths.js +0 -3
- package/dist/plugin-sdk/status-helpers.js +0 -4
- package/dist/plugin-sdk/string-normalization-runtime.js +0 -3
- package/dist/plugin-sdk/synthetic.js +0 -17
- package/dist/plugin-sdk/telegram-account.js +0 -2
- package/dist/plugin-sdk/telegram-allow-from.js +0 -12
- package/dist/plugin-sdk/telegram-command-config.js +0 -3
- package/dist/plugin-sdk/telegram-core.js +0 -18
- package/dist/plugin-sdk/telegram-surface.js +0 -42
- package/dist/plugin-sdk/temp-path.js +0 -4
- package/dist/plugin-sdk/testing.js +0 -11
- package/dist/plugin-sdk/text-runtime.js +0 -19
- package/dist/plugin-sdk/thread-bindings-runtime.js +0 -4
- package/dist/plugin-sdk/thread-ownership.js +0 -5
- package/dist/plugin-sdk/tlon.js +0 -13
- package/dist/plugin-sdk/together.js +0 -16
- package/dist/plugin-sdk/tool-send.js +0 -2
- package/dist/plugin-sdk/twitch.js +0 -8
- package/dist/plugin-sdk/venice.js +0 -16
- package/dist/plugin-sdk/vllm.js +0 -15
- package/dist/plugin-sdk/voice-call.js +0 -7
- package/dist/plugin-sdk/volcengine.js +0 -17
- package/dist/plugin-sdk/web-media.js +0 -4
- package/dist/plugin-sdk/webhook-ingress.js +0 -9
- package/dist/plugin-sdk/webhook-path.js +0 -2
- package/dist/plugin-sdk/webhook-request-guards.js +0 -3
- package/dist/plugin-sdk/whatsapp-auth-presence.js +0 -2
- package/dist/plugin-sdk/whatsapp-core.js +0 -11
- package/dist/plugin-sdk/whatsapp-shared.js +0 -5
- package/dist/plugin-sdk/whatsapp-surface.js +0 -2
- package/dist/plugin-sdk/whatsapp-targets.js +0 -2
- package/dist/plugin-sdk/windows-spawn.js +0 -2
- package/dist/plugin-sdk/xai.js +0 -27
- package/dist/plugin-sdk/zalo-setup.js +0 -2
- package/dist/plugin-sdk/zalo.js +0 -38
- package/dist/plugin-sdk/zalouser.js +0 -29
- package/dist/plugin-sdk/zod.js +0 -3
- package/dist/plugins/build-smoke-entry.js +0 -4
- package/dist/plugins/provider-runtime.runtime.js +0 -2
- package/dist/plugins/runtime/index.js +0 -2
- package/dist/plugins/runtime/runtime-line.contract.js +0 -23
- package/dist/plugins-DcjzAZWt.js +0 -5
- package/dist/plugins-allowlist-DoZlIC4p.js +0 -14
- package/dist/plugins-cli-G6GhHHD0.js +0 -561
- package/dist/plugins-command-helpers-CIYzoC65.js +0 -116
- package/dist/plugins-install-persist-C5-bJdRb.js +0 -121
- package/dist/plugins-update-command-CsT_saJm.js +0 -974
- package/dist/plugins-w6xUzHby.js +0 -40
- package/dist/pluralkit-B_DWQnc5.js +0 -21
- package/dist/pluralkit-Bez5QVFC.js +0 -2
- package/dist/policy-D6OQdw73.js +0 -173
- package/dist/policy-DXeeH8B2.js +0 -147
- package/dist/poll-params-DTVSSuok.js +0 -52
- package/dist/polls-CMmT0F_y.js +0 -35
- package/dist/port-defaults-Dajs4Obu.js +0 -30
- package/dist/ports-DuU-A86K.js +0 -262
- package/dist/ports-ZA1n2It7.js +0 -432
- package/dist/ports-lsof-Cw_6T7ru.js +0 -25
- package/dist/ports-probe-DeuK48Pq.js +0 -14
- package/dist/preflight-audio-DTSBExi8.js +0 -48
- package/dist/preflight-audio.runtime-BJRLyBvf.js +0 -7
- package/dist/preflight-audio.runtime.js +0 -1
- package/dist/prepare-BQBndJUC.js +0 -1301
- package/dist/probe-BO4hbHvs.js +0 -435
- package/dist/probe-DPv2pfj5.js +0 -1868
- package/dist/probe-DlO2Q9rN.js +0 -170
- package/dist/probe-RbbTQOHx.js +0 -178
- package/dist/probe-auth-Bl9MHtlP.js +0 -2
- package/dist/probe-auth-CUfEH7di.js +0 -63
- package/dist/probe-eYLpFww_.js +0 -137
- package/dist/probe-kfBMuOWF.js +0 -2
- package/dist/probe-wktb4WTP.js +0 -349
- package/dist/probe.runtime-BhbUesak.js +0 -2
- package/dist/probe.runtime.js +0 -1
- package/dist/process-runtime-CBFMzhIk.js +0 -2
- package/dist/process-scoped-map-C7IoOrV-.js +0 -61
- package/dist/profile-B5n9yLlB.js +0 -2
- package/dist/profile-CmsqnPsu.js +0 -107
- package/dist/profile-update-D6f10CZk.js +0 -67
- package/dist/profile-utils-C7uzTwgJ.js +0 -15
- package/dist/profiles-BoNergZo.js +0 -79
- package/dist/program-BuKG0Ntx.js +0 -158
- package/dist/program-context-DDmlbmbl.js +0 -2
- package/dist/program-context-DQOnR5c_.js +0 -10
- package/dist/progress-DQvXYKne.js +0 -132
- package/dist/prompt-COzf5LIJ.js +0 -2
- package/dist/prompt-OSmU-o7R.js +0 -20
- package/dist/prompt-select-styled-yYL3el77.js +0 -6432
- package/dist/prompt-style-DekFM6h7.js +0 -7
- package/dist/prompts-MtRTsZpw.js +0 -9
- package/dist/prototype-keys-DrjhYNcz.js +0 -11
- package/dist/provider-BWTXmDq3.js +0 -3685
- package/dist/provider-BrmcrkEe.js +0 -70
- package/dist/provider-ByBRbhW5.js +0 -7216
- package/dist/provider-api-key-auth-BcyipSdy.js +0 -109
- package/dist/provider-api-key-auth.runtime-BRu_8L4m.js +0 -14
- package/dist/provider-api-key-auth.runtime.js +0 -1
- package/dist/provider-attribution-DMVujx9B.js +0 -285
- package/dist/provider-auth-DK2UmYsZ.js +0 -43
- package/dist/provider-auth-api-key-99KxscjW.js +0 -5
- package/dist/provider-auth-choice-GbHta8Bp.js +0 -134
- package/dist/provider-auth-choice-helpers-CO2MnSGR.js +0 -58
- package/dist/provider-auth-choice-preference-DvAqSMGK.js +0 -44
- package/dist/provider-auth-choice.runtime-B8R63sLq.js +0 -14
- package/dist/provider-auth-choice.runtime-DypTKgMQ.js +0 -2
- package/dist/provider-auth-choice.runtime.js +0 -1
- package/dist/provider-auth-choices-n-JV1XgU.js +0 -65
- package/dist/provider-auth-guidance-DAB9sGGR.js +0 -35
- package/dist/provider-auth-helpers-gmTAji1W.js +0 -92
- package/dist/provider-auth-input-GgY_tjJh.js +0 -116
- package/dist/provider-auth-login-BYbccnB1.js +0 -8
- package/dist/provider-auth-login.runtime-DnSxCwqU.js +0 -196
- package/dist/provider-auth-login.runtime.js +0 -1
- package/dist/provider-auth-mode-Dbja5LLX.js +0 -20
- package/dist/provider-auth-ref-BErMfwCd.js +0 -171
- package/dist/provider-auth-ref-DEF_hE2R.js +0 -2
- package/dist/provider-auth-result-DiUxDF1G.js +0 -31
- package/dist/provider-auth-runtime-BwMq9oMD.js +0 -32
- package/dist/provider-catalog--Qc0q0I-.js +0 -26
- package/dist/provider-catalog-A_s8JQaq.js +0 -18
- package/dist/provider-catalog-B-EcLvBI.js +0 -11
- package/dist/provider-catalog-Bte-HucL.js +0 -44
- package/dist/provider-catalog-C63Rfat7.js +0 -11
- package/dist/provider-catalog-C7q0Vb3S.js +0 -95
- package/dist/provider-catalog-CCnuf8d3.js +0 -49
- package/dist/provider-catalog-CYQ7k_Db.js +0 -48
- package/dist/provider-catalog-CnlB2mMZ.js +0 -11
- package/dist/provider-catalog-CoyAbDZX.js +0 -56
- package/dist/provider-catalog-CtqhFopw.js +0 -48
- package/dist/provider-catalog-CyGxB_aR.js +0 -18
- package/dist/provider-catalog-D1pmWiDQ.js +0 -48
- package/dist/provider-catalog-DGgsalJv.js +0 -12
- package/dist/provider-catalog-DLdTTMmW.js +0 -11
- package/dist/provider-catalog-DZzX7Vwk.js +0 -54
- package/dist/provider-catalog-J2dZciKS.js +0 -11
- package/dist/provider-catalog-LVrcrz-W.js +0 -36
- package/dist/provider-catalog-aIN0QojF.js +0 -11
- package/dist/provider-catalog-shared-Db9nbr1B.js +0 -28
- package/dist/provider-discovery.runtime-BCUAsMMz.js +0 -10
- package/dist/provider-discovery.runtime.js +0 -1
- package/dist/provider-dispatcher-COxXbow_.js +0 -22
- package/dist/provider-entry-CT_YeII_.js +0 -86
- package/dist/provider-env-vars-4Bon7Y2X.js +0 -121
- package/dist/provider-env-vars-Np7qkDjC.js +0 -2
- package/dist/provider-flow-Dlg1GcXQ.js +0 -93
- package/dist/provider-http-DQQ317hc.js +0 -3
- package/dist/provider-id-CHzLB538.js +0 -30
- package/dist/provider-model-defaults-dSPzPas0.js +0 -5
- package/dist/provider-model-primary-D8SgLcOd.js +0 -26
- package/dist/provider-model-shared-GO1WT2fY.js +0 -104
- package/dist/provider-models-BG8YwJaY.js +0 -117
- package/dist/provider-models-BVVCdM8F.js +0 -22
- package/dist/provider-models-D2UZvTo3.js +0 -46
- package/dist/provider-moonshot-Cl8urWHL.js +0 -2
- package/dist/provider-oauth-flow-Bu2gIeX6.js +0 -33
- package/dist/provider-onboard-CTEHTjfw.js +0 -264
- package/dist/provider-openai-codex-oauth-tls-DdLUDuIM.js +0 -101
- package/dist/provider-registry-Ljtt6CKE.js +0 -49
- package/dist/provider-request-config-CIrbwAnR.js +0 -209
- package/dist/provider-runtime-BBFXlsU0.js +0 -2
- package/dist/provider-runtime-D_itmv9t.js +0 -291
- package/dist/provider-runtime.runtime-B_oC992d.js +0 -26
- package/dist/provider-runtime.runtime.js +0 -1
- package/dist/provider-self-hosted-setup-BlNrSREL.js +0 -272
- package/dist/provider-session.runtime-DQyRV-t3.js +0 -7
- package/dist/provider-session.runtime.js +0 -1
- package/dist/provider-setup-CSrOyU04.js +0 -2
- package/dist/provider-stream-m5D8QZPz.js +0 -289
- package/dist/provider-tools-NuJzTqa1.js +0 -37
- package/dist/provider-usage-BB5mQ8Fg.js +0 -3
- package/dist/provider-usage-CbPs3eFQ.js +0 -2
- package/dist/provider-usage-DG1gff_M.js +0 -375
- package/dist/provider-usage.fetch-DHWQ4YZu.js +0 -633
- package/dist/provider-web-fetch-QzED2vth.js +0 -5
- package/dist/provider-web-search-CVMEZcl8.js +0 -306
- package/dist/provider-wizard-B0ocsg3q.js +0 -209
- package/dist/provider-zai-endpoint-DoIy5HQf.js +0 -116
- package/dist/provider.runtime-jHt6447e.js +0 -2
- package/dist/provider.runtime.js +0 -1
- package/dist/providers-DUy2TaM-.js +0 -59
- package/dist/providers.runtime-Bz0X8DZ2.js +0 -60
- package/dist/providers.runtime.js +0 -1
- package/dist/proxy-env-D4H9qI5l.js +0 -40
- package/dist/proxy-fetch-DiyTLcAR.js +0 -55
- package/dist/proxy-hcRRmsDd.js +0 -121
- package/dist/pw-ai-Cp64-UGh.js +0 -2037
- package/dist/qmd-manager-D2rMomsU.js +0 -1740
- package/dist/qr-cli-DuANCi-n.js +0 -2
- package/dist/qr-cli-lr5CcLr8.js +0 -367
- package/dist/qr-image-DOcoqAUw.js +0 -2
- package/dist/query-expansion-85HlYbKD.js +0 -633
- package/dist/queue-CtO0M_P1.js +0 -663
- package/dist/reaction-runtime-api-B4KmfKtJ.js +0 -114
- package/dist/reactions-5N2KSGJ2.js +0 -258
- package/dist/read-only-account-inspect-Y_ijOKJ3.js +0 -9
- package/dist/read-only-account-inspect.telegram-BSjjDWnM.js +0 -202
- package/dist/reasoning-tags-CAmbBXLr.js +0 -77
- package/dist/recovery-key-store-DqgdfMc7.js +0 -283
- package/dist/redact-BDinS1q9.js +0 -102
- package/dist/redact-identifier-S69DDJn1.js +0 -13
- package/dist/redact-sensitive-url-CAJSZ_7g.js +0 -50
- package/dist/redirect-headers-CGxONG_L.js +0 -25
- package/dist/ref-contract-CC5BLDoS.js +0 -53
- package/dist/region-BFGEM88n.js +0 -62
- package/dist/register-lazy-command-D6EEI-zz.js +0 -43
- package/dist/register.agent-D1eKwVU7.js +0 -239
- package/dist/register.backup-S8hwHpZL.js +0 -236
- package/dist/register.configure-CJrQ3u9y.js +0 -15
- package/dist/register.maintenance-BrKWl7_D.js +0 -449
- package/dist/register.message-BCWJfH2h.js +0 -642
- package/dist/register.onboard-zzNq0pJS.js +0 -79
- package/dist/register.setup-BLQwDKzc.js +0 -104
- package/dist/register.status-health-sessions-B4TUEudf.js +0 -1206
- package/dist/register.subclis-B0pG22H2.js +0 -295
- package/dist/register.subclis-BEM0mzJb.js +0 -3
- package/dist/registry-ByjnKj3u.js +0 -219
- package/dist/registry-CuFNdbH5.js +0 -60
- package/dist/registry-DvqOrcbF.js +0 -675
- package/dist/registry-mVzzlPf7.js +0 -50
- package/dist/repair-IMBZnz-L.js +0 -112
- package/dist/replies-BCoZ2HxY.js +0 -118
- package/dist/reply-D8bUQd-Q.js +0 -3176
- package/dist/reply-blocks-CjCUTZru.js +0 -103
- package/dist/reply-chunking-CxFd5izq.js +0 -3
- package/dist/reply-dispatch-runtime-Bk9RDzB9.js +0 -3
- package/dist/reply-history-DtTaPEgt.js +0 -2
- package/dist/reply-payload-CRYI4jIB.js +0 -232
- package/dist/reply-payloads-CQXH7ury.js +0 -116
- package/dist/reply-payloads-dedupe-BKObDjVe.js +0 -135
- package/dist/reply-payloads-dedupe.runtime-SbVNMvEs.js +0 -2
- package/dist/reply-payloads-dedupe.runtime.js +0 -1
- package/dist/reply-prefix-Eema_xXG.js +0 -39
- package/dist/reply-runtime-DUrpJTzu.js +0 -123
- package/dist/reply.runtime-Cdb_6NI1.js +0 -2
- package/dist/reply.runtime.js +0 -1
- package/dist/request-url-B8k-YRRH.js +0 -10
- package/dist/resolve-C3pJ2gj_.js +0 -174
- package/dist/resolve-C_pCWwC0.js +0 -619
- package/dist/resolve-allowlist-HrJ_3icS.js +0 -147
- package/dist/resolve-cbCi7mbs.js +0 -2
- package/dist/resolve-channels-BTyErRev.js +0 -226
- package/dist/resolve-channels-DvV-fUQv.js +0 -263
- package/dist/resolve-configured-secret-input-string-BasQGOd9.js +0 -112
- package/dist/resolve-route-EE8E7OAF.js +0 -486
- package/dist/resolve-system-bin-TC907QYo.js +0 -120
- package/dist/resolve-targets-B1MvBWpT.js +0 -280
- package/dist/resolve-users-BfVoBZG_.js +0 -145
- package/dist/resolve-utils-ClmKSkEQ.js +0 -102
- package/dist/response-generator-ACP21F1j.js +0 -153
- package/dist/response-prefix-template-Cp4tg6Qw.js +0 -50
- package/dist/restart-sentinel-B3EigRIb.js +0 -70
- package/dist/restart-stale-pids-dsB3eE6_.js +0 -187
- package/dist/retry-CIAqcw7C.js +0 -76
- package/dist/retry-policy-BJ5Q68It.js +0 -58
- package/dist/retry-runtime-Cbu5zDnX.js +0 -3
- package/dist/rooms-B1IyUfuR.js +0 -325
- package/dist/root-help-Bwa-vlhy.js +0 -53
- package/dist/route-reply-bC07YRDb.js +0 -133
- package/dist/route-reply.runtime-dS2XMwkv.js +0 -2
- package/dist/route-reply.runtime.js +0 -1
- package/dist/route-resolution-DQHmIfWN.js +0 -461
- package/dist/routes-CWXihJFR.js +0 -6884
- package/dist/routing-BVt9nMN-.js +0 -16
- package/dist/rpc-5eaI-FsF.js +0 -67
- package/dist/rpc-context-Dimdo4io.js +0 -155
- package/dist/run-command-2jxKF1a6.js +0 -32
- package/dist/run-main-BKeNUaXq.js +0 -425
- package/dist/run-with-concurrency-DGLkItan.js +0 -41
- package/dist/runner-COmi-bB0.js +0 -1479
- package/dist/runs-CX-70k4f.js +0 -616
- package/dist/runtime-1phb9iVo.js +0 -6
- package/dist/runtime-B8hqEtu6.js +0 -181
- package/dist/runtime-BpHrcXgA.js +0 -5
- package/dist/runtime-BscSIjIL.js +0 -126
- package/dist/runtime-C8qvwPYG.js +0 -286
- package/dist/runtime-CBX_rq4O.js +0 -18
- package/dist/runtime-CC1YDOst.js +0 -5
- package/dist/runtime-CIE7xJwu.js +0 -5
- package/dist/runtime-CNZi_czi.js +0 -42
- package/dist/runtime-CPw-0dWW.js +0 -5
- package/dist/runtime-DXdxDbJm.js +0 -102
- package/dist/runtime-DofOSZ5U.js +0 -2153
- package/dist/runtime-api-B4Zb5p1_.js +0 -2
- package/dist/runtime-api-BB2RZPnq.js +0 -2
- package/dist/runtime-api-BJnw1_pK.js +0 -2
- package/dist/runtime-api-BTf2rLCn.js +0 -2
- package/dist/runtime-api-BTgAUySz.js +0 -2
- package/dist/runtime-api-BVftCkYc.js +0 -2484
- package/dist/runtime-api-BWaVsvsK.js +0 -14
- package/dist/runtime-api-BXlE282E.js +0 -2
- package/dist/runtime-api-Ba7wWBWO.js +0 -1
- package/dist/runtime-api-BfZqvwkY.js +0 -2
- package/dist/runtime-api-Bja3afzd.js +0 -3676
- package/dist/runtime-api-C7cX3f2r.js +0 -2
- package/dist/runtime-api-CCKblcQO.js +0 -81
- package/dist/runtime-api-CEmQSooZ.js +0 -2
- package/dist/runtime-api-CWQMIahu.js +0 -241
- package/dist/runtime-api-Ch1E1gvT.js +0 -2
- package/dist/runtime-api-CjgyJEjn.js +0 -2
- package/dist/runtime-api-CuqnElJG.js +0 -3
- package/dist/runtime-api-DOyNJNHi.js +0 -2
- package/dist/runtime-api-DUbp7oPz.js +0 -2
- package/dist/runtime-api-DZDDizAj.js +0 -1
- package/dist/runtime-api-DZcQIyI0.js +0 -1
- package/dist/runtime-api-Di-XE7J4.js +0 -3
- package/dist/runtime-api-Dq7rdsm6.js +0 -2
- package/dist/runtime-api-DxO7sIvA.js +0 -120
- package/dist/runtime-api-Dzz1aWyq.js +0 -29
- package/dist/runtime-api-_dg5Me1l.js +0 -2
- package/dist/runtime-config-snapshot-DqWNFIej.js +0 -2
- package/dist/runtime-d8L2hZ57.js +0 -5
- package/dist/runtime-discord-ops.runtime-C2o0995d.js +0 -25
- package/dist/runtime-discord-ops.runtime.js +0 -1
- package/dist/runtime-embedded-pi.runtime-Bk8vHdbc.js +0 -2
- package/dist/runtime-embedded-pi.runtime.js +0 -1
- package/dist/runtime-entry-BypP0hpR.js +0 -4925
- package/dist/runtime-env-SHKgcATc.js +0 -9
- package/dist/runtime-forwarders-ev8FdVyV.js +0 -44
- package/dist/runtime-group-policy-DXJJCWpk.js +0 -1
- package/dist/runtime-group-policy-zTp8fKRK.js +0 -59
- package/dist/runtime-guard-78ESz4Qy.js +0 -70
- package/dist/runtime-kS8e4c6-.js +0 -125
- package/dist/runtime-media-understanding.runtime-CpPWzWdQ.js +0 -2
- package/dist/runtime-media-understanding.runtime.js +0 -1
- package/dist/runtime-model-auth.runtime-1Gsp1j1n.js +0 -2
- package/dist/runtime-model-auth.runtime.js +0 -1
- package/dist/runtime-parse-vvG9x7Ps.js +0 -83
- package/dist/runtime-paths-NiQSNveu.js +0 -305
- package/dist/runtime-plugin-boundary-CzRNh2jW.js +0 -65
- package/dist/runtime-schema-uKXWjWrD.js +0 -14440
- package/dist/runtime-slack-ops.runtime-MQwSRdp3.js +0 -15
- package/dist/runtime-slack-ops.runtime.js +0 -1
- package/dist/runtime-status-2omGgKaM.js +0 -109
- package/dist/runtime-status-Cc383GkB.js +0 -15
- package/dist/runtime-store-CT3yRBe_.js +0 -22
- package/dist/runtime-tts.runtime-DTfPYn3H.js +0 -2
- package/dist/runtime-tts.runtime.js +0 -1
- package/dist/runtime-uvckmk15.js +0 -68
- package/dist/runtime-web-tools-Cf6BXnCm.js +0 -2042
- package/dist/runtime-whatsapp-boundary-Bs8RrKxP.js +0 -139
- package/dist/runtime-whatsapp-boundary-C5mx67ac.js +0 -2
- package/dist/safe-regex-tLlDZYfM.js +0 -244
- package/dist/safe-text-DhIQbZid.js +0 -16
- package/dist/sandbox-DkZ4-LBj.js +0 -4
- package/dist/sandbox-cli-Cho_k3dA.js +0 -443
- package/dist/sandbox-f4-hZNCj.js +0 -2710
- package/dist/sandbox-paths-Br54mtAJ.js +0 -146
- package/dist/sanitize-env-vars-BpNLWkzd.js +0 -82
- package/dist/scan-paths-Bln7l19-.js +0 -28
- package/dist/schema-validator-DofqBvJi.js +0 -176
- package/dist/scoped-expiring-id-cache-C8wyKEV-.js +0 -35
- package/dist/scp-host-B9NPcVwn.js +0 -62
- package/dist/sdk-Ba91_ru8.js +0 -1108
- package/dist/searxng-search-provider-CUEJoeaQ.js +0 -220
- package/dist/secret-equal-fMR1DjSl.js +0 -9
- package/dist/secret-file-BNKBIds0.js +0 -11
- package/dist/secret-file-DwDmPLSX.js +0 -92
- package/dist/secret-input-4MqmO__N.js +0 -13
- package/dist/secret-input-Bqf5ho4v.js +0 -38
- package/dist/secret-input-DyzcNLLY.js +0 -2
- package/dist/secrets-cli-DAP4hi4r.js +0 -2112
- package/dist/secure-random-Diy9rj1m.js +0 -20
- package/dist/security-cli-2WQVKZ3w.js +0 -477
- package/dist/security-runtime-BSQDlFPi.js +0 -55
- package/dist/semver-compare-DkYCMcwG.js +0 -53
- package/dist/send--GwzHbbI.js +0 -100
- package/dist/send-4ZItW1GB.js +0 -3
- package/dist/send-B1YVZR_q.js +0 -1076
- package/dist/send-B6AgLKhw.js +0 -178
- package/dist/send-CAosrV3E.js +0 -2
- package/dist/send-CTHiX-WN.js +0 -442
- package/dist/send-CywIIzow.js +0 -318
- package/dist/send-DZ2VaVTD.js +0 -856
- package/dist/send-deps-Cuc-dTy5.js +0 -19
- package/dist/send-policy-Dz5lteoO.js +0 -60
- package/dist/send-q09VUMe3.js +0 -532
- package/dist/send.components-Cbi5ixnJ.js +0 -844
- package/dist/send.components-dLe6ppiS.js +0 -2
- package/dist/server-BRW1HQ2M.js +0 -67
- package/dist/server-Clq20rV8.js +0 -27990
- package/dist/server-middleware-Ubw3OFd1.js +0 -108
- package/dist/server-node-events-kgWhdE2I.js +0 -454
- package/dist/server-startup-matrix-migration-DJZgJiUa.js +0 -1348
- package/dist/service-2O78fADl.js +0 -867
- package/dist/service-BCUDr0mF.js +0 -2
- package/dist/session-BIwHn1FL.js +0 -137
- package/dist/session-BJudz6Rb.js +0 -50
- package/dist/session-archive.runtime-8FrIp7MP.js +0 -2
- package/dist/session-archive.runtime.js +0 -1
- package/dist/session-binding-service-D7bUc7mS.js +0 -421
- package/dist/session-context-DbS6R7x0.js +0 -23
- package/dist/session-conversation-5Z-WApq_.js +0 -15
- package/dist/session-conversation-BC-SPGma.js +0 -135
- package/dist/session-conversation-D-Olnomz.js +0 -27
- package/dist/session-cost-usage-5iS5N1Rs.js +0 -651
- package/dist/session-cost-usage-ibiGeH7Z.js +0 -2
- package/dist/session-envelope-RE_1D3fZ.js +0 -18
- package/dist/session-errors-CoC2qhLC.js +0 -63
- package/dist/session-file-CnTnoAyl.js +0 -120
- package/dist/session-fork.runtime-Bb9nNLwX.js +0 -50
- package/dist/session-fork.runtime.js +0 -1
- package/dist/session-hooks-D4zcaOKV.js +0 -109
- package/dist/session-key-CQMUjsSp.js +0 -52
- package/dist/session-key-Do__tq1E.js +0 -279
- package/dist/session-key-normalization-BamCBtxj.js +0 -22
- package/dist/session-override-CHm5auQy.js +0 -100
- package/dist/session-reset-model.runtime-DD5SooaH.js +0 -119
- package/dist/session-reset-model.runtime.js +0 -1
- package/dist/session-route-O1Pb7Oid.js +0 -91
- package/dist/session-store-runtime-ePmbOWO1.js +0 -2
- package/dist/session-subagent-reactivation.runtime-BwUDVflj.js +0 -2
- package/dist/session-subagent-reactivation.runtime.js +0 -1
- package/dist/session-transcript-files.fs-CyBs2u56.js +0 -149
- package/dist/session-updates-C33bkLCm.js +0 -222
- package/dist/session-updates.runtime-BHLQJ71D.js +0 -2
- package/dist/session-updates.runtime.js +0 -1
- package/dist/session-utils-C0HJP9m_.js +0 -1743
- package/dist/session-write-lock-C7svKLqX.js +0 -343
- package/dist/sessions-CkaONOVi.js +0 -224
- package/dist/sessions-Dqj9fL_x.js +0 -2
- package/dist/sessions-j2hbBGOS.js +0 -443
- package/dist/setup-0GrDtpRN.js +0 -427
- package/dist/setup-BrOJEPVN.js +0 -15
- package/dist/setup-adapter-runtime-CyIIvoms.js +0 -2
- package/dist/setup-api-1P88M5pV.js +0 -2
- package/dist/setup-binary-CXmsVXWb.js +0 -2
- package/dist/setup-bootstrap-QdrIAyis.js +0 -54
- package/dist/setup-core-BqPbreVF.js +0 -256
- package/dist/setup-core-CFzSqpD7.js +0 -256
- package/dist/setup-core-DJHWTJKX.js +0 -383
- package/dist/setup-core-DT1fK9yD.js +0 -146
- package/dist/setup-core-kjYyNYvv.js +0 -48
- package/dist/setup-core-t03VZdcn.js +0 -160
- package/dist/setup-group-access-BQbnTk8B.js +0 -70
- package/dist/setup-helpers-0yWIq2cW.js +0 -390
- package/dist/setup-runtime-BChXvJOO.js +0 -4
- package/dist/setup-surface-B8loJ-nJ.js +0 -272
- package/dist/setup-surface-BKizDP2g.js +0 -237
- package/dist/setup-surface-BOd4V0w5.js +0 -261
- package/dist/setup-surface-BaLQtvFW.js +0 -353
- package/dist/setup-surface-Bha7U86Z.js +0 -72
- package/dist/setup-surface-BkHkduRm.js +0 -450
- package/dist/setup-surface-CDfudYpT2.js +0 -261
- package/dist/setup-surface-CT-Erp53.js +0 -346
- package/dist/setup-surface-Co1jSLDk.js +0 -656
- package/dist/setup-surface-D0joW4q1.js +0 -333
- package/dist/setup-surface-D9rWJb4Z.js +0 -1447
- package/dist/setup-surface-D_CJfyJ1.js +0 -381
- package/dist/setup-surface-DbVJ8CAj.js +0 -484
- package/dist/setup-surface-Di1q12ha.js +0 -97
- package/dist/setup-surface-LWupQ_eL.js +0 -304
- package/dist/setup-tools-Cb6PLN3L.js +0 -4
- package/dist/setup-wizard-helpers-CA5yiprq.js +0 -841
- package/dist/setup-wizard-proxy-bmMo6OPA.js +0 -127
- package/dist/setup.finalize-DvGlwfbU.js +0 -443
- package/dist/setup.gateway-config-D_eSo_Jz.js +0 -246
- package/dist/setup.secret-input-BAQnay16.js +0 -25
- package/dist/shared-1nXP7RAM.js +0 -78
- package/dist/shared-6u4-kP5J.js +0 -221
- package/dist/shared-BnSR7joQ.js +0 -144
- package/dist/shared-BsLpgVLV.js +0 -37
- package/dist/shared-C-PSF7Rv.js +0 -64
- package/dist/shared-C1MrVu4M.js +0 -180
- package/dist/shared-CA8QQ_O5.js +0 -94
- package/dist/shared-CCV62W5K.js +0 -2
- package/dist/shared-CHJjz6Zz.js +0 -72
- package/dist/shared-CK49TKED.js +0 -50
- package/dist/shared-CL7I4ij0.js +0 -160
- package/dist/shared-Cr7ijuS4.js +0 -198
- package/dist/shared-D61IX915.js +0 -10
- package/dist/shared-Dr9OQu4c.js +0 -64
- package/dist/shared-DwxV-O-g.js +0 -136
- package/dist/shared-dWHdeoyy.js +0 -126
- package/dist/shared-runtime-yV5uP0IO.js +0 -7
- package/dist/shell-argv-B9p91CMW.js +0 -72
- package/dist/shell-env-BTztt4a1.js +0 -181
- package/dist/signal-B1kD3iF3.js +0 -46
- package/dist/signal-DP8FUJOa.js +0 -6
- package/dist/signal-Dvmeol77.js +0 -13
- package/dist/signal-account-CYKnyxZK.js +0 -11
- package/dist/signal-cli-install-DcmsRDbB.js +0 -188
- package/dist/signal-surface-AbofIH7s.js +0 -21
- package/dist/simple-completion-transport-Dl5DzRWP.js +0 -24
- package/dist/skill-commands-CH4lfyW8.js +0 -77
- package/dist/skill-commands-base-CvVjZByy.js +0 -60
- package/dist/skill-commands-runtime-zpWkVBay.js +0 -2
- package/dist/skill-commands.runtime-BKa5oyH-.js +0 -2
- package/dist/skill-commands.runtime.js +0 -1
- package/dist/skill-scanner-bqroDZTs.js +0 -354
- package/dist/skills-D0K7gu2V.js +0 -972
- package/dist/skills-DFTLIGCd.js +0 -4
- package/dist/skills-clawhub-KJGw0uGT.js +0 -274
- package/dist/skills-cli-DziAPxba.js +0 -369
- package/dist/skills-install-CQeO3Sll.js +0 -819
- package/dist/skills-remote-BojLLDxp.js +0 -584
- package/dist/skills-status-BINZ_svK.js +0 -2
- package/dist/skills-status-CdQUttuP.js +0 -170
- package/dist/slack-BuMSbx3k.js +0 -6
- package/dist/slack-DMg3O5YT.js +0 -9
- package/dist/slack-account-LEbfbXys.js +0 -11
- package/dist/slack-core-oqCiyGw8.js +0 -4
- package/dist/slack-runtime-surface-CyaeT7yk.js +0 -18
- package/dist/slack-surface-1yTIS5Q8.js +0 -44
- package/dist/slack-target-parser-CruIJ5w5.js +0 -12
- package/dist/slack-targets-ukxuKR1I.js +0 -45
- package/dist/slash-commands-CRuXC74L.js +0 -672
- package/dist/slash-commands.runtime-F6b9KUnh.js +0 -20
- package/dist/slash-commands.runtime.js +0 -1
- package/dist/slash-dispatch.runtime-CItGyoBF.js +0 -38
- package/dist/slash-dispatch.runtime.js +0 -1
- package/dist/slash-skill-commands.runtime-Caw0oNvV.js +0 -8
- package/dist/slash-skill-commands.runtime.js +0 -1
- package/dist/slots-Dq-2eIRb.js +0 -93
- package/dist/speech-Ceb4ISD4.js +0 -46
- package/dist/speech-provider-BHjDbut-.js +0 -190
- package/dist/speech-provider-D45m9grJ.js +0 -154
- package/dist/speech-provider-DM1ZXsz2.js +0 -385
- package/dist/speech-runtime-CNvOkPw4.js +0 -34
- package/dist/src-Dn1TYXp6.js +0 -2739
- package/dist/ssh-config-C1ipLHgq.js +0 -77
- package/dist/ssh-tunnel-BwMCLc2e.js +0 -159
- package/dist/ssh-tunnel-D5YdH2SQ.js +0 -2
- package/dist/ssrf-Duye12M_.js +0 -246
- package/dist/ssrf-policy-5L7qS2kK.js +0 -69
- package/dist/ssrf-runtime-bpDM5Bgo.js +0 -5
- package/dist/stable-node-path-n7TARbHZ.js +0 -32
- package/dist/stage-sandbox-media.runtime-Tlgx4F6M.js +0 -229
- package/dist/stage-sandbox-media.runtime.js +0 -1
- package/dist/stagger-Cs-6sySM.js +0 -54
- package/dist/startup-verification-DS8Rlwfj.js +0 -131
- package/dist/state-migrations-ssGF0Trg.js +0 -845
- package/dist/state-paths-LoYjHd5L.js +0 -2
- package/dist/status-B7yRr4OV.js +0 -3
- package/dist/status-BM1Lyqo6.js +0 -261
- package/dist/status-BekOC_tW.js +0 -650
- package/dist/status-CxodlqzZ.js +0 -2
- package/dist/status-DHbl5eIj.js +0 -608
- package/dist/status-PsQV2sfU.js +0 -44
- package/dist/status-all-C53a3881.js +0 -798
- package/dist/status-helpers-CCJSSrVJ.js +0 -170
- package/dist/status-issues-M-RUxHvm.js +0 -336
- package/dist/status-issues-qWKbW6r2.js +0 -187
- package/dist/status-json-B66tF12J.js +0 -86
- package/dist/status.agent-local-B8Sw_p6M.js +0 -59
- package/dist/status.command.text-runtime-csZS5yHm.js +0 -18
- package/dist/status.daemon-D0GzvHft.js +0 -25
- package/dist/status.format-C1VNrTBi.js +0 -44
- package/dist/status.gateway-probe-4INUEsUo.js +0 -15
- package/dist/status.link-channel-CJtR5UX6.js +0 -35
- package/dist/status.node-mode-Bva3wbBI.js +0 -2
- package/dist/status.node-mode-CneoXHPW.js +0 -32
- package/dist/status.scan-t1kfm4e0.js +0 -264
- package/dist/status.scan.deps.runtime-CCaTJlzV.js +0 -18
- package/dist/status.scan.deps.runtime.js +0 -1
- package/dist/status.scan.fast-json-DmzN3HuU.js +0 -97
- package/dist/status.scan.fast-json-gu6uL_BR.js +0 -2
- package/dist/status.scan.json-core-JjMIy9YZ.js +0 -254
- package/dist/status.scan.runtime-r_5mTC8f.js +0 -9
- package/dist/status.scan.runtime.js +0 -1
- package/dist/status.service-summary-DnbDBXMs.js +0 -32
- package/dist/status.summary-CbEhZE0h.js +0 -210
- package/dist/status.summary-SLm6uT22.js +0 -2
- package/dist/status.update-Bw9CvcCc.js +0 -2
- package/dist/status.update-CLnevxJb.js +0 -79
- package/dist/sticker-cache-C_FrWgaA.js +0 -1573
- package/dist/sticker-vision.runtime-DR7e08nD.js +0 -16
- package/dist/sticker-vision.runtime.js +0 -1
- package/dist/storage-CPQLpmgN.js +0 -234
- package/dist/storage-paths-DvC4vQo1.js +0 -51
- package/dist/store-8ONMiMTI.js +0 -365
- package/dist/store-DQJZr0Yf.js +0 -767
- package/dist/store-Dxcm2vsw.js +0 -140
- package/dist/store-_OZh8RrM.js +0 -1343
- package/dist/store-read-JHUhrL0Z.js +0 -16
- package/dist/store.runtime-Dmqv-8M7.js +0 -2
- package/dist/store.runtime.js +0 -1
- package/dist/stream-CGrFe0j0.js +0 -123
- package/dist/stream-D9HOuZmn.js +0 -633
- package/dist/stream-Di_JOWoE.js +0 -180
- package/dist/stream-wrappers-D-DlMIYG.js +0 -136
- package/dist/string-normalization-Ddc4JXRe.js +0 -19
- package/dist/string-normalization-runtime-CCsvs1ds.js +0 -1
- package/dist/string-sample-BIWt11jp.js +0 -11
- package/dist/strip-inbound-meta-DvHTlpJG.js +0 -155
- package/dist/subagent-orphan-recovery-Do8Az2RD.js +0 -206
- package/dist/subagent-registry-runtime-D5PNyCsh.js +0 -2
- package/dist/subcli-descriptors-Dasenv4J.js +0 -151
- package/dist/subsystem-C9VSlEcV.js +0 -582
- package/dist/supervisor-log.runtime-CZe76kAj.js +0 -8
- package/dist/supervisor-log.runtime.js +0 -1
- package/dist/system-cli-2-HDh_Ev.js +0 -58
- package/dist/system-events-5SDw3lix.js +0 -93
- package/dist/system-events-BuGmSpuG.js +0 -34
- package/dist/system-message-0oem5MWV.js +0 -16
- package/dist/system-run-command-BmlO5dn2.js +0 -301
- package/dist/systemd-B2HBHMpF.js +0 -588
- package/dist/systemd-hints-DkRlAuPR.js +0 -325
- package/dist/systemd-linger-BBPBJSm0.js +0 -68
- package/dist/systemd-linger-DiWO9n2E.js +0 -2
- package/dist/table-CY2XIg3l.js +0 -305
- package/dist/tables-D6qL6k4d.js +0 -832
- package/dist/tailnet-CZMxMuGK.js +0 -76
- package/dist/tailscale-mpS_cTve.js +0 -238
- package/dist/tailscale-status-Dg2Iov5f.js +0 -71
- package/dist/target-errors-ThNFqo8X.js +0 -26
- package/dist/target-ids-O3O6piTN.js +0 -76
- package/dist/target-parsing-Boyj_2v0.js +0 -41
- package/dist/target-registry-BHJcVSo1.js +0 -1269
- package/dist/targets-C7I_wjs2.js +0 -283
- package/dist/targets-CZA632lq.js +0 -39
- package/dist/targets-Dz1dx4G8.js +0 -78
- package/dist/targets-Zd0-pJu7.js +0 -748
- package/dist/targets-krmeAAxz.js +0 -70
- package/dist/task-registry-delivery-runtime-BnkUa6Mp.js +0 -2
- package/dist/task-registry.audit-DbCRt5MR.js +0 -320
- package/dist/task-registry.audit.shared-SH4MOLKM.js +0 -18
- package/dist/task-registry.maintenance-DfZmDWog.js +0 -2
- package/dist/task-registry.summary-SoFiECCc.js +0 -44
- package/dist/tavily-search-provider-BCY1kfQB.js +0 -227
- package/dist/telegram/audit.js +0 -2
- package/dist/telegram/token.js +0 -2
- package/dist/telegram-Cq20PSxw.js +0 -23
- package/dist/telegram-account-vRRwyfuA.js +0 -11
- package/dist/telegram-command-config-BiHhXScJ.js +0 -1
- package/dist/telegram-core-DTJayyAj.js +0 -6
- package/dist/telegram-custom-commands-C-nv8yoB.js +0 -75
- package/dist/temp-download-Ccatr7zI.js +0 -62
- package/dist/temp-path-JU2kkd64.js +0 -2
- package/dist/templating-Bu436Euy.js +0 -24
- package/dist/testing-BrrgubIp.js +0 -690
- package/dist/text-chunking-BTs2yTSd.js +0 -12
- package/dist/text-chunking-ByXwyFNP.js +0 -20
- package/dist/text-format-lEYRGxj5.js +0 -8
- package/dist/text-runtime-D9ApM_8O.js +0 -398
- package/dist/theme-Bb-qluq6.js +0 -2
- package/dist/theme-wBMZmJzz.js +0 -34
- package/dist/thinking-Dga2zdtd.js +0 -68
- package/dist/thinking.shared-D6IkoLJU.js +0 -243
- package/dist/thread-bindings-BMnz7w-V.js +0 -219
- package/dist/thread-bindings-BbQWOcMr.js +0 -352
- package/dist/thread-bindings-Bv0I9sBY.js +0 -534
- package/dist/thread-bindings-C3jMrVvp.js +0 -778
- package/dist/thread-bindings-policy-Br8s4hQ6.js +0 -172
- package/dist/thread-bindings-runtime-CbG63N4N.js +0 -2
- package/dist/thread-bindings-shared-DjSYaoHi.js +0 -95
- package/dist/thread-bindings.discord-api-NFR5qsWt.js +0 -487
- package/dist/thread-ownership-DG810AQi.js +0 -3
- package/dist/threading-1Z_3y_Dp.js +0 -2
- package/dist/threading-Hl8nWez6.js +0 -832
- package/dist/threading-helpers-BpqyeyAU.js +0 -14
- package/dist/threading-tool-context-DxV30qIW.js +0 -157
- package/dist/timeouts-B1NiHSGi.js +0 -74
- package/dist/tlon-C54Qojl0.js +0 -20
- package/dist/tmp-openclaw-dir-B44_vmJv.js +0 -102
- package/dist/token-BlUJQi_X.js +0 -2
- package/dist/token-CDYFJvj8.js +0 -82
- package/dist/token-kCjtGElJ.js +0 -45
- package/dist/tokens-C2f9Klbt.js +0 -66
- package/dist/tool-actions.runtime-aB0DgLk7.js +0 -532
- package/dist/tool-actions.runtime.js +0 -1
- package/dist/tool-display-C7h9IZa_.js +0 -1607
- package/dist/tool-images-BDUvc_pd.js +0 -270
- package/dist/tool-mutation-DIBpIegg.js +0 -140
- package/dist/tool-policy-FUm_F19C.js +0 -515
- package/dist/tool-policy-match-CCFHTsu9.js +0 -49
- package/dist/tool-send-DClM4vsZ.js +0 -16
- package/dist/tools-54j1hYBv.js +0 -123
- package/dist/tools-effective-inventory-C09suj6-.js +0 -148
- package/dist/tools.runtime-VBFxIXC8.js +0 -4
- package/dist/tools.runtime.js +0 -1
- package/dist/transcript-events-Dc7U5QmQ.js +0 -29
- package/dist/transport-ready-Cje3USX4.js +0 -36
- package/dist/tts-CTM9C09A.js +0 -2
- package/dist/tts-Ck_K3tIi.js +0 -84
- package/dist/tts-auto-mode-bD-u2biE.js +0 -14
- package/dist/tts-bTuorllO.js +0 -102
- package/dist/tts-eOLiJF6d.js +0 -29
- package/dist/tts.runtime-ChTwy0yH.js +0 -3
- package/dist/tts.runtime.js +0 -1
- package/dist/tui-CrM-Bz3i.js +0 -3899
- package/dist/tui-cli-aVL5aPGw.js +0 -31
- package/dist/twitch-CFFlkhYG.js +0 -15
- package/dist/typebox-DmerPHaM.js +0 -22
- package/dist/types-BzNSmNk3.js +0 -12
- package/dist/types-DAzqpvqD.js +0 -83
- package/dist/types-DVJVELY7.js +0 -471
- package/dist/types-DqNppUoh.js +0 -15
- package/dist/types.secrets-BpcqHPAv.js +0 -80
- package/dist/types.tools-BTQL6INB.js +0 -22
- package/dist/typing-BnCchGtL.js +0 -8
- package/dist/typing-Bugg5LPP.js +0 -68
- package/dist/typing-J_ktpWeA.js +0 -2
- package/dist/typing-mode-DDYL_0TG.js +0 -75
- package/dist/typing-policy-CaZhrM-F.js +0 -11
- package/dist/typing-start-guard-Cgjgzy5e.js +0 -73
- package/dist/ui-BLDY9-7R.js +0 -212
- package/dist/undici-global-dispatcher-CcNdQ7Dt.js +0 -99
- package/dist/unhandled-rejections-CA_e1R-O.js +0 -2
- package/dist/unhandled-rejections-V7U9keRG.js +0 -241
- package/dist/update-CcALvtl_.js +0 -1253
- package/dist/update-channels-Dn1F57Kf.js +0 -78
- package/dist/update-check-CoDVxy35.js +0 -354
- package/dist/update-cli-BWOYy_Mp.js +0 -1447
- package/dist/update-offset-store-BLZmshZE.js +0 -75
- package/dist/usage-CC7-wLUi.js +0 -39
- package/dist/usage-format-C7nMV1jc.js +0 -513
- package/dist/utils-CN_F_3Qg.js +0 -243
- package/dist/utils-Cgw9Y0-Q.js +0 -2
- package/dist/validation-BNNAUmDO.js +0 -18521
- package/dist/verification-B4ogZ29M.js +0 -130
- package/dist/verification-B99uVIxo.js +0 -2
- package/dist/version-BNzJ37Re.js +0 -79
- package/dist/version-Dw0eJ-1F.js +0 -2
- package/dist/voice-call-Dt6m6oA3.js +0 -4
- package/dist/wait-YXJvtMmp.js +0 -7
- package/dist/warning-filter-GX8LpGKz.js +0 -57
- package/dist/web-fetch-utils-CoVia2ez.js +0 -413
- package/dist/web-media-D9opLz21.js +0 -2
- package/dist/web-media-DHlguFej.js +0 -339
- package/dist/web-search-BcSDWJK9.js +0 -169
- package/dist/web-search-providers-CqY6CVp3.js +0 -21
- package/dist/web-search-providers.runtime-BHjzPQW-.js +0 -113
- package/dist/web-search-providers.runtime.js +0 -1
- package/dist/web-search-providers.shared-CMeQec8y.js +0 -421
- package/dist/web-search-shared-B5mHm7QD.js +0 -87
- package/dist/webhook-ingress-CTl81NUR.js +0 -164
- package/dist/webhook-memory-guards-B6k3g-po.js +0 -129
- package/dist/webhook-path-CklCw5kp.js +0 -22
- package/dist/webhook-request-guards-CxDPmU9e.js +0 -178
- package/dist/webhook-shared-Bw9wLe6L.js +0 -370
- package/dist/webhooks-cli-DPRITERU.js +0 -326
- package/dist/whatsapp-CSzf1Nu0.js +0 -5
- package/dist/whatsapp-D18Otn45.js +0 -30
- package/dist/whatsapp-auth-presence-B5GZUgTA.js +0 -41
- package/dist/whatsapp-core-Be0P_p4R.js +0 -7
- package/dist/whatsapp-heartbeat-a2-OB01n.js +0 -85
- package/dist/whatsapp-shared-ChjLiMDw.js +0 -56
- package/dist/whatsapp-shared-FR_Jw-NH.js +0 -4
- package/dist/whatsapp-surface-Dwrfi_SD.js +0 -26
- package/dist/whatsapp-targets-59A3BDBi.js +0 -13
- package/dist/widearea-dns-CfQt6b3q.js +0 -125
- package/dist/windows-argv-DDAf3waz.js +0 -345
- package/dist/windows-install-roots-XI3CvO9O.js +0 -149
- package/dist/windows-spawn-DKvkg_66.js +0 -154
- package/dist/with-timeout-B2smrGj0.js +0 -214
- package/dist/with-timeout-BmJKiOMd.js +0 -13
- package/dist/workflow-summary-BMvffn8D.js +0 -2
- package/dist/workflow-summary-NvN5lUvK.js +0 -167
- package/dist/workspace-D5P9nuJd.js +0 -479
- package/dist/workspace-D5UiPYKk.js +0 -306
- package/dist/workspace-dirs-CRv8Jwfz.js +0 -13
- package/dist/ws-97FEIc7w.js +0 -11
- package/dist/ws-log-BaAOgG9m.js +0 -281
- package/dist/ws-logging-M92fgmyp.js +0 -10
- package/dist/wsl-ytdRZp54.js +0 -57
- package/dist/x-search-FsMNZ7d0.js +0 -166
- package/dist/x-search-shared-D0tVMJk9.js +0 -124
- package/dist/zalo-CNoa7XH7.js +0 -13
- package/dist/zalo-js-HktBGDbg.js +0 -1156
- package/dist/zalo-setup-BT-xGElf.js +0 -14
- package/dist/zalouser-TwyfhIYz.js +0 -22
- package/dist/zod-1Wegy5nx.js +0 -7
- package/dist/zod-parse-HlGwTZP3.js +0 -14
- package/dist/zod-schema.agent-runtime-DFC7a3eV.js +0 -602
- package/dist/zod-schema.core-C1Ewlj9j.js +0 -520
- package/dist/zod-schema.providers-core-Bmbs-R4l.js +0 -1541
- package/dist/zod-schema.providers-whatsapp-CanJPkvb.js +0 -132
- package/dist/zod-schema.sensitive-DEzKzMxI.js +0 -5
|
@@ -1,3707 +0,0 @@
|
|
|
1
|
-
import { i as clampInt, v as resolveUserPath } from "./utils-CN_F_3Qg.js";
|
|
2
|
-
import { d as normalizeUsageDisplay, p as resolveResponseUsageMode, s as normalizeFastMode } from "./thinking.shared-D6IkoLJU.js";
|
|
3
|
-
import { _ as normalizeAccountId, v as normalizeOptionalAccountId } from "./session-key-Do__tq1E.js";
|
|
4
|
-
import { r as logVerbose } from "./globals-CDtV0ht8.js";
|
|
5
|
-
import { r as normalizeStringEntries } from "./string-normalization-Ddc4JXRe.js";
|
|
6
|
-
import { v as resolveSessionAgentId } from "./agent-scope-rWWUivuC.js";
|
|
7
|
-
import { A as setConfigValueAtPath, D as unsetConfigOverride, E as setConfigOverride, O as getConfigValueAtPath, T as resetConfigOverrides, f as readConfigFileSnapshot, j as unsetConfigValueAtPath, k as parseConfigPath, w as getConfigOverrides, x as writeConfigFile } from "./io-BUxKr33U.js";
|
|
8
|
-
import { a as validateConfigObjectWithPlugins } from "./validation-BNNAUmDO.js";
|
|
9
|
-
import { o as normalizeChannelId } from "./registry-mVzzlPf7.js";
|
|
10
|
-
import { t as clearPluginManifestRegistryCache } from "./manifest-registry-Kx5Z2lJL.js";
|
|
11
|
-
import { t as parseDurationMs } from "./parse-duration-D9q1V0xx.js";
|
|
12
|
-
import { t as resolveAccountEntry } from "./account-lookup-CLJxpfHr.js";
|
|
13
|
-
import "./config-CKJA2kAO.js";
|
|
14
|
-
import { _ as GATEWAY_CLIENT_NAMES, d as normalizeMessageChannel, g as GATEWAY_CLIENT_MODES, o as isInternalMessageChannel } from "./message-channel-bEWdw4ul.js";
|
|
15
|
-
import { d as updateSessionStore, i as loadSessionStore } from "./store-_OZh8RrM.js";
|
|
16
|
-
import { t as getChannelPlugin } from "./registry-CuFNdbH5.js";
|
|
17
|
-
import { n as resolveChannelApprovalCapability } from "./plugins-w6xUzHby.js";
|
|
18
|
-
import "./sessions-j2hbBGOS.js";
|
|
19
|
-
import { i as resolveSessionFilePathOptions, l as resolveStorePath, r as resolveSessionFilePath } from "./paths-xpks599B.js";
|
|
20
|
-
import { a as resolveFreshSessionTotalTokens } from "./types-DAzqpvqD.js";
|
|
21
|
-
import { un as ErrorCodes } from "./method-scopes-B6e_KuRU.js";
|
|
22
|
-
import { r as callGateway } from "./call-dy-GwrXS.js";
|
|
23
|
-
import { r as isRestartEnabled, t as isCommandFlagEnabled } from "./commands-BxWe27p0.js";
|
|
24
|
-
import { r as getSessionBindingService } from "./session-binding-service-D7bUc7mS.js";
|
|
25
|
-
import { n as createInternalHookEvent, p as triggerInternalHook } from "./internal-hooks-C3ziA7w_.js";
|
|
26
|
-
import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-KjI5xf8m.js";
|
|
27
|
-
import { B as resolveAcpThreadSessionDetailLines, Dr as stripToolMessages, Mr as createExecTool, P as spawnSubagentDirect, R as resolveAcpSessionCwd, S as stripToolResultDetails, _t as steerControlledSubagentRun, ar as sortSubagentRuns, cr as formatTaskStatusTitle, ct as listTasksForAgentIdForStatus, dt as killAllControlledSubagentRuns, ft as killControlledSubagentRun, g as compactEmbeddedPiSession, gt as sendControlledSubagentMessage, lr as sanitizeTaskStatusText, lt as listTasksForSessionKeyForStatus, mt as listControlledSubagentRuns, nr as formatRunLabel, nt as formatContextUsageShort, or as buildTaskStatusSnapshot, pn as readAcpSessionEntry, q as findTaskByRunIdForOwner, rt as formatTokenCount, s as EmbeddedBlockChunker, sr as formatTaskStatusDetail, ut as buildSubagentList, yt as countPendingDescendantRuns } from "./pi-embedded-DEAtCIdT.js";
|
|
28
|
-
import { t as diag } from "./diagnostic-DfKz60Xk.js";
|
|
29
|
-
import { C as textToSpeech, _ as setSummarizationEnabled, a as getTtsMaxLength, b as setTtsMaxLength, c as isTtsEnabled, g as setLastTtsAttempt, i as getResolvedSpeechProviderConfig, l as isTtsProviderConfigured, m as resolveTtsPrefsPath, o as getTtsProvider, p as resolveTtsConfig, r as getLastTtsAttempt, s as isSummarizationEnabled, x as setTtsProvider, y as setTtsEnabled } from "./speech-runtime-CNvOkPw4.js";
|
|
30
|
-
import "./tts-CTM9C09A.js";
|
|
31
|
-
import { n as resolveSandboxRuntimeStatus } from "./runtime-status-2omGgKaM.js";
|
|
32
|
-
import "./thinking-Dga2zdtd.js";
|
|
33
|
-
import { t as requireApiKey } from "./model-auth-runtime-shared-DnhseQ_3.js";
|
|
34
|
-
import { r as getApiKeyForModel } from "./model-auth-DcCyGs_6.js";
|
|
35
|
-
import { t as ensureOpenClawModelsJson } from "./models-config-lYKxSxLo.js";
|
|
36
|
-
import { n as setPluginEnabledInConfig } from "./enable-BgSxsKp_.js";
|
|
37
|
-
import { i as unsetConfiguredMcpServer, r as setConfiguredMcpServer, t as listConfiguredMcpServers } from "./mcp-config-3y1z3N2x.js";
|
|
38
|
-
import { O as getFinishedSession, k as getSession } from "./model-runtime-CkjgxQmB.js";
|
|
39
|
-
import { r as enqueueSystemEvent } from "./system-events-5SDw3lix.js";
|
|
40
|
-
import "./sandbox-f4-hZNCj.js";
|
|
41
|
-
import { t as formatDurationCompact } from "./format-duration-DqcpDYkZ.js";
|
|
42
|
-
import { a as getActiveEmbeddedRunSnapshot, f as waitForEmbeddedPiRunEnd, o as isEmbeddedPiRunActive, t as abortEmbeddedPiRun, v as scheduleGatewaySigusr1Restart, x as triggerStableClawRestart } from "./runs-CX-70k4f.js";
|
|
43
|
-
import { C as resolveFastModeState, i as clearSessionQueues } from "./queue-CtO0M_P1.js";
|
|
44
|
-
import { n as parseActivationCommand } from "./group-activation-ClEb7qwj.js";
|
|
45
|
-
import { n as formatTimeAgo } from "./format-relative-CYrRyrT7.js";
|
|
46
|
-
import { i as matchPluginCommand, n as executePluginCommand } from "./commands-CiyPyNRY.js";
|
|
47
|
-
import { n as formatTokenCount$1, r as formatUsd } from "./usage-format-C7nMV1jc.js";
|
|
48
|
-
import { p as normalizeCommandBody } from "./commands-registry-DgMc5_jk.js";
|
|
49
|
-
import { n as stripInboundMetadata } from "./strip-inbound-meta-DvHTlpJG.js";
|
|
50
|
-
import { c as resolveThreadBindingIdleTimeoutMsForChannel, d as resolveThreadBindingMaxAgeMsForChannel, g as formatThreadBindingDurationLabel, i as formatThreadBindingSpawnDisabledError, p as resolveThreadBindingSpawnPolicy, r as formatThreadBindingDisabledError, v as resolveThreadBindingIntroText, y as resolveThreadBindingThreadName } from "./thread-bindings-policy-Br8s4hQ6.js";
|
|
51
|
-
import { i as resolveModelWithRegistry } from "./anthropic-vertex-stream-DgR8-m-G.js";
|
|
52
|
-
import { n as createPluginRuntime } from "./runtime-DofOSZ5U.js";
|
|
53
|
-
import { i as setAbortMemory, r as isAbortTrigger } from "./abort-primitives-CGyFwJ93.js";
|
|
54
|
-
import { o as stripMentions, s as stripStructuralPrefixes } from "./mentions-BKYgZd-C.js";
|
|
55
|
-
import { a as readChannelAllowFromStore, l as removeChannelAllowFromStoreEntry, t as addChannelAllowFromStoreEntry } from "./pairing-store-B171dUVa.js";
|
|
56
|
-
import { a as resolveArchiveKind } from "./archive-BaCqqQP1.js";
|
|
57
|
-
import { r as formatElevatedUnavailableMessage } from "./reply-D8bUQd-Q.js";
|
|
58
|
-
import { n as resolveSessionAuthProfileOverride } from "./session-override-CHm5auQy.js";
|
|
59
|
-
import { a as shouldPersistAbortCutoff, i as resolveAbortCutoffFromContext, t as applyAbortCutoffToSessionEntry } from "./abort-cutoff-B1ws4nOb.js";
|
|
60
|
-
import { n as resolveSessionEntryForKey, r as stopSubagentsForRequester, t as formatAbortReplyText } from "./abort-C9luPDzM.js";
|
|
61
|
-
import { t as extractBtwQuestion } from "./btw-command-CPUGSdlD.js";
|
|
62
|
-
import { n as getSpeechProvider, r as listSpeechProviders, t as canonicalizeSpeechProviderId } from "./provider-registry-Ljtt6CKE.js";
|
|
63
|
-
import { c as rejectUnauthorizedCommand, l as requireCommandFlagEnabled, o as buildDisabledCommandReply, r as handleModelsCommand, s as rejectNonOwnerCommand, u as requireGatewayClientScopeForInternalChannel } from "./commands-models-B4EJh5Fy.js";
|
|
64
|
-
import { S as resolveCommandSurfaceChannel, _ as resolveTelegramConversationId, a as formatLogLines, b as isTelegramSurface, c as resolveCommandSubagentController, d as resolveFocusTargetSession, f as resolveHandledPrefix, g as stopWithText, h as resolveSubagentsAction, i as buildSubagentsHelp, l as resolveDiscordChannelIdForFocus, m as resolveSubagentEntryForToken, o as formatTimestampWithAge, p as resolveRequesterSessionKey, s as loadSubagentSessionEntry, u as resolveDisplayStatus, v as isDiscordSurface, x as resolveChannelAccountId, y as isMatrixSurface } from "./targets-Zd0-pJu7.js";
|
|
65
|
-
import { t as handleAcpCommand } from "./commands-acp-BeCm2Wnq.js";
|
|
66
|
-
import { a as handleHelpCommand, c as handleWhoamiCommand, i as handleExportSessionCommand, n as handleCommandsListCommand, o as handleStatusCommand, r as handleContextCommand, s as handleToolsCommand } from "./commands-info-COwAtIWb.js";
|
|
67
|
-
import { i as isTelegramExecApprovalClientEnabled, r as isTelegramExecApprovalAuthorizedSender } from "./exec-approvals-CW5axvaY.js";
|
|
68
|
-
import "./api-Bk5mFOju.js";
|
|
69
|
-
import { n as incrementCompactionCount } from "./session-updates-C33bkLCm.js";
|
|
70
|
-
import { t as parseConfigValue } from "./config-value-CMTdBw5q.js";
|
|
71
|
-
import { i as buildNpmInstallRecordFields, n as persistPluginInstall } from "./plugins-install-persist-C5-bJdRb.js";
|
|
72
|
-
import { s as parseClawHubPluginSpec } from "./clawhub-CDs2LE11.js";
|
|
73
|
-
import { i as installPluginFromPath, r as installPluginFromNpmSpec } from "./install-Bk7XyvtC.js";
|
|
74
|
-
import { r as installPluginFromClawHub } from "./clawhub-CO6YnoQZ.js";
|
|
75
|
-
import { a as buildPluginInspectReport, i as buildPluginDiagnosticsReport, o as buildPluginSnapshotReport, s as formatPluginCompatibilityNotice, t as buildAllPluginInspectReports } from "./status-BM1Lyqo6.js";
|
|
76
|
-
import { a as decidePreferredClawHubFallback, f as resolveFileNpmSpecToLocalPath, i as createPluginInstallLogger, n as buildPreferredClawHubSpec } from "./plugins-command-helpers-CIYzoC65.js";
|
|
77
|
-
import { n as loadCostUsageSummary, r as loadSessionCostSummary } from "./session-cost-usage-5iS5N1Rs.js";
|
|
78
|
-
import fsSync from "node:fs";
|
|
79
|
-
import { streamSimple } from "@mariozechner/pi-ai";
|
|
80
|
-
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
81
|
-
//#region src/channels/plugins/config-writes.ts
|
|
82
|
-
function resolveChannelConfigWrites(params) {
|
|
83
|
-
const channelConfig = resolveChannelConfig(params.cfg, params.channelId);
|
|
84
|
-
if (!channelConfig) return true;
|
|
85
|
-
return (resolveChannelAccountConfig(channelConfig, params.accountId)?.configWrites ?? channelConfig.configWrites) !== false;
|
|
86
|
-
}
|
|
87
|
-
function authorizeConfigWrite(params) {
|
|
88
|
-
if (params.allowBypass) return { allowed: true };
|
|
89
|
-
if (params.target?.kind === "ambiguous") return {
|
|
90
|
-
allowed: false,
|
|
91
|
-
reason: "ambiguous-target"
|
|
92
|
-
};
|
|
93
|
-
if (params.origin?.channelId && !resolveChannelConfigWrites({
|
|
94
|
-
cfg: params.cfg,
|
|
95
|
-
channelId: params.origin.channelId,
|
|
96
|
-
accountId: params.origin.accountId
|
|
97
|
-
})) return {
|
|
98
|
-
allowed: false,
|
|
99
|
-
reason: "origin-disabled",
|
|
100
|
-
blockedScope: {
|
|
101
|
-
kind: "origin",
|
|
102
|
-
scope: params.origin
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const seen = /* @__PURE__ */ new Set();
|
|
106
|
-
for (const target of listConfigWriteTargetScopes(params.target)) {
|
|
107
|
-
if (!target.channelId) continue;
|
|
108
|
-
const key = `${target.channelId}:${normalizeAccountId(target.accountId)}`;
|
|
109
|
-
if (seen.has(key)) continue;
|
|
110
|
-
seen.add(key);
|
|
111
|
-
if (!resolveChannelConfigWrites({
|
|
112
|
-
cfg: params.cfg,
|
|
113
|
-
channelId: target.channelId,
|
|
114
|
-
accountId: target.accountId
|
|
115
|
-
})) return {
|
|
116
|
-
allowed: false,
|
|
117
|
-
reason: "target-disabled",
|
|
118
|
-
blockedScope: {
|
|
119
|
-
kind: "target",
|
|
120
|
-
scope: target
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return { allowed: true };
|
|
125
|
-
}
|
|
126
|
-
function resolveExplicitConfigWriteTarget(scope) {
|
|
127
|
-
if (!scope.channelId) return { kind: "global" };
|
|
128
|
-
const accountId = normalizeAccountId(scope.accountId);
|
|
129
|
-
if (!accountId || accountId === "default") return {
|
|
130
|
-
kind: "channel",
|
|
131
|
-
scope: { channelId: scope.channelId }
|
|
132
|
-
};
|
|
133
|
-
return {
|
|
134
|
-
kind: "account",
|
|
135
|
-
scope: {
|
|
136
|
-
channelId: scope.channelId,
|
|
137
|
-
accountId
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function resolveConfigWriteTargetFromPath(path) {
|
|
142
|
-
if (path[0] !== "channels") return { kind: "global" };
|
|
143
|
-
if (path.length < 2) return {
|
|
144
|
-
kind: "ambiguous",
|
|
145
|
-
scopes: []
|
|
146
|
-
};
|
|
147
|
-
const channelId = path[1].trim().toLowerCase();
|
|
148
|
-
if (!channelId) return {
|
|
149
|
-
kind: "ambiguous",
|
|
150
|
-
scopes: []
|
|
151
|
-
};
|
|
152
|
-
if (path.length === 2) return {
|
|
153
|
-
kind: "ambiguous",
|
|
154
|
-
scopes: [{ channelId }]
|
|
155
|
-
};
|
|
156
|
-
if (path[2] !== "accounts") return {
|
|
157
|
-
kind: "channel",
|
|
158
|
-
scope: { channelId }
|
|
159
|
-
};
|
|
160
|
-
if (path.length < 4) return {
|
|
161
|
-
kind: "ambiguous",
|
|
162
|
-
scopes: [{ channelId }]
|
|
163
|
-
};
|
|
164
|
-
return resolveExplicitConfigWriteTarget({
|
|
165
|
-
channelId,
|
|
166
|
-
accountId: normalizeAccountId(path[3])
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
function canBypassConfigWritePolicy(params) {
|
|
170
|
-
return isInternalMessageChannel(params.channel) && params.gatewayClientScopes?.includes("operator.admin") === true;
|
|
171
|
-
}
|
|
172
|
-
function formatConfigWriteDeniedMessage(params) {
|
|
173
|
-
if (params.result.reason === "ambiguous-target") return "ā ļø Channel-initiated /config writes cannot replace channels, channel roots, or accounts collections. Use a more specific path or gateway operator.admin.";
|
|
174
|
-
const blocked = params.result.blockedScope?.scope;
|
|
175
|
-
return `ā ļø Config writes are disabled for ${blocked?.channelId ?? params.fallbackChannelId ?? "this channel"}. Set ${blocked?.channelId ? blocked.accountId ? `channels.${blocked.channelId}.accounts.${blocked.accountId}.configWrites=true` : `channels.${blocked.channelId}.configWrites=true` : params.fallbackChannelId ? `channels.${params.fallbackChannelId}.configWrites=true` : "channels.<channel>.configWrites=true"} to enable.`;
|
|
176
|
-
}
|
|
177
|
-
function listConfigWriteTargetScopes(target) {
|
|
178
|
-
if (!target || target.kind === "global") return [];
|
|
179
|
-
if (target.kind === "ambiguous") return target.scopes;
|
|
180
|
-
return [target.scope];
|
|
181
|
-
}
|
|
182
|
-
function resolveChannelConfig(cfg, channelId) {
|
|
183
|
-
if (!channelId) return;
|
|
184
|
-
return cfg.channels?.[channelId];
|
|
185
|
-
}
|
|
186
|
-
function resolveChannelAccountConfig(channelConfig, accountId) {
|
|
187
|
-
return resolveAccountEntry(channelConfig.accounts, normalizeAccountId(accountId));
|
|
188
|
-
}
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/auto-reply/reply/config-write-authorization.ts
|
|
191
|
-
function resolveConfigWriteDeniedText(params) {
|
|
192
|
-
const writeAuth = authorizeConfigWrite({
|
|
193
|
-
cfg: params.cfg,
|
|
194
|
-
origin: {
|
|
195
|
-
channelId: params.channelId,
|
|
196
|
-
accountId: params.accountId
|
|
197
|
-
},
|
|
198
|
-
target: params.target,
|
|
199
|
-
allowBypass: canBypassConfigWritePolicy({
|
|
200
|
-
channel: params.channel ?? "",
|
|
201
|
-
gatewayClientScopes: params.gatewayClientScopes
|
|
202
|
-
})
|
|
203
|
-
});
|
|
204
|
-
if (writeAuth.allowed) return null;
|
|
205
|
-
return formatConfigWriteDeniedMessage({
|
|
206
|
-
result: writeAuth,
|
|
207
|
-
fallbackChannelId: params.channelId
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/auto-reply/reply/commands-allowlist.ts
|
|
212
|
-
const ACTIONS = new Set([
|
|
213
|
-
"list",
|
|
214
|
-
"add",
|
|
215
|
-
"remove"
|
|
216
|
-
]);
|
|
217
|
-
const SCOPES = new Set([
|
|
218
|
-
"dm",
|
|
219
|
-
"group",
|
|
220
|
-
"all"
|
|
221
|
-
]);
|
|
222
|
-
function parseAllowlistCommand(raw) {
|
|
223
|
-
const trimmed = raw.trim();
|
|
224
|
-
if (!trimmed.toLowerCase().startsWith("/allowlist")) return null;
|
|
225
|
-
const rest = trimmed.slice(10).trim();
|
|
226
|
-
if (!rest) return {
|
|
227
|
-
action: "list",
|
|
228
|
-
scope: "dm"
|
|
229
|
-
};
|
|
230
|
-
const tokens = rest.split(/\s+/);
|
|
231
|
-
let action = "list";
|
|
232
|
-
let scope = "dm";
|
|
233
|
-
let resolve = false;
|
|
234
|
-
let target = "both";
|
|
235
|
-
let channel;
|
|
236
|
-
let account;
|
|
237
|
-
const entryTokens = [];
|
|
238
|
-
let i = 0;
|
|
239
|
-
if (tokens[i] && ACTIONS.has(tokens[i].toLowerCase())) {
|
|
240
|
-
action = tokens[i].toLowerCase();
|
|
241
|
-
i += 1;
|
|
242
|
-
}
|
|
243
|
-
if (tokens[i] && SCOPES.has(tokens[i].toLowerCase())) {
|
|
244
|
-
scope = tokens[i].toLowerCase();
|
|
245
|
-
i += 1;
|
|
246
|
-
}
|
|
247
|
-
for (; i < tokens.length; i += 1) {
|
|
248
|
-
const token = tokens[i];
|
|
249
|
-
const lowered = token.toLowerCase();
|
|
250
|
-
if (lowered === "--resolve" || lowered === "resolve") {
|
|
251
|
-
resolve = true;
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
if (lowered === "--config" || lowered === "config") {
|
|
255
|
-
target = "config";
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
if (lowered === "--store" || lowered === "store") {
|
|
259
|
-
target = "store";
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
if (lowered === "--channel" && tokens[i + 1]) {
|
|
263
|
-
channel = tokens[i + 1];
|
|
264
|
-
i += 1;
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
if (lowered === "--account" && tokens[i + 1]) {
|
|
268
|
-
account = tokens[i + 1];
|
|
269
|
-
i += 1;
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
const kv = token.split("=");
|
|
273
|
-
if (kv.length === 2) {
|
|
274
|
-
const key = kv[0]?.trim().toLowerCase();
|
|
275
|
-
const value = kv[1]?.trim();
|
|
276
|
-
if (key === "channel") {
|
|
277
|
-
if (value) channel = value;
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
if (key === "account") {
|
|
281
|
-
if (value) account = value;
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
if (key === "scope" && value && SCOPES.has(value.toLowerCase())) {
|
|
285
|
-
scope = value.toLowerCase();
|
|
286
|
-
continue;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
entryTokens.push(token);
|
|
290
|
-
}
|
|
291
|
-
if (action === "add" || action === "remove") {
|
|
292
|
-
const entry = entryTokens.join(" ").trim();
|
|
293
|
-
if (!entry) return {
|
|
294
|
-
action: "error",
|
|
295
|
-
message: "Usage: /allowlist add|remove <entry>"
|
|
296
|
-
};
|
|
297
|
-
return {
|
|
298
|
-
action,
|
|
299
|
-
scope,
|
|
300
|
-
entry,
|
|
301
|
-
channel,
|
|
302
|
-
account,
|
|
303
|
-
resolve,
|
|
304
|
-
target
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
action: "list",
|
|
309
|
-
scope,
|
|
310
|
-
channel,
|
|
311
|
-
account,
|
|
312
|
-
resolve
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function normalizeAllowFrom(params) {
|
|
316
|
-
const plugin = getChannelPlugin(params.channelId);
|
|
317
|
-
if (plugin?.config.formatAllowFrom) return plugin.config.formatAllowFrom({
|
|
318
|
-
cfg: params.cfg,
|
|
319
|
-
accountId: params.accountId,
|
|
320
|
-
allowFrom: params.values
|
|
321
|
-
});
|
|
322
|
-
return normalizeStringEntries(params.values);
|
|
323
|
-
}
|
|
324
|
-
function formatEntryList(entries, resolved) {
|
|
325
|
-
if (entries.length === 0) return "(none)";
|
|
326
|
-
return entries.map((entry) => {
|
|
327
|
-
const name = resolved?.get(entry);
|
|
328
|
-
return name ? `${entry} (${name})` : entry;
|
|
329
|
-
}).join(", ");
|
|
330
|
-
}
|
|
331
|
-
async function updatePairingStoreAllowlist(params) {
|
|
332
|
-
const storeEntry = {
|
|
333
|
-
channel: params.channelId,
|
|
334
|
-
entry: params.entry,
|
|
335
|
-
accountId: params.accountId
|
|
336
|
-
};
|
|
337
|
-
if (params.action === "add") {
|
|
338
|
-
await addChannelAllowFromStoreEntry(storeEntry);
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
await removeChannelAllowFromStoreEntry(storeEntry);
|
|
342
|
-
if (params.accountId === "default") await removeChannelAllowFromStoreEntry({
|
|
343
|
-
channel: params.channelId,
|
|
344
|
-
entry: params.entry
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
function mapResolvedAllowlistNames(entries) {
|
|
348
|
-
const map = /* @__PURE__ */ new Map();
|
|
349
|
-
for (const entry of entries) if (entry.resolved && entry.name) map.set(entry.input, entry.name);
|
|
350
|
-
return map;
|
|
351
|
-
}
|
|
352
|
-
async function resolveAllowlistNames(params) {
|
|
353
|
-
return mapResolvedAllowlistNames(await getChannelPlugin(params.channelId)?.allowlist?.resolveNames?.({
|
|
354
|
-
cfg: params.cfg,
|
|
355
|
-
accountId: params.accountId,
|
|
356
|
-
scope: params.scope,
|
|
357
|
-
entries: params.entries
|
|
358
|
-
}) ?? []);
|
|
359
|
-
}
|
|
360
|
-
async function readAllowlistConfig(params) {
|
|
361
|
-
return await getChannelPlugin(params.channelId)?.allowlist?.readConfig?.({
|
|
362
|
-
cfg: params.cfg,
|
|
363
|
-
accountId: params.accountId
|
|
364
|
-
}) ?? {};
|
|
365
|
-
}
|
|
366
|
-
const handleAllowlistCommand = async (params, allowTextCommands) => {
|
|
367
|
-
if (!allowTextCommands) return null;
|
|
368
|
-
const parsed = parseAllowlistCommand(params.command.commandBodyNormalized);
|
|
369
|
-
if (!parsed) return null;
|
|
370
|
-
if (parsed.action === "error") return {
|
|
371
|
-
shouldContinue: false,
|
|
372
|
-
reply: { text: `ā ļø ${parsed.message}` }
|
|
373
|
-
};
|
|
374
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/allowlist");
|
|
375
|
-
if (unauthorized) return unauthorized;
|
|
376
|
-
const channelId = normalizeChannelId(parsed.channel) ?? params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
377
|
-
if (!channelId) return {
|
|
378
|
-
shouldContinue: false,
|
|
379
|
-
reply: { text: "ā ļø Unknown channel. Add channel=<id> to the command." }
|
|
380
|
-
};
|
|
381
|
-
if (parsed.account?.trim() && !normalizeOptionalAccountId(parsed.account)) return {
|
|
382
|
-
shouldContinue: false,
|
|
383
|
-
reply: { text: "ā ļø Invalid account id. Reserved keys (__proto__, constructor, prototype) are blocked." }
|
|
384
|
-
};
|
|
385
|
-
const accountId = normalizeAccountId(parsed.account ?? params.ctx.AccountId);
|
|
386
|
-
const plugin = getChannelPlugin(channelId);
|
|
387
|
-
if (parsed.action === "list") {
|
|
388
|
-
const supportsStore = Boolean(plugin?.pairing);
|
|
389
|
-
if (!plugin?.allowlist?.readConfig && !supportsStore) return {
|
|
390
|
-
shouldContinue: false,
|
|
391
|
-
reply: { text: `ā ļø ${channelId} does not expose allowlist configuration.` }
|
|
392
|
-
};
|
|
393
|
-
const storeAllowFrom = supportsStore ? await readChannelAllowFromStore(channelId, process.env, accountId).catch(() => []) : [];
|
|
394
|
-
const configState = await readAllowlistConfig({
|
|
395
|
-
cfg: params.cfg,
|
|
396
|
-
channelId,
|
|
397
|
-
accountId
|
|
398
|
-
});
|
|
399
|
-
const dmAllowFrom = (configState.dmAllowFrom ?? []).map(String);
|
|
400
|
-
const groupAllowFrom = (configState.groupAllowFrom ?? []).map(String);
|
|
401
|
-
const groupOverrides = (configState.groupOverrides ?? []).map((entry) => ({
|
|
402
|
-
label: entry.label,
|
|
403
|
-
entries: entry.entries.map(String).filter(Boolean)
|
|
404
|
-
}));
|
|
405
|
-
const dmDisplay = normalizeAllowFrom({
|
|
406
|
-
cfg: params.cfg,
|
|
407
|
-
channelId,
|
|
408
|
-
accountId,
|
|
409
|
-
values: dmAllowFrom
|
|
410
|
-
});
|
|
411
|
-
const groupDisplay = normalizeAllowFrom({
|
|
412
|
-
cfg: params.cfg,
|
|
413
|
-
channelId,
|
|
414
|
-
accountId,
|
|
415
|
-
values: groupAllowFrom
|
|
416
|
-
});
|
|
417
|
-
const groupOverrideEntries = groupOverrides.flatMap((entry) => entry.entries);
|
|
418
|
-
const groupOverrideDisplay = normalizeAllowFrom({
|
|
419
|
-
cfg: params.cfg,
|
|
420
|
-
channelId,
|
|
421
|
-
accountId,
|
|
422
|
-
values: groupOverrideEntries
|
|
423
|
-
});
|
|
424
|
-
const resolvedDm = parsed.resolve && dmDisplay.length > 0 ? await resolveAllowlistNames({
|
|
425
|
-
cfg: params.cfg,
|
|
426
|
-
channelId,
|
|
427
|
-
accountId,
|
|
428
|
-
scope: "dm",
|
|
429
|
-
entries: dmDisplay
|
|
430
|
-
}) : void 0;
|
|
431
|
-
const resolvedGroup = parsed.resolve && groupOverrideDisplay.length > 0 ? await resolveAllowlistNames({
|
|
432
|
-
cfg: params.cfg,
|
|
433
|
-
channelId,
|
|
434
|
-
accountId,
|
|
435
|
-
scope: "group",
|
|
436
|
-
entries: groupOverrideDisplay
|
|
437
|
-
}) : void 0;
|
|
438
|
-
const lines = ["š§¾ Allowlist"];
|
|
439
|
-
lines.push(`Channel: ${channelId}${accountId ? ` (account ${accountId})` : ""}`);
|
|
440
|
-
if (configState.dmPolicy) lines.push(`DM policy: ${configState.dmPolicy}`);
|
|
441
|
-
if (configState.groupPolicy) lines.push(`Group policy: ${configState.groupPolicy}`);
|
|
442
|
-
const showDm = parsed.scope === "dm" || parsed.scope === "all";
|
|
443
|
-
const showGroup = parsed.scope === "group" || parsed.scope === "all";
|
|
444
|
-
if (showDm) lines.push(`DM allowFrom (config): ${formatEntryList(dmDisplay, resolvedDm)}`);
|
|
445
|
-
if (supportsStore && storeAllowFrom.length > 0) {
|
|
446
|
-
const storeLabel = normalizeAllowFrom({
|
|
447
|
-
cfg: params.cfg,
|
|
448
|
-
channelId,
|
|
449
|
-
accountId,
|
|
450
|
-
values: storeAllowFrom
|
|
451
|
-
});
|
|
452
|
-
lines.push(`Paired allowFrom (store): ${formatEntryList(storeLabel)}`);
|
|
453
|
-
}
|
|
454
|
-
if (showGroup) {
|
|
455
|
-
if (groupAllowFrom.length > 0) lines.push(`Group allowFrom (config): ${formatEntryList(groupDisplay, resolvedGroup)}`);
|
|
456
|
-
if (groupOverrides.length > 0) {
|
|
457
|
-
lines.push("Group overrides:");
|
|
458
|
-
for (const entry of groupOverrides) {
|
|
459
|
-
const normalized = normalizeAllowFrom({
|
|
460
|
-
cfg: params.cfg,
|
|
461
|
-
channelId,
|
|
462
|
-
accountId,
|
|
463
|
-
values: entry.entries
|
|
464
|
-
});
|
|
465
|
-
lines.push(`- ${entry.label}: ${formatEntryList(normalized, resolvedGroup)}`);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return {
|
|
470
|
-
shouldContinue: false,
|
|
471
|
-
reply: { text: lines.join("\n") }
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
475
|
-
label: "/allowlist write",
|
|
476
|
-
allowedScopes: ["operator.admin"],
|
|
477
|
-
missingText: "ā /allowlist add|remove requires operator.admin for gateway clients."
|
|
478
|
-
});
|
|
479
|
-
if (missingAdminScope) return missingAdminScope;
|
|
480
|
-
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
481
|
-
label: "/allowlist edits",
|
|
482
|
-
configKey: "config",
|
|
483
|
-
disabledVerb: "are"
|
|
484
|
-
});
|
|
485
|
-
if (disabled) return disabled;
|
|
486
|
-
const shouldUpdateConfig = parsed.target !== "store";
|
|
487
|
-
const shouldTouchStore = parsed.target !== "config" && Boolean(plugin?.pairing);
|
|
488
|
-
if (shouldUpdateConfig) {
|
|
489
|
-
if (parsed.scope === "all") return {
|
|
490
|
-
shouldContinue: false,
|
|
491
|
-
reply: { text: "ā ļø /allowlist add|remove requires scope dm or group." }
|
|
492
|
-
};
|
|
493
|
-
if (!plugin?.allowlist?.applyConfigEdit) return {
|
|
494
|
-
shouldContinue: false,
|
|
495
|
-
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
496
|
-
};
|
|
497
|
-
const snapshot = await readConfigFileSnapshot();
|
|
498
|
-
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
499
|
-
shouldContinue: false,
|
|
500
|
-
reply: { text: "ā ļø Config file is invalid; fix it before using /allowlist." }
|
|
501
|
-
};
|
|
502
|
-
const parsedConfig = structuredClone(snapshot.parsed);
|
|
503
|
-
const editResult = await plugin.allowlist.applyConfigEdit({
|
|
504
|
-
cfg: params.cfg,
|
|
505
|
-
parsedConfig,
|
|
506
|
-
accountId,
|
|
507
|
-
scope: parsed.scope,
|
|
508
|
-
action: parsed.action,
|
|
509
|
-
entry: parsed.entry
|
|
510
|
-
});
|
|
511
|
-
if (!editResult) return {
|
|
512
|
-
shouldContinue: false,
|
|
513
|
-
reply: { text: `ā ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
514
|
-
};
|
|
515
|
-
if (editResult.kind === "invalid-entry") return {
|
|
516
|
-
shouldContinue: false,
|
|
517
|
-
reply: { text: "ā ļø Invalid allowlist entry." }
|
|
518
|
-
};
|
|
519
|
-
const deniedText = resolveConfigWriteDeniedText({
|
|
520
|
-
cfg: params.cfg,
|
|
521
|
-
channel: params.command.channel,
|
|
522
|
-
channelId,
|
|
523
|
-
accountId: params.ctx.AccountId,
|
|
524
|
-
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
525
|
-
target: editResult.writeTarget
|
|
526
|
-
});
|
|
527
|
-
if (deniedText) return {
|
|
528
|
-
shouldContinue: false,
|
|
529
|
-
reply: { text: deniedText }
|
|
530
|
-
};
|
|
531
|
-
const configChanged = editResult.changed;
|
|
532
|
-
if (configChanged) {
|
|
533
|
-
const validated = validateConfigObjectWithPlugins(parsedConfig);
|
|
534
|
-
if (!validated.ok) {
|
|
535
|
-
const issue = validated.issues[0];
|
|
536
|
-
return {
|
|
537
|
-
shouldContinue: false,
|
|
538
|
-
reply: { text: `ā ļø Config invalid after update (${issue.path}: ${issue.message}).` }
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
await writeConfigFile(validated.config);
|
|
542
|
-
}
|
|
543
|
-
if (!configChanged && !shouldTouchStore) return {
|
|
544
|
-
shouldContinue: false,
|
|
545
|
-
reply: { text: parsed.action === "add" ? "ā
Already allowlisted." : "ā ļø Entry not found." }
|
|
546
|
-
};
|
|
547
|
-
if (shouldTouchStore) await updatePairingStoreAllowlist({
|
|
548
|
-
action: parsed.action,
|
|
549
|
-
channelId,
|
|
550
|
-
accountId,
|
|
551
|
-
entry: parsed.entry
|
|
552
|
-
});
|
|
553
|
-
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
554
|
-
const scopeLabel = parsed.scope === "dm" ? "DM" : "group";
|
|
555
|
-
const locations = [];
|
|
556
|
-
if (configChanged) locations.push(editResult.pathLabel);
|
|
557
|
-
if (shouldTouchStore) locations.push("pairing store");
|
|
558
|
-
return {
|
|
559
|
-
shouldContinue: false,
|
|
560
|
-
reply: { text: `ā
${scopeLabel} allowlist ${actionLabel}: ${locations.length > 0 ? locations.join(" + ") : "no-op"}.` }
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
if (!shouldTouchStore) return {
|
|
564
|
-
shouldContinue: false,
|
|
565
|
-
reply: { text: "ā ļø This channel does not support allowlist storage." }
|
|
566
|
-
};
|
|
567
|
-
await updatePairingStoreAllowlist({
|
|
568
|
-
action: parsed.action,
|
|
569
|
-
channelId,
|
|
570
|
-
accountId,
|
|
571
|
-
entry: parsed.entry
|
|
572
|
-
});
|
|
573
|
-
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
574
|
-
return {
|
|
575
|
-
shouldContinue: false,
|
|
576
|
-
reply: { text: `ā
${parsed.scope === "dm" ? "DM" : "group"} allowlist ${actionLabel} in pairing store.` }
|
|
577
|
-
};
|
|
578
|
-
};
|
|
579
|
-
//#endregion
|
|
580
|
-
//#region src/infra/channel-approval-auth.ts
|
|
581
|
-
function resolveApprovalCommandAuthorization(params) {
|
|
582
|
-
const channel = normalizeMessageChannel(params.channel);
|
|
583
|
-
if (!channel) return {
|
|
584
|
-
authorized: true,
|
|
585
|
-
explicit: false
|
|
586
|
-
};
|
|
587
|
-
const approvalCapability = resolveChannelApprovalCapability(getChannelPlugin(channel));
|
|
588
|
-
const resolved = approvalCapability?.authorizeActorAction?.({
|
|
589
|
-
cfg: params.cfg,
|
|
590
|
-
accountId: params.accountId,
|
|
591
|
-
senderId: params.senderId,
|
|
592
|
-
action: "approve",
|
|
593
|
-
approvalKind: params.kind
|
|
594
|
-
});
|
|
595
|
-
if (!resolved) return {
|
|
596
|
-
authorized: true,
|
|
597
|
-
explicit: false
|
|
598
|
-
};
|
|
599
|
-
const availability = approvalCapability?.getActionAvailabilityState?.({
|
|
600
|
-
cfg: params.cfg,
|
|
601
|
-
accountId: params.accountId,
|
|
602
|
-
action: "approve"
|
|
603
|
-
});
|
|
604
|
-
return {
|
|
605
|
-
authorized: resolved.authorized,
|
|
606
|
-
reason: resolved.reason,
|
|
607
|
-
explicit: resolved.authorized ? availability?.kind !== "disabled" : true
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
//#endregion
|
|
611
|
-
//#region src/auto-reply/reply/commands-approve.ts
|
|
612
|
-
const COMMAND_REGEX = /^\/?approve(?:\s|$)/i;
|
|
613
|
-
const FOREIGN_COMMAND_MENTION_REGEX = /^\/approve@([^\s]+)(?:\s|$)/i;
|
|
614
|
-
const DECISION_ALIASES = {
|
|
615
|
-
allow: "allow-once",
|
|
616
|
-
once: "allow-once",
|
|
617
|
-
"allow-once": "allow-once",
|
|
618
|
-
allowonce: "allow-once",
|
|
619
|
-
always: "allow-always",
|
|
620
|
-
"allow-always": "allow-always",
|
|
621
|
-
allowalways: "allow-always",
|
|
622
|
-
deny: "deny",
|
|
623
|
-
reject: "deny",
|
|
624
|
-
block: "deny"
|
|
625
|
-
};
|
|
626
|
-
const APPROVE_USAGE_TEXT = "Usage: /approve <id> <decision> (see the pending approval message for available decisions)";
|
|
627
|
-
function parseApproveCommand(raw) {
|
|
628
|
-
const trimmed = raw.trim();
|
|
629
|
-
if (FOREIGN_COMMAND_MENTION_REGEX.test(trimmed)) return {
|
|
630
|
-
ok: false,
|
|
631
|
-
error: "ā This /approve command targets a different Telegram bot."
|
|
632
|
-
};
|
|
633
|
-
const commandMatch = trimmed.match(COMMAND_REGEX);
|
|
634
|
-
if (!commandMatch) return null;
|
|
635
|
-
const rest = trimmed.slice(commandMatch[0].length).trim();
|
|
636
|
-
if (!rest) return {
|
|
637
|
-
ok: false,
|
|
638
|
-
error: APPROVE_USAGE_TEXT
|
|
639
|
-
};
|
|
640
|
-
const tokens = rest.split(/\s+/).filter(Boolean);
|
|
641
|
-
if (tokens.length < 2) return {
|
|
642
|
-
ok: false,
|
|
643
|
-
error: APPROVE_USAGE_TEXT
|
|
644
|
-
};
|
|
645
|
-
const first = tokens[0].toLowerCase();
|
|
646
|
-
const second = tokens[1].toLowerCase();
|
|
647
|
-
if (DECISION_ALIASES[first]) return {
|
|
648
|
-
ok: true,
|
|
649
|
-
decision: DECISION_ALIASES[first],
|
|
650
|
-
id: tokens.slice(1).join(" ").trim()
|
|
651
|
-
};
|
|
652
|
-
if (DECISION_ALIASES[second]) return {
|
|
653
|
-
ok: true,
|
|
654
|
-
decision: DECISION_ALIASES[second],
|
|
655
|
-
id: tokens[0]
|
|
656
|
-
};
|
|
657
|
-
return {
|
|
658
|
-
ok: false,
|
|
659
|
-
error: APPROVE_USAGE_TEXT
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
function buildResolvedByLabel(params) {
|
|
663
|
-
return `${params.command.channel}:${params.command.senderId ?? "unknown"}`;
|
|
664
|
-
}
|
|
665
|
-
function isAuthorizedTelegramExecSender(params) {
|
|
666
|
-
if (params.command.channel !== "telegram") return false;
|
|
667
|
-
return isTelegramExecApprovalAuthorizedSender({
|
|
668
|
-
cfg: params.cfg,
|
|
669
|
-
accountId: params.ctx.AccountId,
|
|
670
|
-
senderId: params.command.senderId
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
function readErrorCode(value) {
|
|
674
|
-
return typeof value === "string" && value.trim() ? value : null;
|
|
675
|
-
}
|
|
676
|
-
function readApprovalNotFoundDetailsReason(value) {
|
|
677
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
678
|
-
const reason = value.reason;
|
|
679
|
-
return typeof reason === "string" && reason.trim() ? reason : null;
|
|
680
|
-
}
|
|
681
|
-
function isApprovalNotFoundError(err) {
|
|
682
|
-
if (!(err instanceof Error)) return false;
|
|
683
|
-
const gatewayCode = readErrorCode(err.gatewayCode);
|
|
684
|
-
if (gatewayCode === ErrorCodes.APPROVAL_NOT_FOUND) return true;
|
|
685
|
-
const detailsReason = readApprovalNotFoundDetailsReason(err.details);
|
|
686
|
-
if (gatewayCode === ErrorCodes.INVALID_REQUEST && detailsReason === ErrorCodes.APPROVAL_NOT_FOUND) return true;
|
|
687
|
-
return /unknown or expired approval id/i.test(err.message);
|
|
688
|
-
}
|
|
689
|
-
function formatApprovalSubmitError(error) {
|
|
690
|
-
return error instanceof Error ? error.message : String(error);
|
|
691
|
-
}
|
|
692
|
-
function resolveApprovalMethods(params) {
|
|
693
|
-
if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.authorized ? ["plugin.approval.resolve"] : [];
|
|
694
|
-
if (params.execAuthorization.authorized && params.pluginAuthorization.authorized) return ["exec.approval.resolve", "plugin.approval.resolve"];
|
|
695
|
-
if (params.execAuthorization.authorized) return ["exec.approval.resolve"];
|
|
696
|
-
if (params.pluginAuthorization.authorized) return ["plugin.approval.resolve"];
|
|
697
|
-
return [];
|
|
698
|
-
}
|
|
699
|
-
function resolveApprovalAuthorizationError(params) {
|
|
700
|
-
if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.reason ?? "ā You are not authorized to approve this request.";
|
|
701
|
-
return params.execAuthorization.reason ?? params.pluginAuthorization.reason ?? "ā You are not authorized to approve this request.";
|
|
702
|
-
}
|
|
703
|
-
const handleApproveCommand = async (params, allowTextCommands) => {
|
|
704
|
-
if (!allowTextCommands) return null;
|
|
705
|
-
const normalized = params.command.commandBodyNormalized;
|
|
706
|
-
const parsed = parseApproveCommand(normalized);
|
|
707
|
-
if (!parsed) return null;
|
|
708
|
-
if (!parsed.ok) return {
|
|
709
|
-
shouldContinue: false,
|
|
710
|
-
reply: { text: parsed.error }
|
|
711
|
-
};
|
|
712
|
-
const isPluginId = parsed.id.startsWith("plugin:");
|
|
713
|
-
const telegramExecAuthorizedSender = isAuthorizedTelegramExecSender(params);
|
|
714
|
-
const execApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
715
|
-
cfg: params.cfg,
|
|
716
|
-
channel: params.command.channel,
|
|
717
|
-
accountId: params.ctx.AccountId,
|
|
718
|
-
senderId: params.command.senderId,
|
|
719
|
-
kind: "exec"
|
|
720
|
-
});
|
|
721
|
-
const pluginApprovalAuthorization = resolveApprovalCommandAuthorization({
|
|
722
|
-
cfg: params.cfg,
|
|
723
|
-
channel: params.command.channel,
|
|
724
|
-
accountId: params.ctx.AccountId,
|
|
725
|
-
senderId: params.command.senderId,
|
|
726
|
-
kind: "plugin"
|
|
727
|
-
});
|
|
728
|
-
const hasExplicitApprovalAuthorization = execApprovalAuthorization.explicit && execApprovalAuthorization.authorized || pluginApprovalAuthorization.explicit && pluginApprovalAuthorization.authorized;
|
|
729
|
-
if (!params.command.isAuthorizedSender && !hasExplicitApprovalAuthorization) {
|
|
730
|
-
logVerbose(`Ignoring /approve from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
731
|
-
return { shouldContinue: false };
|
|
732
|
-
}
|
|
733
|
-
if (params.command.channel === "telegram" && !isPluginId && !telegramExecAuthorizedSender && !isTelegramExecApprovalClientEnabled({
|
|
734
|
-
cfg: params.cfg,
|
|
735
|
-
accountId: params.ctx.AccountId
|
|
736
|
-
})) return {
|
|
737
|
-
shouldContinue: false,
|
|
738
|
-
reply: { text: "ā Telegram exec approvals are not enabled for this bot account." }
|
|
739
|
-
};
|
|
740
|
-
const missingScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
741
|
-
label: "/approve",
|
|
742
|
-
allowedScopes: ["operator.approvals", "operator.admin"],
|
|
743
|
-
missingText: "ā /approve requires operator.approvals for gateway clients."
|
|
744
|
-
});
|
|
745
|
-
if (missingScope) return missingScope;
|
|
746
|
-
const resolvedBy = buildResolvedByLabel(params);
|
|
747
|
-
const callApprovalMethod = async (method) => {
|
|
748
|
-
await callGateway({
|
|
749
|
-
method,
|
|
750
|
-
params: {
|
|
751
|
-
id: parsed.id,
|
|
752
|
-
decision: parsed.decision
|
|
753
|
-
},
|
|
754
|
-
clientName: GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
755
|
-
clientDisplayName: `Chat approval (${resolvedBy})`,
|
|
756
|
-
mode: GATEWAY_CLIENT_MODES.BACKEND
|
|
757
|
-
});
|
|
758
|
-
};
|
|
759
|
-
const methods = resolveApprovalMethods({
|
|
760
|
-
approvalId: parsed.id,
|
|
761
|
-
execAuthorization: execApprovalAuthorization,
|
|
762
|
-
pluginAuthorization: pluginApprovalAuthorization
|
|
763
|
-
});
|
|
764
|
-
if (methods.length === 0) return {
|
|
765
|
-
shouldContinue: false,
|
|
766
|
-
reply: { text: resolveApprovalAuthorizationError({
|
|
767
|
-
approvalId: parsed.id,
|
|
768
|
-
execAuthorization: execApprovalAuthorization,
|
|
769
|
-
pluginAuthorization: pluginApprovalAuthorization
|
|
770
|
-
}) }
|
|
771
|
-
};
|
|
772
|
-
let lastError = null;
|
|
773
|
-
for (const [index, method] of methods.entries()) try {
|
|
774
|
-
await callApprovalMethod(method);
|
|
775
|
-
lastError = null;
|
|
776
|
-
break;
|
|
777
|
-
} catch (error) {
|
|
778
|
-
lastError = error;
|
|
779
|
-
const isLastMethod = index === methods.length - 1;
|
|
780
|
-
if (!isApprovalNotFoundError(error) || isLastMethod) return {
|
|
781
|
-
shouldContinue: false,
|
|
782
|
-
reply: { text: `ā Failed to submit approval: ${formatApprovalSubmitError(error)}` }
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
if (lastError) return {
|
|
786
|
-
shouldContinue: false,
|
|
787
|
-
reply: { text: `ā Failed to submit approval: ${formatApprovalSubmitError(lastError)}` }
|
|
788
|
-
};
|
|
789
|
-
return {
|
|
790
|
-
shouldContinue: false,
|
|
791
|
-
reply: { text: `ā
Approval ${parsed.decision} submitted for ${parsed.id}.` }
|
|
792
|
-
};
|
|
793
|
-
};
|
|
794
|
-
//#endregion
|
|
795
|
-
//#region src/auto-reply/reply/bash-command.ts
|
|
796
|
-
const CHAT_BASH_SCOPE_KEY = "chat:bash";
|
|
797
|
-
const DEFAULT_FOREGROUND_MS = 2e3;
|
|
798
|
-
const MAX_FOREGROUND_MS = 3e4;
|
|
799
|
-
let activeJob = null;
|
|
800
|
-
function resolveForegroundMs(cfg) {
|
|
801
|
-
const raw = cfg.commands?.bashForegroundMs;
|
|
802
|
-
if (typeof raw !== "number" || Number.isNaN(raw)) return DEFAULT_FOREGROUND_MS;
|
|
803
|
-
return clampInt(raw, 0, MAX_FOREGROUND_MS);
|
|
804
|
-
}
|
|
805
|
-
function formatSessionSnippet(sessionId) {
|
|
806
|
-
const trimmed = sessionId.trim();
|
|
807
|
-
if (trimmed.length <= 12) return trimmed;
|
|
808
|
-
return `${trimmed.slice(0, 8)}ā¦`;
|
|
809
|
-
}
|
|
810
|
-
function formatOutputBlock(text) {
|
|
811
|
-
const trimmed = text.trim();
|
|
812
|
-
if (!trimmed) return "(no output)";
|
|
813
|
-
return `\`\`\`txt\n${trimmed}\n\`\`\``;
|
|
814
|
-
}
|
|
815
|
-
function parseBashRequest(raw) {
|
|
816
|
-
const trimmed = raw.trimStart();
|
|
817
|
-
let restSource = "";
|
|
818
|
-
if (trimmed.toLowerCase().startsWith("/bash")) {
|
|
819
|
-
const match = trimmed.match(/^\/bash(?:\s*:\s*|\s+|$)([\s\S]*)$/i);
|
|
820
|
-
if (!match) return null;
|
|
821
|
-
restSource = match[1] ?? "";
|
|
822
|
-
} else if (trimmed.startsWith("!")) {
|
|
823
|
-
restSource = trimmed.slice(1);
|
|
824
|
-
if (restSource.trimStart().startsWith(":")) restSource = restSource.trimStart().slice(1);
|
|
825
|
-
} else return null;
|
|
826
|
-
const rest = restSource.trimStart();
|
|
827
|
-
if (!rest) return { action: "help" };
|
|
828
|
-
const tokenMatch = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
829
|
-
const token = tokenMatch?.[1]?.trim() ?? "";
|
|
830
|
-
const remainder = tokenMatch?.[2]?.trim() ?? "";
|
|
831
|
-
const lowered = token.toLowerCase();
|
|
832
|
-
if (lowered === "poll") return {
|
|
833
|
-
action: "poll",
|
|
834
|
-
sessionId: remainder || void 0
|
|
835
|
-
};
|
|
836
|
-
if (lowered === "stop") return {
|
|
837
|
-
action: "stop",
|
|
838
|
-
sessionId: remainder || void 0
|
|
839
|
-
};
|
|
840
|
-
if (lowered === "help") return { action: "help" };
|
|
841
|
-
return {
|
|
842
|
-
action: "run",
|
|
843
|
-
command: rest
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
function resolveRawCommandBody(params) {
|
|
847
|
-
const stripped = stripStructuralPrefixes(params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body ?? "");
|
|
848
|
-
return params.isGroup ? stripMentions(stripped, params.ctx, params.cfg, params.agentId) : stripped;
|
|
849
|
-
}
|
|
850
|
-
function getScopedSession(sessionId) {
|
|
851
|
-
const running = getSession(sessionId);
|
|
852
|
-
if (running && running.scopeKey === CHAT_BASH_SCOPE_KEY) return { running };
|
|
853
|
-
const finished = getFinishedSession(sessionId);
|
|
854
|
-
if (finished && finished.scopeKey === CHAT_BASH_SCOPE_KEY) return { finished };
|
|
855
|
-
return {};
|
|
856
|
-
}
|
|
857
|
-
function ensureActiveJobState() {
|
|
858
|
-
if (!activeJob) return null;
|
|
859
|
-
if (activeJob.state === "starting") return activeJob;
|
|
860
|
-
const { running, finished } = getScopedSession(activeJob.sessionId);
|
|
861
|
-
if (running) return activeJob;
|
|
862
|
-
if (finished) {
|
|
863
|
-
activeJob = null;
|
|
864
|
-
return null;
|
|
865
|
-
}
|
|
866
|
-
activeJob = null;
|
|
867
|
-
return null;
|
|
868
|
-
}
|
|
869
|
-
function attachActiveWatcher(sessionId) {
|
|
870
|
-
if (!activeJob || activeJob.state !== "running") return;
|
|
871
|
-
if (activeJob.sessionId !== sessionId) return;
|
|
872
|
-
if (activeJob.watcherAttached) return;
|
|
873
|
-
const { running } = getScopedSession(sessionId);
|
|
874
|
-
const child = running?.child;
|
|
875
|
-
if (!child) return;
|
|
876
|
-
activeJob.watcherAttached = true;
|
|
877
|
-
child.once("close", () => {
|
|
878
|
-
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
|
-
function buildUsageReply() {
|
|
882
|
-
return { text: [
|
|
883
|
-
"āļø Usage:",
|
|
884
|
-
"- ! <command>",
|
|
885
|
-
"- !poll | ! poll",
|
|
886
|
-
"- !stop | ! stop",
|
|
887
|
-
"- /bash ... (alias; same subcommands as !)"
|
|
888
|
-
].join("\n") };
|
|
889
|
-
}
|
|
890
|
-
async function handleBashChatCommand(params) {
|
|
891
|
-
if (!isCommandFlagEnabled(params.cfg, "bash")) return buildDisabledCommandReply({
|
|
892
|
-
label: "bash",
|
|
893
|
-
configKey: "bash",
|
|
894
|
-
docsUrl: "https://docs.stableclaw.ai/tools/slash-commands#config"
|
|
895
|
-
});
|
|
896
|
-
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
897
|
-
sessionKey: params.sessionKey,
|
|
898
|
-
config: params.cfg
|
|
899
|
-
});
|
|
900
|
-
if (!params.elevated.enabled || !params.elevated.allowed) {
|
|
901
|
-
const runtimeSandboxed = resolveSandboxRuntimeStatus({
|
|
902
|
-
cfg: params.cfg,
|
|
903
|
-
sessionKey: params.ctx.SessionKey
|
|
904
|
-
}).sandboxed;
|
|
905
|
-
return { text: formatElevatedUnavailableMessage({
|
|
906
|
-
runtimeSandboxed,
|
|
907
|
-
failures: params.elevated.failures,
|
|
908
|
-
sessionKey: params.ctx.SessionKey
|
|
909
|
-
}) };
|
|
910
|
-
}
|
|
911
|
-
const request = parseBashRequest(resolveRawCommandBody({
|
|
912
|
-
ctx: params.ctx,
|
|
913
|
-
cfg: params.cfg,
|
|
914
|
-
agentId,
|
|
915
|
-
isGroup: params.isGroup
|
|
916
|
-
}).trim());
|
|
917
|
-
if (!request) return { text: "ā ļø Unrecognized bash request." };
|
|
918
|
-
const liveJob = ensureActiveJobState();
|
|
919
|
-
if (request.action === "help") return buildUsageReply();
|
|
920
|
-
if (request.action === "poll") {
|
|
921
|
-
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
922
|
-
if (!sessionId) return { text: "āļø No active bash job." };
|
|
923
|
-
const { running, finished } = getScopedSession(sessionId);
|
|
924
|
-
if (running) {
|
|
925
|
-
attachActiveWatcher(sessionId);
|
|
926
|
-
const runtimeSec = Math.max(0, Math.floor((Date.now() - running.startedAt) / 1e3));
|
|
927
|
-
const tail = running.tail || "(no output yet)";
|
|
928
|
-
return { text: [
|
|
929
|
-
`āļø bash still running (session ${formatSessionSnippet(sessionId)}, ${runtimeSec}s).`,
|
|
930
|
-
formatOutputBlock(tail),
|
|
931
|
-
"Hint: !stop (or /bash stop)"
|
|
932
|
-
].join("\n") };
|
|
933
|
-
}
|
|
934
|
-
if (finished) {
|
|
935
|
-
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
936
|
-
const exitLabel = finished.exitSignal ? `signal ${String(finished.exitSignal)}` : `code ${String(finished.exitCode ?? 0)}`;
|
|
937
|
-
return { text: [
|
|
938
|
-
`${finished.status === "completed" ? "āļø" : "ā ļø"} bash finished (session ${formatSessionSnippet(sessionId)}).`,
|
|
939
|
-
`Exit: ${exitLabel}`,
|
|
940
|
-
formatOutputBlock(finished.aggregated || finished.tail)
|
|
941
|
-
].join("\n") };
|
|
942
|
-
}
|
|
943
|
-
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
944
|
-
return { text: `āļø No bash session found for ${formatSessionSnippet(sessionId)}.` };
|
|
945
|
-
}
|
|
946
|
-
if (request.action === "stop") {
|
|
947
|
-
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
948
|
-
if (!sessionId) return { text: "āļø No active bash job." };
|
|
949
|
-
const { running } = getScopedSession(sessionId);
|
|
950
|
-
if (!running) {
|
|
951
|
-
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
952
|
-
return { text: `āļø No running bash job found for ${formatSessionSnippet(sessionId)}.` };
|
|
953
|
-
}
|
|
954
|
-
if (!running.backgrounded) return { text: `ā ļø Session ${formatSessionSnippet(sessionId)} is not backgrounded.` };
|
|
955
|
-
const pid = running.pid ?? running.child?.pid;
|
|
956
|
-
if (!pid) return { text: `ā ļø Unable to stop bash session ${formatSessionSnippet(sessionId)} because no process ID is available. Use !poll ${sessionId} to check whether it exits on its own.` };
|
|
957
|
-
const { killProcessTree } = await import("./kill-tree-CIfAbzdN.js");
|
|
958
|
-
killProcessTree(pid);
|
|
959
|
-
return { text: `āļø bash stopping (session ${formatSessionSnippet(sessionId)}). Use !poll ${sessionId} to confirm exit.` };
|
|
960
|
-
}
|
|
961
|
-
if (liveJob) return { text: `ā ļø A bash job is already running (${liveJob.state === "running" ? formatSessionSnippet(liveJob.sessionId) : "starting"}). Use !poll / !stop (or /bash poll / /bash stop).` };
|
|
962
|
-
const commandText = request.command.trim();
|
|
963
|
-
if (!commandText) return buildUsageReply();
|
|
964
|
-
activeJob = {
|
|
965
|
-
state: "starting",
|
|
966
|
-
startedAt: Date.now(),
|
|
967
|
-
command: commandText
|
|
968
|
-
};
|
|
969
|
-
try {
|
|
970
|
-
const foregroundMs = resolveForegroundMs(params.cfg);
|
|
971
|
-
const shouldBackgroundImmediately = foregroundMs <= 0;
|
|
972
|
-
const timeoutSec = params.cfg.tools?.exec?.timeoutSec;
|
|
973
|
-
const notifyOnExit = params.cfg.tools?.exec?.notifyOnExit;
|
|
974
|
-
const notifyOnExitEmptySuccess = params.cfg.tools?.exec?.notifyOnExitEmptySuccess;
|
|
975
|
-
const result = await createExecTool({
|
|
976
|
-
scopeKey: CHAT_BASH_SCOPE_KEY,
|
|
977
|
-
allowBackground: true,
|
|
978
|
-
timeoutSec,
|
|
979
|
-
sessionKey: params.sessionKey,
|
|
980
|
-
notifyOnExit,
|
|
981
|
-
notifyOnExitEmptySuccess,
|
|
982
|
-
elevated: {
|
|
983
|
-
enabled: params.elevated.enabled,
|
|
984
|
-
allowed: params.elevated.allowed,
|
|
985
|
-
defaultLevel: "on"
|
|
986
|
-
}
|
|
987
|
-
}).execute("chat-bash", {
|
|
988
|
-
command: commandText,
|
|
989
|
-
background: shouldBackgroundImmediately,
|
|
990
|
-
yieldMs: shouldBackgroundImmediately ? void 0 : foregroundMs,
|
|
991
|
-
timeout: timeoutSec,
|
|
992
|
-
elevated: true
|
|
993
|
-
});
|
|
994
|
-
if (result.details?.status === "running") {
|
|
995
|
-
const sessionId = result.details.sessionId;
|
|
996
|
-
activeJob = {
|
|
997
|
-
state: "running",
|
|
998
|
-
sessionId,
|
|
999
|
-
startedAt: result.details.startedAt,
|
|
1000
|
-
command: commandText,
|
|
1001
|
-
watcherAttached: false
|
|
1002
|
-
};
|
|
1003
|
-
attachActiveWatcher(sessionId);
|
|
1004
|
-
logVerbose(`Started bash session ${formatSessionSnippet(sessionId)}: ${commandText}`);
|
|
1005
|
-
return { text: `āļø bash started (session ${sessionId}). Still running; use !poll / !stop (or /bash poll / /bash stop).` };
|
|
1006
|
-
}
|
|
1007
|
-
activeJob = null;
|
|
1008
|
-
const exitCode = result.details?.status === "completed" ? result.details.exitCode : 0;
|
|
1009
|
-
const output = result.details?.status === "completed" ? result.details.aggregated : result.content.map((chunk) => chunk.type === "text" ? chunk.text : "").join("\n");
|
|
1010
|
-
return { text: [
|
|
1011
|
-
`āļø bash: ${commandText}`,
|
|
1012
|
-
`Exit: ${exitCode}`,
|
|
1013
|
-
formatOutputBlock(output || "(no output)")
|
|
1014
|
-
].join("\n") };
|
|
1015
|
-
} catch (err) {
|
|
1016
|
-
activeJob = null;
|
|
1017
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
1018
|
-
return { text: [`ā ļø bash failed: ${commandText}`, formatOutputBlock(message)].join("\n") };
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
//#endregion
|
|
1022
|
-
//#region src/auto-reply/reply/commands-bash.ts
|
|
1023
|
-
const handleBashCommand = async (params, allowTextCommands) => {
|
|
1024
|
-
if (!allowTextCommands) return null;
|
|
1025
|
-
const { command } = params;
|
|
1026
|
-
const bashSlashRequested = command.commandBodyNormalized === "/bash" || command.commandBodyNormalized.startsWith("/bash ");
|
|
1027
|
-
const bashBangRequested = command.commandBodyNormalized.startsWith("!");
|
|
1028
|
-
if (!bashSlashRequested && !(bashBangRequested && command.isAuthorizedSender)) return null;
|
|
1029
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/bash");
|
|
1030
|
-
if (unauthorized) return unauthorized;
|
|
1031
|
-
return {
|
|
1032
|
-
shouldContinue: false,
|
|
1033
|
-
reply: await handleBashChatCommand({
|
|
1034
|
-
ctx: params.ctx,
|
|
1035
|
-
cfg: params.cfg,
|
|
1036
|
-
agentId: params.agentId,
|
|
1037
|
-
sessionKey: params.sessionKey,
|
|
1038
|
-
isGroup: params.isGroup,
|
|
1039
|
-
elevated: params.elevated
|
|
1040
|
-
})
|
|
1041
|
-
};
|
|
1042
|
-
};
|
|
1043
|
-
//#endregion
|
|
1044
|
-
//#region src/agents/btw.ts
|
|
1045
|
-
function collectTextContent(content) {
|
|
1046
|
-
return content.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
1047
|
-
}
|
|
1048
|
-
function collectThinkingContent(content) {
|
|
1049
|
-
return content.filter((part) => part.type === "thinking").map((part) => part.thinking).join("");
|
|
1050
|
-
}
|
|
1051
|
-
function buildBtwSystemPrompt() {
|
|
1052
|
-
return [
|
|
1053
|
-
"You are answering an ephemeral /btw side question about the current conversation.",
|
|
1054
|
-
"Use the conversation only as background context.",
|
|
1055
|
-
"Answer only the side question in the last user message.",
|
|
1056
|
-
"Do not continue, resume, or complete any unfinished task from the conversation.",
|
|
1057
|
-
"Do not emit tool calls, pseudo-tool calls, shell commands, file writes, patches, or code unless the side question explicitly asks for them.",
|
|
1058
|
-
"Do not say you will continue the main task after answering.",
|
|
1059
|
-
"If the question can be answered briefly, answer briefly."
|
|
1060
|
-
].join("\n");
|
|
1061
|
-
}
|
|
1062
|
-
function buildBtwQuestionPrompt(question, inFlightPrompt) {
|
|
1063
|
-
const lines = ["Answer this side question only.", "Ignore any unfinished task in the conversation while answering it."];
|
|
1064
|
-
const trimmedPrompt = inFlightPrompt?.trim();
|
|
1065
|
-
if (trimmedPrompt) lines.push("", "Current in-flight main task request for background context only:", "<in_flight_main_task>", trimmedPrompt, "</in_flight_main_task>", "Do not continue or complete that task while answering the side question.");
|
|
1066
|
-
lines.push("", "<btw_side_question>", question.trim(), "</btw_side_question>");
|
|
1067
|
-
return lines.join("\n");
|
|
1068
|
-
}
|
|
1069
|
-
function toSimpleContextMessages(messages) {
|
|
1070
|
-
return stripToolResultDetails(messages.filter((message) => {
|
|
1071
|
-
if (!message || typeof message !== "object") return false;
|
|
1072
|
-
const role = message.role;
|
|
1073
|
-
return role === "user" || role === "assistant";
|
|
1074
|
-
}));
|
|
1075
|
-
}
|
|
1076
|
-
function resolveSessionTranscriptPath(params) {
|
|
1077
|
-
try {
|
|
1078
|
-
const agentId = params.sessionKey?.split(":")[1];
|
|
1079
|
-
const pathOpts = resolveSessionFilePathOptions({
|
|
1080
|
-
agentId,
|
|
1081
|
-
storePath: params.storePath
|
|
1082
|
-
});
|
|
1083
|
-
return resolveSessionFilePath(params.sessionId, params.sessionEntry, pathOpts);
|
|
1084
|
-
} catch (error) {
|
|
1085
|
-
diag.debug(`resolveSessionTranscriptPath failed: sessionId=${params.sessionId} err=${String(error)}`);
|
|
1086
|
-
return;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
async function resolveRuntimeModel(params) {
|
|
1090
|
-
await ensureOpenClawModelsJson(params.cfg, params.agentDir);
|
|
1091
|
-
const modelRegistry = discoverModels(discoverAuthStorage(params.agentDir), params.agentDir);
|
|
1092
|
-
const model = resolveModelWithRegistry({
|
|
1093
|
-
provider: params.provider,
|
|
1094
|
-
modelId: params.model,
|
|
1095
|
-
modelRegistry,
|
|
1096
|
-
cfg: params.cfg
|
|
1097
|
-
});
|
|
1098
|
-
if (!model) throw new Error(`Unknown model: ${params.provider}/${params.model}`);
|
|
1099
|
-
return {
|
|
1100
|
-
model,
|
|
1101
|
-
authProfileId: await resolveSessionAuthProfileOverride({
|
|
1102
|
-
cfg: params.cfg,
|
|
1103
|
-
provider: params.provider,
|
|
1104
|
-
agentDir: params.agentDir,
|
|
1105
|
-
sessionEntry: params.sessionEntry,
|
|
1106
|
-
sessionStore: params.sessionStore,
|
|
1107
|
-
sessionKey: params.sessionKey,
|
|
1108
|
-
storePath: params.storePath,
|
|
1109
|
-
isNewSession: params.isNewSession
|
|
1110
|
-
}),
|
|
1111
|
-
authProfileIdSource: params.sessionEntry?.authProfileOverrideSource
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
async function runBtwSideQuestion(params) {
|
|
1115
|
-
const sessionId = params.sessionEntry.sessionId?.trim();
|
|
1116
|
-
if (!sessionId) throw new Error("No active session context.");
|
|
1117
|
-
const sessionFile = resolveSessionTranscriptPath({
|
|
1118
|
-
sessionId,
|
|
1119
|
-
sessionEntry: params.sessionEntry,
|
|
1120
|
-
sessionKey: params.sessionKey,
|
|
1121
|
-
storePath: params.storePath
|
|
1122
|
-
});
|
|
1123
|
-
if (!sessionFile) throw new Error("No active session transcript.");
|
|
1124
|
-
const sessionManager = SessionManager.open(sessionFile);
|
|
1125
|
-
const activeRunSnapshot = getActiveEmbeddedRunSnapshot(sessionId);
|
|
1126
|
-
let messages = [];
|
|
1127
|
-
let inFlightPrompt;
|
|
1128
|
-
if (Array.isArray(activeRunSnapshot?.messages) && activeRunSnapshot.messages.length > 0) {
|
|
1129
|
-
messages = toSimpleContextMessages(activeRunSnapshot.messages);
|
|
1130
|
-
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1131
|
-
} else if (activeRunSnapshot) {
|
|
1132
|
-
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
1133
|
-
if (activeRunSnapshot.transcriptLeafId && sessionManager.branch) try {
|
|
1134
|
-
sessionManager.branch(activeRunSnapshot.transcriptLeafId);
|
|
1135
|
-
} catch (error) {
|
|
1136
|
-
diag.debug(`btw snapshot leaf unavailable: sessionId=${sessionId} leaf=${activeRunSnapshot.transcriptLeafId} err=${String(error)}`);
|
|
1137
|
-
sessionManager.resetLeaf?.();
|
|
1138
|
-
}
|
|
1139
|
-
else sessionManager.resetLeaf?.();
|
|
1140
|
-
} else {
|
|
1141
|
-
const leafEntry = sessionManager.getLeafEntry?.();
|
|
1142
|
-
if (leafEntry?.type === "message" && leafEntry.message?.role === "user") if (leafEntry.parentId && sessionManager.branch) sessionManager.branch(leafEntry.parentId);
|
|
1143
|
-
else sessionManager.resetLeaf?.();
|
|
1144
|
-
}
|
|
1145
|
-
if (messages.length === 0) {
|
|
1146
|
-
const sessionContext = sessionManager.buildSessionContext();
|
|
1147
|
-
messages = toSimpleContextMessages(Array.isArray(sessionContext.messages) ? sessionContext.messages : []);
|
|
1148
|
-
}
|
|
1149
|
-
if (messages.length === 0 && !inFlightPrompt?.trim()) throw new Error("No active session context.");
|
|
1150
|
-
const { model, authProfileId } = await resolveRuntimeModel({
|
|
1151
|
-
cfg: params.cfg,
|
|
1152
|
-
provider: params.provider,
|
|
1153
|
-
model: params.model,
|
|
1154
|
-
agentDir: params.agentDir,
|
|
1155
|
-
sessionEntry: params.sessionEntry,
|
|
1156
|
-
sessionStore: params.sessionStore,
|
|
1157
|
-
sessionKey: params.sessionKey,
|
|
1158
|
-
storePath: params.storePath,
|
|
1159
|
-
isNewSession: params.isNewSession
|
|
1160
|
-
});
|
|
1161
|
-
const apiKey = requireApiKey(await getApiKeyForModel({
|
|
1162
|
-
model,
|
|
1163
|
-
cfg: params.cfg,
|
|
1164
|
-
profileId: authProfileId,
|
|
1165
|
-
agentDir: params.agentDir
|
|
1166
|
-
}), model.provider);
|
|
1167
|
-
const chunker = params.opts?.onBlockReply && params.blockReplyChunking ? new EmbeddedBlockChunker(params.blockReplyChunking) : void 0;
|
|
1168
|
-
let emittedBlocks = 0;
|
|
1169
|
-
let blockEmitChain = Promise.resolve();
|
|
1170
|
-
let answerText = "";
|
|
1171
|
-
let reasoningText = "";
|
|
1172
|
-
let assistantStarted = false;
|
|
1173
|
-
let sawTextEvent = false;
|
|
1174
|
-
const emitBlockChunk = async (text) => {
|
|
1175
|
-
if (!text.trim() || !params.opts?.onBlockReply) return;
|
|
1176
|
-
emittedBlocks += 1;
|
|
1177
|
-
blockEmitChain = blockEmitChain.then(async () => {
|
|
1178
|
-
await params.opts?.onBlockReply?.({
|
|
1179
|
-
text,
|
|
1180
|
-
btw: { question: params.question }
|
|
1181
|
-
});
|
|
1182
|
-
});
|
|
1183
|
-
await blockEmitChain;
|
|
1184
|
-
};
|
|
1185
|
-
const stream = streamSimple(model, {
|
|
1186
|
-
systemPrompt: buildBtwSystemPrompt(),
|
|
1187
|
-
messages: [...messages, {
|
|
1188
|
-
role: "user",
|
|
1189
|
-
content: [{
|
|
1190
|
-
type: "text",
|
|
1191
|
-
text: buildBtwQuestionPrompt(params.question, inFlightPrompt)
|
|
1192
|
-
}],
|
|
1193
|
-
timestamp: Date.now()
|
|
1194
|
-
}]
|
|
1195
|
-
}, {
|
|
1196
|
-
apiKey,
|
|
1197
|
-
reasoning: void 0,
|
|
1198
|
-
signal: params.opts?.abortSignal
|
|
1199
|
-
});
|
|
1200
|
-
let finalEvent;
|
|
1201
|
-
for await (const event of stream) {
|
|
1202
|
-
finalEvent = event.type === "done" || event.type === "error" ? event : finalEvent;
|
|
1203
|
-
if (!assistantStarted && (event.type === "text_start" || event.type === "start")) {
|
|
1204
|
-
assistantStarted = true;
|
|
1205
|
-
await params.opts?.onAssistantMessageStart?.();
|
|
1206
|
-
}
|
|
1207
|
-
if (event.type === "text_delta") {
|
|
1208
|
-
sawTextEvent = true;
|
|
1209
|
-
answerText += event.delta;
|
|
1210
|
-
chunker?.append(event.delta);
|
|
1211
|
-
if (chunker && params.resolvedBlockStreamingBreak === "text_end") chunker.drain({
|
|
1212
|
-
force: false,
|
|
1213
|
-
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1214
|
-
});
|
|
1215
|
-
continue;
|
|
1216
|
-
}
|
|
1217
|
-
if (event.type === "text_end" && chunker && params.resolvedBlockStreamingBreak === "text_end") {
|
|
1218
|
-
chunker.drain({
|
|
1219
|
-
force: true,
|
|
1220
|
-
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1221
|
-
});
|
|
1222
|
-
continue;
|
|
1223
|
-
}
|
|
1224
|
-
if (event.type === "thinking_delta") {
|
|
1225
|
-
reasoningText += event.delta;
|
|
1226
|
-
if (params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningStream?.({
|
|
1227
|
-
text: reasoningText,
|
|
1228
|
-
isReasoning: true
|
|
1229
|
-
});
|
|
1230
|
-
continue;
|
|
1231
|
-
}
|
|
1232
|
-
if (event.type === "thinking_end" && params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningEnd?.();
|
|
1233
|
-
}
|
|
1234
|
-
if (chunker && params.resolvedBlockStreamingBreak !== "text_end" && chunker.hasBuffered()) chunker.drain({
|
|
1235
|
-
force: true,
|
|
1236
|
-
emit: (chunk) => void emitBlockChunk(chunk)
|
|
1237
|
-
});
|
|
1238
|
-
await blockEmitChain;
|
|
1239
|
-
if (finalEvent?.type === "error") {
|
|
1240
|
-
const message = collectTextContent(finalEvent.error.content);
|
|
1241
|
-
throw new Error(message || finalEvent.error.errorMessage || "BTW failed.");
|
|
1242
|
-
}
|
|
1243
|
-
const finalMessage = finalEvent?.type === "done" ? finalEvent.message : void 0;
|
|
1244
|
-
if (finalMessage) {
|
|
1245
|
-
if (!sawTextEvent) answerText = collectTextContent(finalMessage.content);
|
|
1246
|
-
if (!reasoningText) reasoningText = collectThinkingContent(finalMessage.content);
|
|
1247
|
-
}
|
|
1248
|
-
const answer = answerText.trim();
|
|
1249
|
-
if (!answer) throw new Error("No BTW response generated.");
|
|
1250
|
-
if (emittedBlocks > 0) return;
|
|
1251
|
-
return { text: answer };
|
|
1252
|
-
}
|
|
1253
|
-
//#endregion
|
|
1254
|
-
//#region src/auto-reply/reply/commands-btw.ts
|
|
1255
|
-
const BTW_USAGE = "Usage: /btw <side question>";
|
|
1256
|
-
const handleBtwCommand = async (params, allowTextCommands) => {
|
|
1257
|
-
if (!allowTextCommands) return null;
|
|
1258
|
-
const question = extractBtwQuestion(params.command.commandBodyNormalized);
|
|
1259
|
-
if (question === null) return null;
|
|
1260
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/btw");
|
|
1261
|
-
if (unauthorized) return unauthorized;
|
|
1262
|
-
if (!question) return {
|
|
1263
|
-
shouldContinue: false,
|
|
1264
|
-
reply: { text: BTW_USAGE }
|
|
1265
|
-
};
|
|
1266
|
-
if (!params.sessionEntry?.sessionId) return {
|
|
1267
|
-
shouldContinue: false,
|
|
1268
|
-
reply: { text: "ā ļø /btw requires an active session with existing context." }
|
|
1269
|
-
};
|
|
1270
|
-
if (!params.agentDir) return {
|
|
1271
|
-
shouldContinue: false,
|
|
1272
|
-
reply: { text: "ā ļø /btw is unavailable because the active agent directory could not be resolved." }
|
|
1273
|
-
};
|
|
1274
|
-
try {
|
|
1275
|
-
await params.typing?.startTypingLoop();
|
|
1276
|
-
const reply = await runBtwSideQuestion({
|
|
1277
|
-
cfg: params.cfg,
|
|
1278
|
-
agentDir: params.agentDir,
|
|
1279
|
-
provider: params.provider,
|
|
1280
|
-
model: params.model,
|
|
1281
|
-
question,
|
|
1282
|
-
sessionEntry: params.sessionEntry,
|
|
1283
|
-
sessionStore: params.sessionStore,
|
|
1284
|
-
sessionKey: params.sessionKey,
|
|
1285
|
-
storePath: params.storePath,
|
|
1286
|
-
resolvedThinkLevel: "off",
|
|
1287
|
-
resolvedReasoningLevel: "off",
|
|
1288
|
-
blockReplyChunking: params.blockReplyChunking,
|
|
1289
|
-
resolvedBlockStreamingBreak: params.resolvedBlockStreamingBreak,
|
|
1290
|
-
opts: params.opts,
|
|
1291
|
-
isNewSession: false
|
|
1292
|
-
});
|
|
1293
|
-
return {
|
|
1294
|
-
shouldContinue: false,
|
|
1295
|
-
reply: reply ? {
|
|
1296
|
-
...reply,
|
|
1297
|
-
btw: { question }
|
|
1298
|
-
} : reply
|
|
1299
|
-
};
|
|
1300
|
-
} catch (error) {
|
|
1301
|
-
const message = error instanceof Error ? error.message.trim() : "";
|
|
1302
|
-
return {
|
|
1303
|
-
shouldContinue: false,
|
|
1304
|
-
reply: {
|
|
1305
|
-
text: `ā ļø /btw failed${message ? `: ${message}` : "."}`,
|
|
1306
|
-
btw: { question },
|
|
1307
|
-
isError: true
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
}
|
|
1311
|
-
};
|
|
1312
|
-
//#endregion
|
|
1313
|
-
//#region src/auto-reply/reply/commands-compact.ts
|
|
1314
|
-
function extractCompactInstructions(params) {
|
|
1315
|
-
const raw = stripStructuralPrefixes(params.rawBody ?? "");
|
|
1316
|
-
const trimmed = (params.isGroup ? stripMentions(raw, params.ctx, params.cfg, params.agentId) : raw).trim();
|
|
1317
|
-
if (!trimmed) return;
|
|
1318
|
-
const prefix = trimmed.toLowerCase().startsWith("/compact") ? "/compact" : null;
|
|
1319
|
-
if (!prefix) return;
|
|
1320
|
-
let rest = trimmed.slice(prefix.length).trimStart();
|
|
1321
|
-
if (rest.startsWith(":")) rest = rest.slice(1).trimStart();
|
|
1322
|
-
return rest.length ? rest : void 0;
|
|
1323
|
-
}
|
|
1324
|
-
function isCompactionSkipReason(reason) {
|
|
1325
|
-
const text = reason?.trim().toLowerCase() ?? "";
|
|
1326
|
-
return text.includes("nothing to compact") || text.includes("below threshold") || text.includes("already compacted") || text.includes("no real conversation messages");
|
|
1327
|
-
}
|
|
1328
|
-
function formatCompactionReason(reason) {
|
|
1329
|
-
const text = reason?.trim();
|
|
1330
|
-
if (!text) return;
|
|
1331
|
-
const lower = text.toLowerCase();
|
|
1332
|
-
if (lower.includes("nothing to compact")) return "nothing compactable in this session yet";
|
|
1333
|
-
if (lower.includes("below threshold")) return "context is below the compaction threshold";
|
|
1334
|
-
if (lower.includes("already compacted")) return "session was already compacted recently";
|
|
1335
|
-
if (lower.includes("no real conversation messages")) return "no real conversation messages yet";
|
|
1336
|
-
return text;
|
|
1337
|
-
}
|
|
1338
|
-
const handleCompactCommand = async (params) => {
|
|
1339
|
-
if (!(params.command.commandBodyNormalized === "/compact" || params.command.commandBodyNormalized.startsWith("/compact "))) return null;
|
|
1340
|
-
if (!params.command.isAuthorizedSender) {
|
|
1341
|
-
logVerbose(`Ignoring /compact from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
1342
|
-
return { shouldContinue: false };
|
|
1343
|
-
}
|
|
1344
|
-
if (!params.sessionEntry?.sessionId) return {
|
|
1345
|
-
shouldContinue: false,
|
|
1346
|
-
reply: { text: "āļø Compaction unavailable (missing session id)." }
|
|
1347
|
-
};
|
|
1348
|
-
const sessionId = params.sessionEntry.sessionId;
|
|
1349
|
-
if (isEmbeddedPiRunActive(sessionId)) {
|
|
1350
|
-
abortEmbeddedPiRun(sessionId);
|
|
1351
|
-
await waitForEmbeddedPiRunEnd(sessionId, 15e3);
|
|
1352
|
-
}
|
|
1353
|
-
const customInstructions = extractCompactInstructions({
|
|
1354
|
-
rawBody: params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body,
|
|
1355
|
-
ctx: params.ctx,
|
|
1356
|
-
cfg: params.cfg,
|
|
1357
|
-
agentId: params.agentId,
|
|
1358
|
-
isGroup: params.isGroup
|
|
1359
|
-
});
|
|
1360
|
-
const result = await compactEmbeddedPiSession({
|
|
1361
|
-
sessionId,
|
|
1362
|
-
sessionKey: params.sessionKey,
|
|
1363
|
-
allowGatewaySubagentBinding: true,
|
|
1364
|
-
messageChannel: params.command.channel,
|
|
1365
|
-
groupId: params.sessionEntry.groupId,
|
|
1366
|
-
groupChannel: params.sessionEntry.groupChannel,
|
|
1367
|
-
groupSpace: params.sessionEntry.space,
|
|
1368
|
-
spawnedBy: params.sessionEntry.spawnedBy,
|
|
1369
|
-
sessionFile: resolveSessionFilePath(sessionId, params.sessionEntry, resolveSessionFilePathOptions({
|
|
1370
|
-
agentId: params.agentId,
|
|
1371
|
-
storePath: params.storePath
|
|
1372
|
-
})),
|
|
1373
|
-
workspaceDir: params.workspaceDir,
|
|
1374
|
-
agentDir: params.agentDir,
|
|
1375
|
-
config: params.cfg,
|
|
1376
|
-
skillsSnapshot: params.sessionEntry.skillsSnapshot,
|
|
1377
|
-
provider: params.provider,
|
|
1378
|
-
model: params.model,
|
|
1379
|
-
thinkLevel: params.resolvedThinkLevel ?? await params.resolveDefaultThinkingLevel(),
|
|
1380
|
-
bashElevated: {
|
|
1381
|
-
enabled: false,
|
|
1382
|
-
allowed: false,
|
|
1383
|
-
defaultLevel: "off"
|
|
1384
|
-
},
|
|
1385
|
-
customInstructions,
|
|
1386
|
-
trigger: "manual",
|
|
1387
|
-
senderIsOwner: params.command.senderIsOwner,
|
|
1388
|
-
ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : void 0
|
|
1389
|
-
});
|
|
1390
|
-
const compactLabel = result.ok || isCompactionSkipReason(result.reason) ? result.compacted ? result.result?.tokensBefore != null && result.result?.tokensAfter != null ? `Compacted (${formatTokenCount(result.result.tokensBefore)} ā ${formatTokenCount(result.result.tokensAfter)})` : result.result?.tokensBefore ? `Compacted (${formatTokenCount(result.result.tokensBefore)} before)` : "Compacted" : "Compaction skipped" : "Compaction failed";
|
|
1391
|
-
if (result.ok && result.compacted) await incrementCompactionCount({
|
|
1392
|
-
cfg: params.cfg,
|
|
1393
|
-
sessionEntry: params.sessionEntry,
|
|
1394
|
-
sessionStore: params.sessionStore,
|
|
1395
|
-
sessionKey: params.sessionKey,
|
|
1396
|
-
storePath: params.storePath,
|
|
1397
|
-
tokensAfter: result.result?.tokensAfter
|
|
1398
|
-
});
|
|
1399
|
-
const totalTokens = result.result?.tokensAfter ?? resolveFreshSessionTotalTokens(params.sessionEntry);
|
|
1400
|
-
const contextSummary = formatContextUsageShort(typeof totalTokens === "number" && totalTokens > 0 ? totalTokens : null, params.contextTokens ?? params.sessionEntry.contextTokens ?? null);
|
|
1401
|
-
const reason = formatCompactionReason(result.reason);
|
|
1402
|
-
const line = reason ? `${compactLabel}: ${reason} ⢠${contextSummary}` : `${compactLabel} ⢠${contextSummary}`;
|
|
1403
|
-
enqueueSystemEvent(line, { sessionKey: params.sessionKey });
|
|
1404
|
-
return {
|
|
1405
|
-
shouldContinue: false,
|
|
1406
|
-
reply: { text: `āļø ${line}` }
|
|
1407
|
-
};
|
|
1408
|
-
};
|
|
1409
|
-
//#endregion
|
|
1410
|
-
//#region src/auto-reply/reply/commands-slash-parse.ts
|
|
1411
|
-
function parseSlashCommandActionArgs(raw, slash) {
|
|
1412
|
-
const trimmed = raw.trim();
|
|
1413
|
-
const slashLower = slash.toLowerCase();
|
|
1414
|
-
if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" };
|
|
1415
|
-
const rest = trimmed.slice(slash.length).trim();
|
|
1416
|
-
if (!rest) return { kind: "empty" };
|
|
1417
|
-
const match = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
1418
|
-
if (!match) return { kind: "invalid" };
|
|
1419
|
-
return {
|
|
1420
|
-
kind: "parsed",
|
|
1421
|
-
action: match[1]?.toLowerCase() ?? "",
|
|
1422
|
-
args: (match[2] ?? "").trim()
|
|
1423
|
-
};
|
|
1424
|
-
}
|
|
1425
|
-
function parseSlashCommandOrNull(raw, slash, opts) {
|
|
1426
|
-
const parsed = parseSlashCommandActionArgs(raw, slash);
|
|
1427
|
-
if (parsed.kind === "no-match") return null;
|
|
1428
|
-
if (parsed.kind === "invalid") return {
|
|
1429
|
-
ok: false,
|
|
1430
|
-
message: opts.invalidMessage
|
|
1431
|
-
};
|
|
1432
|
-
if (parsed.kind === "empty") return {
|
|
1433
|
-
ok: true,
|
|
1434
|
-
action: opts.defaultAction ?? "show",
|
|
1435
|
-
args: ""
|
|
1436
|
-
};
|
|
1437
|
-
return {
|
|
1438
|
-
ok: true,
|
|
1439
|
-
action: parsed.action,
|
|
1440
|
-
args: parsed.args
|
|
1441
|
-
};
|
|
1442
|
-
}
|
|
1443
|
-
//#endregion
|
|
1444
|
-
//#region src/auto-reply/reply/commands-setunset.ts
|
|
1445
|
-
function parseSetUnsetCommand(params) {
|
|
1446
|
-
const action = params.action;
|
|
1447
|
-
const args = params.args.trim();
|
|
1448
|
-
if (action === "unset") {
|
|
1449
|
-
if (!args) return {
|
|
1450
|
-
kind: "error",
|
|
1451
|
-
message: `Usage: ${params.slash} unset path`
|
|
1452
|
-
};
|
|
1453
|
-
return {
|
|
1454
|
-
kind: "unset",
|
|
1455
|
-
path: args
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
if (!args) return {
|
|
1459
|
-
kind: "error",
|
|
1460
|
-
message: `Usage: ${params.slash} set path=value`
|
|
1461
|
-
};
|
|
1462
|
-
const eqIndex = args.indexOf("=");
|
|
1463
|
-
if (eqIndex <= 0) return {
|
|
1464
|
-
kind: "error",
|
|
1465
|
-
message: `Usage: ${params.slash} set path=value`
|
|
1466
|
-
};
|
|
1467
|
-
const path = args.slice(0, eqIndex).trim();
|
|
1468
|
-
const rawValue = args.slice(eqIndex + 1);
|
|
1469
|
-
if (!path) return {
|
|
1470
|
-
kind: "error",
|
|
1471
|
-
message: `Usage: ${params.slash} set path=value`
|
|
1472
|
-
};
|
|
1473
|
-
const parsed = parseConfigValue(rawValue);
|
|
1474
|
-
if (parsed.error) return {
|
|
1475
|
-
kind: "error",
|
|
1476
|
-
message: parsed.error
|
|
1477
|
-
};
|
|
1478
|
-
return {
|
|
1479
|
-
kind: "set",
|
|
1480
|
-
path,
|
|
1481
|
-
value: parsed.value
|
|
1482
|
-
};
|
|
1483
|
-
}
|
|
1484
|
-
function parseSetUnsetCommandAction(params) {
|
|
1485
|
-
if (params.action !== "set" && params.action !== "unset") return null;
|
|
1486
|
-
const parsed = parseSetUnsetCommand({
|
|
1487
|
-
slash: params.slash,
|
|
1488
|
-
action: params.action,
|
|
1489
|
-
args: params.args
|
|
1490
|
-
});
|
|
1491
|
-
if (parsed.kind === "error") return params.onError(parsed.message);
|
|
1492
|
-
return parsed.kind === "set" ? params.onSet(parsed.path, parsed.value) : params.onUnset(parsed.path);
|
|
1493
|
-
}
|
|
1494
|
-
function parseSlashCommandWithSetUnset(params) {
|
|
1495
|
-
const parsed = parseSlashCommandOrNull(params.raw, params.slash, { invalidMessage: params.invalidMessage });
|
|
1496
|
-
if (!parsed) return null;
|
|
1497
|
-
if (!parsed.ok) return params.onError(parsed.message);
|
|
1498
|
-
const { action, args } = parsed;
|
|
1499
|
-
const setUnset = parseSetUnsetCommandAction({
|
|
1500
|
-
slash: params.slash,
|
|
1501
|
-
action,
|
|
1502
|
-
args,
|
|
1503
|
-
onSet: params.onSet,
|
|
1504
|
-
onUnset: params.onUnset,
|
|
1505
|
-
onError: params.onError
|
|
1506
|
-
});
|
|
1507
|
-
if (setUnset) return setUnset;
|
|
1508
|
-
const knownAction = params.onKnownAction(action, args);
|
|
1509
|
-
if (knownAction) return knownAction;
|
|
1510
|
-
return params.onError(params.usageMessage);
|
|
1511
|
-
}
|
|
1512
|
-
//#endregion
|
|
1513
|
-
//#region src/auto-reply/reply/commands-setunset-standard.ts
|
|
1514
|
-
function parseStandardSetUnsetSlashCommand(params) {
|
|
1515
|
-
return parseSlashCommandWithSetUnset({
|
|
1516
|
-
raw: params.raw,
|
|
1517
|
-
slash: params.slash,
|
|
1518
|
-
invalidMessage: params.invalidMessage,
|
|
1519
|
-
usageMessage: params.usageMessage,
|
|
1520
|
-
onKnownAction: params.onKnownAction,
|
|
1521
|
-
onSet: params.onSet ?? ((path, value) => ({
|
|
1522
|
-
action: "set",
|
|
1523
|
-
path,
|
|
1524
|
-
value
|
|
1525
|
-
})),
|
|
1526
|
-
onUnset: params.onUnset ?? ((path) => ({
|
|
1527
|
-
action: "unset",
|
|
1528
|
-
path
|
|
1529
|
-
})),
|
|
1530
|
-
onError: params.onError ?? ((message) => ({
|
|
1531
|
-
action: "error",
|
|
1532
|
-
message
|
|
1533
|
-
}))
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
|
-
//#endregion
|
|
1537
|
-
//#region src/auto-reply/reply/config-commands.ts
|
|
1538
|
-
function parseConfigCommand(raw) {
|
|
1539
|
-
return parseStandardSetUnsetSlashCommand({
|
|
1540
|
-
raw,
|
|
1541
|
-
slash: "/config",
|
|
1542
|
-
invalidMessage: "Invalid /config syntax.",
|
|
1543
|
-
usageMessage: "Usage: /config show|set|unset",
|
|
1544
|
-
onKnownAction: (action, args) => {
|
|
1545
|
-
if (action === "show" || action === "get") return {
|
|
1546
|
-
action: "show",
|
|
1547
|
-
path: args || void 0
|
|
1548
|
-
};
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
//#endregion
|
|
1553
|
-
//#region src/auto-reply/reply/debug-commands.ts
|
|
1554
|
-
function parseDebugCommand(raw) {
|
|
1555
|
-
return parseStandardSetUnsetSlashCommand({
|
|
1556
|
-
raw,
|
|
1557
|
-
slash: "/debug",
|
|
1558
|
-
invalidMessage: "Invalid /debug syntax.",
|
|
1559
|
-
usageMessage: "Usage: /debug show|set|unset|reset",
|
|
1560
|
-
onKnownAction: (action) => {
|
|
1561
|
-
if (action === "show") return { action: "show" };
|
|
1562
|
-
if (action === "reset") return { action: "reset" };
|
|
1563
|
-
}
|
|
1564
|
-
});
|
|
1565
|
-
}
|
|
1566
|
-
//#endregion
|
|
1567
|
-
//#region src/auto-reply/reply/commands-config.ts
|
|
1568
|
-
const handleConfigCommand = async (params, allowTextCommands) => {
|
|
1569
|
-
if (!allowTextCommands) return null;
|
|
1570
|
-
const configCommand = parseConfigCommand(params.command.commandBodyNormalized);
|
|
1571
|
-
if (!configCommand) return null;
|
|
1572
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/config");
|
|
1573
|
-
if (unauthorized) return unauthorized;
|
|
1574
|
-
const nonOwner = configCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/config");
|
|
1575
|
-
if (nonOwner) return nonOwner;
|
|
1576
|
-
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1577
|
-
label: "/config",
|
|
1578
|
-
configKey: "config"
|
|
1579
|
-
});
|
|
1580
|
-
if (disabled) return disabled;
|
|
1581
|
-
if (configCommand.action === "error") return {
|
|
1582
|
-
shouldContinue: false,
|
|
1583
|
-
reply: { text: `ā ļø ${configCommand.message}` }
|
|
1584
|
-
};
|
|
1585
|
-
let parsedWritePath;
|
|
1586
|
-
if (configCommand.action === "set" || configCommand.action === "unset") {
|
|
1587
|
-
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
1588
|
-
label: "/config write",
|
|
1589
|
-
allowedScopes: ["operator.admin"],
|
|
1590
|
-
missingText: "ā /config set|unset requires operator.admin for gateway clients."
|
|
1591
|
-
});
|
|
1592
|
-
if (missingAdminScope) return missingAdminScope;
|
|
1593
|
-
const parsedPath = parseConfigPath(configCommand.path);
|
|
1594
|
-
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1595
|
-
shouldContinue: false,
|
|
1596
|
-
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1597
|
-
};
|
|
1598
|
-
parsedWritePath = parsedPath.path;
|
|
1599
|
-
const channelId = params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
1600
|
-
const deniedText = resolveConfigWriteDeniedText({
|
|
1601
|
-
cfg: params.cfg,
|
|
1602
|
-
channel: params.command.channel,
|
|
1603
|
-
channelId,
|
|
1604
|
-
accountId: params.ctx.AccountId,
|
|
1605
|
-
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
1606
|
-
target: resolveConfigWriteTargetFromPath(parsedWritePath)
|
|
1607
|
-
});
|
|
1608
|
-
if (deniedText) return {
|
|
1609
|
-
shouldContinue: false,
|
|
1610
|
-
reply: { text: deniedText }
|
|
1611
|
-
};
|
|
1612
|
-
}
|
|
1613
|
-
const snapshot = await readConfigFileSnapshot();
|
|
1614
|
-
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
1615
|
-
shouldContinue: false,
|
|
1616
|
-
reply: { text: "ā ļø Config file is invalid; fix it before using /config." }
|
|
1617
|
-
};
|
|
1618
|
-
const parsedBase = structuredClone(snapshot.parsed);
|
|
1619
|
-
if (configCommand.action === "show") {
|
|
1620
|
-
const pathRaw = configCommand.path?.trim();
|
|
1621
|
-
if (pathRaw) {
|
|
1622
|
-
const parsedPath = parseConfigPath(pathRaw);
|
|
1623
|
-
if (!parsedPath.ok || !parsedPath.path) return {
|
|
1624
|
-
shouldContinue: false,
|
|
1625
|
-
reply: { text: `ā ļø ${parsedPath.error ?? "Invalid path."}` }
|
|
1626
|
-
};
|
|
1627
|
-
const value = getConfigValueAtPath(parsedBase, parsedPath.path);
|
|
1628
|
-
return {
|
|
1629
|
-
shouldContinue: false,
|
|
1630
|
-
reply: { text: `āļø Config ${pathRaw}:\n\`\`\`json\n${JSON.stringify(value ?? null, null, 2)}\n\`\`\`` }
|
|
1631
|
-
};
|
|
1632
|
-
}
|
|
1633
|
-
return {
|
|
1634
|
-
shouldContinue: false,
|
|
1635
|
-
reply: { text: `āļø Config (raw):\n\`\`\`json\n${JSON.stringify(parsedBase, null, 2)}\n\`\`\`` }
|
|
1636
|
-
};
|
|
1637
|
-
}
|
|
1638
|
-
if (configCommand.action === "unset") {
|
|
1639
|
-
if (!unsetConfigValueAtPath(parsedBase, parsedWritePath ?? [])) return {
|
|
1640
|
-
shouldContinue: false,
|
|
1641
|
-
reply: { text: `āļø No config value found for ${configCommand.path}.` }
|
|
1642
|
-
};
|
|
1643
|
-
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1644
|
-
if (!validated.ok) {
|
|
1645
|
-
const issue = validated.issues[0];
|
|
1646
|
-
return {
|
|
1647
|
-
shouldContinue: false,
|
|
1648
|
-
reply: { text: `ā ļø Config invalid after unset (${issue.path}: ${issue.message}).` }
|
|
1649
|
-
};
|
|
1650
|
-
}
|
|
1651
|
-
await writeConfigFile(validated.config);
|
|
1652
|
-
return {
|
|
1653
|
-
shouldContinue: false,
|
|
1654
|
-
reply: { text: `āļø Config updated: ${configCommand.path} removed.` }
|
|
1655
|
-
};
|
|
1656
|
-
}
|
|
1657
|
-
if (configCommand.action === "set") {
|
|
1658
|
-
setConfigValueAtPath(parsedBase, parsedWritePath ?? [], configCommand.value);
|
|
1659
|
-
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
1660
|
-
if (!validated.ok) {
|
|
1661
|
-
const issue = validated.issues[0];
|
|
1662
|
-
return {
|
|
1663
|
-
shouldContinue: false,
|
|
1664
|
-
reply: { text: `ā ļø Config invalid after set (${issue.path}: ${issue.message}).` }
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
|
-
await writeConfigFile(validated.config);
|
|
1668
|
-
const valueLabel = typeof configCommand.value === "string" ? `"${configCommand.value}"` : JSON.stringify(configCommand.value);
|
|
1669
|
-
return {
|
|
1670
|
-
shouldContinue: false,
|
|
1671
|
-
reply: { text: `āļø Config updated: ${configCommand.path}=${valueLabel ?? "null"}` }
|
|
1672
|
-
};
|
|
1673
|
-
}
|
|
1674
|
-
return null;
|
|
1675
|
-
};
|
|
1676
|
-
const handleDebugCommand = async (params, allowTextCommands) => {
|
|
1677
|
-
if (!allowTextCommands) return null;
|
|
1678
|
-
const debugCommand = parseDebugCommand(params.command.commandBodyNormalized);
|
|
1679
|
-
if (!debugCommand) return null;
|
|
1680
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/debug");
|
|
1681
|
-
if (unauthorized) return unauthorized;
|
|
1682
|
-
const nonOwner = rejectNonOwnerCommand(params, "/debug");
|
|
1683
|
-
if (nonOwner) return nonOwner;
|
|
1684
|
-
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1685
|
-
label: "/debug",
|
|
1686
|
-
configKey: "debug"
|
|
1687
|
-
});
|
|
1688
|
-
if (disabled) return disabled;
|
|
1689
|
-
if (debugCommand.action === "error") return {
|
|
1690
|
-
shouldContinue: false,
|
|
1691
|
-
reply: { text: `ā ļø ${debugCommand.message}` }
|
|
1692
|
-
};
|
|
1693
|
-
if (debugCommand.action === "show") {
|
|
1694
|
-
const overrides = getConfigOverrides();
|
|
1695
|
-
if (!(Object.keys(overrides).length > 0)) return {
|
|
1696
|
-
shouldContinue: false,
|
|
1697
|
-
reply: { text: "āļø Debug overrides: (none)" }
|
|
1698
|
-
};
|
|
1699
|
-
return {
|
|
1700
|
-
shouldContinue: false,
|
|
1701
|
-
reply: { text: `āļø Debug overrides (memory-only):\n\`\`\`json\n${JSON.stringify(overrides, null, 2)}\n\`\`\`` }
|
|
1702
|
-
};
|
|
1703
|
-
}
|
|
1704
|
-
if (debugCommand.action === "reset") {
|
|
1705
|
-
resetConfigOverrides();
|
|
1706
|
-
return {
|
|
1707
|
-
shouldContinue: false,
|
|
1708
|
-
reply: { text: "āļø Debug overrides cleared; using config on disk." }
|
|
1709
|
-
};
|
|
1710
|
-
}
|
|
1711
|
-
if (debugCommand.action === "unset") {
|
|
1712
|
-
const result = unsetConfigOverride(debugCommand.path);
|
|
1713
|
-
if (!result.ok) return {
|
|
1714
|
-
shouldContinue: false,
|
|
1715
|
-
reply: { text: `ā ļø ${result.error ?? "Invalid path."}` }
|
|
1716
|
-
};
|
|
1717
|
-
if (!result.removed) return {
|
|
1718
|
-
shouldContinue: false,
|
|
1719
|
-
reply: { text: `āļø No debug override found for ${debugCommand.path}.` }
|
|
1720
|
-
};
|
|
1721
|
-
return {
|
|
1722
|
-
shouldContinue: false,
|
|
1723
|
-
reply: { text: `āļø Debug override removed for ${debugCommand.path}.` }
|
|
1724
|
-
};
|
|
1725
|
-
}
|
|
1726
|
-
if (debugCommand.action === "set") {
|
|
1727
|
-
const result = setConfigOverride(debugCommand.path, debugCommand.value);
|
|
1728
|
-
if (!result.ok) return {
|
|
1729
|
-
shouldContinue: false,
|
|
1730
|
-
reply: { text: `ā ļø ${result.error ?? "Invalid override."}` }
|
|
1731
|
-
};
|
|
1732
|
-
const valueLabel = typeof debugCommand.value === "string" ? `"${debugCommand.value}"` : JSON.stringify(debugCommand.value);
|
|
1733
|
-
return {
|
|
1734
|
-
shouldContinue: false,
|
|
1735
|
-
reply: { text: `āļø Debug override set: ${debugCommand.path}=${valueLabel ?? "null"}` }
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
return null;
|
|
1739
|
-
};
|
|
1740
|
-
//#endregion
|
|
1741
|
-
//#region src/auto-reply/reply/mcp-commands.ts
|
|
1742
|
-
function parseMcpCommand(raw) {
|
|
1743
|
-
return parseStandardSetUnsetSlashCommand({
|
|
1744
|
-
raw,
|
|
1745
|
-
slash: "/mcp",
|
|
1746
|
-
invalidMessage: "Invalid /mcp syntax.",
|
|
1747
|
-
usageMessage: "Usage: /mcp show|set|unset",
|
|
1748
|
-
onKnownAction: (action, args) => {
|
|
1749
|
-
if (action === "show" || action === "get") return {
|
|
1750
|
-
action: "show",
|
|
1751
|
-
name: args || void 0
|
|
1752
|
-
};
|
|
1753
|
-
},
|
|
1754
|
-
onSet: (name, value) => ({
|
|
1755
|
-
action: "set",
|
|
1756
|
-
name,
|
|
1757
|
-
value
|
|
1758
|
-
}),
|
|
1759
|
-
onUnset: (name) => ({
|
|
1760
|
-
action: "unset",
|
|
1761
|
-
name
|
|
1762
|
-
})
|
|
1763
|
-
});
|
|
1764
|
-
}
|
|
1765
|
-
//#endregion
|
|
1766
|
-
//#region src/auto-reply/reply/commands-mcp.ts
|
|
1767
|
-
function renderJsonBlock$1(label, value) {
|
|
1768
|
-
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
1769
|
-
}
|
|
1770
|
-
const handleMcpCommand = async (params, allowTextCommands) => {
|
|
1771
|
-
if (!allowTextCommands) return null;
|
|
1772
|
-
const mcpCommand = parseMcpCommand(params.command.commandBodyNormalized);
|
|
1773
|
-
if (!mcpCommand) return null;
|
|
1774
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/mcp");
|
|
1775
|
-
if (unauthorized) return unauthorized;
|
|
1776
|
-
const nonOwner = mcpCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/mcp");
|
|
1777
|
-
if (nonOwner) return nonOwner;
|
|
1778
|
-
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1779
|
-
label: "/mcp",
|
|
1780
|
-
configKey: "mcp"
|
|
1781
|
-
});
|
|
1782
|
-
if (disabled) return disabled;
|
|
1783
|
-
if (mcpCommand.action === "error") return {
|
|
1784
|
-
shouldContinue: false,
|
|
1785
|
-
reply: { text: `ā ļø ${mcpCommand.message}` }
|
|
1786
|
-
};
|
|
1787
|
-
if (mcpCommand.action === "show") {
|
|
1788
|
-
const loaded = await listConfiguredMcpServers();
|
|
1789
|
-
if (!loaded.ok) return {
|
|
1790
|
-
shouldContinue: false,
|
|
1791
|
-
reply: { text: `ā ļø ${loaded.error}` }
|
|
1792
|
-
};
|
|
1793
|
-
if (mcpCommand.name) {
|
|
1794
|
-
const server = loaded.mcpServers[mcpCommand.name];
|
|
1795
|
-
if (!server) return {
|
|
1796
|
-
shouldContinue: false,
|
|
1797
|
-
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${loaded.path}.` }
|
|
1798
|
-
};
|
|
1799
|
-
return {
|
|
1800
|
-
shouldContinue: false,
|
|
1801
|
-
reply: { text: renderJsonBlock$1(`š MCP server "${mcpCommand.name}" (${loaded.path})`, server) }
|
|
1802
|
-
};
|
|
1803
|
-
}
|
|
1804
|
-
if (Object.keys(loaded.mcpServers).length === 0) return {
|
|
1805
|
-
shouldContinue: false,
|
|
1806
|
-
reply: { text: `š No MCP servers configured in ${loaded.path}.` }
|
|
1807
|
-
};
|
|
1808
|
-
return {
|
|
1809
|
-
shouldContinue: false,
|
|
1810
|
-
reply: { text: renderJsonBlock$1(`š MCP servers (${loaded.path})`, loaded.mcpServers) }
|
|
1811
|
-
};
|
|
1812
|
-
}
|
|
1813
|
-
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
1814
|
-
label: "/mcp write",
|
|
1815
|
-
allowedScopes: ["operator.admin"],
|
|
1816
|
-
missingText: "ā /mcp set|unset requires operator.admin for gateway clients."
|
|
1817
|
-
});
|
|
1818
|
-
if (missingAdminScope) return missingAdminScope;
|
|
1819
|
-
if (mcpCommand.action === "set") {
|
|
1820
|
-
const result = await setConfiguredMcpServer({
|
|
1821
|
-
name: mcpCommand.name,
|
|
1822
|
-
server: mcpCommand.value
|
|
1823
|
-
});
|
|
1824
|
-
if (!result.ok) return {
|
|
1825
|
-
shouldContinue: false,
|
|
1826
|
-
reply: { text: `ā ļø ${result.error}` }
|
|
1827
|
-
};
|
|
1828
|
-
return {
|
|
1829
|
-
shouldContinue: false,
|
|
1830
|
-
reply: { text: `š MCP server "${mcpCommand.name}" saved to ${result.path}.` }
|
|
1831
|
-
};
|
|
1832
|
-
}
|
|
1833
|
-
const result = await unsetConfiguredMcpServer({ name: mcpCommand.name });
|
|
1834
|
-
if (!result.ok) return {
|
|
1835
|
-
shouldContinue: false,
|
|
1836
|
-
reply: { text: `ā ļø ${result.error}` }
|
|
1837
|
-
};
|
|
1838
|
-
if (!result.removed) return {
|
|
1839
|
-
shouldContinue: false,
|
|
1840
|
-
reply: { text: `š No MCP server named "${mcpCommand.name}" in ${result.path}.` }
|
|
1841
|
-
};
|
|
1842
|
-
return {
|
|
1843
|
-
shouldContinue: false,
|
|
1844
|
-
reply: { text: `š MCP server "${mcpCommand.name}" removed from ${result.path}.` }
|
|
1845
|
-
};
|
|
1846
|
-
};
|
|
1847
|
-
//#endregion
|
|
1848
|
-
//#region src/auto-reply/reply/commands-plugin.ts
|
|
1849
|
-
/**
|
|
1850
|
-
* Plugin Command Handler
|
|
1851
|
-
*
|
|
1852
|
-
* Handles commands registered by plugins, bypassing the LLM agent.
|
|
1853
|
-
* This handler is called before built-in command handlers.
|
|
1854
|
-
*/
|
|
1855
|
-
/**
|
|
1856
|
-
* Handle plugin-registered commands.
|
|
1857
|
-
* Returns a result if a plugin command was matched and executed,
|
|
1858
|
-
* or null to continue to the next handler.
|
|
1859
|
-
*/
|
|
1860
|
-
const handlePluginCommand = async (params, allowTextCommands) => {
|
|
1861
|
-
const { command, cfg } = params;
|
|
1862
|
-
if (!allowTextCommands) return null;
|
|
1863
|
-
const match = matchPluginCommand(command.commandBodyNormalized);
|
|
1864
|
-
if (!match) return null;
|
|
1865
|
-
return {
|
|
1866
|
-
shouldContinue: false,
|
|
1867
|
-
reply: await executePluginCommand({
|
|
1868
|
-
command: match.command,
|
|
1869
|
-
args: match.args,
|
|
1870
|
-
senderId: command.senderId,
|
|
1871
|
-
channel: command.channel,
|
|
1872
|
-
channelId: command.channelId,
|
|
1873
|
-
isAuthorizedSender: command.isAuthorizedSender,
|
|
1874
|
-
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
1875
|
-
sessionKey: params.sessionKey,
|
|
1876
|
-
sessionId: params.sessionEntry?.sessionId,
|
|
1877
|
-
commandBody: command.commandBodyNormalized,
|
|
1878
|
-
config: cfg,
|
|
1879
|
-
from: command.from,
|
|
1880
|
-
to: command.to,
|
|
1881
|
-
accountId: params.ctx.AccountId ?? void 0,
|
|
1882
|
-
messageThreadId: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? params.ctx.MessageThreadId : void 0,
|
|
1883
|
-
threadParentId: params.ctx.ThreadParentId?.trim() || void 0
|
|
1884
|
-
})
|
|
1885
|
-
};
|
|
1886
|
-
};
|
|
1887
|
-
//#endregion
|
|
1888
|
-
//#region src/auto-reply/reply/plugins-commands.ts
|
|
1889
|
-
function parsePluginsCommand(raw) {
|
|
1890
|
-
const match = raw.match(/^\/plugins?(?:\s+(.*))?$/i);
|
|
1891
|
-
if (!match) return null;
|
|
1892
|
-
const tail = match[1]?.trim() ?? "";
|
|
1893
|
-
if (!tail) return { action: "list" };
|
|
1894
|
-
const [rawAction, ...rest] = tail.split(/\s+/);
|
|
1895
|
-
const action = rawAction?.trim().toLowerCase();
|
|
1896
|
-
const name = rest.join(" ").trim();
|
|
1897
|
-
if (action === "list") return name ? {
|
|
1898
|
-
action: "error",
|
|
1899
|
-
message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
|
|
1900
|
-
} : { action: "list" };
|
|
1901
|
-
if (action === "inspect" || action === "show" || action === "get") return {
|
|
1902
|
-
action: "inspect",
|
|
1903
|
-
name: name || void 0
|
|
1904
|
-
};
|
|
1905
|
-
if (action === "install" || action === "add") {
|
|
1906
|
-
if (!name) return {
|
|
1907
|
-
action: "error",
|
|
1908
|
-
message: "Usage: /plugins install <path|archive|npm-spec|clawhub:pkg>"
|
|
1909
|
-
};
|
|
1910
|
-
return {
|
|
1911
|
-
action: "install",
|
|
1912
|
-
spec: name
|
|
1913
|
-
};
|
|
1914
|
-
}
|
|
1915
|
-
if (action === "enable" || action === "disable") {
|
|
1916
|
-
if (!name) return {
|
|
1917
|
-
action: "error",
|
|
1918
|
-
message: `Usage: /plugins ${action} <plugin-id-or-name>`
|
|
1919
|
-
};
|
|
1920
|
-
return {
|
|
1921
|
-
action,
|
|
1922
|
-
name
|
|
1923
|
-
};
|
|
1924
|
-
}
|
|
1925
|
-
return {
|
|
1926
|
-
action: "error",
|
|
1927
|
-
message: "Usage: /plugins list|inspect|show|get|install|enable|disable [plugin]"
|
|
1928
|
-
};
|
|
1929
|
-
}
|
|
1930
|
-
//#endregion
|
|
1931
|
-
//#region src/auto-reply/reply/commands-plugins.ts
|
|
1932
|
-
function renderJsonBlock(label, value) {
|
|
1933
|
-
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
1934
|
-
}
|
|
1935
|
-
function buildPluginInspectJson(params) {
|
|
1936
|
-
const inspect = buildPluginInspectReport({
|
|
1937
|
-
id: params.id,
|
|
1938
|
-
config: params.config,
|
|
1939
|
-
report: params.report
|
|
1940
|
-
});
|
|
1941
|
-
if (!inspect) return null;
|
|
1942
|
-
return {
|
|
1943
|
-
inspect,
|
|
1944
|
-
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
1945
|
-
code: warning.code,
|
|
1946
|
-
severity: warning.severity,
|
|
1947
|
-
message: formatPluginCompatibilityNotice(warning)
|
|
1948
|
-
})),
|
|
1949
|
-
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
1950
|
-
};
|
|
1951
|
-
}
|
|
1952
|
-
function buildAllPluginInspectJson(params) {
|
|
1953
|
-
return buildAllPluginInspectReports({
|
|
1954
|
-
config: params.config,
|
|
1955
|
-
report: params.report
|
|
1956
|
-
}).map((inspect) => ({
|
|
1957
|
-
inspect,
|
|
1958
|
-
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
1959
|
-
code: warning.code,
|
|
1960
|
-
severity: warning.severity,
|
|
1961
|
-
message: formatPluginCompatibilityNotice(warning)
|
|
1962
|
-
})),
|
|
1963
|
-
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
1964
|
-
}));
|
|
1965
|
-
}
|
|
1966
|
-
function formatPluginLabel(plugin) {
|
|
1967
|
-
if (!plugin.name || plugin.name === plugin.id) return plugin.id;
|
|
1968
|
-
return `${plugin.name} (${plugin.id})`;
|
|
1969
|
-
}
|
|
1970
|
-
function formatPluginsList(report) {
|
|
1971
|
-
if (report.plugins.length === 0) return `š No plugins found for workspace ${report.workspaceDir ?? "(unknown workspace)"}.`;
|
|
1972
|
-
return [`š Plugins (${report.plugins.filter((plugin) => plugin.status === "loaded").length}/${report.plugins.length} loaded)`, ...report.plugins.map((plugin) => {
|
|
1973
|
-
const format = plugin.bundleFormat ? `${plugin.format ?? "openclaw"}/${plugin.bundleFormat}` : plugin.format ?? "openclaw";
|
|
1974
|
-
return `- ${formatPluginLabel(plugin)} [${plugin.status}] ${format}`;
|
|
1975
|
-
})].join("\n");
|
|
1976
|
-
}
|
|
1977
|
-
function findPlugin(report, rawName) {
|
|
1978
|
-
const target = rawName.trim().toLowerCase();
|
|
1979
|
-
if (!target) return;
|
|
1980
|
-
return report.plugins.find((plugin) => plugin.id.toLowerCase() === target || plugin.name.toLowerCase() === target);
|
|
1981
|
-
}
|
|
1982
|
-
function looksLikeLocalPluginInstallSpec(raw) {
|
|
1983
|
-
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");
|
|
1984
|
-
}
|
|
1985
|
-
async function installPluginFromPluginsCommand(params) {
|
|
1986
|
-
const fileSpec = resolveFileNpmSpecToLocalPath(params.raw);
|
|
1987
|
-
if (fileSpec && !fileSpec.ok) return {
|
|
1988
|
-
ok: false,
|
|
1989
|
-
error: fileSpec.error
|
|
1990
|
-
};
|
|
1991
|
-
const resolved = resolveUserPath(fileSpec && fileSpec.ok ? fileSpec.path : params.raw);
|
|
1992
|
-
if (fsSync.existsSync(resolved)) {
|
|
1993
|
-
const result = await installPluginFromPath({
|
|
1994
|
-
path: resolved,
|
|
1995
|
-
logger: createPluginInstallLogger()
|
|
1996
|
-
});
|
|
1997
|
-
if (!result.ok) return {
|
|
1998
|
-
ok: false,
|
|
1999
|
-
error: result.error
|
|
2000
|
-
};
|
|
2001
|
-
clearPluginManifestRegistryCache();
|
|
2002
|
-
const source = resolveArchiveKind(resolved) ? "archive" : "path";
|
|
2003
|
-
await persistPluginInstall({
|
|
2004
|
-
config: params.config,
|
|
2005
|
-
pluginId: result.pluginId,
|
|
2006
|
-
install: {
|
|
2007
|
-
source,
|
|
2008
|
-
sourcePath: resolved,
|
|
2009
|
-
installPath: result.targetDir,
|
|
2010
|
-
version: result.version
|
|
2011
|
-
}
|
|
2012
|
-
});
|
|
2013
|
-
return {
|
|
2014
|
-
ok: true,
|
|
2015
|
-
pluginId: result.pluginId
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
if (looksLikeLocalPluginInstallSpec(params.raw)) return {
|
|
2019
|
-
ok: false,
|
|
2020
|
-
error: `Path not found: ${resolved}`
|
|
2021
|
-
};
|
|
2022
|
-
if (parseClawHubPluginSpec(params.raw)) {
|
|
2023
|
-
const result = await installPluginFromClawHub({
|
|
2024
|
-
spec: params.raw,
|
|
2025
|
-
logger: createPluginInstallLogger()
|
|
2026
|
-
});
|
|
2027
|
-
if (!result.ok) return {
|
|
2028
|
-
ok: false,
|
|
2029
|
-
error: result.error
|
|
2030
|
-
};
|
|
2031
|
-
clearPluginManifestRegistryCache();
|
|
2032
|
-
await persistPluginInstall({
|
|
2033
|
-
config: params.config,
|
|
2034
|
-
pluginId: result.pluginId,
|
|
2035
|
-
install: {
|
|
2036
|
-
source: "clawhub",
|
|
2037
|
-
spec: params.raw,
|
|
2038
|
-
installPath: result.targetDir,
|
|
2039
|
-
version: result.version,
|
|
2040
|
-
integrity: result.clawhub.integrity,
|
|
2041
|
-
resolvedAt: result.clawhub.resolvedAt,
|
|
2042
|
-
clawhubUrl: result.clawhub.clawhubUrl,
|
|
2043
|
-
clawhubPackage: result.clawhub.clawhubPackage,
|
|
2044
|
-
clawhubFamily: result.clawhub.clawhubFamily,
|
|
2045
|
-
clawhubChannel: result.clawhub.clawhubChannel
|
|
2046
|
-
}
|
|
2047
|
-
});
|
|
2048
|
-
return {
|
|
2049
|
-
ok: true,
|
|
2050
|
-
pluginId: result.pluginId
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
const preferredClawHubSpec = buildPreferredClawHubSpec(params.raw);
|
|
2054
|
-
if (preferredClawHubSpec) {
|
|
2055
|
-
const clawhubResult = await installPluginFromClawHub({
|
|
2056
|
-
spec: preferredClawHubSpec,
|
|
2057
|
-
logger: createPluginInstallLogger()
|
|
2058
|
-
});
|
|
2059
|
-
if (clawhubResult.ok) {
|
|
2060
|
-
clearPluginManifestRegistryCache();
|
|
2061
|
-
await persistPluginInstall({
|
|
2062
|
-
config: params.config,
|
|
2063
|
-
pluginId: clawhubResult.pluginId,
|
|
2064
|
-
install: {
|
|
2065
|
-
source: "clawhub",
|
|
2066
|
-
spec: preferredClawHubSpec,
|
|
2067
|
-
installPath: clawhubResult.targetDir,
|
|
2068
|
-
version: clawhubResult.version,
|
|
2069
|
-
integrity: clawhubResult.clawhub.integrity,
|
|
2070
|
-
resolvedAt: clawhubResult.clawhub.resolvedAt,
|
|
2071
|
-
clawhubUrl: clawhubResult.clawhub.clawhubUrl,
|
|
2072
|
-
clawhubPackage: clawhubResult.clawhub.clawhubPackage,
|
|
2073
|
-
clawhubFamily: clawhubResult.clawhub.clawhubFamily,
|
|
2074
|
-
clawhubChannel: clawhubResult.clawhub.clawhubChannel
|
|
2075
|
-
}
|
|
2076
|
-
});
|
|
2077
|
-
return {
|
|
2078
|
-
ok: true,
|
|
2079
|
-
pluginId: clawhubResult.pluginId
|
|
2080
|
-
};
|
|
2081
|
-
}
|
|
2082
|
-
if (decidePreferredClawHubFallback(clawhubResult) !== "fallback_to_npm") return {
|
|
2083
|
-
ok: false,
|
|
2084
|
-
error: clawhubResult.error
|
|
2085
|
-
};
|
|
2086
|
-
}
|
|
2087
|
-
const result = await installPluginFromNpmSpec({
|
|
2088
|
-
spec: params.raw,
|
|
2089
|
-
logger: createPluginInstallLogger()
|
|
2090
|
-
});
|
|
2091
|
-
if (!result.ok) return {
|
|
2092
|
-
ok: false,
|
|
2093
|
-
error: result.error
|
|
2094
|
-
};
|
|
2095
|
-
clearPluginManifestRegistryCache();
|
|
2096
|
-
const installRecord = buildNpmInstallRecordFields({
|
|
2097
|
-
spec: params.raw,
|
|
2098
|
-
installPath: result.targetDir,
|
|
2099
|
-
version: result.version,
|
|
2100
|
-
resolution: result.npmResolution
|
|
2101
|
-
});
|
|
2102
|
-
await persistPluginInstall({
|
|
2103
|
-
config: params.config,
|
|
2104
|
-
pluginId: result.pluginId,
|
|
2105
|
-
install: installRecord
|
|
2106
|
-
});
|
|
2107
|
-
return {
|
|
2108
|
-
ok: true,
|
|
2109
|
-
pluginId: result.pluginId
|
|
2110
|
-
};
|
|
2111
|
-
}
|
|
2112
|
-
async function loadPluginCommandState(workspaceDir, options) {
|
|
2113
|
-
const snapshot = await readConfigFileSnapshot();
|
|
2114
|
-
if (!snapshot.valid) return {
|
|
2115
|
-
ok: false,
|
|
2116
|
-
path: snapshot.path,
|
|
2117
|
-
error: "Config file is invalid; fix it before using /plugins."
|
|
2118
|
-
};
|
|
2119
|
-
const config = structuredClone(snapshot.resolved);
|
|
2120
|
-
return {
|
|
2121
|
-
ok: true,
|
|
2122
|
-
path: snapshot.path,
|
|
2123
|
-
config,
|
|
2124
|
-
report: options?.loadModules === true ? buildPluginDiagnosticsReport({
|
|
2125
|
-
config,
|
|
2126
|
-
workspaceDir
|
|
2127
|
-
}) : buildPluginSnapshotReport({
|
|
2128
|
-
config,
|
|
2129
|
-
workspaceDir
|
|
2130
|
-
})
|
|
2131
|
-
};
|
|
2132
|
-
}
|
|
2133
|
-
const handlePluginsCommand = async (params, allowTextCommands) => {
|
|
2134
|
-
if (!allowTextCommands) return null;
|
|
2135
|
-
const pluginsCommand = parsePluginsCommand(params.command.commandBodyNormalized);
|
|
2136
|
-
if (!pluginsCommand) return null;
|
|
2137
|
-
const unauthorized = rejectUnauthorizedCommand(params, "/plugins");
|
|
2138
|
-
if (unauthorized) return unauthorized;
|
|
2139
|
-
const nonOwner = (pluginsCommand.action === "list" || pluginsCommand.action === "inspect") && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/plugins");
|
|
2140
|
-
if (nonOwner) return nonOwner;
|
|
2141
|
-
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
2142
|
-
label: "/plugins",
|
|
2143
|
-
configKey: "plugins"
|
|
2144
|
-
});
|
|
2145
|
-
if (disabled) return disabled;
|
|
2146
|
-
if (pluginsCommand.action === "error") return {
|
|
2147
|
-
shouldContinue: false,
|
|
2148
|
-
reply: { text: `ā ļø ${pluginsCommand.message}` }
|
|
2149
|
-
};
|
|
2150
|
-
const loaded = await loadPluginCommandState(params.workspaceDir, { loadModules: pluginsCommand.action !== "list" });
|
|
2151
|
-
if (!loaded.ok) return {
|
|
2152
|
-
shouldContinue: false,
|
|
2153
|
-
reply: { text: `ā ļø ${loaded.error}` }
|
|
2154
|
-
};
|
|
2155
|
-
if (pluginsCommand.action === "list") return {
|
|
2156
|
-
shouldContinue: false,
|
|
2157
|
-
reply: { text: formatPluginsList(loaded.report) }
|
|
2158
|
-
};
|
|
2159
|
-
if (pluginsCommand.action === "inspect") {
|
|
2160
|
-
if (!pluginsCommand.name) return {
|
|
2161
|
-
shouldContinue: false,
|
|
2162
|
-
reply: { text: formatPluginsList(loaded.report) }
|
|
2163
|
-
};
|
|
2164
|
-
if (pluginsCommand.name.toLowerCase() === "all") return {
|
|
2165
|
-
shouldContinue: false,
|
|
2166
|
-
reply: { text: renderJsonBlock("š Plugins", buildAllPluginInspectJson(loaded)) }
|
|
2167
|
-
};
|
|
2168
|
-
const payload = buildPluginInspectJson({
|
|
2169
|
-
id: pluginsCommand.name,
|
|
2170
|
-
config: loaded.config,
|
|
2171
|
-
report: loaded.report
|
|
2172
|
-
});
|
|
2173
|
-
if (!payload) return {
|
|
2174
|
-
shouldContinue: false,
|
|
2175
|
-
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2176
|
-
};
|
|
2177
|
-
return {
|
|
2178
|
-
shouldContinue: false,
|
|
2179
|
-
reply: { text: renderJsonBlock(`š Plugin "${payload.inspect.plugin.id}"`, {
|
|
2180
|
-
...payload.inspect,
|
|
2181
|
-
compatibilityWarnings: payload.compatibilityWarnings,
|
|
2182
|
-
install: payload.install
|
|
2183
|
-
}) }
|
|
2184
|
-
};
|
|
2185
|
-
}
|
|
2186
|
-
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2187
|
-
label: "/plugins write",
|
|
2188
|
-
allowedScopes: ["operator.admin"],
|
|
2189
|
-
missingText: "ā /plugins install|enable|disable requires operator.admin for gateway clients."
|
|
2190
|
-
});
|
|
2191
|
-
if (missingAdminScope) return missingAdminScope;
|
|
2192
|
-
if (pluginsCommand.action === "install") {
|
|
2193
|
-
const installed = await installPluginFromPluginsCommand({
|
|
2194
|
-
raw: pluginsCommand.spec,
|
|
2195
|
-
config: structuredClone(loaded.config)
|
|
2196
|
-
});
|
|
2197
|
-
if (!installed.ok) return {
|
|
2198
|
-
shouldContinue: false,
|
|
2199
|
-
reply: { text: `ā ļø ${installed.error}` }
|
|
2200
|
-
};
|
|
2201
|
-
return {
|
|
2202
|
-
shouldContinue: false,
|
|
2203
|
-
reply: { text: `š Installed plugin "${installed.pluginId}". Restart the gateway to load plugins.` }
|
|
2204
|
-
};
|
|
2205
|
-
}
|
|
2206
|
-
const plugin = findPlugin(loaded.report, pluginsCommand.name);
|
|
2207
|
-
if (!plugin) return {
|
|
2208
|
-
shouldContinue: false,
|
|
2209
|
-
reply: { text: `š No plugin named "${pluginsCommand.name}" found.` }
|
|
2210
|
-
};
|
|
2211
|
-
const validated = validateConfigObjectWithPlugins(setPluginEnabledInConfig(structuredClone(loaded.config), plugin.id, pluginsCommand.action === "enable"));
|
|
2212
|
-
if (!validated.ok) {
|
|
2213
|
-
const issue = validated.issues[0];
|
|
2214
|
-
return {
|
|
2215
|
-
shouldContinue: false,
|
|
2216
|
-
reply: { text: `ā ļø Config invalid after /plugins ${pluginsCommand.action} (${issue.path}: ${issue.message}).` }
|
|
2217
|
-
};
|
|
2218
|
-
}
|
|
2219
|
-
await writeConfigFile(validated.config);
|
|
2220
|
-
return {
|
|
2221
|
-
shouldContinue: false,
|
|
2222
|
-
reply: { text: `š Plugin "${plugin.id}" ${pluginsCommand.action}d in ${loaded.path}. Restart the gateway to apply.` }
|
|
2223
|
-
};
|
|
2224
|
-
};
|
|
2225
|
-
//#endregion
|
|
2226
|
-
//#region src/auto-reply/send-policy.ts
|
|
2227
|
-
function normalizeSendPolicyOverride(raw) {
|
|
2228
|
-
const value = raw?.trim().toLowerCase();
|
|
2229
|
-
if (!value) return;
|
|
2230
|
-
if (value === "allow" || value === "on") return "allow";
|
|
2231
|
-
if (value === "deny" || value === "off") return "deny";
|
|
2232
|
-
}
|
|
2233
|
-
function parseSendPolicyCommand(raw) {
|
|
2234
|
-
if (!raw) return { hasCommand: false };
|
|
2235
|
-
const trimmed = raw.trim();
|
|
2236
|
-
if (!trimmed) return { hasCommand: false };
|
|
2237
|
-
const match = normalizeCommandBody(stripInboundMetadata(trimmed)).match(/^\/send(?:\s+([a-zA-Z]+))?\s*$/i);
|
|
2238
|
-
if (!match) return { hasCommand: false };
|
|
2239
|
-
const token = match[1]?.trim().toLowerCase();
|
|
2240
|
-
if (!token) return { hasCommand: true };
|
|
2241
|
-
if (token === "inherit" || token === "default" || token === "reset") return {
|
|
2242
|
-
hasCommand: true,
|
|
2243
|
-
mode: "inherit"
|
|
2244
|
-
};
|
|
2245
|
-
return {
|
|
2246
|
-
hasCommand: true,
|
|
2247
|
-
mode: normalizeSendPolicyOverride(token)
|
|
2248
|
-
};
|
|
2249
|
-
}
|
|
2250
|
-
//#endregion
|
|
2251
|
-
//#region src/auto-reply/reply/commands-session-store.ts
|
|
2252
|
-
async function persistSessionEntry(params) {
|
|
2253
|
-
if (!params.sessionEntry || !params.sessionStore || !params.sessionKey) return false;
|
|
2254
|
-
params.sessionEntry.updatedAt = Date.now();
|
|
2255
|
-
params.sessionStore[params.sessionKey] = params.sessionEntry;
|
|
2256
|
-
if (params.storePath) await updateSessionStore(params.storePath, (store) => {
|
|
2257
|
-
store[params.sessionKey] = params.sessionEntry;
|
|
2258
|
-
});
|
|
2259
|
-
return true;
|
|
2260
|
-
}
|
|
2261
|
-
async function persistAbortTargetEntry(params) {
|
|
2262
|
-
const { entry, key, sessionStore, storePath, abortCutoff } = params;
|
|
2263
|
-
if (!entry || !key || !sessionStore) return false;
|
|
2264
|
-
entry.abortedLastRun = true;
|
|
2265
|
-
applyAbortCutoffToSessionEntry(entry, abortCutoff);
|
|
2266
|
-
entry.updatedAt = Date.now();
|
|
2267
|
-
sessionStore[key] = entry;
|
|
2268
|
-
if (storePath) await updateSessionStore(storePath, (store) => {
|
|
2269
|
-
const nextEntry = store[key] ?? entry;
|
|
2270
|
-
if (!nextEntry) return;
|
|
2271
|
-
nextEntry.abortedLastRun = true;
|
|
2272
|
-
applyAbortCutoffToSessionEntry(nextEntry, abortCutoff);
|
|
2273
|
-
nextEntry.updatedAt = Date.now();
|
|
2274
|
-
store[key] = nextEntry;
|
|
2275
|
-
});
|
|
2276
|
-
return true;
|
|
2277
|
-
}
|
|
2278
|
-
//#endregion
|
|
2279
|
-
//#region src/auto-reply/reply/commands-session-abort.ts
|
|
2280
|
-
function resolveAbortTarget(params) {
|
|
2281
|
-
const targetSessionKey = params.ctx.CommandTargetSessionKey?.trim() || params.sessionKey;
|
|
2282
|
-
const { entry, key } = resolveSessionEntryForKey(params.sessionStore, targetSessionKey);
|
|
2283
|
-
if (entry && key) return {
|
|
2284
|
-
entry,
|
|
2285
|
-
key,
|
|
2286
|
-
sessionId: entry.sessionId
|
|
2287
|
-
};
|
|
2288
|
-
if (params.sessionEntry && params.sessionKey) return {
|
|
2289
|
-
entry: params.sessionEntry,
|
|
2290
|
-
key: params.sessionKey,
|
|
2291
|
-
sessionId: params.sessionEntry.sessionId
|
|
2292
|
-
};
|
|
2293
|
-
return {
|
|
2294
|
-
entry: void 0,
|
|
2295
|
-
key: targetSessionKey,
|
|
2296
|
-
sessionId: void 0
|
|
2297
|
-
};
|
|
2298
|
-
}
|
|
2299
|
-
function resolveAbortCutoffForTarget(params) {
|
|
2300
|
-
if (!shouldPersistAbortCutoff({
|
|
2301
|
-
commandSessionKey: params.commandSessionKey,
|
|
2302
|
-
targetSessionKey: params.targetSessionKey
|
|
2303
|
-
})) return;
|
|
2304
|
-
return resolveAbortCutoffFromContext(params.ctx);
|
|
2305
|
-
}
|
|
2306
|
-
async function applyAbortTarget(params) {
|
|
2307
|
-
const { abortTarget } = params;
|
|
2308
|
-
if (abortTarget.sessionId) abortEmbeddedPiRun(abortTarget.sessionId);
|
|
2309
|
-
if (!await persistAbortTargetEntry({
|
|
2310
|
-
entry: abortTarget.entry,
|
|
2311
|
-
key: abortTarget.key,
|
|
2312
|
-
sessionStore: params.sessionStore,
|
|
2313
|
-
storePath: params.storePath,
|
|
2314
|
-
abortCutoff: params.abortCutoff
|
|
2315
|
-
}) && params.abortKey) setAbortMemory(params.abortKey, true);
|
|
2316
|
-
}
|
|
2317
|
-
function buildAbortTargetApplyParams(params, abortTarget) {
|
|
2318
|
-
return {
|
|
2319
|
-
abortTarget,
|
|
2320
|
-
sessionStore: params.sessionStore,
|
|
2321
|
-
storePath: params.storePath,
|
|
2322
|
-
abortKey: params.command.abortKey,
|
|
2323
|
-
abortCutoff: resolveAbortCutoffForTarget({
|
|
2324
|
-
ctx: params.ctx,
|
|
2325
|
-
commandSessionKey: params.sessionKey,
|
|
2326
|
-
targetSessionKey: abortTarget.key
|
|
2327
|
-
})
|
|
2328
|
-
};
|
|
2329
|
-
}
|
|
2330
|
-
const handleStopCommand = async (params, allowTextCommands) => {
|
|
2331
|
-
if (!allowTextCommands) return null;
|
|
2332
|
-
if (params.command.commandBodyNormalized !== "/stop") return null;
|
|
2333
|
-
const unauthorizedStop = rejectUnauthorizedCommand(params, "/stop");
|
|
2334
|
-
if (unauthorizedStop) return unauthorizedStop;
|
|
2335
|
-
const abortTarget = resolveAbortTarget({
|
|
2336
|
-
ctx: params.ctx,
|
|
2337
|
-
sessionKey: params.sessionKey,
|
|
2338
|
-
sessionEntry: params.sessionEntry,
|
|
2339
|
-
sessionStore: params.sessionStore
|
|
2340
|
-
});
|
|
2341
|
-
const cleared = clearSessionQueues([abortTarget.key, abortTarget.sessionId]);
|
|
2342
|
-
if (cleared.followupCleared > 0 || cleared.laneCleared > 0) logVerbose(`stop: cleared followups=${cleared.followupCleared} lane=${cleared.laneCleared} keys=${cleared.keys.join(",")}`);
|
|
2343
|
-
await applyAbortTarget(buildAbortTargetApplyParams(params, abortTarget));
|
|
2344
|
-
await triggerInternalHook(createInternalHookEvent("command", "stop", abortTarget.key ?? params.sessionKey ?? "", {
|
|
2345
|
-
sessionEntry: abortTarget.entry ?? params.sessionEntry,
|
|
2346
|
-
sessionId: abortTarget.sessionId,
|
|
2347
|
-
commandSource: params.command.surface,
|
|
2348
|
-
senderId: params.command.senderId
|
|
2349
|
-
}));
|
|
2350
|
-
const { stopped } = stopSubagentsForRequester({
|
|
2351
|
-
cfg: params.cfg,
|
|
2352
|
-
requesterSessionKey: abortTarget.key ?? params.sessionKey
|
|
2353
|
-
});
|
|
2354
|
-
return {
|
|
2355
|
-
shouldContinue: false,
|
|
2356
|
-
reply: { text: formatAbortReplyText(stopped) }
|
|
2357
|
-
};
|
|
2358
|
-
};
|
|
2359
|
-
const handleAbortTrigger = async (params, allowTextCommands) => {
|
|
2360
|
-
if (!allowTextCommands) return null;
|
|
2361
|
-
if (!isAbortTrigger(params.command.rawBodyNormalized)) return null;
|
|
2362
|
-
const unauthorizedAbortTrigger = rejectUnauthorizedCommand(params, "abort trigger");
|
|
2363
|
-
if (unauthorizedAbortTrigger) return unauthorizedAbortTrigger;
|
|
2364
|
-
await applyAbortTarget(buildAbortTargetApplyParams(params, resolveAbortTarget({
|
|
2365
|
-
ctx: params.ctx,
|
|
2366
|
-
sessionKey: params.sessionKey,
|
|
2367
|
-
sessionEntry: params.sessionEntry,
|
|
2368
|
-
sessionStore: params.sessionStore
|
|
2369
|
-
})));
|
|
2370
|
-
return {
|
|
2371
|
-
shouldContinue: false,
|
|
2372
|
-
reply: { text: "āļø Agent was aborted." }
|
|
2373
|
-
};
|
|
2374
|
-
};
|
|
2375
|
-
//#endregion
|
|
2376
|
-
//#region src/auto-reply/reply/matrix-context.ts
|
|
2377
|
-
function normalizeMatrixTarget(value) {
|
|
2378
|
-
return typeof value === "string" ? value.trim() : "";
|
|
2379
|
-
}
|
|
2380
|
-
function resolveMatrixRoomIdFromTarget(raw) {
|
|
2381
|
-
let target = normalizeMatrixTarget(raw);
|
|
2382
|
-
if (!target) return;
|
|
2383
|
-
if (target.toLowerCase().startsWith("matrix:")) target = target.slice(7).trim();
|
|
2384
|
-
if (/^(room|channel):/i.test(target)) return target.replace(/^(room|channel):/i, "").trim() || void 0;
|
|
2385
|
-
if (target.startsWith("!") || target.startsWith("#")) return target;
|
|
2386
|
-
}
|
|
2387
|
-
function resolveMatrixParentConversationId(params) {
|
|
2388
|
-
const targets = [
|
|
2389
|
-
params.ctx.OriginatingTo,
|
|
2390
|
-
params.command.to,
|
|
2391
|
-
params.ctx.To
|
|
2392
|
-
];
|
|
2393
|
-
for (const candidate of targets) {
|
|
2394
|
-
const roomId = resolveMatrixRoomIdFromTarget(candidate ?? "");
|
|
2395
|
-
if (roomId) return roomId;
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
function resolveMatrixConversationId(params) {
|
|
2399
|
-
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2400
|
-
if (threadId) return threadId;
|
|
2401
|
-
return resolveMatrixParentConversationId(params);
|
|
2402
|
-
}
|
|
2403
|
-
//#endregion
|
|
2404
|
-
//#region src/auto-reply/reply/commands-session.ts
|
|
2405
|
-
const SESSION_DURATION_OFF_VALUES = new Set([
|
|
2406
|
-
"off",
|
|
2407
|
-
"disable",
|
|
2408
|
-
"disabled",
|
|
2409
|
-
"none",
|
|
2410
|
-
"0"
|
|
2411
|
-
]);
|
|
2412
|
-
const SESSION_ACTION_IDLE = "idle";
|
|
2413
|
-
const SESSION_ACTION_MAX_AGE = "max-age";
|
|
2414
|
-
let cachedChannelRuntime;
|
|
2415
|
-
function getChannelRuntime() {
|
|
2416
|
-
cachedChannelRuntime ??= createPluginRuntime().channel;
|
|
2417
|
-
return cachedChannelRuntime;
|
|
2418
|
-
}
|
|
2419
|
-
function resolveSessionCommandUsage() {
|
|
2420
|
-
return "Usage: /session idle <duration|off> | /session max-age <duration|off> (example: /session idle 24h)";
|
|
2421
|
-
}
|
|
2422
|
-
function parseSessionDurationMs(raw) {
|
|
2423
|
-
const normalized = raw.trim().toLowerCase();
|
|
2424
|
-
if (!normalized) throw new Error("missing duration");
|
|
2425
|
-
if (SESSION_DURATION_OFF_VALUES.has(normalized)) return 0;
|
|
2426
|
-
if (/^\d+(?:\.\d+)?$/.test(normalized)) {
|
|
2427
|
-
const hours = Number(normalized);
|
|
2428
|
-
if (!Number.isFinite(hours) || hours < 0) throw new Error("invalid duration");
|
|
2429
|
-
return Math.round(hours * 60 * 60 * 1e3);
|
|
2430
|
-
}
|
|
2431
|
-
return parseDurationMs(normalized, { defaultUnit: "h" });
|
|
2432
|
-
}
|
|
2433
|
-
function formatSessionExpiry(expiresAt) {
|
|
2434
|
-
return new Date(expiresAt).toISOString();
|
|
2435
|
-
}
|
|
2436
|
-
function resolveSessionBindingDurationMs(binding, key, fallbackMs) {
|
|
2437
|
-
const raw = binding.metadata?.[key];
|
|
2438
|
-
if (typeof raw !== "number" || !Number.isFinite(raw)) return fallbackMs;
|
|
2439
|
-
return Math.max(0, Math.floor(raw));
|
|
2440
|
-
}
|
|
2441
|
-
function resolveSessionBindingLastActivityAt(binding) {
|
|
2442
|
-
const raw = binding.metadata?.lastActivityAt;
|
|
2443
|
-
if (typeof raw !== "number" || !Number.isFinite(raw)) return binding.boundAt;
|
|
2444
|
-
return Math.max(Math.floor(raw), binding.boundAt);
|
|
2445
|
-
}
|
|
2446
|
-
function resolveSessionBindingBoundBy(binding) {
|
|
2447
|
-
const raw = binding.metadata?.boundBy;
|
|
2448
|
-
return typeof raw === "string" ? raw.trim() : "";
|
|
2449
|
-
}
|
|
2450
|
-
function isSessionBindingRecord(binding) {
|
|
2451
|
-
return "bindingId" in binding;
|
|
2452
|
-
}
|
|
2453
|
-
function resolveUpdatedLifecycleDurationMs(binding, key) {
|
|
2454
|
-
if (!isSessionBindingRecord(binding)) {
|
|
2455
|
-
const raw = binding[key];
|
|
2456
|
-
if (typeof raw === "number" && Number.isFinite(raw)) return Math.max(0, Math.floor(raw));
|
|
2457
|
-
}
|
|
2458
|
-
if (!isSessionBindingRecord(binding)) return;
|
|
2459
|
-
const raw = binding.metadata?.[key];
|
|
2460
|
-
if (typeof raw !== "number" || !Number.isFinite(raw)) return;
|
|
2461
|
-
return Math.max(0, Math.floor(raw));
|
|
2462
|
-
}
|
|
2463
|
-
function toUpdatedLifecycleBinding(binding) {
|
|
2464
|
-
const lastActivityAt = isSessionBindingRecord(binding) ? resolveSessionBindingLastActivityAt(binding) : Math.max(Math.floor(binding.lastActivityAt), binding.boundAt);
|
|
2465
|
-
return {
|
|
2466
|
-
boundAt: binding.boundAt,
|
|
2467
|
-
lastActivityAt,
|
|
2468
|
-
idleTimeoutMs: resolveUpdatedLifecycleDurationMs(binding, "idleTimeoutMs"),
|
|
2469
|
-
maxAgeMs: resolveUpdatedLifecycleDurationMs(binding, "maxAgeMs")
|
|
2470
|
-
};
|
|
2471
|
-
}
|
|
2472
|
-
function resolveUpdatedBindingExpiry(params) {
|
|
2473
|
-
const expiries = params.bindings.map((binding) => {
|
|
2474
|
-
if (params.action === SESSION_ACTION_IDLE) {
|
|
2475
|
-
const idleTimeoutMs = typeof binding.idleTimeoutMs === "number" && Number.isFinite(binding.idleTimeoutMs) ? Math.max(0, Math.floor(binding.idleTimeoutMs)) : 0;
|
|
2476
|
-
if (idleTimeoutMs <= 0) return;
|
|
2477
|
-
return Math.max(binding.lastActivityAt, binding.boundAt) + idleTimeoutMs;
|
|
2478
|
-
}
|
|
2479
|
-
const maxAgeMs = typeof binding.maxAgeMs === "number" && Number.isFinite(binding.maxAgeMs) ? Math.max(0, Math.floor(binding.maxAgeMs)) : 0;
|
|
2480
|
-
if (maxAgeMs <= 0) return;
|
|
2481
|
-
return binding.boundAt + maxAgeMs;
|
|
2482
|
-
}).filter((expiresAt) => typeof expiresAt === "number");
|
|
2483
|
-
if (expiries.length === 0) return;
|
|
2484
|
-
return Math.min(...expiries);
|
|
2485
|
-
}
|
|
2486
|
-
const handleActivationCommand = async (params, allowTextCommands) => {
|
|
2487
|
-
if (!allowTextCommands) return null;
|
|
2488
|
-
const activationCommand = parseActivationCommand(params.command.commandBodyNormalized);
|
|
2489
|
-
if (!activationCommand.hasCommand) return null;
|
|
2490
|
-
if (!params.isGroup) return {
|
|
2491
|
-
shouldContinue: false,
|
|
2492
|
-
reply: { text: "āļø Group activation only applies to group chats." }
|
|
2493
|
-
};
|
|
2494
|
-
if (!params.command.isAuthorizedSender) {
|
|
2495
|
-
logVerbose(`Ignoring /activation from unauthorized sender in group: ${params.command.senderId || "<unknown>"}`);
|
|
2496
|
-
return { shouldContinue: false };
|
|
2497
|
-
}
|
|
2498
|
-
if (!activationCommand.mode) return {
|
|
2499
|
-
shouldContinue: false,
|
|
2500
|
-
reply: { text: "āļø Usage: /activation mention|always" }
|
|
2501
|
-
};
|
|
2502
|
-
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2503
|
-
params.sessionEntry.groupActivation = activationCommand.mode;
|
|
2504
|
-
params.sessionEntry.groupActivationNeedsSystemIntro = true;
|
|
2505
|
-
await persistSessionEntry(params);
|
|
2506
|
-
}
|
|
2507
|
-
return {
|
|
2508
|
-
shouldContinue: false,
|
|
2509
|
-
reply: { text: `āļø Group activation set to ${activationCommand.mode}.` }
|
|
2510
|
-
};
|
|
2511
|
-
};
|
|
2512
|
-
const handleSendPolicyCommand = async (params, allowTextCommands) => {
|
|
2513
|
-
if (!allowTextCommands) return null;
|
|
2514
|
-
const sendPolicyCommand = parseSendPolicyCommand(params.command.commandBodyNormalized);
|
|
2515
|
-
if (!sendPolicyCommand.hasCommand) return null;
|
|
2516
|
-
const unauthorizedResult = rejectUnauthorizedCommand(params, "/send");
|
|
2517
|
-
if (unauthorizedResult) return unauthorizedResult;
|
|
2518
|
-
const nonOwnerResult = rejectNonOwnerCommand(params, "/send");
|
|
2519
|
-
if (nonOwnerResult) return nonOwnerResult;
|
|
2520
|
-
if (!sendPolicyCommand.mode) return {
|
|
2521
|
-
shouldContinue: false,
|
|
2522
|
-
reply: { text: "āļø Usage: /send on|off|inherit" }
|
|
2523
|
-
};
|
|
2524
|
-
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2525
|
-
if (sendPolicyCommand.mode === "inherit") delete params.sessionEntry.sendPolicy;
|
|
2526
|
-
else params.sessionEntry.sendPolicy = sendPolicyCommand.mode;
|
|
2527
|
-
await persistSessionEntry(params);
|
|
2528
|
-
}
|
|
2529
|
-
return {
|
|
2530
|
-
shouldContinue: false,
|
|
2531
|
-
reply: { text: `āļø Send policy set to ${sendPolicyCommand.mode === "inherit" ? "inherit" : sendPolicyCommand.mode === "allow" ? "on" : "off"}.` }
|
|
2532
|
-
};
|
|
2533
|
-
};
|
|
2534
|
-
const handleUsageCommand = async (params, allowTextCommands) => {
|
|
2535
|
-
if (!allowTextCommands) return null;
|
|
2536
|
-
const normalized = params.command.commandBodyNormalized;
|
|
2537
|
-
if (normalized !== "/usage" && !normalized.startsWith("/usage ")) return null;
|
|
2538
|
-
if (!params.command.isAuthorizedSender) {
|
|
2539
|
-
logVerbose(`Ignoring /usage from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2540
|
-
return { shouldContinue: false };
|
|
2541
|
-
}
|
|
2542
|
-
const rawArgs = normalized === "/usage" ? "" : normalized.slice(6).trim();
|
|
2543
|
-
const requested = rawArgs ? normalizeUsageDisplay(rawArgs) : void 0;
|
|
2544
|
-
if (rawArgs.toLowerCase().startsWith("cost")) {
|
|
2545
|
-
const sessionSummary = await loadSessionCostSummary({
|
|
2546
|
-
sessionId: params.sessionEntry?.sessionId,
|
|
2547
|
-
sessionEntry: params.sessionEntry,
|
|
2548
|
-
sessionFile: params.sessionEntry?.sessionFile,
|
|
2549
|
-
config: params.cfg,
|
|
2550
|
-
agentId: params.agentId
|
|
2551
|
-
});
|
|
2552
|
-
const summary = await loadCostUsageSummary({
|
|
2553
|
-
days: 30,
|
|
2554
|
-
config: params.cfg
|
|
2555
|
-
});
|
|
2556
|
-
const sessionCost = formatUsd(sessionSummary?.totalCost);
|
|
2557
|
-
const sessionTokens = sessionSummary?.totalTokens ? formatTokenCount$1(sessionSummary.totalTokens) : void 0;
|
|
2558
|
-
const sessionSuffix = (sessionSummary?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
2559
|
-
const sessionLine = sessionCost || sessionTokens ? `Session ${sessionCost ?? "n/a"}${sessionSuffix}${sessionTokens ? ` Ā· ${sessionTokens} tokens` : ""}` : "Session n/a";
|
|
2560
|
-
const todayKey = (/* @__PURE__ */ new Date()).toLocaleDateString("en-CA");
|
|
2561
|
-
const todayEntry = summary.daily.find((entry) => entry.date === todayKey);
|
|
2562
|
-
const todayCost = formatUsd(todayEntry?.totalCost);
|
|
2563
|
-
const todaySuffix = (todayEntry?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
2564
|
-
const todayLine = `Today ${todayCost ?? "n/a"}${todaySuffix}`;
|
|
2565
|
-
const last30Cost = formatUsd(summary.totals.totalCost);
|
|
2566
|
-
const last30Suffix = summary.totals.missingCostEntries > 0 ? " (partial)" : "";
|
|
2567
|
-
return {
|
|
2568
|
-
shouldContinue: false,
|
|
2569
|
-
reply: { text: `šø Usage cost\n${sessionLine}\n${todayLine}\n${`Last 30d ${last30Cost ?? "n/a"}${last30Suffix}`}` }
|
|
2570
|
-
};
|
|
2571
|
-
}
|
|
2572
|
-
if (rawArgs && !requested) return {
|
|
2573
|
-
shouldContinue: false,
|
|
2574
|
-
reply: { text: "āļø Usage: /usage off|tokens|full|cost" }
|
|
2575
|
-
};
|
|
2576
|
-
const current = resolveResponseUsageMode(params.sessionEntry?.responseUsage ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey]?.responseUsage : void 0));
|
|
2577
|
-
const next = requested ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
|
|
2578
|
-
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2579
|
-
if (next === "off") delete params.sessionEntry.responseUsage;
|
|
2580
|
-
else params.sessionEntry.responseUsage = next;
|
|
2581
|
-
await persistSessionEntry(params);
|
|
2582
|
-
}
|
|
2583
|
-
return {
|
|
2584
|
-
shouldContinue: false,
|
|
2585
|
-
reply: { text: `āļø Usage footer: ${next}.` }
|
|
2586
|
-
};
|
|
2587
|
-
};
|
|
2588
|
-
const handleFastCommand = async (params, allowTextCommands) => {
|
|
2589
|
-
if (!allowTextCommands) return null;
|
|
2590
|
-
const normalized = params.command.commandBodyNormalized;
|
|
2591
|
-
if (normalized !== "/fast" && !normalized.startsWith("/fast ")) return null;
|
|
2592
|
-
if (!params.command.isAuthorizedSender) {
|
|
2593
|
-
logVerbose(`Ignoring /fast from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2594
|
-
return { shouldContinue: false };
|
|
2595
|
-
}
|
|
2596
|
-
const rawMode = (normalized === "/fast" ? "" : normalized.slice(5).trim()).toLowerCase();
|
|
2597
|
-
if (!rawMode || rawMode === "status") {
|
|
2598
|
-
const state = resolveFastModeState({
|
|
2599
|
-
cfg: params.cfg,
|
|
2600
|
-
provider: params.provider,
|
|
2601
|
-
model: params.model,
|
|
2602
|
-
agentId: params.agentId,
|
|
2603
|
-
sessionEntry: params.sessionEntry
|
|
2604
|
-
});
|
|
2605
|
-
const suffix = state.source === "agent" ? " (agent)" : state.source === "config" ? " (config)" : state.source === "default" ? " (default)" : "";
|
|
2606
|
-
return {
|
|
2607
|
-
shouldContinue: false,
|
|
2608
|
-
reply: { text: `āļø Current fast mode: ${state.enabled ? "on" : "off"}${suffix}.` }
|
|
2609
|
-
};
|
|
2610
|
-
}
|
|
2611
|
-
const nextMode = normalizeFastMode(rawMode);
|
|
2612
|
-
if (nextMode === void 0) return {
|
|
2613
|
-
shouldContinue: false,
|
|
2614
|
-
reply: { text: "āļø Usage: /fast status|on|off" }
|
|
2615
|
-
};
|
|
2616
|
-
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
2617
|
-
params.sessionEntry.fastMode = nextMode;
|
|
2618
|
-
await persistSessionEntry(params);
|
|
2619
|
-
}
|
|
2620
|
-
return {
|
|
2621
|
-
shouldContinue: false,
|
|
2622
|
-
reply: { text: `āļø Fast mode ${nextMode ? "enabled" : "disabled"}.` }
|
|
2623
|
-
};
|
|
2624
|
-
};
|
|
2625
|
-
const handleSessionCommand = async (params, allowTextCommands) => {
|
|
2626
|
-
if (!allowTextCommands) return null;
|
|
2627
|
-
const normalized = params.command.commandBodyNormalized;
|
|
2628
|
-
if (!/^\/session(?:\s|$)/.test(normalized)) return null;
|
|
2629
|
-
if (!params.command.isAuthorizedSender) {
|
|
2630
|
-
logVerbose(`Ignoring /session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2631
|
-
return { shouldContinue: false };
|
|
2632
|
-
}
|
|
2633
|
-
const tokens = normalized.slice(8).trim().split(/\s+/).filter(Boolean);
|
|
2634
|
-
const action = tokens[0]?.toLowerCase();
|
|
2635
|
-
if (action !== SESSION_ACTION_IDLE && action !== SESSION_ACTION_MAX_AGE) return {
|
|
2636
|
-
shouldContinue: false,
|
|
2637
|
-
reply: { text: resolveSessionCommandUsage() }
|
|
2638
|
-
};
|
|
2639
|
-
const onDiscord = isDiscordSurface(params);
|
|
2640
|
-
const onMatrix = isMatrixSurface(params);
|
|
2641
|
-
const onTelegram = isTelegramSurface(params);
|
|
2642
|
-
if (!onDiscord && !onMatrix && !onTelegram) return {
|
|
2643
|
-
shouldContinue: false,
|
|
2644
|
-
reply: { text: "ā ļø /session idle and /session max-age are currently available for Discord, Matrix, and Telegram bound sessions." }
|
|
2645
|
-
};
|
|
2646
|
-
const accountId = resolveChannelAccountId(params);
|
|
2647
|
-
const sessionBindingService = getSessionBindingService();
|
|
2648
|
-
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2649
|
-
const matrixConversationId = onMatrix ? resolveMatrixConversationId({
|
|
2650
|
-
ctx: {
|
|
2651
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
2652
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
2653
|
-
To: params.ctx.To
|
|
2654
|
-
},
|
|
2655
|
-
command: { to: params.command.to }
|
|
2656
|
-
}) : void 0;
|
|
2657
|
-
const matrixParentConversationId = onMatrix ? resolveMatrixParentConversationId({
|
|
2658
|
-
ctx: {
|
|
2659
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
2660
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
2661
|
-
To: params.ctx.To
|
|
2662
|
-
},
|
|
2663
|
-
command: { to: params.command.to }
|
|
2664
|
-
}) : void 0;
|
|
2665
|
-
const telegramConversationId = onTelegram ? resolveTelegramConversationId(params) : void 0;
|
|
2666
|
-
const channelRuntime = getChannelRuntime();
|
|
2667
|
-
const discordManager = onDiscord ? channelRuntime.discord.threadBindings.getManager(accountId) : null;
|
|
2668
|
-
if (onDiscord && !discordManager) return {
|
|
2669
|
-
shouldContinue: false,
|
|
2670
|
-
reply: { text: "ā ļø Discord thread bindings are unavailable for this account." }
|
|
2671
|
-
};
|
|
2672
|
-
const discordBinding = onDiscord && threadId ? discordManager?.getByThreadId(threadId) : void 0;
|
|
2673
|
-
const telegramBinding = onTelegram && telegramConversationId ? sessionBindingService.resolveByConversation({
|
|
2674
|
-
channel: "telegram",
|
|
2675
|
-
accountId,
|
|
2676
|
-
conversationId: telegramConversationId
|
|
2677
|
-
}) : null;
|
|
2678
|
-
const matrixBinding = onMatrix && matrixConversationId ? sessionBindingService.resolveByConversation({
|
|
2679
|
-
channel: "matrix",
|
|
2680
|
-
accountId,
|
|
2681
|
-
conversationId: matrixConversationId,
|
|
2682
|
-
...matrixParentConversationId && matrixParentConversationId !== matrixConversationId ? { parentConversationId: matrixParentConversationId } : {}
|
|
2683
|
-
}) : null;
|
|
2684
|
-
if (onDiscord && !discordBinding) {
|
|
2685
|
-
if (onDiscord && !threadId) return {
|
|
2686
|
-
shouldContinue: false,
|
|
2687
|
-
reply: { text: "ā ļø /session idle and /session max-age must be run inside a focused Discord thread." }
|
|
2688
|
-
};
|
|
2689
|
-
return {
|
|
2690
|
-
shouldContinue: false,
|
|
2691
|
-
reply: { text: "ā¹ļø This thread is not currently focused." }
|
|
2692
|
-
};
|
|
2693
|
-
}
|
|
2694
|
-
if (onMatrix && !matrixBinding) {
|
|
2695
|
-
if (!threadId) return {
|
|
2696
|
-
shouldContinue: false,
|
|
2697
|
-
reply: { text: "ā ļø /session idle and /session max-age must be run inside a focused Matrix thread." }
|
|
2698
|
-
};
|
|
2699
|
-
return {
|
|
2700
|
-
shouldContinue: false,
|
|
2701
|
-
reply: { text: "ā¹ļø This thread is not currently focused." }
|
|
2702
|
-
};
|
|
2703
|
-
}
|
|
2704
|
-
if (onTelegram && !telegramBinding) {
|
|
2705
|
-
if (!telegramConversationId) return {
|
|
2706
|
-
shouldContinue: false,
|
|
2707
|
-
reply: { text: "ā ļø /session idle and /session max-age on Telegram require a topic context in groups, or a direct-message conversation." }
|
|
2708
|
-
};
|
|
2709
|
-
return {
|
|
2710
|
-
shouldContinue: false,
|
|
2711
|
-
reply: { text: "ā¹ļø This conversation is not currently focused." }
|
|
2712
|
-
};
|
|
2713
|
-
}
|
|
2714
|
-
const idleTimeoutMs = onDiscord ? channelRuntime.discord.threadBindings.resolveIdleTimeoutMs({
|
|
2715
|
-
record: discordBinding,
|
|
2716
|
-
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
2717
|
-
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "idleTimeoutMs", 1440 * 60 * 1e3);
|
|
2718
|
-
const idleExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveInactivityExpiresAt({
|
|
2719
|
-
record: discordBinding,
|
|
2720
|
-
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
2721
|
-
}) : idleTimeoutMs > 0 ? resolveSessionBindingLastActivityAt(onMatrix ? matrixBinding : telegramBinding) + idleTimeoutMs : void 0;
|
|
2722
|
-
const maxAgeMs = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeMs({
|
|
2723
|
-
record: discordBinding,
|
|
2724
|
-
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
2725
|
-
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "maxAgeMs", 0);
|
|
2726
|
-
const maxAgeExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeExpiresAt({
|
|
2727
|
-
record: discordBinding,
|
|
2728
|
-
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
2729
|
-
}) : maxAgeMs > 0 ? (onMatrix ? matrixBinding : telegramBinding).boundAt + maxAgeMs : void 0;
|
|
2730
|
-
const durationArgRaw = tokens.slice(1).join("");
|
|
2731
|
-
if (!durationArgRaw) {
|
|
2732
|
-
if (action === SESSION_ACTION_IDLE) {
|
|
2733
|
-
if (typeof idleExpiresAt === "number" && Number.isFinite(idleExpiresAt) && idleExpiresAt > Date.now()) return {
|
|
2734
|
-
shouldContinue: false,
|
|
2735
|
-
reply: { text: `ā¹ļø Idle timeout active (${formatThreadBindingDurationLabel(idleTimeoutMs)}, next auto-unfocus at ${formatSessionExpiry(idleExpiresAt)}).` }
|
|
2736
|
-
};
|
|
2737
|
-
return {
|
|
2738
|
-
shouldContinue: false,
|
|
2739
|
-
reply: { text: "ā¹ļø Idle timeout is currently disabled for this focused session." }
|
|
2740
|
-
};
|
|
2741
|
-
}
|
|
2742
|
-
if (typeof maxAgeExpiresAt === "number" && Number.isFinite(maxAgeExpiresAt) && maxAgeExpiresAt > Date.now()) return {
|
|
2743
|
-
shouldContinue: false,
|
|
2744
|
-
reply: { text: `ā¹ļø Max age active (${formatThreadBindingDurationLabel(maxAgeMs)}, hard auto-unfocus at ${formatSessionExpiry(maxAgeExpiresAt)}).` }
|
|
2745
|
-
};
|
|
2746
|
-
return {
|
|
2747
|
-
shouldContinue: false,
|
|
2748
|
-
reply: { text: "ā¹ļø Max age is currently disabled for this focused session." }
|
|
2749
|
-
};
|
|
2750
|
-
}
|
|
2751
|
-
const senderId = params.command.senderId?.trim() || "";
|
|
2752
|
-
const boundBy = onDiscord ? discordBinding.boundBy : resolveSessionBindingBoundBy(onMatrix ? matrixBinding : telegramBinding);
|
|
2753
|
-
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
|
|
2754
|
-
shouldContinue: false,
|
|
2755
|
-
reply: { text: onDiscord ? `ā ļø Only ${boundBy} can update session lifecycle settings for this thread.` : onMatrix ? `ā ļø Only ${boundBy} can update session lifecycle settings for this thread.` : `ā ļø Only ${boundBy} can update session lifecycle settings for this conversation.` }
|
|
2756
|
-
};
|
|
2757
|
-
let durationMs;
|
|
2758
|
-
try {
|
|
2759
|
-
durationMs = parseSessionDurationMs(durationArgRaw);
|
|
2760
|
-
} catch {
|
|
2761
|
-
return {
|
|
2762
|
-
shouldContinue: false,
|
|
2763
|
-
reply: { text: resolveSessionCommandUsage() }
|
|
2764
|
-
};
|
|
2765
|
-
}
|
|
2766
|
-
const updatedBindings = (() => {
|
|
2767
|
-
if (onDiscord) return action === SESSION_ACTION_IDLE ? channelRuntime.discord.threadBindings.setIdleTimeoutBySessionKey({
|
|
2768
|
-
targetSessionKey: discordBinding.targetSessionKey,
|
|
2769
|
-
accountId,
|
|
2770
|
-
idleTimeoutMs: durationMs
|
|
2771
|
-
}) : channelRuntime.discord.threadBindings.setMaxAgeBySessionKey({
|
|
2772
|
-
targetSessionKey: discordBinding.targetSessionKey,
|
|
2773
|
-
accountId,
|
|
2774
|
-
maxAgeMs: durationMs
|
|
2775
|
-
});
|
|
2776
|
-
if (onMatrix) return action === SESSION_ACTION_IDLE ? channelRuntime.matrix.threadBindings.setIdleTimeoutBySessionKey({
|
|
2777
|
-
targetSessionKey: matrixBinding.targetSessionKey,
|
|
2778
|
-
accountId,
|
|
2779
|
-
idleTimeoutMs: durationMs
|
|
2780
|
-
}) : channelRuntime.matrix.threadBindings.setMaxAgeBySessionKey({
|
|
2781
|
-
targetSessionKey: matrixBinding.targetSessionKey,
|
|
2782
|
-
accountId,
|
|
2783
|
-
maxAgeMs: durationMs
|
|
2784
|
-
});
|
|
2785
|
-
return action === SESSION_ACTION_IDLE ? channelRuntime.threadBindings.setIdleTimeoutBySessionKey({
|
|
2786
|
-
channelId: "telegram",
|
|
2787
|
-
targetSessionKey: telegramBinding.targetSessionKey,
|
|
2788
|
-
accountId,
|
|
2789
|
-
idleTimeoutMs: durationMs
|
|
2790
|
-
}) : channelRuntime.threadBindings.setMaxAgeBySessionKey({
|
|
2791
|
-
channelId: "telegram",
|
|
2792
|
-
targetSessionKey: telegramBinding.targetSessionKey,
|
|
2793
|
-
accountId,
|
|
2794
|
-
maxAgeMs: durationMs
|
|
2795
|
-
});
|
|
2796
|
-
})();
|
|
2797
|
-
if (updatedBindings.length === 0) return {
|
|
2798
|
-
shouldContinue: false,
|
|
2799
|
-
reply: { text: action === SESSION_ACTION_IDLE ? "ā ļø Failed to update idle timeout for the current binding." : "ā ļø Failed to update max age for the current binding." }
|
|
2800
|
-
};
|
|
2801
|
-
if (durationMs <= 0) return {
|
|
2802
|
-
shouldContinue: false,
|
|
2803
|
-
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"}.` }
|
|
2804
|
-
};
|
|
2805
|
-
const nextExpiry = resolveUpdatedBindingExpiry({
|
|
2806
|
-
action,
|
|
2807
|
-
bindings: updatedBindings.map((binding) => toUpdatedLifecycleBinding(binding))
|
|
2808
|
-
});
|
|
2809
|
-
const expiryLabel = typeof nextExpiry === "number" && Number.isFinite(nextExpiry) ? formatSessionExpiry(nextExpiry) : "n/a";
|
|
2810
|
-
return {
|
|
2811
|
-
shouldContinue: false,
|
|
2812
|
-
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}).` }
|
|
2813
|
-
};
|
|
2814
|
-
};
|
|
2815
|
-
const handleRestartCommand = async (params, allowTextCommands) => {
|
|
2816
|
-
if (!allowTextCommands) return null;
|
|
2817
|
-
if (params.command.commandBodyNormalized !== "/restart") return null;
|
|
2818
|
-
if (!params.command.isAuthorizedSender) {
|
|
2819
|
-
logVerbose(`Ignoring /restart from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2820
|
-
return { shouldContinue: false };
|
|
2821
|
-
}
|
|
2822
|
-
if (!isRestartEnabled(params.cfg)) return {
|
|
2823
|
-
shouldContinue: false,
|
|
2824
|
-
reply: { text: "ā ļø /restart is disabled (commands.restart=false)." }
|
|
2825
|
-
};
|
|
2826
|
-
if (process.listenerCount("SIGUSR1") > 0) {
|
|
2827
|
-
scheduleGatewaySigusr1Restart({ reason: "/restart" });
|
|
2828
|
-
return {
|
|
2829
|
-
shouldContinue: false,
|
|
2830
|
-
reply: { text: "āļø Restarting StableClaw in-process (SIGUSR1); back in a few seconds." }
|
|
2831
|
-
};
|
|
2832
|
-
}
|
|
2833
|
-
const restartMethod = triggerStableClawRestart();
|
|
2834
|
-
if (!restartMethod.ok) {
|
|
2835
|
-
const detail = restartMethod.detail ? ` Details: ${restartMethod.detail}` : "";
|
|
2836
|
-
return {
|
|
2837
|
-
shouldContinue: false,
|
|
2838
|
-
reply: { text: `ā ļø Restart failed (${restartMethod.method}).${detail}` }
|
|
2839
|
-
};
|
|
2840
|
-
}
|
|
2841
|
-
return {
|
|
2842
|
-
shouldContinue: false,
|
|
2843
|
-
reply: { text: `āļø Restarting OpenClaw via ${restartMethod.method}; give me a few seconds to come back online.` }
|
|
2844
|
-
};
|
|
2845
|
-
};
|
|
2846
|
-
//#endregion
|
|
2847
|
-
//#region src/auto-reply/reply/commands-subagents/action-agents.ts
|
|
2848
|
-
function formatConversationBindingText(params) {
|
|
2849
|
-
if (params.channel === "discord" || params.channel === "matrix") return `thread:${params.conversationId}`;
|
|
2850
|
-
if (params.channel === "telegram") return `conversation:${params.conversationId}`;
|
|
2851
|
-
return `binding:${params.conversationId}`;
|
|
2852
|
-
}
|
|
2853
|
-
function handleSubagentsAgentsAction(ctx) {
|
|
2854
|
-
const { params, requesterKey, runs } = ctx;
|
|
2855
|
-
const channel = resolveCommandSurfaceChannel(params);
|
|
2856
|
-
const accountId = resolveChannelAccountId(params);
|
|
2857
|
-
const bindingService = getSessionBindingService();
|
|
2858
|
-
const bindingsBySession = /* @__PURE__ */ new Map();
|
|
2859
|
-
const resolveSessionBindings = (sessionKey) => {
|
|
2860
|
-
const cached = bindingsBySession.get(sessionKey);
|
|
2861
|
-
if (cached) return cached;
|
|
2862
|
-
const resolved = bindingService.listBySession(sessionKey).filter((entry) => entry.status === "active" && entry.conversation.channel === channel && entry.conversation.accountId === accountId);
|
|
2863
|
-
bindingsBySession.set(sessionKey, resolved);
|
|
2864
|
-
return resolved;
|
|
2865
|
-
};
|
|
2866
|
-
const dedupedRuns = [];
|
|
2867
|
-
const seenChildSessionKeys = /* @__PURE__ */ new Set();
|
|
2868
|
-
for (const entry of sortSubagentRuns(runs)) {
|
|
2869
|
-
if (seenChildSessionKeys.has(entry.childSessionKey)) continue;
|
|
2870
|
-
seenChildSessionKeys.add(entry.childSessionKey);
|
|
2871
|
-
dedupedRuns.push(entry);
|
|
2872
|
-
}
|
|
2873
|
-
const recentCutoff = Date.now() - 30 * 6e4;
|
|
2874
|
-
const numericOrder = [...dedupedRuns.filter((entry) => !entry.endedAt || countPendingDescendantRuns(entry.childSessionKey) > 0), ...dedupedRuns.filter((entry) => entry.endedAt && countPendingDescendantRuns(entry.childSessionKey) === 0 && entry.endedAt >= recentCutoff)];
|
|
2875
|
-
const indexByChildSessionKey = new Map(numericOrder.map((entry, idx) => [entry.childSessionKey, idx + 1]));
|
|
2876
|
-
const visibleRuns = [];
|
|
2877
|
-
for (const entry of dedupedRuns) {
|
|
2878
|
-
if (!(!entry.endedAt || countPendingDescendantRuns(entry.childSessionKey) > 0 || resolveSessionBindings(entry.childSessionKey).length > 0)) continue;
|
|
2879
|
-
visibleRuns.push(entry);
|
|
2880
|
-
}
|
|
2881
|
-
const lines = ["agents:", "-----"];
|
|
2882
|
-
if (visibleRuns.length === 0) lines.push("(none)");
|
|
2883
|
-
else for (const entry of visibleRuns) {
|
|
2884
|
-
const binding = resolveSessionBindings(entry.childSessionKey)[0];
|
|
2885
|
-
const bindingText = binding ? formatConversationBindingText({
|
|
2886
|
-
channel,
|
|
2887
|
-
conversationId: binding.conversation.conversationId
|
|
2888
|
-
}) : channel === "discord" || channel === "telegram" || channel === "matrix" ? "unbound" : "bindings available on discord/telegram";
|
|
2889
|
-
const resolvedIndex = indexByChildSessionKey.get(entry.childSessionKey);
|
|
2890
|
-
const prefix = resolvedIndex ? `${resolvedIndex}.` : "-";
|
|
2891
|
-
lines.push(`${prefix} ${formatRunLabel(entry)} (${bindingText})`);
|
|
2892
|
-
}
|
|
2893
|
-
const requesterBindings = resolveSessionBindings(requesterKey).filter((entry) => entry.targetKind === "session");
|
|
2894
|
-
if (requesterBindings.length > 0) {
|
|
2895
|
-
lines.push("", "acp/session bindings:", "-----");
|
|
2896
|
-
for (const binding of requesterBindings) {
|
|
2897
|
-
const label = typeof binding.metadata?.label === "string" && binding.metadata.label.trim() ? binding.metadata.label.trim() : binding.targetSessionKey;
|
|
2898
|
-
lines.push(`- ${label} (${formatConversationBindingText({
|
|
2899
|
-
channel,
|
|
2900
|
-
conversationId: binding.conversation.conversationId
|
|
2901
|
-
})}, session:${binding.targetSessionKey})`);
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
return stopWithText(lines.join("\n"));
|
|
2905
|
-
}
|
|
2906
|
-
//#endregion
|
|
2907
|
-
//#region src/auto-reply/reply/commands-subagents/action-focus.ts
|
|
2908
|
-
function resolveFocusBindingContext(params) {
|
|
2909
|
-
if (isDiscordSurface(params)) {
|
|
2910
|
-
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2911
|
-
const parentChannelId = currentThreadId ? void 0 : resolveDiscordChannelIdForFocus(params);
|
|
2912
|
-
const conversationId = currentThreadId || parentChannelId;
|
|
2913
|
-
if (!conversationId) return null;
|
|
2914
|
-
return {
|
|
2915
|
-
channel: "discord",
|
|
2916
|
-
accountId: resolveChannelAccountId(params),
|
|
2917
|
-
conversationId,
|
|
2918
|
-
placement: currentThreadId ? "current" : "child",
|
|
2919
|
-
labelNoun: "thread"
|
|
2920
|
-
};
|
|
2921
|
-
}
|
|
2922
|
-
if (isTelegramSurface(params)) {
|
|
2923
|
-
const conversationId = resolveTelegramConversationId(params);
|
|
2924
|
-
if (!conversationId) return null;
|
|
2925
|
-
return {
|
|
2926
|
-
channel: "telegram",
|
|
2927
|
-
accountId: resolveChannelAccountId(params),
|
|
2928
|
-
conversationId,
|
|
2929
|
-
placement: "current",
|
|
2930
|
-
labelNoun: "conversation"
|
|
2931
|
-
};
|
|
2932
|
-
}
|
|
2933
|
-
if (isMatrixSurface(params)) {
|
|
2934
|
-
const conversationId = resolveMatrixConversationId({
|
|
2935
|
-
ctx: {
|
|
2936
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
2937
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
2938
|
-
To: params.ctx.To
|
|
2939
|
-
},
|
|
2940
|
-
command: { to: params.command.to }
|
|
2941
|
-
});
|
|
2942
|
-
if (!conversationId) return null;
|
|
2943
|
-
const parentConversationId = resolveMatrixParentConversationId({
|
|
2944
|
-
ctx: {
|
|
2945
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
2946
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
2947
|
-
To: params.ctx.To
|
|
2948
|
-
},
|
|
2949
|
-
command: { to: params.command.to }
|
|
2950
|
-
});
|
|
2951
|
-
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
2952
|
-
return {
|
|
2953
|
-
channel: "matrix",
|
|
2954
|
-
accountId: resolveChannelAccountId(params),
|
|
2955
|
-
conversationId,
|
|
2956
|
-
...parentConversationId ? { parentConversationId } : {},
|
|
2957
|
-
placement: currentThreadId ? "current" : "child",
|
|
2958
|
-
labelNoun: "thread"
|
|
2959
|
-
};
|
|
2960
|
-
}
|
|
2961
|
-
return null;
|
|
2962
|
-
}
|
|
2963
|
-
async function handleSubagentsFocusAction(ctx) {
|
|
2964
|
-
const { params, runs, restTokens } = ctx;
|
|
2965
|
-
const channel = resolveCommandSurfaceChannel(params);
|
|
2966
|
-
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("ā ļø /focus is only available on Discord, Matrix, and Telegram.");
|
|
2967
|
-
const token = restTokens.join(" ").trim();
|
|
2968
|
-
if (!token) return stopWithText("Usage: /focus <subagent-label|session-key|session-id|session-label>");
|
|
2969
|
-
const accountId = resolveChannelAccountId(params);
|
|
2970
|
-
const bindingService = getSessionBindingService();
|
|
2971
|
-
const capabilities = bindingService.getCapabilities({
|
|
2972
|
-
channel,
|
|
2973
|
-
accountId
|
|
2974
|
-
});
|
|
2975
|
-
if (!capabilities.adapterAvailable || !capabilities.bindSupported) return stopWithText(`ā ļø ${channel === "discord" ? "Discord thread" : channel === "matrix" ? "Matrix thread" : "Telegram conversation"} bindings are unavailable for this account.`);
|
|
2976
|
-
const focusTarget = await resolveFocusTargetSession({
|
|
2977
|
-
runs,
|
|
2978
|
-
token
|
|
2979
|
-
});
|
|
2980
|
-
if (!focusTarget) return stopWithText(`ā ļø Unable to resolve focus target: ${token}`);
|
|
2981
|
-
const bindingContext = resolveFocusBindingContext(params);
|
|
2982
|
-
if (!bindingContext) {
|
|
2983
|
-
if (channel === "telegram") return stopWithText("ā ļø /focus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
2984
|
-
if (channel === "matrix") return stopWithText("ā ļø Could not resolve a Matrix room for /focus.");
|
|
2985
|
-
return stopWithText("ā ļø Could not resolve a Discord channel for /focus.");
|
|
2986
|
-
}
|
|
2987
|
-
if (channel === "matrix") {
|
|
2988
|
-
const spawnPolicy = resolveThreadBindingSpawnPolicy({
|
|
2989
|
-
cfg: params.cfg,
|
|
2990
|
-
channel,
|
|
2991
|
-
accountId: bindingContext.accountId,
|
|
2992
|
-
kind: "subagent"
|
|
2993
|
-
});
|
|
2994
|
-
if (!spawnPolicy.enabled) return stopWithText(`ā ļø ${formatThreadBindingDisabledError({
|
|
2995
|
-
channel: spawnPolicy.channel,
|
|
2996
|
-
accountId: spawnPolicy.accountId,
|
|
2997
|
-
kind: "subagent"
|
|
2998
|
-
})}`);
|
|
2999
|
-
if (bindingContext.placement === "child" && !spawnPolicy.spawnEnabled) return stopWithText(`ā ļø ${formatThreadBindingSpawnDisabledError({
|
|
3000
|
-
channel: spawnPolicy.channel,
|
|
3001
|
-
accountId: spawnPolicy.accountId,
|
|
3002
|
-
kind: "subagent"
|
|
3003
|
-
})}`);
|
|
3004
|
-
}
|
|
3005
|
-
const senderId = params.command.senderId?.trim() || "";
|
|
3006
|
-
const existingBinding = bindingService.resolveByConversation({
|
|
3007
|
-
channel: bindingContext.channel,
|
|
3008
|
-
accountId: bindingContext.accountId,
|
|
3009
|
-
conversationId: bindingContext.conversationId,
|
|
3010
|
-
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
3011
|
-
});
|
|
3012
|
-
const boundBy = typeof existingBinding?.metadata?.boundBy === "string" ? existingBinding.metadata.boundBy.trim() : "";
|
|
3013
|
-
if (existingBinding && boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return stopWithText(`ā ļø Only ${boundBy} can refocus this ${bindingContext.labelNoun}.`);
|
|
3014
|
-
const label = focusTarget.label || token;
|
|
3015
|
-
const acpMeta = focusTarget.targetKind === "acp" ? readAcpSessionEntry({
|
|
3016
|
-
cfg: params.cfg,
|
|
3017
|
-
sessionKey: focusTarget.targetSessionKey
|
|
3018
|
-
})?.acp : void 0;
|
|
3019
|
-
if (!capabilities.placements.includes(bindingContext.placement)) return stopWithText(`ā ļø ${channel} bindings are unavailable for this account.`);
|
|
3020
|
-
let binding;
|
|
3021
|
-
try {
|
|
3022
|
-
binding = await bindingService.bind({
|
|
3023
|
-
targetSessionKey: focusTarget.targetSessionKey,
|
|
3024
|
-
targetKind: focusTarget.targetKind === "acp" ? "session" : "subagent",
|
|
3025
|
-
conversation: {
|
|
3026
|
-
channel: bindingContext.channel,
|
|
3027
|
-
accountId: bindingContext.accountId,
|
|
3028
|
-
conversationId: bindingContext.conversationId,
|
|
3029
|
-
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
3030
|
-
},
|
|
3031
|
-
placement: bindingContext.placement,
|
|
3032
|
-
metadata: {
|
|
3033
|
-
threadName: resolveThreadBindingThreadName({
|
|
3034
|
-
agentId: focusTarget.agentId,
|
|
3035
|
-
label
|
|
3036
|
-
}),
|
|
3037
|
-
agentId: focusTarget.agentId,
|
|
3038
|
-
label,
|
|
3039
|
-
boundBy: senderId || "unknown",
|
|
3040
|
-
introText: resolveThreadBindingIntroText({
|
|
3041
|
-
agentId: focusTarget.agentId,
|
|
3042
|
-
label,
|
|
3043
|
-
idleTimeoutMs: resolveThreadBindingIdleTimeoutMsForChannel({
|
|
3044
|
-
cfg: params.cfg,
|
|
3045
|
-
channel: bindingContext.channel,
|
|
3046
|
-
accountId
|
|
3047
|
-
}),
|
|
3048
|
-
maxAgeMs: resolveThreadBindingMaxAgeMsForChannel({
|
|
3049
|
-
cfg: params.cfg,
|
|
3050
|
-
channel: bindingContext.channel,
|
|
3051
|
-
accountId
|
|
3052
|
-
}),
|
|
3053
|
-
sessionCwd: focusTarget.targetKind === "acp" ? resolveAcpSessionCwd(acpMeta) : void 0,
|
|
3054
|
-
sessionDetails: focusTarget.targetKind === "acp" ? resolveAcpThreadSessionDetailLines({
|
|
3055
|
-
sessionKey: focusTarget.targetSessionKey,
|
|
3056
|
-
meta: acpMeta
|
|
3057
|
-
}) : []
|
|
3058
|
-
})
|
|
3059
|
-
}
|
|
3060
|
-
});
|
|
3061
|
-
} catch {
|
|
3062
|
-
return stopWithText(`ā ļø Failed to bind this ${bindingContext.labelNoun} to the target session.`);
|
|
3063
|
-
}
|
|
3064
|
-
return stopWithText(`ā
${bindingContext.placement === "child" ? `created thread ${binding.conversation.conversationId} and bound it to ${binding.targetSessionKey}` : `bound this ${bindingContext.labelNoun} to ${binding.targetSessionKey}`} (${focusTarget.targetKind}).`);
|
|
3065
|
-
}
|
|
3066
|
-
//#endregion
|
|
3067
|
-
//#region src/auto-reply/reply/commands-subagents/action-help.ts
|
|
3068
|
-
function handleSubagentsHelpAction() {
|
|
3069
|
-
return stopWithText(buildSubagentsHelp());
|
|
3070
|
-
}
|
|
3071
|
-
//#endregion
|
|
3072
|
-
//#region src/auto-reply/reply/commands-subagents/action-info.ts
|
|
3073
|
-
function handleSubagentsInfoAction(ctx) {
|
|
3074
|
-
const { params, runs, restTokens } = ctx;
|
|
3075
|
-
const target = restTokens[0];
|
|
3076
|
-
if (!target) return stopWithText("ā¹ļø Usage: /subagents info <id|#>");
|
|
3077
|
-
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3078
|
-
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3079
|
-
const run = targetResolution.entry;
|
|
3080
|
-
const { entry: sessionEntry } = loadSubagentSessionEntry(params, run.childSessionKey, {
|
|
3081
|
-
loadSessionStore,
|
|
3082
|
-
resolveStorePath
|
|
3083
|
-
});
|
|
3084
|
-
const runtime = run.startedAt && Number.isFinite(run.startedAt) ? formatDurationCompact((run.endedAt ?? Date.now()) - run.startedAt) ?? "n/a" : "n/a";
|
|
3085
|
-
const outcomeError = sanitizeTaskStatusText(run.outcome?.error, { errorContext: true });
|
|
3086
|
-
const outcome = run.outcome ? `${run.outcome.status}${outcomeError ? ` (${outcomeError})` : ""}` : "n/a";
|
|
3087
|
-
const linkedTask = findTaskByRunIdForOwner({
|
|
3088
|
-
runId: run.runId,
|
|
3089
|
-
callerOwnerKey: params.sessionKey
|
|
3090
|
-
});
|
|
3091
|
-
const taskText = sanitizeTaskStatusText(run.task) || "n/a";
|
|
3092
|
-
const progressText = sanitizeTaskStatusText(linkedTask?.progressSummary);
|
|
3093
|
-
const taskSummaryText = sanitizeTaskStatusText(linkedTask?.terminalSummary, { errorContext: true });
|
|
3094
|
-
const taskErrorText = sanitizeTaskStatusText(linkedTask?.error, { errorContext: true });
|
|
3095
|
-
return stopWithText([
|
|
3096
|
-
"ā¹ļø Subagent info",
|
|
3097
|
-
`Status: ${resolveDisplayStatus(run, { pendingDescendants: countPendingDescendantRuns(run.childSessionKey) })}`,
|
|
3098
|
-
`Label: ${formatRunLabel(run)}`,
|
|
3099
|
-
`Task: ${taskText}`,
|
|
3100
|
-
`Run: ${run.runId}`,
|
|
3101
|
-
linkedTask ? `TaskId: ${linkedTask.taskId}` : void 0,
|
|
3102
|
-
linkedTask ? `TaskStatus: ${linkedTask.status}` : void 0,
|
|
3103
|
-
`Session: ${run.childSessionKey}`,
|
|
3104
|
-
`SessionId: ${sessionEntry?.sessionId ?? "n/a"}`,
|
|
3105
|
-
`Transcript: ${sessionEntry?.sessionFile ?? "n/a"}`,
|
|
3106
|
-
`Runtime: ${runtime}`,
|
|
3107
|
-
`Created: ${formatTimestampWithAge(run.createdAt)}`,
|
|
3108
|
-
`Started: ${formatTimestampWithAge(run.startedAt)}`,
|
|
3109
|
-
`Ended: ${formatTimestampWithAge(run.endedAt)}`,
|
|
3110
|
-
`Cleanup: ${run.cleanup}`,
|
|
3111
|
-
run.archiveAtMs ? `Archive: ${formatTimestampWithAge(run.archiveAtMs)}` : void 0,
|
|
3112
|
-
run.cleanupHandled ? "Cleanup handled: yes" : void 0,
|
|
3113
|
-
`Outcome: ${outcome}`,
|
|
3114
|
-
progressText ? `Progress: ${progressText}` : void 0,
|
|
3115
|
-
taskSummaryText ? `Task summary: ${taskSummaryText}` : void 0,
|
|
3116
|
-
taskErrorText ? `Task error: ${taskErrorText}` : void 0,
|
|
3117
|
-
linkedTask ? `Delivery: ${linkedTask.deliveryStatus}` : void 0
|
|
3118
|
-
].filter(Boolean).join("\n"));
|
|
3119
|
-
}
|
|
3120
|
-
//#endregion
|
|
3121
|
-
//#region src/auto-reply/reply/commands-subagents/action-kill.ts
|
|
3122
|
-
async function handleSubagentsKillAction(ctx) {
|
|
3123
|
-
const { params, handledPrefix, requesterKey, runs, restTokens } = ctx;
|
|
3124
|
-
const target = restTokens[0];
|
|
3125
|
-
if (!target) return stopWithText(handledPrefix === "/subagents" ? "Usage: /subagents kill <id|#|all>" : "Usage: /kill <id|#|all>");
|
|
3126
|
-
if (target === "all" || target === "*") {
|
|
3127
|
-
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
3128
|
-
const result = await killAllControlledSubagentRuns({
|
|
3129
|
-
cfg: params.cfg,
|
|
3130
|
-
controller,
|
|
3131
|
-
runs
|
|
3132
|
-
});
|
|
3133
|
-
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error}`);
|
|
3134
|
-
if (result.killed > 0) return { shouldContinue: false };
|
|
3135
|
-
return { shouldContinue: false };
|
|
3136
|
-
}
|
|
3137
|
-
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3138
|
-
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3139
|
-
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
3140
|
-
const result = await killControlledSubagentRun({
|
|
3141
|
-
cfg: params.cfg,
|
|
3142
|
-
controller,
|
|
3143
|
-
entry: targetResolution.entry
|
|
3144
|
-
});
|
|
3145
|
-
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error}`);
|
|
3146
|
-
if (result.status === "done") return stopWithText(result.text);
|
|
3147
|
-
return { shouldContinue: false };
|
|
3148
|
-
}
|
|
3149
|
-
//#endregion
|
|
3150
|
-
//#region src/auto-reply/reply/commands-subagents/action-list.ts
|
|
3151
|
-
function handleSubagentsListAction(ctx) {
|
|
3152
|
-
const { params, runs } = ctx;
|
|
3153
|
-
const list = buildSubagentList({
|
|
3154
|
-
cfg: params.cfg,
|
|
3155
|
-
runs,
|
|
3156
|
-
recentMinutes: 30,
|
|
3157
|
-
taskMaxChars: 110
|
|
3158
|
-
});
|
|
3159
|
-
const lines = ["active subagents:", "-----"];
|
|
3160
|
-
if (list.active.length === 0) lines.push("(none)");
|
|
3161
|
-
else lines.push(list.active.map((entry) => entry.line).join("\n"));
|
|
3162
|
-
lines.push("", `recent subagents (last 30m):`, "-----");
|
|
3163
|
-
if (list.recent.length === 0) lines.push("(none)");
|
|
3164
|
-
else lines.push(list.recent.map((entry) => entry.line).join("\n"));
|
|
3165
|
-
return stopWithText(lines.join("\n"));
|
|
3166
|
-
}
|
|
3167
|
-
//#endregion
|
|
3168
|
-
//#region src/auto-reply/reply/commands-subagents/action-log.ts
|
|
3169
|
-
async function handleSubagentsLogAction(ctx) {
|
|
3170
|
-
const { runs, restTokens } = ctx;
|
|
3171
|
-
const target = restTokens[0];
|
|
3172
|
-
if (!target) return stopWithText("š Usage: /subagents log <id|#> [limit]");
|
|
3173
|
-
const includeTools = restTokens.some((token) => token.toLowerCase() === "tools");
|
|
3174
|
-
const limitToken = restTokens.find((token) => /^\d+$/.test(token));
|
|
3175
|
-
const limit = limitToken ? Math.min(200, Math.max(1, Number.parseInt(limitToken, 10))) : 20;
|
|
3176
|
-
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3177
|
-
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3178
|
-
const history = await callGateway({
|
|
3179
|
-
method: "chat.history",
|
|
3180
|
-
params: {
|
|
3181
|
-
sessionKey: targetResolution.entry.childSessionKey,
|
|
3182
|
-
limit
|
|
3183
|
-
}
|
|
3184
|
-
});
|
|
3185
|
-
const rawMessages = Array.isArray(history?.messages) ? history.messages : [];
|
|
3186
|
-
const lines = formatLogLines(includeTools ? rawMessages : stripToolMessages(rawMessages));
|
|
3187
|
-
const header = `š Subagent log: ${formatRunLabel(targetResolution.entry)}`;
|
|
3188
|
-
if (lines.length === 0) return stopWithText(`${header}\n(no messages)`);
|
|
3189
|
-
return stopWithText([header, ...lines].join("\n"));
|
|
3190
|
-
}
|
|
3191
|
-
//#endregion
|
|
3192
|
-
//#region src/auto-reply/reply/commands-subagents/action-send.ts
|
|
3193
|
-
async function handleSubagentsSendAction(ctx, steerRequested) {
|
|
3194
|
-
const { params, handledPrefix, runs, restTokens } = ctx;
|
|
3195
|
-
const target = restTokens[0];
|
|
3196
|
-
const message = restTokens.slice(1).join(" ").trim();
|
|
3197
|
-
if (!target || !message) return stopWithText(steerRequested ? handledPrefix === "/subagents" ? "Usage: /subagents steer <id|#> <message>" : `Usage: ${handledPrefix} <id|#> <message>` : "Usage: /subagents send <id|#> <message>");
|
|
3198
|
-
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
3199
|
-
if ("reply" in targetResolution) return targetResolution.reply;
|
|
3200
|
-
const controller = resolveCommandSubagentController(params, ctx.requesterKey);
|
|
3201
|
-
if (steerRequested) {
|
|
3202
|
-
const result = await steerControlledSubagentRun({
|
|
3203
|
-
cfg: params.cfg,
|
|
3204
|
-
controller,
|
|
3205
|
-
entry: targetResolution.entry,
|
|
3206
|
-
message
|
|
3207
|
-
});
|
|
3208
|
-
if (result.status === "accepted") return stopWithText(`steered ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
3209
|
-
if (result.status === "done" && result.text) return stopWithText(result.text);
|
|
3210
|
-
if (result.status === "error") return stopWithText(`send failed: ${result.error ?? "error"}`);
|
|
3211
|
-
return stopWithText(`ā ļø ${result.error ?? "send failed"}`);
|
|
3212
|
-
}
|
|
3213
|
-
const result = await sendControlledSubagentMessage({
|
|
3214
|
-
cfg: params.cfg,
|
|
3215
|
-
controller,
|
|
3216
|
-
entry: targetResolution.entry,
|
|
3217
|
-
message
|
|
3218
|
-
});
|
|
3219
|
-
if (result.status === "timeout") return stopWithText(`ā³ Subagent still running (run ${result.runId.slice(0, 8)}).`);
|
|
3220
|
-
if (result.status === "error") return stopWithText(`ā ļø Subagent error: ${result.error} (run ${result.runId.slice(0, 8)}).`);
|
|
3221
|
-
if (result.status === "forbidden") return stopWithText(`ā ļø ${result.error ?? "send failed"}`);
|
|
3222
|
-
if (result.status === "done") return stopWithText(result.text);
|
|
3223
|
-
return stopWithText(result.replyText ?? `ā
Sent to ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
3224
|
-
}
|
|
3225
|
-
//#endregion
|
|
3226
|
-
//#region src/auto-reply/reply/commands-subagents/action-spawn.ts
|
|
3227
|
-
async function handleSubagentsSpawnAction(ctx) {
|
|
3228
|
-
const { params, requesterKey, restTokens } = ctx;
|
|
3229
|
-
const agentId = restTokens[0];
|
|
3230
|
-
const taskParts = [];
|
|
3231
|
-
let model;
|
|
3232
|
-
let thinking;
|
|
3233
|
-
for (let i = 1; i < restTokens.length; i++) if (restTokens[i] === "--model" && i + 1 < restTokens.length) {
|
|
3234
|
-
i += 1;
|
|
3235
|
-
model = restTokens[i];
|
|
3236
|
-
} else if (restTokens[i] === "--thinking" && i + 1 < restTokens.length) {
|
|
3237
|
-
i += 1;
|
|
3238
|
-
thinking = restTokens[i];
|
|
3239
|
-
} else taskParts.push(restTokens[i]);
|
|
3240
|
-
const task = taskParts.join(" ").trim();
|
|
3241
|
-
if (!agentId || !task) return stopWithText("Usage: /subagents spawn <agentId> <task> [--model <model>] [--thinking <level>]");
|
|
3242
|
-
const commandTo = typeof params.command.to === "string" ? params.command.to.trim() : "";
|
|
3243
|
-
const originatingTo = typeof params.ctx.OriginatingTo === "string" ? params.ctx.OriginatingTo.trim() : "";
|
|
3244
|
-
const fallbackTo = typeof params.ctx.To === "string" ? params.ctx.To.trim() : "";
|
|
3245
|
-
const normalizedTo = originatingTo || commandTo || fallbackTo || void 0;
|
|
3246
|
-
const result = await spawnSubagentDirect({
|
|
3247
|
-
task,
|
|
3248
|
-
agentId,
|
|
3249
|
-
model,
|
|
3250
|
-
thinking,
|
|
3251
|
-
mode: "run",
|
|
3252
|
-
cleanup: "keep",
|
|
3253
|
-
expectsCompletionMessage: true
|
|
3254
|
-
}, {
|
|
3255
|
-
agentSessionKey: requesterKey,
|
|
3256
|
-
agentChannel: params.ctx.OriginatingChannel ?? params.command.channel,
|
|
3257
|
-
agentAccountId: params.ctx.AccountId,
|
|
3258
|
-
agentTo: normalizedTo,
|
|
3259
|
-
agentThreadId: params.ctx.MessageThreadId,
|
|
3260
|
-
agentGroupId: params.sessionEntry?.groupId ?? null,
|
|
3261
|
-
agentGroupChannel: params.sessionEntry?.groupChannel ?? null,
|
|
3262
|
-
agentGroupSpace: params.sessionEntry?.space ?? null
|
|
3263
|
-
});
|
|
3264
|
-
if (result.status === "accepted") return stopWithText(`Spawned subagent ${agentId} (session ${result.childSessionKey}, run ${result.runId?.slice(0, 8)}).`);
|
|
3265
|
-
return stopWithText(`Spawn failed: ${result.error ?? result.status}`);
|
|
3266
|
-
}
|
|
3267
|
-
//#endregion
|
|
3268
|
-
//#region src/auto-reply/reply/commands-subagents/action-unfocus.ts
|
|
3269
|
-
async function handleSubagentsUnfocusAction(ctx) {
|
|
3270
|
-
const { params } = ctx;
|
|
3271
|
-
const channel = resolveCommandSurfaceChannel(params);
|
|
3272
|
-
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("ā ļø /unfocus is only available on Discord, Matrix, and Telegram.");
|
|
3273
|
-
const accountId = resolveChannelAccountId(params);
|
|
3274
|
-
const bindingService = getSessionBindingService();
|
|
3275
|
-
const conversationId = (() => {
|
|
3276
|
-
if (isDiscordSurface(params)) return (params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId) : "").trim() || void 0;
|
|
3277
|
-
if (isTelegramSurface(params)) return resolveTelegramConversationId(params);
|
|
3278
|
-
if (isMatrixSurface(params)) return resolveMatrixConversationId({
|
|
3279
|
-
ctx: {
|
|
3280
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
3281
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
3282
|
-
To: params.ctx.To
|
|
3283
|
-
},
|
|
3284
|
-
command: { to: params.command.to }
|
|
3285
|
-
});
|
|
3286
|
-
})();
|
|
3287
|
-
const parentConversationId = (() => {
|
|
3288
|
-
if (!isMatrixSurface(params)) return;
|
|
3289
|
-
return resolveMatrixParentConversationId({
|
|
3290
|
-
ctx: {
|
|
3291
|
-
MessageThreadId: params.ctx.MessageThreadId,
|
|
3292
|
-
OriginatingTo: params.ctx.OriginatingTo,
|
|
3293
|
-
To: params.ctx.To
|
|
3294
|
-
},
|
|
3295
|
-
command: { to: params.command.to }
|
|
3296
|
-
});
|
|
3297
|
-
})();
|
|
3298
|
-
if (!conversationId) {
|
|
3299
|
-
if (channel === "discord") return stopWithText("ā ļø /unfocus must be run inside a Discord thread.");
|
|
3300
|
-
if (channel === "matrix") return stopWithText("ā ļø /unfocus must be run inside a Matrix thread.");
|
|
3301
|
-
return stopWithText("ā ļø /unfocus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
3302
|
-
}
|
|
3303
|
-
const binding = bindingService.resolveByConversation({
|
|
3304
|
-
channel,
|
|
3305
|
-
accountId,
|
|
3306
|
-
conversationId,
|
|
3307
|
-
...parentConversationId && parentConversationId !== conversationId ? { parentConversationId } : {}
|
|
3308
|
-
});
|
|
3309
|
-
if (!binding) return stopWithText(channel === "discord" ? "ā¹ļø This thread is not currently focused." : channel === "matrix" ? "ā¹ļø This thread is not currently focused." : "ā¹ļø This conversation is not currently focused.");
|
|
3310
|
-
const senderId = params.command.senderId?.trim() || "";
|
|
3311
|
-
const boundBy = typeof binding.metadata?.boundBy === "string" ? binding.metadata.boundBy.trim() : "";
|
|
3312
|
-
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return stopWithText(channel === "discord" ? `ā ļø Only ${boundBy} can unfocus this thread.` : channel === "matrix" ? `ā ļø Only ${boundBy} can unfocus this thread.` : `ā ļø Only ${boundBy} can unfocus this conversation.`);
|
|
3313
|
-
await bindingService.unbind({
|
|
3314
|
-
bindingId: binding.bindingId,
|
|
3315
|
-
reason: "manual"
|
|
3316
|
-
});
|
|
3317
|
-
return stopWithText(channel === "discord" || channel === "matrix" ? "ā
Thread unfocused." : "ā
Conversation unfocused.");
|
|
3318
|
-
}
|
|
3319
|
-
//#endregion
|
|
3320
|
-
//#region src/auto-reply/reply/commands-subagents.ts
|
|
3321
|
-
const handleSubagentsCommand = async (params, allowTextCommands) => {
|
|
3322
|
-
if (!allowTextCommands) return null;
|
|
3323
|
-
const normalized = params.command.commandBodyNormalized;
|
|
3324
|
-
const handledPrefix = resolveHandledPrefix(normalized);
|
|
3325
|
-
if (!handledPrefix) return null;
|
|
3326
|
-
if (!params.command.isAuthorizedSender) {
|
|
3327
|
-
logVerbose(`Ignoring ${handledPrefix} from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3328
|
-
return { shouldContinue: false };
|
|
3329
|
-
}
|
|
3330
|
-
const restTokens = normalized.slice(handledPrefix.length).trim().split(/\s+/).filter(Boolean);
|
|
3331
|
-
const action = resolveSubagentsAction({
|
|
3332
|
-
handledPrefix,
|
|
3333
|
-
restTokens
|
|
3334
|
-
});
|
|
3335
|
-
if (!action) return handleSubagentsHelpAction();
|
|
3336
|
-
const requesterKey = action === "spawn" ? resolveRequesterSessionKey(params, { preferCommandTarget: true }) : resolveRequesterSessionKey(params);
|
|
3337
|
-
if (!requesterKey) return stopWithText("ā ļø Missing session key.");
|
|
3338
|
-
const ctx = {
|
|
3339
|
-
params,
|
|
3340
|
-
handledPrefix,
|
|
3341
|
-
requesterKey,
|
|
3342
|
-
runs: listControlledSubagentRuns(requesterKey),
|
|
3343
|
-
restTokens
|
|
3344
|
-
};
|
|
3345
|
-
switch (action) {
|
|
3346
|
-
case "help": return handleSubagentsHelpAction();
|
|
3347
|
-
case "agents": return handleSubagentsAgentsAction(ctx);
|
|
3348
|
-
case "focus": return await handleSubagentsFocusAction(ctx);
|
|
3349
|
-
case "unfocus": return await handleSubagentsUnfocusAction(ctx);
|
|
3350
|
-
case "list": return handleSubagentsListAction(ctx);
|
|
3351
|
-
case "kill": return await handleSubagentsKillAction(ctx);
|
|
3352
|
-
case "info": return handleSubagentsInfoAction(ctx);
|
|
3353
|
-
case "log": return await handleSubagentsLogAction(ctx);
|
|
3354
|
-
case "send": return await handleSubagentsSendAction(ctx, false);
|
|
3355
|
-
case "steer": return await handleSubagentsSendAction(ctx, true);
|
|
3356
|
-
case "spawn": return await handleSubagentsSpawnAction(ctx);
|
|
3357
|
-
default: return handleSubagentsHelpAction();
|
|
3358
|
-
}
|
|
3359
|
-
};
|
|
3360
|
-
//#endregion
|
|
3361
|
-
//#region src/auto-reply/reply/commands-tasks.ts
|
|
3362
|
-
const MAX_VISIBLE_TASKS = 5;
|
|
3363
|
-
const TASK_STATUS_ICONS = {
|
|
3364
|
-
queued: "š”",
|
|
3365
|
-
running: "š¢",
|
|
3366
|
-
succeeded: "ā
",
|
|
3367
|
-
failed: "š“",
|
|
3368
|
-
timed_out: "ā±ļø",
|
|
3369
|
-
cancelled: "āŖļø",
|
|
3370
|
-
lost: "ā ļø"
|
|
3371
|
-
};
|
|
3372
|
-
const TASK_RUNTIME_LABELS = {
|
|
3373
|
-
subagent: "Subagent",
|
|
3374
|
-
acp: "ACP",
|
|
3375
|
-
cli: "CLI",
|
|
3376
|
-
cron: "Cron"
|
|
3377
|
-
};
|
|
3378
|
-
function formatTaskHeadline(snapshot) {
|
|
3379
|
-
if (snapshot.totalCount === 0) return "All clear - nothing linked to this session right now.";
|
|
3380
|
-
return `Current session: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
|
|
3381
|
-
}
|
|
3382
|
-
function formatAgentFallbackLine(agentId) {
|
|
3383
|
-
const snapshot = buildTaskStatusSnapshot(listTasksForAgentIdForStatus(agentId));
|
|
3384
|
-
if (snapshot.totalCount === 0) return;
|
|
3385
|
-
return `Agent-local: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
|
|
3386
|
-
}
|
|
3387
|
-
function formatTaskTiming(task) {
|
|
3388
|
-
if (task.status === "running") {
|
|
3389
|
-
const startedAt = task.startedAt ?? task.createdAt;
|
|
3390
|
-
return `elapsed ${formatDurationCompact(Date.now() - startedAt, { spaced: true }) ?? "0s"}`;
|
|
3391
|
-
}
|
|
3392
|
-
if (task.status === "queued") return `queued ${formatTimeAgo(Date.now() - task.createdAt)}`;
|
|
3393
|
-
const endedAt = task.endedAt ?? task.lastEventAt ?? task.createdAt;
|
|
3394
|
-
return `finished ${formatTimeAgo(Date.now() - endedAt)}`;
|
|
3395
|
-
}
|
|
3396
|
-
function formatTaskDetail(task) {
|
|
3397
|
-
return formatTaskStatusDetail(task);
|
|
3398
|
-
}
|
|
3399
|
-
function formatVisibleTask(task, index) {
|
|
3400
|
-
const title = formatTaskStatusTitle(task);
|
|
3401
|
-
const status = task.status.replaceAll("_", " ");
|
|
3402
|
-
const timing = formatTaskTiming(task);
|
|
3403
|
-
const detail = formatTaskDetail(task);
|
|
3404
|
-
const meta = [
|
|
3405
|
-
TASK_RUNTIME_LABELS[task.runtime],
|
|
3406
|
-
status,
|
|
3407
|
-
timing
|
|
3408
|
-
].filter(Boolean).join(" Ā· ");
|
|
3409
|
-
const lines = [`${index + 1}. ${TASK_STATUS_ICONS[task.status]} ${title}`, ` ${meta}`];
|
|
3410
|
-
if (detail) lines.push(` ${detail}`);
|
|
3411
|
-
return lines.join("\n");
|
|
3412
|
-
}
|
|
3413
|
-
function buildTasksText(params) {
|
|
3414
|
-
const sessionSnapshot = buildTaskStatusSnapshot(listTasksForSessionKeyForStatus(params.sessionKey));
|
|
3415
|
-
const lines = ["š Tasks", formatTaskHeadline(sessionSnapshot)];
|
|
3416
|
-
if (sessionSnapshot.totalCount > 0) {
|
|
3417
|
-
const visible = sessionSnapshot.visible.slice(0, MAX_VISIBLE_TASKS);
|
|
3418
|
-
lines.push("");
|
|
3419
|
-
for (const [index, task] of visible.entries()) {
|
|
3420
|
-
lines.push(formatVisibleTask(task, index));
|
|
3421
|
-
if (index < visible.length - 1) lines.push("");
|
|
3422
|
-
}
|
|
3423
|
-
const hiddenCount = sessionSnapshot.visible.length - visible.length;
|
|
3424
|
-
if (hiddenCount > 0) lines.push("", `+${hiddenCount} more recent task${hiddenCount === 1 ? "" : "s"}`);
|
|
3425
|
-
return lines.join("\n");
|
|
3426
|
-
}
|
|
3427
|
-
const agentFallback = formatAgentFallbackLine(params.agentId);
|
|
3428
|
-
if (agentFallback) lines.push(agentFallback);
|
|
3429
|
-
return lines.join("\n");
|
|
3430
|
-
}
|
|
3431
|
-
async function buildTasksReply(params) {
|
|
3432
|
-
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
3433
|
-
sessionKey: params.sessionKey,
|
|
3434
|
-
config: params.cfg
|
|
3435
|
-
});
|
|
3436
|
-
return { text: buildTasksText({
|
|
3437
|
-
sessionKey: params.sessionKey,
|
|
3438
|
-
agentId
|
|
3439
|
-
}) };
|
|
3440
|
-
}
|
|
3441
|
-
const handleTasksCommand = async (params, allowTextCommands) => {
|
|
3442
|
-
if (!allowTextCommands) return null;
|
|
3443
|
-
const normalized = params.command.commandBodyNormalized;
|
|
3444
|
-
if (normalized !== "/tasks" && !normalized.startsWith("/tasks ")) return null;
|
|
3445
|
-
if (!params.command.isAuthorizedSender) {
|
|
3446
|
-
logVerbose(`Ignoring /tasks from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3447
|
-
return { shouldContinue: false };
|
|
3448
|
-
}
|
|
3449
|
-
if (normalized !== "/tasks") return {
|
|
3450
|
-
shouldContinue: false,
|
|
3451
|
-
reply: { text: "Usage: /tasks" }
|
|
3452
|
-
};
|
|
3453
|
-
return {
|
|
3454
|
-
shouldContinue: false,
|
|
3455
|
-
reply: await buildTasksReply(params)
|
|
3456
|
-
};
|
|
3457
|
-
};
|
|
3458
|
-
//#endregion
|
|
3459
|
-
//#region src/auto-reply/reply/commands-tts.ts
|
|
3460
|
-
function parseTtsCommand(normalized) {
|
|
3461
|
-
if (normalized === "/tts") return {
|
|
3462
|
-
action: "status",
|
|
3463
|
-
args: ""
|
|
3464
|
-
};
|
|
3465
|
-
if (!normalized.startsWith("/tts ")) return null;
|
|
3466
|
-
const rest = normalized.slice(5).trim();
|
|
3467
|
-
if (!rest) return {
|
|
3468
|
-
action: "status",
|
|
3469
|
-
args: ""
|
|
3470
|
-
};
|
|
3471
|
-
const [action, ...tail] = rest.split(/\s+/);
|
|
3472
|
-
return {
|
|
3473
|
-
action: action.toLowerCase(),
|
|
3474
|
-
args: tail.join(" ").trim()
|
|
3475
|
-
};
|
|
3476
|
-
}
|
|
3477
|
-
function formatAttemptDetails(attempts) {
|
|
3478
|
-
if (!attempts || attempts.length === 0) return;
|
|
3479
|
-
return attempts.map((attempt) => {
|
|
3480
|
-
const reason = attempt.reasonCode === "success" ? "ok" : attempt.reasonCode;
|
|
3481
|
-
const latency = Number.isFinite(attempt.latencyMs) ? ` ${attempt.latencyMs}ms` : "";
|
|
3482
|
-
return `${attempt.provider}:${attempt.outcome}(${reason})${latency}`;
|
|
3483
|
-
}).join(", ");
|
|
3484
|
-
}
|
|
3485
|
-
function ttsUsage() {
|
|
3486
|
-
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!" };
|
|
3487
|
-
}
|
|
3488
|
-
const handleTtsCommands = async (params, allowTextCommands) => {
|
|
3489
|
-
if (!allowTextCommands) return null;
|
|
3490
|
-
const parsed = parseTtsCommand(params.command.commandBodyNormalized);
|
|
3491
|
-
if (!parsed) return null;
|
|
3492
|
-
if (!params.command.isAuthorizedSender) {
|
|
3493
|
-
logVerbose(`Ignoring TTS command from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3494
|
-
return { shouldContinue: false };
|
|
3495
|
-
}
|
|
3496
|
-
const config = resolveTtsConfig(params.cfg);
|
|
3497
|
-
const prefsPath = resolveTtsPrefsPath(config);
|
|
3498
|
-
const action = parsed.action;
|
|
3499
|
-
const args = parsed.args;
|
|
3500
|
-
if (action === "help") return {
|
|
3501
|
-
shouldContinue: false,
|
|
3502
|
-
reply: ttsUsage()
|
|
3503
|
-
};
|
|
3504
|
-
if (action === "on") {
|
|
3505
|
-
setTtsEnabled(prefsPath, true);
|
|
3506
|
-
return {
|
|
3507
|
-
shouldContinue: false,
|
|
3508
|
-
reply: { text: "š TTS enabled." }
|
|
3509
|
-
};
|
|
3510
|
-
}
|
|
3511
|
-
if (action === "off") {
|
|
3512
|
-
setTtsEnabled(prefsPath, false);
|
|
3513
|
-
return {
|
|
3514
|
-
shouldContinue: false,
|
|
3515
|
-
reply: { text: "š TTS disabled." }
|
|
3516
|
-
};
|
|
3517
|
-
}
|
|
3518
|
-
if (action === "audio") {
|
|
3519
|
-
if (!args.trim()) return {
|
|
3520
|
-
shouldContinue: false,
|
|
3521
|
-
reply: { text: "š¤ Generate audio from text.\n\nUsage: /tts audio <text>\nExample: /tts audio Hello, this is a test!" }
|
|
3522
|
-
};
|
|
3523
|
-
const start = Date.now();
|
|
3524
|
-
const result = await textToSpeech({
|
|
3525
|
-
text: args,
|
|
3526
|
-
cfg: params.cfg,
|
|
3527
|
-
channel: params.command.channel,
|
|
3528
|
-
prefsPath
|
|
3529
|
-
});
|
|
3530
|
-
if (result.success && result.audioPath) {
|
|
3531
|
-
setLastTtsAttempt({
|
|
3532
|
-
timestamp: Date.now(),
|
|
3533
|
-
success: true,
|
|
3534
|
-
textLength: args.length,
|
|
3535
|
-
summarized: false,
|
|
3536
|
-
provider: result.provider,
|
|
3537
|
-
fallbackFrom: result.fallbackFrom,
|
|
3538
|
-
attemptedProviders: result.attemptedProviders,
|
|
3539
|
-
attempts: result.attempts,
|
|
3540
|
-
latencyMs: result.latencyMs
|
|
3541
|
-
});
|
|
3542
|
-
return {
|
|
3543
|
-
shouldContinue: false,
|
|
3544
|
-
reply: {
|
|
3545
|
-
mediaUrl: result.audioPath,
|
|
3546
|
-
audioAsVoice: result.voiceCompatible === true
|
|
3547
|
-
}
|
|
3548
|
-
};
|
|
3549
|
-
}
|
|
3550
|
-
setLastTtsAttempt({
|
|
3551
|
-
timestamp: Date.now(),
|
|
3552
|
-
success: false,
|
|
3553
|
-
textLength: args.length,
|
|
3554
|
-
summarized: false,
|
|
3555
|
-
attemptedProviders: result.attemptedProviders,
|
|
3556
|
-
attempts: result.attempts,
|
|
3557
|
-
error: result.error,
|
|
3558
|
-
latencyMs: Date.now() - start
|
|
3559
|
-
});
|
|
3560
|
-
return {
|
|
3561
|
-
shouldContinue: false,
|
|
3562
|
-
reply: { text: `ā Error generating audio: ${result.error ?? "unknown error"}` }
|
|
3563
|
-
};
|
|
3564
|
-
}
|
|
3565
|
-
if (action === "provider") {
|
|
3566
|
-
const currentProvider = getTtsProvider(config, prefsPath);
|
|
3567
|
-
if (!args.trim()) {
|
|
3568
|
-
const providers = listSpeechProviders(params.cfg);
|
|
3569
|
-
return {
|
|
3570
|
-
shouldContinue: false,
|
|
3571
|
-
reply: { text: `šļø TTS provider\nPrimary: ${currentProvider}\n` + providers.map((provider) => `${provider.label}: ${provider.isConfigured({
|
|
3572
|
-
cfg: params.cfg,
|
|
3573
|
-
providerConfig: getResolvedSpeechProviderConfig(config, provider.id, params.cfg),
|
|
3574
|
-
timeoutMs: config.timeoutMs
|
|
3575
|
-
}) ? "ā
" : "ā"}`).join("\n") + `\nUsage: /tts provider <id>` }
|
|
3576
|
-
};
|
|
3577
|
-
}
|
|
3578
|
-
const requested = args.trim().toLowerCase();
|
|
3579
|
-
const resolvedProvider = getSpeechProvider(requested, params.cfg);
|
|
3580
|
-
if (!resolvedProvider) return {
|
|
3581
|
-
shouldContinue: false,
|
|
3582
|
-
reply: ttsUsage()
|
|
3583
|
-
};
|
|
3584
|
-
const nextProvider = canonicalizeSpeechProviderId(requested, params.cfg) ?? resolvedProvider.id;
|
|
3585
|
-
setTtsProvider(prefsPath, nextProvider);
|
|
3586
|
-
return {
|
|
3587
|
-
shouldContinue: false,
|
|
3588
|
-
reply: { text: `ā
TTS provider set to ${nextProvider}.` }
|
|
3589
|
-
};
|
|
3590
|
-
}
|
|
3591
|
-
if (action === "limit") {
|
|
3592
|
-
if (!args.trim()) return {
|
|
3593
|
-
shouldContinue: false,
|
|
3594
|
-
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` }
|
|
3595
|
-
};
|
|
3596
|
-
const next = Number.parseInt(args.trim(), 10);
|
|
3597
|
-
if (!Number.isFinite(next) || next < 100 || next > 4096) return {
|
|
3598
|
-
shouldContinue: false,
|
|
3599
|
-
reply: { text: "ā Limit must be between 100 and 4096 characters." }
|
|
3600
|
-
};
|
|
3601
|
-
setTtsMaxLength(prefsPath, next);
|
|
3602
|
-
return {
|
|
3603
|
-
shouldContinue: false,
|
|
3604
|
-
reply: { text: `ā
TTS limit set to ${next} characters.` }
|
|
3605
|
-
};
|
|
3606
|
-
}
|
|
3607
|
-
if (action === "summary") {
|
|
3608
|
-
if (!args.trim()) {
|
|
3609
|
-
const enabled = isSummarizationEnabled(prefsPath);
|
|
3610
|
-
const maxLen = getTtsMaxLength(prefsPath);
|
|
3611
|
-
return {
|
|
3612
|
-
shouldContinue: false,
|
|
3613
|
-
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` }
|
|
3614
|
-
};
|
|
3615
|
-
}
|
|
3616
|
-
const requested = args.trim().toLowerCase();
|
|
3617
|
-
if (requested !== "on" && requested !== "off") return {
|
|
3618
|
-
shouldContinue: false,
|
|
3619
|
-
reply: ttsUsage()
|
|
3620
|
-
};
|
|
3621
|
-
setSummarizationEnabled(prefsPath, requested === "on");
|
|
3622
|
-
return {
|
|
3623
|
-
shouldContinue: false,
|
|
3624
|
-
reply: { text: requested === "on" ? "ā
TTS auto-summary enabled." : "ā TTS auto-summary disabled." }
|
|
3625
|
-
};
|
|
3626
|
-
}
|
|
3627
|
-
if (action === "status") {
|
|
3628
|
-
const enabled = isTtsEnabled(config, prefsPath);
|
|
3629
|
-
const provider = getTtsProvider(config, prefsPath);
|
|
3630
|
-
const hasKey = isTtsProviderConfigured(config, provider, params.cfg);
|
|
3631
|
-
const maxLength = getTtsMaxLength(prefsPath);
|
|
3632
|
-
const summarize = isSummarizationEnabled(prefsPath);
|
|
3633
|
-
const last = getLastTtsAttempt();
|
|
3634
|
-
const lines = [
|
|
3635
|
-
"š TTS status",
|
|
3636
|
-
`State: ${enabled ? "ā
enabled" : "ā disabled"}`,
|
|
3637
|
-
`Provider: ${provider} (${hasKey ? "ā
configured" : "ā not configured"})`,
|
|
3638
|
-
`Text limit: ${maxLength} chars`,
|
|
3639
|
-
`Auto-summary: ${summarize ? "on" : "off"}`
|
|
3640
|
-
];
|
|
3641
|
-
if (last) {
|
|
3642
|
-
const timeAgo = Math.round((Date.now() - last.timestamp) / 1e3);
|
|
3643
|
-
lines.push("");
|
|
3644
|
-
lines.push(`Last attempt (${timeAgo}s ago): ${last.success ? "ā
" : "ā"}`);
|
|
3645
|
-
lines.push(`Text: ${last.textLength} chars${last.summarized ? " (summarized)" : ""}`);
|
|
3646
|
-
if (last.success) {
|
|
3647
|
-
lines.push(`Provider: ${last.provider ?? "unknown"}`);
|
|
3648
|
-
if (last.fallbackFrom && last.provider && last.fallbackFrom !== last.provider) lines.push(`Fallback: ${last.fallbackFrom} -> ${last.provider}`);
|
|
3649
|
-
if (last.attemptedProviders && last.attemptedProviders.length > 1) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3650
|
-
const details = formatAttemptDetails(last.attempts);
|
|
3651
|
-
if (details) lines.push(`Attempt details: ${details}`);
|
|
3652
|
-
lines.push(`Latency: ${last.latencyMs ?? 0}ms`);
|
|
3653
|
-
} else if (last.error) {
|
|
3654
|
-
lines.push(`Error: ${last.error}`);
|
|
3655
|
-
if (last.attemptedProviders && last.attemptedProviders.length > 0) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
|
|
3656
|
-
const details = formatAttemptDetails(last.attempts);
|
|
3657
|
-
if (details) lines.push(`Attempt details: ${details}`);
|
|
3658
|
-
}
|
|
3659
|
-
}
|
|
3660
|
-
return {
|
|
3661
|
-
shouldContinue: false,
|
|
3662
|
-
reply: { text: lines.join("\n") }
|
|
3663
|
-
};
|
|
3664
|
-
}
|
|
3665
|
-
return {
|
|
3666
|
-
shouldContinue: false,
|
|
3667
|
-
reply: ttsUsage()
|
|
3668
|
-
};
|
|
3669
|
-
};
|
|
3670
|
-
//#endregion
|
|
3671
|
-
//#region src/auto-reply/reply/commands-handlers.runtime.ts
|
|
3672
|
-
function loadCommandHandlers() {
|
|
3673
|
-
return [
|
|
3674
|
-
handlePluginCommand,
|
|
3675
|
-
handleBtwCommand,
|
|
3676
|
-
handleBashCommand,
|
|
3677
|
-
handleActivationCommand,
|
|
3678
|
-
handleSendPolicyCommand,
|
|
3679
|
-
handleFastCommand,
|
|
3680
|
-
handleUsageCommand,
|
|
3681
|
-
handleSessionCommand,
|
|
3682
|
-
handleRestartCommand,
|
|
3683
|
-
handleTtsCommands,
|
|
3684
|
-
handleHelpCommand,
|
|
3685
|
-
handleCommandsListCommand,
|
|
3686
|
-
handleToolsCommand,
|
|
3687
|
-
handleStatusCommand,
|
|
3688
|
-
handleTasksCommand,
|
|
3689
|
-
handleAllowlistCommand,
|
|
3690
|
-
handleApproveCommand,
|
|
3691
|
-
handleContextCommand,
|
|
3692
|
-
handleExportSessionCommand,
|
|
3693
|
-
handleWhoamiCommand,
|
|
3694
|
-
handleSubagentsCommand,
|
|
3695
|
-
handleAcpCommand,
|
|
3696
|
-
handleMcpCommand,
|
|
3697
|
-
handlePluginsCommand,
|
|
3698
|
-
handleConfigCommand,
|
|
3699
|
-
handleDebugCommand,
|
|
3700
|
-
handleModelsCommand,
|
|
3701
|
-
handleStopCommand,
|
|
3702
|
-
handleCompactCommand,
|
|
3703
|
-
handleAbortTrigger
|
|
3704
|
-
];
|
|
3705
|
-
}
|
|
3706
|
-
//#endregion
|
|
3707
|
-
export { loadCommandHandlers };
|