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,4945 @@
|
|
|
1
|
+
import { t as formatDocsLink } from "./links-CKahSp5K.js";
|
|
2
|
+
import { d as resolveThreadSessionKeys$1 } from "./session-key-gFFk3uv9.js";
|
|
3
|
+
import { n as normalizeAccountId, t as DEFAULT_ACCOUNT_ID } from "./account-id-ZCrgXl7Z.js";
|
|
4
|
+
import { r as normalizeProviderId } from "./provider-id-BpXo5t6v.js";
|
|
5
|
+
import { a as hasConfiguredSecretInput, c as normalizeResolvedSecretInputString, l as normalizeSecretInputString } from "./types.secrets-BWSeXrF4.js";
|
|
6
|
+
import { F as requireOpenAllowFrom, a as DmPolicySchema, c as GroupPolicySchema, m as MarkdownConfigSchema, n as BlockStreamingCoalesceSchema } from "./zod-schema.core-BdgRr-F1.js";
|
|
7
|
+
import { o as isTrustedProxyAddress, u as resolveClientIp } from "./net-DlJFp95v.js";
|
|
8
|
+
import { n as loadSessionStore } from "./store-AMSZUI0p.js";
|
|
9
|
+
import { a as resolveAllowlistMatchSimple } from "./allowlist-match-CYmPgg1K.js";
|
|
10
|
+
import { l as resolveStorePath } from "./paths-CTjJI9l0.js";
|
|
11
|
+
import { i as parseStrictPositiveInteger } from "./parse-finite-number-CP4MQF_w.js";
|
|
12
|
+
import { t as rawDataToString } from "./ws-By-QcLjg.js";
|
|
13
|
+
import { t as createAccountListHelpers } from "./account-helpers-D3c_eI7c.js";
|
|
14
|
+
import { r as buildSecretInputSchema } from "./secret-input-4REZ4sHo.js";
|
|
15
|
+
import { t as normalizeOutboundThreadId } from "./routing-Y3m0o-kB.js";
|
|
16
|
+
import { Da as buildModelsProviderData } from "./pi-embedded-CDH9LrEg.js";
|
|
17
|
+
import { t as createDedupeCache } from "./dedupe-Cgnk5BbX.js";
|
|
18
|
+
import { t as registerPluginHttpRoute } from "./http-registry-WFFbLYRd.js";
|
|
19
|
+
import { t as createScopedAccountReplyToModeResolver } from "./threading-helpers-Cq55SUtb.js";
|
|
20
|
+
import { i as createScopedChannelConfigAdapter, o as createScopedDmSecurityResolver } from "./channel-config-helpers-ChUYvBB0.js";
|
|
21
|
+
import { a as warnMissingProviderGroupPolicyFallbackOnce, n as resolveAllowlistProviderRuntimeGroupPolicy, r as resolveDefaultGroupPolicy } from "./runtime-group-policy-B7irU4eu.js";
|
|
22
|
+
import { p as createAllowlistProviderRestrictSendersWarningCollector } from "./group-policy-warnings-Ddu6lBkh.js";
|
|
23
|
+
import { n as createChannelPairingController, r as createLoggedPairingApprovalNotifier } from "./channel-pairing-rNA4qQPY.js";
|
|
24
|
+
import { i as createAttachedChannelResultAdapter } from "./channel-send-result-By8EpCPw.js";
|
|
25
|
+
import { r as buildChannelConfigSchema } from "./config-schema-B1UGMwZ8.js";
|
|
26
|
+
import { a as migrateBaseNameToDefaultAccount, n as applySetupAccountConfigPatch, t as applyAccountNameToChannelSection } from "./setup-helpers-B62Ecg9r.js";
|
|
27
|
+
import { o as stripChannelTargetPrefix, s as stripTargetKindPrefix, t as buildChannelOutboundSessionRoute } from "./core-BV7ewUK4.js";
|
|
28
|
+
import { i as evaluateSenderGroupAccessForPolicy } from "./group-access-DJZrYPx1.js";
|
|
29
|
+
import { n as resolveControlCommandGate } from "./command-gating-BQXGSqc9.js";
|
|
30
|
+
import { n as readStoreAllowFromForDmPolicy, o as resolveDmGroupAccessWithLists, s as resolveEffectiveAllowFromLists, t as DM_GROUP_ACCESS_REASON } from "./dm-policy-shared-6bCJzHOS.js";
|
|
31
|
+
import { t as getAgentScopedMediaLocalRoots } from "./local-roots-DAzCjWbC.js";
|
|
32
|
+
import { t as listSkillCommandsForAgents } from "./skill-commands-CiSwTFBQ.js";
|
|
33
|
+
import { i as resolveStoredModelOverride } from "./model-selection-slZyRw2d.js";
|
|
34
|
+
import { i as deliverTextOrMediaReply, p as resolveSendableOutboundReplyParts } from "./reply-payload-DBGc074f.js";
|
|
35
|
+
import { r as buildComputedAccountStatusSnapshot } from "./status-helpers-Cda-rGLX.js";
|
|
36
|
+
import { n as resolveChannelGroupRequireMention } from "./group-policy-CWFxv3iB.js";
|
|
37
|
+
import { n as isDangerousNameMatchingEnabled } from "./dangerous-name-matching-DZa_t0RM.js";
|
|
38
|
+
import { t as resolveChannelMediaMaxBytes } from "./media-limits-Cuvmmhop.js";
|
|
39
|
+
import { l as buildAgentMediaPayload } from "./follow-redirects-BPQ_NgUo.js";
|
|
40
|
+
import { l as formatInboundFromLabel$1 } from "./channel-inbound-3L_8TOZ0.js";
|
|
41
|
+
import { n as formatNormalizedAllowFromEntries } from "./allow-from-C4iBpqFI.js";
|
|
42
|
+
import { t as createMessageToolButtonsSchema } from "./channel-actions-DU2CR3xW.js";
|
|
43
|
+
import { a as isRequestBodyLimitError, s as readRequestBodyWithLimit } from "./http-body-CCiSfloA.js";
|
|
44
|
+
import { a as buildPendingHistoryContextFromMap, s as clearHistoryEntriesIfEnabled, u as recordPendingHistoryEntryIfEnabled } from "./history-CHjo8B5W.js";
|
|
45
|
+
import { n as logInboundDrop, r as logTypingFailure } from "./logging-Bz1qZDPg.js";
|
|
46
|
+
import { t as createChannelReplyPipeline } from "./channel-reply-pipeline-CPTuaW8n.js";
|
|
47
|
+
import { t as createChannelDirectoryAdapter } from "./directory-runtime-DhC8QkMq.js";
|
|
48
|
+
import { t as createAccountStatusSink } from "./channel-lifecycle-CpU1dRbh.js";
|
|
49
|
+
import { t as createPluginRuntimeStore } from "./runtime-store-Bt3Sdbrn.js";
|
|
50
|
+
import { n as buildPassiveProbedChannelStatusSummary, s as requireChannelOpenAllowFrom } from "./extension-shared-5txN7IXK.js";
|
|
51
|
+
import { t as loadOutboundMediaFromUrl } from "./outbound-media-69yrWRDt.js";
|
|
52
|
+
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
53
|
+
import { z } from "zod";
|
|
54
|
+
import WebSocket$1 from "ws";
|
|
55
|
+
//#region extensions/mattermost/src/config-schema.ts
|
|
56
|
+
const DmChannelRetrySchema = z.object({
|
|
57
|
+
maxRetries: z.number().int().min(0).max(10).optional(),
|
|
58
|
+
initialDelayMs: z.number().int().min(100).max(6e4).optional(),
|
|
59
|
+
maxDelayMs: z.number().int().min(1e3).max(6e4).optional(),
|
|
60
|
+
timeoutMs: z.number().int().min(5e3).max(12e4).optional()
|
|
61
|
+
}).strict().refine((data) => {
|
|
62
|
+
if (data.initialDelayMs !== void 0 && data.maxDelayMs !== void 0) return data.initialDelayMs <= data.maxDelayMs;
|
|
63
|
+
return true;
|
|
64
|
+
}, {
|
|
65
|
+
message: "initialDelayMs must be less than or equal to maxDelayMs",
|
|
66
|
+
path: ["initialDelayMs"]
|
|
67
|
+
}).optional();
|
|
68
|
+
const MattermostSlashCommandsSchema = z.object({
|
|
69
|
+
native: z.union([z.boolean(), z.literal("auto")]).optional(),
|
|
70
|
+
nativeSkills: z.union([z.boolean(), z.literal("auto")]).optional(),
|
|
71
|
+
callbackPath: z.string().optional(),
|
|
72
|
+
callbackUrl: z.string().optional()
|
|
73
|
+
}).strict().optional();
|
|
74
|
+
const MattermostAccountSchemaBase = z.object({
|
|
75
|
+
name: z.string().optional(),
|
|
76
|
+
capabilities: z.array(z.string()).optional(),
|
|
77
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
78
|
+
markdown: MarkdownConfigSchema,
|
|
79
|
+
enabled: z.boolean().optional(),
|
|
80
|
+
configWrites: z.boolean().optional(),
|
|
81
|
+
botToken: buildSecretInputSchema().optional(),
|
|
82
|
+
baseUrl: z.string().optional(),
|
|
83
|
+
chatmode: z.enum([
|
|
84
|
+
"oncall",
|
|
85
|
+
"onmessage",
|
|
86
|
+
"onchar"
|
|
87
|
+
]).optional(),
|
|
88
|
+
oncharPrefixes: z.array(z.string()).optional(),
|
|
89
|
+
requireMention: z.boolean().optional(),
|
|
90
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
91
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
92
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
93
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
94
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
95
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
96
|
+
blockStreaming: z.boolean().optional(),
|
|
97
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
98
|
+
replyToMode: z.enum([
|
|
99
|
+
"off",
|
|
100
|
+
"first",
|
|
101
|
+
"all"
|
|
102
|
+
]).optional(),
|
|
103
|
+
responsePrefix: z.string().optional(),
|
|
104
|
+
actions: z.object({ reactions: z.boolean().optional() }).optional(),
|
|
105
|
+
commands: MattermostSlashCommandsSchema,
|
|
106
|
+
interactions: z.object({
|
|
107
|
+
callbackBaseUrl: z.string().optional(),
|
|
108
|
+
allowedSourceIps: z.array(z.string()).optional()
|
|
109
|
+
}).optional(),
|
|
110
|
+
dmChannelRetry: DmChannelRetrySchema
|
|
111
|
+
}).strict();
|
|
112
|
+
const MattermostAccountSchema = MattermostAccountSchemaBase.superRefine((value, ctx) => {
|
|
113
|
+
requireChannelOpenAllowFrom({
|
|
114
|
+
channel: "mattermost",
|
|
115
|
+
policy: value.dmPolicy,
|
|
116
|
+
allowFrom: value.allowFrom,
|
|
117
|
+
ctx,
|
|
118
|
+
requireOpenAllowFrom
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
const MattermostConfigSchema = MattermostAccountSchemaBase.extend({
|
|
122
|
+
accounts: z.record(z.string(), MattermostAccountSchema.optional()).optional(),
|
|
123
|
+
defaultAccount: z.string().optional()
|
|
124
|
+
}).superRefine((value, ctx) => {
|
|
125
|
+
requireChannelOpenAllowFrom({
|
|
126
|
+
channel: "mattermost",
|
|
127
|
+
policy: value.dmPolicy,
|
|
128
|
+
allowFrom: value.allowFrom,
|
|
129
|
+
ctx,
|
|
130
|
+
requireOpenAllowFrom
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region extensions/mattermost/src/mattermost/client.ts
|
|
135
|
+
function normalizeMattermostBaseUrl(raw) {
|
|
136
|
+
const trimmed = raw?.trim();
|
|
137
|
+
if (!trimmed) return;
|
|
138
|
+
return trimmed.replace(/\/+$/, "").replace(/\/api\/v4$/i, "");
|
|
139
|
+
}
|
|
140
|
+
function buildMattermostApiUrl(baseUrl, path) {
|
|
141
|
+
const normalized = normalizeMattermostBaseUrl(baseUrl);
|
|
142
|
+
if (!normalized) throw new Error("Mattermost baseUrl is required");
|
|
143
|
+
return `${normalized}/api/v4${path.startsWith("/") ? path : `/${path}`}`;
|
|
144
|
+
}
|
|
145
|
+
async function readMattermostError(res) {
|
|
146
|
+
if ((res.headers.get("content-type") ?? "").includes("application/json")) {
|
|
147
|
+
const data = await res.json();
|
|
148
|
+
if (data?.message) return data.message;
|
|
149
|
+
return JSON.stringify(data);
|
|
150
|
+
}
|
|
151
|
+
return await res.text();
|
|
152
|
+
}
|
|
153
|
+
function createMattermostClient(params) {
|
|
154
|
+
const baseUrl = normalizeMattermostBaseUrl(params.baseUrl);
|
|
155
|
+
if (!baseUrl) throw new Error("Mattermost baseUrl is required");
|
|
156
|
+
const apiBaseUrl = `${baseUrl}/api/v4`;
|
|
157
|
+
const token = params.botToken.trim();
|
|
158
|
+
const fetchImpl = params.fetchImpl ?? fetch;
|
|
159
|
+
const request = async (path, init) => {
|
|
160
|
+
const url = buildMattermostApiUrl(baseUrl, path);
|
|
161
|
+
const headers = new Headers(init?.headers);
|
|
162
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
163
|
+
if (typeof init?.body === "string" && !headers.has("Content-Type")) headers.set("Content-Type", "application/json");
|
|
164
|
+
const res = await fetchImpl(url, {
|
|
165
|
+
...init,
|
|
166
|
+
headers
|
|
167
|
+
});
|
|
168
|
+
if (!res.ok) {
|
|
169
|
+
const detail = await readMattermostError(res);
|
|
170
|
+
throw new Error(`Mattermost API ${res.status} ${res.statusText}: ${detail || "unknown error"}`);
|
|
171
|
+
}
|
|
172
|
+
if (res.status === 204) return;
|
|
173
|
+
if ((res.headers.get("content-type") ?? "").includes("application/json")) return await res.json();
|
|
174
|
+
return await res.text();
|
|
175
|
+
};
|
|
176
|
+
return {
|
|
177
|
+
baseUrl,
|
|
178
|
+
apiBaseUrl,
|
|
179
|
+
token,
|
|
180
|
+
request
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async function fetchMattermostMe(client) {
|
|
184
|
+
return await client.request("/users/me");
|
|
185
|
+
}
|
|
186
|
+
async function fetchMattermostUser(client, userId) {
|
|
187
|
+
return await client.request(`/users/${userId}`);
|
|
188
|
+
}
|
|
189
|
+
async function fetchMattermostUserByUsername(client, username) {
|
|
190
|
+
return await client.request(`/users/username/${encodeURIComponent(username)}`);
|
|
191
|
+
}
|
|
192
|
+
async function fetchMattermostChannel(client, channelId) {
|
|
193
|
+
return await client.request(`/channels/${channelId}`);
|
|
194
|
+
}
|
|
195
|
+
async function fetchMattermostChannelByName(client, teamId, channelName) {
|
|
196
|
+
return await client.request(`/teams/${teamId}/channels/name/${encodeURIComponent(channelName)}`);
|
|
197
|
+
}
|
|
198
|
+
async function sendMattermostTyping(client, params) {
|
|
199
|
+
const payload = { channel_id: params.channelId };
|
|
200
|
+
const parentId = params.parentId?.trim();
|
|
201
|
+
if (parentId) payload.parent_id = parentId;
|
|
202
|
+
await client.request("/users/me/typing", {
|
|
203
|
+
method: "POST",
|
|
204
|
+
body: JSON.stringify(payload)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async function createMattermostDirectChannel(client, userIds, signal) {
|
|
208
|
+
return await client.request("/channels/direct", {
|
|
209
|
+
method: "POST",
|
|
210
|
+
body: JSON.stringify(userIds),
|
|
211
|
+
signal
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
const RETRYABLE_NETWORK_ERROR_CODES = new Set([
|
|
215
|
+
"ECONNRESET",
|
|
216
|
+
"ECONNREFUSED",
|
|
217
|
+
"ETIMEDOUT",
|
|
218
|
+
"ESOCKETTIMEDOUT",
|
|
219
|
+
"ECONNABORTED",
|
|
220
|
+
"ENOTFOUND",
|
|
221
|
+
"EAI_AGAIN",
|
|
222
|
+
"EHOSTUNREACH",
|
|
223
|
+
"ENETUNREACH",
|
|
224
|
+
"EPIPE",
|
|
225
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
226
|
+
"UND_ERR_DNS_RESOLVE_FAILED",
|
|
227
|
+
"UND_ERR_CONNECT",
|
|
228
|
+
"UND_ERR_SOCKET",
|
|
229
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
230
|
+
"UND_ERR_BODY_TIMEOUT"
|
|
231
|
+
]);
|
|
232
|
+
const RETRYABLE_NETWORK_ERROR_NAMES = new Set([
|
|
233
|
+
"AbortError",
|
|
234
|
+
"TimeoutError",
|
|
235
|
+
"ConnectTimeoutError",
|
|
236
|
+
"HeadersTimeoutError",
|
|
237
|
+
"BodyTimeoutError"
|
|
238
|
+
]);
|
|
239
|
+
const RETRYABLE_NETWORK_MESSAGE_SNIPPETS = [
|
|
240
|
+
"network error",
|
|
241
|
+
"timeout",
|
|
242
|
+
"timed out",
|
|
243
|
+
"abort",
|
|
244
|
+
"connection refused",
|
|
245
|
+
"econnreset",
|
|
246
|
+
"econnrefused",
|
|
247
|
+
"etimedout",
|
|
248
|
+
"enotfound",
|
|
249
|
+
"socket hang up",
|
|
250
|
+
"getaddrinfo"
|
|
251
|
+
];
|
|
252
|
+
/**
|
|
253
|
+
* Creates a Mattermost DM channel with exponential backoff retry logic.
|
|
254
|
+
* Retries on transient errors (429, 5xx, network errors) but not on
|
|
255
|
+
* client errors (4xx except 429) or permanent failures.
|
|
256
|
+
*/
|
|
257
|
+
async function createMattermostDirectChannelWithRetry(client, userIds, options = {}) {
|
|
258
|
+
const { maxRetries = 3, initialDelayMs = 1e3, maxDelayMs = 1e4, timeoutMs = 3e4, onRetry } = options;
|
|
259
|
+
let lastError;
|
|
260
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) try {
|
|
261
|
+
const controller = new AbortController();
|
|
262
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
263
|
+
try {
|
|
264
|
+
return await createMattermostDirectChannel(client, userIds, controller.signal);
|
|
265
|
+
} finally {
|
|
266
|
+
clearTimeout(timeoutId);
|
|
267
|
+
}
|
|
268
|
+
} catch (err) {
|
|
269
|
+
lastError = err instanceof Error ? err : new Error(String(err));
|
|
270
|
+
if (attempt >= maxRetries) break;
|
|
271
|
+
if (!isRetryableError(lastError)) throw lastError;
|
|
272
|
+
const exponentialDelay = initialDelayMs * Math.pow(2, attempt);
|
|
273
|
+
const jitter = Math.random() * exponentialDelay;
|
|
274
|
+
const delayMs = Math.min(exponentialDelay + jitter, maxDelayMs);
|
|
275
|
+
if (onRetry) onRetry(attempt + 1, delayMs, lastError);
|
|
276
|
+
await sleep(delayMs);
|
|
277
|
+
}
|
|
278
|
+
throw lastError ?? /* @__PURE__ */ new Error("Failed to create DM channel after retries");
|
|
279
|
+
}
|
|
280
|
+
function isRetryableError(error) {
|
|
281
|
+
const candidates = collectErrorCandidates(error);
|
|
282
|
+
const messages = candidates.map((candidate) => readErrorMessage(candidate)?.toLowerCase()).filter((message) => Boolean(message));
|
|
283
|
+
if (messages.some((message) => /mattermost api 5\d{2}\b/.test(message))) return true;
|
|
284
|
+
if (messages.some((message) => /mattermost api 429\b/.test(message) || message.includes("too many requests"))) return true;
|
|
285
|
+
for (const message of messages) {
|
|
286
|
+
const clientErrorMatch = message.match(/mattermost api (4\d{2})\b/);
|
|
287
|
+
if (!clientErrorMatch) continue;
|
|
288
|
+
const statusCode = parseInt(clientErrorMatch[1], 10);
|
|
289
|
+
if (statusCode >= 400 && statusCode < 500) return false;
|
|
290
|
+
}
|
|
291
|
+
if (messages.some((message) => /mattermost api \d{3}\b/.test(message))) return false;
|
|
292
|
+
if (candidates.map((candidate) => readErrorCode(candidate)).filter((code) => Boolean(code)).some((code) => RETRYABLE_NETWORK_ERROR_CODES.has(code))) return true;
|
|
293
|
+
if (candidates.map((candidate) => readErrorName(candidate)).filter((name) => Boolean(name)).some((name) => RETRYABLE_NETWORK_ERROR_NAMES.has(name))) return true;
|
|
294
|
+
return messages.some((message) => RETRYABLE_NETWORK_MESSAGE_SNIPPETS.some((pattern) => message.includes(pattern)));
|
|
295
|
+
}
|
|
296
|
+
function collectErrorCandidates(error) {
|
|
297
|
+
const queue = [error];
|
|
298
|
+
const seen = /* @__PURE__ */ new Set();
|
|
299
|
+
const candidates = [];
|
|
300
|
+
while (queue.length > 0) {
|
|
301
|
+
const current = queue.shift();
|
|
302
|
+
if (!current || seen.has(current)) continue;
|
|
303
|
+
seen.add(current);
|
|
304
|
+
candidates.push(current);
|
|
305
|
+
if (typeof current !== "object") continue;
|
|
306
|
+
const nested = current;
|
|
307
|
+
queue.push(nested.cause, nested.reason);
|
|
308
|
+
if (Array.isArray(nested.errors)) queue.push(...nested.errors);
|
|
309
|
+
}
|
|
310
|
+
return candidates;
|
|
311
|
+
}
|
|
312
|
+
function readErrorMessage(error) {
|
|
313
|
+
if (!error || typeof error !== "object") return;
|
|
314
|
+
const message = error.message;
|
|
315
|
+
return typeof message === "string" && message.trim() ? message : void 0;
|
|
316
|
+
}
|
|
317
|
+
function readErrorName(error) {
|
|
318
|
+
if (!error || typeof error !== "object") return;
|
|
319
|
+
const name = error.name;
|
|
320
|
+
return typeof name === "string" && name.trim() ? name : void 0;
|
|
321
|
+
}
|
|
322
|
+
function readErrorCode(error) {
|
|
323
|
+
if (!error || typeof error !== "object") return;
|
|
324
|
+
const { code, errno } = error;
|
|
325
|
+
const raw = typeof code === "string" && code.trim() ? code : errno;
|
|
326
|
+
if (typeof raw === "string" && raw.trim()) return raw.trim().toUpperCase();
|
|
327
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
|
|
328
|
+
}
|
|
329
|
+
function sleep(ms) {
|
|
330
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
331
|
+
}
|
|
332
|
+
async function createMattermostPost(client, params) {
|
|
333
|
+
const payload = {
|
|
334
|
+
channel_id: params.channelId,
|
|
335
|
+
message: params.message
|
|
336
|
+
};
|
|
337
|
+
if (params.rootId) payload.root_id = params.rootId;
|
|
338
|
+
if (params.fileIds?.length) payload.file_ids = params.fileIds;
|
|
339
|
+
if (params.props) payload.props = params.props;
|
|
340
|
+
return await client.request("/posts", {
|
|
341
|
+
method: "POST",
|
|
342
|
+
body: JSON.stringify(payload)
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
async function fetchMattermostUserTeams(client, userId) {
|
|
346
|
+
return await client.request(`/users/${userId}/teams`);
|
|
347
|
+
}
|
|
348
|
+
async function updateMattermostPost(client, postId, params) {
|
|
349
|
+
const payload = { id: postId };
|
|
350
|
+
if (params.message !== void 0) payload.message = params.message;
|
|
351
|
+
if (params.props !== void 0) payload.props = params.props;
|
|
352
|
+
return await client.request(`/posts/${postId}`, {
|
|
353
|
+
method: "PUT",
|
|
354
|
+
body: JSON.stringify(payload)
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
async function uploadMattermostFile(client, params) {
|
|
358
|
+
const form = new FormData();
|
|
359
|
+
const fileName = params.fileName?.trim() || "upload";
|
|
360
|
+
const bytes = Uint8Array.from(params.buffer);
|
|
361
|
+
const blob = params.contentType ? new Blob([bytes], { type: params.contentType }) : new Blob([bytes]);
|
|
362
|
+
form.append("files", blob, fileName);
|
|
363
|
+
form.append("channel_id", params.channelId);
|
|
364
|
+
const res = await fetch(`${client.apiBaseUrl}/files`, {
|
|
365
|
+
method: "POST",
|
|
366
|
+
headers: { Authorization: `Bearer ${client.token}` },
|
|
367
|
+
body: form
|
|
368
|
+
});
|
|
369
|
+
if (!res.ok) {
|
|
370
|
+
const detail = await readMattermostError(res);
|
|
371
|
+
throw new Error(`Mattermost API ${res.status} ${res.statusText}: ${detail || "unknown error"}`);
|
|
372
|
+
}
|
|
373
|
+
const info = (await res.json()).file_infos?.[0];
|
|
374
|
+
if (!info?.id) throw new Error("Mattermost file upload failed");
|
|
375
|
+
return info;
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region extensions/mattermost/src/mattermost/accounts.ts
|
|
379
|
+
const { listAccountIds: listMattermostAccountIds, resolveDefaultAccountId: resolveDefaultMattermostAccountId } = createAccountListHelpers("mattermost");
|
|
380
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
381
|
+
const accounts = cfg.channels?.mattermost?.accounts;
|
|
382
|
+
if (!accounts || typeof accounts !== "object") return;
|
|
383
|
+
return accounts[accountId];
|
|
384
|
+
}
|
|
385
|
+
function mergeMattermostAccountConfig(cfg, accountId) {
|
|
386
|
+
const { accounts: _ignored, defaultAccount: _ignoredDefaultAccount, ...base } = cfg.channels?.mattermost ?? {};
|
|
387
|
+
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
388
|
+
const mergedCommands = {
|
|
389
|
+
...base.commands ?? {},
|
|
390
|
+
...account.commands ?? {}
|
|
391
|
+
};
|
|
392
|
+
const merged = {
|
|
393
|
+
...base,
|
|
394
|
+
...account
|
|
395
|
+
};
|
|
396
|
+
if (Object.keys(mergedCommands).length > 0) merged.commands = mergedCommands;
|
|
397
|
+
return merged;
|
|
398
|
+
}
|
|
399
|
+
function resolveMattermostRequireMention(config) {
|
|
400
|
+
if (config.chatmode === "oncall") return true;
|
|
401
|
+
if (config.chatmode === "onmessage") return false;
|
|
402
|
+
if (config.chatmode === "onchar") return true;
|
|
403
|
+
return config.requireMention;
|
|
404
|
+
}
|
|
405
|
+
function resolveMattermostAccount(params) {
|
|
406
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
407
|
+
const baseEnabled = params.cfg.channels?.mattermost?.enabled !== false;
|
|
408
|
+
const merged = mergeMattermostAccountConfig(params.cfg, accountId);
|
|
409
|
+
const accountEnabled = merged.enabled !== false;
|
|
410
|
+
const enabled = baseEnabled && accountEnabled;
|
|
411
|
+
const allowEnv = accountId === DEFAULT_ACCOUNT_ID;
|
|
412
|
+
const envToken = allowEnv ? process.env.MATTERMOST_BOT_TOKEN?.trim() : void 0;
|
|
413
|
+
const envUrl = allowEnv ? process.env.MATTERMOST_URL?.trim() : void 0;
|
|
414
|
+
const configToken = params.allowUnresolvedSecretRef ? normalizeSecretInputString(merged.botToken) : normalizeResolvedSecretInputString({
|
|
415
|
+
value: merged.botToken,
|
|
416
|
+
path: `channels.mattermost.accounts.${accountId}.botToken`
|
|
417
|
+
});
|
|
418
|
+
const configUrl = merged.baseUrl?.trim();
|
|
419
|
+
const botToken = configToken || envToken;
|
|
420
|
+
const baseUrl = normalizeMattermostBaseUrl(configUrl || envUrl);
|
|
421
|
+
const requireMention = resolveMattermostRequireMention(merged);
|
|
422
|
+
const botTokenSource = configToken ? "config" : envToken ? "env" : "none";
|
|
423
|
+
const baseUrlSource = configUrl ? "config" : envUrl ? "env" : "none";
|
|
424
|
+
return {
|
|
425
|
+
accountId,
|
|
426
|
+
enabled,
|
|
427
|
+
name: merged.name?.trim() || void 0,
|
|
428
|
+
botToken,
|
|
429
|
+
baseUrl,
|
|
430
|
+
botTokenSource,
|
|
431
|
+
baseUrlSource,
|
|
432
|
+
config: merged,
|
|
433
|
+
chatmode: merged.chatmode,
|
|
434
|
+
oncharPrefixes: merged.oncharPrefixes,
|
|
435
|
+
requireMention,
|
|
436
|
+
textChunkLimit: merged.textChunkLimit,
|
|
437
|
+
blockStreaming: merged.blockStreaming,
|
|
438
|
+
blockStreamingCoalesce: merged.blockStreamingCoalesce
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Resolve the effective replyToMode for a given chat type.
|
|
443
|
+
* Mattermost auto-threading only applies to channel and group messages.
|
|
444
|
+
*/
|
|
445
|
+
function resolveMattermostReplyToMode(account, kind) {
|
|
446
|
+
if (kind === "direct") return "off";
|
|
447
|
+
return account.config.replyToMode ?? "off";
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region extensions/mattermost/src/group-mentions.ts
|
|
451
|
+
function resolveMattermostGroupRequireMention(params) {
|
|
452
|
+
const account = resolveMattermostAccount({
|
|
453
|
+
cfg: params.cfg,
|
|
454
|
+
accountId: params.accountId
|
|
455
|
+
});
|
|
456
|
+
const requireMentionOverride = typeof params.requireMentionOverride === "boolean" ? params.requireMentionOverride : account.requireMention;
|
|
457
|
+
return resolveChannelGroupRequireMention({
|
|
458
|
+
cfg: params.cfg,
|
|
459
|
+
channel: "mattermost",
|
|
460
|
+
groupId: params.groupId,
|
|
461
|
+
accountId: params.accountId,
|
|
462
|
+
requireMentionOverride
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region extensions/mattermost/src/mattermost/directory.ts
|
|
467
|
+
function buildClient(params) {
|
|
468
|
+
const account = resolveMattermostAccount({
|
|
469
|
+
cfg: params.cfg,
|
|
470
|
+
accountId: params.accountId
|
|
471
|
+
});
|
|
472
|
+
if (!account.enabled || !account.botToken || !account.baseUrl) return null;
|
|
473
|
+
return createMattermostClient({
|
|
474
|
+
baseUrl: account.baseUrl,
|
|
475
|
+
botToken: account.botToken
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Build clients from ALL enabled accounts (deduplicated by token).
|
|
480
|
+
*
|
|
481
|
+
* We always scan every account because:
|
|
482
|
+
* - Private channels are only visible to bots that are members
|
|
483
|
+
* - The requesting agent's account may have an expired/invalid token
|
|
484
|
+
*
|
|
485
|
+
* This means a single healthy bot token is enough for directory discovery.
|
|
486
|
+
*/
|
|
487
|
+
function buildClients(params) {
|
|
488
|
+
const accountIds = listMattermostAccountIds(params.cfg);
|
|
489
|
+
const seen = /* @__PURE__ */ new Set();
|
|
490
|
+
const clients = [];
|
|
491
|
+
for (const id of accountIds) {
|
|
492
|
+
const client = buildClient({
|
|
493
|
+
cfg: params.cfg,
|
|
494
|
+
accountId: id
|
|
495
|
+
});
|
|
496
|
+
if (client && !seen.has(client.token)) {
|
|
497
|
+
seen.add(client.token);
|
|
498
|
+
clients.push(client);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return clients;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* List channels (public + private) visible to any configured bot account.
|
|
505
|
+
*
|
|
506
|
+
* NOTE: Uses per_page=200 which covers most instances. Mattermost does not
|
|
507
|
+
* return a "has more" indicator, so very large instances (200+ channels per bot)
|
|
508
|
+
* may see incomplete results. Pagination can be added if needed.
|
|
509
|
+
*/
|
|
510
|
+
async function listMattermostDirectoryGroups(params) {
|
|
511
|
+
const clients = buildClients(params);
|
|
512
|
+
if (!clients.length) return [];
|
|
513
|
+
const q = params.query?.trim().toLowerCase() || "";
|
|
514
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
515
|
+
const entries = [];
|
|
516
|
+
for (const client of clients) try {
|
|
517
|
+
const me = await fetchMattermostMe(client);
|
|
518
|
+
const channels = await client.request(`/users/${me.id}/channels?per_page=200`);
|
|
519
|
+
for (const ch of channels) {
|
|
520
|
+
if (ch.type !== "O" && ch.type !== "P") continue;
|
|
521
|
+
if (seenIds.has(ch.id)) continue;
|
|
522
|
+
if (q) {
|
|
523
|
+
const name = (ch.name ?? "").toLowerCase();
|
|
524
|
+
const display = (ch.display_name ?? "").toLowerCase();
|
|
525
|
+
if (!name.includes(q) && !display.includes(q)) continue;
|
|
526
|
+
}
|
|
527
|
+
seenIds.add(ch.id);
|
|
528
|
+
entries.push({
|
|
529
|
+
kind: "group",
|
|
530
|
+
id: `channel:${ch.id}`,
|
|
531
|
+
name: ch.name ?? void 0,
|
|
532
|
+
handle: ch.display_name ?? void 0
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
} catch (err) {
|
|
536
|
+
console.debug?.("[mattermost-directory] listGroups: skipping account:", err?.message);
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
return params.limit && params.limit > 0 ? entries.slice(0, params.limit) : entries;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* List team members as peer directory entries.
|
|
543
|
+
*
|
|
544
|
+
* Uses only the first available client since all bots in a team see the same
|
|
545
|
+
* user list (unlike channels where membership varies). Uses the first team
|
|
546
|
+
* returned — multi-team setups will only see members from that team.
|
|
547
|
+
*
|
|
548
|
+
* NOTE: per_page=200 for member listing; same pagination caveat as groups.
|
|
549
|
+
*/
|
|
550
|
+
async function listMattermostDirectoryPeers(params) {
|
|
551
|
+
const clients = buildClients(params);
|
|
552
|
+
if (!clients.length) return [];
|
|
553
|
+
const client = clients[0];
|
|
554
|
+
try {
|
|
555
|
+
const me = await fetchMattermostMe(client);
|
|
556
|
+
const teams = await client.request("/users/me/teams");
|
|
557
|
+
if (!teams.length) return [];
|
|
558
|
+
const teamId = teams[0].id;
|
|
559
|
+
const q = params.query?.trim().toLowerCase() || "";
|
|
560
|
+
let users;
|
|
561
|
+
if (q) users = await client.request("/users/search", {
|
|
562
|
+
method: "POST",
|
|
563
|
+
body: JSON.stringify({
|
|
564
|
+
term: q,
|
|
565
|
+
team_id: teamId
|
|
566
|
+
})
|
|
567
|
+
});
|
|
568
|
+
else {
|
|
569
|
+
const userIds = (await client.request(`/teams/${teamId}/members?per_page=200`)).map((m) => m.user_id).filter((id) => id !== me.id);
|
|
570
|
+
if (!userIds.length) return [];
|
|
571
|
+
users = await client.request("/users/ids", {
|
|
572
|
+
method: "POST",
|
|
573
|
+
body: JSON.stringify(userIds)
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
const entries = users.filter((u) => u.id !== me.id).map((u) => ({
|
|
577
|
+
kind: "user",
|
|
578
|
+
id: `user:${u.id}`,
|
|
579
|
+
name: u.username ?? void 0,
|
|
580
|
+
handle: [u.first_name, u.last_name].filter(Boolean).join(" ").trim() || u.nickname || void 0
|
|
581
|
+
}));
|
|
582
|
+
return params.limit && params.limit > 0 ? entries.slice(0, params.limit) : entries;
|
|
583
|
+
} catch (err) {
|
|
584
|
+
console.debug?.("[mattermost-directory] listPeers failed:", err?.message);
|
|
585
|
+
return [];
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region extensions/mattermost/src/runtime.ts
|
|
590
|
+
const { setRuntime: setMattermostRuntime, getRuntime: getMattermostRuntime } = createPluginRuntimeStore("Mattermost runtime not initialized");
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region extensions/mattermost/src/mattermost/interactions.ts
|
|
593
|
+
const INTERACTION_MAX_BODY_BYTES = 64 * 1024;
|
|
594
|
+
const INTERACTION_BODY_TIMEOUT_MS = 1e4;
|
|
595
|
+
const SIGNED_CHANNEL_ID_CONTEXT_KEY = "__openclaw_channel_id";
|
|
596
|
+
const callbackUrls = /* @__PURE__ */ new Map();
|
|
597
|
+
function setInteractionCallbackUrl(accountId, url) {
|
|
598
|
+
callbackUrls.set(accountId, url);
|
|
599
|
+
}
|
|
600
|
+
function resolveInteractionCallbackPath(accountId) {
|
|
601
|
+
return `/mattermost/interactions/${accountId}`;
|
|
602
|
+
}
|
|
603
|
+
function isWildcardBindHost(rawHost) {
|
|
604
|
+
const trimmed = rawHost.trim();
|
|
605
|
+
if (!trimmed) return false;
|
|
606
|
+
const host = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.slice(1, -1) : trimmed;
|
|
607
|
+
return host === "0.0.0.0" || host === "::" || host === "0:0:0:0:0:0:0:0" || host === "::0";
|
|
608
|
+
}
|
|
609
|
+
function normalizeCallbackBaseUrl(baseUrl) {
|
|
610
|
+
return baseUrl.trim().replace(/\/+$/, "");
|
|
611
|
+
}
|
|
612
|
+
function headerValue(value) {
|
|
613
|
+
if (Array.isArray(value)) return value[0]?.trim() || void 0;
|
|
614
|
+
return value?.trim() || void 0;
|
|
615
|
+
}
|
|
616
|
+
function isAllowedInteractionSource(params) {
|
|
617
|
+
const { allowedSourceIps } = params;
|
|
618
|
+
if (!allowedSourceIps?.length) return true;
|
|
619
|
+
return isTrustedProxyAddress(resolveClientIp({
|
|
620
|
+
remoteAddr: params.req.socket?.remoteAddress,
|
|
621
|
+
forwardedFor: headerValue(params.req.headers["x-forwarded-for"]),
|
|
622
|
+
realIp: headerValue(params.req.headers["x-real-ip"]),
|
|
623
|
+
trustedProxies: params.trustedProxies,
|
|
624
|
+
allowRealIpFallback: params.allowRealIpFallback
|
|
625
|
+
}), allowedSourceIps);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Resolve the interaction callback URL for an account.
|
|
629
|
+
* Falls back to computing it from interactions.callbackBaseUrl or gateway host config.
|
|
630
|
+
*/
|
|
631
|
+
function computeInteractionCallbackUrl(accountId, cfg) {
|
|
632
|
+
const path = resolveInteractionCallbackPath(accountId);
|
|
633
|
+
const callbackBaseUrl = cfg?.interactions?.callbackBaseUrl?.trim() ?? cfg?.channels?.mattermost?.interactions?.callbackBaseUrl?.trim();
|
|
634
|
+
if (callbackBaseUrl) return `${normalizeCallbackBaseUrl(callbackBaseUrl)}${path}`;
|
|
635
|
+
const port = typeof cfg?.gateway?.port === "number" ? cfg.gateway.port : 18789;
|
|
636
|
+
let host = cfg?.gateway?.customBindHost && !isWildcardBindHost(cfg.gateway.customBindHost) ? cfg.gateway.customBindHost.trim() : "localhost";
|
|
637
|
+
if (host.includes(":") && !(host.startsWith("[") && host.endsWith("]"))) host = `[${host}]`;
|
|
638
|
+
return `http://${host}:${port}${path}`;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Resolve the interaction callback URL for an account.
|
|
642
|
+
* Prefers the in-memory registered URL (set by the gateway monitor) so callers outside the
|
|
643
|
+
* monitor lifecycle can reuse the runtime-validated callback destination.
|
|
644
|
+
*/
|
|
645
|
+
function resolveInteractionCallbackUrl(accountId, cfg) {
|
|
646
|
+
const cached = callbackUrls.get(accountId);
|
|
647
|
+
if (cached) return cached;
|
|
648
|
+
return computeInteractionCallbackUrl(accountId, cfg);
|
|
649
|
+
}
|
|
650
|
+
const interactionSecrets = /* @__PURE__ */ new Map();
|
|
651
|
+
let defaultInteractionSecret;
|
|
652
|
+
function deriveInteractionSecret(botToken) {
|
|
653
|
+
return createHmac("sha256", "openclaw-mattermost-interactions").update(botToken).digest("hex");
|
|
654
|
+
}
|
|
655
|
+
function setInteractionSecret(accountIdOrBotToken, botToken) {
|
|
656
|
+
if (typeof botToken === "string") {
|
|
657
|
+
interactionSecrets.set(accountIdOrBotToken, deriveInteractionSecret(botToken));
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
defaultInteractionSecret = deriveInteractionSecret(accountIdOrBotToken);
|
|
661
|
+
}
|
|
662
|
+
function getInteractionSecret(accountId) {
|
|
663
|
+
const scoped = accountId ? interactionSecrets.get(accountId) : void 0;
|
|
664
|
+
if (scoped) return scoped;
|
|
665
|
+
if (defaultInteractionSecret) return defaultInteractionSecret;
|
|
666
|
+
if (interactionSecrets.size === 1) {
|
|
667
|
+
const first = interactionSecrets.values().next().value;
|
|
668
|
+
if (typeof first === "string") return first;
|
|
669
|
+
}
|
|
670
|
+
throw new Error("Interaction secret not initialized — call setInteractionSecret(accountId, botToken) first");
|
|
671
|
+
}
|
|
672
|
+
function canonicalizeInteractionContext(value) {
|
|
673
|
+
if (Array.isArray(value)) return value.map((item) => canonicalizeInteractionContext(item));
|
|
674
|
+
if (value && typeof value === "object") {
|
|
675
|
+
const entries = Object.entries(value).filter(([, entryValue]) => entryValue !== void 0).sort(([left], [right]) => left.localeCompare(right)).map(([key, entryValue]) => [key, canonicalizeInteractionContext(entryValue)]);
|
|
676
|
+
return Object.fromEntries(entries);
|
|
677
|
+
}
|
|
678
|
+
return value;
|
|
679
|
+
}
|
|
680
|
+
function generateInteractionToken(context, accountId) {
|
|
681
|
+
const secret = getInteractionSecret(accountId);
|
|
682
|
+
const payload = JSON.stringify(canonicalizeInteractionContext(context));
|
|
683
|
+
return createHmac("sha256", secret).update(payload).digest("hex");
|
|
684
|
+
}
|
|
685
|
+
function verifyInteractionToken(context, token, accountId) {
|
|
686
|
+
const expected = generateInteractionToken(context, accountId);
|
|
687
|
+
if (expected.length !== token.length) return false;
|
|
688
|
+
return timingSafeEqual(Buffer.from(expected), Buffer.from(token));
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Build Mattermost `props.attachments` with interactive buttons.
|
|
692
|
+
*
|
|
693
|
+
* Each button includes an HMAC token in its integration context so the
|
|
694
|
+
* callback handler can verify the request originated from a legitimate
|
|
695
|
+
* button click (Mattermost's recommended security pattern).
|
|
696
|
+
*/
|
|
697
|
+
/**
|
|
698
|
+
* Sanitize a button ID so Mattermost's action router can match it.
|
|
699
|
+
* Mattermost uses the action ID in the URL path `/api/v4/posts/{id}/actions/{actionId}`
|
|
700
|
+
* and IDs containing hyphens or underscores break the server-side routing.
|
|
701
|
+
* See: https://github.com/mattermost/mattermost/issues/25747
|
|
702
|
+
*/
|
|
703
|
+
function sanitizeActionId(id) {
|
|
704
|
+
return id.replace(/[-_]/g, "");
|
|
705
|
+
}
|
|
706
|
+
function buildButtonAttachments(params) {
|
|
707
|
+
const actions = params.buttons.map((btn) => {
|
|
708
|
+
const safeId = sanitizeActionId(btn.id);
|
|
709
|
+
const context = {
|
|
710
|
+
action_id: safeId,
|
|
711
|
+
...btn.context
|
|
712
|
+
};
|
|
713
|
+
const token = generateInteractionToken(context, params.accountId);
|
|
714
|
+
return {
|
|
715
|
+
id: safeId,
|
|
716
|
+
type: "button",
|
|
717
|
+
name: btn.name,
|
|
718
|
+
style: btn.style,
|
|
719
|
+
integration: {
|
|
720
|
+
url: params.callbackUrl,
|
|
721
|
+
context: {
|
|
722
|
+
...context,
|
|
723
|
+
_token: token
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
return [{
|
|
729
|
+
text: params.text ?? "",
|
|
730
|
+
actions
|
|
731
|
+
}];
|
|
732
|
+
}
|
|
733
|
+
function buildButtonProps(params) {
|
|
734
|
+
const buttons = params.buttons.flatMap((item) => Array.isArray(item) ? item : [item]).map((btn) => ({
|
|
735
|
+
id: String(btn.id ?? btn.callback_data ?? "").trim(),
|
|
736
|
+
name: String(btn.text ?? btn.name ?? btn.label ?? "").trim(),
|
|
737
|
+
style: btn.style ?? "default",
|
|
738
|
+
context: typeof btn.context === "object" && btn.context !== null ? {
|
|
739
|
+
...btn.context,
|
|
740
|
+
[SIGNED_CHANNEL_ID_CONTEXT_KEY]: params.channelId
|
|
741
|
+
} : { [SIGNED_CHANNEL_ID_CONTEXT_KEY]: params.channelId }
|
|
742
|
+
})).filter((btn) => btn.id && btn.name);
|
|
743
|
+
if (buttons.length === 0) return;
|
|
744
|
+
return { attachments: buildButtonAttachments({
|
|
745
|
+
callbackUrl: params.callbackUrl,
|
|
746
|
+
accountId: params.accountId,
|
|
747
|
+
buttons,
|
|
748
|
+
text: params.text
|
|
749
|
+
}) };
|
|
750
|
+
}
|
|
751
|
+
function readInteractionBody(req) {
|
|
752
|
+
return new Promise((resolve, reject) => {
|
|
753
|
+
const chunks = [];
|
|
754
|
+
let totalBytes = 0;
|
|
755
|
+
const timer = setTimeout(() => {
|
|
756
|
+
req.destroy();
|
|
757
|
+
reject(/* @__PURE__ */ new Error("Request body read timeout"));
|
|
758
|
+
}, INTERACTION_BODY_TIMEOUT_MS);
|
|
759
|
+
req.on("data", (chunk) => {
|
|
760
|
+
totalBytes += chunk.length;
|
|
761
|
+
if (totalBytes > INTERACTION_MAX_BODY_BYTES) {
|
|
762
|
+
req.destroy();
|
|
763
|
+
clearTimeout(timer);
|
|
764
|
+
reject(/* @__PURE__ */ new Error("Request body too large"));
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
chunks.push(chunk);
|
|
768
|
+
});
|
|
769
|
+
req.on("end", () => {
|
|
770
|
+
clearTimeout(timer);
|
|
771
|
+
resolve(Buffer.concat(chunks).toString("utf8"));
|
|
772
|
+
});
|
|
773
|
+
req.on("error", (err) => {
|
|
774
|
+
clearTimeout(timer);
|
|
775
|
+
reject(err);
|
|
776
|
+
});
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
function createMattermostInteractionHandler(params) {
|
|
780
|
+
const { client, accountId, log } = params;
|
|
781
|
+
const core = getMattermostRuntime();
|
|
782
|
+
return async (req, res) => {
|
|
783
|
+
if (req.method !== "POST") {
|
|
784
|
+
res.statusCode = 405;
|
|
785
|
+
res.setHeader("Allow", "POST");
|
|
786
|
+
res.setHeader("Content-Type", "application/json");
|
|
787
|
+
res.end(JSON.stringify({ error: "Method Not Allowed" }));
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
if (!isAllowedInteractionSource({
|
|
791
|
+
req,
|
|
792
|
+
allowedSourceIps: params.allowedSourceIps,
|
|
793
|
+
trustedProxies: params.trustedProxies,
|
|
794
|
+
allowRealIpFallback: params.allowRealIpFallback
|
|
795
|
+
})) {
|
|
796
|
+
log?.(`mattermost interaction: rejected callback source remote=${req.socket?.remoteAddress ?? "?"}`);
|
|
797
|
+
res.statusCode = 403;
|
|
798
|
+
res.setHeader("Content-Type", "application/json");
|
|
799
|
+
res.end(JSON.stringify({ error: "Forbidden origin" }));
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
let payload;
|
|
803
|
+
try {
|
|
804
|
+
const raw = await readInteractionBody(req);
|
|
805
|
+
payload = JSON.parse(raw);
|
|
806
|
+
} catch (err) {
|
|
807
|
+
log?.(`mattermost interaction: failed to parse body: ${String(err)}`);
|
|
808
|
+
res.statusCode = 400;
|
|
809
|
+
res.setHeader("Content-Type", "application/json");
|
|
810
|
+
res.end(JSON.stringify({ error: "Invalid request body" }));
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
const context = payload.context;
|
|
814
|
+
if (!context) {
|
|
815
|
+
res.statusCode = 400;
|
|
816
|
+
res.setHeader("Content-Type", "application/json");
|
|
817
|
+
res.end(JSON.stringify({ error: "Missing context" }));
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
const token = context._token;
|
|
821
|
+
if (typeof token !== "string") {
|
|
822
|
+
log?.("mattermost interaction: missing _token in context");
|
|
823
|
+
res.statusCode = 403;
|
|
824
|
+
res.setHeader("Content-Type", "application/json");
|
|
825
|
+
res.end(JSON.stringify({ error: "Missing token" }));
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
const { _token, ...contextWithoutToken } = context;
|
|
829
|
+
if (!verifyInteractionToken(contextWithoutToken, token, accountId)) {
|
|
830
|
+
log?.("mattermost interaction: invalid _token");
|
|
831
|
+
res.statusCode = 403;
|
|
832
|
+
res.setHeader("Content-Type", "application/json");
|
|
833
|
+
res.end(JSON.stringify({ error: "Invalid token" }));
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
const actionId = context.action_id;
|
|
837
|
+
if (typeof actionId !== "string") {
|
|
838
|
+
res.statusCode = 400;
|
|
839
|
+
res.setHeader("Content-Type", "application/json");
|
|
840
|
+
res.end(JSON.stringify({ error: "Missing action_id in context" }));
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
const signedChannelId = typeof contextWithoutToken[SIGNED_CHANNEL_ID_CONTEXT_KEY] === "string" ? contextWithoutToken[SIGNED_CHANNEL_ID_CONTEXT_KEY].trim() : "";
|
|
844
|
+
if (signedChannelId && signedChannelId !== payload.channel_id) {
|
|
845
|
+
log?.(`mattermost interaction: signed channel mismatch payload=${payload.channel_id} signed=${signedChannelId}`);
|
|
846
|
+
res.statusCode = 403;
|
|
847
|
+
res.setHeader("Content-Type", "application/json");
|
|
848
|
+
res.end(JSON.stringify({ error: "Channel mismatch" }));
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const userName = payload.user_name ?? payload.user_id;
|
|
852
|
+
let originalMessage = "";
|
|
853
|
+
let originalPost = null;
|
|
854
|
+
let clickedButtonName = null;
|
|
855
|
+
try {
|
|
856
|
+
originalPost = await client.request(`/posts/${payload.post_id}`);
|
|
857
|
+
const postChannelId = originalPost.channel_id?.trim();
|
|
858
|
+
if (!postChannelId || postChannelId !== payload.channel_id) {
|
|
859
|
+
log?.(`mattermost interaction: post channel mismatch payload=${payload.channel_id} post=${postChannelId ?? "<missing>"}`);
|
|
860
|
+
res.statusCode = 403;
|
|
861
|
+
res.setHeader("Content-Type", "application/json");
|
|
862
|
+
res.end(JSON.stringify({ error: "Post/channel mismatch" }));
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
originalMessage = originalPost.message ?? "";
|
|
866
|
+
const postAttachments = Array.isArray(originalPost?.props?.attachments) ? originalPost.props.attachments : [];
|
|
867
|
+
for (const att of postAttachments) {
|
|
868
|
+
const match = att.actions?.find((a) => a.id === actionId);
|
|
869
|
+
if (match?.name) {
|
|
870
|
+
clickedButtonName = match.name;
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
if (clickedButtonName === null) {
|
|
875
|
+
log?.(`mattermost interaction: action ${actionId} not found in post ${payload.post_id}`);
|
|
876
|
+
res.statusCode = 403;
|
|
877
|
+
res.setHeader("Content-Type", "application/json");
|
|
878
|
+
res.end(JSON.stringify({ error: "Unknown action" }));
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
} catch (err) {
|
|
882
|
+
log?.(`mattermost interaction: failed to validate post ${payload.post_id}: ${String(err)}`);
|
|
883
|
+
res.statusCode = 500;
|
|
884
|
+
res.setHeader("Content-Type", "application/json");
|
|
885
|
+
res.end(JSON.stringify({ error: "Failed to validate interaction" }));
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
if (!originalPost) {
|
|
889
|
+
log?.(`mattermost interaction: missing fetched post ${payload.post_id}`);
|
|
890
|
+
res.statusCode = 500;
|
|
891
|
+
res.setHeader("Content-Type", "application/json");
|
|
892
|
+
res.end(JSON.stringify({ error: "Failed to load interaction post" }));
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
log?.(`mattermost interaction: action=${actionId} user=${payload.user_name ?? payload.user_id} post=${payload.post_id} channel=${payload.channel_id}`);
|
|
896
|
+
if (params.authorizeButtonClick) try {
|
|
897
|
+
const authorization = await params.authorizeButtonClick({
|
|
898
|
+
payload,
|
|
899
|
+
post: originalPost
|
|
900
|
+
});
|
|
901
|
+
if (!authorization.ok) {
|
|
902
|
+
res.statusCode = authorization.statusCode ?? 200;
|
|
903
|
+
res.setHeader("Content-Type", "application/json");
|
|
904
|
+
res.end(JSON.stringify(authorization.response ?? { ephemeral_text: "You are not allowed to use this action here." }));
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
} catch (err) {
|
|
908
|
+
log?.(`mattermost interaction: authorization failed: ${String(err)}`);
|
|
909
|
+
res.statusCode = 500;
|
|
910
|
+
res.setHeader("Content-Type", "application/json");
|
|
911
|
+
res.end(JSON.stringify({ error: "Interaction authorization failed" }));
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
if (params.handleInteraction) try {
|
|
915
|
+
const response = await params.handleInteraction({
|
|
916
|
+
payload,
|
|
917
|
+
userName,
|
|
918
|
+
actionId,
|
|
919
|
+
actionName: clickedButtonName,
|
|
920
|
+
originalMessage,
|
|
921
|
+
context: contextWithoutToken,
|
|
922
|
+
post: originalPost
|
|
923
|
+
});
|
|
924
|
+
if (response !== null) {
|
|
925
|
+
res.statusCode = 200;
|
|
926
|
+
res.setHeader("Content-Type", "application/json");
|
|
927
|
+
res.end(JSON.stringify(response));
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
} catch (err) {
|
|
931
|
+
log?.(`mattermost interaction: custom handler failed: ${String(err)}`);
|
|
932
|
+
res.statusCode = 500;
|
|
933
|
+
res.setHeader("Content-Type", "application/json");
|
|
934
|
+
res.end(JSON.stringify({ error: "Interaction handler failed" }));
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
try {
|
|
938
|
+
const eventLabel = `Mattermost button click: action="${actionId}" by ${payload.user_name ?? payload.user_id} in channel ${payload.channel_id}`;
|
|
939
|
+
const sessionKey = params.resolveSessionKey ? await params.resolveSessionKey({
|
|
940
|
+
channelId: payload.channel_id,
|
|
941
|
+
userId: payload.user_id,
|
|
942
|
+
post: originalPost
|
|
943
|
+
}) : `agent:main:mattermost:${accountId}:${payload.channel_id}`;
|
|
944
|
+
core.system.enqueueSystemEvent(eventLabel, {
|
|
945
|
+
sessionKey,
|
|
946
|
+
contextKey: `mattermost:interaction:${payload.post_id}:${actionId}`
|
|
947
|
+
});
|
|
948
|
+
} catch (err) {
|
|
949
|
+
log?.(`mattermost interaction: system event dispatch failed: ${String(err)}`);
|
|
950
|
+
}
|
|
951
|
+
try {
|
|
952
|
+
await updateMattermostPost(client, payload.post_id, {
|
|
953
|
+
message: originalMessage,
|
|
954
|
+
props: { attachments: [{ text: `✓ **${clickedButtonName}** selected by @${userName}` }] }
|
|
955
|
+
});
|
|
956
|
+
} catch (err) {
|
|
957
|
+
log?.(`mattermost interaction: failed to update post ${payload.post_id}: ${String(err)}`);
|
|
958
|
+
}
|
|
959
|
+
res.statusCode = 200;
|
|
960
|
+
res.setHeader("Content-Type", "application/json");
|
|
961
|
+
res.end("{}");
|
|
962
|
+
if (params.dispatchButtonClick) try {
|
|
963
|
+
await params.dispatchButtonClick({
|
|
964
|
+
channelId: payload.channel_id,
|
|
965
|
+
userId: payload.user_id,
|
|
966
|
+
userName,
|
|
967
|
+
actionId,
|
|
968
|
+
actionName: clickedButtonName,
|
|
969
|
+
postId: payload.post_id,
|
|
970
|
+
post: originalPost
|
|
971
|
+
});
|
|
972
|
+
} catch (err) {
|
|
973
|
+
log?.(`mattermost interaction: dispatchButtonClick failed: ${String(err)}`);
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
//#endregion
|
|
978
|
+
//#region extensions/mattermost/src/mattermost/model-picker.ts
|
|
979
|
+
const MATTERMOST_MODEL_PICKER_CONTEXT_KEY = "oc_model_picker";
|
|
980
|
+
const MODELS_PAGE_SIZE = 8;
|
|
981
|
+
const ACTION_IDS = {
|
|
982
|
+
providers: "mdlprov",
|
|
983
|
+
list: "mdllist",
|
|
984
|
+
select: "mdlsel",
|
|
985
|
+
back: "mdlback"
|
|
986
|
+
};
|
|
987
|
+
function splitModelRef(modelRef) {
|
|
988
|
+
const match = (modelRef?.trim())?.match(/^([^/]+)\/(.+)$/u);
|
|
989
|
+
if (!match) return null;
|
|
990
|
+
const provider = normalizeProviderId(match[1]);
|
|
991
|
+
const model = match[2].trim();
|
|
992
|
+
if (!provider || !model) return null;
|
|
993
|
+
return {
|
|
994
|
+
provider,
|
|
995
|
+
model
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
function normalizePage(value) {
|
|
999
|
+
if (!Number.isFinite(value)) return 1;
|
|
1000
|
+
return Math.max(1, Math.floor(value));
|
|
1001
|
+
}
|
|
1002
|
+
function paginateItems(items, page, pageSize = MODELS_PAGE_SIZE) {
|
|
1003
|
+
const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
|
|
1004
|
+
const safePage = Math.max(1, Math.min(normalizePage(page), totalPages));
|
|
1005
|
+
const start = (safePage - 1) * pageSize;
|
|
1006
|
+
return {
|
|
1007
|
+
items: items.slice(start, start + pageSize),
|
|
1008
|
+
page: safePage,
|
|
1009
|
+
totalPages,
|
|
1010
|
+
hasPrev: safePage > 1,
|
|
1011
|
+
hasNext: safePage < totalPages,
|
|
1012
|
+
totalItems: items.length
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function buildContext(state) {
|
|
1016
|
+
return {
|
|
1017
|
+
[MATTERMOST_MODEL_PICKER_CONTEXT_KEY]: true,
|
|
1018
|
+
...state
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function buildButtonId(state) {
|
|
1022
|
+
const digest = createHash("sha256").update(JSON.stringify(state)).digest("hex").slice(0, 12);
|
|
1023
|
+
return `${ACTION_IDS[state.action]}${digest}`;
|
|
1024
|
+
}
|
|
1025
|
+
function buildButton(params) {
|
|
1026
|
+
const baseState = params.action === "providers" || params.action === "back" ? {
|
|
1027
|
+
action: params.action,
|
|
1028
|
+
ownerUserId: params.ownerUserId
|
|
1029
|
+
} : params.action === "list" ? {
|
|
1030
|
+
action: "list",
|
|
1031
|
+
ownerUserId: params.ownerUserId,
|
|
1032
|
+
provider: normalizeProviderId(params.provider ?? ""),
|
|
1033
|
+
page: normalizePage(params.page)
|
|
1034
|
+
} : {
|
|
1035
|
+
action: "select",
|
|
1036
|
+
ownerUserId: params.ownerUserId,
|
|
1037
|
+
provider: normalizeProviderId(params.provider ?? ""),
|
|
1038
|
+
page: normalizePage(params.page),
|
|
1039
|
+
model: String(params.model ?? "").trim()
|
|
1040
|
+
};
|
|
1041
|
+
return {
|
|
1042
|
+
id: buildButtonId(baseState),
|
|
1043
|
+
text: params.text,
|
|
1044
|
+
...params.style ? { style: params.style } : {},
|
|
1045
|
+
context: buildContext(baseState)
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
function getProviderModels(data, provider) {
|
|
1049
|
+
return [...data.byProvider.get(normalizeProviderId(provider)) ?? /* @__PURE__ */ new Set()].toSorted();
|
|
1050
|
+
}
|
|
1051
|
+
function formatCurrentModelLine(currentModel) {
|
|
1052
|
+
const parsed = splitModelRef(currentModel);
|
|
1053
|
+
if (!parsed) return "Current: default";
|
|
1054
|
+
return `Current: ${parsed.provider}/${parsed.model}`;
|
|
1055
|
+
}
|
|
1056
|
+
function resolveMattermostModelPickerEntry(commandText) {
|
|
1057
|
+
const normalized = commandText.trim().replace(/\s+/g, " ");
|
|
1058
|
+
if (/^\/model$/i.test(normalized)) return { kind: "summary" };
|
|
1059
|
+
if (/^\/models$/i.test(normalized)) return { kind: "providers" };
|
|
1060
|
+
const providerMatch = normalized.match(/^\/models\s+(\S+)$/i);
|
|
1061
|
+
if (!providerMatch?.[1]) return null;
|
|
1062
|
+
return {
|
|
1063
|
+
kind: "models",
|
|
1064
|
+
provider: normalizeProviderId(providerMatch[1])
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
function parseMattermostModelPickerContext(context) {
|
|
1068
|
+
if (!context || context[MATTERMOST_MODEL_PICKER_CONTEXT_KEY] !== true) return null;
|
|
1069
|
+
const ownerUserId = String(context.ownerUserId ?? "").trim();
|
|
1070
|
+
const action = String(context.action ?? "").trim();
|
|
1071
|
+
if (!ownerUserId) return null;
|
|
1072
|
+
if (action === "providers" || action === "back") return {
|
|
1073
|
+
action,
|
|
1074
|
+
ownerUserId
|
|
1075
|
+
};
|
|
1076
|
+
const provider = normalizeProviderId(String(context.provider ?? ""));
|
|
1077
|
+
const page = Number.parseInt(String(context.page ?? "1"), 10);
|
|
1078
|
+
if (!provider) return null;
|
|
1079
|
+
if (action === "list") return {
|
|
1080
|
+
action,
|
|
1081
|
+
ownerUserId,
|
|
1082
|
+
provider,
|
|
1083
|
+
page: normalizePage(page)
|
|
1084
|
+
};
|
|
1085
|
+
if (action === "select") {
|
|
1086
|
+
const model = String(context.model ?? "").trim();
|
|
1087
|
+
if (!model) return null;
|
|
1088
|
+
return {
|
|
1089
|
+
action,
|
|
1090
|
+
ownerUserId,
|
|
1091
|
+
provider,
|
|
1092
|
+
page: normalizePage(page),
|
|
1093
|
+
model
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
return null;
|
|
1097
|
+
}
|
|
1098
|
+
function buildMattermostAllowedModelRefs(data) {
|
|
1099
|
+
const refs = /* @__PURE__ */ new Set();
|
|
1100
|
+
for (const provider of data.providers) for (const model of data.byProvider.get(provider) ?? []) refs.add(`${provider}/${model}`);
|
|
1101
|
+
return refs;
|
|
1102
|
+
}
|
|
1103
|
+
function resolveMattermostModelPickerCurrentModel(params) {
|
|
1104
|
+
const fallback = `${params.data.resolvedDefault.provider}/${params.data.resolvedDefault.model}`;
|
|
1105
|
+
try {
|
|
1106
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
1107
|
+
const sessionStore = params.skipCache ? loadSessionStore(storePath, { skipCache: true }) : loadSessionStore(storePath);
|
|
1108
|
+
const sessionEntry = sessionStore[params.route.sessionKey];
|
|
1109
|
+
const override = resolveStoredModelOverride({
|
|
1110
|
+
sessionEntry,
|
|
1111
|
+
sessionStore,
|
|
1112
|
+
sessionKey: params.route.sessionKey
|
|
1113
|
+
});
|
|
1114
|
+
if (!override?.model) return fallback;
|
|
1115
|
+
const provider = (override.provider || params.data.resolvedDefault.provider).trim();
|
|
1116
|
+
return provider ? `${provider}/${override.model}` : fallback;
|
|
1117
|
+
} catch {
|
|
1118
|
+
return fallback;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
function renderMattermostModelSummaryView(params) {
|
|
1122
|
+
return {
|
|
1123
|
+
text: [
|
|
1124
|
+
formatCurrentModelLine(params.currentModel),
|
|
1125
|
+
"",
|
|
1126
|
+
"Tap below to browse models, or use:",
|
|
1127
|
+
"/oc_model <provider/model> to switch",
|
|
1128
|
+
"/oc_model status for details"
|
|
1129
|
+
].join("\n"),
|
|
1130
|
+
buttons: [[buildButton({
|
|
1131
|
+
action: "providers",
|
|
1132
|
+
ownerUserId: params.ownerUserId,
|
|
1133
|
+
text: "Browse providers",
|
|
1134
|
+
style: "primary"
|
|
1135
|
+
})]]
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
function renderMattermostProviderPickerView(params) {
|
|
1139
|
+
const currentProvider = splitModelRef(params.currentModel)?.provider;
|
|
1140
|
+
const rows = params.data.providers.map((provider) => [buildButton({
|
|
1141
|
+
action: "list",
|
|
1142
|
+
ownerUserId: params.ownerUserId,
|
|
1143
|
+
text: `${provider} (${params.data.byProvider.get(provider)?.size ?? 0})`,
|
|
1144
|
+
provider,
|
|
1145
|
+
page: 1,
|
|
1146
|
+
style: provider === currentProvider ? "primary" : "default"
|
|
1147
|
+
})]);
|
|
1148
|
+
return {
|
|
1149
|
+
text: [
|
|
1150
|
+
formatCurrentModelLine(params.currentModel),
|
|
1151
|
+
"",
|
|
1152
|
+
"Select a provider:"
|
|
1153
|
+
].join("\n"),
|
|
1154
|
+
buttons: rows
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function renderMattermostModelsPickerView(params) {
|
|
1158
|
+
const provider = normalizeProviderId(params.provider);
|
|
1159
|
+
const models = getProviderModels(params.data, provider);
|
|
1160
|
+
const current = splitModelRef(params.currentModel);
|
|
1161
|
+
if (models.length === 0) return {
|
|
1162
|
+
text: [
|
|
1163
|
+
formatCurrentModelLine(params.currentModel),
|
|
1164
|
+
"",
|
|
1165
|
+
`Unknown provider: ${provider}`
|
|
1166
|
+
].join("\n"),
|
|
1167
|
+
buttons: [[buildButton({
|
|
1168
|
+
action: "back",
|
|
1169
|
+
ownerUserId: params.ownerUserId,
|
|
1170
|
+
text: "Back to providers"
|
|
1171
|
+
})]]
|
|
1172
|
+
};
|
|
1173
|
+
const page = paginateItems(models, params.page);
|
|
1174
|
+
const rows = page.items.map((model) => {
|
|
1175
|
+
const isCurrent = current?.provider === provider && current.model === model;
|
|
1176
|
+
return [buildButton({
|
|
1177
|
+
action: "select",
|
|
1178
|
+
ownerUserId: params.ownerUserId,
|
|
1179
|
+
text: isCurrent ? `${model} [current]` : model,
|
|
1180
|
+
provider,
|
|
1181
|
+
model,
|
|
1182
|
+
page: page.page,
|
|
1183
|
+
style: isCurrent ? "primary" : "default"
|
|
1184
|
+
})];
|
|
1185
|
+
});
|
|
1186
|
+
const navRow = [];
|
|
1187
|
+
if (page.hasPrev) navRow.push(buildButton({
|
|
1188
|
+
action: "list",
|
|
1189
|
+
ownerUserId: params.ownerUserId,
|
|
1190
|
+
text: "Prev",
|
|
1191
|
+
provider,
|
|
1192
|
+
page: page.page - 1
|
|
1193
|
+
}));
|
|
1194
|
+
if (page.hasNext) navRow.push(buildButton({
|
|
1195
|
+
action: "list",
|
|
1196
|
+
ownerUserId: params.ownerUserId,
|
|
1197
|
+
text: "Next",
|
|
1198
|
+
provider,
|
|
1199
|
+
page: page.page + 1
|
|
1200
|
+
}));
|
|
1201
|
+
if (navRow.length > 0) rows.push(navRow);
|
|
1202
|
+
rows.push([buildButton({
|
|
1203
|
+
action: "back",
|
|
1204
|
+
ownerUserId: params.ownerUserId,
|
|
1205
|
+
text: "Back to providers"
|
|
1206
|
+
})]);
|
|
1207
|
+
return {
|
|
1208
|
+
text: [
|
|
1209
|
+
`Models (${provider}) - ${page.totalItems} available`,
|
|
1210
|
+
formatCurrentModelLine(params.currentModel),
|
|
1211
|
+
`Page ${page.page}/${page.totalPages}`,
|
|
1212
|
+
"Select a model to switch immediately."
|
|
1213
|
+
].join("\n"),
|
|
1214
|
+
buttons: rows
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region extensions/mattermost/src/mattermost/monitor-auth.ts
|
|
1219
|
+
function normalizeMattermostAllowEntry(entry) {
|
|
1220
|
+
const trimmed = entry.trim();
|
|
1221
|
+
if (!trimmed) return "";
|
|
1222
|
+
if (trimmed === "*") return "*";
|
|
1223
|
+
return trimmed.replace(/^(mattermost|user):/i, "").replace(/^@/, "").toLowerCase();
|
|
1224
|
+
}
|
|
1225
|
+
function normalizeMattermostAllowList(entries) {
|
|
1226
|
+
const normalized = entries.map((entry) => normalizeMattermostAllowEntry(String(entry))).filter(Boolean);
|
|
1227
|
+
return Array.from(new Set(normalized));
|
|
1228
|
+
}
|
|
1229
|
+
function resolveMattermostEffectiveAllowFromLists(params) {
|
|
1230
|
+
return resolveEffectiveAllowFromLists({
|
|
1231
|
+
allowFrom: normalizeMattermostAllowList(params.allowFrom ?? []),
|
|
1232
|
+
groupAllowFrom: normalizeMattermostAllowList(params.groupAllowFrom ?? []),
|
|
1233
|
+
storeAllowFrom: normalizeMattermostAllowList(params.storeAllowFrom ?? []),
|
|
1234
|
+
dmPolicy: params.dmPolicy
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
function isMattermostSenderAllowed(params) {
|
|
1238
|
+
const allowFrom = normalizeMattermostAllowList(params.allowFrom);
|
|
1239
|
+
if (allowFrom.length === 0) return false;
|
|
1240
|
+
return resolveAllowlistMatchSimple({
|
|
1241
|
+
allowFrom,
|
|
1242
|
+
senderId: normalizeMattermostAllowEntry(params.senderId),
|
|
1243
|
+
senderName: params.senderName ? normalizeMattermostAllowEntry(params.senderName) : void 0,
|
|
1244
|
+
allowNameMatching: params.allowNameMatching
|
|
1245
|
+
}).allowed;
|
|
1246
|
+
}
|
|
1247
|
+
function mapMattermostChannelKind(channelType) {
|
|
1248
|
+
const normalized = channelType?.trim().toUpperCase();
|
|
1249
|
+
if (normalized === "D") return "direct";
|
|
1250
|
+
if (normalized === "G" || normalized === "P") return "group";
|
|
1251
|
+
return "channel";
|
|
1252
|
+
}
|
|
1253
|
+
function authorizeMattermostCommandInvocation(params) {
|
|
1254
|
+
const { account, cfg, senderId, senderName, channelId, channelInfo, storeAllowFrom, allowTextCommands, hasControlCommand } = params;
|
|
1255
|
+
if (!channelInfo) return {
|
|
1256
|
+
ok: false,
|
|
1257
|
+
denyReason: "unknown-channel",
|
|
1258
|
+
commandAuthorized: false,
|
|
1259
|
+
channelInfo: null,
|
|
1260
|
+
kind: "channel",
|
|
1261
|
+
chatType: "channel",
|
|
1262
|
+
channelName: "",
|
|
1263
|
+
channelDisplay: "",
|
|
1264
|
+
roomLabel: `#${channelId}`
|
|
1265
|
+
};
|
|
1266
|
+
const kind = mapMattermostChannelKind(channelInfo.type);
|
|
1267
|
+
const chatType = kind;
|
|
1268
|
+
const channelName = channelInfo.name ?? "";
|
|
1269
|
+
const channelDisplay = channelInfo.display_name ?? channelName;
|
|
1270
|
+
const roomLabel = channelName ? `#${channelName}` : channelDisplay || `#${channelId}`;
|
|
1271
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
1272
|
+
const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
|
|
1273
|
+
const groupPolicy = account.config.groupPolicy ?? defaultGroupPolicy ?? "allowlist";
|
|
1274
|
+
const allowNameMatching = isDangerousNameMatchingEnabled(account.config);
|
|
1275
|
+
const configAllowFrom = normalizeMattermostAllowList(account.config.allowFrom ?? []);
|
|
1276
|
+
const configGroupAllowFrom = normalizeMattermostAllowList(account.config.groupAllowFrom ?? []);
|
|
1277
|
+
const { effectiveAllowFrom, effectiveGroupAllowFrom } = resolveMattermostEffectiveAllowFromLists({
|
|
1278
|
+
allowFrom: configAllowFrom,
|
|
1279
|
+
groupAllowFrom: configGroupAllowFrom,
|
|
1280
|
+
storeAllowFrom: normalizeMattermostAllowList(storeAllowFrom ?? []),
|
|
1281
|
+
dmPolicy
|
|
1282
|
+
});
|
|
1283
|
+
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
1284
|
+
const commandDmAllowFrom = kind === "direct" ? effectiveAllowFrom : configAllowFrom;
|
|
1285
|
+
const commandGroupAllowFrom = kind === "direct" ? effectiveGroupAllowFrom : configGroupAllowFrom.length > 0 ? configGroupAllowFrom : configAllowFrom;
|
|
1286
|
+
const senderAllowedForCommands = isMattermostSenderAllowed({
|
|
1287
|
+
senderId,
|
|
1288
|
+
senderName,
|
|
1289
|
+
allowFrom: commandDmAllowFrom,
|
|
1290
|
+
allowNameMatching
|
|
1291
|
+
});
|
|
1292
|
+
const groupAllowedForCommands = isMattermostSenderAllowed({
|
|
1293
|
+
senderId,
|
|
1294
|
+
senderName,
|
|
1295
|
+
allowFrom: commandGroupAllowFrom,
|
|
1296
|
+
allowNameMatching
|
|
1297
|
+
});
|
|
1298
|
+
const commandGate = resolveControlCommandGate({
|
|
1299
|
+
useAccessGroups,
|
|
1300
|
+
authorizers: [{
|
|
1301
|
+
configured: commandDmAllowFrom.length > 0,
|
|
1302
|
+
allowed: senderAllowedForCommands
|
|
1303
|
+
}, {
|
|
1304
|
+
configured: commandGroupAllowFrom.length > 0,
|
|
1305
|
+
allowed: groupAllowedForCommands
|
|
1306
|
+
}],
|
|
1307
|
+
allowTextCommands,
|
|
1308
|
+
hasControlCommand: allowTextCommands && hasControlCommand
|
|
1309
|
+
});
|
|
1310
|
+
const commandAuthorized = kind === "direct" ? dmPolicy === "open" || senderAllowedForCommands : commandGate.commandAuthorized;
|
|
1311
|
+
if (kind === "direct") {
|
|
1312
|
+
if (dmPolicy === "disabled") return {
|
|
1313
|
+
ok: false,
|
|
1314
|
+
denyReason: "dm-disabled",
|
|
1315
|
+
commandAuthorized: false,
|
|
1316
|
+
channelInfo,
|
|
1317
|
+
kind,
|
|
1318
|
+
chatType,
|
|
1319
|
+
channelName,
|
|
1320
|
+
channelDisplay,
|
|
1321
|
+
roomLabel
|
|
1322
|
+
};
|
|
1323
|
+
if (dmPolicy !== "open" && !senderAllowedForCommands) return {
|
|
1324
|
+
ok: false,
|
|
1325
|
+
denyReason: dmPolicy === "pairing" ? "dm-pairing" : "unauthorized",
|
|
1326
|
+
commandAuthorized: false,
|
|
1327
|
+
channelInfo,
|
|
1328
|
+
kind,
|
|
1329
|
+
chatType,
|
|
1330
|
+
channelName,
|
|
1331
|
+
channelDisplay,
|
|
1332
|
+
roomLabel
|
|
1333
|
+
};
|
|
1334
|
+
} else {
|
|
1335
|
+
const senderGroupAccess = evaluateSenderGroupAccessForPolicy({
|
|
1336
|
+
groupPolicy,
|
|
1337
|
+
groupAllowFrom: effectiveGroupAllowFrom,
|
|
1338
|
+
senderId,
|
|
1339
|
+
isSenderAllowed: (_senderId, allowFrom) => isMattermostSenderAllowed({
|
|
1340
|
+
senderId,
|
|
1341
|
+
senderName,
|
|
1342
|
+
allowFrom,
|
|
1343
|
+
allowNameMatching
|
|
1344
|
+
})
|
|
1345
|
+
});
|
|
1346
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "disabled") return {
|
|
1347
|
+
ok: false,
|
|
1348
|
+
denyReason: "channels-disabled",
|
|
1349
|
+
commandAuthorized: false,
|
|
1350
|
+
channelInfo,
|
|
1351
|
+
kind,
|
|
1352
|
+
chatType,
|
|
1353
|
+
channelName,
|
|
1354
|
+
channelDisplay,
|
|
1355
|
+
roomLabel
|
|
1356
|
+
};
|
|
1357
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "empty_allowlist") return {
|
|
1358
|
+
ok: false,
|
|
1359
|
+
denyReason: "channel-no-allowlist",
|
|
1360
|
+
commandAuthorized: false,
|
|
1361
|
+
channelInfo,
|
|
1362
|
+
kind,
|
|
1363
|
+
chatType,
|
|
1364
|
+
channelName,
|
|
1365
|
+
channelDisplay,
|
|
1366
|
+
roomLabel
|
|
1367
|
+
};
|
|
1368
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "sender_not_allowlisted") return {
|
|
1369
|
+
ok: false,
|
|
1370
|
+
denyReason: "unauthorized",
|
|
1371
|
+
commandAuthorized: false,
|
|
1372
|
+
channelInfo,
|
|
1373
|
+
kind,
|
|
1374
|
+
chatType,
|
|
1375
|
+
channelName,
|
|
1376
|
+
channelDisplay,
|
|
1377
|
+
roomLabel
|
|
1378
|
+
};
|
|
1379
|
+
if (commandGate.shouldBlock) return {
|
|
1380
|
+
ok: false,
|
|
1381
|
+
denyReason: "unauthorized",
|
|
1382
|
+
commandAuthorized: false,
|
|
1383
|
+
channelInfo,
|
|
1384
|
+
kind,
|
|
1385
|
+
chatType,
|
|
1386
|
+
channelName,
|
|
1387
|
+
channelDisplay,
|
|
1388
|
+
roomLabel
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
return {
|
|
1392
|
+
ok: true,
|
|
1393
|
+
commandAuthorized,
|
|
1394
|
+
channelInfo,
|
|
1395
|
+
kind,
|
|
1396
|
+
chatType,
|
|
1397
|
+
channelName,
|
|
1398
|
+
channelDisplay,
|
|
1399
|
+
roomLabel
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
//#endregion
|
|
1403
|
+
//#region extensions/mattermost/src/mattermost/monitor-gating.ts
|
|
1404
|
+
function mapMattermostChannelTypeToChatType(channelType) {
|
|
1405
|
+
if (!channelType) return "channel";
|
|
1406
|
+
const normalized = channelType.trim().toUpperCase();
|
|
1407
|
+
if (normalized === "D") return "direct";
|
|
1408
|
+
if (normalized === "G" || normalized === "P") return "group";
|
|
1409
|
+
return "channel";
|
|
1410
|
+
}
|
|
1411
|
+
function evaluateMattermostMentionGate(params) {
|
|
1412
|
+
const shouldRequireMention = params.kind !== "direct" && params.resolveRequireMention({
|
|
1413
|
+
cfg: params.cfg,
|
|
1414
|
+
channel: "mattermost",
|
|
1415
|
+
accountId: params.accountId,
|
|
1416
|
+
groupId: params.channelId,
|
|
1417
|
+
requireMentionOverride: params.requireMentionOverride
|
|
1418
|
+
});
|
|
1419
|
+
const shouldBypassMention = params.isControlCommand && shouldRequireMention && !params.wasMentioned && params.commandAuthorized;
|
|
1420
|
+
const effectiveWasMentioned = params.wasMentioned || shouldBypassMention || params.oncharTriggered;
|
|
1421
|
+
if (params.oncharEnabled && !params.oncharTriggered && !params.wasMentioned && !params.isControlCommand) return {
|
|
1422
|
+
shouldRequireMention,
|
|
1423
|
+
shouldBypassMention,
|
|
1424
|
+
effectiveWasMentioned,
|
|
1425
|
+
dropReason: "onchar-not-triggered"
|
|
1426
|
+
};
|
|
1427
|
+
if (params.kind !== "direct" && shouldRequireMention && params.canDetectMention && !effectiveWasMentioned) return {
|
|
1428
|
+
shouldRequireMention,
|
|
1429
|
+
shouldBypassMention,
|
|
1430
|
+
effectiveWasMentioned,
|
|
1431
|
+
dropReason: "missing-mention"
|
|
1432
|
+
};
|
|
1433
|
+
return {
|
|
1434
|
+
shouldRequireMention,
|
|
1435
|
+
shouldBypassMention,
|
|
1436
|
+
effectiveWasMentioned,
|
|
1437
|
+
dropReason: null
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
//#endregion
|
|
1441
|
+
//#region extensions/mattermost/src/mattermost/monitor-helpers.ts
|
|
1442
|
+
const formatInboundFromLabel = formatInboundFromLabel$1;
|
|
1443
|
+
function resolveThreadSessionKeys(params) {
|
|
1444
|
+
return resolveThreadSessionKeys$1({
|
|
1445
|
+
...params,
|
|
1446
|
+
normalizeThreadId: (threadId) => threadId
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Strip bot mention from message text while preserving newlines and
|
|
1451
|
+
* block-level Markdown formatting (headings, lists, blockquotes).
|
|
1452
|
+
*/
|
|
1453
|
+
function normalizeMention(text, mention) {
|
|
1454
|
+
if (!mention) return text.trim();
|
|
1455
|
+
const escaped = mention.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1456
|
+
const hasMentionRe = new RegExp(`@${escaped}\\b`, "i");
|
|
1457
|
+
const leadingMentionRe = new RegExp(`^([\\t ]*)@${escaped}\\b[\\t ]*`, "i");
|
|
1458
|
+
const trailingMentionRe = new RegExp(`[\\t ]*@${escaped}\\b[\\t ]*$`, "i");
|
|
1459
|
+
const normalizedLines = text.split("\n").map((line) => {
|
|
1460
|
+
const hadMention = hasMentionRe.test(line);
|
|
1461
|
+
const normalizedLine = line.replace(leadingMentionRe, "$1").replace(trailingMentionRe, "").replace(new RegExp(`@${escaped}\\b`, "gi"), "").replace(/(\S)[ \t]{2,}/g, "$1 ");
|
|
1462
|
+
return {
|
|
1463
|
+
text: normalizedLine,
|
|
1464
|
+
mentionOnlyBlank: hadMention && normalizedLine.trim() === ""
|
|
1465
|
+
};
|
|
1466
|
+
});
|
|
1467
|
+
while (normalizedLines[0]?.mentionOnlyBlank) normalizedLines.shift();
|
|
1468
|
+
while (normalizedLines.at(-1)?.text.trim() === "") normalizedLines.pop();
|
|
1469
|
+
return normalizedLines.map((line) => line.text).join("\n");
|
|
1470
|
+
}
|
|
1471
|
+
//#endregion
|
|
1472
|
+
//#region extensions/mattermost/src/mattermost/monitor-onchar.ts
|
|
1473
|
+
const DEFAULT_ONCHAR_PREFIXES = [">", "!"];
|
|
1474
|
+
function resolveOncharPrefixes(prefixes) {
|
|
1475
|
+
const cleaned = prefixes?.map((entry) => entry.trim()).filter(Boolean) ?? DEFAULT_ONCHAR_PREFIXES;
|
|
1476
|
+
return cleaned.length > 0 ? cleaned : DEFAULT_ONCHAR_PREFIXES;
|
|
1477
|
+
}
|
|
1478
|
+
function stripOncharPrefix(text, prefixes) {
|
|
1479
|
+
const trimmed = text.trimStart();
|
|
1480
|
+
for (const prefix of prefixes) {
|
|
1481
|
+
if (!prefix) continue;
|
|
1482
|
+
if (trimmed.startsWith(prefix)) return {
|
|
1483
|
+
triggered: true,
|
|
1484
|
+
stripped: trimmed.slice(prefix.length).trimStart()
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
return {
|
|
1488
|
+
triggered: false,
|
|
1489
|
+
stripped: text
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region extensions/mattermost/src/mattermost/monitor-resources.ts
|
|
1494
|
+
const CHANNEL_CACHE_TTL_MS = 5 * 6e4;
|
|
1495
|
+
const USER_CACHE_TTL_MS = 10 * 6e4;
|
|
1496
|
+
function createMattermostMonitorResources(params) {
|
|
1497
|
+
const { accountId, callbackUrl, client, logger, mediaMaxBytes, fetchRemoteMedia, saveMediaBuffer, mediaKindFromMime } = params;
|
|
1498
|
+
const channelCache = /* @__PURE__ */ new Map();
|
|
1499
|
+
const userCache = /* @__PURE__ */ new Map();
|
|
1500
|
+
const resolveMattermostMedia = async (fileIds) => {
|
|
1501
|
+
const ids = (fileIds ?? []).map((id) => id?.trim()).filter(Boolean);
|
|
1502
|
+
if (ids.length === 0) return [];
|
|
1503
|
+
const out = [];
|
|
1504
|
+
for (const fileId of ids) try {
|
|
1505
|
+
const fetched = await fetchRemoteMedia({
|
|
1506
|
+
url: `${client.apiBaseUrl}/files/${fileId}`,
|
|
1507
|
+
requestInit: { headers: { Authorization: `Bearer ${client.token}` } },
|
|
1508
|
+
filePathHint: fileId,
|
|
1509
|
+
maxBytes: mediaMaxBytes,
|
|
1510
|
+
ssrfPolicy: { allowedHostnames: [new URL(client.baseUrl).hostname] }
|
|
1511
|
+
});
|
|
1512
|
+
const saved = await saveMediaBuffer(Buffer.from(fetched.buffer), fetched.contentType ?? void 0, "inbound", mediaMaxBytes);
|
|
1513
|
+
const contentType = saved.contentType ?? fetched.contentType ?? void 0;
|
|
1514
|
+
out.push({
|
|
1515
|
+
path: saved.path,
|
|
1516
|
+
contentType,
|
|
1517
|
+
kind: mediaKindFromMime(contentType) ?? "unknown"
|
|
1518
|
+
});
|
|
1519
|
+
} catch (err) {
|
|
1520
|
+
logger.debug?.(`mattermost: failed to download file ${fileId}: ${String(err)}`);
|
|
1521
|
+
}
|
|
1522
|
+
return out;
|
|
1523
|
+
};
|
|
1524
|
+
const sendTypingIndicator = async (channelId, parentId) => {
|
|
1525
|
+
await sendMattermostTyping(client, {
|
|
1526
|
+
channelId,
|
|
1527
|
+
parentId
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
const resolveChannelInfo = async (channelId) => {
|
|
1531
|
+
const cached = channelCache.get(channelId);
|
|
1532
|
+
if (cached && cached.expiresAt > Date.now()) return cached.value;
|
|
1533
|
+
try {
|
|
1534
|
+
const info = await fetchMattermostChannel(client, channelId);
|
|
1535
|
+
channelCache.set(channelId, {
|
|
1536
|
+
value: info,
|
|
1537
|
+
expiresAt: Date.now() + CHANNEL_CACHE_TTL_MS
|
|
1538
|
+
});
|
|
1539
|
+
return info;
|
|
1540
|
+
} catch (err) {
|
|
1541
|
+
logger.debug?.(`mattermost: channel lookup failed: ${String(err)}`);
|
|
1542
|
+
channelCache.set(channelId, {
|
|
1543
|
+
value: null,
|
|
1544
|
+
expiresAt: Date.now() + CHANNEL_CACHE_TTL_MS
|
|
1545
|
+
});
|
|
1546
|
+
return null;
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
const resolveUserInfo = async (userId) => {
|
|
1550
|
+
const cached = userCache.get(userId);
|
|
1551
|
+
if (cached && cached.expiresAt > Date.now()) return cached.value;
|
|
1552
|
+
try {
|
|
1553
|
+
const info = await fetchMattermostUser(client, userId);
|
|
1554
|
+
userCache.set(userId, {
|
|
1555
|
+
value: info,
|
|
1556
|
+
expiresAt: Date.now() + USER_CACHE_TTL_MS
|
|
1557
|
+
});
|
|
1558
|
+
return info;
|
|
1559
|
+
} catch (err) {
|
|
1560
|
+
logger.debug?.(`mattermost: user lookup failed: ${String(err)}`);
|
|
1561
|
+
userCache.set(userId, {
|
|
1562
|
+
value: null,
|
|
1563
|
+
expiresAt: Date.now() + USER_CACHE_TTL_MS
|
|
1564
|
+
});
|
|
1565
|
+
return null;
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
const buildModelPickerProps = (channelId, buttons) => buildButtonProps({
|
|
1569
|
+
callbackUrl,
|
|
1570
|
+
accountId,
|
|
1571
|
+
channelId,
|
|
1572
|
+
buttons
|
|
1573
|
+
});
|
|
1574
|
+
const updateModelPickerPost = async (params) => {
|
|
1575
|
+
const props = buildModelPickerProps(params.channelId, params.buttons ?? []) ?? { attachments: [] };
|
|
1576
|
+
await updateMattermostPost(client, params.postId, {
|
|
1577
|
+
message: params.message,
|
|
1578
|
+
props
|
|
1579
|
+
});
|
|
1580
|
+
return {};
|
|
1581
|
+
};
|
|
1582
|
+
return {
|
|
1583
|
+
resolveMattermostMedia,
|
|
1584
|
+
sendTypingIndicator,
|
|
1585
|
+
resolveChannelInfo,
|
|
1586
|
+
resolveUserInfo,
|
|
1587
|
+
updateModelPickerPost
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region extensions/mattermost/src/mattermost/slash-commands.ts
|
|
1592
|
+
/**
|
|
1593
|
+
* Built-in OpenClaw commands to register as native slash commands.
|
|
1594
|
+
* These mirror the text-based commands already handled by the gateway.
|
|
1595
|
+
*/
|
|
1596
|
+
const DEFAULT_COMMAND_SPECS = [
|
|
1597
|
+
{
|
|
1598
|
+
trigger: "oc_status",
|
|
1599
|
+
originalName: "status",
|
|
1600
|
+
description: "Show session status (model, usage, uptime)",
|
|
1601
|
+
autoComplete: true
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
trigger: "oc_model",
|
|
1605
|
+
originalName: "model",
|
|
1606
|
+
description: "View or change the current model",
|
|
1607
|
+
autoComplete: true,
|
|
1608
|
+
autoCompleteHint: "[model-name]"
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
trigger: "oc_models",
|
|
1612
|
+
originalName: "models",
|
|
1613
|
+
description: "Browse available models",
|
|
1614
|
+
autoComplete: true,
|
|
1615
|
+
autoCompleteHint: "[provider]"
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
trigger: "oc_new",
|
|
1619
|
+
originalName: "new",
|
|
1620
|
+
description: "Start a new conversation session",
|
|
1621
|
+
autoComplete: true
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
trigger: "oc_help",
|
|
1625
|
+
originalName: "help",
|
|
1626
|
+
description: "Show available commands",
|
|
1627
|
+
autoComplete: true
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
trigger: "oc_think",
|
|
1631
|
+
originalName: "think",
|
|
1632
|
+
description: "Set thinking/reasoning level",
|
|
1633
|
+
autoComplete: true,
|
|
1634
|
+
autoCompleteHint: "[off|low|medium|high]"
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
trigger: "oc_reasoning",
|
|
1638
|
+
originalName: "reasoning",
|
|
1639
|
+
description: "Toggle reasoning mode",
|
|
1640
|
+
autoComplete: true,
|
|
1641
|
+
autoCompleteHint: "[on|off]"
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
trigger: "oc_verbose",
|
|
1645
|
+
originalName: "verbose",
|
|
1646
|
+
description: "Toggle verbose mode",
|
|
1647
|
+
autoComplete: true,
|
|
1648
|
+
autoCompleteHint: "[on|off]"
|
|
1649
|
+
}
|
|
1650
|
+
];
|
|
1651
|
+
/**
|
|
1652
|
+
* List existing custom slash commands for a team.
|
|
1653
|
+
*/
|
|
1654
|
+
async function listMattermostCommands(client, teamId) {
|
|
1655
|
+
return await client.request(`/commands?team_id=${encodeURIComponent(teamId)}&custom_only=true`);
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Create a custom slash command on a Mattermost team.
|
|
1659
|
+
*/
|
|
1660
|
+
async function createMattermostCommand(client, params) {
|
|
1661
|
+
return await client.request("/commands", {
|
|
1662
|
+
method: "POST",
|
|
1663
|
+
body: JSON.stringify(params)
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Delete a custom slash command.
|
|
1668
|
+
*/
|
|
1669
|
+
async function deleteMattermostCommand(client, commandId) {
|
|
1670
|
+
await client.request(`/commands/${encodeURIComponent(commandId)}`, { method: "DELETE" });
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Update an existing custom slash command.
|
|
1674
|
+
*/
|
|
1675
|
+
async function updateMattermostCommand(client, params) {
|
|
1676
|
+
return await client.request(`/commands/${encodeURIComponent(params.id)}`, {
|
|
1677
|
+
method: "PUT",
|
|
1678
|
+
body: JSON.stringify(params)
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Register all OpenClaw slash commands for a given team.
|
|
1683
|
+
* Skips commands that are already registered with the same trigger + callback URL.
|
|
1684
|
+
* Returns the list of newly created command IDs.
|
|
1685
|
+
*/
|
|
1686
|
+
async function registerSlashCommands(params) {
|
|
1687
|
+
const { client, teamId, creatorUserId, callbackUrl, commands, log } = params;
|
|
1688
|
+
const normalizedCreatorUserId = creatorUserId.trim();
|
|
1689
|
+
if (!normalizedCreatorUserId) throw new Error("creatorUserId is required for slash command reconciliation");
|
|
1690
|
+
let existing = [];
|
|
1691
|
+
try {
|
|
1692
|
+
existing = await listMattermostCommands(client, teamId);
|
|
1693
|
+
} catch (err) {
|
|
1694
|
+
log?.(`mattermost: failed to list existing commands: ${String(err)}`);
|
|
1695
|
+
throw err;
|
|
1696
|
+
}
|
|
1697
|
+
const existingByTrigger = /* @__PURE__ */ new Map();
|
|
1698
|
+
for (const cmd of existing) {
|
|
1699
|
+
const list = existingByTrigger.get(cmd.trigger) ?? [];
|
|
1700
|
+
list.push(cmd);
|
|
1701
|
+
existingByTrigger.set(cmd.trigger, list);
|
|
1702
|
+
}
|
|
1703
|
+
const registered = [];
|
|
1704
|
+
for (const spec of commands) {
|
|
1705
|
+
const existingForTrigger = existingByTrigger.get(spec.trigger) ?? [];
|
|
1706
|
+
const ownedCommands = existingForTrigger.filter((cmd) => cmd.creator_id?.trim() === normalizedCreatorUserId);
|
|
1707
|
+
const foreignCommands = existingForTrigger.filter((cmd) => cmd.creator_id?.trim() !== normalizedCreatorUserId);
|
|
1708
|
+
if (ownedCommands.length === 0 && foreignCommands.length > 0) {
|
|
1709
|
+
log?.(`mattermost: trigger /${spec.trigger} already used by non-OpenClaw command(s); skipping to avoid mutating external integrations`);
|
|
1710
|
+
continue;
|
|
1711
|
+
}
|
|
1712
|
+
if (ownedCommands.length > 1) log?.(`mattermost: multiple owned commands found for /${spec.trigger}; using the first and leaving extras untouched`);
|
|
1713
|
+
const existingCmd = ownedCommands[0];
|
|
1714
|
+
if (existingCmd && existingCmd.url === callbackUrl) {
|
|
1715
|
+
log?.(`mattermost: command /${spec.trigger} already registered (id=${existingCmd.id})`);
|
|
1716
|
+
registered.push({
|
|
1717
|
+
id: existingCmd.id,
|
|
1718
|
+
trigger: spec.trigger,
|
|
1719
|
+
teamId,
|
|
1720
|
+
token: existingCmd.token,
|
|
1721
|
+
managed: false
|
|
1722
|
+
});
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
if (existingCmd && existingCmd.url !== callbackUrl) {
|
|
1726
|
+
log?.(`mattermost: command /${spec.trigger} exists with different callback URL; updating (id=${existingCmd.id})`);
|
|
1727
|
+
try {
|
|
1728
|
+
const updated = await updateMattermostCommand(client, {
|
|
1729
|
+
id: existingCmd.id,
|
|
1730
|
+
team_id: teamId,
|
|
1731
|
+
trigger: spec.trigger,
|
|
1732
|
+
method: "P",
|
|
1733
|
+
url: callbackUrl,
|
|
1734
|
+
description: spec.description,
|
|
1735
|
+
auto_complete: spec.autoComplete,
|
|
1736
|
+
auto_complete_desc: spec.description,
|
|
1737
|
+
auto_complete_hint: spec.autoCompleteHint
|
|
1738
|
+
});
|
|
1739
|
+
registered.push({
|
|
1740
|
+
id: updated.id,
|
|
1741
|
+
trigger: spec.trigger,
|
|
1742
|
+
teamId,
|
|
1743
|
+
token: updated.token,
|
|
1744
|
+
managed: false
|
|
1745
|
+
});
|
|
1746
|
+
continue;
|
|
1747
|
+
} catch (err) {
|
|
1748
|
+
log?.(`mattermost: failed to update command /${spec.trigger} (id=${existingCmd.id}): ${String(err)}`);
|
|
1749
|
+
try {
|
|
1750
|
+
await deleteMattermostCommand(client, existingCmd.id);
|
|
1751
|
+
log?.(`mattermost: deleted stale command /${spec.trigger} (id=${existingCmd.id})`);
|
|
1752
|
+
} catch (deleteErr) {
|
|
1753
|
+
log?.(`mattermost: failed to delete stale command /${spec.trigger} (id=${existingCmd.id}): ${String(deleteErr)}`);
|
|
1754
|
+
continue;
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
try {
|
|
1759
|
+
const created = await createMattermostCommand(client, {
|
|
1760
|
+
team_id: teamId,
|
|
1761
|
+
trigger: spec.trigger,
|
|
1762
|
+
method: "P",
|
|
1763
|
+
url: callbackUrl,
|
|
1764
|
+
description: spec.description,
|
|
1765
|
+
auto_complete: spec.autoComplete,
|
|
1766
|
+
auto_complete_desc: spec.description,
|
|
1767
|
+
auto_complete_hint: spec.autoCompleteHint
|
|
1768
|
+
});
|
|
1769
|
+
log?.(`mattermost: registered command /${spec.trigger} (id=${created.id})`);
|
|
1770
|
+
registered.push({
|
|
1771
|
+
id: created.id,
|
|
1772
|
+
trigger: spec.trigger,
|
|
1773
|
+
teamId,
|
|
1774
|
+
token: created.token,
|
|
1775
|
+
managed: true
|
|
1776
|
+
});
|
|
1777
|
+
} catch (err) {
|
|
1778
|
+
log?.(`mattermost: failed to register command /${spec.trigger}: ${String(err)}`);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return registered;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Clean up all registered slash commands.
|
|
1785
|
+
*/
|
|
1786
|
+
async function cleanupSlashCommands(params) {
|
|
1787
|
+
const { client, commands, log } = params;
|
|
1788
|
+
for (const cmd of commands) {
|
|
1789
|
+
if (!cmd.managed) continue;
|
|
1790
|
+
try {
|
|
1791
|
+
await deleteMattermostCommand(client, cmd.id);
|
|
1792
|
+
log?.(`mattermost: deleted command /${cmd.trigger} (id=${cmd.id})`);
|
|
1793
|
+
} catch (err) {
|
|
1794
|
+
log?.(`mattermost: failed to delete command /${cmd.trigger}: ${String(err)}`);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Parse a Mattermost slash command callback payload from a URL-encoded or JSON body.
|
|
1800
|
+
*/
|
|
1801
|
+
function parseSlashCommandPayload(body, contentType) {
|
|
1802
|
+
if (!body) return null;
|
|
1803
|
+
try {
|
|
1804
|
+
if (contentType?.includes("application/json")) {
|
|
1805
|
+
const parsed = JSON.parse(body);
|
|
1806
|
+
const token = typeof parsed.token === "string" ? parsed.token : "";
|
|
1807
|
+
const teamId = typeof parsed.team_id === "string" ? parsed.team_id : "";
|
|
1808
|
+
const channelId = typeof parsed.channel_id === "string" ? parsed.channel_id : "";
|
|
1809
|
+
const userId = typeof parsed.user_id === "string" ? parsed.user_id : "";
|
|
1810
|
+
const command = typeof parsed.command === "string" ? parsed.command : "";
|
|
1811
|
+
if (!token || !teamId || !channelId || !userId || !command) return null;
|
|
1812
|
+
return {
|
|
1813
|
+
token,
|
|
1814
|
+
team_id: teamId,
|
|
1815
|
+
team_domain: typeof parsed.team_domain === "string" ? parsed.team_domain : void 0,
|
|
1816
|
+
channel_id: channelId,
|
|
1817
|
+
channel_name: typeof parsed.channel_name === "string" ? parsed.channel_name : void 0,
|
|
1818
|
+
user_id: userId,
|
|
1819
|
+
user_name: typeof parsed.user_name === "string" ? parsed.user_name : void 0,
|
|
1820
|
+
command,
|
|
1821
|
+
text: typeof parsed.text === "string" ? parsed.text : "",
|
|
1822
|
+
trigger_id: typeof parsed.trigger_id === "string" ? parsed.trigger_id : void 0,
|
|
1823
|
+
response_url: typeof parsed.response_url === "string" ? parsed.response_url : void 0
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
const params = new URLSearchParams(body);
|
|
1827
|
+
const token = params.get("token");
|
|
1828
|
+
const teamId = params.get("team_id");
|
|
1829
|
+
const channelId = params.get("channel_id");
|
|
1830
|
+
const userId = params.get("user_id");
|
|
1831
|
+
const command = params.get("command");
|
|
1832
|
+
if (!token || !teamId || !channelId || !userId || !command) return null;
|
|
1833
|
+
return {
|
|
1834
|
+
token,
|
|
1835
|
+
team_id: teamId,
|
|
1836
|
+
team_domain: params.get("team_domain") ?? void 0,
|
|
1837
|
+
channel_id: channelId,
|
|
1838
|
+
channel_name: params.get("channel_name") ?? void 0,
|
|
1839
|
+
user_id: userId,
|
|
1840
|
+
user_name: params.get("user_name") ?? void 0,
|
|
1841
|
+
command,
|
|
1842
|
+
text: params.get("text") ?? "",
|
|
1843
|
+
trigger_id: params.get("trigger_id") ?? void 0,
|
|
1844
|
+
response_url: params.get("response_url") ?? void 0
|
|
1845
|
+
};
|
|
1846
|
+
} catch {
|
|
1847
|
+
return null;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Map the trigger word back to the original OpenClaw command name.
|
|
1852
|
+
* e.g. "oc_status" -> "/status", "oc_model" -> "/model"
|
|
1853
|
+
*/
|
|
1854
|
+
function resolveCommandText(trigger, text, triggerMap) {
|
|
1855
|
+
const commandName = triggerMap?.get(trigger) ?? (trigger.startsWith("oc_") ? trigger.slice(3) : trigger);
|
|
1856
|
+
const args = text.trim();
|
|
1857
|
+
return args ? `/${commandName} ${args}` : `/${commandName}`;
|
|
1858
|
+
}
|
|
1859
|
+
const DEFAULT_CALLBACK_PATH = "/api/channels/mattermost/command";
|
|
1860
|
+
/**
|
|
1861
|
+
* Ensure the callback path starts with a leading `/` to prevent
|
|
1862
|
+
* malformed URLs like `http://host:portapi/...`.
|
|
1863
|
+
*/
|
|
1864
|
+
function normalizeCallbackPath(path) {
|
|
1865
|
+
const trimmed = path.trim();
|
|
1866
|
+
if (!trimmed) return DEFAULT_CALLBACK_PATH;
|
|
1867
|
+
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
1868
|
+
}
|
|
1869
|
+
function resolveSlashCommandConfig(raw) {
|
|
1870
|
+
return {
|
|
1871
|
+
native: raw?.native ?? "auto",
|
|
1872
|
+
nativeSkills: raw?.nativeSkills ?? "auto",
|
|
1873
|
+
callbackPath: normalizeCallbackPath(raw?.callbackPath ?? DEFAULT_CALLBACK_PATH),
|
|
1874
|
+
callbackUrl: raw?.callbackUrl?.trim() || void 0
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1877
|
+
function isSlashCommandsEnabled(config) {
|
|
1878
|
+
if (config.native === true) return true;
|
|
1879
|
+
if (config.native === false) return false;
|
|
1880
|
+
return false;
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Build the callback URL that Mattermost will POST to when a command is invoked.
|
|
1884
|
+
*/
|
|
1885
|
+
function resolveCallbackUrl(params) {
|
|
1886
|
+
if (params.config.callbackUrl) return params.config.callbackUrl;
|
|
1887
|
+
const isWildcardBindHost = (rawHost) => {
|
|
1888
|
+
const trimmed = rawHost.trim();
|
|
1889
|
+
if (!trimmed) return false;
|
|
1890
|
+
const host = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.slice(1, -1) : trimmed;
|
|
1891
|
+
return host === "0.0.0.0" || host === "::" || host === "0:0:0:0:0:0:0:0" || host === "::0";
|
|
1892
|
+
};
|
|
1893
|
+
let host = params.gatewayHost && !isWildcardBindHost(params.gatewayHost) ? params.gatewayHost : "localhost";
|
|
1894
|
+
const path = normalizeCallbackPath(params.config.callbackPath);
|
|
1895
|
+
if (host.includes(":") && !(host.startsWith("[") && host.endsWith("]"))) host = `[${host}]`;
|
|
1896
|
+
return `http://${host}:${params.gatewayPort}${path}`;
|
|
1897
|
+
}
|
|
1898
|
+
//#endregion
|
|
1899
|
+
//#region extensions/mattermost/src/mattermost/reply-delivery.ts
|
|
1900
|
+
async function deliverMattermostReplyPayload(params) {
|
|
1901
|
+
const reply = resolveSendableOutboundReplyParts(params.payload, { text: params.core.channel.text.convertMarkdownTables(params.payload.text ?? "", params.tableMode) });
|
|
1902
|
+
const mediaLocalRoots = getAgentScopedMediaLocalRoots(params.cfg, params.agentId);
|
|
1903
|
+
const chunkMode = params.core.channel.text.resolveChunkMode(params.cfg, "mattermost", params.accountId);
|
|
1904
|
+
await deliverTextOrMediaReply({
|
|
1905
|
+
payload: params.payload,
|
|
1906
|
+
text: reply.text,
|
|
1907
|
+
chunkText: (value) => params.core.channel.text.chunkMarkdownTextWithMode(value, params.textLimit, chunkMode),
|
|
1908
|
+
sendText: async (chunk) => {
|
|
1909
|
+
await params.sendMessage(params.to, chunk, {
|
|
1910
|
+
accountId: params.accountId,
|
|
1911
|
+
replyToId: params.replyToId
|
|
1912
|
+
});
|
|
1913
|
+
},
|
|
1914
|
+
sendMedia: async ({ mediaUrl, caption }) => {
|
|
1915
|
+
await params.sendMessage(params.to, caption ?? "", {
|
|
1916
|
+
accountId: params.accountId,
|
|
1917
|
+
mediaUrl,
|
|
1918
|
+
mediaLocalRoots,
|
|
1919
|
+
replyToId: params.replyToId
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1924
|
+
//#endregion
|
|
1925
|
+
//#region extensions/mattermost/src/mattermost/target-resolution.ts
|
|
1926
|
+
const mattermostOpaqueTargetCache = /* @__PURE__ */ new Map();
|
|
1927
|
+
function cacheKey$1(baseUrl, token, id) {
|
|
1928
|
+
return `${baseUrl}::${token}::${id}`;
|
|
1929
|
+
}
|
|
1930
|
+
/** Mattermost IDs are 26-character lowercase alphanumeric strings. */
|
|
1931
|
+
function isMattermostId(value) {
|
|
1932
|
+
return /^[a-z0-9]{26}$/.test(value);
|
|
1933
|
+
}
|
|
1934
|
+
function isExplicitMattermostTarget(raw) {
|
|
1935
|
+
const trimmed = raw.trim();
|
|
1936
|
+
if (!trimmed) return false;
|
|
1937
|
+
return /^(channel|user|mattermost):/i.test(trimmed) || trimmed.startsWith("@") || trimmed.startsWith("#");
|
|
1938
|
+
}
|
|
1939
|
+
function parseMattermostApiStatus(err) {
|
|
1940
|
+
if (!err || typeof err !== "object") return;
|
|
1941
|
+
const msg = "message" in err ? String(err.message ?? "") : "";
|
|
1942
|
+
const match = /Mattermost API (\d{3})\b/.exec(msg);
|
|
1943
|
+
if (!match) return;
|
|
1944
|
+
const code = Number(match[1]);
|
|
1945
|
+
return Number.isFinite(code) ? code : void 0;
|
|
1946
|
+
}
|
|
1947
|
+
async function resolveMattermostOpaqueTarget(params) {
|
|
1948
|
+
const input = params.input.trim();
|
|
1949
|
+
if (!input || isExplicitMattermostTarget(input) || !isMattermostId(input)) return null;
|
|
1950
|
+
const account = params.cfg && (!params.token || !params.baseUrl) ? resolveMattermostAccount({
|
|
1951
|
+
cfg: params.cfg,
|
|
1952
|
+
accountId: params.accountId
|
|
1953
|
+
}) : null;
|
|
1954
|
+
const token = params.token?.trim() || account?.botToken?.trim();
|
|
1955
|
+
const baseUrl = normalizeMattermostBaseUrl(params.baseUrl ?? account?.baseUrl);
|
|
1956
|
+
if (!token || !baseUrl) return null;
|
|
1957
|
+
const key = cacheKey$1(baseUrl, token, input);
|
|
1958
|
+
const cached = mattermostOpaqueTargetCache.get(key);
|
|
1959
|
+
if (cached === true) return {
|
|
1960
|
+
kind: "user",
|
|
1961
|
+
id: input,
|
|
1962
|
+
to: `user:${input}`
|
|
1963
|
+
};
|
|
1964
|
+
if (cached === false) return {
|
|
1965
|
+
kind: "channel",
|
|
1966
|
+
id: input,
|
|
1967
|
+
to: `channel:${input}`
|
|
1968
|
+
};
|
|
1969
|
+
const client = createMattermostClient({
|
|
1970
|
+
baseUrl,
|
|
1971
|
+
botToken: token
|
|
1972
|
+
});
|
|
1973
|
+
try {
|
|
1974
|
+
await fetchMattermostUser(client, input);
|
|
1975
|
+
mattermostOpaqueTargetCache.set(key, true);
|
|
1976
|
+
return {
|
|
1977
|
+
kind: "user",
|
|
1978
|
+
id: input,
|
|
1979
|
+
to: `user:${input}`
|
|
1980
|
+
};
|
|
1981
|
+
} catch (err) {
|
|
1982
|
+
if (parseMattermostApiStatus(err) === 404) mattermostOpaqueTargetCache.set(key, false);
|
|
1983
|
+
return {
|
|
1984
|
+
kind: "channel",
|
|
1985
|
+
id: input,
|
|
1986
|
+
to: `channel:${input}`
|
|
1987
|
+
};
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
//#endregion
|
|
1991
|
+
//#region extensions/mattermost/src/mattermost/send.ts
|
|
1992
|
+
const botUserCache = /* @__PURE__ */ new Map();
|
|
1993
|
+
const userByNameCache = /* @__PURE__ */ new Map();
|
|
1994
|
+
const channelByNameCache = /* @__PURE__ */ new Map();
|
|
1995
|
+
const dmChannelCache = /* @__PURE__ */ new Map();
|
|
1996
|
+
const getCore = () => getMattermostRuntime();
|
|
1997
|
+
function cacheKey(baseUrl, token) {
|
|
1998
|
+
return `${baseUrl}::${token}`;
|
|
1999
|
+
}
|
|
2000
|
+
function normalizeMessage(text, mediaUrl) {
|
|
2001
|
+
return [text.trim(), mediaUrl?.trim()].filter(Boolean).join("\n");
|
|
2002
|
+
}
|
|
2003
|
+
function isHttpUrl(value) {
|
|
2004
|
+
return /^https?:\/\//i.test(value);
|
|
2005
|
+
}
|
|
2006
|
+
function parseMattermostTarget(raw) {
|
|
2007
|
+
const trimmed = raw.trim();
|
|
2008
|
+
if (!trimmed) throw new Error("Recipient is required for Mattermost sends");
|
|
2009
|
+
const lower = trimmed.toLowerCase();
|
|
2010
|
+
if (lower.startsWith("channel:")) {
|
|
2011
|
+
const id = trimmed.slice(8).trim();
|
|
2012
|
+
if (!id) throw new Error("Channel id is required for Mattermost sends");
|
|
2013
|
+
if (id.startsWith("#")) {
|
|
2014
|
+
const name = id.slice(1).trim();
|
|
2015
|
+
if (!name) throw new Error("Channel name is required for Mattermost sends");
|
|
2016
|
+
return {
|
|
2017
|
+
kind: "channel-name",
|
|
2018
|
+
name
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
if (!isMattermostId(id)) return {
|
|
2022
|
+
kind: "channel-name",
|
|
2023
|
+
name: id
|
|
2024
|
+
};
|
|
2025
|
+
return {
|
|
2026
|
+
kind: "channel",
|
|
2027
|
+
id
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
if (lower.startsWith("user:")) {
|
|
2031
|
+
const id = trimmed.slice(5).trim();
|
|
2032
|
+
if (!id) throw new Error("User id is required for Mattermost sends");
|
|
2033
|
+
return {
|
|
2034
|
+
kind: "user",
|
|
2035
|
+
id
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
if (lower.startsWith("mattermost:")) {
|
|
2039
|
+
const id = trimmed.slice(11).trim();
|
|
2040
|
+
if (!id) throw new Error("User id is required for Mattermost sends");
|
|
2041
|
+
return {
|
|
2042
|
+
kind: "user",
|
|
2043
|
+
id
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
if (trimmed.startsWith("@")) {
|
|
2047
|
+
const username = trimmed.slice(1).trim();
|
|
2048
|
+
if (!username) throw new Error("Username is required for Mattermost sends");
|
|
2049
|
+
return {
|
|
2050
|
+
kind: "user",
|
|
2051
|
+
username
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
2054
|
+
if (trimmed.startsWith("#")) {
|
|
2055
|
+
const name = trimmed.slice(1).trim();
|
|
2056
|
+
if (!name) throw new Error("Channel name is required for Mattermost sends");
|
|
2057
|
+
return {
|
|
2058
|
+
kind: "channel-name",
|
|
2059
|
+
name
|
|
2060
|
+
};
|
|
2061
|
+
}
|
|
2062
|
+
if (!isMattermostId(trimmed)) return {
|
|
2063
|
+
kind: "channel-name",
|
|
2064
|
+
name: trimmed
|
|
2065
|
+
};
|
|
2066
|
+
return {
|
|
2067
|
+
kind: "channel",
|
|
2068
|
+
id: trimmed
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
async function resolveBotUser(baseUrl, token) {
|
|
2072
|
+
const key = cacheKey(baseUrl, token);
|
|
2073
|
+
const cached = botUserCache.get(key);
|
|
2074
|
+
if (cached) return cached;
|
|
2075
|
+
const user = await fetchMattermostMe(createMattermostClient({
|
|
2076
|
+
baseUrl,
|
|
2077
|
+
botToken: token
|
|
2078
|
+
}));
|
|
2079
|
+
botUserCache.set(key, user);
|
|
2080
|
+
return user;
|
|
2081
|
+
}
|
|
2082
|
+
async function resolveUserIdByUsername(params) {
|
|
2083
|
+
const { baseUrl, token, username } = params;
|
|
2084
|
+
const key = `${cacheKey(baseUrl, token)}::${username.toLowerCase()}`;
|
|
2085
|
+
const cached = userByNameCache.get(key);
|
|
2086
|
+
if (cached?.id) return cached.id;
|
|
2087
|
+
const user = await fetchMattermostUserByUsername(createMattermostClient({
|
|
2088
|
+
baseUrl,
|
|
2089
|
+
botToken: token
|
|
2090
|
+
}), username);
|
|
2091
|
+
userByNameCache.set(key, user);
|
|
2092
|
+
return user.id;
|
|
2093
|
+
}
|
|
2094
|
+
async function resolveChannelIdByName(params) {
|
|
2095
|
+
const { baseUrl, token, name } = params;
|
|
2096
|
+
const key = `${cacheKey(baseUrl, token)}::channel::${name.toLowerCase()}`;
|
|
2097
|
+
const cached = channelByNameCache.get(key);
|
|
2098
|
+
if (cached) return cached;
|
|
2099
|
+
const client = createMattermostClient({
|
|
2100
|
+
baseUrl,
|
|
2101
|
+
botToken: token
|
|
2102
|
+
});
|
|
2103
|
+
const teams = await fetchMattermostUserTeams(client, (await fetchMattermostMe(client)).id);
|
|
2104
|
+
for (const team of teams) try {
|
|
2105
|
+
const channel = await fetchMattermostChannelByName(client, team.id, name);
|
|
2106
|
+
if (channel?.id) {
|
|
2107
|
+
channelByNameCache.set(key, channel.id);
|
|
2108
|
+
return channel.id;
|
|
2109
|
+
}
|
|
2110
|
+
} catch {}
|
|
2111
|
+
throw new Error(`Mattermost channel "#${name}" not found in any team the bot belongs to`);
|
|
2112
|
+
}
|
|
2113
|
+
function mergeDmRetryOptions(base, override) {
|
|
2114
|
+
const merged = {
|
|
2115
|
+
maxRetries: override?.maxRetries ?? base?.maxRetries,
|
|
2116
|
+
initialDelayMs: override?.initialDelayMs ?? base?.initialDelayMs,
|
|
2117
|
+
maxDelayMs: override?.maxDelayMs ?? base?.maxDelayMs,
|
|
2118
|
+
timeoutMs: override?.timeoutMs ?? base?.timeoutMs,
|
|
2119
|
+
onRetry: override?.onRetry
|
|
2120
|
+
};
|
|
2121
|
+
if (merged.maxRetries === void 0 && merged.initialDelayMs === void 0 && merged.maxDelayMs === void 0 && merged.timeoutMs === void 0 && merged.onRetry === void 0) return;
|
|
2122
|
+
return merged;
|
|
2123
|
+
}
|
|
2124
|
+
async function resolveTargetChannelId(params) {
|
|
2125
|
+
if (params.target.kind === "channel") return params.target.id;
|
|
2126
|
+
if (params.target.kind === "channel-name") return await resolveChannelIdByName({
|
|
2127
|
+
baseUrl: params.baseUrl,
|
|
2128
|
+
token: params.token,
|
|
2129
|
+
name: params.target.name
|
|
2130
|
+
});
|
|
2131
|
+
const userId = params.target.id ? params.target.id : await resolveUserIdByUsername({
|
|
2132
|
+
baseUrl: params.baseUrl,
|
|
2133
|
+
token: params.token,
|
|
2134
|
+
username: params.target.username ?? ""
|
|
2135
|
+
});
|
|
2136
|
+
const dmKey = `${cacheKey(params.baseUrl, params.token)}::dm::${userId}`;
|
|
2137
|
+
const cachedDm = dmChannelCache.get(dmKey);
|
|
2138
|
+
if (cachedDm) return cachedDm;
|
|
2139
|
+
const botUser = await resolveBotUser(params.baseUrl, params.token);
|
|
2140
|
+
const channel = await createMattermostDirectChannelWithRetry(createMattermostClient({
|
|
2141
|
+
baseUrl: params.baseUrl,
|
|
2142
|
+
botToken: params.token
|
|
2143
|
+
}), [botUser.id, userId], {
|
|
2144
|
+
...params.dmRetryOptions,
|
|
2145
|
+
onRetry: (attempt, delayMs, error) => {
|
|
2146
|
+
params.dmRetryOptions?.onRetry?.(attempt, delayMs, error);
|
|
2147
|
+
if (params.logger) params.logger.warn?.(`DM channel creation retry ${attempt} after ${delayMs}ms: ${error.message}`);
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
dmChannelCache.set(dmKey, channel.id);
|
|
2151
|
+
return channel.id;
|
|
2152
|
+
}
|
|
2153
|
+
async function resolveMattermostSendContext(to, opts = {}) {
|
|
2154
|
+
const core = getCore();
|
|
2155
|
+
const logger = core.logging.getChildLogger({ module: "mattermost" });
|
|
2156
|
+
const cfg = opts.cfg ?? core.config.loadConfig();
|
|
2157
|
+
const account = resolveMattermostAccount({
|
|
2158
|
+
cfg,
|
|
2159
|
+
accountId: opts.accountId
|
|
2160
|
+
});
|
|
2161
|
+
const token = opts.botToken?.trim() || account.botToken?.trim();
|
|
2162
|
+
if (!token) throw new Error(`Mattermost bot token missing for account "${account.accountId}" (set channels.mattermost.accounts.${account.accountId}.botToken or MATTERMOST_BOT_TOKEN for default).`);
|
|
2163
|
+
const baseUrl = normalizeMattermostBaseUrl(opts.baseUrl ?? account.baseUrl);
|
|
2164
|
+
if (!baseUrl) throw new Error(`Mattermost baseUrl missing for account "${account.accountId}" (set channels.mattermost.accounts.${account.accountId}.baseUrl or MATTERMOST_URL for default).`);
|
|
2165
|
+
const trimmedTo = to?.trim() ?? "";
|
|
2166
|
+
const opaqueTarget = await resolveMattermostOpaqueTarget({
|
|
2167
|
+
input: trimmedTo,
|
|
2168
|
+
token,
|
|
2169
|
+
baseUrl
|
|
2170
|
+
});
|
|
2171
|
+
const channelId = await resolveTargetChannelId({
|
|
2172
|
+
target: opaqueTarget?.kind === "user" ? {
|
|
2173
|
+
kind: "user",
|
|
2174
|
+
id: opaqueTarget.id
|
|
2175
|
+
} : opaqueTarget?.kind === "channel" ? {
|
|
2176
|
+
kind: "channel",
|
|
2177
|
+
id: opaqueTarget.id
|
|
2178
|
+
} : parseMattermostTarget(trimmedTo),
|
|
2179
|
+
baseUrl,
|
|
2180
|
+
token,
|
|
2181
|
+
dmRetryOptions: mergeDmRetryOptions(account.config.dmChannelRetry ? {
|
|
2182
|
+
maxRetries: account.config.dmChannelRetry.maxRetries,
|
|
2183
|
+
initialDelayMs: account.config.dmChannelRetry.initialDelayMs,
|
|
2184
|
+
maxDelayMs: account.config.dmChannelRetry.maxDelayMs,
|
|
2185
|
+
timeoutMs: account.config.dmChannelRetry.timeoutMs
|
|
2186
|
+
} : void 0, opts.dmRetryOptions),
|
|
2187
|
+
logger: core.logging.shouldLogVerbose() ? logger : void 0
|
|
2188
|
+
});
|
|
2189
|
+
return {
|
|
2190
|
+
cfg,
|
|
2191
|
+
accountId: account.accountId,
|
|
2192
|
+
token,
|
|
2193
|
+
baseUrl,
|
|
2194
|
+
channelId
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
async function sendMessageMattermost(to, text, opts = {}) {
|
|
2198
|
+
const core = getCore();
|
|
2199
|
+
const logger = core.logging.getChildLogger({ module: "mattermost" });
|
|
2200
|
+
const { cfg, accountId, token, baseUrl, channelId } = await resolveMattermostSendContext(to, opts);
|
|
2201
|
+
const client = createMattermostClient({
|
|
2202
|
+
baseUrl,
|
|
2203
|
+
botToken: token
|
|
2204
|
+
});
|
|
2205
|
+
let props = opts.props;
|
|
2206
|
+
if (!props && Array.isArray(opts.buttons) && opts.buttons.length > 0) {
|
|
2207
|
+
setInteractionSecret(accountId, token);
|
|
2208
|
+
props = buildButtonProps({
|
|
2209
|
+
callbackUrl: resolveInteractionCallbackUrl(accountId, {
|
|
2210
|
+
gateway: cfg.gateway,
|
|
2211
|
+
interactions: resolveMattermostAccount({
|
|
2212
|
+
cfg,
|
|
2213
|
+
accountId
|
|
2214
|
+
}).config?.interactions
|
|
2215
|
+
}),
|
|
2216
|
+
accountId,
|
|
2217
|
+
channelId,
|
|
2218
|
+
buttons: opts.buttons,
|
|
2219
|
+
text: opts.attachmentText
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
let message = text?.trim() ?? "";
|
|
2223
|
+
let fileIds;
|
|
2224
|
+
let uploadError;
|
|
2225
|
+
const mediaUrl = opts.mediaUrl?.trim();
|
|
2226
|
+
if (mediaUrl) try {
|
|
2227
|
+
const media = await loadOutboundMediaFromUrl(mediaUrl, { mediaLocalRoots: opts.mediaLocalRoots });
|
|
2228
|
+
fileIds = [(await uploadMattermostFile(client, {
|
|
2229
|
+
channelId,
|
|
2230
|
+
buffer: media.buffer,
|
|
2231
|
+
fileName: media.fileName ?? "upload",
|
|
2232
|
+
contentType: media.contentType ?? void 0
|
|
2233
|
+
})).id];
|
|
2234
|
+
} catch (err) {
|
|
2235
|
+
uploadError = err instanceof Error ? err : new Error(String(err));
|
|
2236
|
+
if (core.logging.shouldLogVerbose()) logger.debug?.(`mattermost send: media upload failed, falling back to URL text: ${String(err)}`);
|
|
2237
|
+
message = normalizeMessage(message, isHttpUrl(mediaUrl) ? mediaUrl : "");
|
|
2238
|
+
}
|
|
2239
|
+
if (message) {
|
|
2240
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
2241
|
+
cfg,
|
|
2242
|
+
channel: "mattermost",
|
|
2243
|
+
accountId
|
|
2244
|
+
});
|
|
2245
|
+
message = core.channel.text.convertMarkdownTables(message, tableMode);
|
|
2246
|
+
}
|
|
2247
|
+
if (!message && (!fileIds || fileIds.length === 0)) {
|
|
2248
|
+
if (uploadError) throw new Error(`Mattermost media upload failed: ${uploadError.message}`);
|
|
2249
|
+
throw new Error("Mattermost message is empty");
|
|
2250
|
+
}
|
|
2251
|
+
const post = await createMattermostPost(client, {
|
|
2252
|
+
channelId,
|
|
2253
|
+
message,
|
|
2254
|
+
rootId: opts.replyToId,
|
|
2255
|
+
fileIds,
|
|
2256
|
+
props
|
|
2257
|
+
});
|
|
2258
|
+
core.channel.activity.record({
|
|
2259
|
+
channel: "mattermost",
|
|
2260
|
+
accountId,
|
|
2261
|
+
direction: "outbound"
|
|
2262
|
+
});
|
|
2263
|
+
return {
|
|
2264
|
+
messageId: post.id ?? "unknown",
|
|
2265
|
+
channelId
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2268
|
+
//#endregion
|
|
2269
|
+
//#region extensions/mattermost/src/mattermost/slash-http.ts
|
|
2270
|
+
const MAX_BODY_BYTES = 64 * 1024;
|
|
2271
|
+
const BODY_READ_TIMEOUT_MS = 5e3;
|
|
2272
|
+
/**
|
|
2273
|
+
* Read the full request body as a string.
|
|
2274
|
+
*/
|
|
2275
|
+
function readBody(req, maxBytes) {
|
|
2276
|
+
return readRequestBodyWithLimit(req, {
|
|
2277
|
+
maxBytes,
|
|
2278
|
+
timeoutMs: BODY_READ_TIMEOUT_MS
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
function sendJsonResponse(res, status, body) {
|
|
2282
|
+
res.statusCode = status;
|
|
2283
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
2284
|
+
res.end(JSON.stringify(body));
|
|
2285
|
+
}
|
|
2286
|
+
async function authorizeSlashInvocation(params) {
|
|
2287
|
+
const { account, cfg, client, commandText, channelId, senderId, senderName, log } = params;
|
|
2288
|
+
const core = getMattermostRuntime();
|
|
2289
|
+
let channelInfo = null;
|
|
2290
|
+
try {
|
|
2291
|
+
channelInfo = await fetchMattermostChannel(client, channelId);
|
|
2292
|
+
} catch (err) {
|
|
2293
|
+
log?.(`mattermost: slash channel lookup failed for ${channelId}: ${String(err)}`);
|
|
2294
|
+
}
|
|
2295
|
+
if (!channelInfo) return {
|
|
2296
|
+
ok: false,
|
|
2297
|
+
denyResponse: {
|
|
2298
|
+
response_type: "ephemeral",
|
|
2299
|
+
text: "Temporary error: unable to determine channel type. Please try again."
|
|
2300
|
+
},
|
|
2301
|
+
commandAuthorized: false,
|
|
2302
|
+
channelInfo: null,
|
|
2303
|
+
kind: "channel",
|
|
2304
|
+
chatType: "channel",
|
|
2305
|
+
channelName: "",
|
|
2306
|
+
channelDisplay: "",
|
|
2307
|
+
roomLabel: `#${channelId}`
|
|
2308
|
+
};
|
|
2309
|
+
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
2310
|
+
cfg,
|
|
2311
|
+
surface: "mattermost"
|
|
2312
|
+
});
|
|
2313
|
+
const hasControlCommand = core.channel.text.hasControlCommand(commandText, cfg);
|
|
2314
|
+
const storeAllowFrom = normalizeMattermostAllowList(await core.channel.pairing.readAllowFromStore({
|
|
2315
|
+
channel: "mattermost",
|
|
2316
|
+
accountId: account.accountId
|
|
2317
|
+
}).catch(() => []));
|
|
2318
|
+
const decision = authorizeMattermostCommandInvocation({
|
|
2319
|
+
account,
|
|
2320
|
+
cfg,
|
|
2321
|
+
senderId,
|
|
2322
|
+
senderName,
|
|
2323
|
+
channelId,
|
|
2324
|
+
channelInfo,
|
|
2325
|
+
storeAllowFrom,
|
|
2326
|
+
allowTextCommands,
|
|
2327
|
+
hasControlCommand
|
|
2328
|
+
});
|
|
2329
|
+
if (!decision.ok) {
|
|
2330
|
+
if (decision.denyReason === "dm-pairing") {
|
|
2331
|
+
const { code } = await core.channel.pairing.upsertPairingRequest({
|
|
2332
|
+
channel: "mattermost",
|
|
2333
|
+
accountId: account.accountId,
|
|
2334
|
+
id: senderId,
|
|
2335
|
+
meta: { name: senderName }
|
|
2336
|
+
});
|
|
2337
|
+
return {
|
|
2338
|
+
...decision,
|
|
2339
|
+
denyResponse: {
|
|
2340
|
+
response_type: "ephemeral",
|
|
2341
|
+
text: core.channel.pairing.buildPairingReply({
|
|
2342
|
+
channel: "mattermost",
|
|
2343
|
+
idLine: `Your Mattermost user id: ${senderId}`,
|
|
2344
|
+
code
|
|
2345
|
+
})
|
|
2346
|
+
}
|
|
2347
|
+
};
|
|
2348
|
+
}
|
|
2349
|
+
const denyText = decision.denyReason === "unknown-channel" ? "Temporary error: unable to determine channel type. Please try again." : decision.denyReason === "dm-disabled" ? "This bot is not accepting direct messages." : decision.denyReason === "channels-disabled" ? "Slash commands are disabled in channels." : decision.denyReason === "channel-no-allowlist" ? "Slash commands are not configured for this channel (no allowlist)." : "Unauthorized.";
|
|
2350
|
+
return {
|
|
2351
|
+
...decision,
|
|
2352
|
+
denyResponse: {
|
|
2353
|
+
response_type: "ephemeral",
|
|
2354
|
+
text: denyText
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
}
|
|
2358
|
+
return {
|
|
2359
|
+
...decision,
|
|
2360
|
+
denyResponse: void 0
|
|
2361
|
+
};
|
|
2362
|
+
}
|
|
2363
|
+
/**
|
|
2364
|
+
* Create the HTTP request handler for Mattermost slash command callbacks.
|
|
2365
|
+
*
|
|
2366
|
+
* This handler is registered as a plugin HTTP route and receives POSTs
|
|
2367
|
+
* from the Mattermost server when a user invokes a registered slash command.
|
|
2368
|
+
*/
|
|
2369
|
+
function createSlashCommandHttpHandler(params) {
|
|
2370
|
+
const { account, cfg, runtime, commandTokens, triggerMap, log } = params;
|
|
2371
|
+
return async (req, res) => {
|
|
2372
|
+
if (req.method !== "POST") {
|
|
2373
|
+
res.statusCode = 405;
|
|
2374
|
+
res.setHeader("Allow", "POST");
|
|
2375
|
+
res.end("Method Not Allowed");
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
let body;
|
|
2379
|
+
try {
|
|
2380
|
+
body = await readBody(req, MAX_BODY_BYTES);
|
|
2381
|
+
} catch (error) {
|
|
2382
|
+
if (isRequestBodyLimitError(error, "REQUEST_BODY_TIMEOUT")) {
|
|
2383
|
+
res.statusCode = 408;
|
|
2384
|
+
res.end("Request body timeout");
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
res.statusCode = 413;
|
|
2388
|
+
res.end("Payload Too Large");
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2391
|
+
const contentType = req.headers["content-type"] ?? "";
|
|
2392
|
+
const payload = parseSlashCommandPayload(body, contentType);
|
|
2393
|
+
if (!payload) {
|
|
2394
|
+
sendJsonResponse(res, 400, {
|
|
2395
|
+
response_type: "ephemeral",
|
|
2396
|
+
text: "Invalid slash command payload."
|
|
2397
|
+
});
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
if (commandTokens.size === 0 || !commandTokens.has(payload.token)) {
|
|
2401
|
+
sendJsonResponse(res, 401, {
|
|
2402
|
+
response_type: "ephemeral",
|
|
2403
|
+
text: "Unauthorized: invalid command token."
|
|
2404
|
+
});
|
|
2405
|
+
return;
|
|
2406
|
+
}
|
|
2407
|
+
const trigger = payload.command.replace(/^\//, "").trim();
|
|
2408
|
+
const commandText = resolveCommandText(trigger, payload.text, triggerMap);
|
|
2409
|
+
const channelId = payload.channel_id;
|
|
2410
|
+
const senderId = payload.user_id;
|
|
2411
|
+
const senderName = payload.user_name ?? senderId;
|
|
2412
|
+
const client = createMattermostClient({
|
|
2413
|
+
baseUrl: account.baseUrl ?? "",
|
|
2414
|
+
botToken: account.botToken ?? ""
|
|
2415
|
+
});
|
|
2416
|
+
const auth = await authorizeSlashInvocation({
|
|
2417
|
+
account,
|
|
2418
|
+
cfg,
|
|
2419
|
+
client,
|
|
2420
|
+
commandText,
|
|
2421
|
+
channelId,
|
|
2422
|
+
senderId,
|
|
2423
|
+
senderName,
|
|
2424
|
+
log
|
|
2425
|
+
});
|
|
2426
|
+
if (!auth.ok) {
|
|
2427
|
+
sendJsonResponse(res, 200, auth.denyResponse ?? {
|
|
2428
|
+
response_type: "ephemeral",
|
|
2429
|
+
text: "Unauthorized."
|
|
2430
|
+
});
|
|
2431
|
+
return;
|
|
2432
|
+
}
|
|
2433
|
+
log?.(`mattermost: slash command /${trigger} from ${senderName} in ${channelId}`);
|
|
2434
|
+
sendJsonResponse(res, 200, {
|
|
2435
|
+
response_type: "ephemeral",
|
|
2436
|
+
text: "Processing..."
|
|
2437
|
+
});
|
|
2438
|
+
try {
|
|
2439
|
+
await handleSlashCommandAsync({
|
|
2440
|
+
account,
|
|
2441
|
+
cfg,
|
|
2442
|
+
runtime,
|
|
2443
|
+
client,
|
|
2444
|
+
commandText,
|
|
2445
|
+
channelId,
|
|
2446
|
+
senderId,
|
|
2447
|
+
senderName,
|
|
2448
|
+
teamId: payload.team_id,
|
|
2449
|
+
triggerId: payload.trigger_id,
|
|
2450
|
+
kind: auth.kind,
|
|
2451
|
+
chatType: auth.chatType,
|
|
2452
|
+
channelName: auth.channelName,
|
|
2453
|
+
channelDisplay: auth.channelDisplay,
|
|
2454
|
+
roomLabel: auth.roomLabel,
|
|
2455
|
+
commandAuthorized: auth.commandAuthorized,
|
|
2456
|
+
log
|
|
2457
|
+
});
|
|
2458
|
+
} catch (err) {
|
|
2459
|
+
log?.(`mattermost: slash command handler error: ${String(err)}`);
|
|
2460
|
+
try {
|
|
2461
|
+
await sendMessageMattermost(`channel:${channelId}`, "Sorry, something went wrong processing that command.", { accountId: account.accountId });
|
|
2462
|
+
} catch {}
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
}
|
|
2466
|
+
async function handleSlashCommandAsync(params) {
|
|
2467
|
+
const { account, cfg, runtime, client, commandText, channelId, senderId, senderName, teamId, kind, chatType, channelName, channelDisplay, roomLabel, commandAuthorized, triggerId, log } = params;
|
|
2468
|
+
const core = getMattermostRuntime();
|
|
2469
|
+
const route = core.channel.routing.resolveAgentRoute({
|
|
2470
|
+
cfg,
|
|
2471
|
+
channel: "mattermost",
|
|
2472
|
+
accountId: account.accountId,
|
|
2473
|
+
teamId,
|
|
2474
|
+
peer: {
|
|
2475
|
+
kind,
|
|
2476
|
+
id: kind === "direct" ? senderId : channelId
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
const fromLabel = kind === "direct" ? `Mattermost DM from ${senderName}` : `Mattermost message in ${roomLabel} from ${senderName}`;
|
|
2480
|
+
const to = kind === "direct" ? `user:${senderId}` : `channel:${channelId}`;
|
|
2481
|
+
const pickerEntry = resolveMattermostModelPickerEntry(commandText);
|
|
2482
|
+
if (pickerEntry) {
|
|
2483
|
+
const data = await buildModelsProviderData(cfg, route.agentId);
|
|
2484
|
+
if (data.providers.length === 0) {
|
|
2485
|
+
await sendMessageMattermost(to, "No models available.", { accountId: account.accountId });
|
|
2486
|
+
return;
|
|
2487
|
+
}
|
|
2488
|
+
const currentModel = resolveMattermostModelPickerCurrentModel({
|
|
2489
|
+
cfg,
|
|
2490
|
+
route,
|
|
2491
|
+
data
|
|
2492
|
+
});
|
|
2493
|
+
const view = pickerEntry.kind === "summary" ? renderMattermostModelSummaryView({
|
|
2494
|
+
ownerUserId: senderId,
|
|
2495
|
+
currentModel
|
|
2496
|
+
}) : pickerEntry.kind === "providers" ? renderMattermostProviderPickerView({
|
|
2497
|
+
ownerUserId: senderId,
|
|
2498
|
+
data,
|
|
2499
|
+
currentModel
|
|
2500
|
+
}) : renderMattermostModelsPickerView({
|
|
2501
|
+
ownerUserId: senderId,
|
|
2502
|
+
data,
|
|
2503
|
+
provider: pickerEntry.provider,
|
|
2504
|
+
page: 1,
|
|
2505
|
+
currentModel
|
|
2506
|
+
});
|
|
2507
|
+
await sendMessageMattermost(to, view.text, {
|
|
2508
|
+
accountId: account.accountId,
|
|
2509
|
+
buttons: view.buttons
|
|
2510
|
+
});
|
|
2511
|
+
runtime.log?.(`delivered model picker to ${to}`);
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
2515
|
+
Body: commandText,
|
|
2516
|
+
BodyForAgent: commandText,
|
|
2517
|
+
RawBody: commandText,
|
|
2518
|
+
CommandBody: commandText,
|
|
2519
|
+
From: kind === "direct" ? `mattermost:${senderId}` : kind === "group" ? `mattermost:group:${channelId}` : `mattermost:channel:${channelId}`,
|
|
2520
|
+
To: to,
|
|
2521
|
+
SessionKey: route.sessionKey,
|
|
2522
|
+
AccountId: route.accountId,
|
|
2523
|
+
ChatType: chatType,
|
|
2524
|
+
ConversationLabel: fromLabel,
|
|
2525
|
+
GroupSubject: kind !== "direct" ? channelDisplay || roomLabel : void 0,
|
|
2526
|
+
SenderName: senderName,
|
|
2527
|
+
SenderId: senderId,
|
|
2528
|
+
Provider: "mattermost",
|
|
2529
|
+
Surface: "mattermost",
|
|
2530
|
+
MessageSid: triggerId ?? `slash-${Date.now()}`,
|
|
2531
|
+
Timestamp: Date.now(),
|
|
2532
|
+
WasMentioned: true,
|
|
2533
|
+
CommandAuthorized: commandAuthorized,
|
|
2534
|
+
CommandSource: "native",
|
|
2535
|
+
OriginatingChannel: "mattermost",
|
|
2536
|
+
OriginatingTo: to
|
|
2537
|
+
});
|
|
2538
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "mattermost", account.accountId, { fallbackLimit: account.textChunkLimit ?? 4e3 });
|
|
2539
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
2540
|
+
cfg,
|
|
2541
|
+
channel: "mattermost",
|
|
2542
|
+
accountId: account.accountId
|
|
2543
|
+
});
|
|
2544
|
+
const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelReplyPipeline({
|
|
2545
|
+
cfg,
|
|
2546
|
+
agentId: route.agentId,
|
|
2547
|
+
channel: "mattermost",
|
|
2548
|
+
accountId: account.accountId,
|
|
2549
|
+
typing: {
|
|
2550
|
+
start: () => sendMattermostTyping(client, { channelId }),
|
|
2551
|
+
onStartError: (err) => {
|
|
2552
|
+
logTypingFailure({
|
|
2553
|
+
log: (message) => log?.(message),
|
|
2554
|
+
channel: "mattermost",
|
|
2555
|
+
target: channelId,
|
|
2556
|
+
error: err
|
|
2557
|
+
});
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
const humanDelay = core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId);
|
|
2562
|
+
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
2563
|
+
...replyPipeline,
|
|
2564
|
+
humanDelay,
|
|
2565
|
+
deliver: async (payload) => {
|
|
2566
|
+
await deliverMattermostReplyPayload({
|
|
2567
|
+
core,
|
|
2568
|
+
cfg,
|
|
2569
|
+
payload,
|
|
2570
|
+
to,
|
|
2571
|
+
accountId: account.accountId,
|
|
2572
|
+
agentId: route.agentId,
|
|
2573
|
+
textLimit,
|
|
2574
|
+
tableMode,
|
|
2575
|
+
sendMessage: sendMessageMattermost
|
|
2576
|
+
});
|
|
2577
|
+
runtime.log?.(`delivered slash reply to ${to}`);
|
|
2578
|
+
},
|
|
2579
|
+
onError: (err, info) => {
|
|
2580
|
+
runtime.error?.(`mattermost slash ${info.kind} reply failed: ${String(err)}`);
|
|
2581
|
+
},
|
|
2582
|
+
onReplyStart: typingCallbacks?.onReplyStart
|
|
2583
|
+
});
|
|
2584
|
+
await core.channel.reply.withReplyDispatcher({
|
|
2585
|
+
dispatcher,
|
|
2586
|
+
onSettled: () => {
|
|
2587
|
+
markDispatchIdle();
|
|
2588
|
+
},
|
|
2589
|
+
run: () => core.channel.reply.dispatchReplyFromConfig({
|
|
2590
|
+
ctx: ctxPayload,
|
|
2591
|
+
cfg,
|
|
2592
|
+
dispatcher,
|
|
2593
|
+
replyOptions: {
|
|
2594
|
+
...replyOptions,
|
|
2595
|
+
disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
|
|
2596
|
+
onModelSelected
|
|
2597
|
+
}
|
|
2598
|
+
})
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
//#endregion
|
|
2602
|
+
//#region extensions/mattermost/src/mattermost/slash-state.ts
|
|
2603
|
+
/** Map from accountId → per-account slash command state. */
|
|
2604
|
+
const accountStates = /* @__PURE__ */ new Map();
|
|
2605
|
+
function resolveSlashHandlerForToken(token) {
|
|
2606
|
+
const matches = [];
|
|
2607
|
+
for (const [accountId, state] of accountStates) if (state.commandTokens.has(token) && state.handler) matches.push({
|
|
2608
|
+
accountId,
|
|
2609
|
+
handler: state.handler
|
|
2610
|
+
});
|
|
2611
|
+
if (matches.length === 0) return { kind: "none" };
|
|
2612
|
+
if (matches.length === 1) return {
|
|
2613
|
+
kind: "single",
|
|
2614
|
+
handler: matches[0].handler,
|
|
2615
|
+
accountIds: [matches[0].accountId]
|
|
2616
|
+
};
|
|
2617
|
+
return {
|
|
2618
|
+
kind: "ambiguous",
|
|
2619
|
+
accountIds: matches.map((entry) => entry.accountId)
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Get the slash command state for a specific account, or null if not activated.
|
|
2624
|
+
*/
|
|
2625
|
+
function getSlashCommandState(accountId) {
|
|
2626
|
+
return accountStates.get(accountId) ?? null;
|
|
2627
|
+
}
|
|
2628
|
+
/**
|
|
2629
|
+
* Activate slash commands for a specific account.
|
|
2630
|
+
* Called from the monitor after bot connects.
|
|
2631
|
+
*/
|
|
2632
|
+
function activateSlashCommands(params) {
|
|
2633
|
+
const { account, commandTokens, registeredCommands, triggerMap, api, log } = params;
|
|
2634
|
+
const accountId = account.accountId;
|
|
2635
|
+
const tokenSet = new Set(commandTokens);
|
|
2636
|
+
const handler = createSlashCommandHttpHandler({
|
|
2637
|
+
account,
|
|
2638
|
+
cfg: api.cfg,
|
|
2639
|
+
runtime: api.runtime,
|
|
2640
|
+
commandTokens: tokenSet,
|
|
2641
|
+
triggerMap,
|
|
2642
|
+
log
|
|
2643
|
+
});
|
|
2644
|
+
accountStates.set(accountId, {
|
|
2645
|
+
commandTokens: tokenSet,
|
|
2646
|
+
registeredCommands,
|
|
2647
|
+
handler,
|
|
2648
|
+
account,
|
|
2649
|
+
triggerMap: triggerMap ?? /* @__PURE__ */ new Map()
|
|
2650
|
+
});
|
|
2651
|
+
log?.(`mattermost: slash commands activated for account ${accountId} (${registeredCommands.length} commands)`);
|
|
2652
|
+
}
|
|
2653
|
+
/**
|
|
2654
|
+
* Deactivate slash commands for a specific account (on shutdown/disconnect).
|
|
2655
|
+
*/
|
|
2656
|
+
function deactivateSlashCommands(accountId) {
|
|
2657
|
+
if (accountId) {
|
|
2658
|
+
const state = accountStates.get(accountId);
|
|
2659
|
+
if (state) {
|
|
2660
|
+
state.commandTokens.clear();
|
|
2661
|
+
state.registeredCommands = [];
|
|
2662
|
+
state.handler = null;
|
|
2663
|
+
accountStates.delete(accountId);
|
|
2664
|
+
}
|
|
2665
|
+
} else {
|
|
2666
|
+
for (const [, state] of accountStates) {
|
|
2667
|
+
state.commandTokens.clear();
|
|
2668
|
+
state.registeredCommands = [];
|
|
2669
|
+
state.handler = null;
|
|
2670
|
+
}
|
|
2671
|
+
accountStates.clear();
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Register the HTTP route for slash command callbacks.
|
|
2676
|
+
* Called during plugin registration.
|
|
2677
|
+
*
|
|
2678
|
+
* The single HTTP route dispatches to the correct per-account handler
|
|
2679
|
+
* by matching the inbound token against each account's registered tokens.
|
|
2680
|
+
*/
|
|
2681
|
+
function registerSlashCommandRoute(api) {
|
|
2682
|
+
const mmConfig = api.config.channels?.mattermost;
|
|
2683
|
+
const callbackPaths = /* @__PURE__ */ new Set();
|
|
2684
|
+
const addCallbackPaths = (raw) => {
|
|
2685
|
+
const resolved = resolveSlashCommandConfig(raw);
|
|
2686
|
+
callbackPaths.add(resolved.callbackPath);
|
|
2687
|
+
if (resolved.callbackUrl) try {
|
|
2688
|
+
const urlPath = new URL(resolved.callbackUrl).pathname;
|
|
2689
|
+
if (urlPath && urlPath !== resolved.callbackPath) callbackPaths.add(urlPath);
|
|
2690
|
+
} catch {}
|
|
2691
|
+
};
|
|
2692
|
+
const commandsRaw = mmConfig?.commands;
|
|
2693
|
+
addCallbackPaths(commandsRaw);
|
|
2694
|
+
const accountsRaw = mmConfig?.accounts ?? {};
|
|
2695
|
+
for (const accountId of Object.keys(accountsRaw)) {
|
|
2696
|
+
const accountCommandsRaw = accountsRaw[accountId]?.commands;
|
|
2697
|
+
addCallbackPaths(accountCommandsRaw);
|
|
2698
|
+
}
|
|
2699
|
+
const routeHandler = async (req, res) => {
|
|
2700
|
+
if (accountStates.size === 0) {
|
|
2701
|
+
res.statusCode = 503;
|
|
2702
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
2703
|
+
res.end(JSON.stringify({
|
|
2704
|
+
response_type: "ephemeral",
|
|
2705
|
+
text: "Slash commands are not yet initialized. Please try again in a moment."
|
|
2706
|
+
}));
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
if (accountStates.size === 1) {
|
|
2710
|
+
const [, state] = [...accountStates.entries()][0];
|
|
2711
|
+
if (!state.handler) {
|
|
2712
|
+
res.statusCode = 503;
|
|
2713
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
2714
|
+
res.end(JSON.stringify({
|
|
2715
|
+
response_type: "ephemeral",
|
|
2716
|
+
text: "Slash commands are not yet initialized. Please try again in a moment."
|
|
2717
|
+
}));
|
|
2718
|
+
return;
|
|
2719
|
+
}
|
|
2720
|
+
await state.handler(req, res);
|
|
2721
|
+
return;
|
|
2722
|
+
}
|
|
2723
|
+
const chunks = [];
|
|
2724
|
+
const MAX_BODY = 64 * 1024;
|
|
2725
|
+
let size = 0;
|
|
2726
|
+
for await (const chunk of req) {
|
|
2727
|
+
size += chunk.length;
|
|
2728
|
+
if (size > MAX_BODY) {
|
|
2729
|
+
res.statusCode = 413;
|
|
2730
|
+
res.end("Payload Too Large");
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
chunks.push(chunk);
|
|
2734
|
+
}
|
|
2735
|
+
const bodyStr = Buffer.concat(chunks).toString("utf8");
|
|
2736
|
+
let token = null;
|
|
2737
|
+
const ct = req.headers["content-type"] ?? "";
|
|
2738
|
+
try {
|
|
2739
|
+
if (ct.includes("application/json")) token = JSON.parse(bodyStr).token ?? null;
|
|
2740
|
+
else token = new URLSearchParams(bodyStr).get("token");
|
|
2741
|
+
} catch {}
|
|
2742
|
+
const match = token ? resolveSlashHandlerForToken(token) : { kind: "none" };
|
|
2743
|
+
if (match.kind === "none") {
|
|
2744
|
+
res.statusCode = 401;
|
|
2745
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
2746
|
+
res.end(JSON.stringify({
|
|
2747
|
+
response_type: "ephemeral",
|
|
2748
|
+
text: "Unauthorized: invalid command token."
|
|
2749
|
+
}));
|
|
2750
|
+
return;
|
|
2751
|
+
}
|
|
2752
|
+
if (match.kind === "ambiguous") {
|
|
2753
|
+
api.logger.warn?.(`mattermost: slash callback token matched multiple accounts (${match.accountIds?.join(", ")})`);
|
|
2754
|
+
res.statusCode = 409;
|
|
2755
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
2756
|
+
res.end(JSON.stringify({
|
|
2757
|
+
response_type: "ephemeral",
|
|
2758
|
+
text: "Conflict: command token is not unique across accounts."
|
|
2759
|
+
}));
|
|
2760
|
+
return;
|
|
2761
|
+
}
|
|
2762
|
+
const matchedHandler = match.handler;
|
|
2763
|
+
const { Readable } = await import("node:stream");
|
|
2764
|
+
const syntheticReq = new Readable({ read() {
|
|
2765
|
+
this.push(Buffer.from(bodyStr, "utf8"));
|
|
2766
|
+
this.push(null);
|
|
2767
|
+
} });
|
|
2768
|
+
syntheticReq.method = req.method;
|
|
2769
|
+
syntheticReq.url = req.url;
|
|
2770
|
+
syntheticReq.headers = req.headers;
|
|
2771
|
+
await matchedHandler(syntheticReq, res);
|
|
2772
|
+
};
|
|
2773
|
+
for (const callbackPath of callbackPaths) {
|
|
2774
|
+
api.registerHttpRoute({
|
|
2775
|
+
path: callbackPath,
|
|
2776
|
+
auth: "plugin",
|
|
2777
|
+
handler: routeHandler
|
|
2778
|
+
});
|
|
2779
|
+
api.logger.info?.(`mattermost: registered slash command callback at ${callbackPath}`);
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
//#endregion
|
|
2783
|
+
//#region extensions/mattermost/src/mattermost/monitor-slash.ts
|
|
2784
|
+
function isLoopbackHost$1(hostname) {
|
|
2785
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
2786
|
+
}
|
|
2787
|
+
function buildSlashCommands(params) {
|
|
2788
|
+
const commandsToRegister = [...DEFAULT_COMMAND_SPECS];
|
|
2789
|
+
if (!params.nativeSkills) return commandsToRegister;
|
|
2790
|
+
try {
|
|
2791
|
+
const skillCommands = listSkillCommandsForAgents({ cfg: params.cfg });
|
|
2792
|
+
for (const spec of skillCommands) {
|
|
2793
|
+
const name = typeof spec.name === "string" ? spec.name.trim() : "";
|
|
2794
|
+
if (!name) continue;
|
|
2795
|
+
const trigger = name.startsWith("oc_") ? name : `oc_${name}`;
|
|
2796
|
+
commandsToRegister.push({
|
|
2797
|
+
trigger,
|
|
2798
|
+
description: spec.description || `Run skill ${name}`,
|
|
2799
|
+
autoComplete: true,
|
|
2800
|
+
autoCompleteHint: "[args]",
|
|
2801
|
+
originalName: name
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
} catch (err) {
|
|
2805
|
+
params.runtime.error?.(`mattermost: failed to list skill commands: ${String(err)}`);
|
|
2806
|
+
}
|
|
2807
|
+
return commandsToRegister;
|
|
2808
|
+
}
|
|
2809
|
+
function dedupeSlashCommands(commands) {
|
|
2810
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2811
|
+
return commands.filter((cmd) => {
|
|
2812
|
+
const key = cmd.trigger.trim();
|
|
2813
|
+
if (!key || seen.has(key)) return false;
|
|
2814
|
+
seen.add(key);
|
|
2815
|
+
return true;
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
function buildTriggerMap(commands) {
|
|
2819
|
+
const triggerMap = /* @__PURE__ */ new Map();
|
|
2820
|
+
for (const cmd of commands) if (cmd.originalName) triggerMap.set(cmd.trigger, cmd.originalName);
|
|
2821
|
+
return triggerMap;
|
|
2822
|
+
}
|
|
2823
|
+
function warnOnSuspiciousCallbackUrl(params) {
|
|
2824
|
+
try {
|
|
2825
|
+
const mmHost = new URL(normalizeMattermostBaseUrl(params.baseUrl) ?? params.baseUrl).hostname;
|
|
2826
|
+
const callbackHost = new URL(params.callbackUrl).hostname;
|
|
2827
|
+
if (isLoopbackHost$1(callbackHost) && !isLoopbackHost$1(mmHost)) params.runtime.error?.(`mattermost: slash commands callbackUrl resolved to ${params.callbackUrl} (loopback) while baseUrl is ${params.baseUrl}. This MAY be unreachable depending on your deployment. If native slash commands don't work, set channels.mattermost.commands.callbackUrl to a URL reachable from the Mattermost server (e.g. your public reverse proxy URL).`);
|
|
2828
|
+
} catch {}
|
|
2829
|
+
}
|
|
2830
|
+
async function registerSlashCommandsAcrossTeams(params) {
|
|
2831
|
+
const registered = [];
|
|
2832
|
+
let teamRegistrationFailures = 0;
|
|
2833
|
+
for (const team of params.teams) try {
|
|
2834
|
+
const created = await registerSlashCommands({
|
|
2835
|
+
client: params.client,
|
|
2836
|
+
teamId: team.id,
|
|
2837
|
+
creatorUserId: params.botUserId,
|
|
2838
|
+
callbackUrl: params.callbackUrl,
|
|
2839
|
+
commands: params.commands,
|
|
2840
|
+
log: (msg) => params.runtime.log?.(msg)
|
|
2841
|
+
});
|
|
2842
|
+
registered.push(...created);
|
|
2843
|
+
} catch (err) {
|
|
2844
|
+
teamRegistrationFailures += 1;
|
|
2845
|
+
params.runtime.error?.(`mattermost: failed to register slash commands for team ${team.id}: ${String(err)}`);
|
|
2846
|
+
}
|
|
2847
|
+
return {
|
|
2848
|
+
registered,
|
|
2849
|
+
teamRegistrationFailures
|
|
2850
|
+
};
|
|
2851
|
+
}
|
|
2852
|
+
async function registerMattermostMonitorSlashCommands(params) {
|
|
2853
|
+
const commandsRaw = params.account.config.commands;
|
|
2854
|
+
const slashConfig = resolveSlashCommandConfig(commandsRaw);
|
|
2855
|
+
if (!isSlashCommandsEnabled(slashConfig)) return;
|
|
2856
|
+
try {
|
|
2857
|
+
const teams = await fetchMattermostUserTeams(params.client, params.botUserId);
|
|
2858
|
+
const slashCallbackUrl = resolveCallbackUrl({
|
|
2859
|
+
config: slashConfig,
|
|
2860
|
+
gatewayPort: parseStrictPositiveInteger(process.env.OPENCLAW_GATEWAY_PORT?.trim()) ?? params.cfg.gateway?.port ?? 18789,
|
|
2861
|
+
gatewayHost: params.cfg.gateway?.customBindHost ?? void 0
|
|
2862
|
+
});
|
|
2863
|
+
warnOnSuspiciousCallbackUrl({
|
|
2864
|
+
runtime: params.runtime,
|
|
2865
|
+
baseUrl: params.baseUrl,
|
|
2866
|
+
callbackUrl: slashCallbackUrl
|
|
2867
|
+
});
|
|
2868
|
+
const dedupedCommands = dedupeSlashCommands(buildSlashCommands({
|
|
2869
|
+
cfg: params.cfg,
|
|
2870
|
+
runtime: params.runtime,
|
|
2871
|
+
nativeSkills: slashConfig.nativeSkills === true
|
|
2872
|
+
}));
|
|
2873
|
+
const { registered, teamRegistrationFailures } = await registerSlashCommandsAcrossTeams({
|
|
2874
|
+
client: params.client,
|
|
2875
|
+
teams,
|
|
2876
|
+
botUserId: params.botUserId,
|
|
2877
|
+
callbackUrl: slashCallbackUrl,
|
|
2878
|
+
commands: dedupedCommands,
|
|
2879
|
+
runtime: params.runtime
|
|
2880
|
+
});
|
|
2881
|
+
if (registered.length === 0) {
|
|
2882
|
+
params.runtime.error?.("mattermost: native slash commands enabled but no commands could be registered; keeping slash callbacks inactive");
|
|
2883
|
+
return;
|
|
2884
|
+
}
|
|
2885
|
+
if (teamRegistrationFailures > 0) params.runtime.error?.(`mattermost: slash command registration completed with ${teamRegistrationFailures} team error(s)`);
|
|
2886
|
+
activateSlashCommands({
|
|
2887
|
+
account: params.account,
|
|
2888
|
+
commandTokens: registered.map((cmd) => cmd.token).filter(Boolean),
|
|
2889
|
+
registeredCommands: registered,
|
|
2890
|
+
triggerMap: buildTriggerMap(dedupedCommands),
|
|
2891
|
+
api: {
|
|
2892
|
+
cfg: params.cfg,
|
|
2893
|
+
runtime: params.runtime
|
|
2894
|
+
},
|
|
2895
|
+
log: (msg) => params.runtime.log?.(msg)
|
|
2896
|
+
});
|
|
2897
|
+
params.runtime.log?.(`mattermost: slash commands registered (${registered.length} commands across ${teams.length} teams, callback=${slashCallbackUrl})`);
|
|
2898
|
+
} catch (err) {
|
|
2899
|
+
params.runtime.error?.(`mattermost: failed to register slash commands: ${String(err)}`);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
//#endregion
|
|
2903
|
+
//#region extensions/mattermost/src/mattermost/monitor-websocket.ts
|
|
2904
|
+
var WebSocketClosedBeforeOpenError = class extends Error {
|
|
2905
|
+
constructor(code, reason) {
|
|
2906
|
+
super(`websocket closed before open (code ${code})`);
|
|
2907
|
+
this.code = code;
|
|
2908
|
+
this.reason = reason;
|
|
2909
|
+
this.name = "WebSocketClosedBeforeOpenError";
|
|
2910
|
+
}
|
|
2911
|
+
};
|
|
2912
|
+
const defaultMattermostWebSocketFactory = (url) => new WebSocket$1(url);
|
|
2913
|
+
function parsePostedPayload(payload) {
|
|
2914
|
+
if (payload.event !== "posted") return null;
|
|
2915
|
+
const postData = payload.data?.post;
|
|
2916
|
+
if (!postData) return null;
|
|
2917
|
+
let post = null;
|
|
2918
|
+
if (typeof postData === "string") try {
|
|
2919
|
+
post = JSON.parse(postData);
|
|
2920
|
+
} catch {
|
|
2921
|
+
return null;
|
|
2922
|
+
}
|
|
2923
|
+
else if (typeof postData === "object") post = postData;
|
|
2924
|
+
if (!post) return null;
|
|
2925
|
+
return {
|
|
2926
|
+
payload,
|
|
2927
|
+
post
|
|
2928
|
+
};
|
|
2929
|
+
}
|
|
2930
|
+
function createMattermostConnectOnce(opts) {
|
|
2931
|
+
const webSocketFactory = opts.webSocketFactory ?? defaultMattermostWebSocketFactory;
|
|
2932
|
+
return async () => {
|
|
2933
|
+
const ws = webSocketFactory(opts.wsUrl);
|
|
2934
|
+
const onAbort = () => ws.terminate();
|
|
2935
|
+
opts.abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
2936
|
+
try {
|
|
2937
|
+
return await new Promise((resolve, reject) => {
|
|
2938
|
+
let opened = false;
|
|
2939
|
+
let settled = false;
|
|
2940
|
+
const resolveOnce = () => {
|
|
2941
|
+
if (settled) return;
|
|
2942
|
+
settled = true;
|
|
2943
|
+
resolve();
|
|
2944
|
+
};
|
|
2945
|
+
const rejectOnce = (error) => {
|
|
2946
|
+
if (settled) return;
|
|
2947
|
+
settled = true;
|
|
2948
|
+
reject(error);
|
|
2949
|
+
};
|
|
2950
|
+
ws.on("open", () => {
|
|
2951
|
+
opened = true;
|
|
2952
|
+
opts.statusSink?.({
|
|
2953
|
+
connected: true,
|
|
2954
|
+
lastConnectedAt: Date.now(),
|
|
2955
|
+
lastError: null
|
|
2956
|
+
});
|
|
2957
|
+
ws.send(JSON.stringify({
|
|
2958
|
+
seq: opts.nextSeq(),
|
|
2959
|
+
action: "authentication_challenge",
|
|
2960
|
+
data: { token: opts.botToken }
|
|
2961
|
+
}));
|
|
2962
|
+
});
|
|
2963
|
+
ws.on("message", async (data) => {
|
|
2964
|
+
const raw = rawDataToString(data);
|
|
2965
|
+
let payload;
|
|
2966
|
+
try {
|
|
2967
|
+
payload = JSON.parse(raw);
|
|
2968
|
+
} catch {
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
if (payload.event === "reaction_added" || payload.event === "reaction_removed") {
|
|
2972
|
+
if (!opts.onReaction) return;
|
|
2973
|
+
try {
|
|
2974
|
+
await opts.onReaction(payload);
|
|
2975
|
+
} catch (err) {
|
|
2976
|
+
opts.runtime.error?.(`mattermost reaction handler failed: ${String(err)}`);
|
|
2977
|
+
}
|
|
2978
|
+
return;
|
|
2979
|
+
}
|
|
2980
|
+
if (payload.event !== "posted") return;
|
|
2981
|
+
const parsed = parsePostedPayload(payload);
|
|
2982
|
+
if (!parsed) return;
|
|
2983
|
+
try {
|
|
2984
|
+
await opts.onPosted(parsed.post, parsed.payload);
|
|
2985
|
+
} catch (err) {
|
|
2986
|
+
opts.runtime.error?.(`mattermost handler failed: ${String(err)}`);
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
ws.on("close", (code, reason) => {
|
|
2990
|
+
const message = reasonToString(reason);
|
|
2991
|
+
opts.statusSink?.({
|
|
2992
|
+
connected: false,
|
|
2993
|
+
lastDisconnect: {
|
|
2994
|
+
at: Date.now(),
|
|
2995
|
+
status: code,
|
|
2996
|
+
error: message || void 0
|
|
2997
|
+
}
|
|
2998
|
+
});
|
|
2999
|
+
if (opened) {
|
|
3000
|
+
resolveOnce();
|
|
3001
|
+
return;
|
|
3002
|
+
}
|
|
3003
|
+
rejectOnce(new WebSocketClosedBeforeOpenError(code, message || void 0));
|
|
3004
|
+
});
|
|
3005
|
+
ws.on("error", (err) => {
|
|
3006
|
+
opts.runtime.error?.(`mattermost websocket error: ${String(err)}`);
|
|
3007
|
+
opts.statusSink?.({ lastError: String(err) });
|
|
3008
|
+
try {
|
|
3009
|
+
ws.close();
|
|
3010
|
+
} catch {}
|
|
3011
|
+
});
|
|
3012
|
+
});
|
|
3013
|
+
} finally {
|
|
3014
|
+
opts.abortSignal?.removeEventListener("abort", onAbort);
|
|
3015
|
+
}
|
|
3016
|
+
};
|
|
3017
|
+
}
|
|
3018
|
+
function reasonToString(reason) {
|
|
3019
|
+
if (!reason) return "";
|
|
3020
|
+
if (typeof reason === "string") return reason;
|
|
3021
|
+
return reason.length > 0 ? reason.toString("utf8") : "";
|
|
3022
|
+
}
|
|
3023
|
+
//#endregion
|
|
3024
|
+
//#region extensions/mattermost/src/mattermost/reconnect.ts
|
|
3025
|
+
/**
|
|
3026
|
+
* Reconnection loop with exponential backoff.
|
|
3027
|
+
*
|
|
3028
|
+
* Calls `connectFn` in a while loop. On normal resolve (connection closed),
|
|
3029
|
+
* the backoff resets. On thrown error (connection failed), the current delay is
|
|
3030
|
+
* used, then doubled for the next retry.
|
|
3031
|
+
* The loop exits when `abortSignal` fires.
|
|
3032
|
+
*/
|
|
3033
|
+
async function runWithReconnect(connectFn, opts = {}) {
|
|
3034
|
+
const { initialDelayMs = 2e3, maxDelayMs = 6e4 } = opts;
|
|
3035
|
+
const jitterRatio = Math.max(0, opts.jitterRatio ?? 0);
|
|
3036
|
+
const random = opts.random ?? Math.random;
|
|
3037
|
+
let retryDelay = initialDelayMs;
|
|
3038
|
+
let attempt = 0;
|
|
3039
|
+
while (!opts.abortSignal?.aborted) {
|
|
3040
|
+
let shouldIncreaseDelay = false;
|
|
3041
|
+
let outcome = "resolved";
|
|
3042
|
+
let error;
|
|
3043
|
+
try {
|
|
3044
|
+
await connectFn();
|
|
3045
|
+
retryDelay = initialDelayMs;
|
|
3046
|
+
} catch (err) {
|
|
3047
|
+
if (opts.abortSignal?.aborted) return;
|
|
3048
|
+
outcome = "rejected";
|
|
3049
|
+
error = err;
|
|
3050
|
+
opts.onError?.(err);
|
|
3051
|
+
shouldIncreaseDelay = true;
|
|
3052
|
+
}
|
|
3053
|
+
if (opts.abortSignal?.aborted) return;
|
|
3054
|
+
const delayMs = withJitter(retryDelay, jitterRatio, random);
|
|
3055
|
+
if (!(opts.shouldReconnect?.({
|
|
3056
|
+
attempt,
|
|
3057
|
+
delayMs,
|
|
3058
|
+
outcome,
|
|
3059
|
+
error
|
|
3060
|
+
}) ?? true)) return;
|
|
3061
|
+
opts.onReconnect?.(delayMs);
|
|
3062
|
+
await sleepAbortable(delayMs, opts.abortSignal);
|
|
3063
|
+
if (shouldIncreaseDelay) retryDelay = Math.min(retryDelay * 2, maxDelayMs);
|
|
3064
|
+
attempt++;
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
function withJitter(baseMs, jitterRatio, random) {
|
|
3068
|
+
if (jitterRatio <= 0) return baseMs;
|
|
3069
|
+
const normalized = Math.max(0, Math.min(1, random()));
|
|
3070
|
+
const spread = baseMs * jitterRatio;
|
|
3071
|
+
return Math.max(1, Math.round(baseMs - spread + normalized * spread * 2));
|
|
3072
|
+
}
|
|
3073
|
+
function sleepAbortable(ms, signal) {
|
|
3074
|
+
return new Promise((resolve) => {
|
|
3075
|
+
if (signal?.aborted) {
|
|
3076
|
+
resolve();
|
|
3077
|
+
return;
|
|
3078
|
+
}
|
|
3079
|
+
const onAbort = () => {
|
|
3080
|
+
clearTimeout(timer);
|
|
3081
|
+
resolve();
|
|
3082
|
+
};
|
|
3083
|
+
const timer = setTimeout(() => {
|
|
3084
|
+
signal?.removeEventListener("abort", onAbort);
|
|
3085
|
+
resolve();
|
|
3086
|
+
}, ms);
|
|
3087
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
//#endregion
|
|
3091
|
+
//#region extensions/mattermost/src/mattermost/monitor.ts
|
|
3092
|
+
const RECENT_MATTERMOST_MESSAGE_TTL_MS = 5 * 6e4;
|
|
3093
|
+
const RECENT_MATTERMOST_MESSAGE_MAX = 2e3;
|
|
3094
|
+
function isLoopbackHost(hostname) {
|
|
3095
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
3096
|
+
}
|
|
3097
|
+
function normalizeInteractionSourceIps(values) {
|
|
3098
|
+
return (values ?? []).map((value) => value.trim()).filter(Boolean);
|
|
3099
|
+
}
|
|
3100
|
+
const recentInboundMessages = createDedupeCache({
|
|
3101
|
+
ttlMs: RECENT_MATTERMOST_MESSAGE_TTL_MS,
|
|
3102
|
+
maxSize: RECENT_MATTERMOST_MESSAGE_MAX
|
|
3103
|
+
});
|
|
3104
|
+
function resolveRuntime(opts) {
|
|
3105
|
+
return opts.runtime ?? {
|
|
3106
|
+
log: console.log,
|
|
3107
|
+
error: console.error,
|
|
3108
|
+
exit: (code) => {
|
|
3109
|
+
throw new Error(`exit ${code}`);
|
|
3110
|
+
}
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
function isSystemPost(post) {
|
|
3114
|
+
const type = post.type?.trim();
|
|
3115
|
+
return Boolean(type);
|
|
3116
|
+
}
|
|
3117
|
+
function channelChatType(kind) {
|
|
3118
|
+
if (kind === "direct") return "direct";
|
|
3119
|
+
if (kind === "group") return "group";
|
|
3120
|
+
return "channel";
|
|
3121
|
+
}
|
|
3122
|
+
function resolveMattermostReplyRootId(params) {
|
|
3123
|
+
const threadRootId = params.threadRootId?.trim();
|
|
3124
|
+
if (threadRootId) return threadRootId;
|
|
3125
|
+
return params.replyToId?.trim() || void 0;
|
|
3126
|
+
}
|
|
3127
|
+
function resolveMattermostEffectiveReplyToId(params) {
|
|
3128
|
+
const threadRootId = params.threadRootId?.trim();
|
|
3129
|
+
if (threadRootId) return threadRootId;
|
|
3130
|
+
if (params.kind === "direct") return;
|
|
3131
|
+
const postId = params.postId?.trim();
|
|
3132
|
+
if (!postId) return;
|
|
3133
|
+
return params.replyToMode === "all" || params.replyToMode === "first" ? postId : void 0;
|
|
3134
|
+
}
|
|
3135
|
+
function resolveMattermostThreadSessionContext(params) {
|
|
3136
|
+
const effectiveReplyToId = resolveMattermostEffectiveReplyToId({
|
|
3137
|
+
kind: params.kind,
|
|
3138
|
+
postId: params.postId,
|
|
3139
|
+
replyToMode: params.replyToMode,
|
|
3140
|
+
threadRootId: params.threadRootId
|
|
3141
|
+
});
|
|
3142
|
+
const threadKeys = resolveThreadSessionKeys({
|
|
3143
|
+
baseSessionKey: params.baseSessionKey,
|
|
3144
|
+
threadId: effectiveReplyToId,
|
|
3145
|
+
parentSessionKey: effectiveReplyToId ? params.baseSessionKey : void 0
|
|
3146
|
+
});
|
|
3147
|
+
return {
|
|
3148
|
+
effectiveReplyToId,
|
|
3149
|
+
sessionKey: threadKeys.sessionKey,
|
|
3150
|
+
parentSessionKey: threadKeys.parentSessionKey
|
|
3151
|
+
};
|
|
3152
|
+
}
|
|
3153
|
+
function buildMattermostAttachmentPlaceholder(mediaList) {
|
|
3154
|
+
if (mediaList.length === 0) return "";
|
|
3155
|
+
if (mediaList.length === 1) return `<media:${mediaList[0].kind === "unknown" ? "document" : mediaList[0].kind}>`;
|
|
3156
|
+
const allImages = mediaList.every((media) => media.kind === "image");
|
|
3157
|
+
const label = allImages ? "image" : "file";
|
|
3158
|
+
const suffix = mediaList.length === 1 ? label : `${label}s`;
|
|
3159
|
+
return `${allImages ? "<media:image>" : "<media:document>"} (${mediaList.length} ${suffix})`;
|
|
3160
|
+
}
|
|
3161
|
+
function buildMattermostWsUrl(baseUrl) {
|
|
3162
|
+
const normalized = normalizeMattermostBaseUrl(baseUrl);
|
|
3163
|
+
if (!normalized) throw new Error("Mattermost baseUrl is required");
|
|
3164
|
+
return `${normalized.replace(/^http/i, "ws")}/api/v4/websocket`;
|
|
3165
|
+
}
|
|
3166
|
+
async function monitorMattermostProvider(opts = {}) {
|
|
3167
|
+
const core = getMattermostRuntime();
|
|
3168
|
+
const runtime = resolveRuntime(opts);
|
|
3169
|
+
const cfg = opts.config ?? core.config.loadConfig();
|
|
3170
|
+
const account = resolveMattermostAccount({
|
|
3171
|
+
cfg,
|
|
3172
|
+
accountId: opts.accountId
|
|
3173
|
+
});
|
|
3174
|
+
const pairing = createChannelPairingController({
|
|
3175
|
+
core,
|
|
3176
|
+
channel: "mattermost",
|
|
3177
|
+
accountId: account.accountId
|
|
3178
|
+
});
|
|
3179
|
+
const allowNameMatching = isDangerousNameMatchingEnabled(account.config);
|
|
3180
|
+
const botToken = opts.botToken?.trim() || account.botToken?.trim();
|
|
3181
|
+
if (!botToken) throw new Error(`Mattermost bot token missing for account "${account.accountId}" (set channels.mattermost.accounts.${account.accountId}.botToken or MATTERMOST_BOT_TOKEN for default).`);
|
|
3182
|
+
const baseUrl = normalizeMattermostBaseUrl(opts.baseUrl ?? account.baseUrl);
|
|
3183
|
+
if (!baseUrl) throw new Error(`Mattermost baseUrl missing for account "${account.accountId}" (set channels.mattermost.accounts.${account.accountId}.baseUrl or MATTERMOST_URL for default).`);
|
|
3184
|
+
const client = createMattermostClient({
|
|
3185
|
+
baseUrl,
|
|
3186
|
+
botToken
|
|
3187
|
+
});
|
|
3188
|
+
const botUser = await fetchMattermostMe(client);
|
|
3189
|
+
const botUserId = botUser.id;
|
|
3190
|
+
const botUsername = botUser.username?.trim() || void 0;
|
|
3191
|
+
runtime.log?.(`mattermost connected as ${botUsername ? `@${botUsername}` : botUserId}`);
|
|
3192
|
+
await registerMattermostMonitorSlashCommands({
|
|
3193
|
+
client,
|
|
3194
|
+
cfg,
|
|
3195
|
+
runtime,
|
|
3196
|
+
account,
|
|
3197
|
+
baseUrl,
|
|
3198
|
+
botUserId
|
|
3199
|
+
});
|
|
3200
|
+
const slashEnabled = getSlashCommandState(account.accountId) != null;
|
|
3201
|
+
setInteractionSecret(account.accountId, botToken);
|
|
3202
|
+
const interactionPath = resolveInteractionCallbackPath(account.accountId);
|
|
3203
|
+
const callbackUrl = computeInteractionCallbackUrl(account.accountId, {
|
|
3204
|
+
gateway: cfg.gateway,
|
|
3205
|
+
interactions: account.config.interactions
|
|
3206
|
+
});
|
|
3207
|
+
setInteractionCallbackUrl(account.accountId, callbackUrl);
|
|
3208
|
+
const allowedInteractionSourceIps = normalizeInteractionSourceIps(account.config.interactions?.allowedSourceIps);
|
|
3209
|
+
try {
|
|
3210
|
+
const mmHost = new URL(baseUrl).hostname;
|
|
3211
|
+
const callbackHost = new URL(callbackUrl).hostname;
|
|
3212
|
+
if (isLoopbackHost(callbackHost) && !isLoopbackHost(mmHost)) runtime.error?.(`mattermost: interactions callbackUrl resolved to ${callbackUrl} (loopback) while baseUrl is ${baseUrl}. This MAY be unreachable depending on your deployment. If button clicks don't work, set channels.mattermost.interactions.callbackBaseUrl to a URL reachable from the Mattermost server (e.g. your public reverse proxy URL).`);
|
|
3213
|
+
if (!isLoopbackHost(callbackHost) && allowedInteractionSourceIps.length === 0) runtime.error?.(`mattermost: interactions callbackUrl resolved to ${callbackUrl} without channels.mattermost.interactions.allowedSourceIps. For safety, non-loopback callback sources will be rejected until you allowlist the Mattermost server or trusted ingress IPs.`);
|
|
3214
|
+
} catch {}
|
|
3215
|
+
const effectiveInteractionSourceIps = allowedInteractionSourceIps.length > 0 ? allowedInteractionSourceIps : ["127.0.0.1", "::1"];
|
|
3216
|
+
const unregisterInteractions = registerPluginHttpRoute({
|
|
3217
|
+
path: interactionPath,
|
|
3218
|
+
fallbackPath: "/mattermost/interactions/default",
|
|
3219
|
+
auth: "plugin",
|
|
3220
|
+
handler: createMattermostInteractionHandler({
|
|
3221
|
+
client,
|
|
3222
|
+
botUserId,
|
|
3223
|
+
accountId: account.accountId,
|
|
3224
|
+
allowedSourceIps: effectiveInteractionSourceIps,
|
|
3225
|
+
trustedProxies: cfg.gateway?.trustedProxies,
|
|
3226
|
+
allowRealIpFallback: cfg.gateway?.allowRealIpFallback === true,
|
|
3227
|
+
handleInteraction: handleModelPickerInteraction,
|
|
3228
|
+
authorizeButtonClick: async ({ payload, post }) => {
|
|
3229
|
+
const channelInfo = await resolveChannelInfo(payload.channel_id);
|
|
3230
|
+
const isDirect = channelInfo?.type?.trim().toUpperCase() === "D";
|
|
3231
|
+
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
3232
|
+
cfg,
|
|
3233
|
+
surface: "mattermost"
|
|
3234
|
+
});
|
|
3235
|
+
const decision = authorizeMattermostCommandInvocation({
|
|
3236
|
+
account,
|
|
3237
|
+
cfg,
|
|
3238
|
+
senderId: payload.user_id,
|
|
3239
|
+
senderName: payload.user_name ?? "",
|
|
3240
|
+
channelId: payload.channel_id,
|
|
3241
|
+
channelInfo,
|
|
3242
|
+
storeAllowFrom: isDirect ? await readStoreAllowFromForDmPolicy({
|
|
3243
|
+
provider: "mattermost",
|
|
3244
|
+
accountId: account.accountId,
|
|
3245
|
+
dmPolicy: account.config.dmPolicy ?? "pairing",
|
|
3246
|
+
readStore: pairing.readStoreForDmPolicy
|
|
3247
|
+
}) : void 0,
|
|
3248
|
+
allowTextCommands,
|
|
3249
|
+
hasControlCommand: false
|
|
3250
|
+
});
|
|
3251
|
+
if (decision.ok) return { ok: true };
|
|
3252
|
+
return {
|
|
3253
|
+
ok: false,
|
|
3254
|
+
response: {
|
|
3255
|
+
update: {
|
|
3256
|
+
message: post.message ?? "",
|
|
3257
|
+
props: post.props
|
|
3258
|
+
},
|
|
3259
|
+
ephemeral_text: `OpenClaw ignored this action for ${decision.roomLabel}.`
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
},
|
|
3263
|
+
resolveSessionKey: async ({ channelId, userId, post }) => {
|
|
3264
|
+
const channelInfo = await resolveChannelInfo(channelId);
|
|
3265
|
+
const kind = mapMattermostChannelTypeToChatType(channelInfo?.type);
|
|
3266
|
+
const teamId = channelInfo?.team_id ?? void 0;
|
|
3267
|
+
const route = core.channel.routing.resolveAgentRoute({
|
|
3268
|
+
cfg,
|
|
3269
|
+
channel: "mattermost",
|
|
3270
|
+
accountId: account.accountId,
|
|
3271
|
+
teamId,
|
|
3272
|
+
peer: {
|
|
3273
|
+
kind,
|
|
3274
|
+
id: kind === "direct" ? userId : channelId
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
const replyToMode = resolveMattermostReplyToMode(account, kind);
|
|
3278
|
+
return resolveMattermostThreadSessionContext({
|
|
3279
|
+
baseSessionKey: route.sessionKey,
|
|
3280
|
+
kind,
|
|
3281
|
+
postId: post.id || void 0,
|
|
3282
|
+
replyToMode,
|
|
3283
|
+
threadRootId: post.root_id
|
|
3284
|
+
}).sessionKey;
|
|
3285
|
+
},
|
|
3286
|
+
dispatchButtonClick: async (opts) => {
|
|
3287
|
+
const channelInfo = await resolveChannelInfo(opts.channelId);
|
|
3288
|
+
const kind = mapMattermostChannelTypeToChatType(channelInfo?.type);
|
|
3289
|
+
const chatType = channelChatType(kind);
|
|
3290
|
+
const teamId = channelInfo?.team_id ?? void 0;
|
|
3291
|
+
const channelName = channelInfo?.name ?? void 0;
|
|
3292
|
+
const channelDisplay = channelInfo?.display_name ?? channelName ?? opts.channelId;
|
|
3293
|
+
const route = core.channel.routing.resolveAgentRoute({
|
|
3294
|
+
cfg,
|
|
3295
|
+
channel: "mattermost",
|
|
3296
|
+
accountId: account.accountId,
|
|
3297
|
+
teamId,
|
|
3298
|
+
peer: {
|
|
3299
|
+
kind,
|
|
3300
|
+
id: kind === "direct" ? opts.userId : opts.channelId
|
|
3301
|
+
}
|
|
3302
|
+
});
|
|
3303
|
+
const replyToMode = resolveMattermostReplyToMode(account, kind);
|
|
3304
|
+
const threadContext = resolveMattermostThreadSessionContext({
|
|
3305
|
+
baseSessionKey: route.sessionKey,
|
|
3306
|
+
kind,
|
|
3307
|
+
postId: opts.post.id || opts.postId,
|
|
3308
|
+
replyToMode,
|
|
3309
|
+
threadRootId: opts.post.root_id
|
|
3310
|
+
});
|
|
3311
|
+
const to = kind === "direct" ? `user:${opts.userId}` : `channel:${opts.channelId}`;
|
|
3312
|
+
const bodyText = `[Button click: user @${opts.userName} selected "${opts.actionName}"]`;
|
|
3313
|
+
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
3314
|
+
Body: bodyText,
|
|
3315
|
+
BodyForAgent: bodyText,
|
|
3316
|
+
RawBody: bodyText,
|
|
3317
|
+
CommandBody: bodyText,
|
|
3318
|
+
From: kind === "direct" ? `mattermost:${opts.userId}` : kind === "group" ? `mattermost:group:${opts.channelId}` : `mattermost:channel:${opts.channelId}`,
|
|
3319
|
+
To: to,
|
|
3320
|
+
SessionKey: threadContext.sessionKey,
|
|
3321
|
+
ParentSessionKey: threadContext.parentSessionKey,
|
|
3322
|
+
AccountId: route.accountId,
|
|
3323
|
+
ChatType: chatType,
|
|
3324
|
+
ConversationLabel: `mattermost:${opts.userName}`,
|
|
3325
|
+
GroupSubject: kind !== "direct" ? channelDisplay : void 0,
|
|
3326
|
+
GroupChannel: channelName ? `#${channelName}` : void 0,
|
|
3327
|
+
GroupSpace: teamId,
|
|
3328
|
+
SenderName: opts.userName,
|
|
3329
|
+
SenderId: opts.userId,
|
|
3330
|
+
Provider: "mattermost",
|
|
3331
|
+
Surface: "mattermost",
|
|
3332
|
+
MessageSid: `interaction:${opts.postId}:${opts.actionId}`,
|
|
3333
|
+
ReplyToId: threadContext.effectiveReplyToId,
|
|
3334
|
+
MessageThreadId: threadContext.effectiveReplyToId,
|
|
3335
|
+
WasMentioned: true,
|
|
3336
|
+
CommandAuthorized: false,
|
|
3337
|
+
OriginatingChannel: "mattermost",
|
|
3338
|
+
OriginatingTo: to
|
|
3339
|
+
});
|
|
3340
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "mattermost", account.accountId, { fallbackLimit: account.textChunkLimit ?? 4e3 });
|
|
3341
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
3342
|
+
cfg,
|
|
3343
|
+
channel: "mattermost",
|
|
3344
|
+
accountId: account.accountId
|
|
3345
|
+
});
|
|
3346
|
+
const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelReplyPipeline({
|
|
3347
|
+
cfg,
|
|
3348
|
+
agentId: route.agentId,
|
|
3349
|
+
channel: "mattermost",
|
|
3350
|
+
accountId: account.accountId,
|
|
3351
|
+
typing: {
|
|
3352
|
+
start: () => sendTypingIndicator(opts.channelId, threadContext.effectiveReplyToId),
|
|
3353
|
+
onStartError: (err) => {
|
|
3354
|
+
logTypingFailure({
|
|
3355
|
+
log: (message) => logger.debug?.(message),
|
|
3356
|
+
channel: "mattermost",
|
|
3357
|
+
target: opts.channelId,
|
|
3358
|
+
error: err
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
});
|
|
3363
|
+
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
3364
|
+
...replyPipeline,
|
|
3365
|
+
humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId),
|
|
3366
|
+
deliver: async (payload) => {
|
|
3367
|
+
await deliverMattermostReplyPayload({
|
|
3368
|
+
core,
|
|
3369
|
+
cfg,
|
|
3370
|
+
payload,
|
|
3371
|
+
to,
|
|
3372
|
+
accountId: account.accountId,
|
|
3373
|
+
agentId: route.agentId,
|
|
3374
|
+
replyToId: resolveMattermostReplyRootId({
|
|
3375
|
+
threadRootId: threadContext.effectiveReplyToId,
|
|
3376
|
+
replyToId: payload.replyToId
|
|
3377
|
+
}),
|
|
3378
|
+
textLimit,
|
|
3379
|
+
tableMode,
|
|
3380
|
+
sendMessage: sendMessageMattermost
|
|
3381
|
+
});
|
|
3382
|
+
runtime.log?.(`delivered button-click reply to ${to}`);
|
|
3383
|
+
},
|
|
3384
|
+
onError: (err, info) => {
|
|
3385
|
+
runtime.error?.(`mattermost button-click ${info.kind} reply failed: ${String(err)}`);
|
|
3386
|
+
},
|
|
3387
|
+
onReplyStart: typingCallbacks?.onReplyStart
|
|
3388
|
+
});
|
|
3389
|
+
await core.channel.reply.dispatchReplyFromConfig({
|
|
3390
|
+
ctx: ctxPayload,
|
|
3391
|
+
cfg,
|
|
3392
|
+
dispatcher,
|
|
3393
|
+
replyOptions: {
|
|
3394
|
+
...replyOptions,
|
|
3395
|
+
disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
|
|
3396
|
+
onModelSelected
|
|
3397
|
+
}
|
|
3398
|
+
});
|
|
3399
|
+
markDispatchIdle();
|
|
3400
|
+
},
|
|
3401
|
+
log: (msg) => runtime.log?.(msg)
|
|
3402
|
+
}),
|
|
3403
|
+
pluginId: "mattermost",
|
|
3404
|
+
source: "mattermost-interactions",
|
|
3405
|
+
accountId: account.accountId,
|
|
3406
|
+
log: (msg) => runtime.log?.(msg)
|
|
3407
|
+
});
|
|
3408
|
+
const logger = core.logging.getChildLogger({ module: "mattermost" });
|
|
3409
|
+
const logVerboseMessage = (message) => {
|
|
3410
|
+
if (!core.logging.shouldLogVerbose()) return;
|
|
3411
|
+
logger.debug?.(message);
|
|
3412
|
+
};
|
|
3413
|
+
const mediaMaxBytes = resolveChannelMediaMaxBytes({
|
|
3414
|
+
cfg,
|
|
3415
|
+
resolveChannelLimitMb: () => void 0,
|
|
3416
|
+
accountId: account.accountId
|
|
3417
|
+
}) ?? 8 * 1024 * 1024;
|
|
3418
|
+
const historyLimit = Math.max(0, cfg.messages?.groupChat?.historyLimit ?? 50);
|
|
3419
|
+
const channelHistories = /* @__PURE__ */ new Map();
|
|
3420
|
+
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
3421
|
+
const { groupPolicy, providerMissingFallbackApplied } = resolveAllowlistProviderRuntimeGroupPolicy({
|
|
3422
|
+
providerConfigPresent: cfg.channels?.mattermost !== void 0,
|
|
3423
|
+
groupPolicy: account.config.groupPolicy,
|
|
3424
|
+
defaultGroupPolicy
|
|
3425
|
+
});
|
|
3426
|
+
warnMissingProviderGroupPolicyFallbackOnce({
|
|
3427
|
+
providerMissingFallbackApplied,
|
|
3428
|
+
providerKey: "mattermost",
|
|
3429
|
+
accountId: account.accountId,
|
|
3430
|
+
log: (message) => logVerboseMessage(message)
|
|
3431
|
+
});
|
|
3432
|
+
const { resolveMattermostMedia, sendTypingIndicator, resolveChannelInfo, resolveUserInfo, updateModelPickerPost } = createMattermostMonitorResources({
|
|
3433
|
+
accountId: account.accountId,
|
|
3434
|
+
callbackUrl,
|
|
3435
|
+
client,
|
|
3436
|
+
logger: { debug: (message) => logger.debug?.(String(message)) },
|
|
3437
|
+
mediaMaxBytes,
|
|
3438
|
+
fetchRemoteMedia: (params) => core.channel.media.fetchRemoteMedia(params),
|
|
3439
|
+
saveMediaBuffer: (buffer, contentType, direction, maxBytes) => core.channel.media.saveMediaBuffer(Buffer.from(buffer), contentType, direction, maxBytes),
|
|
3440
|
+
mediaKindFromMime: (contentType) => core.media.mediaKindFromMime(contentType)
|
|
3441
|
+
});
|
|
3442
|
+
const runModelPickerCommand = async (params) => {
|
|
3443
|
+
const to = params.kind === "direct" ? `user:${params.senderId}` : `channel:${params.channelId}`;
|
|
3444
|
+
const fromLabel = params.kind === "direct" ? `Mattermost DM from ${params.senderName}` : `Mattermost message in ${params.roomLabel} from ${params.senderName}`;
|
|
3445
|
+
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
3446
|
+
Body: params.commandText,
|
|
3447
|
+
BodyForAgent: params.commandText,
|
|
3448
|
+
RawBody: params.commandText,
|
|
3449
|
+
CommandBody: params.commandText,
|
|
3450
|
+
From: params.kind === "direct" ? `mattermost:${params.senderId}` : params.kind === "group" ? `mattermost:group:${params.channelId}` : `mattermost:channel:${params.channelId}`,
|
|
3451
|
+
To: to,
|
|
3452
|
+
SessionKey: params.sessionKey,
|
|
3453
|
+
ParentSessionKey: params.parentSessionKey,
|
|
3454
|
+
AccountId: params.route.accountId,
|
|
3455
|
+
ChatType: params.chatType,
|
|
3456
|
+
ConversationLabel: fromLabel,
|
|
3457
|
+
GroupSubject: params.kind !== "direct" ? params.channelDisplay || params.roomLabel : void 0,
|
|
3458
|
+
GroupChannel: params.channelName ? `#${params.channelName}` : void 0,
|
|
3459
|
+
GroupSpace: params.teamId,
|
|
3460
|
+
SenderName: params.senderName,
|
|
3461
|
+
SenderId: params.senderId,
|
|
3462
|
+
Provider: "mattermost",
|
|
3463
|
+
Surface: "mattermost",
|
|
3464
|
+
MessageSid: `interaction:${params.postId}:${Date.now()}`,
|
|
3465
|
+
ReplyToId: params.effectiveReplyToId,
|
|
3466
|
+
MessageThreadId: params.effectiveReplyToId,
|
|
3467
|
+
Timestamp: Date.now(),
|
|
3468
|
+
WasMentioned: true,
|
|
3469
|
+
CommandAuthorized: params.commandAuthorized,
|
|
3470
|
+
CommandSource: "native",
|
|
3471
|
+
OriginatingChannel: "mattermost",
|
|
3472
|
+
OriginatingTo: to
|
|
3473
|
+
});
|
|
3474
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
3475
|
+
cfg,
|
|
3476
|
+
channel: "mattermost",
|
|
3477
|
+
accountId: account.accountId
|
|
3478
|
+
});
|
|
3479
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "mattermost", account.accountId, { fallbackLimit: account.textChunkLimit ?? 4e3 });
|
|
3480
|
+
const shouldDeliverReplies = params.deliverReplies === true;
|
|
3481
|
+
const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelReplyPipeline({
|
|
3482
|
+
cfg,
|
|
3483
|
+
agentId: params.route.agentId,
|
|
3484
|
+
channel: "mattermost",
|
|
3485
|
+
accountId: account.accountId,
|
|
3486
|
+
typing: shouldDeliverReplies ? {
|
|
3487
|
+
start: () => sendTypingIndicator(params.channelId, params.effectiveReplyToId),
|
|
3488
|
+
onStartError: (err) => {
|
|
3489
|
+
logTypingFailure({
|
|
3490
|
+
log: (message) => logger.debug?.(message),
|
|
3491
|
+
channel: "mattermost",
|
|
3492
|
+
target: params.channelId,
|
|
3493
|
+
error: err
|
|
3494
|
+
});
|
|
3495
|
+
}
|
|
3496
|
+
} : void 0
|
|
3497
|
+
});
|
|
3498
|
+
const capturedTexts = [];
|
|
3499
|
+
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
3500
|
+
...replyPipeline,
|
|
3501
|
+
deliver: async (payload) => {
|
|
3502
|
+
const trimmedPayload = {
|
|
3503
|
+
...payload,
|
|
3504
|
+
text: core.channel.text.convertMarkdownTables(payload.text ?? "", tableMode).trim()
|
|
3505
|
+
};
|
|
3506
|
+
if (!shouldDeliverReplies) {
|
|
3507
|
+
if (trimmedPayload.text) capturedTexts.push(trimmedPayload.text);
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
await deliverMattermostReplyPayload({
|
|
3511
|
+
core,
|
|
3512
|
+
cfg,
|
|
3513
|
+
payload: trimmedPayload,
|
|
3514
|
+
to,
|
|
3515
|
+
accountId: account.accountId,
|
|
3516
|
+
agentId: params.route.agentId,
|
|
3517
|
+
replyToId: resolveMattermostReplyRootId({
|
|
3518
|
+
threadRootId: params.effectiveReplyToId,
|
|
3519
|
+
replyToId: trimmedPayload.replyToId
|
|
3520
|
+
}),
|
|
3521
|
+
textLimit,
|
|
3522
|
+
tableMode: "off",
|
|
3523
|
+
sendMessage: sendMessageMattermost
|
|
3524
|
+
});
|
|
3525
|
+
},
|
|
3526
|
+
onError: (err, info) => {
|
|
3527
|
+
runtime.error?.(`mattermost model picker ${info.kind} reply failed: ${String(err)}`);
|
|
3528
|
+
},
|
|
3529
|
+
onReplyStart: typingCallbacks?.onReplyStart
|
|
3530
|
+
});
|
|
3531
|
+
await core.channel.reply.withReplyDispatcher({
|
|
3532
|
+
dispatcher,
|
|
3533
|
+
onSettled: () => {
|
|
3534
|
+
markDispatchIdle();
|
|
3535
|
+
},
|
|
3536
|
+
run: () => core.channel.reply.dispatchReplyFromConfig({
|
|
3537
|
+
ctx: ctxPayload,
|
|
3538
|
+
cfg,
|
|
3539
|
+
dispatcher,
|
|
3540
|
+
replyOptions: {
|
|
3541
|
+
...replyOptions,
|
|
3542
|
+
disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
|
|
3543
|
+
onModelSelected
|
|
3544
|
+
}
|
|
3545
|
+
})
|
|
3546
|
+
});
|
|
3547
|
+
return capturedTexts.join("\n\n").trim();
|
|
3548
|
+
};
|
|
3549
|
+
async function handleModelPickerInteraction(params) {
|
|
3550
|
+
const pickerState = parseMattermostModelPickerContext(params.context);
|
|
3551
|
+
if (!pickerState) return null;
|
|
3552
|
+
if (pickerState.ownerUserId !== params.payload.user_id) return { ephemeral_text: "Only the person who opened this picker can use it." };
|
|
3553
|
+
const channelInfo = await resolveChannelInfo(params.payload.channel_id);
|
|
3554
|
+
const pickerCommandText = pickerState.action === "select" ? `/model ${pickerState.provider}/${pickerState.model}` : pickerState.action === "list" ? `/models ${pickerState.provider}` : "/models";
|
|
3555
|
+
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
3556
|
+
cfg,
|
|
3557
|
+
surface: "mattermost"
|
|
3558
|
+
});
|
|
3559
|
+
const hasControlCommand = core.channel.text.hasControlCommand(pickerCommandText, cfg);
|
|
3560
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
3561
|
+
const storeAllowFrom = normalizeMattermostAllowList(await readStoreAllowFromForDmPolicy({
|
|
3562
|
+
provider: "mattermost",
|
|
3563
|
+
accountId: account.accountId,
|
|
3564
|
+
dmPolicy,
|
|
3565
|
+
readStore: pairing.readStoreForDmPolicy
|
|
3566
|
+
}));
|
|
3567
|
+
const auth = authorizeMattermostCommandInvocation({
|
|
3568
|
+
account,
|
|
3569
|
+
cfg,
|
|
3570
|
+
senderId: params.payload.user_id,
|
|
3571
|
+
senderName: params.userName,
|
|
3572
|
+
channelId: params.payload.channel_id,
|
|
3573
|
+
channelInfo,
|
|
3574
|
+
storeAllowFrom,
|
|
3575
|
+
allowTextCommands,
|
|
3576
|
+
hasControlCommand
|
|
3577
|
+
});
|
|
3578
|
+
if (!auth.ok) {
|
|
3579
|
+
if (auth.denyReason === "dm-pairing") {
|
|
3580
|
+
const { code } = await pairing.upsertPairingRequest({
|
|
3581
|
+
id: params.payload.user_id,
|
|
3582
|
+
meta: { name: params.userName }
|
|
3583
|
+
});
|
|
3584
|
+
return { ephemeral_text: core.channel.pairing.buildPairingReply({
|
|
3585
|
+
channel: "mattermost",
|
|
3586
|
+
idLine: `Your Mattermost user id: ${params.payload.user_id}`,
|
|
3587
|
+
code
|
|
3588
|
+
}) };
|
|
3589
|
+
}
|
|
3590
|
+
return { ephemeral_text: auth.denyReason === "unknown-channel" ? "Temporary error: unable to determine channel type. Please try again." : auth.denyReason === "dm-disabled" ? "This bot is not accepting direct messages." : auth.denyReason === "channels-disabled" ? "Model picker actions are disabled in channels." : auth.denyReason === "channel-no-allowlist" ? "Model picker actions are not configured for this channel." : "Unauthorized." };
|
|
3591
|
+
}
|
|
3592
|
+
const kind = auth.kind;
|
|
3593
|
+
const chatType = auth.chatType;
|
|
3594
|
+
const teamId = auth.channelInfo.team_id ?? params.payload.team_id ?? void 0;
|
|
3595
|
+
const channelName = auth.channelName || void 0;
|
|
3596
|
+
const channelDisplay = auth.channelDisplay || auth.channelName || params.payload.channel_id;
|
|
3597
|
+
const roomLabel = auth.roomLabel;
|
|
3598
|
+
const route = core.channel.routing.resolveAgentRoute({
|
|
3599
|
+
cfg,
|
|
3600
|
+
channel: "mattermost",
|
|
3601
|
+
accountId: account.accountId,
|
|
3602
|
+
teamId,
|
|
3603
|
+
peer: {
|
|
3604
|
+
kind,
|
|
3605
|
+
id: kind === "direct" ? params.payload.user_id : params.payload.channel_id
|
|
3606
|
+
}
|
|
3607
|
+
});
|
|
3608
|
+
const replyToMode = resolveMattermostReplyToMode(account, kind);
|
|
3609
|
+
const threadContext = resolveMattermostThreadSessionContext({
|
|
3610
|
+
baseSessionKey: route.sessionKey,
|
|
3611
|
+
kind,
|
|
3612
|
+
postId: params.post.id || params.payload.post_id,
|
|
3613
|
+
replyToMode,
|
|
3614
|
+
threadRootId: params.post.root_id
|
|
3615
|
+
});
|
|
3616
|
+
const modelSessionRoute = {
|
|
3617
|
+
agentId: route.agentId,
|
|
3618
|
+
sessionKey: threadContext.sessionKey
|
|
3619
|
+
};
|
|
3620
|
+
const data = await buildModelsProviderData(cfg, route.agentId);
|
|
3621
|
+
if (data.providers.length === 0) return await updateModelPickerPost({
|
|
3622
|
+
channelId: params.payload.channel_id,
|
|
3623
|
+
postId: params.payload.post_id,
|
|
3624
|
+
message: "No models available."
|
|
3625
|
+
});
|
|
3626
|
+
if (pickerState.action === "providers" || pickerState.action === "back") {
|
|
3627
|
+
const currentModel = resolveMattermostModelPickerCurrentModel({
|
|
3628
|
+
cfg,
|
|
3629
|
+
route: modelSessionRoute,
|
|
3630
|
+
data
|
|
3631
|
+
});
|
|
3632
|
+
const view = renderMattermostProviderPickerView({
|
|
3633
|
+
ownerUserId: pickerState.ownerUserId,
|
|
3634
|
+
data,
|
|
3635
|
+
currentModel
|
|
3636
|
+
});
|
|
3637
|
+
return await updateModelPickerPost({
|
|
3638
|
+
channelId: params.payload.channel_id,
|
|
3639
|
+
postId: params.payload.post_id,
|
|
3640
|
+
message: view.text,
|
|
3641
|
+
buttons: view.buttons
|
|
3642
|
+
});
|
|
3643
|
+
}
|
|
3644
|
+
if (pickerState.action === "list") {
|
|
3645
|
+
const currentModel = resolveMattermostModelPickerCurrentModel({
|
|
3646
|
+
cfg,
|
|
3647
|
+
route: modelSessionRoute,
|
|
3648
|
+
data
|
|
3649
|
+
});
|
|
3650
|
+
const view = renderMattermostModelsPickerView({
|
|
3651
|
+
ownerUserId: pickerState.ownerUserId,
|
|
3652
|
+
data,
|
|
3653
|
+
provider: pickerState.provider,
|
|
3654
|
+
page: pickerState.page,
|
|
3655
|
+
currentModel
|
|
3656
|
+
});
|
|
3657
|
+
return await updateModelPickerPost({
|
|
3658
|
+
channelId: params.payload.channel_id,
|
|
3659
|
+
postId: params.payload.post_id,
|
|
3660
|
+
message: view.text,
|
|
3661
|
+
buttons: view.buttons
|
|
3662
|
+
});
|
|
3663
|
+
}
|
|
3664
|
+
const targetModelRef = `${pickerState.provider}/${pickerState.model}`;
|
|
3665
|
+
if (!buildMattermostAllowedModelRefs(data).has(targetModelRef)) return { ephemeral_text: `That model is no longer available: ${targetModelRef}` };
|
|
3666
|
+
(async () => {
|
|
3667
|
+
try {
|
|
3668
|
+
await runModelPickerCommand({
|
|
3669
|
+
commandText: `/model ${targetModelRef}`,
|
|
3670
|
+
commandAuthorized: auth.commandAuthorized,
|
|
3671
|
+
route,
|
|
3672
|
+
sessionKey: threadContext.sessionKey,
|
|
3673
|
+
parentSessionKey: threadContext.parentSessionKey,
|
|
3674
|
+
channelId: params.payload.channel_id,
|
|
3675
|
+
senderId: params.payload.user_id,
|
|
3676
|
+
senderName: params.userName,
|
|
3677
|
+
kind,
|
|
3678
|
+
chatType,
|
|
3679
|
+
channelName,
|
|
3680
|
+
channelDisplay,
|
|
3681
|
+
roomLabel,
|
|
3682
|
+
teamId,
|
|
3683
|
+
postId: params.payload.post_id,
|
|
3684
|
+
effectiveReplyToId: threadContext.effectiveReplyToId,
|
|
3685
|
+
deliverReplies: true
|
|
3686
|
+
});
|
|
3687
|
+
const updatedModel = resolveMattermostModelPickerCurrentModel({
|
|
3688
|
+
cfg,
|
|
3689
|
+
route: modelSessionRoute,
|
|
3690
|
+
data,
|
|
3691
|
+
skipCache: true
|
|
3692
|
+
});
|
|
3693
|
+
const view = renderMattermostModelsPickerView({
|
|
3694
|
+
ownerUserId: pickerState.ownerUserId,
|
|
3695
|
+
data,
|
|
3696
|
+
provider: pickerState.provider,
|
|
3697
|
+
page: pickerState.page,
|
|
3698
|
+
currentModel: updatedModel
|
|
3699
|
+
});
|
|
3700
|
+
await updateModelPickerPost({
|
|
3701
|
+
channelId: params.payload.channel_id,
|
|
3702
|
+
postId: params.payload.post_id,
|
|
3703
|
+
message: view.text,
|
|
3704
|
+
buttons: view.buttons
|
|
3705
|
+
});
|
|
3706
|
+
} catch (err) {
|
|
3707
|
+
runtime.error?.(`mattermost model picker select failed: ${String(err)}`);
|
|
3708
|
+
}
|
|
3709
|
+
})();
|
|
3710
|
+
return {};
|
|
3711
|
+
}
|
|
3712
|
+
const handlePost = async (post, payload, messageIds) => {
|
|
3713
|
+
const channelId = post.channel_id ?? payload.data?.channel_id ?? payload.broadcast?.channel_id;
|
|
3714
|
+
if (!channelId) {
|
|
3715
|
+
logVerboseMessage("mattermost: drop post (missing channel id)");
|
|
3716
|
+
return;
|
|
3717
|
+
}
|
|
3718
|
+
const allMessageIds = messageIds?.length ? messageIds : post.id ? [post.id] : [];
|
|
3719
|
+
if (allMessageIds.length === 0) {
|
|
3720
|
+
logVerboseMessage("mattermost: drop post (missing message id)");
|
|
3721
|
+
return;
|
|
3722
|
+
}
|
|
3723
|
+
const dedupeEntries = allMessageIds.map((id) => recentInboundMessages.check(`${account.accountId}:${id}`));
|
|
3724
|
+
if (dedupeEntries.length > 0 && dedupeEntries.every(Boolean)) {
|
|
3725
|
+
logVerboseMessage(`mattermost: drop post (dedupe account=${account.accountId} ids=${allMessageIds.length})`);
|
|
3726
|
+
return;
|
|
3727
|
+
}
|
|
3728
|
+
const senderId = post.user_id ?? payload.broadcast?.user_id;
|
|
3729
|
+
if (!senderId) {
|
|
3730
|
+
logVerboseMessage("mattermost: drop post (missing sender id)");
|
|
3731
|
+
return;
|
|
3732
|
+
}
|
|
3733
|
+
if (senderId === botUserId) {
|
|
3734
|
+
logVerboseMessage(`mattermost: drop post (self sender=${senderId})`);
|
|
3735
|
+
return;
|
|
3736
|
+
}
|
|
3737
|
+
if (isSystemPost(post)) {
|
|
3738
|
+
logVerboseMessage(`mattermost: drop post (system post type=${post.type ?? "unknown"})`);
|
|
3739
|
+
return;
|
|
3740
|
+
}
|
|
3741
|
+
const channelInfo = await resolveChannelInfo(channelId);
|
|
3742
|
+
const kind = mapMattermostChannelTypeToChatType(payload.data?.channel_type ?? channelInfo?.type ?? void 0);
|
|
3743
|
+
const chatType = channelChatType(kind);
|
|
3744
|
+
const senderName = payload.data?.sender_name?.trim() || (await resolveUserInfo(senderId))?.username?.trim() || senderId;
|
|
3745
|
+
const rawText = post.message?.trim() || "";
|
|
3746
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
3747
|
+
const normalizedAllowFrom = normalizeMattermostAllowList(account.config.allowFrom ?? []);
|
|
3748
|
+
const normalizedGroupAllowFrom = normalizeMattermostAllowList(account.config.groupAllowFrom ?? []);
|
|
3749
|
+
const storeAllowFrom = normalizeMattermostAllowList(await readStoreAllowFromForDmPolicy({
|
|
3750
|
+
provider: "mattermost",
|
|
3751
|
+
accountId: account.accountId,
|
|
3752
|
+
dmPolicy,
|
|
3753
|
+
readStore: pairing.readStoreForDmPolicy
|
|
3754
|
+
}));
|
|
3755
|
+
const accessDecision = resolveDmGroupAccessWithLists({
|
|
3756
|
+
isGroup: kind !== "direct",
|
|
3757
|
+
dmPolicy,
|
|
3758
|
+
groupPolicy,
|
|
3759
|
+
allowFrom: normalizedAllowFrom,
|
|
3760
|
+
groupAllowFrom: normalizedGroupAllowFrom,
|
|
3761
|
+
storeAllowFrom,
|
|
3762
|
+
isSenderAllowed: (allowFrom) => isMattermostSenderAllowed({
|
|
3763
|
+
senderId,
|
|
3764
|
+
senderName,
|
|
3765
|
+
allowFrom,
|
|
3766
|
+
allowNameMatching
|
|
3767
|
+
})
|
|
3768
|
+
});
|
|
3769
|
+
const effectiveAllowFrom = accessDecision.effectiveAllowFrom;
|
|
3770
|
+
const effectiveGroupAllowFrom = accessDecision.effectiveGroupAllowFrom;
|
|
3771
|
+
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
3772
|
+
cfg,
|
|
3773
|
+
surface: "mattermost"
|
|
3774
|
+
});
|
|
3775
|
+
const hasControlCommand = core.channel.text.hasControlCommand(rawText, cfg);
|
|
3776
|
+
const isControlCommand = allowTextCommands && hasControlCommand;
|
|
3777
|
+
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
3778
|
+
const commandDmAllowFrom = kind === "direct" ? effectiveAllowFrom : normalizedAllowFrom;
|
|
3779
|
+
const senderAllowedForCommands = isMattermostSenderAllowed({
|
|
3780
|
+
senderId,
|
|
3781
|
+
senderName,
|
|
3782
|
+
allowFrom: commandDmAllowFrom,
|
|
3783
|
+
allowNameMatching
|
|
3784
|
+
});
|
|
3785
|
+
const groupAllowedForCommands = isMattermostSenderAllowed({
|
|
3786
|
+
senderId,
|
|
3787
|
+
senderName,
|
|
3788
|
+
allowFrom: effectiveGroupAllowFrom,
|
|
3789
|
+
allowNameMatching
|
|
3790
|
+
});
|
|
3791
|
+
const commandGate = resolveControlCommandGate({
|
|
3792
|
+
useAccessGroups,
|
|
3793
|
+
authorizers: [{
|
|
3794
|
+
configured: commandDmAllowFrom.length > 0,
|
|
3795
|
+
allowed: senderAllowedForCommands
|
|
3796
|
+
}, {
|
|
3797
|
+
configured: effectiveGroupAllowFrom.length > 0,
|
|
3798
|
+
allowed: groupAllowedForCommands
|
|
3799
|
+
}],
|
|
3800
|
+
allowTextCommands,
|
|
3801
|
+
hasControlCommand
|
|
3802
|
+
});
|
|
3803
|
+
const commandAuthorized = commandGate.commandAuthorized;
|
|
3804
|
+
if (accessDecision.decision !== "allow") {
|
|
3805
|
+
if (kind === "direct") {
|
|
3806
|
+
if (accessDecision.reasonCode === DM_GROUP_ACCESS_REASON.DM_POLICY_DISABLED) {
|
|
3807
|
+
logVerboseMessage(`mattermost: drop dm (dmPolicy=disabled sender=${senderId})`);
|
|
3808
|
+
return;
|
|
3809
|
+
}
|
|
3810
|
+
if (accessDecision.decision === "pairing") {
|
|
3811
|
+
const { code, created } = await pairing.upsertPairingRequest({
|
|
3812
|
+
id: senderId,
|
|
3813
|
+
meta: { name: senderName }
|
|
3814
|
+
});
|
|
3815
|
+
logVerboseMessage(`mattermost: pairing request sender=${senderId} created=${created}`);
|
|
3816
|
+
if (created) try {
|
|
3817
|
+
await sendMessageMattermost(`user:${senderId}`, core.channel.pairing.buildPairingReply({
|
|
3818
|
+
channel: "mattermost",
|
|
3819
|
+
idLine: `Your Mattermost user id: ${senderId}`,
|
|
3820
|
+
code
|
|
3821
|
+
}), { accountId: account.accountId });
|
|
3822
|
+
opts.statusSink?.({ lastOutboundAt: Date.now() });
|
|
3823
|
+
} catch (err) {
|
|
3824
|
+
logVerboseMessage(`mattermost: pairing reply failed for ${senderId}: ${String(err)}`);
|
|
3825
|
+
}
|
|
3826
|
+
return;
|
|
3827
|
+
}
|
|
3828
|
+
logVerboseMessage(`mattermost: drop dm sender=${senderId} (dmPolicy=${dmPolicy})`);
|
|
3829
|
+
return;
|
|
3830
|
+
}
|
|
3831
|
+
if (accessDecision.reasonCode === DM_GROUP_ACCESS_REASON.GROUP_POLICY_DISABLED) {
|
|
3832
|
+
logVerboseMessage("mattermost: drop group message (groupPolicy=disabled)");
|
|
3833
|
+
return;
|
|
3834
|
+
}
|
|
3835
|
+
if (accessDecision.reasonCode === DM_GROUP_ACCESS_REASON.GROUP_POLICY_EMPTY_ALLOWLIST) {
|
|
3836
|
+
logVerboseMessage("mattermost: drop group message (no group allowlist)");
|
|
3837
|
+
return;
|
|
3838
|
+
}
|
|
3839
|
+
if (accessDecision.reasonCode === DM_GROUP_ACCESS_REASON.GROUP_POLICY_NOT_ALLOWLISTED) {
|
|
3840
|
+
logVerboseMessage(`mattermost: drop group sender=${senderId} (not in groupAllowFrom)`);
|
|
3841
|
+
return;
|
|
3842
|
+
}
|
|
3843
|
+
logVerboseMessage(`mattermost: drop group message (groupPolicy=${groupPolicy} reason=${accessDecision.reason})`);
|
|
3844
|
+
return;
|
|
3845
|
+
}
|
|
3846
|
+
if (kind !== "direct" && commandGate.shouldBlock) {
|
|
3847
|
+
logInboundDrop({
|
|
3848
|
+
log: logVerboseMessage,
|
|
3849
|
+
channel: "mattermost",
|
|
3850
|
+
reason: "control command (unauthorized)",
|
|
3851
|
+
target: senderId
|
|
3852
|
+
});
|
|
3853
|
+
return;
|
|
3854
|
+
}
|
|
3855
|
+
const teamId = payload.data?.team_id ?? channelInfo?.team_id ?? void 0;
|
|
3856
|
+
const channelName = payload.data?.channel_name ?? channelInfo?.name ?? "";
|
|
3857
|
+
const channelDisplay = payload.data?.channel_display_name ?? channelInfo?.display_name ?? channelName;
|
|
3858
|
+
const roomLabel = channelName ? `#${channelName}` : channelDisplay || `#${channelId}`;
|
|
3859
|
+
const route = core.channel.routing.resolveAgentRoute({
|
|
3860
|
+
cfg,
|
|
3861
|
+
channel: "mattermost",
|
|
3862
|
+
accountId: account.accountId,
|
|
3863
|
+
teamId,
|
|
3864
|
+
peer: {
|
|
3865
|
+
kind,
|
|
3866
|
+
id: kind === "direct" ? senderId : channelId
|
|
3867
|
+
}
|
|
3868
|
+
});
|
|
3869
|
+
const baseSessionKey = route.sessionKey;
|
|
3870
|
+
const threadRootId = post.root_id?.trim() || void 0;
|
|
3871
|
+
const replyToMode = resolveMattermostReplyToMode(account, kind);
|
|
3872
|
+
const { effectiveReplyToId, sessionKey, parentSessionKey } = resolveMattermostThreadSessionContext({
|
|
3873
|
+
baseSessionKey,
|
|
3874
|
+
kind,
|
|
3875
|
+
postId: post.id,
|
|
3876
|
+
replyToMode,
|
|
3877
|
+
threadRootId
|
|
3878
|
+
});
|
|
3879
|
+
const historyKey = kind === "direct" ? null : sessionKey;
|
|
3880
|
+
const mentionRegexes = core.channel.mentions.buildMentionRegexes(cfg, route.agentId);
|
|
3881
|
+
const wasMentioned = kind !== "direct" && ((botUsername ? rawText.toLowerCase().includes(`@${botUsername.toLowerCase()}`) : false) || core.channel.mentions.matchesMentionPatterns(rawText, mentionRegexes));
|
|
3882
|
+
const pendingBody = rawText || (post.file_ids?.length ? `[Mattermost ${post.file_ids.length === 1 ? "file" : "files"}]` : "");
|
|
3883
|
+
const pendingSender = senderName;
|
|
3884
|
+
const recordPendingHistory = () => {
|
|
3885
|
+
const trimmed = pendingBody.trim();
|
|
3886
|
+
recordPendingHistoryEntryIfEnabled({
|
|
3887
|
+
historyMap: channelHistories,
|
|
3888
|
+
limit: historyLimit,
|
|
3889
|
+
historyKey: historyKey ?? "",
|
|
3890
|
+
entry: historyKey && trimmed ? {
|
|
3891
|
+
sender: pendingSender,
|
|
3892
|
+
body: trimmed,
|
|
3893
|
+
timestamp: typeof post.create_at === "number" ? post.create_at : void 0,
|
|
3894
|
+
messageId: post.id ?? void 0
|
|
3895
|
+
} : null
|
|
3896
|
+
});
|
|
3897
|
+
};
|
|
3898
|
+
const oncharEnabled = account.chatmode === "onchar" && kind !== "direct";
|
|
3899
|
+
const oncharPrefixes = oncharEnabled ? resolveOncharPrefixes(account.oncharPrefixes) : [];
|
|
3900
|
+
const oncharResult = oncharEnabled ? stripOncharPrefix(rawText, oncharPrefixes) : {
|
|
3901
|
+
triggered: false,
|
|
3902
|
+
stripped: rawText
|
|
3903
|
+
};
|
|
3904
|
+
const oncharTriggered = oncharResult.triggered;
|
|
3905
|
+
const canDetectMention = Boolean(botUsername) || mentionRegexes.length > 0;
|
|
3906
|
+
const mentionDecision = evaluateMattermostMentionGate({
|
|
3907
|
+
kind,
|
|
3908
|
+
cfg,
|
|
3909
|
+
accountId: account.accountId,
|
|
3910
|
+
channelId,
|
|
3911
|
+
threadRootId,
|
|
3912
|
+
requireMentionOverride: account.requireMention,
|
|
3913
|
+
resolveRequireMention: core.channel.groups.resolveRequireMention,
|
|
3914
|
+
wasMentioned,
|
|
3915
|
+
isControlCommand,
|
|
3916
|
+
commandAuthorized,
|
|
3917
|
+
oncharEnabled,
|
|
3918
|
+
oncharTriggered,
|
|
3919
|
+
canDetectMention
|
|
3920
|
+
});
|
|
3921
|
+
const { shouldRequireMention, shouldBypassMention } = mentionDecision;
|
|
3922
|
+
if (mentionDecision.dropReason === "onchar-not-triggered") {
|
|
3923
|
+
logVerboseMessage(`mattermost: drop group message (onchar not triggered channel=${channelId} sender=${senderId})`);
|
|
3924
|
+
recordPendingHistory();
|
|
3925
|
+
return;
|
|
3926
|
+
}
|
|
3927
|
+
if (mentionDecision.dropReason === "missing-mention") {
|
|
3928
|
+
logVerboseMessage(`mattermost: drop group message (missing mention channel=${channelId} sender=${senderId} requireMention=${shouldRequireMention} bypass=${shouldBypassMention} canDetectMention=${canDetectMention})`);
|
|
3929
|
+
recordPendingHistory();
|
|
3930
|
+
return;
|
|
3931
|
+
}
|
|
3932
|
+
const mediaList = await resolveMattermostMedia(post.file_ids);
|
|
3933
|
+
const mediaPlaceholder = buildMattermostAttachmentPlaceholder(mediaList);
|
|
3934
|
+
const bodyText = normalizeMention([oncharTriggered ? oncharResult.stripped : rawText, mediaPlaceholder].filter(Boolean).join("\n").trim(), botUsername);
|
|
3935
|
+
if (!bodyText) {
|
|
3936
|
+
logVerboseMessage(`mattermost: drop group message (empty body after normalization channel=${channelId} sender=${senderId})`);
|
|
3937
|
+
return;
|
|
3938
|
+
}
|
|
3939
|
+
core.channel.activity.record({
|
|
3940
|
+
channel: "mattermost",
|
|
3941
|
+
accountId: account.accountId,
|
|
3942
|
+
direction: "inbound"
|
|
3943
|
+
});
|
|
3944
|
+
const fromLabel = formatInboundFromLabel({
|
|
3945
|
+
isGroup: kind !== "direct",
|
|
3946
|
+
groupLabel: channelDisplay || roomLabel,
|
|
3947
|
+
groupId: channelId,
|
|
3948
|
+
groupFallback: roomLabel || "Channel",
|
|
3949
|
+
directLabel: senderName,
|
|
3950
|
+
directId: senderId
|
|
3951
|
+
});
|
|
3952
|
+
const preview = bodyText.replace(/\s+/g, " ").slice(0, 160);
|
|
3953
|
+
const inboundLabel = kind === "direct" ? `Mattermost DM from ${senderName}` : `Mattermost message in ${roomLabel} from ${senderName}`;
|
|
3954
|
+
core.system.enqueueSystemEvent(`${inboundLabel}: ${preview}`, {
|
|
3955
|
+
sessionKey,
|
|
3956
|
+
contextKey: `mattermost:message:${channelId}:${post.id ?? "unknown"}`
|
|
3957
|
+
});
|
|
3958
|
+
const textWithId = `${bodyText}\n[mattermost message id: ${post.id ?? "unknown"} channel: ${channelId}]`;
|
|
3959
|
+
let combinedBody = core.channel.reply.formatInboundEnvelope({
|
|
3960
|
+
channel: "Mattermost",
|
|
3961
|
+
from: fromLabel,
|
|
3962
|
+
timestamp: typeof post.create_at === "number" ? post.create_at : void 0,
|
|
3963
|
+
body: textWithId,
|
|
3964
|
+
chatType,
|
|
3965
|
+
sender: {
|
|
3966
|
+
name: senderName,
|
|
3967
|
+
id: senderId
|
|
3968
|
+
}
|
|
3969
|
+
});
|
|
3970
|
+
if (historyKey) combinedBody = buildPendingHistoryContextFromMap({
|
|
3971
|
+
historyMap: channelHistories,
|
|
3972
|
+
historyKey,
|
|
3973
|
+
limit: historyLimit,
|
|
3974
|
+
currentMessage: combinedBody,
|
|
3975
|
+
formatEntry: (entry) => core.channel.reply.formatInboundEnvelope({
|
|
3976
|
+
channel: "Mattermost",
|
|
3977
|
+
from: fromLabel,
|
|
3978
|
+
timestamp: entry.timestamp,
|
|
3979
|
+
body: `${entry.body}${entry.messageId ? ` [id:${entry.messageId} channel:${channelId}]` : ""}`,
|
|
3980
|
+
chatType,
|
|
3981
|
+
senderLabel: entry.sender
|
|
3982
|
+
})
|
|
3983
|
+
});
|
|
3984
|
+
const to = kind === "direct" ? `user:${senderId}` : `channel:${channelId}`;
|
|
3985
|
+
const mediaPayload = buildAgentMediaPayload(mediaList);
|
|
3986
|
+
const commandBody = rawText.trim();
|
|
3987
|
+
const inboundHistory = historyKey && historyLimit > 0 ? (channelHistories.get(historyKey) ?? []).map((entry) => ({
|
|
3988
|
+
sender: entry.sender,
|
|
3989
|
+
body: entry.body,
|
|
3990
|
+
timestamp: entry.timestamp
|
|
3991
|
+
})) : void 0;
|
|
3992
|
+
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
3993
|
+
Body: combinedBody,
|
|
3994
|
+
BodyForAgent: bodyText,
|
|
3995
|
+
InboundHistory: inboundHistory,
|
|
3996
|
+
RawBody: bodyText,
|
|
3997
|
+
CommandBody: commandBody,
|
|
3998
|
+
BodyForCommands: commandBody,
|
|
3999
|
+
From: kind === "direct" ? `mattermost:${senderId}` : kind === "group" ? `mattermost:group:${channelId}` : `mattermost:channel:${channelId}`,
|
|
4000
|
+
To: to,
|
|
4001
|
+
SessionKey: sessionKey,
|
|
4002
|
+
ParentSessionKey: parentSessionKey,
|
|
4003
|
+
AccountId: route.accountId,
|
|
4004
|
+
ChatType: chatType,
|
|
4005
|
+
ConversationLabel: fromLabel,
|
|
4006
|
+
GroupSubject: kind !== "direct" ? channelDisplay || roomLabel : void 0,
|
|
4007
|
+
GroupChannel: channelName ? `#${channelName}` : void 0,
|
|
4008
|
+
GroupSpace: teamId,
|
|
4009
|
+
SenderName: senderName,
|
|
4010
|
+
SenderId: senderId,
|
|
4011
|
+
Provider: "mattermost",
|
|
4012
|
+
Surface: "mattermost",
|
|
4013
|
+
MessageSid: post.id ?? void 0,
|
|
4014
|
+
MessageSids: allMessageIds.length > 1 ? allMessageIds : void 0,
|
|
4015
|
+
MessageSidFirst: allMessageIds.length > 1 ? allMessageIds[0] : void 0,
|
|
4016
|
+
MessageSidLast: allMessageIds.length > 1 ? allMessageIds[allMessageIds.length - 1] : void 0,
|
|
4017
|
+
ReplyToId: effectiveReplyToId,
|
|
4018
|
+
MessageThreadId: effectiveReplyToId,
|
|
4019
|
+
Timestamp: typeof post.create_at === "number" ? post.create_at : void 0,
|
|
4020
|
+
WasMentioned: kind !== "direct" ? mentionDecision.effectiveWasMentioned : void 0,
|
|
4021
|
+
CommandAuthorized: commandAuthorized,
|
|
4022
|
+
OriginatingChannel: "mattermost",
|
|
4023
|
+
OriginatingTo: to,
|
|
4024
|
+
...mediaPayload
|
|
4025
|
+
});
|
|
4026
|
+
if (kind === "direct") {
|
|
4027
|
+
const sessionCfg = cfg.session;
|
|
4028
|
+
const storePath = core.channel.session.resolveStorePath(sessionCfg?.store, { agentId: route.agentId });
|
|
4029
|
+
await core.channel.session.updateLastRoute({
|
|
4030
|
+
storePath,
|
|
4031
|
+
sessionKey: route.mainSessionKey,
|
|
4032
|
+
deliveryContext: {
|
|
4033
|
+
channel: "mattermost",
|
|
4034
|
+
to,
|
|
4035
|
+
accountId: route.accountId
|
|
4036
|
+
}
|
|
4037
|
+
});
|
|
4038
|
+
}
|
|
4039
|
+
const previewLine = bodyText.slice(0, 200).replace(/\n/g, "\\n");
|
|
4040
|
+
logVerboseMessage(`mattermost inbound: from=${ctxPayload.From} len=${bodyText.length} preview="${previewLine}"`);
|
|
4041
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "mattermost", account.accountId, { fallbackLimit: account.textChunkLimit ?? 4e3 });
|
|
4042
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
4043
|
+
cfg,
|
|
4044
|
+
channel: "mattermost",
|
|
4045
|
+
accountId: account.accountId
|
|
4046
|
+
});
|
|
4047
|
+
const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelReplyPipeline({
|
|
4048
|
+
cfg,
|
|
4049
|
+
agentId: route.agentId,
|
|
4050
|
+
channel: "mattermost",
|
|
4051
|
+
accountId: account.accountId,
|
|
4052
|
+
typing: {
|
|
4053
|
+
start: () => sendTypingIndicator(channelId, effectiveReplyToId),
|
|
4054
|
+
onStartError: (err) => {
|
|
4055
|
+
logTypingFailure({
|
|
4056
|
+
log: (message) => logger.debug?.(message),
|
|
4057
|
+
channel: "mattermost",
|
|
4058
|
+
target: channelId,
|
|
4059
|
+
error: err
|
|
4060
|
+
});
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
});
|
|
4064
|
+
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
4065
|
+
...replyPipeline,
|
|
4066
|
+
humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId),
|
|
4067
|
+
typingCallbacks,
|
|
4068
|
+
deliver: async (payload) => {
|
|
4069
|
+
await deliverMattermostReplyPayload({
|
|
4070
|
+
core,
|
|
4071
|
+
cfg,
|
|
4072
|
+
payload,
|
|
4073
|
+
to,
|
|
4074
|
+
accountId: account.accountId,
|
|
4075
|
+
agentId: route.agentId,
|
|
4076
|
+
replyToId: resolveMattermostReplyRootId({
|
|
4077
|
+
threadRootId: effectiveReplyToId,
|
|
4078
|
+
replyToId: payload.replyToId
|
|
4079
|
+
}),
|
|
4080
|
+
textLimit,
|
|
4081
|
+
tableMode,
|
|
4082
|
+
sendMessage: sendMessageMattermost
|
|
4083
|
+
});
|
|
4084
|
+
runtime.log?.(`delivered reply to ${to}`);
|
|
4085
|
+
},
|
|
4086
|
+
onError: (err, info) => {
|
|
4087
|
+
runtime.error?.(`mattermost ${info.kind} reply failed: ${String(err)}`);
|
|
4088
|
+
}
|
|
4089
|
+
});
|
|
4090
|
+
await core.channel.reply.withReplyDispatcher({
|
|
4091
|
+
dispatcher,
|
|
4092
|
+
onSettled: () => {
|
|
4093
|
+
markDispatchIdle();
|
|
4094
|
+
},
|
|
4095
|
+
run: () => core.channel.reply.dispatchReplyFromConfig({
|
|
4096
|
+
ctx: ctxPayload,
|
|
4097
|
+
cfg,
|
|
4098
|
+
dispatcher,
|
|
4099
|
+
replyOptions: {
|
|
4100
|
+
...replyOptions,
|
|
4101
|
+
disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
|
|
4102
|
+
onModelSelected
|
|
4103
|
+
}
|
|
4104
|
+
})
|
|
4105
|
+
});
|
|
4106
|
+
if (historyKey) clearHistoryEntriesIfEnabled({
|
|
4107
|
+
historyMap: channelHistories,
|
|
4108
|
+
historyKey,
|
|
4109
|
+
limit: historyLimit
|
|
4110
|
+
});
|
|
4111
|
+
};
|
|
4112
|
+
const handleReactionEvent = async (payload) => {
|
|
4113
|
+
const reactionData = payload.data?.reaction;
|
|
4114
|
+
if (!reactionData) return;
|
|
4115
|
+
let reaction = null;
|
|
4116
|
+
if (typeof reactionData === "string") try {
|
|
4117
|
+
reaction = JSON.parse(reactionData);
|
|
4118
|
+
} catch {
|
|
4119
|
+
return;
|
|
4120
|
+
}
|
|
4121
|
+
else if (typeof reactionData === "object") reaction = reactionData;
|
|
4122
|
+
if (!reaction) return;
|
|
4123
|
+
const userId = reaction.user_id?.trim();
|
|
4124
|
+
const postId = reaction.post_id?.trim();
|
|
4125
|
+
const emojiName = reaction.emoji_name?.trim();
|
|
4126
|
+
if (!userId || !postId || !emojiName) return;
|
|
4127
|
+
if (userId === botUserId) return;
|
|
4128
|
+
const action = payload.event === "reaction_removed" ? "removed" : "added";
|
|
4129
|
+
const senderName = (await resolveUserInfo(userId))?.username?.trim() || userId;
|
|
4130
|
+
const channelId = payload.broadcast?.channel_id;
|
|
4131
|
+
if (!channelId) {
|
|
4132
|
+
logVerboseMessage(`mattermost: drop reaction (no channel_id in broadcast, cannot enforce policy)`);
|
|
4133
|
+
return;
|
|
4134
|
+
}
|
|
4135
|
+
const channelInfo = await resolveChannelInfo(channelId);
|
|
4136
|
+
if (!channelInfo?.type) {
|
|
4137
|
+
logVerboseMessage(`mattermost: drop reaction (cannot resolve channel type for ${channelId})`);
|
|
4138
|
+
return;
|
|
4139
|
+
}
|
|
4140
|
+
const kind = mapMattermostChannelTypeToChatType(channelInfo.type);
|
|
4141
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
4142
|
+
const storeAllowFrom = normalizeMattermostAllowList(await readStoreAllowFromForDmPolicy({
|
|
4143
|
+
provider: "mattermost",
|
|
4144
|
+
accountId: account.accountId,
|
|
4145
|
+
dmPolicy,
|
|
4146
|
+
readStore: pairing.readStoreForDmPolicy
|
|
4147
|
+
}));
|
|
4148
|
+
const reactionAccess = resolveDmGroupAccessWithLists({
|
|
4149
|
+
isGroup: kind !== "direct",
|
|
4150
|
+
dmPolicy,
|
|
4151
|
+
groupPolicy,
|
|
4152
|
+
allowFrom: normalizeMattermostAllowList(account.config.allowFrom ?? []),
|
|
4153
|
+
groupAllowFrom: normalizeMattermostAllowList(account.config.groupAllowFrom ?? []),
|
|
4154
|
+
storeAllowFrom,
|
|
4155
|
+
isSenderAllowed: (allowFrom) => isMattermostSenderAllowed({
|
|
4156
|
+
senderId: userId,
|
|
4157
|
+
senderName,
|
|
4158
|
+
allowFrom,
|
|
4159
|
+
allowNameMatching
|
|
4160
|
+
})
|
|
4161
|
+
});
|
|
4162
|
+
if (reactionAccess.decision !== "allow") {
|
|
4163
|
+
if (kind === "direct") logVerboseMessage(`mattermost: drop reaction (dmPolicy=${dmPolicy} sender=${userId} reason=${reactionAccess.reason})`);
|
|
4164
|
+
else logVerboseMessage(`mattermost: drop reaction (groupPolicy=${groupPolicy} sender=${userId} reason=${reactionAccess.reason} channel=${channelId})`);
|
|
4165
|
+
return;
|
|
4166
|
+
}
|
|
4167
|
+
const teamId = channelInfo?.team_id ?? void 0;
|
|
4168
|
+
const sessionKey = core.channel.routing.resolveAgentRoute({
|
|
4169
|
+
cfg,
|
|
4170
|
+
channel: "mattermost",
|
|
4171
|
+
accountId: account.accountId,
|
|
4172
|
+
teamId,
|
|
4173
|
+
peer: {
|
|
4174
|
+
kind,
|
|
4175
|
+
id: kind === "direct" ? userId : channelId
|
|
4176
|
+
}
|
|
4177
|
+
}).sessionKey;
|
|
4178
|
+
const eventText = `Mattermost reaction ${action}: :${emojiName}: by @${senderName} on post ${postId} in channel ${channelId}`;
|
|
4179
|
+
core.system.enqueueSystemEvent(eventText, {
|
|
4180
|
+
sessionKey,
|
|
4181
|
+
contextKey: `mattermost:reaction:${postId}:${emojiName}:${userId}:${action}`
|
|
4182
|
+
});
|
|
4183
|
+
logVerboseMessage(`mattermost reaction: ${action} :${emojiName}: by ${senderName} on ${postId}`);
|
|
4184
|
+
};
|
|
4185
|
+
const inboundDebounceMs = core.channel.debounce.resolveInboundDebounceMs({
|
|
4186
|
+
cfg,
|
|
4187
|
+
channel: "mattermost"
|
|
4188
|
+
});
|
|
4189
|
+
const debouncer = core.channel.debounce.createInboundDebouncer({
|
|
4190
|
+
debounceMs: inboundDebounceMs,
|
|
4191
|
+
buildKey: (entry) => {
|
|
4192
|
+
const channelId = entry.post.channel_id ?? entry.payload.data?.channel_id ?? entry.payload.broadcast?.channel_id;
|
|
4193
|
+
if (!channelId) return null;
|
|
4194
|
+
const threadId = entry.post.root_id?.trim();
|
|
4195
|
+
const threadKey = threadId ? `thread:${threadId}` : "channel";
|
|
4196
|
+
return `mattermost:${account.accountId}:${channelId}:${threadKey}`;
|
|
4197
|
+
},
|
|
4198
|
+
shouldDebounce: (entry) => {
|
|
4199
|
+
if (entry.post.file_ids && entry.post.file_ids.length > 0) return false;
|
|
4200
|
+
const text = entry.post.message?.trim() ?? "";
|
|
4201
|
+
if (!text) return false;
|
|
4202
|
+
return !core.channel.text.hasControlCommand(text, cfg);
|
|
4203
|
+
},
|
|
4204
|
+
onFlush: async (entries) => {
|
|
4205
|
+
const last = entries.at(-1);
|
|
4206
|
+
if (!last) return;
|
|
4207
|
+
if (entries.length === 1) {
|
|
4208
|
+
await handlePost(last.post, last.payload);
|
|
4209
|
+
return;
|
|
4210
|
+
}
|
|
4211
|
+
const combinedText = entries.map((entry) => entry.post.message?.trim() ?? "").filter(Boolean).join("\n");
|
|
4212
|
+
const mergedPost = {
|
|
4213
|
+
...last.post,
|
|
4214
|
+
message: combinedText,
|
|
4215
|
+
file_ids: []
|
|
4216
|
+
};
|
|
4217
|
+
const ids = entries.map((entry) => entry.post.id).filter(Boolean);
|
|
4218
|
+
await handlePost(mergedPost, last.payload, ids.length > 0 ? ids : void 0);
|
|
4219
|
+
},
|
|
4220
|
+
onError: (err) => {
|
|
4221
|
+
runtime.error?.(`mattermost debounce flush failed: ${String(err)}`);
|
|
4222
|
+
}
|
|
4223
|
+
});
|
|
4224
|
+
const wsUrl = buildMattermostWsUrl(baseUrl);
|
|
4225
|
+
let seq = 1;
|
|
4226
|
+
const connectOnce = createMattermostConnectOnce({
|
|
4227
|
+
wsUrl,
|
|
4228
|
+
botToken,
|
|
4229
|
+
abortSignal: opts.abortSignal,
|
|
4230
|
+
statusSink: opts.statusSink,
|
|
4231
|
+
runtime,
|
|
4232
|
+
webSocketFactory: opts.webSocketFactory,
|
|
4233
|
+
nextSeq: () => seq++,
|
|
4234
|
+
onPosted: async (post, payload) => {
|
|
4235
|
+
await debouncer.enqueue({
|
|
4236
|
+
post,
|
|
4237
|
+
payload
|
|
4238
|
+
});
|
|
4239
|
+
},
|
|
4240
|
+
onReaction: async (payload) => {
|
|
4241
|
+
await handleReactionEvent(payload);
|
|
4242
|
+
}
|
|
4243
|
+
});
|
|
4244
|
+
let slashShutdownCleanup = null;
|
|
4245
|
+
if (slashEnabled) {
|
|
4246
|
+
const runAbortCleanup = () => {
|
|
4247
|
+
if (slashShutdownCleanup) return;
|
|
4248
|
+
const commands = getSlashCommandState(account.accountId)?.registeredCommands ?? [];
|
|
4249
|
+
deactivateSlashCommands(account.accountId);
|
|
4250
|
+
slashShutdownCleanup = cleanupSlashCommands({
|
|
4251
|
+
client,
|
|
4252
|
+
commands,
|
|
4253
|
+
log: (msg) => runtime.log?.(msg)
|
|
4254
|
+
}).catch((err) => {
|
|
4255
|
+
runtime.error?.(`mattermost: slash cleanup failed: ${String(err)}`);
|
|
4256
|
+
});
|
|
4257
|
+
};
|
|
4258
|
+
if (opts.abortSignal?.aborted) runAbortCleanup();
|
|
4259
|
+
else opts.abortSignal?.addEventListener("abort", runAbortCleanup, { once: true });
|
|
4260
|
+
}
|
|
4261
|
+
try {
|
|
4262
|
+
await runWithReconnect(connectOnce, {
|
|
4263
|
+
abortSignal: opts.abortSignal,
|
|
4264
|
+
jitterRatio: .2,
|
|
4265
|
+
onError: (err) => {
|
|
4266
|
+
runtime.error?.(`mattermost connection failed: ${String(err)}`);
|
|
4267
|
+
opts.statusSink?.({
|
|
4268
|
+
lastError: String(err),
|
|
4269
|
+
connected: false
|
|
4270
|
+
});
|
|
4271
|
+
},
|
|
4272
|
+
onReconnect: (delayMs) => {
|
|
4273
|
+
runtime.log?.(`mattermost reconnecting in ${Math.round(delayMs / 1e3)}s`);
|
|
4274
|
+
}
|
|
4275
|
+
});
|
|
4276
|
+
} finally {
|
|
4277
|
+
unregisterInteractions?.();
|
|
4278
|
+
}
|
|
4279
|
+
if (slashShutdownCleanup) await slashShutdownCleanup;
|
|
4280
|
+
}
|
|
4281
|
+
//#endregion
|
|
4282
|
+
//#region extensions/mattermost/src/mattermost/probe.ts
|
|
4283
|
+
async function probeMattermost(baseUrl, botToken, timeoutMs = 2500) {
|
|
4284
|
+
const normalized = normalizeMattermostBaseUrl(baseUrl);
|
|
4285
|
+
if (!normalized) return {
|
|
4286
|
+
ok: false,
|
|
4287
|
+
error: "baseUrl missing"
|
|
4288
|
+
};
|
|
4289
|
+
const url = `${normalized}/api/v4/users/me`;
|
|
4290
|
+
const start = Date.now();
|
|
4291
|
+
const controller = timeoutMs > 0 ? new AbortController() : void 0;
|
|
4292
|
+
let timer = null;
|
|
4293
|
+
if (controller) timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
4294
|
+
try {
|
|
4295
|
+
const res = await fetch(url, {
|
|
4296
|
+
headers: { Authorization: `Bearer ${botToken}` },
|
|
4297
|
+
signal: controller?.signal
|
|
4298
|
+
});
|
|
4299
|
+
const elapsedMs = Date.now() - start;
|
|
4300
|
+
if (!res.ok) {
|
|
4301
|
+
const detail = await readMattermostError(res);
|
|
4302
|
+
return {
|
|
4303
|
+
ok: false,
|
|
4304
|
+
status: res.status,
|
|
4305
|
+
error: detail || res.statusText,
|
|
4306
|
+
elapsedMs
|
|
4307
|
+
};
|
|
4308
|
+
}
|
|
4309
|
+
const bot = await res.json();
|
|
4310
|
+
return {
|
|
4311
|
+
ok: true,
|
|
4312
|
+
status: res.status,
|
|
4313
|
+
elapsedMs,
|
|
4314
|
+
bot
|
|
4315
|
+
};
|
|
4316
|
+
} catch (err) {
|
|
4317
|
+
return {
|
|
4318
|
+
ok: false,
|
|
4319
|
+
status: null,
|
|
4320
|
+
error: err instanceof Error ? err.message : String(err),
|
|
4321
|
+
elapsedMs: Date.now() - start
|
|
4322
|
+
};
|
|
4323
|
+
} finally {
|
|
4324
|
+
if (timer) clearTimeout(timer);
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
//#endregion
|
|
4328
|
+
//#region extensions/mattermost/src/mattermost/reactions.ts
|
|
4329
|
+
const BOT_USER_CACHE_TTL_MS = 10 * 6e4;
|
|
4330
|
+
const botUserIdCache = /* @__PURE__ */ new Map();
|
|
4331
|
+
async function resolveBotUserId(client, cacheKey) {
|
|
4332
|
+
const cached = botUserIdCache.get(cacheKey);
|
|
4333
|
+
if (cached && cached.expiresAt > Date.now()) return cached.userId;
|
|
4334
|
+
const userId = (await fetchMattermostMe(client))?.id?.trim();
|
|
4335
|
+
if (!userId) return null;
|
|
4336
|
+
botUserIdCache.set(cacheKey, {
|
|
4337
|
+
userId,
|
|
4338
|
+
expiresAt: Date.now() + BOT_USER_CACHE_TTL_MS
|
|
4339
|
+
});
|
|
4340
|
+
return userId;
|
|
4341
|
+
}
|
|
4342
|
+
async function addMattermostReaction(params) {
|
|
4343
|
+
return runMattermostReaction(params, {
|
|
4344
|
+
action: "add",
|
|
4345
|
+
mutation: createReaction
|
|
4346
|
+
});
|
|
4347
|
+
}
|
|
4348
|
+
async function removeMattermostReaction(params) {
|
|
4349
|
+
return runMattermostReaction(params, {
|
|
4350
|
+
action: "remove",
|
|
4351
|
+
mutation: deleteReaction
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4354
|
+
async function runMattermostReaction(params, options) {
|
|
4355
|
+
const resolved = resolveMattermostAccount({
|
|
4356
|
+
cfg: params.cfg,
|
|
4357
|
+
accountId: params.accountId
|
|
4358
|
+
});
|
|
4359
|
+
const baseUrl = resolved.baseUrl?.trim();
|
|
4360
|
+
const botToken = resolved.botToken?.trim();
|
|
4361
|
+
if (!baseUrl || !botToken) return {
|
|
4362
|
+
ok: false,
|
|
4363
|
+
error: "Mattermost botToken/baseUrl missing."
|
|
4364
|
+
};
|
|
4365
|
+
const client = createMattermostClient({
|
|
4366
|
+
baseUrl,
|
|
4367
|
+
botToken,
|
|
4368
|
+
fetchImpl: params.fetchImpl
|
|
4369
|
+
});
|
|
4370
|
+
const userId = await resolveBotUserId(client, `${baseUrl}:${botToken}`);
|
|
4371
|
+
if (!userId) return {
|
|
4372
|
+
ok: false,
|
|
4373
|
+
error: "Mattermost reactions failed: could not resolve bot user id."
|
|
4374
|
+
};
|
|
4375
|
+
try {
|
|
4376
|
+
await options.mutation(client, {
|
|
4377
|
+
userId,
|
|
4378
|
+
postId: params.postId,
|
|
4379
|
+
emojiName: params.emojiName
|
|
4380
|
+
});
|
|
4381
|
+
} catch (err) {
|
|
4382
|
+
return {
|
|
4383
|
+
ok: false,
|
|
4384
|
+
error: `Mattermost ${options.action} reaction failed: ${String(err)}`
|
|
4385
|
+
};
|
|
4386
|
+
}
|
|
4387
|
+
return { ok: true };
|
|
4388
|
+
}
|
|
4389
|
+
async function createReaction(client, params) {
|
|
4390
|
+
await client.request("/reactions", {
|
|
4391
|
+
method: "POST",
|
|
4392
|
+
body: JSON.stringify({
|
|
4393
|
+
user_id: params.userId,
|
|
4394
|
+
post_id: params.postId,
|
|
4395
|
+
emoji_name: params.emojiName
|
|
4396
|
+
})
|
|
4397
|
+
});
|
|
4398
|
+
}
|
|
4399
|
+
async function deleteReaction(client, params) {
|
|
4400
|
+
const emoji = encodeURIComponent(params.emojiName);
|
|
4401
|
+
await client.request(`/users/${params.userId}/posts/${params.postId}/reactions/${emoji}`, { method: "DELETE" });
|
|
4402
|
+
}
|
|
4403
|
+
//#endregion
|
|
4404
|
+
//#region extensions/mattermost/src/normalize.ts
|
|
4405
|
+
function normalizeMattermostMessagingTarget(raw) {
|
|
4406
|
+
const trimmed = raw.trim();
|
|
4407
|
+
if (!trimmed) return;
|
|
4408
|
+
const lower = trimmed.toLowerCase();
|
|
4409
|
+
if (lower.startsWith("channel:")) {
|
|
4410
|
+
const id = trimmed.slice(8).trim();
|
|
4411
|
+
return id ? `channel:${id}` : void 0;
|
|
4412
|
+
}
|
|
4413
|
+
if (lower.startsWith("group:")) {
|
|
4414
|
+
const id = trimmed.slice(6).trim();
|
|
4415
|
+
return id ? `channel:${id}` : void 0;
|
|
4416
|
+
}
|
|
4417
|
+
if (lower.startsWith("user:")) {
|
|
4418
|
+
const id = trimmed.slice(5).trim();
|
|
4419
|
+
return id ? `user:${id}` : void 0;
|
|
4420
|
+
}
|
|
4421
|
+
if (lower.startsWith("mattermost:")) {
|
|
4422
|
+
const id = trimmed.slice(11).trim();
|
|
4423
|
+
return id ? `user:${id}` : void 0;
|
|
4424
|
+
}
|
|
4425
|
+
if (trimmed.startsWith("@")) {
|
|
4426
|
+
const id = trimmed.slice(1).trim();
|
|
4427
|
+
return id ? `@${id}` : void 0;
|
|
4428
|
+
}
|
|
4429
|
+
if (trimmed.startsWith("#")) return;
|
|
4430
|
+
}
|
|
4431
|
+
function looksLikeMattermostTargetId(raw, normalized) {
|
|
4432
|
+
const trimmed = raw.trim();
|
|
4433
|
+
if (!trimmed) return false;
|
|
4434
|
+
if (/^(user|channel|group|mattermost):/i.test(trimmed)) return true;
|
|
4435
|
+
if (trimmed.startsWith("@")) return true;
|
|
4436
|
+
return /^[a-z0-9]{26}$/i.test(trimmed) || /^[a-z0-9]{26}__[a-z0-9]{26}$/i.test(trimmed);
|
|
4437
|
+
}
|
|
4438
|
+
//#endregion
|
|
4439
|
+
//#region extensions/mattermost/src/session-route.ts
|
|
4440
|
+
function resolveMattermostOutboundSessionRoute(params) {
|
|
4441
|
+
let trimmed = stripChannelTargetPrefix(params.target, "mattermost");
|
|
4442
|
+
if (!trimmed) return null;
|
|
4443
|
+
const lower = trimmed.toLowerCase();
|
|
4444
|
+
const resolvedKind = params.resolvedTarget?.kind;
|
|
4445
|
+
const isUser = resolvedKind === "user" || resolvedKind !== "channel" && resolvedKind !== "group" && (lower.startsWith("user:") || trimmed.startsWith("@"));
|
|
4446
|
+
if (trimmed.startsWith("@")) trimmed = trimmed.slice(1).trim();
|
|
4447
|
+
const rawId = stripTargetKindPrefix(trimmed);
|
|
4448
|
+
if (!rawId) return null;
|
|
4449
|
+
const baseRoute = buildChannelOutboundSessionRoute({
|
|
4450
|
+
cfg: params.cfg,
|
|
4451
|
+
agentId: params.agentId,
|
|
4452
|
+
channel: "mattermost",
|
|
4453
|
+
accountId: params.accountId,
|
|
4454
|
+
peer: {
|
|
4455
|
+
kind: isUser ? "direct" : "channel",
|
|
4456
|
+
id: rawId
|
|
4457
|
+
},
|
|
4458
|
+
chatType: isUser ? "direct" : "channel",
|
|
4459
|
+
from: isUser ? `mattermost:${rawId}` : `mattermost:channel:${rawId}`,
|
|
4460
|
+
to: isUser ? `user:${rawId}` : `channel:${rawId}`
|
|
4461
|
+
});
|
|
4462
|
+
const threadId = normalizeOutboundThreadId(params.replyToId ?? params.threadId);
|
|
4463
|
+
const threadKeys = resolveThreadSessionKeys$1({
|
|
4464
|
+
baseSessionKey: baseRoute.baseSessionKey,
|
|
4465
|
+
threadId
|
|
4466
|
+
});
|
|
4467
|
+
return {
|
|
4468
|
+
...baseRoute,
|
|
4469
|
+
sessionKey: threadKeys.sessionKey,
|
|
4470
|
+
...threadId !== void 0 ? { threadId } : {}
|
|
4471
|
+
};
|
|
4472
|
+
}
|
|
4473
|
+
//#endregion
|
|
4474
|
+
//#region extensions/mattermost/src/setup-core.ts
|
|
4475
|
+
const channel$1 = "mattermost";
|
|
4476
|
+
function isMattermostConfigured(account) {
|
|
4477
|
+
return (Boolean(account.botToken?.trim()) || hasConfiguredSecretInput(account.config.botToken)) && Boolean(account.baseUrl);
|
|
4478
|
+
}
|
|
4479
|
+
function resolveMattermostAccountWithSecrets(cfg, accountId) {
|
|
4480
|
+
return resolveMattermostAccount({
|
|
4481
|
+
cfg,
|
|
4482
|
+
accountId,
|
|
4483
|
+
allowUnresolvedSecretRef: true
|
|
4484
|
+
});
|
|
4485
|
+
}
|
|
4486
|
+
const mattermostSetupAdapter = {
|
|
4487
|
+
resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
|
|
4488
|
+
applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
|
|
4489
|
+
cfg,
|
|
4490
|
+
channelKey: channel$1,
|
|
4491
|
+
accountId,
|
|
4492
|
+
name
|
|
4493
|
+
}),
|
|
4494
|
+
validateInput: ({ accountId, input }) => {
|
|
4495
|
+
const token = input.botToken ?? input.token;
|
|
4496
|
+
const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
|
|
4497
|
+
if (input.useEnv && accountId !== "default") return "Mattermost env vars can only be used for the default account.";
|
|
4498
|
+
if (!input.useEnv && (!token || !baseUrl)) return "Mattermost requires --bot-token and --http-url (or --use-env).";
|
|
4499
|
+
if (input.httpUrl && !baseUrl) return "Mattermost --http-url must include a valid base URL.";
|
|
4500
|
+
return null;
|
|
4501
|
+
},
|
|
4502
|
+
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
4503
|
+
const token = input.botToken ?? input.token;
|
|
4504
|
+
const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
|
|
4505
|
+
const namedConfig = applyAccountNameToChannelSection({
|
|
4506
|
+
cfg,
|
|
4507
|
+
channelKey: channel$1,
|
|
4508
|
+
accountId,
|
|
4509
|
+
name: input.name
|
|
4510
|
+
});
|
|
4511
|
+
return applySetupAccountConfigPatch({
|
|
4512
|
+
cfg: accountId !== "default" ? migrateBaseNameToDefaultAccount({
|
|
4513
|
+
cfg: namedConfig,
|
|
4514
|
+
channelKey: channel$1
|
|
4515
|
+
}) : namedConfig,
|
|
4516
|
+
channelKey: channel$1,
|
|
4517
|
+
accountId,
|
|
4518
|
+
patch: input.useEnv ? {} : {
|
|
4519
|
+
...token ? { botToken: token } : {},
|
|
4520
|
+
...baseUrl ? { baseUrl } : {}
|
|
4521
|
+
}
|
|
4522
|
+
});
|
|
4523
|
+
}
|
|
4524
|
+
};
|
|
4525
|
+
//#endregion
|
|
4526
|
+
//#region extensions/mattermost/src/setup-surface.ts
|
|
4527
|
+
const channel = "mattermost";
|
|
4528
|
+
const mattermostSetupWizard = {
|
|
4529
|
+
channel,
|
|
4530
|
+
status: {
|
|
4531
|
+
configuredLabel: "configured",
|
|
4532
|
+
unconfiguredLabel: "needs token + url",
|
|
4533
|
+
configuredHint: "configured",
|
|
4534
|
+
unconfiguredHint: "needs setup",
|
|
4535
|
+
configuredScore: 2,
|
|
4536
|
+
unconfiguredScore: 1,
|
|
4537
|
+
resolveConfigured: ({ cfg }) => listMattermostAccountIds(cfg).some((accountId) => isMattermostConfigured(resolveMattermostAccountWithSecrets(cfg, accountId)))
|
|
4538
|
+
},
|
|
4539
|
+
introNote: {
|
|
4540
|
+
title: "Mattermost bot token",
|
|
4541
|
+
lines: [
|
|
4542
|
+
"1) Mattermost System Console -> Integrations -> Bot Accounts",
|
|
4543
|
+
"2) Create a bot + copy its token",
|
|
4544
|
+
"3) Use your server base URL (e.g., https://chat.example.com)",
|
|
4545
|
+
"Tip: the bot must be a member of any channel you want it to monitor.",
|
|
4546
|
+
`Docs: ${formatDocsLink("/mattermost", "mattermost")}`
|
|
4547
|
+
],
|
|
4548
|
+
shouldShow: ({ cfg, accountId }) => !isMattermostConfigured(resolveMattermostAccountWithSecrets(cfg, accountId))
|
|
4549
|
+
},
|
|
4550
|
+
envShortcut: {
|
|
4551
|
+
prompt: "MATTERMOST_BOT_TOKEN + MATTERMOST_URL detected. Use env vars?",
|
|
4552
|
+
preferredEnvVar: "MATTERMOST_BOT_TOKEN",
|
|
4553
|
+
isAvailable: ({ cfg, accountId }) => {
|
|
4554
|
+
if (accountId !== "default") return false;
|
|
4555
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
4556
|
+
const hasConfigValues = hasConfiguredSecretInput(resolvedAccount.config.botToken) || Boolean(resolvedAccount.config.baseUrl?.trim());
|
|
4557
|
+
return Boolean(process.env.MATTERMOST_BOT_TOKEN?.trim() && process.env.MATTERMOST_URL?.trim() && !hasConfigValues);
|
|
4558
|
+
},
|
|
4559
|
+
apply: ({ cfg, accountId }) => applySetupAccountConfigPatch({
|
|
4560
|
+
cfg,
|
|
4561
|
+
channelKey: channel,
|
|
4562
|
+
accountId,
|
|
4563
|
+
patch: {}
|
|
4564
|
+
})
|
|
4565
|
+
},
|
|
4566
|
+
credentials: [{
|
|
4567
|
+
inputKey: "botToken",
|
|
4568
|
+
providerHint: channel,
|
|
4569
|
+
credentialLabel: "bot token",
|
|
4570
|
+
preferredEnvVar: "MATTERMOST_BOT_TOKEN",
|
|
4571
|
+
envPrompt: "MATTERMOST_BOT_TOKEN + MATTERMOST_URL detected. Use env vars?",
|
|
4572
|
+
keepPrompt: "Mattermost bot token already configured. Keep it?",
|
|
4573
|
+
inputPrompt: "Enter Mattermost bot token",
|
|
4574
|
+
inspect: ({ cfg, accountId }) => {
|
|
4575
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
4576
|
+
return {
|
|
4577
|
+
accountConfigured: isMattermostConfigured(resolvedAccount),
|
|
4578
|
+
hasConfiguredValue: hasConfiguredSecretInput(resolvedAccount.config.botToken)
|
|
4579
|
+
};
|
|
4580
|
+
}
|
|
4581
|
+
}],
|
|
4582
|
+
textInputs: [{
|
|
4583
|
+
inputKey: "httpUrl",
|
|
4584
|
+
message: "Enter Mattermost base URL",
|
|
4585
|
+
confirmCurrentValue: false,
|
|
4586
|
+
currentValue: ({ cfg, accountId }) => resolveMattermostAccountWithSecrets(cfg, accountId).baseUrl ?? process.env.MATTERMOST_URL?.trim(),
|
|
4587
|
+
initialValue: ({ cfg, accountId }) => resolveMattermostAccountWithSecrets(cfg, accountId).baseUrl ?? process.env.MATTERMOST_URL?.trim(),
|
|
4588
|
+
shouldPrompt: ({ cfg, accountId, credentialValues, currentValue }) => {
|
|
4589
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
4590
|
+
const tokenConfigured = Boolean(resolvedAccount.botToken?.trim()) || hasConfiguredSecretInput(resolvedAccount.config.botToken);
|
|
4591
|
+
return Boolean(credentialValues.botToken) || !tokenConfigured || !currentValue;
|
|
4592
|
+
},
|
|
4593
|
+
validate: ({ value }) => normalizeMattermostBaseUrl(value) ? void 0 : "Mattermost base URL must include a valid base URL.",
|
|
4594
|
+
normalizeValue: ({ value }) => normalizeMattermostBaseUrl(value) ?? value.trim()
|
|
4595
|
+
}],
|
|
4596
|
+
disable: (cfg) => ({
|
|
4597
|
+
...cfg,
|
|
4598
|
+
channels: {
|
|
4599
|
+
...cfg.channels,
|
|
4600
|
+
mattermost: {
|
|
4601
|
+
...cfg.channels?.mattermost,
|
|
4602
|
+
enabled: false
|
|
4603
|
+
}
|
|
4604
|
+
}
|
|
4605
|
+
})
|
|
4606
|
+
};
|
|
4607
|
+
//#endregion
|
|
4608
|
+
//#region extensions/mattermost/src/channel.ts
|
|
4609
|
+
const collectMattermostSecurityWarnings = createAllowlistProviderRestrictSendersWarningCollector({
|
|
4610
|
+
providerConfigPresent: (cfg) => cfg.channels?.mattermost !== void 0,
|
|
4611
|
+
resolveGroupPolicy: (account) => account.config.groupPolicy,
|
|
4612
|
+
surface: "Mattermost channels",
|
|
4613
|
+
openScope: "any member",
|
|
4614
|
+
groupPolicyPath: "channels.mattermost.groupPolicy",
|
|
4615
|
+
groupAllowFromPath: "channels.mattermost.groupAllowFrom"
|
|
4616
|
+
});
|
|
4617
|
+
function describeMattermostMessageTool({ cfg }) {
|
|
4618
|
+
const enabledAccounts = listMattermostAccountIds(cfg).map((accountId) => resolveMattermostAccount({
|
|
4619
|
+
cfg,
|
|
4620
|
+
accountId
|
|
4621
|
+
})).filter((account) => account.enabled).filter((account) => Boolean(account.botToken?.trim() && account.baseUrl?.trim()));
|
|
4622
|
+
const actions = [];
|
|
4623
|
+
if (enabledAccounts.length > 0) actions.push("send");
|
|
4624
|
+
const baseReactions = (cfg.channels?.mattermost?.actions)?.reactions;
|
|
4625
|
+
if (enabledAccounts.some((account) => {
|
|
4626
|
+
return (account.config.actions?.reactions ?? baseReactions ?? true) !== false;
|
|
4627
|
+
})) actions.push("react");
|
|
4628
|
+
return {
|
|
4629
|
+
actions,
|
|
4630
|
+
capabilities: enabledAccounts.length > 0 ? ["buttons"] : [],
|
|
4631
|
+
schema: enabledAccounts.length > 0 ? { properties: { buttons: createMessageToolButtonsSchema() } } : null
|
|
4632
|
+
};
|
|
4633
|
+
}
|
|
4634
|
+
const mattermostMessageActions = {
|
|
4635
|
+
describeMessageTool: describeMattermostMessageTool,
|
|
4636
|
+
supportsAction: ({ action }) => {
|
|
4637
|
+
return action === "send" || action === "react";
|
|
4638
|
+
},
|
|
4639
|
+
handleAction: async ({ action, params, cfg, accountId }) => {
|
|
4640
|
+
if (action === "react") {
|
|
4641
|
+
const mmBase = cfg?.channels?.mattermost;
|
|
4642
|
+
const accounts = mmBase?.accounts;
|
|
4643
|
+
const resolvedAccountId = accountId ?? resolveDefaultMattermostAccountId(cfg);
|
|
4644
|
+
const acctActions = (accounts?.[resolvedAccountId])?.actions;
|
|
4645
|
+
const baseActions = mmBase?.actions;
|
|
4646
|
+
if (!(acctActions?.reactions ?? baseActions?.reactions ?? true)) throw new Error("Mattermost reactions are disabled in config");
|
|
4647
|
+
const postId = (typeof params?.messageId === "string" ? params.messageId : typeof params?.postId === "string" ? params.postId : "").trim();
|
|
4648
|
+
if (!postId) throw new Error("Mattermost react requires messageId (post id)");
|
|
4649
|
+
const emojiName = (typeof params?.emoji === "string" ? params.emoji : "").trim().replace(/^:+|:+$/g, "");
|
|
4650
|
+
if (!emojiName) throw new Error("Mattermost react requires emoji");
|
|
4651
|
+
if (params?.remove === true) {
|
|
4652
|
+
const result = await removeMattermostReaction({
|
|
4653
|
+
cfg,
|
|
4654
|
+
postId,
|
|
4655
|
+
emojiName,
|
|
4656
|
+
accountId: resolvedAccountId
|
|
4657
|
+
});
|
|
4658
|
+
if (!result.ok) throw new Error(result.error);
|
|
4659
|
+
return {
|
|
4660
|
+
content: [{
|
|
4661
|
+
type: "text",
|
|
4662
|
+
text: `Removed reaction :${emojiName}: from ${postId}`
|
|
4663
|
+
}],
|
|
4664
|
+
details: {}
|
|
4665
|
+
};
|
|
4666
|
+
}
|
|
4667
|
+
const result = await addMattermostReaction({
|
|
4668
|
+
cfg,
|
|
4669
|
+
postId,
|
|
4670
|
+
emojiName,
|
|
4671
|
+
accountId: resolvedAccountId
|
|
4672
|
+
});
|
|
4673
|
+
if (!result.ok) throw new Error(result.error);
|
|
4674
|
+
return {
|
|
4675
|
+
content: [{
|
|
4676
|
+
type: "text",
|
|
4677
|
+
text: `Reacted with :${emojiName}: on ${postId}`
|
|
4678
|
+
}],
|
|
4679
|
+
details: {}
|
|
4680
|
+
};
|
|
4681
|
+
}
|
|
4682
|
+
if (action !== "send") throw new Error(`Unsupported Mattermost action: ${action}`);
|
|
4683
|
+
const to = typeof params.to === "string" ? params.to.trim() : typeof params.target === "string" ? params.target.trim() : "";
|
|
4684
|
+
if (!to) throw new Error("Mattermost send requires a target (to).");
|
|
4685
|
+
const message = typeof params.message === "string" ? params.message : "";
|
|
4686
|
+
const replyToId = readMattermostReplyToId(params);
|
|
4687
|
+
const resolvedAccountId = accountId || void 0;
|
|
4688
|
+
const mediaUrl = typeof params.media === "string" ? params.media.trim() || void 0 : void 0;
|
|
4689
|
+
const result = await sendMessageMattermost(to, message, {
|
|
4690
|
+
accountId: resolvedAccountId,
|
|
4691
|
+
replyToId,
|
|
4692
|
+
buttons: Array.isArray(params.buttons) ? params.buttons : void 0,
|
|
4693
|
+
attachmentText: typeof params.attachmentText === "string" ? params.attachmentText : void 0,
|
|
4694
|
+
mediaUrl
|
|
4695
|
+
});
|
|
4696
|
+
return {
|
|
4697
|
+
content: [{
|
|
4698
|
+
type: "text",
|
|
4699
|
+
text: JSON.stringify({
|
|
4700
|
+
ok: true,
|
|
4701
|
+
channel: "mattermost",
|
|
4702
|
+
messageId: result.messageId,
|
|
4703
|
+
channelId: result.channelId
|
|
4704
|
+
})
|
|
4705
|
+
}],
|
|
4706
|
+
details: {}
|
|
4707
|
+
};
|
|
4708
|
+
}
|
|
4709
|
+
};
|
|
4710
|
+
const meta = {
|
|
4711
|
+
id: "mattermost",
|
|
4712
|
+
label: "Mattermost",
|
|
4713
|
+
selectionLabel: "Mattermost (plugin)",
|
|
4714
|
+
detailLabel: "Mattermost Bot",
|
|
4715
|
+
docsPath: "/channels/mattermost",
|
|
4716
|
+
docsLabel: "mattermost",
|
|
4717
|
+
blurb: "self-hosted Slack-style chat; install the plugin to enable.",
|
|
4718
|
+
systemImage: "bubble.left.and.bubble.right",
|
|
4719
|
+
order: 65,
|
|
4720
|
+
quickstartAllowFrom: true
|
|
4721
|
+
};
|
|
4722
|
+
function readMattermostReplyToId(params) {
|
|
4723
|
+
const readNormalizedValue = (value) => {
|
|
4724
|
+
if (typeof value !== "string") return;
|
|
4725
|
+
return value.trim() || void 0;
|
|
4726
|
+
};
|
|
4727
|
+
return readNormalizedValue(params.replyToId) ?? readNormalizedValue(params.replyTo);
|
|
4728
|
+
}
|
|
4729
|
+
function normalizeAllowEntry(entry) {
|
|
4730
|
+
return entry.trim().replace(/^(mattermost|user):/i, "").replace(/^@/, "").toLowerCase();
|
|
4731
|
+
}
|
|
4732
|
+
function formatAllowEntry(entry) {
|
|
4733
|
+
const trimmed = entry.trim();
|
|
4734
|
+
if (!trimmed) return "";
|
|
4735
|
+
if (trimmed.startsWith("@")) {
|
|
4736
|
+
const username = trimmed.slice(1).trim();
|
|
4737
|
+
return username ? `@${username.toLowerCase()}` : "";
|
|
4738
|
+
}
|
|
4739
|
+
return trimmed.replace(/^(mattermost|user):/i, "").toLowerCase();
|
|
4740
|
+
}
|
|
4741
|
+
const mattermostConfigAdapter = createScopedChannelConfigAdapter({
|
|
4742
|
+
sectionKey: "mattermost",
|
|
4743
|
+
listAccountIds: listMattermostAccountIds,
|
|
4744
|
+
resolveAccount: (cfg, accountId) => resolveMattermostAccount({
|
|
4745
|
+
cfg,
|
|
4746
|
+
accountId
|
|
4747
|
+
}),
|
|
4748
|
+
defaultAccountId: resolveDefaultMattermostAccountId,
|
|
4749
|
+
clearBaseFields: [
|
|
4750
|
+
"botToken",
|
|
4751
|
+
"baseUrl",
|
|
4752
|
+
"name"
|
|
4753
|
+
],
|
|
4754
|
+
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
4755
|
+
formatAllowFrom: (allowFrom) => formatNormalizedAllowFromEntries({
|
|
4756
|
+
allowFrom,
|
|
4757
|
+
normalizeEntry: formatAllowEntry
|
|
4758
|
+
})
|
|
4759
|
+
});
|
|
4760
|
+
const resolveMattermostDmPolicy = createScopedDmSecurityResolver({
|
|
4761
|
+
channelKey: "mattermost",
|
|
4762
|
+
resolvePolicy: (account) => account.config.dmPolicy,
|
|
4763
|
+
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
4764
|
+
policyPathSuffix: "dmPolicy",
|
|
4765
|
+
normalizeEntry: (raw) => normalizeAllowEntry(raw)
|
|
4766
|
+
});
|
|
4767
|
+
const mattermostPlugin = {
|
|
4768
|
+
id: "mattermost",
|
|
4769
|
+
meta: { ...meta },
|
|
4770
|
+
setup: mattermostSetupAdapter,
|
|
4771
|
+
setupWizard: mattermostSetupWizard,
|
|
4772
|
+
pairing: {
|
|
4773
|
+
idLabel: "mattermostUserId",
|
|
4774
|
+
normalizeAllowEntry: (entry) => normalizeAllowEntry(entry),
|
|
4775
|
+
notifyApproval: createLoggedPairingApprovalNotifier(({ id }) => `[mattermost] User ${id} approved for pairing`)
|
|
4776
|
+
},
|
|
4777
|
+
capabilities: {
|
|
4778
|
+
chatTypes: [
|
|
4779
|
+
"direct",
|
|
4780
|
+
"channel",
|
|
4781
|
+
"group",
|
|
4782
|
+
"thread"
|
|
4783
|
+
],
|
|
4784
|
+
reactions: true,
|
|
4785
|
+
threads: true,
|
|
4786
|
+
media: true,
|
|
4787
|
+
nativeCommands: true
|
|
4788
|
+
},
|
|
4789
|
+
streaming: { blockStreamingCoalesceDefaults: {
|
|
4790
|
+
minChars: 1500,
|
|
4791
|
+
idleMs: 1e3
|
|
4792
|
+
} },
|
|
4793
|
+
threading: { resolveReplyToMode: createScopedAccountReplyToModeResolver({
|
|
4794
|
+
resolveAccount: (cfg, accountId) => resolveMattermostAccount({
|
|
4795
|
+
cfg,
|
|
4796
|
+
accountId: accountId ?? "default"
|
|
4797
|
+
}),
|
|
4798
|
+
resolveReplyToMode: (account, chatType) => resolveMattermostReplyToMode(account, chatType === "direct" || chatType === "group" || chatType === "channel" ? chatType : "channel")
|
|
4799
|
+
}) },
|
|
4800
|
+
reload: { configPrefixes: ["channels.mattermost"] },
|
|
4801
|
+
configSchema: buildChannelConfigSchema(MattermostConfigSchema),
|
|
4802
|
+
config: {
|
|
4803
|
+
...mattermostConfigAdapter,
|
|
4804
|
+
isConfigured: (account) => Boolean(account.botToken && account.baseUrl),
|
|
4805
|
+
describeAccount: (account) => ({
|
|
4806
|
+
accountId: account.accountId,
|
|
4807
|
+
name: account.name,
|
|
4808
|
+
enabled: account.enabled,
|
|
4809
|
+
configured: Boolean(account.botToken && account.baseUrl),
|
|
4810
|
+
botTokenSource: account.botTokenSource,
|
|
4811
|
+
baseUrl: account.baseUrl
|
|
4812
|
+
})
|
|
4813
|
+
},
|
|
4814
|
+
security: {
|
|
4815
|
+
resolveDmPolicy: resolveMattermostDmPolicy,
|
|
4816
|
+
collectWarnings: collectMattermostSecurityWarnings
|
|
4817
|
+
},
|
|
4818
|
+
groups: { resolveRequireMention: resolveMattermostGroupRequireMention },
|
|
4819
|
+
actions: mattermostMessageActions,
|
|
4820
|
+
directory: createChannelDirectoryAdapter({
|
|
4821
|
+
listGroups: async (params) => listMattermostDirectoryGroups(params),
|
|
4822
|
+
listGroupsLive: async (params) => listMattermostDirectoryGroups(params),
|
|
4823
|
+
listPeers: async (params) => listMattermostDirectoryPeers(params),
|
|
4824
|
+
listPeersLive: async (params) => listMattermostDirectoryPeers(params)
|
|
4825
|
+
}),
|
|
4826
|
+
messaging: {
|
|
4827
|
+
normalizeTarget: normalizeMattermostMessagingTarget,
|
|
4828
|
+
resolveOutboundSessionRoute: (params) => resolveMattermostOutboundSessionRoute(params),
|
|
4829
|
+
targetResolver: {
|
|
4830
|
+
looksLikeId: looksLikeMattermostTargetId,
|
|
4831
|
+
hint: "<channelId|user:ID|channel:ID>",
|
|
4832
|
+
resolveTarget: async ({ cfg, accountId, input }) => {
|
|
4833
|
+
const resolved = await resolveMattermostOpaqueTarget({
|
|
4834
|
+
input,
|
|
4835
|
+
cfg,
|
|
4836
|
+
accountId
|
|
4837
|
+
});
|
|
4838
|
+
if (!resolved) return null;
|
|
4839
|
+
return {
|
|
4840
|
+
to: resolved.to,
|
|
4841
|
+
kind: resolved.kind,
|
|
4842
|
+
source: "directory"
|
|
4843
|
+
};
|
|
4844
|
+
}
|
|
4845
|
+
}
|
|
4846
|
+
},
|
|
4847
|
+
outbound: {
|
|
4848
|
+
deliveryMode: "direct",
|
|
4849
|
+
chunker: (text, limit) => getMattermostRuntime().channel.text.chunkMarkdownText(text, limit),
|
|
4850
|
+
chunkerMode: "markdown",
|
|
4851
|
+
textChunkLimit: 4e3,
|
|
4852
|
+
resolveTarget: ({ to }) => {
|
|
4853
|
+
const trimmed = to?.trim();
|
|
4854
|
+
if (!trimmed) return {
|
|
4855
|
+
ok: false,
|
|
4856
|
+
error: /* @__PURE__ */ new Error("Delivering to Mattermost requires --to <channelId|@username|user:ID|channel:ID>")
|
|
4857
|
+
};
|
|
4858
|
+
return {
|
|
4859
|
+
ok: true,
|
|
4860
|
+
to: trimmed
|
|
4861
|
+
};
|
|
4862
|
+
},
|
|
4863
|
+
...createAttachedChannelResultAdapter({
|
|
4864
|
+
channel: "mattermost",
|
|
4865
|
+
sendText: async ({ cfg, to, text, accountId, replyToId, threadId }) => await sendMessageMattermost(to, text, {
|
|
4866
|
+
cfg,
|
|
4867
|
+
accountId: accountId ?? void 0,
|
|
4868
|
+
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0)
|
|
4869
|
+
}),
|
|
4870
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, accountId, replyToId, threadId }) => await sendMessageMattermost(to, text, {
|
|
4871
|
+
cfg,
|
|
4872
|
+
accountId: accountId ?? void 0,
|
|
4873
|
+
mediaUrl,
|
|
4874
|
+
mediaLocalRoots,
|
|
4875
|
+
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0)
|
|
4876
|
+
})
|
|
4877
|
+
})
|
|
4878
|
+
},
|
|
4879
|
+
status: {
|
|
4880
|
+
defaultRuntime: {
|
|
4881
|
+
accountId: DEFAULT_ACCOUNT_ID,
|
|
4882
|
+
running: false,
|
|
4883
|
+
connected: false,
|
|
4884
|
+
lastConnectedAt: null,
|
|
4885
|
+
lastDisconnect: null,
|
|
4886
|
+
lastStartAt: null,
|
|
4887
|
+
lastStopAt: null,
|
|
4888
|
+
lastError: null
|
|
4889
|
+
},
|
|
4890
|
+
buildChannelSummary: ({ snapshot }) => buildPassiveProbedChannelStatusSummary(snapshot, {
|
|
4891
|
+
botTokenSource: snapshot.botTokenSource ?? "none",
|
|
4892
|
+
connected: snapshot.connected ?? false,
|
|
4893
|
+
baseUrl: snapshot.baseUrl ?? null
|
|
4894
|
+
}),
|
|
4895
|
+
probeAccount: async ({ account, timeoutMs }) => {
|
|
4896
|
+
const token = account.botToken?.trim();
|
|
4897
|
+
const baseUrl = account.baseUrl?.trim();
|
|
4898
|
+
if (!token || !baseUrl) return {
|
|
4899
|
+
ok: false,
|
|
4900
|
+
error: "bot token or baseUrl missing"
|
|
4901
|
+
};
|
|
4902
|
+
return await probeMattermost(baseUrl, token, timeoutMs);
|
|
4903
|
+
},
|
|
4904
|
+
buildAccountSnapshot: ({ account, runtime, probe }) => {
|
|
4905
|
+
return {
|
|
4906
|
+
...buildComputedAccountStatusSnapshot({
|
|
4907
|
+
accountId: account.accountId,
|
|
4908
|
+
name: account.name,
|
|
4909
|
+
enabled: account.enabled,
|
|
4910
|
+
configured: Boolean(account.botToken && account.baseUrl),
|
|
4911
|
+
runtime,
|
|
4912
|
+
probe
|
|
4913
|
+
}),
|
|
4914
|
+
botTokenSource: account.botTokenSource,
|
|
4915
|
+
baseUrl: account.baseUrl,
|
|
4916
|
+
connected: runtime?.connected ?? false,
|
|
4917
|
+
lastConnectedAt: runtime?.lastConnectedAt ?? null,
|
|
4918
|
+
lastDisconnect: runtime?.lastDisconnect ?? null
|
|
4919
|
+
};
|
|
4920
|
+
}
|
|
4921
|
+
},
|
|
4922
|
+
gateway: { startAccount: async (ctx) => {
|
|
4923
|
+
const account = ctx.account;
|
|
4924
|
+
const statusSink = createAccountStatusSink({
|
|
4925
|
+
accountId: ctx.accountId,
|
|
4926
|
+
setStatus: ctx.setStatus
|
|
4927
|
+
});
|
|
4928
|
+
statusSink({
|
|
4929
|
+
baseUrl: account.baseUrl,
|
|
4930
|
+
botTokenSource: account.botTokenSource
|
|
4931
|
+
});
|
|
4932
|
+
ctx.log?.info(`[${account.accountId}] starting channel`);
|
|
4933
|
+
return monitorMattermostProvider({
|
|
4934
|
+
botToken: account.botToken ?? void 0,
|
|
4935
|
+
baseUrl: account.baseUrl ?? void 0,
|
|
4936
|
+
accountId: account.accountId,
|
|
4937
|
+
config: ctx.cfg,
|
|
4938
|
+
runtime: ctx.runtime,
|
|
4939
|
+
abortSignal: ctx.abortSignal,
|
|
4940
|
+
statusSink
|
|
4941
|
+
});
|
|
4942
|
+
} }
|
|
4943
|
+
};
|
|
4944
|
+
//#endregion
|
|
4945
|
+
export { registerSlashCommandRoute as n, setMattermostRuntime as r, mattermostPlugin as t };
|