@openclaw/msteams 2026.9.4 → 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.
- package/assets/activity.svg +40 -0
- package/assets/icon.png +0 -0
- package/dist/{approval-handler.runtime-DRhFNeJS.cjs → .setup/approval-handler.runtime-DDxGPJDz.cjs} +3 -3
- package/dist/{channel-B9LIyYeu.cjs → .setup/channel-Dzpbbht8.cjs} +62 -35
- package/dist/{channel.runtime-BergqMHg.cjs → .setup/channel.runtime-TE49QvFv.cjs} +57 -32
- package/dist/{channel.setup-BhxokviI.cjs → .setup/channel.setup-BVDfgdCc.cjs} +3 -3
- package/dist/{delegated-state-DiEz9JIa.cjs → .setup/delegated-state-u-ywZyZT.cjs} +5 -5
- package/dist/{messenger-TLdZf9Ar.cjs → .setup/messenger-BR1l4zw-.cjs} +108 -178
- package/dist/{oauth-DUtLTz2u.cjs → .setup/oauth-C6m7dvHj.cjs} +1 -1
- package/dist/{polls-BBdZPx_R.cjs → .setup/polls-BJ4-4uZm.cjs} +14 -7
- package/dist/{reaction-types-BbBBdnQ5.cjs → .setup/reaction-types-C7RA7Wxt.cjs} +1 -1
- package/dist/{resolve-allowlist-DmUTQxEz.cjs → .setup/resolve-allowlist-CHzaaWiC.cjs} +135 -93
- package/dist/.setup/secret-contract-api-ChQdBeU1.cjs +4 -0
- package/dist/.setup/secret-contract-api-ipiUsANg.cjs +28 -0
- package/dist/{send-CU61PSDN.cjs → .setup/send-D8ATH4QI.cjs} +95 -33
- package/dist/.setup/setup-plugin-api-DpiaA8z1.cjs +3 -0
- package/dist/{src-D7Do7sM5.cjs → .setup/src-CpKfpP1m.cjs} +132 -54
- package/dist/{sso-token-store-DTeYxubp.cjs → .setup/sso-token-store-YYLHXgFH.cjs} +1 -1
- package/dist/{thread-session-NmA7_njI.cjs → .setup/thread-session-CXgHK-yi.cjs} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/configured-state.cjs +1 -1
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +64 -62
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/runtime-api.cjs +1 -1
- package/dist/secret-contract-api.cjs +4 -13
- package/dist/setup-entry.cjs +5 -3
- package/dist/setup-plugin-api.cjs +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +14 -11
- package/dist/{adapter.runtime-BzR3RK2J.cjs → .setup/adapter.runtime-ChuVK6k_.cjs} +2 -2
- /package/dist/{approval-card-CPNH_q3P.cjs → .setup/approval-card-CPNH_q3P.cjs} +0 -0
- /package/dist/{config-schema-D22Lr1Qk.cjs → .setup/config-schema-D22Lr1Qk.cjs} +0 -0
- /package/dist/{rolldown-runtime-VH7oDXx4.cjs → .setup/rolldown-runtime-VH7oDXx4.cjs} +0 -0
- /package/dist/{runtime-gZTAuFux.cjs → .setup/runtime-gZTAuFux.cjs} +0 -0
- /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>
|
package/assets/icon.png
ADDED
|
Binary file
|
package/dist/{approval-handler.runtime-DRhFNeJS.cjs → .setup/approval-handler.runtime-DDxGPJDz.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
2
|
-
const require_channel = require("./channel-
|
|
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-
|
|
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("
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
3
|
-
const require_directory_contract_api = require("
|
|
4
|
-
const require_thread_session = require("./thread-session-
|
|
5
|
-
const require_channel_setup = require("./channel.setup-
|
|
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]);
|
|
@@ -331,7 +347,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
|
|
|
331
347
|
request
|
|
332
348
|
}),
|
|
333
349
|
load: async () => {
|
|
334
|
-
const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-
|
|
350
|
+
const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-DDxGPJDz.cjs"));
|
|
335
351
|
return msTeamsApprovalNativeRuntime;
|
|
336
352
|
}
|
|
337
353
|
});
|
|
@@ -389,6 +405,19 @@ const collectMSTeamsMutableAllowlistWarnings = (0, openclaw_plugin_sdk_channel_p
|
|
|
389
405
|
collectLists: (scope) => (0, openclaw_plugin_sdk_channel_policy.collectStandardAllowlistLists)(scope)
|
|
390
406
|
});
|
|
391
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
|
|
392
421
|
//#region extensions/msteams/src/presentation.ts
|
|
393
422
|
const MSTEAMS_PRESENTATION_CAPABILITIES = {
|
|
394
423
|
supported: true,
|
|
@@ -766,11 +795,6 @@ const TEAMS_GRAPH_PERMISSION_HINTS = {
|
|
|
766
795
|
"Sites.Read.All": "files (SharePoint)",
|
|
767
796
|
"Files.Read.All": "files (OneDrive)"
|
|
768
797
|
};
|
|
769
|
-
const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
|
|
770
|
-
"addParticipant",
|
|
771
|
-
"removeParticipant",
|
|
772
|
-
"renameGroup"
|
|
773
|
-
]);
|
|
774
798
|
const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.createAllowlistProviderGroupPolicyWarningCollector)({
|
|
775
799
|
providerConfigPresent: (cfg) => cfg.channels?.msteams !== void 0,
|
|
776
800
|
resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
|
|
@@ -779,10 +803,10 @@ const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.cr
|
|
|
779
803
|
const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.createConditionalWarningCollector.findings({
|
|
780
804
|
collectWarnings: collectMSTeamsSecurityWarnings,
|
|
781
805
|
checkId: "channels.msteams.groups.open",
|
|
782
|
-
severity: "
|
|
806
|
+
severity: "warn",
|
|
783
807
|
title: "MS Teams security warning"
|
|
784
808
|
});
|
|
785
|
-
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-
|
|
809
|
+
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-TE49QvFv.cjs")), "msTeamsChannelRuntime");
|
|
786
810
|
function jsonActionResult(data) {
|
|
787
811
|
return {
|
|
788
812
|
content: [{
|
|
@@ -856,7 +880,7 @@ function resolveGraphActionTarget(params, currentChannelId, currentGraphChannelI
|
|
|
856
880
|
const currentChannelTarget = currentChannelId?.trim();
|
|
857
881
|
const currentGraphTarget = currentGraphChannelId?.trim();
|
|
858
882
|
if (explicitTarget) {
|
|
859
|
-
if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && explicitTarget
|
|
883
|
+
if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && msteamsContextTargetsMatch(require_resolve_allowlist.normalizeMSTeamsMessagingTarget(explicitTarget) ?? "", { currentChannelId: currentChannelTarget })) return currentGraphTarget;
|
|
860
884
|
return explicitTarget;
|
|
861
885
|
}
|
|
862
886
|
if (currentGraphTarget) return currentGraphTarget;
|
|
@@ -874,22 +898,9 @@ function resolveActionPinnedMessageId(params) {
|
|
|
874
898
|
function resolveActionQuery(params) {
|
|
875
899
|
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.query) ?? "";
|
|
876
900
|
}
|
|
877
|
-
function resolveActionContent(params) {
|
|
878
|
-
return typeof params.text === "string" ? params.text : typeof params.content === "string" ? params.content : typeof params.message === "string" ? params.message : "";
|
|
879
|
-
}
|
|
880
901
|
function readOptionalTrimmedString(params, key) {
|
|
881
902
|
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params[key]);
|
|
882
903
|
}
|
|
883
|
-
function resolveActionUploadFilePath(params) {
|
|
884
|
-
for (const key of [
|
|
885
|
-
"filePath",
|
|
886
|
-
"path",
|
|
887
|
-
"media"
|
|
888
|
-
]) if (typeof params[key] === "string") {
|
|
889
|
-
const value = params[key];
|
|
890
|
-
if (value.trim()) return value;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
904
|
function resolveMSTeamsActionTarget(params) {
|
|
894
905
|
return params.graphOnly ? resolveGraphActionTarget(params.toolParams, params.currentChannelId, params.currentGraphChannelId, params.currentChatType) : resolveActionTarget(params.toolParams, params.currentChannelId);
|
|
895
906
|
}
|
|
@@ -1138,10 +1149,19 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1138
1149
|
} },
|
|
1139
1150
|
actions: {
|
|
1140
1151
|
providerOwnedReadGates: true,
|
|
1152
|
+
readAuthorityActions: [
|
|
1153
|
+
"read",
|
|
1154
|
+
"search",
|
|
1155
|
+
"reactions",
|
|
1156
|
+
"list-pins",
|
|
1157
|
+
"member-info",
|
|
1158
|
+
"channel-info",
|
|
1159
|
+
"channel-list"
|
|
1160
|
+
],
|
|
1141
1161
|
describeMessageTool: describeMSTeamsMessageTool,
|
|
1142
1162
|
extractToolSendResult: ({ result, send }) => extractMSTeamsToolSendResult(result, send),
|
|
1143
1163
|
requiresTrustedRequesterSender: ({ action, toolContext }) => (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(toolContext?.currentChannelProvider)?.toLowerCase() === "msteams" && MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(action),
|
|
1144
|
-
handleAction: async (ctx) => {
|
|
1164
|
+
handleAction: withMSTeamsGraphMutationCurrentness(async (ctx) => {
|
|
1145
1165
|
if (MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(ctx.action)) {
|
|
1146
1166
|
const authError = requireMSTeamsGroupManagementAuthorization(ctx);
|
|
1147
1167
|
if (authError) return authError;
|
|
@@ -1165,7 +1185,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1165
1185
|
const result = await sendAdaptiveCardMSTeams({
|
|
1166
1186
|
cfg: ctx.cfg,
|
|
1167
1187
|
to,
|
|
1168
|
-
card
|
|
1188
|
+
card,
|
|
1189
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
1190
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
1169
1191
|
});
|
|
1170
1192
|
return jsonActionResultWithDetails({
|
|
1171
1193
|
ok: true,
|
|
@@ -1197,7 +1219,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1197
1219
|
filename: readOptionalTrimmedString(ctx.params, "filename") ?? readOptionalTrimmedString(ctx.params, "title"),
|
|
1198
1220
|
mediaAccess: ctx.mediaAccess,
|
|
1199
1221
|
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
1200
|
-
mediaReadFile: ctx.mediaReadFile
|
|
1222
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
1223
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
1224
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
1201
1225
|
});
|
|
1202
1226
|
return jsonActionResultWithDetails({
|
|
1203
1227
|
ok: true,
|
|
@@ -1249,7 +1273,10 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1249
1273
|
}
|
|
1250
1274
|
});
|
|
1251
1275
|
const graphActionTarget = {
|
|
1252
|
-
toolParams: ctx.
|
|
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,
|
|
1253
1280
|
currentChannelId: ctx.toolContext?.currentChannelId,
|
|
1254
1281
|
currentGraphChannelId: resolveCurrentGraphActionTarget(ctx.toolContext),
|
|
1255
1282
|
currentChatType: ctx.toolContext?.currentChatType,
|
|
@@ -1369,7 +1396,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1369
1396
|
const allowedTarget = await authorizeActionTarget(to);
|
|
1370
1397
|
const query = resolveActionQuery(ctx.params);
|
|
1371
1398
|
if (!query) return actionError("Search requires a target (to) and query.");
|
|
1372
|
-
const limit =
|
|
1399
|
+
const limit = (0, openclaw_plugin_sdk_channel_actions.readPositiveIntegerParam)(ctx.params, "limit");
|
|
1373
1400
|
const from = typeof ctx.params.from === "string" ? ctx.params.from.trim() : void 0;
|
|
1374
1401
|
const { searchMessagesMSTeams } = await loadMSTeamsChannelRuntime();
|
|
1375
1402
|
return jsonMSTeamsOkActionResult("search", await searchMessagesMSTeams({
|
|
@@ -1484,7 +1511,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1484
1511
|
});
|
|
1485
1512
|
}
|
|
1486
1513
|
return null;
|
|
1487
|
-
}
|
|
1514
|
+
})
|
|
1488
1515
|
},
|
|
1489
1516
|
status: (0, openclaw_plugin_sdk_status_helpers.createComputedAccountStatusAdapter)({
|
|
1490
1517
|
defaultRuntime: (0, openclaw_plugin_sdk_channel_status.createDefaultChannelRuntimeState)(openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID, { port: null }),
|
|
@@ -1525,7 +1552,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1525
1552
|
})
|
|
1526
1553
|
}),
|
|
1527
1554
|
gateway: { startAccount: async (ctx) => {
|
|
1528
|
-
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-
|
|
1555
|
+
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-CpKfpP1m.cjs"));
|
|
1529
1556
|
const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
|
|
1530
1557
|
const statusSink = (0, openclaw_plugin_sdk_channel_outbound.createAccountStatusSink)({
|
|
1531
1558
|
accountId: ctx.accountId,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require("
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
3
|
-
const require_channel = require("./channel-
|
|
4
|
-
const require_channel_setup = require("./channel.setup-
|
|
5
|
-
const require_polls = require("./polls-
|
|
6
|
-
const require_send = require("./send-
|
|
7
|
-
const require_reaction_types = require("./reaction-types-
|
|
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
|
-
|
|
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
|
-
|
|
681
|
-
|
|
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
|
-
|
|
705
|
+
sendText: async ({ cfg, to, text, deps, threadId, assertDirectAdapterHandoff, onPlatformSendDispatch, onDeliveryResult }) => {
|
|
706
|
+
const send = resolveMSTeamsTextSend({
|
|
691
707
|
cfg,
|
|
692
708
|
deps
|
|
693
|
-
})
|
|
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
|
-
|
|
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
|
-
})
|
|
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-
|
|
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");
|
|
@@ -475,7 +475,7 @@ const msteamsSetupWizard = {
|
|
|
475
475
|
};
|
|
476
476
|
let oauthModule;
|
|
477
477
|
try {
|
|
478
|
-
oauthModule = await Promise.resolve().then(() => require("./oauth-
|
|
478
|
+
oauthModule = await Promise.resolve().then(() => require("./oauth-C6m7dvHj.cjs"));
|
|
479
479
|
} catch (err) {
|
|
480
480
|
await noteDelegatedAuthFailure(err);
|
|
481
481
|
return {
|
|
@@ -515,7 +515,7 @@ const msteamsSetupWizard = {
|
|
|
515
515
|
progress.stop();
|
|
516
516
|
throw err;
|
|
517
517
|
}
|
|
518
|
-
require_resolve_allowlist.saveDelegatedTokens(tokens);
|
|
518
|
+
await require_resolve_allowlist.saveDelegatedTokens(tokens);
|
|
519
519
|
progress.stop(t("wizard.msteams.delegatedAuthConfigured"));
|
|
520
520
|
}
|
|
521
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.
|
|
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", {
|