@spacebar_ai/moldclaw-core 2026.3.43 → 2026.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts-5qY-dKca.d.ts +103 -0
- package/dist/accounts-CxV5zzzp.js +114 -0
- package/dist/acp-cli-2JoKJ0xt.js +2093 -0
- package/dist/actions.runtime-BJPd9nat.js +119 -0
- package/dist/actions.runtime-DVs4a2cB.js +133 -0
- package/dist/agent-scope-lZlwP1At.js +208 -0
- package/dist/agents-CmT3Jwvj.js +222 -0
- package/dist/agents-D7Pebhph.js +853 -0
- package/dist/agents.config-CX9CPNfP.js +17 -0
- package/dist/agents.config-DF9Zwn9n.js +121 -0
- package/dist/allow-list-B3f4EqAM.js +81 -0
- package/dist/allowlist-_YpK0-4h.js +142 -0
- package/dist/api-B44giplI.js +117 -0
- package/dist/audit-C3InXm7H.js +787 -0
- package/dist/audit-ChWS6RiF.js +54 -0
- package/dist/audit-channel.collect.runtime-DZzrS6v2.js +605 -0
- package/dist/audit-channel.runtime-B2XTOsSF.js +121 -0
- package/dist/audit-extra.async-C2G0mqmk.js +813 -0
- package/dist/audit-membership-runtime-DOv5-eHo.js +162 -0
- package/dist/audit.deep.runtime-DyL9O_sU.js +25 -0
- package/dist/audit.nondeep.runtime-C6jFgJfH.js +832 -0
- package/dist/audit.runtime-Cvh2wmWM.js +118 -0
- package/dist/auth-Ch3Rchm4.js +101 -0
- package/dist/auth-choice-Beq0dWPS.js +268 -0
- package/dist/auth-choice-DZYg94gS.js +122 -0
- package/dist/auth-choice-TVG_8lJj.js +507 -0
- package/dist/auth-choice-options-B_qxsjdj.js +123 -0
- package/dist/auth-choice-prompt-BayzDobT.js +115 -0
- package/dist/auth-choice-prompt-_UES859x.js +36 -0
- package/dist/auth-choice.apply-helpers-BhbNIV8X.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-CVC4Jzhp.js +119 -0
- package/dist/auth-profiles-C-Ul-Qkn.js +128139 -0
- package/dist/auth-profiles.runtime-Clyka_jV.js +116 -0
- package/dist/banner-CojBHPWr.js +342 -0
- package/dist/bluebubbles-BnLsj2Fy.d.ts +6 -0
- package/dist/bluebubbles-irYTGbfn.js +64 -0
- package/dist/bot-DdyrB2z9.d.ts +478 -0
- package/dist/brave-w4Fo8WZ3.js +24 -0
- package/dist/browser-cli-DWFs3P_i.js +1494 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.d.ts +1 -1
- package/dist/bundled/boot-md/handler.js +35 -35
- package/dist/bundled/bootstrap-extra-files/handler.d.ts +1 -1
- package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
- package/dist/bundled/command-logger/handler.d.ts +1 -1
- package/dist/bundled/session-memory/handler.d.ts +1 -1
- package/dist/bundled/session-memory/handler.js +36 -36
- package/dist/call-Do7wTSr7.js +39 -0
- package/dist/call-gdDAt07d.js +640 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/channel-34O87pvK.js +949 -0
- package/dist/channel-B3Xo_4d8.js +1598 -0
- package/dist/channel-BEqDvL49.js +397 -0
- package/dist/channel-BLOk9WRE.js +214 -0
- package/dist/channel-BY5H2cdy.js +803 -0
- package/dist/channel-BeOtzXIH.js +4681 -0
- package/dist/channel-Bt8x_5Kj.js +306 -0
- package/dist/channel-C3E8XWLF.js +1321 -0
- package/dist/channel-C6ngVfGr.js +943 -0
- package/dist/channel-CVDBca2b.js +226 -0
- package/dist/channel-Cctli72q.js +562 -0
- package/dist/channel-DEAbU9Dj2.js +316 -0
- package/dist/channel-DIULkrBN.js +575 -0
- package/dist/channel-DXb4gsSd.js +619 -0
- package/dist/channel-Dap9LY-9.js +352 -0
- package/dist/channel-DcJdUnab.js +538 -0
- package/dist/channel-ZYCQj3hP.js +207 -0
- package/dist/channel-account-context-Baszl3_B.js +103 -0
- package/dist/channel-hlzhFHDl.js +497 -0
- package/dist/channel-options-PwBzYYtq.js +50 -0
- package/dist/channel-plugin-ids-TZIY4hFs.js +26 -0
- package/dist/channel-summary-CCEAV13o.js +111 -0
- package/dist/channel-tY2Hg5ac.js +542 -0
- package/dist/channel-vMWcWq1U.js +920 -0
- package/dist/channel.runtime-8qWgkCxX.js +404 -0
- package/dist/channel.runtime-C4jtgrbI.js +179 -0
- package/dist/channel.runtime-CJ4ug6Mp.js +127 -0
- package/dist/channel.runtime-ChKRJAZ8.js +4011 -0
- package/dist/channel.runtime-Cj54LYU-.js +418 -0
- package/dist/channel.runtime-KH06-bu1.js +870 -0
- package/dist/channel.runtime-_GYnBh2X.js +199 -0
- package/dist/channel.runtime-go7Pzt6N.js +241 -0
- package/dist/channel.runtime-iypIZ0EU.js +171 -0
- package/dist/channel.runtime-mukTWpon.js +182 -0
- package/dist/channel.runtime-oNtF1sc3.js +218 -0
- package/dist/channel.setup-BZfok6kX.js +11 -0
- package/dist/channel.setup-CbXfZ2dq.js +9 -0
- package/dist/channel.setup-CfyM55np.js +8 -0
- package/dist/channel.setup-CoG-gJ6n.js +9 -0
- package/dist/channel.setup-Cp4PH_rc.js +57 -0
- package/dist/channel.setup-V2w9Jk9j.js +6 -0
- package/dist/channel.setup-t7F5WZE7.js +8 -0
- package/dist/channels/plugins/actions/discord.d.ts +2 -2
- package/dist/channels/plugins/actions/discord.js +35 -35
- package/dist/channels/plugins/actions/signal.d.ts +1 -1
- package/dist/channels/plugins/actions/signal.js +35 -35
- package/dist/channels/plugins/actions/telegram.d.ts +2 -2
- package/dist/channels/plugins/actions/telegram.js +35 -35
- package/dist/channels/plugins/agent-tools/whatsapp-login.d.ts +3 -3
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +35 -35
- package/dist/channels-H5ThmyG8.js +1118 -0
- package/dist/channels-cQ-6NFCQ.js +404 -0
- package/dist/channels-cli-TmchKLFS.js +291 -0
- package/dist/channels-status-issues-DXnkXEeJ.js +16 -0
- package/dist/clawbot-cli-Cpbxu8dD.js +118 -0
- package/dist/cleanup-utils-D0L17RsX.js +96 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli--2bGSKdX.js +154 -0
- package/dist/command-registry-BaVPDmwn.js +242 -0
- package/dist/command-registry-DhLyeSbO.js +14 -0
- package/dist/command-secret-gateway-C5D_-jb0.js +111 -0
- package/dist/compact.runtime-C9a0kRAg.js +116 -0
- package/dist/completion-cli-Bg95upyk.js +17 -0
- package/dist/completion-cli-CrPdlnCH.js +445 -0
- package/dist/config-BbvDRSYp.js +31 -0
- package/dist/config-CwBv71QC.js +44 -0
- package/dist/config-cli-jsZsYhAl.js +678 -0
- package/dist/config-guard-DTaXXqly.js +118 -0
- package/dist/config-validation-Q6U1sP84.js +262 -0
- package/dist/config-value-DT3-5958.js +132 -0
- package/dist/configure-BJfMiVej.js +1100 -0
- package/dist/configure-Cist3Iza.js +243 -0
- package/dist/control-ui-assets-C1YDYi82.js +232 -0
- package/dist/control-ui-shared-Dm5Dh0Lo.js +29 -0
- package/dist/core-BwKq3krw.js +150 -0
- package/dist/core-hjBwfDsW.d.ts +87 -0
- package/dist/cron-cli-Bktbk7iP.js +639 -0
- package/dist/daemon-cli-BXyH8DBL.js +339 -0
- package/dist/daemon-install-mxcGYsRJ.js +180 -0
- package/dist/deliver-BPYUKaSp.js +111 -0
- package/dist/deliver-runtime-CwnLQZTN.js +111 -0
- package/dist/device-id-cli-XvwZbIyC.js +52 -0
- package/dist/device-identity-IG5DngWM.js +365 -0
- package/dist/devices-cli-DIsxj4xp.js +342 -0
- package/dist/diagnostic-DTPopFvh.js +310 -0
- package/dist/directory-cli-D253m0er.js +311 -0
- package/dist/directory-config-helpers-DpFcAbmo.d.ts +38 -0
- package/dist/directory.static-BXv9MXqm.js +44 -0
- package/dist/discord-DwFf1qp7.js +114 -0
- package/dist/discovery-DzRM1wzK.js +48 -0
- package/dist/dm-policy-shared-DKoGdUpY.d.ts +95 -0
- package/dist/dns-cli-BJiz6CLK.js +217 -0
- package/dist/docs-cli-Dq2Yi5qO.js +174 -0
- package/dist/doctor-completion-BPl6HiiZ.js +90 -0
- package/dist/doctor-config-flow-BHR1Ayyh.js +2437 -0
- package/dist/doctor-config-flow-PXVtrfkE.js +112 -0
- package/dist/enable-Cyagpq3b.js +24 -0
- package/dist/entry.js +4 -4
- package/dist/exec-approvals-cli-kLAev6bP.js +421 -0
- package/dist/extensions/acpx/index.d.ts +1 -1
- package/dist/extensions/amazon-bedrock/index.d.ts +1 -1
- package/dist/extensions/amazon-bedrock/index.js +4 -4
- package/dist/extensions/anthropic/index.d.ts +1 -1
- package/dist/extensions/anthropic/index.js +35 -35
- package/dist/extensions/bluebubbles/index.d.ts +1 -1
- package/dist/extensions/bluebubbles/index.js +39 -39
- package/dist/extensions/bluebubbles/setup-entry.d.ts +2 -2
- package/dist/extensions/bluebubbles/setup-entry.js +39 -39
- package/dist/extensions/brave/index.d.ts +1 -1
- package/dist/extensions/brave/index.js +5 -5
- package/dist/extensions/byteplus/index.d.ts +1 -1
- package/dist/extensions/byteplus/index.js +35 -35
- package/dist/extensions/cloudflare-ai-gateway/index.d.ts +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +36 -36
- package/dist/extensions/copilot-proxy/index.d.ts +1 -1
- package/dist/extensions/copilot-proxy/index.js +4 -4
- package/dist/extensions/device-pair/index.d.ts +1 -1
- package/dist/extensions/device-pair/index.js +4 -4
- package/dist/extensions/diagnostics-otel/index.d.ts +1 -1
- package/dist/extensions/diagnostics-otel/index.js +4 -4
- package/dist/extensions/diffs/index.d.ts +1 -1
- package/dist/extensions/discord/index.d.ts +1 -1
- package/dist/extensions/discord/index.js +40 -40
- package/dist/extensions/discord/setup-entry.d.ts +1 -1
- package/dist/extensions/discord/setup-entry.js +38 -38
- package/dist/extensions/elevenlabs/index.d.ts +1 -1
- package/dist/extensions/elevenlabs/index.js +35 -35
- package/dist/extensions/feishu/index.d.ts +2 -2
- package/dist/extensions/feishu/index.js +40 -40
- package/dist/extensions/feishu/setup-entry.d.ts +2 -2
- package/dist/extensions/feishu/setup-entry.js +37 -37
- package/dist/extensions/firecrawl/index.d.ts +1 -1
- package/dist/extensions/firecrawl/index.js +35 -35
- package/dist/extensions/github-copilot/index.d.ts +1 -1
- package/dist/extensions/github-copilot/index.js +35 -35
- package/dist/extensions/google/index.d.ts +1 -1
- package/dist/extensions/google/index.js +35 -35
- package/dist/extensions/googlechat/index.d.ts +1 -1
- package/dist/extensions/googlechat/index.js +38 -38
- package/dist/extensions/googlechat/setup-entry.d.ts +1 -1
- package/dist/extensions/googlechat/setup-entry.js +38 -38
- package/dist/extensions/huggingface/index.d.ts +1 -1
- package/dist/extensions/huggingface/index.js +35 -35
- package/dist/extensions/imessage/index.d.ts +1 -1
- package/dist/extensions/imessage/index.js +39 -39
- package/dist/extensions/imessage/setup-entry.d.ts +1 -1
- package/dist/extensions/imessage/setup-entry.js +39 -39
- package/dist/extensions/irc/index.d.ts +1 -1
- package/dist/extensions/irc/index.js +38 -38
- package/dist/extensions/irc/setup-entry.d.ts +2 -2
- package/dist/extensions/irc/setup-entry.js +38 -38
- package/dist/extensions/kakao-talkchannel/index.d.ts +1 -1
- package/dist/extensions/kakao-talkchannel/index.js +4 -4
- package/dist/extensions/kilocode/index.d.ts +1 -1
- package/dist/extensions/kilocode/index.js +35 -35
- package/dist/extensions/kimi-coding/index.d.ts +1 -1
- package/dist/extensions/kimi-coding/index.js +35 -35
- package/dist/extensions/line/index.d.ts +1 -1
- package/dist/extensions/line/index.js +37 -37
- package/dist/extensions/line/setup-entry.d.ts +1 -1
- package/dist/extensions/line/setup-entry.js +37 -37
- package/dist/extensions/llm-task/index.d.ts +1 -1
- package/dist/extensions/llm-task/index.js +35 -35
- package/dist/extensions/lobster/index.d.ts +1 -1
- package/dist/extensions/lobster/index.js +4 -4
- package/dist/extensions/matrix/index.d.ts +1 -1
- package/dist/extensions/matrix/index.js +40 -40
- package/dist/extensions/matrix/setup-entry.d.ts +2 -2
- package/dist/extensions/matrix/setup-entry.js +40 -40
- package/dist/extensions/mattermost/index.d.ts +1 -1
- package/dist/extensions/mattermost/index.js +37 -37
- package/dist/extensions/mattermost/setup-entry.d.ts +2 -2
- package/dist/extensions/mattermost/setup-entry.js +37 -37
- package/dist/extensions/memory-core/index.d.ts +1 -1
- package/dist/extensions/memory-core/index.js +4 -4
- package/dist/extensions/memory-lancedb/index.d.ts +1 -1
- package/dist/extensions/memory-lancedb/index.js +4 -4
- package/dist/extensions/microsoft/index.d.ts +1 -1
- package/dist/extensions/microsoft/index.js +35 -35
- package/dist/extensions/minimax/index.d.ts +1 -1
- package/dist/extensions/minimax/index.js +35 -35
- package/dist/extensions/mistral/index.d.ts +1 -1
- package/dist/extensions/mistral/index.js +35 -35
- package/dist/extensions/modelstudio/index.d.ts +1 -1
- package/dist/extensions/modelstudio/index.js +35 -35
- package/dist/extensions/moonshot/index.d.ts +1 -1
- package/dist/extensions/moonshot/index.js +35 -35
- package/dist/extensions/msteams/index.d.ts +1 -1
- package/dist/extensions/msteams/index.js +40 -40
- package/dist/extensions/msteams/setup-entry.d.ts +1 -1
- package/dist/extensions/msteams/setup-entry.js +40 -40
- package/dist/extensions/nextcloud-talk/index.d.ts +1 -1
- package/dist/extensions/nextcloud-talk/index.js +37 -37
- package/dist/extensions/nextcloud-talk/setup-entry.d.ts +2 -2
- package/dist/extensions/nextcloud-talk/setup-entry.js +37 -37
- package/dist/extensions/nostr/index.d.ts +1 -1
- package/dist/extensions/nostr/index.js +37 -37
- package/dist/extensions/nostr/setup-entry.d.ts +1 -1
- package/dist/extensions/nostr/setup-entry.js +37 -37
- package/dist/extensions/nvidia/index.d.ts +1 -1
- package/dist/extensions/nvidia/index.js +4 -4
- package/dist/extensions/ollama/index.d.ts +1 -1
- package/dist/extensions/ollama/index.js +7 -7
- package/dist/extensions/open-prose/index.d.ts +1 -1
- package/dist/extensions/open-prose/index.js +4 -4
- package/dist/extensions/openai/index.d.ts +1 -1
- package/dist/extensions/openai/index.js +35 -35
- package/dist/extensions/opencode/index.d.ts +1 -1
- package/dist/extensions/opencode/index.js +35 -35
- package/dist/extensions/opencode-go/index.d.ts +1 -1
- package/dist/extensions/opencode-go/index.js +35 -35
- package/dist/extensions/openrouter/index.d.ts +1 -1
- package/dist/extensions/openrouter/index.js +35 -35
- package/dist/extensions/openshell/index.d.ts +1 -1
- package/dist/extensions/openshell/index.js +35 -35
- package/dist/extensions/perplexity/index.d.ts +1 -1
- package/dist/extensions/perplexity/index.js +5 -5
- package/dist/extensions/phone-control/index.d.ts +1 -1
- package/dist/extensions/phone-control/index.js +4 -4
- package/dist/extensions/qianfan/index.d.ts +1 -1
- package/dist/extensions/qianfan/index.js +35 -35
- package/dist/extensions/qwen-portal-auth/index.d.ts +1 -1
- package/dist/extensions/qwen-portal-auth/index.js +35 -35
- package/dist/extensions/sglang/index.d.ts +1 -1
- package/dist/extensions/sglang/index.js +35 -35
- package/dist/extensions/signal/index.d.ts +1 -1
- package/dist/extensions/signal/index.js +38 -38
- package/dist/extensions/signal/setup-entry.d.ts +1 -1
- package/dist/extensions/signal/setup-entry.js +38 -38
- package/dist/extensions/slack/index.d.ts +1 -1
- package/dist/extensions/slack/index.js +39 -39
- package/dist/extensions/slack/setup-entry.d.ts +1 -1
- package/dist/extensions/slack/setup-entry.js +38 -38
- package/dist/extensions/synology-chat/index.d.ts +1 -1
- package/dist/extensions/synology-chat/index.js +37 -37
- package/dist/extensions/synology-chat/setup-entry.d.ts +1 -1
- package/dist/extensions/synology-chat/setup-entry.js +37 -37
- package/dist/extensions/synthetic/index.d.ts +1 -1
- package/dist/extensions/synthetic/index.js +35 -35
- package/dist/extensions/talk-voice/index.d.ts +1 -1
- package/dist/extensions/talk-voice/index.js +35 -35
- package/dist/extensions/telegram/index.d.ts +1 -1
- package/dist/extensions/telegram/index.js +38 -38
- package/dist/extensions/telegram/setup-entry.d.ts +1 -1
- package/dist/extensions/telegram/setup-entry.js +37 -37
- package/dist/extensions/thread-ownership/index.d.ts +1 -1
- package/dist/extensions/thread-ownership/index.js +4 -4
- package/dist/extensions/tlon/index.d.ts +1 -1
- package/dist/extensions/tlon/index.js +37 -37
- package/dist/extensions/tlon/setup-entry.d.ts +1 -1
- package/dist/extensions/tlon/setup-entry.js +37 -37
- package/dist/extensions/together/index.d.ts +1 -1
- package/dist/extensions/together/index.js +35 -35
- package/dist/extensions/twitch/index.d.ts +2 -2
- package/dist/extensions/twitch/index.js +37 -37
- package/dist/extensions/venice/index.d.ts +1 -1
- package/dist/extensions/venice/index.js +35 -35
- package/dist/extensions/vercel-ai-gateway/index.d.ts +1 -1
- package/dist/extensions/vercel-ai-gateway/index.js +36 -36
- package/dist/extensions/vllm/index.d.ts +1 -1
- package/dist/extensions/vllm/index.js +35 -35
- package/dist/extensions/voice-call/index.d.ts +1 -1
- package/dist/extensions/voice-call/index.js +35 -35
- package/dist/extensions/volcengine/index.d.ts +1 -1
- package/dist/extensions/volcengine/index.js +35 -35
- package/dist/extensions/whatsapp/index.d.ts +1 -1
- package/dist/extensions/whatsapp/index.js +38 -38
- package/dist/extensions/whatsapp/setup-entry.d.ts +1 -1
- package/dist/extensions/whatsapp/setup-entry.js +38 -38
- package/dist/extensions/xai/index.d.ts +1 -1
- package/dist/extensions/xai/index.js +35 -35
- package/dist/extensions/xiaomi/index.d.ts +1 -1
- package/dist/extensions/xiaomi/index.js +35 -35
- package/dist/extensions/zai/index.d.ts +1 -1
- package/dist/extensions/zai/index.js +35 -35
- package/dist/extensions/zalo/index.d.ts +1 -1
- package/dist/extensions/zalo/index.js +39 -39
- package/dist/extensions/zalo/setup-entry.d.ts +1 -1
- package/dist/extensions/zalo/setup-entry.js +39 -39
- package/dist/extensions/zalouser/index.d.ts +1 -1
- package/dist/extensions/zalouser/index.js +40 -40
- package/dist/extensions/zalouser/setup-entry.d.ts +1 -1
- package/dist/extensions/zalouser/setup-entry.js +40 -40
- package/dist/feishu-fIcnHDTd.d.ts +36 -0
- package/dist/gateway-cli-DofujQf3.js +26437 -0
- package/dist/gateway-install-token-vvtOvufH.js +163 -0
- package/dist/gateway-rpc-C0Vk51W7.js +26 -0
- package/dist/gateway-runtime-CBm3CCoA.js +69 -0
- package/dist/git-commit-BTWXFY41.js +177 -0
- package/dist/git-commit-D6GTN5Yt.js +2 -0
- package/dist/googlechat-BvwsCVKl.d.ts +12 -0
- package/dist/googlechat-DzoFLiDG.js +307 -0
- package/dist/group-access-DpiQnd-G.d.ts +61 -0
- package/dist/health-CqUU_ecm.js +570 -0
- package/dist/health-Dzn8BT5I.js +113 -0
- package/dist/heartbeat-summary-Dct2lqJj.js +57 -0
- package/dist/help-CtwSApfq.js +81 -0
- package/dist/hooks-9gokOxZ5.d.ts +6 -0
- package/dist/hooks-cli-DtBvd1lb.js +1000 -0
- package/dist/hooks-status-Bm_pGORf.js +78 -0
- package/dist/http-registry-D-S6a1Na.d.ts +20 -0
- package/dist/identity-file-Diub2a0t.js +60 -0
- package/dist/image-generation-CbIVzmAR.d.ts +9 -0
- package/dist/imessage-C7Z59nbV.js +31 -0
- package/dist/imessage-scXvYYHX.js +115 -0
- package/dist/inbound-reply-dispatch-gzPJFtkc.js +71 -0
- package/dist/inbound-reply-dispatch-n7U3qg15.d.ts +72 -0
- package/dist/index.js +2 -2
- package/dist/install-target-B4n74f_B.js +574 -0
- package/dist/installs-e1WEcS2x.js +532 -0
- package/dist/io-BaBxjB1v.js +9739 -0
- package/dist/io-CgHb1Jld.js +29 -0
- package/dist/irc-DxJ7uOKl.js +672 -0
- package/dist/library-DjjiKiBC.js +112 -0
- package/dist/lifecycle-core-Dn8PK6nk.js +382 -0
- package/dist/line/accounts.d.ts +2 -2
- package/dist/line/send.d.ts +1 -1
- package/dist/line/send.js +7 -7
- package/dist/line/template-messages.d.ts +1 -1
- package/dist/line-B5QFpgN_.d.ts +75 -0
- package/dist/line-BBiBiGgL.js +530 -0
- package/dist/llm-slug-generator-BQ09Fz6D.js +67 -0
- package/dist/llm-slug-generator.d.ts +1 -1
- package/dist/llm-slug-generator.js +36 -36
- package/dist/logging-CdisccbY.js +13 -0
- package/dist/logging-LKQSgX1d.js +30 -0
- package/dist/login-qr-B2ElPfmb.js +112 -0
- package/dist/login-qr-Di3uPIK1.js +233 -0
- package/dist/logs-cli-CNzOvZ2d.js +256 -0
- package/dist/manager-runtime-2RwW64dE.js +111 -0
- package/dist/manager.runtime-BacHmSFL.js +715 -0
- package/dist/manifest-registry-CS_p1OBQ.js +1329 -0
- package/dist/matrix-43_RGLZN.d.ts +68 -0
- package/dist/matrix-6-xpfQHf.js +1269 -0
- package/dist/matrix-DKYdZvGK.js +1495 -0
- package/dist/mcp-cli-Ci2jvv3s.js +87 -0
- package/dist/media-understanding.runtime-0668UZMb.js +116 -0
- package/dist/memory-cli-BGfRJOPh.js +111 -0
- package/dist/memory-search-BHhETk6u.js +17 -0
- package/dist/memory-search-tTD5o_rU.js +204 -0
- package/dist/method-scopes-B2ZKSsxQ.js +2452 -0
- package/dist/model-auth-markers-LqZ4qhrZ.d.ts +20 -0
- package/dist/model-picker-D9Gmg9vM.js +390 -0
- package/dist/model-picker-VOam6Dfa.js +112 -0
- package/dist/model-picker.runtime-B8h4yaGk.js +125 -0
- package/dist/model-selection-bBBxfXdb.js +653 -0
- package/dist/model-suppression.runtime-IpdzuuaW.js +116 -0
- package/dist/models-CEr8OkSA.js +118 -0
- package/dist/models-FgjlnyvT.js +2514 -0
- package/dist/models-cli-CdXULEZe.js +309 -0
- package/dist/models-config-UQxq76ac.js +111 -0
- package/dist/models-config.providers.discovery-puxTsH39.d.ts +18 -0
- package/dist/moldclaw-root-Cb6HRlUO.js +92 -0
- package/dist/monitor-BGAB5pZp.js +772 -0
- package/dist/monitor-C_1qA4q5.js +6823 -0
- package/dist/monitor-D8WcCUuA.js +782 -0
- package/dist/monitor-DesGoihT.js +113 -0
- package/dist/monitor-DhrUY3U6.js +3468 -0
- package/dist/monitor-DsDCIG87.js +3076 -0
- package/dist/monitor-dBB-luY7.js +115 -0
- package/dist/monitor-shared-CkicpwVc.js +444 -0
- package/dist/msteams-qmY7xMCK.js +852 -0
- package/dist/node-cli-B_2nTm80.js +2503 -0
- package/dist/node-resolve-BYC2FbO2.js +835 -0
- package/dist/nodes-cli-CBX71Wd_.js +1380 -0
- package/dist/nostr-BFKRoOlz.d.ts +7 -0
- package/dist/nostr-OB78XVlq.js +8744 -0
- package/dist/npm-resolution-DZJB3Hgh.js +60 -0
- package/dist/oauth-env-CLG8KOrz.js +10 -0
- package/dist/onboard-BON0C360.js +48 -0
- package/dist/onboard-DsKI17iq.js +25 -0
- package/dist/onboard-DyBwXVGT.js +589 -0
- package/dist/onboard-channels-BaVA02kK.js +1241 -0
- package/dist/onboard-channels-JJVMXpKl.js +205 -0
- package/dist/onboard-custom-D6YDrk9n.js +571 -0
- package/dist/onboard-custom-DqsNalL1.js +114 -0
- package/dist/onboard-helpers-DiSRTpZC.js +335 -0
- package/dist/onboard-helpers-DqZsjdb8.js +113 -0
- package/dist/onboard-hooks-pzEPZAvl.js +72 -0
- package/dist/onboard-remote-DFMLELsg.js +181 -0
- package/dist/onboard-remote-DmMYxY80.js +117 -0
- package/dist/onboard-search-B7FsNd7m.js +302 -0
- package/dist/onboard-skills-BJRdI-K3.js +133 -0
- package/dist/onboard-skills-Cg1YQAZa.js +117 -0
- package/dist/outbound-media-BHD4aJEX.d.ts +11 -0
- package/dist/outbound-media-CrraEXXv.js +11 -0
- package/dist/pairing-access-CzHpaM0R.d.ts +21 -0
- package/dist/pairing-cli-DSQTYgc0.js +217 -0
- package/dist/perplexity-CXwMDD3u.js +24 -0
- package/dist/persistent-dedupe-B9vrAf8t.d.ts +26 -0
- package/dist/pi-model-discovery-runtime-vSSbBDFG.js +111 -0
- package/dist/pi-tools.before-tool-call.runtime-C5yLUogH.js +381 -0
- package/dist/plugin-install-B1RfdrdV.js +117 -0
- package/dist/plugin-install-C9aaL42Y.js +184 -0
- package/dist/plugin-install-plan-BlfDt117.js +49 -0
- package/dist/plugin-registry-D2P9SYJ9.js +113 -0
- package/dist/plugin-registry-QtjVXmj3.js +49 -0
- package/dist/plugin-sdk/account-resolution.js +35 -35
- package/dist/plugin-sdk/acp-runtime.js +35 -35
- package/dist/plugin-sdk/agent-runtime.js +35 -35
- package/dist/plugin-sdk/bluebubbles.js +37 -37
- package/dist/plugin-sdk/channel-config-helpers.js +35 -35
- package/dist/plugin-sdk/channel-policy.js +35 -35
- package/dist/plugin-sdk/channel-runtime.js +35 -35
- package/dist/plugin-sdk/compat.js +36 -36
- package/dist/plugin-sdk/config-runtime.js +35 -35
- package/dist/plugin-sdk/conversation-runtime.js +35 -35
- package/dist/plugin-sdk/copilot-proxy.js +4 -4
- package/dist/plugin-sdk/core.js +4 -4
- package/dist/plugin-sdk/device-pair.js +4 -4
- package/dist/plugin-sdk/discord.js +35 -35
- package/dist/plugin-sdk/feishu.js +35 -35
- package/dist/plugin-sdk/gateway-runtime.js +10 -10
- package/dist/plugin-sdk/googlechat.js +37 -37
- package/dist/plugin-sdk/image-generation-runtime.js +35 -35
- package/dist/plugin-sdk/image-generation.js +35 -35
- package/dist/plugin-sdk/imessage.js +36 -36
- package/dist/plugin-sdk/index.js +35 -35
- package/dist/plugin-sdk/infra-runtime.js +35 -35
- package/dist/plugin-sdk/irc.js +37 -37
- package/dist/plugin-sdk/line.js +36 -36
- package/dist/plugin-sdk/llm-task.js +35 -35
- package/dist/plugin-sdk/lobster.js +4 -4
- package/dist/plugin-sdk/matrix.js +37 -37
- package/dist/plugin-sdk/mattermost.js +36 -36
- package/dist/plugin-sdk/media-runtime.js +35 -35
- package/dist/plugin-sdk/media-understanding-runtime.js +35 -35
- package/dist/plugin-sdk/media-understanding.js +35 -35
- package/dist/plugin-sdk/memory-lancedb.js +4 -4
- package/dist/plugin-sdk/minimax-portal-auth.js +4 -4
- package/dist/plugin-sdk/msteams.js +38 -38
- package/dist/plugin-sdk/nextcloud-talk.js +36 -36
- package/dist/plugin-sdk/nostr.js +36 -36
- package/dist/plugin-sdk/ollama-setup.js +9 -9
- package/dist/plugin-sdk/open-prose.js +4 -4
- package/dist/plugin-sdk/phone-control.js +4 -4
- package/dist/plugin-sdk/plugin-runtime.js +35 -35
- package/dist/plugin-sdk/provider-auth.js +35 -35
- package/dist/plugin-sdk/provider-models.js +5 -5
- package/dist/plugin-sdk/provider-onboard.js +4 -4
- package/dist/plugin-sdk/provider-setup.js +39 -39
- package/dist/plugin-sdk/provider-stream.js +4 -4
- package/dist/plugin-sdk/provider-usage.js +4 -4
- package/dist/plugin-sdk/qwen-portal-auth.js +35 -35
- package/dist/plugin-sdk/reply-history.js +35 -35
- package/dist/plugin-sdk/reply-runtime.js +35 -35
- package/dist/plugin-sdk/routing.js +3 -3
- package/dist/plugin-sdk/sandbox.js +35 -35
- package/dist/plugin-sdk/security-runtime.js +35 -35
- package/dist/plugin-sdk/self-hosted-provider-setup.js +37 -37
- package/dist/plugin-sdk/setup.js +35 -35
- package/dist/plugin-sdk/signal.js +35 -35
- package/dist/plugin-sdk/slack.js +35 -35
- package/dist/plugin-sdk/speech-runtime.js +35 -35
- package/dist/plugin-sdk/speech.js +35 -35
- package/dist/plugin-sdk/src/secrets/secure-file-store.d.ts +26 -0
- package/dist/plugin-sdk/src/subscription/provider.d.ts +5 -3
- package/dist/plugin-sdk/synology-chat.js +36 -36
- package/dist/plugin-sdk/talk-voice.js +4 -4
- package/dist/plugin-sdk/telegram.js +35 -35
- package/dist/plugin-sdk/text-runtime.js +7 -7
- package/dist/plugin-sdk/thread-ownership.js +4 -4
- package/dist/plugin-sdk/tlon.js +36 -36
- package/dist/plugin-sdk/twitch.js +35 -35
- package/dist/plugin-sdk/voice-call.js +35 -35
- package/dist/plugin-sdk/whatsapp.js +35 -35
- package/dist/plugin-sdk/zalo.js +38 -38
- package/dist/plugin-sdk/zalouser.js +38 -38
- package/dist/plugins/runtime/index.d.ts +1 -1
- package/dist/plugins/runtime/index.js +35 -35
- package/dist/plugins-CAULK-lt.js +111 -0
- package/dist/plugins-cli-BGAgYy3Z.js +917 -0
- package/dist/policy-WKZJ8cPK.js +143 -0
- package/dist/preflight-audio.runtime-Bc6Hv-u4.js +116 -0
- package/dist/probe-B7a_VBCB.js +47 -0
- package/dist/probe-BLioBOhT.js +6329 -0
- package/dist/probe-BkM5pykD.js +21 -0
- package/dist/probe-DOEaWez2.js +1793 -0
- package/dist/probe-DpcJ0WeP.js +129 -0
- package/dist/probe-auth-BcNjX8hy.js +40 -0
- package/dist/probe-auth-DhuAb8ls.js +48 -0
- package/dist/program-zG0CuBsn.js +253 -0
- package/dist/prompt-select-styled-B-D6NQFO.js +2673 -0
- package/dist/provider-api-key-auth.runtime-DgGM_pHf.js +121 -0
- package/dist/provider-auth-choice-BOQA0idb.js +126 -0
- package/dist/provider-auth-choice-helpers-hzDkh3f1.js +48 -0
- package/dist/provider-auth-choice-preference-BPcuoO9b.js +189 -0
- package/dist/provider-auth-choice.runtime-B4E0A4J8.js +123 -0
- package/dist/provider-auth-choices-0KaDNPBQ.js +57 -0
- package/dist/provider-auth-guidance-BxxMxMEt.js +34 -0
- package/dist/provider-auth-result-Bto1bYtS.d.ts +18 -0
- package/dist/provider-models-DxOmeToO.d.ts +867 -0
- package/dist/provider-models-xnyxy6mO.js +2113 -0
- package/dist/provider-ollama-setup-DBYK__ov.d.ts +32 -0
- package/dist/provider-ollama-setup-QzgCxj44.js +314 -0
- package/dist/provider-onboard-B9ionepI.js +139 -0
- package/dist/provider-onboard-CURxJ_UX.d.ts +40 -0
- package/dist/provider-runtime.runtime-DFAIaPZT.js +111 -0
- package/dist/provider-self-hosted-setup-CclMg3QB.js +182 -0
- package/dist/provider-self-hosted-setup-qeY8BYSy.d.ts +61 -0
- package/dist/provider-stream-Chz_EFw3.js +512 -0
- package/dist/provider-usage-Cn_OrdMP.js +111 -0
- package/dist/provider-usage-kxemdMp2.js +633 -0
- package/dist/provider-wizard-BMc1Dzks.js +152 -0
- package/dist/push-apns-CuIs_G0k.js +1038 -0
- package/dist/pw-ai-DUe4BbH2.js +1867 -0
- package/dist/qmd-manager-CAAFp7qK.js +1570 -0
- package/dist/qr-cli-9H9go9JE.js +113 -0
- package/dist/qr-cli-Bxxttvx3.js +369 -0
- package/dist/reactions-Dx2ypGlm.js +281 -0
- package/dist/read-only-account-inspect.discord.runtime-D_RVd1-r.js +116 -0
- package/dist/read-only-account-inspect.slack.runtime-Ckl92Rhy.js +116 -0
- package/dist/read-only-account-inspect.telegram.runtime-D97ssjQk.js +116 -0
- package/dist/redact-snapshot-ojhTflxp.js +2663 -0
- package/dist/register.agent-DlBmy_RL.js +439 -0
- package/dist/register.backup-8nOYtJqg.js +625 -0
- package/dist/register.configure-BV_GUQ5w.js +252 -0
- package/dist/register.maintenance-BafAHBum.js +574 -0
- package/dist/register.message-CHhfcEq2.js +709 -0
- package/dist/register.onboard-DjPNnlnr.js +192 -0
- package/dist/register.setup-BMGXI9PG.js +212 -0
- package/dist/register.status-health-sessions-BJMsh2AL.js +498 -0
- package/dist/register.subclis-B7nrik3-.js +315 -0
- package/dist/register.subclis-BCoAVyGn.js +13 -0
- package/dist/replies-BU4AvOyD.js +110 -0
- package/dist/resolve-channels-CDfj5NGq.js +226 -0
- package/dist/resolve-channels-Cz120Lvf.js +262 -0
- package/dist/resolve-route-DdX-HBVt.js +538 -0
- package/dist/resolve-users-Bc6nRqpb.js +143 -0
- package/dist/root-help-QAkoA7GD.js +32 -0
- package/dist/routes-CcJNnwTF.js +7097 -0
- package/dist/rpc-DDUAlBbH.js +67 -0
- package/dist/run-main-Cf8vXm6i.js +424 -0
- package/dist/runtime-Bitmi8Er.d.ts +26 -0
- package/dist/runtime-discord-ops.runtime-DWBnG-Hf.js +9078 -0
- package/dist/runtime-slack-ops.runtime-oYfbYvX4.js +4556 -0
- package/dist/runtime-telegram-ops.runtime-EPGDYN1f.js +133 -0
- package/dist/runtime-whatsapp-login.runtime-BGJoKM2h.js +114 -0
- package/dist/runtime-whatsapp-outbound.runtime-D3Sag6Bv.js +117 -0
- package/dist/sandbox-cli-waaYyhsC.js +535 -0
- package/dist/search-manager-BjDsOXzB.js +16 -0
- package/dist/search-manager-D-G9UaXe.js +386 -0
- package/dist/secrets-cli-BmeEhlzt.js +2070 -0
- package/dist/security-cli-CSsLnFuN.js +575 -0
- package/dist/send-6o7piqfv.js +100 -0
- package/dist/send-99FyFLgk.js +629 -0
- package/dist/send-B1pX9_Oc.js +283 -0
- package/dist/send-Dg5-AjXW.js +1025 -0
- package/dist/send-LdV9TRoN.js +631 -0
- package/dist/server-node-events-BAUUKNFW.js +506 -0
- package/dist/server-zI_K-D05.js +107 -0
- package/dist/sessions-DJGywtY2.js +112 -0
- package/dist/sessions-WR0GKdGl.js +218 -0
- package/dist/setup-2LvBON2J.js +387 -0
- package/dist/setup-CFIMq-Pz.d.ts +37 -0
- package/dist/setup-binary-CcAv8NXz.js +406 -0
- package/dist/setup-browser-C4eRV3h6.js +70 -0
- package/dist/setup-core-ByqF8Nvc.js +166 -0
- package/dist/setup-core-COkq8Zop.js +205 -0
- package/dist/setup-core-C_o77DVV.js +143 -0
- package/dist/setup-core-tAdHbqi9.js +47 -0
- package/dist/setup-surface-DMHtZByF.js +490 -0
- package/dist/setup-wizard-helpers-r0J6l8ST.d.ts +203 -0
- package/dist/setup.finalize-pTkXn8pV.js +522 -0
- package/dist/setup.gateway-config-D1wiUQe6.js +343 -0
- package/dist/shared-BaM_tMxk.js +102 -0
- package/dist/shared-BgUgXsM9.js +75 -0
- package/dist/shared-CezRuVfl.js +96 -0
- package/dist/shared-DQgf3R0B.js +298 -0
- package/dist/shared-RA6kxQfu.js +182 -0
- package/dist/signal-xxP4dGx7.js +114 -0
- package/dist/skills-Bio8GwTE.js +20 -0
- package/dist/skills-DE_MXFSN.js +853 -0
- package/dist/skills-cli-BGuW-tKw.js +292 -0
- package/dist/skills-install-BIlG41ei.js +763 -0
- package/dist/skills-status-B08PtBc_.js +21 -0
- package/dist/skills-status-CzM008aB.js +169 -0
- package/dist/slack-Bzt3M7d8.js +114 -0
- package/dist/slash-commands.runtime-EYqj8SbV.js +128 -0
- package/dist/slash-dispatch.runtime-vWH92PUY.js +141 -0
- package/dist/slash-skill-commands.runtime-sUTjM3J0.js +116 -0
- package/dist/src-Iso9-DPo.js +1701 -0
- package/dist/status-8S882KRO.js +43 -0
- package/dist/status-BF7h_jTB.js +126 -0
- package/dist/status-DxOIyRm9.js +131 -0
- package/dist/status-HlvixAOq.js +606 -0
- package/dist/status-json-CShBo8A6.js +288 -0
- package/dist/status-qhtgsJFd.js +1599 -0
- package/dist/status.link-channel-D3dLYZiH.js +143 -0
- package/dist/status.scan.deps.runtime-mCmOLzpG.js +126 -0
- package/dist/status.scan.runtime-CYuUlDeg.js +119 -0
- package/dist/status.summary-BjB1aTjV.js +592 -0
- package/dist/status.summary.runtime-DW4MOt1Z.js +118 -0
- package/dist/status.update-BxblMS7P.js +77 -0
- package/dist/subagent-orphan-recovery-CCVopsdP.js +307 -0
- package/dist/subagent-registry-runtime-oG47Fzvg.js +111 -0
- package/dist/subscription-CpFdxuFS.js +33 -0
- package/dist/subscription-DaA1urx-.js +102 -0
- package/dist/subscription-cli-Bvto9EmO.js +134 -0
- package/dist/synology-chat-CVy1tJGY.js +297 -0
- package/dist/system-cli-BvNps8sl.js +94 -0
- package/dist/telegram/audit.d.ts +1 -1
- package/dist/telegram/audit.js +1 -1
- package/dist/telegram/token.d.ts +1 -1
- package/dist/telegram/token.js +35 -35
- package/dist/telegram-Dug8pd82.js +114 -0
- package/dist/text-chunking-CQ6ttpWs.js +84 -0
- package/dist/text-chunking-DDUU_vAF.d.ts +79 -0
- package/dist/tlon-BnckVr_7.js +433 -0
- package/dist/tui-DXTge9Ac.js +3834 -0
- package/dist/tui-cli-BRUfLUTd.js +137 -0
- package/dist/types-2H_e7eWT.d.ts +45 -0
- package/dist/types-ZKnGUchG.d.ts +22692 -0
- package/dist/types.base-BFiQZ4J9.d.ts +188 -0
- package/dist/ui--iP08xRA.js +31 -0
- package/dist/update-CtxBD-Cf.js +1036 -0
- package/dist/update-cli-DPE3GCHJ.js +1503 -0
- package/dist/update-offset-store-BlBY7dWj.js +112 -0
- package/dist/update-runner-Cfcrhf2j.js +1496 -0
- package/dist/upsert-with-lock-BZU7Le8n.js +33 -0
- package/dist/usage-Czgwvg0h.js +115 -0
- package/dist/web-BGDXhunB.js +112 -0
- package/dist/web-shared-B5Q0mIJq.d.ts +45 -0
- package/dist/webhook-request-guards-CsKDhZJr.d.ts +76 -0
- package/dist/webhook-targets-CjxuEE9C.d.ts +106 -0
- package/dist/webhook-targets-Dtt6rH4N.js +181 -0
- package/dist/webhooks-cli-Wl9y6AWW.js +350 -0
- package/dist/whatsapp-D64cBQ_9.js +114 -0
- package/dist/whatsapp-actions-CVoTcagb.js +167 -0
- package/dist/workspace-DJ_S272u.js +484 -0
- package/dist/workspace-DbZSqjw0.js +289 -0
- package/dist/workspace-cli-D93DLmAh.js +154 -0
- package/dist/workspace-dirs-CGeIPpGN.js +2003 -0
- package/dist/zalo-CK2dlGmu.d.ts +9 -0
- package/dist/zalo-DxoY8M22.js +415 -0
- package/dist/zalouser-DTHIrPvs.js +30911 -0
- package/extensions/discord/src/monitor/allow-list.ts +8 -1
- package/extensions/discord/src/monitor/message-handler.preflight.ts +4 -1
- package/package.json +1 -1
- package/dist/accounts-CS8U4v8C.js +0 -114
- package/dist/accounts-gLr-Udmt.d.ts +0 -103
- package/dist/acp-cli-BGT0jXcC.js +0 -2093
- package/dist/actions.runtime-BfckTw6c.js +0 -119
- package/dist/actions.runtime-Cl9mBfqH.js +0 -133
- package/dist/agent-scope-C-YmLnnb.js +0 -208
- package/dist/agents-CydD54p8.js +0 -222
- package/dist/agents-DpQsZO6O.js +0 -853
- package/dist/agents.config-XU7IsYE-.js +0 -121
- package/dist/agents.config-ssoQXuvF.js +0 -17
- package/dist/allow-list-Cfn6lmMK.js +0 -81
- package/dist/allowlist-CCYXVpM9.js +0 -142
- package/dist/api-BoXoFKxy.js +0 -117
- package/dist/audit-Bv05N5o9.js +0 -787
- package/dist/audit-CIWW1Aqm.js +0 -54
- package/dist/audit-channel.collect.runtime-Bi7yrdcO.js +0 -605
- package/dist/audit-channel.runtime-C_NDweiW.js +0 -121
- package/dist/audit-extra.async-Dp7OKSXg.js +0 -813
- package/dist/audit-membership-runtime-B8FQ6VtN.js +0 -162
- package/dist/audit.deep.runtime-CXhobL6b.js +0 -25
- package/dist/audit.nondeep.runtime-CrEm3T16.js +0 -832
- package/dist/audit.runtime-CJPKj1Zg.js +0 -118
- package/dist/auth-Byfp0flq.js +0 -101
- package/dist/auth-choice-BgOjdeXN.js +0 -507
- package/dist/auth-choice-CD1Heq0M.js +0 -122
- package/dist/auth-choice-ePNfg0iQ.js +0 -268
- package/dist/auth-choice-options-BlewQWI0.js +0 -123
- package/dist/auth-choice-prompt-BP2b6aXz.js +0 -36
- package/dist/auth-choice-prompt-Cmwl4n97.js +0 -115
- package/dist/auth-choice.apply-helpers-Dq-nxuuX.js +0 -66
- package/dist/auth-choice.plugin-providers.runtime-B23kOUzQ.js +0 -119
- package/dist/auth-profiles-1kPLbBwI.js +0 -127823
- package/dist/auth-profiles.runtime-DAfSjku1.js +0 -116
- package/dist/banner-DeOsobLO.js +0 -342
- package/dist/bluebubbles-BsLGedBM.js +0 -64
- package/dist/bluebubbles-U2sAfO4_.d.ts +0 -6
- package/dist/bot-DW12K3bO.d.ts +0 -478
- package/dist/brave-BoWimrLe.js +0 -24
- package/dist/browser-cli-D_S3wEYE.js +0 -1494
- package/dist/call-ByEzDJ1_.js +0 -640
- package/dist/call-CHCWVg-O.js +0 -39
- package/dist/channel-3VC0oOMu.js +0 -214
- package/dist/channel-B9fCBPiS.js +0 -207
- package/dist/channel-B9q775cM.js +0 -562
- package/dist/channel-BG3UK54j.js +0 -803
- package/dist/channel-BRQAdMML.js +0 -352
- package/dist/channel-BmlLp933.js +0 -1321
- package/dist/channel-By6KvdTG.js +0 -920
- package/dist/channel-C8rRsdf6.js +0 -226
- package/dist/channel-CLEDBbXE.js +0 -943
- package/dist/channel-CMvBAG7o.js +0 -306
- package/dist/channel-CmlxxjHY.js +0 -1598
- package/dist/channel-CqG6_xN0.js +0 -949
- package/dist/channel-DNueHKs92.js +0 -316
- package/dist/channel-DUtyN7BX.js +0 -4681
- package/dist/channel-DWD6GrfZ.js +0 -538
- package/dist/channel-DaRYMYzj.js +0 -619
- package/dist/channel-Dj6BgLp8.js +0 -575
- package/dist/channel-account-context-Ba3u5D21.js +0 -103
- package/dist/channel-crabk6Em.js +0 -542
- package/dist/channel-i8uqQaK2.js +0 -497
- package/dist/channel-options-xljvwHS2.js +0 -50
- package/dist/channel-plugin-ids-DAgknSG4.js +0 -26
- package/dist/channel-summary-dHTMCG75.js +0 -111
- package/dist/channel-xVWQ96Ni.js +0 -397
- package/dist/channel.runtime-B6PoZ4BV.js +0 -182
- package/dist/channel.runtime-BPZmo57e.js +0 -404
- package/dist/channel.runtime-B_1uGR-U.js +0 -199
- package/dist/channel.runtime-BiXnPU0d.js +0 -218
- package/dist/channel.runtime-BpvDc9sv.js +0 -870
- package/dist/channel.runtime-CUua3W80.js +0 -418
- package/dist/channel.runtime-CaCBTd0A.js +0 -179
- package/dist/channel.runtime-D0FfYvUj.js +0 -4011
- package/dist/channel.runtime-DhoJtpvJ.js +0 -241
- package/dist/channel.runtime-Kj9EXNE0.js +0 -127
- package/dist/channel.runtime-r4tPuPyh.js +0 -171
- package/dist/channel.setup-B7d_grfe.js +0 -6
- package/dist/channel.setup-C0vu1fhi.js +0 -9
- package/dist/channel.setup-CAI0FNHj.js +0 -11
- package/dist/channel.setup-CkDVwv5R.js +0 -57
- package/dist/channel.setup-Cpd00YqQ.js +0 -8
- package/dist/channel.setup-DbBz1-WT.js +0 -9
- package/dist/channel.setup-GZnAvD9g.js +0 -8
- package/dist/channels-5H484RSw.js +0 -1118
- package/dist/channels-BnPudfyx.js +0 -404
- package/dist/channels-cli-WIC-QeH_.js +0 -291
- package/dist/channels-status-issues-RDmzovJU.js +0 -16
- package/dist/clawbot-cli-BgutNwf8.js +0 -118
- package/dist/cleanup-utils-DBl1Aij1.js +0 -96
- package/dist/cli-1P7u6zqu.js +0 -154
- package/dist/command-registry-B8jovrws.js +0 -232
- package/dist/command-registry-DtDl1FVm.js +0 -14
- package/dist/command-secret-gateway-BgUo3FxJ.js +0 -111
- package/dist/compact.runtime-CXbXM0AU.js +0 -116
- package/dist/completion-cli-Cik_owAE.js +0 -17
- package/dist/completion-cli-RU3P2RSl.js +0 -445
- package/dist/config-5HUpB1L1.js +0 -31
- package/dist/config-cli-QHaUHoZI.js +0 -433
- package/dist/config-guard-C9Sn3pE-.js +0 -118
- package/dist/config-sW57gztj.js +0 -44
- package/dist/config-validation-5LkjIKNt.js +0 -262
- package/dist/config-value-CtTWALxG.js +0 -132
- package/dist/configure-BmR2TPLf.js +0 -243
- package/dist/configure-DaLN-5xM.js +0 -1100
- package/dist/control-ui-assets-CH3MYmAo.js +0 -232
- package/dist/control-ui-shared-CA77PTml.js +0 -29
- package/dist/core-CvDzLs7B.js +0 -150
- package/dist/core-dPA4nFkn.d.ts +0 -87
- package/dist/cron-cli-tguLpzyq.js +0 -639
- package/dist/daemon-cli-ptosOkL8.js +0 -339
- package/dist/daemon-install-DzU4EnVa.js +0 -180
- package/dist/deliver-DwxFoHM3.js +0 -111
- package/dist/deliver-runtime-DOdDyaPI.js +0 -111
- package/dist/device-id-cli-GopvlxxZ.js +0 -52
- package/dist/device-identity-CRfhC3_s.js +0 -365
- package/dist/devices-cli-ain7ESqU.js +0 -342
- package/dist/diagnostic-D96Xaqrj.js +0 -310
- package/dist/directory-cli-fh1UxGgY.js +0 -311
- package/dist/directory-config-helpers-CpU1oflo.d.ts +0 -38
- package/dist/directory.static-CKjJUNGl.js +0 -44
- package/dist/discord-CflhwDEM.js +0 -114
- package/dist/discovery-x0ZqY4AB.js +0 -48
- package/dist/dm-policy-shared-73A52W6E.d.ts +0 -95
- package/dist/dns-cli-DCHyKjGf.js +0 -217
- package/dist/docs-cli-D3OoqYSP.js +0 -174
- package/dist/doctor-completion-Bq2eP87s.js +0 -90
- package/dist/doctor-config-flow-D8XRG9Ku.js +0 -2437
- package/dist/doctor-config-flow-DGiF1HGc.js +0 -112
- package/dist/enable-0QSF4YGH.js +0 -24
- package/dist/exec-approvals-cli-Bncym0Gd.js +0 -421
- package/dist/feishu-B5JDcyF9.d.ts +0 -36
- package/dist/gateway-cli-DYscsmA-.js +0 -26437
- package/dist/gateway-install-token-CNv17ac9.js +0 -163
- package/dist/gateway-rpc-BGC1Rxvg.js +0 -26
- package/dist/gateway-runtime-D89mSQPB.js +0 -69
- package/dist/git-commit-CeLH5Ozm.js +0 -2
- package/dist/git-commit-DUKRiCP-.js +0 -177
- package/dist/googlechat-BgXeXjd1.js +0 -307
- package/dist/googlechat-De-T7C31.d.ts +0 -12
- package/dist/group-access-Deh1tVNr.d.ts +0 -61
- package/dist/health-BEjzWwaB.js +0 -570
- package/dist/health-FjqrWQL6.js +0 -113
- package/dist/heartbeat-summary-CfdSA9M1.js +0 -57
- package/dist/help-BZeVprq1.js +0 -81
- package/dist/hooks-B5pYs_d7.d.ts +0 -6
- package/dist/hooks-cli-B7uGJs2O.js +0 -1000
- package/dist/hooks-status-CfceaUSg.js +0 -78
- package/dist/http-registry-C-KXqwnj.d.ts +0 -20
- package/dist/identity-file-sshkKKIr.js +0 -60
- package/dist/image-generation-CafM5hZh.d.ts +0 -9
- package/dist/imessage-BcV3WGx_.js +0 -31
- package/dist/imessage-Dhje7Ty-.js +0 -115
- package/dist/inbound-reply-dispatch-C73_7SOl.js +0 -71
- package/dist/inbound-reply-dispatch-DmL0KWLe.d.ts +0 -72
- package/dist/install-target-D7NRhfzc.js +0 -574
- package/dist/installs-Bj6jblqc.js +0 -532
- package/dist/io-CMfWWPXQ.js +0 -9738
- package/dist/io-CV844hAM.js +0 -29
- package/dist/irc-DKi1fDYI.js +0 -672
- package/dist/library-rygTG3oA.js +0 -112
- package/dist/lifecycle-core-BPlvShWY.js +0 -382
- package/dist/line-CGsemKWJ.js +0 -530
- package/dist/line-CKU3ER-n.d.ts +0 -75
- package/dist/llm-slug-generator-DlhVyMqT.js +0 -67
- package/dist/logging-5wu9k6w4.js +0 -30
- package/dist/logging-CxP9suT8.js +0 -13
- package/dist/login-qr-BcDsiwHs.js +0 -233
- package/dist/login-qr-Y8pJ5yV4.js +0 -112
- package/dist/logs-cli-XI9oVXpH.js +0 -256
- package/dist/manager-runtime-DkIlXBhD.js +0 -111
- package/dist/manager.runtime-Q0q2rJCC.js +0 -715
- package/dist/manifest-registry-DAd0SRAP.js +0 -1329
- package/dist/matrix-BI0DBBrG.js +0 -1495
- package/dist/matrix-DiABGjJR.js +0 -1269
- package/dist/matrix-fC6NrFM5.d.ts +0 -68
- package/dist/mcp-cli-BOyn_DLL.js +0 -87
- package/dist/media-understanding.runtime-DjUa7Dka.js +0 -116
- package/dist/memory-cli-CJd_vl-Y.js +0 -111
- package/dist/memory-search-CEEItIFR.js +0 -17
- package/dist/memory-search-Cv1SBrn7.js +0 -204
- package/dist/method-scopes-CQE7-bZ-.js +0 -2452
- package/dist/model-auth-markers-B1bbs9Qd.d.ts +0 -20
- package/dist/model-picker-D6_89XHg.js +0 -112
- package/dist/model-picker-Svaw-APs.js +0 -390
- package/dist/model-picker.runtime-Chi9nV7A.js +0 -125
- package/dist/model-selection-hL8i1Jbs.js +0 -653
- package/dist/model-suppression.runtime-DjWJZ0X-.js +0 -116
- package/dist/models-7qj1dG_W.js +0 -118
- package/dist/models-BPOB_xJF.js +0 -2514
- package/dist/models-cli-DdlOVUjS.js +0 -309
- package/dist/models-config-CBqUS-jX.js +0 -111
- package/dist/models-config.providers.discovery-BKB5JH9M.d.ts +0 -18
- package/dist/moldclaw-root-D6PbhbZk.js +0 -88
- package/dist/monitor-BPYhkEqF.js +0 -782
- package/dist/monitor-BuTcQ24j.js +0 -3468
- package/dist/monitor-CuXvNhFh.js +0 -113
- package/dist/monitor-D-TqSIHF.js +0 -6823
- package/dist/monitor-DRSgo9u2.js +0 -3076
- package/dist/monitor-DcHch39z.js +0 -772
- package/dist/monitor-DsHBMrXp.js +0 -115
- package/dist/monitor-shared-CL8T4gt1.js +0 -444
- package/dist/msteams-7FMwTvQG.js +0 -852
- package/dist/node-cli-BCjaSCZM.js +0 -2503
- package/dist/node-resolve-D5Hvcgyx.js +0 -835
- package/dist/nodes-cli-Dd_SNbkt.js +0 -1380
- package/dist/nostr-D8scBiYq.d.ts +0 -7
- package/dist/nostr-DBTFTxKs.js +0 -8744
- package/dist/npm-resolution-CYfb3MHG.js +0 -60
- package/dist/oauth-env-zPt5RywA.js +0 -10
- package/dist/onboard-BEFQQeig.js +0 -25
- package/dist/onboard-CJHNyxJh.js +0 -48
- package/dist/onboard-D_3UeLEN.js +0 -589
- package/dist/onboard-channels-B_JL0Djc.js +0 -1241
- package/dist/onboard-channels-CqZzHt2C.js +0 -205
- package/dist/onboard-custom-CER3Ggbq.js +0 -571
- package/dist/onboard-custom-bNRdGECb.js +0 -114
- package/dist/onboard-helpers-BK0Hsb7Y.js +0 -335
- package/dist/onboard-helpers-CXZ5RPoR.js +0 -113
- package/dist/onboard-hooks-1NsxEDjH.js +0 -72
- package/dist/onboard-remote-DuKhC_7W.js +0 -117
- package/dist/onboard-remote-OwRcDuB3.js +0 -181
- package/dist/onboard-search-Cy8dOq2W.js +0 -302
- package/dist/onboard-skills-D5phRa6r.js +0 -117
- package/dist/onboard-skills-c9qWCNe9.js +0 -133
- package/dist/outbound-media-CgNYEQWb.d.ts +0 -11
- package/dist/outbound-media-DYRO2vTD.js +0 -11
- package/dist/pairing-access-Dsiu5Mvl.d.ts +0 -21
- package/dist/pairing-cli-BOnv0TYn.js +0 -217
- package/dist/perplexity-EZwC3y2b.js +0 -24
- package/dist/persistent-dedupe-DMLOqJ23.d.ts +0 -26
- package/dist/pi-model-discovery-runtime-BToY3A6K.js +0 -111
- package/dist/pi-tools.before-tool-call.runtime-D_acPtld.js +0 -381
- package/dist/plugin-install-CgJpSjYd.js +0 -184
- package/dist/plugin-install-Cl1A4EF6.js +0 -117
- package/dist/plugin-install-plan-Dc2Z4DeU.js +0 -49
- package/dist/plugin-registry-B1UaWrQD.js +0 -49
- package/dist/plugin-registry-Cy8biwnn.js +0 -113
- package/dist/plugins-CXwvg50F.js +0 -111
- package/dist/plugins-cli-Uvzp2aYV.js +0 -917
- package/dist/policy-DsMBbEe7.js +0 -143
- package/dist/preflight-audio.runtime-hWsZIYvc.js +0 -116
- package/dist/probe-CNsSf1Uf.js +0 -6329
- package/dist/probe-CqOIrPhb.js +0 -47
- package/dist/probe-DH6gDw-h.js +0 -129
- package/dist/probe-DM16PLf4.js +0 -21
- package/dist/probe-DvAEEWYr.js +0 -1793
- package/dist/probe-auth-COfgCble.js +0 -48
- package/dist/probe-auth-I_5TX1Eh.js +0 -40
- package/dist/program-Dz80sgTU.js +0 -253
- package/dist/prompt-select-styled-wQehwFxK.js +0 -2673
- package/dist/provider-api-key-auth.runtime-BR9GU4ya.js +0 -121
- package/dist/provider-auth-choice-CdhA84kr.js +0 -126
- package/dist/provider-auth-choice-helpers-kabp_0zA.js +0 -48
- package/dist/provider-auth-choice-preference-se3zAM_2.js +0 -189
- package/dist/provider-auth-choice.runtime-BMc8-xNQ.js +0 -123
- package/dist/provider-auth-choices-CYsCViGi.js +0 -57
- package/dist/provider-auth-guidance-CMjUWlNf.js +0 -34
- package/dist/provider-auth-result-Cw6qIhO-.d.ts +0 -18
- package/dist/provider-models-BCId_Lfu.js +0 -2113
- package/dist/provider-models-Ok-DrSiY.d.ts +0 -867
- package/dist/provider-ollama-setup-B6XJZ0So.js +0 -314
- package/dist/provider-ollama-setup-lGDdTl0b.d.ts +0 -32
- package/dist/provider-onboard-CSPi7jOK.d.ts +0 -40
- package/dist/provider-onboard-Ca0TaNud.js +0 -139
- package/dist/provider-runtime.runtime-DwwkHw_7.js +0 -111
- package/dist/provider-self-hosted-setup-BEKLVGpj.js +0 -182
- package/dist/provider-self-hosted-setup-Df91By-J.d.ts +0 -61
- package/dist/provider-stream-DrUD69ai.js +0 -512
- package/dist/provider-usage-BgKHCnjr.js +0 -111
- package/dist/provider-usage-D8EZpFz9.js +0 -633
- package/dist/provider-wizard-DMdb-zj_.js +0 -152
- package/dist/push-apns-BPH6d4VV.js +0 -1038
- package/dist/pw-ai-DttfldtL.js +0 -1867
- package/dist/qmd-manager-CybcDUfk.js +0 -1570
- package/dist/qr-cli-8NcmJ8Ft.js +0 -369
- package/dist/qr-cli-DWe0Our3.js +0 -113
- package/dist/reactions-D6N0LR16.js +0 -281
- package/dist/read-only-account-inspect.discord.runtime-CqUWTRfl.js +0 -116
- package/dist/read-only-account-inspect.slack.runtime-9-jpln3q.js +0 -116
- package/dist/read-only-account-inspect.telegram.runtime-EKPI1D7n.js +0 -116
- package/dist/redact-snapshot-DwJEIVk9.js +0 -2663
- package/dist/register.agent-D3YdDirP.js +0 -439
- package/dist/register.backup-dR27qCuo.js +0 -625
- package/dist/register.configure-BjFhkkka.js +0 -252
- package/dist/register.maintenance-DiMQJIOa.js +0 -574
- package/dist/register.message-CdZsKYH1.js +0 -709
- package/dist/register.onboard-B0rV1eaO.js +0 -192
- package/dist/register.setup-wKMvohzo.js +0 -212
- package/dist/register.status-health-sessions-BJ68m6pt.js +0 -498
- package/dist/register.subclis-CnnrWt2a.js +0 -315
- package/dist/register.subclis-lSvTkC6z.js +0 -13
- package/dist/replies-BABt9b48.js +0 -110
- package/dist/resolve-channels-BqZFl2Ux.js +0 -262
- package/dist/resolve-channels-DjQLXb7B.js +0 -226
- package/dist/resolve-route-CSHDsa_m.js +0 -538
- package/dist/resolve-users-BG6HaSR5.js +0 -143
- package/dist/root-help-ohmaCyC_.js +0 -32
- package/dist/routes-4k2kpvoT.js +0 -7097
- package/dist/rpc-Cnwn4Q6L.js +0 -67
- package/dist/run-main-VYlacKA0.js +0 -424
- package/dist/runtime-D61jzMiI.d.ts +0 -26
- package/dist/runtime-discord-ops.runtime-DafrU-rI.js +0 -9078
- package/dist/runtime-slack-ops.runtime-CdXBKXwd.js +0 -4556
- package/dist/runtime-telegram-ops.runtime-B12sF7gE.js +0 -133
- package/dist/runtime-whatsapp-login.runtime-CqEudH37.js +0 -114
- package/dist/runtime-whatsapp-outbound.runtime-D5m2qyn-.js +0 -117
- package/dist/sandbox-cli-CHJiEWXB.js +0 -535
- package/dist/search-manager-BtNC3-i_.js +0 -16
- package/dist/search-manager-C7J7B3_a.js +0 -386
- package/dist/secrets-cli-C6yIWBbN.js +0 -2070
- package/dist/security-cli-BVu9BkjD.js +0 -575
- package/dist/send-BSreC7rr.js +0 -631
- package/dist/send-BsLHQG_B.js +0 -1025
- package/dist/send-BuNhp8PH.js +0 -283
- package/dist/send-DOCswVar.js +0 -100
- package/dist/send-Dl0LLErk.js +0 -629
- package/dist/server-node-events-Bq2067EG.js +0 -506
- package/dist/server-y38L7N5H.js +0 -107
- package/dist/sessions-BV8gXURR.js +0 -112
- package/dist/sessions-dl1Kc-Ci.js +0 -218
- package/dist/setup-BSPXdMuK.d.ts +0 -37
- package/dist/setup-DGszQH0_.js +0 -387
- package/dist/setup-binary-C17YnmA8.js +0 -406
- package/dist/setup-browser-CPx-nEsr.js +0 -70
- package/dist/setup-core-BByHN1ME.js +0 -143
- package/dist/setup-core-C0KPlBmL.js +0 -47
- package/dist/setup-core-Cq37G6of.js +0 -166
- package/dist/setup-core-uO84_Y75.js +0 -205
- package/dist/setup-surface-BEMi7Rmb.js +0 -490
- package/dist/setup-wizard-helpers-Ck9wDR0b.d.ts +0 -203
- package/dist/setup.finalize-BzPBa8zW.js +0 -522
- package/dist/setup.gateway-config-DdwkF-8e.js +0 -343
- package/dist/shared-BCw4SKjB.js +0 -96
- package/dist/shared-CjNzsULP.js +0 -75
- package/dist/shared-Cu1BE7ZE.js +0 -298
- package/dist/shared-DSClmyUn.js +0 -182
- package/dist/shared-DyJdGH6y.js +0 -102
- package/dist/signal-Dyv4NZsB.js +0 -114
- package/dist/skills-CbB5b27M.js +0 -853
- package/dist/skills-CnfI7Szw.js +0 -20
- package/dist/skills-cli-CavB1f_3.js +0 -292
- package/dist/skills-install-B1OBdgd0.js +0 -763
- package/dist/skills-status-B3gAmIbW.js +0 -169
- package/dist/skills-status-DrHhFgU9.js +0 -21
- package/dist/slack-BRzqnoAz.js +0 -114
- package/dist/slash-commands.runtime-BK88kgds.js +0 -128
- package/dist/slash-dispatch.runtime-COGywwJE.js +0 -141
- package/dist/slash-skill-commands.runtime-Ti4brxgh.js +0 -116
- package/dist/src-DUR6OQxI.js +0 -1701
- package/dist/status-C6dgQY9a.js +0 -131
- package/dist/status-CNK0Q7QH.js +0 -606
- package/dist/status-DBcX0DSC.js +0 -43
- package/dist/status-DKgFgbwv.js +0 -1599
- package/dist/status-Wn5lhNAc.js +0 -126
- package/dist/status-json-D2EkWqAl.js +0 -288
- package/dist/status.link-channel-D3ULIdEa.js +0 -143
- package/dist/status.scan.deps.runtime-BsjWTAm4.js +0 -126
- package/dist/status.scan.runtime-D4HbzROD.js +0 -119
- package/dist/status.summary-C3YxPrDK.js +0 -592
- package/dist/status.summary.runtime-DAkXPSaK.js +0 -118
- package/dist/status.update-B4NnN9P1.js +0 -77
- package/dist/subagent-orphan-recovery-QiQEBv36.js +0 -307
- package/dist/subagent-registry-runtime-BJatPQFK.js +0 -111
- package/dist/subscription-BhZORXN9.js +0 -100
- package/dist/subscription-QEUjQRMv.js +0 -33
- package/dist/subscription-cli-HrULlAgc.js +0 -134
- package/dist/synology-chat-DB76GWMN.js +0 -297
- package/dist/system-cli-D8jDwWuL.js +0 -94
- package/dist/telegram-BHiiqKkQ.js +0 -114
- package/dist/text-chunking-Baonm9Lu.js +0 -84
- package/dist/text-chunking-DzB11ONk.d.ts +0 -79
- package/dist/tlon-DLESxNgD.js +0 -433
- package/dist/tui-C75zi2Cl.js +0 -3834
- package/dist/tui-cli-DFwx5e6i.js +0 -137
- package/dist/types-BKldC9YN.d.ts +0 -22692
- package/dist/types-MeyueBE0.d.ts +0 -45
- package/dist/types.base-Cw0-zIvE.d.ts +0 -188
- package/dist/ui-B55NOIB6.js +0 -31
- package/dist/update--ojavYQ4.js +0 -1036
- package/dist/update-cli-Cvj5aWYM.js +0 -1503
- package/dist/update-offset-store-upatuWwX.js +0 -112
- package/dist/update-runner-DHkY_-76.js +0 -1496
- package/dist/upsert-with-lock-C171GLaR.js +0 -33
- package/dist/usage-N3bxnbmt.js +0 -115
- package/dist/web-RdvT7gKa.js +0 -112
- package/dist/web-shared-C2qHVxw1.d.ts +0 -45
- package/dist/webhook-request-guards-CosLyl01.d.ts +0 -76
- package/dist/webhook-targets-Bfnag-du.js +0 -181
- package/dist/webhook-targets-DP_EkQa4.d.ts +0 -106
- package/dist/webhooks-cli-ZpnXrq7G.js +0 -350
- package/dist/whatsapp-DNTAyZHt.js +0 -114
- package/dist/whatsapp-actions-o1zKQzKZ.js +0 -167
- package/dist/workspace-CpWi5wPr.js +0 -479
- package/dist/workspace-Ii7aRS7c.js +0 -289
- package/dist/workspace-dirs-x10McA9t.js +0 -2003
- package/dist/zalo-C9OQRYRw.d.ts +0 -9
- package/dist/zalo-zm_bYCKg.js +0 -415
- package/dist/zalouser-CvVEUvc5.js +0 -30911
- /package/dist/{account-id-B3YSn4hl.d.ts → account-id-B8ce6G_4.d.ts} +0 -0
- /package/dist/{acpx-CnNv70m2.d.ts → acpx-Ci50I9T2.d.ts} +0 -0
- /package/dist/{agent-media-payload-DE2pEcsz.d.ts → agent-media-payload-en-gS5p6.d.ts} +0 -0
- /package/dist/{allow-from-DPpHnT2A.d.ts → allow-from-cMeQ47Ot.d.ts} +0 -0
- /package/dist/{allowlist-resolution-CLFiZ6nE.d.ts → allowlist-resolution-DoAWbfXV.d.ts} +0 -0
- /package/dist/{bluebubbles-Duhu-Jer.d.ts → bluebubbles-C6yYmUl0.d.ts} +0 -0
- /package/dist/{boolean-param-BhFjB3gp.d.ts → boolean-param-CdO2TFTk.d.ts} +0 -0
- /package/dist/{channel-config-schema-DnnVMdjR.d.ts → channel-config-schema-Chp38wel.d.ts} +0 -0
- /package/dist/{channel-policy-Baq-Z06b.d.ts → channel-policy-g2h6AbYQ.d.ts} +0 -0
- /package/dist/{chat-type-DpiBgwuG.d.ts → chat-type-BLt59pPT.d.ts} +0 -0
- /package/dist/{command-format-vi4xq8e8.d.ts → command-format-BDJC05Jp.d.ts} +0 -0
- /package/dist/{diffs-DK7fVSDo.d.ts → diffs-D_iNKCyn.d.ts} +0 -0
- /package/dist/{directory-runtime-BTLPaysA.d.ts → directory-runtime-DhMex6HY.d.ts} +0 -0
- /package/dist/{exec-C01wtBHu.d.ts → exec-pjfUY4KM.d.ts} +0 -0
- /package/dist/{gaxios-fetch-compat-wZ38b3w3.js → gaxios-fetch-compat-B_vtINdV.js} +0 -0
- /package/dist/{history-CwXuP2TW.d.ts → history-aqSS5VGQ.d.ts} +0 -0
- /package/dist/{inbound-envelope-SggrBs9m.d.ts → inbound-envelope-C5hWuZod.d.ts} +0 -0
- /package/dist/{index-apAZHsDo.d.ts → index-DXVQFYGX.d.ts} +0 -0
- /package/dist/{json-store-r75IZGk9.d.ts → json-store-UnqQ5aV3.d.ts} +0 -0
- /package/dist/{keyed-async-queue-DHIr7yNe.d.ts → keyed-async-queue-guucpLw3.d.ts} +0 -0
- /package/dist/{links-HeQ3r_L0.d.ts → links-Bar0meEK.d.ts} +0 -0
- /package/dist/{markdown-to-line-CDb4Jy3V.d.ts → markdown-to-line-D8uH_KOj.d.ts} +0 -0
- /package/dist/{mattermost-DtCsxpgg.d.ts → mattermost-xl7jAFJL.d.ts} +0 -0
- /package/dist/{net-BATPDwdQ.d.ts → net-rGOKGds6.d.ts} +0 -0
- /package/dist/{nextcloud-talk-Bb2wHOwp.d.ts → nextcloud-talk-De2CZ9dV.d.ts} +0 -0
- /package/dist/{oauth-utils-u567CLT0.d.ts → oauth-utils-DzN1AlEH.d.ts} +0 -0
- /package/dist/{parse-finite-number-l3tNlrZh.d.ts → parse-finite-number-odgyqhi0.d.ts} +0 -0
- /package/dist/{provider-usage.types-C6061OVN.d.ts → provider-usage.types-EDE9o-H_.d.ts} +0 -0
- /package/dist/{reply-history-BDsFnZFl.d.ts → reply-history-CVuU31xe.d.ts} +0 -0
- /package/dist/{reply-payload-CCvM4W9u.d.ts → reply-payload-CHkpBYwL.d.ts} +0 -0
- /package/dist/{request-url-C54l4-xC.d.ts → request-url-DHisbiHY.d.ts} +0 -0
- /package/dist/{run-command-D3RqWcHu.d.ts → run-command-y0Cndsb1.d.ts} +0 -0
- /package/dist/{secret-input-schema-BLBt-NAP.d.ts → secret-input-schema-b1vpYDQN.d.ts} +0 -0
- /package/dist/{session-key-BQ2-bR-9.d.ts → session-key-DTHQl57f.d.ts} +0 -0
- /package/dist/{ssh-config-C4mcH9Ly.js → ssh-config-hEHBfU2_.js} +0 -0
- /package/dist/{testing-DLkhGsoz.d.ts → testing-DszuZXgK.d.ts} +0 -0
- /package/dist/{thinking-DRkjX18p.d.ts → thinking-IwXTGSeT.d.ts} +0 -0
- /package/dist/{tool-send-CMMD1uDu.d.ts → tool-send-DWHRmKpz.d.ts} +0 -0
- /package/dist/{vllm-defaults-CcGuf4hL.d.ts → vllm-defaults-CrxZgE6-.d.ts} +0 -0
- /package/dist/{wait-Daog8bxM.d.ts → wait-wDWw_MTI.d.ts} +0 -0
- /package/dist/{webhook-memory-guards-C5MrExwT.d.ts → webhook-memory-guards-DreORuJy.d.ts} +0 -0
- /package/dist/{windows-spawn-j2l-dqu8.d.ts → windows-spawn-BIzH92x2.d.ts} +0 -0
- /package/dist/{zod-schema.agent-runtime-krMrBnIn.d.ts → zod-schema.agent-runtime-CP2rmis3.d.ts} +0 -0
- /package/dist/{zod-schema.core-BNDieZDZ.d.ts → zod-schema.core-Foi1tYwi.d.ts} +0 -0
package/dist/src-DUR6OQxI.js
DELETED
|
@@ -1,1701 +0,0 @@
|
|
|
1
|
-
import "./redact-fatrROh9.js";
|
|
2
|
-
import "./errors-DOJWZqNo.js";
|
|
3
|
-
import "./unhandled-rejections-CTvNvnT0.js";
|
|
4
|
-
import "./logger-BFfIIIKH.js";
|
|
5
|
-
import "./paths-D6AgsMTU.js";
|
|
6
|
-
import "./tmp-moldclaw-dir-DWF-d8qD.js";
|
|
7
|
-
import "./theme-BSXzMzAA.js";
|
|
8
|
-
import "./globals-DESrFYmC.js";
|
|
9
|
-
import "./runtime-_tQz41uA.js";
|
|
10
|
-
import "./ansi-BPhP6LBZ.js";
|
|
11
|
-
import "./subsystem-CPmDTJ2P.js";
|
|
12
|
-
import "./boolean-B6zcAynR.js";
|
|
13
|
-
import "./env-D42cffog.js";
|
|
14
|
-
import "./warning-filter-B1UOeM0G.js";
|
|
15
|
-
import "./utils-C7ykRPCQ.js";
|
|
16
|
-
import "./links-BcahUP5U.js";
|
|
17
|
-
import "./setup-binary-C17YnmA8.js";
|
|
18
|
-
import { $w as formatAllowlistMatchMeta, Ah as createScopedPairingAccess, At as buildMediaPayload, Nd as resolveDmGroupAccessWithLists, Pd as resolveEffectiveAllowFromLists, Qg as buildPendingHistoryContextFromMap, Ug as logInboundDrop, Wg as logTypingFailure, Ww as resolveDualTextControlCommandGate, ag as createTypingCallbacks, e_ as clearHistoryEntriesIfEnabled, hS as DEFAULT_WEBHOOK_MAX_BODY_BYTES, hs as resolveInboundSessionEnvelopeContext, kd as readStoreAllowFromForDmPolicy, nh as resolveChannelMediaMaxBytes, r_ as recordPendingHistoryEntryIfEnabled, sT as mergeAllowlist, sg as createReplyPrefixOptions, tC as isDangerousNameMatchingEnabled, uT as summarizeMapping, ys as resolveMentionGating } from "./auth-profiles-1kPLbBwI.js";
|
|
19
|
-
import "./model-selection-hL8i1Jbs.js";
|
|
20
|
-
import "./agent-scope-C-YmLnnb.js";
|
|
21
|
-
import { t as DEFAULT_ACCOUNT_ID } from "./account-id-BuyZMNja.js";
|
|
22
|
-
import "./boundary-file-read-tPYh_8fH.js";
|
|
23
|
-
import "./logger-BGzLUitz.js";
|
|
24
|
-
import "./exec-CvEtXqTZ.js";
|
|
25
|
-
import "./workspace-CpWi5wPr.js";
|
|
26
|
-
import "./io-CMfWWPXQ.js";
|
|
27
|
-
import "./host-env-security-DQ2i_W12.js";
|
|
28
|
-
import "./safe-text-Cnulee_z.js";
|
|
29
|
-
import "./version-T8nMYUnU.js";
|
|
30
|
-
import "./env-substitution-68cyvF5h.js";
|
|
31
|
-
import "./config-state-h5jUoHya.js";
|
|
32
|
-
import "./network-mode-BtWXzwYn.js";
|
|
33
|
-
import "./registry-C1pRrsQl.js";
|
|
34
|
-
import "./manifest-registry-DAd0SRAP.js";
|
|
35
|
-
import "./ip-C4YAIpr4.js";
|
|
36
|
-
import "./zod-schema.core-DvwgNmpd.js";
|
|
37
|
-
import "./config-sW57gztj.js";
|
|
38
|
-
import "./audit-fs-CMb-YUHX.js";
|
|
39
|
-
import "./resolve-PSlwZjg3.js";
|
|
40
|
-
import { J as fetchWithSsrFGuard } from "./provider-web-search-CcUC9ktE.js";
|
|
41
|
-
import "./text-runtime-Cfq-Uyx0.js";
|
|
42
|
-
import "./workspace-dirs-x10McA9t.js";
|
|
43
|
-
import "./config-BwkGZjD5.js";
|
|
44
|
-
import "./tailnet-fFTz5Twr.js";
|
|
45
|
-
import "./net-K181nxTH.js";
|
|
46
|
-
import "./credentials-D-5Pb-aZ.js";
|
|
47
|
-
import "./routes-4k2kpvoT.js";
|
|
48
|
-
import "./frontmatter-Cgg0ICvh.js";
|
|
49
|
-
import "./env-overrides-DBQl3LRc.js";
|
|
50
|
-
import "./path-alias-guards-BtSO7sk7.js";
|
|
51
|
-
import "./skills-CbB5b27M.js";
|
|
52
|
-
import "./ports-Ca74cFb2.js";
|
|
53
|
-
import "./ports-lsof-CoiADo0p.js";
|
|
54
|
-
import "./ssh-tunnel-DsY-9yao.js";
|
|
55
|
-
import "./image-ops-Ck_D_vpe.js";
|
|
56
|
-
import "./fs-safe-CRXFoBmh.js";
|
|
57
|
-
import "./mime-DGFQe4XX.js";
|
|
58
|
-
import "./server-middleware-Djfoa1s0.js";
|
|
59
|
-
import "./message-channel-DFE4FuE_.js";
|
|
60
|
-
import "./resolve-route-CSHDsa_m.js";
|
|
61
|
-
import "./internal-hooks-83AcmxP3.js";
|
|
62
|
-
import { a as resolveSenderScopedGroupPolicy, i as evaluateSenderGroupAccessForPolicy, l as resolveDefaultGroupPolicy } from "./group-access-UAqUyJod.js";
|
|
63
|
-
import "./lazy-runtime-BoGB4usD.js";
|
|
64
|
-
import "./config-schema-BNU4GQh_.js";
|
|
65
|
-
import "./method-scopes-CQE7-bZ-.js";
|
|
66
|
-
import "./session-cost-usage-DWgQk6XT.js";
|
|
67
|
-
import "./paths-ApLcu1Uu.js";
|
|
68
|
-
import "./routing-DQ-fpTaA.js";
|
|
69
|
-
import "./send-BuNhp8PH.js";
|
|
70
|
-
import "./node-resolve-D5Hvcgyx.js";
|
|
71
|
-
import "./provider-stream-DrUD69ai.js";
|
|
72
|
-
import "./identity-file-sshkKKIr.js";
|
|
73
|
-
import "./provider-models-BCId_Lfu.js";
|
|
74
|
-
import "./secret-file-p1IhQzwJ.js";
|
|
75
|
-
import "./logging-Dy7UYzIN.js";
|
|
76
|
-
import "./runtime-env-BlEtPF6b.js";
|
|
77
|
-
import "./registry-BFMbkmgR.js";
|
|
78
|
-
import "./provider-onboard-Ca0TaNud.js";
|
|
79
|
-
import "./model-definitions-Cyyzm6Kr.js";
|
|
80
|
-
import "./usage-N3bxnbmt.js";
|
|
81
|
-
import "./device-identity-CRfhC3_s.js";
|
|
82
|
-
import "./auth-Byfp0flq.js";
|
|
83
|
-
import "./subscription-BhZORXN9.js";
|
|
84
|
-
import "./diagnostic-D96Xaqrj.js";
|
|
85
|
-
import "./message-hook-mappers-CeiHXgSQ.js";
|
|
86
|
-
import "./json-store--7cBPxTG.js";
|
|
87
|
-
import "./call-ByEzDJ1_.js";
|
|
88
|
-
import "./multimodal-BJBBn_4F.js";
|
|
89
|
-
import "./memory-search-Cv1SBrn7.js";
|
|
90
|
-
import "./query-expansion-D_Mm5Hhi.js";
|
|
91
|
-
import "./search-manager-C7J7B3_a.js";
|
|
92
|
-
import "./core-CvDzLs7B.js";
|
|
93
|
-
import "./issue-format-B0SI57Es.js";
|
|
94
|
-
import "./logging-CxP9suT8.js";
|
|
95
|
-
import "./note-dOl5kPAy.js";
|
|
96
|
-
import "./state-paths-DsMoTg25.js";
|
|
97
|
-
import "./config-value-CtTWALxG.js";
|
|
98
|
-
import "./command-secret-targets-BFF4x_RB.js";
|
|
99
|
-
import "./brave-BoWimrLe.js";
|
|
100
|
-
import "./provider-usage-D8EZpFz9.js";
|
|
101
|
-
import "./perplexity-EZwC3y2b.js";
|
|
102
|
-
import "./restart-stale-pids-CPF1_61W.js";
|
|
103
|
-
import "./delivery-queue-BOf5wYIc.js";
|
|
104
|
-
import "./pairing-token-bu1e6z6X.js";
|
|
105
|
-
import "./accounts-J2OhhhQi.js";
|
|
106
|
-
import "./process-runtime-D27SftX_.js";
|
|
107
|
-
import "./audit-CIWW1Aqm.js";
|
|
108
|
-
import "./cli-runtime-DTCHPjCi.js";
|
|
109
|
-
import "./cli-utils-BCuSS4l6.js";
|
|
110
|
-
import "./help-format-BFzPm_8V.js";
|
|
111
|
-
import "./progress-Cwq59vgZ.js";
|
|
112
|
-
import "./gateway-runtime-D89mSQPB.js";
|
|
113
|
-
import { n as keepHttpServerTaskAlive } from "./channel-lifecycle-DA5pCpey.js";
|
|
114
|
-
import { n as dispatchReplyFromConfigWithSettledDispatcher } from "./inbound-reply-dispatch-C73_7SOl.js";
|
|
115
|
-
import "./outbound-media-DYRO2vTD.js";
|
|
116
|
-
import { A as resolveAttachmentFetchPolicy, C as extractInlineImageCandidates, D as isRecord, E as isLikelyImageAttachment, M as resolveRequestUrl, N as safeFetchWithPolicy, O as isUrlAllowed, P as safeHostForUrl, S as extractHtmlFromAttachment, T as isDownloadableAttachment, _ as loadMSTeamsSdkWithAuth, b as IMG_SRC_RE, c as resolveMSTeamsUserAllowlist, g as createMSTeamsAdapter, j as resolveMediaSsrfPolicy, k as normalizeContentType, m as resolveMSTeamsCredentials, s as resolveMSTeamsChannelAllowlist, v as ATTACHMENT_TAG_RE, w as inferPlaceholder, x as applyAuthorizationHeaderForUrl, y as GRAPH_ROOT } from "./msteams-7FMwTvQG.js";
|
|
117
|
-
import { a as resolveMSTeamsRouteConfig, i as resolveMSTeamsReplyPolicy, n as resolveMSTeamsAllowlistMatch, t as isMSTeamsGroupAllowed } from "./policy-DsMBbEe7.js";
|
|
118
|
-
import { t as getMSTeamsRuntime } from "./runtime-ChDf4nkp.js";
|
|
119
|
-
import { _ as createMSTeamsConversationStoreFs, a as buildConversationReference, c as withRevokedProxyFallback, d as buildFileInfoCard, f as parseFileConsentInvoke, g as formatUnknownError, h as formatMSTeamsSendErrorHint, l as getPendingUpload, m as classifyMSTeamsSendError, o as renderReplyPayloadsToMessages, p as uploadToConsentUrl, s as sendMSTeamsMessages, u as removePendingUpload, v as createMSTeamsPollStoreFs, y as extractMSTeamsPollVote } from "./probe-DvAEEWYr.js";
|
|
120
|
-
//#region extensions/msteams/src/inbound.ts
|
|
121
|
-
function normalizeMSTeamsConversationId(raw) {
|
|
122
|
-
return raw.split(";")[0] ?? raw;
|
|
123
|
-
}
|
|
124
|
-
function extractMSTeamsConversationMessageId(raw) {
|
|
125
|
-
if (!raw) return;
|
|
126
|
-
return (/(?:^|;)messageid=([^;]+)/i.exec(raw)?.[1]?.trim() ?? "") || void 0;
|
|
127
|
-
}
|
|
128
|
-
function parseMSTeamsActivityTimestamp(value) {
|
|
129
|
-
if (!value) return;
|
|
130
|
-
if (value instanceof Date) return value;
|
|
131
|
-
if (typeof value !== "string") return;
|
|
132
|
-
const date = new Date(value);
|
|
133
|
-
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
134
|
-
}
|
|
135
|
-
function stripMSTeamsMentionTags(text) {
|
|
136
|
-
return text.replace(/<at[^>]*>.*?<\/at>/gi, "").trim();
|
|
137
|
-
}
|
|
138
|
-
function wasMSTeamsBotMentioned(activity) {
|
|
139
|
-
const botId = activity.recipient?.id;
|
|
140
|
-
if (!botId) return false;
|
|
141
|
-
return (activity.entities ?? []).some((e) => e.type === "mention" && e.mentioned?.id === botId);
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region extensions/msteams/src/attachments/remote-media.ts
|
|
145
|
-
async function downloadAndStoreMSTeamsRemoteMedia(params) {
|
|
146
|
-
const fetched = await getMSTeamsRuntime().channel.media.fetchRemoteMedia({
|
|
147
|
-
url: params.url,
|
|
148
|
-
fetchImpl: params.fetchImpl,
|
|
149
|
-
filePathHint: params.filePathHint,
|
|
150
|
-
maxBytes: params.maxBytes,
|
|
151
|
-
ssrfPolicy: params.ssrfPolicy
|
|
152
|
-
});
|
|
153
|
-
const mime = await getMSTeamsRuntime().media.detectMime({
|
|
154
|
-
buffer: fetched.buffer,
|
|
155
|
-
headerMime: fetched.contentType ?? params.contentTypeHint,
|
|
156
|
-
filePath: params.filePathHint
|
|
157
|
-
});
|
|
158
|
-
const originalFilename = params.preserveFilenames ? params.filePathHint : void 0;
|
|
159
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(fetched.buffer, mime ?? params.contentTypeHint, "inbound", params.maxBytes, originalFilename);
|
|
160
|
-
return {
|
|
161
|
-
path: saved.path,
|
|
162
|
-
contentType: saved.contentType,
|
|
163
|
-
placeholder: params.placeholder ?? inferPlaceholder({
|
|
164
|
-
contentType: saved.contentType,
|
|
165
|
-
fileName: params.filePathHint
|
|
166
|
-
})
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region extensions/msteams/src/attachments/download.ts
|
|
171
|
-
function resolveDownloadCandidate(att) {
|
|
172
|
-
const contentType = normalizeContentType(att.contentType);
|
|
173
|
-
const name = typeof att.name === "string" ? att.name.trim() : "";
|
|
174
|
-
if (contentType === "application/vnd.microsoft.teams.file.download.info") {
|
|
175
|
-
if (!isRecord(att.content)) return null;
|
|
176
|
-
const downloadUrl = typeof att.content.downloadUrl === "string" ? att.content.downloadUrl.trim() : "";
|
|
177
|
-
if (!downloadUrl) return null;
|
|
178
|
-
const fileType = typeof att.content.fileType === "string" ? att.content.fileType.trim() : "";
|
|
179
|
-
const uniqueId = typeof att.content.uniqueId === "string" ? att.content.uniqueId.trim() : "";
|
|
180
|
-
const fileName = typeof att.content.fileName === "string" ? att.content.fileName.trim() : "";
|
|
181
|
-
const fileHint = name || fileName || (uniqueId && fileType ? `${uniqueId}.${fileType}` : "");
|
|
182
|
-
return {
|
|
183
|
-
url: downloadUrl,
|
|
184
|
-
fileHint: fileHint || void 0,
|
|
185
|
-
contentTypeHint: void 0,
|
|
186
|
-
placeholder: inferPlaceholder({
|
|
187
|
-
contentType,
|
|
188
|
-
fileName: fileHint,
|
|
189
|
-
fileType
|
|
190
|
-
})
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
const contentUrl = typeof att.contentUrl === "string" ? att.contentUrl.trim() : "";
|
|
194
|
-
if (!contentUrl) return null;
|
|
195
|
-
return {
|
|
196
|
-
url: contentUrl,
|
|
197
|
-
fileHint: name || void 0,
|
|
198
|
-
contentTypeHint: contentType,
|
|
199
|
-
placeholder: inferPlaceholder({
|
|
200
|
-
contentType,
|
|
201
|
-
fileName: name
|
|
202
|
-
})
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
function scopeCandidatesForUrl(url) {
|
|
206
|
-
try {
|
|
207
|
-
const host = new URL(url).hostname.toLowerCase();
|
|
208
|
-
return host.endsWith("graph.microsoft.com") || host.endsWith("sharepoint.com") || host.endsWith("1drv.ms") || host.includes("sharepoint") ? ["https://graph.microsoft.com", "https://api.botframework.com"] : ["https://api.botframework.com", "https://graph.microsoft.com"];
|
|
209
|
-
} catch {
|
|
210
|
-
return ["https://api.botframework.com", "https://graph.microsoft.com"];
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function isRedirectStatus(status) {
|
|
214
|
-
return status === 301 || status === 302 || status === 303 || status === 307 || status === 308;
|
|
215
|
-
}
|
|
216
|
-
async function fetchWithAuthFallback(params) {
|
|
217
|
-
const firstAttempt = await safeFetchWithPolicy({
|
|
218
|
-
url: params.url,
|
|
219
|
-
policy: params.policy,
|
|
220
|
-
fetchFn: params.fetchFn,
|
|
221
|
-
requestInit: params.requestInit
|
|
222
|
-
});
|
|
223
|
-
if (firstAttempt.ok) return firstAttempt;
|
|
224
|
-
if (!params.tokenProvider) return firstAttempt;
|
|
225
|
-
if (firstAttempt.status !== 401 && firstAttempt.status !== 403) return firstAttempt;
|
|
226
|
-
if (!isUrlAllowed(params.url, params.policy.authAllowHosts)) return firstAttempt;
|
|
227
|
-
const scopes = scopeCandidatesForUrl(params.url);
|
|
228
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
229
|
-
for (const scope of scopes) try {
|
|
230
|
-
const token = await params.tokenProvider.getAccessToken(scope);
|
|
231
|
-
const authHeaders = new Headers(params.requestInit?.headers);
|
|
232
|
-
authHeaders.set("Authorization", `Bearer ${token}`);
|
|
233
|
-
const authAttempt = await safeFetchWithPolicy({
|
|
234
|
-
url: params.url,
|
|
235
|
-
policy: params.policy,
|
|
236
|
-
fetchFn,
|
|
237
|
-
requestInit: {
|
|
238
|
-
...params.requestInit,
|
|
239
|
-
headers: authHeaders
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
if (authAttempt.ok) return authAttempt;
|
|
243
|
-
if (isRedirectStatus(authAttempt.status)) return authAttempt;
|
|
244
|
-
if (authAttempt.status !== 401 && authAttempt.status !== 403) continue;
|
|
245
|
-
} catch {}
|
|
246
|
-
return firstAttempt;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Download all file attachments from a Teams message (images, documents, etc.).
|
|
250
|
-
* Renamed from downloadMSTeamsImageAttachments to support all file types.
|
|
251
|
-
*/
|
|
252
|
-
async function downloadMSTeamsAttachments(params) {
|
|
253
|
-
const list = Array.isArray(params.attachments) ? params.attachments : [];
|
|
254
|
-
if (list.length === 0) return [];
|
|
255
|
-
const policy = resolveAttachmentFetchPolicy({
|
|
256
|
-
allowHosts: params.allowHosts,
|
|
257
|
-
authAllowHosts: params.authAllowHosts
|
|
258
|
-
});
|
|
259
|
-
const allowHosts = policy.allowHosts;
|
|
260
|
-
const ssrfPolicy = resolveMediaSsrfPolicy(allowHosts);
|
|
261
|
-
const candidates = list.filter(isDownloadableAttachment).map(resolveDownloadCandidate).filter(Boolean);
|
|
262
|
-
const inlineCandidates = extractInlineImageCandidates(list);
|
|
263
|
-
const seenUrls = /* @__PURE__ */ new Set();
|
|
264
|
-
for (const inline of inlineCandidates) if (inline.kind === "url") {
|
|
265
|
-
if (!isUrlAllowed(inline.url, allowHosts)) continue;
|
|
266
|
-
if (seenUrls.has(inline.url)) continue;
|
|
267
|
-
seenUrls.add(inline.url);
|
|
268
|
-
candidates.push({
|
|
269
|
-
url: inline.url,
|
|
270
|
-
fileHint: inline.fileHint,
|
|
271
|
-
contentTypeHint: inline.contentType,
|
|
272
|
-
placeholder: inline.placeholder
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
if (candidates.length === 0 && inlineCandidates.length === 0) return [];
|
|
276
|
-
const out = [];
|
|
277
|
-
for (const inline of inlineCandidates) {
|
|
278
|
-
if (inline.kind !== "data") continue;
|
|
279
|
-
if (inline.data.byteLength > params.maxBytes) continue;
|
|
280
|
-
try {
|
|
281
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(inline.data, inline.contentType, "inbound", params.maxBytes);
|
|
282
|
-
out.push({
|
|
283
|
-
path: saved.path,
|
|
284
|
-
contentType: saved.contentType,
|
|
285
|
-
placeholder: inline.placeholder
|
|
286
|
-
});
|
|
287
|
-
} catch {}
|
|
288
|
-
}
|
|
289
|
-
for (const candidate of candidates) {
|
|
290
|
-
if (!isUrlAllowed(candidate.url, allowHosts)) continue;
|
|
291
|
-
try {
|
|
292
|
-
const media = await downloadAndStoreMSTeamsRemoteMedia({
|
|
293
|
-
url: candidate.url,
|
|
294
|
-
filePathHint: candidate.fileHint ?? candidate.url,
|
|
295
|
-
maxBytes: params.maxBytes,
|
|
296
|
-
contentTypeHint: candidate.contentTypeHint,
|
|
297
|
-
placeholder: candidate.placeholder,
|
|
298
|
-
preserveFilenames: params.preserveFilenames,
|
|
299
|
-
ssrfPolicy,
|
|
300
|
-
fetchImpl: (input, init) => fetchWithAuthFallback({
|
|
301
|
-
url: resolveRequestUrl(input),
|
|
302
|
-
tokenProvider: params.tokenProvider,
|
|
303
|
-
fetchFn: params.fetchFn,
|
|
304
|
-
requestInit: init,
|
|
305
|
-
policy
|
|
306
|
-
})
|
|
307
|
-
});
|
|
308
|
-
out.push(media);
|
|
309
|
-
} catch {}
|
|
310
|
-
}
|
|
311
|
-
return out;
|
|
312
|
-
}
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region extensions/msteams/src/attachments/graph.ts
|
|
315
|
-
function readNestedString(value, keys) {
|
|
316
|
-
let current = value;
|
|
317
|
-
for (const key of keys) {
|
|
318
|
-
if (!isRecord(current)) return;
|
|
319
|
-
current = current[key];
|
|
320
|
-
}
|
|
321
|
-
return typeof current === "string" && current.trim() ? current.trim() : void 0;
|
|
322
|
-
}
|
|
323
|
-
function buildMSTeamsGraphMessageUrls(params) {
|
|
324
|
-
const conversationType = params.conversationType?.trim().toLowerCase() ?? "";
|
|
325
|
-
const messageIdCandidates = /* @__PURE__ */ new Set();
|
|
326
|
-
const pushCandidate = (value) => {
|
|
327
|
-
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
328
|
-
if (trimmed) messageIdCandidates.add(trimmed);
|
|
329
|
-
};
|
|
330
|
-
pushCandidate(params.messageId);
|
|
331
|
-
pushCandidate(params.conversationMessageId);
|
|
332
|
-
pushCandidate(readNestedString(params.channelData, ["messageId"]));
|
|
333
|
-
pushCandidate(readNestedString(params.channelData, ["teamsMessageId"]));
|
|
334
|
-
const replyToId = typeof params.replyToId === "string" ? params.replyToId.trim() : "";
|
|
335
|
-
if (conversationType === "channel") {
|
|
336
|
-
const teamId = readNestedString(params.channelData, ["team", "id"]) ?? readNestedString(params.channelData, ["teamId"]);
|
|
337
|
-
const channelId = readNestedString(params.channelData, ["channel", "id"]) ?? readNestedString(params.channelData, ["channelId"]) ?? readNestedString(params.channelData, ["teamsChannelId"]);
|
|
338
|
-
if (!teamId || !channelId) return [];
|
|
339
|
-
const urls = [];
|
|
340
|
-
if (replyToId) for (const candidate of messageIdCandidates) {
|
|
341
|
-
if (candidate === replyToId) continue;
|
|
342
|
-
urls.push(`${GRAPH_ROOT}/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages/${encodeURIComponent(replyToId)}/replies/${encodeURIComponent(candidate)}`);
|
|
343
|
-
}
|
|
344
|
-
if (messageIdCandidates.size === 0 && replyToId) messageIdCandidates.add(replyToId);
|
|
345
|
-
for (const candidate of messageIdCandidates) urls.push(`${GRAPH_ROOT}/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages/${encodeURIComponent(candidate)}`);
|
|
346
|
-
return Array.from(new Set(urls));
|
|
347
|
-
}
|
|
348
|
-
const chatId = params.conversationId?.trim() || readNestedString(params.channelData, ["chatId"]);
|
|
349
|
-
if (!chatId) return [];
|
|
350
|
-
if (messageIdCandidates.size === 0 && replyToId) messageIdCandidates.add(replyToId);
|
|
351
|
-
const urls = Array.from(messageIdCandidates).map((candidate) => `${GRAPH_ROOT}/chats/${encodeURIComponent(chatId)}/messages/${encodeURIComponent(candidate)}`);
|
|
352
|
-
return Array.from(new Set(urls));
|
|
353
|
-
}
|
|
354
|
-
async function fetchGraphCollection(params) {
|
|
355
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
356
|
-
const { response, release } = await fetchWithSsrFGuard({
|
|
357
|
-
url: params.url,
|
|
358
|
-
fetchImpl: fetchFn,
|
|
359
|
-
init: { headers: { Authorization: `Bearer ${params.accessToken}` } },
|
|
360
|
-
policy: params.ssrfPolicy,
|
|
361
|
-
auditContext: "msteams.graph.collection"
|
|
362
|
-
});
|
|
363
|
-
try {
|
|
364
|
-
const status = response.status;
|
|
365
|
-
if (!response.ok) return {
|
|
366
|
-
status,
|
|
367
|
-
items: []
|
|
368
|
-
};
|
|
369
|
-
try {
|
|
370
|
-
const data = await response.json();
|
|
371
|
-
return {
|
|
372
|
-
status,
|
|
373
|
-
items: Array.isArray(data.value) ? data.value : []
|
|
374
|
-
};
|
|
375
|
-
} catch {
|
|
376
|
-
return {
|
|
377
|
-
status,
|
|
378
|
-
items: []
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
} finally {
|
|
382
|
-
await release();
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
function normalizeGraphAttachment(att) {
|
|
386
|
-
let content = att.content;
|
|
387
|
-
if (typeof content === "string") try {
|
|
388
|
-
content = JSON.parse(content);
|
|
389
|
-
} catch {}
|
|
390
|
-
return {
|
|
391
|
-
contentType: normalizeContentType(att.contentType) ?? void 0,
|
|
392
|
-
contentUrl: att.contentUrl ?? void 0,
|
|
393
|
-
name: att.name ?? void 0,
|
|
394
|
-
thumbnailUrl: att.thumbnailUrl ?? void 0,
|
|
395
|
-
content
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Download all hosted content from a Teams message (images, documents, etc.).
|
|
400
|
-
* Renamed from downloadGraphHostedImages to support all file types.
|
|
401
|
-
*/
|
|
402
|
-
async function downloadGraphHostedContent(params) {
|
|
403
|
-
const hosted = await fetchGraphCollection({
|
|
404
|
-
url: `${params.messageUrl}/hostedContents`,
|
|
405
|
-
accessToken: params.accessToken,
|
|
406
|
-
fetchFn: params.fetchFn,
|
|
407
|
-
ssrfPolicy: params.ssrfPolicy
|
|
408
|
-
});
|
|
409
|
-
if (hosted.items.length === 0) return {
|
|
410
|
-
media: [],
|
|
411
|
-
status: hosted.status,
|
|
412
|
-
count: 0
|
|
413
|
-
};
|
|
414
|
-
const out = [];
|
|
415
|
-
for (const item of hosted.items) {
|
|
416
|
-
const contentBytes = typeof item.contentBytes === "string" ? item.contentBytes : "";
|
|
417
|
-
if (!contentBytes) continue;
|
|
418
|
-
let buffer;
|
|
419
|
-
try {
|
|
420
|
-
buffer = Buffer.from(contentBytes, "base64");
|
|
421
|
-
} catch {
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
if (buffer.byteLength > params.maxBytes) continue;
|
|
425
|
-
const mime = await getMSTeamsRuntime().media.detectMime({
|
|
426
|
-
buffer,
|
|
427
|
-
headerMime: item.contentType ?? void 0
|
|
428
|
-
});
|
|
429
|
-
try {
|
|
430
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(buffer, mime ?? item.contentType ?? void 0, "inbound", params.maxBytes);
|
|
431
|
-
out.push({
|
|
432
|
-
path: saved.path,
|
|
433
|
-
contentType: saved.contentType,
|
|
434
|
-
placeholder: inferPlaceholder({ contentType: saved.contentType })
|
|
435
|
-
});
|
|
436
|
-
} catch {}
|
|
437
|
-
}
|
|
438
|
-
return {
|
|
439
|
-
media: out,
|
|
440
|
-
status: hosted.status,
|
|
441
|
-
count: hosted.items.length
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
async function downloadMSTeamsGraphMedia(params) {
|
|
445
|
-
if (!params.messageUrl || !params.tokenProvider) return { media: [] };
|
|
446
|
-
const policy = resolveAttachmentFetchPolicy({
|
|
447
|
-
allowHosts: params.allowHosts,
|
|
448
|
-
authAllowHosts: params.authAllowHosts
|
|
449
|
-
});
|
|
450
|
-
const ssrfPolicy = resolveMediaSsrfPolicy(policy.allowHosts);
|
|
451
|
-
const messageUrl = params.messageUrl;
|
|
452
|
-
let accessToken;
|
|
453
|
-
try {
|
|
454
|
-
accessToken = await params.tokenProvider.getAccessToken("https://graph.microsoft.com");
|
|
455
|
-
} catch {
|
|
456
|
-
return {
|
|
457
|
-
media: [],
|
|
458
|
-
messageUrl,
|
|
459
|
-
tokenError: true
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
463
|
-
const sharePointMedia = [];
|
|
464
|
-
const downloadedReferenceUrls = /* @__PURE__ */ new Set();
|
|
465
|
-
try {
|
|
466
|
-
const { response: msgRes, release } = await fetchWithSsrFGuard({
|
|
467
|
-
url: messageUrl,
|
|
468
|
-
fetchImpl: fetchFn,
|
|
469
|
-
init: { headers: { Authorization: `Bearer ${accessToken}` } },
|
|
470
|
-
policy: ssrfPolicy,
|
|
471
|
-
auditContext: "msteams.graph.message"
|
|
472
|
-
});
|
|
473
|
-
try {
|
|
474
|
-
if (msgRes.ok) {
|
|
475
|
-
const spAttachments = ((await msgRes.json()).attachments ?? []).filter((a) => a.contentType === "reference" && a.contentUrl && a.name);
|
|
476
|
-
for (const att of spAttachments) {
|
|
477
|
-
const name = att.name ?? "file";
|
|
478
|
-
try {
|
|
479
|
-
const shareUrl = att.contentUrl;
|
|
480
|
-
if (!isUrlAllowed(shareUrl, policy.allowHosts)) continue;
|
|
481
|
-
const media = await downloadAndStoreMSTeamsRemoteMedia({
|
|
482
|
-
url: `${GRAPH_ROOT}/shares/u!${Buffer.from(shareUrl).toString("base64url")}/driveItem/content`,
|
|
483
|
-
filePathHint: name,
|
|
484
|
-
maxBytes: params.maxBytes,
|
|
485
|
-
contentTypeHint: "application/octet-stream",
|
|
486
|
-
preserveFilenames: params.preserveFilenames,
|
|
487
|
-
ssrfPolicy,
|
|
488
|
-
fetchImpl: async (input, init) => {
|
|
489
|
-
const requestUrl = resolveRequestUrl(input);
|
|
490
|
-
const headers = new Headers(init?.headers);
|
|
491
|
-
applyAuthorizationHeaderForUrl({
|
|
492
|
-
headers,
|
|
493
|
-
url: requestUrl,
|
|
494
|
-
authAllowHosts: policy.authAllowHosts,
|
|
495
|
-
bearerToken: accessToken
|
|
496
|
-
});
|
|
497
|
-
return await safeFetchWithPolicy({
|
|
498
|
-
url: requestUrl,
|
|
499
|
-
policy,
|
|
500
|
-
fetchFn,
|
|
501
|
-
requestInit: {
|
|
502
|
-
...init,
|
|
503
|
-
headers
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
sharePointMedia.push(media);
|
|
509
|
-
downloadedReferenceUrls.add(shareUrl);
|
|
510
|
-
} catch {}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
} finally {
|
|
514
|
-
await release();
|
|
515
|
-
}
|
|
516
|
-
} catch {}
|
|
517
|
-
const hosted = await downloadGraphHostedContent({
|
|
518
|
-
accessToken,
|
|
519
|
-
messageUrl,
|
|
520
|
-
maxBytes: params.maxBytes,
|
|
521
|
-
fetchFn: params.fetchFn,
|
|
522
|
-
preserveFilenames: params.preserveFilenames,
|
|
523
|
-
ssrfPolicy
|
|
524
|
-
});
|
|
525
|
-
const attachments = await fetchGraphCollection({
|
|
526
|
-
url: `${messageUrl}/attachments`,
|
|
527
|
-
accessToken,
|
|
528
|
-
fetchFn: params.fetchFn,
|
|
529
|
-
ssrfPolicy
|
|
530
|
-
});
|
|
531
|
-
const normalizedAttachments = attachments.items.map(normalizeGraphAttachment);
|
|
532
|
-
const filteredAttachments = sharePointMedia.length > 0 ? normalizedAttachments.filter((att) => {
|
|
533
|
-
if (att.contentType?.toLowerCase() !== "reference") return true;
|
|
534
|
-
const url = typeof att.contentUrl === "string" ? att.contentUrl : "";
|
|
535
|
-
if (!url) return true;
|
|
536
|
-
return !downloadedReferenceUrls.has(url);
|
|
537
|
-
}) : normalizedAttachments;
|
|
538
|
-
const attachmentMedia = await downloadMSTeamsAttachments({
|
|
539
|
-
attachments: filteredAttachments,
|
|
540
|
-
maxBytes: params.maxBytes,
|
|
541
|
-
tokenProvider: params.tokenProvider,
|
|
542
|
-
allowHosts: policy.allowHosts,
|
|
543
|
-
authAllowHosts: policy.authAllowHosts,
|
|
544
|
-
fetchFn: params.fetchFn,
|
|
545
|
-
preserveFilenames: params.preserveFilenames
|
|
546
|
-
});
|
|
547
|
-
return {
|
|
548
|
-
media: [
|
|
549
|
-
...sharePointMedia,
|
|
550
|
-
...hosted.media,
|
|
551
|
-
...attachmentMedia
|
|
552
|
-
],
|
|
553
|
-
hostedCount: hosted.count,
|
|
554
|
-
attachmentCount: filteredAttachments.length + sharePointMedia.length,
|
|
555
|
-
hostedStatus: hosted.status,
|
|
556
|
-
attachmentStatus: attachments.status,
|
|
557
|
-
messageUrl
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
//#endregion
|
|
561
|
-
//#region extensions/msteams/src/attachments/html.ts
|
|
562
|
-
function summarizeMSTeamsHtmlAttachments(attachments) {
|
|
563
|
-
const list = Array.isArray(attachments) ? attachments : [];
|
|
564
|
-
if (list.length === 0) return;
|
|
565
|
-
let htmlAttachments = 0;
|
|
566
|
-
let imgTags = 0;
|
|
567
|
-
let dataImages = 0;
|
|
568
|
-
let cidImages = 0;
|
|
569
|
-
const srcHosts = /* @__PURE__ */ new Set();
|
|
570
|
-
let attachmentTags = 0;
|
|
571
|
-
const attachmentIds = /* @__PURE__ */ new Set();
|
|
572
|
-
for (const att of list) {
|
|
573
|
-
const html = extractHtmlFromAttachment(att);
|
|
574
|
-
if (!html) continue;
|
|
575
|
-
htmlAttachments += 1;
|
|
576
|
-
IMG_SRC_RE.lastIndex = 0;
|
|
577
|
-
let match = IMG_SRC_RE.exec(html);
|
|
578
|
-
while (match) {
|
|
579
|
-
imgTags += 1;
|
|
580
|
-
const src = match[1]?.trim();
|
|
581
|
-
if (src) if (src.startsWith("data:")) dataImages += 1;
|
|
582
|
-
else if (src.startsWith("cid:")) cidImages += 1;
|
|
583
|
-
else srcHosts.add(safeHostForUrl(src));
|
|
584
|
-
match = IMG_SRC_RE.exec(html);
|
|
585
|
-
}
|
|
586
|
-
ATTACHMENT_TAG_RE.lastIndex = 0;
|
|
587
|
-
let attachmentMatch = ATTACHMENT_TAG_RE.exec(html);
|
|
588
|
-
while (attachmentMatch) {
|
|
589
|
-
attachmentTags += 1;
|
|
590
|
-
const id = attachmentMatch[1]?.trim();
|
|
591
|
-
if (id) attachmentIds.add(id);
|
|
592
|
-
attachmentMatch = ATTACHMENT_TAG_RE.exec(html);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
if (htmlAttachments === 0) return;
|
|
596
|
-
return {
|
|
597
|
-
htmlAttachments,
|
|
598
|
-
imgTags,
|
|
599
|
-
dataImages,
|
|
600
|
-
cidImages,
|
|
601
|
-
srcHosts: Array.from(srcHosts).slice(0, 5),
|
|
602
|
-
attachmentTags,
|
|
603
|
-
attachmentIds: Array.from(attachmentIds).slice(0, 5)
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
function buildMSTeamsAttachmentPlaceholder(attachments) {
|
|
607
|
-
const list = Array.isArray(attachments) ? attachments : [];
|
|
608
|
-
if (list.length === 0) return "";
|
|
609
|
-
const totalImages = list.filter(isLikelyImageAttachment).length + extractInlineImageCandidates(list).length;
|
|
610
|
-
if (totalImages > 0) return `<media:image>${totalImages > 1 ? ` (${totalImages} images)` : ""}`;
|
|
611
|
-
const count = list.length;
|
|
612
|
-
return `<media:document>${count > 1 ? ` (${count} files)` : ""}`;
|
|
613
|
-
}
|
|
614
|
-
//#endregion
|
|
615
|
-
//#region extensions/msteams/src/attachments/payload.ts
|
|
616
|
-
function buildMSTeamsMediaPayload(mediaList) {
|
|
617
|
-
return buildMediaPayload(mediaList, { preserveMediaTypeCardinality: true });
|
|
618
|
-
}
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region extensions/msteams/src/reply-dispatcher.ts
|
|
621
|
-
function createMSTeamsReplyDispatcher(params) {
|
|
622
|
-
const core = getMSTeamsRuntime();
|
|
623
|
-
/**
|
|
624
|
-
* Send a typing indicator.
|
|
625
|
-
*
|
|
626
|
-
* First tries the live turn context (cheapest path). When the context has
|
|
627
|
-
* been revoked (debounced messages) we fall back to proactive messaging via
|
|
628
|
-
* the stored conversation reference so the user still sees the "…" bubble.
|
|
629
|
-
*/
|
|
630
|
-
const sendTypingIndicator = async () => {
|
|
631
|
-
await withRevokedProxyFallback({
|
|
632
|
-
run: async () => {
|
|
633
|
-
await params.context.sendActivity({ type: "typing" });
|
|
634
|
-
},
|
|
635
|
-
onRevoked: async () => {
|
|
636
|
-
const baseRef = buildConversationReference(params.conversationRef);
|
|
637
|
-
await params.adapter.continueConversation(params.appId, {
|
|
638
|
-
...baseRef,
|
|
639
|
-
activityId: void 0
|
|
640
|
-
}, async (ctx) => {
|
|
641
|
-
await ctx.sendActivity({ type: "typing" });
|
|
642
|
-
});
|
|
643
|
-
},
|
|
644
|
-
onRevokedLog: () => {
|
|
645
|
-
params.log.debug?.("turn context revoked, sending typing via proactive messaging");
|
|
646
|
-
}
|
|
647
|
-
});
|
|
648
|
-
};
|
|
649
|
-
const typingCallbacks = createTypingCallbacks({
|
|
650
|
-
start: sendTypingIndicator,
|
|
651
|
-
onStartError: (err) => {
|
|
652
|
-
logTypingFailure({
|
|
653
|
-
log: (message) => params.log.debug?.(message),
|
|
654
|
-
channel: "msteams",
|
|
655
|
-
action: "start",
|
|
656
|
-
error: err
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
661
|
-
cfg: params.cfg,
|
|
662
|
-
agentId: params.agentId,
|
|
663
|
-
channel: "msteams",
|
|
664
|
-
accountId: params.accountId
|
|
665
|
-
});
|
|
666
|
-
const chunkMode = core.channel.text.resolveChunkMode(params.cfg, "msteams");
|
|
667
|
-
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
668
|
-
...prefixOptions,
|
|
669
|
-
humanDelay: core.channel.reply.resolveHumanDelayConfig(params.cfg, params.agentId),
|
|
670
|
-
typingCallbacks,
|
|
671
|
-
deliver: async (payload) => {
|
|
672
|
-
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
673
|
-
cfg: params.cfg,
|
|
674
|
-
channel: "msteams"
|
|
675
|
-
});
|
|
676
|
-
const messages = renderReplyPayloadsToMessages([payload], {
|
|
677
|
-
textChunkLimit: params.textLimit,
|
|
678
|
-
chunkText: true,
|
|
679
|
-
mediaMode: "split",
|
|
680
|
-
tableMode,
|
|
681
|
-
chunkMode
|
|
682
|
-
});
|
|
683
|
-
const mediaMaxBytes = resolveChannelMediaMaxBytes({
|
|
684
|
-
cfg: params.cfg,
|
|
685
|
-
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
|
|
686
|
-
});
|
|
687
|
-
const ids = await sendMSTeamsMessages({
|
|
688
|
-
replyStyle: params.replyStyle,
|
|
689
|
-
adapter: params.adapter,
|
|
690
|
-
appId: params.appId,
|
|
691
|
-
conversationRef: params.conversationRef,
|
|
692
|
-
context: params.context,
|
|
693
|
-
messages,
|
|
694
|
-
retry: {},
|
|
695
|
-
onRetry: (event) => {
|
|
696
|
-
params.log.debug?.("retrying send", {
|
|
697
|
-
replyStyle: params.replyStyle,
|
|
698
|
-
...event
|
|
699
|
-
});
|
|
700
|
-
},
|
|
701
|
-
tokenProvider: params.tokenProvider,
|
|
702
|
-
sharePointSiteId: params.sharePointSiteId,
|
|
703
|
-
mediaMaxBytes
|
|
704
|
-
});
|
|
705
|
-
if (ids.length > 0) params.onSentMessageIds?.(ids);
|
|
706
|
-
},
|
|
707
|
-
onError: (err, info) => {
|
|
708
|
-
const errMsg = formatUnknownError(err);
|
|
709
|
-
const classification = classifyMSTeamsSendError(err);
|
|
710
|
-
const hint = formatMSTeamsSendErrorHint(classification);
|
|
711
|
-
params.runtime.error?.(`msteams ${info.kind} reply failed: ${errMsg}${hint ? ` (${hint})` : ""}`);
|
|
712
|
-
params.log.error("reply failed", {
|
|
713
|
-
kind: info.kind,
|
|
714
|
-
error: errMsg,
|
|
715
|
-
classification,
|
|
716
|
-
hint
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
return {
|
|
721
|
-
dispatcher,
|
|
722
|
-
replyOptions: {
|
|
723
|
-
...replyOptions,
|
|
724
|
-
onModelSelected
|
|
725
|
-
},
|
|
726
|
-
markDispatchIdle
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
//#endregion
|
|
730
|
-
//#region extensions/msteams/src/sent-message-cache.ts
|
|
731
|
-
const TTL_MS = 1440 * 60 * 1e3;
|
|
732
|
-
const sentMessages = /* @__PURE__ */ new Map();
|
|
733
|
-
function cleanupExpired(entry) {
|
|
734
|
-
const now = Date.now();
|
|
735
|
-
for (const [msgId, timestamp] of entry.timestamps) if (now - timestamp > TTL_MS) entry.timestamps.delete(msgId);
|
|
736
|
-
}
|
|
737
|
-
function recordMSTeamsSentMessage(conversationId, messageId) {
|
|
738
|
-
if (!conversationId || !messageId) return;
|
|
739
|
-
let entry = sentMessages.get(conversationId);
|
|
740
|
-
if (!entry) {
|
|
741
|
-
entry = { timestamps: /* @__PURE__ */ new Map() };
|
|
742
|
-
sentMessages.set(conversationId, entry);
|
|
743
|
-
}
|
|
744
|
-
entry.timestamps.set(messageId, Date.now());
|
|
745
|
-
if (entry.timestamps.size > 200) cleanupExpired(entry);
|
|
746
|
-
}
|
|
747
|
-
function wasMSTeamsMessageSent(conversationId, messageId) {
|
|
748
|
-
const entry = sentMessages.get(conversationId);
|
|
749
|
-
if (!entry) return false;
|
|
750
|
-
cleanupExpired(entry);
|
|
751
|
-
return entry.timestamps.has(messageId);
|
|
752
|
-
}
|
|
753
|
-
//#endregion
|
|
754
|
-
//#region extensions/msteams/src/monitor-handler/inbound-media.ts
|
|
755
|
-
async function resolveMSTeamsInboundMedia(params) {
|
|
756
|
-
const { attachments, htmlSummary, maxBytes, tokenProvider, allowHosts, conversationType, conversationId, conversationMessageId, activity, log, preserveFilenames } = params;
|
|
757
|
-
let mediaList = await downloadMSTeamsAttachments({
|
|
758
|
-
attachments,
|
|
759
|
-
maxBytes,
|
|
760
|
-
tokenProvider,
|
|
761
|
-
allowHosts,
|
|
762
|
-
authAllowHosts: params.authAllowHosts,
|
|
763
|
-
preserveFilenames
|
|
764
|
-
});
|
|
765
|
-
if (mediaList.length === 0) {
|
|
766
|
-
if (attachments.length > 0 && attachments.every((att) => String(att.contentType ?? "").startsWith("text/html"))) {
|
|
767
|
-
const messageUrls = buildMSTeamsGraphMessageUrls({
|
|
768
|
-
conversationType,
|
|
769
|
-
conversationId,
|
|
770
|
-
messageId: activity.id ?? void 0,
|
|
771
|
-
replyToId: activity.replyToId ?? void 0,
|
|
772
|
-
conversationMessageId,
|
|
773
|
-
channelData: activity.channelData
|
|
774
|
-
});
|
|
775
|
-
if (messageUrls.length === 0) log.debug?.("graph message url unavailable", {
|
|
776
|
-
conversationType,
|
|
777
|
-
hasChannelData: Boolean(activity.channelData),
|
|
778
|
-
messageId: activity.id ?? void 0,
|
|
779
|
-
replyToId: activity.replyToId ?? void 0
|
|
780
|
-
});
|
|
781
|
-
else {
|
|
782
|
-
const attempts = [];
|
|
783
|
-
for (const messageUrl of messageUrls) {
|
|
784
|
-
const graphMedia = await downloadMSTeamsGraphMedia({
|
|
785
|
-
messageUrl,
|
|
786
|
-
tokenProvider,
|
|
787
|
-
maxBytes,
|
|
788
|
-
allowHosts,
|
|
789
|
-
authAllowHosts: params.authAllowHosts,
|
|
790
|
-
preserveFilenames
|
|
791
|
-
});
|
|
792
|
-
attempts.push({
|
|
793
|
-
url: messageUrl,
|
|
794
|
-
hostedStatus: graphMedia.hostedStatus,
|
|
795
|
-
attachmentStatus: graphMedia.attachmentStatus,
|
|
796
|
-
hostedCount: graphMedia.hostedCount,
|
|
797
|
-
attachmentCount: graphMedia.attachmentCount,
|
|
798
|
-
tokenError: graphMedia.tokenError
|
|
799
|
-
});
|
|
800
|
-
if (graphMedia.media.length > 0) {
|
|
801
|
-
mediaList = graphMedia.media;
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
if (graphMedia.tokenError) break;
|
|
805
|
-
}
|
|
806
|
-
if (mediaList.length === 0) log.debug?.("graph media fetch empty", { attempts });
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
if (mediaList.length > 0) log.debug?.("downloaded attachments", { count: mediaList.length });
|
|
811
|
-
else if (htmlSummary?.imgTags) log.debug?.("inline images detected but none downloaded", {
|
|
812
|
-
imgTags: htmlSummary.imgTags,
|
|
813
|
-
srcHosts: htmlSummary.srcHosts,
|
|
814
|
-
dataImages: htmlSummary.dataImages,
|
|
815
|
-
cidImages: htmlSummary.cidImages
|
|
816
|
-
});
|
|
817
|
-
return mediaList;
|
|
818
|
-
}
|
|
819
|
-
//#endregion
|
|
820
|
-
//#region extensions/msteams/src/monitor-handler/message-handler.ts
|
|
821
|
-
function createMSTeamsMessageHandler(deps) {
|
|
822
|
-
const { cfg, runtime, appId, adapter, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
|
|
823
|
-
const core = getMSTeamsRuntime();
|
|
824
|
-
const pairing = createScopedPairingAccess({
|
|
825
|
-
core,
|
|
826
|
-
channel: "msteams",
|
|
827
|
-
accountId: DEFAULT_ACCOUNT_ID
|
|
828
|
-
});
|
|
829
|
-
const logVerboseMessage = (message) => {
|
|
830
|
-
if (core.logging.shouldLogVerbose()) log.debug?.(message);
|
|
831
|
-
};
|
|
832
|
-
const msteamsCfg = cfg.channels?.msteams;
|
|
833
|
-
const historyLimit = Math.max(0, msteamsCfg?.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? 50);
|
|
834
|
-
const conversationHistories = /* @__PURE__ */ new Map();
|
|
835
|
-
const inboundDebounceMs = core.channel.debounce.resolveInboundDebounceMs({
|
|
836
|
-
cfg,
|
|
837
|
-
channel: "msteams"
|
|
838
|
-
});
|
|
839
|
-
const handleTeamsMessageNow = async (params) => {
|
|
840
|
-
const context = params.context;
|
|
841
|
-
const activity = context.activity;
|
|
842
|
-
const rawText = params.rawText;
|
|
843
|
-
const text = params.text;
|
|
844
|
-
const attachments = params.attachments;
|
|
845
|
-
const attachmentPlaceholder = buildMSTeamsAttachmentPlaceholder(attachments);
|
|
846
|
-
const rawBody = text || attachmentPlaceholder;
|
|
847
|
-
const from = activity.from;
|
|
848
|
-
const conversation = activity.conversation;
|
|
849
|
-
const attachmentTypes = attachments.map((att) => typeof att.contentType === "string" ? att.contentType : void 0).filter(Boolean).slice(0, 3);
|
|
850
|
-
const htmlSummary = summarizeMSTeamsHtmlAttachments(attachments);
|
|
851
|
-
log.info("received message", {
|
|
852
|
-
rawText: rawText.slice(0, 50),
|
|
853
|
-
text: text.slice(0, 50),
|
|
854
|
-
attachments: attachments.length,
|
|
855
|
-
attachmentTypes,
|
|
856
|
-
from: from?.id,
|
|
857
|
-
conversation: conversation?.id
|
|
858
|
-
});
|
|
859
|
-
if (htmlSummary) log.debug?.("html attachment summary", htmlSummary);
|
|
860
|
-
if (!from?.id) {
|
|
861
|
-
log.debug?.("skipping message without from.id");
|
|
862
|
-
return;
|
|
863
|
-
}
|
|
864
|
-
const rawConversationId = conversation?.id ?? "";
|
|
865
|
-
const conversationId = normalizeMSTeamsConversationId(rawConversationId);
|
|
866
|
-
const conversationMessageId = extractMSTeamsConversationMessageId(rawConversationId);
|
|
867
|
-
const conversationType = conversation?.conversationType ?? "personal";
|
|
868
|
-
const isGroupChat = conversationType === "groupChat" || conversation?.isGroup === true;
|
|
869
|
-
const isChannel = conversationType === "channel";
|
|
870
|
-
const isDirectMessage = !isGroupChat && !isChannel;
|
|
871
|
-
const senderName = from.name ?? from.id;
|
|
872
|
-
const senderId = from.aadObjectId ?? from.id;
|
|
873
|
-
const dmPolicy = msteamsCfg?.dmPolicy ?? "pairing";
|
|
874
|
-
const storedAllowFrom = await readStoreAllowFromForDmPolicy({
|
|
875
|
-
provider: "msteams",
|
|
876
|
-
accountId: pairing.accountId,
|
|
877
|
-
dmPolicy,
|
|
878
|
-
readStore: pairing.readStoreForDmPolicy
|
|
879
|
-
});
|
|
880
|
-
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
881
|
-
const configuredDmAllowFrom = (msteamsCfg?.allowFrom ?? []).map((v) => String(v));
|
|
882
|
-
const groupAllowFrom = msteamsCfg?.groupAllowFrom;
|
|
883
|
-
const resolvedAllowFromLists = resolveEffectiveAllowFromLists({
|
|
884
|
-
allowFrom: configuredDmAllowFrom,
|
|
885
|
-
groupAllowFrom,
|
|
886
|
-
storeAllowFrom: storedAllowFrom,
|
|
887
|
-
dmPolicy
|
|
888
|
-
});
|
|
889
|
-
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
890
|
-
const groupPolicy = !isDirectMessage && msteamsCfg ? msteamsCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist" : "disabled";
|
|
891
|
-
const effectiveGroupAllowFrom = resolvedAllowFromLists.effectiveGroupAllowFrom;
|
|
892
|
-
const teamId = activity.channelData?.team?.id;
|
|
893
|
-
const teamName = activity.channelData?.team?.name;
|
|
894
|
-
const channelName = activity.channelData?.channel?.name;
|
|
895
|
-
const channelGate = resolveMSTeamsRouteConfig({
|
|
896
|
-
cfg: msteamsCfg,
|
|
897
|
-
teamId,
|
|
898
|
-
teamName,
|
|
899
|
-
conversationId,
|
|
900
|
-
channelName,
|
|
901
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
902
|
-
});
|
|
903
|
-
const senderGroupPolicy = resolveSenderScopedGroupPolicy({
|
|
904
|
-
groupPolicy,
|
|
905
|
-
groupAllowFrom: effectiveGroupAllowFrom
|
|
906
|
-
});
|
|
907
|
-
const access = resolveDmGroupAccessWithLists({
|
|
908
|
-
isGroup: !isDirectMessage,
|
|
909
|
-
dmPolicy,
|
|
910
|
-
groupPolicy: senderGroupPolicy,
|
|
911
|
-
allowFrom: configuredDmAllowFrom,
|
|
912
|
-
groupAllowFrom,
|
|
913
|
-
storeAllowFrom: storedAllowFrom,
|
|
914
|
-
groupAllowFromFallbackToAllowFrom: false,
|
|
915
|
-
isSenderAllowed: (allowFrom) => resolveMSTeamsAllowlistMatch({
|
|
916
|
-
allowFrom,
|
|
917
|
-
senderId,
|
|
918
|
-
senderName,
|
|
919
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
920
|
-
}).allowed
|
|
921
|
-
});
|
|
922
|
-
const effectiveDmAllowFrom = access.effectiveAllowFrom;
|
|
923
|
-
if (isDirectMessage && msteamsCfg && access.decision !== "allow") {
|
|
924
|
-
if (access.reason === "dmPolicy=disabled") {
|
|
925
|
-
log.debug?.("dropping dm (dms disabled)");
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
const allowMatch = resolveMSTeamsAllowlistMatch({
|
|
929
|
-
allowFrom: effectiveDmAllowFrom,
|
|
930
|
-
senderId,
|
|
931
|
-
senderName,
|
|
932
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
933
|
-
});
|
|
934
|
-
if (access.decision === "pairing") {
|
|
935
|
-
if (await pairing.upsertPairingRequest({
|
|
936
|
-
id: senderId,
|
|
937
|
-
meta: { name: senderName }
|
|
938
|
-
})) log.info("msteams pairing request created", {
|
|
939
|
-
sender: senderId,
|
|
940
|
-
label: senderName
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
log.debug?.("dropping dm (not allowlisted)", {
|
|
944
|
-
sender: senderId,
|
|
945
|
-
label: senderName,
|
|
946
|
-
allowlistMatch: formatAllowlistMatchMeta(allowMatch)
|
|
947
|
-
});
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
if (!isDirectMessage && msteamsCfg) {
|
|
951
|
-
if (channelGate.allowlistConfigured && !channelGate.allowed) {
|
|
952
|
-
log.debug?.("dropping group message (not in team/channel allowlist)", {
|
|
953
|
-
conversationId,
|
|
954
|
-
teamKey: channelGate.teamKey ?? "none",
|
|
955
|
-
channelKey: channelGate.channelKey ?? "none",
|
|
956
|
-
channelMatchKey: channelGate.channelMatchKey ?? "none",
|
|
957
|
-
channelMatchSource: channelGate.channelMatchSource ?? "none"
|
|
958
|
-
});
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
const senderGroupAccess = evaluateSenderGroupAccessForPolicy({
|
|
962
|
-
groupPolicy,
|
|
963
|
-
groupAllowFrom: effectiveGroupAllowFrom,
|
|
964
|
-
senderId,
|
|
965
|
-
isSenderAllowed: (_senderId, allowFrom) => resolveMSTeamsAllowlistMatch({
|
|
966
|
-
allowFrom,
|
|
967
|
-
senderId,
|
|
968
|
-
senderName,
|
|
969
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
970
|
-
}).allowed
|
|
971
|
-
});
|
|
972
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "disabled") {
|
|
973
|
-
log.debug?.("dropping group message (groupPolicy: disabled)", { conversationId });
|
|
974
|
-
return;
|
|
975
|
-
}
|
|
976
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "empty_allowlist") {
|
|
977
|
-
log.debug?.("dropping group message (groupPolicy: allowlist, no allowlist)", { conversationId });
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
980
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "sender_not_allowlisted") {
|
|
981
|
-
const allowMatch = resolveMSTeamsAllowlistMatch({
|
|
982
|
-
allowFrom: effectiveGroupAllowFrom,
|
|
983
|
-
senderId,
|
|
984
|
-
senderName,
|
|
985
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
986
|
-
});
|
|
987
|
-
log.debug?.("dropping group message (not in groupAllowFrom)", {
|
|
988
|
-
sender: senderId,
|
|
989
|
-
label: senderName,
|
|
990
|
-
allowlistMatch: formatAllowlistMatchMeta(allowMatch)
|
|
991
|
-
});
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
const commandDmAllowFrom = isDirectMessage ? effectiveDmAllowFrom : configuredDmAllowFrom;
|
|
996
|
-
const ownerAllowedForCommands = isMSTeamsGroupAllowed({
|
|
997
|
-
groupPolicy: "allowlist",
|
|
998
|
-
allowFrom: commandDmAllowFrom,
|
|
999
|
-
senderId,
|
|
1000
|
-
senderName,
|
|
1001
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
1002
|
-
});
|
|
1003
|
-
const groupAllowedForCommands = isMSTeamsGroupAllowed({
|
|
1004
|
-
groupPolicy: "allowlist",
|
|
1005
|
-
allowFrom: effectiveGroupAllowFrom,
|
|
1006
|
-
senderId,
|
|
1007
|
-
senderName,
|
|
1008
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
1009
|
-
});
|
|
1010
|
-
const { commandAuthorized, shouldBlock } = resolveDualTextControlCommandGate({
|
|
1011
|
-
useAccessGroups,
|
|
1012
|
-
primaryConfigured: commandDmAllowFrom.length > 0,
|
|
1013
|
-
primaryAllowed: ownerAllowedForCommands,
|
|
1014
|
-
secondaryConfigured: effectiveGroupAllowFrom.length > 0,
|
|
1015
|
-
secondaryAllowed: groupAllowedForCommands,
|
|
1016
|
-
hasControlCommand: core.channel.text.hasControlCommand(text, cfg)
|
|
1017
|
-
});
|
|
1018
|
-
if (shouldBlock) {
|
|
1019
|
-
logInboundDrop({
|
|
1020
|
-
log: logVerboseMessage,
|
|
1021
|
-
channel: "msteams",
|
|
1022
|
-
reason: "control command (unauthorized)",
|
|
1023
|
-
target: senderId
|
|
1024
|
-
});
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
const agent = activity.recipient;
|
|
1028
|
-
const conversationRef = {
|
|
1029
|
-
activityId: activity.id,
|
|
1030
|
-
user: {
|
|
1031
|
-
id: from.id,
|
|
1032
|
-
name: from.name,
|
|
1033
|
-
aadObjectId: from.aadObjectId
|
|
1034
|
-
},
|
|
1035
|
-
agent,
|
|
1036
|
-
bot: agent ? {
|
|
1037
|
-
id: agent.id,
|
|
1038
|
-
name: agent.name
|
|
1039
|
-
} : void 0,
|
|
1040
|
-
conversation: {
|
|
1041
|
-
id: conversationId,
|
|
1042
|
-
conversationType,
|
|
1043
|
-
tenantId: conversation?.tenantId
|
|
1044
|
-
},
|
|
1045
|
-
teamId,
|
|
1046
|
-
channelId: activity.channelId,
|
|
1047
|
-
serviceUrl: activity.serviceUrl,
|
|
1048
|
-
locale: activity.locale
|
|
1049
|
-
};
|
|
1050
|
-
conversationStore.upsert(conversationId, conversationRef).catch((err) => {
|
|
1051
|
-
log.debug?.("failed to save conversation reference", { error: formatUnknownError(err) });
|
|
1052
|
-
});
|
|
1053
|
-
const pollVote = extractMSTeamsPollVote(activity);
|
|
1054
|
-
if (pollVote) {
|
|
1055
|
-
try {
|
|
1056
|
-
if (!await pollStore.recordVote({
|
|
1057
|
-
pollId: pollVote.pollId,
|
|
1058
|
-
voterId: senderId,
|
|
1059
|
-
selections: pollVote.selections
|
|
1060
|
-
})) log.debug?.("poll vote ignored (poll not found)", { pollId: pollVote.pollId });
|
|
1061
|
-
else log.info("recorded poll vote", {
|
|
1062
|
-
pollId: pollVote.pollId,
|
|
1063
|
-
voter: senderId,
|
|
1064
|
-
selections: pollVote.selections
|
|
1065
|
-
});
|
|
1066
|
-
} catch (err) {
|
|
1067
|
-
log.error("failed to record poll vote", {
|
|
1068
|
-
pollId: pollVote.pollId,
|
|
1069
|
-
error: formatUnknownError(err)
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
return;
|
|
1073
|
-
}
|
|
1074
|
-
if (!rawBody) {
|
|
1075
|
-
log.debug?.("skipping empty message after stripping mentions");
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
const teamsFrom = isDirectMessage ? `msteams:${senderId}` : isChannel ? `msteams:channel:${conversationId}` : `msteams:group:${conversationId}`;
|
|
1079
|
-
const teamsTo = isDirectMessage ? `user:${senderId}` : `conversation:${conversationId}`;
|
|
1080
|
-
const route = core.channel.routing.resolveAgentRoute({
|
|
1081
|
-
cfg,
|
|
1082
|
-
channel: "msteams",
|
|
1083
|
-
peer: {
|
|
1084
|
-
kind: isDirectMessage ? "direct" : isChannel ? "channel" : "group",
|
|
1085
|
-
id: isDirectMessage ? senderId : conversationId
|
|
1086
|
-
}
|
|
1087
|
-
});
|
|
1088
|
-
const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
|
|
1089
|
-
const inboundLabel = isDirectMessage ? `Teams DM from ${senderName}` : `Teams message in ${conversationType} from ${senderName}`;
|
|
1090
|
-
core.system.enqueueSystemEvent(`${inboundLabel}: ${preview}`, {
|
|
1091
|
-
sessionKey: route.sessionKey,
|
|
1092
|
-
contextKey: `msteams:message:${conversationId}:${activity.id ?? "unknown"}`
|
|
1093
|
-
});
|
|
1094
|
-
const channelId = conversationId;
|
|
1095
|
-
const { teamConfig, channelConfig } = channelGate;
|
|
1096
|
-
const { requireMention, replyStyle } = resolveMSTeamsReplyPolicy({
|
|
1097
|
-
isDirectMessage,
|
|
1098
|
-
globalConfig: msteamsCfg,
|
|
1099
|
-
teamConfig,
|
|
1100
|
-
channelConfig
|
|
1101
|
-
});
|
|
1102
|
-
const timestamp = parseMSTeamsActivityTimestamp(activity.timestamp);
|
|
1103
|
-
if (!isDirectMessage) {
|
|
1104
|
-
const mentionGate = resolveMentionGating({
|
|
1105
|
-
requireMention: Boolean(requireMention),
|
|
1106
|
-
canDetectMention: true,
|
|
1107
|
-
wasMentioned: params.wasMentioned,
|
|
1108
|
-
implicitMention: params.implicitMention,
|
|
1109
|
-
shouldBypassMention: false
|
|
1110
|
-
});
|
|
1111
|
-
const mentioned = mentionGate.effectiveWasMentioned;
|
|
1112
|
-
if (requireMention && mentionGate.shouldSkip) {
|
|
1113
|
-
log.debug?.("skipping message (mention required)", {
|
|
1114
|
-
teamId,
|
|
1115
|
-
channelId,
|
|
1116
|
-
requireMention,
|
|
1117
|
-
mentioned
|
|
1118
|
-
});
|
|
1119
|
-
recordPendingHistoryEntryIfEnabled({
|
|
1120
|
-
historyMap: conversationHistories,
|
|
1121
|
-
historyKey: conversationId,
|
|
1122
|
-
limit: historyLimit,
|
|
1123
|
-
entry: {
|
|
1124
|
-
sender: senderName,
|
|
1125
|
-
body: rawBody,
|
|
1126
|
-
timestamp: timestamp?.getTime(),
|
|
1127
|
-
messageId: activity.id ?? void 0
|
|
1128
|
-
}
|
|
1129
|
-
});
|
|
1130
|
-
return;
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
const mediaPayload = buildMSTeamsMediaPayload(await resolveMSTeamsInboundMedia({
|
|
1134
|
-
attachments,
|
|
1135
|
-
htmlSummary: htmlSummary ?? void 0,
|
|
1136
|
-
maxBytes: mediaMaxBytes,
|
|
1137
|
-
tokenProvider,
|
|
1138
|
-
allowHosts: msteamsCfg?.mediaAllowHosts,
|
|
1139
|
-
authAllowHosts: msteamsCfg?.mediaAuthAllowHosts,
|
|
1140
|
-
conversationType,
|
|
1141
|
-
conversationId,
|
|
1142
|
-
conversationMessageId: conversationMessageId ?? void 0,
|
|
1143
|
-
activity: {
|
|
1144
|
-
id: activity.id,
|
|
1145
|
-
replyToId: activity.replyToId,
|
|
1146
|
-
channelData: activity.channelData
|
|
1147
|
-
},
|
|
1148
|
-
log,
|
|
1149
|
-
preserveFilenames: cfg.media?.preserveFilenames
|
|
1150
|
-
}));
|
|
1151
|
-
const envelopeFrom = isDirectMessage ? senderName : conversationType;
|
|
1152
|
-
const { storePath, envelopeOptions, previousTimestamp } = resolveInboundSessionEnvelopeContext({
|
|
1153
|
-
cfg,
|
|
1154
|
-
agentId: route.agentId,
|
|
1155
|
-
sessionKey: route.sessionKey
|
|
1156
|
-
});
|
|
1157
|
-
let combinedBody = core.channel.reply.formatAgentEnvelope({
|
|
1158
|
-
channel: "Teams",
|
|
1159
|
-
from: envelopeFrom,
|
|
1160
|
-
timestamp,
|
|
1161
|
-
previousTimestamp,
|
|
1162
|
-
envelope: envelopeOptions,
|
|
1163
|
-
body: rawBody
|
|
1164
|
-
});
|
|
1165
|
-
const isRoomish = !isDirectMessage;
|
|
1166
|
-
const historyKey = isRoomish ? conversationId : void 0;
|
|
1167
|
-
if (isRoomish && historyKey) combinedBody = buildPendingHistoryContextFromMap({
|
|
1168
|
-
historyMap: conversationHistories,
|
|
1169
|
-
historyKey,
|
|
1170
|
-
limit: historyLimit,
|
|
1171
|
-
currentMessage: combinedBody,
|
|
1172
|
-
formatEntry: (entry) => core.channel.reply.formatAgentEnvelope({
|
|
1173
|
-
channel: "Teams",
|
|
1174
|
-
from: conversationType,
|
|
1175
|
-
timestamp: entry.timestamp,
|
|
1176
|
-
body: `${entry.sender}: ${entry.body}${entry.messageId ? ` [id:${entry.messageId}]` : ""}`,
|
|
1177
|
-
envelope: envelopeOptions
|
|
1178
|
-
})
|
|
1179
|
-
});
|
|
1180
|
-
const inboundHistory = isRoomish && historyKey && historyLimit > 0 ? (conversationHistories.get(historyKey) ?? []).map((entry) => ({
|
|
1181
|
-
sender: entry.sender,
|
|
1182
|
-
body: entry.body,
|
|
1183
|
-
timestamp: entry.timestamp
|
|
1184
|
-
})) : void 0;
|
|
1185
|
-
const commandBody = text.trim();
|
|
1186
|
-
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
1187
|
-
Body: combinedBody,
|
|
1188
|
-
BodyForAgent: rawBody,
|
|
1189
|
-
InboundHistory: inboundHistory,
|
|
1190
|
-
RawBody: rawBody,
|
|
1191
|
-
CommandBody: commandBody,
|
|
1192
|
-
BodyForCommands: commandBody,
|
|
1193
|
-
From: teamsFrom,
|
|
1194
|
-
To: teamsTo,
|
|
1195
|
-
SessionKey: route.sessionKey,
|
|
1196
|
-
AccountId: route.accountId,
|
|
1197
|
-
ChatType: isDirectMessage ? "direct" : isChannel ? "channel" : "group",
|
|
1198
|
-
ConversationLabel: envelopeFrom,
|
|
1199
|
-
GroupSubject: !isDirectMessage ? conversationType : void 0,
|
|
1200
|
-
SenderName: senderName,
|
|
1201
|
-
SenderId: senderId,
|
|
1202
|
-
Provider: "msteams",
|
|
1203
|
-
Surface: "msteams",
|
|
1204
|
-
MessageSid: activity.id,
|
|
1205
|
-
Timestamp: timestamp?.getTime() ?? Date.now(),
|
|
1206
|
-
WasMentioned: isDirectMessage || params.wasMentioned || params.implicitMention,
|
|
1207
|
-
CommandAuthorized: commandAuthorized,
|
|
1208
|
-
OriginatingChannel: "msteams",
|
|
1209
|
-
OriginatingTo: teamsTo,
|
|
1210
|
-
...mediaPayload
|
|
1211
|
-
});
|
|
1212
|
-
await core.channel.session.recordInboundSession({
|
|
1213
|
-
storePath,
|
|
1214
|
-
sessionKey: ctxPayload.SessionKey ?? route.sessionKey,
|
|
1215
|
-
ctx: ctxPayload,
|
|
1216
|
-
onRecordError: (err) => {
|
|
1217
|
-
logVerboseMessage(`msteams: failed updating session meta: ${String(err)}`);
|
|
1218
|
-
}
|
|
1219
|
-
});
|
|
1220
|
-
logVerboseMessage(`msteams inbound: from=${ctxPayload.From} preview="${preview}"`);
|
|
1221
|
-
const sharePointSiteId = msteamsCfg?.sharePointSiteId;
|
|
1222
|
-
const { dispatcher, replyOptions, markDispatchIdle } = createMSTeamsReplyDispatcher({
|
|
1223
|
-
cfg,
|
|
1224
|
-
agentId: route.agentId,
|
|
1225
|
-
accountId: route.accountId,
|
|
1226
|
-
runtime,
|
|
1227
|
-
log,
|
|
1228
|
-
adapter,
|
|
1229
|
-
appId,
|
|
1230
|
-
conversationRef,
|
|
1231
|
-
context,
|
|
1232
|
-
replyStyle,
|
|
1233
|
-
textLimit,
|
|
1234
|
-
onSentMessageIds: (ids) => {
|
|
1235
|
-
for (const id of ids) recordMSTeamsSentMessage(conversationId, id);
|
|
1236
|
-
},
|
|
1237
|
-
tokenProvider,
|
|
1238
|
-
sharePointSiteId
|
|
1239
|
-
});
|
|
1240
|
-
log.info("dispatching to agent", { sessionKey: route.sessionKey });
|
|
1241
|
-
try {
|
|
1242
|
-
const { queuedFinal, counts } = await dispatchReplyFromConfigWithSettledDispatcher({
|
|
1243
|
-
cfg,
|
|
1244
|
-
ctxPayload,
|
|
1245
|
-
dispatcher,
|
|
1246
|
-
onSettled: () => {
|
|
1247
|
-
markDispatchIdle();
|
|
1248
|
-
},
|
|
1249
|
-
replyOptions
|
|
1250
|
-
});
|
|
1251
|
-
log.info("dispatch complete", {
|
|
1252
|
-
queuedFinal,
|
|
1253
|
-
counts
|
|
1254
|
-
});
|
|
1255
|
-
if (!queuedFinal) {
|
|
1256
|
-
if (isRoomish && historyKey) clearHistoryEntriesIfEnabled({
|
|
1257
|
-
historyMap: conversationHistories,
|
|
1258
|
-
historyKey,
|
|
1259
|
-
limit: historyLimit
|
|
1260
|
-
});
|
|
1261
|
-
return;
|
|
1262
|
-
}
|
|
1263
|
-
const finalCount = counts.final;
|
|
1264
|
-
logVerboseMessage(`msteams: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${teamsTo}`);
|
|
1265
|
-
if (isRoomish && historyKey) clearHistoryEntriesIfEnabled({
|
|
1266
|
-
historyMap: conversationHistories,
|
|
1267
|
-
historyKey,
|
|
1268
|
-
limit: historyLimit
|
|
1269
|
-
});
|
|
1270
|
-
} catch (err) {
|
|
1271
|
-
log.error("dispatch failed", { error: String(err) });
|
|
1272
|
-
runtime.error?.(`msteams dispatch failed: ${String(err)}`);
|
|
1273
|
-
try {
|
|
1274
|
-
await context.sendActivity(`⚠️ Agent failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1275
|
-
} catch {}
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
const inboundDebouncer = core.channel.debounce.createInboundDebouncer({
|
|
1279
|
-
debounceMs: inboundDebounceMs,
|
|
1280
|
-
buildKey: (entry) => {
|
|
1281
|
-
const conversationId = normalizeMSTeamsConversationId(entry.context.activity.conversation?.id ?? "");
|
|
1282
|
-
const senderId = entry.context.activity.from?.aadObjectId ?? entry.context.activity.from?.id ?? "";
|
|
1283
|
-
if (!senderId || !conversationId) return null;
|
|
1284
|
-
return `msteams:${appId}:${conversationId}:${senderId}`;
|
|
1285
|
-
},
|
|
1286
|
-
shouldDebounce: (entry) => {
|
|
1287
|
-
if (!entry.text.trim()) return false;
|
|
1288
|
-
if (entry.attachments.length > 0) return false;
|
|
1289
|
-
return !core.channel.text.hasControlCommand(entry.text, cfg);
|
|
1290
|
-
},
|
|
1291
|
-
onFlush: async (entries) => {
|
|
1292
|
-
const last = entries.at(-1);
|
|
1293
|
-
if (!last) return;
|
|
1294
|
-
if (entries.length === 1) {
|
|
1295
|
-
await handleTeamsMessageNow(last);
|
|
1296
|
-
return;
|
|
1297
|
-
}
|
|
1298
|
-
const combinedText = entries.map((entry) => entry.text).filter(Boolean).join("\n");
|
|
1299
|
-
if (!combinedText.trim()) return;
|
|
1300
|
-
const combinedRawText = entries.map((entry) => entry.rawText).filter(Boolean).join("\n");
|
|
1301
|
-
const wasMentioned = entries.some((entry) => entry.wasMentioned);
|
|
1302
|
-
const implicitMention = entries.some((entry) => entry.implicitMention);
|
|
1303
|
-
await handleTeamsMessageNow({
|
|
1304
|
-
context: last.context,
|
|
1305
|
-
rawText: combinedRawText,
|
|
1306
|
-
text: combinedText,
|
|
1307
|
-
attachments: [],
|
|
1308
|
-
wasMentioned,
|
|
1309
|
-
implicitMention
|
|
1310
|
-
});
|
|
1311
|
-
},
|
|
1312
|
-
onError: (err) => {
|
|
1313
|
-
runtime.error?.(`msteams debounce flush failed: ${String(err)}`);
|
|
1314
|
-
}
|
|
1315
|
-
});
|
|
1316
|
-
return async function handleTeamsMessage(context) {
|
|
1317
|
-
const activity = context.activity;
|
|
1318
|
-
const rawText = activity.text?.trim() ?? "";
|
|
1319
|
-
const text = stripMSTeamsMentionTags(rawText);
|
|
1320
|
-
const attachments = Array.isArray(activity.attachments) ? activity.attachments : [];
|
|
1321
|
-
const wasMentioned = wasMSTeamsBotMentioned(activity);
|
|
1322
|
-
const conversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
|
|
1323
|
-
const replyToId = activity.replyToId ?? void 0;
|
|
1324
|
-
const implicitMention = Boolean(conversationId && replyToId && wasMSTeamsMessageSent(conversationId, replyToId));
|
|
1325
|
-
await inboundDebouncer.enqueue({
|
|
1326
|
-
context,
|
|
1327
|
-
rawText,
|
|
1328
|
-
text,
|
|
1329
|
-
attachments,
|
|
1330
|
-
wasMentioned,
|
|
1331
|
-
implicitMention
|
|
1332
|
-
});
|
|
1333
|
-
};
|
|
1334
|
-
}
|
|
1335
|
-
//#endregion
|
|
1336
|
-
//#region extensions/msteams/src/monitor-handler.ts
|
|
1337
|
-
/**
|
|
1338
|
-
* Handle fileConsent/invoke activities for large file uploads.
|
|
1339
|
-
*/
|
|
1340
|
-
async function handleFileConsentInvoke(context, log) {
|
|
1341
|
-
const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
|
|
1342
|
-
const activity = context.activity;
|
|
1343
|
-
if (activity.type !== "invoke" || activity.name !== "fileConsent/invoke") return false;
|
|
1344
|
-
const consentResponse = parseFileConsentInvoke(activity);
|
|
1345
|
-
if (!consentResponse) {
|
|
1346
|
-
log.debug?.("invalid file consent invoke", { value: activity.value });
|
|
1347
|
-
return false;
|
|
1348
|
-
}
|
|
1349
|
-
const uploadId = typeof consentResponse.context?.uploadId === "string" ? consentResponse.context.uploadId : void 0;
|
|
1350
|
-
const pendingFile = getPendingUpload(uploadId);
|
|
1351
|
-
if (pendingFile) {
|
|
1352
|
-
const pendingConversationId = normalizeMSTeamsConversationId(pendingFile.conversationId);
|
|
1353
|
-
const invokeConversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
|
|
1354
|
-
if (!invokeConversationId || pendingConversationId !== invokeConversationId) {
|
|
1355
|
-
log.info("file consent conversation mismatch", {
|
|
1356
|
-
uploadId,
|
|
1357
|
-
expectedConversationId: pendingConversationId,
|
|
1358
|
-
receivedConversationId: invokeConversationId || void 0
|
|
1359
|
-
});
|
|
1360
|
-
if (consentResponse.action === "accept") await context.sendActivity(expiredUploadMessage);
|
|
1361
|
-
return true;
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
if (consentResponse.action === "accept" && consentResponse.uploadInfo) if (pendingFile) {
|
|
1365
|
-
log.debug?.("user accepted file consent, uploading", {
|
|
1366
|
-
uploadId,
|
|
1367
|
-
filename: pendingFile.filename,
|
|
1368
|
-
size: pendingFile.buffer.length
|
|
1369
|
-
});
|
|
1370
|
-
try {
|
|
1371
|
-
await uploadToConsentUrl({
|
|
1372
|
-
url: consentResponse.uploadInfo.uploadUrl,
|
|
1373
|
-
buffer: pendingFile.buffer,
|
|
1374
|
-
contentType: pendingFile.contentType
|
|
1375
|
-
});
|
|
1376
|
-
const fileInfoCard = buildFileInfoCard({
|
|
1377
|
-
filename: consentResponse.uploadInfo.name,
|
|
1378
|
-
contentUrl: consentResponse.uploadInfo.contentUrl,
|
|
1379
|
-
uniqueId: consentResponse.uploadInfo.uniqueId,
|
|
1380
|
-
fileType: consentResponse.uploadInfo.fileType
|
|
1381
|
-
});
|
|
1382
|
-
await context.sendActivity({
|
|
1383
|
-
type: "message",
|
|
1384
|
-
attachments: [fileInfoCard]
|
|
1385
|
-
});
|
|
1386
|
-
log.info("file upload complete", {
|
|
1387
|
-
uploadId,
|
|
1388
|
-
filename: consentResponse.uploadInfo.name,
|
|
1389
|
-
uniqueId: consentResponse.uploadInfo.uniqueId
|
|
1390
|
-
});
|
|
1391
|
-
} catch (err) {
|
|
1392
|
-
log.debug?.("file upload failed", {
|
|
1393
|
-
uploadId,
|
|
1394
|
-
error: String(err)
|
|
1395
|
-
});
|
|
1396
|
-
await context.sendActivity(`File upload failed: ${String(err)}`);
|
|
1397
|
-
} finally {
|
|
1398
|
-
removePendingUpload(uploadId);
|
|
1399
|
-
}
|
|
1400
|
-
} else {
|
|
1401
|
-
log.debug?.("pending file not found for consent", { uploadId });
|
|
1402
|
-
await context.sendActivity(expiredUploadMessage);
|
|
1403
|
-
}
|
|
1404
|
-
else {
|
|
1405
|
-
log.debug?.("user declined file consent", { uploadId });
|
|
1406
|
-
removePendingUpload(uploadId);
|
|
1407
|
-
}
|
|
1408
|
-
return true;
|
|
1409
|
-
}
|
|
1410
|
-
function registerMSTeamsHandlers(handler, deps) {
|
|
1411
|
-
const handleTeamsMessage = createMSTeamsMessageHandler(deps);
|
|
1412
|
-
const originalRun = handler.run;
|
|
1413
|
-
if (originalRun) handler.run = async (context) => {
|
|
1414
|
-
const ctx = context;
|
|
1415
|
-
if (ctx.activity?.type === "invoke" && ctx.activity?.name === "fileConsent/invoke") {
|
|
1416
|
-
await ctx.sendActivity({
|
|
1417
|
-
type: "invokeResponse",
|
|
1418
|
-
value: { status: 200 }
|
|
1419
|
-
});
|
|
1420
|
-
try {
|
|
1421
|
-
await withRevokedProxyFallback({
|
|
1422
|
-
run: async () => await handleFileConsentInvoke(ctx, deps.log),
|
|
1423
|
-
onRevoked: async () => true,
|
|
1424
|
-
onRevokedLog: () => {
|
|
1425
|
-
deps.log.debug?.("turn context revoked during file consent invoke; skipping delayed response");
|
|
1426
|
-
}
|
|
1427
|
-
});
|
|
1428
|
-
} catch (err) {
|
|
1429
|
-
deps.log.debug?.("file consent handler error", { error: String(err) });
|
|
1430
|
-
}
|
|
1431
|
-
return;
|
|
1432
|
-
}
|
|
1433
|
-
return originalRun.call(handler, context);
|
|
1434
|
-
};
|
|
1435
|
-
handler.onMessage(async (context, next) => {
|
|
1436
|
-
try {
|
|
1437
|
-
await handleTeamsMessage(context);
|
|
1438
|
-
} catch (err) {
|
|
1439
|
-
deps.runtime.error?.(`msteams handler failed: ${String(err)}`);
|
|
1440
|
-
}
|
|
1441
|
-
await next();
|
|
1442
|
-
});
|
|
1443
|
-
handler.onMembersAdded(async (context, next) => {
|
|
1444
|
-
const membersAdded = context.activity?.membersAdded ?? [];
|
|
1445
|
-
for (const member of membersAdded) if (member.id !== context.activity?.recipient?.id) deps.log.debug?.("member added", { member: member.id });
|
|
1446
|
-
await next();
|
|
1447
|
-
});
|
|
1448
|
-
return handler;
|
|
1449
|
-
}
|
|
1450
|
-
//#endregion
|
|
1451
|
-
//#region extensions/msteams/src/monitor.ts
|
|
1452
|
-
const MSTEAMS_WEBHOOK_MAX_BODY_BYTES = DEFAULT_WEBHOOK_MAX_BODY_BYTES;
|
|
1453
|
-
const MSTEAMS_WEBHOOK_INACTIVITY_TIMEOUT_MS = 3e4;
|
|
1454
|
-
const MSTEAMS_WEBHOOK_REQUEST_TIMEOUT_MS = 3e4;
|
|
1455
|
-
const MSTEAMS_WEBHOOK_HEADERS_TIMEOUT_MS = 15e3;
|
|
1456
|
-
function applyMSTeamsWebhookTimeouts(httpServer, opts) {
|
|
1457
|
-
const inactivityTimeoutMs = opts?.inactivityTimeoutMs ?? MSTEAMS_WEBHOOK_INACTIVITY_TIMEOUT_MS;
|
|
1458
|
-
const requestTimeoutMs = opts?.requestTimeoutMs ?? MSTEAMS_WEBHOOK_REQUEST_TIMEOUT_MS;
|
|
1459
|
-
const headersTimeoutMs = Math.min(opts?.headersTimeoutMs ?? MSTEAMS_WEBHOOK_HEADERS_TIMEOUT_MS, requestTimeoutMs);
|
|
1460
|
-
httpServer.setTimeout(inactivityTimeoutMs);
|
|
1461
|
-
httpServer.requestTimeout = requestTimeoutMs;
|
|
1462
|
-
httpServer.headersTimeout = headersTimeoutMs;
|
|
1463
|
-
}
|
|
1464
|
-
async function monitorMSTeamsProvider(opts) {
|
|
1465
|
-
const core = getMSTeamsRuntime();
|
|
1466
|
-
const log = core.logging.getChildLogger({ name: "msteams" });
|
|
1467
|
-
let cfg = opts.cfg;
|
|
1468
|
-
let msteamsCfg = cfg.channels?.msteams;
|
|
1469
|
-
if (!msteamsCfg?.enabled) {
|
|
1470
|
-
log.debug?.("msteams provider disabled");
|
|
1471
|
-
return {
|
|
1472
|
-
app: null,
|
|
1473
|
-
shutdown: async () => {}
|
|
1474
|
-
};
|
|
1475
|
-
}
|
|
1476
|
-
const creds = resolveMSTeamsCredentials(msteamsCfg);
|
|
1477
|
-
if (!creds) {
|
|
1478
|
-
log.error("msteams credentials not configured");
|
|
1479
|
-
return {
|
|
1480
|
-
app: null,
|
|
1481
|
-
shutdown: async () => {}
|
|
1482
|
-
};
|
|
1483
|
-
}
|
|
1484
|
-
const appId = creds.appId;
|
|
1485
|
-
const runtime = opts.runtime ?? {
|
|
1486
|
-
log: console.log,
|
|
1487
|
-
error: console.error,
|
|
1488
|
-
exit: (code) => {
|
|
1489
|
-
throw new Error(`exit ${code}`);
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
let allowFrom = msteamsCfg.allowFrom;
|
|
1493
|
-
let groupAllowFrom = msteamsCfg.groupAllowFrom;
|
|
1494
|
-
let teamsConfig = msteamsCfg.teams;
|
|
1495
|
-
const cleanAllowEntry = (entry) => entry.replace(/^(msteams|teams):/i, "").replace(/^user:/i, "").trim();
|
|
1496
|
-
const resolveAllowlistUsers = async (label, entries) => {
|
|
1497
|
-
if (entries.length === 0) return {
|
|
1498
|
-
additions: [],
|
|
1499
|
-
unresolved: []
|
|
1500
|
-
};
|
|
1501
|
-
const resolved = await resolveMSTeamsUserAllowlist({
|
|
1502
|
-
cfg,
|
|
1503
|
-
entries
|
|
1504
|
-
});
|
|
1505
|
-
const additions = [];
|
|
1506
|
-
const unresolved = [];
|
|
1507
|
-
for (const entry of resolved) if (entry.resolved && entry.id) additions.push(entry.id);
|
|
1508
|
-
else unresolved.push(entry.input);
|
|
1509
|
-
summarizeMapping(label, resolved.filter((entry) => entry.resolved && entry.id).map((entry) => `${entry.input}→${entry.id}`), unresolved, runtime);
|
|
1510
|
-
return {
|
|
1511
|
-
additions,
|
|
1512
|
-
unresolved
|
|
1513
|
-
};
|
|
1514
|
-
};
|
|
1515
|
-
try {
|
|
1516
|
-
const allowEntries = allowFrom?.map((entry) => cleanAllowEntry(String(entry))).filter((entry) => entry && entry !== "*") ?? [];
|
|
1517
|
-
if (allowEntries.length > 0) {
|
|
1518
|
-
const { additions } = await resolveAllowlistUsers("msteams users", allowEntries);
|
|
1519
|
-
allowFrom = mergeAllowlist({
|
|
1520
|
-
existing: allowFrom,
|
|
1521
|
-
additions
|
|
1522
|
-
});
|
|
1523
|
-
}
|
|
1524
|
-
if (Array.isArray(groupAllowFrom) && groupAllowFrom.length > 0) {
|
|
1525
|
-
const groupEntries = groupAllowFrom.map((entry) => cleanAllowEntry(String(entry))).filter((entry) => entry && entry !== "*");
|
|
1526
|
-
if (groupEntries.length > 0) {
|
|
1527
|
-
const { additions } = await resolveAllowlistUsers("msteams group users", groupEntries);
|
|
1528
|
-
groupAllowFrom = mergeAllowlist({
|
|
1529
|
-
existing: groupAllowFrom,
|
|
1530
|
-
additions
|
|
1531
|
-
});
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
if (teamsConfig && Object.keys(teamsConfig).length > 0) {
|
|
1535
|
-
const entries = [];
|
|
1536
|
-
for (const [teamKey, teamCfg] of Object.entries(teamsConfig)) {
|
|
1537
|
-
if (teamKey === "*") continue;
|
|
1538
|
-
const channels = teamCfg?.channels ?? {};
|
|
1539
|
-
const channelKeys = Object.keys(channels).filter((key) => key !== "*");
|
|
1540
|
-
if (channelKeys.length === 0) {
|
|
1541
|
-
entries.push({
|
|
1542
|
-
input: teamKey,
|
|
1543
|
-
teamKey
|
|
1544
|
-
});
|
|
1545
|
-
continue;
|
|
1546
|
-
}
|
|
1547
|
-
for (const channelKey of channelKeys) entries.push({
|
|
1548
|
-
input: `${teamKey}/${channelKey}`,
|
|
1549
|
-
teamKey,
|
|
1550
|
-
channelKey
|
|
1551
|
-
});
|
|
1552
|
-
}
|
|
1553
|
-
if (entries.length > 0) {
|
|
1554
|
-
const resolved = await resolveMSTeamsChannelAllowlist({
|
|
1555
|
-
cfg,
|
|
1556
|
-
entries: entries.map((entry) => entry.input)
|
|
1557
|
-
});
|
|
1558
|
-
const mapping = [];
|
|
1559
|
-
const unresolved = [];
|
|
1560
|
-
const nextTeams = { ...teamsConfig };
|
|
1561
|
-
resolved.forEach((entry, idx) => {
|
|
1562
|
-
const source = entries[idx];
|
|
1563
|
-
if (!source) return;
|
|
1564
|
-
const sourceTeam = teamsConfig?.[source.teamKey] ?? {};
|
|
1565
|
-
if (!entry.resolved || !entry.teamId) {
|
|
1566
|
-
unresolved.push(entry.input);
|
|
1567
|
-
return;
|
|
1568
|
-
}
|
|
1569
|
-
mapping.push(entry.channelId ? `${entry.input}→${entry.teamId}/${entry.channelId}` : `${entry.input}→${entry.teamId}`);
|
|
1570
|
-
const existing = nextTeams[entry.teamId] ?? {};
|
|
1571
|
-
const mergedChannels = {
|
|
1572
|
-
...sourceTeam.channels,
|
|
1573
|
-
...existing.channels
|
|
1574
|
-
};
|
|
1575
|
-
const mergedTeam = {
|
|
1576
|
-
...sourceTeam,
|
|
1577
|
-
...existing,
|
|
1578
|
-
channels: mergedChannels
|
|
1579
|
-
};
|
|
1580
|
-
nextTeams[entry.teamId] = mergedTeam;
|
|
1581
|
-
if (source.channelKey && entry.channelId) {
|
|
1582
|
-
const sourceChannel = sourceTeam.channels?.[source.channelKey];
|
|
1583
|
-
if (sourceChannel) nextTeams[entry.teamId] = {
|
|
1584
|
-
...mergedTeam,
|
|
1585
|
-
channels: {
|
|
1586
|
-
...mergedChannels,
|
|
1587
|
-
[entry.channelId]: {
|
|
1588
|
-
...sourceChannel,
|
|
1589
|
-
...mergedChannels?.[entry.channelId]
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
};
|
|
1593
|
-
}
|
|
1594
|
-
});
|
|
1595
|
-
teamsConfig = nextTeams;
|
|
1596
|
-
summarizeMapping("msteams channels", mapping, unresolved, runtime);
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
} catch (err) {
|
|
1600
|
-
runtime.log?.(`msteams resolve failed; using config entries. ${String(err)}`);
|
|
1601
|
-
}
|
|
1602
|
-
msteamsCfg = {
|
|
1603
|
-
...msteamsCfg,
|
|
1604
|
-
allowFrom,
|
|
1605
|
-
groupAllowFrom,
|
|
1606
|
-
teams: teamsConfig
|
|
1607
|
-
};
|
|
1608
|
-
cfg = {
|
|
1609
|
-
...cfg,
|
|
1610
|
-
channels: {
|
|
1611
|
-
...cfg.channels,
|
|
1612
|
-
msteams: msteamsCfg
|
|
1613
|
-
}
|
|
1614
|
-
};
|
|
1615
|
-
const port = msteamsCfg.webhook?.port ?? 3978;
|
|
1616
|
-
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "msteams");
|
|
1617
|
-
const MB = 1024 * 1024;
|
|
1618
|
-
const agentDefaults = cfg.agents?.defaults;
|
|
1619
|
-
const mediaMaxBytes = typeof agentDefaults?.mediaMaxMb === "number" && agentDefaults.mediaMaxMb > 0 ? Math.floor(agentDefaults.mediaMaxMb * MB) : 8 * MB;
|
|
1620
|
-
const conversationStore = opts.conversationStore ?? createMSTeamsConversationStoreFs();
|
|
1621
|
-
const pollStore = opts.pollStore ?? createMSTeamsPollStoreFs();
|
|
1622
|
-
log.info(`starting provider (port ${port})`);
|
|
1623
|
-
const express = await import("express");
|
|
1624
|
-
const { sdk, authConfig } = await loadMSTeamsSdkWithAuth(creds);
|
|
1625
|
-
const { ActivityHandler, MsalTokenProvider, authorizeJWT } = sdk;
|
|
1626
|
-
const tokenProvider = new MsalTokenProvider(authConfig);
|
|
1627
|
-
const adapter = createMSTeamsAdapter(authConfig, sdk);
|
|
1628
|
-
const handler = registerMSTeamsHandlers(new ActivityHandler(), {
|
|
1629
|
-
cfg,
|
|
1630
|
-
runtime,
|
|
1631
|
-
appId,
|
|
1632
|
-
adapter,
|
|
1633
|
-
tokenProvider,
|
|
1634
|
-
textLimit,
|
|
1635
|
-
mediaMaxBytes,
|
|
1636
|
-
conversationStore,
|
|
1637
|
-
pollStore,
|
|
1638
|
-
log
|
|
1639
|
-
});
|
|
1640
|
-
const expressApp = express.default();
|
|
1641
|
-
expressApp.use(authorizeJWT(authConfig));
|
|
1642
|
-
expressApp.use(express.json({ limit: MSTEAMS_WEBHOOK_MAX_BODY_BYTES }));
|
|
1643
|
-
expressApp.use((err, _req, res, next) => {
|
|
1644
|
-
if (err && typeof err === "object" && "status" in err && err.status === 413) {
|
|
1645
|
-
res.status(413).json({ error: "Payload too large" });
|
|
1646
|
-
return;
|
|
1647
|
-
}
|
|
1648
|
-
next(err);
|
|
1649
|
-
});
|
|
1650
|
-
const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
|
|
1651
|
-
const messageHandler = (req, res) => {
|
|
1652
|
-
adapter.process(req, res, (context) => handler.run(context)).catch((err) => {
|
|
1653
|
-
log.error("msteams webhook failed", { error: formatUnknownError(err) });
|
|
1654
|
-
});
|
|
1655
|
-
};
|
|
1656
|
-
expressApp.post(configuredPath, messageHandler);
|
|
1657
|
-
if (configuredPath !== "/api/messages") expressApp.post("/api/messages", messageHandler);
|
|
1658
|
-
log.debug?.("listening on paths", {
|
|
1659
|
-
primary: configuredPath,
|
|
1660
|
-
fallback: "/api/messages"
|
|
1661
|
-
});
|
|
1662
|
-
const httpServer = expressApp.listen(port);
|
|
1663
|
-
await new Promise((resolve, reject) => {
|
|
1664
|
-
const onListening = () => {
|
|
1665
|
-
httpServer.off("error", onError);
|
|
1666
|
-
log.info(`msteams provider started on port ${port}`);
|
|
1667
|
-
resolve();
|
|
1668
|
-
};
|
|
1669
|
-
const onError = (err) => {
|
|
1670
|
-
httpServer.off("listening", onListening);
|
|
1671
|
-
log.error("msteams server error", { error: String(err) });
|
|
1672
|
-
reject(err);
|
|
1673
|
-
};
|
|
1674
|
-
httpServer.once("listening", onListening);
|
|
1675
|
-
httpServer.once("error", onError);
|
|
1676
|
-
});
|
|
1677
|
-
applyMSTeamsWebhookTimeouts(httpServer);
|
|
1678
|
-
httpServer.on("error", (err) => {
|
|
1679
|
-
log.error("msteams server error", { error: String(err) });
|
|
1680
|
-
});
|
|
1681
|
-
const shutdown = async () => {
|
|
1682
|
-
log.info("shutting down msteams provider");
|
|
1683
|
-
return new Promise((resolve) => {
|
|
1684
|
-
httpServer.close((err) => {
|
|
1685
|
-
if (err) log.debug?.("msteams server close error", { error: String(err) });
|
|
1686
|
-
resolve();
|
|
1687
|
-
});
|
|
1688
|
-
});
|
|
1689
|
-
};
|
|
1690
|
-
await keepHttpServerTaskAlive({
|
|
1691
|
-
server: httpServer,
|
|
1692
|
-
abortSignal: opts.abortSignal,
|
|
1693
|
-
onAbort: shutdown
|
|
1694
|
-
});
|
|
1695
|
-
return {
|
|
1696
|
-
app: expressApp,
|
|
1697
|
-
shutdown
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
//#endregion
|
|
1701
|
-
export { monitorMSTeamsProvider };
|