silentlake 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/dist/APEv2Parser-BZv_dP9t.js +269 -0
- package/dist/APEv2Parser-CPzxFNBB.js +5 -0
- package/dist/AbstractID3Parser-mvDFcjYV.js +47 -0
- package/dist/AiffParser-BXQ9SRZk.js +145 -0
- package/dist/AsfParser-CmBDUlZE.js +631 -0
- package/dist/BasicParser-DhmXREDo.js +853 -0
- package/dist/DsdiffParser-CTKKGyZg.js +150 -0
- package/dist/DsfParser-Ds-YQe4Z.js +101 -0
- package/dist/FlacParser-B1XVPgXF.js +5 -0
- package/dist/FlacParser-DMPyL1y4.js +367 -0
- package/dist/ID3v1Parser-BICWWVDG.js +289 -0
- package/dist/ID3v2Parser-BmZHSUqs.js +650 -0
- package/dist/ID3v2Token-DeJf4tYQ.js +145 -0
- package/dist/MP4Parser-Cjf-Zs8T.js +1061 -0
- package/dist/MatroskaParser-DgBzBe8t.js +909 -0
- package/dist/MpegParser-D5swTpA1.js +744 -0
- package/dist/MusepackParser-D8EQXnpK.js +285 -0
- package/dist/OggParser-BcIYPHwP.js +390 -0
- package/dist/Util-D_zGsr97.js +170 -0
- package/dist/WavPackParser-hosU8gfo.js +166 -0
- package/dist/WaveParser-CA00FZrC.js +273 -0
- package/dist/abort-cutoff-CERmtgZI.js +56 -0
- package/dist/abort-cutoff.runtime-BuaoE5Si.js +61 -0
- package/dist/abort-signal-CsrBEr94.js +13 -0
- package/dist/account-helpers-D3c_eI7c.js +37 -0
- package/dist/account-helpers-ru3jdZSV.js +12 -0
- package/dist/account-id-DZnNZg8x.js +1 -0
- package/dist/account-id-ZCrgXl7Z.js +44 -0
- package/dist/account-lookup-nkoa-foB.js +10 -0
- package/dist/account-snapshot-fields-Cvq7803C.js +116 -0
- package/dist/account-summary-B5Xzvntm.js +36 -0
- package/dist/accounts-CYgFhv2o.js +105 -0
- package/dist/accounts-ChlyF7cx.js +112 -0
- package/dist/accounts-Fyrhtztr.js +212 -0
- package/dist/ack-reactions-CNVwfOBj.js +43 -0
- package/dist/acp-cli-BIcgXTaP.js +2033 -0
- package/dist/acp-runtime-BdLdT-QY.js +1 -0
- package/dist/actions.runtime-BBPvLwDK.js +236 -0
- package/dist/actions.runtime-MrkZQbUZ.js +217 -0
- package/dist/agent-CBOdzEvR.js +1 -0
- package/dist/agent-scope-BLhzf-o0.js +17 -0
- package/dist/agent-scope-DPP4Z_UU.js +193 -0
- package/dist/agents-DGJIvby1.js +323 -0
- package/dist/agents-DbUUarGq.js +855 -0
- package/dist/agents.config-C_lrnc9J.js +18 -0
- package/dist/agents.config-D1VqC78r.js +121 -0
- package/dist/allow-from-BPSBITdd.js +9 -0
- package/dist/allow-from-BwTLpvhp.js +20 -0
- package/dist/allow-from-C4iBpqFI.js +62 -0
- package/dist/allowlist-config-edit-CKbnMmwS.js +279 -0
- package/dist/allowlist-match-CYmPgg1K.js +63 -0
- package/dist/ansi-BEJF8NKS.js +54 -0
- package/dist/anthropic-vertex-provider-Dd5agCN9.js +60 -0
- package/dist/apply.runtime-BO_W7UsB.js +211 -0
- package/dist/apply.runtime-BeYLuuGy.js +370 -0
- package/dist/archive-Tr0wIUO-.js +532 -0
- package/dist/arg-split-Dtda0YDl.js +38 -0
- package/dist/artifacts-C_4LekPC.js +39 -0
- package/dist/audit-COaaGhfd.js +788 -0
- package/dist/audit-OWBlbPvC.js +54 -0
- package/dist/audit-channel.allow-from.runtime-B7BHNblL.js +17 -0
- package/dist/audit-channel.collect.runtime-BjAagjy5.js +521 -0
- package/dist/audit-channel.discord.runtime-BBY6S9lg.js +5 -0
- package/dist/audit-channel.telegram.runtime-SJnxOJH2.js +8 -0
- package/dist/audit-channel.zalouser.runtime-SGRWvHxT.js +5 -0
- package/dist/audit-extra.async-Brlm785b.js +817 -0
- package/dist/audit-fs-oDMUa5N_.js +375 -0
- package/dist/audit-membership-runtime-BV4yo8s2.js +261 -0
- package/dist/audit.deep.runtime-C4qycPyC.js +31 -0
- package/dist/audit.nondeep.runtime-BKadRetL.js +842 -0
- package/dist/audit.runtime-n3hTkevZ.js +74 -0
- package/dist/auth-O6LQFLHJ.js +416 -0
- package/dist/auth-choice-D-8Ti3vA.js +219 -0
- package/dist/auth-choice-DN87_4lW.js +610 -0
- package/dist/auth-choice-in4GYJhH.js +64 -0
- package/dist/auth-choice-legacy-Clyw2lVc.js +17 -0
- package/dist/auth-choice-options-Bu05kzZL.js +127 -0
- package/dist/auth-choice-prompt-BCN6pEXi.js +215 -0
- package/dist/auth-choice-prompt-CtrY5wqR.js +36 -0
- package/dist/auth-choice.apply-helpers-BibBSEl9.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-T3IBLR0k.js +219 -0
- package/dist/auth-health-BKOrx-5O.js +166 -0
- package/dist/auth-mode-policy-DywddkT-.js +18 -0
- package/dist/auth-profiles-CDiIWpd-.js +1047 -0
- package/dist/auth-profiles.runtime-SDKdG_z_.js +48 -0
- package/dist/avatar-policy-Ds9e6uHI.js +67 -0
- package/dist/backup-create-CwfGrmvZ.js +461 -0
- package/dist/banner-TF-M94dP.js +351 -0
- package/dist/base-session-key-Cf2rkwag.js +14 -0
- package/dist/bindings-BV4AtNSY.js +21 -0
- package/dist/bindings-kjwuC11Q.js +69 -0
- package/dist/bluebubbles-C1M3Geg0.js +87 -0
- package/dist/bluebubbles-CahJ717x.js +603 -0
- package/dist/bluebubbles-dEl4QpYz.js +37 -0
- package/dist/bonjour-discovery-C2oY96BG.js +376 -0
- package/dist/boolean-DKtCJu_W.js +29 -0
- package/dist/boolean-param-xAGXUSSN.js +13 -0
- package/dist/boundary-file-read-BP6VMpqH.js +106 -0
- package/dist/boundary-path-B3FFLYNx.js +557 -0
- package/dist/brave--q9r6diS.js +405 -0
- package/dist/brew-DSwWqzLd.js +44 -0
- package/dist/browser-cli-BLE-cZxz.js +1502 -0
- package/dist/build-info.json +5 -0
- package/dist/bundled/boot-md/HOOK.md +20 -0
- package/dist/bundled/boot-md/handler.js +381 -0
- package/dist/bundled/bootstrap-extra-files/HOOK.md +53 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +56 -0
- package/dist/bundled/command-logger/HOOK.md +122 -0
- package/dist/bundled/command-logger/handler.js +62 -0
- package/dist/bundled/session-memory/HOOK.md +109 -0
- package/dist/bundled/session-memory/handler.js +401 -0
- package/dist/call-6gyz3vtP.js +44 -0
- package/dist/call-I0SGvyU7.js +639 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +1 -0
- package/dist/canvas-host/a2ui/index.html +307 -0
- package/dist/catalog-BwAYUfL7.js +240 -0
- package/dist/channel-5NZHO7iU.js +4945 -0
- package/dist/channel-BJK4S8ZH.js +1006 -0
- package/dist/channel-CNodzoey.js +321 -0
- package/dist/channel-UyhyMj09.js +1077 -0
- package/dist/channel-account-context-DXI4NQFD.js +104 -0
- package/dist/channel-actions-DU2CR3xW.js +37 -0
- package/dist/channel-activity-B8aReQoE.js +35 -0
- package/dist/channel-config-3Uv6ve2_.js +115 -0
- package/dist/channel-config-helpers-ChUYvBB0.js +377 -0
- package/dist/channel-config-schema-DEVsCZpj.js +1 -0
- package/dist/channel-feedback-G6zh8efr.js +245 -0
- package/dist/channel-inbound-3L_8TOZ0.js +395 -0
- package/dist/channel-lifecycle-CpU1dRbh.js +354 -0
- package/dist/channel-options-DJaIP4Dv.js +38 -0
- package/dist/channel-pairing-rNA4qQPY.js +66 -0
- package/dist/channel-pb3INhpi.js +1284 -0
- package/dist/channel-plugin-common-BhTxCE5t.js +1 -0
- package/dist/channel-plugin-ids-CFeS3qir.js +26 -0
- package/dist/channel-plugin-resolution-BSK2VmVJ.js +112 -0
- package/dist/channel-policy-C4GKHvhz.js +1 -0
- package/dist/channel-reply-pipeline-CPTuaW8n.js +15 -0
- package/dist/channel-send-result-By8EpCPw.js +40 -0
- package/dist/channel-setup-BiFBGGLd.js +49 -0
- package/dist/channel-shared-B7nVL6s_.js +308 -0
- package/dist/channel-summary-BDcfGPTZ.js +137 -0
- package/dist/channel-summary-rf4JbM-W.js +41 -0
- package/dist/channel-targets-DfnKGXez.js +87 -0
- package/dist/channel-xTzNVpmF.js +1602 -0
- package/dist/channel.runtime-BgaUUB7d.js +268 -0
- package/dist/channel.runtime-C3f_klCw.js +324 -0
- package/dist/channel.runtime-CdJxCNlJ.js +512 -0
- package/dist/channel.runtime-CzzQWPgu.js +35 -0
- package/dist/channel.runtime-PVCKVe5x.js +288 -0
- package/dist/channel.runtime-jBXnZL1S.js +230 -0
- package/dist/channels-CRtKc7T_.js +1393 -0
- package/dist/channels-XmRcwHO_.js +408 -0
- package/dist/channels-cli-BgTInHdf.js +412 -0
- package/dist/channels-status-issues-C_U44M8Y.js +16 -0
- package/dist/chat-type-C-n03mQY.js +10 -0
- package/dist/clack-prompter-DuzDnaLi.js +112 -0
- package/dist/clawbot-cli-lS6Ntjly.js +218 -0
- package/dist/cli/daemon-cli.js +9 -0
- package/dist/cli-DBYk4h7a.js +254 -0
- package/dist/cli-name-Daok7A7-.js +25 -0
- package/dist/cli-runtime-aAVwbEYy.js +7 -0
- package/dist/cli-startup-metadata.json +26 -0
- package/dist/cli-utils-Np4NAAtt.js +39 -0
- package/dist/command-format-CjE6bLiz.js +21 -0
- package/dist/command-format-D7pz5AcU.js +2 -0
- package/dist/command-gating-BQXGSqc9.js +40 -0
- package/dist/command-options-5coRiipK.js +25 -0
- package/dist/command-poll-backoff-CpkSns-6.js +56 -0
- package/dist/command-poll-backoff.runtime-YT6EGcLN.js +7 -0
- package/dist/command-registry-BYuNrgu_.js +14 -0
- package/dist/command-registry-Dkr1-w1Q.js +242 -0
- package/dist/command-secret-gateway-u-EjduIr.js +211 -0
- package/dist/command-secret-targets-COcwhn-D.js +88 -0
- package/dist/command-secret-targets-CQJT3viO.js +3 -0
- package/dist/commands-Bb9xUwz9.js +42 -0
- package/dist/commands-core-CD6RD8UX.js +4923 -0
- package/dist/commands-core.runtime-DhRG5rok.js +232 -0
- package/dist/commands-registry-ChCep1KJ.js +295 -0
- package/dist/commands-registry.data-XyUTELK9.js +904 -0
- package/dist/commands-registry.runtime-m5WTxFtv.js +25 -0
- package/dist/commands-status.runtime-DZwdZgLZ.js +211 -0
- package/dist/commands.runtime-BbpkbBbI.js +232 -0
- package/dist/common-CUBlLRXB.js +457 -0
- package/dist/compact.runtime-DwG4Ix3B.js +216 -0
- package/dist/completion-cli-CYjSNenV.js +17 -0
- package/dist/completion-cli-CuQ2VNX5.js +445 -0
- package/dist/config-6sZwvXJD.js +88 -0
- package/dist/config-C-Ef7QhH.js +23 -0
- package/dist/config-DdDLrP_v.js +273 -0
- package/dist/config-Dgkla4O3.js +38 -0
- package/dist/config-cli-BV16bUmI.js +945 -0
- package/dist/config-guard-BcYEe-kl.js +126 -0
- package/dist/config-helpers-3u5wfLBu.js +117 -0
- package/dist/config-presence-BmUF_5K9.js +79 -0
- package/dist/config-regex-CvZFnWkO.js +39 -0
- package/dist/config-runtime-CstET7fq.js +142 -0
- package/dist/config-schema-5YkIW1xw.js +270 -0
- package/dist/config-schema-B1UGMwZ8.js +31 -0
- package/dist/config-schema-DzlnsY3D.js +33 -0
- package/dist/config-state-CE0CGjey.js +288 -0
- package/dist/config-validation-BEVsnUBu.js +272 -0
- package/dist/config-value-DgJrpclm.js +25 -0
- package/dist/configure-CRx5OThC.js +1126 -0
- package/dist/configure-D4Lh7bhs.js +344 -0
- package/dist/connection-auth-CB_IINnP.js +30 -0
- package/dist/constants-C_Scc680.js +71 -0
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-BS0un8Wb.js +18 -0
- package/dist/control-ui/assets/index-DkMftoEy.css +1 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +22 -0
- package/dist/control-ui/index.html +17 -0
- package/dist/control-ui-assets-DjqeIg6A.js +232 -0
- package/dist/control-ui-shared-DP000Pxd.js +29 -0
- package/dist/conversation-runtime-zmG5YBsE.js +1458 -0
- package/dist/core-BV7ewUK4.js +187 -0
- package/dist/core-command-descriptors-CuKGKQIe.js +96 -0
- package/dist/credentials-BPwBlm1X.js +265 -0
- package/dist/cron-cli-CQlFbxlu.js +579 -0
- package/dist/daemon-cli-COhDevTB.js +354 -0
- package/dist/daemon-install-Ma4HdDtf.js +134 -0
- package/dist/daemon-install-plan.shared-cFfBUeV2.js +222 -0
- package/dist/daemon-runtime-CbClrCwc.js +12 -0
- package/dist/dangerous-config-flags-BJtLWIk7.js +15 -0
- package/dist/dangerous-name-matching-DZa_t0RM.js +44 -0
- package/dist/dangerous-tools-yGPDFTHh.js +27 -0
- package/dist/date-time-DCAyaBop.js +118 -0
- package/dist/dedupe-Cgnk5BbX.js +55 -0
- package/dist/defaults-CEdZhIIb.js +6 -0
- package/dist/delegate-DTiRmxH5.js +43 -0
- package/dist/deliver-BUIGBDbK.js +212 -0
- package/dist/deliver-runtime-BY7Zrac7.js +211 -0
- package/dist/delivery-queue-B19wDCjT.js +3 -0
- package/dist/delivery-queue-DrrqB4Hi.js +299 -0
- package/dist/device-auth-GEXe9vqR.js +15 -0
- package/dist/device-bootstrap-CwwokLEY.js +96 -0
- package/dist/device-bootstrap-Dbhe6oe8.js +1 -0
- package/dist/device-metadata-normalization-BDSQ_eA7.js +21 -0
- package/dist/device-pairing-CeI55dBv.js +560 -0
- package/dist/devices-cli-BXm0dkB2.js +366 -0
- package/dist/diagnostic-DBAi0Q5B.js +310 -0
- package/dist/diagnostic-events-ktCoG8Br.js +48 -0
- package/dist/diagnostics-QM3vI6rj.js +14 -0
- package/dist/diagnostics-XVyUA90d.js +33 -0
- package/dist/directive-handling.fast-lane-C7se5K_I.js +273 -0
- package/dist/directive-handling.impl-DMqj3m0-.js +638 -0
- package/dist/directive-handling.impl-aong_bNF.js +214 -0
- package/dist/directive-handling.levels-8vnMeuGX.js +2 -0
- package/dist/directive-handling.levels-CoruY1AA.js +13 -0
- package/dist/directive-handling.persist.runtime-ZWDdE5tG.js +170 -0
- package/dist/directive-handling.shared-B0RjHp7h.js +147 -0
- package/dist/directory-cli-I6eodbBS.js +437 -0
- package/dist/directory-config-helpers-CURJ8mj7.js +129 -0
- package/dist/directory-runtime-DhC8QkMq.js +19 -0
- package/dist/directory.static-B4VBitVO.js +44 -0
- package/dist/discord-Cu5CoXrA.js +214 -0
- package/dist/discord-core-5tkl-BzP.js +1 -0
- package/dist/discord-dOQ4uo2e.js +635 -0
- package/dist/dm-policy-shared-6bCJzHOS.js +188 -0
- package/dist/dns-cli-Dr0_Afcp.js +223 -0
- package/dist/docker-COe8Snwj.js +1254 -0
- package/dist/docs-cli-BkY5rqBi.js +176 -0
- package/dist/doctor-completion-CU7jR9vY.js +90 -0
- package/dist/doctor-config-preflight-Bj70HRt3.js +150 -0
- package/dist/doctor-config-preflight-C5h-tgtM.js +40 -0
- package/dist/doctor-state-migrations-CW1v5V4y.js +212 -0
- package/dist/doctor-state-migrations-ElD0NFmv.js +732 -0
- package/dist/entry-status-B2OWAf0s.js +172 -0
- package/dist/entry.js +219 -0
- package/dist/env-BP70DGuy.js +30 -0
- package/dist/env-overrides-JneV60sd.js +434 -0
- package/dist/env-overrides.runtime-DLrwions.js +18 -0
- package/dist/env-substitution-D6t_sLS_.js +136 -0
- package/dist/errors-BxyFnvP3.js +58 -0
- package/dist/exec-Dmex2w_d.js +310 -0
- package/dist/exec-approvals-BJhuySBz.js +386 -0
- package/dist/exec-approvals-allowlist-BboWC4n9.js +384 -0
- package/dist/exec-approvals-cli-rer7oVfh.js +427 -0
- package/dist/exec-safe-bin-runtime-policy-BL5_Z-KU.js +89 -0
- package/dist/exec-safety-CaaBy-Zw.js +24 -0
- package/dist/export-html/template.css +1060 -0
- package/dist/export-html/template.html +88 -0
- package/dist/export-html/template.js +1875 -0
- package/dist/extension-shared-5txN7IXK.js +74 -0
- package/dist/extensionAPI.js +218 -0
- package/dist/extensions/acpx/openclaw.plugin.json +120 -0
- package/dist/extensions/acpx/package.json +14 -0
- package/dist/extensions/acpx/skills/acp-router/SKILL.md +219 -0
- package/dist/extensions/amazon-bedrock/index.js +231 -0
- package/dist/extensions/amazon-bedrock/openclaw.plugin.json +11 -0
- package/dist/extensions/amazon-bedrock/package.json +12 -0
- package/dist/extensions/anthropic/index.js +330 -0
- package/dist/extensions/anthropic/openclaw.plugin.json +42 -0
- package/dist/extensions/anthropic/package.json +12 -0
- package/dist/extensions/bluebubbles/index.js +224 -0
- package/dist/extensions/bluebubbles/openclaw.plugin.json +11 -0
- package/dist/extensions/bluebubbles/package.json +51 -0
- package/dist/extensions/bluebubbles/setup-entry.js +289 -0
- package/dist/extensions/brave/index.js +23 -0
- package/dist/extensions/brave/openclaw.plugin.json +45 -0
- package/dist/extensions/brave/package.json +12 -0
- package/dist/extensions/byteplus/index.js +112 -0
- package/dist/extensions/byteplus/openclaw.plugin.json +32 -0
- package/dist/extensions/byteplus/package.json +12 -0
- package/dist/extensions/chutes/index.js +221 -0
- package/dist/extensions/chutes/openclaw.plugin.json +44 -0
- package/dist/extensions/chutes/package.json +12 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +218 -0
- package/dist/extensions/cloudflare-ai-gateway/openclaw.plugin.json +32 -0
- package/dist/extensions/cloudflare-ai-gateway/package.json +12 -0
- package/dist/extensions/copilot-proxy/index.js +125 -0
- package/dist/extensions/copilot-proxy/openclaw.plugin.json +23 -0
- package/dist/extensions/copilot-proxy/package.json +12 -0
- package/dist/extensions/device-pair/index.js +1040 -0
- package/dist/extensions/device-pair/openclaw.plugin.json +20 -0
- package/dist/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
- package/dist/extensions/diagnostics-otel/package.json +27 -0
- package/dist/extensions/diffs/openclaw.plugin.json +216 -0
- package/dist/extensions/diffs/package.json +20 -0
- package/dist/extensions/diffs/skills/diffs/SKILL.md +22 -0
- package/dist/extensions/discord/index.js +215 -0
- package/dist/extensions/discord/openclaw.plugin.json +11 -0
- package/dist/extensions/discord/package.json +40 -0
- package/dist/extensions/discord/setup-entry.js +215 -0
- package/dist/extensions/elevenlabs/index.js +223 -0
- package/dist/extensions/elevenlabs/openclaw.plugin.json +8 -0
- package/dist/extensions/elevenlabs/package.json +12 -0
- package/dist/extensions/fal/index.js +112 -0
- package/dist/extensions/fal/openclaw.plugin.json +34 -0
- package/dist/extensions/fal/package.json +12 -0
- package/dist/extensions/feishu/index.js +227 -0
- package/dist/extensions/feishu/openclaw.plugin.json +14 -0
- package/dist/extensions/feishu/package.json +42 -0
- package/dist/extensions/feishu/setup-entry.js +112 -0
- package/dist/extensions/feishu/skills/feishu-doc/SKILL.md +211 -0
- package/dist/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
- package/dist/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
- package/dist/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
- package/dist/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
- package/dist/extensions/firecrawl/index.js +211 -0
- package/dist/extensions/firecrawl/openclaw.plugin.json +41 -0
- package/dist/extensions/firecrawl/package.json +12 -0
- package/dist/extensions/github-copilot/index.js +490 -0
- package/dist/extensions/github-copilot/openclaw.plugin.json +30 -0
- package/dist/extensions/github-copilot/package.json +12 -0
- package/dist/extensions/google/index.js +211 -0
- package/dist/extensions/google/openclaw.plugin.json +71 -0
- package/dist/extensions/google/package.json +12 -0
- package/dist/extensions/googlechat/openclaw.plugin.json +11 -0
- package/dist/extensions/googlechat/package.json +46 -0
- package/dist/extensions/huggingface/index.js +108 -0
- package/dist/extensions/huggingface/openclaw.plugin.json +33 -0
- package/dist/extensions/huggingface/package.json +12 -0
- package/dist/extensions/imessage/index.js +223 -0
- package/dist/extensions/imessage/openclaw.plugin.json +11 -0
- package/dist/extensions/imessage/package.json +26 -0
- package/dist/extensions/imessage/setup-entry.js +220 -0
- package/dist/extensions/irc/index.js +220 -0
- package/dist/extensions/irc/openclaw.plugin.json +11 -0
- package/dist/extensions/irc/package.json +25 -0
- package/dist/extensions/irc/setup-entry.js +222 -0
- package/dist/extensions/kilocode/index.js +282 -0
- package/dist/extensions/kilocode/openclaw.plugin.json +32 -0
- package/dist/extensions/kilocode/package.json +12 -0
- package/dist/extensions/kimi-coding/index.js +148 -0
- package/dist/extensions/kimi-coding/openclaw.plugin.json +37 -0
- package/dist/extensions/kimi-coding/package.json +12 -0
- package/dist/extensions/line/index.js +57 -0
- package/dist/extensions/line/openclaw.plugin.json +11 -0
- package/dist/extensions/line/package.json +39 -0
- package/dist/extensions/line/setup-entry.js +49 -0
- package/dist/extensions/llm-task/index.js +157 -0
- package/dist/extensions/llm-task/openclaw.plugin.json +33 -0
- package/dist/extensions/llm-task/package.json +16 -0
- package/dist/extensions/lobster/index.js +261 -0
- package/dist/extensions/lobster/openclaw.plugin.json +10 -0
- package/dist/extensions/lobster/package.json +17 -0
- package/dist/extensions/matrix/openclaw.plugin.json +11 -0
- package/dist/extensions/matrix/package.json +53 -0
- package/dist/extensions/mattermost/index.js +220 -0
- package/dist/extensions/mattermost/openclaw.plugin.json +11 -0
- package/dist/extensions/mattermost/package.json +41 -0
- package/dist/extensions/mattermost/setup-entry.js +222 -0
- package/dist/extensions/memory-core/index.js +36 -0
- package/dist/extensions/memory-core/openclaw.plugin.json +9 -0
- package/dist/extensions/memory-core/package.json +20 -0
- package/dist/extensions/memory-lancedb/openclaw.plugin.json +92 -0
- package/dist/extensions/memory-lancedb/package.json +24 -0
- package/dist/extensions/microsoft/index.js +223 -0
- package/dist/extensions/microsoft/openclaw.plugin.json +8 -0
- package/dist/extensions/microsoft/package.json +12 -0
- package/dist/extensions/minimax/index.js +437 -0
- package/dist/extensions/minimax/openclaw.plugin.json +71 -0
- package/dist/extensions/minimax/package.json +12 -0
- package/dist/extensions/mistral/index.js +149 -0
- package/dist/extensions/mistral/openclaw.plugin.json +31 -0
- package/dist/extensions/mistral/package.json +12 -0
- package/dist/extensions/modelstudio/index.js +144 -0
- package/dist/extensions/modelstudio/openclaw.plugin.json +46 -0
- package/dist/extensions/modelstudio/package.json +12 -0
- package/dist/extensions/moonshot/index.js +211 -0
- package/dist/extensions/moonshot/openclaw.plugin.json +78 -0
- package/dist/extensions/moonshot/package.json +12 -0
- package/dist/extensions/msteams/openclaw.plugin.json +11 -0
- package/dist/extensions/msteams/package.json +48 -0
- package/dist/extensions/nextcloud-talk/index.js +221 -0
- package/dist/extensions/nextcloud-talk/openclaw.plugin.json +11 -0
- package/dist/extensions/nextcloud-talk/package.json +48 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +223 -0
- package/dist/extensions/nostr/openclaw.plugin.json +11 -0
- package/dist/extensions/nostr/package.json +45 -0
- package/dist/extensions/nvidia/index.js +29 -0
- package/dist/extensions/nvidia/openclaw.plugin.json +16 -0
- package/dist/extensions/nvidia/package.json +12 -0
- package/dist/extensions/ollama/index.js +118 -0
- package/dist/extensions/ollama/openclaw.plugin.json +28 -0
- package/dist/extensions/ollama/package.json +12 -0
- package/dist/extensions/open-prose/index.js +10 -0
- package/dist/extensions/open-prose/openclaw.plugin.json +13 -0
- package/dist/extensions/open-prose/package.json +12 -0
- package/dist/extensions/open-prose/skills/prose/LICENSE +21 -0
- package/dist/extensions/open-prose/skills/prose/SKILL.md +323 -0
- package/dist/extensions/open-prose/skills/prose/alt-borges.md +141 -0
- package/dist/extensions/open-prose/skills/prose/alts/arabian-nights.md +229 -0
- package/dist/extensions/open-prose/skills/prose/alts/borges.md +360 -0
- package/dist/extensions/open-prose/skills/prose/alts/folk.md +322 -0
- package/dist/extensions/open-prose/skills/prose/alts/homer.md +217 -0
- package/dist/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
- package/dist/extensions/open-prose/skills/prose/alts/shared-appendix.md +35 -0
- package/dist/extensions/open-prose/skills/prose/compiler.md +2971 -0
- package/dist/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
- package/dist/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
- package/dist/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
- package/dist/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
- package/dist/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
- package/dist/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
- package/dist/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
- package/dist/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
- package/dist/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
- package/dist/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
- package/dist/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
- package/dist/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
- package/dist/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
- package/dist/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
- package/dist/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
- package/dist/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
- package/dist/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
- package/dist/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
- package/dist/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
- package/dist/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
- package/dist/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
- package/dist/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
- package/dist/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
- package/dist/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
- package/dist/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
- package/dist/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
- package/dist/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
- package/dist/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
- package/dist/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
- package/dist/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
- package/dist/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
- package/dist/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
- package/dist/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
- package/dist/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
- package/dist/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
- package/dist/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
- package/dist/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
- package/dist/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
- package/dist/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
- package/dist/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
- package/dist/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
- package/dist/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
- package/dist/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
- package/dist/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
- package/dist/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
- package/dist/extensions/open-prose/skills/prose/examples/README.md +391 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
- package/dist/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
- package/dist/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
- package/dist/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
- package/dist/extensions/open-prose/skills/prose/help.md +144 -0
- package/dist/extensions/open-prose/skills/prose/lib/README.md +108 -0
- package/dist/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
- package/dist/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
- package/dist/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
- package/dist/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
- package/dist/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
- package/dist/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
- package/dist/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
- package/dist/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
- package/dist/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
- package/dist/extensions/open-prose/skills/prose/primitives/session.md +593 -0
- package/dist/extensions/open-prose/skills/prose/prose.md +1237 -0
- package/dist/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
- package/dist/extensions/open-prose/skills/prose/state/in-context.md +384 -0
- package/dist/extensions/open-prose/skills/prose/state/postgres.md +880 -0
- package/dist/extensions/open-prose/skills/prose/state/sqlite.md +531 -0
- package/dist/extensions/openai/index.js +677 -0
- package/dist/extensions/openai/openclaw.plugin.json +42 -0
- package/dist/extensions/openai/package.json +12 -0
- package/dist/extensions/opencode/index.js +116 -0
- package/dist/extensions/opencode/openclaw.plugin.json +32 -0
- package/dist/extensions/opencode/package.json +12 -0
- package/dist/extensions/opencode-go/index.js +114 -0
- package/dist/extensions/opencode-go/openclaw.plugin.json +32 -0
- package/dist/extensions/opencode-go/package.json +12 -0
- package/dist/extensions/openrouter/index.js +398 -0
- package/dist/extensions/openrouter/openclaw.plugin.json +31 -0
- package/dist/extensions/openrouter/package.json +12 -0
- package/dist/extensions/openshell/index.js +923 -0
- package/dist/extensions/openshell/openclaw.plugin.json +99 -0
- package/dist/extensions/openshell/package.json +12 -0
- package/dist/extensions/perplexity/index.js +23 -0
- package/dist/extensions/perplexity/openclaw.plugin.json +49 -0
- package/dist/extensions/perplexity/package.json +12 -0
- package/dist/extensions/phone-control/index.js +276 -0
- package/dist/extensions/phone-control/openclaw.plugin.json +10 -0
- package/dist/extensions/qianfan/index.js +114 -0
- package/dist/extensions/qianfan/openclaw.plugin.json +31 -0
- package/dist/extensions/qianfan/package.json +12 -0
- package/dist/extensions/qwen-portal-auth/index.js +350 -0
- package/dist/extensions/qwen-portal-auth/openclaw.plugin.json +29 -0
- package/dist/extensions/sglang/index.js +285 -0
- package/dist/extensions/sglang/openclaw.plugin.json +28 -0
- package/dist/extensions/sglang/package.json +12 -0
- package/dist/extensions/signal/index.js +218 -0
- package/dist/extensions/signal/openclaw.plugin.json +11 -0
- package/dist/extensions/signal/package.json +23 -0
- package/dist/extensions/signal/setup-entry.js +218 -0
- package/dist/extensions/slack/index.js +222 -0
- package/dist/extensions/slack/openclaw.plugin.json +11 -0
- package/dist/extensions/slack/package.json +30 -0
- package/dist/extensions/slack/setup-entry.js +220 -0
- package/dist/extensions/synology-chat/index.js +56 -0
- package/dist/extensions/synology-chat/openclaw.plugin.json +11 -0
- package/dist/extensions/synology-chat/package.json +29 -0
- package/dist/extensions/synology-chat/setup-entry.js +58 -0
- package/dist/extensions/synthetic/index.js +112 -0
- package/dist/extensions/synthetic/openclaw.plugin.json +31 -0
- package/dist/extensions/synthetic/package.json +12 -0
- package/dist/extensions/talk-voice/index.js +197 -0
- package/dist/extensions/talk-voice/openclaw.plugin.json +10 -0
- package/dist/extensions/tavily/index.js +211 -0
- package/dist/extensions/tavily/openclaw.plugin.json +44 -0
- package/dist/extensions/tavily/package.json +12 -0
- package/dist/extensions/tavily/skills/tavily/SKILL.md +94 -0
- package/dist/extensions/telegram/index.js +221 -0
- package/dist/extensions/telegram/openclaw.plugin.json +11 -0
- package/dist/extensions/telegram/package.json +31 -0
- package/dist/extensions/telegram/setup-entry.js +221 -0
- package/dist/extensions/thread-ownership/index.js +70 -0
- package/dist/extensions/thread-ownership/openclaw.plugin.json +30 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/README.md +143 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/SKILL.md +375 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/bin/tlon.js +96 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/package.json +40 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/auto-react.hoon +24 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/delete-old-posts.hoon +18 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/word-filter.hoon +52 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks.md +366 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/urbit-api.md +113 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/scripts/postinstall.js +74 -0
- package/dist/extensions/tlon/openclaw.plugin.json +14 -0
- package/dist/extensions/tlon/package.json +45 -0
- package/dist/extensions/together/index.js +113 -0
- package/dist/extensions/together/openclaw.plugin.json +31 -0
- package/dist/extensions/together/package.json +12 -0
- package/dist/extensions/twitch/openclaw.plugin.json +11 -0
- package/dist/extensions/twitch/package.json +27 -0
- package/dist/extensions/venice/index.js +132 -0
- package/dist/extensions/venice/openclaw.plugin.json +31 -0
- package/dist/extensions/venice/package.json +12 -0
- package/dist/extensions/vercel-ai-gateway/index.js +86 -0
- package/dist/extensions/vercel-ai-gateway/openclaw.plugin.json +31 -0
- package/dist/extensions/vercel-ai-gateway/package.json +12 -0
- package/dist/extensions/vllm/index.js +285 -0
- package/dist/extensions/vllm/openclaw.plugin.json +28 -0
- package/dist/extensions/vllm/package.json +12 -0
- package/dist/extensions/voice-call/index.js +5715 -0
- package/dist/extensions/voice-call/openclaw.plugin.json +648 -0
- package/dist/extensions/voice-call/package.json +31 -0
- package/dist/extensions/volcengine/index.js +112 -0
- package/dist/extensions/volcengine/openclaw.plugin.json +32 -0
- package/dist/extensions/volcengine/package.json +12 -0
- package/dist/extensions/whatsapp/openclaw.plugin.json +11 -0
- package/dist/extensions/whatsapp/package.json +44 -0
- package/dist/extensions/xai/index.js +211 -0
- package/dist/extensions/xai/openclaw.plugin.json +65 -0
- package/dist/extensions/xai/package.json +12 -0
- package/dist/extensions/xiaomi/index.js +115 -0
- package/dist/extensions/xiaomi/openclaw.plugin.json +31 -0
- package/dist/extensions/xiaomi/package.json +12 -0
- package/dist/extensions/zai/index.js +559 -0
- package/dist/extensions/zai/openclaw.plugin.json +88 -0
- package/dist/extensions/zai/package.json +12 -0
- package/dist/extensions/zalo/index.js +225 -0
- package/dist/extensions/zalo/openclaw.plugin.json +11 -0
- package/dist/extensions/zalo/package.json +48 -0
- package/dist/extensions/zalo/setup-entry.js +226 -0
- package/dist/extensions/zalouser/openclaw.plugin.json +11 -0
- package/dist/extensions/zalouser/package.json +49 -0
- package/dist/external-content-BUdUOqkv.js +238 -0
- package/dist/feishu-CiuVx86p.js +62821 -0
- package/dist/feishu-DKboNv0e.js +2664 -0
- package/dist/fetch-guard-DIyN1HW5.js +165 -0
- package/dist/fetch-timeout-C5xpMuGd.js +36 -0
- package/dist/file-identity-Cw0fQxYY.js +11 -0
- package/dist/file-lock-WbEmczmY.js +107 -0
- package/dist/filter-oMGaNOM1.js +20 -0
- package/dist/follow-redirects-BPQ_NgUo.js +9143 -0
- package/dist/format-DH8ysi7s.js +19 -0
- package/dist/format-datetime-BGS6tLDE.js +73 -0
- package/dist/format-duration-CO0BGWB0.js +57 -0
- package/dist/format-relative-C3nDxnXz.js +54 -0
- package/dist/frontmatter-S5vS-I4a.js +309 -0
- package/dist/fs-safe-D3qzH-ab.js +731 -0
- package/dist/gateway-cli-CPLQ73W9.js +28403 -0
- package/dist/gateway-install-token-CKAQVM8-.js +164 -0
- package/dist/gateway-rpc-BsgPg6MU.js +26 -0
- package/dist/gateway-runtime-B5HHmFvN.js +42 -0
- package/dist/gaxios-fetch-compat-KX6bsqFm.js +165 -0
- package/dist/gemini-auth-B5ljg7jr.js +29 -0
- package/dist/git-commit-BIdLubm5.js +2 -0
- package/dist/git-commit-OvUvjri2.js +177 -0
- package/dist/github-copilot-auth-BBn03354.js +104 -0
- package/dist/global-singleton-4KwY5RvX.js +13 -0
- package/dist/globals-41sdSaKv.js +38 -0
- package/dist/gmail-setup-utils-BX68dZla.js +419 -0
- package/dist/group-access-DJZrYPx1.js +113 -0
- package/dist/group-keys-BD_IYSMs.js +44 -0
- package/dist/group-policy-CWFxv3iB.js +201 -0
- package/dist/group-policy-warnings-Ddu6lBkh.js +175 -0
- package/dist/health-BW_d3hKj.js +573 -0
- package/dist/health-format-B5XfOTuJ.js +26 -0
- package/dist/health-o6N--_xj.js +59 -0
- package/dist/heartbeat-7aHh0m3d.js +169 -0
- package/dist/heartbeat-summary-Das49TYq.js +57 -0
- package/dist/help-Cr5cdpTF.js +81 -0
- package/dist/help-format-Dv45FpYu.js +15 -0
- package/dist/helpers-CLNycoI8.js +32 -0
- package/dist/helpers-DJ-5HEbE.js +24 -0
- package/dist/history-CHjo8B5W.js +102 -0
- package/dist/hook-runtime-BnNBi_q4.js +1 -0
- package/dist/hooks-cli-Bj8_UM2C.js +1102 -0
- package/dist/hooks-policy-BL6HDLUn.js +20 -0
- package/dist/hooks-status-gzNmo3li.js +78 -0
- package/dist/host-env-security-BogNN146.js +223 -0
- package/dist/http-body-CCiSfloA.js +237 -0
- package/dist/http-registry-WFFbLYRd.js +153 -0
- package/dist/identity-DovQV4zD.js +112 -0
- package/dist/identity-cyBYcoXS.js +84 -0
- package/dist/identity-file-EndG1nfc.js +60 -0
- package/dist/image-DWkjd9ze.js +211 -0
- package/dist/image-generation-CsblUROw.js +441 -0
- package/dist/image-ops-j01UkxEv.js +371 -0
- package/dist/imessage-Bb83msoJ.js +219 -0
- package/dist/imessage-CsiCgRcg.js +190 -0
- package/dist/imessage-CytlwbMq.js +1451 -0
- package/dist/imessage-core-CsYJuaRZ.js +1 -0
- package/dist/inbound-envelope-4P3IIJc3.js +61 -0
- package/dist/inbound-reply-dispatch-B6JDKPpf.js +72 -0
- package/dist/includes-7XyL3p1c.js +188 -0
- package/dist/includes-scan-y-rS6tTw.js +55 -0
- package/dist/index.js +57 -0
- package/dist/infra/warning-filter.js +2 -0
- package/dist/inspect-TkOiUCgp.js +279 -0
- package/dist/install-safe-path-Rwbw1XCZ.js +62 -0
- package/dist/installs-CShDWoiR.js +532 -0
- package/dist/interactive-F7iY0yED.js +8 -0
- package/dist/interactive-runtime-OweOj_Vv.js +90 -0
- package/dist/internal-hooks-0uipqzRY.js +156 -0
- package/dist/io-BYmuc7ha.js +35 -0
- package/dist/io-BjKpaXU3.js +7161 -0
- package/dist/ip-C8vmzVu0.js +203 -0
- package/dist/ipv4-CJCNv_K7.js +82 -0
- package/dist/irc-BSHd6-tL.js +12 -0
- package/dist/irc-CO-H7Npu.js +660 -0
- package/dist/is-main-YViS6wOn.js +27 -0
- package/dist/issue-format-CBEXVico.js +31 -0
- package/dist/issue-format-D3HehoKZ.js +4 -0
- package/dist/json-file-C2zjA0Gv.js +23 -0
- package/dist/json-files-WW-H_psG.js +60 -0
- package/dist/json-pointer-f9dEnBoR.js +43 -0
- package/dist/json-store-O1LwpnBH.js +37 -0
- package/dist/kb-cli-DMZs6PCu.js +65 -0
- package/dist/keyed-async-queue-CPUWV5Pm.js +32 -0
- package/dist/kill-tree-CbjXBw3z.js +149 -0
- package/dist/kilocode-shared-DS7_0IMs.js +29 -0
- package/dist/launchd-DowEtzjr.js +491 -0
- package/dist/lazy-runtime-BcXbyAaC.js +1 -0
- package/dist/lazy-runtime-bWkd2cs3.js +29 -0
- package/dist/legacy-names-CUNZ4vHN.js +7 -0
- package/dist/legacy-web-search-BgZjNG2h.js +222 -0
- package/dist/lib-CERS7N4b.js +503 -0
- package/dist/lib-PPICrHv1.js +1938 -0
- package/dist/library-DJriL3ed.js +211 -0
- package/dist/lifecycle-core-D08nRlzW.js +382 -0
- package/dist/line/accounts.js +10 -0
- package/dist/line/send.js +39 -0
- package/dist/line/template-messages.js +2 -0
- package/dist/line-BX_d0Jwk.js +688 -0
- package/dist/line-CJSvwApm.js +1 -0
- package/dist/line-core-BOIxkjgu.js +1 -0
- package/dist/links-CKahSp5K.js +13 -0
- package/dist/llm-slug-generator-X_rlkFDe.js +68 -0
- package/dist/llm-slug-generator.js +212 -0
- package/dist/llm-task-Dx8ymRFr.js +1 -0
- package/dist/local-roots-DAzCjWbC.js +34 -0
- package/dist/location-DefAH9WS.js +42 -0
- package/dist/logger-CoEtkjhn.js +550 -0
- package/dist/logger-Cqy7-Maj.js +70 -0
- package/dist/logging-Bz1qZDPg.js +16 -0
- package/dist/logging-CS185p8Q.js +13 -0
- package/dist/logging-CbTTfADU.js +1 -0
- package/dist/logging-CrGwCjML.js +36 -0
- package/dist/logs-cli-C3x0gsGh.js +261 -0
- package/dist/magic-string.es-DJPWMt-n.js +1011 -0
- package/dist/main-session-DKr0lBVk.js +36 -0
- package/dist/manager-BF-xRVUt.js +2005 -0
- package/dist/manager-DjPRm0yC.js +4226 -0
- package/dist/manager-runtime-DoKa4efG.js +59 -0
- package/dist/manager.runtime-CdPdh296.js +827 -0
- package/dist/manifest-registry-B90TyTWl.js +1350 -0
- package/dist/map-size-CMTQVKUV.js +15 -0
- package/dist/markdown-to-line-BWwaRx5F.js +640 -0
- package/dist/mask-api-key-CprzEe7l.js +10 -0
- package/dist/matrix-CMi2y980.js +228 -0
- package/dist/matrix-migration-snapshot-NMxdum7C.js +702 -0
- package/dist/mattermost-Cduscjlj.js +15 -0
- package/dist/mattermost-DO0BCfF3.js +1 -0
- package/dist/mcp-cli-D0PqoKGl.js +94 -0
- package/dist/mcp-config-BcFTambR.js +108 -0
- package/dist/media-limits-Cuvmmhop.js +14 -0
- package/dist/media-understanding-DptzemF7.js +48 -0
- package/dist/media-understanding.runtime-w4DWJMEQ.js +216 -0
- package/dist/memory-DBjQ0TPd.js +1 -0
- package/dist/memory-cli-D2AtVbYN.js +215 -0
- package/dist/memory-cli-DNq4q-b4.js +541 -0
- package/dist/memory-search-Das1tiuB.js +204 -0
- package/dist/memory-search-DxmSTjHq.js +18 -0
- package/dist/mention-gating-B_q-EHFx.js +25 -0
- package/dist/mentions-Bxys_va0.js +154 -0
- package/dist/message-channel-Cy-gN4K2.js +106 -0
- package/dist/message-hook-mappers-BBTV3JRQ.js +249 -0
- package/dist/method-scopes-ChbR5hu0.js +2650 -0
- package/dist/mime-C4vVTBso.js +150 -0
- package/dist/minimal-C5yUxtHy.js +2120 -0
- package/dist/model-auth-Blh0xL9g.js +309 -0
- package/dist/model-auth-env-CF9ts7Th.js +111 -0
- package/dist/model-catalog.runtime-Bq_DOgMs.js +211 -0
- package/dist/model-id-normalization-Y-MIsyK_.js +16 -0
- package/dist/model-input-BB2wSAHb.js +20 -0
- package/dist/model-overrides-sIzKU2wo.js +84 -0
- package/dist/model-param-b-DIFEhICm.js +15 -0
- package/dist/model-picker-CCcVTPVs.js +400 -0
- package/dist/model-picker-DbqaKTMq.js +215 -0
- package/dist/model-picker.runtime-CkLp1x9k.js +224 -0
- package/dist/model-selection-BTpJnslv.js +437 -0
- package/dist/model-selection-slZyRw2d.js +765 -0
- package/dist/model-suppression.runtime-DaobH5cQ.js +216 -0
- package/dist/models-BN_CtDV3.js +2536 -0
- package/dist/models-Dp5Lga_a.js +226 -0
- package/dist/models-cli-Cd_3pVLS.js +418 -0
- package/dist/models-config-jp2ZYjgH.js +211 -0
- package/dist/models-config.providers.discovery-BaIk1NKL.js +141 -0
- package/dist/models-config.runtime-CYpoeHa4.js +211 -0
- package/dist/monitor-Bbfus89A.js +3145 -0
- package/dist/monitor-D63iuNTd.js +3272 -0
- package/dist/monitor-DAPxJ4Fy.js +878 -0
- package/dist/monitor-DlFPue4X.js +223 -0
- package/dist/multimodal-DC43jYNv.js +75 -0
- package/dist/mutable-allowlist-detectors-C6EAzWYE.js +62 -0
- package/dist/net-DlJFp95v.js +270 -0
- package/dist/network-mode-DOgvmom4.js +17 -0
- package/dist/nextcloud-talk-4niIjhpY.js +12 -0
- package/dist/nextcloud-talk-CwnkUy8E.js +1 -0
- package/dist/node-cli-BQ0uYRRJ.js +2484 -0
- package/dist/node-command-policy-Bg2g6Xjp.js +192 -0
- package/dist/node-commands-B6W6Eo0b.js +11 -0
- package/dist/node-require-BgDD9bTi.js +14 -0
- package/dist/node-resolve-BunMro3f.js +69 -0
- package/dist/node-service-DEZvLQRW.js +65 -0
- package/dist/node-startup-env-Gz8ZQniA.js +50 -0
- package/dist/nodes-cli-Dvhiks4b.js +1330 -0
- package/dist/nodes-screen-DkGtEg3m.js +401 -0
- package/dist/normalize-secret-input-_PgpexOG.js +32 -0
- package/dist/note-dfjacCV8.js +109 -0
- package/dist/npm-pack-install-DFT7_ufP.js +574 -0
- package/dist/npm-resolution-O8ezGXjk.js +60 -0
- package/dist/oauth.runtime-Dn3J7wCH.js +318 -0
- package/dist/oauth.runtime-qCkidk8J.js +180 -0
- package/dist/oauth.runtime-y9sB_ut5.js +687 -0
- package/dist/ollama-defaults-asNuGW4_.js +4 -0
- package/dist/onboard-D9IU-7uw.js +48 -0
- package/dist/onboard-DQaHGPRm.js +25 -0
- package/dist/onboard-DXqBeqiM.js +589 -0
- package/dist/onboard-channels-CfZTqyJW.js +300 -0
- package/dist/onboard-channels-Cl8Z603m.js +1257 -0
- package/dist/onboard-config-DFKb-0sE.js +29 -0
- package/dist/onboard-config-DYykzJhx.js +2 -0
- package/dist/onboard-custom-BH3efE8p.js +216 -0
- package/dist/onboard-custom-z5zb42R-.js +644 -0
- package/dist/onboard-helpers-BN19CLP5.js +335 -0
- package/dist/onboard-helpers-Ddb9wkxO.js +54 -0
- package/dist/onboard-hooks-Hiw3_8VL.js +73 -0
- package/dist/onboard-remote-Bdqyy2tX.js +59 -0
- package/dist/onboard-remote-DZ1c3za2.js +182 -0
- package/dist/onboard-search-8Xnnh8SX.js +446 -0
- package/dist/onboard-skills-BTVz6kVV.js +69 -0
- package/dist/onboard-skills-BskXWJGU.js +133 -0
- package/dist/openai-codex-provider.runtime-BFsopDHI.js +2 -0
- package/dist/openai-defaults-B7FUywsh.js +10 -0
- package/dist/openclaw-exec-env-AcZ9we1N.js +14 -0
- package/dist/openclaw-root-TUHYdr9B.js +88 -0
- package/dist/openclaw-tools.runtime-BI4ZZ6Ie.js +211 -0
- package/dist/outbound-media-69yrWRDt.js +11 -0
- package/dist/outbound-runtime-ic_7ulJJ.js +1 -0
- package/dist/pairing-challenge-pdOQqb2j.js +48 -0
- package/dist/pairing-cli-DXxrNtvB.js +150 -0
- package/dist/pairing-labels-CNKCSmBK.js +7 -0
- package/dist/pairing-message-CBv2njJT.js +4 -0
- package/dist/pairing-store-C4lsd4pO.js +590 -0
- package/dist/pairing-token-gKj4SNFJ.js +55 -0
- package/dist/parse-duration-BBGYkY0S.js +41 -0
- package/dist/parse-finite-number-CP4MQF_w.js +30 -0
- package/dist/parse-log-line-CVh9zu3Q.js +43 -0
- package/dist/parse-port-COyt3COn.js +8 -0
- package/dist/path-alias-guards-ZTKqurNH.js +40 -0
- package/dist/path-env-CPkz6U0Y.js +87 -0
- package/dist/paths-CTjJI9l0.js +179 -0
- package/dist/paths-GHJ97ebE.js +268 -0
- package/dist/paths-nCHyK08H.js +56 -0
- package/dist/perplexity-kYSLNo8o.js +422 -0
- package/dist/persistent-dedupe-bjKjVI5u.js +116 -0
- package/dist/pi-embedded-CDH9LrEg.js +172586 -0
- package/dist/pi-model-discovery-CuX5CDyZ.js +125 -0
- package/dist/pi-model-discovery-runtime-DUWeqjUv.js +44 -0
- package/dist/pi-tools.before-tool-call.runtime-D9NV63QP.js +387 -0
- package/dist/platform-launcher-CqGy6UhP.js +83 -0
- package/dist/plugin-entry-CwuwM1jC.js +17 -0
- package/dist/plugin-install-CpMYi2tB.js +184 -0
- package/dist/plugin-install-aDvFMLBT.js +216 -0
- package/dist/plugin-install-plan-B_2cLkDP.js +49 -0
- package/dist/plugin-registry-C7Z7CkLP.js +213 -0
- package/dist/plugin-registry-C8bgJflP.js +51 -0
- package/dist/plugin-sdk/account-helpers.d.ts +1 -0
- package/dist/plugin-sdk/account-helpers.js +3 -0
- package/dist/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/account-id.js +2 -0
- package/dist/plugin-sdk/account-resolution.d.ts +1 -0
- package/dist/plugin-sdk/account-resolution.js +216 -0
- package/dist/plugin-sdk/acp-runtime.d.ts +1 -0
- package/dist/plugin-sdk/acp-runtime.js +46 -0
- package/dist/plugin-sdk/agent-runtime.d.ts +1 -0
- package/dist/plugin-sdk/agent-runtime.js +215 -0
- package/dist/plugin-sdk/allow-from.d.ts +1 -0
- package/dist/plugin-sdk/allow-from.js +17 -0
- package/dist/plugin-sdk/allowlist-config-edit.d.ts +1 -0
- package/dist/plugin-sdk/allowlist-config-edit.js +2 -0
- package/dist/plugin-sdk/bluebubbles.d.ts +1 -0
- package/dist/plugin-sdk/bluebubbles.js +232 -0
- package/dist/plugin-sdk/boolean-param.d.ts +1 -0
- package/dist/plugin-sdk/boolean-param.js +2 -0
- package/dist/plugin-sdk/channel-actions.d.ts +1 -0
- package/dist/plugin-sdk/channel-actions.js +16 -0
- package/dist/plugin-sdk/channel-config-helpers.d.ts +1 -0
- package/dist/plugin-sdk/channel-config-helpers.js +15 -0
- package/dist/plugin-sdk/channel-config-schema.d.ts +1 -0
- package/dist/plugin-sdk/channel-config-schema.js +5 -0
- package/dist/plugin-sdk/channel-contract.d.ts +1 -0
- package/dist/plugin-sdk/channel-contract.js +1 -0
- package/dist/plugin-sdk/channel-feedback.d.ts +1 -0
- package/dist/plugin-sdk/channel-feedback.js +4 -0
- package/dist/plugin-sdk/channel-inbound.d.ts +1 -0
- package/dist/plugin-sdk/channel-inbound.js +53 -0
- package/dist/plugin-sdk/channel-lifecycle.d.ts +1 -0
- package/dist/plugin-sdk/channel-lifecycle.js +2 -0
- package/dist/plugin-sdk/channel-pairing.d.ts +1 -0
- package/dist/plugin-sdk/channel-pairing.js +2 -0
- package/dist/plugin-sdk/channel-policy.d.ts +1 -0
- package/dist/plugin-sdk/channel-policy.js +19 -0
- package/dist/plugin-sdk/channel-reply-pipeline.d.ts +1 -0
- package/dist/plugin-sdk/channel-reply-pipeline.js +23 -0
- package/dist/plugin-sdk/channel-runtime.d.ts +1 -0
- package/dist/plugin-sdk/channel-runtime.js +33 -0
- package/dist/plugin-sdk/channel-send-result.d.ts +1 -0
- package/dist/plugin-sdk/channel-send-result.js +2 -0
- package/dist/plugin-sdk/channel-setup.d.ts +1 -0
- package/dist/plugin-sdk/channel-setup.js +24 -0
- package/dist/plugin-sdk/channel-targets.d.ts +1 -0
- package/dist/plugin-sdk/channel-targets.js +3 -0
- package/dist/plugin-sdk/cli-runtime.d.ts +1 -0
- package/dist/plugin-sdk/cli-runtime.js +5 -0
- package/dist/plugin-sdk/command-auth.d.ts +1 -0
- package/dist/plugin-sdk/command-auth.js +212 -0
- package/dist/plugin-sdk/compat.js +59 -0
- package/dist/plugin-sdk/config-runtime.d.ts +1 -0
- package/dist/plugin-sdk/config-runtime.js +51 -0
- package/dist/plugin-sdk/conversation-runtime.d.ts +1 -0
- package/dist/plugin-sdk/conversation-runtime.js +55 -0
- package/dist/plugin-sdk/core.d.ts +1 -0
- package/dist/plugin-sdk/core.js +40 -0
- package/dist/plugin-sdk/device-bootstrap.d.ts +1 -0
- package/dist/plugin-sdk/device-bootstrap.js +6 -0
- package/dist/plugin-sdk/diagnostics-otel.d.ts +1 -0
- package/dist/plugin-sdk/diagnostics-otel.js +7 -0
- package/dist/plugin-sdk/diffs.d.ts +1 -0
- package/dist/plugin-sdk/diffs.js +3 -0
- package/dist/plugin-sdk/directory-runtime.d.ts +1 -0
- package/dist/plugin-sdk/directory-runtime.js +5 -0
- package/dist/plugin-sdk/discord-core.d.ts +1 -0
- package/dist/plugin-sdk/discord-core.js +26 -0
- package/dist/plugin-sdk/discord.d.ts +1 -0
- package/dist/plugin-sdk/discord.js +219 -0
- package/dist/plugin-sdk/extension-shared.d.ts +1 -0
- package/dist/plugin-sdk/extension-shared.js +15 -0
- package/dist/plugin-sdk/extensions/anthropic-vertex/provider-catalog.d.ts +5 -0
- package/dist/plugin-sdk/extensions/bluebubbles/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/bluebubbles/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/brave/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/brave/src/brave-web-search-provider.d.ts +42 -0
- package/dist/plugin-sdk/extensions/discord/api.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/runtime-api.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/session-key-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/account-inspect.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/accounts.d.ts +27 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.guild-admin.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.guild.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.messaging.d.ts +32 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation-shared.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.presence.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.shared.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/audit.d.ts +29 -0
- package/dist/plugin-sdk/extensions/discord/src/channel-actions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/chunk.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/client.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/components-registry.d.ts +16 -0
- package/dist/plugin-sdk/extensions/discord/src/components.d.ts +204 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-cache.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-live.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/draft-chunking.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/draft-stream.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/gateway-logging.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/guilds.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/mentions.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/message-tool-schema.d.ts +96 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components-helpers.d.ts +155 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components.d.ts +28 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/allow-list.d.ts +189 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/auto-presence.d.ts +59 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-auth.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-decision.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/exec-approvals.d.ts +55 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/format.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-error-guard.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-plugin.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-registry.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-context.d.ts +22 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-job.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-worker.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/listeners.d.ts +67 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.types.d.ts +88 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.process.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-utils.d.ts +45 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker-preferences.d.ts +18 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker.d.ts +117 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-context.d.ts +68 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-ui.d.ts +97 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command.d.ts +19 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/presence-cache.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/presence.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.allowlist.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.d.ts +26 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.lifecycle.d.ts +27 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-context.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-delivery.d.ts +40 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/rest-fetch.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/route-resolution.d.ts +40 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/sender-identity.d.ts +31 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/startup-status.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/status.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/system-events.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.config.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.discord-api.d.ts +41 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.lifecycle.d.ts +60 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.manager.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.messages.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.persona.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.state.d.ts +79 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.types.d.ts +79 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-session-close.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/threading.d.ts +98 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/timeouts.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/typing.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor.gateway.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/normalize.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/outbound-adapter.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/pluralkit.d.ts +26 -0
- package/dist/plugin-sdk/extensions/discord/src/probe.d.ts +37 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-allowlist-common.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-channels.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-users.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/retry.d.ts +12 -0
- package/dist/plugin-sdk/extensions/discord/src/runtime-api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/send.channels.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/send.components.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/send.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/send.emojis-stickers.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/send.guild.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/send.messages.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/send.outbound.d.ts +61 -0
- package/dist/plugin-sdk/extensions/discord/src/send.permissions.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/send.reactions.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/send.shared.d.ts +86 -0
- package/dist/plugin-sdk/extensions/discord/src/send.types.d.ts +148 -0
- package/dist/plugin-sdk/extensions/discord/src/send.typing.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/session-key-normalization.d.ts +7 -0
- package/dist/plugin-sdk/extensions/discord/src/shared-interactive.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/status-issues.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/targets.d.ts +18 -0
- package/dist/plugin-sdk/extensions/discord/src/token.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/ui.d.ts +19 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/command.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.d.ts +60 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/sdk-runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/voice-message.d.ts +50 -0
- package/dist/plugin-sdk/extensions/discord/timeouts.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/feishu/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/setup-api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/feishu/src/accounts.d.ts +48 -0
- package/dist/plugin-sdk/extensions/feishu/src/async.d.ts +12 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot-content.d.ts +82 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot-sender-name.d.ts +16 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot.d.ts +70 -0
- package/dist/plugin-sdk/extensions/feishu/src/client.d.ts +47 -0
- package/dist/plugin-sdk/extensions/feishu/src/config-schema.d.ts +550 -0
- package/dist/plugin-sdk/extensions/feishu/src/conversation-id.d.ts +17 -0
- package/dist/plugin-sdk/extensions/feishu/src/dedup.d.ts +19 -0
- package/dist/plugin-sdk/extensions/feishu/src/dynamic-agent.d.ts +18 -0
- package/dist/plugin-sdk/extensions/feishu/src/external-keys.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/src/media.d.ts +118 -0
- package/dist/plugin-sdk/extensions/feishu/src/mention.d.ts +52 -0
- package/dist/plugin-sdk/extensions/feishu/src/policy.d.ts +28 -0
- package/dist/plugin-sdk/extensions/feishu/src/post.d.ts +11 -0
- package/dist/plugin-sdk/extensions/feishu/src/probe.d.ts +10 -0
- package/dist/plugin-sdk/extensions/feishu/src/reply-dispatcher.d.ts +35 -0
- package/dist/plugin-sdk/extensions/feishu/src/runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/src/send-result.d.ts +12 -0
- package/dist/plugin-sdk/extensions/feishu/src/send-target.d.ts +10 -0
- package/dist/plugin-sdk/extensions/feishu/src/send.d.ts +131 -0
- package/dist/plugin-sdk/extensions/feishu/src/setup-core.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/setup-surface.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/streaming-card.d.ts +55 -0
- package/dist/plugin-sdk/extensions/feishu/src/targets.d.ts +6 -0
- package/dist/plugin-sdk/extensions/feishu/src/thread-bindings.d.ts +42 -0
- package/dist/plugin-sdk/extensions/feishu/src/types.d.ts +84 -0
- package/dist/plugin-sdk/extensions/feishu/src/typing.d.ts +57 -0
- package/dist/plugin-sdk/extensions/firecrawl/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/config.d.ts +25 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-client.d.ts +43 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-scrape-tool.d.ts +17 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-search-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-search-tool.d.ts +15 -0
- package/dist/plugin-sdk/extensions/google/gemini-cli-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/google/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/google/media-understanding-provider.d.ts +6 -0
- package/dist/plugin-sdk/extensions/google/oauth.credentials.d.ts +21 -0
- package/dist/plugin-sdk/extensions/google/oauth.d.ts +5 -0
- package/dist/plugin-sdk/extensions/google/oauth.flow.d.ts +20 -0
- package/dist/plugin-sdk/extensions/google/oauth.http.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/oauth.project.d.ts +4 -0
- package/dist/plugin-sdk/extensions/google/oauth.runtime.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/oauth.shared.d.ts +33 -0
- package/dist/plugin-sdk/extensions/google/oauth.token.d.ts +2 -0
- package/dist/plugin-sdk/extensions/google/provider-models.d.ts +6 -0
- package/dist/plugin-sdk/extensions/google/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/src/gemini-web-search-provider.d.ts +13 -0
- package/dist/plugin-sdk/extensions/huggingface/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/imessage/runtime-api.d.ts +6 -0
- package/dist/plugin-sdk/extensions/imessage/src/accounts.d.ts +16 -0
- package/dist/plugin-sdk/extensions/imessage/src/client.d.ts +46 -0
- package/dist/plugin-sdk/extensions/imessage/src/constants.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/abort-handler.d.ts +9 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/deliver.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/echo-cache.d.ts +9 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/inbound-processing.d.ts +98 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/loop-rate-limiter.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/monitor-provider.d.ts +7 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/parse-notification.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/reflection-guard.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/sanitize-outbound.d.ts +6 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/self-chat-cache.d.ts +16 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/types.d.ts +37 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/probe.d.ts +17 -0
- package/dist/plugin-sdk/extensions/imessage/src/send.d.ts +34 -0
- package/dist/plugin-sdk/extensions/imessage/src/target-parsing-helpers.d.ts +85 -0
- package/dist/plugin-sdk/extensions/imessage/src/targets.d.ts +27 -0
- package/dist/plugin-sdk/extensions/irc/api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/irc/src/accounts.d.ts +23 -0
- package/dist/plugin-sdk/extensions/irc/src/control-chars.d.ts +3 -0
- package/dist/plugin-sdk/extensions/irc/src/normalize.d.ts +18 -0
- package/dist/plugin-sdk/extensions/irc/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/irc/src/setup-core.d.ts +10 -0
- package/dist/plugin-sdk/extensions/irc/src/setup-surface.d.ts +4 -0
- package/dist/plugin-sdk/extensions/irc/src/types.d.ts +83 -0
- package/dist/plugin-sdk/extensions/kilocode/provider-catalog.d.ts +3 -0
- package/dist/plugin-sdk/extensions/kimi-coding/provider-catalog.d.ts +10 -0
- package/dist/plugin-sdk/extensions/matrix/helper-api.d.ts +3 -0
- package/dist/plugin-sdk/extensions/matrix/runtime-api.d.ts +7 -0
- package/dist/plugin-sdk/extensions/matrix/src/account-selection.d.ts +6 -0
- package/dist/plugin-sdk/extensions/matrix/src/auth-precedence.d.ts +11 -0
- package/dist/plugin-sdk/extensions/matrix/src/env-vars.d.ts +10 -0
- package/dist/plugin-sdk/extensions/matrix/src/matrix/thread-bindings-shared.d.ts +77 -0
- package/dist/plugin-sdk/extensions/matrix/src/storage-paths.d.ts +26 -0
- package/dist/plugin-sdk/extensions/matrix/thread-bindings-runtime.d.ts +1 -0
- package/dist/plugin-sdk/extensions/modelstudio/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/moonshot/media-understanding-provider.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/onboard.d.ts +7 -0
- package/dist/plugin-sdk/extensions/moonshot/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/src/kimi-web-search-provider.d.ts +43 -0
- package/dist/plugin-sdk/extensions/nvidia/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/perplexity/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/perplexity/src/perplexity-web-search-provider.d.ts +37 -0
- package/dist/plugin-sdk/extensions/qianfan/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/signal/api.d.ts +8 -0
- package/dist/plugin-sdk/extensions/signal/src/accounts.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/client.d.ts +32 -0
- package/dist/plugin-sdk/extensions/signal/src/daemon.d.ts +26 -0
- package/dist/plugin-sdk/extensions/signal/src/format.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/identity.d.ts +25 -0
- package/dist/plugin-sdk/extensions/signal/src/message-actions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/access-policy.d.ts +40 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.d.ts +5 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.types.d.ts +126 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/mentions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor.d.ts +27 -0
- package/dist/plugin-sdk/extensions/signal/src/probe.d.ts +7 -0
- package/dist/plugin-sdk/extensions/signal/src/reaction-level.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/rpc-context.d.ts +9 -0
- package/dist/plugin-sdk/extensions/signal/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/signal/src/send-reactions.d.ts +34 -0
- package/dist/plugin-sdk/extensions/signal/src/send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/signal/src/sse-reconnect.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/api.d.ts +15 -0
- package/dist/plugin-sdk/extensions/slack/runtime-api.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/account-inspect.d.ts +32 -0
- package/dist/plugin-sdk/extensions/slack/src/account-surface-fields.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/accounts.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/action-runtime.d.ts +38 -0
- package/dist/plugin-sdk/extensions/slack/src/actions.d.ts +74 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-fallback.d.ts +2 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-input.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-render.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/channel-migration.d.ts +20 -0
- package/dist/plugin-sdk/extensions/slack/src/client.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/directory-live.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/draft-stream.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/format.d.ts +8 -0
- package/dist/plugin-sdk/extensions/slack/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/http/index.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/http/registry.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/index.d.ts +7 -0
- package/dist/plugin-sdk/extensions/slack/src/interactive-replies.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/message-actions.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/modal-metadata.d.ts +8 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/allow-list.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/auth.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-config.d.ts +45 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-type.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/commands.d.ts +9 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/context.d.ts +107 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/dm-auth.d.ts +17 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/channels.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.block-actions.d.ts +49 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.modal.d.ts +68 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/members.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/message-subtype-handlers.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/messages.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/pins.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/reactions.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/system-event-context.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events.d.ts +10 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/external-arg-menu-store.d.ts +18 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/media.d.ts +66 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/dispatch.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-content.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-thread-context.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/types.d.ts +23 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler.d.ts +22 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/mrkdwn.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/policy.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/provider.d.ts +26 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/reconnect-policy.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/replies.d.ts +56 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/room-context.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-commands.runtime.d.ts +11 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-dispatch.runtime.d.ts +17 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-skill-commands.runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/thread-resolution.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/types.d.ts +113 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/probe.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-allowlist-common.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-channels.d.ts +19 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-users.d.ts +26 -0
- package/dist/plugin-sdk/extensions/slack/src/runtime-api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/send.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/sent-thread-cache.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/stream-mode.d.ts +23 -0
- package/dist/plugin-sdk/extensions/slack/src/streaming.d.ts +72 -0
- package/dist/plugin-sdk/extensions/slack/src/targets.d.ts +7 -0
- package/dist/plugin-sdk/extensions/slack/src/threading-tool-context.d.ts +10 -0
- package/dist/plugin-sdk/extensions/slack/src/threading.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/token.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/truncate.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/types.d.ts +58 -0
- package/dist/plugin-sdk/extensions/tavily/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/tavily/src/config.d.ts +14 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-client.d.ts +29 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-extract-tool.d.ts +14 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-search-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-search-tool.d.ts +17 -0
- package/dist/plugin-sdk/extensions/telegram/allow-from.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/api.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/runtime-api.d.ts +14 -0
- package/dist/plugin-sdk/extensions/telegram/src/account-inspect.d.ts +18 -0
- package/dist/plugin-sdk/extensions/telegram/src/accounts.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/action-runtime.d.ts +21 -0
- package/dist/plugin-sdk/extensions/telegram/src/allow-from.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/allowed-updates.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/api-fetch.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/api-logging.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/approval-buttons.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/audit-membership-runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/audit.d.ts +33 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.replies.d.ts +50 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.resolve-media.d.ts +8 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/helpers.d.ts +147 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/reply-threading.d.ts +30 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/types.d.ts +28 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-access.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-deps.d.ts +19 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.media.d.ts +7 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.runtime.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.body.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.d.ts +34 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.session.d.ts +41 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.types.d.ts +56 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-dispatch.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-native-command-menu.d.ts +37 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-native-commands.d.ts +60 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-updates.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot.runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/button-types.d.ts +13 -0
- package/dist/plugin-sdk/extensions/telegram/src/caption.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/channel-actions.d.ts +6 -0
- package/dist/plugin-sdk/extensions/telegram/src/conversation-route.d.ts +24 -0
- package/dist/plugin-sdk/extensions/telegram/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/telegram/src/dm-access.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/draft-stream.d.ts +48 -0
- package/dist/plugin-sdk/extensions/telegram/src/exec-approvals-handler.d.ts +34 -0
- package/dist/plugin-sdk/extensions/telegram/src/exec-approvals.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/fetch.d.ts +23 -0
- package/dist/plugin-sdk/extensions/telegram/src/format.d.ts +19 -0
- package/dist/plugin-sdk/extensions/telegram/src/forum-service-message.d.ts +9 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-access.d.ts +54 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-config-helpers.d.ts +8 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-migration.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/inline-buttons.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery-state.d.ts +12 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery-text-deliverer.d.ts +55 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/media-understanding.runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/message-tool-schema.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/model-buttons.d.ts +84 -0
- package/dist/plugin-sdk/extensions/telegram/src/monitor.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/network-config.d.ts +33 -0
- package/dist/plugin-sdk/extensions/telegram/src/network-errors.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/normalize.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/outbound-adapter.d.ts +14 -0
- package/dist/plugin-sdk/extensions/telegram/src/outbound-params.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/polling-session.d.ts +27 -0
- package/dist/plugin-sdk/extensions/telegram/src/probe.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/proxy.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/src/reaction-level.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/reasoning-lane-coordinator.d.ts +18 -0
- package/dist/plugin-sdk/extensions/telegram/src/send.d.ts +217 -0
- package/dist/plugin-sdk/extensions/telegram/src/sendchataction-401-backoff.d.ts +28 -0
- package/dist/plugin-sdk/extensions/telegram/src/sent-message-cache.d.ts +12 -0
- package/dist/plugin-sdk/extensions/telegram/src/sequential-key.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/status-issues.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/status-reaction-variants.d.ts +21 -0
- package/dist/plugin-sdk/extensions/telegram/src/sticker-cache.d.ts +46 -0
- package/dist/plugin-sdk/extensions/telegram/src/target-writeback.d.ts +7 -0
- package/dist/plugin-sdk/extensions/telegram/src/targets.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/thread-bindings.d.ts +58 -0
- package/dist/plugin-sdk/extensions/telegram/src/token.d.ts +13 -0
- package/dist/plugin-sdk/extensions/telegram/src/update-offset-store.d.ts +15 -0
- package/dist/plugin-sdk/extensions/telegram/src/voice.d.ts +16 -0
- package/dist/plugin-sdk/extensions/telegram/src/webhook.d.ts +21 -0
- package/dist/plugin-sdk/extensions/venice/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/api.d.ts +7 -0
- package/dist/plugin-sdk/extensions/whatsapp/auth-presence.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/light-runtime-api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/login-qr-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/runtime-api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/accounts.d.ts +42 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime-target-auth.d.ts +10 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime.d.ts +9 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/active-listener.d.ts +25 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/agent-tools-login.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auth-store.d.ts +26 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/constants.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/deliver-reply.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/heartbeat-runner.d.ts +20 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/loggers.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/ack-reaction.d.ts +13 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/broadcast.d.ts +16 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/echo.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-activation.d.ts +9 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-gating.d.ts +33 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-members.d.ts +6 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/last-route.d.ts +15 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/message-line.d.ts +11 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/on-message.d.ts +24 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/peer.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/process-message.d.ts +40 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor.d.ts +5 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/session-snapshot.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/types.d.ts +30 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/util.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.impl.d.ts +6 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/channel.runtime.d.ts +23 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/access-control.d.ts +36 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/dedupe.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/extract.d.ts +13 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/media.d.ts +7 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/monitor.d.ts +30 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/send-api.d.ts +22 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/types.d.ts +42 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/login-qr.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/login.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/media.d.ts +43 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/normalize.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/qr-image.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/reconnect.d.ts +12 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/runtime-api.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/session-errors.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/session.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-core.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-surface.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/vcard.d.ts +6 -0
- package/dist/plugin-sdk/extensions/xai/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/xai/model-definitions.d.ts +17 -0
- package/dist/plugin-sdk/extensions/xai/onboard.d.ts +5 -0
- package/dist/plugin-sdk/extensions/xai/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/xai/provider-models.d.ts +6 -0
- package/dist/plugin-sdk/extensions/xai/src/web-search-shared.d.ts +69 -0
- package/dist/plugin-sdk/extensions/xai/stream.d.ts +3 -0
- package/dist/plugin-sdk/extensions/xai/web-search.d.ts +10 -0
- package/dist/plugin-sdk/extensions/xiaomi/provider-catalog.d.ts +3 -0
- package/dist/plugin-sdk/extensions/zalo/api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/zalo/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/accounts.d.ts +11 -0
- package/dist/plugin-sdk/extensions/zalo/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/setup-core.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/setup-surface.d.ts +3 -0
- package/dist/plugin-sdk/extensions/zalo/src/token.d.ts +8 -0
- package/dist/plugin-sdk/extensions/zalo/src/types.d.ts +46 -0
- package/dist/plugin-sdk/feishu.d.ts +1 -0
- package/dist/plugin-sdk/feishu.js +101 -0
- package/dist/plugin-sdk/gateway-runtime.d.ts +1 -0
- package/dist/plugin-sdk/gateway-runtime.js +46 -0
- package/dist/plugin-sdk/googlechat.d.ts +1 -0
- package/dist/plugin-sdk/googlechat.js +93 -0
- package/dist/plugin-sdk/group-access.d.ts +1 -0
- package/dist/plugin-sdk/group-access.js +2 -0
- package/dist/plugin-sdk/hook-runtime.d.ts +1 -0
- package/dist/plugin-sdk/hook-runtime.js +12 -0
- package/dist/plugin-sdk/image-generation.d.ts +1 -0
- package/dist/plugin-sdk/image-generation.js +51 -0
- package/dist/plugin-sdk/imessage-core.d.ts +1 -0
- package/dist/plugin-sdk/imessage-core.js +214 -0
- package/dist/plugin-sdk/imessage.d.ts +1 -0
- package/dist/plugin-sdk/imessage.js +223 -0
- package/dist/plugin-sdk/index.d.ts +1 -0
- package/dist/plugin-sdk/index.js +55 -0
- package/dist/plugin-sdk/infra-runtime.d.ts +1 -0
- package/dist/plugin-sdk/infra-runtime.js +223 -0
- package/dist/plugin-sdk/interactive-runtime.d.ts +1 -0
- package/dist/plugin-sdk/interactive-runtime.js +3 -0
- package/dist/plugin-sdk/irc.d.ts +1 -0
- package/dist/plugin-sdk/irc.js +232 -0
- package/dist/plugin-sdk/json-store.d.ts +1 -0
- package/dist/plugin-sdk/json-store.js +9 -0
- package/dist/plugin-sdk/keyed-async-queue.d.ts +1 -0
- package/dist/plugin-sdk/keyed-async-queue.js +2 -0
- package/dist/plugin-sdk/lazy-runtime.d.ts +1 -0
- package/dist/plugin-sdk/lazy-runtime.js +2 -0
- package/dist/plugin-sdk/line-core.d.ts +1 -0
- package/dist/plugin-sdk/line-core.js +29 -0
- package/dist/plugin-sdk/line.d.ts +1 -0
- package/dist/plugin-sdk/line.js +22 -0
- package/dist/plugin-sdk/llm-task.d.ts +1 -0
- package/dist/plugin-sdk/llm-task.js +7 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.d.ts +1 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.js +223 -0
- package/dist/plugin-sdk/matrix-runtime-shared.d.ts +1 -0
- package/dist/plugin-sdk/matrix-runtime-shared.js +2 -0
- package/dist/plugin-sdk/matrix.d.ts +1 -0
- package/dist/plugin-sdk/matrix.js +84 -0
- package/dist/plugin-sdk/mattermost.d.ts +1 -0
- package/dist/plugin-sdk/mattermost.js +233 -0
- package/dist/plugin-sdk/media-runtime.d.ts +1 -0
- package/dist/plugin-sdk/media-runtime.js +212 -0
- package/dist/plugin-sdk/media-understanding-runtime.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding-runtime.js +211 -0
- package/dist/plugin-sdk/media-understanding.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding.js +15 -0
- package/dist/plugin-sdk/memory-core.d.ts +1 -0
- package/dist/plugin-sdk/memory-core.js +2 -0
- package/dist/plugin-sdk/memory-lancedb.d.ts +1 -0
- package/dist/plugin-sdk/memory-lancedb.js +2 -0
- package/dist/plugin-sdk/msteams.d.ts +1 -0
- package/dist/plugin-sdk/msteams.js +244 -0
- package/dist/plugin-sdk/nextcloud-talk.d.ts +1 -0
- package/dist/plugin-sdk/nextcloud-talk.js +231 -0
- package/dist/plugin-sdk/nostr.d.ts +1 -0
- package/dist/plugin-sdk/nostr.js +50 -0
- package/dist/plugin-sdk/ollama-setup.d.ts +1 -0
- package/dist/plugin-sdk/ollama-setup.js +33 -0
- package/dist/plugin-sdk/outbound-runtime.d.ts +1 -0
- package/dist/plugin-sdk/outbound-runtime.js +23 -0
- package/dist/plugin-sdk/plugin-entry.d.ts +1 -0
- package/dist/plugin-sdk/plugin-entry.js +3 -0
- package/dist/plugin-sdk/plugin-runtime.d.ts +1 -0
- package/dist/plugin-sdk/plugin-runtime.js +211 -0
- package/dist/plugin-sdk/process-runtime.d.ts +1 -0
- package/dist/plugin-sdk/process-runtime.js +12 -0
- package/dist/plugin-sdk/provider-auth-api-key.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth-api-key.js +53 -0
- package/dist/plugin-sdk/provider-auth-login.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth-login.js +2 -0
- package/dist/plugin-sdk/provider-auth.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth.js +37 -0
- package/dist/plugin-sdk/provider-catalog.d.ts +1 -0
- package/dist/plugin-sdk/provider-catalog.js +2 -0
- package/dist/plugin-sdk/provider-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/provider-env-vars.js +2 -0
- package/dist/plugin-sdk/provider-google.d.ts +1 -0
- package/dist/plugin-sdk/provider-google.js +3 -0
- package/dist/plugin-sdk/provider-models.d.ts +1 -0
- package/dist/plugin-sdk/provider-models.js +27 -0
- package/dist/plugin-sdk/provider-onboard.d.ts +1 -0
- package/dist/plugin-sdk/provider-onboard.js +20 -0
- package/dist/plugin-sdk/provider-setup.d.ts +1 -0
- package/dist/plugin-sdk/provider-setup.js +58 -0
- package/dist/plugin-sdk/provider-stream.d.ts +1 -0
- package/dist/plugin-sdk/provider-stream.js +211 -0
- package/dist/plugin-sdk/provider-usage.d.ts +1 -0
- package/dist/plugin-sdk/provider-usage.js +18 -0
- package/dist/plugin-sdk/provider-web-search.d.ts +1 -0
- package/dist/plugin-sdk/provider-web-search.js +23 -0
- package/dist/plugin-sdk/provider-zai-endpoint.d.ts +1 -0
- package/dist/plugin-sdk/provider-zai-endpoint.js +3 -0
- package/dist/plugin-sdk/reply-history.d.ts +1 -0
- package/dist/plugin-sdk/reply-history.js +23 -0
- package/dist/plugin-sdk/reply-payload.d.ts +1 -0
- package/dist/plugin-sdk/reply-payload.js +2 -0
- package/dist/plugin-sdk/reply-runtime.d.ts +1 -0
- package/dist/plugin-sdk/reply-runtime.js +211 -0
- package/dist/plugin-sdk/request-url.d.ts +1 -0
- package/dist/plugin-sdk/request-url.js +2 -0
- package/dist/plugin-sdk/root-alias.cjs +272 -0
- package/dist/plugin-sdk/routing.d.ts +1 -0
- package/dist/plugin-sdk/routing.js +25 -0
- package/dist/plugin-sdk/runtime-env.d.ts +1 -0
- package/dist/plugin-sdk/runtime-env.js +15 -0
- package/dist/plugin-sdk/runtime-store.d.ts +1 -0
- package/dist/plugin-sdk/runtime-store.js +2 -0
- package/dist/plugin-sdk/runtime.d.ts +1 -0
- package/dist/plugin-sdk/runtime.js +15 -0
- package/dist/plugin-sdk/sandbox.d.ts +1 -0
- package/dist/plugin-sdk/sandbox.js +66 -0
- package/dist/plugin-sdk/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/secret-input.js +3 -0
- package/dist/plugin-sdk/security-runtime.d.ts +1 -0
- package/dist/plugin-sdk/security-runtime.js +18 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.d.ts +1 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.js +33 -0
- package/dist/plugin-sdk/setup-adapter-runtime.d.ts +1 -0
- package/dist/plugin-sdk/setup-adapter-runtime.js +2 -0
- package/dist/plugin-sdk/setup-runtime.d.ts +1 -0
- package/dist/plugin-sdk/setup-runtime.js +17 -0
- package/dist/plugin-sdk/setup-tools.d.ts +1 -0
- package/dist/plugin-sdk/setup-tools.js +21 -0
- package/dist/plugin-sdk/setup.d.ts +1 -0
- package/dist/plugin-sdk/setup.js +26 -0
- package/dist/plugin-sdk/signal.d.ts +1 -0
- package/dist/plugin-sdk/signal.js +220 -0
- package/dist/plugin-sdk/slack-core.d.ts +1 -0
- package/dist/plugin-sdk/slack-core.js +22 -0
- package/dist/plugin-sdk/slack.d.ts +1 -0
- package/dist/plugin-sdk/slack.js +223 -0
- package/dist/plugin-sdk/speech-runtime.d.ts +1 -0
- package/dist/plugin-sdk/speech-runtime.js +213 -0
- package/dist/plugin-sdk/speech.d.ts +1 -0
- package/dist/plugin-sdk/speech.js +212 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.core.d.ts +86 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.d.ts +7 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.identity-reconcile.d.ts +23 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.runtime-controls.d.ts +14 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.types.d.ts +109 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.utils.d.ts +21 -0
- package/dist/plugin-sdk/src/acp/control-plane/runtime-cache.d.ts +38 -0
- package/dist/plugin-sdk/src/acp/control-plane/runtime-options.d.ts +23 -0
- package/dist/plugin-sdk/src/acp/control-plane/session-actor-queue.d.ts +8 -0
- package/dist/plugin-sdk/src/acp/control-plane/spawn.d.ts +25 -0
- package/dist/plugin-sdk/src/acp/conversation-id.d.ts +15 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.lifecycle.d.ts +33 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.resolve.d.ts +18 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.types.d.ts +39 -0
- package/dist/plugin-sdk/src/acp/policy.d.ts +10 -0
- package/dist/plugin-sdk/src/acp/runtime/error-text.d.ts +7 -0
- package/dist/plugin-sdk/src/acp/runtime/errors.d.ts +20 -0
- package/dist/plugin-sdk/src/acp/runtime/registry.d.ts +18 -0
- package/dist/plugin-sdk/src/acp/runtime/session-identifiers.d.ts +17 -0
- package/dist/plugin-sdk/src/acp/runtime/session-identity.d.ts +24 -0
- package/dist/plugin-sdk/src/acp/runtime/session-meta.d.ts +31 -0
- package/dist/plugin-sdk/src/acp/runtime/types.d.ts +118 -0
- package/dist/plugin-sdk/src/agents/acp-spawn-parent-stream.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/acp-spawn.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/agent-command.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/agent-paths.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/agent-scope.d.ts +66 -0
- package/dist/plugin-sdk/src/agents/announce-idempotency.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/anthropic-payload-log.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/anthropic-vertex-provider.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/anthropic-vertex-stream.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/api-key-rotation.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/apply-patch-update.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/apply-patch.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/auth-health.d.ts +40 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/constants.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/credential-state.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/display.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/doctor.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/external-cli-sync.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/oauth.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/order.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/paths.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/profiles.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/repair.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/session-override.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/state-observation.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/store.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/types.d.ts +63 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/upsert-with-lock.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/usage.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/auth-profiles.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/auth-profiles.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/bash-process-registry.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/bash-tools.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-followup.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-request.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-gateway.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-node.d.ts +26 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-shared.d.ts +143 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-runtime.d.ts +81 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-types.d.ts +68 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/bash-tools.process.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/bash-tools.shared.d.ts +56 -0
- package/dist/plugin-sdk/src/agents/bedrock-discovery.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/bootstrap-budget.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/bootstrap-cache.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/bootstrap-files.d.ts +32 -0
- package/dist/plugin-sdk/src/agents/bootstrap-hooks.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/btw.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/byteplus-models.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/cache-trace.d.ts +49 -0
- package/dist/plugin-sdk/src/agents/channel-tools.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/chutes-models.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/chutes-oauth.d.ts +46 -0
- package/dist/plugin-sdk/src/agents/cli-backends.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/cli-credentials.d.ts +83 -0
- package/dist/plugin-sdk/src/agents/cli-runner/bundle-mcp.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/cli-runner/helpers.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/cli-runner/reliability.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/cli-runner.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/cli-session.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/cli-watchdog-defaults.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/cloudflare-ai-gateway.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/command/delivery.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/command/run-context.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/command/session-store.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/command/session.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/command/types.d.ts +95 -0
- package/dist/plugin-sdk/src/agents/command-poll-backoff.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/command-poll-backoff.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/compaction-real-conversation.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/compaction.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/console-sanitize.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/content-blocks.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/context-cache.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/context-window-guard.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/context.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/current-time.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/custom-api-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/date-time.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/defaults.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/docs-path.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/doubao-models.d.ts +100 -0
- package/dist/plugin-sdk/src/agents/embedded-pi-lsp.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/embedded-pi-mcp.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/failover-error.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/fast-mode.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/glob-pattern.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/huggingface-models.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/identity-avatar.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/identity-file.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/identity.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/image-sanitization.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/internal-events.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/kilocode-models.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/lanes.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/live-auth-keys.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/mcp-stdio.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/memory-search.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/minimax-vlm.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/model-alias-lines.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-auth-env-vars.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-auth-env.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/model-auth-label.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/model-auth-markers.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/model-auth.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/model-catalog.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/model-catalog.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/model-compat.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/model-fallback-observation.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/model-fallback.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/model-fallback.types.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/model-id-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-ref-profile.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/model-selection.d.ts +125 -0
- package/dist/plugin-sdk/src/agents/model-suppression.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/model-suppression.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/model-tool-support.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/models-config.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/models-config.merge.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/models-config.plan.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/models-config.providers.d.ts +50 -0
- package/dist/plugin-sdk/src/agents/models-config.providers.discovery.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/models-config.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/ollama-defaults.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/ollama-models.d.ts +48 -0
- package/dist/plugin-sdk/src/agents/ollama-stream.d.ts +58 -0
- package/dist/plugin-sdk/src/agents/openai-ws-connection.d.ts +323 -0
- package/dist/plugin-sdk/src/agents/openai-ws-stream.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/openclaw-tools.d.ts +63 -0
- package/dist/plugin-sdk/src/agents/openclaw-tools.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/opencode-zen-models.d.ts +46 -0
- package/dist/plugin-sdk/src/agents/owner-display.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/path-policy.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/payload-redaction.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-auth-credentials.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/pi-bundle-lsp-runtime.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-tools.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-block-chunker.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-error-observation.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/bootstrap.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/errors.d.ts +45 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/failover-matches.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/google.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/images.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/messaging-dedupe.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/openai.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/thinking.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/turns.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/types.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-messaging.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-payloads.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/abort.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/anthropic-stream-wrappers.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/cache-ttl.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compact.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compact.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compaction-runtime-context.d.ts +50 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compaction-safety-timeout.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/context-engine-maintenance.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extensions.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extra-params.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/google-stream-wrappers.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/google.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/history.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/lanes.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/logger.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/message-action-discovery-input.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/model.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/model.provider-normalization.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/moonshot-stream-wrappers.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/openai-stream-wrappers.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/openrouter-model-capabilities.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/proxy-stream-wrappers.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/attempt.d.ts +69 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/compaction-retry-aggregate-timeout.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/compaction-timeout.d.ts +29 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/failover-observation.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/history-image-prune.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/images.d.ts +83 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/params.d.ts +138 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/payloads.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/types.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/runs.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/sandbox-info.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-cache.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-init.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-truncation.d.ts +38 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/skills-runtime.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/stream-payload-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/system-prompt.d.ts +55 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/thinking.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-name-allowlist.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-char-estimator.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-context-guard.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-truncation.d.ts +84 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-split.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/transcript-rewrite.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/types.d.ts +89 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/utils.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/wait-for-idle-before-flush.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/zai-stream-wrappers.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.compaction.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.lifecycle.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.messages.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.tools.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.types.d.ts +154 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.raw-stream.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.tools.d.ts +26 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.types.d.ts +47 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-utils.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/pi-embedded.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-instructions.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard-runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/extension.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/pruner.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/settings.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/tools.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/session-manager-runtime-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-model-discovery-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-model-discovery.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-project-settings.d.ts +31 -0
- package/dist/plugin-sdk/src/agents/pi-settings.d.ts +45 -0
- package/dist/plugin-sdk/src/agents/pi-tool-definition-adapter.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-tools.abort.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-tools.before-tool-call.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/pi-tools.before-tool-call.runtime.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-tools.d.ts +106 -0
- package/dist/plugin-sdk/src/agents/pi-tools.host-edit.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-tools.params.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/pi-tools.policy.d.ts +38 -0
- package/dist/plugin-sdk/src/agents/pi-tools.read.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-tools.schema.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-tools.types.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/provider-attribution.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/provider-capabilities.d.ts +42 -0
- package/dist/plugin-sdk/src/agents/provider-id.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pty-dsr.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pty-keys.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/queued-file-writer.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/runtime-plugins.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/sandbox/backend.d.ts +84 -0
- package/dist/plugin-sdk/src/agents/sandbox/bind-spec.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/browser-bridges.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/browser.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/config-hash.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/sandbox/config.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/sandbox/constants.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/sandbox/context.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/sandbox/docker-backend.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/docker.d.ts +59 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-mutation-helper.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-path-safety.d.ts +60 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-shell-command-plans.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge.d.ts +56 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-paths.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/sandbox/hash.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/sandbox/host-paths.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/sandbox/manage.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/sandbox/network-mode.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/novnc-auth.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox/path-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/sandbox/prune.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/sandbox/registry.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/sandbox/remote-fs-bridge.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/runtime-status.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/sandbox/sanitize-env-vars.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/sandbox/shared.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/ssh-backend.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/sandbox/ssh.d.ts +52 -0
- package/dist/plugin-sdk/src/agents/sandbox/tool-policy.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/types.d.ts +98 -0
- package/dist/plugin-sdk/src/agents/sandbox/types.docker.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/validate-sandbox-security.d.ts +68 -0
- package/dist/plugin-sdk/src/agents/sandbox/workspace-mounts.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/sandbox/workspace.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/sandbox-media-paths.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/sandbox-paths.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox-tool-policy.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/sandbox.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/sanitize-for-prompt.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/schema/clean-for-gemini.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/schema/clean-for-xai.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/schema/typebox.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/self-hosted-provider-defaults.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/session-dirs.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/session-file-repair.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/session-slug.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-guard-wrapper.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-guard.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-state.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/session-transcript-repair.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/session-write-lock.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/sglang-defaults.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/shell-utils.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/simple-completion-transport.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/skills/bundled-dir.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/skills/config.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/skills/env-overrides.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/skills/filter.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/skills/frontmatter.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/skills/plugin-skills.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/skills/refresh.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/skills/serialize.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/skills/types.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/skills/workspace.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/skills.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/spawned-context.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/stable-stringify.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/stream-message-shared.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/subagent-announce-dispatch.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/subagent-announce-queue.d.ts +29 -0
- package/dist/plugin-sdk/src/agents/subagent-announce.d.ts +48 -0
- package/dist/plugin-sdk/src/agents/subagent-attachments.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/subagent-capabilities.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/subagent-control.d.ts +176 -0
- package/dist/plugin-sdk/src/agents/subagent-depth.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/subagent-lifecycle-events.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/subagent-orphan-recovery.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-cleanup.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-completion.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-queries.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-state.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.store.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.types.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/subagent-spawn.d.ts +71 -0
- package/dist/plugin-sdk/src/agents/synthetic-models.d.ts +160 -0
- package/dist/plugin-sdk/src/agents/system-prompt-params.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/system-prompt-report.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/system-prompt.d.ts +72 -0
- package/dist/plugin-sdk/src/agents/timeout.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/together-models.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/tool-call-id.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tool-catalog.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/tool-display-common.d.ts +69 -0
- package/dist/plugin-sdk/src/agents/tool-display.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tool-fs-policy.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/tool-images.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tool-loop-detection.d.ts +55 -0
- package/dist/plugin-sdk/src/agents/tool-mutation.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/tool-policy-match.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/tool-policy-pipeline.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tool-policy-shared.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tool-policy.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/tool-summaries.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/tools/agent-step.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tools/agents-list-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.actions.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.schema.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-tool.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/common.d.ts +81 -0
- package/dist/plugin-sdk/src/agents/tools/cron-tool.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tools/gateway-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/gateway.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tools/image-generate-tool.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/tools/image-tool.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/tools/image-tool.helpers.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/tools/media-tool-shared.d.ts +47 -0
- package/dist/plugin-sdk/src/agents/tools/memory-tool.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/tools/message-tool.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/model-config.helpers.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/nodes-tool.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/nodes-utils.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-native-providers.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-tool.d.ts +23 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-tool.helpers.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tools/session-status-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-access.d.ts +42 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-announce-target.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-helpers.d.ts +73 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-history-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-list-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-resolution.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-helpers.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.a2a.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-spawn-tool.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-yield-tool.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/subagents-tool.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/tools/tool-runtime.helpers.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/tools/tts-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch-utils.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch-visibility.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/tools/web-guarded-fetch.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-citation-redirect.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-common.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-config.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-credentials.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/web-search.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/web-shared.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/tools/web-tools.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/trace-base.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/transcript-policy.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/usage.d.ts +65 -0
- package/dist/plugin-sdk/src/agents/venice-models.d.ts +369 -0
- package/dist/plugin-sdk/src/agents/vercel-ai-gateway.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/vllm-defaults.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/volc-models.shared.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/workspace-dir.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/workspace-dirs.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/workspace-run.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/workspace-templates.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/workspace.d.ts +45 -0
- package/dist/plugin-sdk/src/auto-reply/chunk.d.ts +45 -0
- package/dist/plugin-sdk/src/auto-reply/command-auth.d.ts +17 -0
- package/dist/plugin-sdk/src/auto-reply/command-detection.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/commands-args.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.d.ts +54 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.data.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.types.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/commands-text-routing.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/dispatch.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/envelope.d.ts +60 -0
- package/dist/plugin-sdk/src/auto-reply/fallback-state.d.ts +55 -0
- package/dist/plugin-sdk/src/auto-reply/group-activation.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/heartbeat-reply-payload.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/heartbeat.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/inbound-debounce.d.ts +18 -0
- package/dist/plugin-sdk/src/auto-reply/media-note.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/model-runtime.d.ts +17 -0
- package/dist/plugin-sdk/src/auto-reply/model.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.d.ts +22 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-primitives.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-projector.d.ts +21 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-reset-target.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-stream-settings.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-execution.d.ts +59 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-helpers.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-memory.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-payloads.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-reminder-guard.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-utils.d.ts +214 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner.d.ts +38 -0
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label-config.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/bash-command.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-pipeline.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-streaming.d.ts +38 -0
- package/dist/plugin-sdk/src/auto-reply/reply/body.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/btw-command.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/channel-context.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/command-gates.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/context.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/diagnostics.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/install-hints.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/lifecycle.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/runtime-options.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/shared.d.ts +95 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/targets.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-approve.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-bash.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-btw.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-compact.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-config.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context-report.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-export-session.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-info.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-mcp.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-models.d.ts +34 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-plugin.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-plugins.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-abort.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-store.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset-standard.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset.d.ts +34 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-slash-parse.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-status.d.ts +27 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-status.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-agents.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-focus.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-help.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-info.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-kill.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-list.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-log.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-send.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-spawn.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-unfocus.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/shared.d.ts +87 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-system-prompt.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-tts.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-types.d.ts +70 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-commands.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-value.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-write-authorization.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/debug-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.auth-profile.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.auth.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.defaults.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.fast-lane.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.impl.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.levels.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model-picker.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model-selection.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model.d.ts +44 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.params.d.ts +52 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.parse.d.ts +65 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.persist.d.ts +29 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.persist.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.shared.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-parsing.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directives.d.ts +44 -0
- package/dist/plugin-sdk/src/auto-reply/reply/discord-parent-channel.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp-delivery.d.ts +29 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-from-config.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatcher-registry.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-allowlist-matcher.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-unavailable.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/exec/directive.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/exec.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/followup-runner.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-apply.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-utils.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives.d.ts +93 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-inline-actions.d.ts +62 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-run.d.ts +69 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/groups.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/history.d.ts +72 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-context.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-dedupe.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-meta.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-text.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/line-directives.d.ts +22 -0
- package/dist/plugin-sdk/src/auto-reply/reply/matrix-context.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/mcp-commands.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/memory-flush.d.ts +63 -0
- package/dist/plugin-sdk/src/auto-reply/reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/message-preprocess-hooks.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/model-selection.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/reply/normalize-reply.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/origin-routing.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/plugins-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/post-compaction-context.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/provider-dispatcher.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/cleanup.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/directive.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/drain.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/enqueue.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/normalize.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/settings.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/state.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/types.d.ts +87 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue-policy.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-delivery.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-directives.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-dispatcher.d.ts +57 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-elevated.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-inline-whitespace.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-inline.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-media-paths.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-payloads.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-reference.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-tags.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-threading.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/response-prefix-template.d.ts +51 -0
- package/dist/plugin-sdk/src/auto-reply/reply/route-reply.d.ts +60 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-delivery.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-hooks.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-model.d.ts +25 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-prompt.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-run-accounting.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-updates.d.ts +35 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-usage.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/slack-directives.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/stage-sandbox-media.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/streaming-directives.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/strip-inbound-meta.d.ts +31 -0
- package/dist/plugin-sdk/src/auto-reply/reply/subagents-utils.d.ts +27 -0
- package/dist/plugin-sdk/src/auto-reply/reply/telegram-context.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing-mode.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing-policy.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing.d.ts +18 -0
- package/dist/plugin-sdk/src/auto-reply/reply/untrusted-context.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/send-policy.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands-base.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/status.d.ts +61 -0
- package/dist/plugin-sdk/src/auto-reply/templating.d.ts +190 -0
- package/dist/plugin-sdk/src/auto-reply/thinking.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/thinking.shared.d.ts +33 -0
- package/dist/plugin-sdk/src/auto-reply/tokens.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/tool-meta.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/types.d.ts +95 -0
- package/dist/plugin-sdk/src/bindings/records.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/bridge-auth-registry.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/bridge-server.d.ts +24 -0
- package/dist/plugin-sdk/src/browser/cdp-proxy-bypass.d.ts +31 -0
- package/dist/plugin-sdk/src/browser/cdp-timeouts.d.ts +26 -0
- package/dist/plugin-sdk/src/browser/cdp.d.ts +125 -0
- package/dist/plugin-sdk/src/browser/cdp.helpers.d.ts +29 -0
- package/dist/plugin-sdk/src/browser/chrome-mcp.d.ts +127 -0
- package/dist/plugin-sdk/src/browser/chrome-mcp.snapshot.d.ts +26 -0
- package/dist/plugin-sdk/src/browser/chrome.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/chrome.executables.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/chrome.profile-decoration.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/client-actions-core.d.ts +159 -0
- package/dist/plugin-sdk/src/browser/client-actions-observe.d.ts +68 -0
- package/dist/plugin-sdk/src/browser/client-actions-state.d.ts +93 -0
- package/dist/plugin-sdk/src/browser/client-actions-types.d.ts +18 -0
- package/dist/plugin-sdk/src/browser/client-actions-url.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/client-actions.d.ts +4 -0
- package/dist/plugin-sdk/src/browser/client-fetch.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/client.d.ts +157 -0
- package/dist/plugin-sdk/src/browser/config.d.ts +46 -0
- package/dist/plugin-sdk/src/browser/constants.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/control-auth.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/control-service.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/csrf.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/errors.d.ts +35 -0
- package/dist/plugin-sdk/src/browser/form-fields.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/http-auth.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/navigation-guard.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/output-atomic.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/paths.d.ts +61 -0
- package/dist/plugin-sdk/src/browser/profile-capabilities.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/profiles-service.d.ts +28 -0
- package/dist/plugin-sdk/src/browser/profiles.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/proxy-files.d.ts +7 -0
- package/dist/plugin-sdk/src/browser/pw-ai-module.d.ts +6 -0
- package/dist/plugin-sdk/src/browser/pw-ai-state.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/pw-ai.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/pw-role-snapshot.d.ts +35 -0
- package/dist/plugin-sdk/src/browser/pw-session.d.ts +164 -0
- package/dist/plugin-sdk/src/browser/pw-session.page-cdp.d.ts +9 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.activity.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.downloads.d.ts +34 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.interactions.d.ts +135 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.responses.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.shared.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.snapshot.d.ts +66 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.state.d.ts +46 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.storage.d.ts +47 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.trace.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/resolved-config-refresh.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.download.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.hooks.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.shared.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/routes/agent.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.debug.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.shared.d.ts +37 -0
- package/dist/plugin-sdk/src/browser/routes/agent.snapshot.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/routes/agent.snapshot.plan.d.ts +22 -0
- package/dist/plugin-sdk/src/browser/routes/agent.storage.d.ts +14 -0
- package/dist/plugin-sdk/src/browser/routes/basic.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/dispatcher.d.ts +16 -0
- package/dist/plugin-sdk/src/browser/routes/index.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/output-paths.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/routes/path-output.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/routes/tabs.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/types.d.ts +20 -0
- package/dist/plugin-sdk/src/browser/routes/utils.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/runtime-lifecycle.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/safe-filename.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/screenshot.d.ts +9 -0
- package/dist/plugin-sdk/src/browser/server-context.availability.d.ts +19 -0
- package/dist/plugin-sdk/src/browser/server-context.constants.d.ts +7 -0
- package/dist/plugin-sdk/src/browser/server-context.d.ts +4 -0
- package/dist/plugin-sdk/src/browser/server-context.reset.d.ts +20 -0
- package/dist/plugin-sdk/src/browser/server-context.selection.d.ts +16 -0
- package/dist/plugin-sdk/src/browser/server-context.tab-ops.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/server-context.types.d.ts +74 -0
- package/dist/plugin-sdk/src/browser/server-lifecycle.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/server-middleware.d.ts +6 -0
- package/dist/plugin-sdk/src/browser/session-tab-registry.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/snapshot-roles.d.ts +11 -0
- package/dist/plugin-sdk/src/browser/target-id.d.ts +11 -0
- package/dist/plugin-sdk/src/browser/trash.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/url-pattern.d.ts +1 -0
- package/dist/plugin-sdk/src/bundled-web-search-registry.d.ts +10 -0
- package/dist/plugin-sdk/src/channel-web.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/account-snapshot-fields.d.ts +10 -0
- package/dist/plugin-sdk/src/channels/account-summary.d.ts +28 -0
- package/dist/plugin-sdk/src/channels/ack-reactions.d.ts +29 -0
- package/dist/plugin-sdk/src/channels/allow-from.d.ts +16 -0
- package/dist/plugin-sdk/src/channels/allowlist-match.d.ts +42 -0
- package/dist/plugin-sdk/src/channels/allowlists/resolve-utils.d.ts +34 -0
- package/dist/plugin-sdk/src/channels/channel-config.d.ts +39 -0
- package/dist/plugin-sdk/src/channels/chat-type.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/command-gating.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/config-presence.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/conversation-label.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/draft-stream-controls.d.ts +54 -0
- package/dist/plugin-sdk/src/channels/draft-stream-loop.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/ids.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/inbound-debounce-policy.d.ts +18 -0
- package/dist/plugin-sdk/src/channels/location.d.ts +21 -0
- package/dist/plugin-sdk/src/channels/logging.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/mention-gating.d.ts +27 -0
- package/dist/plugin-sdk/src/channels/model-overrides.d.ts +18 -0
- package/dist/plugin-sdk/src/channels/native-command-session-targets.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/account-action-gate.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/account-helpers.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/acp-configured-binding-consumer.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/acp-stateful-target-driver.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/actions/reaction-message-id.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/actions/shared.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/allowlist-match.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-provider.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-registry.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-routing.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-targets.d.ts +33 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-types.d.ts +40 -0
- package/dist/plugin-sdk/src/channels/plugins/bluebubbles-actions.d.ts +48 -0
- package/dist/plugin-sdk/src/channels/plugins/channel-config.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/config-helpers.d.ts +25 -0
- package/dist/plugin-sdk/src/channels/plugins/config-schema.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/plugins/config-writes.d.ts +56 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-builtins.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-compiler.d.ts +11 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-consumers.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-match.d.ts +23 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-registry.d.ts +28 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-session-lookup.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-adapters.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-config-helpers.d.ts +69 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-types.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/exec-approval-local.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/group-policy-warnings.d.ts +126 -0
- package/dist/plugin-sdk/src/channels/plugins/helpers.d.ts +24 -0
- package/dist/plugin-sdk/src/channels/plugins/index.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/plugins/media-limits.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/plugins/media-payload.d.ts +15 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-discovery.d.ts +77 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-dispatch.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-names.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/message-capabilities.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/imessage.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/shared.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/signal.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/slack.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/whatsapp.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/direct-text-media.d.ts +39 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/interactive.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/load.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing-adapters.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing-message.d.ts +1 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing.d.ts +16 -0
- package/dist/plugin-sdk/src/channels/plugins/registry-loader.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/registry.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/plugins/runtime-forwarders.d.ts +26 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-group-access-configure.d.ts +22 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-group-access.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-helpers.d.ts +81 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-binary.d.ts +34 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-helpers.d.ts +441 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-proxy.d.ts +48 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-types.d.ts +107 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard.d.ts +267 -0
- package/dist/plugin-sdk/src/channels/plugins/stateful-target-builtins.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/stateful-target-drivers.d.ts +54 -0
- package/dist/plugin-sdk/src/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/status-issues/shared.d.ts +29 -0
- package/dist/plugin-sdk/src/channels/plugins/target-parsing.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/target-resolvers.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/threading-helpers.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/types.adapters.d.ts +557 -0
- package/dist/plugin-sdk/src/channels/plugins/types.core.d.ts +522 -0
- package/dist/plugin-sdk/src/channels/plugins/types.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/types.plugin.d.ts +58 -0
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-shared.d.ts +21 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.discord.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.slack.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.telegram.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/registry.d.ts +15 -0
- package/dist/plugin-sdk/src/channels/reply-prefix.d.ts +25 -0
- package/dist/plugin-sdk/src/channels/run-state-machine.d.ts +19 -0
- package/dist/plugin-sdk/src/channels/sender-label.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/session-envelope.d.ts +10 -0
- package/dist/plugin-sdk/src/channels/session-meta.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/session.d.ts +26 -0
- package/dist/plugin-sdk/src/channels/status-reactions.d.ts +66 -0
- package/dist/plugin-sdk/src/channels/targets.d.ts +57 -0
- package/dist/plugin-sdk/src/channels/thread-binding-id.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/thread-bindings-messages.d.ts +19 -0
- package/dist/plugin-sdk/src/channels/thread-bindings-policy.d.ts +68 -0
- package/dist/plugin-sdk/src/channels/transport/stall-watchdog.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/typing-lifecycle.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/typing-start-guard.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/typing.d.ts +18 -0
- package/dist/plugin-sdk/src/cli/argv.d.ts +27 -0
- package/dist/plugin-sdk/src/cli/cli-name.d.ts +3 -0
- package/dist/plugin-sdk/src/cli/cli-utils.d.ts +19 -0
- package/dist/plugin-sdk/src/cli/command-format.d.ts +1 -0
- package/dist/plugin-sdk/src/cli/command-secret-gateway.d.ts +19 -0
- package/dist/plugin-sdk/src/cli/command-secret-targets.d.ts +16 -0
- package/dist/plugin-sdk/src/cli/deps.d.ts +11 -0
- package/dist/plugin-sdk/src/cli/help-format.d.ts +5 -0
- package/dist/plugin-sdk/src/cli/memory-cli.d.ts +12 -0
- package/dist/plugin-sdk/src/cli/message-secret-scope.d.ts +11 -0
- package/dist/plugin-sdk/src/cli/nodes-camera.d.ts +51 -0
- package/dist/plugin-sdk/src/cli/nodes-canvas.d.ts +10 -0
- package/dist/plugin-sdk/src/cli/nodes-media-utils.d.ts +13 -0
- package/dist/plugin-sdk/src/cli/nodes-run.d.ts +3 -0
- package/dist/plugin-sdk/src/cli/nodes-screen.d.ts +18 -0
- package/dist/plugin-sdk/src/cli/outbound-send-deps.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/outbound-send-mapping.d.ts +13 -0
- package/dist/plugin-sdk/src/cli/parse-bytes.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/parse-duration.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/parse-timeout.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/profile-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/cli/progress.d.ts +24 -0
- package/dist/plugin-sdk/src/cli/prompt.d.ts +1 -0
- package/dist/plugin-sdk/src/cli/send-runtime/discord.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/imessage.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/signal.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/slack.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/telegram.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/whatsapp.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/wait.d.ts +1 -0
- package/dist/plugin-sdk/src/commands/backup-shared.d.ts +32 -0
- package/dist/plugin-sdk/src/commands/chutes-oauth.d.ts +21 -0
- package/dist/plugin-sdk/src/commands/cleanup-utils.d.ts +36 -0
- package/dist/plugin-sdk/src/commands/daemon-runtime.d.ts +8 -0
- package/dist/plugin-sdk/src/commands/health.d.ts +63 -0
- package/dist/plugin-sdk/src/commands/models/shared.d.ts +58 -0
- package/dist/plugin-sdk/src/commands/onboard-types.d.ts +92 -0
- package/dist/plugin-sdk/src/compat/legacy-names.d.ts +8 -0
- package/dist/plugin-sdk/src/config/agent-dirs.d.ts +14 -0
- package/dist/plugin-sdk/src/config/agent-limits.d.ts +6 -0
- package/dist/plugin-sdk/src/config/allowed-values.d.ts +7 -0
- package/dist/plugin-sdk/src/config/backup-rotation.d.ts +32 -0
- package/dist/plugin-sdk/src/config/bindings.d.ts +8 -0
- package/dist/plugin-sdk/src/config/byte-size.d.ts +6 -0
- package/dist/plugin-sdk/src/config/cache-utils.d.ts +10 -0
- package/dist/plugin-sdk/src/config/channel-capabilities.d.ts +6 -0
- package/dist/plugin-sdk/src/config/channel-configured.d.ts +2 -0
- package/dist/plugin-sdk/src/config/commands.d.ts +25 -0
- package/dist/plugin-sdk/src/config/config-paths.d.ts +10 -0
- package/dist/plugin-sdk/src/config/config.d.ts +6 -0
- package/dist/plugin-sdk/src/config/dangerous-name-matching.d.ts +12 -0
- package/dist/plugin-sdk/src/config/defaults.d.ts +18 -0
- package/dist/plugin-sdk/src/config/discord-preview-streaming.d.ts +27 -0
- package/dist/plugin-sdk/src/config/env-preserve.d.ts +10 -0
- package/dist/plugin-sdk/src/config/env-substitution.d.ts +45 -0
- package/dist/plugin-sdk/src/config/env-vars.d.ts +7 -0
- package/dist/plugin-sdk/src/config/gateway-control-ui-origins.d.ts +21 -0
- package/dist/plugin-sdk/src/config/group-policy.d.ts +49 -0
- package/dist/plugin-sdk/src/config/includes.d.ts +43 -0
- package/dist/plugin-sdk/src/config/io.d.ts +79 -0
- package/dist/plugin-sdk/src/config/issue-format.d.ts +14 -0
- package/dist/plugin-sdk/src/config/legacy-migrate.d.ts +5 -0
- package/dist/plugin-sdk/src/config/legacy-web-search.d.ts +8 -0
- package/dist/plugin-sdk/src/config/legacy.d.ts +6 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.d.ts +1 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-1.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-2.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-3.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.rules.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.shared.d.ts +20 -0
- package/dist/plugin-sdk/src/config/logging.d.ts +8 -0
- package/dist/plugin-sdk/src/config/markdown-tables.d.ts +8 -0
- package/dist/plugin-sdk/src/config/mcp-config.d.ts +33 -0
- package/dist/plugin-sdk/src/config/merge-patch.d.ts +5 -0
- package/dist/plugin-sdk/src/config/model-input.d.ts +9 -0
- package/dist/plugin-sdk/src/config/normalize-exec-safe-bin.d.ts +2 -0
- package/dist/plugin-sdk/src/config/normalize-paths.d.ts +8 -0
- package/dist/plugin-sdk/src/config/paths.d.ts +57 -0
- package/dist/plugin-sdk/src/config/plugin-auto-enable.d.ts +14 -0
- package/dist/plugin-sdk/src/config/plugins-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/src/config/port-defaults.d.ts +13 -0
- package/dist/plugin-sdk/src/config/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/src/config/runtime-group-policy.d.ts +56 -0
- package/dist/plugin-sdk/src/config/runtime-overrides.d.ts +15 -0
- package/dist/plugin-sdk/src/config/sessions/artifacts.d.ts +5 -0
- package/dist/plugin-sdk/src/config/sessions/delivery-info.d.ts +16 -0
- package/dist/plugin-sdk/src/config/sessions/disk-budget.d.ts +28 -0
- package/dist/plugin-sdk/src/config/sessions/explicit-session-key-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/config/sessions/group.d.ts +11 -0
- package/dist/plugin-sdk/src/config/sessions/main-session.d.ts +42 -0
- package/dist/plugin-sdk/src/config/sessions/main-session.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/config/sessions/metadata.d.ts +16 -0
- package/dist/plugin-sdk/src/config/sessions/paths.d.ts +23 -0
- package/dist/plugin-sdk/src/config/sessions/reset.d.ts +43 -0
- package/dist/plugin-sdk/src/config/sessions/session-file.d.ts +15 -0
- package/dist/plugin-sdk/src/config/sessions/session-key.d.ts +8 -0
- package/dist/plugin-sdk/src/config/sessions/store-cache.d.ts +19 -0
- package/dist/plugin-sdk/src/config/sessions/store-maintenance.d.ts +62 -0
- package/dist/plugin-sdk/src/config/sessions/store-migrations.d.ts +2 -0
- package/dist/plugin-sdk/src/config/sessions/store-summary.d.ts +6 -0
- package/dist/plugin-sdk/src/config/sessions/store.d.ts +91 -0
- package/dist/plugin-sdk/src/config/sessions/store.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/config/sessions/targets.d.ts +19 -0
- package/dist/plugin-sdk/src/config/sessions/transcript.d.ts +33 -0
- package/dist/plugin-sdk/src/config/sessions/types.d.ts +259 -0
- package/dist/plugin-sdk/src/config/sessions.d.ts +15 -0
- package/dist/plugin-sdk/src/config/talk.d.ts +18 -0
- package/dist/plugin-sdk/src/config/telegram-custom-commands.d.ts +24 -0
- package/dist/plugin-sdk/src/config/types.acp.d.ts +44 -0
- package/dist/plugin-sdk/src/config/types.agent-defaults.d.ts +354 -0
- package/dist/plugin-sdk/src/config/types.agents-shared.d.ts +33 -0
- package/dist/plugin-sdk/src/config/types.agents.d.ts +94 -0
- package/dist/plugin-sdk/src/config/types.approvals.d.ts +26 -0
- package/dist/plugin-sdk/src/config/types.auth.d.ts +28 -0
- package/dist/plugin-sdk/src/config/types.base.d.ts +216 -0
- package/dist/plugin-sdk/src/config/types.browser.d.ts +71 -0
- package/dist/plugin-sdk/src/config/types.channel-messaging-common.d.ts +46 -0
- package/dist/plugin-sdk/src/config/types.channels.d.ts +63 -0
- package/dist/plugin-sdk/src/config/types.cli.d.ts +12 -0
- package/dist/plugin-sdk/src/config/types.cron.d.ts +55 -0
- package/dist/plugin-sdk/src/config/types.d.ts +34 -0
- package/dist/plugin-sdk/src/config/types.discord.d.ts +345 -0
- package/dist/plugin-sdk/src/config/types.gateway.d.ts +416 -0
- package/dist/plugin-sdk/src/config/types.googlechat.d.ts +115 -0
- package/dist/plugin-sdk/src/config/types.hooks.d.ts +123 -0
- package/dist/plugin-sdk/src/config/types.imessage.d.ts +81 -0
- package/dist/plugin-sdk/src/config/types.installs.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.irc.d.ts +56 -0
- package/dist/plugin-sdk/src/config/types.mcp.d.ts +13 -0
- package/dist/plugin-sdk/src/config/types.memory.d.ts +59 -0
- package/dist/plugin-sdk/src/config/types.messages.d.ts +163 -0
- package/dist/plugin-sdk/src/config/types.models.d.ts +57 -0
- package/dist/plugin-sdk/src/config/types.msteams.d.ts +111 -0
- package/dist/plugin-sdk/src/config/types.node-host.d.ts +10 -0
- package/dist/plugin-sdk/src/config/types.openclaw.d.ts +141 -0
- package/dist/plugin-sdk/src/config/types.plugins.d.ts +46 -0
- package/dist/plugin-sdk/src/config/types.queue.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.sandbox.d.ts +122 -0
- package/dist/plugin-sdk/src/config/types.secrets.d.ts +90 -0
- package/dist/plugin-sdk/src/config/types.signal.d.ts +58 -0
- package/dist/plugin-sdk/src/config/types.skills.d.ts +42 -0
- package/dist/plugin-sdk/src/config/types.slack.d.ts +190 -0
- package/dist/plugin-sdk/src/config/types.telegram.d.ts +271 -0
- package/dist/plugin-sdk/src/config/types.tools.d.ts +567 -0
- package/dist/plugin-sdk/src/config/types.tts.d.ts +97 -0
- package/dist/plugin-sdk/src/config/types.whatsapp.d.ts +105 -0
- package/dist/plugin-sdk/src/config/validation.d.ts +35 -0
- package/dist/plugin-sdk/src/config/version.d.ts +8 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-defaults.d.ts +387 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-model.d.ts +5 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-runtime.d.ts +1571 -0
- package/dist/plugin-sdk/src/config/zod-schema.agents.d.ts +803 -0
- package/dist/plugin-sdk/src/config/zod-schema.allowdeny.d.ts +13 -0
- package/dist/plugin-sdk/src/config/zod-schema.approvals.d.ts +15 -0
- package/dist/plugin-sdk/src/config/zod-schema.channels.d.ts +9 -0
- package/dist/plugin-sdk/src/config/zod-schema.core.d.ts +979 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +5313 -0
- package/dist/plugin-sdk/src/config/zod-schema.hooks.d.ts +85 -0
- package/dist/plugin-sdk/src/config/zod-schema.installs.d.ts +34 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers-core.d.ts +4992 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers-whatsapp.d.ts +245 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers.d.ts +2923 -0
- package/dist/plugin-sdk/src/config/zod-schema.secret-input-validation.d.ts +24 -0
- package/dist/plugin-sdk/src/config/zod-schema.sensitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.session.d.ts +277 -0
- package/dist/plugin-sdk/src/context-engine/delegate.d.ts +15 -0
- package/dist/plugin-sdk/src/context-engine/index.d.ts +6 -0
- package/dist/plugin-sdk/src/context-engine/init.d.ts +1 -0
- package/dist/plugin-sdk/src/context-engine/legacy.d.ts +50 -0
- package/dist/plugin-sdk/src/context-engine/registry.d.ts +47 -0
- package/dist/plugin-sdk/src/context-engine/types.d.ts +206 -0
- package/dist/plugin-sdk/src/cron/delivery.d.ts +32 -0
- package/dist/plugin-sdk/src/cron/isolated-agent/delivery-target.d.ts +26 -0
- package/dist/plugin-sdk/src/cron/legacy-delivery.d.ts +15 -0
- package/dist/plugin-sdk/src/cron/normalize.d.ts +13 -0
- package/dist/plugin-sdk/src/cron/parse.d.ts +1 -0
- package/dist/plugin-sdk/src/cron/payload-migration.d.ts +3 -0
- package/dist/plugin-sdk/src/cron/schedule.d.ts +6 -0
- package/dist/plugin-sdk/src/cron/service/initial-delivery.d.ts +3 -0
- package/dist/plugin-sdk/src/cron/service/jobs.d.ts +32 -0
- package/dist/plugin-sdk/src/cron/service/locked.d.ts +2 -0
- package/dist/plugin-sdk/src/cron/service/normalize.d.ts +18 -0
- package/dist/plugin-sdk/src/cron/service/ops.d.ts +84 -0
- package/dist/plugin-sdk/src/cron/service/state.d.ts +158 -0
- package/dist/plugin-sdk/src/cron/service/store.d.ts +11 -0
- package/dist/plugin-sdk/src/cron/service/timeout-policy.d.ts +13 -0
- package/dist/plugin-sdk/src/cron/service/timer.d.ts +45 -0
- package/dist/plugin-sdk/src/cron/service.d.ts +69 -0
- package/dist/plugin-sdk/src/cron/session-reaper.d.ts +35 -0
- package/dist/plugin-sdk/src/cron/stagger.d.ts +8 -0
- package/dist/plugin-sdk/src/cron/store-migration.d.ts +9 -0
- package/dist/plugin-sdk/src/cron/store.d.ts +10 -0
- package/dist/plugin-sdk/src/cron/types-shared.d.ts +17 -0
- package/dist/plugin-sdk/src/cron/types.d.ts +142 -0
- package/dist/plugin-sdk/src/cron/webhook-url.d.ts +1 -0
- package/dist/plugin-sdk/src/daemon/arg-split.d.ts +4 -0
- package/dist/plugin-sdk/src/daemon/cmd-argv.d.ts +3 -0
- package/dist/plugin-sdk/src/daemon/cmd-set.d.ts +7 -0
- package/dist/plugin-sdk/src/daemon/constants.d.ts +35 -0
- package/dist/plugin-sdk/src/daemon/runtime-binary.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/auth-mode-policy.d.ts +4 -0
- package/dist/plugin-sdk/src/gateway/auth-rate-limit.d.ts +67 -0
- package/dist/plugin-sdk/src/gateway/auth.d.ts +62 -0
- package/dist/plugin-sdk/src/gateway/call.d.ts +88 -0
- package/dist/plugin-sdk/src/gateway/channel-status-patches.d.ts +6 -0
- package/dist/plugin-sdk/src/gateway/chat-abort.d.ts +46 -0
- package/dist/plugin-sdk/src/gateway/chat-sanitize.d.ts +4 -0
- package/dist/plugin-sdk/src/gateway/client.d.ts +83 -0
- package/dist/plugin-sdk/src/gateway/connection-auth.d.ts +28 -0
- package/dist/plugin-sdk/src/gateway/credential-planner.d.ts +53 -0
- package/dist/plugin-sdk/src/gateway/credentials.d.ts +52 -0
- package/dist/plugin-sdk/src/gateway/device-auth.d.ts +18 -0
- package/dist/plugin-sdk/src/gateway/device-metadata-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/exec-approval-manager.d.ts +47 -0
- package/dist/plugin-sdk/src/gateway/method-scopes.d.ts +22 -0
- package/dist/plugin-sdk/src/gateway/model-pricing-cache.d.ts +32 -0
- package/dist/plugin-sdk/src/gateway/net.d.ts +88 -0
- package/dist/plugin-sdk/src/gateway/node-registry.d.ts +60 -0
- package/dist/plugin-sdk/src/gateway/operator-approvals-client.d.ts +6 -0
- package/dist/plugin-sdk/src/gateway/protocol/client-info.d.ts +58 -0
- package/dist/plugin-sdk/src/gateway/protocol/connect-error-details.d.ts +38 -0
- package/dist/plugin-sdk/src/gateway/protocol/index.d.ts +874 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/agent.d.ts +119 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/agents-models-skills.d.ts +206 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/channels.d.ts +229 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/config.d.ts +110 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/cron.d.ts +455 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/devices.d.ts +42 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/error-codes.d.ts +14 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/exec-approvals.d.ts +184 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/frames.d.ts +169 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/logs-chat.d.ts +53 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/nodes.d.ts +111 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/primitives.d.ts +40 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/protocol-schemas.d.ts +1601 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/push.d.ts +16 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/secrets.d.ts +23 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/sessions.d.ts +112 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/snapshot.d.ts +69 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/types.d.ts +137 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/wizard.d.ts +86 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema.d.ts +18 -0
- package/dist/plugin-sdk/src/gateway/resolve-configured-secret-input-string.d.ts +33 -0
- package/dist/plugin-sdk/src/gateway/security-path.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/server/ws-types.d.ts +12 -0
- package/dist/plugin-sdk/src/gateway/server-broadcast.d.ts +17 -0
- package/dist/plugin-sdk/src/gateway/server-channels.d.ts +66 -0
- package/dist/plugin-sdk/src/gateway/server-constants.d.ts +11 -0
- package/dist/plugin-sdk/src/gateway/server-methods/types.d.ts +102 -0
- package/dist/plugin-sdk/src/gateway/server-shared.d.ts +7 -0
- package/dist/plugin-sdk/src/gateway/session-archive.fs.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/session-utils.d.ts +108 -0
- package/dist/plugin-sdk/src/gateway/session-utils.fs.d.ts +33 -0
- package/dist/plugin-sdk/src/gateway/session-utils.types.d.ts +76 -0
- package/dist/plugin-sdk/src/gateway/startup-auth.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/ws-log.d.ts +5 -0
- package/dist/plugin-sdk/src/gateway/ws-logging.d.ts +4 -0
- package/dist/plugin-sdk/src/globals.d.ts +11 -0
- package/dist/plugin-sdk/src/hooks/fire-and-forget.d.ts +1 -0
- package/dist/plugin-sdk/src/hooks/internal-hooks.d.ts +216 -0
- package/dist/plugin-sdk/src/hooks/message-hook-mappers.d.ts +76 -0
- package/dist/plugin-sdk/src/hooks/types.d.ts +62 -0
- package/dist/plugin-sdk/src/image-generation/provider-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/image-generation/providers/fal.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/providers/google.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/runtime.d.ts +27 -0
- package/dist/plugin-sdk/src/image-generation/types.d.ts +64 -0
- package/dist/plugin-sdk/src/infra/abort-signal.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/agent-events.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/archive-path.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/archive-staging.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/archive.d.ts +53 -0
- package/dist/plugin-sdk/src/infra/backoff.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/backup-create.d.ts +29 -0
- package/dist/plugin-sdk/src/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/boundary-file-read.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/boundary-path.d.ts +38 -0
- package/dist/plugin-sdk/src/infra/brew.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/channel-activity.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/channel-summary.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/cli-root-options.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/dedupe.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/device-auth-store.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/device-bootstrap.d.ts +41 -0
- package/dist/plugin-sdk/src/infra/device-identity.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/device-pairing.d.ts +126 -0
- package/dist/plugin-sdk/src/infra/diagnostic-events.d.ts +140 -0
- package/dist/plugin-sdk/src/infra/diagnostic-flags.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/dotenv.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/env.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/errors.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/exec-allowlist-pattern.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/exec-approval-command-display.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/exec-approval-reply.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/exec-approval-session-target.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/exec-approval-surface.d.ts +20 -0
- package/dist/plugin-sdk/src/infra/exec-approvals-allowlist.d.ts +64 -0
- package/dist/plugin-sdk/src/infra/exec-approvals-analysis.d.ts +79 -0
- package/dist/plugin-sdk/src/infra/exec-approvals.d.ts +147 -0
- package/dist/plugin-sdk/src/infra/exec-command-resolution.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/exec-obfuscation-detect.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-profiles.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-validator.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-runtime-policy.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-trust.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/exec-safety.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/exec-wrapper-resolution.d.ts +48 -0
- package/dist/plugin-sdk/src/infra/executable-path.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/fetch.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/file-identity.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/file-lock.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/format-time/format-datetime.d.ts +35 -0
- package/dist/plugin-sdk/src/infra/format-time/format-duration.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/format-time/format-relative.d.ts +39 -0
- package/dist/plugin-sdk/src/infra/fs-pinned-write-helper.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/fs-safe.d.ts +87 -0
- package/dist/plugin-sdk/src/infra/gemini-auth.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/git-commit.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/git-root.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/hardlink-guards.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/heartbeat-events.d.ts +22 -0
- package/dist/plugin-sdk/src/infra/heartbeat-reason.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/heartbeat-summary.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/heartbeat-visibility.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/heartbeat-wake.d.ts +33 -0
- package/dist/plugin-sdk/src/infra/home-dir.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/host-env-security.d.ts +40 -0
- package/dist/plugin-sdk/src/infra/http-body.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/json-file.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/json-files.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/json-utf8-bytes.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/jsonl-socket.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/machine-name.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/map-size.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/matrix-legacy-crypto.d.ts +41 -0
- package/dist/plugin-sdk/src/infra/matrix-legacy-state.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/matrix-migration-config.d.ts +48 -0
- package/dist/plugin-sdk/src/infra/matrix-migration-snapshot.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/matrix-plugin-helper.d.ts +29 -0
- package/dist/plugin-sdk/src/infra/net/fetch-guard.d.ts +37 -0
- package/dist/plugin-sdk/src/infra/net/hostname.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/net/proxy-env.d.ts +10 -0
- package/dist/plugin-sdk/src/infra/net/proxy-fetch.d.ts +15 -0
- package/dist/plugin-sdk/src/infra/net/ssrf.d.ts +55 -0
- package/dist/plugin-sdk/src/infra/net/undici-global-dispatcher.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/node-pairing.d.ts +53 -0
- package/dist/plugin-sdk/src/infra/node-shell.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/npm-registry-spec.d.ts +19 -0
- package/dist/plugin-sdk/src/infra/openclaw-exec-env.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/openclaw-root.d.ts +10 -0
- package/dist/plugin-sdk/src/infra/outbound/abort.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/outbound/agent-delivery.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/outbound/base-session-key.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/outbound/bound-delivery-router.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-adapters.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-resolution.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-selection.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-target.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/conversation-id.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/outbound/deliver-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/outbound/deliver.d.ts +49 -0
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue.d.ts +89 -0
- package/dist/plugin-sdk/src/infra/outbound/directory-cache.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/outbound/envelope.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/outbound/format.d.ts +39 -0
- package/dist/plugin-sdk/src/infra/outbound/identity.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-normalization.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-params.d.ts +36 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-runner.d.ts +76 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-spec.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/outbound/message.d.ts +84 -0
- package/dist/plugin-sdk/src/infra/outbound/mirror.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-policy.d.ts +32 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-send-service.d.ts +65 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-session.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/outbound/payloads.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/outbound/sanitize-text.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/outbound/send-deps.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/outbound/session-binding-service.d.ts +90 -0
- package/dist/plugin-sdk/src/infra/outbound/session-context.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/outbound/target-errors.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/target-normalization.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/outbound/target-resolver.d.ts +60 -0
- package/dist/plugin-sdk/src/infra/outbound/targets.d.ts +87 -0
- package/dist/plugin-sdk/src/infra/outbound/thread-id.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/outbound/tool-payload.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/pairing-files.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/pairing-pending.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/pairing-token.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/parse-finite-number.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/path-alias-guards.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/path-guards.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/path-prepend.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/path-safety.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/plain-object.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/ports-format.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/ports-inspect.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ports-lsof.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ports-probe.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/ports-types.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/ports.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/provider-usage.auth.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.claude.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.codex.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.gemini.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.minimax.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.shared.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.zai.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.format.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/provider-usage.load.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/provider-usage.shared.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/provider-usage.types.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/restart-sentinel.d.ts +50 -0
- package/dist/plugin-sdk/src/infra/restart-stale-pids.d.ts +22 -0
- package/dist/plugin-sdk/src/infra/restart.d.ts +72 -0
- package/dist/plugin-sdk/src/infra/retry-policy.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/retry.d.ts +21 -0
- package/dist/plugin-sdk/src/infra/safe-open-sync.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/scp-host.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/secret-file.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/secure-random.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/session-cost-usage.d.ts +45 -0
- package/dist/plugin-sdk/src/infra/session-cost-usage.types.d.ts +141 -0
- package/dist/plugin-sdk/src/infra/session-maintenance-warning.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/shell-env.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/shell-inline-command.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/skills-remote.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/ssh-tunnel.d.ts +21 -0
- package/dist/plugin-sdk/src/infra/system-events.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/system-message.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/system-run-approval-binding.d.ts +49 -0
- package/dist/plugin-sdk/src/infra/system-run-approval-context.d.ts +45 -0
- package/dist/plugin-sdk/src/infra/system-run-command.d.ts +36 -0
- package/dist/plugin-sdk/src/infra/system-run-normalize.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/tailnet.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/tailscale.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/tls/fingerprint.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/tls/gateway.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/tmp-openclaw-dir.d.ts +20 -0
- package/dist/plugin-sdk/src/infra/transport-ready.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/unhandled-rejections.d.ts +15 -0
- package/dist/plugin-sdk/src/infra/warning-filter.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/windows-task-restart.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ws.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/wsl.d.ts +12 -0
- package/dist/plugin-sdk/src/interactive/payload.d.ts +53 -0
- package/dist/plugin-sdk/src/line/accounts.d.ts +10 -0
- package/dist/plugin-sdk/src/line/actions.d.ts +22 -0
- package/dist/plugin-sdk/src/line/auto-reply-delivery.d.ts +38 -0
- package/dist/plugin-sdk/src/line/bot-access.d.ts +17 -0
- package/dist/plugin-sdk/src/line/bot-handlers.d.ts +23 -0
- package/dist/plugin-sdk/src/line/bot-message-context.d.ts +129 -0
- package/dist/plugin-sdk/src/line/bot.d.ts +24 -0
- package/dist/plugin-sdk/src/line/channel-access-token.d.ts +4 -0
- package/dist/plugin-sdk/src/line/config-schema.d.ts +65 -0
- package/dist/plugin-sdk/src/line/download.d.ts +7 -0
- package/dist/plugin-sdk/src/line/flex-templates/basic-cards.d.ts +46 -0
- package/dist/plugin-sdk/src/line/flex-templates/common.d.ts +2 -0
- package/dist/plugin-sdk/src/line/flex-templates/media-control-cards.d.ts +73 -0
- package/dist/plugin-sdk/src/line/flex-templates/message.d.ts +6 -0
- package/dist/plugin-sdk/src/line/flex-templates/schedule-cards.d.ts +55 -0
- package/dist/plugin-sdk/src/line/flex-templates/types.d.ts +19 -0
- package/dist/plugin-sdk/src/line/flex-templates.d.ts +5 -0
- package/dist/plugin-sdk/src/line/group-keys.d.ts +17 -0
- package/dist/plugin-sdk/src/line/markdown-to-line.d.ts +72 -0
- package/dist/plugin-sdk/src/line/monitor.d.ts +28 -0
- package/dist/plugin-sdk/src/line/probe.d.ts +2 -0
- package/dist/plugin-sdk/src/line/reply-chunks.d.ts +24 -0
- package/dist/plugin-sdk/src/line/send.d.ts +93 -0
- package/dist/plugin-sdk/src/line/signature.d.ts +1 -0
- package/dist/plugin-sdk/src/line/template-messages.d.ts +100 -0
- package/dist/plugin-sdk/src/line/types.d.ts +115 -0
- package/dist/plugin-sdk/src/line/webhook-node.d.ts +15 -0
- package/dist/plugin-sdk/src/line/webhook-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/line/webhook.d.ts +19 -0
- package/dist/plugin-sdk/src/link-understanding/apply.d.ts +10 -0
- package/dist/plugin-sdk/src/link-understanding/apply.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/link-understanding/defaults.d.ts +2 -0
- package/dist/plugin-sdk/src/link-understanding/detect.d.ts +3 -0
- package/dist/plugin-sdk/src/link-understanding/format.d.ts +4 -0
- package/dist/plugin-sdk/src/link-understanding/runner.d.ts +11 -0
- package/dist/plugin-sdk/src/logger.d.ts +6 -0
- package/dist/plugin-sdk/src/logging/config.d.ts +4 -0
- package/dist/plugin-sdk/src/logging/console.d.ts +23 -0
- package/dist/plugin-sdk/src/logging/diagnostic-session-state.d.ts +30 -0
- package/dist/plugin-sdk/src/logging/diagnostic.d.ts +67 -0
- package/dist/plugin-sdk/src/logging/env-log-level.d.ts +2 -0
- package/dist/plugin-sdk/src/logging/levels.d.ts +5 -0
- package/dist/plugin-sdk/src/logging/logger.d.ts +48 -0
- package/dist/plugin-sdk/src/logging/node-require.d.ts +1 -0
- package/dist/plugin-sdk/src/logging/redact-bounded.d.ts +8 -0
- package/dist/plugin-sdk/src/logging/redact-identifier.d.ts +4 -0
- package/dist/plugin-sdk/src/logging/redact.d.ts +9 -0
- package/dist/plugin-sdk/src/logging/state.d.ts +19 -0
- package/dist/plugin-sdk/src/logging/subsystem.d.ts +18 -0
- package/dist/plugin-sdk/src/logging/timestamps.d.ts +2 -0
- package/dist/plugin-sdk/src/logging.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/code-spans.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/fences.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/frontmatter.d.ts +2 -0
- package/dist/plugin-sdk/src/markdown/ir.d.ts +32 -0
- package/dist/plugin-sdk/src/markdown/render.d.ts +18 -0
- package/dist/plugin-sdk/src/markdown/tables.d.ts +2 -0
- package/dist/plugin-sdk/src/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/src/media/audio-tags.d.ts +10 -0
- package/dist/plugin-sdk/src/media/audio.d.ts +19 -0
- package/dist/plugin-sdk/src/media/base64.d.ts +6 -0
- package/dist/plugin-sdk/src/media/constants.d.ts +7 -0
- package/dist/plugin-sdk/src/media/fetch.d.ts +34 -0
- package/dist/plugin-sdk/src/media/ffmpeg-exec.d.ts +11 -0
- package/dist/plugin-sdk/src/media/ffmpeg-limits.d.ts +4 -0
- package/dist/plugin-sdk/src/media/file-context.d.ts +7 -0
- package/dist/plugin-sdk/src/media/image-ops.d.ts +41 -0
- package/dist/plugin-sdk/src/media/inbound-path-policy.d.ts +18 -0
- package/dist/plugin-sdk/src/media/input-files.d.ts +99 -0
- package/dist/plugin-sdk/src/media/load-options.d.ts +12 -0
- package/dist/plugin-sdk/src/media/local-roots.d.ts +3 -0
- package/dist/plugin-sdk/src/media/mime.d.ts +16 -0
- package/dist/plugin-sdk/src/media/outbound-attachment.d.ts +6 -0
- package/dist/plugin-sdk/src/media/parse.d.ts +8 -0
- package/dist/plugin-sdk/src/media/pdf-extract.d.ts +17 -0
- package/dist/plugin-sdk/src/media/png-encode.d.ts +8 -0
- package/dist/plugin-sdk/src/media/read-response-with-limit.d.ts +8 -0
- package/dist/plugin-sdk/src/media/sniff-mime-from-base64.d.ts +1 -0
- package/dist/plugin-sdk/src/media/store.d.ts +37 -0
- package/dist/plugin-sdk/src/media/temp-files.d.ts +1 -0
- package/dist/plugin-sdk/src/media/web-media.d.ts +43 -0
- package/dist/plugin-sdk/src/media-understanding/apply.d.ts +19 -0
- package/dist/plugin-sdk/src/media-understanding/apply.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.cache.d.ts +37 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.d.ts +3 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.normalize.d.ts +8 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.select.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/src/media-understanding/audio-transcription-runner.d.ts +16 -0
- package/dist/plugin-sdk/src/media-understanding/concurrency.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/defaults.d.ts +20 -0
- package/dist/plugin-sdk/src/media-understanding/echo-transcript.d.ts +13 -0
- package/dist/plugin-sdk/src/media-understanding/errors.d.ts +6 -0
- package/dist/plugin-sdk/src/media-understanding/format.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/fs.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/output-extract.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/audio.d.ts +4 -0
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/index.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/groq/index.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/image-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/image.d.ts +3 -0
- package/dist/plugin-sdk/src/media-understanding/providers/index.d.ts +5 -0
- package/dist/plugin-sdk/src/media-understanding/providers/openai-compatible-audio.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/providers/shared.d.ts +28 -0
- package/dist/plugin-sdk/src/media-understanding/resolve.d.ts +44 -0
- package/dist/plugin-sdk/src/media-understanding/runner.d.ts +39 -0
- package/dist/plugin-sdk/src/media-understanding/runner.entries.d.ts +33 -0
- package/dist/plugin-sdk/src/media-understanding/runtime.d.ts +52 -0
- package/dist/plugin-sdk/src/media-understanding/scope.d.ts +9 -0
- package/dist/plugin-sdk/src/media-understanding/transcribe-audio.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/types.d.ts +115 -0
- package/dist/plugin-sdk/src/media-understanding/video.d.ts +2 -0
- package/dist/plugin-sdk/src/memory/backend-config.d.ts +55 -0
- package/dist/plugin-sdk/src/memory/batch-embedding-common.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/batch-error-utils.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/batch-gemini.d.ts +46 -0
- package/dist/plugin-sdk/src/memory/batch-http.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/batch-openai.d.ts +19 -0
- package/dist/plugin-sdk/src/memory/batch-output.d.ts +23 -0
- package/dist/plugin-sdk/src/memory/batch-provider-common.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/batch-runner.d.ts +38 -0
- package/dist/plugin-sdk/src/memory/batch-status.d.ts +27 -0
- package/dist/plugin-sdk/src/memory/batch-upload.d.ts +6 -0
- package/dist/plugin-sdk/src/memory/batch-utils.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/batch-voyage.d.ts +20 -0
- package/dist/plugin-sdk/src/memory/embedding-chunk-limits.d.ts +3 -0
- package/dist/plugin-sdk/src/memory/embedding-input-limits.d.ts +4 -0
- package/dist/plugin-sdk/src/memory/embedding-inputs.d.ts +17 -0
- package/dist/plugin-sdk/src/memory/embedding-model-limits.d.ts +2 -0
- package/dist/plugin-sdk/src/memory/embedding-vectors.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/embeddings-debug.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/embeddings-gemini.d.ts +63 -0
- package/dist/plugin-sdk/src/memory/embeddings-mistral.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings-model-normalize.d.ts +5 -0
- package/dist/plugin-sdk/src/memory/embeddings-ollama.d.ts +14 -0
- package/dist/plugin-sdk/src/memory/embeddings-openai.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-client.d.ts +12 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-fetch.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-provider.d.ts +21 -0
- package/dist/plugin-sdk/src/memory/embeddings-voyage.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings.d.ts +58 -0
- package/dist/plugin-sdk/src/memory/fs-utils.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/hybrid.d.ts +45 -0
- package/dist/plugin-sdk/src/memory/index.d.ts +3 -0
- package/dist/plugin-sdk/src/memory/internal.d.ts +51 -0
- package/dist/plugin-sdk/src/memory/manager-embedding-ops.d.ts +49 -0
- package/dist/plugin-sdk/src/memory/manager-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/manager-search.d.ts +60 -0
- package/dist/plugin-sdk/src/memory/manager-sync-ops.d.ts +147 -0
- package/dist/plugin-sdk/src/memory/manager.d.ts +122 -0
- package/dist/plugin-sdk/src/memory/memory-schema.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/mmr.d.ts +62 -0
- package/dist/plugin-sdk/src/memory/multimodal.d.ts +36 -0
- package/dist/plugin-sdk/src/memory/node-llama.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/post-json.d.ts +10 -0
- package/dist/plugin-sdk/src/memory/prompt-section.d.ts +22 -0
- package/dist/plugin-sdk/src/memory/qmd-manager.d.ts +149 -0
- package/dist/plugin-sdk/src/memory/qmd-process.d.ts +24 -0
- package/dist/plugin-sdk/src/memory/qmd-query-parser.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/qmd-scope.d.ts +4 -0
- package/dist/plugin-sdk/src/memory/query-expansion.d.ts +41 -0
- package/dist/plugin-sdk/src/memory/read-file.d.ts +21 -0
- package/dist/plugin-sdk/src/memory/remote-http.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/search-manager.d.ts +12 -0
- package/dist/plugin-sdk/src/memory/secret-input.d.ts +5 -0
- package/dist/plugin-sdk/src/memory/session-files.d.ts +14 -0
- package/dist/plugin-sdk/src/memory/sqlite-vec.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/sqlite.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/temporal-decay.d.ts +25 -0
- package/dist/plugin-sdk/src/memory/types.d.ts +95 -0
- package/dist/plugin-sdk/src/node-host/with-timeout.d.ts +1 -0
- package/dist/plugin-sdk/src/pairing/pairing-challenge.d.ts +32 -0
- package/dist/plugin-sdk/src/pairing/pairing-labels.d.ts +2 -0
- package/dist/plugin-sdk/src/pairing/pairing-messages.d.ts +6 -0
- package/dist/plugin-sdk/src/pairing/pairing-store.d.ts +52 -0
- package/dist/plugin-sdk/src/param-key.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-helpers.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-resolution.d.ts +24 -0
- package/dist/plugin-sdk/src/plugin-sdk/acp-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/acpx.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/agent-media-payload.d.ts +13 -0
- package/dist/plugin-sdk/src/plugin-sdk/agent-runtime.d.ts +25 -0
- package/dist/plugin-sdk/src/plugin-sdk/allow-from.d.ts +58 -0
- package/dist/plugin-sdk/src/plugin-sdk/allowlist-config-edit.d.ts +99 -0
- package/dist/plugin-sdk/src/plugin-sdk/bluebubbles.d.ts +43 -0
- package/dist/plugin-sdk/src/plugin-sdk/boolean-param.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-actions.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-helpers.d.ts +147 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-schema.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-contract.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-feedback.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-inbound.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-lifecycle.d.ts +41 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-pairing.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-plugin-common.d.ts +12 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-policy.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-reply-pipeline.d.ts +16 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-send-result.d.ts +39 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-setup.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-targets.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/cli-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/command-auth.d.ts +62 -0
- package/dist/plugin-sdk/src/plugin-sdk/compat.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/config-paths.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/config-runtime.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/conversation-runtime.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/copilot-proxy.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/core.d.ts +142 -0
- package/dist/plugin-sdk/src/plugin-sdk/device-bootstrap.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/diagnostics-otel.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/diffs.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/directory-runtime.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord-core.d.ts +10 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord-send.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord.d.ts +33 -0
- package/dist/plugin-sdk/src/plugin-sdk/entrypoints.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/extension-shared.d.ts +67 -0
- package/dist/plugin-sdk/src/plugin-sdk/feishu.d.ts +42 -0
- package/dist/plugin-sdk/src/plugin-sdk/fetch-auth.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/file-lock.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/gateway-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/google.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/googlechat.d.ts +45 -0
- package/dist/plugin-sdk/src/plugin-sdk/group-access.d.ts +57 -0
- package/dist/plugin-sdk/src/plugin-sdk/hook-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/image-generation-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/image-generation.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage-core.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage-targets.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/inbound-envelope.d.ts +97 -0
- package/dist/plugin-sdk/src/plugin-sdk/inbound-reply-dispatch.d.ts +73 -0
- package/dist/plugin-sdk/src/plugin-sdk/index.d.ts +25 -0
- package/dist/plugin-sdk/src/plugin-sdk/infra-runtime.d.ts +40 -0
- package/dist/plugin-sdk/src/plugin-sdk/interactive-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/irc.d.ts +37 -0
- package/dist/plugin-sdk/src/plugin-sdk/json-store.d.ts +12 -0
- package/dist/plugin-sdk/src/plugin-sdk/keyed-async-queue.d.ts +16 -0
- package/dist/plugin-sdk/src/plugin-sdk/lazy-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/line-core.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/line.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/llm-task.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/lobster.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-heavy.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-shared.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix.d.ts +65 -0
- package/dist/plugin-sdk/src/plugin-sdk/mattermost.d.ts +49 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-runtime.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-understanding-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-understanding.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/memory-core.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/memory-lancedb.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/msteams.d.ts +57 -0
- package/dist/plugin-sdk/src/plugin-sdk/nextcloud-talk.d.ts +41 -0
- package/dist/plugin-sdk/src/plugin-sdk/nostr.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/oauth-utils.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/ollama-setup.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/open-prose.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/optional-channel-setup.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/outbound-media.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/outbound-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/pairing-access.d.ts +19 -0
- package/dist/plugin-sdk/src/plugin-sdk/persistent-dedupe.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/phone-control.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/plugin-entry.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/plugin-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/process-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-api-key.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.d.ts +27 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-result.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-google.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-models.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-onboard.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-setup.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-stream.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-tools.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-web-search.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-zai-endpoint.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-history.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-payload.d.ts +164 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/request-url.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/resolution-notes.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/routing.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/run-command.d.ts +13 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime-env.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime-store.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime.d.ts +28 -0
- package/dist/plugin-sdk/src/plugin-sdk/sandbox.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input-schema.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/security-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/self-hosted-provider-setup.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-adapter-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-tools.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/signal-core.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/signal.d.ts +23 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack-core.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack-targets.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack.d.ts +26 -0
- package/dist/plugin-sdk/src/plugin-sdk/speech-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/speech.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/ssrf-policy.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/ssrf-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/state-paths.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/status-helpers.d.ts +145 -0
- package/dist/plugin-sdk/src/plugin-sdk/talk-voice.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/telegram-core.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/telegram.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/temp-path.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/test-utils.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/testing.d.ts +26 -0
- package/dist/plugin-sdk/src/plugin-sdk/text-chunking.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/text-runtime.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/thread-bindings-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/thread-ownership.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/tlon.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/tool-send.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/twitch.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/voice-call.d.ts +9 -0
- package/dist/plugin-sdk/src/plugin-sdk/web-media.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-ingress.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-memory-guards.d.ts +52 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-path.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-request-guards.d.ts +89 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-targets.d.ts +97 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-action-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-core.d.ts +10 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-login-qr.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-shared.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/windows-spawn.d.ts +44 -0
- package/dist/plugin-sdk/src/plugin-sdk/zai.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/zalo.d.ts +46 -0
- package/dist/plugin-sdk/src/plugin-sdk/zalouser.d.ts +39 -0
- package/dist/plugin-sdk/src/plugins/bundle-commands.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/bundle-lsp.d.ts +27 -0
- package/dist/plugin-sdk/src/plugins/bundle-manifest.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/bundle-mcp.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/bundled-compat.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/bundled-dir.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/bundled-provider-auth-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/bundled-provider-auth-env-vars.generated.d.ts +40 -0
- package/dist/plugin-sdk/src/plugins/bundled-web-search-ids.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/bundled-web-search.d.ts +10 -0
- package/dist/plugin-sdk/src/plugins/captured-registration.d.ts +14 -0
- package/dist/plugin-sdk/src/plugins/commands.d.ts +111 -0
- package/dist/plugin-sdk/src/plugins/config-schema.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/config-state.d.ts +53 -0
- package/dist/plugin-sdk/src/plugins/conversation-binding.d.ts +89 -0
- package/dist/plugin-sdk/src/plugins/discovery.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/enable.d.ts +7 -0
- package/dist/plugin-sdk/src/plugins/hook-runner-global.d.ts +37 -0
- package/dist/plugin-sdk/src/plugins/hooks.d.ts +70 -0
- package/dist/plugin-sdk/src/plugins/http-path.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/http-registry.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/http-route-overlap.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/interactive-dispatch-adapters.d.ts +44 -0
- package/dist/plugin-sdk/src/plugins/interactive.d.ts +60 -0
- package/dist/plugin-sdk/src/plugins/loader.d.ts +47 -0
- package/dist/plugin-sdk/src/plugins/logger.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/manifest-registry.d.ts +49 -0
- package/dist/plugin-sdk/src/plugins/manifest.d.ts +119 -0
- package/dist/plugin-sdk/src/plugins/path-safety.d.ts +5 -0
- package/dist/plugin-sdk/src/plugins/provider-api-key-auth.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/provider-api-key-auth.runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-helpers.d.ts +25 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-input.d.ts +49 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-mode.d.ts +14 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-ref.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-token.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-types.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/provider-catalog-metadata.d.ts +6 -0
- package/dist/plugin-sdk/src/plugins/provider-catalog.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/provider-discovery.d.ts +37 -0
- package/dist/plugin-sdk/src/plugins/provider-model-allowlist.d.ts +6 -0
- package/dist/plugin-sdk/src/plugins/provider-model-defaults.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/provider-model-definitions.d.ts +107 -0
- package/dist/plugin-sdk/src/plugins/provider-model-helpers.d.ts +8 -0
- package/dist/plugin-sdk/src/plugins/provider-model-primary.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/provider-oauth-flow.d.ts +20 -0
- package/dist/plugin-sdk/src/plugins/provider-ollama-setup.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/provider-onboarding-config.d.ts +62 -0
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth-tls.d.ts +22 -0
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth.d.ts +10 -0
- package/dist/plugin-sdk/src/plugins/provider-runtime.d.ts +154 -0
- package/dist/plugin-sdk/src/plugins/provider-runtime.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/provider-self-hosted-setup.d.ts +51 -0
- package/dist/plugin-sdk/src/plugins/provider-thinking.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/provider-validation.d.ts +7 -0
- package/dist/plugin-sdk/src/plugins/provider-vllm-setup.d.ts +21 -0
- package/dist/plugin-sdk/src/plugins/provider-zai-endpoint.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/providers.d.ts +40 -0
- package/dist/plugin-sdk/src/plugins/registry-empty.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/registry.d.ts +191 -0
- package/dist/plugin-sdk/src/plugins/roots.d.ts +18 -0
- package/dist/plugin-sdk/src/plugins/runtime/gateway-request-scope.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/runtime/index.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/runtime/native-deps.d.ts +8 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-agent.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-channel.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-config.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord-ops.runtime.d.ts +25 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord-typing.d.ts +15 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-events.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-imessage.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-logging.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-matrix-boundary.d.ts +4 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-matrix.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-media.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-signal.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack-ops.runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-system.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-contract.d.ts +41 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-ops.runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-typing.d.ts +18 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-tools.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp-boundary.d.ts +35 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp-login-tool.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/types-channel.d.ts +242 -0
- package/dist/plugin-sdk/src/plugins/runtime/types-core.d.ts +100 -0
- package/dist/plugin-sdk/src/plugins/runtime/types.d.ts +50 -0
- package/dist/plugin-sdk/src/plugins/runtime.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/schema-validator.d.ts +17 -0
- package/dist/plugin-sdk/src/plugins/sdk-alias.d.ts +47 -0
- package/dist/plugin-sdk/src/plugins/setup-binary.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/setup-browser.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/signal-cli-install.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/slots.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/status.d.ts +97 -0
- package/dist/plugin-sdk/src/plugins/toggle-config.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/tools.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/types.d.ts +1566 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.runtime.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.shared.d.ts +13 -0
- package/dist/plugin-sdk/src/poll-params.d.ts +42 -0
- package/dist/plugin-sdk/src/polls.d.ts +32 -0
- package/dist/plugin-sdk/src/process/command-queue.d.ts +63 -0
- package/dist/plugin-sdk/src/process/exec.d.ts +36 -0
- package/dist/plugin-sdk/src/process/kill-tree.d.ts +12 -0
- package/dist/plugin-sdk/src/process/lanes.d.ts +6 -0
- package/dist/plugin-sdk/src/process/spawn-utils.d.ts +26 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/child.d.ts +10 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/env.d.ts +1 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/pty.d.ts +11 -0
- package/dist/plugin-sdk/src/process/supervisor/index.d.ts +4 -0
- package/dist/plugin-sdk/src/process/supervisor/registry.d.ts +21 -0
- package/dist/plugin-sdk/src/process/supervisor/supervisor.d.ts +2 -0
- package/dist/plugin-sdk/src/process/supervisor/types.d.ts +92 -0
- package/dist/plugin-sdk/src/process/windows-command.d.ts +5 -0
- package/dist/plugin-sdk/src/providers/github-copilot-auth.d.ts +5 -0
- package/dist/plugin-sdk/src/providers/kilocode-shared.d.ts +27 -0
- package/dist/plugin-sdk/src/providers/openai-defaults.d.ts +7 -0
- package/dist/plugin-sdk/src/routing/account-id.d.ts +3 -0
- package/dist/plugin-sdk/src/routing/account-lookup.d.ts +1 -0
- package/dist/plugin-sdk/src/routing/bindings.d.ts +11 -0
- package/dist/plugin-sdk/src/routing/default-account-warnings.d.ts +6 -0
- package/dist/plugin-sdk/src/routing/resolve-route.d.ts +53 -0
- package/dist/plugin-sdk/src/routing/session-key.d.ts +52 -0
- package/dist/plugin-sdk/src/runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/command-config.d.ts +35 -0
- package/dist/plugin-sdk/src/secrets/json-pointer.d.ts +6 -0
- package/dist/plugin-sdk/src/secrets/path-utils.d.ts +5 -0
- package/dist/plugin-sdk/src/secrets/provider-env-vars.d.ts +21 -0
- package/dist/plugin-sdk/src/secrets/ref-contract.d.ts +33 -0
- package/dist/plugin-sdk/src/secrets/resolve-secret-input-string.d.ts +12 -0
- package/dist/plugin-sdk/src/secrets/resolve.d.ts +40 -0
- package/dist/plugin-sdk/src/secrets/runtime-auth-collectors.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-channels.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-core.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-tts.d.ts +9 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors.d.ts +6 -0
- package/dist/plugin-sdk/src/secrets/runtime-gateway-auth-surfaces.d.ts +16 -0
- package/dist/plugin-sdk/src/secrets/runtime-shared.d.ts +52 -0
- package/dist/plugin-sdk/src/secrets/runtime-web-tools.d.ts +9 -0
- package/dist/plugin-sdk/src/secrets/runtime-web-tools.types.d.ts +26 -0
- package/dist/plugin-sdk/src/secrets/runtime.d.ts +34 -0
- package/dist/plugin-sdk/src/secrets/secret-value.d.ts +8 -0
- package/dist/plugin-sdk/src/secrets/shared.d.ts +11 -0
- package/dist/plugin-sdk/src/secrets/target-registry-data.d.ts +3 -0
- package/dist/plugin-sdk/src/secrets/target-registry-pattern.d.ts +28 -0
- package/dist/plugin-sdk/src/secrets/target-registry-query.d.ts +18 -0
- package/dist/plugin-sdk/src/secrets/target-registry-types.d.ts +39 -0
- package/dist/plugin-sdk/src/secrets/target-registry.d.ts +1 -0
- package/dist/plugin-sdk/src/security/audit-fs.d.ts +44 -0
- package/dist/plugin-sdk/src/security/channel-metadata.d.ts +6 -0
- package/dist/plugin-sdk/src/security/config-regex.d.ts +22 -0
- package/dist/plugin-sdk/src/security/dm-policy-shared.d.ts +92 -0
- package/dist/plugin-sdk/src/security/external-content.d.ts +58 -0
- package/dist/plugin-sdk/src/security/safe-regex.d.ts +16 -0
- package/dist/plugin-sdk/src/security/scan-paths.d.ts +5 -0
- package/dist/plugin-sdk/src/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/src/security/windows-acl.d.ts +37 -0
- package/dist/plugin-sdk/src/sessions/input-provenance.d.ts +17 -0
- package/dist/plugin-sdk/src/sessions/level-overrides.d.ts +10 -0
- package/dist/plugin-sdk/src/sessions/model-overrides.d.ts +14 -0
- package/dist/plugin-sdk/src/sessions/send-policy.d.ts +11 -0
- package/dist/plugin-sdk/src/sessions/session-id-resolution.d.ts +2 -0
- package/dist/plugin-sdk/src/sessions/session-id.d.ts +2 -0
- package/dist/plugin-sdk/src/sessions/session-key-utils.d.ts +20 -0
- package/dist/plugin-sdk/src/sessions/session-label.d.ts +9 -0
- package/dist/plugin-sdk/src/sessions/session-lifecycle-events.d.ts +11 -0
- package/dist/plugin-sdk/src/sessions/transcript-events.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/assistant-error-format.d.ts +16 -0
- package/dist/plugin-sdk/src/shared/avatar-policy.d.ts +16 -0
- package/dist/plugin-sdk/src/shared/chat-content.d.ts +5 -0
- package/dist/plugin-sdk/src/shared/chat-envelope.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/config-eval.d.ts +26 -0
- package/dist/plugin-sdk/src/shared/device-auth-store.d.ts +23 -0
- package/dist/plugin-sdk/src/shared/device-auth.d.ts +13 -0
- package/dist/plugin-sdk/src/shared/frontmatter.d.ts +29 -0
- package/dist/plugin-sdk/src/shared/gateway-bind-url.d.ts +14 -0
- package/dist/plugin-sdk/src/shared/global-singleton.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/lazy-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/shared/net/ip.d.ts +20 -0
- package/dist/plugin-sdk/src/shared/net/url-userinfo.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/node-list-parse.d.ts +3 -0
- package/dist/plugin-sdk/src/shared/node-list-types.d.ts +48 -0
- package/dist/plugin-sdk/src/shared/node-match.d.ts +9 -0
- package/dist/plugin-sdk/src/shared/node-resolve.d.ts +8 -0
- package/dist/plugin-sdk/src/shared/operator-scope-compat.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/pid-alive.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/process-scoped-map.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/session-types.d.ts +25 -0
- package/dist/plugin-sdk/src/shared/session-usage-timeseries-types.d.ts +15 -0
- package/dist/plugin-sdk/src/shared/string-normalization.d.ts +4 -0
- package/dist/plugin-sdk/src/shared/string-sample.d.ts +5 -0
- package/dist/plugin-sdk/src/shared/subagents-format.d.ts +15 -0
- package/dist/plugin-sdk/src/shared/tailscale-status.d.ts +8 -0
- package/dist/plugin-sdk/src/shared/text/assistant-visible-text.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/text/auto-linked-file-ref.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/text/code-regions.d.ts +6 -0
- package/dist/plugin-sdk/src/shared/text/join-segments.d.ts +9 -0
- package/dist/plugin-sdk/src/shared/text/reasoning-tags.d.ts +6 -0
- package/dist/plugin-sdk/src/shared/text-chunking.d.ts +1 -0
- package/dist/plugin-sdk/src/terminal/ansi.d.ts +9 -0
- package/dist/plugin-sdk/src/terminal/health-style.d.ts +1 -0
- package/dist/plugin-sdk/src/terminal/links.d.ts +6 -0
- package/dist/plugin-sdk/src/terminal/note.d.ts +5 -0
- package/dist/plugin-sdk/src/terminal/palette.d.ts +10 -0
- package/dist/plugin-sdk/src/terminal/progress-line.d.ts +3 -0
- package/dist/plugin-sdk/src/terminal/prompt-style.d.ts +3 -0
- package/dist/plugin-sdk/src/terminal/restore.d.ts +17 -0
- package/dist/plugin-sdk/src/terminal/safe-text.d.ts +4 -0
- package/dist/plugin-sdk/src/terminal/theme.d.ts +15 -0
- package/dist/plugin-sdk/src/test-utils/vitest-mock-fn.d.ts +1 -0
- package/dist/plugin-sdk/src/tts/provider-registry.d.ts +6 -0
- package/dist/plugin-sdk/src/tts/provider-types.d.ts +46 -0
- package/dist/plugin-sdk/src/tts/providers/elevenlabs.d.ts +7 -0
- package/dist/plugin-sdk/src/tts/providers/microsoft.d.ts +4 -0
- package/dist/plugin-sdk/src/tts/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/src/tts/runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/tts/tts-core.d.ts +57 -0
- package/dist/plugin-sdk/src/tts/tts.d.ts +216 -0
- package/dist/plugin-sdk/src/utils/account-id.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/boolean.d.ts +5 -0
- package/dist/plugin-sdk/src/utils/chunk-items.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/delivery-context.d.ts +42 -0
- package/dist/plugin-sdk/src/utils/directive-tags.d.ts +29 -0
- package/dist/plugin-sdk/src/utils/fetch-timeout.d.ts +13 -0
- package/dist/plugin-sdk/src/utils/mask-api-key.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/message-channel.d.ts +27 -0
- package/dist/plugin-sdk/src/utils/normalize-secret-input.d.ts +17 -0
- package/dist/plugin-sdk/src/utils/parse-json-compat.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/provider-utils.d.ts +9 -0
- package/dist/plugin-sdk/src/utils/queue-helpers.d.ts +80 -0
- package/dist/plugin-sdk/src/utils/reaction-level.d.ts +15 -0
- package/dist/plugin-sdk/src/utils/run-with-concurrency.d.ts +11 -0
- package/dist/plugin-sdk/src/utils/safe-json.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/shell-argv.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/transcript-tools.d.ts +8 -0
- package/dist/plugin-sdk/src/utils/usage-format.d.ts +27 -0
- package/dist/plugin-sdk/src/utils/with-timeout.d.ts +1 -0
- package/dist/plugin-sdk/src/utils.d.ts +61 -0
- package/dist/plugin-sdk/src/version.d.ts +16 -0
- package/dist/plugin-sdk/src/web-search/runtime.d.ts +46 -0
- package/dist/plugin-sdk/src/whatsapp/normalize.d.ts +6 -0
- package/dist/plugin-sdk/src/whatsapp/resolve-outbound-target.d.ts +12 -0
- package/dist/plugin-sdk/src/wizard/prompts.d.ts +43 -0
- package/dist/plugin-sdk/src/wizard/session.d.ts +42 -0
- package/dist/plugin-sdk/ssrf-runtime.d.ts +1 -0
- package/dist/plugin-sdk/ssrf-runtime.js +5 -0
- package/dist/plugin-sdk/state-paths.d.ts +1 -0
- package/dist/plugin-sdk/state-paths.js +3 -0
- package/dist/plugin-sdk/status-helpers.d.ts +1 -0
- package/dist/plugin-sdk/status-helpers.js +9 -0
- package/dist/plugin-sdk/telegram-core.d.ts +1 -0
- package/dist/plugin-sdk/telegram-core.js +23 -0
- package/dist/plugin-sdk/telegram.d.ts +1 -0
- package/dist/plugin-sdk/telegram.js +224 -0
- package/dist/plugin-sdk/testing.d.ts +1 -0
- package/dist/plugin-sdk/testing.js +13174 -0
- package/dist/plugin-sdk/text-runtime.d.ts +1 -0
- package/dist/plugin-sdk/text-runtime.js +45 -0
- package/dist/plugin-sdk/thread-bindings-runtime.d.ts +1 -0
- package/dist/plugin-sdk/thread-bindings-runtime.js +2 -0
- package/dist/plugin-sdk/thread-ownership.d.ts +1 -0
- package/dist/plugin-sdk/thread-ownership.js +2 -0
- package/dist/plugin-sdk/tlon.d.ts +1 -0
- package/dist/plugin-sdk/tlon.js +57 -0
- package/dist/plugin-sdk/tool-send.d.ts +1 -0
- package/dist/plugin-sdk/tool-send.js +2 -0
- package/dist/plugin-sdk/twitch.d.ts +1 -0
- package/dist/plugin-sdk/twitch.js +46 -0
- package/dist/plugin-sdk/voice-call.d.ts +1 -0
- package/dist/plugin-sdk/voice-call.js +213 -0
- package/dist/plugin-sdk/web-media.d.ts +1 -0
- package/dist/plugin-sdk/web-media.js +28 -0
- package/dist/plugin-sdk/webhook-ingress.d.ts +1 -0
- package/dist/plugin-sdk/webhook-ingress.js +7 -0
- package/dist/plugin-sdk/webhook-path.d.ts +1 -0
- package/dist/plugin-sdk/webhook-path.js +29 -0
- package/dist/plugin-sdk/whatsapp-core.d.ts +1 -0
- package/dist/plugin-sdk/whatsapp-core.js +219 -0
- package/dist/plugin-sdk/whatsapp-shared.d.ts +1 -0
- package/dist/plugin-sdk/whatsapp-shared.js +18 -0
- package/dist/plugin-sdk/windows-spawn.d.ts +1 -0
- package/dist/plugin-sdk/windows-spawn.js +2 -0
- package/dist/plugin-sdk/zalo.d.ts +1 -0
- package/dist/plugin-sdk/zalo.js +239 -0
- package/dist/plugin-sdk/zalouser.d.ts +1 -0
- package/dist/plugin-sdk/zalouser.js +240 -0
- package/dist/plugins/build-smoke-entry.js +211 -0
- package/dist/plugins/runtime/index.js +229 -0
- package/dist/plugins-1Z50ecJ6.js +1 -0
- package/dist/plugins-C6fKmNuA.js +7 -0
- package/dist/plugins-cli-C9F7LFai.js +1192 -0
- package/dist/policy-CpkbSAfm.js +60 -0
- package/dist/polls-B2VH7SN9.js +35 -0
- package/dist/ports-BjWuIIQw.js +262 -0
- package/dist/ports-bjxjgHBT.js +385 -0
- package/dist/ports-lsof-DtJqhFOr.js +25 -0
- package/dist/ports-probe-BQqp8l8E.js +14 -0
- package/dist/preflight-audio.runtime-CHKtYFCD.js +216 -0
- package/dist/probe-B4addlGb.js +20 -0
- package/dist/probe-DEHTy47Q.js +134 -0
- package/dist/probe-auth-f8H5asG2.js +45 -0
- package/dist/probe-auth-w1LTAARt.js +48 -0
- package/dist/process-runtime-C7el-Ri4.js +1 -0
- package/dist/process-scoped-map-C4gOa-gv.js +61 -0
- package/dist/profile-utils-BcMYGFPT.js +15 -0
- package/dist/profiles-D17eMKQZ.js +683 -0
- package/dist/program-7yuBUzsM.js +155 -0
- package/dist/program-context-BMWNUfqL.js +10 -0
- package/dist/program-context-CD_RvRYh.js +2 -0
- package/dist/progress-D1r9bZU1.js +132 -0
- package/dist/prompt-select-styled-nNVADeGF.js +4879 -0
- package/dist/prompt-style-BvciNCqy.js +7 -0
- package/dist/prompts-NtuylUyl.js +9 -0
- package/dist/prototype-keys-Cm_8mWvq.js +11 -0
- package/dist/provider-api-key-auth-BE0taXiB.js +108 -0
- package/dist/provider-api-key-auth.runtime-jDZZUAMX.js +34 -0
- package/dist/provider-auth-Bw8x1a3o.js +58 -0
- package/dist/provider-auth-api-key-BrQYvdxi.js +1 -0
- package/dist/provider-auth-choice-CHLyhQwI.js +128 -0
- package/dist/provider-auth-choice-helpers-Bj1GkOSn.js +48 -0
- package/dist/provider-auth-choice-preference-DlolknHt.js +192 -0
- package/dist/provider-auth-choice.runtime-unOg_4AL.js +223 -0
- package/dist/provider-auth-choices-QSilukI1.js +58 -0
- package/dist/provider-auth-guidance-7WCTw6mb.js +34 -0
- package/dist/provider-auth-helpers-B0dS-1WK.js +86 -0
- package/dist/provider-auth-input-BftBdgvW.js +112 -0
- package/dist/provider-auth-login-MdVTo3EF.js +8 -0
- package/dist/provider-auth-login.runtime-CmHgk5FU.js +243 -0
- package/dist/provider-auth-mode-sTdccIKL.js +20 -0
- package/dist/provider-auth-ref-BS3gwrNr.js +168 -0
- package/dist/provider-auth-ref-BmEcEN7K.js +3 -0
- package/dist/provider-catalog--18-pW5t.js +11 -0
- package/dist/provider-catalog-2P2hel74.js +48 -0
- package/dist/provider-catalog-B0FqWSwe.js +48 -0
- package/dist/provider-catalog-BvORKzzD.js +91 -0
- package/dist/provider-catalog-C34j1_or.js +26 -0
- package/dist/provider-catalog-C5vmXjmb.js +11 -0
- package/dist/provider-catalog-CBufm2Dr.js +36 -0
- package/dist/provider-catalog-D7QvsUXS.js +12 -0
- package/dist/provider-catalog-DKy_dzQZ.js +41 -0
- package/dist/provider-env-vars-CsQlY7bF.js +110 -0
- package/dist/provider-id-BpXo5t6v.js +31 -0
- package/dist/provider-model-allowlist-4HSOnlX-.js +24 -0
- package/dist/provider-model-primary-NJ-xlhec.js +53 -0
- package/dist/provider-models-C2EjYMwW.js +2416 -0
- package/dist/provider-oauth-flow-BQN6F6EC.js +33 -0
- package/dist/provider-ollama-setup-DhQvDwAj.js +309 -0
- package/dist/provider-onboard-CjOfyeQG.js +1 -0
- package/dist/provider-onboarding-config-DOZ3pFA6.js +165 -0
- package/dist/provider-openai-codex-oauth-tls-CciH-ElI.js +101 -0
- package/dist/provider-runtime.runtime-CqLlOpNN.js +211 -0
- package/dist/provider-self-hosted-setup-CUrmsugW.js +182 -0
- package/dist/provider-usage-ClDVmkhl.js +633 -0
- package/dist/provider-usage-Da21nLuJ.js +211 -0
- package/dist/provider-web-search-D2JPMqCP.js +507 -0
- package/dist/provider-wizard-DLQlOsRE.js +236 -0
- package/dist/provider-zai-endpoint-DeDABzT4.js +106 -0
- package/dist/proxy-H5O2p6AP.js +121 -0
- package/dist/proxy-env-DG2u55RW.js +40 -0
- package/dist/push-apns-DthmTY-D.js +1050 -0
- package/dist/pw-ai-S7kXHa5n.js +1876 -0
- package/dist/qmd-manager-BpygGMW9.js +1571 -0
- package/dist/qr-cli-BujxPQbh.js +370 -0
- package/dist/qr-cli-DVmW5mdc.js +213 -0
- package/dist/query-expansion-Do45hILP.js +1114 -0
- package/dist/reactions-BlWPBR0l.js +281 -0
- package/dist/read-only-account-inspect-CuuTbX8x.js +42 -0
- package/dist/read-only-account-inspect.discord.runtime-BNqMWV41.js +216 -0
- package/dist/read-only-account-inspect.slack.runtime-CNRAytxm.js +216 -0
- package/dist/read-only-account-inspect.telegram.runtime-byPPLnsZ.js +216 -0
- package/dist/redact-BDinS1q9.js +102 -0
- package/dist/redact-identifier-FUiWQxv5.js +13 -0
- package/dist/redact-snapshot-DBPmeYy2.js +2654 -0
- package/dist/ref-contract-CCBBbf1r.js +53 -0
- package/dist/register-CppP7Ddc.js +43 -0
- package/dist/register.agent-Cy1pvUnS.js +546 -0
- package/dist/register.backup-Dxsn-Yi4.js +269 -0
- package/dist/register.configure-BOONWPZN.js +354 -0
- package/dist/register.maintenance-C_E5F3xW.js +694 -0
- package/dist/register.message-BwmuEJ7n.js +812 -0
- package/dist/register.onboard-D4Fu6BPi.js +298 -0
- package/dist/register.setup-DJYgl_5E.js +318 -0
- package/dist/register.status-health-sessions-B0KtOOEc.js +604 -0
- package/dist/register.subclis-CKJ5Qvch.js +315 -0
- package/dist/register.subclis-CcdM_H8W.js +13 -0
- package/dist/registry-C3q59Qj0.js +55 -0
- package/dist/registry-CPsHw6xU.js +219 -0
- package/dist/registry-CxgtJ09C.js +28 -0
- package/dist/registry-rgYi7KoO.js +160 -0
- package/dist/repair-qXnOAvDy.js +105 -0
- package/dist/replies-MyUi4VUF.js +122 -0
- package/dist/reply-history-CVCD5oE9.js +1 -0
- package/dist/reply-payload-DBGc074f.js +232 -0
- package/dist/report-cli-DB1jQx32.js +42 -0
- package/dist/request-url-BKfWAQx8.js +10 -0
- package/dist/resolve-Ckjd8TAk.js +14 -0
- package/dist/resolve-T2q_0ARF.js +619 -0
- package/dist/resolve-route-vEY3ONZ2.js +466 -0
- package/dist/resolve-utils-CF8cU9WO.js +102 -0
- package/dist/response-generator-VdoCcQ3y.js +153 -0
- package/dist/restart-stale-pids-CLGiqU2E.js +187 -0
- package/dist/retry-D15TD1S3.js +168 -0
- package/dist/root-help-2Fvs2dP7.js +32 -0
- package/dist/routes-LnFKW9Eh.js +7084 -0
- package/dist/routing-Y3m0o-kB.js +26 -0
- package/dist/rpc-lnQaxoYH.js +67 -0
- package/dist/run-command-DRKv5Lj6.js +32 -0
- package/dist/run-main-XmwwulYd.js +425 -0
- package/dist/run-with-concurrency-BrSjWzpg.js +41 -0
- package/dist/runtime-B66W9flm.js +43 -0
- package/dist/runtime-CT2LIJZu.js +91 -0
- package/dist/runtime-Cl6sSlDG.js +143 -0
- package/dist/runtime-CuvWMN7E.js +89 -0
- package/dist/runtime-D4_OpzA1.js +5 -0
- package/dist/runtime-DP-4DZja.js +5 -0
- package/dist/runtime-Dl17x_cV.js +1 -0
- package/dist/runtime-Dwejo3y0.js +2338 -0
- package/dist/runtime-Z35JoYPC.js +30 -0
- package/dist/runtime-api-AQf4CGN0.js +39 -0
- package/dist/runtime-api-D79M0lQN.js +1 -0
- package/dist/runtime-discord-ops.runtime-CvmUbfVm.js +234 -0
- package/dist/runtime-env-a_iwdJIv.js +1 -0
- package/dist/runtime-forwarders-DtMc8rBP.js +44 -0
- package/dist/runtime-group-policy-B7irU4eu.js +59 -0
- package/dist/runtime-guard-y62lPDGY.js +58 -0
- package/dist/runtime-parse-CeqXmZHJ.js +84 -0
- package/dist/runtime-paths-2jrzlMjr.js +334 -0
- package/dist/runtime-slack-ops.runtime-D7IhY8CD.js +226 -0
- package/dist/runtime-status-CgL02wYX.js +15 -0
- package/dist/runtime-store-Bt3Sdbrn.js +22 -0
- package/dist/runtime-telegram-ops.runtime-DMM0_L8z.js +233 -0
- package/dist/runtime-whatsapp-boundary-BE-h0Dkz.js +371 -0
- package/dist/safe-open-sync-Bt9R1Mnf.js +83 -0
- package/dist/safe-regex-tLlDZYfM.js +244 -0
- package/dist/safe-text-B_CQuica.js +16 -0
- package/dist/sandbox-Ceruxpo4.js +2795 -0
- package/dist/sandbox-cli-Bj_FeUbQ.js +499 -0
- package/dist/sandbox-paths-fqp_TZdO.js +144 -0
- package/dist/sandbox-qSs4h3sk.js +1 -0
- package/dist/sanitize-env-vars-vNSNqm0y.js +74 -0
- package/dist/scan-paths-BJmvUZ1E.js +28 -0
- package/dist/search-manager-5CMnrJiG.js +392 -0
- package/dist/search-manager-mbopau6D.js +17 -0
- package/dist/secret-equal-ObQfyZGa.js +9 -0
- package/dist/secret-file-Ch0yuOXR.js +11 -0
- package/dist/secret-file-DYJtH6kf.js +92 -0
- package/dist/secret-input-4REZ4sHo.js +35 -0
- package/dist/secrets-cli-CDAAxiLx.js +2304 -0
- package/dist/secure-random-Cs8tw_HQ.js +10 -0
- package/dist/security-cli-73x8ZrPY.js +676 -0
- package/dist/security-runtime-BuEhpJVE.js +23 -0
- package/dist/send-3tabvle6.js +100 -0
- package/dist/send-CK2mTZ2A.js +1026 -0
- package/dist/send-CoghdDtC.js +250 -0
- package/dist/send-deps-CrFMNvqO.js +19 -0
- package/dist/server-DsQSJw3K.js +116 -0
- package/dist/server-middleware-CCqKhKUb.js +106 -0
- package/dist/server-node-events-ByKRzTEW.js +611 -0
- package/dist/server-startup-matrix-migration-DXgvClaj.js +1595 -0
- package/dist/service-CCEFa-Yp.js +21 -0
- package/dist/service-DsLjWzXO.js +774 -0
- package/dist/session-cost-usage-Bcu2puh5.js +615 -0
- package/dist/session-cost-usage-CqAjBtg1.js +212 -0
- package/dist/session-fork.runtime-BZfcC1Nc.js +51 -0
- package/dist/session-key-gFFk3uv9.js +216 -0
- package/dist/session-write-lock-DNKvpjKf.js +324 -0
- package/dist/sessions-BjptmD-t.js +669 -0
- package/dist/sessions-CcXbjCp-.js +212 -0
- package/dist/sessions-DzQPJoHb.js +222 -0
- package/dist/setup-CN-teRpz.js +8 -0
- package/dist/setup-adapter-runtime-Bjv2adwG.js +1 -0
- package/dist/setup-binary-BOJA7zdN.js +30 -0
- package/dist/setup-browser-BhNPCUtK.js +71 -0
- package/dist/setup-core-7tpbsHoe.js +510 -0
- package/dist/setup-core-DsGvW4Oh.js +149 -0
- package/dist/setup-core-m6QfoAWl.js +162 -0
- package/dist/setup-entry-BgrHdl35.js +13 -0
- package/dist/setup-entry-DKV-8VNp.js +13 -0
- package/dist/setup-entry-Df-K2RuZ.js +12 -0
- package/dist/setup-entry-DxtbuNKQ.js +12 -0
- package/dist/setup-entry-Dzn7A8q7.js +10 -0
- package/dist/setup-entry-bSF8R2r8.js +14 -0
- package/dist/setup-group-access-BtPApRvE.js +70 -0
- package/dist/setup-helpers-B62Ecg9r.js +362 -0
- package/dist/setup-saJ2s_47.js +397 -0
- package/dist/setup-surface-BGYo0Juy.js +452 -0
- package/dist/setup-surface-Cx1YVfWw.js +298 -0
- package/dist/setup-surface-DF1wiFx2.js +380 -0
- package/dist/setup-tools-BPiMjAN7.js +1 -0
- package/dist/setup-wizard-helpers-COZ1UAdX.js +770 -0
- package/dist/setup-wizard-proxy-Slwi-1gX.js +116 -0
- package/dist/setup.finalize-BEoLI29h.js +633 -0
- package/dist/setup.gateway-config-6ACjCQcc.js +288 -0
- package/dist/setup.secret-input-BL-bqJpt.js +25 -0
- package/dist/shared-AygSbeCK.js +50 -0
- package/dist/shared-BEtSbYbS.js +70 -0
- package/dist/shared-BU0QgVMZ.js +36 -0
- package/dist/shared-B_i-s5Yg.js +127 -0
- package/dist/shared-CsOwQtm1.js +82 -0
- package/dist/shared-DA95aWfS.js +196 -0
- package/dist/shared-DsbqCNFQ.js +64 -0
- package/dist/shared-LeP8iUTz.js +54 -0
- package/dist/shared-N35AUgZI.js +351 -0
- package/dist/shared-qmfOl6pa.js +87 -0
- package/dist/shell-argv-DWV43Vya.js +72 -0
- package/dist/shell-env-cD92jEyV.js +181 -0
- package/dist/signal-8EYn_jCw.js +214 -0
- package/dist/signal-Ca7y47bM.js +46 -0
- package/dist/signal-CdndhLSx.js +315 -0
- package/dist/signal-cli-install-DxoL8CgF.js +188 -0
- package/dist/skill-commands-CiSwTFBQ.js +652 -0
- package/dist/skill-commands.runtime-CEwlWT4j.js +34 -0
- package/dist/skill-scanner-DG7MT7pu.js +354 -0
- package/dist/skills-BC8GJ9Rp.js +22 -0
- package/dist/skills-CCgKs_NJ.js +863 -0
- package/dist/skills-cli-Xqm4TQ_x.js +339 -0
- package/dist/skills-install-DiriUXJd.js +763 -0
- package/dist/skills-status-BmQTn4jL.js +23 -0
- package/dist/skills-status-a9b899Y3.js +169 -0
- package/dist/slack-C3ZawHgc.js +217 -0
- package/dist/slack-DnTAFEmr.js +730 -0
- package/dist/slack-UD0yJzLR.js +24536 -0
- package/dist/slack-core-DcsbATUs.js +1 -0
- package/dist/slash-commands.runtime-sOpKLp0F.js +228 -0
- package/dist/slash-dispatch.runtime-CbC_hoS7.js +238 -0
- package/dist/slash-skill-commands.runtime-CXNUQJQR.js +216 -0
- package/dist/speech-bSreRuDH.js +1 -0
- package/dist/speech-runtime-y1FcnGVA.js +1 -0
- package/dist/src-CmXHIz5f.js +846 -0
- package/dist/ssh-config-ChqR6ijV.js +77 -0
- package/dist/ssh-tunnel-BWqSNkJo.js +159 -0
- package/dist/ssh-tunnel-DXVCvSif.js +16 -0
- package/dist/ssrf-Dk9XaoKN.js +220 -0
- package/dist/ssrf-policy-Dk6oMa20.js +69 -0
- package/dist/ssrf-runtime-C-mAQLVA.js +1 -0
- package/dist/stagger-DU7FjHYo.js +54 -0
- package/dist/state-paths-DJIGEFq_.js +1 -0
- package/dist/status-1dN68Nry.js +212 -0
- package/dist/status-B5jKN_AU.js +606 -0
- package/dist/status-BQWWxkTB.js +235 -0
- package/dist/status-By03N6J2.js +44 -0
- package/dist/status-COGoXc70.js +202 -0
- package/dist/status-ClMSSlfZ.js +1665 -0
- package/dist/status-Dl_kHCzm.js +75 -0
- package/dist/status-helpers-Cda-rGLX.js +101 -0
- package/dist/status-json-DXiuJMkM.js +322 -0
- package/dist/status.link-channel-DVXC4ITW.js +40 -0
- package/dist/status.scan.deps.runtime-BklcI9d4.js +77 -0
- package/dist/status.scan.runtime-Bz0f5qUW.js +14 -0
- package/dist/status.summary-D8-ms-9P.js +600 -0
- package/dist/status.summary.runtime-Cng6MzRU.js +151 -0
- package/dist/status.update-CjoH4lVV.js +79 -0
- package/dist/store-AMSZUI0p.js +1446 -0
- package/dist/store.runtime-B0dFf2pa.js +43 -0
- package/dist/string-normalization-CvzuCAZv.js +19 -0
- package/dist/string-sample-BOLqzr4Y.js +11 -0
- package/dist/subagent-orphan-recovery-CDTomicF.js +407 -0
- package/dist/subagent-registry-runtime-kD87ylaJ.js +211 -0
- package/dist/subcli-descriptors-CteQXLPG.js +151 -0
- package/dist/subsystem-CUp-6QQf.js +421 -0
- package/dist/synology-chat-CFiJEDRu.js +12 -0
- package/dist/system-cli-D2pMYxTX.js +99 -0
- package/dist/system-events-mAu6Ap6K.js +75 -0
- package/dist/system-message-DA9eUYzB.js +16 -0
- package/dist/system-run-command-BV7UnYxn.js +258 -0
- package/dist/systemd-CrxZBFae.js +557 -0
- package/dist/systemd-hints-BLAoAquw.js +315 -0
- package/dist/systemd-linger-BdklDcLg.js +16 -0
- package/dist/systemd-linger-DLrbG9_d.js +68 -0
- package/dist/table-DFMOhmNZ.js +305 -0
- package/dist/tailnet-ofqBrXzu.js +38 -0
- package/dist/tailscale-Cbsx-2HB.js +254 -0
- package/dist/target-errors-ksphhzJg.js +26 -0
- package/dist/target-registry-krAVlXi_.js +1321 -0
- package/dist/telegram/audit.js +2 -0
- package/dist/telegram/token.js +211 -0
- package/dist/telegram--sUKZkSQ.js +218 -0
- package/dist/telegram-T7TInjDG.js +575 -0
- package/dist/telegram-core-B4Jo-uko.js +1 -0
- package/dist/telegram-gE5VPMy9.js +10910 -0
- package/dist/template-messages-kh7VfgOb.js +214 -0
- package/dist/text-chunking-CUf5WgqG.js +19 -0
- package/dist/text-format-sFXlJfHH.js +8 -0
- package/dist/text-runtime-C_Roi_Je.js +1418 -0
- package/dist/theme-B5HDbQfl.js +2 -0
- package/dist/theme-CdOoMzRk.js +34 -0
- package/dist/thinking-BBD_0HSp.js +68 -0
- package/dist/thinking.shared-CncvRHts.js +246 -0
- package/dist/thread-bindings-messages-Cdo8jSa9.js +229 -0
- package/dist/thread-bindings-policy-DMjOaNyR.js +119 -0
- package/dist/thread-bindings-runtime-Ckwk3Uuz.js +1 -0
- package/dist/threading-helpers-Cq55SUtb.js +14 -0
- package/dist/timeouts-BwR1sGom.js +72 -0
- package/dist/tmp-openclaw-dir-idKIOMmb.js +102 -0
- package/dist/token-Bgv8XEsC.js +50 -0
- package/dist/tool-catalog-BV6FcEWS.js +337 -0
- package/dist/tool-policy-match-hui3aCeL.js +46 -0
- package/dist/tool-send-9LXKcrda.js +16 -0
- package/dist/topology-cli-BhUXVViF.js +43 -0
- package/dist/transcript-events-B1V6z5ct.js +29 -0
- package/dist/tui-DPFSXSKf.js +3838 -0
- package/dist/tui-cli-ARm2kBar.js +237 -0
- package/dist/typebox-D0SHDJST.js +175 -0
- package/dist/types-BCKGVVld.js +83 -0
- package/dist/types-CtpUGsDP.js +30 -0
- package/dist/types.secrets-BWSeXrF4.js +80 -0
- package/dist/types.tools-BBO8HCi6.js +22 -0
- package/dist/typing-DG_YqWJ7.js +224 -0
- package/dist/unhandled-rejections-CDJ8dOVP.js +170 -0
- package/dist/unhandled-rejections-O6cVOz2D.js +4 -0
- package/dist/update-check-C3TeQaWg.js +464 -0
- package/dist/update-cli-d9OEgooM.js +1625 -0
- package/dist/update-offset-store-DxnWyB1g.js +211 -0
- package/dist/update-yEO8OZ1B.js +1039 -0
- package/dist/upsert-with-lock-Bb96JHpb.js +34 -0
- package/dist/url-userinfo-Db63ng4y.js +14 -0
- package/dist/utils-Bxk6BLTg.js +236 -0
- package/dist/utils-vDeUf98G.js +7 -0
- package/dist/version-BQotbaVq.js +65 -0
- package/dist/version-riajrkRq.js +2 -0
- package/dist/voice-call-D4fgwZNO.js +1 -0
- package/dist/warning-filter-CgvLQB4Y.js +56 -0
- package/dist/web-media-BfBb8i48.js +1 -0
- package/dist/web-media-CtU6jM5V.js +498 -0
- package/dist/webhook-ingress-CupqYpKM.js +338 -0
- package/dist/webhook-memory-guards-BHrFZ4yq.js +129 -0
- package/dist/webhook-path-BGFZ55ML.js +22 -0
- package/dist/webhook-shared-DPtckp_I.js +349 -0
- package/dist/webhooks-cli-DXesU9a9.js +357 -0
- package/dist/whatsapp-Ba6KkyUx.js +58 -0
- package/dist/whatsapp-DXbWlm3A.js +82 -0
- package/dist/whatsapp-core-Ca4IJFs0.js +89490 -0
- package/dist/whatsapp-heartbeat-CSWnPQ7q.js +84 -0
- package/dist/whatsapp-shared-BmHKqTtR.js +95 -0
- package/dist/widearea-dns-CXimgJzu.js +125 -0
- package/dist/windows-argv-IXrdWrJj.js +145 -0
- package/dist/windows-spawn-vMJGZo89.js +154 -0
- package/dist/with-timeout-2AKTISee.js +58 -0
- package/dist/workspace-BH7CXmrr.js +479 -0
- package/dist/workspace-dirs-_O4V3xCR.js +13 -0
- package/dist/workspace-v5XppK5M.js +302 -0
- package/dist/ws-By-QcLjg.js +11 -0
- package/dist/wsl-BV3Cb66X.js +57 -0
- package/dist/zalo-Ca9sr4FS.js +301 -0
- package/dist/zalo-x6b0tYi0.js +13 -0
- package/dist/zod-schema.agent-runtime-T_EC_6fg.js +600 -0
- package/dist/zod-schema.core-BdgRr-F1.js +545 -0
- package/dist/zod-schema.providers-core-Dgq7MTqU.js +1613 -0
- package/dist-runtime/extensions/acpx/openclaw.plugin.json +120 -0
- package/dist-runtime/extensions/acpx/package.json +14 -0
- package/dist-runtime/extensions/amazon-bedrock/index.js +3 -0
- package/dist-runtime/extensions/amazon-bedrock/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/amazon-bedrock/package.json +12 -0
- package/dist-runtime/extensions/anthropic/index.js +3 -0
- package/dist-runtime/extensions/anthropic/openclaw.plugin.json +42 -0
- package/dist-runtime/extensions/anthropic/package.json +12 -0
- package/dist-runtime/extensions/bluebubbles/index.js +3 -0
- package/dist-runtime/extensions/bluebubbles/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/bluebubbles/package.json +51 -0
- package/dist-runtime/extensions/bluebubbles/setup-entry.js +3 -0
- package/dist-runtime/extensions/brave/index.js +3 -0
- package/dist-runtime/extensions/brave/openclaw.plugin.json +45 -0
- package/dist-runtime/extensions/brave/package.json +12 -0
- package/dist-runtime/extensions/byteplus/index.js +3 -0
- package/dist-runtime/extensions/byteplus/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/byteplus/package.json +12 -0
- package/dist-runtime/extensions/chutes/index.js +3 -0
- package/dist-runtime/extensions/chutes/openclaw.plugin.json +44 -0
- package/dist-runtime/extensions/chutes/package.json +12 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/index.js +3 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/package.json +12 -0
- package/dist-runtime/extensions/copilot-proxy/index.js +3 -0
- package/dist-runtime/extensions/copilot-proxy/openclaw.plugin.json +23 -0
- package/dist-runtime/extensions/copilot-proxy/package.json +12 -0
- package/dist-runtime/extensions/device-pair/index.js +3 -0
- package/dist-runtime/extensions/device-pair/openclaw.plugin.json +20 -0
- package/dist-runtime/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/diagnostics-otel/package.json +27 -0
- package/dist-runtime/extensions/diffs/openclaw.plugin.json +216 -0
- package/dist-runtime/extensions/diffs/package.json +20 -0
- package/dist-runtime/extensions/discord/index.js +3 -0
- package/dist-runtime/extensions/discord/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/discord/package.json +40 -0
- package/dist-runtime/extensions/discord/setup-entry.js +3 -0
- package/dist-runtime/extensions/elevenlabs/index.js +3 -0
- package/dist-runtime/extensions/elevenlabs/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/elevenlabs/package.json +12 -0
- package/dist-runtime/extensions/fal/index.js +3 -0
- package/dist-runtime/extensions/fal/openclaw.plugin.json +34 -0
- package/dist-runtime/extensions/fal/package.json +12 -0
- package/dist-runtime/extensions/feishu/index.js +3 -0
- package/dist-runtime/extensions/feishu/openclaw.plugin.json +14 -0
- package/dist-runtime/extensions/feishu/package.json +42 -0
- package/dist-runtime/extensions/feishu/setup-entry.js +3 -0
- package/dist-runtime/extensions/firecrawl/index.js +3 -0
- package/dist-runtime/extensions/firecrawl/openclaw.plugin.json +41 -0
- package/dist-runtime/extensions/firecrawl/package.json +12 -0
- package/dist-runtime/extensions/github-copilot/index.js +3 -0
- package/dist-runtime/extensions/github-copilot/openclaw.plugin.json +30 -0
- package/dist-runtime/extensions/github-copilot/package.json +12 -0
- package/dist-runtime/extensions/google/index.js +3 -0
- package/dist-runtime/extensions/google/openclaw.plugin.json +71 -0
- package/dist-runtime/extensions/google/package.json +12 -0
- package/dist-runtime/extensions/googlechat/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/googlechat/package.json +46 -0
- package/dist-runtime/extensions/huggingface/index.js +3 -0
- package/dist-runtime/extensions/huggingface/openclaw.plugin.json +33 -0
- package/dist-runtime/extensions/huggingface/package.json +12 -0
- package/dist-runtime/extensions/imessage/index.js +3 -0
- package/dist-runtime/extensions/imessage/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/imessage/package.json +26 -0
- package/dist-runtime/extensions/imessage/setup-entry.js +3 -0
- package/dist-runtime/extensions/irc/index.js +3 -0
- package/dist-runtime/extensions/irc/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/irc/package.json +25 -0
- package/dist-runtime/extensions/irc/setup-entry.js +3 -0
- package/dist-runtime/extensions/kilocode/index.js +3 -0
- package/dist-runtime/extensions/kilocode/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/kilocode/package.json +12 -0
- package/dist-runtime/extensions/kimi-coding/index.js +3 -0
- package/dist-runtime/extensions/kimi-coding/openclaw.plugin.json +37 -0
- package/dist-runtime/extensions/kimi-coding/package.json +12 -0
- package/dist-runtime/extensions/line/index.js +3 -0
- package/dist-runtime/extensions/line/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/line/package.json +39 -0
- package/dist-runtime/extensions/line/setup-entry.js +3 -0
- package/dist-runtime/extensions/llm-task/index.js +3 -0
- package/dist-runtime/extensions/llm-task/openclaw.plugin.json +33 -0
- package/dist-runtime/extensions/llm-task/package.json +16 -0
- package/dist-runtime/extensions/lobster/index.js +3 -0
- package/dist-runtime/extensions/lobster/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/lobster/package.json +17 -0
- package/dist-runtime/extensions/matrix/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/matrix/package.json +53 -0
- package/dist-runtime/extensions/mattermost/index.js +3 -0
- package/dist-runtime/extensions/mattermost/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/mattermost/package.json +41 -0
- package/dist-runtime/extensions/mattermost/setup-entry.js +3 -0
- package/dist-runtime/extensions/memory-core/index.js +3 -0
- package/dist-runtime/extensions/memory-core/openclaw.plugin.json +9 -0
- package/dist-runtime/extensions/memory-core/package.json +20 -0
- package/dist-runtime/extensions/memory-lancedb/openclaw.plugin.json +92 -0
- package/dist-runtime/extensions/memory-lancedb/package.json +24 -0
- package/dist-runtime/extensions/microsoft/index.js +3 -0
- package/dist-runtime/extensions/microsoft/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/microsoft/package.json +12 -0
- package/dist-runtime/extensions/minimax/index.js +3 -0
- package/dist-runtime/extensions/minimax/openclaw.plugin.json +71 -0
- package/dist-runtime/extensions/minimax/package.json +12 -0
- package/dist-runtime/extensions/mistral/index.js +3 -0
- package/dist-runtime/extensions/mistral/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/mistral/package.json +12 -0
- package/dist-runtime/extensions/modelstudio/index.js +3 -0
- package/dist-runtime/extensions/modelstudio/openclaw.plugin.json +46 -0
- package/dist-runtime/extensions/modelstudio/package.json +12 -0
- package/dist-runtime/extensions/moonshot/index.js +3 -0
- package/dist-runtime/extensions/moonshot/openclaw.plugin.json +78 -0
- package/dist-runtime/extensions/moonshot/package.json +12 -0
- package/dist-runtime/extensions/msteams/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/msteams/package.json +48 -0
- package/dist-runtime/extensions/nextcloud-talk/index.js +3 -0
- package/dist-runtime/extensions/nextcloud-talk/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/nextcloud-talk/package.json +48 -0
- package/dist-runtime/extensions/nextcloud-talk/setup-entry.js +3 -0
- package/dist-runtime/extensions/nostr/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/nostr/package.json +45 -0
- package/dist-runtime/extensions/nvidia/index.js +3 -0
- package/dist-runtime/extensions/nvidia/openclaw.plugin.json +16 -0
- package/dist-runtime/extensions/nvidia/package.json +12 -0
- package/dist-runtime/extensions/ollama/index.js +3 -0
- package/dist-runtime/extensions/ollama/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/ollama/package.json +12 -0
- package/dist-runtime/extensions/open-prose/index.js +3 -0
- package/dist-runtime/extensions/open-prose/openclaw.plugin.json +13 -0
- package/dist-runtime/extensions/open-prose/package.json +12 -0
- package/dist-runtime/extensions/openai/index.js +3 -0
- package/dist-runtime/extensions/openai/openclaw.plugin.json +42 -0
- package/dist-runtime/extensions/openai/package.json +12 -0
- package/dist-runtime/extensions/opencode/index.js +3 -0
- package/dist-runtime/extensions/opencode/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/opencode/package.json +12 -0
- package/dist-runtime/extensions/opencode-go/index.js +3 -0
- package/dist-runtime/extensions/opencode-go/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/opencode-go/package.json +12 -0
- package/dist-runtime/extensions/openrouter/index.js +3 -0
- package/dist-runtime/extensions/openrouter/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/openrouter/package.json +12 -0
- package/dist-runtime/extensions/openshell/index.js +3 -0
- package/dist-runtime/extensions/openshell/openclaw.plugin.json +99 -0
- package/dist-runtime/extensions/openshell/package.json +12 -0
- package/dist-runtime/extensions/perplexity/index.js +3 -0
- package/dist-runtime/extensions/perplexity/openclaw.plugin.json +49 -0
- package/dist-runtime/extensions/perplexity/package.json +12 -0
- package/dist-runtime/extensions/phone-control/index.js +3 -0
- package/dist-runtime/extensions/phone-control/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/qianfan/index.js +3 -0
- package/dist-runtime/extensions/qianfan/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/qianfan/package.json +12 -0
- package/dist-runtime/extensions/qwen-portal-auth/index.js +3 -0
- package/dist-runtime/extensions/qwen-portal-auth/openclaw.plugin.json +29 -0
- package/dist-runtime/extensions/sglang/index.js +3 -0
- package/dist-runtime/extensions/sglang/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/sglang/package.json +12 -0
- package/dist-runtime/extensions/signal/index.js +3 -0
- package/dist-runtime/extensions/signal/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/signal/package.json +23 -0
- package/dist-runtime/extensions/signal/setup-entry.js +3 -0
- package/dist-runtime/extensions/slack/index.js +3 -0
- package/dist-runtime/extensions/slack/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/slack/package.json +30 -0
- package/dist-runtime/extensions/slack/setup-entry.js +3 -0
- package/dist-runtime/extensions/synology-chat/index.js +3 -0
- package/dist-runtime/extensions/synology-chat/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/synology-chat/package.json +29 -0
- package/dist-runtime/extensions/synology-chat/setup-entry.js +3 -0
- package/dist-runtime/extensions/synthetic/index.js +3 -0
- package/dist-runtime/extensions/synthetic/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/synthetic/package.json +12 -0
- package/dist-runtime/extensions/talk-voice/index.js +3 -0
- package/dist-runtime/extensions/talk-voice/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/tavily/index.js +3 -0
- package/dist-runtime/extensions/tavily/openclaw.plugin.json +44 -0
- package/dist-runtime/extensions/tavily/package.json +12 -0
- package/dist-runtime/extensions/telegram/index.js +3 -0
- package/dist-runtime/extensions/telegram/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/telegram/package.json +31 -0
- package/dist-runtime/extensions/telegram/setup-entry.js +3 -0
- package/dist-runtime/extensions/thread-ownership/index.js +3 -0
- package/dist-runtime/extensions/thread-ownership/openclaw.plugin.json +30 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/bin/tlon.js +3 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/package.json +40 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/scripts/postinstall.js +3 -0
- package/dist-runtime/extensions/tlon/openclaw.plugin.json +14 -0
- package/dist-runtime/extensions/tlon/package.json +45 -0
- package/dist-runtime/extensions/together/index.js +3 -0
- package/dist-runtime/extensions/together/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/together/package.json +12 -0
- package/dist-runtime/extensions/twitch/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/twitch/package.json +27 -0
- package/dist-runtime/extensions/venice/index.js +3 -0
- package/dist-runtime/extensions/venice/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/venice/package.json +12 -0
- package/dist-runtime/extensions/vercel-ai-gateway/index.js +3 -0
- package/dist-runtime/extensions/vercel-ai-gateway/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/vercel-ai-gateway/package.json +12 -0
- package/dist-runtime/extensions/vllm/index.js +3 -0
- package/dist-runtime/extensions/vllm/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/vllm/package.json +12 -0
- package/dist-runtime/extensions/voice-call/index.js +3 -0
- package/dist-runtime/extensions/voice-call/openclaw.plugin.json +648 -0
- package/dist-runtime/extensions/voice-call/package.json +31 -0
- package/dist-runtime/extensions/volcengine/index.js +3 -0
- package/dist-runtime/extensions/volcengine/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/volcengine/package.json +12 -0
- package/dist-runtime/extensions/whatsapp/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/whatsapp/package.json +44 -0
- package/dist-runtime/extensions/xai/index.js +3 -0
- package/dist-runtime/extensions/xai/openclaw.plugin.json +65 -0
- package/dist-runtime/extensions/xai/package.json +12 -0
- package/dist-runtime/extensions/xiaomi/index.js +3 -0
- package/dist-runtime/extensions/xiaomi/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/xiaomi/package.json +12 -0
- package/dist-runtime/extensions/zai/index.js +3 -0
- package/dist-runtime/extensions/zai/openclaw.plugin.json +88 -0
- package/dist-runtime/extensions/zai/package.json +12 -0
- package/dist-runtime/extensions/zalo/index.js +3 -0
- package/dist-runtime/extensions/zalo/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/zalo/package.json +48 -0
- package/dist-runtime/extensions/zalo/setup-entry.js +3 -0
- package/dist-runtime/extensions/zalouser/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/zalouser/package.json +49 -0
- package/openclaw.mjs +135 -0
- package/package.json +673 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +198 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +295 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/doubao-code/SKILL.md +43 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +865 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/kimi-code/SKILL.md +42 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +320 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +92 -0
- package/skills/openai-image-gen/scripts/gen.py +328 -0
- package/skills/openai-image-gen/scripts/test_gen.py +140 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +153 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +112 -0
- package/skills/xurl/SKILL.md +461 -0
|
@@ -0,0 +1,4923 @@
|
|
|
1
|
+
import { a as logVerbose } from "./globals-41sdSaKv.js";
|
|
2
|
+
import { i as clampInt } from "./utils-Bxk6BLTg.js";
|
|
3
|
+
import { d as normalizeUsageDisplay, p as resolveResponseUsageMode, s as normalizeFastMode } from "./thinking.shared-CncvRHts.js";
|
|
4
|
+
import { S as parseAgentSessionKey, c as normalizeAgentId, u as resolveAgentIdFromSessionKey, v as isAcpSessionKey, x as isSubagentSessionKey } from "./session-key-gFFk3uv9.js";
|
|
5
|
+
import { n as normalizeAccountId, r as normalizeOptionalAccountId } from "./account-id-ZCrgXl7Z.js";
|
|
6
|
+
import { r as normalizeStringEntries } from "./string-normalization-CvzuCAZv.js";
|
|
7
|
+
import { v as resolveSessionAgentId } from "./agent-scope-DPP4Z_UU.js";
|
|
8
|
+
import { A as getConfigOverrides, F as parseConfigPath, I as setConfigValueAtPath, L as unsetConfigValueAtPath, M as setConfigOverride, N as unsetConfigOverride, P as getConfigValueAtPath, b as validateConfigObjectWithPlugins, d as readConfigFileSnapshot, g as writeConfigFile, j as resetConfigOverrides } from "./io-BjKpaXU3.js";
|
|
9
|
+
import { o as normalizeChannelId } from "./registry-rgYi7KoO.js";
|
|
10
|
+
import { t as parseDurationMs } from "./parse-duration-BBGYkY0S.js";
|
|
11
|
+
import { a as isInternalMessageChannel, h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-Cy-gN4K2.js";
|
|
12
|
+
import { l as updateSessionStore, n as loadSessionStore } from "./store-AMSZUI0p.js";
|
|
13
|
+
import { t as getChannelPlugin } from "./registry-C3q59Qj0.js";
|
|
14
|
+
import { i as resolveSessionFilePathOptions, l as resolveStorePath, r as resolveSessionFilePath } from "./paths-CTjJI9l0.js";
|
|
15
|
+
import { a as resolveFreshSessionTotalTokens } from "./types-BCKGVVld.js";
|
|
16
|
+
import { n as callGateway } from "./call-I0SGvyU7.js";
|
|
17
|
+
import { r as isRestartEnabled, t as isCommandFlagEnabled } from "./commands-Bb9xUwz9.js";
|
|
18
|
+
import { $d as setLastTtsAttempt, $l as parseActivationCommand, $r as extractBtwQuestion, Al as resolveConversationIdFromTargets, Ba as handleHelpCommand, Bd as getTtsMaxLength, Bl as clearSessionQueues, Cl as resolveMainSessionAlias, Ct as isTelegramExecApprovalClientEnabled, Ef as killProcessTree, Fa as requireGatewayClientScopeForInternalChannel, Fp as resolveAcpAgentPolicyError, Gs as formatContextUsageShort, Ha as handleWhoamiCommand, Hd as isSummarizationEnabled, If as resolveSendPolicy, Ip as resolveAcpDispatchPolicyError, Is as createExecTool, Jd as resolveTtsApiKey, Jm as parseExplicitTargetForChannel, Ks as formatTokenCount, La as handleCommandsListCommand, Ll as incrementCompactionCount, Lp as resolveAcpDispatchPolicyMessage, Ls as getFinishedSession, Ma as rejectNonOwnerCommand, Ml as normalizeConversationText, Mm as getGlobalHookRunner, Mp as resolveAcpSessionIdentifierLinesFromIdentity, Na as rejectUnauthorizedCommand, Nl as parseTelegramChatIdFromTarget, Np as resolveAcpThreadSessionDetailLines, Ol as parseDiscordParentChannelFromSessionKey, Pa as requireCommandFlagEnabled, Pp as isAcpEnabledByPolicy, Ra as handleContextCommand, Rl as stripToolResultDetails, Rs as getSession, Sl as resolveInternalSessionKey, St as isTelegramExecApprovalApprover, Tl as looksLikeSessionId, Ud as isTtsEnabled, Va as handleStatusCommand, Vd as getTtsProvider, Vl as routeReply, Vm as executePluginCommand, Wd as isTtsProviderConfigured, Wm as matchPluginCommand, Xd as resolveTtsConfig, Zd as resolveTtsPrefsPath, Zl as formatElevatedUnavailableMessage, _o as cleanupFailedAcpSpawn, a as isEmbeddedPiRunActive, al as resolveSessionEntryForKey, bl as sanitizeTextContent, c as compactEmbeddedPiSession, cf as listSpeechProviders, cl as countPendingDescendantRuns, cm as EmbeddedBlockChunker, co as steerControlledSubagentRun, do as formatRunStatus, ef as setSummarizationEnabled, fo as resolveSubagentTargetFromRuns, go as resolveAcpSpawnRuntimePolicyError, hm as ensureOpenClawModelsJson, ho as resolveStoredSubagentCapabilities, i as getActiveEmbeddedRunSnapshot, if as setTtsProvider, il as formatAbortReplyText, io as killControlledSubagentRun, is as scheduleGatewaySigusr1Restart, ja as buildDisabledCommandReply, jl as buildTelegramTopicConversationId, jp as resolveAcpSessionCwd, ka as handleModelsCommand, kl as resolveEffectiveResetTargetSessionKey, ld as formatTokenCount$1, lf as normalizeSpeechProviderId, lo as formatDurationCompact, ml as listSubagentRunsForController, mo as spawnSubagentDirect, n as abortEmbeddedPiRun, nf as setTtsEnabled, nl as formatAcpRuntimeErrorText, no as buildSubagentList, of as textToSpeech, ol as stopSubagentsForRequester, po as sortSubagentRuns, rf as setTtsMaxLength, rl as toAcpRuntimeErrorText, ro as killAllControlledSubagentRuns, s as waitForEmbeddedPiRunEnd, sm as extractTextFromChatContent, so as sendControlledSubagentMessage, ss as triggerOpenClawRestart, u as mapThinkingLevel, ud as formatUsd, uo as formatRunLabel, wl as SESSION_ID_RE, wp as resolveFastModeState, xf as resolveModelWithRegistry, xl as stripToolMessages, za as handleExportSessionCommand, zd as getLastTtsAttempt, zs as markExited } from "./pi-embedded-CDH9LrEg.js";
|
|
19
|
+
import { n as getApiKeyForModel, o as requireApiKey } from "./model-auth-Blh0xL9g.js";
|
|
20
|
+
import { t as diag } from "./diagnostic-DBAi0Q5B.js";
|
|
21
|
+
import { i as resolveThreadBindingThreadName, o as getSessionBindingService, r as resolveThreadBindingIntroText, t as formatThreadBindingDurationLabel } from "./thread-bindings-messages-Cdo8jSa9.js";
|
|
22
|
+
import { c as resetConfiguredBindingTargetInPlace } from "./conversation-runtime-zmG5YBsE.js";
|
|
23
|
+
import { d as triggerInternalHook, n as createInternalHookEvent } from "./internal-hooks-0uipqzRY.js";
|
|
24
|
+
import { P as resolveSandboxRuntimeStatus } from "./sandbox-Ceruxpo4.js";
|
|
25
|
+
import { r as setPluginEnabledInConfig } from "./provider-web-search-D2JPMqCP.js";
|
|
26
|
+
import { b as toAcpRuntimeError, c as parseRuntimeTimeoutSecondsInput, d as validateRuntimeModeInput, f as validateRuntimeModelInput, h as resolveAcpSessionResolutionError, i as getAcpRuntimeBackend, l as validateRuntimeConfigOptionInput, n as readAcpSessionEntry, o as requireAcpRuntimeBackend, p as validateRuntimePermissionProfileInput, r as resolveSessionStorePathForAcp, t as getAcpSessionManager, u as validateRuntimeCwdInput } from "./manager-BF-xRVUt.js";
|
|
27
|
+
import { _ as authorizeConfigWrite, v as canBypassConfigWritePolicy, x as resolveConfigWriteTargetFromPath, y as formatConfigWriteDeniedMessage } from "./channel-config-helpers-ChUYvBB0.js";
|
|
28
|
+
import { a as readChannelAllowFromStore, l as removeChannelAllowFromStoreEntry, t as addChannelAllowFromStoreEntry } from "./pairing-store-C4lsd4pO.js";
|
|
29
|
+
import { d as resolveSessionAuthProfileOverride } from "./model-selection-slZyRw2d.js";
|
|
30
|
+
import { r as enqueueSystemEvent } from "./system-events-mAu6Ap6K.js";
|
|
31
|
+
import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-CuX5CDyZ.js";
|
|
32
|
+
import { o as stripMentions, s as stripStructuralPrefixes } from "./mentions-Bxys_va0.js";
|
|
33
|
+
import { a as shouldPersistAbortCutoff, i as resolveAbortCutoffFromContext, t as applyAbortCutoffToSessionEntry } from "./abort-cutoff-CERmtgZI.js";
|
|
34
|
+
import { p as normalizeCommandBody, y as shouldHandleTextCommands } from "./commands-registry-ChCep1KJ.js";
|
|
35
|
+
import { v as isAbortTrigger, y as setAbortMemory } from "./channel-inbound-3L_8TOZ0.js";
|
|
36
|
+
import { n as formatTimeAgo } from "./format-relative-C3nDxnXz.js";
|
|
37
|
+
import { d as resolveThreadBindingSpawnPolicy, i as formatThreadBindingSpawnDisabledError, r as formatThreadBindingDisabledError, s as resolveThreadBindingIdleTimeoutMsForChannel, u as resolveThreadBindingMaxAgeMsForChannel } from "./thread-bindings-policy-DMjOaNyR.js";
|
|
38
|
+
import { i as unsetConfiguredMcpServer, r as setConfiguredMcpServer, t as listConfiguredMcpServers } from "./mcp-config-BcFTambR.js";
|
|
39
|
+
import { n as createPluginRuntime } from "./runtime-Dwejo3y0.js";
|
|
40
|
+
import { t as parseConfigValue } from "./config-value-DgJrpclm.js";
|
|
41
|
+
import { a as buildPluginStatusReport, i as buildPluginInspectReport, o as formatPluginCompatibilityNotice, t as buildAllPluginInspectReports } from "./status-COGoXc70.js";
|
|
42
|
+
import { n as loadCostUsageSummary, r as loadSessionCostSummary } from "./session-cost-usage-Bcu2puh5.js";
|
|
43
|
+
import { existsSync } from "node:fs";
|
|
44
|
+
import path from "node:path";
|
|
45
|
+
import fs$1 from "node:fs/promises";
|
|
46
|
+
import { randomUUID } from "node:crypto";
|
|
47
|
+
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
48
|
+
import { streamSimple } from "@mariozechner/pi-ai";
|
|
49
|
+
//#region src/auto-reply/reply/matrix-context.ts
|
|
50
|
+
function normalizeMatrixTarget(value) {
|
|
51
|
+
return typeof value === "string" ? value.trim() : "";
|
|
52
|
+
}
|
|
53
|
+
function resolveMatrixRoomIdFromTarget(raw) {
|
|
54
|
+
let target = normalizeMatrixTarget(raw);
|
|
55
|
+
if (!target) return;
|
|
56
|
+
if (target.toLowerCase().startsWith("matrix:")) target = target.slice(7).trim();
|
|
57
|
+
if (/^(room|channel):/i.test(target)) return target.replace(/^(room|channel):/i, "").trim() || void 0;
|
|
58
|
+
if (target.startsWith("!") || target.startsWith("#")) return target;
|
|
59
|
+
}
|
|
60
|
+
function resolveMatrixParentConversationId(params) {
|
|
61
|
+
const targets = [
|
|
62
|
+
params.ctx.OriginatingTo,
|
|
63
|
+
params.command.to,
|
|
64
|
+
params.ctx.To
|
|
65
|
+
];
|
|
66
|
+
for (const candidate of targets) {
|
|
67
|
+
const roomId = resolveMatrixRoomIdFromTarget(candidate ?? "");
|
|
68
|
+
if (roomId) return roomId;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function resolveMatrixConversationId(params) {
|
|
72
|
+
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
73
|
+
if (threadId) return threadId;
|
|
74
|
+
return resolveMatrixParentConversationId(params);
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/auto-reply/reply/telegram-context.ts
|
|
78
|
+
function resolveTelegramConversationId(params) {
|
|
79
|
+
const threadId = (params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "") || void 0;
|
|
80
|
+
const chatId = [
|
|
81
|
+
typeof params.ctx.OriginatingTo === "string" ? params.ctx.OriginatingTo : "",
|
|
82
|
+
typeof params.command.to === "string" ? params.command.to : "",
|
|
83
|
+
typeof params.ctx.To === "string" ? params.ctx.To : ""
|
|
84
|
+
].map((value) => value.trim()).filter(Boolean).map((candidate) => parseExplicitTargetForChannel("telegram", candidate)?.to.trim() ?? "").find((candidate) => candidate.length > 0);
|
|
85
|
+
if (!chatId) return;
|
|
86
|
+
if (threadId) return `${chatId}:topic:${threadId}`;
|
|
87
|
+
if (chatId.startsWith("-")) return;
|
|
88
|
+
return chatId;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/auto-reply/reply/commands-acp/context.ts
|
|
92
|
+
function buildFeishuConversationId(params) {
|
|
93
|
+
const chatId = normalizeConversationText(params.chatId) ?? "unknown";
|
|
94
|
+
const senderOpenId = normalizeConversationText(params.senderOpenId);
|
|
95
|
+
const topicId = normalizeConversationText(params.topicId);
|
|
96
|
+
switch (params.scope) {
|
|
97
|
+
case "group_sender": return senderOpenId ? `${chatId}:sender:${senderOpenId}` : chatId;
|
|
98
|
+
case "group_topic": return topicId ? `${chatId}:topic:${topicId}` : chatId;
|
|
99
|
+
case "group_topic_sender":
|
|
100
|
+
if (topicId && senderOpenId) return `${chatId}:topic:${topicId}:sender:${senderOpenId}`;
|
|
101
|
+
if (topicId) return `${chatId}:topic:${topicId}`;
|
|
102
|
+
return senderOpenId ? `${chatId}:sender:${senderOpenId}` : chatId;
|
|
103
|
+
default: return chatId;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function parseFeishuTargetId(raw) {
|
|
107
|
+
const target = normalizeConversationText(raw);
|
|
108
|
+
if (!target) return;
|
|
109
|
+
const withoutProvider = target.replace(/^(feishu|lark):/i, "").trim();
|
|
110
|
+
if (!withoutProvider) return;
|
|
111
|
+
const lowered = withoutProvider.toLowerCase();
|
|
112
|
+
for (const prefix of [
|
|
113
|
+
"chat:",
|
|
114
|
+
"group:",
|
|
115
|
+
"channel:",
|
|
116
|
+
"user:",
|
|
117
|
+
"dm:",
|
|
118
|
+
"open_id:"
|
|
119
|
+
]) if (lowered.startsWith(prefix)) return normalizeConversationText(withoutProvider.slice(prefix.length));
|
|
120
|
+
return withoutProvider;
|
|
121
|
+
}
|
|
122
|
+
function parseFeishuDirectConversationId(raw) {
|
|
123
|
+
const target = normalizeConversationText(raw);
|
|
124
|
+
if (!target) return;
|
|
125
|
+
const withoutProvider = target.replace(/^(feishu|lark):/i, "").trim();
|
|
126
|
+
if (!withoutProvider) return;
|
|
127
|
+
const lowered = withoutProvider.toLowerCase();
|
|
128
|
+
for (const prefix of [
|
|
129
|
+
"user:",
|
|
130
|
+
"dm:",
|
|
131
|
+
"open_id:"
|
|
132
|
+
]) if (lowered.startsWith(prefix)) return normalizeConversationText(withoutProvider.slice(prefix.length));
|
|
133
|
+
const id = parseFeishuTargetId(target);
|
|
134
|
+
if (!id) return;
|
|
135
|
+
if (id.startsWith("ou_") || id.startsWith("on_")) return id;
|
|
136
|
+
}
|
|
137
|
+
function resolveFeishuSenderScopedConversationId(params) {
|
|
138
|
+
const parentConversationId = normalizeConversationText(params.parentConversationId);
|
|
139
|
+
const threadId = normalizeConversationText(params.threadId);
|
|
140
|
+
const senderId = normalizeConversationText(params.senderId);
|
|
141
|
+
const expectedScopePrefix = `feishu:group:${parentConversationId?.toLowerCase()}:topic:${threadId?.toLowerCase()}:sender:`;
|
|
142
|
+
const isSenderScopedSession = [params.sessionKey, params.parentSessionKey].some((candidate) => {
|
|
143
|
+
const scopedRest = parseAgentSessionKey(candidate)?.rest?.trim().toLowerCase() ?? "";
|
|
144
|
+
return Boolean(scopedRest && expectedScopePrefix && scopedRest.startsWith(expectedScopePrefix));
|
|
145
|
+
});
|
|
146
|
+
if (!parentConversationId || !threadId || !senderId) return;
|
|
147
|
+
if (!isSenderScopedSession && params.sessionKey?.trim()) {
|
|
148
|
+
const boundConversation = getSessionBindingService().listBySession(params.sessionKey).find((binding) => {
|
|
149
|
+
if (binding.conversation.channel !== "feishu" || binding.conversation.accountId !== params.accountId) return false;
|
|
150
|
+
return binding.conversation.conversationId === buildFeishuConversationId({
|
|
151
|
+
chatId: parentConversationId,
|
|
152
|
+
scope: "group_topic_sender",
|
|
153
|
+
topicId: threadId,
|
|
154
|
+
senderOpenId: senderId
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
if (boundConversation) return boundConversation.conversation.conversationId;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
return buildFeishuConversationId({
|
|
161
|
+
chatId: parentConversationId,
|
|
162
|
+
scope: "group_topic_sender",
|
|
163
|
+
topicId: threadId,
|
|
164
|
+
senderOpenId: senderId
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function resolveAcpCommandChannel(params) {
|
|
168
|
+
return normalizeConversationText(params.ctx.OriginatingChannel ?? params.command.channel ?? params.ctx.Surface ?? params.ctx.Provider).toLowerCase();
|
|
169
|
+
}
|
|
170
|
+
function resolveAcpCommandAccountId(params) {
|
|
171
|
+
return normalizeConversationText(params.ctx.AccountId) || "default";
|
|
172
|
+
}
|
|
173
|
+
function resolveAcpCommandThreadId(params) {
|
|
174
|
+
return (params.ctx.MessageThreadId != null ? normalizeConversationText(String(params.ctx.MessageThreadId)) : "") || void 0;
|
|
175
|
+
}
|
|
176
|
+
function resolveAcpCommandConversationId(params) {
|
|
177
|
+
const channel = resolveAcpCommandChannel(params);
|
|
178
|
+
if (channel === "matrix") return resolveMatrixConversationId({
|
|
179
|
+
ctx: {
|
|
180
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
181
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
182
|
+
To: params.ctx.To
|
|
183
|
+
},
|
|
184
|
+
command: { to: params.command.to }
|
|
185
|
+
});
|
|
186
|
+
if (channel === "telegram") {
|
|
187
|
+
const telegramConversationId = resolveTelegramConversationId({
|
|
188
|
+
ctx: {
|
|
189
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
190
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
191
|
+
To: params.ctx.To
|
|
192
|
+
},
|
|
193
|
+
command: { to: params.command.to }
|
|
194
|
+
});
|
|
195
|
+
if (telegramConversationId) return telegramConversationId;
|
|
196
|
+
const threadId = resolveAcpCommandThreadId(params);
|
|
197
|
+
const parentConversationId = resolveAcpCommandParentConversationId(params);
|
|
198
|
+
if (threadId && parentConversationId) return buildTelegramTopicConversationId({
|
|
199
|
+
chatId: parentConversationId,
|
|
200
|
+
topicId: threadId
|
|
201
|
+
}) ?? threadId;
|
|
202
|
+
}
|
|
203
|
+
if (channel === "feishu") {
|
|
204
|
+
const threadId = resolveAcpCommandThreadId(params);
|
|
205
|
+
const parentConversationId = resolveAcpCommandParentConversationId(params);
|
|
206
|
+
if (threadId && parentConversationId) return resolveFeishuSenderScopedConversationId({
|
|
207
|
+
accountId: resolveAcpCommandAccountId(params),
|
|
208
|
+
parentConversationId,
|
|
209
|
+
threadId,
|
|
210
|
+
senderId: params.command.senderId ?? params.ctx.SenderId,
|
|
211
|
+
sessionKey: params.sessionKey,
|
|
212
|
+
parentSessionKey: params.ctx.ParentSessionKey
|
|
213
|
+
}) ?? buildFeishuConversationId({
|
|
214
|
+
chatId: parentConversationId,
|
|
215
|
+
scope: "group_topic",
|
|
216
|
+
topicId: threadId
|
|
217
|
+
});
|
|
218
|
+
return parseFeishuDirectConversationId(params.ctx.OriginatingTo) ?? parseFeishuDirectConversationId(params.command.to) ?? parseFeishuDirectConversationId(params.ctx.To);
|
|
219
|
+
}
|
|
220
|
+
return resolveConversationIdFromTargets({
|
|
221
|
+
threadId: params.ctx.MessageThreadId,
|
|
222
|
+
targets: [
|
|
223
|
+
params.ctx.OriginatingTo,
|
|
224
|
+
params.command.to,
|
|
225
|
+
params.ctx.To
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function parseDiscordParentChannelFromContext(raw) {
|
|
230
|
+
const parentId = normalizeConversationText(raw);
|
|
231
|
+
if (!parentId) return;
|
|
232
|
+
return parentId;
|
|
233
|
+
}
|
|
234
|
+
function resolveAcpCommandParentConversationId(params) {
|
|
235
|
+
const channel = resolveAcpCommandChannel(params);
|
|
236
|
+
if (channel === "matrix") return resolveMatrixParentConversationId({
|
|
237
|
+
ctx: {
|
|
238
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
239
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
240
|
+
To: params.ctx.To
|
|
241
|
+
},
|
|
242
|
+
command: { to: params.command.to }
|
|
243
|
+
});
|
|
244
|
+
if (channel === "telegram") return parseTelegramChatIdFromTarget(params.ctx.OriginatingTo) ?? parseTelegramChatIdFromTarget(params.command.to) ?? parseTelegramChatIdFromTarget(params.ctx.To);
|
|
245
|
+
if (channel === "feishu") {
|
|
246
|
+
if (!resolveAcpCommandThreadId(params)) return;
|
|
247
|
+
return parseFeishuTargetId(params.ctx.OriginatingTo) ?? parseFeishuTargetId(params.command.to) ?? parseFeishuTargetId(params.ctx.To);
|
|
248
|
+
}
|
|
249
|
+
if (channel === "discord") {
|
|
250
|
+
const threadId = resolveAcpCommandThreadId(params);
|
|
251
|
+
if (!threadId) return;
|
|
252
|
+
const fromContext = parseDiscordParentChannelFromContext(params.ctx.ThreadParentId);
|
|
253
|
+
if (fromContext && fromContext !== threadId) return fromContext;
|
|
254
|
+
const fromParentSession = parseDiscordParentChannelFromSessionKey(params.ctx.ParentSessionKey);
|
|
255
|
+
if (fromParentSession && fromParentSession !== threadId) return fromParentSession;
|
|
256
|
+
const fromTargets = resolveConversationIdFromTargets({ targets: [
|
|
257
|
+
params.ctx.OriginatingTo,
|
|
258
|
+
params.command.to,
|
|
259
|
+
params.ctx.To
|
|
260
|
+
] });
|
|
261
|
+
if (fromTargets && fromTargets !== threadId) return fromTargets;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function resolveAcpCommandBindingContext(params) {
|
|
265
|
+
const parentConversationId = resolveAcpCommandParentConversationId(params);
|
|
266
|
+
return {
|
|
267
|
+
channel: resolveAcpCommandChannel(params),
|
|
268
|
+
accountId: resolveAcpCommandAccountId(params),
|
|
269
|
+
threadId: resolveAcpCommandThreadId(params),
|
|
270
|
+
conversationId: resolveAcpCommandConversationId(params),
|
|
271
|
+
...parentConversationId ? { parentConversationId } : {}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/auto-reply/reply/commands-acp/install-hints.ts
|
|
276
|
+
function resolveConfiguredAcpBackendId(cfg) {
|
|
277
|
+
return cfg.acp?.backend?.trim() || "acpx";
|
|
278
|
+
}
|
|
279
|
+
function resolveAcpInstallCommandHint(cfg) {
|
|
280
|
+
const configured = cfg.acp?.runtime?.installCommand?.trim();
|
|
281
|
+
if (configured) return configured;
|
|
282
|
+
const backendId = resolveConfiguredAcpBackendId(cfg).toLowerCase();
|
|
283
|
+
if (backendId === "acpx") {
|
|
284
|
+
const localPath = path.resolve(process.cwd(), "extensions/acpx");
|
|
285
|
+
if (existsSync(localPath)) return `openclaw plugins install ${localPath}`;
|
|
286
|
+
return "openclaw plugins install acpx";
|
|
287
|
+
}
|
|
288
|
+
return `Install and enable the plugin that provides ACP backend "${backendId}".`;
|
|
289
|
+
}
|
|
290
|
+
const ACP_SPAWN_USAGE = "Usage: /acp spawn [harness-id] [--mode persistent|oneshot] [--thread auto|here|off] [--cwd <path>] [--label <label>].";
|
|
291
|
+
const ACP_STEER_USAGE = "Usage: /acp steer [--session <session-key|session-id|session-label>] <instruction>";
|
|
292
|
+
const ACP_SET_MODE_USAGE = "Usage: /acp set-mode <mode> [session-key|session-id|session-label]";
|
|
293
|
+
const ACP_SET_USAGE = "Usage: /acp set <key> <value> [session-key|session-id|session-label]";
|
|
294
|
+
const ACP_CWD_USAGE = "Usage: /acp cwd <path> [session-key|session-id|session-label]";
|
|
295
|
+
const ACP_PERMISSIONS_USAGE = "Usage: /acp permissions <profile> [session-key|session-id|session-label]";
|
|
296
|
+
const ACP_TIMEOUT_USAGE = "Usage: /acp timeout <seconds> [session-key|session-id|session-label]";
|
|
297
|
+
const ACP_MODEL_USAGE = "Usage: /acp model <model-id> [session-key|session-id|session-label]";
|
|
298
|
+
const ACP_RESET_OPTIONS_USAGE = "Usage: /acp reset-options [session-key|session-id|session-label]";
|
|
299
|
+
const ACP_STATUS_USAGE = "Usage: /acp status [session-key|session-id|session-label]";
|
|
300
|
+
const ACP_INSTALL_USAGE = "Usage: /acp install";
|
|
301
|
+
const ACP_DOCTOR_USAGE = "Usage: /acp doctor";
|
|
302
|
+
const ACP_SESSIONS_USAGE = "Usage: /acp sessions";
|
|
303
|
+
const ACP_UNICODE_DASH_PREFIX_RE = /^[\u2010\u2011\u2012\u2013\u2014\u2015\u2212\uFE58\uFE63\uFF0D]+/;
|
|
304
|
+
function stopWithText$1(text) {
|
|
305
|
+
return {
|
|
306
|
+
shouldContinue: false,
|
|
307
|
+
reply: { text }
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function resolveAcpAction(tokens) {
|
|
311
|
+
const action = tokens[0]?.trim().toLowerCase();
|
|
312
|
+
if (action === "spawn" || action === "cancel" || action === "steer" || action === "close" || action === "sessions" || action === "status" || action === "set-mode" || action === "set" || action === "cwd" || action === "permissions" || action === "timeout" || action === "model" || action === "reset-options" || action === "doctor" || action === "install" || action === "help") {
|
|
313
|
+
tokens.shift();
|
|
314
|
+
return action;
|
|
315
|
+
}
|
|
316
|
+
return "help";
|
|
317
|
+
}
|
|
318
|
+
function readOptionValue(params) {
|
|
319
|
+
const token = normalizeAcpOptionToken(params.tokens[params.index] ?? "");
|
|
320
|
+
if (token === params.flag) {
|
|
321
|
+
const nextValue = normalizeAcpOptionToken(params.tokens[params.index + 1] ?? "");
|
|
322
|
+
if (!nextValue || nextValue.startsWith("--")) return {
|
|
323
|
+
matched: true,
|
|
324
|
+
nextIndex: params.index + 1,
|
|
325
|
+
error: `${params.flag} requires a value`
|
|
326
|
+
};
|
|
327
|
+
return {
|
|
328
|
+
matched: true,
|
|
329
|
+
value: nextValue,
|
|
330
|
+
nextIndex: params.index + 2
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
if (token.startsWith(`${params.flag}=`)) {
|
|
334
|
+
const value = token.slice(`${params.flag}=`.length).trim();
|
|
335
|
+
if (!value) return {
|
|
336
|
+
matched: true,
|
|
337
|
+
nextIndex: params.index + 1,
|
|
338
|
+
error: `${params.flag} requires a value`
|
|
339
|
+
};
|
|
340
|
+
return {
|
|
341
|
+
matched: true,
|
|
342
|
+
value,
|
|
343
|
+
nextIndex: params.index + 1
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
return { matched: false };
|
|
347
|
+
}
|
|
348
|
+
function normalizeAcpOptionToken(raw) {
|
|
349
|
+
const token = raw.trim();
|
|
350
|
+
if (!token || token.startsWith("--")) return token;
|
|
351
|
+
const dashPrefix = token.match(ACP_UNICODE_DASH_PREFIX_RE)?.[0];
|
|
352
|
+
if (!dashPrefix) return token;
|
|
353
|
+
return `--${token.slice(dashPrefix.length)}`;
|
|
354
|
+
}
|
|
355
|
+
function resolveDefaultSpawnThreadMode(params) {
|
|
356
|
+
const channel = resolveAcpCommandChannel(params);
|
|
357
|
+
if (channel !== "discord" && channel !== "matrix") return "off";
|
|
358
|
+
return resolveAcpCommandThreadId(params) ? "here" : "auto";
|
|
359
|
+
}
|
|
360
|
+
function parseSpawnInput(params, tokens) {
|
|
361
|
+
const normalizedTokens = tokens.map((token) => normalizeAcpOptionToken(token));
|
|
362
|
+
let mode = "persistent";
|
|
363
|
+
let thread = resolveDefaultSpawnThreadMode(params);
|
|
364
|
+
let cwd;
|
|
365
|
+
let label;
|
|
366
|
+
let rawAgentId;
|
|
367
|
+
for (let i = 0; i < normalizedTokens.length;) {
|
|
368
|
+
const token = normalizedTokens[i] ?? "";
|
|
369
|
+
const modeOption = readOptionValue({
|
|
370
|
+
tokens: normalizedTokens,
|
|
371
|
+
index: i,
|
|
372
|
+
flag: "--mode"
|
|
373
|
+
});
|
|
374
|
+
if (modeOption.matched) {
|
|
375
|
+
if (modeOption.error) return {
|
|
376
|
+
ok: false,
|
|
377
|
+
error: `${modeOption.error}. ${ACP_SPAWN_USAGE}`
|
|
378
|
+
};
|
|
379
|
+
const raw = modeOption.value?.trim().toLowerCase();
|
|
380
|
+
if (raw !== "persistent" && raw !== "oneshot") return {
|
|
381
|
+
ok: false,
|
|
382
|
+
error: `Invalid --mode value "${modeOption.value}". Use persistent or oneshot.`
|
|
383
|
+
};
|
|
384
|
+
mode = raw;
|
|
385
|
+
i = modeOption.nextIndex;
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
const threadOption = readOptionValue({
|
|
389
|
+
tokens: normalizedTokens,
|
|
390
|
+
index: i,
|
|
391
|
+
flag: "--thread"
|
|
392
|
+
});
|
|
393
|
+
if (threadOption.matched) {
|
|
394
|
+
if (threadOption.error) return {
|
|
395
|
+
ok: false,
|
|
396
|
+
error: `${threadOption.error}. ${ACP_SPAWN_USAGE}`
|
|
397
|
+
};
|
|
398
|
+
const raw = threadOption.value?.trim().toLowerCase();
|
|
399
|
+
if (raw !== "auto" && raw !== "here" && raw !== "off") return {
|
|
400
|
+
ok: false,
|
|
401
|
+
error: `Invalid --thread value "${threadOption.value}". Use auto, here, or off.`
|
|
402
|
+
};
|
|
403
|
+
thread = raw;
|
|
404
|
+
i = threadOption.nextIndex;
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
const cwdOption = readOptionValue({
|
|
408
|
+
tokens: normalizedTokens,
|
|
409
|
+
index: i,
|
|
410
|
+
flag: "--cwd"
|
|
411
|
+
});
|
|
412
|
+
if (cwdOption.matched) {
|
|
413
|
+
if (cwdOption.error) return {
|
|
414
|
+
ok: false,
|
|
415
|
+
error: `${cwdOption.error}. ${ACP_SPAWN_USAGE}`
|
|
416
|
+
};
|
|
417
|
+
cwd = cwdOption.value?.trim();
|
|
418
|
+
i = cwdOption.nextIndex;
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
const labelOption = readOptionValue({
|
|
422
|
+
tokens: normalizedTokens,
|
|
423
|
+
index: i,
|
|
424
|
+
flag: "--label"
|
|
425
|
+
});
|
|
426
|
+
if (labelOption.matched) {
|
|
427
|
+
if (labelOption.error) return {
|
|
428
|
+
ok: false,
|
|
429
|
+
error: `${labelOption.error}. ${ACP_SPAWN_USAGE}`
|
|
430
|
+
};
|
|
431
|
+
label = labelOption.value?.trim();
|
|
432
|
+
i = labelOption.nextIndex;
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (token.startsWith("--")) return {
|
|
436
|
+
ok: false,
|
|
437
|
+
error: `Unknown option: ${token}. ${ACP_SPAWN_USAGE}`
|
|
438
|
+
};
|
|
439
|
+
if (!rawAgentId) {
|
|
440
|
+
rawAgentId = token.trim();
|
|
441
|
+
i += 1;
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
ok: false,
|
|
446
|
+
error: `Unexpected argument: ${token}. ${ACP_SPAWN_USAGE}`
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
const fallbackAgent = params.cfg.acp?.defaultAgent?.trim() || "";
|
|
450
|
+
const selectedAgent = (rawAgentId?.trim() || fallbackAgent).trim();
|
|
451
|
+
if (!selectedAgent) return {
|
|
452
|
+
ok: false,
|
|
453
|
+
error: `ACP target harness id is required. Pass an ACP harness id (for example codex) or configure acp.defaultAgent. ${ACP_SPAWN_USAGE}`
|
|
454
|
+
};
|
|
455
|
+
return {
|
|
456
|
+
ok: true,
|
|
457
|
+
value: {
|
|
458
|
+
agentId: normalizeAgentId(selectedAgent),
|
|
459
|
+
mode,
|
|
460
|
+
thread,
|
|
461
|
+
cwd,
|
|
462
|
+
label: label || void 0
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function parseSteerInput(tokens) {
|
|
467
|
+
const normalizedTokens = tokens.map((token) => normalizeAcpOptionToken(token));
|
|
468
|
+
let sessionToken;
|
|
469
|
+
const instructionTokens = [];
|
|
470
|
+
for (let i = 0; i < normalizedTokens.length;) {
|
|
471
|
+
const sessionOption = readOptionValue({
|
|
472
|
+
tokens: normalizedTokens,
|
|
473
|
+
index: i,
|
|
474
|
+
flag: "--session"
|
|
475
|
+
});
|
|
476
|
+
if (sessionOption.matched) {
|
|
477
|
+
if (sessionOption.error) return {
|
|
478
|
+
ok: false,
|
|
479
|
+
error: `${sessionOption.error}. ${ACP_STEER_USAGE}`
|
|
480
|
+
};
|
|
481
|
+
sessionToken = sessionOption.value?.trim() || void 0;
|
|
482
|
+
i = sessionOption.nextIndex;
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
instructionTokens.push(tokens[i] ?? "");
|
|
486
|
+
i += 1;
|
|
487
|
+
}
|
|
488
|
+
const instruction = instructionTokens.join(" ").trim();
|
|
489
|
+
if (!instruction) return {
|
|
490
|
+
ok: false,
|
|
491
|
+
error: ACP_STEER_USAGE
|
|
492
|
+
};
|
|
493
|
+
return {
|
|
494
|
+
ok: true,
|
|
495
|
+
value: {
|
|
496
|
+
sessionToken,
|
|
497
|
+
instruction
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function parseSingleValueCommandInput(tokens, usage) {
|
|
502
|
+
const value = tokens[0]?.trim() || "";
|
|
503
|
+
if (!value) return {
|
|
504
|
+
ok: false,
|
|
505
|
+
error: usage
|
|
506
|
+
};
|
|
507
|
+
if (tokens.length > 2) return {
|
|
508
|
+
ok: false,
|
|
509
|
+
error: usage
|
|
510
|
+
};
|
|
511
|
+
return {
|
|
512
|
+
ok: true,
|
|
513
|
+
value: {
|
|
514
|
+
value,
|
|
515
|
+
sessionToken: tokens[1]?.trim() || void 0
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function parseSetCommandInput(tokens) {
|
|
520
|
+
const key = tokens[0]?.trim() || "";
|
|
521
|
+
const value = tokens[1]?.trim() || "";
|
|
522
|
+
if (!key || !value) return {
|
|
523
|
+
ok: false,
|
|
524
|
+
error: ACP_SET_USAGE
|
|
525
|
+
};
|
|
526
|
+
if (tokens.length > 3) return {
|
|
527
|
+
ok: false,
|
|
528
|
+
error: ACP_SET_USAGE
|
|
529
|
+
};
|
|
530
|
+
return {
|
|
531
|
+
ok: true,
|
|
532
|
+
value: {
|
|
533
|
+
key,
|
|
534
|
+
value,
|
|
535
|
+
sessionToken: tokens[2]?.trim() || void 0
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function parseOptionalSingleTarget(tokens, usage) {
|
|
540
|
+
if (tokens.length > 1) return {
|
|
541
|
+
ok: false,
|
|
542
|
+
error: usage
|
|
543
|
+
};
|
|
544
|
+
const token = tokens[0]?.trim() || "";
|
|
545
|
+
return {
|
|
546
|
+
ok: true,
|
|
547
|
+
...token ? { sessionToken: token } : {}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function resolveAcpHelpText() {
|
|
551
|
+
return [
|
|
552
|
+
"ACP commands:",
|
|
553
|
+
"-----",
|
|
554
|
+
"/acp spawn [harness-id] [--mode persistent|oneshot] [--thread auto|here|off] [--cwd <path>] [--label <label>]",
|
|
555
|
+
"/acp cancel [session-key|session-id|session-label]",
|
|
556
|
+
"/acp steer [--session <session-key|session-id|session-label>] <instruction>",
|
|
557
|
+
"/acp close [session-key|session-id|session-label]",
|
|
558
|
+
"/acp status [session-key|session-id|session-label]",
|
|
559
|
+
"/acp set-mode <mode> [session-key|session-id|session-label]",
|
|
560
|
+
"/acp set <key> <value> [session-key|session-id|session-label]",
|
|
561
|
+
"/acp cwd <path> [session-key|session-id|session-label]",
|
|
562
|
+
"/acp permissions <profile> [session-key|session-id|session-label]",
|
|
563
|
+
"/acp timeout <seconds> [session-key|session-id|session-label]",
|
|
564
|
+
"/acp model <model-id> [session-key|session-id|session-label]",
|
|
565
|
+
"/acp reset-options [session-key|session-id|session-label]",
|
|
566
|
+
"/acp doctor",
|
|
567
|
+
"/acp install",
|
|
568
|
+
"/acp sessions",
|
|
569
|
+
"",
|
|
570
|
+
"Notes:",
|
|
571
|
+
"- /acp spawn harness-id is an ACP runtime harness alias (for example codex), not an OpenClaw agents.list id.",
|
|
572
|
+
"- /focus and /unfocus also work with ACP session keys.",
|
|
573
|
+
"- ACP dispatch of normal thread messages is controlled by acp.dispatch.enabled."
|
|
574
|
+
].join("\n");
|
|
575
|
+
}
|
|
576
|
+
function formatRuntimeOptionsText(options) {
|
|
577
|
+
const extras = options.backendExtras ? Object.entries(options.backendExtras).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, value]) => `${key}=${value}`).join(", ") : "";
|
|
578
|
+
const parts = [
|
|
579
|
+
options.runtimeMode ? `runtimeMode=${options.runtimeMode}` : null,
|
|
580
|
+
options.model ? `model=${options.model}` : null,
|
|
581
|
+
options.cwd ? `cwd=${options.cwd}` : null,
|
|
582
|
+
options.permissionProfile ? `permissionProfile=${options.permissionProfile}` : null,
|
|
583
|
+
typeof options.timeoutSeconds === "number" ? `timeoutSeconds=${options.timeoutSeconds}` : null,
|
|
584
|
+
extras ? `extras={${extras}}` : null
|
|
585
|
+
].filter(Boolean);
|
|
586
|
+
if (parts.length === 0) return "(none)";
|
|
587
|
+
return parts.join(", ");
|
|
588
|
+
}
|
|
589
|
+
function formatAcpCapabilitiesText(controls) {
|
|
590
|
+
if (controls.length === 0) return "(none)";
|
|
591
|
+
return controls.toSorted().join(", ");
|
|
592
|
+
}
|
|
593
|
+
function resolveCommandRequestId(params) {
|
|
594
|
+
const value = params.ctx.MessageSidFull ?? params.ctx.MessageSid ?? params.ctx.MessageSidFirst ?? params.ctx.MessageSidLast;
|
|
595
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
596
|
+
if (typeof value === "number" || typeof value === "bigint") return String(value);
|
|
597
|
+
return randomUUID();
|
|
598
|
+
}
|
|
599
|
+
function collectAcpErrorText(params) {
|
|
600
|
+
return toAcpRuntimeErrorText({
|
|
601
|
+
error: params.error,
|
|
602
|
+
fallbackCode: params.fallbackCode,
|
|
603
|
+
fallbackMessage: params.fallbackMessage
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
async function withAcpCommandErrorBoundary(params) {
|
|
607
|
+
try {
|
|
608
|
+
const result = await params.run();
|
|
609
|
+
return params.onSuccess(result);
|
|
610
|
+
} catch (error) {
|
|
611
|
+
return stopWithText$1(collectAcpErrorText({
|
|
612
|
+
error,
|
|
613
|
+
fallbackCode: params.fallbackCode,
|
|
614
|
+
fallbackMessage: params.fallbackMessage
|
|
615
|
+
}));
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/auto-reply/reply/channel-context.ts
|
|
620
|
+
function isDiscordSurface(params) {
|
|
621
|
+
return resolveCommandSurfaceChannel(params) === "discord";
|
|
622
|
+
}
|
|
623
|
+
function isTelegramSurface(params) {
|
|
624
|
+
return resolveCommandSurfaceChannel(params) === "telegram";
|
|
625
|
+
}
|
|
626
|
+
function isMatrixSurface(params) {
|
|
627
|
+
return resolveCommandSurfaceChannel(params) === "matrix";
|
|
628
|
+
}
|
|
629
|
+
function resolveCommandSurfaceChannel(params) {
|
|
630
|
+
const channel = params.ctx.OriginatingChannel ?? params.command.channel ?? params.ctx.Surface ?? params.ctx.Provider;
|
|
631
|
+
return String(channel ?? "").trim().toLowerCase();
|
|
632
|
+
}
|
|
633
|
+
function resolveChannelAccountId(params) {
|
|
634
|
+
return (typeof params.ctx.AccountId === "string" ? params.ctx.AccountId.trim() : "") || "default";
|
|
635
|
+
}
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region src/auto-reply/reply/commands-subagents/shared.ts
|
|
638
|
+
const COMMAND = "/subagents";
|
|
639
|
+
const COMMAND_KILL = "/kill";
|
|
640
|
+
const COMMAND_STEER = "/steer";
|
|
641
|
+
const COMMAND_TELL = "/tell";
|
|
642
|
+
const COMMAND_FOCUS = "/focus";
|
|
643
|
+
const COMMAND_UNFOCUS = "/unfocus";
|
|
644
|
+
const COMMAND_AGENTS = "/agents";
|
|
645
|
+
const ACTIONS$1 = new Set([
|
|
646
|
+
"list",
|
|
647
|
+
"kill",
|
|
648
|
+
"log",
|
|
649
|
+
"send",
|
|
650
|
+
"steer",
|
|
651
|
+
"info",
|
|
652
|
+
"spawn",
|
|
653
|
+
"focus",
|
|
654
|
+
"unfocus",
|
|
655
|
+
"agents",
|
|
656
|
+
"help"
|
|
657
|
+
]);
|
|
658
|
+
function resolveDisplayStatus(entry, options) {
|
|
659
|
+
const pendingDescendants = Math.max(0, options?.pendingDescendants ?? 0);
|
|
660
|
+
if (pendingDescendants > 0) return `active (waiting on ${pendingDescendants} ${pendingDescendants === 1 ? "child" : "children"})`;
|
|
661
|
+
const status = formatRunStatus(entry);
|
|
662
|
+
return status === "error" ? "failed" : status;
|
|
663
|
+
}
|
|
664
|
+
function formatTimestamp(valueMs) {
|
|
665
|
+
if (!valueMs || !Number.isFinite(valueMs) || valueMs <= 0) return "n/a";
|
|
666
|
+
return new Date(valueMs).toISOString();
|
|
667
|
+
}
|
|
668
|
+
function formatTimestampWithAge(valueMs) {
|
|
669
|
+
if (!valueMs || !Number.isFinite(valueMs) || valueMs <= 0) return "n/a";
|
|
670
|
+
return `${formatTimestamp(valueMs)} (${formatTimeAgo(Date.now() - valueMs, { fallback: "n/a" })})`;
|
|
671
|
+
}
|
|
672
|
+
function stopWithText(text) {
|
|
673
|
+
return {
|
|
674
|
+
shouldContinue: false,
|
|
675
|
+
reply: { text }
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function stopWithUnknownTargetError(error) {
|
|
679
|
+
return stopWithText(`⚠️ ${error ?? "Unknown subagent."}`);
|
|
680
|
+
}
|
|
681
|
+
function resolveSubagentTarget(runs, token) {
|
|
682
|
+
return resolveSubagentTargetFromRuns({
|
|
683
|
+
runs,
|
|
684
|
+
token,
|
|
685
|
+
recentWindowMinutes: 30,
|
|
686
|
+
label: (entry) => formatRunLabel(entry),
|
|
687
|
+
isActive: (entry) => !entry.endedAt || Math.max(0, countPendingDescendantRuns(entry.childSessionKey)) > 0,
|
|
688
|
+
errors: {
|
|
689
|
+
missingTarget: "Missing subagent id.",
|
|
690
|
+
invalidIndex: (value) => `Invalid subagent index: ${value}`,
|
|
691
|
+
unknownSession: (value) => `Unknown subagent session: ${value}`,
|
|
692
|
+
ambiguousLabel: (value) => `Ambiguous subagent label: ${value}`,
|
|
693
|
+
ambiguousLabelPrefix: (value) => `Ambiguous subagent label prefix: ${value}`,
|
|
694
|
+
ambiguousRunIdPrefix: (value) => `Ambiguous run id prefix: ${value}`,
|
|
695
|
+
unknownTarget: (value) => `Unknown subagent id: ${value}`
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function resolveSubagentEntryForToken(runs, token) {
|
|
700
|
+
const resolved = resolveSubagentTarget(runs, token);
|
|
701
|
+
if (!resolved.entry) return { reply: stopWithUnknownTargetError(resolved.error) };
|
|
702
|
+
return { entry: resolved.entry };
|
|
703
|
+
}
|
|
704
|
+
function resolveRequesterSessionKey(params, opts) {
|
|
705
|
+
const commandTarget = params.ctx.CommandTargetSessionKey?.trim();
|
|
706
|
+
const commandSession = params.sessionKey?.trim();
|
|
707
|
+
const raw = opts?.preferCommandTarget ?? params.ctx.CommandSource === "native" ? commandTarget || commandSession : commandSession || commandTarget;
|
|
708
|
+
if (!raw) return;
|
|
709
|
+
const { mainKey, alias } = resolveMainSessionAlias(params.cfg);
|
|
710
|
+
return resolveInternalSessionKey({
|
|
711
|
+
key: raw,
|
|
712
|
+
alias,
|
|
713
|
+
mainKey
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
function resolveCommandSubagentController(params, requesterKey) {
|
|
717
|
+
if (!isSubagentSessionKey(requesterKey)) return {
|
|
718
|
+
controllerSessionKey: requesterKey,
|
|
719
|
+
callerSessionKey: requesterKey,
|
|
720
|
+
callerIsSubagent: false,
|
|
721
|
+
controlScope: "children"
|
|
722
|
+
};
|
|
723
|
+
return {
|
|
724
|
+
controllerSessionKey: requesterKey,
|
|
725
|
+
callerSessionKey: requesterKey,
|
|
726
|
+
callerIsSubagent: true,
|
|
727
|
+
controlScope: resolveStoredSubagentCapabilities(requesterKey, { cfg: params.cfg }).controlScope
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function resolveHandledPrefix(normalized) {
|
|
731
|
+
return normalized.startsWith("/subagents") ? COMMAND : normalized.startsWith("/kill") ? COMMAND_KILL : normalized.startsWith("/steer") ? COMMAND_STEER : normalized.startsWith("/tell") ? COMMAND_TELL : normalized.startsWith("/focus") ? COMMAND_FOCUS : normalized.startsWith("/unfocus") ? COMMAND_UNFOCUS : normalized.startsWith("/agents") ? COMMAND_AGENTS : null;
|
|
732
|
+
}
|
|
733
|
+
function resolveSubagentsAction(params) {
|
|
734
|
+
if (params.handledPrefix === "/subagents") {
|
|
735
|
+
const [actionRaw] = params.restTokens;
|
|
736
|
+
const action = actionRaw?.toLowerCase() || "list";
|
|
737
|
+
if (!ACTIONS$1.has(action)) return null;
|
|
738
|
+
params.restTokens.splice(0, 1);
|
|
739
|
+
return action;
|
|
740
|
+
}
|
|
741
|
+
if (params.handledPrefix === "/kill") return "kill";
|
|
742
|
+
if (params.handledPrefix === "/focus") return "focus";
|
|
743
|
+
if (params.handledPrefix === "/unfocus") return "unfocus";
|
|
744
|
+
if (params.handledPrefix === "/agents") return "agents";
|
|
745
|
+
return "steer";
|
|
746
|
+
}
|
|
747
|
+
function resolveDiscordChannelIdForFocus(params) {
|
|
748
|
+
const toCandidates = [
|
|
749
|
+
typeof params.ctx.OriginatingTo === "string" ? params.ctx.OriginatingTo.trim() : "",
|
|
750
|
+
typeof params.command.to === "string" ? params.command.to.trim() : "",
|
|
751
|
+
typeof params.ctx.To === "string" ? params.ctx.To.trim() : ""
|
|
752
|
+
].filter(Boolean);
|
|
753
|
+
for (const candidate of toCandidates) {
|
|
754
|
+
const target = parseExplicitTargetForChannel("discord", candidate);
|
|
755
|
+
if (target?.chatType === "channel" && target.to) return target.to;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
async function resolveFocusTargetSession(params) {
|
|
759
|
+
const subagentMatch = resolveSubagentTarget(params.runs, params.token);
|
|
760
|
+
if (subagentMatch.entry) {
|
|
761
|
+
const key = subagentMatch.entry.childSessionKey;
|
|
762
|
+
return {
|
|
763
|
+
targetKind: "subagent",
|
|
764
|
+
targetSessionKey: key,
|
|
765
|
+
agentId: parseAgentSessionKey(key)?.agentId ?? "main",
|
|
766
|
+
label: formatRunLabel(subagentMatch.entry)
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
const token = params.token.trim();
|
|
770
|
+
if (!token) return null;
|
|
771
|
+
const attempts = [];
|
|
772
|
+
attempts.push({ key: token });
|
|
773
|
+
if (looksLikeSessionId(token)) attempts.push({ sessionId: token });
|
|
774
|
+
attempts.push({ label: token });
|
|
775
|
+
for (const attempt of attempts) try {
|
|
776
|
+
const resolved = await callGateway({
|
|
777
|
+
method: "sessions.resolve",
|
|
778
|
+
params: attempt
|
|
779
|
+
});
|
|
780
|
+
const key = typeof resolved?.key === "string" ? resolved.key.trim() : "";
|
|
781
|
+
if (!key) continue;
|
|
782
|
+
const parsed = parseAgentSessionKey(key);
|
|
783
|
+
return {
|
|
784
|
+
targetKind: key.includes(":subagent:") ? "subagent" : "acp",
|
|
785
|
+
targetSessionKey: key,
|
|
786
|
+
agentId: parsed?.agentId ?? "main",
|
|
787
|
+
label: token
|
|
788
|
+
};
|
|
789
|
+
} catch {}
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
function buildSubagentsHelp() {
|
|
793
|
+
return [
|
|
794
|
+
"Subagents",
|
|
795
|
+
"Usage:",
|
|
796
|
+
"- /subagents list",
|
|
797
|
+
"- /subagents kill <id|#|all>",
|
|
798
|
+
"- /subagents log <id|#> [limit] [tools]",
|
|
799
|
+
"- /subagents info <id|#>",
|
|
800
|
+
"- /subagents send <id|#> <message>",
|
|
801
|
+
"- /subagents steer <id|#> <message>",
|
|
802
|
+
"- /subagents spawn <agentId> <task> [--model <model>] [--thinking <level>]",
|
|
803
|
+
"- /focus <subagent-label|session-key|session-id|session-label>",
|
|
804
|
+
"- /unfocus",
|
|
805
|
+
"- /agents",
|
|
806
|
+
"- /session idle <duration|off>",
|
|
807
|
+
"- /session max-age <duration|off>",
|
|
808
|
+
"- /kill <id|#|all>",
|
|
809
|
+
"- /steer <id|#> <message>",
|
|
810
|
+
"- /tell <id|#> <message>",
|
|
811
|
+
"",
|
|
812
|
+
"Ids: use the list index (#), runId/session prefix, label, or full session key."
|
|
813
|
+
].join("\n");
|
|
814
|
+
}
|
|
815
|
+
function extractMessageText(message) {
|
|
816
|
+
const role = typeof message.role === "string" ? message.role : "";
|
|
817
|
+
const shouldSanitize = role === "assistant";
|
|
818
|
+
const text = extractTextFromChatContent(message.content, { sanitizeText: shouldSanitize ? sanitizeTextContent : void 0 });
|
|
819
|
+
return text ? {
|
|
820
|
+
role,
|
|
821
|
+
text
|
|
822
|
+
} : null;
|
|
823
|
+
}
|
|
824
|
+
function formatLogLines(messages) {
|
|
825
|
+
const lines = [];
|
|
826
|
+
for (const msg of messages) {
|
|
827
|
+
const extracted = extractMessageText(msg);
|
|
828
|
+
if (!extracted) continue;
|
|
829
|
+
const label = extracted.role === "assistant" ? "Assistant" : "User";
|
|
830
|
+
lines.push(`${label}: ${extracted.text}`);
|
|
831
|
+
}
|
|
832
|
+
return lines;
|
|
833
|
+
}
|
|
834
|
+
function loadSubagentSessionEntry(params, childKey, loaders, storeCache) {
|
|
835
|
+
const parsed = parseAgentSessionKey(childKey);
|
|
836
|
+
const storePath = loaders.resolveStorePath(params.cfg.session?.store, { agentId: parsed?.agentId });
|
|
837
|
+
let store = storeCache?.get(storePath);
|
|
838
|
+
if (!store) {
|
|
839
|
+
store = loaders.loadSessionStore(storePath);
|
|
840
|
+
storeCache?.set(storePath, store);
|
|
841
|
+
}
|
|
842
|
+
return {
|
|
843
|
+
storePath,
|
|
844
|
+
store,
|
|
845
|
+
entry: store[childKey]
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region src/auto-reply/reply/commands-acp/targets.ts
|
|
850
|
+
async function resolveSessionKeyByToken(token) {
|
|
851
|
+
const trimmed = token.trim();
|
|
852
|
+
if (!trimmed) return null;
|
|
853
|
+
const attempts = [{ key: trimmed }];
|
|
854
|
+
if (SESSION_ID_RE.test(trimmed)) attempts.push({ sessionId: trimmed });
|
|
855
|
+
attempts.push({ label: trimmed });
|
|
856
|
+
for (const params of attempts) try {
|
|
857
|
+
const resolved = await callGateway({
|
|
858
|
+
method: "sessions.resolve",
|
|
859
|
+
params,
|
|
860
|
+
timeoutMs: 8e3
|
|
861
|
+
});
|
|
862
|
+
const key = typeof resolved?.key === "string" ? resolved.key.trim() : "";
|
|
863
|
+
if (key) return key;
|
|
864
|
+
} catch {}
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
function resolveBoundAcpThreadSessionKey(params) {
|
|
868
|
+
const activeSessionKey = (typeof params.ctx.CommandTargetSessionKey === "string" ? params.ctx.CommandTargetSessionKey.trim() : "") || params.sessionKey.trim();
|
|
869
|
+
const bindingContext = resolveAcpCommandBindingContext(params);
|
|
870
|
+
return resolveEffectiveResetTargetSessionKey({
|
|
871
|
+
cfg: params.cfg,
|
|
872
|
+
channel: bindingContext.channel,
|
|
873
|
+
accountId: bindingContext.accountId,
|
|
874
|
+
conversationId: bindingContext.conversationId,
|
|
875
|
+
parentConversationId: bindingContext.parentConversationId,
|
|
876
|
+
activeSessionKey,
|
|
877
|
+
allowNonAcpBindingSessionKey: true,
|
|
878
|
+
skipConfiguredFallbackWhenActiveSessionNonAcp: false
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
async function resolveAcpTargetSessionKey(params) {
|
|
882
|
+
const token = params.token?.trim() || "";
|
|
883
|
+
if (token) {
|
|
884
|
+
const resolved = await resolveSessionKeyByToken(token);
|
|
885
|
+
if (!resolved) return {
|
|
886
|
+
ok: false,
|
|
887
|
+
error: `Unable to resolve session target: ${token}`
|
|
888
|
+
};
|
|
889
|
+
return {
|
|
890
|
+
ok: true,
|
|
891
|
+
sessionKey: resolved
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
const threadBound = resolveBoundAcpThreadSessionKey(params.commandParams);
|
|
895
|
+
if (threadBound) return {
|
|
896
|
+
ok: true,
|
|
897
|
+
sessionKey: threadBound
|
|
898
|
+
};
|
|
899
|
+
const fallback = resolveRequesterSessionKey(params.commandParams, { preferCommandTarget: true });
|
|
900
|
+
if (!fallback) return {
|
|
901
|
+
ok: false,
|
|
902
|
+
error: "Missing session key."
|
|
903
|
+
};
|
|
904
|
+
return {
|
|
905
|
+
ok: true,
|
|
906
|
+
sessionKey: fallback
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/auto-reply/reply/commands-acp/diagnostics.ts
|
|
911
|
+
async function handleAcpDoctorAction(params, restTokens) {
|
|
912
|
+
if (restTokens.length > 0) return stopWithText$1(`⚠️ ${ACP_DOCTOR_USAGE}`);
|
|
913
|
+
const backendId = resolveConfiguredAcpBackendId(params.cfg);
|
|
914
|
+
const installHint = resolveAcpInstallCommandHint(params.cfg);
|
|
915
|
+
const registeredBackend = getAcpRuntimeBackend(backendId);
|
|
916
|
+
const managerSnapshot = getAcpSessionManager().getObservabilitySnapshot(params.cfg);
|
|
917
|
+
const lines = [
|
|
918
|
+
"ACP doctor:",
|
|
919
|
+
"-----",
|
|
920
|
+
`configuredBackend: ${backendId}`
|
|
921
|
+
];
|
|
922
|
+
lines.push(`activeRuntimeSessions: ${managerSnapshot.runtimeCache.activeSessions}`);
|
|
923
|
+
lines.push(`runtimeIdleTtlMs: ${managerSnapshot.runtimeCache.idleTtlMs}`);
|
|
924
|
+
lines.push(`evictedIdleRuntimes: ${managerSnapshot.runtimeCache.evictedTotal}`);
|
|
925
|
+
lines.push(`activeTurns: ${managerSnapshot.turns.active}`);
|
|
926
|
+
lines.push(`queueDepth: ${managerSnapshot.turns.queueDepth}`);
|
|
927
|
+
lines.push(`turnLatencyMs: avg=${managerSnapshot.turns.averageLatencyMs}, max=${managerSnapshot.turns.maxLatencyMs}`);
|
|
928
|
+
lines.push(`turnCounts: completed=${managerSnapshot.turns.completed}, failed=${managerSnapshot.turns.failed}`);
|
|
929
|
+
const errorStatsText = Object.entries(managerSnapshot.errorsByCode).map(([code, count]) => `${code}=${count}`).join(", ") || "(none)";
|
|
930
|
+
lines.push(`errorCodes: ${errorStatsText}`);
|
|
931
|
+
if (registeredBackend) lines.push(`registeredBackend: ${registeredBackend.id}`);
|
|
932
|
+
else lines.push("registeredBackend: (none)");
|
|
933
|
+
if (registeredBackend?.runtime.doctor) try {
|
|
934
|
+
const report = await registeredBackend.runtime.doctor();
|
|
935
|
+
lines.push(`runtimeDoctor: ${report.ok ? "ok" : "error"} (${report.message})`);
|
|
936
|
+
if (report.code) lines.push(`runtimeDoctorCode: ${report.code}`);
|
|
937
|
+
if (report.installCommand) lines.push(`runtimeDoctorInstall: ${report.installCommand}`);
|
|
938
|
+
for (const detail of report.details ?? []) lines.push(`runtimeDoctorDetail: ${detail}`);
|
|
939
|
+
} catch (error) {
|
|
940
|
+
lines.push(`runtimeDoctor: error (${toAcpRuntimeError({
|
|
941
|
+
error,
|
|
942
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
943
|
+
fallbackMessage: "Runtime doctor failed."
|
|
944
|
+
}).message})`);
|
|
945
|
+
}
|
|
946
|
+
try {
|
|
947
|
+
const backend = requireAcpRuntimeBackend(backendId);
|
|
948
|
+
const capabilities = backend.runtime.getCapabilities ? await backend.runtime.getCapabilities({}) : {
|
|
949
|
+
controls: [],
|
|
950
|
+
configOptionKeys: []
|
|
951
|
+
};
|
|
952
|
+
lines.push("healthy: yes");
|
|
953
|
+
lines.push(`capabilities: ${formatAcpCapabilitiesText(capabilities.controls ?? [])}`);
|
|
954
|
+
if ((capabilities.configOptionKeys?.length ?? 0) > 0) lines.push(`configKeys: ${capabilities.configOptionKeys?.join(", ")}`);
|
|
955
|
+
return stopWithText$1(lines.join("\n"));
|
|
956
|
+
} catch (error) {
|
|
957
|
+
const acpError = toAcpRuntimeError({
|
|
958
|
+
error,
|
|
959
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
960
|
+
fallbackMessage: "ACP backend doctor failed."
|
|
961
|
+
});
|
|
962
|
+
lines.push("healthy: no");
|
|
963
|
+
lines.push(formatAcpRuntimeErrorText(acpError));
|
|
964
|
+
lines.push(`next: ${installHint}`);
|
|
965
|
+
lines.push(`next: openclaw config set plugins.entries.${backendId}.enabled true`);
|
|
966
|
+
if (backendId.toLowerCase() === "acpx") lines.push("next: verify acpx is installed (`acpx --help`).");
|
|
967
|
+
return stopWithText$1(lines.join("\n"));
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function handleAcpInstallAction(params, restTokens) {
|
|
971
|
+
if (restTokens.length > 0) return stopWithText$1(`⚠️ ${ACP_INSTALL_USAGE}`);
|
|
972
|
+
const backendId = resolveConfiguredAcpBackendId(params.cfg);
|
|
973
|
+
const installHint = resolveAcpInstallCommandHint(params.cfg);
|
|
974
|
+
return stopWithText$1([
|
|
975
|
+
"ACP install:",
|
|
976
|
+
"-----",
|
|
977
|
+
`configuredBackend: ${backendId}`,
|
|
978
|
+
`run: ${installHint}`,
|
|
979
|
+
`then: openclaw config set plugins.entries.${backendId}.enabled true`,
|
|
980
|
+
"then: /acp doctor"
|
|
981
|
+
].join("\n"));
|
|
982
|
+
}
|
|
983
|
+
function formatAcpSessionLine(params) {
|
|
984
|
+
const acp = params.entry.acp;
|
|
985
|
+
if (!acp) return "";
|
|
986
|
+
const marker = params.currentSessionKey === params.key ? "*" : " ";
|
|
987
|
+
const label = params.entry.label?.trim() || acp.agent;
|
|
988
|
+
const threadText = params.threadId ? `, thread:${params.threadId}` : "";
|
|
989
|
+
return `${marker} ${label} (${acp.mode}, ${acp.state}, backend:${acp.backend}${threadText}) -> ${params.key}`;
|
|
990
|
+
}
|
|
991
|
+
function handleAcpSessionsAction(params, restTokens) {
|
|
992
|
+
if (restTokens.length > 0) return stopWithText$1(ACP_SESSIONS_USAGE);
|
|
993
|
+
const currentSessionKey = resolveBoundAcpThreadSessionKey(params) || params.sessionKey;
|
|
994
|
+
if (!currentSessionKey) return stopWithText$1("⚠️ Missing session key.");
|
|
995
|
+
const { storePath } = resolveSessionStorePathForAcp({
|
|
996
|
+
cfg: params.cfg,
|
|
997
|
+
sessionKey: currentSessionKey
|
|
998
|
+
});
|
|
999
|
+
let store;
|
|
1000
|
+
try {
|
|
1001
|
+
store = loadSessionStore(storePath);
|
|
1002
|
+
} catch {
|
|
1003
|
+
store = {};
|
|
1004
|
+
}
|
|
1005
|
+
const bindingContext = resolveAcpCommandBindingContext(params);
|
|
1006
|
+
const normalizedChannel = bindingContext.channel;
|
|
1007
|
+
const normalizedAccountId = bindingContext.accountId || void 0;
|
|
1008
|
+
const bindingService = getSessionBindingService();
|
|
1009
|
+
const rows = Object.entries(store).filter(([, entry]) => Boolean(entry?.acp)).toSorted(([, a], [, b]) => (b?.updatedAt ?? 0) - (a?.updatedAt ?? 0)).slice(0, 20).map(([key, entry]) => {
|
|
1010
|
+
const bindingThreadId = bindingService.listBySession(key).find((binding) => (!normalizedChannel || binding.conversation.channel === normalizedChannel) && (!normalizedAccountId || binding.conversation.accountId === normalizedAccountId))?.conversation.conversationId;
|
|
1011
|
+
return formatAcpSessionLine({
|
|
1012
|
+
key,
|
|
1013
|
+
entry,
|
|
1014
|
+
currentSessionKey,
|
|
1015
|
+
threadId: bindingThreadId
|
|
1016
|
+
});
|
|
1017
|
+
}).filter(Boolean);
|
|
1018
|
+
if (rows.length === 0) return stopWithText$1("ACP sessions:\n-----\n(none)");
|
|
1019
|
+
return stopWithText$1([
|
|
1020
|
+
"ACP sessions:",
|
|
1021
|
+
"-----",
|
|
1022
|
+
...rows
|
|
1023
|
+
].join("\n"));
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region src/auto-reply/reply/commands-acp/lifecycle.ts
|
|
1027
|
+
async function bindSpawnedAcpSessionToThread(params) {
|
|
1028
|
+
const { commandParams, threadMode } = params;
|
|
1029
|
+
if (threadMode === "off") return {
|
|
1030
|
+
ok: false,
|
|
1031
|
+
error: "internal: thread binding is disabled for this spawn"
|
|
1032
|
+
};
|
|
1033
|
+
const bindingContext = resolveAcpCommandBindingContext(commandParams);
|
|
1034
|
+
const channel = bindingContext.channel;
|
|
1035
|
+
if (!channel) return {
|
|
1036
|
+
ok: false,
|
|
1037
|
+
error: "ACP thread binding requires a channel context."
|
|
1038
|
+
};
|
|
1039
|
+
const accountId = resolveAcpCommandAccountId(commandParams);
|
|
1040
|
+
const spawnPolicy = resolveThreadBindingSpawnPolicy({
|
|
1041
|
+
cfg: commandParams.cfg,
|
|
1042
|
+
channel,
|
|
1043
|
+
accountId,
|
|
1044
|
+
kind: "acp"
|
|
1045
|
+
});
|
|
1046
|
+
if (!spawnPolicy.enabled) return {
|
|
1047
|
+
ok: false,
|
|
1048
|
+
error: formatThreadBindingDisabledError({
|
|
1049
|
+
channel: spawnPolicy.channel,
|
|
1050
|
+
accountId: spawnPolicy.accountId,
|
|
1051
|
+
kind: "acp"
|
|
1052
|
+
})
|
|
1053
|
+
};
|
|
1054
|
+
if (!spawnPolicy.spawnEnabled) return {
|
|
1055
|
+
ok: false,
|
|
1056
|
+
error: formatThreadBindingSpawnDisabledError({
|
|
1057
|
+
channel: spawnPolicy.channel,
|
|
1058
|
+
accountId: spawnPolicy.accountId,
|
|
1059
|
+
kind: "acp"
|
|
1060
|
+
})
|
|
1061
|
+
};
|
|
1062
|
+
const bindingService = getSessionBindingService();
|
|
1063
|
+
const capabilities = bindingService.getCapabilities({
|
|
1064
|
+
channel: spawnPolicy.channel,
|
|
1065
|
+
accountId: spawnPolicy.accountId
|
|
1066
|
+
});
|
|
1067
|
+
if (!capabilities.adapterAvailable) return {
|
|
1068
|
+
ok: false,
|
|
1069
|
+
error: `Thread bindings are unavailable for ${channel}.`
|
|
1070
|
+
};
|
|
1071
|
+
if (!capabilities.bindSupported) return {
|
|
1072
|
+
ok: false,
|
|
1073
|
+
error: `Thread bindings are unavailable for ${channel}.`
|
|
1074
|
+
};
|
|
1075
|
+
const currentThreadId = bindingContext.threadId ?? "";
|
|
1076
|
+
const currentConversationId = bindingContext.conversationId?.trim() || "";
|
|
1077
|
+
const requiresThreadIdForHere = channel !== "telegram" && channel !== "feishu";
|
|
1078
|
+
if (threadMode === "here" && (requiresThreadIdForHere && !currentThreadId || !requiresThreadIdForHere && !currentConversationId)) return {
|
|
1079
|
+
ok: false,
|
|
1080
|
+
error: `--thread here requires running /acp spawn inside an active ${channel} thread/conversation.`
|
|
1081
|
+
};
|
|
1082
|
+
const placement = channel === "telegram" || channel === "feishu" ? "current" : currentThreadId ? "current" : "child";
|
|
1083
|
+
if (!capabilities.placements.includes(placement)) return {
|
|
1084
|
+
ok: false,
|
|
1085
|
+
error: `Thread bindings do not support ${placement} placement for ${channel}.`
|
|
1086
|
+
};
|
|
1087
|
+
if (!currentConversationId) return {
|
|
1088
|
+
ok: false,
|
|
1089
|
+
error: `Could not resolve a ${channel} conversation for ACP thread spawn.`
|
|
1090
|
+
};
|
|
1091
|
+
const senderId = commandParams.command.senderId?.trim() || "";
|
|
1092
|
+
const parentConversationId = bindingContext.parentConversationId?.trim() || void 0;
|
|
1093
|
+
const conversationRef = {
|
|
1094
|
+
channel: spawnPolicy.channel,
|
|
1095
|
+
accountId: spawnPolicy.accountId,
|
|
1096
|
+
conversationId: currentConversationId,
|
|
1097
|
+
...parentConversationId && parentConversationId !== currentConversationId ? { parentConversationId } : {}
|
|
1098
|
+
};
|
|
1099
|
+
if (placement === "current") {
|
|
1100
|
+
const existingBinding = bindingService.resolveByConversation(conversationRef);
|
|
1101
|
+
const boundBy = typeof existingBinding?.metadata?.boundBy === "string" ? existingBinding.metadata.boundBy.trim() : "";
|
|
1102
|
+
if (existingBinding && boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
|
|
1103
|
+
ok: false,
|
|
1104
|
+
error: `Only ${boundBy} can rebind this ${channel === "telegram" ? "conversation" : "thread"}.`
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
const label = params.label || params.agentId;
|
|
1108
|
+
try {
|
|
1109
|
+
return {
|
|
1110
|
+
ok: true,
|
|
1111
|
+
binding: await bindingService.bind({
|
|
1112
|
+
targetSessionKey: params.sessionKey,
|
|
1113
|
+
targetKind: "session",
|
|
1114
|
+
conversation: conversationRef,
|
|
1115
|
+
placement,
|
|
1116
|
+
metadata: {
|
|
1117
|
+
threadName: resolveThreadBindingThreadName({
|
|
1118
|
+
agentId: params.agentId,
|
|
1119
|
+
label
|
|
1120
|
+
}),
|
|
1121
|
+
agentId: params.agentId,
|
|
1122
|
+
label,
|
|
1123
|
+
boundBy: senderId || "unknown",
|
|
1124
|
+
introText: resolveThreadBindingIntroText({
|
|
1125
|
+
agentId: params.agentId,
|
|
1126
|
+
label,
|
|
1127
|
+
idleTimeoutMs: resolveThreadBindingIdleTimeoutMsForChannel({
|
|
1128
|
+
cfg: commandParams.cfg,
|
|
1129
|
+
channel: spawnPolicy.channel,
|
|
1130
|
+
accountId: spawnPolicy.accountId
|
|
1131
|
+
}),
|
|
1132
|
+
maxAgeMs: resolveThreadBindingMaxAgeMsForChannel({
|
|
1133
|
+
cfg: commandParams.cfg,
|
|
1134
|
+
channel: spawnPolicy.channel,
|
|
1135
|
+
accountId: spawnPolicy.accountId
|
|
1136
|
+
}),
|
|
1137
|
+
sessionCwd: resolveAcpSessionCwd(params.sessionMeta),
|
|
1138
|
+
sessionDetails: resolveAcpThreadSessionDetailLines({
|
|
1139
|
+
sessionKey: params.sessionKey,
|
|
1140
|
+
meta: params.sessionMeta
|
|
1141
|
+
})
|
|
1142
|
+
})
|
|
1143
|
+
}
|
|
1144
|
+
})
|
|
1145
|
+
};
|
|
1146
|
+
} catch (error) {
|
|
1147
|
+
return {
|
|
1148
|
+
ok: false,
|
|
1149
|
+
error: (error instanceof Error ? error.message : String(error)) || `Failed to bind a ${channel} thread/conversation to the new ACP session.`
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
async function cleanupFailedSpawn(params) {
|
|
1154
|
+
await cleanupFailedAcpSpawn({
|
|
1155
|
+
cfg: params.cfg,
|
|
1156
|
+
sessionKey: params.sessionKey,
|
|
1157
|
+
shouldDeleteSession: params.shouldDeleteSession,
|
|
1158
|
+
deleteTranscript: false,
|
|
1159
|
+
runtimeCloseHandle: params.initializedRuntime
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
async function handleAcpSpawnAction(params, restTokens) {
|
|
1163
|
+
if (!isAcpEnabledByPolicy(params.cfg)) return stopWithText$1("ACP is disabled by policy (`acp.enabled=false`).");
|
|
1164
|
+
const parsed = parseSpawnInput(params, restTokens);
|
|
1165
|
+
if (!parsed.ok) return stopWithText$1(`⚠️ ${parsed.error}`);
|
|
1166
|
+
const spawn = parsed.value;
|
|
1167
|
+
const runtimePolicyError = resolveAcpSpawnRuntimePolicyError({
|
|
1168
|
+
cfg: params.cfg,
|
|
1169
|
+
requesterSessionKey: params.sessionKey
|
|
1170
|
+
});
|
|
1171
|
+
if (runtimePolicyError) return stopWithText$1(`⚠️ ${runtimePolicyError}`);
|
|
1172
|
+
const agentPolicyError = resolveAcpAgentPolicyError(params.cfg, spawn.agentId);
|
|
1173
|
+
if (agentPolicyError) return stopWithText$1(collectAcpErrorText({
|
|
1174
|
+
error: agentPolicyError,
|
|
1175
|
+
fallbackCode: "ACP_SESSION_INIT_FAILED",
|
|
1176
|
+
fallbackMessage: "ACP target agent is not allowed by policy."
|
|
1177
|
+
}));
|
|
1178
|
+
const acpManager = getAcpSessionManager();
|
|
1179
|
+
const sessionKey = `agent:${spawn.agentId}:acp:${randomUUID()}`;
|
|
1180
|
+
let initializedBackend = "";
|
|
1181
|
+
let initializedMeta;
|
|
1182
|
+
let initializedRuntime;
|
|
1183
|
+
try {
|
|
1184
|
+
const initialized = await acpManager.initializeSession({
|
|
1185
|
+
cfg: params.cfg,
|
|
1186
|
+
sessionKey,
|
|
1187
|
+
agent: spawn.agentId,
|
|
1188
|
+
mode: spawn.mode,
|
|
1189
|
+
cwd: spawn.cwd
|
|
1190
|
+
});
|
|
1191
|
+
initializedRuntime = {
|
|
1192
|
+
runtime: initialized.runtime,
|
|
1193
|
+
handle: initialized.handle
|
|
1194
|
+
};
|
|
1195
|
+
initializedBackend = initialized.handle.backend || initialized.meta.backend;
|
|
1196
|
+
initializedMeta = initialized.meta;
|
|
1197
|
+
} catch (err) {
|
|
1198
|
+
return stopWithText$1(collectAcpErrorText({
|
|
1199
|
+
error: err,
|
|
1200
|
+
fallbackCode: "ACP_SESSION_INIT_FAILED",
|
|
1201
|
+
fallbackMessage: "Could not initialize ACP session runtime."
|
|
1202
|
+
}));
|
|
1203
|
+
}
|
|
1204
|
+
let binding = null;
|
|
1205
|
+
if (spawn.thread !== "off") {
|
|
1206
|
+
const bound = await bindSpawnedAcpSessionToThread({
|
|
1207
|
+
commandParams: params,
|
|
1208
|
+
sessionKey,
|
|
1209
|
+
agentId: spawn.agentId,
|
|
1210
|
+
label: spawn.label,
|
|
1211
|
+
threadMode: spawn.thread,
|
|
1212
|
+
sessionMeta: initializedMeta
|
|
1213
|
+
});
|
|
1214
|
+
if (!bound.ok) {
|
|
1215
|
+
await cleanupFailedSpawn({
|
|
1216
|
+
cfg: params.cfg,
|
|
1217
|
+
sessionKey,
|
|
1218
|
+
shouldDeleteSession: true,
|
|
1219
|
+
initializedRuntime
|
|
1220
|
+
});
|
|
1221
|
+
return stopWithText$1(`⚠️ ${bound.error}`);
|
|
1222
|
+
}
|
|
1223
|
+
binding = bound.binding;
|
|
1224
|
+
}
|
|
1225
|
+
try {
|
|
1226
|
+
await callGateway({
|
|
1227
|
+
method: "sessions.patch",
|
|
1228
|
+
params: {
|
|
1229
|
+
key: sessionKey,
|
|
1230
|
+
...spawn.label ? { label: spawn.label } : {}
|
|
1231
|
+
},
|
|
1232
|
+
timeoutMs: 1e4
|
|
1233
|
+
});
|
|
1234
|
+
} catch (err) {
|
|
1235
|
+
await cleanupFailedSpawn({
|
|
1236
|
+
cfg: params.cfg,
|
|
1237
|
+
sessionKey,
|
|
1238
|
+
shouldDeleteSession: true,
|
|
1239
|
+
initializedRuntime
|
|
1240
|
+
});
|
|
1241
|
+
return stopWithText$1(`⚠️ ACP spawn failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1242
|
+
}
|
|
1243
|
+
const parts = [`✅ Spawned ACP session ${sessionKey} (${spawn.mode}, backend ${initializedBackend}).`];
|
|
1244
|
+
if (binding) {
|
|
1245
|
+
const currentConversationId = resolveAcpCommandConversationId(params)?.trim() || "";
|
|
1246
|
+
const boundConversationId = binding.conversation.conversationId.trim();
|
|
1247
|
+
const placementLabel = binding.conversation.channel === "telegram" ? "conversation" : "thread";
|
|
1248
|
+
if (currentConversationId && boundConversationId === currentConversationId) parts.push(`Bound this ${placementLabel} to ${sessionKey}.`);
|
|
1249
|
+
else parts.push(`Created ${placementLabel} ${boundConversationId} and bound it to ${sessionKey}.`);
|
|
1250
|
+
} else parts.push("Session is unbound (use /focus <session-key> to bind this thread/conversation).");
|
|
1251
|
+
const dispatchNote = resolveAcpDispatchPolicyMessage(params.cfg);
|
|
1252
|
+
if (dispatchNote) parts.push(`ℹ️ ${dispatchNote}`);
|
|
1253
|
+
if (binding?.conversation.channel === "telegram" && binding.conversation.conversationId.includes(":topic:")) return {
|
|
1254
|
+
shouldContinue: false,
|
|
1255
|
+
reply: {
|
|
1256
|
+
text: parts.join(" "),
|
|
1257
|
+
channelData: { telegram: { pin: true } }
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1260
|
+
return stopWithText$1(parts.join(" "));
|
|
1261
|
+
}
|
|
1262
|
+
function resolveAcpSessionForCommandOrStop(params) {
|
|
1263
|
+
const error = resolveAcpSessionResolutionError(params.acpManager.resolveSession({
|
|
1264
|
+
cfg: params.cfg,
|
|
1265
|
+
sessionKey: params.sessionKey
|
|
1266
|
+
}));
|
|
1267
|
+
if (error) return stopWithText$1(collectAcpErrorText({
|
|
1268
|
+
error,
|
|
1269
|
+
fallbackCode: "ACP_SESSION_INIT_FAILED",
|
|
1270
|
+
fallbackMessage: error.message
|
|
1271
|
+
}));
|
|
1272
|
+
return null;
|
|
1273
|
+
}
|
|
1274
|
+
async function resolveAcpTokenTargetSessionKeyOrStop(params) {
|
|
1275
|
+
const token = params.restTokens.join(" ").trim() || void 0;
|
|
1276
|
+
const target = await resolveAcpTargetSessionKey({
|
|
1277
|
+
commandParams: params.commandParams,
|
|
1278
|
+
token
|
|
1279
|
+
});
|
|
1280
|
+
if (!target.ok) return stopWithText$1(`⚠️ ${target.error}`);
|
|
1281
|
+
return target.sessionKey;
|
|
1282
|
+
}
|
|
1283
|
+
async function withResolvedAcpSessionTarget(params) {
|
|
1284
|
+
const acpManager = getAcpSessionManager();
|
|
1285
|
+
const targetSessionKey = await resolveAcpTokenTargetSessionKeyOrStop({
|
|
1286
|
+
commandParams: params.commandParams,
|
|
1287
|
+
restTokens: params.restTokens
|
|
1288
|
+
});
|
|
1289
|
+
if (typeof targetSessionKey !== "string") return targetSessionKey;
|
|
1290
|
+
const guardFailure = resolveAcpSessionForCommandOrStop({
|
|
1291
|
+
acpManager,
|
|
1292
|
+
cfg: params.commandParams.cfg,
|
|
1293
|
+
sessionKey: targetSessionKey
|
|
1294
|
+
});
|
|
1295
|
+
if (guardFailure) return guardFailure;
|
|
1296
|
+
return await params.run({
|
|
1297
|
+
acpManager,
|
|
1298
|
+
sessionKey: targetSessionKey
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
async function handleAcpCancelAction(params, restTokens) {
|
|
1302
|
+
return await withResolvedAcpSessionTarget({
|
|
1303
|
+
commandParams: params,
|
|
1304
|
+
restTokens,
|
|
1305
|
+
run: async ({ acpManager, sessionKey }) => await withAcpCommandErrorBoundary({
|
|
1306
|
+
run: async () => await acpManager.cancelSession({
|
|
1307
|
+
cfg: params.cfg,
|
|
1308
|
+
sessionKey,
|
|
1309
|
+
reason: "manual-cancel"
|
|
1310
|
+
}),
|
|
1311
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1312
|
+
fallbackMessage: "ACP cancel failed before completion.",
|
|
1313
|
+
onSuccess: () => stopWithText$1(`✅ Cancel requested for ACP session ${sessionKey}.`)
|
|
1314
|
+
})
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
async function runAcpSteer(params) {
|
|
1318
|
+
const acpManager = getAcpSessionManager();
|
|
1319
|
+
let output = "";
|
|
1320
|
+
await acpManager.runTurn({
|
|
1321
|
+
cfg: params.cfg,
|
|
1322
|
+
sessionKey: params.sessionKey,
|
|
1323
|
+
text: params.instruction,
|
|
1324
|
+
mode: "steer",
|
|
1325
|
+
requestId: params.requestId,
|
|
1326
|
+
onEvent: (event) => {
|
|
1327
|
+
if (event.type !== "text_delta") return;
|
|
1328
|
+
if (event.stream && event.stream !== "output") return;
|
|
1329
|
+
if (event.text) {
|
|
1330
|
+
output += event.text;
|
|
1331
|
+
if (output.length > 800) output = `${output.slice(0, 800)}…`;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
return output.trim();
|
|
1336
|
+
}
|
|
1337
|
+
async function handleAcpSteerAction(params, restTokens) {
|
|
1338
|
+
const dispatchPolicyError = resolveAcpDispatchPolicyError(params.cfg);
|
|
1339
|
+
if (dispatchPolicyError) return stopWithText$1(collectAcpErrorText({
|
|
1340
|
+
error: dispatchPolicyError,
|
|
1341
|
+
fallbackCode: "ACP_DISPATCH_DISABLED",
|
|
1342
|
+
fallbackMessage: dispatchPolicyError.message
|
|
1343
|
+
}));
|
|
1344
|
+
const parsed = parseSteerInput(restTokens);
|
|
1345
|
+
if (!parsed.ok) return stopWithText$1(`⚠️ ${parsed.error}`);
|
|
1346
|
+
const acpManager = getAcpSessionManager();
|
|
1347
|
+
const target = await resolveAcpTargetSessionKey({
|
|
1348
|
+
commandParams: params,
|
|
1349
|
+
token: parsed.value.sessionToken
|
|
1350
|
+
});
|
|
1351
|
+
if (!target.ok) return stopWithText$1(`⚠️ ${target.error}`);
|
|
1352
|
+
const guardFailure = resolveAcpSessionForCommandOrStop({
|
|
1353
|
+
acpManager,
|
|
1354
|
+
cfg: params.cfg,
|
|
1355
|
+
sessionKey: target.sessionKey
|
|
1356
|
+
});
|
|
1357
|
+
if (guardFailure) return guardFailure;
|
|
1358
|
+
return await withAcpCommandErrorBoundary({
|
|
1359
|
+
run: async () => await runAcpSteer({
|
|
1360
|
+
cfg: params.cfg,
|
|
1361
|
+
sessionKey: target.sessionKey,
|
|
1362
|
+
instruction: parsed.value.instruction,
|
|
1363
|
+
requestId: `${resolveCommandRequestId(params)}:steer`
|
|
1364
|
+
}),
|
|
1365
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1366
|
+
fallbackMessage: "ACP steer failed before completion.",
|
|
1367
|
+
onSuccess: (steerOutput) => {
|
|
1368
|
+
if (!steerOutput) return stopWithText$1(`✅ ACP steer sent to ${target.sessionKey}.`);
|
|
1369
|
+
return stopWithText$1(`✅ ACP steer sent to ${target.sessionKey}.\n${steerOutput}`);
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
async function handleAcpCloseAction(params, restTokens) {
|
|
1374
|
+
return await withResolvedAcpSessionTarget({
|
|
1375
|
+
commandParams: params,
|
|
1376
|
+
restTokens,
|
|
1377
|
+
run: async ({ acpManager, sessionKey }) => {
|
|
1378
|
+
let runtimeNotice = "";
|
|
1379
|
+
try {
|
|
1380
|
+
const closed = await acpManager.closeSession({
|
|
1381
|
+
cfg: params.cfg,
|
|
1382
|
+
sessionKey,
|
|
1383
|
+
reason: "manual-close",
|
|
1384
|
+
allowBackendUnavailable: true,
|
|
1385
|
+
clearMeta: true
|
|
1386
|
+
});
|
|
1387
|
+
runtimeNotice = closed.runtimeNotice ? ` (${closed.runtimeNotice})` : "";
|
|
1388
|
+
} catch (error) {
|
|
1389
|
+
return stopWithText$1(collectAcpErrorText({
|
|
1390
|
+
error,
|
|
1391
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1392
|
+
fallbackMessage: "ACP close failed before completion."
|
|
1393
|
+
}));
|
|
1394
|
+
}
|
|
1395
|
+
const removedBindings = await getSessionBindingService().unbind({
|
|
1396
|
+
targetSessionKey: sessionKey,
|
|
1397
|
+
reason: "manual"
|
|
1398
|
+
});
|
|
1399
|
+
return stopWithText$1(`✅ Closed ACP session ${sessionKey}${runtimeNotice}. Removed ${removedBindings.length} binding${removedBindings.length === 1 ? "" : "s"}.`);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
//#endregion
|
|
1404
|
+
//#region src/auto-reply/reply/commands-acp/runtime-options.ts
|
|
1405
|
+
async function resolveTargetSessionKeyOrStop(params) {
|
|
1406
|
+
const target = await resolveAcpTargetSessionKey({
|
|
1407
|
+
commandParams: params.commandParams,
|
|
1408
|
+
token: params.token
|
|
1409
|
+
});
|
|
1410
|
+
if (!target.ok) return stopWithText$1(`⚠️ ${target.error}`);
|
|
1411
|
+
return target.sessionKey;
|
|
1412
|
+
}
|
|
1413
|
+
async function resolveOptionalSingleTargetOrStop(params) {
|
|
1414
|
+
const parsed = parseOptionalSingleTarget(params.restTokens, params.usage);
|
|
1415
|
+
if (!parsed.ok) return stopWithText$1(`⚠️ ${parsed.error}`);
|
|
1416
|
+
return await resolveTargetSessionKeyOrStop({
|
|
1417
|
+
commandParams: params.commandParams,
|
|
1418
|
+
token: parsed.sessionToken
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
async function resolveSingleTargetValueOrStop(params) {
|
|
1422
|
+
const parsed = parseSingleValueCommandInput(params.restTokens, params.usage);
|
|
1423
|
+
if (!parsed.ok) return stopWithText$1(`⚠️ ${parsed.error}`);
|
|
1424
|
+
const targetSessionKey = await resolveTargetSessionKeyOrStop({
|
|
1425
|
+
commandParams: params.commandParams,
|
|
1426
|
+
token: parsed.value.sessionToken
|
|
1427
|
+
});
|
|
1428
|
+
if (typeof targetSessionKey !== "string") return targetSessionKey;
|
|
1429
|
+
return {
|
|
1430
|
+
targetSessionKey,
|
|
1431
|
+
value: parsed.value.value
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
async function withSingleTargetValue(params) {
|
|
1435
|
+
const resolved = await resolveSingleTargetValueOrStop({
|
|
1436
|
+
commandParams: params.commandParams,
|
|
1437
|
+
restTokens: params.restTokens,
|
|
1438
|
+
usage: params.usage
|
|
1439
|
+
});
|
|
1440
|
+
if (!("targetSessionKey" in resolved)) return resolved;
|
|
1441
|
+
return await params.run(resolved);
|
|
1442
|
+
}
|
|
1443
|
+
async function handleAcpStatusAction(params, restTokens) {
|
|
1444
|
+
const targetSessionKey = await resolveOptionalSingleTargetOrStop({
|
|
1445
|
+
commandParams: params,
|
|
1446
|
+
restTokens,
|
|
1447
|
+
usage: ACP_STATUS_USAGE
|
|
1448
|
+
});
|
|
1449
|
+
if (typeof targetSessionKey !== "string") return targetSessionKey;
|
|
1450
|
+
return await withAcpCommandErrorBoundary({
|
|
1451
|
+
run: async () => await getAcpSessionManager().getSessionStatus({
|
|
1452
|
+
cfg: params.cfg,
|
|
1453
|
+
sessionKey: targetSessionKey
|
|
1454
|
+
}),
|
|
1455
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1456
|
+
fallbackMessage: "Could not read ACP session status.",
|
|
1457
|
+
onSuccess: (status) => {
|
|
1458
|
+
const sessionIdentifierLines = resolveAcpSessionIdentifierLinesFromIdentity({
|
|
1459
|
+
backend: status.backend,
|
|
1460
|
+
identity: status.identity
|
|
1461
|
+
});
|
|
1462
|
+
return stopWithText$1([
|
|
1463
|
+
"ACP status:",
|
|
1464
|
+
"-----",
|
|
1465
|
+
`session: ${status.sessionKey}`,
|
|
1466
|
+
`backend: ${status.backend}`,
|
|
1467
|
+
`agent: ${status.agent}`,
|
|
1468
|
+
...sessionIdentifierLines,
|
|
1469
|
+
`sessionMode: ${status.mode}`,
|
|
1470
|
+
`state: ${status.state}`,
|
|
1471
|
+
`runtimeOptions: ${formatRuntimeOptionsText(status.runtimeOptions)}`,
|
|
1472
|
+
`capabilities: ${formatAcpCapabilitiesText(status.capabilities.controls)}`,
|
|
1473
|
+
`lastActivityAt: ${new Date(status.lastActivityAt).toISOString()}`,
|
|
1474
|
+
...status.lastError ? [`lastError: ${status.lastError}`] : [],
|
|
1475
|
+
...status.runtimeStatus?.summary ? [`runtime: ${status.runtimeStatus.summary}`] : [],
|
|
1476
|
+
...status.runtimeStatus?.details ? [`runtimeDetails: ${JSON.stringify(status.runtimeStatus.details)}`] : []
|
|
1477
|
+
].join("\n"));
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
async function handleAcpSetModeAction(params, restTokens) {
|
|
1482
|
+
return await withSingleTargetValue({
|
|
1483
|
+
commandParams: params,
|
|
1484
|
+
restTokens,
|
|
1485
|
+
usage: ACP_SET_MODE_USAGE,
|
|
1486
|
+
run: async ({ targetSessionKey, value }) => await withAcpCommandErrorBoundary({
|
|
1487
|
+
run: async () => {
|
|
1488
|
+
const runtimeMode = validateRuntimeModeInput(value);
|
|
1489
|
+
return {
|
|
1490
|
+
runtimeMode,
|
|
1491
|
+
options: await getAcpSessionManager().setSessionRuntimeMode({
|
|
1492
|
+
cfg: params.cfg,
|
|
1493
|
+
sessionKey: targetSessionKey,
|
|
1494
|
+
runtimeMode
|
|
1495
|
+
})
|
|
1496
|
+
};
|
|
1497
|
+
},
|
|
1498
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1499
|
+
fallbackMessage: "Could not update ACP runtime mode.",
|
|
1500
|
+
onSuccess: ({ runtimeMode, options }) => stopWithText$1(`✅ Updated ACP runtime mode for ${targetSessionKey}: ${runtimeMode}. Effective options: ${formatRuntimeOptionsText(options)}`)
|
|
1501
|
+
})
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
async function handleAcpSetAction(params, restTokens) {
|
|
1505
|
+
const parsed = parseSetCommandInput(restTokens);
|
|
1506
|
+
if (!parsed.ok) return stopWithText$1(`⚠️ ${parsed.error}`);
|
|
1507
|
+
const target = await resolveAcpTargetSessionKey({
|
|
1508
|
+
commandParams: params,
|
|
1509
|
+
token: parsed.value.sessionToken
|
|
1510
|
+
});
|
|
1511
|
+
if (!target.ok) return stopWithText$1(`⚠️ ${target.error}`);
|
|
1512
|
+
const key = parsed.value.key.trim();
|
|
1513
|
+
const value = parsed.value.value.trim();
|
|
1514
|
+
return await withAcpCommandErrorBoundary({
|
|
1515
|
+
run: async () => {
|
|
1516
|
+
if (key.toLowerCase() === "cwd") {
|
|
1517
|
+
const cwd = validateRuntimeCwdInput(value);
|
|
1518
|
+
const options = await getAcpSessionManager().updateSessionRuntimeOptions({
|
|
1519
|
+
cfg: params.cfg,
|
|
1520
|
+
sessionKey: target.sessionKey,
|
|
1521
|
+
patch: { cwd }
|
|
1522
|
+
});
|
|
1523
|
+
return { text: `✅ Updated ACP cwd for ${target.sessionKey}: ${cwd}. Effective options: ${formatRuntimeOptionsText(options)}` };
|
|
1524
|
+
}
|
|
1525
|
+
const validated = validateRuntimeConfigOptionInput(key, value);
|
|
1526
|
+
const options = await getAcpSessionManager().setSessionConfigOption({
|
|
1527
|
+
cfg: params.cfg,
|
|
1528
|
+
sessionKey: target.sessionKey,
|
|
1529
|
+
key: validated.key,
|
|
1530
|
+
value: validated.value
|
|
1531
|
+
});
|
|
1532
|
+
return { text: `✅ Updated ACP config option for ${target.sessionKey}: ${validated.key}=${validated.value}. Effective options: ${formatRuntimeOptionsText(options)}` };
|
|
1533
|
+
},
|
|
1534
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1535
|
+
fallbackMessage: "Could not update ACP config option.",
|
|
1536
|
+
onSuccess: ({ text }) => stopWithText$1(text)
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
async function handleAcpCwdAction(params, restTokens) {
|
|
1540
|
+
return await withSingleTargetValue({
|
|
1541
|
+
commandParams: params,
|
|
1542
|
+
restTokens,
|
|
1543
|
+
usage: ACP_CWD_USAGE,
|
|
1544
|
+
run: async ({ targetSessionKey, value }) => await withAcpCommandErrorBoundary({
|
|
1545
|
+
run: async () => {
|
|
1546
|
+
const cwd = validateRuntimeCwdInput(value);
|
|
1547
|
+
return {
|
|
1548
|
+
cwd,
|
|
1549
|
+
options: await getAcpSessionManager().updateSessionRuntimeOptions({
|
|
1550
|
+
cfg: params.cfg,
|
|
1551
|
+
sessionKey: targetSessionKey,
|
|
1552
|
+
patch: { cwd }
|
|
1553
|
+
})
|
|
1554
|
+
};
|
|
1555
|
+
},
|
|
1556
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1557
|
+
fallbackMessage: "Could not update ACP cwd.",
|
|
1558
|
+
onSuccess: ({ cwd, options }) => stopWithText$1(`✅ Updated ACP cwd for ${targetSessionKey}: ${cwd}. Effective options: ${formatRuntimeOptionsText(options)}`)
|
|
1559
|
+
})
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
async function handleAcpPermissionsAction(params, restTokens) {
|
|
1563
|
+
return await withSingleTargetValue({
|
|
1564
|
+
commandParams: params,
|
|
1565
|
+
restTokens,
|
|
1566
|
+
usage: ACP_PERMISSIONS_USAGE,
|
|
1567
|
+
run: async ({ targetSessionKey, value }) => await withAcpCommandErrorBoundary({
|
|
1568
|
+
run: async () => {
|
|
1569
|
+
const permissionProfile = validateRuntimePermissionProfileInput(value);
|
|
1570
|
+
return {
|
|
1571
|
+
permissionProfile,
|
|
1572
|
+
options: await getAcpSessionManager().setSessionConfigOption({
|
|
1573
|
+
cfg: params.cfg,
|
|
1574
|
+
sessionKey: targetSessionKey,
|
|
1575
|
+
key: "approval_policy",
|
|
1576
|
+
value: permissionProfile
|
|
1577
|
+
})
|
|
1578
|
+
};
|
|
1579
|
+
},
|
|
1580
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1581
|
+
fallbackMessage: "Could not update ACP permissions profile.",
|
|
1582
|
+
onSuccess: ({ permissionProfile, options }) => stopWithText$1(`✅ Updated ACP permissions profile for ${targetSessionKey}: ${permissionProfile}. Effective options: ${formatRuntimeOptionsText(options)}`)
|
|
1583
|
+
})
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
async function handleAcpTimeoutAction(params, restTokens) {
|
|
1587
|
+
return await withSingleTargetValue({
|
|
1588
|
+
commandParams: params,
|
|
1589
|
+
restTokens,
|
|
1590
|
+
usage: ACP_TIMEOUT_USAGE,
|
|
1591
|
+
run: async ({ targetSessionKey, value }) => await withAcpCommandErrorBoundary({
|
|
1592
|
+
run: async () => {
|
|
1593
|
+
const timeoutSeconds = parseRuntimeTimeoutSecondsInput(value);
|
|
1594
|
+
return {
|
|
1595
|
+
timeoutSeconds,
|
|
1596
|
+
options: await getAcpSessionManager().setSessionConfigOption({
|
|
1597
|
+
cfg: params.cfg,
|
|
1598
|
+
sessionKey: targetSessionKey,
|
|
1599
|
+
key: "timeout",
|
|
1600
|
+
value: String(timeoutSeconds)
|
|
1601
|
+
})
|
|
1602
|
+
};
|
|
1603
|
+
},
|
|
1604
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1605
|
+
fallbackMessage: "Could not update ACP timeout.",
|
|
1606
|
+
onSuccess: ({ timeoutSeconds, options }) => stopWithText$1(`✅ Updated ACP timeout for ${targetSessionKey}: ${timeoutSeconds}s. Effective options: ${formatRuntimeOptionsText(options)}`)
|
|
1607
|
+
})
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
async function handleAcpModelAction(params, restTokens) {
|
|
1611
|
+
return await withSingleTargetValue({
|
|
1612
|
+
commandParams: params,
|
|
1613
|
+
restTokens,
|
|
1614
|
+
usage: ACP_MODEL_USAGE,
|
|
1615
|
+
run: async ({ targetSessionKey, value }) => await withAcpCommandErrorBoundary({
|
|
1616
|
+
run: async () => {
|
|
1617
|
+
const model = validateRuntimeModelInput(value);
|
|
1618
|
+
return {
|
|
1619
|
+
model,
|
|
1620
|
+
options: await getAcpSessionManager().setSessionConfigOption({
|
|
1621
|
+
cfg: params.cfg,
|
|
1622
|
+
sessionKey: targetSessionKey,
|
|
1623
|
+
key: "model",
|
|
1624
|
+
value: model
|
|
1625
|
+
})
|
|
1626
|
+
};
|
|
1627
|
+
},
|
|
1628
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1629
|
+
fallbackMessage: "Could not update ACP model.",
|
|
1630
|
+
onSuccess: ({ model, options }) => stopWithText$1(`✅ Updated ACP model for ${targetSessionKey}: ${model}. Effective options: ${formatRuntimeOptionsText(options)}`)
|
|
1631
|
+
})
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
async function handleAcpResetOptionsAction(params, restTokens) {
|
|
1635
|
+
const targetSessionKey = await resolveOptionalSingleTargetOrStop({
|
|
1636
|
+
commandParams: params,
|
|
1637
|
+
restTokens,
|
|
1638
|
+
usage: ACP_RESET_OPTIONS_USAGE
|
|
1639
|
+
});
|
|
1640
|
+
if (typeof targetSessionKey !== "string") return targetSessionKey;
|
|
1641
|
+
return await withAcpCommandErrorBoundary({
|
|
1642
|
+
run: async () => await getAcpSessionManager().resetSessionRuntimeOptions({
|
|
1643
|
+
cfg: params.cfg,
|
|
1644
|
+
sessionKey: targetSessionKey
|
|
1645
|
+
}),
|
|
1646
|
+
fallbackCode: "ACP_TURN_FAILED",
|
|
1647
|
+
fallbackMessage: "Could not reset ACP runtime options.",
|
|
1648
|
+
onSuccess: () => stopWithText$1(`✅ Reset ACP runtime options for ${targetSessionKey}.`)
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
//#endregion
|
|
1652
|
+
//#region src/auto-reply/reply/commands-acp.ts
|
|
1653
|
+
const ACP_ACTION_HANDLERS = {
|
|
1654
|
+
spawn: handleAcpSpawnAction,
|
|
1655
|
+
cancel: handleAcpCancelAction,
|
|
1656
|
+
steer: handleAcpSteerAction,
|
|
1657
|
+
close: handleAcpCloseAction,
|
|
1658
|
+
status: handleAcpStatusAction,
|
|
1659
|
+
"set-mode": handleAcpSetModeAction,
|
|
1660
|
+
set: handleAcpSetAction,
|
|
1661
|
+
cwd: handleAcpCwdAction,
|
|
1662
|
+
permissions: handleAcpPermissionsAction,
|
|
1663
|
+
timeout: handleAcpTimeoutAction,
|
|
1664
|
+
model: handleAcpModelAction,
|
|
1665
|
+
"reset-options": handleAcpResetOptionsAction,
|
|
1666
|
+
doctor: handleAcpDoctorAction,
|
|
1667
|
+
install: async (params, tokens) => handleAcpInstallAction(params, tokens),
|
|
1668
|
+
sessions: async (params, tokens) => handleAcpSessionsAction(params, tokens)
|
|
1669
|
+
};
|
|
1670
|
+
const ACP_MUTATING_ACTIONS = new Set([
|
|
1671
|
+
"spawn",
|
|
1672
|
+
"cancel",
|
|
1673
|
+
"steer",
|
|
1674
|
+
"close",
|
|
1675
|
+
"status",
|
|
1676
|
+
"set-mode",
|
|
1677
|
+
"set",
|
|
1678
|
+
"cwd",
|
|
1679
|
+
"permissions",
|
|
1680
|
+
"timeout",
|
|
1681
|
+
"model",
|
|
1682
|
+
"reset-options"
|
|
1683
|
+
]);
|
|
1684
|
+
const handleAcpCommand = async (params, allowTextCommands) => {
|
|
1685
|
+
if (!allowTextCommands) return null;
|
|
1686
|
+
const normalized = params.command.commandBodyNormalized;
|
|
1687
|
+
if (!normalized.startsWith("/acp")) return null;
|
|
1688
|
+
if (!params.command.isAuthorizedSender) {
|
|
1689
|
+
logVerbose(`Ignoring /acp from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
1690
|
+
return { shouldContinue: false };
|
|
1691
|
+
}
|
|
1692
|
+
const tokens = normalized.slice(4).trim().split(/\s+/).filter(Boolean);
|
|
1693
|
+
const action = resolveAcpAction(tokens);
|
|
1694
|
+
if (action === "help") return stopWithText$1(resolveAcpHelpText());
|
|
1695
|
+
if (ACP_MUTATING_ACTIONS.has(action)) {
|
|
1696
|
+
const scopeBlock = requireGatewayClientScopeForInternalChannel(params, {
|
|
1697
|
+
label: "/acp",
|
|
1698
|
+
allowedScopes: ["operator.admin"],
|
|
1699
|
+
missingText: "This /acp action requires operator.admin on the internal channel."
|
|
1700
|
+
});
|
|
1701
|
+
if (scopeBlock) return scopeBlock;
|
|
1702
|
+
}
|
|
1703
|
+
const handler = ACP_ACTION_HANDLERS[action];
|
|
1704
|
+
return handler ? await handler(params, tokens) : stopWithText$1(resolveAcpHelpText());
|
|
1705
|
+
};
|
|
1706
|
+
//#endregion
|
|
1707
|
+
//#region src/auto-reply/reply/config-write-authorization.ts
|
|
1708
|
+
function resolveConfigWriteDeniedText(params) {
|
|
1709
|
+
const writeAuth = authorizeConfigWrite({
|
|
1710
|
+
cfg: params.cfg,
|
|
1711
|
+
origin: {
|
|
1712
|
+
channelId: params.channelId,
|
|
1713
|
+
accountId: params.accountId
|
|
1714
|
+
},
|
|
1715
|
+
target: params.target,
|
|
1716
|
+
allowBypass: canBypassConfigWritePolicy({
|
|
1717
|
+
channel: params.channel ?? "",
|
|
1718
|
+
gatewayClientScopes: params.gatewayClientScopes
|
|
1719
|
+
})
|
|
1720
|
+
});
|
|
1721
|
+
if (writeAuth.allowed) return null;
|
|
1722
|
+
return formatConfigWriteDeniedMessage({
|
|
1723
|
+
result: writeAuth,
|
|
1724
|
+
fallbackChannelId: params.channelId
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
//#endregion
|
|
1728
|
+
//#region src/auto-reply/reply/commands-allowlist.ts
|
|
1729
|
+
const ACTIONS = new Set([
|
|
1730
|
+
"list",
|
|
1731
|
+
"add",
|
|
1732
|
+
"remove"
|
|
1733
|
+
]);
|
|
1734
|
+
const SCOPES = new Set([
|
|
1735
|
+
"dm",
|
|
1736
|
+
"group",
|
|
1737
|
+
"all"
|
|
1738
|
+
]);
|
|
1739
|
+
function parseAllowlistCommand(raw) {
|
|
1740
|
+
const trimmed = raw.trim();
|
|
1741
|
+
if (!trimmed.toLowerCase().startsWith("/allowlist")) return null;
|
|
1742
|
+
const rest = trimmed.slice(10).trim();
|
|
1743
|
+
if (!rest) return {
|
|
1744
|
+
action: "list",
|
|
1745
|
+
scope: "dm"
|
|
1746
|
+
};
|
|
1747
|
+
const tokens = rest.split(/\s+/);
|
|
1748
|
+
let action = "list";
|
|
1749
|
+
let scope = "dm";
|
|
1750
|
+
let resolve = false;
|
|
1751
|
+
let target = "both";
|
|
1752
|
+
let channel;
|
|
1753
|
+
let account;
|
|
1754
|
+
const entryTokens = [];
|
|
1755
|
+
let i = 0;
|
|
1756
|
+
if (tokens[i] && ACTIONS.has(tokens[i].toLowerCase())) {
|
|
1757
|
+
action = tokens[i].toLowerCase();
|
|
1758
|
+
i += 1;
|
|
1759
|
+
}
|
|
1760
|
+
if (tokens[i] && SCOPES.has(tokens[i].toLowerCase())) {
|
|
1761
|
+
scope = tokens[i].toLowerCase();
|
|
1762
|
+
i += 1;
|
|
1763
|
+
}
|
|
1764
|
+
for (; i < tokens.length; i += 1) {
|
|
1765
|
+
const token = tokens[i];
|
|
1766
|
+
const lowered = token.toLowerCase();
|
|
1767
|
+
if (lowered === "--resolve" || lowered === "resolve") {
|
|
1768
|
+
resolve = true;
|
|
1769
|
+
continue;
|
|
1770
|
+
}
|
|
1771
|
+
if (lowered === "--config" || lowered === "config") {
|
|
1772
|
+
target = "config";
|
|
1773
|
+
continue;
|
|
1774
|
+
}
|
|
1775
|
+
if (lowered === "--store" || lowered === "store") {
|
|
1776
|
+
target = "store";
|
|
1777
|
+
continue;
|
|
1778
|
+
}
|
|
1779
|
+
if (lowered === "--channel" && tokens[i + 1]) {
|
|
1780
|
+
channel = tokens[i + 1];
|
|
1781
|
+
i += 1;
|
|
1782
|
+
continue;
|
|
1783
|
+
}
|
|
1784
|
+
if (lowered === "--account" && tokens[i + 1]) {
|
|
1785
|
+
account = tokens[i + 1];
|
|
1786
|
+
i += 1;
|
|
1787
|
+
continue;
|
|
1788
|
+
}
|
|
1789
|
+
const kv = token.split("=");
|
|
1790
|
+
if (kv.length === 2) {
|
|
1791
|
+
const key = kv[0]?.trim().toLowerCase();
|
|
1792
|
+
const value = kv[1]?.trim();
|
|
1793
|
+
if (key === "channel") {
|
|
1794
|
+
if (value) channel = value;
|
|
1795
|
+
continue;
|
|
1796
|
+
}
|
|
1797
|
+
if (key === "account") {
|
|
1798
|
+
if (value) account = value;
|
|
1799
|
+
continue;
|
|
1800
|
+
}
|
|
1801
|
+
if (key === "scope" && value && SCOPES.has(value.toLowerCase())) {
|
|
1802
|
+
scope = value.toLowerCase();
|
|
1803
|
+
continue;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
entryTokens.push(token);
|
|
1807
|
+
}
|
|
1808
|
+
if (action === "add" || action === "remove") {
|
|
1809
|
+
const entry = entryTokens.join(" ").trim();
|
|
1810
|
+
if (!entry) return {
|
|
1811
|
+
action: "error",
|
|
1812
|
+
message: "Usage: /allowlist add|remove <entry>"
|
|
1813
|
+
};
|
|
1814
|
+
return {
|
|
1815
|
+
action,
|
|
1816
|
+
scope,
|
|
1817
|
+
entry,
|
|
1818
|
+
channel,
|
|
1819
|
+
account,
|
|
1820
|
+
resolve,
|
|
1821
|
+
target
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
return {
|
|
1825
|
+
action: "list",
|
|
1826
|
+
scope,
|
|
1827
|
+
channel,
|
|
1828
|
+
account,
|
|
1829
|
+
resolve
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
function normalizeAllowFrom(params) {
|
|
1833
|
+
const plugin = getChannelPlugin(params.channelId);
|
|
1834
|
+
if (plugin?.config.formatAllowFrom) return plugin.config.formatAllowFrom({
|
|
1835
|
+
cfg: params.cfg,
|
|
1836
|
+
accountId: params.accountId,
|
|
1837
|
+
allowFrom: params.values
|
|
1838
|
+
});
|
|
1839
|
+
return normalizeStringEntries(params.values);
|
|
1840
|
+
}
|
|
1841
|
+
function formatEntryList(entries, resolved) {
|
|
1842
|
+
if (entries.length === 0) return "(none)";
|
|
1843
|
+
return entries.map((entry) => {
|
|
1844
|
+
const name = resolved?.get(entry);
|
|
1845
|
+
return name ? `${entry} (${name})` : entry;
|
|
1846
|
+
}).join(", ");
|
|
1847
|
+
}
|
|
1848
|
+
async function updatePairingStoreAllowlist(params) {
|
|
1849
|
+
const storeEntry = {
|
|
1850
|
+
channel: params.channelId,
|
|
1851
|
+
entry: params.entry,
|
|
1852
|
+
accountId: params.accountId
|
|
1853
|
+
};
|
|
1854
|
+
if (params.action === "add") {
|
|
1855
|
+
await addChannelAllowFromStoreEntry(storeEntry);
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
await removeChannelAllowFromStoreEntry(storeEntry);
|
|
1859
|
+
if (params.accountId === "default") await removeChannelAllowFromStoreEntry({
|
|
1860
|
+
channel: params.channelId,
|
|
1861
|
+
entry: params.entry
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
function mapResolvedAllowlistNames(entries) {
|
|
1865
|
+
const map = /* @__PURE__ */ new Map();
|
|
1866
|
+
for (const entry of entries) if (entry.resolved && entry.name) map.set(entry.input, entry.name);
|
|
1867
|
+
return map;
|
|
1868
|
+
}
|
|
1869
|
+
async function resolveAllowlistNames(params) {
|
|
1870
|
+
return mapResolvedAllowlistNames(await getChannelPlugin(params.channelId)?.allowlist?.resolveNames?.({
|
|
1871
|
+
cfg: params.cfg,
|
|
1872
|
+
accountId: params.accountId,
|
|
1873
|
+
scope: params.scope,
|
|
1874
|
+
entries: params.entries
|
|
1875
|
+
}) ?? []);
|
|
1876
|
+
}
|
|
1877
|
+
async function readAllowlistConfig(params) {
|
|
1878
|
+
return await getChannelPlugin(params.channelId)?.allowlist?.readConfig?.({
|
|
1879
|
+
cfg: params.cfg,
|
|
1880
|
+
accountId: params.accountId
|
|
1881
|
+
}) ?? {};
|
|
1882
|
+
}
|
|
1883
|
+
const handleAllowlistCommand = async (params, allowTextCommands) => {
|
|
1884
|
+
if (!allowTextCommands) return null;
|
|
1885
|
+
const parsed = parseAllowlistCommand(params.command.commandBodyNormalized);
|
|
1886
|
+
if (!parsed) return null;
|
|
1887
|
+
if (parsed.action === "error") return {
|
|
1888
|
+
shouldContinue: false,
|
|
1889
|
+
reply: { text: `⚠️ ${parsed.message}` }
|
|
1890
|
+
};
|
|
1891
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/allowlist");
|
|
1892
|
+
if (unauthorized) return unauthorized;
|
|
1893
|
+
const channelId = normalizeChannelId(parsed.channel) ?? params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
1894
|
+
if (!channelId) return {
|
|
1895
|
+
shouldContinue: false,
|
|
1896
|
+
reply: { text: "⚠️ Unknown channel. Add channel=<id> to the command." }
|
|
1897
|
+
};
|
|
1898
|
+
if (parsed.account?.trim() && !normalizeOptionalAccountId(parsed.account)) return {
|
|
1899
|
+
shouldContinue: false,
|
|
1900
|
+
reply: { text: "⚠️ Invalid account id. Reserved keys (__proto__, constructor, prototype) are blocked." }
|
|
1901
|
+
};
|
|
1902
|
+
const accountId = normalizeAccountId(parsed.account ?? params.ctx.AccountId);
|
|
1903
|
+
const plugin = getChannelPlugin(channelId);
|
|
1904
|
+
if (parsed.action === "list") {
|
|
1905
|
+
const supportsStore = Boolean(plugin?.pairing);
|
|
1906
|
+
if (!plugin?.allowlist?.readConfig && !supportsStore) return {
|
|
1907
|
+
shouldContinue: false,
|
|
1908
|
+
reply: { text: `⚠️ ${channelId} does not expose allowlist configuration.` }
|
|
1909
|
+
};
|
|
1910
|
+
const storeAllowFrom = supportsStore ? await readChannelAllowFromStore(channelId, process.env, accountId).catch(() => []) : [];
|
|
1911
|
+
const configState = await readAllowlistConfig({
|
|
1912
|
+
cfg: params.cfg,
|
|
1913
|
+
channelId,
|
|
1914
|
+
accountId
|
|
1915
|
+
});
|
|
1916
|
+
const dmAllowFrom = (configState.dmAllowFrom ?? []).map(String);
|
|
1917
|
+
const groupAllowFrom = (configState.groupAllowFrom ?? []).map(String);
|
|
1918
|
+
const groupOverrides = (configState.groupOverrides ?? []).map((entry) => ({
|
|
1919
|
+
label: entry.label,
|
|
1920
|
+
entries: entry.entries.map(String).filter(Boolean)
|
|
1921
|
+
}));
|
|
1922
|
+
const dmDisplay = normalizeAllowFrom({
|
|
1923
|
+
cfg: params.cfg,
|
|
1924
|
+
channelId,
|
|
1925
|
+
accountId,
|
|
1926
|
+
values: dmAllowFrom
|
|
1927
|
+
});
|
|
1928
|
+
const groupDisplay = normalizeAllowFrom({
|
|
1929
|
+
cfg: params.cfg,
|
|
1930
|
+
channelId,
|
|
1931
|
+
accountId,
|
|
1932
|
+
values: groupAllowFrom
|
|
1933
|
+
});
|
|
1934
|
+
const groupOverrideEntries = groupOverrides.flatMap((entry) => entry.entries);
|
|
1935
|
+
const groupOverrideDisplay = normalizeAllowFrom({
|
|
1936
|
+
cfg: params.cfg,
|
|
1937
|
+
channelId,
|
|
1938
|
+
accountId,
|
|
1939
|
+
values: groupOverrideEntries
|
|
1940
|
+
});
|
|
1941
|
+
const resolvedDm = parsed.resolve && dmDisplay.length > 0 ? await resolveAllowlistNames({
|
|
1942
|
+
cfg: params.cfg,
|
|
1943
|
+
channelId,
|
|
1944
|
+
accountId,
|
|
1945
|
+
scope: "dm",
|
|
1946
|
+
entries: dmDisplay
|
|
1947
|
+
}) : void 0;
|
|
1948
|
+
const resolvedGroup = parsed.resolve && groupOverrideDisplay.length > 0 ? await resolveAllowlistNames({
|
|
1949
|
+
cfg: params.cfg,
|
|
1950
|
+
channelId,
|
|
1951
|
+
accountId,
|
|
1952
|
+
scope: "group",
|
|
1953
|
+
entries: groupOverrideDisplay
|
|
1954
|
+
}) : void 0;
|
|
1955
|
+
const lines = ["🧾 Allowlist"];
|
|
1956
|
+
lines.push(`Channel: ${channelId}${accountId ? ` (account ${accountId})` : ""}`);
|
|
1957
|
+
if (configState.dmPolicy) lines.push(`DM policy: ${configState.dmPolicy}`);
|
|
1958
|
+
if (configState.groupPolicy) lines.push(`Group policy: ${configState.groupPolicy}`);
|
|
1959
|
+
const showDm = parsed.scope === "dm" || parsed.scope === "all";
|
|
1960
|
+
const showGroup = parsed.scope === "group" || parsed.scope === "all";
|
|
1961
|
+
if (showDm) lines.push(`DM allowFrom (config): ${formatEntryList(dmDisplay, resolvedDm)}`);
|
|
1962
|
+
if (supportsStore && storeAllowFrom.length > 0) {
|
|
1963
|
+
const storeLabel = normalizeAllowFrom({
|
|
1964
|
+
cfg: params.cfg,
|
|
1965
|
+
channelId,
|
|
1966
|
+
accountId,
|
|
1967
|
+
values: storeAllowFrom
|
|
1968
|
+
});
|
|
1969
|
+
lines.push(`Paired allowFrom (store): ${formatEntryList(storeLabel)}`);
|
|
1970
|
+
}
|
|
1971
|
+
if (showGroup) {
|
|
1972
|
+
if (groupAllowFrom.length > 0) lines.push(`Group allowFrom (config): ${formatEntryList(groupDisplay, resolvedGroup)}`);
|
|
1973
|
+
if (groupOverrides.length > 0) {
|
|
1974
|
+
lines.push("Group overrides:");
|
|
1975
|
+
for (const entry of groupOverrides) {
|
|
1976
|
+
const normalized = normalizeAllowFrom({
|
|
1977
|
+
cfg: params.cfg,
|
|
1978
|
+
channelId,
|
|
1979
|
+
accountId,
|
|
1980
|
+
values: entry.entries
|
|
1981
|
+
});
|
|
1982
|
+
lines.push(`- ${entry.label}: ${formatEntryList(normalized, resolvedGroup)}`);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
return {
|
|
1987
|
+
shouldContinue: false,
|
|
1988
|
+
reply: { text: lines.join("\n") }
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
1992
|
+
label: "/allowlist edits",
|
|
1993
|
+
configKey: "config",
|
|
1994
|
+
disabledVerb: "are"
|
|
1995
|
+
});
|
|
1996
|
+
if (disabled) return disabled;
|
|
1997
|
+
const shouldUpdateConfig = parsed.target !== "store";
|
|
1998
|
+
const shouldTouchStore = parsed.target !== "config" && Boolean(plugin?.pairing);
|
|
1999
|
+
if (shouldUpdateConfig) {
|
|
2000
|
+
if (parsed.scope === "all") return {
|
|
2001
|
+
shouldContinue: false,
|
|
2002
|
+
reply: { text: "⚠️ /allowlist add|remove requires scope dm or group." }
|
|
2003
|
+
};
|
|
2004
|
+
if (!plugin?.allowlist?.applyConfigEdit) return {
|
|
2005
|
+
shouldContinue: false,
|
|
2006
|
+
reply: { text: `⚠️ ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
2007
|
+
};
|
|
2008
|
+
const snapshot = await readConfigFileSnapshot();
|
|
2009
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
2010
|
+
shouldContinue: false,
|
|
2011
|
+
reply: { text: "⚠️ Config file is invalid; fix it before using /allowlist." }
|
|
2012
|
+
};
|
|
2013
|
+
const parsedConfig = structuredClone(snapshot.parsed);
|
|
2014
|
+
const editResult = await plugin.allowlist.applyConfigEdit({
|
|
2015
|
+
cfg: params.cfg,
|
|
2016
|
+
parsedConfig,
|
|
2017
|
+
accountId,
|
|
2018
|
+
scope: parsed.scope,
|
|
2019
|
+
action: parsed.action,
|
|
2020
|
+
entry: parsed.entry
|
|
2021
|
+
});
|
|
2022
|
+
if (!editResult) return {
|
|
2023
|
+
shouldContinue: false,
|
|
2024
|
+
reply: { text: `⚠️ ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
|
|
2025
|
+
};
|
|
2026
|
+
if (editResult.kind === "invalid-entry") return {
|
|
2027
|
+
shouldContinue: false,
|
|
2028
|
+
reply: { text: "⚠️ Invalid allowlist entry." }
|
|
2029
|
+
};
|
|
2030
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
2031
|
+
cfg: params.cfg,
|
|
2032
|
+
channel: params.command.channel,
|
|
2033
|
+
channelId,
|
|
2034
|
+
accountId: params.ctx.AccountId,
|
|
2035
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
2036
|
+
target: editResult.writeTarget
|
|
2037
|
+
});
|
|
2038
|
+
if (deniedText) return {
|
|
2039
|
+
shouldContinue: false,
|
|
2040
|
+
reply: { text: deniedText }
|
|
2041
|
+
};
|
|
2042
|
+
const configChanged = editResult.changed;
|
|
2043
|
+
if (configChanged) {
|
|
2044
|
+
const validated = validateConfigObjectWithPlugins(parsedConfig);
|
|
2045
|
+
if (!validated.ok) {
|
|
2046
|
+
const issue = validated.issues[0];
|
|
2047
|
+
return {
|
|
2048
|
+
shouldContinue: false,
|
|
2049
|
+
reply: { text: `⚠️ Config invalid after update (${issue.path}: ${issue.message}).` }
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
await writeConfigFile(validated.config);
|
|
2053
|
+
}
|
|
2054
|
+
if (!configChanged && !shouldTouchStore) return {
|
|
2055
|
+
shouldContinue: false,
|
|
2056
|
+
reply: { text: parsed.action === "add" ? "✅ Already allowlisted." : "⚠️ Entry not found." }
|
|
2057
|
+
};
|
|
2058
|
+
if (shouldTouchStore) await updatePairingStoreAllowlist({
|
|
2059
|
+
action: parsed.action,
|
|
2060
|
+
channelId,
|
|
2061
|
+
accountId,
|
|
2062
|
+
entry: parsed.entry
|
|
2063
|
+
});
|
|
2064
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
2065
|
+
const scopeLabel = parsed.scope === "dm" ? "DM" : "group";
|
|
2066
|
+
const locations = [];
|
|
2067
|
+
if (configChanged) locations.push(editResult.pathLabel);
|
|
2068
|
+
if (shouldTouchStore) locations.push("pairing store");
|
|
2069
|
+
return {
|
|
2070
|
+
shouldContinue: false,
|
|
2071
|
+
reply: { text: `✅ ${scopeLabel} allowlist ${actionLabel}: ${locations.length > 0 ? locations.join(" + ") : "no-op"}.` }
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
if (!shouldTouchStore) return {
|
|
2075
|
+
shouldContinue: false,
|
|
2076
|
+
reply: { text: "⚠️ This channel does not support allowlist storage." }
|
|
2077
|
+
};
|
|
2078
|
+
await updatePairingStoreAllowlist({
|
|
2079
|
+
action: parsed.action,
|
|
2080
|
+
channelId,
|
|
2081
|
+
accountId,
|
|
2082
|
+
entry: parsed.entry
|
|
2083
|
+
});
|
|
2084
|
+
const actionLabel = parsed.action === "add" ? "added" : "removed";
|
|
2085
|
+
return {
|
|
2086
|
+
shouldContinue: false,
|
|
2087
|
+
reply: { text: `✅ ${parsed.scope === "dm" ? "DM" : "group"} allowlist ${actionLabel} in pairing store.` }
|
|
2088
|
+
};
|
|
2089
|
+
};
|
|
2090
|
+
//#endregion
|
|
2091
|
+
//#region src/auto-reply/reply/commands-approve.ts
|
|
2092
|
+
const COMMAND_REGEX = /^\/approve(?:\s|$)/i;
|
|
2093
|
+
const FOREIGN_COMMAND_MENTION_REGEX = /^\/approve@([^\s]+)(?:\s|$)/i;
|
|
2094
|
+
const DECISION_ALIASES = {
|
|
2095
|
+
allow: "allow-once",
|
|
2096
|
+
once: "allow-once",
|
|
2097
|
+
"allow-once": "allow-once",
|
|
2098
|
+
allowonce: "allow-once",
|
|
2099
|
+
always: "allow-always",
|
|
2100
|
+
"allow-always": "allow-always",
|
|
2101
|
+
allowalways: "allow-always",
|
|
2102
|
+
deny: "deny",
|
|
2103
|
+
reject: "deny",
|
|
2104
|
+
block: "deny"
|
|
2105
|
+
};
|
|
2106
|
+
function parseApproveCommand(raw) {
|
|
2107
|
+
const trimmed = raw.trim();
|
|
2108
|
+
if (FOREIGN_COMMAND_MENTION_REGEX.test(trimmed)) return {
|
|
2109
|
+
ok: false,
|
|
2110
|
+
error: "❌ This /approve command targets a different Telegram bot."
|
|
2111
|
+
};
|
|
2112
|
+
const commandMatch = trimmed.match(COMMAND_REGEX);
|
|
2113
|
+
if (!commandMatch) return null;
|
|
2114
|
+
const rest = trimmed.slice(commandMatch[0].length).trim();
|
|
2115
|
+
if (!rest) return {
|
|
2116
|
+
ok: false,
|
|
2117
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
2118
|
+
};
|
|
2119
|
+
const tokens = rest.split(/\s+/).filter(Boolean);
|
|
2120
|
+
if (tokens.length < 2) return {
|
|
2121
|
+
ok: false,
|
|
2122
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
2123
|
+
};
|
|
2124
|
+
const first = tokens[0].toLowerCase();
|
|
2125
|
+
const second = tokens[1].toLowerCase();
|
|
2126
|
+
if (DECISION_ALIASES[first]) return {
|
|
2127
|
+
ok: true,
|
|
2128
|
+
decision: DECISION_ALIASES[first],
|
|
2129
|
+
id: tokens.slice(1).join(" ").trim()
|
|
2130
|
+
};
|
|
2131
|
+
if (DECISION_ALIASES[second]) return {
|
|
2132
|
+
ok: true,
|
|
2133
|
+
decision: DECISION_ALIASES[second],
|
|
2134
|
+
id: tokens[0]
|
|
2135
|
+
};
|
|
2136
|
+
return {
|
|
2137
|
+
ok: false,
|
|
2138
|
+
error: "Usage: /approve <id> allow-once|allow-always|deny"
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
function buildResolvedByLabel(params) {
|
|
2142
|
+
return `${params.command.channel}:${params.command.senderId ?? "unknown"}`;
|
|
2143
|
+
}
|
|
2144
|
+
const handleApproveCommand = async (params, allowTextCommands) => {
|
|
2145
|
+
if (!allowTextCommands) return null;
|
|
2146
|
+
const normalized = params.command.commandBodyNormalized;
|
|
2147
|
+
const parsed = parseApproveCommand(normalized);
|
|
2148
|
+
if (!parsed) return null;
|
|
2149
|
+
if (!params.command.isAuthorizedSender) {
|
|
2150
|
+
logVerbose(`Ignoring /approve from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2151
|
+
return { shouldContinue: false };
|
|
2152
|
+
}
|
|
2153
|
+
if (!parsed.ok) return {
|
|
2154
|
+
shouldContinue: false,
|
|
2155
|
+
reply: { text: parsed.error }
|
|
2156
|
+
};
|
|
2157
|
+
if (params.command.channel === "telegram") {
|
|
2158
|
+
if (!isTelegramExecApprovalClientEnabled({
|
|
2159
|
+
cfg: params.cfg,
|
|
2160
|
+
accountId: params.ctx.AccountId
|
|
2161
|
+
})) return {
|
|
2162
|
+
shouldContinue: false,
|
|
2163
|
+
reply: { text: "❌ Telegram exec approvals are not enabled for this bot account." }
|
|
2164
|
+
};
|
|
2165
|
+
if (!isTelegramExecApprovalApprover({
|
|
2166
|
+
cfg: params.cfg,
|
|
2167
|
+
accountId: params.ctx.AccountId,
|
|
2168
|
+
senderId: params.command.senderId
|
|
2169
|
+
})) return {
|
|
2170
|
+
shouldContinue: false,
|
|
2171
|
+
reply: { text: "❌ You are not authorized to approve exec requests on Telegram." }
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
const missingScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2175
|
+
label: "/approve",
|
|
2176
|
+
allowedScopes: ["operator.approvals", "operator.admin"],
|
|
2177
|
+
missingText: "❌ /approve requires operator.approvals for gateway clients."
|
|
2178
|
+
});
|
|
2179
|
+
if (missingScope) return missingScope;
|
|
2180
|
+
const resolvedBy = buildResolvedByLabel(params);
|
|
2181
|
+
try {
|
|
2182
|
+
await callGateway({
|
|
2183
|
+
method: "exec.approval.resolve",
|
|
2184
|
+
params: {
|
|
2185
|
+
id: parsed.id,
|
|
2186
|
+
decision: parsed.decision
|
|
2187
|
+
},
|
|
2188
|
+
clientName: GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
2189
|
+
clientDisplayName: `Chat approval (${resolvedBy})`,
|
|
2190
|
+
mode: GATEWAY_CLIENT_MODES.BACKEND
|
|
2191
|
+
});
|
|
2192
|
+
} catch (err) {
|
|
2193
|
+
return {
|
|
2194
|
+
shouldContinue: false,
|
|
2195
|
+
reply: { text: `❌ Failed to submit approval: ${String(err)}` }
|
|
2196
|
+
};
|
|
2197
|
+
}
|
|
2198
|
+
return {
|
|
2199
|
+
shouldContinue: false,
|
|
2200
|
+
reply: { text: `✅ Exec approval ${parsed.decision} submitted for ${parsed.id}.` }
|
|
2201
|
+
};
|
|
2202
|
+
};
|
|
2203
|
+
//#endregion
|
|
2204
|
+
//#region src/auto-reply/reply/bash-command.ts
|
|
2205
|
+
const CHAT_BASH_SCOPE_KEY = "chat:bash";
|
|
2206
|
+
const DEFAULT_FOREGROUND_MS = 2e3;
|
|
2207
|
+
const MAX_FOREGROUND_MS = 3e4;
|
|
2208
|
+
let activeJob = null;
|
|
2209
|
+
function resolveForegroundMs(cfg) {
|
|
2210
|
+
const raw = cfg.commands?.bashForegroundMs;
|
|
2211
|
+
if (typeof raw !== "number" || Number.isNaN(raw)) return DEFAULT_FOREGROUND_MS;
|
|
2212
|
+
return clampInt(raw, 0, MAX_FOREGROUND_MS);
|
|
2213
|
+
}
|
|
2214
|
+
function formatSessionSnippet(sessionId) {
|
|
2215
|
+
const trimmed = sessionId.trim();
|
|
2216
|
+
if (trimmed.length <= 12) return trimmed;
|
|
2217
|
+
return `${trimmed.slice(0, 8)}…`;
|
|
2218
|
+
}
|
|
2219
|
+
function formatOutputBlock(text) {
|
|
2220
|
+
const trimmed = text.trim();
|
|
2221
|
+
if (!trimmed) return "(no output)";
|
|
2222
|
+
return `\`\`\`txt\n${trimmed}\n\`\`\``;
|
|
2223
|
+
}
|
|
2224
|
+
function parseBashRequest(raw) {
|
|
2225
|
+
const trimmed = raw.trimStart();
|
|
2226
|
+
let restSource = "";
|
|
2227
|
+
if (trimmed.toLowerCase().startsWith("/bash")) {
|
|
2228
|
+
const match = trimmed.match(/^\/bash(?:\s*:\s*|\s+|$)([\s\S]*)$/i);
|
|
2229
|
+
if (!match) return null;
|
|
2230
|
+
restSource = match[1] ?? "";
|
|
2231
|
+
} else if (trimmed.startsWith("!")) {
|
|
2232
|
+
restSource = trimmed.slice(1);
|
|
2233
|
+
if (restSource.trimStart().startsWith(":")) restSource = restSource.trimStart().slice(1);
|
|
2234
|
+
} else return null;
|
|
2235
|
+
const rest = restSource.trimStart();
|
|
2236
|
+
if (!rest) return { action: "help" };
|
|
2237
|
+
const tokenMatch = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
2238
|
+
const token = tokenMatch?.[1]?.trim() ?? "";
|
|
2239
|
+
const remainder = tokenMatch?.[2]?.trim() ?? "";
|
|
2240
|
+
const lowered = token.toLowerCase();
|
|
2241
|
+
if (lowered === "poll") return {
|
|
2242
|
+
action: "poll",
|
|
2243
|
+
sessionId: remainder || void 0
|
|
2244
|
+
};
|
|
2245
|
+
if (lowered === "stop") return {
|
|
2246
|
+
action: "stop",
|
|
2247
|
+
sessionId: remainder || void 0
|
|
2248
|
+
};
|
|
2249
|
+
if (lowered === "help") return { action: "help" };
|
|
2250
|
+
return {
|
|
2251
|
+
action: "run",
|
|
2252
|
+
command: rest
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
function resolveRawCommandBody(params) {
|
|
2256
|
+
const stripped = stripStructuralPrefixes(params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body ?? "");
|
|
2257
|
+
return params.isGroup ? stripMentions(stripped, params.ctx, params.cfg, params.agentId) : stripped;
|
|
2258
|
+
}
|
|
2259
|
+
function getScopedSession(sessionId) {
|
|
2260
|
+
const running = getSession(sessionId);
|
|
2261
|
+
if (running && running.scopeKey === CHAT_BASH_SCOPE_KEY) return { running };
|
|
2262
|
+
const finished = getFinishedSession(sessionId);
|
|
2263
|
+
if (finished && finished.scopeKey === CHAT_BASH_SCOPE_KEY) return { finished };
|
|
2264
|
+
return {};
|
|
2265
|
+
}
|
|
2266
|
+
function ensureActiveJobState() {
|
|
2267
|
+
if (!activeJob) return null;
|
|
2268
|
+
if (activeJob.state === "starting") return activeJob;
|
|
2269
|
+
const { running, finished } = getScopedSession(activeJob.sessionId);
|
|
2270
|
+
if (running) return activeJob;
|
|
2271
|
+
if (finished) {
|
|
2272
|
+
activeJob = null;
|
|
2273
|
+
return null;
|
|
2274
|
+
}
|
|
2275
|
+
activeJob = null;
|
|
2276
|
+
return null;
|
|
2277
|
+
}
|
|
2278
|
+
function attachActiveWatcher(sessionId) {
|
|
2279
|
+
if (!activeJob || activeJob.state !== "running") return;
|
|
2280
|
+
if (activeJob.sessionId !== sessionId) return;
|
|
2281
|
+
if (activeJob.watcherAttached) return;
|
|
2282
|
+
const { running } = getScopedSession(sessionId);
|
|
2283
|
+
const child = running?.child;
|
|
2284
|
+
if (!child) return;
|
|
2285
|
+
activeJob.watcherAttached = true;
|
|
2286
|
+
child.once("close", () => {
|
|
2287
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
function buildUsageReply() {
|
|
2291
|
+
return { text: [
|
|
2292
|
+
"⚙️ Usage:",
|
|
2293
|
+
"- ! <command>",
|
|
2294
|
+
"- !poll | ! poll",
|
|
2295
|
+
"- !stop | ! stop",
|
|
2296
|
+
"- /bash ... (alias; same subcommands as !)"
|
|
2297
|
+
].join("\n") };
|
|
2298
|
+
}
|
|
2299
|
+
async function handleBashChatCommand(params) {
|
|
2300
|
+
if (!isCommandFlagEnabled(params.cfg, "bash")) return buildDisabledCommandReply({
|
|
2301
|
+
label: "bash",
|
|
2302
|
+
configKey: "bash",
|
|
2303
|
+
docsUrl: "https://github.com/SlientLake/SlientLakeAgent/tree/main/docs/tools/slash-commands#config"
|
|
2304
|
+
});
|
|
2305
|
+
const agentId = params.agentId ?? resolveSessionAgentId({
|
|
2306
|
+
sessionKey: params.sessionKey,
|
|
2307
|
+
config: params.cfg
|
|
2308
|
+
});
|
|
2309
|
+
if (!params.elevated.enabled || !params.elevated.allowed) {
|
|
2310
|
+
const runtimeSandboxed = resolveSandboxRuntimeStatus({
|
|
2311
|
+
cfg: params.cfg,
|
|
2312
|
+
sessionKey: params.ctx.SessionKey
|
|
2313
|
+
}).sandboxed;
|
|
2314
|
+
return { text: formatElevatedUnavailableMessage({
|
|
2315
|
+
runtimeSandboxed,
|
|
2316
|
+
failures: params.elevated.failures,
|
|
2317
|
+
sessionKey: params.ctx.SessionKey
|
|
2318
|
+
}) };
|
|
2319
|
+
}
|
|
2320
|
+
const request = parseBashRequest(resolveRawCommandBody({
|
|
2321
|
+
ctx: params.ctx,
|
|
2322
|
+
cfg: params.cfg,
|
|
2323
|
+
agentId,
|
|
2324
|
+
isGroup: params.isGroup
|
|
2325
|
+
}).trim());
|
|
2326
|
+
if (!request) return { text: "⚠️ Unrecognized bash request." };
|
|
2327
|
+
const liveJob = ensureActiveJobState();
|
|
2328
|
+
if (request.action === "help") return buildUsageReply();
|
|
2329
|
+
if (request.action === "poll") {
|
|
2330
|
+
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
2331
|
+
if (!sessionId) return { text: "⚙️ No active bash job." };
|
|
2332
|
+
const { running, finished } = getScopedSession(sessionId);
|
|
2333
|
+
if (running) {
|
|
2334
|
+
attachActiveWatcher(sessionId);
|
|
2335
|
+
const runtimeSec = Math.max(0, Math.floor((Date.now() - running.startedAt) / 1e3));
|
|
2336
|
+
const tail = running.tail || "(no output yet)";
|
|
2337
|
+
return { text: [
|
|
2338
|
+
`⚙️ bash still running (session ${formatSessionSnippet(sessionId)}, ${runtimeSec}s).`,
|
|
2339
|
+
formatOutputBlock(tail),
|
|
2340
|
+
"Hint: !stop (or /bash stop)"
|
|
2341
|
+
].join("\n") };
|
|
2342
|
+
}
|
|
2343
|
+
if (finished) {
|
|
2344
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
2345
|
+
const exitLabel = finished.exitSignal ? `signal ${String(finished.exitSignal)}` : `code ${String(finished.exitCode ?? 0)}`;
|
|
2346
|
+
return { text: [
|
|
2347
|
+
`${finished.status === "completed" ? "⚙️" : "⚠️"} bash finished (session ${formatSessionSnippet(sessionId)}).`,
|
|
2348
|
+
`Exit: ${exitLabel}`,
|
|
2349
|
+
formatOutputBlock(finished.aggregated || finished.tail)
|
|
2350
|
+
].join("\n") };
|
|
2351
|
+
}
|
|
2352
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
2353
|
+
return { text: `⚙️ No bash session found for ${formatSessionSnippet(sessionId)}.` };
|
|
2354
|
+
}
|
|
2355
|
+
if (request.action === "stop") {
|
|
2356
|
+
const sessionId = request.sessionId?.trim() || (liveJob?.state === "running" ? liveJob.sessionId : "");
|
|
2357
|
+
if (!sessionId) return { text: "⚙️ No active bash job." };
|
|
2358
|
+
const { running } = getScopedSession(sessionId);
|
|
2359
|
+
if (!running) {
|
|
2360
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
2361
|
+
return { text: `⚙️ No running bash job found for ${formatSessionSnippet(sessionId)}.` };
|
|
2362
|
+
}
|
|
2363
|
+
if (!running.backgrounded) return { text: `⚠️ Session ${formatSessionSnippet(sessionId)} is not backgrounded.` };
|
|
2364
|
+
const pid = running.pid ?? running.child?.pid;
|
|
2365
|
+
if (pid) killProcessTree(pid);
|
|
2366
|
+
markExited(running, null, "SIGKILL", "failed");
|
|
2367
|
+
if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
|
|
2368
|
+
return { text: `⚙️ bash stopped (session ${formatSessionSnippet(sessionId)}).` };
|
|
2369
|
+
}
|
|
2370
|
+
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).` };
|
|
2371
|
+
const commandText = request.command.trim();
|
|
2372
|
+
if (!commandText) return buildUsageReply();
|
|
2373
|
+
activeJob = {
|
|
2374
|
+
state: "starting",
|
|
2375
|
+
startedAt: Date.now(),
|
|
2376
|
+
command: commandText
|
|
2377
|
+
};
|
|
2378
|
+
try {
|
|
2379
|
+
const foregroundMs = resolveForegroundMs(params.cfg);
|
|
2380
|
+
const shouldBackgroundImmediately = foregroundMs <= 0;
|
|
2381
|
+
const timeoutSec = params.cfg.tools?.exec?.timeoutSec;
|
|
2382
|
+
const notifyOnExit = params.cfg.tools?.exec?.notifyOnExit;
|
|
2383
|
+
const notifyOnExitEmptySuccess = params.cfg.tools?.exec?.notifyOnExitEmptySuccess;
|
|
2384
|
+
const result = await createExecTool({
|
|
2385
|
+
scopeKey: CHAT_BASH_SCOPE_KEY,
|
|
2386
|
+
allowBackground: true,
|
|
2387
|
+
timeoutSec,
|
|
2388
|
+
sessionKey: params.sessionKey,
|
|
2389
|
+
notifyOnExit,
|
|
2390
|
+
notifyOnExitEmptySuccess,
|
|
2391
|
+
elevated: {
|
|
2392
|
+
enabled: params.elevated.enabled,
|
|
2393
|
+
allowed: params.elevated.allowed,
|
|
2394
|
+
defaultLevel: "on"
|
|
2395
|
+
}
|
|
2396
|
+
}).execute("chat-bash", {
|
|
2397
|
+
command: commandText,
|
|
2398
|
+
background: shouldBackgroundImmediately,
|
|
2399
|
+
yieldMs: shouldBackgroundImmediately ? void 0 : foregroundMs,
|
|
2400
|
+
timeout: timeoutSec,
|
|
2401
|
+
elevated: true
|
|
2402
|
+
});
|
|
2403
|
+
if (result.details?.status === "running") {
|
|
2404
|
+
const sessionId = result.details.sessionId;
|
|
2405
|
+
activeJob = {
|
|
2406
|
+
state: "running",
|
|
2407
|
+
sessionId,
|
|
2408
|
+
startedAt: result.details.startedAt,
|
|
2409
|
+
command: commandText,
|
|
2410
|
+
watcherAttached: false
|
|
2411
|
+
};
|
|
2412
|
+
attachActiveWatcher(sessionId);
|
|
2413
|
+
logVerbose(`Started bash session ${formatSessionSnippet(sessionId)}: ${commandText}`);
|
|
2414
|
+
return { text: `⚙️ bash started (session ${sessionId}). Still running; use !poll / !stop (or /bash poll / /bash stop).` };
|
|
2415
|
+
}
|
|
2416
|
+
activeJob = null;
|
|
2417
|
+
const exitCode = result.details?.status === "completed" ? result.details.exitCode : 0;
|
|
2418
|
+
const output = result.details?.status === "completed" ? result.details.aggregated : result.content.map((chunk) => chunk.type === "text" ? chunk.text : "").join("\n");
|
|
2419
|
+
return { text: [
|
|
2420
|
+
`⚙️ bash: ${commandText}`,
|
|
2421
|
+
`Exit: ${exitCode}`,
|
|
2422
|
+
formatOutputBlock(output || "(no output)")
|
|
2423
|
+
].join("\n") };
|
|
2424
|
+
} catch (err) {
|
|
2425
|
+
activeJob = null;
|
|
2426
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2427
|
+
return { text: [`⚠️ bash failed: ${commandText}`, formatOutputBlock(message)].join("\n") };
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
//#endregion
|
|
2431
|
+
//#region src/auto-reply/reply/commands-bash.ts
|
|
2432
|
+
const handleBashCommand = async (params, allowTextCommands) => {
|
|
2433
|
+
if (!allowTextCommands) return null;
|
|
2434
|
+
const { command } = params;
|
|
2435
|
+
const bashSlashRequested = command.commandBodyNormalized === "/bash" || command.commandBodyNormalized.startsWith("/bash ");
|
|
2436
|
+
const bashBangRequested = command.commandBodyNormalized.startsWith("!");
|
|
2437
|
+
if (!bashSlashRequested && !(bashBangRequested && command.isAuthorizedSender)) return null;
|
|
2438
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/bash");
|
|
2439
|
+
if (unauthorized) return unauthorized;
|
|
2440
|
+
return {
|
|
2441
|
+
shouldContinue: false,
|
|
2442
|
+
reply: await handleBashChatCommand({
|
|
2443
|
+
ctx: params.ctx,
|
|
2444
|
+
cfg: params.cfg,
|
|
2445
|
+
agentId: params.agentId,
|
|
2446
|
+
sessionKey: params.sessionKey,
|
|
2447
|
+
isGroup: params.isGroup,
|
|
2448
|
+
elevated: params.elevated
|
|
2449
|
+
})
|
|
2450
|
+
};
|
|
2451
|
+
};
|
|
2452
|
+
//#endregion
|
|
2453
|
+
//#region src/agents/btw.ts
|
|
2454
|
+
function collectTextContent(content) {
|
|
2455
|
+
return content.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
2456
|
+
}
|
|
2457
|
+
function collectThinkingContent(content) {
|
|
2458
|
+
return content.filter((part) => part.type === "thinking").map((part) => part.thinking).join("");
|
|
2459
|
+
}
|
|
2460
|
+
function buildBtwSystemPrompt() {
|
|
2461
|
+
return [
|
|
2462
|
+
"You are answering an ephemeral /btw side question about the current conversation.",
|
|
2463
|
+
"Use the conversation only as background context.",
|
|
2464
|
+
"Answer only the side question in the last user message.",
|
|
2465
|
+
"Do not continue, resume, or complete any unfinished task from the conversation.",
|
|
2466
|
+
"Do not emit tool calls, pseudo-tool calls, shell commands, file writes, patches, or code unless the side question explicitly asks for them.",
|
|
2467
|
+
"Do not say you will continue the main task after answering.",
|
|
2468
|
+
"If the question can be answered briefly, answer briefly."
|
|
2469
|
+
].join("\n");
|
|
2470
|
+
}
|
|
2471
|
+
function buildBtwQuestionPrompt(question, inFlightPrompt) {
|
|
2472
|
+
const lines = ["Answer this side question only.", "Ignore any unfinished task in the conversation while answering it."];
|
|
2473
|
+
const trimmedPrompt = inFlightPrompt?.trim();
|
|
2474
|
+
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.");
|
|
2475
|
+
lines.push("", "<btw_side_question>", question.trim(), "</btw_side_question>");
|
|
2476
|
+
return lines.join("\n");
|
|
2477
|
+
}
|
|
2478
|
+
function toSimpleContextMessages(messages) {
|
|
2479
|
+
return stripToolResultDetails(messages.filter((message) => {
|
|
2480
|
+
if (!message || typeof message !== "object") return false;
|
|
2481
|
+
const role = message.role;
|
|
2482
|
+
return role === "user" || role === "assistant";
|
|
2483
|
+
}));
|
|
2484
|
+
}
|
|
2485
|
+
function resolveSimpleThinkingLevel(level) {
|
|
2486
|
+
if (!level || level === "off") return;
|
|
2487
|
+
return mapThinkingLevel(level);
|
|
2488
|
+
}
|
|
2489
|
+
function resolveSessionTranscriptPath(params) {
|
|
2490
|
+
try {
|
|
2491
|
+
const agentId = params.sessionKey?.split(":")[1];
|
|
2492
|
+
const pathOpts = resolveSessionFilePathOptions({
|
|
2493
|
+
agentId,
|
|
2494
|
+
storePath: params.storePath
|
|
2495
|
+
});
|
|
2496
|
+
return resolveSessionFilePath(params.sessionId, params.sessionEntry, pathOpts);
|
|
2497
|
+
} catch (error) {
|
|
2498
|
+
diag.debug(`resolveSessionTranscriptPath failed: sessionId=${params.sessionId} err=${String(error)}`);
|
|
2499
|
+
return;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
async function resolveRuntimeModel(params) {
|
|
2503
|
+
await ensureOpenClawModelsJson(params.cfg, params.agentDir);
|
|
2504
|
+
const modelRegistry = discoverModels(discoverAuthStorage(params.agentDir), params.agentDir);
|
|
2505
|
+
const model = resolveModelWithRegistry({
|
|
2506
|
+
provider: params.provider,
|
|
2507
|
+
modelId: params.model,
|
|
2508
|
+
modelRegistry,
|
|
2509
|
+
cfg: params.cfg
|
|
2510
|
+
});
|
|
2511
|
+
if (!model) throw new Error(`Unknown model: ${params.provider}/${params.model}`);
|
|
2512
|
+
return {
|
|
2513
|
+
model,
|
|
2514
|
+
authProfileId: await resolveSessionAuthProfileOverride({
|
|
2515
|
+
cfg: params.cfg,
|
|
2516
|
+
provider: params.provider,
|
|
2517
|
+
agentDir: params.agentDir,
|
|
2518
|
+
sessionEntry: params.sessionEntry,
|
|
2519
|
+
sessionStore: params.sessionStore,
|
|
2520
|
+
sessionKey: params.sessionKey,
|
|
2521
|
+
storePath: params.storePath,
|
|
2522
|
+
isNewSession: params.isNewSession
|
|
2523
|
+
}),
|
|
2524
|
+
authProfileIdSource: params.sessionEntry?.authProfileOverrideSource
|
|
2525
|
+
};
|
|
2526
|
+
}
|
|
2527
|
+
async function runBtwSideQuestion(params) {
|
|
2528
|
+
const sessionId = params.sessionEntry.sessionId?.trim();
|
|
2529
|
+
if (!sessionId) throw new Error("No active session context.");
|
|
2530
|
+
const sessionFile = resolveSessionTranscriptPath({
|
|
2531
|
+
sessionId,
|
|
2532
|
+
sessionEntry: params.sessionEntry,
|
|
2533
|
+
sessionKey: params.sessionKey,
|
|
2534
|
+
storePath: params.storePath
|
|
2535
|
+
});
|
|
2536
|
+
if (!sessionFile) throw new Error("No active session transcript.");
|
|
2537
|
+
const sessionManager = SessionManager.open(sessionFile);
|
|
2538
|
+
const activeRunSnapshot = getActiveEmbeddedRunSnapshot(sessionId);
|
|
2539
|
+
let messages = [];
|
|
2540
|
+
let inFlightPrompt;
|
|
2541
|
+
if (Array.isArray(activeRunSnapshot?.messages) && activeRunSnapshot.messages.length > 0) {
|
|
2542
|
+
messages = toSimpleContextMessages(activeRunSnapshot.messages);
|
|
2543
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
2544
|
+
} else if (activeRunSnapshot) {
|
|
2545
|
+
inFlightPrompt = activeRunSnapshot.inFlightPrompt;
|
|
2546
|
+
if (activeRunSnapshot.transcriptLeafId && sessionManager.branch) try {
|
|
2547
|
+
sessionManager.branch(activeRunSnapshot.transcriptLeafId);
|
|
2548
|
+
} catch (error) {
|
|
2549
|
+
diag.debug(`btw snapshot leaf unavailable: sessionId=${sessionId} leaf=${activeRunSnapshot.transcriptLeafId} err=${String(error)}`);
|
|
2550
|
+
sessionManager.resetLeaf?.();
|
|
2551
|
+
}
|
|
2552
|
+
else sessionManager.resetLeaf?.();
|
|
2553
|
+
} else {
|
|
2554
|
+
const leafEntry = sessionManager.getLeafEntry?.();
|
|
2555
|
+
if (leafEntry?.type === "message" && leafEntry.message?.role === "user") if (leafEntry.parentId && sessionManager.branch) sessionManager.branch(leafEntry.parentId);
|
|
2556
|
+
else sessionManager.resetLeaf?.();
|
|
2557
|
+
}
|
|
2558
|
+
if (messages.length === 0) {
|
|
2559
|
+
const sessionContext = sessionManager.buildSessionContext();
|
|
2560
|
+
messages = toSimpleContextMessages(Array.isArray(sessionContext.messages) ? sessionContext.messages : []);
|
|
2561
|
+
}
|
|
2562
|
+
if (messages.length === 0 && !inFlightPrompt?.trim()) throw new Error("No active session context.");
|
|
2563
|
+
const { model, authProfileId } = await resolveRuntimeModel({
|
|
2564
|
+
cfg: params.cfg,
|
|
2565
|
+
provider: params.provider,
|
|
2566
|
+
model: params.model,
|
|
2567
|
+
agentDir: params.agentDir,
|
|
2568
|
+
sessionEntry: params.sessionEntry,
|
|
2569
|
+
sessionStore: params.sessionStore,
|
|
2570
|
+
sessionKey: params.sessionKey,
|
|
2571
|
+
storePath: params.storePath,
|
|
2572
|
+
isNewSession: params.isNewSession
|
|
2573
|
+
});
|
|
2574
|
+
const apiKey = requireApiKey(await getApiKeyForModel({
|
|
2575
|
+
model,
|
|
2576
|
+
cfg: params.cfg,
|
|
2577
|
+
profileId: authProfileId,
|
|
2578
|
+
agentDir: params.agentDir
|
|
2579
|
+
}), model.provider);
|
|
2580
|
+
const chunker = params.opts?.onBlockReply && params.blockReplyChunking ? new EmbeddedBlockChunker(params.blockReplyChunking) : void 0;
|
|
2581
|
+
let emittedBlocks = 0;
|
|
2582
|
+
let blockEmitChain = Promise.resolve();
|
|
2583
|
+
let answerText = "";
|
|
2584
|
+
let reasoningText = "";
|
|
2585
|
+
let assistantStarted = false;
|
|
2586
|
+
let sawTextEvent = false;
|
|
2587
|
+
const emitBlockChunk = async (text) => {
|
|
2588
|
+
if (!text.trim() || !params.opts?.onBlockReply) return;
|
|
2589
|
+
emittedBlocks += 1;
|
|
2590
|
+
blockEmitChain = blockEmitChain.then(async () => {
|
|
2591
|
+
await params.opts?.onBlockReply?.({
|
|
2592
|
+
text,
|
|
2593
|
+
btw: { question: params.question }
|
|
2594
|
+
});
|
|
2595
|
+
});
|
|
2596
|
+
await blockEmitChain;
|
|
2597
|
+
};
|
|
2598
|
+
const stream = streamSimple(model, {
|
|
2599
|
+
systemPrompt: buildBtwSystemPrompt(),
|
|
2600
|
+
messages: [...messages, {
|
|
2601
|
+
role: "user",
|
|
2602
|
+
content: [{
|
|
2603
|
+
type: "text",
|
|
2604
|
+
text: buildBtwQuestionPrompt(params.question, inFlightPrompt)
|
|
2605
|
+
}],
|
|
2606
|
+
timestamp: Date.now()
|
|
2607
|
+
}]
|
|
2608
|
+
}, {
|
|
2609
|
+
apiKey,
|
|
2610
|
+
reasoning: resolveSimpleThinkingLevel(params.resolvedThinkLevel),
|
|
2611
|
+
signal: params.opts?.abortSignal
|
|
2612
|
+
});
|
|
2613
|
+
let finalEvent;
|
|
2614
|
+
for await (const event of stream) {
|
|
2615
|
+
finalEvent = event.type === "done" || event.type === "error" ? event : finalEvent;
|
|
2616
|
+
if (!assistantStarted && (event.type === "text_start" || event.type === "start")) {
|
|
2617
|
+
assistantStarted = true;
|
|
2618
|
+
await params.opts?.onAssistantMessageStart?.();
|
|
2619
|
+
}
|
|
2620
|
+
if (event.type === "text_delta") {
|
|
2621
|
+
sawTextEvent = true;
|
|
2622
|
+
answerText += event.delta;
|
|
2623
|
+
chunker?.append(event.delta);
|
|
2624
|
+
if (chunker && params.resolvedBlockStreamingBreak === "text_end") chunker.drain({
|
|
2625
|
+
force: false,
|
|
2626
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
2627
|
+
});
|
|
2628
|
+
continue;
|
|
2629
|
+
}
|
|
2630
|
+
if (event.type === "text_end" && chunker && params.resolvedBlockStreamingBreak === "text_end") {
|
|
2631
|
+
chunker.drain({
|
|
2632
|
+
force: true,
|
|
2633
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
2634
|
+
});
|
|
2635
|
+
continue;
|
|
2636
|
+
}
|
|
2637
|
+
if (event.type === "thinking_delta") {
|
|
2638
|
+
reasoningText += event.delta;
|
|
2639
|
+
if (params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningStream?.({
|
|
2640
|
+
text: reasoningText,
|
|
2641
|
+
isReasoning: true
|
|
2642
|
+
});
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
if (event.type === "thinking_end" && params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningEnd?.();
|
|
2646
|
+
}
|
|
2647
|
+
if (chunker && params.resolvedBlockStreamingBreak !== "text_end" && chunker.hasBuffered()) chunker.drain({
|
|
2648
|
+
force: true,
|
|
2649
|
+
emit: (chunk) => void emitBlockChunk(chunk)
|
|
2650
|
+
});
|
|
2651
|
+
await blockEmitChain;
|
|
2652
|
+
if (finalEvent?.type === "error") {
|
|
2653
|
+
const message = collectTextContent(finalEvent.error.content);
|
|
2654
|
+
throw new Error(message || finalEvent.error.errorMessage || "BTW failed.");
|
|
2655
|
+
}
|
|
2656
|
+
const finalMessage = finalEvent?.type === "done" ? finalEvent.message : void 0;
|
|
2657
|
+
if (finalMessage) {
|
|
2658
|
+
if (!sawTextEvent) answerText = collectTextContent(finalMessage.content);
|
|
2659
|
+
if (!reasoningText) reasoningText = collectThinkingContent(finalMessage.content);
|
|
2660
|
+
}
|
|
2661
|
+
const answer = answerText.trim();
|
|
2662
|
+
if (!answer) throw new Error("No BTW response generated.");
|
|
2663
|
+
if (emittedBlocks > 0) return;
|
|
2664
|
+
return { text: answer };
|
|
2665
|
+
}
|
|
2666
|
+
//#endregion
|
|
2667
|
+
//#region src/auto-reply/reply/commands-btw.ts
|
|
2668
|
+
const BTW_USAGE = "Usage: /btw <side question>";
|
|
2669
|
+
const handleBtwCommand = async (params, allowTextCommands) => {
|
|
2670
|
+
if (!allowTextCommands) return null;
|
|
2671
|
+
const question = extractBtwQuestion(params.command.commandBodyNormalized);
|
|
2672
|
+
if (question === null) return null;
|
|
2673
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/btw");
|
|
2674
|
+
if (unauthorized) return unauthorized;
|
|
2675
|
+
if (!question) return {
|
|
2676
|
+
shouldContinue: false,
|
|
2677
|
+
reply: { text: BTW_USAGE }
|
|
2678
|
+
};
|
|
2679
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
2680
|
+
shouldContinue: false,
|
|
2681
|
+
reply: { text: "⚠️ /btw requires an active session with existing context." }
|
|
2682
|
+
};
|
|
2683
|
+
if (!params.agentDir) return {
|
|
2684
|
+
shouldContinue: false,
|
|
2685
|
+
reply: { text: "⚠️ /btw is unavailable because the active agent directory could not be resolved." }
|
|
2686
|
+
};
|
|
2687
|
+
try {
|
|
2688
|
+
await params.typing?.startTypingLoop();
|
|
2689
|
+
const reply = await runBtwSideQuestion({
|
|
2690
|
+
cfg: params.cfg,
|
|
2691
|
+
agentDir: params.agentDir,
|
|
2692
|
+
provider: params.provider,
|
|
2693
|
+
model: params.model,
|
|
2694
|
+
question,
|
|
2695
|
+
sessionEntry: params.sessionEntry,
|
|
2696
|
+
sessionStore: params.sessionStore,
|
|
2697
|
+
sessionKey: params.sessionKey,
|
|
2698
|
+
storePath: params.storePath,
|
|
2699
|
+
resolvedThinkLevel: "off",
|
|
2700
|
+
resolvedReasoningLevel: "off",
|
|
2701
|
+
blockReplyChunking: params.blockReplyChunking,
|
|
2702
|
+
resolvedBlockStreamingBreak: params.resolvedBlockStreamingBreak,
|
|
2703
|
+
opts: params.opts,
|
|
2704
|
+
isNewSession: false
|
|
2705
|
+
});
|
|
2706
|
+
return {
|
|
2707
|
+
shouldContinue: false,
|
|
2708
|
+
reply: reply ? {
|
|
2709
|
+
...reply,
|
|
2710
|
+
btw: { question }
|
|
2711
|
+
} : reply
|
|
2712
|
+
};
|
|
2713
|
+
} catch (error) {
|
|
2714
|
+
const message = error instanceof Error ? error.message.trim() : "";
|
|
2715
|
+
return {
|
|
2716
|
+
shouldContinue: false,
|
|
2717
|
+
reply: {
|
|
2718
|
+
text: `⚠️ /btw failed${message ? `: ${message}` : "."}`,
|
|
2719
|
+
btw: { question },
|
|
2720
|
+
isError: true
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
};
|
|
2725
|
+
//#endregion
|
|
2726
|
+
//#region src/auto-reply/reply/commands-compact.ts
|
|
2727
|
+
function extractCompactInstructions(params) {
|
|
2728
|
+
const raw = stripStructuralPrefixes(params.rawBody ?? "");
|
|
2729
|
+
const trimmed = (params.isGroup ? stripMentions(raw, params.ctx, params.cfg, params.agentId) : raw).trim();
|
|
2730
|
+
if (!trimmed) return;
|
|
2731
|
+
const prefix = trimmed.toLowerCase().startsWith("/compact") ? "/compact" : null;
|
|
2732
|
+
if (!prefix) return;
|
|
2733
|
+
let rest = trimmed.slice(prefix.length).trimStart();
|
|
2734
|
+
if (rest.startsWith(":")) rest = rest.slice(1).trimStart();
|
|
2735
|
+
return rest.length ? rest : void 0;
|
|
2736
|
+
}
|
|
2737
|
+
const handleCompactCommand = async (params) => {
|
|
2738
|
+
if (!(params.command.commandBodyNormalized === "/compact" || params.command.commandBodyNormalized.startsWith("/compact "))) return null;
|
|
2739
|
+
if (!params.command.isAuthorizedSender) {
|
|
2740
|
+
logVerbose(`Ignoring /compact from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
2741
|
+
return { shouldContinue: false };
|
|
2742
|
+
}
|
|
2743
|
+
if (!params.sessionEntry?.sessionId) return {
|
|
2744
|
+
shouldContinue: false,
|
|
2745
|
+
reply: { text: "⚙️ Compaction unavailable (missing session id)." }
|
|
2746
|
+
};
|
|
2747
|
+
const sessionId = params.sessionEntry.sessionId;
|
|
2748
|
+
if (isEmbeddedPiRunActive(sessionId)) {
|
|
2749
|
+
abortEmbeddedPiRun(sessionId);
|
|
2750
|
+
await waitForEmbeddedPiRunEnd(sessionId, 15e3);
|
|
2751
|
+
}
|
|
2752
|
+
const customInstructions = extractCompactInstructions({
|
|
2753
|
+
rawBody: params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body,
|
|
2754
|
+
ctx: params.ctx,
|
|
2755
|
+
cfg: params.cfg,
|
|
2756
|
+
agentId: params.agentId,
|
|
2757
|
+
isGroup: params.isGroup
|
|
2758
|
+
});
|
|
2759
|
+
const result = await compactEmbeddedPiSession({
|
|
2760
|
+
sessionId,
|
|
2761
|
+
sessionKey: params.sessionKey,
|
|
2762
|
+
allowGatewaySubagentBinding: true,
|
|
2763
|
+
messageChannel: params.command.channel,
|
|
2764
|
+
groupId: params.sessionEntry.groupId,
|
|
2765
|
+
groupChannel: params.sessionEntry.groupChannel,
|
|
2766
|
+
groupSpace: params.sessionEntry.space,
|
|
2767
|
+
spawnedBy: params.sessionEntry.spawnedBy,
|
|
2768
|
+
sessionFile: resolveSessionFilePath(sessionId, params.sessionEntry, resolveSessionFilePathOptions({
|
|
2769
|
+
agentId: params.agentId,
|
|
2770
|
+
storePath: params.storePath
|
|
2771
|
+
})),
|
|
2772
|
+
workspaceDir: params.workspaceDir,
|
|
2773
|
+
agentDir: params.agentDir,
|
|
2774
|
+
config: params.cfg,
|
|
2775
|
+
skillsSnapshot: params.sessionEntry.skillsSnapshot,
|
|
2776
|
+
provider: params.provider,
|
|
2777
|
+
model: params.model,
|
|
2778
|
+
thinkLevel: params.resolvedThinkLevel ?? await params.resolveDefaultThinkingLevel(),
|
|
2779
|
+
bashElevated: {
|
|
2780
|
+
enabled: false,
|
|
2781
|
+
allowed: false,
|
|
2782
|
+
defaultLevel: "off"
|
|
2783
|
+
},
|
|
2784
|
+
customInstructions,
|
|
2785
|
+
trigger: "manual",
|
|
2786
|
+
senderIsOwner: params.command.senderIsOwner,
|
|
2787
|
+
ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : void 0
|
|
2788
|
+
});
|
|
2789
|
+
const compactLabel = result.ok ? 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";
|
|
2790
|
+
if (result.ok && result.compacted) await incrementCompactionCount({
|
|
2791
|
+
sessionEntry: params.sessionEntry,
|
|
2792
|
+
sessionStore: params.sessionStore,
|
|
2793
|
+
sessionKey: params.sessionKey,
|
|
2794
|
+
storePath: params.storePath,
|
|
2795
|
+
tokensAfter: result.result?.tokensAfter
|
|
2796
|
+
});
|
|
2797
|
+
const totalTokens = result.result?.tokensAfter ?? resolveFreshSessionTotalTokens(params.sessionEntry);
|
|
2798
|
+
const contextSummary = formatContextUsageShort(typeof totalTokens === "number" && totalTokens > 0 ? totalTokens : null, params.contextTokens ?? params.sessionEntry.contextTokens ?? null);
|
|
2799
|
+
const reason = result.reason?.trim();
|
|
2800
|
+
const line = reason ? `${compactLabel}: ${reason} • ${contextSummary}` : `${compactLabel} • ${contextSummary}`;
|
|
2801
|
+
enqueueSystemEvent(line, { sessionKey: params.sessionKey });
|
|
2802
|
+
return {
|
|
2803
|
+
shouldContinue: false,
|
|
2804
|
+
reply: { text: `⚙️ ${line}` }
|
|
2805
|
+
};
|
|
2806
|
+
};
|
|
2807
|
+
//#endregion
|
|
2808
|
+
//#region src/auto-reply/reply/commands-slash-parse.ts
|
|
2809
|
+
function parseSlashCommandActionArgs(raw, slash) {
|
|
2810
|
+
const trimmed = raw.trim();
|
|
2811
|
+
const slashLower = slash.toLowerCase();
|
|
2812
|
+
if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" };
|
|
2813
|
+
const rest = trimmed.slice(slash.length).trim();
|
|
2814
|
+
if (!rest) return { kind: "empty" };
|
|
2815
|
+
const match = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
|
|
2816
|
+
if (!match) return { kind: "invalid" };
|
|
2817
|
+
return {
|
|
2818
|
+
kind: "parsed",
|
|
2819
|
+
action: match[1]?.toLowerCase() ?? "",
|
|
2820
|
+
args: (match[2] ?? "").trim()
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2823
|
+
function parseSlashCommandOrNull(raw, slash, opts) {
|
|
2824
|
+
const parsed = parseSlashCommandActionArgs(raw, slash);
|
|
2825
|
+
if (parsed.kind === "no-match") return null;
|
|
2826
|
+
if (parsed.kind === "invalid") return {
|
|
2827
|
+
ok: false,
|
|
2828
|
+
message: opts.invalidMessage
|
|
2829
|
+
};
|
|
2830
|
+
if (parsed.kind === "empty") return {
|
|
2831
|
+
ok: true,
|
|
2832
|
+
action: opts.defaultAction ?? "show",
|
|
2833
|
+
args: ""
|
|
2834
|
+
};
|
|
2835
|
+
return {
|
|
2836
|
+
ok: true,
|
|
2837
|
+
action: parsed.action,
|
|
2838
|
+
args: parsed.args
|
|
2839
|
+
};
|
|
2840
|
+
}
|
|
2841
|
+
//#endregion
|
|
2842
|
+
//#region src/auto-reply/reply/commands-setunset.ts
|
|
2843
|
+
function parseSetUnsetCommand(params) {
|
|
2844
|
+
const action = params.action;
|
|
2845
|
+
const args = params.args.trim();
|
|
2846
|
+
if (action === "unset") {
|
|
2847
|
+
if (!args) return {
|
|
2848
|
+
kind: "error",
|
|
2849
|
+
message: `Usage: ${params.slash} unset path`
|
|
2850
|
+
};
|
|
2851
|
+
return {
|
|
2852
|
+
kind: "unset",
|
|
2853
|
+
path: args
|
|
2854
|
+
};
|
|
2855
|
+
}
|
|
2856
|
+
if (!args) return {
|
|
2857
|
+
kind: "error",
|
|
2858
|
+
message: `Usage: ${params.slash} set path=value`
|
|
2859
|
+
};
|
|
2860
|
+
const eqIndex = args.indexOf("=");
|
|
2861
|
+
if (eqIndex <= 0) return {
|
|
2862
|
+
kind: "error",
|
|
2863
|
+
message: `Usage: ${params.slash} set path=value`
|
|
2864
|
+
};
|
|
2865
|
+
const path = args.slice(0, eqIndex).trim();
|
|
2866
|
+
const rawValue = args.slice(eqIndex + 1);
|
|
2867
|
+
if (!path) return {
|
|
2868
|
+
kind: "error",
|
|
2869
|
+
message: `Usage: ${params.slash} set path=value`
|
|
2870
|
+
};
|
|
2871
|
+
const parsed = parseConfigValue(rawValue);
|
|
2872
|
+
if (parsed.error) return {
|
|
2873
|
+
kind: "error",
|
|
2874
|
+
message: parsed.error
|
|
2875
|
+
};
|
|
2876
|
+
return {
|
|
2877
|
+
kind: "set",
|
|
2878
|
+
path,
|
|
2879
|
+
value: parsed.value
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
function parseSetUnsetCommandAction(params) {
|
|
2883
|
+
if (params.action !== "set" && params.action !== "unset") return null;
|
|
2884
|
+
const parsed = parseSetUnsetCommand({
|
|
2885
|
+
slash: params.slash,
|
|
2886
|
+
action: params.action,
|
|
2887
|
+
args: params.args
|
|
2888
|
+
});
|
|
2889
|
+
if (parsed.kind === "error") return params.onError(parsed.message);
|
|
2890
|
+
return parsed.kind === "set" ? params.onSet(parsed.path, parsed.value) : params.onUnset(parsed.path);
|
|
2891
|
+
}
|
|
2892
|
+
function parseSlashCommandWithSetUnset(params) {
|
|
2893
|
+
const parsed = parseSlashCommandOrNull(params.raw, params.slash, { invalidMessage: params.invalidMessage });
|
|
2894
|
+
if (!parsed) return null;
|
|
2895
|
+
if (!parsed.ok) return params.onError(parsed.message);
|
|
2896
|
+
const { action, args } = parsed;
|
|
2897
|
+
const setUnset = parseSetUnsetCommandAction({
|
|
2898
|
+
slash: params.slash,
|
|
2899
|
+
action,
|
|
2900
|
+
args,
|
|
2901
|
+
onSet: params.onSet,
|
|
2902
|
+
onUnset: params.onUnset,
|
|
2903
|
+
onError: params.onError
|
|
2904
|
+
});
|
|
2905
|
+
if (setUnset) return setUnset;
|
|
2906
|
+
const knownAction = params.onKnownAction(action, args);
|
|
2907
|
+
if (knownAction) return knownAction;
|
|
2908
|
+
return params.onError(params.usageMessage);
|
|
2909
|
+
}
|
|
2910
|
+
//#endregion
|
|
2911
|
+
//#region src/auto-reply/reply/commands-setunset-standard.ts
|
|
2912
|
+
function parseStandardSetUnsetSlashCommand(params) {
|
|
2913
|
+
return parseSlashCommandWithSetUnset({
|
|
2914
|
+
raw: params.raw,
|
|
2915
|
+
slash: params.slash,
|
|
2916
|
+
invalidMessage: params.invalidMessage,
|
|
2917
|
+
usageMessage: params.usageMessage,
|
|
2918
|
+
onKnownAction: params.onKnownAction,
|
|
2919
|
+
onSet: params.onSet ?? ((path, value) => ({
|
|
2920
|
+
action: "set",
|
|
2921
|
+
path,
|
|
2922
|
+
value
|
|
2923
|
+
})),
|
|
2924
|
+
onUnset: params.onUnset ?? ((path) => ({
|
|
2925
|
+
action: "unset",
|
|
2926
|
+
path
|
|
2927
|
+
})),
|
|
2928
|
+
onError: params.onError ?? ((message) => ({
|
|
2929
|
+
action: "error",
|
|
2930
|
+
message
|
|
2931
|
+
}))
|
|
2932
|
+
});
|
|
2933
|
+
}
|
|
2934
|
+
//#endregion
|
|
2935
|
+
//#region src/auto-reply/reply/config-commands.ts
|
|
2936
|
+
function parseConfigCommand(raw) {
|
|
2937
|
+
return parseStandardSetUnsetSlashCommand({
|
|
2938
|
+
raw,
|
|
2939
|
+
slash: "/config",
|
|
2940
|
+
invalidMessage: "Invalid /config syntax.",
|
|
2941
|
+
usageMessage: "Usage: /config show|set|unset",
|
|
2942
|
+
onKnownAction: (action, args) => {
|
|
2943
|
+
if (action === "show" || action === "get") return {
|
|
2944
|
+
action: "show",
|
|
2945
|
+
path: args || void 0
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
});
|
|
2949
|
+
}
|
|
2950
|
+
//#endregion
|
|
2951
|
+
//#region src/auto-reply/reply/debug-commands.ts
|
|
2952
|
+
function parseDebugCommand(raw) {
|
|
2953
|
+
return parseStandardSetUnsetSlashCommand({
|
|
2954
|
+
raw,
|
|
2955
|
+
slash: "/debug",
|
|
2956
|
+
invalidMessage: "Invalid /debug syntax.",
|
|
2957
|
+
usageMessage: "Usage: /debug show|set|unset|reset",
|
|
2958
|
+
onKnownAction: (action) => {
|
|
2959
|
+
if (action === "show") return { action: "show" };
|
|
2960
|
+
if (action === "reset") return { action: "reset" };
|
|
2961
|
+
}
|
|
2962
|
+
});
|
|
2963
|
+
}
|
|
2964
|
+
//#endregion
|
|
2965
|
+
//#region src/auto-reply/reply/commands-config.ts
|
|
2966
|
+
const handleConfigCommand = async (params, allowTextCommands) => {
|
|
2967
|
+
if (!allowTextCommands) return null;
|
|
2968
|
+
const configCommand = parseConfigCommand(params.command.commandBodyNormalized);
|
|
2969
|
+
if (!configCommand) return null;
|
|
2970
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/config");
|
|
2971
|
+
if (unauthorized) return unauthorized;
|
|
2972
|
+
const nonOwner = configCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/config");
|
|
2973
|
+
if (nonOwner) return nonOwner;
|
|
2974
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
2975
|
+
label: "/config",
|
|
2976
|
+
configKey: "config"
|
|
2977
|
+
});
|
|
2978
|
+
if (disabled) return disabled;
|
|
2979
|
+
if (configCommand.action === "error") return {
|
|
2980
|
+
shouldContinue: false,
|
|
2981
|
+
reply: { text: `⚠️ ${configCommand.message}` }
|
|
2982
|
+
};
|
|
2983
|
+
let parsedWritePath;
|
|
2984
|
+
if (configCommand.action === "set" || configCommand.action === "unset") {
|
|
2985
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
2986
|
+
label: "/config write",
|
|
2987
|
+
allowedScopes: ["operator.admin"],
|
|
2988
|
+
missingText: "❌ /config set|unset requires operator.admin for gateway clients."
|
|
2989
|
+
});
|
|
2990
|
+
if (missingAdminScope) return missingAdminScope;
|
|
2991
|
+
const parsedPath = parseConfigPath(configCommand.path);
|
|
2992
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
2993
|
+
shouldContinue: false,
|
|
2994
|
+
reply: { text: `⚠️ ${parsedPath.error ?? "Invalid path."}` }
|
|
2995
|
+
};
|
|
2996
|
+
parsedWritePath = parsedPath.path;
|
|
2997
|
+
const channelId = params.command.channelId ?? normalizeChannelId(params.command.channel);
|
|
2998
|
+
const deniedText = resolveConfigWriteDeniedText({
|
|
2999
|
+
cfg: params.cfg,
|
|
3000
|
+
channel: params.command.channel,
|
|
3001
|
+
channelId,
|
|
3002
|
+
accountId: params.ctx.AccountId,
|
|
3003
|
+
gatewayClientScopes: params.ctx.GatewayClientScopes,
|
|
3004
|
+
target: resolveConfigWriteTargetFromPath(parsedWritePath)
|
|
3005
|
+
});
|
|
3006
|
+
if (deniedText) return {
|
|
3007
|
+
shouldContinue: false,
|
|
3008
|
+
reply: { text: deniedText }
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
const snapshot = await readConfigFileSnapshot();
|
|
3012
|
+
if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
|
|
3013
|
+
shouldContinue: false,
|
|
3014
|
+
reply: { text: "⚠️ Config file is invalid; fix it before using /config." }
|
|
3015
|
+
};
|
|
3016
|
+
const parsedBase = structuredClone(snapshot.parsed);
|
|
3017
|
+
if (configCommand.action === "show") {
|
|
3018
|
+
const pathRaw = configCommand.path?.trim();
|
|
3019
|
+
if (pathRaw) {
|
|
3020
|
+
const parsedPath = parseConfigPath(pathRaw);
|
|
3021
|
+
if (!parsedPath.ok || !parsedPath.path) return {
|
|
3022
|
+
shouldContinue: false,
|
|
3023
|
+
reply: { text: `⚠️ ${parsedPath.error ?? "Invalid path."}` }
|
|
3024
|
+
};
|
|
3025
|
+
const value = getConfigValueAtPath(parsedBase, parsedPath.path);
|
|
3026
|
+
return {
|
|
3027
|
+
shouldContinue: false,
|
|
3028
|
+
reply: { text: `⚙️ Config ${pathRaw}:\n\`\`\`json\n${JSON.stringify(value ?? null, null, 2)}\n\`\`\`` }
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
return {
|
|
3032
|
+
shouldContinue: false,
|
|
3033
|
+
reply: { text: `⚙️ Config (raw):\n\`\`\`json\n${JSON.stringify(parsedBase, null, 2)}\n\`\`\`` }
|
|
3034
|
+
};
|
|
3035
|
+
}
|
|
3036
|
+
if (configCommand.action === "unset") {
|
|
3037
|
+
if (!unsetConfigValueAtPath(parsedBase, parsedWritePath ?? [])) return {
|
|
3038
|
+
shouldContinue: false,
|
|
3039
|
+
reply: { text: `⚙️ No config value found for ${configCommand.path}.` }
|
|
3040
|
+
};
|
|
3041
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
3042
|
+
if (!validated.ok) {
|
|
3043
|
+
const issue = validated.issues[0];
|
|
3044
|
+
return {
|
|
3045
|
+
shouldContinue: false,
|
|
3046
|
+
reply: { text: `⚠️ Config invalid after unset (${issue.path}: ${issue.message}).` }
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
await writeConfigFile(validated.config);
|
|
3050
|
+
return {
|
|
3051
|
+
shouldContinue: false,
|
|
3052
|
+
reply: { text: `⚙️ Config updated: ${configCommand.path} removed.` }
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
if (configCommand.action === "set") {
|
|
3056
|
+
setConfigValueAtPath(parsedBase, parsedWritePath ?? [], configCommand.value);
|
|
3057
|
+
const validated = validateConfigObjectWithPlugins(parsedBase);
|
|
3058
|
+
if (!validated.ok) {
|
|
3059
|
+
const issue = validated.issues[0];
|
|
3060
|
+
return {
|
|
3061
|
+
shouldContinue: false,
|
|
3062
|
+
reply: { text: `⚠️ Config invalid after set (${issue.path}: ${issue.message}).` }
|
|
3063
|
+
};
|
|
3064
|
+
}
|
|
3065
|
+
await writeConfigFile(validated.config);
|
|
3066
|
+
const valueLabel = typeof configCommand.value === "string" ? `"${configCommand.value}"` : JSON.stringify(configCommand.value);
|
|
3067
|
+
return {
|
|
3068
|
+
shouldContinue: false,
|
|
3069
|
+
reply: { text: `⚙️ Config updated: ${configCommand.path}=${valueLabel ?? "null"}` }
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
return null;
|
|
3073
|
+
};
|
|
3074
|
+
const handleDebugCommand = async (params, allowTextCommands) => {
|
|
3075
|
+
if (!allowTextCommands) return null;
|
|
3076
|
+
const debugCommand = parseDebugCommand(params.command.commandBodyNormalized);
|
|
3077
|
+
if (!debugCommand) return null;
|
|
3078
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/debug");
|
|
3079
|
+
if (unauthorized) return unauthorized;
|
|
3080
|
+
const nonOwner = rejectNonOwnerCommand(params, "/debug");
|
|
3081
|
+
if (nonOwner) return nonOwner;
|
|
3082
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
3083
|
+
label: "/debug",
|
|
3084
|
+
configKey: "debug"
|
|
3085
|
+
});
|
|
3086
|
+
if (disabled) return disabled;
|
|
3087
|
+
if (debugCommand.action === "error") return {
|
|
3088
|
+
shouldContinue: false,
|
|
3089
|
+
reply: { text: `⚠️ ${debugCommand.message}` }
|
|
3090
|
+
};
|
|
3091
|
+
if (debugCommand.action === "show") {
|
|
3092
|
+
const overrides = getConfigOverrides();
|
|
3093
|
+
if (!(Object.keys(overrides).length > 0)) return {
|
|
3094
|
+
shouldContinue: false,
|
|
3095
|
+
reply: { text: "⚙️ Debug overrides: (none)" }
|
|
3096
|
+
};
|
|
3097
|
+
return {
|
|
3098
|
+
shouldContinue: false,
|
|
3099
|
+
reply: { text: `⚙️ Debug overrides (memory-only):\n\`\`\`json\n${JSON.stringify(overrides, null, 2)}\n\`\`\`` }
|
|
3100
|
+
};
|
|
3101
|
+
}
|
|
3102
|
+
if (debugCommand.action === "reset") {
|
|
3103
|
+
resetConfigOverrides();
|
|
3104
|
+
return {
|
|
3105
|
+
shouldContinue: false,
|
|
3106
|
+
reply: { text: "⚙️ Debug overrides cleared; using config on disk." }
|
|
3107
|
+
};
|
|
3108
|
+
}
|
|
3109
|
+
if (debugCommand.action === "unset") {
|
|
3110
|
+
const result = unsetConfigOverride(debugCommand.path);
|
|
3111
|
+
if (!result.ok) return {
|
|
3112
|
+
shouldContinue: false,
|
|
3113
|
+
reply: { text: `⚠️ ${result.error ?? "Invalid path."}` }
|
|
3114
|
+
};
|
|
3115
|
+
if (!result.removed) return {
|
|
3116
|
+
shouldContinue: false,
|
|
3117
|
+
reply: { text: `⚙️ No debug override found for ${debugCommand.path}.` }
|
|
3118
|
+
};
|
|
3119
|
+
return {
|
|
3120
|
+
shouldContinue: false,
|
|
3121
|
+
reply: { text: `⚙️ Debug override removed for ${debugCommand.path}.` }
|
|
3122
|
+
};
|
|
3123
|
+
}
|
|
3124
|
+
if (debugCommand.action === "set") {
|
|
3125
|
+
const result = setConfigOverride(debugCommand.path, debugCommand.value);
|
|
3126
|
+
if (!result.ok) return {
|
|
3127
|
+
shouldContinue: false,
|
|
3128
|
+
reply: { text: `⚠️ ${result.error ?? "Invalid override."}` }
|
|
3129
|
+
};
|
|
3130
|
+
const valueLabel = typeof debugCommand.value === "string" ? `"${debugCommand.value}"` : JSON.stringify(debugCommand.value);
|
|
3131
|
+
return {
|
|
3132
|
+
shouldContinue: false,
|
|
3133
|
+
reply: { text: `⚙️ Debug override set: ${debugCommand.path}=${valueLabel ?? "null"}` }
|
|
3134
|
+
};
|
|
3135
|
+
}
|
|
3136
|
+
return null;
|
|
3137
|
+
};
|
|
3138
|
+
//#endregion
|
|
3139
|
+
//#region src/auto-reply/reply/mcp-commands.ts
|
|
3140
|
+
function parseMcpCommand(raw) {
|
|
3141
|
+
return parseStandardSetUnsetSlashCommand({
|
|
3142
|
+
raw,
|
|
3143
|
+
slash: "/mcp",
|
|
3144
|
+
invalidMessage: "Invalid /mcp syntax.",
|
|
3145
|
+
usageMessage: "Usage: /mcp show|set|unset",
|
|
3146
|
+
onKnownAction: (action, args) => {
|
|
3147
|
+
if (action === "show" || action === "get") return {
|
|
3148
|
+
action: "show",
|
|
3149
|
+
name: args || void 0
|
|
3150
|
+
};
|
|
3151
|
+
},
|
|
3152
|
+
onSet: (name, value) => ({
|
|
3153
|
+
action: "set",
|
|
3154
|
+
name,
|
|
3155
|
+
value
|
|
3156
|
+
}),
|
|
3157
|
+
onUnset: (name) => ({
|
|
3158
|
+
action: "unset",
|
|
3159
|
+
name
|
|
3160
|
+
})
|
|
3161
|
+
});
|
|
3162
|
+
}
|
|
3163
|
+
//#endregion
|
|
3164
|
+
//#region src/auto-reply/reply/commands-mcp.ts
|
|
3165
|
+
function renderJsonBlock$1(label, value) {
|
|
3166
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
3167
|
+
}
|
|
3168
|
+
const handleMcpCommand = async (params, allowTextCommands) => {
|
|
3169
|
+
if (!allowTextCommands) return null;
|
|
3170
|
+
const mcpCommand = parseMcpCommand(params.command.commandBodyNormalized);
|
|
3171
|
+
if (!mcpCommand) return null;
|
|
3172
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/mcp");
|
|
3173
|
+
if (unauthorized) return unauthorized;
|
|
3174
|
+
const nonOwner = mcpCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/mcp");
|
|
3175
|
+
if (nonOwner) return nonOwner;
|
|
3176
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
3177
|
+
label: "/mcp",
|
|
3178
|
+
configKey: "mcp"
|
|
3179
|
+
});
|
|
3180
|
+
if (disabled) return disabled;
|
|
3181
|
+
if (mcpCommand.action === "error") return {
|
|
3182
|
+
shouldContinue: false,
|
|
3183
|
+
reply: { text: `⚠️ ${mcpCommand.message}` }
|
|
3184
|
+
};
|
|
3185
|
+
if (mcpCommand.action === "show") {
|
|
3186
|
+
const loaded = await listConfiguredMcpServers();
|
|
3187
|
+
if (!loaded.ok) return {
|
|
3188
|
+
shouldContinue: false,
|
|
3189
|
+
reply: { text: `⚠️ ${loaded.error}` }
|
|
3190
|
+
};
|
|
3191
|
+
if (mcpCommand.name) {
|
|
3192
|
+
const server = loaded.mcpServers[mcpCommand.name];
|
|
3193
|
+
if (!server) return {
|
|
3194
|
+
shouldContinue: false,
|
|
3195
|
+
reply: { text: `🔌 No MCP server named "${mcpCommand.name}" in ${loaded.path}.` }
|
|
3196
|
+
};
|
|
3197
|
+
return {
|
|
3198
|
+
shouldContinue: false,
|
|
3199
|
+
reply: { text: renderJsonBlock$1(`🔌 MCP server "${mcpCommand.name}" (${loaded.path})`, server) }
|
|
3200
|
+
};
|
|
3201
|
+
}
|
|
3202
|
+
if (Object.keys(loaded.mcpServers).length === 0) return {
|
|
3203
|
+
shouldContinue: false,
|
|
3204
|
+
reply: { text: `🔌 No MCP servers configured in ${loaded.path}.` }
|
|
3205
|
+
};
|
|
3206
|
+
return {
|
|
3207
|
+
shouldContinue: false,
|
|
3208
|
+
reply: { text: renderJsonBlock$1(`🔌 MCP servers (${loaded.path})`, loaded.mcpServers) }
|
|
3209
|
+
};
|
|
3210
|
+
}
|
|
3211
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
3212
|
+
label: "/mcp write",
|
|
3213
|
+
allowedScopes: ["operator.admin"],
|
|
3214
|
+
missingText: "❌ /mcp set|unset requires operator.admin for gateway clients."
|
|
3215
|
+
});
|
|
3216
|
+
if (missingAdminScope) return missingAdminScope;
|
|
3217
|
+
if (mcpCommand.action === "set") {
|
|
3218
|
+
const result = await setConfiguredMcpServer({
|
|
3219
|
+
name: mcpCommand.name,
|
|
3220
|
+
server: mcpCommand.value
|
|
3221
|
+
});
|
|
3222
|
+
if (!result.ok) return {
|
|
3223
|
+
shouldContinue: false,
|
|
3224
|
+
reply: { text: `⚠️ ${result.error}` }
|
|
3225
|
+
};
|
|
3226
|
+
return {
|
|
3227
|
+
shouldContinue: false,
|
|
3228
|
+
reply: { text: `🔌 MCP server "${mcpCommand.name}" saved to ${result.path}.` }
|
|
3229
|
+
};
|
|
3230
|
+
}
|
|
3231
|
+
const result = await unsetConfiguredMcpServer({ name: mcpCommand.name });
|
|
3232
|
+
if (!result.ok) return {
|
|
3233
|
+
shouldContinue: false,
|
|
3234
|
+
reply: { text: `⚠️ ${result.error}` }
|
|
3235
|
+
};
|
|
3236
|
+
if (!result.removed) return {
|
|
3237
|
+
shouldContinue: false,
|
|
3238
|
+
reply: { text: `🔌 No MCP server named "${mcpCommand.name}" in ${result.path}.` }
|
|
3239
|
+
};
|
|
3240
|
+
return {
|
|
3241
|
+
shouldContinue: false,
|
|
3242
|
+
reply: { text: `🔌 MCP server "${mcpCommand.name}" removed from ${result.path}.` }
|
|
3243
|
+
};
|
|
3244
|
+
};
|
|
3245
|
+
//#endregion
|
|
3246
|
+
//#region src/auto-reply/reply/commands-plugin.ts
|
|
3247
|
+
/**
|
|
3248
|
+
* Plugin Command Handler
|
|
3249
|
+
*
|
|
3250
|
+
* Handles commands registered by plugins, bypassing the LLM agent.
|
|
3251
|
+
* This handler is called before built-in command handlers.
|
|
3252
|
+
*/
|
|
3253
|
+
/**
|
|
3254
|
+
* Handle plugin-registered commands.
|
|
3255
|
+
* Returns a result if a plugin command was matched and executed,
|
|
3256
|
+
* or null to continue to the next handler.
|
|
3257
|
+
*/
|
|
3258
|
+
const handlePluginCommand = async (params, allowTextCommands) => {
|
|
3259
|
+
const { command, cfg } = params;
|
|
3260
|
+
if (!allowTextCommands) return null;
|
|
3261
|
+
const match = matchPluginCommand(command.commandBodyNormalized);
|
|
3262
|
+
if (!match) return null;
|
|
3263
|
+
return {
|
|
3264
|
+
shouldContinue: false,
|
|
3265
|
+
reply: await executePluginCommand({
|
|
3266
|
+
command: match.command,
|
|
3267
|
+
args: match.args,
|
|
3268
|
+
senderId: command.senderId,
|
|
3269
|
+
channel: command.channel,
|
|
3270
|
+
channelId: command.channelId,
|
|
3271
|
+
isAuthorizedSender: command.isAuthorizedSender,
|
|
3272
|
+
commandBody: command.commandBodyNormalized,
|
|
3273
|
+
config: cfg,
|
|
3274
|
+
from: command.from,
|
|
3275
|
+
to: command.to,
|
|
3276
|
+
accountId: params.ctx.AccountId ?? void 0,
|
|
3277
|
+
messageThreadId: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? params.ctx.MessageThreadId : void 0
|
|
3278
|
+
})
|
|
3279
|
+
};
|
|
3280
|
+
};
|
|
3281
|
+
//#endregion
|
|
3282
|
+
//#region src/auto-reply/reply/plugins-commands.ts
|
|
3283
|
+
function parsePluginsCommand(raw) {
|
|
3284
|
+
const match = raw.match(/^\/plugins?(?:\s+(.*))?$/i);
|
|
3285
|
+
if (!match) return null;
|
|
3286
|
+
const tail = match[1]?.trim() ?? "";
|
|
3287
|
+
if (!tail) return { action: "list" };
|
|
3288
|
+
const [rawAction, ...rest] = tail.split(/\s+/);
|
|
3289
|
+
const action = rawAction?.trim().toLowerCase();
|
|
3290
|
+
const name = rest.join(" ").trim();
|
|
3291
|
+
if (action === "list") return name ? {
|
|
3292
|
+
action: "error",
|
|
3293
|
+
message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
|
|
3294
|
+
} : { action: "list" };
|
|
3295
|
+
if (action === "inspect" || action === "show" || action === "get") return {
|
|
3296
|
+
action: "inspect",
|
|
3297
|
+
name: name || void 0
|
|
3298
|
+
};
|
|
3299
|
+
if (action === "enable" || action === "disable") {
|
|
3300
|
+
if (!name) return {
|
|
3301
|
+
action: "error",
|
|
3302
|
+
message: `Usage: /plugins ${action} <plugin-id-or-name>`
|
|
3303
|
+
};
|
|
3304
|
+
return {
|
|
3305
|
+
action,
|
|
3306
|
+
name
|
|
3307
|
+
};
|
|
3308
|
+
}
|
|
3309
|
+
return {
|
|
3310
|
+
action: "error",
|
|
3311
|
+
message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
//#endregion
|
|
3315
|
+
//#region src/auto-reply/reply/commands-plugins.ts
|
|
3316
|
+
function renderJsonBlock(label, value) {
|
|
3317
|
+
return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
|
|
3318
|
+
}
|
|
3319
|
+
function buildPluginInspectJson(params) {
|
|
3320
|
+
const inspect = buildPluginInspectReport({
|
|
3321
|
+
id: params.id,
|
|
3322
|
+
config: params.config,
|
|
3323
|
+
report: params.report
|
|
3324
|
+
});
|
|
3325
|
+
if (!inspect) return null;
|
|
3326
|
+
return {
|
|
3327
|
+
inspect,
|
|
3328
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
3329
|
+
code: warning.code,
|
|
3330
|
+
severity: warning.severity,
|
|
3331
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
3332
|
+
})),
|
|
3333
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
3334
|
+
};
|
|
3335
|
+
}
|
|
3336
|
+
function buildAllPluginInspectJson(params) {
|
|
3337
|
+
return buildAllPluginInspectReports({
|
|
3338
|
+
config: params.config,
|
|
3339
|
+
report: params.report
|
|
3340
|
+
}).map((inspect) => ({
|
|
3341
|
+
inspect,
|
|
3342
|
+
compatibilityWarnings: inspect.compatibility.map((warning) => ({
|
|
3343
|
+
code: warning.code,
|
|
3344
|
+
severity: warning.severity,
|
|
3345
|
+
message: formatPluginCompatibilityNotice(warning)
|
|
3346
|
+
})),
|
|
3347
|
+
install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
|
|
3348
|
+
}));
|
|
3349
|
+
}
|
|
3350
|
+
function formatPluginLabel(plugin) {
|
|
3351
|
+
if (!plugin.name || plugin.name === plugin.id) return plugin.id;
|
|
3352
|
+
return `${plugin.name} (${plugin.id})`;
|
|
3353
|
+
}
|
|
3354
|
+
function formatPluginsList(report) {
|
|
3355
|
+
if (report.plugins.length === 0) return `🔌 No plugins found for workspace ${report.workspaceDir ?? "(unknown workspace)"}.`;
|
|
3356
|
+
return [`🔌 Plugins (${report.plugins.filter((plugin) => plugin.status === "loaded").length}/${report.plugins.length} loaded)`, ...report.plugins.map((plugin) => {
|
|
3357
|
+
const format = plugin.bundleFormat ? `${plugin.format ?? "openclaw"}/${plugin.bundleFormat}` : plugin.format ?? "openclaw";
|
|
3358
|
+
return `- ${formatPluginLabel(plugin)} [${plugin.status}] ${format}`;
|
|
3359
|
+
})].join("\n");
|
|
3360
|
+
}
|
|
3361
|
+
function findPlugin(report, rawName) {
|
|
3362
|
+
const target = rawName.trim().toLowerCase();
|
|
3363
|
+
if (!target) return;
|
|
3364
|
+
return report.plugins.find((plugin) => plugin.id.toLowerCase() === target || plugin.name.toLowerCase() === target);
|
|
3365
|
+
}
|
|
3366
|
+
async function loadPluginCommandState(workspaceDir) {
|
|
3367
|
+
const snapshot = await readConfigFileSnapshot();
|
|
3368
|
+
if (!snapshot.valid) return {
|
|
3369
|
+
ok: false,
|
|
3370
|
+
path: snapshot.path,
|
|
3371
|
+
error: "Config file is invalid; fix it before using /plugins."
|
|
3372
|
+
};
|
|
3373
|
+
const config = structuredClone(snapshot.resolved);
|
|
3374
|
+
return {
|
|
3375
|
+
ok: true,
|
|
3376
|
+
path: snapshot.path,
|
|
3377
|
+
config,
|
|
3378
|
+
report: buildPluginStatusReport({
|
|
3379
|
+
config,
|
|
3380
|
+
workspaceDir
|
|
3381
|
+
})
|
|
3382
|
+
};
|
|
3383
|
+
}
|
|
3384
|
+
const handlePluginsCommand = async (params, allowTextCommands) => {
|
|
3385
|
+
if (!allowTextCommands) return null;
|
|
3386
|
+
const pluginsCommand = parsePluginsCommand(params.command.commandBodyNormalized);
|
|
3387
|
+
if (!pluginsCommand) return null;
|
|
3388
|
+
const unauthorized = rejectUnauthorizedCommand(params, "/plugins");
|
|
3389
|
+
if (unauthorized) return unauthorized;
|
|
3390
|
+
const nonOwner = (pluginsCommand.action === "list" || pluginsCommand.action === "inspect") && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/plugins");
|
|
3391
|
+
if (nonOwner) return nonOwner;
|
|
3392
|
+
const disabled = requireCommandFlagEnabled(params.cfg, {
|
|
3393
|
+
label: "/plugins",
|
|
3394
|
+
configKey: "plugins"
|
|
3395
|
+
});
|
|
3396
|
+
if (disabled) return disabled;
|
|
3397
|
+
if (pluginsCommand.action === "error") return {
|
|
3398
|
+
shouldContinue: false,
|
|
3399
|
+
reply: { text: `⚠️ ${pluginsCommand.message}` }
|
|
3400
|
+
};
|
|
3401
|
+
const loaded = await loadPluginCommandState(params.workspaceDir);
|
|
3402
|
+
if (!loaded.ok) return {
|
|
3403
|
+
shouldContinue: false,
|
|
3404
|
+
reply: { text: `⚠️ ${loaded.error}` }
|
|
3405
|
+
};
|
|
3406
|
+
if (pluginsCommand.action === "list") return {
|
|
3407
|
+
shouldContinue: false,
|
|
3408
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
3409
|
+
};
|
|
3410
|
+
if (pluginsCommand.action === "inspect") {
|
|
3411
|
+
if (!pluginsCommand.name) return {
|
|
3412
|
+
shouldContinue: false,
|
|
3413
|
+
reply: { text: formatPluginsList(loaded.report) }
|
|
3414
|
+
};
|
|
3415
|
+
if (pluginsCommand.name.toLowerCase() === "all") return {
|
|
3416
|
+
shouldContinue: false,
|
|
3417
|
+
reply: { text: renderJsonBlock("🔌 Plugins", buildAllPluginInspectJson(loaded)) }
|
|
3418
|
+
};
|
|
3419
|
+
const payload = buildPluginInspectJson({
|
|
3420
|
+
id: pluginsCommand.name,
|
|
3421
|
+
config: loaded.config,
|
|
3422
|
+
report: loaded.report
|
|
3423
|
+
});
|
|
3424
|
+
if (!payload) return {
|
|
3425
|
+
shouldContinue: false,
|
|
3426
|
+
reply: { text: `🔌 No plugin named "${pluginsCommand.name}" found.` }
|
|
3427
|
+
};
|
|
3428
|
+
return {
|
|
3429
|
+
shouldContinue: false,
|
|
3430
|
+
reply: { text: renderJsonBlock(`🔌 Plugin "${payload.inspect.plugin.id}"`, {
|
|
3431
|
+
...payload.inspect,
|
|
3432
|
+
install: payload.install
|
|
3433
|
+
}) }
|
|
3434
|
+
};
|
|
3435
|
+
}
|
|
3436
|
+
const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
|
|
3437
|
+
label: "/plugins write",
|
|
3438
|
+
allowedScopes: ["operator.admin"],
|
|
3439
|
+
missingText: "❌ /plugins enable|disable requires operator.admin for gateway clients."
|
|
3440
|
+
});
|
|
3441
|
+
if (missingAdminScope) return missingAdminScope;
|
|
3442
|
+
const plugin = findPlugin(loaded.report, pluginsCommand.name);
|
|
3443
|
+
if (!plugin) return {
|
|
3444
|
+
shouldContinue: false,
|
|
3445
|
+
reply: { text: `🔌 No plugin named "${pluginsCommand.name}" found.` }
|
|
3446
|
+
};
|
|
3447
|
+
const validated = validateConfigObjectWithPlugins(setPluginEnabledInConfig(structuredClone(loaded.config), plugin.id, pluginsCommand.action === "enable"));
|
|
3448
|
+
if (!validated.ok) {
|
|
3449
|
+
const issue = validated.issues[0];
|
|
3450
|
+
return {
|
|
3451
|
+
shouldContinue: false,
|
|
3452
|
+
reply: { text: `⚠️ Config invalid after /plugins ${pluginsCommand.action} (${issue.path}: ${issue.message}).` }
|
|
3453
|
+
};
|
|
3454
|
+
}
|
|
3455
|
+
await writeConfigFile(validated.config);
|
|
3456
|
+
return {
|
|
3457
|
+
shouldContinue: false,
|
|
3458
|
+
reply: { text: `🔌 Plugin "${plugin.id}" ${pluginsCommand.action}d in ${loaded.path}. Restart the gateway to apply.` }
|
|
3459
|
+
};
|
|
3460
|
+
};
|
|
3461
|
+
//#endregion
|
|
3462
|
+
//#region src/auto-reply/send-policy.ts
|
|
3463
|
+
function normalizeSendPolicyOverride(raw) {
|
|
3464
|
+
const value = raw?.trim().toLowerCase();
|
|
3465
|
+
if (!value) return;
|
|
3466
|
+
if (value === "allow" || value === "on") return "allow";
|
|
3467
|
+
if (value === "deny" || value === "off") return "deny";
|
|
3468
|
+
}
|
|
3469
|
+
function parseSendPolicyCommand(raw) {
|
|
3470
|
+
if (!raw) return { hasCommand: false };
|
|
3471
|
+
const trimmed = raw.trim();
|
|
3472
|
+
if (!trimmed) return { hasCommand: false };
|
|
3473
|
+
const match = normalizeCommandBody(trimmed).match(/^\/send(?:\s+([a-zA-Z]+))?\s*$/i);
|
|
3474
|
+
if (!match) return { hasCommand: false };
|
|
3475
|
+
const token = match[1]?.trim().toLowerCase();
|
|
3476
|
+
if (!token) return { hasCommand: true };
|
|
3477
|
+
if (token === "inherit" || token === "default" || token === "reset") return {
|
|
3478
|
+
hasCommand: true,
|
|
3479
|
+
mode: "inherit"
|
|
3480
|
+
};
|
|
3481
|
+
return {
|
|
3482
|
+
hasCommand: true,
|
|
3483
|
+
mode: normalizeSendPolicyOverride(token)
|
|
3484
|
+
};
|
|
3485
|
+
}
|
|
3486
|
+
//#endregion
|
|
3487
|
+
//#region src/auto-reply/reply/commands-session-store.ts
|
|
3488
|
+
async function persistSessionEntry(params) {
|
|
3489
|
+
if (!params.sessionEntry || !params.sessionStore || !params.sessionKey) return false;
|
|
3490
|
+
params.sessionEntry.updatedAt = Date.now();
|
|
3491
|
+
params.sessionStore[params.sessionKey] = params.sessionEntry;
|
|
3492
|
+
if (params.storePath) await updateSessionStore(params.storePath, (store) => {
|
|
3493
|
+
store[params.sessionKey] = params.sessionEntry;
|
|
3494
|
+
});
|
|
3495
|
+
return true;
|
|
3496
|
+
}
|
|
3497
|
+
async function persistAbortTargetEntry(params) {
|
|
3498
|
+
const { entry, key, sessionStore, storePath, abortCutoff } = params;
|
|
3499
|
+
if (!entry || !key || !sessionStore) return false;
|
|
3500
|
+
entry.abortedLastRun = true;
|
|
3501
|
+
applyAbortCutoffToSessionEntry(entry, abortCutoff);
|
|
3502
|
+
entry.updatedAt = Date.now();
|
|
3503
|
+
sessionStore[key] = entry;
|
|
3504
|
+
if (storePath) await updateSessionStore(storePath, (store) => {
|
|
3505
|
+
const nextEntry = store[key] ?? entry;
|
|
3506
|
+
if (!nextEntry) return;
|
|
3507
|
+
nextEntry.abortedLastRun = true;
|
|
3508
|
+
applyAbortCutoffToSessionEntry(nextEntry, abortCutoff);
|
|
3509
|
+
nextEntry.updatedAt = Date.now();
|
|
3510
|
+
store[key] = nextEntry;
|
|
3511
|
+
});
|
|
3512
|
+
return true;
|
|
3513
|
+
}
|
|
3514
|
+
//#endregion
|
|
3515
|
+
//#region src/auto-reply/reply/commands-session-abort.ts
|
|
3516
|
+
function resolveAbortTarget(params) {
|
|
3517
|
+
const targetSessionKey = params.ctx.CommandTargetSessionKey?.trim() || params.sessionKey;
|
|
3518
|
+
const { entry, key } = resolveSessionEntryForKey(params.sessionStore, targetSessionKey);
|
|
3519
|
+
if (entry && key) return {
|
|
3520
|
+
entry,
|
|
3521
|
+
key,
|
|
3522
|
+
sessionId: entry.sessionId
|
|
3523
|
+
};
|
|
3524
|
+
if (params.sessionEntry && params.sessionKey) return {
|
|
3525
|
+
entry: params.sessionEntry,
|
|
3526
|
+
key: params.sessionKey,
|
|
3527
|
+
sessionId: params.sessionEntry.sessionId
|
|
3528
|
+
};
|
|
3529
|
+
return {
|
|
3530
|
+
entry: void 0,
|
|
3531
|
+
key: targetSessionKey,
|
|
3532
|
+
sessionId: void 0
|
|
3533
|
+
};
|
|
3534
|
+
}
|
|
3535
|
+
function resolveAbortCutoffForTarget(params) {
|
|
3536
|
+
if (!shouldPersistAbortCutoff({
|
|
3537
|
+
commandSessionKey: params.commandSessionKey,
|
|
3538
|
+
targetSessionKey: params.targetSessionKey
|
|
3539
|
+
})) return;
|
|
3540
|
+
return resolveAbortCutoffFromContext(params.ctx);
|
|
3541
|
+
}
|
|
3542
|
+
async function applyAbortTarget(params) {
|
|
3543
|
+
const { abortTarget } = params;
|
|
3544
|
+
if (abortTarget.sessionId) abortEmbeddedPiRun(abortTarget.sessionId);
|
|
3545
|
+
if (!await persistAbortTargetEntry({
|
|
3546
|
+
entry: abortTarget.entry,
|
|
3547
|
+
key: abortTarget.key,
|
|
3548
|
+
sessionStore: params.sessionStore,
|
|
3549
|
+
storePath: params.storePath,
|
|
3550
|
+
abortCutoff: params.abortCutoff
|
|
3551
|
+
}) && params.abortKey) setAbortMemory(params.abortKey, true);
|
|
3552
|
+
}
|
|
3553
|
+
function buildAbortTargetApplyParams(params, abortTarget) {
|
|
3554
|
+
return {
|
|
3555
|
+
abortTarget,
|
|
3556
|
+
sessionStore: params.sessionStore,
|
|
3557
|
+
storePath: params.storePath,
|
|
3558
|
+
abortKey: params.command.abortKey,
|
|
3559
|
+
abortCutoff: resolveAbortCutoffForTarget({
|
|
3560
|
+
ctx: params.ctx,
|
|
3561
|
+
commandSessionKey: params.sessionKey,
|
|
3562
|
+
targetSessionKey: abortTarget.key
|
|
3563
|
+
})
|
|
3564
|
+
};
|
|
3565
|
+
}
|
|
3566
|
+
const handleStopCommand = async (params, allowTextCommands) => {
|
|
3567
|
+
if (!allowTextCommands) return null;
|
|
3568
|
+
if (params.command.commandBodyNormalized !== "/stop") return null;
|
|
3569
|
+
const unauthorizedStop = rejectUnauthorizedCommand(params, "/stop");
|
|
3570
|
+
if (unauthorizedStop) return unauthorizedStop;
|
|
3571
|
+
const abortTarget = resolveAbortTarget({
|
|
3572
|
+
ctx: params.ctx,
|
|
3573
|
+
sessionKey: params.sessionKey,
|
|
3574
|
+
sessionEntry: params.sessionEntry,
|
|
3575
|
+
sessionStore: params.sessionStore
|
|
3576
|
+
});
|
|
3577
|
+
const cleared = clearSessionQueues([abortTarget.key, abortTarget.sessionId]);
|
|
3578
|
+
if (cleared.followupCleared > 0 || cleared.laneCleared > 0) logVerbose(`stop: cleared followups=${cleared.followupCleared} lane=${cleared.laneCleared} keys=${cleared.keys.join(",")}`);
|
|
3579
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, abortTarget));
|
|
3580
|
+
await triggerInternalHook(createInternalHookEvent("command", "stop", abortTarget.key ?? params.sessionKey ?? "", {
|
|
3581
|
+
sessionEntry: abortTarget.entry ?? params.sessionEntry,
|
|
3582
|
+
sessionId: abortTarget.sessionId,
|
|
3583
|
+
commandSource: params.command.surface,
|
|
3584
|
+
senderId: params.command.senderId
|
|
3585
|
+
}));
|
|
3586
|
+
const { stopped } = stopSubagentsForRequester({
|
|
3587
|
+
cfg: params.cfg,
|
|
3588
|
+
requesterSessionKey: abortTarget.key ?? params.sessionKey
|
|
3589
|
+
});
|
|
3590
|
+
return {
|
|
3591
|
+
shouldContinue: false,
|
|
3592
|
+
reply: { text: formatAbortReplyText(stopped) }
|
|
3593
|
+
};
|
|
3594
|
+
};
|
|
3595
|
+
const handleAbortTrigger = async (params, allowTextCommands) => {
|
|
3596
|
+
if (!allowTextCommands) return null;
|
|
3597
|
+
if (!isAbortTrigger(params.command.rawBodyNormalized)) return null;
|
|
3598
|
+
const unauthorizedAbortTrigger = rejectUnauthorizedCommand(params, "abort trigger");
|
|
3599
|
+
if (unauthorizedAbortTrigger) return unauthorizedAbortTrigger;
|
|
3600
|
+
await applyAbortTarget(buildAbortTargetApplyParams(params, resolveAbortTarget({
|
|
3601
|
+
ctx: params.ctx,
|
|
3602
|
+
sessionKey: params.sessionKey,
|
|
3603
|
+
sessionEntry: params.sessionEntry,
|
|
3604
|
+
sessionStore: params.sessionStore
|
|
3605
|
+
})));
|
|
3606
|
+
return {
|
|
3607
|
+
shouldContinue: false,
|
|
3608
|
+
reply: { text: "⚙️ Agent was aborted." }
|
|
3609
|
+
};
|
|
3610
|
+
};
|
|
3611
|
+
//#endregion
|
|
3612
|
+
//#region src/auto-reply/reply/commands-session.ts
|
|
3613
|
+
const SESSION_DURATION_OFF_VALUES = new Set([
|
|
3614
|
+
"off",
|
|
3615
|
+
"disable",
|
|
3616
|
+
"disabled",
|
|
3617
|
+
"none",
|
|
3618
|
+
"0"
|
|
3619
|
+
]);
|
|
3620
|
+
const SESSION_ACTION_IDLE = "idle";
|
|
3621
|
+
const SESSION_ACTION_MAX_AGE = "max-age";
|
|
3622
|
+
let cachedChannelRuntime;
|
|
3623
|
+
function getChannelRuntime() {
|
|
3624
|
+
cachedChannelRuntime ??= createPluginRuntime().channel;
|
|
3625
|
+
return cachedChannelRuntime;
|
|
3626
|
+
}
|
|
3627
|
+
function resolveSessionCommandUsage() {
|
|
3628
|
+
return "Usage: /session idle <duration|off> | /session max-age <duration|off> (example: /session idle 24h)";
|
|
3629
|
+
}
|
|
3630
|
+
function parseSessionDurationMs(raw) {
|
|
3631
|
+
const normalized = raw.trim().toLowerCase();
|
|
3632
|
+
if (!normalized) throw new Error("missing duration");
|
|
3633
|
+
if (SESSION_DURATION_OFF_VALUES.has(normalized)) return 0;
|
|
3634
|
+
if (/^\d+(?:\.\d+)?$/.test(normalized)) {
|
|
3635
|
+
const hours = Number(normalized);
|
|
3636
|
+
if (!Number.isFinite(hours) || hours < 0) throw new Error("invalid duration");
|
|
3637
|
+
return Math.round(hours * 60 * 60 * 1e3);
|
|
3638
|
+
}
|
|
3639
|
+
return parseDurationMs(normalized, { defaultUnit: "h" });
|
|
3640
|
+
}
|
|
3641
|
+
function formatSessionExpiry(expiresAt) {
|
|
3642
|
+
return new Date(expiresAt).toISOString();
|
|
3643
|
+
}
|
|
3644
|
+
function resolveSessionBindingDurationMs(binding, key, fallbackMs) {
|
|
3645
|
+
const raw = binding.metadata?.[key];
|
|
3646
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return fallbackMs;
|
|
3647
|
+
return Math.max(0, Math.floor(raw));
|
|
3648
|
+
}
|
|
3649
|
+
function resolveSessionBindingLastActivityAt(binding) {
|
|
3650
|
+
const raw = binding.metadata?.lastActivityAt;
|
|
3651
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return binding.boundAt;
|
|
3652
|
+
return Math.max(Math.floor(raw), binding.boundAt);
|
|
3653
|
+
}
|
|
3654
|
+
function resolveSessionBindingBoundBy(binding) {
|
|
3655
|
+
const raw = binding.metadata?.boundBy;
|
|
3656
|
+
return typeof raw === "string" ? raw.trim() : "";
|
|
3657
|
+
}
|
|
3658
|
+
function isSessionBindingRecord(binding) {
|
|
3659
|
+
return "bindingId" in binding;
|
|
3660
|
+
}
|
|
3661
|
+
function resolveUpdatedLifecycleDurationMs(binding, key) {
|
|
3662
|
+
if (!isSessionBindingRecord(binding)) {
|
|
3663
|
+
const raw = binding[key];
|
|
3664
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return Math.max(0, Math.floor(raw));
|
|
3665
|
+
}
|
|
3666
|
+
if (!isSessionBindingRecord(binding)) return;
|
|
3667
|
+
const raw = binding.metadata?.[key];
|
|
3668
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return;
|
|
3669
|
+
return Math.max(0, Math.floor(raw));
|
|
3670
|
+
}
|
|
3671
|
+
function toUpdatedLifecycleBinding(binding) {
|
|
3672
|
+
const lastActivityAt = isSessionBindingRecord(binding) ? resolveSessionBindingLastActivityAt(binding) : Math.max(Math.floor(binding.lastActivityAt), binding.boundAt);
|
|
3673
|
+
return {
|
|
3674
|
+
boundAt: binding.boundAt,
|
|
3675
|
+
lastActivityAt,
|
|
3676
|
+
idleTimeoutMs: resolveUpdatedLifecycleDurationMs(binding, "idleTimeoutMs"),
|
|
3677
|
+
maxAgeMs: resolveUpdatedLifecycleDurationMs(binding, "maxAgeMs")
|
|
3678
|
+
};
|
|
3679
|
+
}
|
|
3680
|
+
function resolveUpdatedBindingExpiry(params) {
|
|
3681
|
+
const expiries = params.bindings.map((binding) => {
|
|
3682
|
+
if (params.action === SESSION_ACTION_IDLE) {
|
|
3683
|
+
const idleTimeoutMs = typeof binding.idleTimeoutMs === "number" && Number.isFinite(binding.idleTimeoutMs) ? Math.max(0, Math.floor(binding.idleTimeoutMs)) : 0;
|
|
3684
|
+
if (idleTimeoutMs <= 0) return;
|
|
3685
|
+
return Math.max(binding.lastActivityAt, binding.boundAt) + idleTimeoutMs;
|
|
3686
|
+
}
|
|
3687
|
+
const maxAgeMs = typeof binding.maxAgeMs === "number" && Number.isFinite(binding.maxAgeMs) ? Math.max(0, Math.floor(binding.maxAgeMs)) : 0;
|
|
3688
|
+
if (maxAgeMs <= 0) return;
|
|
3689
|
+
return binding.boundAt + maxAgeMs;
|
|
3690
|
+
}).filter((expiresAt) => typeof expiresAt === "number");
|
|
3691
|
+
if (expiries.length === 0) return;
|
|
3692
|
+
return Math.min(...expiries);
|
|
3693
|
+
}
|
|
3694
|
+
const handleActivationCommand = async (params, allowTextCommands) => {
|
|
3695
|
+
if (!allowTextCommands) return null;
|
|
3696
|
+
const activationCommand = parseActivationCommand(params.command.commandBodyNormalized);
|
|
3697
|
+
if (!activationCommand.hasCommand) return null;
|
|
3698
|
+
if (!params.isGroup) return {
|
|
3699
|
+
shouldContinue: false,
|
|
3700
|
+
reply: { text: "⚙️ Group activation only applies to group chats." }
|
|
3701
|
+
};
|
|
3702
|
+
if (!params.command.isAuthorizedSender) {
|
|
3703
|
+
logVerbose(`Ignoring /activation from unauthorized sender in group: ${params.command.senderId || "<unknown>"}`);
|
|
3704
|
+
return { shouldContinue: false };
|
|
3705
|
+
}
|
|
3706
|
+
if (!activationCommand.mode) return {
|
|
3707
|
+
shouldContinue: false,
|
|
3708
|
+
reply: { text: "⚙️ Usage: /activation mention|always" }
|
|
3709
|
+
};
|
|
3710
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3711
|
+
params.sessionEntry.groupActivation = activationCommand.mode;
|
|
3712
|
+
params.sessionEntry.groupActivationNeedsSystemIntro = true;
|
|
3713
|
+
await persistSessionEntry(params);
|
|
3714
|
+
}
|
|
3715
|
+
return {
|
|
3716
|
+
shouldContinue: false,
|
|
3717
|
+
reply: { text: `⚙️ Group activation set to ${activationCommand.mode}.` }
|
|
3718
|
+
};
|
|
3719
|
+
};
|
|
3720
|
+
const handleSendPolicyCommand = async (params, allowTextCommands) => {
|
|
3721
|
+
if (!allowTextCommands) return null;
|
|
3722
|
+
const sendPolicyCommand = parseSendPolicyCommand(params.command.commandBodyNormalized);
|
|
3723
|
+
if (!sendPolicyCommand.hasCommand) return null;
|
|
3724
|
+
if (!params.command.isAuthorizedSender) {
|
|
3725
|
+
logVerbose(`Ignoring /send from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3726
|
+
return { shouldContinue: false };
|
|
3727
|
+
}
|
|
3728
|
+
if (!sendPolicyCommand.mode) return {
|
|
3729
|
+
shouldContinue: false,
|
|
3730
|
+
reply: { text: "⚙️ Usage: /send on|off|inherit" }
|
|
3731
|
+
};
|
|
3732
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3733
|
+
if (sendPolicyCommand.mode === "inherit") delete params.sessionEntry.sendPolicy;
|
|
3734
|
+
else params.sessionEntry.sendPolicy = sendPolicyCommand.mode;
|
|
3735
|
+
await persistSessionEntry(params);
|
|
3736
|
+
}
|
|
3737
|
+
return {
|
|
3738
|
+
shouldContinue: false,
|
|
3739
|
+
reply: { text: `⚙️ Send policy set to ${sendPolicyCommand.mode === "inherit" ? "inherit" : sendPolicyCommand.mode === "allow" ? "on" : "off"}.` }
|
|
3740
|
+
};
|
|
3741
|
+
};
|
|
3742
|
+
const handleUsageCommand = async (params, allowTextCommands) => {
|
|
3743
|
+
if (!allowTextCommands) return null;
|
|
3744
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3745
|
+
if (normalized !== "/usage" && !normalized.startsWith("/usage ")) return null;
|
|
3746
|
+
if (!params.command.isAuthorizedSender) {
|
|
3747
|
+
logVerbose(`Ignoring /usage from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3748
|
+
return { shouldContinue: false };
|
|
3749
|
+
}
|
|
3750
|
+
const rawArgs = normalized === "/usage" ? "" : normalized.slice(6).trim();
|
|
3751
|
+
const requested = rawArgs ? normalizeUsageDisplay(rawArgs) : void 0;
|
|
3752
|
+
if (rawArgs.toLowerCase().startsWith("cost")) {
|
|
3753
|
+
const sessionSummary = await loadSessionCostSummary({
|
|
3754
|
+
sessionId: params.sessionEntry?.sessionId,
|
|
3755
|
+
sessionEntry: params.sessionEntry,
|
|
3756
|
+
sessionFile: params.sessionEntry?.sessionFile,
|
|
3757
|
+
config: params.cfg,
|
|
3758
|
+
agentId: params.agentId
|
|
3759
|
+
});
|
|
3760
|
+
const summary = await loadCostUsageSummary({
|
|
3761
|
+
days: 30,
|
|
3762
|
+
config: params.cfg
|
|
3763
|
+
});
|
|
3764
|
+
const sessionCost = formatUsd(sessionSummary?.totalCost);
|
|
3765
|
+
const sessionTokens = sessionSummary?.totalTokens ? formatTokenCount$1(sessionSummary.totalTokens) : void 0;
|
|
3766
|
+
const sessionSuffix = (sessionSummary?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
3767
|
+
const sessionLine = sessionCost || sessionTokens ? `Session ${sessionCost ?? "n/a"}${sessionSuffix}${sessionTokens ? ` · ${sessionTokens} tokens` : ""}` : "Session n/a";
|
|
3768
|
+
const todayKey = (/* @__PURE__ */ new Date()).toLocaleDateString("en-CA");
|
|
3769
|
+
const todayEntry = summary.daily.find((entry) => entry.date === todayKey);
|
|
3770
|
+
const todayCost = formatUsd(todayEntry?.totalCost);
|
|
3771
|
+
const todaySuffix = (todayEntry?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
|
|
3772
|
+
const todayLine = `Today ${todayCost ?? "n/a"}${todaySuffix}`;
|
|
3773
|
+
const last30Cost = formatUsd(summary.totals.totalCost);
|
|
3774
|
+
const last30Suffix = summary.totals.missingCostEntries > 0 ? " (partial)" : "";
|
|
3775
|
+
return {
|
|
3776
|
+
shouldContinue: false,
|
|
3777
|
+
reply: { text: `💸 Usage cost\n${sessionLine}\n${todayLine}\n${`Last 30d ${last30Cost ?? "n/a"}${last30Suffix}`}` }
|
|
3778
|
+
};
|
|
3779
|
+
}
|
|
3780
|
+
if (rawArgs && !requested) return {
|
|
3781
|
+
shouldContinue: false,
|
|
3782
|
+
reply: { text: "⚙️ Usage: /usage off|tokens|full|cost" }
|
|
3783
|
+
};
|
|
3784
|
+
const current = resolveResponseUsageMode(params.sessionEntry?.responseUsage ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey]?.responseUsage : void 0));
|
|
3785
|
+
const next = requested ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
|
|
3786
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3787
|
+
if (next === "off") delete params.sessionEntry.responseUsage;
|
|
3788
|
+
else params.sessionEntry.responseUsage = next;
|
|
3789
|
+
await persistSessionEntry(params);
|
|
3790
|
+
}
|
|
3791
|
+
return {
|
|
3792
|
+
shouldContinue: false,
|
|
3793
|
+
reply: { text: `⚙️ Usage footer: ${next}.` }
|
|
3794
|
+
};
|
|
3795
|
+
};
|
|
3796
|
+
const handleFastCommand = async (params, allowTextCommands) => {
|
|
3797
|
+
if (!allowTextCommands) return null;
|
|
3798
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3799
|
+
if (normalized !== "/fast" && !normalized.startsWith("/fast ")) return null;
|
|
3800
|
+
if (!params.command.isAuthorizedSender) {
|
|
3801
|
+
logVerbose(`Ignoring /fast from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3802
|
+
return { shouldContinue: false };
|
|
3803
|
+
}
|
|
3804
|
+
const rawMode = (normalized === "/fast" ? "" : normalized.slice(5).trim()).toLowerCase();
|
|
3805
|
+
if (!rawMode || rawMode === "status") {
|
|
3806
|
+
const state = resolveFastModeState({
|
|
3807
|
+
cfg: params.cfg,
|
|
3808
|
+
provider: params.provider,
|
|
3809
|
+
model: params.model,
|
|
3810
|
+
agentId: params.agentId,
|
|
3811
|
+
sessionEntry: params.sessionEntry
|
|
3812
|
+
});
|
|
3813
|
+
const suffix = state.source === "agent" ? " (agent)" : state.source === "config" ? " (config)" : state.source === "default" ? " (default)" : "";
|
|
3814
|
+
return {
|
|
3815
|
+
shouldContinue: false,
|
|
3816
|
+
reply: { text: `⚙️ Current fast mode: ${state.enabled ? "on" : "off"}${suffix}.` }
|
|
3817
|
+
};
|
|
3818
|
+
}
|
|
3819
|
+
const nextMode = normalizeFastMode(rawMode);
|
|
3820
|
+
if (nextMode === void 0) return {
|
|
3821
|
+
shouldContinue: false,
|
|
3822
|
+
reply: { text: "⚙️ Usage: /fast status|on|off" }
|
|
3823
|
+
};
|
|
3824
|
+
if (params.sessionEntry && params.sessionStore && params.sessionKey) {
|
|
3825
|
+
params.sessionEntry.fastMode = nextMode;
|
|
3826
|
+
await persistSessionEntry(params);
|
|
3827
|
+
}
|
|
3828
|
+
return {
|
|
3829
|
+
shouldContinue: false,
|
|
3830
|
+
reply: { text: `⚙️ Fast mode ${nextMode ? "enabled" : "disabled"}.` }
|
|
3831
|
+
};
|
|
3832
|
+
};
|
|
3833
|
+
const handleSessionCommand = async (params, allowTextCommands) => {
|
|
3834
|
+
if (!allowTextCommands) return null;
|
|
3835
|
+
const normalized = params.command.commandBodyNormalized;
|
|
3836
|
+
if (!/^\/session(?:\s|$)/.test(normalized)) return null;
|
|
3837
|
+
if (!params.command.isAuthorizedSender) {
|
|
3838
|
+
logVerbose(`Ignoring /session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
3839
|
+
return { shouldContinue: false };
|
|
3840
|
+
}
|
|
3841
|
+
const tokens = normalized.slice(8).trim().split(/\s+/).filter(Boolean);
|
|
3842
|
+
const action = tokens[0]?.toLowerCase();
|
|
3843
|
+
if (action !== SESSION_ACTION_IDLE && action !== SESSION_ACTION_MAX_AGE) return {
|
|
3844
|
+
shouldContinue: false,
|
|
3845
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
3846
|
+
};
|
|
3847
|
+
const onDiscord = isDiscordSurface(params);
|
|
3848
|
+
const onMatrix = isMatrixSurface(params);
|
|
3849
|
+
const onTelegram = isTelegramSurface(params);
|
|
3850
|
+
if (!onDiscord && !onMatrix && !onTelegram) return {
|
|
3851
|
+
shouldContinue: false,
|
|
3852
|
+
reply: { text: "⚠️ /session idle and /session max-age are currently available for Discord, Matrix, and Telegram bound sessions." }
|
|
3853
|
+
};
|
|
3854
|
+
const accountId = resolveChannelAccountId(params);
|
|
3855
|
+
const sessionBindingService = getSessionBindingService();
|
|
3856
|
+
const threadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
3857
|
+
const matrixConversationId = onMatrix ? resolveMatrixConversationId({
|
|
3858
|
+
ctx: {
|
|
3859
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
3860
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
3861
|
+
To: params.ctx.To
|
|
3862
|
+
},
|
|
3863
|
+
command: { to: params.command.to }
|
|
3864
|
+
}) : void 0;
|
|
3865
|
+
const matrixParentConversationId = onMatrix ? resolveMatrixParentConversationId({
|
|
3866
|
+
ctx: {
|
|
3867
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
3868
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
3869
|
+
To: params.ctx.To
|
|
3870
|
+
},
|
|
3871
|
+
command: { to: params.command.to }
|
|
3872
|
+
}) : void 0;
|
|
3873
|
+
const telegramConversationId = onTelegram ? resolveTelegramConversationId(params) : void 0;
|
|
3874
|
+
const channelRuntime = getChannelRuntime();
|
|
3875
|
+
const discordManager = onDiscord ? channelRuntime.discord.threadBindings.getManager(accountId) : null;
|
|
3876
|
+
if (onDiscord && !discordManager) return {
|
|
3877
|
+
shouldContinue: false,
|
|
3878
|
+
reply: { text: "⚠️ Discord thread bindings are unavailable for this account." }
|
|
3879
|
+
};
|
|
3880
|
+
const discordBinding = onDiscord && threadId ? discordManager?.getByThreadId(threadId) : void 0;
|
|
3881
|
+
const telegramBinding = onTelegram && telegramConversationId ? sessionBindingService.resolveByConversation({
|
|
3882
|
+
channel: "telegram",
|
|
3883
|
+
accountId,
|
|
3884
|
+
conversationId: telegramConversationId
|
|
3885
|
+
}) : null;
|
|
3886
|
+
const matrixBinding = onMatrix && matrixConversationId ? sessionBindingService.resolveByConversation({
|
|
3887
|
+
channel: "matrix",
|
|
3888
|
+
accountId,
|
|
3889
|
+
conversationId: matrixConversationId,
|
|
3890
|
+
...matrixParentConversationId && matrixParentConversationId !== matrixConversationId ? { parentConversationId: matrixParentConversationId } : {}
|
|
3891
|
+
}) : null;
|
|
3892
|
+
if (onDiscord && !discordBinding) {
|
|
3893
|
+
if (onDiscord && !threadId) return {
|
|
3894
|
+
shouldContinue: false,
|
|
3895
|
+
reply: { text: "⚠️ /session idle and /session max-age must be run inside a focused Discord thread." }
|
|
3896
|
+
};
|
|
3897
|
+
return {
|
|
3898
|
+
shouldContinue: false,
|
|
3899
|
+
reply: { text: "ℹ️ This thread is not currently focused." }
|
|
3900
|
+
};
|
|
3901
|
+
}
|
|
3902
|
+
if (onMatrix && !matrixBinding) {
|
|
3903
|
+
if (!threadId) return {
|
|
3904
|
+
shouldContinue: false,
|
|
3905
|
+
reply: { text: "⚠️ /session idle and /session max-age must be run inside a focused Matrix thread." }
|
|
3906
|
+
};
|
|
3907
|
+
return {
|
|
3908
|
+
shouldContinue: false,
|
|
3909
|
+
reply: { text: "ℹ️ This thread is not currently focused." }
|
|
3910
|
+
};
|
|
3911
|
+
}
|
|
3912
|
+
if (onTelegram && !telegramBinding) {
|
|
3913
|
+
if (!telegramConversationId) return {
|
|
3914
|
+
shouldContinue: false,
|
|
3915
|
+
reply: { text: "⚠️ /session idle and /session max-age on Telegram require a topic context in groups, or a direct-message conversation." }
|
|
3916
|
+
};
|
|
3917
|
+
return {
|
|
3918
|
+
shouldContinue: false,
|
|
3919
|
+
reply: { text: "ℹ️ This conversation is not currently focused." }
|
|
3920
|
+
};
|
|
3921
|
+
}
|
|
3922
|
+
const idleTimeoutMs = onDiscord ? channelRuntime.discord.threadBindings.resolveIdleTimeoutMs({
|
|
3923
|
+
record: discordBinding,
|
|
3924
|
+
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
3925
|
+
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "idleTimeoutMs", 1440 * 60 * 1e3);
|
|
3926
|
+
const idleExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveInactivityExpiresAt({
|
|
3927
|
+
record: discordBinding,
|
|
3928
|
+
defaultIdleTimeoutMs: discordManager.getIdleTimeoutMs()
|
|
3929
|
+
}) : idleTimeoutMs > 0 ? resolveSessionBindingLastActivityAt(onMatrix ? matrixBinding : telegramBinding) + idleTimeoutMs : void 0;
|
|
3930
|
+
const maxAgeMs = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeMs({
|
|
3931
|
+
record: discordBinding,
|
|
3932
|
+
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
3933
|
+
}) : resolveSessionBindingDurationMs(onMatrix ? matrixBinding : telegramBinding, "maxAgeMs", 0);
|
|
3934
|
+
const maxAgeExpiresAt = onDiscord ? channelRuntime.discord.threadBindings.resolveMaxAgeExpiresAt({
|
|
3935
|
+
record: discordBinding,
|
|
3936
|
+
defaultMaxAgeMs: discordManager.getMaxAgeMs()
|
|
3937
|
+
}) : maxAgeMs > 0 ? (onMatrix ? matrixBinding : telegramBinding).boundAt + maxAgeMs : void 0;
|
|
3938
|
+
const durationArgRaw = tokens.slice(1).join("");
|
|
3939
|
+
if (!durationArgRaw) {
|
|
3940
|
+
if (action === SESSION_ACTION_IDLE) {
|
|
3941
|
+
if (typeof idleExpiresAt === "number" && Number.isFinite(idleExpiresAt) && idleExpiresAt > Date.now()) return {
|
|
3942
|
+
shouldContinue: false,
|
|
3943
|
+
reply: { text: `ℹ️ Idle timeout active (${formatThreadBindingDurationLabel(idleTimeoutMs)}, next auto-unfocus at ${formatSessionExpiry(idleExpiresAt)}).` }
|
|
3944
|
+
};
|
|
3945
|
+
return {
|
|
3946
|
+
shouldContinue: false,
|
|
3947
|
+
reply: { text: "ℹ️ Idle timeout is currently disabled for this focused session." }
|
|
3948
|
+
};
|
|
3949
|
+
}
|
|
3950
|
+
if (typeof maxAgeExpiresAt === "number" && Number.isFinite(maxAgeExpiresAt) && maxAgeExpiresAt > Date.now()) return {
|
|
3951
|
+
shouldContinue: false,
|
|
3952
|
+
reply: { text: `ℹ️ Max age active (${formatThreadBindingDurationLabel(maxAgeMs)}, hard auto-unfocus at ${formatSessionExpiry(maxAgeExpiresAt)}).` }
|
|
3953
|
+
};
|
|
3954
|
+
return {
|
|
3955
|
+
shouldContinue: false,
|
|
3956
|
+
reply: { text: "ℹ️ Max age is currently disabled for this focused session." }
|
|
3957
|
+
};
|
|
3958
|
+
}
|
|
3959
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
3960
|
+
const boundBy = onDiscord ? discordBinding.boundBy : resolveSessionBindingBoundBy(onMatrix ? matrixBinding : telegramBinding);
|
|
3961
|
+
if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
|
|
3962
|
+
shouldContinue: false,
|
|
3963
|
+
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.` }
|
|
3964
|
+
};
|
|
3965
|
+
let durationMs;
|
|
3966
|
+
try {
|
|
3967
|
+
durationMs = parseSessionDurationMs(durationArgRaw);
|
|
3968
|
+
} catch {
|
|
3969
|
+
return {
|
|
3970
|
+
shouldContinue: false,
|
|
3971
|
+
reply: { text: resolveSessionCommandUsage() }
|
|
3972
|
+
};
|
|
3973
|
+
}
|
|
3974
|
+
const updatedBindings = (() => {
|
|
3975
|
+
if (onDiscord) return action === SESSION_ACTION_IDLE ? channelRuntime.discord.threadBindings.setIdleTimeoutBySessionKey({
|
|
3976
|
+
targetSessionKey: discordBinding.targetSessionKey,
|
|
3977
|
+
accountId,
|
|
3978
|
+
idleTimeoutMs: durationMs
|
|
3979
|
+
}) : channelRuntime.discord.threadBindings.setMaxAgeBySessionKey({
|
|
3980
|
+
targetSessionKey: discordBinding.targetSessionKey,
|
|
3981
|
+
accountId,
|
|
3982
|
+
maxAgeMs: durationMs
|
|
3983
|
+
});
|
|
3984
|
+
if (onMatrix) return action === SESSION_ACTION_IDLE ? channelRuntime.matrix.threadBindings.setIdleTimeoutBySessionKey({
|
|
3985
|
+
targetSessionKey: matrixBinding.targetSessionKey,
|
|
3986
|
+
accountId,
|
|
3987
|
+
idleTimeoutMs: durationMs
|
|
3988
|
+
}) : channelRuntime.matrix.threadBindings.setMaxAgeBySessionKey({
|
|
3989
|
+
targetSessionKey: matrixBinding.targetSessionKey,
|
|
3990
|
+
accountId,
|
|
3991
|
+
maxAgeMs: durationMs
|
|
3992
|
+
});
|
|
3993
|
+
return action === SESSION_ACTION_IDLE ? channelRuntime.telegram.threadBindings.setIdleTimeoutBySessionKey({
|
|
3994
|
+
targetSessionKey: telegramBinding.targetSessionKey,
|
|
3995
|
+
accountId,
|
|
3996
|
+
idleTimeoutMs: durationMs
|
|
3997
|
+
}) : channelRuntime.telegram.threadBindings.setMaxAgeBySessionKey({
|
|
3998
|
+
targetSessionKey: telegramBinding.targetSessionKey,
|
|
3999
|
+
accountId,
|
|
4000
|
+
maxAgeMs: durationMs
|
|
4001
|
+
});
|
|
4002
|
+
})();
|
|
4003
|
+
if (updatedBindings.length === 0) return {
|
|
4004
|
+
shouldContinue: false,
|
|
4005
|
+
reply: { text: action === SESSION_ACTION_IDLE ? "⚠️ Failed to update idle timeout for the current binding." : "⚠️ Failed to update max age for the current binding." }
|
|
4006
|
+
};
|
|
4007
|
+
if (durationMs <= 0) return {
|
|
4008
|
+
shouldContinue: false,
|
|
4009
|
+
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"}.` }
|
|
4010
|
+
};
|
|
4011
|
+
const nextExpiry = resolveUpdatedBindingExpiry({
|
|
4012
|
+
action,
|
|
4013
|
+
bindings: updatedBindings.map((binding) => toUpdatedLifecycleBinding(binding))
|
|
4014
|
+
});
|
|
4015
|
+
const expiryLabel = typeof nextExpiry === "number" && Number.isFinite(nextExpiry) ? formatSessionExpiry(nextExpiry) : "n/a";
|
|
4016
|
+
return {
|
|
4017
|
+
shouldContinue: false,
|
|
4018
|
+
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}).` }
|
|
4019
|
+
};
|
|
4020
|
+
};
|
|
4021
|
+
const handleRestartCommand = async (params, allowTextCommands) => {
|
|
4022
|
+
if (!allowTextCommands) return null;
|
|
4023
|
+
if (params.command.commandBodyNormalized !== "/restart") return null;
|
|
4024
|
+
if (!params.command.isAuthorizedSender) {
|
|
4025
|
+
logVerbose(`Ignoring /restart from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
4026
|
+
return { shouldContinue: false };
|
|
4027
|
+
}
|
|
4028
|
+
if (!isRestartEnabled(params.cfg)) return {
|
|
4029
|
+
shouldContinue: false,
|
|
4030
|
+
reply: { text: "⚠️ /restart is disabled (commands.restart=false)." }
|
|
4031
|
+
};
|
|
4032
|
+
if (process.listenerCount("SIGUSR1") > 0) {
|
|
4033
|
+
scheduleGatewaySigusr1Restart({ reason: "/restart" });
|
|
4034
|
+
return {
|
|
4035
|
+
shouldContinue: false,
|
|
4036
|
+
reply: { text: "⚙️ Restarting OpenClaw in-process (SIGUSR1); back in a few seconds." }
|
|
4037
|
+
};
|
|
4038
|
+
}
|
|
4039
|
+
const restartMethod = triggerOpenClawRestart();
|
|
4040
|
+
if (!restartMethod.ok) {
|
|
4041
|
+
const detail = restartMethod.detail ? ` Details: ${restartMethod.detail}` : "";
|
|
4042
|
+
return {
|
|
4043
|
+
shouldContinue: false,
|
|
4044
|
+
reply: { text: `⚠️ Restart failed (${restartMethod.method}).${detail}` }
|
|
4045
|
+
};
|
|
4046
|
+
}
|
|
4047
|
+
return {
|
|
4048
|
+
shouldContinue: false,
|
|
4049
|
+
reply: { text: `⚙️ Restarting OpenClaw via ${restartMethod.method}; give me a few seconds to come back online.` }
|
|
4050
|
+
};
|
|
4051
|
+
};
|
|
4052
|
+
//#endregion
|
|
4053
|
+
//#region src/auto-reply/reply/commands-subagents/action-agents.ts
|
|
4054
|
+
function formatConversationBindingText(params) {
|
|
4055
|
+
if (params.channel === "discord") return `thread:${params.conversationId}`;
|
|
4056
|
+
if (params.channel === "telegram") return `conversation:${params.conversationId}`;
|
|
4057
|
+
return `binding:${params.conversationId}`;
|
|
4058
|
+
}
|
|
4059
|
+
function handleSubagentsAgentsAction(ctx) {
|
|
4060
|
+
const { params, requesterKey, runs } = ctx;
|
|
4061
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
4062
|
+
const accountId = resolveChannelAccountId(params);
|
|
4063
|
+
const bindingService = getSessionBindingService();
|
|
4064
|
+
const bindingsBySession = /* @__PURE__ */ new Map();
|
|
4065
|
+
const resolveSessionBindings = (sessionKey) => {
|
|
4066
|
+
const cached = bindingsBySession.get(sessionKey);
|
|
4067
|
+
if (cached) return cached;
|
|
4068
|
+
const resolved = bindingService.listBySession(sessionKey).filter((entry) => entry.status === "active" && entry.conversation.channel === channel && entry.conversation.accountId === accountId);
|
|
4069
|
+
bindingsBySession.set(sessionKey, resolved);
|
|
4070
|
+
return resolved;
|
|
4071
|
+
};
|
|
4072
|
+
const visibleRuns = sortSubagentRuns(runs).filter((entry) => {
|
|
4073
|
+
if (!entry.endedAt) return true;
|
|
4074
|
+
return resolveSessionBindings(entry.childSessionKey).length > 0;
|
|
4075
|
+
});
|
|
4076
|
+
const lines = ["agents:", "-----"];
|
|
4077
|
+
if (visibleRuns.length === 0) lines.push("(none)");
|
|
4078
|
+
else {
|
|
4079
|
+
let index = 1;
|
|
4080
|
+
for (const entry of visibleRuns) {
|
|
4081
|
+
const binding = resolveSessionBindings(entry.childSessionKey)[0];
|
|
4082
|
+
const bindingText = binding ? formatConversationBindingText({
|
|
4083
|
+
channel,
|
|
4084
|
+
conversationId: binding.conversation.conversationId
|
|
4085
|
+
}) : channel === "discord" || channel === "telegram" ? "unbound" : "bindings available on discord/telegram";
|
|
4086
|
+
lines.push(`${index}. ${formatRunLabel(entry)} (${bindingText})`);
|
|
4087
|
+
index += 1;
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
const requesterBindings = resolveSessionBindings(requesterKey).filter((entry) => entry.targetKind === "session");
|
|
4091
|
+
if (requesterBindings.length > 0) {
|
|
4092
|
+
lines.push("", "acp/session bindings:", "-----");
|
|
4093
|
+
for (const binding of requesterBindings) {
|
|
4094
|
+
const label = typeof binding.metadata?.label === "string" && binding.metadata.label.trim() ? binding.metadata.label.trim() : binding.targetSessionKey;
|
|
4095
|
+
lines.push(`- ${label} (${formatConversationBindingText({
|
|
4096
|
+
channel,
|
|
4097
|
+
conversationId: binding.conversation.conversationId
|
|
4098
|
+
})}, session:${binding.targetSessionKey})`);
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
return stopWithText(lines.join("\n"));
|
|
4102
|
+
}
|
|
4103
|
+
//#endregion
|
|
4104
|
+
//#region src/auto-reply/reply/commands-subagents/action-focus.ts
|
|
4105
|
+
function resolveFocusBindingContext(params) {
|
|
4106
|
+
if (isDiscordSurface(params)) {
|
|
4107
|
+
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
4108
|
+
const parentChannelId = currentThreadId ? void 0 : resolveDiscordChannelIdForFocus(params);
|
|
4109
|
+
const conversationId = currentThreadId || parentChannelId;
|
|
4110
|
+
if (!conversationId) return null;
|
|
4111
|
+
return {
|
|
4112
|
+
channel: "discord",
|
|
4113
|
+
accountId: resolveChannelAccountId(params),
|
|
4114
|
+
conversationId,
|
|
4115
|
+
placement: currentThreadId ? "current" : "child",
|
|
4116
|
+
labelNoun: "thread"
|
|
4117
|
+
};
|
|
4118
|
+
}
|
|
4119
|
+
if (isTelegramSurface(params)) {
|
|
4120
|
+
const conversationId = resolveTelegramConversationId(params);
|
|
4121
|
+
if (!conversationId) return null;
|
|
4122
|
+
return {
|
|
4123
|
+
channel: "telegram",
|
|
4124
|
+
accountId: resolveChannelAccountId(params),
|
|
4125
|
+
conversationId,
|
|
4126
|
+
placement: "current",
|
|
4127
|
+
labelNoun: "conversation"
|
|
4128
|
+
};
|
|
4129
|
+
}
|
|
4130
|
+
if (isMatrixSurface(params)) {
|
|
4131
|
+
const conversationId = resolveMatrixConversationId({
|
|
4132
|
+
ctx: {
|
|
4133
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
4134
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
4135
|
+
To: params.ctx.To
|
|
4136
|
+
},
|
|
4137
|
+
command: { to: params.command.to }
|
|
4138
|
+
});
|
|
4139
|
+
if (!conversationId) return null;
|
|
4140
|
+
const parentConversationId = resolveMatrixParentConversationId({
|
|
4141
|
+
ctx: {
|
|
4142
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
4143
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
4144
|
+
To: params.ctx.To
|
|
4145
|
+
},
|
|
4146
|
+
command: { to: params.command.to }
|
|
4147
|
+
});
|
|
4148
|
+
const currentThreadId = params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId).trim() : "";
|
|
4149
|
+
return {
|
|
4150
|
+
channel: "matrix",
|
|
4151
|
+
accountId: resolveChannelAccountId(params),
|
|
4152
|
+
conversationId,
|
|
4153
|
+
...parentConversationId ? { parentConversationId } : {},
|
|
4154
|
+
placement: currentThreadId ? "current" : "child",
|
|
4155
|
+
labelNoun: "thread"
|
|
4156
|
+
};
|
|
4157
|
+
}
|
|
4158
|
+
return null;
|
|
4159
|
+
}
|
|
4160
|
+
async function handleSubagentsFocusAction(ctx) {
|
|
4161
|
+
const { params, runs, restTokens } = ctx;
|
|
4162
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
4163
|
+
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("⚠️ /focus is only available on Discord, Matrix, and Telegram.");
|
|
4164
|
+
const token = restTokens.join(" ").trim();
|
|
4165
|
+
if (!token) return stopWithText("Usage: /focus <subagent-label|session-key|session-id|session-label>");
|
|
4166
|
+
const accountId = resolveChannelAccountId(params);
|
|
4167
|
+
const bindingService = getSessionBindingService();
|
|
4168
|
+
const capabilities = bindingService.getCapabilities({
|
|
4169
|
+
channel,
|
|
4170
|
+
accountId
|
|
4171
|
+
});
|
|
4172
|
+
if (!capabilities.adapterAvailable || !capabilities.bindSupported) return stopWithText(`⚠️ ${channel === "discord" ? "Discord thread" : channel === "matrix" ? "Matrix thread" : "Telegram conversation"} bindings are unavailable for this account.`);
|
|
4173
|
+
const focusTarget = await resolveFocusTargetSession({
|
|
4174
|
+
runs,
|
|
4175
|
+
token
|
|
4176
|
+
});
|
|
4177
|
+
if (!focusTarget) return stopWithText(`⚠️ Unable to resolve focus target: ${token}`);
|
|
4178
|
+
const bindingContext = resolveFocusBindingContext(params);
|
|
4179
|
+
if (!bindingContext) {
|
|
4180
|
+
if (channel === "telegram") return stopWithText("⚠️ /focus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
4181
|
+
if (channel === "matrix") return stopWithText("⚠️ Could not resolve a Matrix room for /focus.");
|
|
4182
|
+
return stopWithText("⚠️ Could not resolve a Discord channel for /focus.");
|
|
4183
|
+
}
|
|
4184
|
+
if (channel === "matrix") {
|
|
4185
|
+
const spawnPolicy = resolveThreadBindingSpawnPolicy({
|
|
4186
|
+
cfg: params.cfg,
|
|
4187
|
+
channel,
|
|
4188
|
+
accountId: bindingContext.accountId,
|
|
4189
|
+
kind: "subagent"
|
|
4190
|
+
});
|
|
4191
|
+
if (!spawnPolicy.enabled) return stopWithText(`⚠️ ${formatThreadBindingDisabledError({
|
|
4192
|
+
channel: spawnPolicy.channel,
|
|
4193
|
+
accountId: spawnPolicy.accountId,
|
|
4194
|
+
kind: "subagent"
|
|
4195
|
+
})}`);
|
|
4196
|
+
if (bindingContext.placement === "child" && !spawnPolicy.spawnEnabled) return stopWithText(`⚠️ ${formatThreadBindingSpawnDisabledError({
|
|
4197
|
+
channel: spawnPolicy.channel,
|
|
4198
|
+
accountId: spawnPolicy.accountId,
|
|
4199
|
+
kind: "subagent"
|
|
4200
|
+
})}`);
|
|
4201
|
+
}
|
|
4202
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
4203
|
+
const existingBinding = bindingService.resolveByConversation({
|
|
4204
|
+
channel: bindingContext.channel,
|
|
4205
|
+
accountId: bindingContext.accountId,
|
|
4206
|
+
conversationId: bindingContext.conversationId,
|
|
4207
|
+
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
4208
|
+
});
|
|
4209
|
+
const boundBy = typeof existingBinding?.metadata?.boundBy === "string" ? existingBinding.metadata.boundBy.trim() : "";
|
|
4210
|
+
if (existingBinding && boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return stopWithText(`⚠️ Only ${boundBy} can refocus this ${bindingContext.labelNoun}.`);
|
|
4211
|
+
const label = focusTarget.label || token;
|
|
4212
|
+
const acpMeta = focusTarget.targetKind === "acp" ? readAcpSessionEntry({
|
|
4213
|
+
cfg: params.cfg,
|
|
4214
|
+
sessionKey: focusTarget.targetSessionKey
|
|
4215
|
+
})?.acp : void 0;
|
|
4216
|
+
if (!capabilities.placements.includes(bindingContext.placement)) return stopWithText(`⚠️ ${channel} bindings are unavailable for this account.`);
|
|
4217
|
+
let binding;
|
|
4218
|
+
try {
|
|
4219
|
+
binding = await bindingService.bind({
|
|
4220
|
+
targetSessionKey: focusTarget.targetSessionKey,
|
|
4221
|
+
targetKind: focusTarget.targetKind === "acp" ? "session" : "subagent",
|
|
4222
|
+
conversation: {
|
|
4223
|
+
channel: bindingContext.channel,
|
|
4224
|
+
accountId: bindingContext.accountId,
|
|
4225
|
+
conversationId: bindingContext.conversationId,
|
|
4226
|
+
...bindingContext.parentConversationId && bindingContext.parentConversationId !== bindingContext.conversationId ? { parentConversationId: bindingContext.parentConversationId } : {}
|
|
4227
|
+
},
|
|
4228
|
+
placement: bindingContext.placement,
|
|
4229
|
+
metadata: {
|
|
4230
|
+
threadName: resolveThreadBindingThreadName({
|
|
4231
|
+
agentId: focusTarget.agentId,
|
|
4232
|
+
label
|
|
4233
|
+
}),
|
|
4234
|
+
agentId: focusTarget.agentId,
|
|
4235
|
+
label,
|
|
4236
|
+
boundBy: senderId || "unknown",
|
|
4237
|
+
introText: resolveThreadBindingIntroText({
|
|
4238
|
+
agentId: focusTarget.agentId,
|
|
4239
|
+
label,
|
|
4240
|
+
idleTimeoutMs: resolveThreadBindingIdleTimeoutMsForChannel({
|
|
4241
|
+
cfg: params.cfg,
|
|
4242
|
+
channel: bindingContext.channel,
|
|
4243
|
+
accountId
|
|
4244
|
+
}),
|
|
4245
|
+
maxAgeMs: resolveThreadBindingMaxAgeMsForChannel({
|
|
4246
|
+
cfg: params.cfg,
|
|
4247
|
+
channel: bindingContext.channel,
|
|
4248
|
+
accountId
|
|
4249
|
+
}),
|
|
4250
|
+
sessionCwd: focusTarget.targetKind === "acp" ? resolveAcpSessionCwd(acpMeta) : void 0,
|
|
4251
|
+
sessionDetails: focusTarget.targetKind === "acp" ? resolveAcpThreadSessionDetailLines({
|
|
4252
|
+
sessionKey: focusTarget.targetSessionKey,
|
|
4253
|
+
meta: acpMeta
|
|
4254
|
+
}) : []
|
|
4255
|
+
})
|
|
4256
|
+
}
|
|
4257
|
+
});
|
|
4258
|
+
} catch {
|
|
4259
|
+
return stopWithText(`⚠️ Failed to bind this ${bindingContext.labelNoun} to the target session.`);
|
|
4260
|
+
}
|
|
4261
|
+
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}).`);
|
|
4262
|
+
}
|
|
4263
|
+
//#endregion
|
|
4264
|
+
//#region src/auto-reply/reply/commands-subagents/action-help.ts
|
|
4265
|
+
function handleSubagentsHelpAction() {
|
|
4266
|
+
return stopWithText(buildSubagentsHelp());
|
|
4267
|
+
}
|
|
4268
|
+
//#endregion
|
|
4269
|
+
//#region src/auto-reply/reply/commands-subagents/action-info.ts
|
|
4270
|
+
function handleSubagentsInfoAction(ctx) {
|
|
4271
|
+
const { params, runs, restTokens } = ctx;
|
|
4272
|
+
const target = restTokens[0];
|
|
4273
|
+
if (!target) return stopWithText("ℹ️ Usage: /subagents info <id|#>");
|
|
4274
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
4275
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
4276
|
+
const run = targetResolution.entry;
|
|
4277
|
+
const { entry: sessionEntry } = loadSubagentSessionEntry(params, run.childSessionKey, {
|
|
4278
|
+
loadSessionStore,
|
|
4279
|
+
resolveStorePath
|
|
4280
|
+
});
|
|
4281
|
+
const runtime = run.startedAt && Number.isFinite(run.startedAt) ? formatDurationCompact((run.endedAt ?? Date.now()) - run.startedAt) ?? "n/a" : "n/a";
|
|
4282
|
+
const outcome = run.outcome ? `${run.outcome.status}${run.outcome.error ? ` (${run.outcome.error})` : ""}` : "n/a";
|
|
4283
|
+
return stopWithText([
|
|
4284
|
+
"ℹ️ Subagent info",
|
|
4285
|
+
`Status: ${resolveDisplayStatus(run, { pendingDescendants: countPendingDescendantRuns(run.childSessionKey) })}`,
|
|
4286
|
+
`Label: ${formatRunLabel(run)}`,
|
|
4287
|
+
`Task: ${run.task}`,
|
|
4288
|
+
`Run: ${run.runId}`,
|
|
4289
|
+
`Session: ${run.childSessionKey}`,
|
|
4290
|
+
`SessionId: ${sessionEntry?.sessionId ?? "n/a"}`,
|
|
4291
|
+
`Transcript: ${sessionEntry?.sessionFile ?? "n/a"}`,
|
|
4292
|
+
`Runtime: ${runtime}`,
|
|
4293
|
+
`Created: ${formatTimestampWithAge(run.createdAt)}`,
|
|
4294
|
+
`Started: ${formatTimestampWithAge(run.startedAt)}`,
|
|
4295
|
+
`Ended: ${formatTimestampWithAge(run.endedAt)}`,
|
|
4296
|
+
`Cleanup: ${run.cleanup}`,
|
|
4297
|
+
run.archiveAtMs ? `Archive: ${formatTimestampWithAge(run.archiveAtMs)}` : void 0,
|
|
4298
|
+
run.cleanupHandled ? "Cleanup handled: yes" : void 0,
|
|
4299
|
+
`Outcome: ${outcome}`
|
|
4300
|
+
].filter(Boolean).join("\n"));
|
|
4301
|
+
}
|
|
4302
|
+
//#endregion
|
|
4303
|
+
//#region src/auto-reply/reply/commands-subagents/action-kill.ts
|
|
4304
|
+
async function handleSubagentsKillAction(ctx) {
|
|
4305
|
+
const { params, handledPrefix, requesterKey, runs, restTokens } = ctx;
|
|
4306
|
+
const target = restTokens[0];
|
|
4307
|
+
if (!target) return stopWithText(handledPrefix === "/subagents" ? "Usage: /subagents kill <id|#|all>" : "Usage: /kill <id|#|all>");
|
|
4308
|
+
if (target === "all" || target === "*") {
|
|
4309
|
+
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
4310
|
+
const result = await killAllControlledSubagentRuns({
|
|
4311
|
+
cfg: params.cfg,
|
|
4312
|
+
controller,
|
|
4313
|
+
runs
|
|
4314
|
+
});
|
|
4315
|
+
if (result.status === "forbidden") return stopWithText(`⚠️ ${result.error}`);
|
|
4316
|
+
if (result.killed > 0) return { shouldContinue: false };
|
|
4317
|
+
return { shouldContinue: false };
|
|
4318
|
+
}
|
|
4319
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
4320
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
4321
|
+
if (targetResolution.entry.endedAt) return stopWithText(`${formatRunLabel(targetResolution.entry)} is already finished.`);
|
|
4322
|
+
const controller = resolveCommandSubagentController(params, requesterKey);
|
|
4323
|
+
const result = await killControlledSubagentRun({
|
|
4324
|
+
cfg: params.cfg,
|
|
4325
|
+
controller,
|
|
4326
|
+
entry: targetResolution.entry
|
|
4327
|
+
});
|
|
4328
|
+
if (result.status === "forbidden") return stopWithText(`⚠️ ${result.error}`);
|
|
4329
|
+
if (result.status === "done") return stopWithText(result.text);
|
|
4330
|
+
return { shouldContinue: false };
|
|
4331
|
+
}
|
|
4332
|
+
//#endregion
|
|
4333
|
+
//#region src/auto-reply/reply/commands-subagents/action-list.ts
|
|
4334
|
+
function handleSubagentsListAction(ctx) {
|
|
4335
|
+
const { params, runs } = ctx;
|
|
4336
|
+
const list = buildSubagentList({
|
|
4337
|
+
cfg: params.cfg,
|
|
4338
|
+
runs,
|
|
4339
|
+
recentMinutes: 30,
|
|
4340
|
+
taskMaxChars: 110
|
|
4341
|
+
});
|
|
4342
|
+
const lines = ["active subagents:", "-----"];
|
|
4343
|
+
if (list.active.length === 0) lines.push("(none)");
|
|
4344
|
+
else lines.push(list.active.map((entry) => entry.line).join("\n"));
|
|
4345
|
+
lines.push("", `recent subagents (last 30m):`, "-----");
|
|
4346
|
+
if (list.recent.length === 0) lines.push("(none)");
|
|
4347
|
+
else lines.push(list.recent.map((entry) => entry.line).join("\n"));
|
|
4348
|
+
return stopWithText(lines.join("\n"));
|
|
4349
|
+
}
|
|
4350
|
+
//#endregion
|
|
4351
|
+
//#region src/auto-reply/reply/commands-subagents/action-log.ts
|
|
4352
|
+
async function handleSubagentsLogAction(ctx) {
|
|
4353
|
+
const { runs, restTokens } = ctx;
|
|
4354
|
+
const target = restTokens[0];
|
|
4355
|
+
if (!target) return stopWithText("📜 Usage: /subagents log <id|#> [limit]");
|
|
4356
|
+
const includeTools = restTokens.some((token) => token.toLowerCase() === "tools");
|
|
4357
|
+
const limitToken = restTokens.find((token) => /^\d+$/.test(token));
|
|
4358
|
+
const limit = limitToken ? Math.min(200, Math.max(1, Number.parseInt(limitToken, 10))) : 20;
|
|
4359
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
4360
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
4361
|
+
const history = await callGateway({
|
|
4362
|
+
method: "chat.history",
|
|
4363
|
+
params: {
|
|
4364
|
+
sessionKey: targetResolution.entry.childSessionKey,
|
|
4365
|
+
limit
|
|
4366
|
+
}
|
|
4367
|
+
});
|
|
4368
|
+
const rawMessages = Array.isArray(history?.messages) ? history.messages : [];
|
|
4369
|
+
const lines = formatLogLines(includeTools ? rawMessages : stripToolMessages(rawMessages));
|
|
4370
|
+
const header = `📜 Subagent log: ${formatRunLabel(targetResolution.entry)}`;
|
|
4371
|
+
if (lines.length === 0) return stopWithText(`${header}\n(no messages)`);
|
|
4372
|
+
return stopWithText([header, ...lines].join("\n"));
|
|
4373
|
+
}
|
|
4374
|
+
//#endregion
|
|
4375
|
+
//#region src/auto-reply/reply/commands-subagents/action-send.ts
|
|
4376
|
+
async function handleSubagentsSendAction(ctx, steerRequested) {
|
|
4377
|
+
const { params, handledPrefix, runs, restTokens } = ctx;
|
|
4378
|
+
const target = restTokens[0];
|
|
4379
|
+
const message = restTokens.slice(1).join(" ").trim();
|
|
4380
|
+
if (!target || !message) return stopWithText(steerRequested ? handledPrefix === "/subagents" ? "Usage: /subagents steer <id|#> <message>" : `Usage: ${handledPrefix} <id|#> <message>` : "Usage: /subagents send <id|#> <message>");
|
|
4381
|
+
const targetResolution = resolveSubagentEntryForToken(runs, target);
|
|
4382
|
+
if ("reply" in targetResolution) return targetResolution.reply;
|
|
4383
|
+
if (steerRequested && targetResolution.entry.endedAt) return stopWithText(`${formatRunLabel(targetResolution.entry)} is already finished.`);
|
|
4384
|
+
const controller = resolveCommandSubagentController(params, ctx.requesterKey);
|
|
4385
|
+
if (steerRequested) {
|
|
4386
|
+
const result = await steerControlledSubagentRun({
|
|
4387
|
+
cfg: params.cfg,
|
|
4388
|
+
controller,
|
|
4389
|
+
entry: targetResolution.entry,
|
|
4390
|
+
message
|
|
4391
|
+
});
|
|
4392
|
+
if (result.status === "accepted") return stopWithText(`steered ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
4393
|
+
if (result.status === "done" && result.text) return stopWithText(result.text);
|
|
4394
|
+
if (result.status === "error") return stopWithText(`send failed: ${result.error ?? "error"}`);
|
|
4395
|
+
return stopWithText(`⚠️ ${result.error ?? "send failed"}`);
|
|
4396
|
+
}
|
|
4397
|
+
const result = await sendControlledSubagentMessage({
|
|
4398
|
+
cfg: params.cfg,
|
|
4399
|
+
controller,
|
|
4400
|
+
entry: targetResolution.entry,
|
|
4401
|
+
message
|
|
4402
|
+
});
|
|
4403
|
+
if (result.status === "timeout") return stopWithText(`⏳ Subagent still running (run ${result.runId.slice(0, 8)}).`);
|
|
4404
|
+
if (result.status === "error") return stopWithText(`⚠️ Subagent error: ${result.error} (run ${result.runId.slice(0, 8)}).`);
|
|
4405
|
+
if (result.status === "forbidden") return stopWithText(`⚠️ ${result.error ?? "send failed"}`);
|
|
4406
|
+
return stopWithText(result.replyText ?? `✅ Sent to ${formatRunLabel(targetResolution.entry)} (run ${result.runId.slice(0, 8)}).`);
|
|
4407
|
+
}
|
|
4408
|
+
//#endregion
|
|
4409
|
+
//#region src/auto-reply/reply/commands-subagents/action-spawn.ts
|
|
4410
|
+
async function handleSubagentsSpawnAction(ctx) {
|
|
4411
|
+
const { params, requesterKey, restTokens } = ctx;
|
|
4412
|
+
const agentId = restTokens[0];
|
|
4413
|
+
const taskParts = [];
|
|
4414
|
+
let model;
|
|
4415
|
+
let thinking;
|
|
4416
|
+
for (let i = 1; i < restTokens.length; i++) if (restTokens[i] === "--model" && i + 1 < restTokens.length) {
|
|
4417
|
+
i += 1;
|
|
4418
|
+
model = restTokens[i];
|
|
4419
|
+
} else if (restTokens[i] === "--thinking" && i + 1 < restTokens.length) {
|
|
4420
|
+
i += 1;
|
|
4421
|
+
thinking = restTokens[i];
|
|
4422
|
+
} else taskParts.push(restTokens[i]);
|
|
4423
|
+
const task = taskParts.join(" ").trim();
|
|
4424
|
+
if (!agentId || !task) return stopWithText("Usage: /subagents spawn <agentId> <task> [--model <model>] [--thinking <level>]");
|
|
4425
|
+
const commandTo = typeof params.command.to === "string" ? params.command.to.trim() : "";
|
|
4426
|
+
const originatingTo = typeof params.ctx.OriginatingTo === "string" ? params.ctx.OriginatingTo.trim() : "";
|
|
4427
|
+
const fallbackTo = typeof params.ctx.To === "string" ? params.ctx.To.trim() : "";
|
|
4428
|
+
const normalizedTo = originatingTo || commandTo || fallbackTo || void 0;
|
|
4429
|
+
const result = await spawnSubagentDirect({
|
|
4430
|
+
task,
|
|
4431
|
+
agentId,
|
|
4432
|
+
model,
|
|
4433
|
+
thinking,
|
|
4434
|
+
mode: "run",
|
|
4435
|
+
cleanup: "keep",
|
|
4436
|
+
expectsCompletionMessage: true
|
|
4437
|
+
}, {
|
|
4438
|
+
agentSessionKey: requesterKey,
|
|
4439
|
+
agentChannel: params.ctx.OriginatingChannel ?? params.command.channel,
|
|
4440
|
+
agentAccountId: params.ctx.AccountId,
|
|
4441
|
+
agentTo: normalizedTo,
|
|
4442
|
+
agentThreadId: params.ctx.MessageThreadId,
|
|
4443
|
+
agentGroupId: params.sessionEntry?.groupId ?? null,
|
|
4444
|
+
agentGroupChannel: params.sessionEntry?.groupChannel ?? null,
|
|
4445
|
+
agentGroupSpace: params.sessionEntry?.space ?? null
|
|
4446
|
+
});
|
|
4447
|
+
if (result.status === "accepted") return stopWithText(`Spawned subagent ${agentId} (session ${result.childSessionKey}, run ${result.runId?.slice(0, 8)}).`);
|
|
4448
|
+
return stopWithText(`Spawn failed: ${result.error ?? result.status}`);
|
|
4449
|
+
}
|
|
4450
|
+
//#endregion
|
|
4451
|
+
//#region src/auto-reply/reply/commands-subagents/action-unfocus.ts
|
|
4452
|
+
async function handleSubagentsUnfocusAction(ctx) {
|
|
4453
|
+
const { params } = ctx;
|
|
4454
|
+
const channel = resolveCommandSurfaceChannel(params);
|
|
4455
|
+
if (channel !== "discord" && channel !== "matrix" && channel !== "telegram") return stopWithText("⚠️ /unfocus is only available on Discord, Matrix, and Telegram.");
|
|
4456
|
+
const accountId = resolveChannelAccountId(params);
|
|
4457
|
+
const bindingService = getSessionBindingService();
|
|
4458
|
+
const conversationId = (() => {
|
|
4459
|
+
if (isDiscordSurface(params)) return (params.ctx.MessageThreadId != null ? String(params.ctx.MessageThreadId) : "").trim() || void 0;
|
|
4460
|
+
if (isTelegramSurface(params)) return resolveTelegramConversationId(params);
|
|
4461
|
+
if (isMatrixSurface(params)) return resolveMatrixConversationId({
|
|
4462
|
+
ctx: {
|
|
4463
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
4464
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
4465
|
+
To: params.ctx.To
|
|
4466
|
+
},
|
|
4467
|
+
command: { to: params.command.to }
|
|
4468
|
+
});
|
|
4469
|
+
})();
|
|
4470
|
+
const parentConversationId = (() => {
|
|
4471
|
+
if (!isMatrixSurface(params)) return;
|
|
4472
|
+
return resolveMatrixParentConversationId({
|
|
4473
|
+
ctx: {
|
|
4474
|
+
MessageThreadId: params.ctx.MessageThreadId,
|
|
4475
|
+
OriginatingTo: params.ctx.OriginatingTo,
|
|
4476
|
+
To: params.ctx.To
|
|
4477
|
+
},
|
|
4478
|
+
command: { to: params.command.to }
|
|
4479
|
+
});
|
|
4480
|
+
})();
|
|
4481
|
+
if (!conversationId) {
|
|
4482
|
+
if (channel === "discord") return stopWithText("⚠️ /unfocus must be run inside a Discord thread.");
|
|
4483
|
+
if (channel === "matrix") return stopWithText("⚠️ /unfocus must be run inside a Matrix thread.");
|
|
4484
|
+
return stopWithText("⚠️ /unfocus on Telegram requires a topic context in groups, or a direct-message conversation.");
|
|
4485
|
+
}
|
|
4486
|
+
const binding = bindingService.resolveByConversation({
|
|
4487
|
+
channel,
|
|
4488
|
+
accountId,
|
|
4489
|
+
conversationId,
|
|
4490
|
+
...parentConversationId && parentConversationId !== conversationId ? { parentConversationId } : {}
|
|
4491
|
+
});
|
|
4492
|
+
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.");
|
|
4493
|
+
const senderId = params.command.senderId?.trim() || "";
|
|
4494
|
+
const boundBy = typeof binding.metadata?.boundBy === "string" ? binding.metadata.boundBy.trim() : "";
|
|
4495
|
+
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.`);
|
|
4496
|
+
await bindingService.unbind({
|
|
4497
|
+
bindingId: binding.bindingId,
|
|
4498
|
+
reason: "manual"
|
|
4499
|
+
});
|
|
4500
|
+
return stopWithText(channel === "discord" || channel === "matrix" ? "✅ Thread unfocused." : "✅ Conversation unfocused.");
|
|
4501
|
+
}
|
|
4502
|
+
//#endregion
|
|
4503
|
+
//#region src/auto-reply/reply/commands-subagents.ts
|
|
4504
|
+
const handleSubagentsCommand = async (params, allowTextCommands) => {
|
|
4505
|
+
if (!allowTextCommands) return null;
|
|
4506
|
+
const normalized = params.command.commandBodyNormalized;
|
|
4507
|
+
const handledPrefix = resolveHandledPrefix(normalized);
|
|
4508
|
+
if (!handledPrefix) return null;
|
|
4509
|
+
if (!params.command.isAuthorizedSender) {
|
|
4510
|
+
logVerbose(`Ignoring ${handledPrefix} from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
4511
|
+
return { shouldContinue: false };
|
|
4512
|
+
}
|
|
4513
|
+
const restTokens = normalized.slice(handledPrefix.length).trim().split(/\s+/).filter(Boolean);
|
|
4514
|
+
const action = resolveSubagentsAction({
|
|
4515
|
+
handledPrefix,
|
|
4516
|
+
restTokens
|
|
4517
|
+
});
|
|
4518
|
+
if (!action) return handleSubagentsHelpAction();
|
|
4519
|
+
const requesterKey = action === "spawn" ? resolveRequesterSessionKey(params, { preferCommandTarget: true }) : resolveRequesterSessionKey(params);
|
|
4520
|
+
if (!requesterKey) return stopWithText("⚠️ Missing session key.");
|
|
4521
|
+
const ctx = {
|
|
4522
|
+
params,
|
|
4523
|
+
handledPrefix,
|
|
4524
|
+
requesterKey,
|
|
4525
|
+
runs: listSubagentRunsForController(requesterKey),
|
|
4526
|
+
restTokens
|
|
4527
|
+
};
|
|
4528
|
+
switch (action) {
|
|
4529
|
+
case "help": return handleSubagentsHelpAction();
|
|
4530
|
+
case "agents": return handleSubagentsAgentsAction(ctx);
|
|
4531
|
+
case "focus": return await handleSubagentsFocusAction(ctx);
|
|
4532
|
+
case "unfocus": return await handleSubagentsUnfocusAction(ctx);
|
|
4533
|
+
case "list": return handleSubagentsListAction(ctx);
|
|
4534
|
+
case "kill": return await handleSubagentsKillAction(ctx);
|
|
4535
|
+
case "info": return handleSubagentsInfoAction(ctx);
|
|
4536
|
+
case "log": return await handleSubagentsLogAction(ctx);
|
|
4537
|
+
case "send": return await handleSubagentsSendAction(ctx, false);
|
|
4538
|
+
case "steer": return await handleSubagentsSendAction(ctx, true);
|
|
4539
|
+
case "spawn": return await handleSubagentsSpawnAction(ctx);
|
|
4540
|
+
default: return handleSubagentsHelpAction();
|
|
4541
|
+
}
|
|
4542
|
+
};
|
|
4543
|
+
//#endregion
|
|
4544
|
+
//#region src/auto-reply/reply/commands-tts.ts
|
|
4545
|
+
function parseTtsCommand(normalized) {
|
|
4546
|
+
if (normalized === "/tts") return {
|
|
4547
|
+
action: "status",
|
|
4548
|
+
args: ""
|
|
4549
|
+
};
|
|
4550
|
+
if (!normalized.startsWith("/tts ")) return null;
|
|
4551
|
+
const rest = normalized.slice(5).trim();
|
|
4552
|
+
if (!rest) return {
|
|
4553
|
+
action: "status",
|
|
4554
|
+
args: ""
|
|
4555
|
+
};
|
|
4556
|
+
const [action, ...tail] = rest.split(/\s+/);
|
|
4557
|
+
return {
|
|
4558
|
+
action: action.toLowerCase(),
|
|
4559
|
+
args: tail.join(" ").trim()
|
|
4560
|
+
};
|
|
4561
|
+
}
|
|
4562
|
+
function ttsUsage() {
|
|
4563
|
+
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:**\n• microsoft — Microsoft Edge-backed speech (default fallback)\n• openai — High quality (requires API key)\n• elevenlabs — Premium voices (requires API key)\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 microsoft\n/tts limit 2000\n/tts audio Hello, this is a test!" };
|
|
4564
|
+
}
|
|
4565
|
+
const handleTtsCommands = async (params, allowTextCommands) => {
|
|
4566
|
+
if (!allowTextCommands) return null;
|
|
4567
|
+
const parsed = parseTtsCommand(params.command.commandBodyNormalized);
|
|
4568
|
+
if (!parsed) return null;
|
|
4569
|
+
if (!params.command.isAuthorizedSender) {
|
|
4570
|
+
logVerbose(`Ignoring TTS command from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
4571
|
+
return { shouldContinue: false };
|
|
4572
|
+
}
|
|
4573
|
+
const config = resolveTtsConfig(params.cfg);
|
|
4574
|
+
const prefsPath = resolveTtsPrefsPath(config);
|
|
4575
|
+
const action = parsed.action;
|
|
4576
|
+
const args = parsed.args;
|
|
4577
|
+
if (action === "help") return {
|
|
4578
|
+
shouldContinue: false,
|
|
4579
|
+
reply: ttsUsage()
|
|
4580
|
+
};
|
|
4581
|
+
if (action === "on") {
|
|
4582
|
+
setTtsEnabled(prefsPath, true);
|
|
4583
|
+
return {
|
|
4584
|
+
shouldContinue: false,
|
|
4585
|
+
reply: { text: "🔊 TTS enabled." }
|
|
4586
|
+
};
|
|
4587
|
+
}
|
|
4588
|
+
if (action === "off") {
|
|
4589
|
+
setTtsEnabled(prefsPath, false);
|
|
4590
|
+
return {
|
|
4591
|
+
shouldContinue: false,
|
|
4592
|
+
reply: { text: "🔇 TTS disabled." }
|
|
4593
|
+
};
|
|
4594
|
+
}
|
|
4595
|
+
if (action === "audio") {
|
|
4596
|
+
if (!args.trim()) return {
|
|
4597
|
+
shouldContinue: false,
|
|
4598
|
+
reply: { text: "🎤 Generate audio from text.\n\nUsage: /tts audio <text>\nExample: /tts audio Hello, this is a test!" }
|
|
4599
|
+
};
|
|
4600
|
+
const start = Date.now();
|
|
4601
|
+
const result = await textToSpeech({
|
|
4602
|
+
text: args,
|
|
4603
|
+
cfg: params.cfg,
|
|
4604
|
+
channel: params.command.channel,
|
|
4605
|
+
prefsPath
|
|
4606
|
+
});
|
|
4607
|
+
if (result.success && result.audioPath) {
|
|
4608
|
+
setLastTtsAttempt({
|
|
4609
|
+
timestamp: Date.now(),
|
|
4610
|
+
success: true,
|
|
4611
|
+
textLength: args.length,
|
|
4612
|
+
summarized: false,
|
|
4613
|
+
provider: result.provider,
|
|
4614
|
+
latencyMs: result.latencyMs
|
|
4615
|
+
});
|
|
4616
|
+
return {
|
|
4617
|
+
shouldContinue: false,
|
|
4618
|
+
reply: {
|
|
4619
|
+
mediaUrl: result.audioPath,
|
|
4620
|
+
audioAsVoice: result.voiceCompatible === true
|
|
4621
|
+
}
|
|
4622
|
+
};
|
|
4623
|
+
}
|
|
4624
|
+
setLastTtsAttempt({
|
|
4625
|
+
timestamp: Date.now(),
|
|
4626
|
+
success: false,
|
|
4627
|
+
textLength: args.length,
|
|
4628
|
+
summarized: false,
|
|
4629
|
+
error: result.error,
|
|
4630
|
+
latencyMs: Date.now() - start
|
|
4631
|
+
});
|
|
4632
|
+
return {
|
|
4633
|
+
shouldContinue: false,
|
|
4634
|
+
reply: { text: `❌ Error generating audio: ${result.error ?? "unknown error"}` }
|
|
4635
|
+
};
|
|
4636
|
+
}
|
|
4637
|
+
if (action === "provider") {
|
|
4638
|
+
const currentProvider = getTtsProvider(config, prefsPath);
|
|
4639
|
+
if (!args.trim()) {
|
|
4640
|
+
const hasOpenAI = Boolean(resolveTtsApiKey(config, "openai"));
|
|
4641
|
+
const hasElevenLabs = Boolean(resolveTtsApiKey(config, "elevenlabs"));
|
|
4642
|
+
const hasMicrosoft = isTtsProviderConfigured(config, "microsoft", params.cfg);
|
|
4643
|
+
return {
|
|
4644
|
+
shouldContinue: false,
|
|
4645
|
+
reply: { text: `🎙️ TTS provider\nPrimary: ${currentProvider}\nOpenAI key: ${hasOpenAI ? "✅" : "❌"}\nElevenLabs key: ${hasElevenLabs ? "✅" : "❌"}\nMicrosoft enabled: ${hasMicrosoft ? "✅" : "❌"}\nUsage: /tts provider openai | elevenlabs | microsoft` }
|
|
4646
|
+
};
|
|
4647
|
+
}
|
|
4648
|
+
const requested = args.trim().toLowerCase();
|
|
4649
|
+
const knownProviders = new Set(listSpeechProviders(params.cfg).map((provider) => provider.id));
|
|
4650
|
+
if (requested !== "edge" && !knownProviders.has(requested)) return {
|
|
4651
|
+
shouldContinue: false,
|
|
4652
|
+
reply: ttsUsage()
|
|
4653
|
+
};
|
|
4654
|
+
const nextProvider = normalizeSpeechProviderId(requested) ?? requested;
|
|
4655
|
+
setTtsProvider(prefsPath, requested);
|
|
4656
|
+
return {
|
|
4657
|
+
shouldContinue: false,
|
|
4658
|
+
reply: { text: `✅ TTS provider set to ${nextProvider}.` }
|
|
4659
|
+
};
|
|
4660
|
+
}
|
|
4661
|
+
if (action === "limit") {
|
|
4662
|
+
if (!args.trim()) return {
|
|
4663
|
+
shouldContinue: false,
|
|
4664
|
+
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` }
|
|
4665
|
+
};
|
|
4666
|
+
const next = Number.parseInt(args.trim(), 10);
|
|
4667
|
+
if (!Number.isFinite(next) || next < 100 || next > 4096) return {
|
|
4668
|
+
shouldContinue: false,
|
|
4669
|
+
reply: { text: "❌ Limit must be between 100 and 4096 characters." }
|
|
4670
|
+
};
|
|
4671
|
+
setTtsMaxLength(prefsPath, next);
|
|
4672
|
+
return {
|
|
4673
|
+
shouldContinue: false,
|
|
4674
|
+
reply: { text: `✅ TTS limit set to ${next} characters.` }
|
|
4675
|
+
};
|
|
4676
|
+
}
|
|
4677
|
+
if (action === "summary") {
|
|
4678
|
+
if (!args.trim()) {
|
|
4679
|
+
const enabled = isSummarizationEnabled(prefsPath);
|
|
4680
|
+
const maxLen = getTtsMaxLength(prefsPath);
|
|
4681
|
+
return {
|
|
4682
|
+
shouldContinue: false,
|
|
4683
|
+
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` }
|
|
4684
|
+
};
|
|
4685
|
+
}
|
|
4686
|
+
const requested = args.trim().toLowerCase();
|
|
4687
|
+
if (requested !== "on" && requested !== "off") return {
|
|
4688
|
+
shouldContinue: false,
|
|
4689
|
+
reply: ttsUsage()
|
|
4690
|
+
};
|
|
4691
|
+
setSummarizationEnabled(prefsPath, requested === "on");
|
|
4692
|
+
return {
|
|
4693
|
+
shouldContinue: false,
|
|
4694
|
+
reply: { text: requested === "on" ? "✅ TTS auto-summary enabled." : "❌ TTS auto-summary disabled." }
|
|
4695
|
+
};
|
|
4696
|
+
}
|
|
4697
|
+
if (action === "status") {
|
|
4698
|
+
const enabled = isTtsEnabled(config, prefsPath);
|
|
4699
|
+
const provider = getTtsProvider(config, prefsPath);
|
|
4700
|
+
const hasKey = isTtsProviderConfigured(config, provider, params.cfg);
|
|
4701
|
+
const maxLength = getTtsMaxLength(prefsPath);
|
|
4702
|
+
const summarize = isSummarizationEnabled(prefsPath);
|
|
4703
|
+
const last = getLastTtsAttempt();
|
|
4704
|
+
const lines = [
|
|
4705
|
+
"📊 TTS status",
|
|
4706
|
+
`State: ${enabled ? "✅ enabled" : "❌ disabled"}`,
|
|
4707
|
+
`Provider: ${provider} (${hasKey ? "✅ configured" : "❌ not configured"})`,
|
|
4708
|
+
`Text limit: ${maxLength} chars`,
|
|
4709
|
+
`Auto-summary: ${summarize ? "on" : "off"}`
|
|
4710
|
+
];
|
|
4711
|
+
if (last) {
|
|
4712
|
+
const timeAgo = Math.round((Date.now() - last.timestamp) / 1e3);
|
|
4713
|
+
lines.push("");
|
|
4714
|
+
lines.push(`Last attempt (${timeAgo}s ago): ${last.success ? "✅" : "❌"}`);
|
|
4715
|
+
lines.push(`Text: ${last.textLength} chars${last.summarized ? " (summarized)" : ""}`);
|
|
4716
|
+
if (last.success) {
|
|
4717
|
+
lines.push(`Provider: ${last.provider ?? "unknown"}`);
|
|
4718
|
+
lines.push(`Latency: ${last.latencyMs ?? 0}ms`);
|
|
4719
|
+
} else if (last.error) lines.push(`Error: ${last.error}`);
|
|
4720
|
+
}
|
|
4721
|
+
return {
|
|
4722
|
+
shouldContinue: false,
|
|
4723
|
+
reply: { text: lines.join("\n") }
|
|
4724
|
+
};
|
|
4725
|
+
}
|
|
4726
|
+
return {
|
|
4727
|
+
shouldContinue: false,
|
|
4728
|
+
reply: ttsUsage()
|
|
4729
|
+
};
|
|
4730
|
+
};
|
|
4731
|
+
//#endregion
|
|
4732
|
+
//#region src/auto-reply/reply/commands-core.ts
|
|
4733
|
+
let HANDLERS = null;
|
|
4734
|
+
async function emitResetCommandHooks(params) {
|
|
4735
|
+
const hookEvent = createInternalHookEvent("command", params.action, params.sessionKey ?? "", {
|
|
4736
|
+
sessionEntry: params.sessionEntry,
|
|
4737
|
+
previousSessionEntry: params.previousSessionEntry,
|
|
4738
|
+
commandSource: params.command.surface,
|
|
4739
|
+
senderId: params.command.senderId,
|
|
4740
|
+
workspaceDir: params.workspaceDir,
|
|
4741
|
+
cfg: params.cfg
|
|
4742
|
+
});
|
|
4743
|
+
await triggerInternalHook(hookEvent);
|
|
4744
|
+
params.command.resetHookTriggered = true;
|
|
4745
|
+
if (hookEvent.messages.length > 0) {
|
|
4746
|
+
const channel = params.ctx.OriginatingChannel || params.command.channel;
|
|
4747
|
+
const to = params.ctx.OriginatingTo || params.command.from || params.command.to;
|
|
4748
|
+
if (channel && to) await routeReply({
|
|
4749
|
+
payload: { text: hookEvent.messages.join("\n\n") },
|
|
4750
|
+
channel,
|
|
4751
|
+
to,
|
|
4752
|
+
sessionKey: params.sessionKey,
|
|
4753
|
+
accountId: params.ctx.AccountId,
|
|
4754
|
+
threadId: params.ctx.MessageThreadId,
|
|
4755
|
+
cfg: params.cfg
|
|
4756
|
+
});
|
|
4757
|
+
}
|
|
4758
|
+
const hookRunner = getGlobalHookRunner();
|
|
4759
|
+
if (hookRunner?.hasHooks("before_reset")) {
|
|
4760
|
+
const prevEntry = params.previousSessionEntry;
|
|
4761
|
+
const sessionFile = prevEntry?.sessionFile;
|
|
4762
|
+
(async () => {
|
|
4763
|
+
try {
|
|
4764
|
+
const messages = [];
|
|
4765
|
+
if (sessionFile) {
|
|
4766
|
+
const content = await fs$1.readFile(sessionFile, "utf-8");
|
|
4767
|
+
for (const line of content.split("\n")) {
|
|
4768
|
+
if (!line.trim()) continue;
|
|
4769
|
+
try {
|
|
4770
|
+
const entry = JSON.parse(line);
|
|
4771
|
+
if (entry.type === "message" && entry.message) messages.push(entry.message);
|
|
4772
|
+
} catch {}
|
|
4773
|
+
}
|
|
4774
|
+
} else logVerbose("before_reset: no session file available, firing hook with empty messages");
|
|
4775
|
+
await hookRunner.runBeforeReset({
|
|
4776
|
+
sessionFile,
|
|
4777
|
+
messages,
|
|
4778
|
+
reason: params.action
|
|
4779
|
+
}, {
|
|
4780
|
+
agentId: resolveAgentIdFromSessionKey(params.sessionKey),
|
|
4781
|
+
sessionKey: params.sessionKey,
|
|
4782
|
+
sessionId: prevEntry?.sessionId,
|
|
4783
|
+
workspaceDir: params.workspaceDir
|
|
4784
|
+
});
|
|
4785
|
+
} catch (err) {
|
|
4786
|
+
logVerbose(`before_reset hook failed: ${String(err)}`);
|
|
4787
|
+
}
|
|
4788
|
+
})();
|
|
4789
|
+
}
|
|
4790
|
+
}
|
|
4791
|
+
function applyAcpResetTailContext(ctx, resetTail) {
|
|
4792
|
+
const mutableCtx = ctx;
|
|
4793
|
+
mutableCtx.Body = resetTail;
|
|
4794
|
+
mutableCtx.RawBody = resetTail;
|
|
4795
|
+
mutableCtx.CommandBody = resetTail;
|
|
4796
|
+
mutableCtx.BodyForCommands = resetTail;
|
|
4797
|
+
mutableCtx.BodyForAgent = resetTail;
|
|
4798
|
+
mutableCtx.BodyStripped = resetTail;
|
|
4799
|
+
mutableCtx.AcpDispatchTailAfterReset = true;
|
|
4800
|
+
}
|
|
4801
|
+
function resolveSessionEntryForHookSessionKey(sessionStore, sessionKey) {
|
|
4802
|
+
if (!sessionStore) return;
|
|
4803
|
+
const directEntry = sessionStore[sessionKey];
|
|
4804
|
+
if (directEntry) return directEntry;
|
|
4805
|
+
const normalizedTarget = sessionKey.trim().toLowerCase();
|
|
4806
|
+
if (!normalizedTarget) return;
|
|
4807
|
+
for (const [candidateKey, candidateEntry] of Object.entries(sessionStore)) if (candidateKey.trim().toLowerCase() === normalizedTarget) return candidateEntry;
|
|
4808
|
+
}
|
|
4809
|
+
async function handleCommands(params) {
|
|
4810
|
+
if (HANDLERS === null) HANDLERS = [
|
|
4811
|
+
handlePluginCommand,
|
|
4812
|
+
handleBtwCommand,
|
|
4813
|
+
handleBashCommand,
|
|
4814
|
+
handleActivationCommand,
|
|
4815
|
+
handleSendPolicyCommand,
|
|
4816
|
+
handleFastCommand,
|
|
4817
|
+
handleUsageCommand,
|
|
4818
|
+
handleSessionCommand,
|
|
4819
|
+
handleRestartCommand,
|
|
4820
|
+
handleTtsCommands,
|
|
4821
|
+
handleHelpCommand,
|
|
4822
|
+
handleCommandsListCommand,
|
|
4823
|
+
handleStatusCommand,
|
|
4824
|
+
handleAllowlistCommand,
|
|
4825
|
+
handleApproveCommand,
|
|
4826
|
+
handleContextCommand,
|
|
4827
|
+
handleExportSessionCommand,
|
|
4828
|
+
handleWhoamiCommand,
|
|
4829
|
+
handleSubagentsCommand,
|
|
4830
|
+
handleAcpCommand,
|
|
4831
|
+
handleMcpCommand,
|
|
4832
|
+
handlePluginsCommand,
|
|
4833
|
+
handleConfigCommand,
|
|
4834
|
+
handleDebugCommand,
|
|
4835
|
+
handleModelsCommand,
|
|
4836
|
+
handleStopCommand,
|
|
4837
|
+
handleCompactCommand,
|
|
4838
|
+
handleAbortTrigger
|
|
4839
|
+
];
|
|
4840
|
+
const resetMatch = params.command.commandBodyNormalized.match(/^\/(new|reset)(?:\s|$)/);
|
|
4841
|
+
const resetRequested = Boolean(resetMatch);
|
|
4842
|
+
if (resetRequested && !params.command.isAuthorizedSender) {
|
|
4843
|
+
logVerbose(`Ignoring /reset from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
|
|
4844
|
+
return { shouldContinue: false };
|
|
4845
|
+
}
|
|
4846
|
+
if (resetRequested && params.command.isAuthorizedSender) {
|
|
4847
|
+
const commandAction = resetMatch?.[1] === "reset" ? "reset" : "new";
|
|
4848
|
+
const resetTail = resetMatch != null ? params.command.commandBodyNormalized.slice(resetMatch[0].length).trimStart() : "";
|
|
4849
|
+
const boundAcpSessionKey = resolveBoundAcpThreadSessionKey(params);
|
|
4850
|
+
const boundAcpKey = boundAcpSessionKey && isAcpSessionKey(boundAcpSessionKey) ? boundAcpSessionKey.trim() : void 0;
|
|
4851
|
+
if (boundAcpKey) {
|
|
4852
|
+
const resetResult = await resetConfiguredBindingTargetInPlace({
|
|
4853
|
+
cfg: params.cfg,
|
|
4854
|
+
sessionKey: boundAcpKey,
|
|
4855
|
+
reason: commandAction
|
|
4856
|
+
});
|
|
4857
|
+
if (!resetResult.ok && !resetResult.skipped) logVerbose(`acp reset-in-place failed for ${boundAcpKey}: ${resetResult.error ?? "unknown error"}`);
|
|
4858
|
+
if (resetResult.ok) {
|
|
4859
|
+
const hookSessionEntry = boundAcpKey === params.sessionKey ? params.sessionEntry : resolveSessionEntryForHookSessionKey(params.sessionStore, boundAcpKey);
|
|
4860
|
+
const hookPreviousSessionEntry = boundAcpKey === params.sessionKey ? params.previousSessionEntry : resolveSessionEntryForHookSessionKey(params.sessionStore, boundAcpKey);
|
|
4861
|
+
await emitResetCommandHooks({
|
|
4862
|
+
action: commandAction,
|
|
4863
|
+
ctx: params.ctx,
|
|
4864
|
+
cfg: params.cfg,
|
|
4865
|
+
command: params.command,
|
|
4866
|
+
sessionKey: boundAcpKey,
|
|
4867
|
+
sessionEntry: hookSessionEntry,
|
|
4868
|
+
previousSessionEntry: hookPreviousSessionEntry,
|
|
4869
|
+
workspaceDir: params.workspaceDir
|
|
4870
|
+
});
|
|
4871
|
+
if (resetTail) {
|
|
4872
|
+
applyAcpResetTailContext(params.ctx, resetTail);
|
|
4873
|
+
if (params.rootCtx && params.rootCtx !== params.ctx) applyAcpResetTailContext(params.rootCtx, resetTail);
|
|
4874
|
+
return { shouldContinue: false };
|
|
4875
|
+
}
|
|
4876
|
+
return {
|
|
4877
|
+
shouldContinue: false,
|
|
4878
|
+
reply: { text: "✅ ACP session reset in place." }
|
|
4879
|
+
};
|
|
4880
|
+
}
|
|
4881
|
+
if (resetResult.skipped) return {
|
|
4882
|
+
shouldContinue: false,
|
|
4883
|
+
reply: { text: "⚠️ ACP session reset unavailable for this bound conversation. Rebind with /acp bind or /acp spawn." }
|
|
4884
|
+
};
|
|
4885
|
+
return {
|
|
4886
|
+
shouldContinue: false,
|
|
4887
|
+
reply: { text: "⚠️ ACP session reset failed. Check /acp status and try again." }
|
|
4888
|
+
};
|
|
4889
|
+
}
|
|
4890
|
+
await emitResetCommandHooks({
|
|
4891
|
+
action: commandAction,
|
|
4892
|
+
ctx: params.ctx,
|
|
4893
|
+
cfg: params.cfg,
|
|
4894
|
+
command: params.command,
|
|
4895
|
+
sessionKey: params.sessionKey,
|
|
4896
|
+
sessionEntry: params.sessionEntry,
|
|
4897
|
+
previousSessionEntry: params.previousSessionEntry,
|
|
4898
|
+
workspaceDir: params.workspaceDir
|
|
4899
|
+
});
|
|
4900
|
+
}
|
|
4901
|
+
const allowTextCommands = shouldHandleTextCommands({
|
|
4902
|
+
cfg: params.cfg,
|
|
4903
|
+
surface: params.command.surface,
|
|
4904
|
+
commandSource: params.ctx.CommandSource
|
|
4905
|
+
});
|
|
4906
|
+
for (const handler of HANDLERS) {
|
|
4907
|
+
const result = await handler(params, allowTextCommands);
|
|
4908
|
+
if (result) return result;
|
|
4909
|
+
}
|
|
4910
|
+
if (resolveSendPolicy({
|
|
4911
|
+
cfg: params.cfg,
|
|
4912
|
+
entry: params.sessionEntry,
|
|
4913
|
+
sessionKey: params.sessionKey,
|
|
4914
|
+
channel: params.sessionEntry?.channel ?? params.command.channel,
|
|
4915
|
+
chatType: params.sessionEntry?.chatType
|
|
4916
|
+
}) === "deny") {
|
|
4917
|
+
logVerbose(`Send blocked by policy for session ${params.sessionKey ?? "unknown"}`);
|
|
4918
|
+
return { shouldContinue: false };
|
|
4919
|
+
}
|
|
4920
|
+
return { shouldContinue: true };
|
|
4921
|
+
}
|
|
4922
|
+
//#endregion
|
|
4923
|
+
export { handleCommands as n, emitResetCommandHooks as t };
|