@openclaw/msteams 2026.9.3 → 2026.9.5

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.
Files changed (38) hide show
  1. package/assets/activity.svg +40 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/{adapter.runtime-DDuc7sKJ.cjs → .setup/adapter.runtime-ChuVK6k_.cjs} +3 -3
  4. package/dist/{approval-handler.runtime-CoTQG4FS.cjs → .setup/approval-handler.runtime-DDxGPJDz.cjs} +3 -3
  5. package/dist/{channel-Cdm6-HsU.cjs → .setup/channel-Dzpbbht8.cjs} +63 -35
  6. package/dist/{channel.runtime-__5ZQlfG.cjs → .setup/channel.runtime-TE49QvFv.cjs} +57 -32
  7. package/dist/{channel.setup-ChwkwdLk.cjs → .setup/channel.setup-BVDfgdCc.cjs} +17 -25
  8. package/dist/{delegated-state-DiEz9JIa.cjs → .setup/delegated-state-u-ywZyZT.cjs} +5 -5
  9. package/dist/{messenger-DbWgzI01.cjs → .setup/messenger-BR1l4zw-.cjs} +108 -178
  10. package/dist/{oauth-BeROaYf0.cjs → .setup/oauth-C6m7dvHj.cjs} +1 -1
  11. package/dist/{polls-BBdZPx_R.cjs → .setup/polls-BJ4-4uZm.cjs} +14 -7
  12. package/dist/{reaction-types-zP91Ncwk.cjs → .setup/reaction-types-C7RA7Wxt.cjs} +1 -1
  13. package/dist/{resolve-allowlist-CoKmLXYe.cjs → .setup/resolve-allowlist-CHzaaWiC.cjs} +141 -93
  14. package/dist/.setup/secret-contract-api-ChQdBeU1.cjs +4 -0
  15. package/dist/.setup/secret-contract-api-ipiUsANg.cjs +28 -0
  16. package/dist/{send-Bw4W8RO7.cjs → .setup/send-D8ATH4QI.cjs} +95 -33
  17. package/dist/.setup/setup-plugin-api-DpiaA8z1.cjs +3 -0
  18. package/dist/{src-B--Qc6lj.cjs → .setup/src-CpKfpP1m.cjs} +134 -58
  19. package/dist/{sso-token-store-DTeYxubp.cjs → .setup/sso-token-store-YYLHXgFH.cjs} +1 -1
  20. package/dist/{thread-session-p8FNgohv.cjs → .setup/thread-session-CXgHK-yi.cjs} +1 -1
  21. package/dist/api.cjs +2 -2
  22. package/dist/channel-config-api.cjs +1 -1
  23. package/dist/channel-plugin-api.cjs +1 -1
  24. package/dist/configured-state.cjs +1 -1
  25. package/dist/directory-contract-api.cjs +1 -1
  26. package/dist/doctor-contract-api.cjs +64 -62
  27. package/dist/qa-runner-api.cjs +1 -1
  28. package/dist/runtime-api.cjs +1 -1
  29. package/dist/secret-contract-api.cjs +4 -13
  30. package/dist/setup-entry.cjs +5 -3
  31. package/dist/setup-plugin-api.cjs +1 -1
  32. package/openclaw.plugin.json +4 -1
  33. package/package.json +14 -11
  34. /package/dist/{approval-card-CPNH_q3P.cjs → .setup/approval-card-CPNH_q3P.cjs} +0 -0
  35. /package/dist/{config-schema-D22Lr1Qk.cjs → .setup/config-schema-D22Lr1Qk.cjs} +0 -0
  36. /package/dist/{rolldown-runtime-VH7oDXx4.cjs → .setup/rolldown-runtime-VH7oDXx4.cjs} +0 -0
  37. /package/dist/{runtime-gZTAuFux.cjs → .setup/runtime-gZTAuFux.cjs} +0 -0
  38. /package/dist/{secret-input-C65t6kjM.cjs → .setup/secret-input-C65t6kjM.cjs} +0 -0
@@ -0,0 +1,40 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <!--
3
+ Source: simple-icons@11.15.0, icons/microsoftteams.svg
4
+ https://www.npmjs.com/package/simple-icons/v/11.15.0
5
+ https://github.com/simple-icons/simple-icons
6
+
7
+ # CC0 1.0 Universal
8
+
9
+ ## Statement of Purpose
10
+
11
+ The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an “owner”) of an original work of authorship and/or a database (each, a “Work”).
12
+
13
+ Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (“Commons”) that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
14
+
15
+ For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
16
+
17
+ 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following:
18
+ 1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
19
+ 2. moral rights retained by the original author(s) and/or performer(s);
20
+ 3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
21
+ 4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below;
22
+ 5. rights protecting the extraction, dissemination, use and reuse of data in a Work;
23
+ 6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
24
+ 7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
25
+
26
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose.
27
+
28
+ 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “License”). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer’s express Statement of Purpose.
29
+
30
+ 4. Limitations and Disclaimers.
31
+ 1. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
32
+ 2. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
33
+ 3. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
34
+ 4. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
35
+
36
+ For more information, please see <https://creativecommons.org/publicdomain/zero/1.0>.
37
+ Names and marks remain the property of their respective owners.
38
+ -->
39
+ <path fill="currentColor" stroke="none" d="M20.625 8.127q-.55 0-1.025-.205-.475-.205-.832-.563-.358-.357-.563-.832Q18 6.053 18 5.502q0-.54.205-1.02t.563-.837q.357-.358.832-.563.474-.205 1.025-.205.54 0 1.02.205t.837.563q.358.357.563.837.205.48.205 1.02 0 .55-.205 1.025-.205.475-.563.832-.357.358-.837.563-.48.205-1.02.205zm0-3.75q-.469 0-.797.328-.328.328-.328.797 0 .469.328.797.328.328.797.328.469 0 .797-.328.328-.328.328-.797 0-.469-.328-.797-.328-.328-.797-.328zM24 10.002v5.578q0 .774-.293 1.46-.293.685-.803 1.194-.51.51-1.195.803-.686.293-1.459.293-.445 0-.908-.105-.463-.106-.85-.329-.293.95-.855 1.729-.563.78-1.319 1.336-.756.557-1.67.861-.914.305-1.898.305-1.148 0-2.162-.398-1.014-.399-1.805-1.102-.79-.703-1.312-1.664t-.674-2.086h-5.8q-.411 0-.704-.293T0 16.881V6.873q0-.41.293-.703t.703-.293h8.59q-.34-.715-.34-1.5 0-.727.275-1.365.276-.639.75-1.114.475-.474 1.114-.75.638-.275 1.365-.275t1.365.275q.639.276 1.114.75.474.475.75 1.114.275.638.275 1.365t-.275 1.365q-.276.639-.75 1.113-.475.475-1.114.75-.638.276-1.365.276-.188 0-.375-.024-.188-.023-.375-.058v1.078h10.875q.469 0 .797.328.328.328.328.797zM12.75 2.373q-.41 0-.78.158-.368.158-.638.434-.27.275-.428.639-.158.363-.158.773 0 .41.158.78.159.368.428.638.27.27.639.428.369.158.779.158.41 0 .773-.158.364-.159.64-.428.274-.27.433-.639.158-.369.158-.779 0-.41-.158-.773-.159-.364-.434-.64-.275-.275-.639-.433-.363-.158-.773-.158zM6.937 9.814h2.25V7.94H2.814v1.875h2.25v6h1.875zm10.313 7.313v-6.75H12v6.504q0 .41-.293.703t-.703.293H8.309q.152.809.556 1.5.405.691.985 1.19.58.497 1.318.779.738.281 1.582.281.926 0 1.746-.352.82-.351 1.436-.966.615-.616.966-1.43.352-.815.352-1.752zm5.25-1.547v-5.203h-3.75v6.855q.305.305.691.452.387.146.809.146.469 0 .879-.176.41-.175.715-.48.304-.305.48-.715t.176-.879Z" />
40
+ </svg>
Binary file
@@ -1,13 +1,13 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
+ let node_url = require("node:url");
2
3
  let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
4
+ let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
3
5
  let node_crypto = require("node:crypto");
4
6
  let node_fs_promises = require("node:fs/promises");
5
7
  node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
6
8
  let node_path = require("node:path");
7
9
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
8
- let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
9
10
  let node_timers_promises = require("node:timers/promises");
10
- let node_url = require("node:url");
11
11
  let node_events = require("node:events");
12
12
  let node_http = require("node:http");
13
13
  //#region extensions/msteams/src/qa/bot-framework-server.ts
@@ -54,7 +54,7 @@ async function startMSTeamsQaBotFrameworkServer(options) {
54
54
  conversationId: route.conversationId,
55
55
  ...route.threadId ? { threadId: route.threadId } : {}
56
56
  });
57
- const acceptedButTimedOut = typeof activity.text === "string" && activity.text.includes(AMBIGUOUS_GATEWAY_TIMEOUT_MARKER);
57
+ const acceptedButTimedOut = activity.type === "message" && typeof activity.text === "string" && activity.text.includes(AMBIGUOUS_GATEWAY_TIMEOUT_MARKER);
58
58
  sendJson(response, acceptedButTimedOut ? 504 : 200, acceptedButTimedOut ? { error: "gateway timeout after acceptance" } : { id: activityId });
59
59
  })().catch((error) => {
60
60
  sendJson(response, 500, { error: (0, openclaw_plugin_sdk_error_runtime.coerceErrorMessage)(error) });
@@ -1,7 +1,7 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
2
- const require_channel = require("./channel-Cdm6-HsU.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
2
+ const require_channel = require("./channel-Dzpbbht8.cjs");
3
3
  const require_approval_card = require("./approval-card-CPNH_q3P.cjs");
4
- const require_send = require("./send-Bw4W8RO7.cjs");
4
+ const require_send = require("./send-D8ATH4QI.cjs");
5
5
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
6
6
  let openclaw_plugin_sdk_approval_native_runtime = require("openclaw/plugin-sdk/approval-native-runtime");
7
7
  let openclaw_plugin_sdk_approval_handler_runtime = require("openclaw/plugin-sdk/approval-handler-runtime");
@@ -1,9 +1,10 @@
1
- require("./runtime-api.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
3
- const require_directory_contract_api = require("./directory-contract-api.cjs");
4
- const require_thread_session = require("./thread-session-p8FNgohv.cjs");
5
- const require_channel_setup = require("./channel.setup-ChwkwdLk.cjs");
1
+ require("../runtime-api.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
3
+ const require_directory_contract_api = require("../directory-contract-api.cjs");
4
+ const require_thread_session = require("./thread-session-CXgHK-yi.cjs");
5
+ const require_channel_setup = require("./channel.setup-BVDfgdCc.cjs");
6
6
  let openclaw_plugin_sdk_approval_handler_adapter_runtime = require("openclaw/plugin-sdk/approval-handler-adapter-runtime");
7
+ let openclaw_plugin_sdk_channel_actions = require("openclaw/plugin-sdk/channel-actions");
7
8
  let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
8
9
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
9
10
  let openclaw_plugin_sdk_channel_pairing = require("openclaw/plugin-sdk/channel-pairing");
@@ -19,13 +20,28 @@ let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
19
20
  let openclaw_plugin_sdk_reply_reference = require("openclaw/plugin-sdk/reply-reference");
20
21
  let openclaw_plugin_sdk_approval_delivery_runtime = require("openclaw/plugin-sdk/approval-delivery-runtime");
21
22
  let openclaw_plugin_sdk_approval_native_runtime = require("openclaw/plugin-sdk/approval-native-runtime");
22
- let openclaw_plugin_sdk_channel_actions = require("openclaw/plugin-sdk/channel-actions");
23
23
  let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
24
24
  let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
25
25
  let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
26
26
  let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
27
27
  let openclaw_plugin_sdk_text_chunking = require("openclaw/plugin-sdk/text-chunking");
28
28
  let openclaw_plugin_sdk_channel_status = require("openclaw/plugin-sdk/channel-status");
29
+ //#region extensions/msteams/src/action-params.ts
30
+ /** Text and upload-source aliases shared by Teams message actions. */
31
+ function resolveActionContent(params) {
32
+ return typeof params.text === "string" ? params.text : typeof params.content === "string" ? params.content : typeof params.message === "string" ? params.message : "";
33
+ }
34
+ function resolveActionUploadFilePath(params) {
35
+ for (const key of [
36
+ "filePath",
37
+ "path",
38
+ "media"
39
+ ]) if (typeof params[key] === "string") {
40
+ const value = params[key];
41
+ if (value.trim()) return value;
42
+ }
43
+ }
44
+ //#endregion
29
45
  //#region extensions/msteams/src/policy.ts
30
46
  const teamScopeKey = (teamKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey]);
31
47
  const channelScopeKey = (teamKey, channelKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey], ["channel", channelKey]);
@@ -314,6 +330,7 @@ const resolveMSTeamsOriginTarget = (0, openclaw_plugin_sdk_approval_native_runti
314
330
  normalizeTarget: msTeamsApprovalTargetResolvers.normalizeTarget
315
331
  });
316
332
  const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_adapter_runtime.createLazyChannelApprovalNativeRuntimeAdapter)({
333
+ capabilityBoundary: true,
317
334
  eventKinds: [
318
335
  "exec",
319
336
  "plugin",
@@ -330,7 +347,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
330
347
  request
331
348
  }),
332
349
  load: async () => {
333
- const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-CoTQG4FS.cjs"));
350
+ const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-DDxGPJDz.cjs"));
334
351
  return msTeamsApprovalNativeRuntime;
335
352
  }
336
353
  });
@@ -388,6 +405,19 @@ const collectMSTeamsMutableAllowlistWarnings = (0, openclaw_plugin_sdk_channel_p
388
405
  collectLists: (scope) => (0, openclaw_plugin_sdk_channel_policy.collectStandardAllowlistLists)(scope)
389
406
  });
390
407
  //#endregion
408
+ //#region extensions/msteams/src/graph-action-context.ts
409
+ const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
410
+ "addParticipant",
411
+ "removeParticipant",
412
+ "renameGroup"
413
+ ]);
414
+ function withMSTeamsGraphMutationCurrentness(handleAction) {
415
+ return (ctx) => {
416
+ if (ctx.action === "pin" || ctx.action === "unpin" || ctx.action === "react" || MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(ctx.action)) return require_resolve_allowlist.runWithMSTeamsGraphRequestCurrentness(ctx.assertDirectAdapterHandoff, () => handleAction(ctx));
417
+ return handleAction(ctx);
418
+ };
419
+ }
420
+ //#endregion
391
421
  //#region extensions/msteams/src/presentation.ts
392
422
  const MSTEAMS_PRESENTATION_CAPABILITIES = {
393
423
  supported: true,
@@ -765,11 +795,6 @@ const TEAMS_GRAPH_PERMISSION_HINTS = {
765
795
  "Sites.Read.All": "files (SharePoint)",
766
796
  "Files.Read.All": "files (OneDrive)"
767
797
  };
768
- const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
769
- "addParticipant",
770
- "removeParticipant",
771
- "renameGroup"
772
- ]);
773
798
  const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.createAllowlistProviderGroupPolicyWarningCollector)({
774
799
  providerConfigPresent: (cfg) => cfg.channels?.msteams !== void 0,
775
800
  resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
@@ -778,10 +803,10 @@ const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.cr
778
803
  const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.createConditionalWarningCollector.findings({
779
804
  collectWarnings: collectMSTeamsSecurityWarnings,
780
805
  checkId: "channels.msteams.groups.open",
781
- severity: "critical",
806
+ severity: "warn",
782
807
  title: "MS Teams security warning"
783
808
  });
784
- const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-__5ZQlfG.cjs")), "msTeamsChannelRuntime");
809
+ const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-TE49QvFv.cjs")), "msTeamsChannelRuntime");
785
810
  function jsonActionResult(data) {
786
811
  return {
787
812
  content: [{
@@ -855,7 +880,7 @@ function resolveGraphActionTarget(params, currentChannelId, currentGraphChannelI
855
880
  const currentChannelTarget = currentChannelId?.trim();
856
881
  const currentGraphTarget = currentGraphChannelId?.trim();
857
882
  if (explicitTarget) {
858
- if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && explicitTarget === currentChannelTarget) return currentGraphTarget;
883
+ if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && msteamsContextTargetsMatch(require_resolve_allowlist.normalizeMSTeamsMessagingTarget(explicitTarget) ?? "", { currentChannelId: currentChannelTarget })) return currentGraphTarget;
859
884
  return explicitTarget;
860
885
  }
861
886
  if (currentGraphTarget) return currentGraphTarget;
@@ -873,22 +898,9 @@ function resolveActionPinnedMessageId(params) {
873
898
  function resolveActionQuery(params) {
874
899
  return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.query) ?? "";
875
900
  }
876
- function resolveActionContent(params) {
877
- return typeof params.text === "string" ? params.text : typeof params.content === "string" ? params.content : typeof params.message === "string" ? params.message : "";
878
- }
879
901
  function readOptionalTrimmedString(params, key) {
880
902
  return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params[key]);
881
903
  }
882
- function resolveActionUploadFilePath(params) {
883
- for (const key of [
884
- "filePath",
885
- "path",
886
- "media"
887
- ]) if (typeof params[key] === "string") {
888
- const value = params[key];
889
- if (value.trim()) return value;
890
- }
891
- }
892
904
  function resolveMSTeamsActionTarget(params) {
893
905
  return params.graphOnly ? resolveGraphActionTarget(params.toolParams, params.currentChannelId, params.currentGraphChannelId, params.currentChatType) : resolveActionTarget(params.toolParams, params.currentChannelId);
894
906
  }
@@ -1137,10 +1149,19 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1137
1149
  } },
1138
1150
  actions: {
1139
1151
  providerOwnedReadGates: true,
1152
+ readAuthorityActions: [
1153
+ "read",
1154
+ "search",
1155
+ "reactions",
1156
+ "list-pins",
1157
+ "member-info",
1158
+ "channel-info",
1159
+ "channel-list"
1160
+ ],
1140
1161
  describeMessageTool: describeMSTeamsMessageTool,
1141
1162
  extractToolSendResult: ({ result, send }) => extractMSTeamsToolSendResult(result, send),
1142
1163
  requiresTrustedRequesterSender: ({ action, toolContext }) => (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(toolContext?.currentChannelProvider)?.toLowerCase() === "msteams" && MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(action),
1143
- handleAction: async (ctx) => {
1164
+ handleAction: withMSTeamsGraphMutationCurrentness(async (ctx) => {
1144
1165
  if (MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(ctx.action)) {
1145
1166
  const authError = requireMSTeamsGroupManagementAuthorization(ctx);
1146
1167
  if (authError) return authError;
@@ -1164,7 +1185,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1164
1185
  const result = await sendAdaptiveCardMSTeams({
1165
1186
  cfg: ctx.cfg,
1166
1187
  to,
1167
- card
1188
+ card,
1189
+ assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
1190
+ onPlatformSendDispatch: ctx.onPlatformSendDispatch
1168
1191
  });
1169
1192
  return jsonActionResultWithDetails({
1170
1193
  ok: true,
@@ -1196,7 +1219,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1196
1219
  filename: readOptionalTrimmedString(ctx.params, "filename") ?? readOptionalTrimmedString(ctx.params, "title"),
1197
1220
  mediaAccess: ctx.mediaAccess,
1198
1221
  mediaLocalRoots: ctx.mediaLocalRoots,
1199
- mediaReadFile: ctx.mediaReadFile
1222
+ mediaReadFile: ctx.mediaReadFile,
1223
+ assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
1224
+ onPlatformSendDispatch: ctx.onPlatformSendDispatch
1200
1225
  });
1201
1226
  return jsonActionResultWithDetails({
1202
1227
  ok: true,
@@ -1248,7 +1273,10 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1248
1273
  }
1249
1274
  });
1250
1275
  const graphActionTarget = {
1251
- toolParams: ctx.params,
1276
+ toolParams: ctx.action === "search" || ctx.action === "member-info" ? {
1277
+ ...ctx.params,
1278
+ to: resolveActionTarget(ctx.params) || (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.params.channelId)
1279
+ } : ctx.params,
1252
1280
  currentChannelId: ctx.toolContext?.currentChannelId,
1253
1281
  currentGraphChannelId: resolveCurrentGraphActionTarget(ctx.toolContext),
1254
1282
  currentChatType: ctx.toolContext?.currentChatType,
@@ -1368,7 +1396,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1368
1396
  const allowedTarget = await authorizeActionTarget(to);
1369
1397
  const query = resolveActionQuery(ctx.params);
1370
1398
  if (!query) return actionError("Search requires a target (to) and query.");
1371
- const limit = typeof ctx.params.limit === "number" ? ctx.params.limit : void 0;
1399
+ const limit = (0, openclaw_plugin_sdk_channel_actions.readPositiveIntegerParam)(ctx.params, "limit");
1372
1400
  const from = typeof ctx.params.from === "string" ? ctx.params.from.trim() : void 0;
1373
1401
  const { searchMessagesMSTeams } = await loadMSTeamsChannelRuntime();
1374
1402
  return jsonMSTeamsOkActionResult("search", await searchMessagesMSTeams({
@@ -1483,7 +1511,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1483
1511
  });
1484
1512
  }
1485
1513
  return null;
1486
- }
1514
+ })
1487
1515
  },
1488
1516
  status: (0, openclaw_plugin_sdk_status_helpers.createComputedAccountStatusAdapter)({
1489
1517
  defaultRuntime: (0, openclaw_plugin_sdk_channel_status.createDefaultChannelRuntimeState)(openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID, { port: null }),
@@ -1524,7 +1552,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1524
1552
  })
1525
1553
  }),
1526
1554
  gateway: { startAccount: async (ctx) => {
1527
- const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-B--Qc6lj.cjs"));
1555
+ const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-CpKfpP1m.cjs"));
1528
1556
  const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
1529
1557
  const statusSink = (0, openclaw_plugin_sdk_channel_outbound.createAccountStatusSink)({
1530
1558
  accountId: ctx.accountId,
@@ -1,10 +1,10 @@
1
- require("./runtime-api.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
3
- const require_channel = require("./channel-Cdm6-HsU.cjs");
4
- const require_channel_setup = require("./channel.setup-ChwkwdLk.cjs");
5
- const require_polls = require("./polls-BBdZPx_R.cjs");
6
- const require_send = require("./send-Bw4W8RO7.cjs");
7
- const require_reaction_types = require("./reaction-types-zP91Ncwk.cjs");
1
+ require("../runtime-api.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
3
+ const require_channel = require("./channel-Dzpbbht8.cjs");
4
+ const require_channel_setup = require("./channel.setup-BVDfgdCc.cjs");
5
+ const require_polls = require("./polls-BJ4-4uZm.cjs");
6
+ const require_send = require("./send-D8ATH4QI.cjs");
7
+ const require_reaction_types = require("./reaction-types-C7RA7Wxt.cjs");
8
8
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
9
9
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
10
10
  let openclaw_plugin_sdk_reply_payload = require("openclaw/plugin-sdk/reply-payload");
@@ -580,6 +580,16 @@ function toMSTeamsOutboundResult(result) {
580
580
  }
581
581
  };
582
582
  }
583
+ async function sendWithDeliveryResults(send, onDeliveryResult) {
584
+ if (!onDeliveryResult) return send(void 0);
585
+ let childReported = false;
586
+ const result = await send(async (delivery) => {
587
+ childReported = true;
588
+ await onDeliveryResult((0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(delivery)));
589
+ });
590
+ if (!childReported) await onDeliveryResult((0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result)));
591
+ return result;
592
+ }
583
593
  function resolveMSTeamsThreadTarget(to, threadId) {
584
594
  const normalizedThreadId = threadId == null ? "" : String(threadId).trim();
585
595
  const graphChannelId = to.includes("/") ? to.slice(to.indexOf("/") + 1) : "";
@@ -588,10 +598,11 @@ function resolveMSTeamsThreadTarget(to, threadId) {
588
598
  return `${to};messageid=${normalizedThreadId}`;
589
599
  }
590
600
  function resolveMSTeamsTextSend(params) {
591
- return (0, openclaw_plugin_sdk_channel_outbound.resolveOutboundSendDep)(params.deps, "msteams") ?? ((to, text) => require_send.sendMessageMSTeams({
601
+ return (0, openclaw_plugin_sdk_channel_outbound.resolveOutboundSendDep)(params.deps, "msteams") ?? ((to, text, opts) => require_send.sendMessageMSTeams({
592
602
  cfg: params.cfg,
593
603
  to,
594
- text
604
+ text,
605
+ ...opts
595
606
  }));
596
607
  }
597
608
  function resolveMSTeamsMediaSend(params) {
@@ -634,15 +645,21 @@ const msteamsOutbound = {
634
645
  }
635
646
  };
636
647
  },
637
- sendPayload: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, payload, deps, onDeliveryResult, threadId }) => {
648
+ sendPayload: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, payload, deps, onDeliveryResult, assertDirectAdapterHandoff, onPlatformSendDispatch, threadId }) => {
649
+ const handoff = {
650
+ assertDirectAdapterHandoff,
651
+ onPlatformSendDispatch
652
+ };
638
653
  const deliveryTarget = resolveMSTeamsThreadTarget(to, threadId);
639
654
  const presentationCard = (0, openclaw_plugin_sdk_string_coerce_runtime.asOptionalRecord)(payload.channelData?.msteams)?.presentationCard;
640
655
  if (presentationCard && typeof presentationCard === "object" && !Array.isArray(presentationCard)) {
641
- const result = await require_send.sendAdaptiveCardMSTeams({
656
+ const result = await sendWithDeliveryResults((report) => require_send.sendAdaptiveCardMSTeams({
642
657
  cfg,
643
658
  to: deliveryTarget,
644
- card: presentationCard
645
- });
659
+ card: presentationCard,
660
+ ...handoff,
661
+ onDeliveryResult: report
662
+ }), onDeliveryResult);
646
663
  return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result));
647
664
  }
648
665
  const mediaUrls = (0, openclaw_plugin_sdk_string_normalization_runtime.normalizeStringEntries)((0, openclaw_plugin_sdk_reply_payload.resolvePayloadMediaUrls)({
@@ -657,15 +674,14 @@ const msteamsOutbound = {
657
674
  const result = await (0, openclaw_plugin_sdk_reply_payload.sendPayloadMediaSequence)({
658
675
  text,
659
676
  mediaUrls,
660
- onResult: async (deliveryResult) => {
661
- await onDeliveryResult?.((0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(deliveryResult)));
662
- },
663
- send: async ({ text: textLocal, mediaUrl: mediaUrlLocal }) => await send(deliveryTarget, textLocal, {
677
+ send: async ({ text: textLocal, mediaUrl: mediaUrlLocal }) => await sendWithDeliveryResults((report) => send(deliveryTarget, textLocal, {
664
678
  mediaUrl: mediaUrlLocal,
665
679
  mediaAccess,
666
680
  mediaLocalRoots,
667
- mediaReadFile
668
- })
681
+ mediaReadFile,
682
+ ...handoff,
683
+ onDeliveryResult: report
684
+ }), onDeliveryResult)
669
685
  });
670
686
  if (result) return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result));
671
687
  }
@@ -676,32 +692,41 @@ const msteamsOutbound = {
676
692
  });
677
693
  const chunks = (0, openclaw_plugin_sdk_reply_payload.resolveTextChunksWithFallback)(text, (0, openclaw_plugin_sdk_text_chunking.chunkTextForOutbound)(text, resolveMSTeamsEffectiveTextChunkLimit(cfg.channels?.msteams?.textChunkLimit)));
678
694
  let result;
679
- for (const chunk of chunks) {
680
- result = await send(deliveryTarget, chunk);
681
- await onDeliveryResult?.((0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result)));
682
- }
695
+ for (const chunk of chunks) result = await sendWithDeliveryResults((report) => send(deliveryTarget, chunk, {
696
+ ...handoff,
697
+ onDeliveryResult: report
698
+ }), onDeliveryResult);
683
699
  return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result));
684
700
  }
685
701
  throw new Error("MS Teams payload send requires text, media, or a presentation card.");
686
702
  },
687
703
  ...(0, openclaw_plugin_sdk_channel_send_result.createAttachedChannelResultAdapter)({
688
704
  channel: "msteams",
689
- sendText: async ({ cfg, to, text, deps, threadId }) => {
690
- return toMSTeamsOutboundResult(await resolveMSTeamsTextSend({
705
+ sendText: async ({ cfg, to, text, deps, threadId, assertDirectAdapterHandoff, onPlatformSendDispatch, onDeliveryResult }) => {
706
+ const send = resolveMSTeamsTextSend({
691
707
  cfg,
692
708
  deps
693
- })(resolveMSTeamsThreadTarget(to, threadId), text));
709
+ });
710
+ return toMSTeamsOutboundResult(await sendWithDeliveryResults((report) => send(resolveMSTeamsThreadTarget(to, threadId), text, {
711
+ assertDirectAdapterHandoff,
712
+ onPlatformSendDispatch,
713
+ onDeliveryResult: report
714
+ }), onDeliveryResult));
694
715
  },
695
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, deps, threadId }) => {
696
- return toMSTeamsOutboundResult(await resolveMSTeamsMediaSend({
716
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, deps, threadId, assertDirectAdapterHandoff, onPlatformSendDispatch, onDeliveryResult }) => {
717
+ const send = resolveMSTeamsMediaSend({
697
718
  cfg,
698
719
  deps
699
- })(resolveMSTeamsThreadTarget(to, threadId), text, {
720
+ });
721
+ return toMSTeamsOutboundResult(await sendWithDeliveryResults((report) => send(resolveMSTeamsThreadTarget(to, threadId), text, {
700
722
  mediaUrl,
701
723
  mediaAccess,
702
724
  mediaLocalRoots,
703
- mediaReadFile
704
- }));
725
+ mediaReadFile,
726
+ assertDirectAdapterHandoff,
727
+ onPlatformSendDispatch,
728
+ onDeliveryResult: report
729
+ }), onDeliveryResult));
705
730
  },
706
731
  sendPoll: async ({ cfg, to, poll, threadId }) => {
707
732
  const maxSelections = poll.maxSelections ?? 1;
@@ -785,7 +810,7 @@ async function probeMSTeams(cfg) {
785
810
  }
786
811
  let delegatedAuth;
787
812
  if (cfg?.delegatedAuth?.enabled) try {
788
- const tokens = require_resolve_allowlist.loadDelegatedTokens();
813
+ const tokens = await require_resolve_allowlist.loadDelegatedTokens();
789
814
  if (tokens) {
790
815
  const isExpired = !(0, openclaw_plugin_sdk_number_runtime.isFutureDateTimestampMs)(tokens.expiresAt);
791
816
  delegatedAuth = {
@@ -1,4 +1,4 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
2
2
  require("./secret-input-C65t6kjM.cjs");
3
3
  const require_config_schema = require("./config-schema-D22Lr1Qk.cjs");
4
4
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
@@ -118,19 +118,16 @@ function createMSTeamsSetupWizardBase() {
118
118
  });
119
119
  else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
120
120
  } else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
121
- if (appId && appPassword && tenantId) next = {
122
- ...next,
123
- channels: {
124
- ...next.channels,
125
- msteams: {
126
- ...next.channels?.msteams,
127
- enabled: true,
128
- appId,
129
- appPassword,
130
- tenantId
131
- }
121
+ if (appId && appPassword && tenantId) next = (0, openclaw_plugin_sdk_setup.patchTopLevelChannelConfigSection)({
122
+ cfg: next,
123
+ channel: channel$1,
124
+ enabled: true,
125
+ patch: {
126
+ appId,
127
+ appPassword,
128
+ tenantId
132
129
  }
133
- };
130
+ });
134
131
  return {
135
132
  cfg: next,
136
133
  accountId: openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID
@@ -468,22 +465,17 @@ const msteamsSetupWizard = {
468
465
  message: t("wizard.msteams.delegatedAuthPrompt"),
469
466
  initialValue: false
470
467
  })) {
471
- next = {
472
- ...next,
473
- channels: {
474
- ...next.channels,
475
- msteams: {
476
- ...next.channels?.msteams,
477
- delegatedAuth: { enabled: true }
478
- }
479
- }
480
- };
468
+ next = (0, openclaw_plugin_sdk_setup.patchTopLevelChannelConfigSection)({
469
+ cfg: next,
470
+ channel,
471
+ patch: { delegatedAuth: { enabled: true } }
472
+ });
481
473
  const noteDelegatedAuthFailure = async (err) => {
482
474
  await params.prompter.note(`Delegated auth setup failed: ${formatUnknownError(err)}\n` + t("wizard.msteams.delegatedAuthRetry"), t("wizard.msteams.delegatedAuthTitle"));
483
475
  };
484
476
  let oauthModule;
485
477
  try {
486
- oauthModule = await Promise.resolve().then(() => require("./oauth-BeROaYf0.cjs"));
478
+ oauthModule = await Promise.resolve().then(() => require("./oauth-C6m7dvHj.cjs"));
487
479
  } catch (err) {
488
480
  await noteDelegatedAuthFailure(err);
489
481
  return {
@@ -523,7 +515,7 @@ const msteamsSetupWizard = {
523
515
  progress.stop();
524
516
  throw err;
525
517
  }
526
- require_resolve_allowlist.saveDelegatedTokens(tokens);
518
+ await require_resolve_allowlist.saveDelegatedTokens(tokens);
527
519
  progress.stop(t("wizard.msteams.delegatedAuthConfigured"));
528
520
  }
529
521
  }
@@ -4,7 +4,7 @@ const MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME = "msteams-delegated.json";
4
4
  const MSTEAMS_DELEGATED_TOKEN_NAMESPACE = "delegated-token";
5
5
  const MSTEAMS_DELEGATED_TOKEN_KEY = "current";
6
6
  function openDelegatedTokenStore(env) {
7
- return require_runtime.getMSTeamsRuntime().state.openSyncKeyedStore({
7
+ return require_runtime.getMSTeamsRuntime().state.openKeyedStore({
8
8
  namespace: MSTEAMS_DELEGATED_TOKEN_NAMESPACE,
9
9
  maxEntries: 1,
10
10
  overflowPolicy: "reject-new",
@@ -23,13 +23,13 @@ function normalizeMSTeamsDelegatedTokens(value) {
23
23
  ...typeof token.userPrincipalName === "string" ? { userPrincipalName: token.userPrincipalName } : {}
24
24
  };
25
25
  }
26
- function loadMSTeamsDelegatedTokens(env) {
27
- return normalizeMSTeamsDelegatedTokens(openDelegatedTokenStore(env).lookup("current")) ?? void 0;
26
+ async function loadMSTeamsDelegatedTokens(env) {
27
+ return normalizeMSTeamsDelegatedTokens(await openDelegatedTokenStore(env).lookup("current")) ?? void 0;
28
28
  }
29
- function saveMSTeamsDelegatedTokens(tokens, env) {
29
+ async function saveMSTeamsDelegatedTokens(tokens, env) {
30
30
  const normalized = normalizeMSTeamsDelegatedTokens(tokens);
31
31
  if (!normalized) throw new Error("Invalid Microsoft Teams delegated token payload");
32
- openDelegatedTokenStore(env).register(MSTEAMS_DELEGATED_TOKEN_KEY, normalized);
32
+ await openDelegatedTokenStore(env).register(MSTEAMS_DELEGATED_TOKEN_KEY, normalized);
33
33
  }
34
34
  //#endregion
35
35
  Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_KEY", {