@openclaw/msteams 2026.9.4 → 2026.9.6
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/{adapter.runtime-BzR3RK2J.cjs → .setup/adapter.runtime-CQWZeqB5.cjs} +5 -3
- package/dist/{approval-handler.runtime-DRhFNeJS.cjs → .setup/approval-handler.runtime-CUnanUdR.cjs} +3 -3
- package/dist/{channel-B9LIyYeu.cjs → .setup/channel-BDp16XRR.cjs} +128 -89
- package/dist/{channel.runtime-BergqMHg.cjs → .setup/channel.runtime-Cv5F8JCa.cjs} +61 -34
- 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-8RA1FUJa.cjs} +112 -188
- 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-CYN_N7O1.cjs} +99 -34
- package/dist/.setup/setup-plugin-api-DpiaA8z1.cjs +3 -0
- package/dist/{src-D7Do7sM5.cjs → .setup/src-BfOCwlHp.cjs} +150 -125
- 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/{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
|
|
@@ -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
|
|
@@ -189,6 +189,7 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
189
189
|
await connector.close().catch(() => void 0);
|
|
190
190
|
throw error;
|
|
191
191
|
}
|
|
192
|
+
const bootstrapUrl = (0, node_url.pathToFileURL)(bootstrapPath).href;
|
|
192
193
|
return {
|
|
193
194
|
id: "msteams",
|
|
194
195
|
label: "Microsoft Teams live",
|
|
@@ -285,8 +286,9 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
285
286
|
} } }),
|
|
286
287
|
createRuntimeEnvPatch: () => ({
|
|
287
288
|
OPENCLAW_BUILD_PRIVATE_QA: "1",
|
|
288
|
-
NODE_OPTIONS: [process.env.NODE_OPTIONS?.trim(), `--import=${
|
|
289
|
+
NODE_OPTIONS: [process.env.NODE_OPTIONS?.trim(), `--import=${bootstrapUrl}`].filter(Boolean).join(" ")
|
|
289
290
|
}),
|
|
291
|
+
createRuntimePreloads: () => [bootstrapUrl],
|
|
290
292
|
waitReady: async ({ gateway, timeoutMs, pollIntervalMs }) => await waitForMSTeamsChannelReady(gateway, timeoutMs, pollIntervalMs),
|
|
291
293
|
buildAgentDelivery: ({ target }) => ({
|
|
292
294
|
channel: "msteams",
|
package/dist/{approval-handler.runtime-DRhFNeJS.cjs → .setup/approval-handler.runtime-CUnanUdR.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-BDp16XRR.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-CYN_N7O1.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,83 @@ 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
|
|
45
|
+
//#region extensions/msteams/src/action-results.ts
|
|
46
|
+
function jsonActionResult(data) {
|
|
47
|
+
return {
|
|
48
|
+
content: [{
|
|
49
|
+
type: "text",
|
|
50
|
+
text: JSON.stringify(data)
|
|
51
|
+
}],
|
|
52
|
+
details: data
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function jsonMSTeamsActionResult(action, data = {}) {
|
|
56
|
+
return jsonActionResult({
|
|
57
|
+
channel: "msteams",
|
|
58
|
+
action,
|
|
59
|
+
...data
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function jsonMSTeamsOkActionResult(action, data = {}) {
|
|
63
|
+
return jsonActionResult({
|
|
64
|
+
ok: true,
|
|
65
|
+
channel: "msteams",
|
|
66
|
+
action,
|
|
67
|
+
...data
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function jsonMSTeamsConversationResult(conversationId) {
|
|
71
|
+
return jsonActionResultWithDetails({
|
|
72
|
+
ok: true,
|
|
73
|
+
channel: "msteams",
|
|
74
|
+
conversationId
|
|
75
|
+
}, {
|
|
76
|
+
ok: true,
|
|
77
|
+
channel: "msteams"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function jsonActionResultWithDetails(contentData, details) {
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: JSON.stringify(contentData)
|
|
85
|
+
}],
|
|
86
|
+
details
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function actionError(message) {
|
|
90
|
+
return {
|
|
91
|
+
isError: true,
|
|
92
|
+
content: [{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: message
|
|
95
|
+
}],
|
|
96
|
+
details: { error: message }
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
29
100
|
//#region extensions/msteams/src/policy.ts
|
|
30
101
|
const teamScopeKey = (teamKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey]);
|
|
31
102
|
const channelScopeKey = (teamKey, channelKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey], ["channel", channelKey]);
|
|
@@ -331,7 +402,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
|
|
|
331
402
|
request
|
|
332
403
|
}),
|
|
333
404
|
load: async () => {
|
|
334
|
-
const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-
|
|
405
|
+
const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-CUnanUdR.cjs"));
|
|
335
406
|
return msTeamsApprovalNativeRuntime;
|
|
336
407
|
}
|
|
337
408
|
});
|
|
@@ -389,6 +460,19 @@ const collectMSTeamsMutableAllowlistWarnings = (0, openclaw_plugin_sdk_channel_p
|
|
|
389
460
|
collectLists: (scope) => (0, openclaw_plugin_sdk_channel_policy.collectStandardAllowlistLists)(scope)
|
|
390
461
|
});
|
|
391
462
|
//#endregion
|
|
463
|
+
//#region extensions/msteams/src/graph-action-context.ts
|
|
464
|
+
const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
|
|
465
|
+
"addParticipant",
|
|
466
|
+
"removeParticipant",
|
|
467
|
+
"renameGroup"
|
|
468
|
+
]);
|
|
469
|
+
function withMSTeamsGraphMutationCurrentness(handleAction) {
|
|
470
|
+
return (ctx) => {
|
|
471
|
+
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));
|
|
472
|
+
return handleAction(ctx);
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
392
476
|
//#region extensions/msteams/src/presentation.ts
|
|
393
477
|
const MSTEAMS_PRESENTATION_CAPABILITIES = {
|
|
394
478
|
supported: true,
|
|
@@ -766,11 +850,6 @@ const TEAMS_GRAPH_PERMISSION_HINTS = {
|
|
|
766
850
|
"Sites.Read.All": "files (SharePoint)",
|
|
767
851
|
"Files.Read.All": "files (OneDrive)"
|
|
768
852
|
};
|
|
769
|
-
const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
|
|
770
|
-
"addParticipant",
|
|
771
|
-
"removeParticipant",
|
|
772
|
-
"renameGroup"
|
|
773
|
-
]);
|
|
774
853
|
const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.createAllowlistProviderGroupPolicyWarningCollector)({
|
|
775
854
|
providerConfigPresent: (cfg) => cfg.channels?.msteams !== void 0,
|
|
776
855
|
resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
|
|
@@ -779,53 +858,10 @@ const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.cr
|
|
|
779
858
|
const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.createConditionalWarningCollector.findings({
|
|
780
859
|
collectWarnings: collectMSTeamsSecurityWarnings,
|
|
781
860
|
checkId: "channels.msteams.groups.open",
|
|
782
|
-
severity: "
|
|
861
|
+
severity: "warn",
|
|
783
862
|
title: "MS Teams security warning"
|
|
784
863
|
});
|
|
785
|
-
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-
|
|
786
|
-
function jsonActionResult(data) {
|
|
787
|
-
return {
|
|
788
|
-
content: [{
|
|
789
|
-
type: "text",
|
|
790
|
-
text: JSON.stringify(data)
|
|
791
|
-
}],
|
|
792
|
-
details: data
|
|
793
|
-
};
|
|
794
|
-
}
|
|
795
|
-
function jsonMSTeamsActionResult(action, data = {}) {
|
|
796
|
-
return jsonActionResult({
|
|
797
|
-
channel: "msteams",
|
|
798
|
-
action,
|
|
799
|
-
...data
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
function jsonMSTeamsOkActionResult(action, data = {}) {
|
|
803
|
-
return jsonActionResult({
|
|
804
|
-
ok: true,
|
|
805
|
-
channel: "msteams",
|
|
806
|
-
action,
|
|
807
|
-
...data
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
function jsonMSTeamsConversationResult(conversationId) {
|
|
811
|
-
return jsonActionResultWithDetails({
|
|
812
|
-
ok: true,
|
|
813
|
-
channel: "msteams",
|
|
814
|
-
conversationId
|
|
815
|
-
}, {
|
|
816
|
-
ok: true,
|
|
817
|
-
channel: "msteams"
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
function jsonActionResultWithDetails(contentData, details) {
|
|
821
|
-
return {
|
|
822
|
-
content: [{
|
|
823
|
-
type: "text",
|
|
824
|
-
text: JSON.stringify(contentData)
|
|
825
|
-
}],
|
|
826
|
-
details
|
|
827
|
-
};
|
|
828
|
-
}
|
|
864
|
+
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-Cv5F8JCa.cjs")), "msTeamsChannelRuntime");
|
|
829
865
|
const MSTEAMS_REACTION_TYPES = [
|
|
830
866
|
"like",
|
|
831
867
|
"heart",
|
|
@@ -834,16 +870,6 @@ const MSTEAMS_REACTION_TYPES = [
|
|
|
834
870
|
"sad",
|
|
835
871
|
"angry"
|
|
836
872
|
];
|
|
837
|
-
function actionError(message) {
|
|
838
|
-
return {
|
|
839
|
-
isError: true,
|
|
840
|
-
content: [{
|
|
841
|
-
type: "text",
|
|
842
|
-
text: message
|
|
843
|
-
}],
|
|
844
|
-
details: { error: message }
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
873
|
function requireMSTeamsGroupManagementAuthorization(ctx) {
|
|
848
874
|
if (ctx.senderIsOwner === true || ctx.gatewayClientScopes?.includes("operator.admin")) return null;
|
|
849
875
|
return actionError("Microsoft Teams group management requires an owner or operator.admin requester.");
|
|
@@ -856,7 +882,7 @@ function resolveGraphActionTarget(params, currentChannelId, currentGraphChannelI
|
|
|
856
882
|
const currentChannelTarget = currentChannelId?.trim();
|
|
857
883
|
const currentGraphTarget = currentGraphChannelId?.trim();
|
|
858
884
|
if (explicitTarget) {
|
|
859
|
-
if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && explicitTarget
|
|
885
|
+
if (currentChatType === "channel" && currentGraphTarget && currentChannelTarget && msteamsContextTargetsMatch(require_resolve_allowlist.normalizeMSTeamsMessagingTarget(explicitTarget) ?? "", { currentChannelId: currentChannelTarget })) return currentGraphTarget;
|
|
860
886
|
return explicitTarget;
|
|
861
887
|
}
|
|
862
888
|
if (currentGraphTarget) return currentGraphTarget;
|
|
@@ -874,22 +900,9 @@ function resolveActionPinnedMessageId(params) {
|
|
|
874
900
|
function resolveActionQuery(params) {
|
|
875
901
|
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.query) ?? "";
|
|
876
902
|
}
|
|
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
903
|
function readOptionalTrimmedString(params, key) {
|
|
881
904
|
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params[key]);
|
|
882
905
|
}
|
|
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
906
|
function resolveMSTeamsActionTarget(params) {
|
|
894
907
|
return params.graphOnly ? resolveGraphActionTarget(params.toolParams, params.currentChannelId, params.currentGraphChannelId, params.currentChatType) : resolveActionTarget(params.toolParams, params.currentChannelId);
|
|
895
908
|
}
|
|
@@ -900,7 +913,14 @@ async function runWithRequiredActionTarget(params) {
|
|
|
900
913
|
}
|
|
901
914
|
async function runWithRequiredActionMessageTarget(params) {
|
|
902
915
|
const to = resolveMSTeamsActionTarget(params);
|
|
903
|
-
const
|
|
916
|
+
const messageIdRaw = params.allowCurrentMessageIdFallback === true && msteamsContextTargetsMatch(to, {
|
|
917
|
+
currentChannelId: params.currentChannelId ?? void 0,
|
|
918
|
+
currentMessagingTarget: params.currentGraphChannelId ?? void 0
|
|
919
|
+
}) ? (0, openclaw_plugin_sdk_channel_actions.resolveReactionMessageId)({
|
|
920
|
+
args: params.toolParams,
|
|
921
|
+
toolContext: { currentMessageId: params.currentMessageId ?? void 0 }
|
|
922
|
+
}) : resolveActionMessageId(params.toolParams);
|
|
923
|
+
const messageId = messageIdRaw == null ? "" : String(messageIdRaw).trim();
|
|
904
924
|
if (!to || !messageId) return actionError(`${params.actionLabel} requires a target (to) and messageId.`);
|
|
905
925
|
return await params.run({
|
|
906
926
|
to,
|
|
@@ -1138,10 +1158,19 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1138
1158
|
} },
|
|
1139
1159
|
actions: {
|
|
1140
1160
|
providerOwnedReadGates: true,
|
|
1161
|
+
readAuthorityActions: [
|
|
1162
|
+
"read",
|
|
1163
|
+
"search",
|
|
1164
|
+
"reactions",
|
|
1165
|
+
"list-pins",
|
|
1166
|
+
"member-info",
|
|
1167
|
+
"channel-info",
|
|
1168
|
+
"channel-list"
|
|
1169
|
+
],
|
|
1141
1170
|
describeMessageTool: describeMSTeamsMessageTool,
|
|
1142
1171
|
extractToolSendResult: ({ result, send }) => extractMSTeamsToolSendResult(result, send),
|
|
1143
1172
|
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) => {
|
|
1173
|
+
handleAction: withMSTeamsGraphMutationCurrentness(async (ctx) => {
|
|
1145
1174
|
if (MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(ctx.action)) {
|
|
1146
1175
|
const authError = requireMSTeamsGroupManagementAuthorization(ctx);
|
|
1147
1176
|
if (authError) return authError;
|
|
@@ -1165,7 +1194,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1165
1194
|
const result = await sendAdaptiveCardMSTeams({
|
|
1166
1195
|
cfg: ctx.cfg,
|
|
1167
1196
|
to,
|
|
1168
|
-
card
|
|
1197
|
+
card,
|
|
1198
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
1199
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
1169
1200
|
});
|
|
1170
1201
|
return jsonActionResultWithDetails({
|
|
1171
1202
|
ok: true,
|
|
@@ -1197,7 +1228,9 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1197
1228
|
filename: readOptionalTrimmedString(ctx.params, "filename") ?? readOptionalTrimmedString(ctx.params, "title"),
|
|
1198
1229
|
mediaAccess: ctx.mediaAccess,
|
|
1199
1230
|
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
1200
|
-
mediaReadFile: ctx.mediaReadFile
|
|
1231
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
1232
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
1233
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
1201
1234
|
});
|
|
1202
1235
|
return jsonActionResultWithDetails({
|
|
1203
1236
|
ok: true,
|
|
@@ -1249,10 +1282,14 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1249
1282
|
}
|
|
1250
1283
|
});
|
|
1251
1284
|
const graphActionTarget = {
|
|
1252
|
-
toolParams: ctx.
|
|
1285
|
+
toolParams: ctx.action === "search" || ctx.action === "member-info" ? {
|
|
1286
|
+
...ctx.params,
|
|
1287
|
+
to: resolveActionTarget(ctx.params) || (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.params.channelId)
|
|
1288
|
+
} : ctx.params,
|
|
1253
1289
|
currentChannelId: ctx.toolContext?.currentChannelId,
|
|
1254
1290
|
currentGraphChannelId: resolveCurrentGraphActionTarget(ctx.toolContext),
|
|
1255
1291
|
currentChatType: ctx.toolContext?.currentChatType,
|
|
1292
|
+
currentMessageId: ctx.toolContext?.currentMessageId,
|
|
1256
1293
|
graphOnly: true
|
|
1257
1294
|
};
|
|
1258
1295
|
if (ctx.action === "read") return await runWithRequiredActionMessageTarget({
|
|
@@ -1309,6 +1346,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1309
1346
|
if (ctx.action === "react") return await runWithRequiredActionMessageTarget({
|
|
1310
1347
|
actionLabel: "React",
|
|
1311
1348
|
...graphActionTarget,
|
|
1349
|
+
allowCurrentMessageIdFallback: true,
|
|
1312
1350
|
run: async (target) => {
|
|
1313
1351
|
const emoji = typeof ctx.params.emoji === "string" ? ctx.params.emoji.trim() : "";
|
|
1314
1352
|
const remove = typeof ctx.params.remove === "boolean" ? ctx.params.remove : false;
|
|
@@ -1352,6 +1390,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1352
1390
|
if (ctx.action === "reactions") return await runWithRequiredActionMessageTarget({
|
|
1353
1391
|
actionLabel: "Reactions",
|
|
1354
1392
|
...graphActionTarget,
|
|
1393
|
+
allowCurrentMessageIdFallback: true,
|
|
1355
1394
|
run: async (target) => {
|
|
1356
1395
|
const to = await authorizeActionTarget(target.to);
|
|
1357
1396
|
const { listReactionsMSTeams } = await loadMSTeamsChannelRuntime();
|
|
@@ -1369,7 +1408,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1369
1408
|
const allowedTarget = await authorizeActionTarget(to);
|
|
1370
1409
|
const query = resolveActionQuery(ctx.params);
|
|
1371
1410
|
if (!query) return actionError("Search requires a target (to) and query.");
|
|
1372
|
-
const limit =
|
|
1411
|
+
const limit = (0, openclaw_plugin_sdk_channel_actions.readPositiveIntegerParam)(ctx.params, "limit");
|
|
1373
1412
|
const from = typeof ctx.params.from === "string" ? ctx.params.from.trim() : void 0;
|
|
1374
1413
|
const { searchMessagesMSTeams } = await loadMSTeamsChannelRuntime();
|
|
1375
1414
|
return jsonMSTeamsOkActionResult("search", await searchMessagesMSTeams({
|
|
@@ -1484,7 +1523,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1484
1523
|
});
|
|
1485
1524
|
}
|
|
1486
1525
|
return null;
|
|
1487
|
-
}
|
|
1526
|
+
})
|
|
1488
1527
|
},
|
|
1489
1528
|
status: (0, openclaw_plugin_sdk_status_helpers.createComputedAccountStatusAdapter)({
|
|
1490
1529
|
defaultRuntime: (0, openclaw_plugin_sdk_channel_status.createDefaultChannelRuntimeState)(openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID, { port: null }),
|
|
@@ -1525,7 +1564,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1525
1564
|
})
|
|
1526
1565
|
}),
|
|
1527
1566
|
gateway: { startAccount: async (ctx) => {
|
|
1528
|
-
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-
|
|
1567
|
+
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-BfOCwlHp.cjs"));
|
|
1529
1568
|
const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
|
|
1530
1569
|
const statusSink = (0, openclaw_plugin_sdk_channel_outbound.createAccountStatusSink)({
|
|
1531
1570
|
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-BDp16XRR.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-CYN_N7O1.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,41 +692,52 @@ 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
|
-
sendPoll: async ({ cfg, to, poll, threadId }) => {
|
|
731
|
+
sendPoll: async ({ cfg, to, poll, threadId, assertDirectAdapterHandoff, onPlatformSendDispatch }) => {
|
|
707
732
|
const maxSelections = poll.maxSelections ?? 1;
|
|
708
733
|
const result = await require_send.sendPollMSTeams({
|
|
709
734
|
cfg,
|
|
710
735
|
to: resolveMSTeamsThreadTarget(to, threadId),
|
|
711
736
|
question: poll.question,
|
|
712
737
|
options: poll.options,
|
|
713
|
-
maxSelections
|
|
738
|
+
maxSelections,
|
|
739
|
+
assertDirectAdapterHandoff,
|
|
740
|
+
onPlatformSendDispatch
|
|
714
741
|
});
|
|
715
742
|
await require_polls.createMSTeamsPollStoreState().createPoll({
|
|
716
743
|
id: result.pollId,
|
|
@@ -785,7 +812,7 @@ async function probeMSTeams(cfg) {
|
|
|
785
812
|
}
|
|
786
813
|
let delegatedAuth;
|
|
787
814
|
if (cfg?.delegatedAuth?.enabled) try {
|
|
788
|
-
const tokens = require_resolve_allowlist.loadDelegatedTokens();
|
|
815
|
+
const tokens = await require_resolve_allowlist.loadDelegatedTokens();
|
|
789
816
|
if (tokens) {
|
|
790
817
|
const isExpired = !(0, openclaw_plugin_sdk_number_runtime.isFutureDateTimestampMs)(tokens.expiresAt);
|
|
791
818
|
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
|
}
|