@openclaw/msteams 2026.10.10-beta.5 → 2026.11.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{adapter.runtime-B-6Q3nMI.cjs → adapter.runtime-UOD_H_ph.cjs} +23 -28
- package/dist/.setup/{approval-card-DWPDItvq.cjs → approval-card-CD5q0Nla.cjs} +7 -13
- package/dist/.setup/{approval-handler.runtime-CGIr9ItR.cjs → approval-handler.runtime-DbPxvynk.cjs} +5 -6
- package/dist/.setup/{bot-framework-service-url-B3FWn2SV.cjs → bot-framework-service-url-CgVuKiIR.cjs} +2 -4
- package/dist/.setup/{channel-Du4L0JEh.cjs → channel-DQrXOfhf.cjs} +43 -263
- package/dist/.setup/{channel.runtime-3-5Ty0Vy.cjs → channel.runtime-Du4GPMES.cjs} +72 -122
- package/dist/.setup/{channel.setup-BN3uhq3r.cjs → channel.setup--7ko_Kxv.cjs} +167 -274
- package/dist/.setup/{config-schema-CkKdphSp.cjs → config-schema-BEXDIOC-.cjs} +121 -127
- package/dist/.setup/{conversation-store-state-B-4g4uq5.cjs → conversation-store-state-AVgRyNE9.cjs} +427 -631
- package/dist/.setup/{delegated-state-Bv5cWuec.cjs → delegated-state-DhIHahf1.cjs} +72 -12
- package/dist/.setup/{monitor-DK0bsDpk.cjs → monitor-CXjIKz7o.cjs} +1907 -2343
- package/dist/.setup/{oauth-BBUQCwmq.cjs → oauth-BWG6qWCd.cjs} +11 -23
- package/dist/.setup/presentation-CaLawc5j.cjs +211 -0
- package/dist/.setup/{reaction-types-CwP5RVQB.cjs → reaction-types-DOzN5oTl.cjs} +3 -5
- package/dist/.setup/{resolve-allowlist-gI34MnpE.cjs → resolve-allowlist-Drj1jaq0.cjs} +230 -122
- package/dist/.setup/{rolldown-runtime-BloeesfJ.cjs → rolldown-runtime-CiKaZLfC.cjs} +1 -2
- package/dist/.setup/{runtime-gZTAuFux.cjs → runtime-CbKazLGv.cjs} +1 -2
- package/dist/.setup/{secret-contract-api-wAyY5UHv.cjs → secret-contract-api-DFqDvc_a.cjs} +5 -8
- package/dist/.setup/{secret-contract-api-YY3v6MP8.cjs → secret-contract-api-YGHrfAT0.cjs} +1 -1
- package/dist/.setup/{send-ZvscULyk.cjs → send-BRUztzVJ.cjs} +90 -188
- package/dist/.setup/{setup-plugin-api-B-NYBLkF.cjs → setup-plugin-api-BHEfter5.cjs} +1 -1
- package/dist/.setup/{thread-session-BWVCoYza.cjs → thread-session-BUUV1zk_.cjs} +6 -10
- package/dist/.setup/{token-config-bEpua_Q7.cjs → token-config-7K6UbNCo.cjs} +1 -4
- package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +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 -2
- package/dist/directory-contract-api.cjs +1 -2
- package/dist/doctor-backup-resources.cjs +2 -3
- package/dist/doctor-contract-api.cjs +13 -26
- package/dist/index.cjs +1 -2
- package/dist/qa-runner-api.cjs +3 -5
- package/dist/runtime-api.cjs +1 -1
- package/dist/secret-contract-api.cjs +1 -1
- package/dist/setup-entry.cjs +3 -4
- package/dist/setup-plugin-api.cjs +1 -1
- package/openclaw.plugin.json +0 -30
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CiKaZLfC.cjs");
|
|
2
2
|
let node_url = require("node:url");
|
|
3
3
|
let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
|
|
4
4
|
let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
|
|
@@ -10,18 +10,14 @@ node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
|
|
|
10
10
|
let node_timers_promises = require("node:timers/promises");
|
|
11
11
|
let node_events = require("node:events");
|
|
12
12
|
let node_http = require("node:http");
|
|
13
|
-
|
|
13
|
+
let node_stream_consumers = require("node:stream/consumers");
|
|
14
|
+
let openclaw_plugin_sdk_http_response_runtime = require("openclaw/plugin-sdk/http-response-runtime");
|
|
15
|
+
// extensions/msteams/src/qa/bot-framework-server.ts
|
|
14
16
|
const AMBIGUOUS_GATEWAY_TIMEOUT_MARKER = "QA-MSTEAMS-AMBIGUOUS-504";
|
|
15
17
|
async function readJson(request) {
|
|
16
|
-
const
|
|
17
|
-
for await (const chunk of request) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
18
|
-
const body = Buffer.concat(chunks).toString("utf8");
|
|
18
|
+
const body = (await (0, node_stream_consumers.buffer)(request)).toString("utf8");
|
|
19
19
|
return body ? JSON.parse(body) : {};
|
|
20
20
|
}
|
|
21
|
-
function sendJson(response, status, body) {
|
|
22
|
-
response.writeHead(status, { "content-type": "application/json" });
|
|
23
|
-
response.end(JSON.stringify(body));
|
|
24
|
-
}
|
|
25
21
|
function parseConversationPath(pathname) {
|
|
26
22
|
const match = /\/v3\/conversations\/([^/]+)\/activities(?:\/[^/]+)?$/u.exec(pathname);
|
|
27
23
|
if (!match) return;
|
|
@@ -38,12 +34,12 @@ async function startMSTeamsQaBotFrameworkServer(options) {
|
|
|
38
34
|
const server = (0, node_http.createServer)((request, response) => {
|
|
39
35
|
(async () => {
|
|
40
36
|
if (request.headers["x-openclaw-msteams-qa-nonce"] !== options.nonce || request.headers.authorization !== `Bearer ${options.botToken}`) {
|
|
41
|
-
|
|
37
|
+
(0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 401, { error: "unauthorized" });
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
44
40
|
const route = parseConversationPath(new URL(request.url ?? "/", "http://127.0.0.1").pathname);
|
|
45
41
|
if (request.method !== "POST" || !route) {
|
|
46
|
-
|
|
42
|
+
(0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 404, { error: "not found" });
|
|
47
43
|
return;
|
|
48
44
|
}
|
|
49
45
|
const activity = await readJson(request);
|
|
@@ -55,9 +51,9 @@ async function startMSTeamsQaBotFrameworkServer(options) {
|
|
|
55
51
|
...route.threadId ? { threadId: route.threadId } : {}
|
|
56
52
|
});
|
|
57
53
|
const acceptedButTimedOut = activity.type === "message" && typeof activity.text === "string" && activity.text.includes(AMBIGUOUS_GATEWAY_TIMEOUT_MARKER);
|
|
58
|
-
|
|
54
|
+
(0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, acceptedButTimedOut ? 504 : 200, acceptedButTimedOut ? { error: "gateway timeout after acceptance" } : { id: activityId });
|
|
59
55
|
})().catch((error) => {
|
|
60
|
-
|
|
56
|
+
(0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 500, { error: (0, openclaw_plugin_sdk_error_runtime.coerceErrorMessage)(error) });
|
|
61
57
|
});
|
|
62
58
|
});
|
|
63
59
|
server.listen(0, "127.0.0.1");
|
|
@@ -71,8 +67,7 @@ async function startMSTeamsQaBotFrameworkServer(options) {
|
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
//#region extensions/msteams/src/qa/adapter.runtime.ts
|
|
70
|
+
// extensions/msteams/src/qa/adapter.runtime.ts
|
|
76
71
|
const SERVICE_URL = "https://smba.trafficmanager.net/qa";
|
|
77
72
|
const APP_ID = "qa-msteams-app";
|
|
78
73
|
const TENANT_ID = "qa-msteams-tenant";
|
|
@@ -140,15 +135,15 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
140
135
|
const bootstrapPath = node_path.default.join(context.outputDir, ".msteams-private-qa-bootstrap.mjs");
|
|
141
136
|
const busByNativeMessageId = /* @__PURE__ */ new Map();
|
|
142
137
|
const nativeByBusMessageId = /* @__PURE__ */ new Map();
|
|
143
|
-
const
|
|
144
|
-
const logicalConversationByNativeId = /* @__PURE__ */ new Map();
|
|
138
|
+
const conversations = /* @__PURE__ */ new Map();
|
|
145
139
|
const requireGroupMention = context.adapterOptions?.transportPolicy?.requireGroupMention === true;
|
|
146
140
|
const connector = await startMSTeamsQaBotFrameworkServer({
|
|
147
141
|
botToken,
|
|
148
142
|
nonce,
|
|
149
143
|
async onOutbound(outbound) {
|
|
150
|
-
const
|
|
151
|
-
const
|
|
144
|
+
const conversation = conversations.get(outbound.conversationId);
|
|
145
|
+
const kind = conversation?.kind ?? "channel";
|
|
146
|
+
const conversationId = conversation?.id ?? outbound.conversationId;
|
|
152
147
|
const message = await context.messages.addOutboundMessage({
|
|
153
148
|
accountId,
|
|
154
149
|
to: `${kind === "direct" ? "dm" : kind}:${conversationId}`,
|
|
@@ -159,7 +154,6 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
159
154
|
});
|
|
160
155
|
nativeByBusMessageId.set(message.id, outbound.activityId);
|
|
161
156
|
busByNativeMessageId.set(outbound.activityId, message.id);
|
|
162
|
-
conversationKindByNativeId.set(outbound.conversationId, kind);
|
|
163
157
|
}
|
|
164
158
|
});
|
|
165
159
|
try {
|
|
@@ -188,10 +182,13 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
188
182
|
requiredPluginIds: ["msteams"],
|
|
189
183
|
supportedActions: [],
|
|
190
184
|
async sendInbound(input) {
|
|
191
|
-
const
|
|
185
|
+
const { id, kind } = input.conversation;
|
|
186
|
+
const conversationId = nativeConversationId(id);
|
|
192
187
|
const nativeThreadId = input.threadId ? nativeByBusMessageId.get(input.threadId) ?? input.threadId : void 0;
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
conversations.set(conversationId, {
|
|
189
|
+
id,
|
|
190
|
+
kind
|
|
191
|
+
});
|
|
195
192
|
const activityId = `qa-inbound-${(0, node_crypto.randomUUID)()}`;
|
|
196
193
|
const activity = {
|
|
197
194
|
id: activityId,
|
|
@@ -211,13 +208,13 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
211
208
|
},
|
|
212
209
|
conversation: {
|
|
213
210
|
id: nativeThreadId ? `${conversationId};messageid=${nativeThreadId}` : conversationId,
|
|
214
|
-
conversationType:
|
|
211
|
+
conversationType: kind === "direct" ? "personal" : kind === "group" ? "groupChat" : "channel",
|
|
215
212
|
tenantId: TENANT_ID
|
|
216
213
|
},
|
|
217
214
|
...input.replyToId ? { replyToId: input.replyToId } : {},
|
|
218
215
|
channelData: {
|
|
219
216
|
tenant: { id: TENANT_ID },
|
|
220
|
-
...
|
|
217
|
+
...kind === "channel" ? {
|
|
221
218
|
team: {
|
|
222
219
|
id: TEAM_ID,
|
|
223
220
|
aadGroupId: TEAM_AAD_GROUP_ID
|
|
@@ -259,8 +256,7 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
259
256
|
resetTransport() {
|
|
260
257
|
busByNativeMessageId.clear();
|
|
261
258
|
nativeByBusMessageId.clear();
|
|
262
|
-
|
|
263
|
-
logicalConversationByNativeId.clear();
|
|
259
|
+
conversations.clear();
|
|
264
260
|
},
|
|
265
261
|
createGatewayConfig: () => {
|
|
266
262
|
return { channels: { msteams: {
|
|
@@ -305,5 +301,4 @@ async function createMSTeamsQaTransportAdapter(context) {
|
|
|
305
301
|
}
|
|
306
302
|
};
|
|
307
303
|
}
|
|
308
|
-
//#endregion
|
|
309
304
|
exports.createMSTeamsQaTransportAdapter = createMSTeamsQaTransportAdapter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
2
2
|
let openclaw_plugin_sdk_approval_runtime = require("openclaw/plugin-sdk/approval-runtime");
|
|
3
|
-
|
|
3
|
+
// extensions/msteams/src/approval-card-actions.ts
|
|
4
4
|
const msTeamsApprovalControls = (0, openclaw_plugin_sdk_approval_runtime.createNativeApprovalControlRegistry)({ releaseClaimOnLookupExpiry: true });
|
|
5
5
|
function readMSTeamsApprovalActionToken(value) {
|
|
6
6
|
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return null;
|
|
@@ -9,8 +9,7 @@ function readMSTeamsApprovalActionToken(value) {
|
|
|
9
9
|
if (submitted.openclawAction !== "approval") return null;
|
|
10
10
|
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(submitted.token) ?? null;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
//#region extensions/msteams/src/approval-card.ts
|
|
12
|
+
// extensions/msteams/src/approval-card.ts
|
|
14
13
|
function formatMSTeamsApprovalKind(kind) {
|
|
15
14
|
return kind === "plugin" ? "Plugin" : kind === "system-agent" ? "OpenClaw Change" : "Exec";
|
|
16
15
|
}
|
|
@@ -124,16 +123,12 @@ function buildMSTeamsPendingApprovalCard(params) {
|
|
|
124
123
|
};
|
|
125
124
|
});
|
|
126
125
|
const remainingSeconds = Math.max(0, Math.ceil((view.expiresAtMs - nowMs) / 1e3));
|
|
127
|
-
const body = [
|
|
128
|
-
...buildCardHeading(`${kindLabel} Approval Required`, `Expires in ${remainingSeconds}s`),
|
|
129
|
-
...buildApprovalSubject(view),
|
|
130
|
-
buildApprovalMetadata(view.approvalId, view.metadata)
|
|
131
|
-
];
|
|
132
126
|
return {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
card: buildAdaptiveCard([
|
|
128
|
+
...buildCardHeading(`${kindLabel} Approval Required`, `Expires in ${remainingSeconds}s`),
|
|
129
|
+
...buildApprovalSubject(view),
|
|
130
|
+
buildApprovalMetadata(view.approvalId, view.metadata)
|
|
131
|
+
], actions),
|
|
137
132
|
actionTokens,
|
|
138
133
|
allowedDecisions: view.actions.map(({ decision }) => decision)
|
|
139
134
|
};
|
|
@@ -199,7 +194,6 @@ function buildMSTeamsCanonicalApprovalTerminalCard(result) {
|
|
|
199
194
|
buildApprovalMetadata(approval.id, metadata)
|
|
200
195
|
]);
|
|
201
196
|
}
|
|
202
|
-
//#endregion
|
|
203
197
|
Object.defineProperty(exports, "buildMSTeamsCanonicalApprovalTerminalCard", {
|
|
204
198
|
enumerable: true,
|
|
205
199
|
get: function() {
|
package/dist/.setup/{approval-handler.runtime-CGIr9ItR.cjs → approval-handler.runtime-DbPxvynk.cjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
2
|
-
const require_channel = require("./channel-
|
|
3
|
-
const require_approval_card = require("./approval-card-
|
|
4
|
-
const require_send = require("./send-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.cjs");
|
|
2
|
+
const require_channel = require("./channel-DQrXOfhf.cjs");
|
|
3
|
+
const require_approval_card = require("./approval-card-CD5q0Nla.cjs");
|
|
4
|
+
const require_send = require("./send-BRUztzVJ.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");
|
|
8
|
-
|
|
8
|
+
// extensions/msteams/src/approval-handler.runtime.ts
|
|
9
9
|
const log = (0, require("openclaw/plugin-sdk/runtime-env").createSubsystemLogger)("msteams/approvals");
|
|
10
10
|
const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_runtime.createChannelApprovalNativeRuntimeAdapterAsync)({
|
|
11
11
|
eventKinds: [
|
|
@@ -117,5 +117,4 @@ const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_ru
|
|
|
117
117
|
});
|
|
118
118
|
} }
|
|
119
119
|
});
|
|
120
|
-
//#endregion
|
|
121
120
|
exports.msTeamsApprovalNativeRuntime = msTeamsApprovalNativeRuntime;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
2
2
|
let openclaw_plugin_sdk_ssrf_policy = require("openclaw/plugin-sdk/ssrf-policy");
|
|
3
|
-
|
|
3
|
+
// extensions/msteams/src/accounts-webhook.ts
|
|
4
4
|
function resolveMSTeamsWebhookPath(channelConfig, accountId, account) {
|
|
5
5
|
const rootPath = channelConfig?.webhook?.path?.trim() || "/api/messages";
|
|
6
6
|
return account?.webhook?.path?.trim() || (accountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID ? rootPath : `${rootPath.replace(/\/+$/u, "")}/${accountId}`);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
//#region extensions/msteams/src/bot-framework-service-url.ts
|
|
8
|
+
// extensions/msteams/src/bot-framework-service-url.ts
|
|
10
9
|
const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = (0, openclaw_plugin_sdk_ssrf_policy.normalizeHostnameSuffixAllowlist)([
|
|
11
10
|
"smba.trafficmanager.net",
|
|
12
11
|
"smba.infra.gcc.teams.microsoft.com",
|
|
@@ -31,7 +30,6 @@ function normalizeBotFrameworkServiceUrl(serviceUrl) {
|
|
|
31
30
|
if (normalized) return normalized;
|
|
32
31
|
throw new Error(`Blocked Microsoft Teams serviceUrl host: ${describeBotFrameworkServiceUrlHost(serviceUrl)}`);
|
|
33
32
|
}
|
|
34
|
-
//#endregion
|
|
35
33
|
Object.defineProperty(exports, "describeBotFrameworkServiceUrlHost", {
|
|
36
34
|
enumerable: true,
|
|
37
35
|
get: function() {
|