@spacebar_ai/moldclaw-core 2026.3.14 → 2026.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -3
- package/dist/account-id-plS5L20e.d.ts +1 -0
- package/dist/accounts-BAYVGC2k.js +109 -0
- package/dist/accounts-DrjRgReV.d.ts +103 -0
- package/dist/acp-cli-at_UYEOS.js +2088 -0
- package/dist/acpx-Chy1GQ_k.d.ts +5 -0
- package/dist/actions.runtime-C0F7dMfO.js +114 -0
- package/dist/actions.runtime-caI2LG9o.js +128 -0
- package/dist/agent-media-payload-CkpAqaOh.d.ts +16 -0
- package/dist/agents-B98yPGc5.js +853 -0
- package/dist/agents-BrLr08L3.js +217 -0
- package/dist/allow-from-BIwT4dl7.d.ts +42 -0
- package/dist/allow-list-CHt7yvAf.js +81 -0
- package/dist/allowlist-CxQo2wQc.js +142 -0
- package/dist/allowlist-resolution-B7ib7gye.d.ts +17 -0
- package/dist/api-Co7TNHbL.js +6953 -0
- package/dist/api-cEQ_ql_8.js +112 -0
- package/dist/audit-AnKnnlaZ.js +787 -0
- package/dist/audit-channel.collect.runtime-CAk1DFQ3.js +600 -0
- package/dist/audit-channel.runtime-5phdZp_m.js +116 -0
- package/dist/audit-extra.async-B8ZXFxic.js +813 -0
- package/dist/audit-hdKa3D-u.js +54 -0
- package/dist/audit-membership-runtime-CJV5XvGU.js +157 -0
- package/dist/audit.deep.runtime-DNMcRQrp.js +24 -0
- package/dist/audit.nondeep.runtime-DhNDL6yM.js +831 -0
- package/dist/audit.runtime-Bx7uWEh8.js +113 -0
- package/dist/auth-choice-C37W9MA7.js +268 -0
- package/dist/auth-choice-CNppOY_V.js +117 -0
- package/dist/auth-choice-XYFnp6fI.js +502 -0
- package/dist/auth-choice-options-D6oZY4Xo.js +123 -0
- package/dist/auth-choice-prompt-BhRqchJx.js +110 -0
- package/dist/auth-choice-prompt-C1xv0N08.js +36 -0
- package/dist/auth-choice.plugin-providers.runtime-DhLEtbmR.js +114 -0
- package/dist/auth-profiles-9zZdaXJK.js +127756 -0
- package/dist/auth-profiles.runtime-HONFDgiu.js +111 -0
- package/dist/bluebubbles-BY8JhO4y.js +64 -0
- package/dist/bluebubbles-CQjEnzK_.d.ts +6 -0
- package/dist/bluebubbles-RmcKgkBa.d.ts +45 -0
- package/dist/boolean-param-F1sMwnPu.d.ts +5 -0
- package/dist/bot-BGh-ATV7.d.ts +478 -0
- package/dist/brave-CljenznH.js +24 -0
- package/dist/browser-cli-CX8i0wf0.js +1492 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.d.ts +6 -0
- package/dist/bundled/boot-md/handler.js +26 -26
- package/dist/bundled/bootstrap-extra-files/handler.d.ts +6 -0
- package/dist/bundled/command-logger/handler.d.ts +9 -0
- package/dist/bundled/session-memory/handler.d.ts +9 -0
- package/dist/bundled/session-memory/handler.js +27 -27
- package/dist/call-Bc257L16.js +37 -0
- package/dist/call-DYFR7oGy.js +639 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/channel-Bd-igGEW.js +803 -0
- package/dist/channel-BgRMb6bZ.js +575 -0
- package/dist/channel-BtcLrU6J.js +1598 -0
- package/dist/channel-Bwf6m_hD.js +538 -0
- package/dist/channel-C7-kgDBd.js +562 -0
- package/dist/channel-CEXOAxIc.js +949 -0
- package/dist/channel-CpZ3p9MJ.js +226 -0
- package/dist/channel-CqBlN6A2.js +619 -0
- package/dist/channel-DKhfHW4U.js +352 -0
- package/dist/channel-DS3t_KdJ2.js +316 -0
- package/dist/channel-DY24FA1v.js +4681 -0
- package/dist/channel-DYFGmImJ.js +542 -0
- package/dist/channel-DcyIqX5p.js +207 -0
- package/dist/channel-J-2XcAli.js +214 -0
- package/dist/channel-N616f4gZ.js +306 -0
- package/dist/channel-NY7aU2Gj.js +397 -0
- package/dist/channel-PNI8BOmm.js +1321 -0
- package/dist/channel-UcXepDJs.js +943 -0
- package/dist/channel-account-context-CL3hEq1j.js +103 -0
- package/dist/channel-config-schema-Q2nzcCCR.d.ts +1 -0
- package/dist/channel-jA_jodJo.js +920 -0
- package/dist/channel-options-CtgU5qkG.js +50 -0
- package/dist/channel-policy-7wXDp6d3.d.ts +1 -0
- package/dist/channel-rGI8uig4.js +497 -0
- package/dist/channel-summary-DGJZXo0r.js +106 -0
- package/dist/channel.runtime--WZvlNJM.js +413 -0
- package/dist/channel.runtime-B0ct42DL.js +122 -0
- package/dist/channel.runtime-BEZUZrYB.js +177 -0
- package/dist/channel.runtime-BMuWmsIC.js +166 -0
- package/dist/channel.runtime-BtvHP0po.js +4006 -0
- package/dist/channel.runtime-Cwf993pX.js +194 -0
- package/dist/channel.runtime-Cy4lEpTX.js +174 -0
- package/dist/channel.runtime-DAz6axda.js +865 -0
- package/dist/channel.runtime-DdQ2mOVh.js +236 -0
- package/dist/channel.runtime-Dy3HPgOU.js +399 -0
- package/dist/channel.runtime-iqfC25k7.js +213 -0
- package/dist/channel.setup-B4VYMZlQ.js +9 -0
- package/dist/channel.setup-BohGbCbI.js +57 -0
- package/dist/channel.setup-Bq2AQqqc.js +6 -0
- package/dist/channel.setup-BxiSfLp1.js +8 -0
- package/dist/channel.setup-DOUS6fjO.js +8 -0
- package/dist/channel.setup-DXhdYU3g.js +9 -0
- package/dist/channel.setup-N51CgfNy.js +11 -0
- package/dist/channels/plugins/actions/discord.d.ts +3 -0
- package/dist/channels/plugins/actions/discord.js +26 -26
- package/dist/channels/plugins/actions/signal.d.ts +2 -0
- package/dist/channels/plugins/actions/signal.js +26 -26
- package/dist/channels/plugins/actions/telegram.d.ts +3 -0
- package/dist/channels/plugins/actions/telegram.js +26 -26
- package/dist/channels/plugins/agent-tools/whatsapp-login.d.ts +4 -0
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +26 -26
- package/dist/channels-CueeFf0q.js +404 -0
- package/dist/channels-PheAd73E.js +1113 -0
- package/dist/channels-cli-CXzVF84v.js +286 -0
- package/dist/channels-status-issues-BjWBQHhU.js +16 -0
- package/dist/chat-type-BlSN0vo4.d.ts +5 -0
- package/dist/clawbot-cli-BBehDXW1.js +113 -0
- package/dist/cli/daemon-cli.d.ts +58 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-CIm7d5Id.js +149 -0
- package/dist/command-format-pq3tS8t2.d.ts +4 -0
- package/dist/command-registry-CDkp__KH.js +13 -0
- package/dist/command-registry-DSEkUBW1.js +212 -0
- package/dist/command-secret-gateway-CqP_o0n8.js +106 -0
- package/dist/compact.runtime-Qm_csEtG.js +111 -0
- package/dist/completion-cli-Ch1sgSLQ.js +445 -0
- package/dist/completion-cli-vF067Tso.js +16 -0
- package/dist/config-B2W1zTP1.js +44 -0
- package/dist/config-CMhKplgO.js +938 -0
- package/dist/config-DchtRsvs.js +30 -0
- package/dist/config-cli-C41d88_c.js +428 -0
- package/dist/config-guard-B_vjkXCQ.js +117 -0
- package/dist/config-schema-pPBCF4hz.js +31 -0
- package/dist/config-validation-6om9cBUx.js +262 -0
- package/dist/config-value-Dl3XEpA6.js +132 -0
- package/dist/configure-BxzvDSzu.js +1100 -0
- package/dist/configure-CLMLoWAn.js +238 -0
- package/dist/control-ui-shared-E8Nz6uKZ.js +29 -0
- package/dist/core-Cd3fMFKq.d.ts +87 -0
- package/dist/credentials-yYt6VWCq.js +268 -0
- package/dist/cron-cli-CA3lV3kh.js +634 -0
- package/dist/daemon-cli-BtQuIXEk.js +339 -0
- package/dist/daemon-install-BWKGzgMm.js +175 -0
- package/dist/deliver-CgMNmfTy.js +106 -0
- package/dist/deliver-runtime-Bn1KWoiQ.js +106 -0
- package/dist/devices-cli-D601npiL.js +340 -0
- package/dist/diagnostic-CkiYEGqt.js +310 -0
- package/dist/diffs-B5tZ8Coj.d.ts +1 -0
- package/dist/directory-cli-skEV8MT7.js +306 -0
- package/dist/directory-config-helpers-B-tiBKIv.d.ts +38 -0
- package/dist/directory-runtime-BEJ2fCIR.d.ts +1 -0
- package/dist/directory.static-CnyzoWbV.js +44 -0
- package/dist/discord-B_gbzPti.js +109 -0
- package/dist/discovery-CqI-e_Mv.js +48 -0
- package/dist/dm-policy-shared-nybkS1uP.d.ts +95 -0
- package/dist/dns-cli-Cjes3Ruw.js +216 -0
- package/dist/docs-cli-C3g3Gi_d.js +173 -0
- package/dist/doctor-completion-TvgV4SZH.js +90 -0
- package/dist/doctor-config-flow-0w9Ux7V8.js +107 -0
- package/dist/doctor-config-flow-DLzr8W7Y.js +2437 -0
- package/dist/enable-VYzv8b2z.js +24 -0
- package/dist/entry.d.ts +7 -0
- package/dist/entry.js +1 -1
- package/dist/env-overrides-DYVIkuvN.js +434 -0
- package/dist/env-overrides.runtime-6kijpIuu.js +17 -0
- package/dist/exec-approvals-cli-D_lkTG-l.js +419 -0
- package/dist/exec-sVmouhA9.d.ts +39 -0
- package/dist/extensions/acpx/index.d.ts +11 -0
- package/dist/extensions/acpx/index.js +1 -1
- package/dist/extensions/amazon-bedrock/index.d.ts +11 -0
- package/dist/extensions/anthropic/index.d.ts +11 -0
- package/dist/extensions/anthropic/index.js +26 -26
- package/dist/extensions/bluebubbles/index.d.ts +11 -0
- package/dist/extensions/bluebubbles/index.js +30 -30
- package/dist/extensions/bluebubbles/setup-entry.d.ts +59 -0
- package/dist/extensions/bluebubbles/setup-entry.js +30 -30
- package/dist/extensions/brave/index.d.ts +11 -0
- package/dist/extensions/brave/index.js +2 -2
- package/dist/extensions/byteplus/index.d.ts +11 -0
- package/dist/extensions/byteplus/index.js +26 -26
- package/dist/extensions/cloudflare-ai-gateway/index.d.ts +11 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +27 -27
- package/dist/extensions/copilot-proxy/index.d.ts +11 -0
- package/dist/extensions/device-pair/index.d.ts +12 -0
- package/dist/extensions/diagnostics-otel/index.d.ts +11 -0
- package/dist/extensions/diffs/index.d.ts +11 -0
- package/dist/extensions/discord/index.d.ts +11 -0
- package/dist/extensions/discord/index.js +31 -31
- package/dist/extensions/discord/setup-entry.d.ts +7 -0
- package/dist/extensions/discord/setup-entry.js +29 -29
- package/dist/extensions/elevenlabs/index.d.ts +11 -0
- package/dist/extensions/elevenlabs/index.js +26 -26
- package/dist/extensions/feishu/index.d.ts +229 -0
- package/dist/extensions/feishu/index.js +31 -31
- package/dist/extensions/feishu/setup-entry.d.ts +9 -0
- package/dist/extensions/feishu/setup-entry.js +28 -28
- package/dist/extensions/firecrawl/index.d.ts +11 -0
- package/dist/extensions/firecrawl/index.js +26 -26
- package/dist/extensions/github-copilot/index.d.ts +11 -0
- package/dist/extensions/github-copilot/index.js +27 -27
- package/dist/extensions/google/index.d.ts +11 -0
- package/dist/extensions/google/index.js +26 -26
- package/dist/extensions/googlechat/index.d.ts +11 -0
- package/dist/extensions/googlechat/index.js +30 -30
- package/dist/extensions/googlechat/setup-entry.d.ts +19 -0
- package/dist/extensions/googlechat/setup-entry.js +30 -30
- package/dist/extensions/huggingface/index.d.ts +11 -0
- package/dist/extensions/huggingface/index.js +26 -26
- package/dist/extensions/imessage/index.d.ts +11 -0
- package/dist/extensions/imessage/index.js +30 -30
- package/dist/extensions/imessage/setup-entry.d.ts +7 -0
- package/dist/extensions/imessage/setup-entry.js +30 -30
- package/dist/extensions/irc/index.d.ts +11 -0
- package/dist/extensions/irc/index.js +29 -29
- package/dist/extensions/irc/setup-entry.d.ts +8 -0
- package/dist/extensions/irc/setup-entry.js +29 -29
- package/dist/extensions/kakao-talkchannel/index.d.ts +19 -0
- package/dist/extensions/kakao-talkchannel/index.js +1762 -0
- package/dist/extensions/kakao-talkchannel/moldclaw.plugin.json +111 -0
- package/dist/extensions/kakao-talkchannel/package.json +12 -0
- package/dist/extensions/kilocode/index.d.ts +11 -0
- package/dist/extensions/kilocode/index.js +26 -26
- package/dist/extensions/kimi-coding/index.d.ts +11 -0
- package/dist/extensions/kimi-coding/index.js +26 -26
- package/dist/extensions/line/index.d.ts +11 -0
- package/dist/extensions/line/index.js +28 -28
- package/dist/extensions/line/setup-entry.d.ts +7 -0
- package/dist/extensions/line/setup-entry.js +28 -28
- package/dist/extensions/llm-task/index.d.ts +11 -0
- package/dist/extensions/llm-task/index.js +28 -28
- package/dist/extensions/lobster/index.d.ts +11 -0
- package/dist/extensions/matrix/index.d.ts +11 -0
- package/dist/extensions/matrix/index.js +31 -31
- package/dist/extensions/matrix/setup-entry.d.ts +20 -0
- package/dist/extensions/matrix/setup-entry.js +31 -31
- package/dist/extensions/mattermost/index.d.ts +11 -0
- package/dist/extensions/mattermost/index.js +28 -28
- package/dist/extensions/mattermost/setup-entry.d.ts +88 -0
- package/dist/extensions/mattermost/setup-entry.js +28 -28
- package/dist/extensions/memory-core/index.d.ts +11 -0
- package/dist/extensions/memory-lancedb/index.d.ts +25 -0
- package/dist/extensions/microsoft/index.d.ts +11 -0
- package/dist/extensions/microsoft/index.js +26 -26
- package/dist/extensions/minimax/index.d.ts +11 -0
- package/dist/extensions/minimax/index.js +26 -26
- package/dist/extensions/mistral/index.d.ts +11 -0
- package/dist/extensions/mistral/index.js +26 -26
- package/dist/extensions/modelstudio/index.d.ts +11 -0
- package/dist/extensions/modelstudio/index.js +26 -26
- package/dist/extensions/moonshot/index.d.ts +11 -0
- package/dist/extensions/moonshot/index.js +26 -26
- package/dist/extensions/msteams/index.d.ts +11 -0
- package/dist/extensions/msteams/index.js +31 -31
- package/dist/extensions/msteams/setup-entry.d.ts +11 -0
- package/dist/extensions/msteams/setup-entry.js +31 -31
- package/dist/extensions/nextcloud-talk/index.d.ts +11 -0
- package/dist/extensions/nextcloud-talk/index.js +28 -28
- package/dist/extensions/nextcloud-talk/setup-entry.d.ts +60 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +28 -28
- package/dist/extensions/nostr/index.d.ts +11 -0
- package/dist/extensions/nostr/index.js +28 -28
- package/dist/extensions/nostr/setup-entry.d.ts +49 -0
- package/dist/extensions/nostr/setup-entry.js +28 -28
- package/dist/extensions/nvidia/index.d.ts +11 -0
- package/dist/extensions/ollama/index.d.ts +11 -0
- package/dist/extensions/open-prose/index.d.ts +11 -0
- package/dist/extensions/openai/index.d.ts +11 -0
- package/dist/extensions/openai/index.js +26 -26
- package/dist/extensions/opencode/index.d.ts +11 -0
- package/dist/extensions/opencode/index.js +26 -26
- package/dist/extensions/opencode-go/index.d.ts +11 -0
- package/dist/extensions/opencode-go/index.js +26 -26
- package/dist/extensions/openrouter/index.d.ts +11 -0
- package/dist/extensions/openrouter/index.js +26 -26
- package/dist/extensions/openshell/index.d.ts +11 -0
- package/dist/extensions/openshell/index.js +26 -26
- package/dist/extensions/perplexity/index.d.ts +11 -0
- package/dist/extensions/perplexity/index.js +2 -2
- package/dist/extensions/phone-control/index.d.ts +12 -0
- package/dist/extensions/qianfan/index.d.ts +11 -0
- package/dist/extensions/qianfan/index.js +26 -26
- package/dist/extensions/qwen-portal-auth/index.d.ts +12 -0
- package/dist/extensions/qwen-portal-auth/index.js +26 -26
- package/dist/extensions/sglang/index.d.ts +11 -0
- package/dist/extensions/sglang/index.js +26 -26
- package/dist/extensions/signal/index.d.ts +11 -0
- package/dist/extensions/signal/index.js +29 -29
- package/dist/extensions/signal/setup-entry.d.ts +7 -0
- package/dist/extensions/signal/setup-entry.js +29 -29
- package/dist/extensions/slack/index.d.ts +11 -0
- package/dist/extensions/slack/index.js +30 -30
- package/dist/extensions/slack/setup-entry.d.ts +7 -0
- package/dist/extensions/slack/setup-entry.js +29 -29
- package/dist/extensions/synology-chat/index.d.ts +11 -0
- package/dist/extensions/synology-chat/index.js +28 -28
- package/dist/extensions/synology-chat/setup-entry.d.ts +138 -0
- package/dist/extensions/synology-chat/setup-entry.js +28 -28
- package/dist/extensions/synthetic/index.d.ts +11 -0
- package/dist/extensions/synthetic/index.js +26 -26
- package/dist/extensions/talk-voice/index.d.ts +12 -0
- package/dist/extensions/talk-voice/index.js +26 -26
- package/dist/extensions/telegram/index.d.ts +11 -0
- package/dist/extensions/telegram/index.js +29 -29
- package/dist/extensions/telegram/setup-entry.d.ts +7 -0
- package/dist/extensions/telegram/setup-entry.js +28 -28
- package/dist/extensions/thread-ownership/index.d.ts +12 -0
- package/dist/extensions/tlon/index.d.ts +11 -0
- package/dist/extensions/tlon/index.js +28 -28
- package/dist/extensions/tlon/setup-entry.d.ts +7 -0
- package/dist/extensions/tlon/setup-entry.js +28 -28
- package/dist/extensions/together/index.d.ts +11 -0
- package/dist/extensions/together/index.js +26 -26
- package/dist/extensions/twitch/index.d.ts +39 -0
- package/dist/extensions/twitch/index.js +28 -28
- package/dist/extensions/venice/index.d.ts +11 -0
- package/dist/extensions/venice/index.js +26 -26
- package/dist/extensions/vercel-ai-gateway/index.d.ts +11 -0
- package/dist/extensions/vercel-ai-gateway/index.js +26 -26
- package/dist/extensions/vllm/index.d.ts +11 -0
- package/dist/extensions/vllm/index.js +26 -26
- package/dist/extensions/voice-call/index.d.ts +11 -0
- package/dist/extensions/voice-call/index.js +26 -26
- package/dist/extensions/volcengine/index.d.ts +11 -0
- package/dist/extensions/volcengine/index.js +26 -26
- package/dist/extensions/whatsapp/index.d.ts +11 -0
- package/dist/extensions/whatsapp/index.js +29 -29
- package/dist/extensions/whatsapp/setup-entry.d.ts +7 -0
- package/dist/extensions/whatsapp/setup-entry.js +29 -29
- package/dist/extensions/xai/index.d.ts +11 -0
- package/dist/extensions/xai/index.js +26 -26
- package/dist/extensions/xiaomi/index.d.ts +11 -0
- package/dist/extensions/xiaomi/index.js +26 -26
- package/dist/extensions/zai/index.d.ts +11 -0
- package/dist/extensions/zai/index.js +26 -26
- package/dist/extensions/zalo/index.d.ts +11 -0
- package/dist/extensions/zalo/index.js +30 -30
- package/dist/extensions/zalo/setup-entry.d.ts +34 -0
- package/dist/extensions/zalo/setup-entry.js +30 -30
- package/dist/extensions/zalouser/index.d.ts +11 -0
- package/dist/extensions/zalouser/index.js +31 -31
- package/dist/extensions/zalouser/setup-entry.d.ts +42 -0
- package/dist/extensions/zalouser/setup-entry.js +31 -31
- package/dist/feishu-DCKEC3ao.d.ts +36 -0
- package/dist/gateway-cli-DN1Ii6J-.js +26432 -0
- package/dist/gateway-install-token-CJYFJBaC.js +163 -0
- package/dist/gateway-rpc-CroQg9MB.js +26 -0
- package/dist/gateway-runtime-D9FRZqKP.js +69 -0
- package/dist/googlechat-CBCkerAy.js +307 -0
- package/dist/googlechat-CSUNieHX.d.ts +12 -0
- package/dist/group-access-rSvkIglb.d.ts +61 -0
- package/dist/health-B6WwLJp4.js +570 -0
- package/dist/health-CAlJydXv.js +108 -0
- package/dist/history-BwNxb0sJ.d.ts +75 -0
- package/dist/hooks-BYlfU3Nf.d.ts +6 -0
- package/dist/hooks-cli-DuKmdo_H.js +995 -0
- package/dist/http-registry-DX_LVtuK.d.ts +20 -0
- package/dist/image-generation-DKkdRpve.d.ts +9 -0
- package/dist/imessage-7abjbe2Q.js +31 -0
- package/dist/imessage-DOH1yaDE.js +110 -0
- package/dist/inbound-envelope-CmvweL6U.d.ts +78 -0
- package/dist/inbound-reply-dispatch-BvnKTOec.js +71 -0
- package/dist/inbound-reply-dispatch-C7LjHRZN.d.ts +72 -0
- package/dist/index-DTQqfqj9.d.ts +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +2 -2
- package/dist/infra/warning-filter.d.ts +10 -0
- package/dist/install-target-tXRD7VkM.js +574 -0
- package/dist/installs-C8fz8sm3.js +532 -0
- package/dist/io-C6XifaT4.js +9737 -0
- package/dist/io-C8awRnSW.js +28 -0
- package/dist/ipv4-d88_Jn2p.js +82 -0
- package/dist/irc-DpR6FXjN.js +672 -0
- package/dist/json-store-Sr_kk-II.d.ts +14 -0
- package/dist/keyed-async-queue-BA3BKukE.d.ts +19 -0
- package/dist/library-DOwowAGN.js +107 -0
- package/dist/lifecycle-core-BHHBoRTY.js +382 -0
- package/dist/line/accounts.d.ts +3 -0
- package/dist/line/send.d.ts +2 -0
- package/dist/line/send.js +4 -4
- package/dist/line/template-messages.d.ts +2 -0
- package/dist/line-8rsNbJCP.js +530 -0
- package/dist/line-D_cvIf6B.d.ts +75 -0
- package/dist/links-BOnvOj1z.d.ts +7 -0
- package/dist/llm-slug-generator-D9HjWtJT.js +67 -0
- package/dist/llm-slug-generator.d.ts +12 -0
- package/dist/llm-slug-generator.js +27 -27
- package/dist/logging-BhqLWxTD.js +13 -0
- package/dist/logging-DfaiL4OX.js +29 -0
- package/dist/login-qr-COBYR52w.js +233 -0
- package/dist/login-qr-xK4QIpPc.js +107 -0
- package/dist/logs-cli-RSSTw8L_.js +254 -0
- package/dist/manager-runtime-DL6JoSj9.js +106 -0
- package/dist/manager.runtime-Cbyhg1vB.js +710 -0
- package/dist/markdown-to-line-BTlEkOls.d.ts +91 -0
- package/dist/matrix-DX-jaB88.js +1490 -0
- package/dist/matrix-H6Yyj1QZ.d.ts +68 -0
- package/dist/matrix-J8s45tRw.js +1269 -0
- package/dist/mattermost-D75n6bRI.d.ts +6 -0
- package/dist/mcp-cli-CLc3_yCO.js +86 -0
- package/dist/media-understanding.runtime-BI0Lljbl.js +111 -0
- package/dist/memory-cli-CTp2cYrf.js +106 -0
- package/dist/method-scopes-Du8ODGFW.js +2586 -0
- package/dist/model-auth-markers-DEDakSUW.d.ts +20 -0
- package/dist/model-picker-CDBs7LJF.js +390 -0
- package/dist/model-picker-CRix4Wwv.js +107 -0
- package/dist/model-picker.runtime-CITyy3Rn.js +120 -0
- package/dist/model-suppression.runtime-Ce7D6QUT.js +111 -0
- package/dist/models-BK1eanuP.js +113 -0
- package/dist/models-X4Czy3uE.js +2514 -0
- package/dist/models-cli-C79Ulviy.js +304 -0
- package/dist/models-config-DALlu3S9.js +106 -0
- package/dist/models-config.providers.discovery-CSJ1STM1.d.ts +18 -0
- package/dist/monitor-B45a_RpX.js +3468 -0
- package/dist/monitor-C8KbJ-i0.js +767 -0
- package/dist/monitor-CIhrvegZ.js +3076 -0
- package/dist/monitor-CQut7klP.js +6823 -0
- package/dist/monitor-DZb5IJle.js +777 -0
- package/dist/monitor-DaFkdD27.js +108 -0
- package/dist/monitor-Do9Tp2Ii.js +110 -0
- package/dist/monitor-shared-CMK9cDOb.js +444 -0
- package/dist/msteams-A6H_wv5F.js +852 -0
- package/dist/net-DpMJgN-o.d.ts +19 -0
- package/dist/nextcloud-talk-f1pZ5Bge.d.ts +1 -0
- package/dist/node-cli-BXnmsjzL.js +2498 -0
- package/dist/node-resolve-CupmrA0Y.js +835 -0
- package/dist/nodes-cli-DZVrah_8.js +1375 -0
- package/dist/nostr-DMV534Ks.d.ts +7 -0
- package/dist/nostr-SAk3tjtR.js +8744 -0
- package/dist/npm-resolution-Dr9wssCY.js +60 -0
- package/dist/oauth-utils-DnyXdWU9.d.ts +10 -0
- package/dist/onboard-BE5pmb1g.js +589 -0
- package/dist/onboard-channels-3hNVY0E7.js +1241 -0
- package/dist/onboard-channels-vaO3nWLL.js +200 -0
- package/dist/onboard-custom-CI5uFyWH.js +571 -0
- package/dist/onboard-custom-eIvRswgv.js +109 -0
- package/dist/onboard-helpers-ChMWfUnl.js +335 -0
- package/dist/onboard-helpers-DRFi9oaD.js +108 -0
- package/dist/onboard-remote-BTspTgA4.js +112 -0
- package/dist/onboard-remote-so38yXlX.js +181 -0
- package/dist/onboard-search-DS0tZS24.js +297 -0
- package/dist/onboard-skills-B9DxCCiU.js +133 -0
- package/dist/onboard-skills-so0a_BJV.js +112 -0
- package/dist/outbound-media-BiJscGlR.js +11 -0
- package/dist/outbound-media-DJF-TuJu.d.ts +11 -0
- package/dist/pairing-access-CuiJP9xN.d.ts +21 -0
- package/dist/pairing-cli-DN0u1Cez.js +212 -0
- package/dist/parse-finite-number-B3FJTjyQ.d.ts +5 -0
- package/dist/perplexity-Bw1u3CAF.js +24 -0
- package/dist/persistent-dedupe-DR5Ka6BX.d.ts +26 -0
- package/dist/pi-model-discovery-runtime-iwKNCaYu.js +106 -0
- package/dist/pi-tools.before-tool-call.runtime-BM_N-JZe.js +380 -0
- package/dist/plugin-install--KVul05Z.js +184 -0
- package/dist/plugin-install-DVpPsLkS.js +112 -0
- package/dist/plugin-install-plan-Dwc6-coz.js +49 -0
- package/dist/plugin-registry-XRswugE9.js +108 -0
- package/dist/plugin-registry-jozQafRo.js +49 -0
- package/dist/plugin-sdk/account-resolution.js +26 -26
- package/dist/plugin-sdk/acp-runtime.js +26 -26
- package/dist/plugin-sdk/acpx.js +1 -1
- package/dist/plugin-sdk/agent-runtime.js +26 -26
- package/dist/plugin-sdk/bluebubbles.js +29 -29
- package/dist/plugin-sdk/channel-config-helpers.js +26 -26
- package/dist/plugin-sdk/channel-config-schema.js +2 -2
- package/dist/plugin-sdk/channel-policy.js +26 -26
- package/dist/plugin-sdk/channel-runtime.js +26 -26
- package/dist/plugin-sdk/compat.js +27 -27
- package/dist/plugin-sdk/config-runtime.js +28 -28
- package/dist/plugin-sdk/conversation-runtime.js +26 -26
- package/dist/plugin-sdk/discord.js +26 -26
- package/dist/plugin-sdk/feishu.js +27 -27
- package/dist/plugin-sdk/gateway-runtime.js +8 -8
- package/dist/plugin-sdk/googlechat.js +29 -29
- package/dist/plugin-sdk/image-generation-runtime.js +26 -26
- package/dist/plugin-sdk/image-generation.js +26 -26
- package/dist/plugin-sdk/imessage.js +27 -27
- package/dist/plugin-sdk/index.js +26 -26
- package/dist/plugin-sdk/infra-runtime.js +26 -26
- package/dist/plugin-sdk/irc.js +29 -29
- package/dist/plugin-sdk/line.js +27 -27
- package/dist/plugin-sdk/llm-task.js +26 -26
- package/dist/plugin-sdk/matrix.js +29 -29
- package/dist/plugin-sdk/mattermost.js +28 -28
- package/dist/plugin-sdk/media-runtime.js +26 -26
- package/dist/plugin-sdk/media-understanding-runtime.js +26 -26
- package/dist/plugin-sdk/media-understanding.js +26 -26
- package/dist/plugin-sdk/msteams.js +30 -30
- package/dist/plugin-sdk/nextcloud-talk.js +28 -28
- package/dist/plugin-sdk/nostr.js +27 -27
- package/dist/plugin-sdk/plugin-runtime.js +26 -26
- package/dist/plugin-sdk/provider-auth.js +28 -28
- package/dist/plugin-sdk/provider-setup.js +27 -27
- package/dist/plugin-sdk/provider-web-search.js +1 -1
- package/dist/plugin-sdk/qwen-portal-auth.js +26 -26
- package/dist/plugin-sdk/reply-history.js +26 -26
- package/dist/plugin-sdk/reply-runtime.js +26 -26
- package/dist/plugin-sdk/sandbox.js +26 -26
- package/dist/plugin-sdk/security-runtime.js +26 -26
- package/dist/plugin-sdk/self-hosted-provider-setup.js +27 -27
- package/dist/plugin-sdk/setup.js +27 -27
- package/dist/plugin-sdk/signal.js +26 -26
- package/dist/plugin-sdk/slack.js +26 -26
- package/dist/plugin-sdk/speech-runtime.js +26 -26
- package/dist/plugin-sdk/speech.js +26 -26
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-helpers.d.ts +3 -0
- package/dist/plugin-sdk/src/config/config-lock.d.ts +38 -0
- package/dist/plugin-sdk/src/config/config.d.ts +1 -1
- package/dist/plugin-sdk/src/config/io.d.ts +39 -0
- package/dist/plugin-sdk/src/config/types.gateway.d.ts +12 -0
- package/dist/plugin-sdk/src/config/types.secrets.d.ts +10 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/credential-planner.d.ts +3 -1
- package/dist/plugin-sdk/src/secrets/provider-env-vars.d.ts +61 -0
- package/dist/plugin-sdk/src/secrets/sec1-placeholder.d.ts +181 -0
- package/dist/plugin-sdk/src/secrets/sec1-utils.d.ts +57 -0
- package/dist/plugin-sdk/synology-chat.js +27 -27
- package/dist/plugin-sdk/telegram.js +26 -26
- package/dist/plugin-sdk/text-runtime.js +4 -4
- package/dist/plugin-sdk/tlon.js +27 -27
- package/dist/plugin-sdk/twitch.js +26 -26
- package/dist/plugin-sdk/voice-call.js +26 -26
- package/dist/plugin-sdk/whatsapp.js +26 -26
- package/dist/plugin-sdk/zalo.js +30 -30
- package/dist/plugin-sdk/zalouser.js +29 -29
- package/dist/plugins/runtime/index.d.ts +22 -0
- package/dist/plugins/runtime/index.js +26 -26
- package/dist/plugins-C4PiDdjc.js +106 -0
- package/dist/plugins-cli-zhmliYNU.js +912 -0
- package/dist/policy-CcSolumc.js +143 -0
- package/dist/preflight-audio.runtime-BAbfqqzW.js +111 -0
- package/dist/probe-Bgt5c-cr.js +129 -0
- package/dist/probe-CPk5iGcg.js +47 -0
- package/dist/probe-DR4KRKXz.js +19 -0
- package/dist/probe-DnoCyJ_m.js +1793 -0
- package/dist/probe-VsLtK3vQ.js +6328 -0
- package/dist/probe-auth-BnsKrQt7.js +38 -0
- package/dist/probe-auth-DYdUG8l1.js +48 -0
- package/dist/program-8enYYBsc.js +247 -0
- package/dist/prompt-select-styled-DxBcUasv.js +2673 -0
- package/dist/provider-api-key-auth.runtime-DsLZyt6h.js +116 -0
- package/dist/provider-auth-choice-30EvRxqc.js +126 -0
- package/dist/provider-auth-choice-preference-DMr1WmRg.js +189 -0
- package/dist/provider-auth-choice.runtime-CI98BgQF.js +118 -0
- package/dist/provider-auth-guidance-WKDIi_wk.js +34 -0
- package/dist/provider-auth-result-Cs8wguSI.d.ts +18 -0
- package/dist/provider-models-EOys_Nvi.d.ts +867 -0
- package/dist/provider-ollama-setup-D89zlm9C.d.ts +32 -0
- package/dist/provider-onboard-BzOpgCLu.d.ts +40 -0
- package/dist/provider-runtime.runtime-Cm4as2KG.js +106 -0
- package/dist/provider-self-hosted-setup-Bmv_AQmw.d.ts +61 -0
- package/dist/provider-self-hosted-setup-CJwFVVB4.js +182 -0
- package/dist/provider-usage-CVNyLLDb.js +106 -0
- package/dist/provider-usage.types-CdTymHNu.d.ts +16 -0
- package/dist/provider-web-search-BJhXD5dH.js +2392 -0
- package/dist/provider-wizard-DMMYXjlW.js +152 -0
- package/dist/push-apns-BnWTdTEk.js +1038 -0
- package/dist/pw-ai-CtK_7Cy2.js +1866 -0
- package/dist/qr-cli-CA-BF0--.js +108 -0
- package/dist/qr-cli-D18HiUkh.js +369 -0
- package/dist/reactions-Df7XG8Uh.js +281 -0
- package/dist/read-only-account-inspect.discord.runtime-B-FP0mwb.js +111 -0
- package/dist/read-only-account-inspect.slack.runtime-DkWZ2ccW.js +111 -0
- package/dist/read-only-account-inspect.telegram.runtime-BnlTkn_e.js +111 -0
- package/dist/redact-snapshot-DVdstBvO.js +2661 -0
- package/dist/ref-contract-RPkB754Q.js +53 -0
- package/dist/register.agent-DVAxXQKW.js +434 -0
- package/dist/register.backup-CUuL5KUZ.js +624 -0
- package/dist/register.configure-bC0UEwfU.js +247 -0
- package/dist/register.maintenance-iIqvl_eT.js +569 -0
- package/dist/register.message-CEDd4z07.js +704 -0
- package/dist/register.onboard-Cejfnysy.js +187 -0
- package/dist/register.setup-DU7uHdYt.js +207 -0
- package/dist/register.status-health-sessions-BWphMXNR.js +493 -0
- package/dist/register.subclis-DnIweTEG.js +315 -0
- package/dist/register.subclis-gJX_Pbub.js +12 -0
- package/dist/registry-Dgwc-7eS.js +1183 -0
- package/dist/replies-D9PEZ8yn.js +110 -0
- package/dist/reply-history-lHgoC4l3.d.ts +1 -0
- package/dist/reply-payload-Bd2HuR4g.d.ts +46 -0
- package/dist/request-url-BcSJaiiu.d.ts +5 -0
- package/dist/resolve-BbsCHGLY.js +660 -0
- package/dist/resolve-channels-BtrGC95o.js +262 -0
- package/dist/resolve-channels-C1SthO1N.js +226 -0
- package/dist/resolve-users-CgSxHrU0.js +143 -0
- package/dist/routes-BZtqNrBf.js +7097 -0
- package/dist/rpc-D3KMxG4J.js +67 -0
- package/dist/run-command-C8b3dCZV.d.ts +16 -0
- package/dist/run-main-BlWJVotF.js +423 -0
- package/dist/runtime-RWGbO5Qy.d.ts +26 -0
- package/dist/runtime-discord-ops.runtime-DUXIYvQr.js +9073 -0
- package/dist/runtime-slack-ops.runtime-n1yFfyp1.js +4551 -0
- package/dist/runtime-telegram-ops.runtime-PZUWchjT.js +128 -0
- package/dist/runtime-whatsapp-login.runtime-xsuNyvGz.js +109 -0
- package/dist/runtime-whatsapp-outbound.runtime-5EfEyCsO.js +112 -0
- package/dist/sandbox-cli-Dw1nWNmQ.js +530 -0
- package/dist/search-manager-BJoRxOaf.js +15 -0
- package/dist/search-manager-DxkQvUrW.js +386 -0
- package/dist/secret-input-schema-Cp_La9qv.d.ts +19 -0
- package/dist/secrets-cli-BPyV2gSq.js +2065 -0
- package/dist/security-cli-EK4sSRfG.js +570 -0
- package/dist/send-B01Gvh9m.js +629 -0
- package/dist/send-B4L4wRJO.js +100 -0
- package/dist/send-BDcGrXt0.js +1025 -0
- package/dist/send-BRRtHxyR.js +283 -0
- package/dist/send-DU6dmMXW.js +631 -0
- package/dist/server-CWw5GFEg.js +106 -0
- package/dist/server-node-events-92cDVswC.js +501 -0
- package/dist/session-key-DbkfhOjM.d.ts +46 -0
- package/dist/sessions-B052uHA3.js +218 -0
- package/dist/sessions-Cef4dZNP.js +107 -0
- package/dist/setup-BlQPyDPy.js +387 -0
- package/dist/setup-DcSZ_pTn.d.ts +37 -0
- package/dist/setup-core-B9mdZYnU.js +166 -0
- package/dist/setup-core-Cj0sLkpP.js +47 -0
- package/dist/setup-core-CkZbebOv.js +143 -0
- package/dist/setup-core-MRNjnrJl.js +205 -0
- package/dist/setup-surface-3ZY0JtWE.js +490 -0
- package/dist/setup-wizard-helpers-Dwzb9Dcz.d.ts +203 -0
- package/dist/setup.finalize-B5ETm3Ui.js +517 -0
- package/dist/setup.gateway-config-C8hdtlbw.js +338 -0
- package/dist/setup.secret-input-BZSIeiqy.js +25 -0
- package/dist/shared--9_eQ_lc.js +75 -0
- package/dist/shared-CxkH3H0U.js +102 -0
- package/dist/shared-DTNL0hA9.js +298 -0
- package/dist/shared-HSP1OV-Q.js +96 -0
- package/dist/shared-UIjWb_3B.js +182 -0
- package/dist/signal-CTI6bSmB.js +109 -0
- package/dist/skills-4-r1mfJM.js +853 -0
- package/dist/skills-RNm54CBO.js +19 -0
- package/dist/skills-cli-te7dSs5p.js +291 -0
- package/dist/skills-install-Del-Ogv8.js +763 -0
- package/dist/skills-status-BZpoMXrR.js +169 -0
- package/dist/skills-status-Dq61Sz8U.js +20 -0
- package/dist/slack-oc-viUtl.js +109 -0
- package/dist/slash-commands.runtime-NdkD2LZV.js +123 -0
- package/dist/slash-dispatch.runtime-DQgeaF3J.js +136 -0
- package/dist/slash-skill-commands.runtime-DmOl2DnL.js +111 -0
- package/dist/src-0wtt7seR.js +1696 -0
- package/dist/status-5oR_gqv_.js +121 -0
- package/dist/status-BO8LY0hC.js +1599 -0
- package/dist/status-D_oHA9yO.js +126 -0
- package/dist/status-IrMacJRj.js +606 -0
- package/dist/status-Prdeg53E.js +43 -0
- package/dist/status-json-Da0hR-1Z.js +286 -0
- package/dist/status.link-channel-BgUJEZAz.js +138 -0
- package/dist/status.scan.deps.runtime-D9vHTxOW.js +121 -0
- package/dist/status.scan.runtime-D-EdD5CW.js +114 -0
- package/dist/status.summary--i6xduWH.js +592 -0
- package/dist/status.summary.runtime-BqMXjaBc.js +113 -0
- package/dist/subagent-orphan-recovery-DiRJcFQc.js +302 -0
- package/dist/subagent-registry-runtime-B66EYEYm.js +106 -0
- package/dist/synology-chat-BemXqdzG.js +297 -0
- package/dist/system-cli-CSuiia4-.js +92 -0
- package/dist/telegram/audit.d.ts +2 -0
- package/dist/telegram/audit.js +1 -1
- package/dist/telegram/token.d.ts +2 -0
- package/dist/telegram/token.js +26 -26
- package/dist/telegram-DLFcRv5a.js +109 -0
- package/dist/testing-DZrulv-n.d.ts +1755 -0
- package/dist/text-chunking-BaYBIUoR.d.ts +79 -0
- package/dist/text-chunking-C8kmbNfa.js +84 -0
- package/dist/thinking-D8aqmr3o.d.ts +13 -0
- package/dist/tlon-Bpr4f3yF.js +433 -0
- package/dist/tool-send-BHKm5ztm.d.ts +9 -0
- package/dist/tui-BY3QRgC1.js +3834 -0
- package/dist/tui-cli-CCfZOlV0.js +132 -0
- package/dist/types-CKx5nDZB.d.ts +45 -0
- package/dist/types-DBhDdMQd.d.ts +22670 -0
- package/dist/types.base-B_TkkSS8.d.ts +188 -0
- package/dist/types.secrets-Bojc4omL.js +92 -0
- package/dist/ui-1UpZZyI3.js +31 -0
- package/dist/update-BR4JvFpV.js +1036 -0
- package/dist/update-cli-BZv44lFq.js +1498 -0
- package/dist/update-offset-store-DGdBotIW.js +107 -0
- package/dist/update-runner-D34sooPe.js +1496 -0
- package/dist/vllm-defaults-BCGSJ7K0.d.ts +13 -0
- package/dist/wait-BU9vJv22.d.ts +4 -0
- package/dist/web-CXpU2D41.js +107 -0
- package/dist/web-shared-B4sL45ah.d.ts +45 -0
- package/dist/webhook-memory-guards-B7oLVseG.d.ts +43 -0
- package/dist/webhook-request-guards-CqIH7equ.d.ts +76 -0
- package/dist/webhook-targets-CAAGATtk.js +181 -0
- package/dist/webhook-targets-oQ0jd4r0.d.ts +106 -0
- package/dist/webhooks-cli-B46t2VT5.js +349 -0
- package/dist/whatsapp-Dniwd4Rv.js +109 -0
- package/dist/whatsapp-actions-fL46PsNs.js +162 -0
- package/dist/windows-spawn-DGeE98SH.d.ts +43 -0
- package/dist/workspace-dirs-d3Ms_ryk.js +2002 -0
- package/dist/zalo-Csulx0XK.d.ts +9 -0
- package/dist/zalo-gh0yAWmS.js +415 -0
- package/dist/zalouser-CuxRvztM.js +30911 -0
- package/dist/zod-schema.agent-runtime-B4MkB-_3.d.ts +10 -0
- package/dist/zod-schema.core-D5reNip6.js +541 -0
- package/dist/zod-schema.core-DN3RhEUG.d.ts +173 -0
- package/docs/SEC1.md +523 -0
- package/docs/SEC1_IMPLEMENTATION/CHANNELS_REPORT.md +173 -0
- package/docs/SEC1_IMPLEMENTATION/CORE_UTIL_REPORT.md +139 -0
- package/docs/SEC1_IMPLEMENTATION/DOCS_REPORT.md +134 -0
- package/docs/SEC1_IMPLEMENTATION/ENV_MAP_DRAFT.md +148 -0
- package/docs/SEC1_IMPLEMENTATION/INTEGRATION_REPORT.md +170 -0
- package/docs/SEC1_IMPLEMENTATION/PROVIDERS_REPORT.md +291 -0
- package/docs/SEC1_IMPLEMENTATION/QA_REPORT.md +249 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-channels.md +317 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-docs.md +212 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-security.md +368 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave2-critic-consolidated.md +195 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave3-fix-report.md +105 -0
- package/docs/SEC1_IMPLEMENTATION/STRATEGY.md +451 -0
- package/docs/SEC1_IMPLEMENTATION/TEST_REPORT.md +156 -0
- package/docs/pipeline-sdk/CLI_SPEC.md +609 -0
- package/docs/pipeline-sdk/PIPELINE_SDK_DESIGN.md +1372 -0
- package/extensions/kakao-talkchannel/MIGRATION_ARCH_ANALYSIS.md +455 -0
- package/extensions/kakao-talkchannel/MIGRATION_CODE_ANALYSIS.md +383 -0
- package/extensions/kakao-talkchannel/MIGRATION_STRATEGY.md +115 -0
- package/extensions/kakao-talkchannel/README.md +50 -0
- package/extensions/kakao-talkchannel/index.ts +20 -0
- package/extensions/kakao-talkchannel/moldclaw.plugin.json +98 -0
- package/extensions/kakao-talkchannel/package.json +12 -0
- package/extensions/kakao-talkchannel/src/adapters/config.ts +132 -0
- package/extensions/kakao-talkchannel/src/adapters/gateway.ts +974 -0
- package/extensions/kakao-talkchannel/src/adapters/outbound.ts +52 -0
- package/extensions/kakao-talkchannel/src/adapters/pairing.ts +35 -0
- package/extensions/kakao-talkchannel/src/adapters/security.ts +57 -0
- package/extensions/kakao-talkchannel/src/adapters/setup.ts +105 -0
- package/extensions/kakao-talkchannel/src/adapters/status.ts +117 -0
- package/extensions/kakao-talkchannel/src/channel.ts +58 -0
- package/extensions/kakao-talkchannel/src/commands/card.ts +413 -0
- package/extensions/kakao-talkchannel/src/config/schema.ts +129 -0
- package/extensions/kakao-talkchannel/src/kakao/callback.ts +133 -0
- package/extensions/kakao-talkchannel/src/kakao/limits.ts +129 -0
- package/extensions/kakao-talkchannel/src/kakao/payload.ts +138 -0
- package/extensions/kakao-talkchannel/src/kakao/response.ts +373 -0
- package/extensions/kakao-talkchannel/src/relay/client.ts +146 -0
- package/extensions/kakao-talkchannel/src/relay/session.ts +137 -0
- package/extensions/kakao-talkchannel/src/relay/sse.ts +258 -0
- package/extensions/kakao-talkchannel/src/relay/stream.ts +149 -0
- package/extensions/kakao-talkchannel/src/runtime.ts +21 -0
- package/extensions/kakao-talkchannel/src/types.ts +447 -0
- package/extensions/kakao-talkchannel/src/version.ts +3 -0
- package/extensions/kakao-talkchannel/tsconfig.json +19 -0
- package/package.json +23 -8
- package/skills/meshy/SKILL.md +69 -0
- package/skills/meshy/scripts/__pycache__/check_status.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/__pycache__/image_to_3d.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/__pycache__/text_to_3d.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/check_status.py +147 -0
- package/skills/meshy/scripts/image_to_3d.py +229 -0
- package/skills/meshy/scripts/text_to_3d.py +214 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +1 -1
- package/skills/openai-whisper-api/scripts/transcribe.sh +0 -0
- package/skills/tavily-search/SKILL.md +61 -0
- package/skills/tavily-search/scripts/__pycache__/search.cpython-312.pyc +0 -0
- package/skills/tavily-search/scripts/search.py +238 -0
- package/skills/video-frames/scripts/frame.sh +0 -0
- package/LICENSE +0 -21
- package/dist/accounts-UcSvD34O.js +0 -109
- package/dist/acp-cli-BPb8PgHP.js +0 -2088
- package/dist/actions.runtime-BL5QRooG.js +0 -114
- package/dist/actions.runtime-DSdfSo40.js +0 -128
- package/dist/agents-CHeX_5-H.js +0 -217
- package/dist/agents-DQRL9XKP.js +0 -853
- package/dist/allow-list-Boi79v-U.js +0 -81
- package/dist/allowlist-B2eBBeMF.js +0 -142
- package/dist/api-CFAtRSYL.js +0 -6953
- package/dist/api-D5JNJj8n.js +0 -112
- package/dist/audit-BM0GsdzV.js +0 -787
- package/dist/audit-BqRK9OSj.js +0 -54
- package/dist/audit-channel.collect.runtime-BPvDB8aq.js +0 -600
- package/dist/audit-channel.runtime-D3fzHiAo.js +0 -116
- package/dist/audit-extra.async-NveNIzX0.js +0 -813
- package/dist/audit-membership-runtime-mu470WFO.js +0 -157
- package/dist/audit.deep.runtime-RdxvW8Tj.js +0 -24
- package/dist/audit.nondeep.runtime-DDu8vA9Z.js +0 -831
- package/dist/audit.runtime-Y8C9W7s9.js +0 -113
- package/dist/auth-choice-C1CIxRsi.js +0 -268
- package/dist/auth-choice-CTvqWiDI.js +0 -117
- package/dist/auth-choice-Ddzko1B8.js +0 -502
- package/dist/auth-choice-options-BIAmAiCe.js +0 -123
- package/dist/auth-choice-prompt-B815kArz.js +0 -110
- package/dist/auth-choice-prompt-CGhTNCJx.js +0 -36
- package/dist/auth-choice.plugin-providers.runtime-AvAZ6S5W.js +0 -114
- package/dist/auth-profiles-BJcHzwPy.js +0 -127650
- package/dist/auth-profiles.runtime-CieFilK5.js +0 -111
- package/dist/bluebubbles-F8FGE9cH.js +0 -64
- package/dist/brave-BG5Yopn8.js +0 -24
- package/dist/browser-cli-Co7PJGZF.js +0 -1492
- package/dist/call-CoaQYq7c.js +0 -639
- package/dist/call-D3eu5Jjh.js +0 -37
- package/dist/channel-BftWD6yu.js +0 -1321
- package/dist/channel-Bub9U5Xg.js +0 -214
- package/dist/channel-C0oDs7TO.js +0 -4681
- package/dist/channel-C8CnEdkZ.js +0 -352
- package/dist/channel-CI-RC-xf.js +0 -497
- package/dist/channel-CY-hZCOJ.js +0 -397
- package/dist/channel-CbtGJB2x.js +0 -943
- package/dist/channel-CcfK3wP8.js +0 -803
- package/dist/channel-DBoDIeVj.js +0 -619
- package/dist/channel-DEq6Ecs-.js +0 -920
- package/dist/channel-DH4dhW1n.js +0 -226
- package/dist/channel-DQ_wdKg_.js +0 -575
- package/dist/channel-DT6qD1Ic.js +0 -207
- package/dist/channel-DZNAyxwr.js +0 -542
- package/dist/channel-DtakwAEe.js +0 -538
- package/dist/channel-DuYgH6p1.js +0 -562
- package/dist/channel-Hn-AN-d52.js +0 -316
- package/dist/channel-_R4hbD5h.js +0 -1598
- package/dist/channel-account-context-DXq8dlvI.js +0 -103
- package/dist/channel-kQmEVn3I.js +0 -306
- package/dist/channel-options-DHfxaklg.js +0 -50
- package/dist/channel-summary-DUpnoYhI.js +0 -106
- package/dist/channel-t-JxCWk6.js +0 -949
- package/dist/channel.runtime--GYriaXU.js +0 -213
- package/dist/channel.runtime-BJtn3GOH.js +0 -174
- package/dist/channel.runtime-BV7t_oNz.js +0 -166
- package/dist/channel.runtime-Bi8a3n9S.js +0 -865
- package/dist/channel.runtime-BjsYF0NN.js +0 -122
- package/dist/channel.runtime-BnI6YtmI.js +0 -413
- package/dist/channel.runtime-CQOftcCd.js +0 -194
- package/dist/channel.runtime-CuIAcPjZ.js +0 -4006
- package/dist/channel.runtime-DH1Q1G4k.js +0 -399
- package/dist/channel.runtime-DYYUPKxr.js +0 -236
- package/dist/channel.runtime-U5Gszsr5.js +0 -177
- package/dist/channel.setup-BQFHmgki.js +0 -9
- package/dist/channel.setup-BVoDwklu.js +0 -8
- package/dist/channel.setup-Bf73HsXr.js +0 -57
- package/dist/channel.setup-CblD4flM.js +0 -11
- package/dist/channel.setup-DgxlrPgz.js +0 -6
- package/dist/channel.setup-GLIAEVKL.js +0 -8
- package/dist/channel.setup-YTy5R1sz.js +0 -9
- package/dist/channels-CTL8iR9J.js +0 -404
- package/dist/channels-DBGvnjHY.js +0 -1113
- package/dist/channels-cli-BmVO5-sq.js +0 -286
- package/dist/channels-status-issues-kDtsWzA-.js +0 -16
- package/dist/clawbot-cli-DtcMJHqX.js +0 -113
- package/dist/cli-BNGECGVY.js +0 -149
- package/dist/command-registry-1SDrWgER.js +0 -13
- package/dist/command-registry-DNorYU4w.js +0 -212
- package/dist/command-secret-gateway-DqDZparO.js +0 -106
- package/dist/compact.runtime-C1ZN8UGb.js +0 -111
- package/dist/completion-cli-Q_Jt5Foc.js +0 -16
- package/dist/completion-cli-QkTXhuJh.js +0 -445
- package/dist/config-BbxrRaLf.js +0 -938
- package/dist/config-CkD8DJ7L.js +0 -44
- package/dist/config-cli-BoPrlYTp.js +0 -428
- package/dist/config-guard-CEhCvr_u.js +0 -117
- package/dist/config-schema-GQ6uWjXe.js +0 -31
- package/dist/config-validation-woE2_LpC.js +0 -262
- package/dist/config-value-Dh8m-CFf.js +0 -132
- package/dist/config-y4i5g7s4.js +0 -30
- package/dist/configure-DGRzwdFN.js +0 -1100
- package/dist/configure-S4AHE3k_.js +0 -238
- package/dist/control-ui-shared-kLBp4YlS.js +0 -29
- package/dist/credentials-D5uBf_C5.js +0 -265
- package/dist/cron-cli-lGupeVCW.js +0 -634
- package/dist/daemon-cli-Cs_edi0I.js +0 -339
- package/dist/daemon-install-DIFpP_qv.js +0 -175
- package/dist/deliver-DYa_DFZU.js +0 -106
- package/dist/deliver-runtime-DCW_o2Ot.js +0 -106
- package/dist/devices-cli-YsGOW2-w.js +0 -340
- package/dist/diagnostic-vMghIesG.js +0 -310
- package/dist/directory-cli-DtjMQjU5.js +0 -306
- package/dist/directory.static-DBZGvsdF.js +0 -44
- package/dist/discord-DYCu19HT.js +0 -109
- package/dist/discovery-DZYAoDF_.js +0 -48
- package/dist/dns-cli-DqW4pNgW.js +0 -216
- package/dist/docs-cli-Bu9TBlDU.js +0 -173
- package/dist/doctor-completion-B5hcQD5c.js +0 -90
- package/dist/doctor-config-flow-BBB2ZKfT.js +0 -107
- package/dist/doctor-config-flow-DDBYUS9f.js +0 -2437
- package/dist/enable-Tmsp8QuB.js +0 -24
- package/dist/env-overrides-BHxqjYZG.js +0 -434
- package/dist/env-overrides.runtime-Cz98bf-l.js +0 -17
- package/dist/exec-approvals-cli-wO5cYfMa.js +0 -419
- package/dist/gateway-cli-CFvDGhB9.js +0 -26429
- package/dist/gateway-install-token-CskJfo_N.js +0 -163
- package/dist/gateway-rpc-srYfBID9.js +0 -26
- package/dist/gateway-runtime-C76hUmUV.js +0 -69
- package/dist/googlechat-Cha5utST.js +0 -307
- package/dist/health-DDQYYsJy.js +0 -108
- package/dist/health-DXZykGaX.js +0 -570
- package/dist/hooks-cli-DfkurPYP.js +0 -995
- package/dist/imessage-B26k39pl.js +0 -110
- package/dist/imessage-Bp1_6cws.js +0 -31
- package/dist/inbound-reply-dispatch-DoIJLztA.js +0 -71
- package/dist/install-target-BjOuS4I8.js +0 -574
- package/dist/installs-Cz4k0W1Y.js +0 -532
- package/dist/io-B0OKifLZ.js +0 -28
- package/dist/io-DcoxdH6t.js +0 -9570
- package/dist/ipv4-CTQQ4_IW.js +0 -82
- package/dist/irc-B8vBDigm.js +0 -672
- package/dist/library-VCM_cQY4.js +0 -107
- package/dist/lifecycle-core-Ctz36PdQ.js +0 -382
- package/dist/line-B_uTLrdI.js +0 -530
- package/dist/llm-slug-generator-YWg0g2pj.js +0 -67
- package/dist/logging-S-5LPdfQ.js +0 -13
- package/dist/logging-ueBMCGMR.js +0 -29
- package/dist/login-qr-pcACm2Ng.js +0 -107
- package/dist/login-qr-pv-kxMfF.js +0 -233
- package/dist/logs-cli-RgADgSMO.js +0 -254
- package/dist/manager-runtime-BhTkoKmb.js +0 -106
- package/dist/manager.runtime-BjHzikoK.js +0 -710
- package/dist/matrix-C4EEu2Qp.js +0 -1490
- package/dist/matrix-Dfzcc5nV.js +0 -1269
- package/dist/mcp-cli-CJmOm9Oj.js +0 -86
- package/dist/media-understanding.runtime-DCETFCw_.js +0 -111
- package/dist/memory-cli-DFqd6tYx.js +0 -106
- package/dist/method-scopes-D-Q9dvbj.js +0 -2586
- package/dist/model-picker-Z-CUcuMr.js +0 -390
- package/dist/model-picker-v5mUsZ4J.js +0 -107
- package/dist/model-picker.runtime-A_z0dHfS.js +0 -120
- package/dist/model-suppression.runtime-QVWVJRr-.js +0 -111
- package/dist/models-Bbj0xV4F.js +0 -2514
- package/dist/models-D-OIjZqU.js +0 -113
- package/dist/models-cli-Bpn-5i4h.js +0 -304
- package/dist/models-config-Cwa5cJbC.js +0 -106
- package/dist/monitor-BchfCAaU.js +0 -6823
- package/dist/monitor-BydV44SP.js +0 -3076
- package/dist/monitor-CT8axwfm.js +0 -767
- package/dist/monitor-CZGWNOvn.js +0 -777
- package/dist/monitor-DN62r69g.js +0 -3468
- package/dist/monitor-DZ0fzJku.js +0 -110
- package/dist/monitor-DvNjzWFu.js +0 -108
- package/dist/monitor-shared-B-DBSlkQ.js +0 -444
- package/dist/msteams-Bf-wk2Rp.js +0 -852
- package/dist/node-cli-kH16TQI7.js +0 -2498
- package/dist/node-resolve-DfOpQmxm.js +0 -835
- package/dist/nodes-cli-CkAMXW5u.js +0 -1375
- package/dist/nostr-B8UGHclZ.js +0 -8744
- package/dist/npm-resolution-DmjlifII.js +0 -60
- package/dist/onboard-C883nfyw.js +0 -589
- package/dist/onboard-channels-Dc-BxN7p.js +0 -200
- package/dist/onboard-channels-j5EENtum.js +0 -1241
- package/dist/onboard-custom-0atne0C5.js +0 -571
- package/dist/onboard-custom-CWMqwjJx.js +0 -109
- package/dist/onboard-helpers-D3wWfH8F.js +0 -335
- package/dist/onboard-helpers-DZmRCe8l.js +0 -108
- package/dist/onboard-remote-Cn6kW-p0.js +0 -112
- package/dist/onboard-remote-Cx4w5VAk.js +0 -181
- package/dist/onboard-search-Ck9HRh2M.js +0 -297
- package/dist/onboard-skills-BtqrGioT.js +0 -133
- package/dist/onboard-skills-Dnw19Os8.js +0 -112
- package/dist/outbound-media-C5Nv4o18.js +0 -11
- package/dist/pairing-cli-Cwy9QZ_4.js +0 -212
- package/dist/perplexity-Brhpb45X.js +0 -24
- package/dist/pi-model-discovery-runtime-DIOdo6D8.js +0 -106
- package/dist/pi-tools.before-tool-call.runtime-CFM4gsDF.js +0 -380
- package/dist/plugin-install-BOV00hia.js +0 -112
- package/dist/plugin-install-Bak8fUBv.js +0 -184
- package/dist/plugin-install-plan-bKkEefRf.js +0 -49
- package/dist/plugin-registry-DxAXQUlZ.js +0 -108
- package/dist/plugin-registry-n0p3phem.js +0 -49
- package/dist/plugins-Ca3RK8Fi.js +0 -106
- package/dist/plugins-cli-BnC51H2R.js +0 -912
- package/dist/policy-BJv97w9e.js +0 -143
- package/dist/preflight-audio.runtime-BrFcf-6_.js +0 -111
- package/dist/probe-063xvvZc.js +0 -19
- package/dist/probe-BJEb2wGv.js +0 -1793
- package/dist/probe-CJQlxgsl.js +0 -47
- package/dist/probe-Caa2HznF.js +0 -6328
- package/dist/probe-CfL4tnJ6.js +0 -129
- package/dist/probe-auth-DN2Ec83-.js +0 -38
- package/dist/probe-auth-D_UKzu4m.js +0 -48
- package/dist/program-BOMdC7MC.js +0 -247
- package/dist/prompt-select-styled-DDnCfM3j.js +0 -2673
- package/dist/provider-api-key-auth.runtime-DUns3fwX.js +0 -116
- package/dist/provider-auth-choice-B_j1ctT2.js +0 -126
- package/dist/provider-auth-choice-preference-BaOBZ_Xn.js +0 -189
- package/dist/provider-auth-choice.runtime-DOako_zV.js +0 -118
- package/dist/provider-auth-guidance-CrjxnoNZ.js +0 -34
- package/dist/provider-runtime.runtime-BkOkgmTw.js +0 -106
- package/dist/provider-self-hosted-setup-BFDU6dRa.js +0 -182
- package/dist/provider-usage-CaDE0mqq.js +0 -106
- package/dist/provider-web-search-BR7etTjJ.js +0 -2392
- package/dist/provider-wizard-DCPdKUvb.js +0 -152
- package/dist/push-apns-B_OZjm4v.js +0 -1038
- package/dist/pw-ai-dG60P0hQ.js +0 -1866
- package/dist/qr-cli-DWfiw79I.js +0 -369
- package/dist/qr-cli-DwuKtyZQ.js +0 -108
- package/dist/reactions-CIGAPBn8.js +0 -281
- package/dist/read-only-account-inspect.discord.runtime-D54mnq8l.js +0 -111
- package/dist/read-only-account-inspect.slack.runtime-Bxs9ObMC.js +0 -111
- package/dist/read-only-account-inspect.telegram.runtime-UoVuf_Yo.js +0 -111
- package/dist/redact-snapshot-DZ3Vq-SC.js +0 -2657
- package/dist/ref-contract-D96lSYLs.js +0 -53
- package/dist/register.agent-2KmeahEL.js +0 -434
- package/dist/register.backup-ECBnWVR7.js +0 -624
- package/dist/register.configure-Doz1daCp.js +0 -247
- package/dist/register.maintenance-C33cV-WM.js +0 -569
- package/dist/register.message-CnL0NiF6.js +0 -704
- package/dist/register.onboard-BrYGZeQA.js +0 -187
- package/dist/register.setup-Bx6gEg6X.js +0 -207
- package/dist/register.status-health-sessions-FLb0CUOO.js +0 -493
- package/dist/register.subclis-BuqgaeIf.js +0 -12
- package/dist/register.subclis-DwdgfdnT.js +0 -315
- package/dist/registry-xhgvU89y.js +0 -1107
- package/dist/replies-hB2aipLu.js +0 -110
- package/dist/resolve-3ErMOltL.js +0 -660
- package/dist/resolve-channels-BV8GXuPe.js +0 -226
- package/dist/resolve-channels-CTY_XRIP.js +0 -262
- package/dist/resolve-users-DQ4Ne4Zc.js +0 -143
- package/dist/routes-BNDsNO_e.js +0 -7097
- package/dist/rpc-BLGTBWXq.js +0 -67
- package/dist/run-main-COAE4GlI.js +0 -423
- package/dist/runtime-discord-ops.runtime-Dxg-nlgd.js +0 -9073
- package/dist/runtime-slack-ops.runtime-Di474LJr.js +0 -4551
- package/dist/runtime-telegram-ops.runtime-Da8vgf3O.js +0 -128
- package/dist/runtime-whatsapp-login.runtime-DcouP4iF.js +0 -109
- package/dist/runtime-whatsapp-outbound.runtime-CYamaEJX.js +0 -112
- package/dist/sandbox-cli-U5ZTxhxL.js +0 -530
- package/dist/search-manager-CfizyEMk.js +0 -386
- package/dist/search-manager-DaF2QP4s.js +0 -15
- package/dist/secrets-cli-C0gytFip.js +0 -2065
- package/dist/security-cli-C74EuLUO.js +0 -570
- package/dist/send-BTLVBf_E.js +0 -631
- package/dist/send-BlWWCEZE.js +0 -1025
- package/dist/send-CfypD1B_.js +0 -100
- package/dist/send-Cm9v3uhF.js +0 -283
- package/dist/send-g2odQuYI.js +0 -629
- package/dist/server-C8b5QJ2s.js +0 -106
- package/dist/server-node-events-xqQe5xiu.js +0 -501
- package/dist/sessions-CSSzvgPQ.js +0 -107
- package/dist/sessions-z0GIvdKa.js +0 -218
- package/dist/setup-D9XTmlF8.js +0 -387
- package/dist/setup-core-BDrLOwYO.js +0 -143
- package/dist/setup-core-CM7cY7_i.js +0 -166
- package/dist/setup-core-CnmgANY-.js +0 -205
- package/dist/setup-core-DgcjCKmG.js +0 -47
- package/dist/setup-surface-DzRrVKYj.js +0 -490
- package/dist/setup.finalize-UaPu_adv.js +0 -517
- package/dist/setup.gateway-config-Djc1ceEh.js +0 -338
- package/dist/setup.secret-input-BkczghbR.js +0 -25
- package/dist/shared-BHizGoNk.js +0 -298
- package/dist/shared-CUfYhQkP.js +0 -96
- package/dist/shared-DYYqr9EC.js +0 -75
- package/dist/shared-DthOxMRQ.js +0 -182
- package/dist/shared-On_A5_hW.js +0 -102
- package/dist/signal-D6px9PGZ.js +0 -109
- package/dist/skills-B4h1k-SP.js +0 -853
- package/dist/skills-Bto10BGB.js +0 -19
- package/dist/skills-cli-CXGR3Y5j.js +0 -291
- package/dist/skills-install-B1AlkK8C.js +0 -763
- package/dist/skills-status-BsmJ_iSg.js +0 -20
- package/dist/skills-status-DGdxY3OI.js +0 -169
- package/dist/slack-B7vWFmxP.js +0 -109
- package/dist/slash-commands.runtime-DXdAT84n.js +0 -123
- package/dist/slash-dispatch.runtime-CNf2-9Aj.js +0 -136
- package/dist/slash-skill-commands.runtime-CBjffHRX.js +0 -111
- package/dist/src-Cp7P7T08.js +0 -1696
- package/dist/status-158fWh4A.js +0 -43
- package/dist/status-BJIVLJnb.js +0 -1599
- package/dist/status-BQiBI6N9.js +0 -126
- package/dist/status-CZipXGUu.js +0 -121
- package/dist/status-ZZIVFLI-.js +0 -606
- package/dist/status-json-BNUy5Mem.js +0 -286
- package/dist/status.link-channel-B694y1Xu.js +0 -138
- package/dist/status.scan.deps.runtime-BcoKEzQD.js +0 -121
- package/dist/status.scan.runtime-CqScDt-p.js +0 -114
- package/dist/status.summary-AMek7qvI.js +0 -592
- package/dist/status.summary.runtime-XgkcQ_kr.js +0 -113
- package/dist/subagent-orphan-recovery-CrCYTmFC.js +0 -302
- package/dist/subagent-registry-runtime-Cg-YvLx3.js +0 -106
- package/dist/synology-chat-0G85jIqQ.js +0 -297
- package/dist/system-cli-kZtSxKNm.js +0 -92
- package/dist/telegram-DV0Wy89w.js +0 -109
- package/dist/text-chunking-C2J2Oeul.js +0 -84
- package/dist/tlon-DmK1NUVP.js +0 -433
- package/dist/tui-D3bNPLG7.js +0 -3834
- package/dist/tui-cli-DtMp9k_s.js +0 -132
- package/dist/types.secrets-DuSPmmWB.js +0 -80
- package/dist/ui-CeGztSEL.js +0 -31
- package/dist/update-De7VudzP.js +0 -1036
- package/dist/update-cli-BH8Pb-So.js +0 -1498
- package/dist/update-offset-store-syELkdEW.js +0 -107
- package/dist/update-runner-Cq-Q40T9.js +0 -1496
- package/dist/web-CjMtvfSq.js +0 -107
- package/dist/webhook-targets-_jTR0Bb_.js +0 -181
- package/dist/webhooks-cli-DQ6u2Qau.js +0 -349
- package/dist/whatsapp-CyLk16SZ.js +0 -109
- package/dist/whatsapp-actions-Dzr2Wzqw.js +0 -162
- package/dist/workspace-dirs-L1_QQ9mB.js +0 -2002
- package/dist/zalo-CrehfXvK.js +0 -415
- package/dist/zalouser-D1QD-O-I.js +0 -30911
- package/dist/zod-schema.core-CWxzqcUs.js +0 -541
package/dist/src-Cp7P7T08.js
DELETED
|
@@ -1,1696 +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 "./subsystem-S4LNMNHd.js";
|
|
10
|
-
import "./ansi-BPhP6LBZ.js";
|
|
11
|
-
import "./boolean-D8Ha5nYV.js";
|
|
12
|
-
import "./env-Dgex_t9p.js";
|
|
13
|
-
import "./warning-filter-gJuwHM7C.js";
|
|
14
|
-
import "./utils-rjVNXUns.js";
|
|
15
|
-
import "./links-C5I443Xb.js";
|
|
16
|
-
import "./setup-binary-Fw3cCSWL.js";
|
|
17
|
-
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-BJcHzwPy.js";
|
|
18
|
-
import "./model-selection-DfA4esOK.js";
|
|
19
|
-
import "./agent-scope-DA7O8MVG.js";
|
|
20
|
-
import { t as DEFAULT_ACCOUNT_ID } from "./account-id-O4Og6DrK.js";
|
|
21
|
-
import "./boundary-file-read-Y1cMjPlu.js";
|
|
22
|
-
import "./logger-wrbK9-ju.js";
|
|
23
|
-
import "./exec-CoBTyh8B.js";
|
|
24
|
-
import "./workspace-CxNKYS0V.js";
|
|
25
|
-
import "./io-DcoxdH6t.js";
|
|
26
|
-
import "./host-env-security-xy11yVnm.js";
|
|
27
|
-
import "./safe-text-BcUvBreN.js";
|
|
28
|
-
import "./version-rW_3ob2o.js";
|
|
29
|
-
import "./env-substitution-C9xZMTDL.js";
|
|
30
|
-
import "./config-state-D1JkXt39.js";
|
|
31
|
-
import "./network-mode-CE-ihBf6.js";
|
|
32
|
-
import "./registry-DcDGl2X7.js";
|
|
33
|
-
import "./manifest-registry-_0xclaVY.js";
|
|
34
|
-
import "./ip-w605xvSx.js";
|
|
35
|
-
import "./zod-schema.core-CWxzqcUs.js";
|
|
36
|
-
import "./config-CkD8DJ7L.js";
|
|
37
|
-
import "./audit-fs-SjcfoPO7.js";
|
|
38
|
-
import "./resolve-3ErMOltL.js";
|
|
39
|
-
import { J as fetchWithSsrFGuard } from "./provider-web-search-BR7etTjJ.js";
|
|
40
|
-
import "./text-runtime-CgEQ9Y9_.js";
|
|
41
|
-
import "./workspace-dirs-L1_QQ9mB.js";
|
|
42
|
-
import "./config-BbxrRaLf.js";
|
|
43
|
-
import "./tailnet-KyAU6tj_.js";
|
|
44
|
-
import "./net-B_Iq_SVP.js";
|
|
45
|
-
import "./credentials-D5uBf_C5.js";
|
|
46
|
-
import "./routes-BNDsNO_e.js";
|
|
47
|
-
import "./frontmatter-BTDAgsA3.js";
|
|
48
|
-
import "./env-overrides-BHxqjYZG.js";
|
|
49
|
-
import "./path-alias-guards-B3ZKrId1.js";
|
|
50
|
-
import "./skills-B4h1k-SP.js";
|
|
51
|
-
import "./ports-BVwQuCIR.js";
|
|
52
|
-
import "./ports-lsof-DiY6GaAf.js";
|
|
53
|
-
import "./ssh-tunnel-BaHTFPzH.js";
|
|
54
|
-
import "./image-ops-Uw4rEShL.js";
|
|
55
|
-
import "./fs-safe-Da4H0IOU.js";
|
|
56
|
-
import "./mime-_IkgFMS2.js";
|
|
57
|
-
import "./server-middleware-BPq4bu3A.js";
|
|
58
|
-
import "./message-channel-CKeDAoOT.js";
|
|
59
|
-
import "./resolve-route-IkBfMjBz.js";
|
|
60
|
-
import "./internal-hooks-0x1JiQ5f.js";
|
|
61
|
-
import { a as resolveSenderScopedGroupPolicy, i as evaluateSenderGroupAccessForPolicy, l as resolveDefaultGroupPolicy } from "./group-access-BWGTPTwF.js";
|
|
62
|
-
import "./lazy-runtime-DdzFA4b9.js";
|
|
63
|
-
import "./config-schema-GQ6uWjXe.js";
|
|
64
|
-
import "./method-scopes-D-Q9dvbj.js";
|
|
65
|
-
import "./session-cost-usage-B-57mlS8.js";
|
|
66
|
-
import "./paths-CDWV-9nX.js";
|
|
67
|
-
import "./routing-3o2D0ix4.js";
|
|
68
|
-
import "./send-Cm9v3uhF.js";
|
|
69
|
-
import "./node-resolve-DfOpQmxm.js";
|
|
70
|
-
import "./provider-stream-gVymYPmd.js";
|
|
71
|
-
import "./identity-file-DM4N5_7H.js";
|
|
72
|
-
import "./provider-models-BA3hqqPq.js";
|
|
73
|
-
import "./secret-file-Bjh19aoH.js";
|
|
74
|
-
import "./logging-BdFqMomc.js";
|
|
75
|
-
import "./runtime-env-CT-voxYE.js";
|
|
76
|
-
import "./registry-xhgvU89y.js";
|
|
77
|
-
import "./provider-onboard-CBC3kdk_.js";
|
|
78
|
-
import "./model-definitions-DwehIMlw.js";
|
|
79
|
-
import "./diagnostic-vMghIesG.js";
|
|
80
|
-
import "./message-hook-mappers-DORrSLHM.js";
|
|
81
|
-
import "./json-store-DlpyvQXN.js";
|
|
82
|
-
import "./call-CoaQYq7c.js";
|
|
83
|
-
import "./multimodal-BWF8MRkz.js";
|
|
84
|
-
import "./memory-search-BBG2BKIh.js";
|
|
85
|
-
import "./query-expansion-8R79qExs.js";
|
|
86
|
-
import "./search-manager-CfizyEMk.js";
|
|
87
|
-
import "./core-EKuk2FxR.js";
|
|
88
|
-
import "./issue-format-i6sEuV4a.js";
|
|
89
|
-
import "./logging-S-5LPdfQ.js";
|
|
90
|
-
import "./note-z78_JyNp.js";
|
|
91
|
-
import "./state-paths-C7dX__ql.js";
|
|
92
|
-
import "./config-value-Dh8m-CFf.js";
|
|
93
|
-
import "./command-secret-targets-CO_lZ_ZZ.js";
|
|
94
|
-
import "./brave-BG5Yopn8.js";
|
|
95
|
-
import "./provider-usage-DzuzbNBv.js";
|
|
96
|
-
import "./perplexity-Brhpb45X.js";
|
|
97
|
-
import "./restart-stale-pids-CN9ElYwR.js";
|
|
98
|
-
import "./delivery-queue-DLjFP-0C.js";
|
|
99
|
-
import "./pairing-token-ANLRyJSu.js";
|
|
100
|
-
import "./accounts-BCaV8MsT.js";
|
|
101
|
-
import "./process-runtime-CicRKAFe.js";
|
|
102
|
-
import "./audit-BqRK9OSj.js";
|
|
103
|
-
import "./cli-runtime-DtIDS2w7.js";
|
|
104
|
-
import "./cli-utils-FHeUZLsT.js";
|
|
105
|
-
import "./help-format-1yV2Xzq7.js";
|
|
106
|
-
import "./progress-BQSTKUhd.js";
|
|
107
|
-
import "./gateway-runtime-C76hUmUV.js";
|
|
108
|
-
import { n as keepHttpServerTaskAlive } from "./channel-lifecycle-x1smD1P7.js";
|
|
109
|
-
import { n as dispatchReplyFromConfigWithSettledDispatcher } from "./inbound-reply-dispatch-DoIJLztA.js";
|
|
110
|
-
import "./outbound-media-C5Nv4o18.js";
|
|
111
|
-
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-Bf-wk2Rp.js";
|
|
112
|
-
import { a as resolveMSTeamsRouteConfig, i as resolveMSTeamsReplyPolicy, n as resolveMSTeamsAllowlistMatch, t as isMSTeamsGroupAllowed } from "./policy-BJv97w9e.js";
|
|
113
|
-
import { t as getMSTeamsRuntime } from "./runtime-py8d-uva.js";
|
|
114
|
-
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-BJEb2wGv.js";
|
|
115
|
-
//#region extensions/msteams/src/inbound.ts
|
|
116
|
-
function normalizeMSTeamsConversationId(raw) {
|
|
117
|
-
return raw.split(";")[0] ?? raw;
|
|
118
|
-
}
|
|
119
|
-
function extractMSTeamsConversationMessageId(raw) {
|
|
120
|
-
if (!raw) return;
|
|
121
|
-
return (/(?:^|;)messageid=([^;]+)/i.exec(raw)?.[1]?.trim() ?? "") || void 0;
|
|
122
|
-
}
|
|
123
|
-
function parseMSTeamsActivityTimestamp(value) {
|
|
124
|
-
if (!value) return;
|
|
125
|
-
if (value instanceof Date) return value;
|
|
126
|
-
if (typeof value !== "string") return;
|
|
127
|
-
const date = new Date(value);
|
|
128
|
-
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
129
|
-
}
|
|
130
|
-
function stripMSTeamsMentionTags(text) {
|
|
131
|
-
return text.replace(/<at[^>]*>.*?<\/at>/gi, "").trim();
|
|
132
|
-
}
|
|
133
|
-
function wasMSTeamsBotMentioned(activity) {
|
|
134
|
-
const botId = activity.recipient?.id;
|
|
135
|
-
if (!botId) return false;
|
|
136
|
-
return (activity.entities ?? []).some((e) => e.type === "mention" && e.mentioned?.id === botId);
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region extensions/msteams/src/attachments/remote-media.ts
|
|
140
|
-
async function downloadAndStoreMSTeamsRemoteMedia(params) {
|
|
141
|
-
const fetched = await getMSTeamsRuntime().channel.media.fetchRemoteMedia({
|
|
142
|
-
url: params.url,
|
|
143
|
-
fetchImpl: params.fetchImpl,
|
|
144
|
-
filePathHint: params.filePathHint,
|
|
145
|
-
maxBytes: params.maxBytes,
|
|
146
|
-
ssrfPolicy: params.ssrfPolicy
|
|
147
|
-
});
|
|
148
|
-
const mime = await getMSTeamsRuntime().media.detectMime({
|
|
149
|
-
buffer: fetched.buffer,
|
|
150
|
-
headerMime: fetched.contentType ?? params.contentTypeHint,
|
|
151
|
-
filePath: params.filePathHint
|
|
152
|
-
});
|
|
153
|
-
const originalFilename = params.preserveFilenames ? params.filePathHint : void 0;
|
|
154
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(fetched.buffer, mime ?? params.contentTypeHint, "inbound", params.maxBytes, originalFilename);
|
|
155
|
-
return {
|
|
156
|
-
path: saved.path,
|
|
157
|
-
contentType: saved.contentType,
|
|
158
|
-
placeholder: params.placeholder ?? inferPlaceholder({
|
|
159
|
-
contentType: saved.contentType,
|
|
160
|
-
fileName: params.filePathHint
|
|
161
|
-
})
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region extensions/msteams/src/attachments/download.ts
|
|
166
|
-
function resolveDownloadCandidate(att) {
|
|
167
|
-
const contentType = normalizeContentType(att.contentType);
|
|
168
|
-
const name = typeof att.name === "string" ? att.name.trim() : "";
|
|
169
|
-
if (contentType === "application/vnd.microsoft.teams.file.download.info") {
|
|
170
|
-
if (!isRecord(att.content)) return null;
|
|
171
|
-
const downloadUrl = typeof att.content.downloadUrl === "string" ? att.content.downloadUrl.trim() : "";
|
|
172
|
-
if (!downloadUrl) return null;
|
|
173
|
-
const fileType = typeof att.content.fileType === "string" ? att.content.fileType.trim() : "";
|
|
174
|
-
const uniqueId = typeof att.content.uniqueId === "string" ? att.content.uniqueId.trim() : "";
|
|
175
|
-
const fileName = typeof att.content.fileName === "string" ? att.content.fileName.trim() : "";
|
|
176
|
-
const fileHint = name || fileName || (uniqueId && fileType ? `${uniqueId}.${fileType}` : "");
|
|
177
|
-
return {
|
|
178
|
-
url: downloadUrl,
|
|
179
|
-
fileHint: fileHint || void 0,
|
|
180
|
-
contentTypeHint: void 0,
|
|
181
|
-
placeholder: inferPlaceholder({
|
|
182
|
-
contentType,
|
|
183
|
-
fileName: fileHint,
|
|
184
|
-
fileType
|
|
185
|
-
})
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
const contentUrl = typeof att.contentUrl === "string" ? att.contentUrl.trim() : "";
|
|
189
|
-
if (!contentUrl) return null;
|
|
190
|
-
return {
|
|
191
|
-
url: contentUrl,
|
|
192
|
-
fileHint: name || void 0,
|
|
193
|
-
contentTypeHint: contentType,
|
|
194
|
-
placeholder: inferPlaceholder({
|
|
195
|
-
contentType,
|
|
196
|
-
fileName: name
|
|
197
|
-
})
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function scopeCandidatesForUrl(url) {
|
|
201
|
-
try {
|
|
202
|
-
const host = new URL(url).hostname.toLowerCase();
|
|
203
|
-
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"];
|
|
204
|
-
} catch {
|
|
205
|
-
return ["https://api.botframework.com", "https://graph.microsoft.com"];
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function isRedirectStatus(status) {
|
|
209
|
-
return status === 301 || status === 302 || status === 303 || status === 307 || status === 308;
|
|
210
|
-
}
|
|
211
|
-
async function fetchWithAuthFallback(params) {
|
|
212
|
-
const firstAttempt = await safeFetchWithPolicy({
|
|
213
|
-
url: params.url,
|
|
214
|
-
policy: params.policy,
|
|
215
|
-
fetchFn: params.fetchFn,
|
|
216
|
-
requestInit: params.requestInit
|
|
217
|
-
});
|
|
218
|
-
if (firstAttempt.ok) return firstAttempt;
|
|
219
|
-
if (!params.tokenProvider) return firstAttempt;
|
|
220
|
-
if (firstAttempt.status !== 401 && firstAttempt.status !== 403) return firstAttempt;
|
|
221
|
-
if (!isUrlAllowed(params.url, params.policy.authAllowHosts)) return firstAttempt;
|
|
222
|
-
const scopes = scopeCandidatesForUrl(params.url);
|
|
223
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
224
|
-
for (const scope of scopes) try {
|
|
225
|
-
const token = await params.tokenProvider.getAccessToken(scope);
|
|
226
|
-
const authHeaders = new Headers(params.requestInit?.headers);
|
|
227
|
-
authHeaders.set("Authorization", `Bearer ${token}`);
|
|
228
|
-
const authAttempt = await safeFetchWithPolicy({
|
|
229
|
-
url: params.url,
|
|
230
|
-
policy: params.policy,
|
|
231
|
-
fetchFn,
|
|
232
|
-
requestInit: {
|
|
233
|
-
...params.requestInit,
|
|
234
|
-
headers: authHeaders
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
if (authAttempt.ok) return authAttempt;
|
|
238
|
-
if (isRedirectStatus(authAttempt.status)) return authAttempt;
|
|
239
|
-
if (authAttempt.status !== 401 && authAttempt.status !== 403) continue;
|
|
240
|
-
} catch {}
|
|
241
|
-
return firstAttempt;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Download all file attachments from a Teams message (images, documents, etc.).
|
|
245
|
-
* Renamed from downloadMSTeamsImageAttachments to support all file types.
|
|
246
|
-
*/
|
|
247
|
-
async function downloadMSTeamsAttachments(params) {
|
|
248
|
-
const list = Array.isArray(params.attachments) ? params.attachments : [];
|
|
249
|
-
if (list.length === 0) return [];
|
|
250
|
-
const policy = resolveAttachmentFetchPolicy({
|
|
251
|
-
allowHosts: params.allowHosts,
|
|
252
|
-
authAllowHosts: params.authAllowHosts
|
|
253
|
-
});
|
|
254
|
-
const allowHosts = policy.allowHosts;
|
|
255
|
-
const ssrfPolicy = resolveMediaSsrfPolicy(allowHosts);
|
|
256
|
-
const candidates = list.filter(isDownloadableAttachment).map(resolveDownloadCandidate).filter(Boolean);
|
|
257
|
-
const inlineCandidates = extractInlineImageCandidates(list);
|
|
258
|
-
const seenUrls = /* @__PURE__ */ new Set();
|
|
259
|
-
for (const inline of inlineCandidates) if (inline.kind === "url") {
|
|
260
|
-
if (!isUrlAllowed(inline.url, allowHosts)) continue;
|
|
261
|
-
if (seenUrls.has(inline.url)) continue;
|
|
262
|
-
seenUrls.add(inline.url);
|
|
263
|
-
candidates.push({
|
|
264
|
-
url: inline.url,
|
|
265
|
-
fileHint: inline.fileHint,
|
|
266
|
-
contentTypeHint: inline.contentType,
|
|
267
|
-
placeholder: inline.placeholder
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
if (candidates.length === 0 && inlineCandidates.length === 0) return [];
|
|
271
|
-
const out = [];
|
|
272
|
-
for (const inline of inlineCandidates) {
|
|
273
|
-
if (inline.kind !== "data") continue;
|
|
274
|
-
if (inline.data.byteLength > params.maxBytes) continue;
|
|
275
|
-
try {
|
|
276
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(inline.data, inline.contentType, "inbound", params.maxBytes);
|
|
277
|
-
out.push({
|
|
278
|
-
path: saved.path,
|
|
279
|
-
contentType: saved.contentType,
|
|
280
|
-
placeholder: inline.placeholder
|
|
281
|
-
});
|
|
282
|
-
} catch {}
|
|
283
|
-
}
|
|
284
|
-
for (const candidate of candidates) {
|
|
285
|
-
if (!isUrlAllowed(candidate.url, allowHosts)) continue;
|
|
286
|
-
try {
|
|
287
|
-
const media = await downloadAndStoreMSTeamsRemoteMedia({
|
|
288
|
-
url: candidate.url,
|
|
289
|
-
filePathHint: candidate.fileHint ?? candidate.url,
|
|
290
|
-
maxBytes: params.maxBytes,
|
|
291
|
-
contentTypeHint: candidate.contentTypeHint,
|
|
292
|
-
placeholder: candidate.placeholder,
|
|
293
|
-
preserveFilenames: params.preserveFilenames,
|
|
294
|
-
ssrfPolicy,
|
|
295
|
-
fetchImpl: (input, init) => fetchWithAuthFallback({
|
|
296
|
-
url: resolveRequestUrl(input),
|
|
297
|
-
tokenProvider: params.tokenProvider,
|
|
298
|
-
fetchFn: params.fetchFn,
|
|
299
|
-
requestInit: init,
|
|
300
|
-
policy
|
|
301
|
-
})
|
|
302
|
-
});
|
|
303
|
-
out.push(media);
|
|
304
|
-
} catch {}
|
|
305
|
-
}
|
|
306
|
-
return out;
|
|
307
|
-
}
|
|
308
|
-
//#endregion
|
|
309
|
-
//#region extensions/msteams/src/attachments/graph.ts
|
|
310
|
-
function readNestedString(value, keys) {
|
|
311
|
-
let current = value;
|
|
312
|
-
for (const key of keys) {
|
|
313
|
-
if (!isRecord(current)) return;
|
|
314
|
-
current = current[key];
|
|
315
|
-
}
|
|
316
|
-
return typeof current === "string" && current.trim() ? current.trim() : void 0;
|
|
317
|
-
}
|
|
318
|
-
function buildMSTeamsGraphMessageUrls(params) {
|
|
319
|
-
const conversationType = params.conversationType?.trim().toLowerCase() ?? "";
|
|
320
|
-
const messageIdCandidates = /* @__PURE__ */ new Set();
|
|
321
|
-
const pushCandidate = (value) => {
|
|
322
|
-
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
323
|
-
if (trimmed) messageIdCandidates.add(trimmed);
|
|
324
|
-
};
|
|
325
|
-
pushCandidate(params.messageId);
|
|
326
|
-
pushCandidate(params.conversationMessageId);
|
|
327
|
-
pushCandidate(readNestedString(params.channelData, ["messageId"]));
|
|
328
|
-
pushCandidate(readNestedString(params.channelData, ["teamsMessageId"]));
|
|
329
|
-
const replyToId = typeof params.replyToId === "string" ? params.replyToId.trim() : "";
|
|
330
|
-
if (conversationType === "channel") {
|
|
331
|
-
const teamId = readNestedString(params.channelData, ["team", "id"]) ?? readNestedString(params.channelData, ["teamId"]);
|
|
332
|
-
const channelId = readNestedString(params.channelData, ["channel", "id"]) ?? readNestedString(params.channelData, ["channelId"]) ?? readNestedString(params.channelData, ["teamsChannelId"]);
|
|
333
|
-
if (!teamId || !channelId) return [];
|
|
334
|
-
const urls = [];
|
|
335
|
-
if (replyToId) for (const candidate of messageIdCandidates) {
|
|
336
|
-
if (candidate === replyToId) continue;
|
|
337
|
-
urls.push(`${GRAPH_ROOT}/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages/${encodeURIComponent(replyToId)}/replies/${encodeURIComponent(candidate)}`);
|
|
338
|
-
}
|
|
339
|
-
if (messageIdCandidates.size === 0 && replyToId) messageIdCandidates.add(replyToId);
|
|
340
|
-
for (const candidate of messageIdCandidates) urls.push(`${GRAPH_ROOT}/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages/${encodeURIComponent(candidate)}`);
|
|
341
|
-
return Array.from(new Set(urls));
|
|
342
|
-
}
|
|
343
|
-
const chatId = params.conversationId?.trim() || readNestedString(params.channelData, ["chatId"]);
|
|
344
|
-
if (!chatId) return [];
|
|
345
|
-
if (messageIdCandidates.size === 0 && replyToId) messageIdCandidates.add(replyToId);
|
|
346
|
-
const urls = Array.from(messageIdCandidates).map((candidate) => `${GRAPH_ROOT}/chats/${encodeURIComponent(chatId)}/messages/${encodeURIComponent(candidate)}`);
|
|
347
|
-
return Array.from(new Set(urls));
|
|
348
|
-
}
|
|
349
|
-
async function fetchGraphCollection(params) {
|
|
350
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
351
|
-
const { response, release } = await fetchWithSsrFGuard({
|
|
352
|
-
url: params.url,
|
|
353
|
-
fetchImpl: fetchFn,
|
|
354
|
-
init: { headers: { Authorization: `Bearer ${params.accessToken}` } },
|
|
355
|
-
policy: params.ssrfPolicy,
|
|
356
|
-
auditContext: "msteams.graph.collection"
|
|
357
|
-
});
|
|
358
|
-
try {
|
|
359
|
-
const status = response.status;
|
|
360
|
-
if (!response.ok) return {
|
|
361
|
-
status,
|
|
362
|
-
items: []
|
|
363
|
-
};
|
|
364
|
-
try {
|
|
365
|
-
const data = await response.json();
|
|
366
|
-
return {
|
|
367
|
-
status,
|
|
368
|
-
items: Array.isArray(data.value) ? data.value : []
|
|
369
|
-
};
|
|
370
|
-
} catch {
|
|
371
|
-
return {
|
|
372
|
-
status,
|
|
373
|
-
items: []
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
} finally {
|
|
377
|
-
await release();
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
function normalizeGraphAttachment(att) {
|
|
381
|
-
let content = att.content;
|
|
382
|
-
if (typeof content === "string") try {
|
|
383
|
-
content = JSON.parse(content);
|
|
384
|
-
} catch {}
|
|
385
|
-
return {
|
|
386
|
-
contentType: normalizeContentType(att.contentType) ?? void 0,
|
|
387
|
-
contentUrl: att.contentUrl ?? void 0,
|
|
388
|
-
name: att.name ?? void 0,
|
|
389
|
-
thumbnailUrl: att.thumbnailUrl ?? void 0,
|
|
390
|
-
content
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Download all hosted content from a Teams message (images, documents, etc.).
|
|
395
|
-
* Renamed from downloadGraphHostedImages to support all file types.
|
|
396
|
-
*/
|
|
397
|
-
async function downloadGraphHostedContent(params) {
|
|
398
|
-
const hosted = await fetchGraphCollection({
|
|
399
|
-
url: `${params.messageUrl}/hostedContents`,
|
|
400
|
-
accessToken: params.accessToken,
|
|
401
|
-
fetchFn: params.fetchFn,
|
|
402
|
-
ssrfPolicy: params.ssrfPolicy
|
|
403
|
-
});
|
|
404
|
-
if (hosted.items.length === 0) return {
|
|
405
|
-
media: [],
|
|
406
|
-
status: hosted.status,
|
|
407
|
-
count: 0
|
|
408
|
-
};
|
|
409
|
-
const out = [];
|
|
410
|
-
for (const item of hosted.items) {
|
|
411
|
-
const contentBytes = typeof item.contentBytes === "string" ? item.contentBytes : "";
|
|
412
|
-
if (!contentBytes) continue;
|
|
413
|
-
let buffer;
|
|
414
|
-
try {
|
|
415
|
-
buffer = Buffer.from(contentBytes, "base64");
|
|
416
|
-
} catch {
|
|
417
|
-
continue;
|
|
418
|
-
}
|
|
419
|
-
if (buffer.byteLength > params.maxBytes) continue;
|
|
420
|
-
const mime = await getMSTeamsRuntime().media.detectMime({
|
|
421
|
-
buffer,
|
|
422
|
-
headerMime: item.contentType ?? void 0
|
|
423
|
-
});
|
|
424
|
-
try {
|
|
425
|
-
const saved = await getMSTeamsRuntime().channel.media.saveMediaBuffer(buffer, mime ?? item.contentType ?? void 0, "inbound", params.maxBytes);
|
|
426
|
-
out.push({
|
|
427
|
-
path: saved.path,
|
|
428
|
-
contentType: saved.contentType,
|
|
429
|
-
placeholder: inferPlaceholder({ contentType: saved.contentType })
|
|
430
|
-
});
|
|
431
|
-
} catch {}
|
|
432
|
-
}
|
|
433
|
-
return {
|
|
434
|
-
media: out,
|
|
435
|
-
status: hosted.status,
|
|
436
|
-
count: hosted.items.length
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
async function downloadMSTeamsGraphMedia(params) {
|
|
440
|
-
if (!params.messageUrl || !params.tokenProvider) return { media: [] };
|
|
441
|
-
const policy = resolveAttachmentFetchPolicy({
|
|
442
|
-
allowHosts: params.allowHosts,
|
|
443
|
-
authAllowHosts: params.authAllowHosts
|
|
444
|
-
});
|
|
445
|
-
const ssrfPolicy = resolveMediaSsrfPolicy(policy.allowHosts);
|
|
446
|
-
const messageUrl = params.messageUrl;
|
|
447
|
-
let accessToken;
|
|
448
|
-
try {
|
|
449
|
-
accessToken = await params.tokenProvider.getAccessToken("https://graph.microsoft.com");
|
|
450
|
-
} catch {
|
|
451
|
-
return {
|
|
452
|
-
media: [],
|
|
453
|
-
messageUrl,
|
|
454
|
-
tokenError: true
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
const fetchFn = params.fetchFn ?? fetch;
|
|
458
|
-
const sharePointMedia = [];
|
|
459
|
-
const downloadedReferenceUrls = /* @__PURE__ */ new Set();
|
|
460
|
-
try {
|
|
461
|
-
const { response: msgRes, release } = await fetchWithSsrFGuard({
|
|
462
|
-
url: messageUrl,
|
|
463
|
-
fetchImpl: fetchFn,
|
|
464
|
-
init: { headers: { Authorization: `Bearer ${accessToken}` } },
|
|
465
|
-
policy: ssrfPolicy,
|
|
466
|
-
auditContext: "msteams.graph.message"
|
|
467
|
-
});
|
|
468
|
-
try {
|
|
469
|
-
if (msgRes.ok) {
|
|
470
|
-
const spAttachments = ((await msgRes.json()).attachments ?? []).filter((a) => a.contentType === "reference" && a.contentUrl && a.name);
|
|
471
|
-
for (const att of spAttachments) {
|
|
472
|
-
const name = att.name ?? "file";
|
|
473
|
-
try {
|
|
474
|
-
const shareUrl = att.contentUrl;
|
|
475
|
-
if (!isUrlAllowed(shareUrl, policy.allowHosts)) continue;
|
|
476
|
-
const media = await downloadAndStoreMSTeamsRemoteMedia({
|
|
477
|
-
url: `${GRAPH_ROOT}/shares/u!${Buffer.from(shareUrl).toString("base64url")}/driveItem/content`,
|
|
478
|
-
filePathHint: name,
|
|
479
|
-
maxBytes: params.maxBytes,
|
|
480
|
-
contentTypeHint: "application/octet-stream",
|
|
481
|
-
preserveFilenames: params.preserveFilenames,
|
|
482
|
-
ssrfPolicy,
|
|
483
|
-
fetchImpl: async (input, init) => {
|
|
484
|
-
const requestUrl = resolveRequestUrl(input);
|
|
485
|
-
const headers = new Headers(init?.headers);
|
|
486
|
-
applyAuthorizationHeaderForUrl({
|
|
487
|
-
headers,
|
|
488
|
-
url: requestUrl,
|
|
489
|
-
authAllowHosts: policy.authAllowHosts,
|
|
490
|
-
bearerToken: accessToken
|
|
491
|
-
});
|
|
492
|
-
return await safeFetchWithPolicy({
|
|
493
|
-
url: requestUrl,
|
|
494
|
-
policy,
|
|
495
|
-
fetchFn,
|
|
496
|
-
requestInit: {
|
|
497
|
-
...init,
|
|
498
|
-
headers
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
sharePointMedia.push(media);
|
|
504
|
-
downloadedReferenceUrls.add(shareUrl);
|
|
505
|
-
} catch {}
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
} finally {
|
|
509
|
-
await release();
|
|
510
|
-
}
|
|
511
|
-
} catch {}
|
|
512
|
-
const hosted = await downloadGraphHostedContent({
|
|
513
|
-
accessToken,
|
|
514
|
-
messageUrl,
|
|
515
|
-
maxBytes: params.maxBytes,
|
|
516
|
-
fetchFn: params.fetchFn,
|
|
517
|
-
preserveFilenames: params.preserveFilenames,
|
|
518
|
-
ssrfPolicy
|
|
519
|
-
});
|
|
520
|
-
const attachments = await fetchGraphCollection({
|
|
521
|
-
url: `${messageUrl}/attachments`,
|
|
522
|
-
accessToken,
|
|
523
|
-
fetchFn: params.fetchFn,
|
|
524
|
-
ssrfPolicy
|
|
525
|
-
});
|
|
526
|
-
const normalizedAttachments = attachments.items.map(normalizeGraphAttachment);
|
|
527
|
-
const filteredAttachments = sharePointMedia.length > 0 ? normalizedAttachments.filter((att) => {
|
|
528
|
-
if (att.contentType?.toLowerCase() !== "reference") return true;
|
|
529
|
-
const url = typeof att.contentUrl === "string" ? att.contentUrl : "";
|
|
530
|
-
if (!url) return true;
|
|
531
|
-
return !downloadedReferenceUrls.has(url);
|
|
532
|
-
}) : normalizedAttachments;
|
|
533
|
-
const attachmentMedia = await downloadMSTeamsAttachments({
|
|
534
|
-
attachments: filteredAttachments,
|
|
535
|
-
maxBytes: params.maxBytes,
|
|
536
|
-
tokenProvider: params.tokenProvider,
|
|
537
|
-
allowHosts: policy.allowHosts,
|
|
538
|
-
authAllowHosts: policy.authAllowHosts,
|
|
539
|
-
fetchFn: params.fetchFn,
|
|
540
|
-
preserveFilenames: params.preserveFilenames
|
|
541
|
-
});
|
|
542
|
-
return {
|
|
543
|
-
media: [
|
|
544
|
-
...sharePointMedia,
|
|
545
|
-
...hosted.media,
|
|
546
|
-
...attachmentMedia
|
|
547
|
-
],
|
|
548
|
-
hostedCount: hosted.count,
|
|
549
|
-
attachmentCount: filteredAttachments.length + sharePointMedia.length,
|
|
550
|
-
hostedStatus: hosted.status,
|
|
551
|
-
attachmentStatus: attachments.status,
|
|
552
|
-
messageUrl
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
//#endregion
|
|
556
|
-
//#region extensions/msteams/src/attachments/html.ts
|
|
557
|
-
function summarizeMSTeamsHtmlAttachments(attachments) {
|
|
558
|
-
const list = Array.isArray(attachments) ? attachments : [];
|
|
559
|
-
if (list.length === 0) return;
|
|
560
|
-
let htmlAttachments = 0;
|
|
561
|
-
let imgTags = 0;
|
|
562
|
-
let dataImages = 0;
|
|
563
|
-
let cidImages = 0;
|
|
564
|
-
const srcHosts = /* @__PURE__ */ new Set();
|
|
565
|
-
let attachmentTags = 0;
|
|
566
|
-
const attachmentIds = /* @__PURE__ */ new Set();
|
|
567
|
-
for (const att of list) {
|
|
568
|
-
const html = extractHtmlFromAttachment(att);
|
|
569
|
-
if (!html) continue;
|
|
570
|
-
htmlAttachments += 1;
|
|
571
|
-
IMG_SRC_RE.lastIndex = 0;
|
|
572
|
-
let match = IMG_SRC_RE.exec(html);
|
|
573
|
-
while (match) {
|
|
574
|
-
imgTags += 1;
|
|
575
|
-
const src = match[1]?.trim();
|
|
576
|
-
if (src) if (src.startsWith("data:")) dataImages += 1;
|
|
577
|
-
else if (src.startsWith("cid:")) cidImages += 1;
|
|
578
|
-
else srcHosts.add(safeHostForUrl(src));
|
|
579
|
-
match = IMG_SRC_RE.exec(html);
|
|
580
|
-
}
|
|
581
|
-
ATTACHMENT_TAG_RE.lastIndex = 0;
|
|
582
|
-
let attachmentMatch = ATTACHMENT_TAG_RE.exec(html);
|
|
583
|
-
while (attachmentMatch) {
|
|
584
|
-
attachmentTags += 1;
|
|
585
|
-
const id = attachmentMatch[1]?.trim();
|
|
586
|
-
if (id) attachmentIds.add(id);
|
|
587
|
-
attachmentMatch = ATTACHMENT_TAG_RE.exec(html);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
if (htmlAttachments === 0) return;
|
|
591
|
-
return {
|
|
592
|
-
htmlAttachments,
|
|
593
|
-
imgTags,
|
|
594
|
-
dataImages,
|
|
595
|
-
cidImages,
|
|
596
|
-
srcHosts: Array.from(srcHosts).slice(0, 5),
|
|
597
|
-
attachmentTags,
|
|
598
|
-
attachmentIds: Array.from(attachmentIds).slice(0, 5)
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
function buildMSTeamsAttachmentPlaceholder(attachments) {
|
|
602
|
-
const list = Array.isArray(attachments) ? attachments : [];
|
|
603
|
-
if (list.length === 0) return "";
|
|
604
|
-
const totalImages = list.filter(isLikelyImageAttachment).length + extractInlineImageCandidates(list).length;
|
|
605
|
-
if (totalImages > 0) return `<media:image>${totalImages > 1 ? ` (${totalImages} images)` : ""}`;
|
|
606
|
-
const count = list.length;
|
|
607
|
-
return `<media:document>${count > 1 ? ` (${count} files)` : ""}`;
|
|
608
|
-
}
|
|
609
|
-
//#endregion
|
|
610
|
-
//#region extensions/msteams/src/attachments/payload.ts
|
|
611
|
-
function buildMSTeamsMediaPayload(mediaList) {
|
|
612
|
-
return buildMediaPayload(mediaList, { preserveMediaTypeCardinality: true });
|
|
613
|
-
}
|
|
614
|
-
//#endregion
|
|
615
|
-
//#region extensions/msteams/src/reply-dispatcher.ts
|
|
616
|
-
function createMSTeamsReplyDispatcher(params) {
|
|
617
|
-
const core = getMSTeamsRuntime();
|
|
618
|
-
/**
|
|
619
|
-
* Send a typing indicator.
|
|
620
|
-
*
|
|
621
|
-
* First tries the live turn context (cheapest path). When the context has
|
|
622
|
-
* been revoked (debounced messages) we fall back to proactive messaging via
|
|
623
|
-
* the stored conversation reference so the user still sees the "…" bubble.
|
|
624
|
-
*/
|
|
625
|
-
const sendTypingIndicator = async () => {
|
|
626
|
-
await withRevokedProxyFallback({
|
|
627
|
-
run: async () => {
|
|
628
|
-
await params.context.sendActivity({ type: "typing" });
|
|
629
|
-
},
|
|
630
|
-
onRevoked: async () => {
|
|
631
|
-
const baseRef = buildConversationReference(params.conversationRef);
|
|
632
|
-
await params.adapter.continueConversation(params.appId, {
|
|
633
|
-
...baseRef,
|
|
634
|
-
activityId: void 0
|
|
635
|
-
}, async (ctx) => {
|
|
636
|
-
await ctx.sendActivity({ type: "typing" });
|
|
637
|
-
});
|
|
638
|
-
},
|
|
639
|
-
onRevokedLog: () => {
|
|
640
|
-
params.log.debug?.("turn context revoked, sending typing via proactive messaging");
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
};
|
|
644
|
-
const typingCallbacks = createTypingCallbacks({
|
|
645
|
-
start: sendTypingIndicator,
|
|
646
|
-
onStartError: (err) => {
|
|
647
|
-
logTypingFailure({
|
|
648
|
-
log: (message) => params.log.debug?.(message),
|
|
649
|
-
channel: "msteams",
|
|
650
|
-
action: "start",
|
|
651
|
-
error: err
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
656
|
-
cfg: params.cfg,
|
|
657
|
-
agentId: params.agentId,
|
|
658
|
-
channel: "msteams",
|
|
659
|
-
accountId: params.accountId
|
|
660
|
-
});
|
|
661
|
-
const chunkMode = core.channel.text.resolveChunkMode(params.cfg, "msteams");
|
|
662
|
-
const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
663
|
-
...prefixOptions,
|
|
664
|
-
humanDelay: core.channel.reply.resolveHumanDelayConfig(params.cfg, params.agentId),
|
|
665
|
-
typingCallbacks,
|
|
666
|
-
deliver: async (payload) => {
|
|
667
|
-
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
668
|
-
cfg: params.cfg,
|
|
669
|
-
channel: "msteams"
|
|
670
|
-
});
|
|
671
|
-
const messages = renderReplyPayloadsToMessages([payload], {
|
|
672
|
-
textChunkLimit: params.textLimit,
|
|
673
|
-
chunkText: true,
|
|
674
|
-
mediaMode: "split",
|
|
675
|
-
tableMode,
|
|
676
|
-
chunkMode
|
|
677
|
-
});
|
|
678
|
-
const mediaMaxBytes = resolveChannelMediaMaxBytes({
|
|
679
|
-
cfg: params.cfg,
|
|
680
|
-
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
|
|
681
|
-
});
|
|
682
|
-
const ids = await sendMSTeamsMessages({
|
|
683
|
-
replyStyle: params.replyStyle,
|
|
684
|
-
adapter: params.adapter,
|
|
685
|
-
appId: params.appId,
|
|
686
|
-
conversationRef: params.conversationRef,
|
|
687
|
-
context: params.context,
|
|
688
|
-
messages,
|
|
689
|
-
retry: {},
|
|
690
|
-
onRetry: (event) => {
|
|
691
|
-
params.log.debug?.("retrying send", {
|
|
692
|
-
replyStyle: params.replyStyle,
|
|
693
|
-
...event
|
|
694
|
-
});
|
|
695
|
-
},
|
|
696
|
-
tokenProvider: params.tokenProvider,
|
|
697
|
-
sharePointSiteId: params.sharePointSiteId,
|
|
698
|
-
mediaMaxBytes
|
|
699
|
-
});
|
|
700
|
-
if (ids.length > 0) params.onSentMessageIds?.(ids);
|
|
701
|
-
},
|
|
702
|
-
onError: (err, info) => {
|
|
703
|
-
const errMsg = formatUnknownError(err);
|
|
704
|
-
const classification = classifyMSTeamsSendError(err);
|
|
705
|
-
const hint = formatMSTeamsSendErrorHint(classification);
|
|
706
|
-
params.runtime.error?.(`msteams ${info.kind} reply failed: ${errMsg}${hint ? ` (${hint})` : ""}`);
|
|
707
|
-
params.log.error("reply failed", {
|
|
708
|
-
kind: info.kind,
|
|
709
|
-
error: errMsg,
|
|
710
|
-
classification,
|
|
711
|
-
hint
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
return {
|
|
716
|
-
dispatcher,
|
|
717
|
-
replyOptions: {
|
|
718
|
-
...replyOptions,
|
|
719
|
-
onModelSelected
|
|
720
|
-
},
|
|
721
|
-
markDispatchIdle
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
//#endregion
|
|
725
|
-
//#region extensions/msteams/src/sent-message-cache.ts
|
|
726
|
-
const TTL_MS = 1440 * 60 * 1e3;
|
|
727
|
-
const sentMessages = /* @__PURE__ */ new Map();
|
|
728
|
-
function cleanupExpired(entry) {
|
|
729
|
-
const now = Date.now();
|
|
730
|
-
for (const [msgId, timestamp] of entry.timestamps) if (now - timestamp > TTL_MS) entry.timestamps.delete(msgId);
|
|
731
|
-
}
|
|
732
|
-
function recordMSTeamsSentMessage(conversationId, messageId) {
|
|
733
|
-
if (!conversationId || !messageId) return;
|
|
734
|
-
let entry = sentMessages.get(conversationId);
|
|
735
|
-
if (!entry) {
|
|
736
|
-
entry = { timestamps: /* @__PURE__ */ new Map() };
|
|
737
|
-
sentMessages.set(conversationId, entry);
|
|
738
|
-
}
|
|
739
|
-
entry.timestamps.set(messageId, Date.now());
|
|
740
|
-
if (entry.timestamps.size > 200) cleanupExpired(entry);
|
|
741
|
-
}
|
|
742
|
-
function wasMSTeamsMessageSent(conversationId, messageId) {
|
|
743
|
-
const entry = sentMessages.get(conversationId);
|
|
744
|
-
if (!entry) return false;
|
|
745
|
-
cleanupExpired(entry);
|
|
746
|
-
return entry.timestamps.has(messageId);
|
|
747
|
-
}
|
|
748
|
-
//#endregion
|
|
749
|
-
//#region extensions/msteams/src/monitor-handler/inbound-media.ts
|
|
750
|
-
async function resolveMSTeamsInboundMedia(params) {
|
|
751
|
-
const { attachments, htmlSummary, maxBytes, tokenProvider, allowHosts, conversationType, conversationId, conversationMessageId, activity, log, preserveFilenames } = params;
|
|
752
|
-
let mediaList = await downloadMSTeamsAttachments({
|
|
753
|
-
attachments,
|
|
754
|
-
maxBytes,
|
|
755
|
-
tokenProvider,
|
|
756
|
-
allowHosts,
|
|
757
|
-
authAllowHosts: params.authAllowHosts,
|
|
758
|
-
preserveFilenames
|
|
759
|
-
});
|
|
760
|
-
if (mediaList.length === 0) {
|
|
761
|
-
if (attachments.length > 0 && attachments.every((att) => String(att.contentType ?? "").startsWith("text/html"))) {
|
|
762
|
-
const messageUrls = buildMSTeamsGraphMessageUrls({
|
|
763
|
-
conversationType,
|
|
764
|
-
conversationId,
|
|
765
|
-
messageId: activity.id ?? void 0,
|
|
766
|
-
replyToId: activity.replyToId ?? void 0,
|
|
767
|
-
conversationMessageId,
|
|
768
|
-
channelData: activity.channelData
|
|
769
|
-
});
|
|
770
|
-
if (messageUrls.length === 0) log.debug?.("graph message url unavailable", {
|
|
771
|
-
conversationType,
|
|
772
|
-
hasChannelData: Boolean(activity.channelData),
|
|
773
|
-
messageId: activity.id ?? void 0,
|
|
774
|
-
replyToId: activity.replyToId ?? void 0
|
|
775
|
-
});
|
|
776
|
-
else {
|
|
777
|
-
const attempts = [];
|
|
778
|
-
for (const messageUrl of messageUrls) {
|
|
779
|
-
const graphMedia = await downloadMSTeamsGraphMedia({
|
|
780
|
-
messageUrl,
|
|
781
|
-
tokenProvider,
|
|
782
|
-
maxBytes,
|
|
783
|
-
allowHosts,
|
|
784
|
-
authAllowHosts: params.authAllowHosts,
|
|
785
|
-
preserveFilenames
|
|
786
|
-
});
|
|
787
|
-
attempts.push({
|
|
788
|
-
url: messageUrl,
|
|
789
|
-
hostedStatus: graphMedia.hostedStatus,
|
|
790
|
-
attachmentStatus: graphMedia.attachmentStatus,
|
|
791
|
-
hostedCount: graphMedia.hostedCount,
|
|
792
|
-
attachmentCount: graphMedia.attachmentCount,
|
|
793
|
-
tokenError: graphMedia.tokenError
|
|
794
|
-
});
|
|
795
|
-
if (graphMedia.media.length > 0) {
|
|
796
|
-
mediaList = graphMedia.media;
|
|
797
|
-
break;
|
|
798
|
-
}
|
|
799
|
-
if (graphMedia.tokenError) break;
|
|
800
|
-
}
|
|
801
|
-
if (mediaList.length === 0) log.debug?.("graph media fetch empty", { attempts });
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
if (mediaList.length > 0) log.debug?.("downloaded attachments", { count: mediaList.length });
|
|
806
|
-
else if (htmlSummary?.imgTags) log.debug?.("inline images detected but none downloaded", {
|
|
807
|
-
imgTags: htmlSummary.imgTags,
|
|
808
|
-
srcHosts: htmlSummary.srcHosts,
|
|
809
|
-
dataImages: htmlSummary.dataImages,
|
|
810
|
-
cidImages: htmlSummary.cidImages
|
|
811
|
-
});
|
|
812
|
-
return mediaList;
|
|
813
|
-
}
|
|
814
|
-
//#endregion
|
|
815
|
-
//#region extensions/msteams/src/monitor-handler/message-handler.ts
|
|
816
|
-
function createMSTeamsMessageHandler(deps) {
|
|
817
|
-
const { cfg, runtime, appId, adapter, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
|
|
818
|
-
const core = getMSTeamsRuntime();
|
|
819
|
-
const pairing = createScopedPairingAccess({
|
|
820
|
-
core,
|
|
821
|
-
channel: "msteams",
|
|
822
|
-
accountId: DEFAULT_ACCOUNT_ID
|
|
823
|
-
});
|
|
824
|
-
const logVerboseMessage = (message) => {
|
|
825
|
-
if (core.logging.shouldLogVerbose()) log.debug?.(message);
|
|
826
|
-
};
|
|
827
|
-
const msteamsCfg = cfg.channels?.msteams;
|
|
828
|
-
const historyLimit = Math.max(0, msteamsCfg?.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? 50);
|
|
829
|
-
const conversationHistories = /* @__PURE__ */ new Map();
|
|
830
|
-
const inboundDebounceMs = core.channel.debounce.resolveInboundDebounceMs({
|
|
831
|
-
cfg,
|
|
832
|
-
channel: "msteams"
|
|
833
|
-
});
|
|
834
|
-
const handleTeamsMessageNow = async (params) => {
|
|
835
|
-
const context = params.context;
|
|
836
|
-
const activity = context.activity;
|
|
837
|
-
const rawText = params.rawText;
|
|
838
|
-
const text = params.text;
|
|
839
|
-
const attachments = params.attachments;
|
|
840
|
-
const attachmentPlaceholder = buildMSTeamsAttachmentPlaceholder(attachments);
|
|
841
|
-
const rawBody = text || attachmentPlaceholder;
|
|
842
|
-
const from = activity.from;
|
|
843
|
-
const conversation = activity.conversation;
|
|
844
|
-
const attachmentTypes = attachments.map((att) => typeof att.contentType === "string" ? att.contentType : void 0).filter(Boolean).slice(0, 3);
|
|
845
|
-
const htmlSummary = summarizeMSTeamsHtmlAttachments(attachments);
|
|
846
|
-
log.info("received message", {
|
|
847
|
-
rawText: rawText.slice(0, 50),
|
|
848
|
-
text: text.slice(0, 50),
|
|
849
|
-
attachments: attachments.length,
|
|
850
|
-
attachmentTypes,
|
|
851
|
-
from: from?.id,
|
|
852
|
-
conversation: conversation?.id
|
|
853
|
-
});
|
|
854
|
-
if (htmlSummary) log.debug?.("html attachment summary", htmlSummary);
|
|
855
|
-
if (!from?.id) {
|
|
856
|
-
log.debug?.("skipping message without from.id");
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
const rawConversationId = conversation?.id ?? "";
|
|
860
|
-
const conversationId = normalizeMSTeamsConversationId(rawConversationId);
|
|
861
|
-
const conversationMessageId = extractMSTeamsConversationMessageId(rawConversationId);
|
|
862
|
-
const conversationType = conversation?.conversationType ?? "personal";
|
|
863
|
-
const isGroupChat = conversationType === "groupChat" || conversation?.isGroup === true;
|
|
864
|
-
const isChannel = conversationType === "channel";
|
|
865
|
-
const isDirectMessage = !isGroupChat && !isChannel;
|
|
866
|
-
const senderName = from.name ?? from.id;
|
|
867
|
-
const senderId = from.aadObjectId ?? from.id;
|
|
868
|
-
const dmPolicy = msteamsCfg?.dmPolicy ?? "pairing";
|
|
869
|
-
const storedAllowFrom = await readStoreAllowFromForDmPolicy({
|
|
870
|
-
provider: "msteams",
|
|
871
|
-
accountId: pairing.accountId,
|
|
872
|
-
dmPolicy,
|
|
873
|
-
readStore: pairing.readStoreForDmPolicy
|
|
874
|
-
});
|
|
875
|
-
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
876
|
-
const configuredDmAllowFrom = (msteamsCfg?.allowFrom ?? []).map((v) => String(v));
|
|
877
|
-
const groupAllowFrom = msteamsCfg?.groupAllowFrom;
|
|
878
|
-
const resolvedAllowFromLists = resolveEffectiveAllowFromLists({
|
|
879
|
-
allowFrom: configuredDmAllowFrom,
|
|
880
|
-
groupAllowFrom,
|
|
881
|
-
storeAllowFrom: storedAllowFrom,
|
|
882
|
-
dmPolicy
|
|
883
|
-
});
|
|
884
|
-
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
885
|
-
const groupPolicy = !isDirectMessage && msteamsCfg ? msteamsCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist" : "disabled";
|
|
886
|
-
const effectiveGroupAllowFrom = resolvedAllowFromLists.effectiveGroupAllowFrom;
|
|
887
|
-
const teamId = activity.channelData?.team?.id;
|
|
888
|
-
const teamName = activity.channelData?.team?.name;
|
|
889
|
-
const channelName = activity.channelData?.channel?.name;
|
|
890
|
-
const channelGate = resolveMSTeamsRouteConfig({
|
|
891
|
-
cfg: msteamsCfg,
|
|
892
|
-
teamId,
|
|
893
|
-
teamName,
|
|
894
|
-
conversationId,
|
|
895
|
-
channelName,
|
|
896
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
897
|
-
});
|
|
898
|
-
const senderGroupPolicy = resolveSenderScopedGroupPolicy({
|
|
899
|
-
groupPolicy,
|
|
900
|
-
groupAllowFrom: effectiveGroupAllowFrom
|
|
901
|
-
});
|
|
902
|
-
const access = resolveDmGroupAccessWithLists({
|
|
903
|
-
isGroup: !isDirectMessage,
|
|
904
|
-
dmPolicy,
|
|
905
|
-
groupPolicy: senderGroupPolicy,
|
|
906
|
-
allowFrom: configuredDmAllowFrom,
|
|
907
|
-
groupAllowFrom,
|
|
908
|
-
storeAllowFrom: storedAllowFrom,
|
|
909
|
-
groupAllowFromFallbackToAllowFrom: false,
|
|
910
|
-
isSenderAllowed: (allowFrom) => resolveMSTeamsAllowlistMatch({
|
|
911
|
-
allowFrom,
|
|
912
|
-
senderId,
|
|
913
|
-
senderName,
|
|
914
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
915
|
-
}).allowed
|
|
916
|
-
});
|
|
917
|
-
const effectiveDmAllowFrom = access.effectiveAllowFrom;
|
|
918
|
-
if (isDirectMessage && msteamsCfg && access.decision !== "allow") {
|
|
919
|
-
if (access.reason === "dmPolicy=disabled") {
|
|
920
|
-
log.debug?.("dropping dm (dms disabled)");
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
const allowMatch = resolveMSTeamsAllowlistMatch({
|
|
924
|
-
allowFrom: effectiveDmAllowFrom,
|
|
925
|
-
senderId,
|
|
926
|
-
senderName,
|
|
927
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
928
|
-
});
|
|
929
|
-
if (access.decision === "pairing") {
|
|
930
|
-
if (await pairing.upsertPairingRequest({
|
|
931
|
-
id: senderId,
|
|
932
|
-
meta: { name: senderName }
|
|
933
|
-
})) log.info("msteams pairing request created", {
|
|
934
|
-
sender: senderId,
|
|
935
|
-
label: senderName
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
log.debug?.("dropping dm (not allowlisted)", {
|
|
939
|
-
sender: senderId,
|
|
940
|
-
label: senderName,
|
|
941
|
-
allowlistMatch: formatAllowlistMatchMeta(allowMatch)
|
|
942
|
-
});
|
|
943
|
-
return;
|
|
944
|
-
}
|
|
945
|
-
if (!isDirectMessage && msteamsCfg) {
|
|
946
|
-
if (channelGate.allowlistConfigured && !channelGate.allowed) {
|
|
947
|
-
log.debug?.("dropping group message (not in team/channel allowlist)", {
|
|
948
|
-
conversationId,
|
|
949
|
-
teamKey: channelGate.teamKey ?? "none",
|
|
950
|
-
channelKey: channelGate.channelKey ?? "none",
|
|
951
|
-
channelMatchKey: channelGate.channelMatchKey ?? "none",
|
|
952
|
-
channelMatchSource: channelGate.channelMatchSource ?? "none"
|
|
953
|
-
});
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
const senderGroupAccess = evaluateSenderGroupAccessForPolicy({
|
|
957
|
-
groupPolicy,
|
|
958
|
-
groupAllowFrom: effectiveGroupAllowFrom,
|
|
959
|
-
senderId,
|
|
960
|
-
isSenderAllowed: (_senderId, allowFrom) => resolveMSTeamsAllowlistMatch({
|
|
961
|
-
allowFrom,
|
|
962
|
-
senderId,
|
|
963
|
-
senderName,
|
|
964
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
965
|
-
}).allowed
|
|
966
|
-
});
|
|
967
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "disabled") {
|
|
968
|
-
log.debug?.("dropping group message (groupPolicy: disabled)", { conversationId });
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "empty_allowlist") {
|
|
972
|
-
log.debug?.("dropping group message (groupPolicy: allowlist, no allowlist)", { conversationId });
|
|
973
|
-
return;
|
|
974
|
-
}
|
|
975
|
-
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "sender_not_allowlisted") {
|
|
976
|
-
const allowMatch = resolveMSTeamsAllowlistMatch({
|
|
977
|
-
allowFrom: effectiveGroupAllowFrom,
|
|
978
|
-
senderId,
|
|
979
|
-
senderName,
|
|
980
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
981
|
-
});
|
|
982
|
-
log.debug?.("dropping group message (not in groupAllowFrom)", {
|
|
983
|
-
sender: senderId,
|
|
984
|
-
label: senderName,
|
|
985
|
-
allowlistMatch: formatAllowlistMatchMeta(allowMatch)
|
|
986
|
-
});
|
|
987
|
-
return;
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
const commandDmAllowFrom = isDirectMessage ? effectiveDmAllowFrom : configuredDmAllowFrom;
|
|
991
|
-
const ownerAllowedForCommands = isMSTeamsGroupAllowed({
|
|
992
|
-
groupPolicy: "allowlist",
|
|
993
|
-
allowFrom: commandDmAllowFrom,
|
|
994
|
-
senderId,
|
|
995
|
-
senderName,
|
|
996
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
997
|
-
});
|
|
998
|
-
const groupAllowedForCommands = isMSTeamsGroupAllowed({
|
|
999
|
-
groupPolicy: "allowlist",
|
|
1000
|
-
allowFrom: effectiveGroupAllowFrom,
|
|
1001
|
-
senderId,
|
|
1002
|
-
senderName,
|
|
1003
|
-
allowNameMatching: isDangerousNameMatchingEnabled(msteamsCfg)
|
|
1004
|
-
});
|
|
1005
|
-
const { commandAuthorized, shouldBlock } = resolveDualTextControlCommandGate({
|
|
1006
|
-
useAccessGroups,
|
|
1007
|
-
primaryConfigured: commandDmAllowFrom.length > 0,
|
|
1008
|
-
primaryAllowed: ownerAllowedForCommands,
|
|
1009
|
-
secondaryConfigured: effectiveGroupAllowFrom.length > 0,
|
|
1010
|
-
secondaryAllowed: groupAllowedForCommands,
|
|
1011
|
-
hasControlCommand: core.channel.text.hasControlCommand(text, cfg)
|
|
1012
|
-
});
|
|
1013
|
-
if (shouldBlock) {
|
|
1014
|
-
logInboundDrop({
|
|
1015
|
-
log: logVerboseMessage,
|
|
1016
|
-
channel: "msteams",
|
|
1017
|
-
reason: "control command (unauthorized)",
|
|
1018
|
-
target: senderId
|
|
1019
|
-
});
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
const agent = activity.recipient;
|
|
1023
|
-
const conversationRef = {
|
|
1024
|
-
activityId: activity.id,
|
|
1025
|
-
user: {
|
|
1026
|
-
id: from.id,
|
|
1027
|
-
name: from.name,
|
|
1028
|
-
aadObjectId: from.aadObjectId
|
|
1029
|
-
},
|
|
1030
|
-
agent,
|
|
1031
|
-
bot: agent ? {
|
|
1032
|
-
id: agent.id,
|
|
1033
|
-
name: agent.name
|
|
1034
|
-
} : void 0,
|
|
1035
|
-
conversation: {
|
|
1036
|
-
id: conversationId,
|
|
1037
|
-
conversationType,
|
|
1038
|
-
tenantId: conversation?.tenantId
|
|
1039
|
-
},
|
|
1040
|
-
teamId,
|
|
1041
|
-
channelId: activity.channelId,
|
|
1042
|
-
serviceUrl: activity.serviceUrl,
|
|
1043
|
-
locale: activity.locale
|
|
1044
|
-
};
|
|
1045
|
-
conversationStore.upsert(conversationId, conversationRef).catch((err) => {
|
|
1046
|
-
log.debug?.("failed to save conversation reference", { error: formatUnknownError(err) });
|
|
1047
|
-
});
|
|
1048
|
-
const pollVote = extractMSTeamsPollVote(activity);
|
|
1049
|
-
if (pollVote) {
|
|
1050
|
-
try {
|
|
1051
|
-
if (!await pollStore.recordVote({
|
|
1052
|
-
pollId: pollVote.pollId,
|
|
1053
|
-
voterId: senderId,
|
|
1054
|
-
selections: pollVote.selections
|
|
1055
|
-
})) log.debug?.("poll vote ignored (poll not found)", { pollId: pollVote.pollId });
|
|
1056
|
-
else log.info("recorded poll vote", {
|
|
1057
|
-
pollId: pollVote.pollId,
|
|
1058
|
-
voter: senderId,
|
|
1059
|
-
selections: pollVote.selections
|
|
1060
|
-
});
|
|
1061
|
-
} catch (err) {
|
|
1062
|
-
log.error("failed to record poll vote", {
|
|
1063
|
-
pollId: pollVote.pollId,
|
|
1064
|
-
error: formatUnknownError(err)
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
if (!rawBody) {
|
|
1070
|
-
log.debug?.("skipping empty message after stripping mentions");
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
const teamsFrom = isDirectMessage ? `msteams:${senderId}` : isChannel ? `msteams:channel:${conversationId}` : `msteams:group:${conversationId}`;
|
|
1074
|
-
const teamsTo = isDirectMessage ? `user:${senderId}` : `conversation:${conversationId}`;
|
|
1075
|
-
const route = core.channel.routing.resolveAgentRoute({
|
|
1076
|
-
cfg,
|
|
1077
|
-
channel: "msteams",
|
|
1078
|
-
peer: {
|
|
1079
|
-
kind: isDirectMessage ? "direct" : isChannel ? "channel" : "group",
|
|
1080
|
-
id: isDirectMessage ? senderId : conversationId
|
|
1081
|
-
}
|
|
1082
|
-
});
|
|
1083
|
-
const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
|
|
1084
|
-
const inboundLabel = isDirectMessage ? `Teams DM from ${senderName}` : `Teams message in ${conversationType} from ${senderName}`;
|
|
1085
|
-
core.system.enqueueSystemEvent(`${inboundLabel}: ${preview}`, {
|
|
1086
|
-
sessionKey: route.sessionKey,
|
|
1087
|
-
contextKey: `msteams:message:${conversationId}:${activity.id ?? "unknown"}`
|
|
1088
|
-
});
|
|
1089
|
-
const channelId = conversationId;
|
|
1090
|
-
const { teamConfig, channelConfig } = channelGate;
|
|
1091
|
-
const { requireMention, replyStyle } = resolveMSTeamsReplyPolicy({
|
|
1092
|
-
isDirectMessage,
|
|
1093
|
-
globalConfig: msteamsCfg,
|
|
1094
|
-
teamConfig,
|
|
1095
|
-
channelConfig
|
|
1096
|
-
});
|
|
1097
|
-
const timestamp = parseMSTeamsActivityTimestamp(activity.timestamp);
|
|
1098
|
-
if (!isDirectMessage) {
|
|
1099
|
-
const mentionGate = resolveMentionGating({
|
|
1100
|
-
requireMention: Boolean(requireMention),
|
|
1101
|
-
canDetectMention: true,
|
|
1102
|
-
wasMentioned: params.wasMentioned,
|
|
1103
|
-
implicitMention: params.implicitMention,
|
|
1104
|
-
shouldBypassMention: false
|
|
1105
|
-
});
|
|
1106
|
-
const mentioned = mentionGate.effectiveWasMentioned;
|
|
1107
|
-
if (requireMention && mentionGate.shouldSkip) {
|
|
1108
|
-
log.debug?.("skipping message (mention required)", {
|
|
1109
|
-
teamId,
|
|
1110
|
-
channelId,
|
|
1111
|
-
requireMention,
|
|
1112
|
-
mentioned
|
|
1113
|
-
});
|
|
1114
|
-
recordPendingHistoryEntryIfEnabled({
|
|
1115
|
-
historyMap: conversationHistories,
|
|
1116
|
-
historyKey: conversationId,
|
|
1117
|
-
limit: historyLimit,
|
|
1118
|
-
entry: {
|
|
1119
|
-
sender: senderName,
|
|
1120
|
-
body: rawBody,
|
|
1121
|
-
timestamp: timestamp?.getTime(),
|
|
1122
|
-
messageId: activity.id ?? void 0
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
const mediaPayload = buildMSTeamsMediaPayload(await resolveMSTeamsInboundMedia({
|
|
1129
|
-
attachments,
|
|
1130
|
-
htmlSummary: htmlSummary ?? void 0,
|
|
1131
|
-
maxBytes: mediaMaxBytes,
|
|
1132
|
-
tokenProvider,
|
|
1133
|
-
allowHosts: msteamsCfg?.mediaAllowHosts,
|
|
1134
|
-
authAllowHosts: msteamsCfg?.mediaAuthAllowHosts,
|
|
1135
|
-
conversationType,
|
|
1136
|
-
conversationId,
|
|
1137
|
-
conversationMessageId: conversationMessageId ?? void 0,
|
|
1138
|
-
activity: {
|
|
1139
|
-
id: activity.id,
|
|
1140
|
-
replyToId: activity.replyToId,
|
|
1141
|
-
channelData: activity.channelData
|
|
1142
|
-
},
|
|
1143
|
-
log,
|
|
1144
|
-
preserveFilenames: cfg.media?.preserveFilenames
|
|
1145
|
-
}));
|
|
1146
|
-
const envelopeFrom = isDirectMessage ? senderName : conversationType;
|
|
1147
|
-
const { storePath, envelopeOptions, previousTimestamp } = resolveInboundSessionEnvelopeContext({
|
|
1148
|
-
cfg,
|
|
1149
|
-
agentId: route.agentId,
|
|
1150
|
-
sessionKey: route.sessionKey
|
|
1151
|
-
});
|
|
1152
|
-
let combinedBody = core.channel.reply.formatAgentEnvelope({
|
|
1153
|
-
channel: "Teams",
|
|
1154
|
-
from: envelopeFrom,
|
|
1155
|
-
timestamp,
|
|
1156
|
-
previousTimestamp,
|
|
1157
|
-
envelope: envelopeOptions,
|
|
1158
|
-
body: rawBody
|
|
1159
|
-
});
|
|
1160
|
-
const isRoomish = !isDirectMessage;
|
|
1161
|
-
const historyKey = isRoomish ? conversationId : void 0;
|
|
1162
|
-
if (isRoomish && historyKey) combinedBody = buildPendingHistoryContextFromMap({
|
|
1163
|
-
historyMap: conversationHistories,
|
|
1164
|
-
historyKey,
|
|
1165
|
-
limit: historyLimit,
|
|
1166
|
-
currentMessage: combinedBody,
|
|
1167
|
-
formatEntry: (entry) => core.channel.reply.formatAgentEnvelope({
|
|
1168
|
-
channel: "Teams",
|
|
1169
|
-
from: conversationType,
|
|
1170
|
-
timestamp: entry.timestamp,
|
|
1171
|
-
body: `${entry.sender}: ${entry.body}${entry.messageId ? ` [id:${entry.messageId}]` : ""}`,
|
|
1172
|
-
envelope: envelopeOptions
|
|
1173
|
-
})
|
|
1174
|
-
});
|
|
1175
|
-
const inboundHistory = isRoomish && historyKey && historyLimit > 0 ? (conversationHistories.get(historyKey) ?? []).map((entry) => ({
|
|
1176
|
-
sender: entry.sender,
|
|
1177
|
-
body: entry.body,
|
|
1178
|
-
timestamp: entry.timestamp
|
|
1179
|
-
})) : void 0;
|
|
1180
|
-
const commandBody = text.trim();
|
|
1181
|
-
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
1182
|
-
Body: combinedBody,
|
|
1183
|
-
BodyForAgent: rawBody,
|
|
1184
|
-
InboundHistory: inboundHistory,
|
|
1185
|
-
RawBody: rawBody,
|
|
1186
|
-
CommandBody: commandBody,
|
|
1187
|
-
BodyForCommands: commandBody,
|
|
1188
|
-
From: teamsFrom,
|
|
1189
|
-
To: teamsTo,
|
|
1190
|
-
SessionKey: route.sessionKey,
|
|
1191
|
-
AccountId: route.accountId,
|
|
1192
|
-
ChatType: isDirectMessage ? "direct" : isChannel ? "channel" : "group",
|
|
1193
|
-
ConversationLabel: envelopeFrom,
|
|
1194
|
-
GroupSubject: !isDirectMessage ? conversationType : void 0,
|
|
1195
|
-
SenderName: senderName,
|
|
1196
|
-
SenderId: senderId,
|
|
1197
|
-
Provider: "msteams",
|
|
1198
|
-
Surface: "msteams",
|
|
1199
|
-
MessageSid: activity.id,
|
|
1200
|
-
Timestamp: timestamp?.getTime() ?? Date.now(),
|
|
1201
|
-
WasMentioned: isDirectMessage || params.wasMentioned || params.implicitMention,
|
|
1202
|
-
CommandAuthorized: commandAuthorized,
|
|
1203
|
-
OriginatingChannel: "msteams",
|
|
1204
|
-
OriginatingTo: teamsTo,
|
|
1205
|
-
...mediaPayload
|
|
1206
|
-
});
|
|
1207
|
-
await core.channel.session.recordInboundSession({
|
|
1208
|
-
storePath,
|
|
1209
|
-
sessionKey: ctxPayload.SessionKey ?? route.sessionKey,
|
|
1210
|
-
ctx: ctxPayload,
|
|
1211
|
-
onRecordError: (err) => {
|
|
1212
|
-
logVerboseMessage(`msteams: failed updating session meta: ${String(err)}`);
|
|
1213
|
-
}
|
|
1214
|
-
});
|
|
1215
|
-
logVerboseMessage(`msteams inbound: from=${ctxPayload.From} preview="${preview}"`);
|
|
1216
|
-
const sharePointSiteId = msteamsCfg?.sharePointSiteId;
|
|
1217
|
-
const { dispatcher, replyOptions, markDispatchIdle } = createMSTeamsReplyDispatcher({
|
|
1218
|
-
cfg,
|
|
1219
|
-
agentId: route.agentId,
|
|
1220
|
-
accountId: route.accountId,
|
|
1221
|
-
runtime,
|
|
1222
|
-
log,
|
|
1223
|
-
adapter,
|
|
1224
|
-
appId,
|
|
1225
|
-
conversationRef,
|
|
1226
|
-
context,
|
|
1227
|
-
replyStyle,
|
|
1228
|
-
textLimit,
|
|
1229
|
-
onSentMessageIds: (ids) => {
|
|
1230
|
-
for (const id of ids) recordMSTeamsSentMessage(conversationId, id);
|
|
1231
|
-
},
|
|
1232
|
-
tokenProvider,
|
|
1233
|
-
sharePointSiteId
|
|
1234
|
-
});
|
|
1235
|
-
log.info("dispatching to agent", { sessionKey: route.sessionKey });
|
|
1236
|
-
try {
|
|
1237
|
-
const { queuedFinal, counts } = await dispatchReplyFromConfigWithSettledDispatcher({
|
|
1238
|
-
cfg,
|
|
1239
|
-
ctxPayload,
|
|
1240
|
-
dispatcher,
|
|
1241
|
-
onSettled: () => {
|
|
1242
|
-
markDispatchIdle();
|
|
1243
|
-
},
|
|
1244
|
-
replyOptions
|
|
1245
|
-
});
|
|
1246
|
-
log.info("dispatch complete", {
|
|
1247
|
-
queuedFinal,
|
|
1248
|
-
counts
|
|
1249
|
-
});
|
|
1250
|
-
if (!queuedFinal) {
|
|
1251
|
-
if (isRoomish && historyKey) clearHistoryEntriesIfEnabled({
|
|
1252
|
-
historyMap: conversationHistories,
|
|
1253
|
-
historyKey,
|
|
1254
|
-
limit: historyLimit
|
|
1255
|
-
});
|
|
1256
|
-
return;
|
|
1257
|
-
}
|
|
1258
|
-
const finalCount = counts.final;
|
|
1259
|
-
logVerboseMessage(`msteams: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${teamsTo}`);
|
|
1260
|
-
if (isRoomish && historyKey) clearHistoryEntriesIfEnabled({
|
|
1261
|
-
historyMap: conversationHistories,
|
|
1262
|
-
historyKey,
|
|
1263
|
-
limit: historyLimit
|
|
1264
|
-
});
|
|
1265
|
-
} catch (err) {
|
|
1266
|
-
log.error("dispatch failed", { error: String(err) });
|
|
1267
|
-
runtime.error?.(`msteams dispatch failed: ${String(err)}`);
|
|
1268
|
-
try {
|
|
1269
|
-
await context.sendActivity(`⚠️ Agent failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1270
|
-
} catch {}
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
const inboundDebouncer = core.channel.debounce.createInboundDebouncer({
|
|
1274
|
-
debounceMs: inboundDebounceMs,
|
|
1275
|
-
buildKey: (entry) => {
|
|
1276
|
-
const conversationId = normalizeMSTeamsConversationId(entry.context.activity.conversation?.id ?? "");
|
|
1277
|
-
const senderId = entry.context.activity.from?.aadObjectId ?? entry.context.activity.from?.id ?? "";
|
|
1278
|
-
if (!senderId || !conversationId) return null;
|
|
1279
|
-
return `msteams:${appId}:${conversationId}:${senderId}`;
|
|
1280
|
-
},
|
|
1281
|
-
shouldDebounce: (entry) => {
|
|
1282
|
-
if (!entry.text.trim()) return false;
|
|
1283
|
-
if (entry.attachments.length > 0) return false;
|
|
1284
|
-
return !core.channel.text.hasControlCommand(entry.text, cfg);
|
|
1285
|
-
},
|
|
1286
|
-
onFlush: async (entries) => {
|
|
1287
|
-
const last = entries.at(-1);
|
|
1288
|
-
if (!last) return;
|
|
1289
|
-
if (entries.length === 1) {
|
|
1290
|
-
await handleTeamsMessageNow(last);
|
|
1291
|
-
return;
|
|
1292
|
-
}
|
|
1293
|
-
const combinedText = entries.map((entry) => entry.text).filter(Boolean).join("\n");
|
|
1294
|
-
if (!combinedText.trim()) return;
|
|
1295
|
-
const combinedRawText = entries.map((entry) => entry.rawText).filter(Boolean).join("\n");
|
|
1296
|
-
const wasMentioned = entries.some((entry) => entry.wasMentioned);
|
|
1297
|
-
const implicitMention = entries.some((entry) => entry.implicitMention);
|
|
1298
|
-
await handleTeamsMessageNow({
|
|
1299
|
-
context: last.context,
|
|
1300
|
-
rawText: combinedRawText,
|
|
1301
|
-
text: combinedText,
|
|
1302
|
-
attachments: [],
|
|
1303
|
-
wasMentioned,
|
|
1304
|
-
implicitMention
|
|
1305
|
-
});
|
|
1306
|
-
},
|
|
1307
|
-
onError: (err) => {
|
|
1308
|
-
runtime.error?.(`msteams debounce flush failed: ${String(err)}`);
|
|
1309
|
-
}
|
|
1310
|
-
});
|
|
1311
|
-
return async function handleTeamsMessage(context) {
|
|
1312
|
-
const activity = context.activity;
|
|
1313
|
-
const rawText = activity.text?.trim() ?? "";
|
|
1314
|
-
const text = stripMSTeamsMentionTags(rawText);
|
|
1315
|
-
const attachments = Array.isArray(activity.attachments) ? activity.attachments : [];
|
|
1316
|
-
const wasMentioned = wasMSTeamsBotMentioned(activity);
|
|
1317
|
-
const conversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
|
|
1318
|
-
const replyToId = activity.replyToId ?? void 0;
|
|
1319
|
-
const implicitMention = Boolean(conversationId && replyToId && wasMSTeamsMessageSent(conversationId, replyToId));
|
|
1320
|
-
await inboundDebouncer.enqueue({
|
|
1321
|
-
context,
|
|
1322
|
-
rawText,
|
|
1323
|
-
text,
|
|
1324
|
-
attachments,
|
|
1325
|
-
wasMentioned,
|
|
1326
|
-
implicitMention
|
|
1327
|
-
});
|
|
1328
|
-
};
|
|
1329
|
-
}
|
|
1330
|
-
//#endregion
|
|
1331
|
-
//#region extensions/msteams/src/monitor-handler.ts
|
|
1332
|
-
/**
|
|
1333
|
-
* Handle fileConsent/invoke activities for large file uploads.
|
|
1334
|
-
*/
|
|
1335
|
-
async function handleFileConsentInvoke(context, log) {
|
|
1336
|
-
const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
|
|
1337
|
-
const activity = context.activity;
|
|
1338
|
-
if (activity.type !== "invoke" || activity.name !== "fileConsent/invoke") return false;
|
|
1339
|
-
const consentResponse = parseFileConsentInvoke(activity);
|
|
1340
|
-
if (!consentResponse) {
|
|
1341
|
-
log.debug?.("invalid file consent invoke", { value: activity.value });
|
|
1342
|
-
return false;
|
|
1343
|
-
}
|
|
1344
|
-
const uploadId = typeof consentResponse.context?.uploadId === "string" ? consentResponse.context.uploadId : void 0;
|
|
1345
|
-
const pendingFile = getPendingUpload(uploadId);
|
|
1346
|
-
if (pendingFile) {
|
|
1347
|
-
const pendingConversationId = normalizeMSTeamsConversationId(pendingFile.conversationId);
|
|
1348
|
-
const invokeConversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
|
|
1349
|
-
if (!invokeConversationId || pendingConversationId !== invokeConversationId) {
|
|
1350
|
-
log.info("file consent conversation mismatch", {
|
|
1351
|
-
uploadId,
|
|
1352
|
-
expectedConversationId: pendingConversationId,
|
|
1353
|
-
receivedConversationId: invokeConversationId || void 0
|
|
1354
|
-
});
|
|
1355
|
-
if (consentResponse.action === "accept") await context.sendActivity(expiredUploadMessage);
|
|
1356
|
-
return true;
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
if (consentResponse.action === "accept" && consentResponse.uploadInfo) if (pendingFile) {
|
|
1360
|
-
log.debug?.("user accepted file consent, uploading", {
|
|
1361
|
-
uploadId,
|
|
1362
|
-
filename: pendingFile.filename,
|
|
1363
|
-
size: pendingFile.buffer.length
|
|
1364
|
-
});
|
|
1365
|
-
try {
|
|
1366
|
-
await uploadToConsentUrl({
|
|
1367
|
-
url: consentResponse.uploadInfo.uploadUrl,
|
|
1368
|
-
buffer: pendingFile.buffer,
|
|
1369
|
-
contentType: pendingFile.contentType
|
|
1370
|
-
});
|
|
1371
|
-
const fileInfoCard = buildFileInfoCard({
|
|
1372
|
-
filename: consentResponse.uploadInfo.name,
|
|
1373
|
-
contentUrl: consentResponse.uploadInfo.contentUrl,
|
|
1374
|
-
uniqueId: consentResponse.uploadInfo.uniqueId,
|
|
1375
|
-
fileType: consentResponse.uploadInfo.fileType
|
|
1376
|
-
});
|
|
1377
|
-
await context.sendActivity({
|
|
1378
|
-
type: "message",
|
|
1379
|
-
attachments: [fileInfoCard]
|
|
1380
|
-
});
|
|
1381
|
-
log.info("file upload complete", {
|
|
1382
|
-
uploadId,
|
|
1383
|
-
filename: consentResponse.uploadInfo.name,
|
|
1384
|
-
uniqueId: consentResponse.uploadInfo.uniqueId
|
|
1385
|
-
});
|
|
1386
|
-
} catch (err) {
|
|
1387
|
-
log.debug?.("file upload failed", {
|
|
1388
|
-
uploadId,
|
|
1389
|
-
error: String(err)
|
|
1390
|
-
});
|
|
1391
|
-
await context.sendActivity(`File upload failed: ${String(err)}`);
|
|
1392
|
-
} finally {
|
|
1393
|
-
removePendingUpload(uploadId);
|
|
1394
|
-
}
|
|
1395
|
-
} else {
|
|
1396
|
-
log.debug?.("pending file not found for consent", { uploadId });
|
|
1397
|
-
await context.sendActivity(expiredUploadMessage);
|
|
1398
|
-
}
|
|
1399
|
-
else {
|
|
1400
|
-
log.debug?.("user declined file consent", { uploadId });
|
|
1401
|
-
removePendingUpload(uploadId);
|
|
1402
|
-
}
|
|
1403
|
-
return true;
|
|
1404
|
-
}
|
|
1405
|
-
function registerMSTeamsHandlers(handler, deps) {
|
|
1406
|
-
const handleTeamsMessage = createMSTeamsMessageHandler(deps);
|
|
1407
|
-
const originalRun = handler.run;
|
|
1408
|
-
if (originalRun) handler.run = async (context) => {
|
|
1409
|
-
const ctx = context;
|
|
1410
|
-
if (ctx.activity?.type === "invoke" && ctx.activity?.name === "fileConsent/invoke") {
|
|
1411
|
-
await ctx.sendActivity({
|
|
1412
|
-
type: "invokeResponse",
|
|
1413
|
-
value: { status: 200 }
|
|
1414
|
-
});
|
|
1415
|
-
try {
|
|
1416
|
-
await withRevokedProxyFallback({
|
|
1417
|
-
run: async () => await handleFileConsentInvoke(ctx, deps.log),
|
|
1418
|
-
onRevoked: async () => true,
|
|
1419
|
-
onRevokedLog: () => {
|
|
1420
|
-
deps.log.debug?.("turn context revoked during file consent invoke; skipping delayed response");
|
|
1421
|
-
}
|
|
1422
|
-
});
|
|
1423
|
-
} catch (err) {
|
|
1424
|
-
deps.log.debug?.("file consent handler error", { error: String(err) });
|
|
1425
|
-
}
|
|
1426
|
-
return;
|
|
1427
|
-
}
|
|
1428
|
-
return originalRun.call(handler, context);
|
|
1429
|
-
};
|
|
1430
|
-
handler.onMessage(async (context, next) => {
|
|
1431
|
-
try {
|
|
1432
|
-
await handleTeamsMessage(context);
|
|
1433
|
-
} catch (err) {
|
|
1434
|
-
deps.runtime.error?.(`msteams handler failed: ${String(err)}`);
|
|
1435
|
-
}
|
|
1436
|
-
await next();
|
|
1437
|
-
});
|
|
1438
|
-
handler.onMembersAdded(async (context, next) => {
|
|
1439
|
-
const membersAdded = context.activity?.membersAdded ?? [];
|
|
1440
|
-
for (const member of membersAdded) if (member.id !== context.activity?.recipient?.id) deps.log.debug?.("member added", { member: member.id });
|
|
1441
|
-
await next();
|
|
1442
|
-
});
|
|
1443
|
-
return handler;
|
|
1444
|
-
}
|
|
1445
|
-
//#endregion
|
|
1446
|
-
//#region extensions/msteams/src/monitor.ts
|
|
1447
|
-
const MSTEAMS_WEBHOOK_MAX_BODY_BYTES = DEFAULT_WEBHOOK_MAX_BODY_BYTES;
|
|
1448
|
-
const MSTEAMS_WEBHOOK_INACTIVITY_TIMEOUT_MS = 3e4;
|
|
1449
|
-
const MSTEAMS_WEBHOOK_REQUEST_TIMEOUT_MS = 3e4;
|
|
1450
|
-
const MSTEAMS_WEBHOOK_HEADERS_TIMEOUT_MS = 15e3;
|
|
1451
|
-
function applyMSTeamsWebhookTimeouts(httpServer, opts) {
|
|
1452
|
-
const inactivityTimeoutMs = opts?.inactivityTimeoutMs ?? MSTEAMS_WEBHOOK_INACTIVITY_TIMEOUT_MS;
|
|
1453
|
-
const requestTimeoutMs = opts?.requestTimeoutMs ?? MSTEAMS_WEBHOOK_REQUEST_TIMEOUT_MS;
|
|
1454
|
-
const headersTimeoutMs = Math.min(opts?.headersTimeoutMs ?? MSTEAMS_WEBHOOK_HEADERS_TIMEOUT_MS, requestTimeoutMs);
|
|
1455
|
-
httpServer.setTimeout(inactivityTimeoutMs);
|
|
1456
|
-
httpServer.requestTimeout = requestTimeoutMs;
|
|
1457
|
-
httpServer.headersTimeout = headersTimeoutMs;
|
|
1458
|
-
}
|
|
1459
|
-
async function monitorMSTeamsProvider(opts) {
|
|
1460
|
-
const core = getMSTeamsRuntime();
|
|
1461
|
-
const log = core.logging.getChildLogger({ name: "msteams" });
|
|
1462
|
-
let cfg = opts.cfg;
|
|
1463
|
-
let msteamsCfg = cfg.channels?.msteams;
|
|
1464
|
-
if (!msteamsCfg?.enabled) {
|
|
1465
|
-
log.debug?.("msteams provider disabled");
|
|
1466
|
-
return {
|
|
1467
|
-
app: null,
|
|
1468
|
-
shutdown: async () => {}
|
|
1469
|
-
};
|
|
1470
|
-
}
|
|
1471
|
-
const creds = resolveMSTeamsCredentials(msteamsCfg);
|
|
1472
|
-
if (!creds) {
|
|
1473
|
-
log.error("msteams credentials not configured");
|
|
1474
|
-
return {
|
|
1475
|
-
app: null,
|
|
1476
|
-
shutdown: async () => {}
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
const appId = creds.appId;
|
|
1480
|
-
const runtime = opts.runtime ?? {
|
|
1481
|
-
log: console.log,
|
|
1482
|
-
error: console.error,
|
|
1483
|
-
exit: (code) => {
|
|
1484
|
-
throw new Error(`exit ${code}`);
|
|
1485
|
-
}
|
|
1486
|
-
};
|
|
1487
|
-
let allowFrom = msteamsCfg.allowFrom;
|
|
1488
|
-
let groupAllowFrom = msteamsCfg.groupAllowFrom;
|
|
1489
|
-
let teamsConfig = msteamsCfg.teams;
|
|
1490
|
-
const cleanAllowEntry = (entry) => entry.replace(/^(msteams|teams):/i, "").replace(/^user:/i, "").trim();
|
|
1491
|
-
const resolveAllowlistUsers = async (label, entries) => {
|
|
1492
|
-
if (entries.length === 0) return {
|
|
1493
|
-
additions: [],
|
|
1494
|
-
unresolved: []
|
|
1495
|
-
};
|
|
1496
|
-
const resolved = await resolveMSTeamsUserAllowlist({
|
|
1497
|
-
cfg,
|
|
1498
|
-
entries
|
|
1499
|
-
});
|
|
1500
|
-
const additions = [];
|
|
1501
|
-
const unresolved = [];
|
|
1502
|
-
for (const entry of resolved) if (entry.resolved && entry.id) additions.push(entry.id);
|
|
1503
|
-
else unresolved.push(entry.input);
|
|
1504
|
-
summarizeMapping(label, resolved.filter((entry) => entry.resolved && entry.id).map((entry) => `${entry.input}→${entry.id}`), unresolved, runtime);
|
|
1505
|
-
return {
|
|
1506
|
-
additions,
|
|
1507
|
-
unresolved
|
|
1508
|
-
};
|
|
1509
|
-
};
|
|
1510
|
-
try {
|
|
1511
|
-
const allowEntries = allowFrom?.map((entry) => cleanAllowEntry(String(entry))).filter((entry) => entry && entry !== "*") ?? [];
|
|
1512
|
-
if (allowEntries.length > 0) {
|
|
1513
|
-
const { additions } = await resolveAllowlistUsers("msteams users", allowEntries);
|
|
1514
|
-
allowFrom = mergeAllowlist({
|
|
1515
|
-
existing: allowFrom,
|
|
1516
|
-
additions
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
if (Array.isArray(groupAllowFrom) && groupAllowFrom.length > 0) {
|
|
1520
|
-
const groupEntries = groupAllowFrom.map((entry) => cleanAllowEntry(String(entry))).filter((entry) => entry && entry !== "*");
|
|
1521
|
-
if (groupEntries.length > 0) {
|
|
1522
|
-
const { additions } = await resolveAllowlistUsers("msteams group users", groupEntries);
|
|
1523
|
-
groupAllowFrom = mergeAllowlist({
|
|
1524
|
-
existing: groupAllowFrom,
|
|
1525
|
-
additions
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
if (teamsConfig && Object.keys(teamsConfig).length > 0) {
|
|
1530
|
-
const entries = [];
|
|
1531
|
-
for (const [teamKey, teamCfg] of Object.entries(teamsConfig)) {
|
|
1532
|
-
if (teamKey === "*") continue;
|
|
1533
|
-
const channels = teamCfg?.channels ?? {};
|
|
1534
|
-
const channelKeys = Object.keys(channels).filter((key) => key !== "*");
|
|
1535
|
-
if (channelKeys.length === 0) {
|
|
1536
|
-
entries.push({
|
|
1537
|
-
input: teamKey,
|
|
1538
|
-
teamKey
|
|
1539
|
-
});
|
|
1540
|
-
continue;
|
|
1541
|
-
}
|
|
1542
|
-
for (const channelKey of channelKeys) entries.push({
|
|
1543
|
-
input: `${teamKey}/${channelKey}`,
|
|
1544
|
-
teamKey,
|
|
1545
|
-
channelKey
|
|
1546
|
-
});
|
|
1547
|
-
}
|
|
1548
|
-
if (entries.length > 0) {
|
|
1549
|
-
const resolved = await resolveMSTeamsChannelAllowlist({
|
|
1550
|
-
cfg,
|
|
1551
|
-
entries: entries.map((entry) => entry.input)
|
|
1552
|
-
});
|
|
1553
|
-
const mapping = [];
|
|
1554
|
-
const unresolved = [];
|
|
1555
|
-
const nextTeams = { ...teamsConfig };
|
|
1556
|
-
resolved.forEach((entry, idx) => {
|
|
1557
|
-
const source = entries[idx];
|
|
1558
|
-
if (!source) return;
|
|
1559
|
-
const sourceTeam = teamsConfig?.[source.teamKey] ?? {};
|
|
1560
|
-
if (!entry.resolved || !entry.teamId) {
|
|
1561
|
-
unresolved.push(entry.input);
|
|
1562
|
-
return;
|
|
1563
|
-
}
|
|
1564
|
-
mapping.push(entry.channelId ? `${entry.input}→${entry.teamId}/${entry.channelId}` : `${entry.input}→${entry.teamId}`);
|
|
1565
|
-
const existing = nextTeams[entry.teamId] ?? {};
|
|
1566
|
-
const mergedChannels = {
|
|
1567
|
-
...sourceTeam.channels,
|
|
1568
|
-
...existing.channels
|
|
1569
|
-
};
|
|
1570
|
-
const mergedTeam = {
|
|
1571
|
-
...sourceTeam,
|
|
1572
|
-
...existing,
|
|
1573
|
-
channels: mergedChannels
|
|
1574
|
-
};
|
|
1575
|
-
nextTeams[entry.teamId] = mergedTeam;
|
|
1576
|
-
if (source.channelKey && entry.channelId) {
|
|
1577
|
-
const sourceChannel = sourceTeam.channels?.[source.channelKey];
|
|
1578
|
-
if (sourceChannel) nextTeams[entry.teamId] = {
|
|
1579
|
-
...mergedTeam,
|
|
1580
|
-
channels: {
|
|
1581
|
-
...mergedChannels,
|
|
1582
|
-
[entry.channelId]: {
|
|
1583
|
-
...sourceChannel,
|
|
1584
|
-
...mergedChannels?.[entry.channelId]
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
};
|
|
1588
|
-
}
|
|
1589
|
-
});
|
|
1590
|
-
teamsConfig = nextTeams;
|
|
1591
|
-
summarizeMapping("msteams channels", mapping, unresolved, runtime);
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
} catch (err) {
|
|
1595
|
-
runtime.log?.(`msteams resolve failed; using config entries. ${String(err)}`);
|
|
1596
|
-
}
|
|
1597
|
-
msteamsCfg = {
|
|
1598
|
-
...msteamsCfg,
|
|
1599
|
-
allowFrom,
|
|
1600
|
-
groupAllowFrom,
|
|
1601
|
-
teams: teamsConfig
|
|
1602
|
-
};
|
|
1603
|
-
cfg = {
|
|
1604
|
-
...cfg,
|
|
1605
|
-
channels: {
|
|
1606
|
-
...cfg.channels,
|
|
1607
|
-
msteams: msteamsCfg
|
|
1608
|
-
}
|
|
1609
|
-
};
|
|
1610
|
-
const port = msteamsCfg.webhook?.port ?? 3978;
|
|
1611
|
-
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "msteams");
|
|
1612
|
-
const MB = 1024 * 1024;
|
|
1613
|
-
const agentDefaults = cfg.agents?.defaults;
|
|
1614
|
-
const mediaMaxBytes = typeof agentDefaults?.mediaMaxMb === "number" && agentDefaults.mediaMaxMb > 0 ? Math.floor(agentDefaults.mediaMaxMb * MB) : 8 * MB;
|
|
1615
|
-
const conversationStore = opts.conversationStore ?? createMSTeamsConversationStoreFs();
|
|
1616
|
-
const pollStore = opts.pollStore ?? createMSTeamsPollStoreFs();
|
|
1617
|
-
log.info(`starting provider (port ${port})`);
|
|
1618
|
-
const express = await import("express");
|
|
1619
|
-
const { sdk, authConfig } = await loadMSTeamsSdkWithAuth(creds);
|
|
1620
|
-
const { ActivityHandler, MsalTokenProvider, authorizeJWT } = sdk;
|
|
1621
|
-
const tokenProvider = new MsalTokenProvider(authConfig);
|
|
1622
|
-
const adapter = createMSTeamsAdapter(authConfig, sdk);
|
|
1623
|
-
const handler = registerMSTeamsHandlers(new ActivityHandler(), {
|
|
1624
|
-
cfg,
|
|
1625
|
-
runtime,
|
|
1626
|
-
appId,
|
|
1627
|
-
adapter,
|
|
1628
|
-
tokenProvider,
|
|
1629
|
-
textLimit,
|
|
1630
|
-
mediaMaxBytes,
|
|
1631
|
-
conversationStore,
|
|
1632
|
-
pollStore,
|
|
1633
|
-
log
|
|
1634
|
-
});
|
|
1635
|
-
const expressApp = express.default();
|
|
1636
|
-
expressApp.use(authorizeJWT(authConfig));
|
|
1637
|
-
expressApp.use(express.json({ limit: MSTEAMS_WEBHOOK_MAX_BODY_BYTES }));
|
|
1638
|
-
expressApp.use((err, _req, res, next) => {
|
|
1639
|
-
if (err && typeof err === "object" && "status" in err && err.status === 413) {
|
|
1640
|
-
res.status(413).json({ error: "Payload too large" });
|
|
1641
|
-
return;
|
|
1642
|
-
}
|
|
1643
|
-
next(err);
|
|
1644
|
-
});
|
|
1645
|
-
const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
|
|
1646
|
-
const messageHandler = (req, res) => {
|
|
1647
|
-
adapter.process(req, res, (context) => handler.run(context)).catch((err) => {
|
|
1648
|
-
log.error("msteams webhook failed", { error: formatUnknownError(err) });
|
|
1649
|
-
});
|
|
1650
|
-
};
|
|
1651
|
-
expressApp.post(configuredPath, messageHandler);
|
|
1652
|
-
if (configuredPath !== "/api/messages") expressApp.post("/api/messages", messageHandler);
|
|
1653
|
-
log.debug?.("listening on paths", {
|
|
1654
|
-
primary: configuredPath,
|
|
1655
|
-
fallback: "/api/messages"
|
|
1656
|
-
});
|
|
1657
|
-
const httpServer = expressApp.listen(port);
|
|
1658
|
-
await new Promise((resolve, reject) => {
|
|
1659
|
-
const onListening = () => {
|
|
1660
|
-
httpServer.off("error", onError);
|
|
1661
|
-
log.info(`msteams provider started on port ${port}`);
|
|
1662
|
-
resolve();
|
|
1663
|
-
};
|
|
1664
|
-
const onError = (err) => {
|
|
1665
|
-
httpServer.off("listening", onListening);
|
|
1666
|
-
log.error("msteams server error", { error: String(err) });
|
|
1667
|
-
reject(err);
|
|
1668
|
-
};
|
|
1669
|
-
httpServer.once("listening", onListening);
|
|
1670
|
-
httpServer.once("error", onError);
|
|
1671
|
-
});
|
|
1672
|
-
applyMSTeamsWebhookTimeouts(httpServer);
|
|
1673
|
-
httpServer.on("error", (err) => {
|
|
1674
|
-
log.error("msteams server error", { error: String(err) });
|
|
1675
|
-
});
|
|
1676
|
-
const shutdown = async () => {
|
|
1677
|
-
log.info("shutting down msteams provider");
|
|
1678
|
-
return new Promise((resolve) => {
|
|
1679
|
-
httpServer.close((err) => {
|
|
1680
|
-
if (err) log.debug?.("msteams server close error", { error: String(err) });
|
|
1681
|
-
resolve();
|
|
1682
|
-
});
|
|
1683
|
-
});
|
|
1684
|
-
};
|
|
1685
|
-
await keepHttpServerTaskAlive({
|
|
1686
|
-
server: httpServer,
|
|
1687
|
-
abortSignal: opts.abortSignal,
|
|
1688
|
-
onAbort: shutdown
|
|
1689
|
-
});
|
|
1690
|
-
return {
|
|
1691
|
-
app: expressApp,
|
|
1692
|
-
shutdown
|
|
1693
|
-
};
|
|
1694
|
-
}
|
|
1695
|
-
//#endregion
|
|
1696
|
-
export { monitorMSTeamsProvider };
|