@openclaw/msteams 2026.10.5-beta.4 → 2026.10.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/.setup/{adapter.runtime-JoPydWqP.cjs → adapter.runtime-B-6Q3nMI.cjs} +6 -4
  2. package/dist/.setup/{approval-handler.runtime-bUN9icMr.cjs → approval-handler.runtime-DccVf5AY.cjs} +16 -6
  3. package/dist/.setup/{bot-framework-service-url-CPp4d-Q6.cjs → bot-framework-service-url-B3FWn2SV.cjs} +13 -0
  4. package/dist/.setup/{channel-Cifn9fsv.cjs → channel-B7Gy3QUW.cjs} +261 -175
  5. package/dist/.setup/{channel.runtime-DWRAolil.cjs → channel.runtime-DzKeQAqd.cjs} +84 -49
  6. package/dist/.setup/channel.setup-B5ClEcNI.cjs +990 -0
  7. package/dist/.setup/config-schema-CkKdphSp.cjs +293 -0
  8. package/dist/.setup/{conversation-store-state-DprmOfl7.cjs → conversation-store-state-C3__T9mK.cjs} +79 -91
  9. package/dist/.setup/delegated-state-Bv5cWuec.cjs +110 -0
  10. package/dist/.setup/{monitor-C9x_CJhY.cjs → monitor-CzRI-Hsc.cjs} +283 -240
  11. package/dist/.setup/{oauth-CWJ85AMw.cjs → oauth-D9u8sPCD.cjs} +1 -1
  12. package/dist/.setup/{reaction-types-Ig9sQJuR.cjs → reaction-types-DSQWVA4Z.cjs} +15 -9
  13. package/dist/.setup/{resolve-allowlist-DdDBVCzl.cjs → resolve-allowlist-tYgAHx0t.cjs} +252 -38
  14. package/dist/.setup/{secret-contract-api-ChQdBeU1.cjs → secret-contract-api-YY3v6MP8.cjs} +1 -1
  15. package/dist/.setup/secret-contract-api-wAyY5UHv.cjs +85 -0
  16. package/dist/.setup/{send-rJpcVtRp.cjs → send-Bgm8RYUa.cjs} +45 -24
  17. package/dist/.setup/{setup-plugin-api-DfoVOqMJ.cjs → setup-plugin-api-BACfeF7_.cjs} +1 -1
  18. package/dist/.setup/{thread-session-B74FC1Id.cjs → thread-session-C7KTMwLU.cjs} +11 -4
  19. package/dist/.setup/token-config-bEpua_Q7.cjs +93 -0
  20. package/dist/api.cjs +2 -2
  21. package/dist/channel-config-api.cjs +1 -1
  22. package/dist/channel-plugin-api.cjs +1 -1
  23. package/dist/directory-contract-api.cjs +30 -22
  24. package/dist/doctor-contract-api.cjs +11 -10
  25. package/dist/qa-runner-api.cjs +1 -1
  26. package/dist/runtime-api.cjs +2 -2
  27. package/dist/secret-contract-api.cjs +1 -1
  28. package/dist/setup-entry.cjs +2 -2
  29. package/dist/setup-plugin-api.cjs +1 -1
  30. package/openclaw.plugin.json +715 -0
  31. package/package.json +57 -6
  32. package/dist/.setup/channel.setup-BjbHugkL.cjs +0 -632
  33. package/dist/.setup/config-schema-Dk0mRIam.cjs +0 -160
  34. package/dist/.setup/secret-contract-api-ipiUsANg.cjs +0 -28
  35. package/dist/.setup/token-config-CqIh8z7Q.cjs +0 -138
@@ -2,11 +2,11 @@ const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.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");
5
+ let node_crypto = require("node:crypto");
5
6
  let node_path = require("node:path");
6
7
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
7
8
  let node_fs_promises = require("node:fs/promises");
8
9
  node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
9
- let node_crypto = require("node:crypto");
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");
@@ -127,7 +127,7 @@ async function waitForMSTeamsChannelReady(gateway, timeoutMs = 6e4, pollInterval
127
127
  }, { timeoutMs: 5e3 })).channelAccounts?.msteams ?? [];
128
128
  lastAccounts = accounts;
129
129
  const account = accounts.find((entry) => entry.accountId === DEFAULT_ACCOUNT_ID);
130
- if (account?.running === true && account.restartPending !== true) return;
130
+ if (account?.running === true && account.lifecycle === "ready" && account.connected === true && account.restartPending !== true) return;
131
131
  await (0, node_timers_promises.setTimeout)(pollIntervalMs);
132
132
  }
133
133
  throw new Error(`msteams did not become ready; last accounts: ${JSON.stringify(lastAccounts)}`);
@@ -262,8 +262,7 @@ async function createMSTeamsQaTransportAdapter(context) {
262
262
  conversationKindByNativeId.clear();
263
263
  logicalConversationByNativeId.clear();
264
264
  },
265
- createGatewayConfig: ({ baseUrl }) => {
266
- webhookUrl = new URL("/api/messages", baseUrl).toString();
265
+ createGatewayConfig: () => {
267
266
  return { channels: { msteams: {
268
267
  enabled: true,
269
268
  appId: APP_ID,
@@ -283,6 +282,9 @@ async function createMSTeamsQaTransportAdapter(context) {
283
282
  NODE_OPTIONS: [process.env.NODE_OPTIONS?.trim(), `--import=${bootstrapUrl}`].filter(Boolean).join(" ")
284
283
  }),
285
284
  createRuntimePreloads: () => [bootstrapUrl],
285
+ prepareFlow: async ({ gateway }) => {
286
+ webhookUrl = new URL("/api/messages", gateway.baseUrl).toString();
287
+ },
286
288
  waitReady: ({ gateway, timeoutMs, pollIntervalMs }) => waitForMSTeamsChannelReady(gateway, timeoutMs, pollIntervalMs),
287
289
  buildAgentDelivery: ({ target }) => ({
288
290
  channel: "msteams",
@@ -1,13 +1,13 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-DdDBVCzl.cjs");
2
- const require_channel = require("./channel-Cifn9fsv.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-tYgAHx0t.cjs");
2
+ const require_channel = require("./channel-B7Gy3QUW.cjs");
3
3
  const require_approval_card = require("./approval-card-DWPDItvq.cjs");
4
- const require_send = require("./send-rJpcVtRp.cjs");
4
+ const require_send = require("./send-Bgm8RYUa.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
  //#region extensions/msteams/src/approval-handler.runtime.ts
9
9
  const log = (0, require("openclaw/plugin-sdk/runtime-env").createSubsystemLogger)("msteams/approvals");
10
- const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_runtime.createChannelApprovalNativeRuntimeAdapter)({
10
+ const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_runtime.createChannelApprovalNativeRuntimeAdapterAsync)({
11
11
  eventKinds: [
12
12
  "exec",
13
13
  "plugin",
@@ -54,14 +54,19 @@ const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_ru
54
54
  };
55
55
  },
56
56
  deliverPending: async ({ cfg, accountId, preparedTarget, pendingPayload }) => {
57
+ const deliveryAccountId = (0, openclaw_plugin_sdk_approval_handler_runtime.resolvePreparedApprovalAccountId)({
58
+ contextAccountId: accountId,
59
+ fallbackAccountId: openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID
60
+ });
57
61
  const sent = await require_send.sendAdaptiveCardMSTeams({
58
62
  cfg,
63
+ accountId: deliveryAccountId,
59
64
  to: preparedTarget.to,
60
65
  card: pendingPayload.card
61
66
  });
62
67
  if (!sent.messageId || sent.messageId === "unknown" || !sent.conversationId) return null;
63
68
  return {
64
- accountId: accountId ?? openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID,
69
+ accountId: deliveryAccountId,
65
70
  conversationId: sent.conversationId,
66
71
  activityId: sent.messageId,
67
72
  actionTokens: pendingPayload.actionTokens
@@ -70,6 +75,7 @@ const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_ru
70
75
  updateEntry: async ({ cfg, entry, payload }) => {
71
76
  await require_send.editAdaptiveCardMSTeams({
72
77
  cfg,
78
+ accountId: entry.accountId,
73
79
  to: entry.conversationId,
74
80
  activityId: entry.activityId,
75
81
  card: payload
@@ -95,11 +101,15 @@ const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_ru
95
101
  unbindPending: ({ binding }) => require_approval_card.msTeamsApprovalControls.unregister(binding),
96
102
  cancelDelivered: ({ entry }) => require_approval_card.msTeamsApprovalControls.unregister(entry.actionTokens.map(({ token }) => token))
97
103
  },
98
- observe: { onDeliveryError: ({ cfg, error, plannedTarget, request, approvalKind, pendingPayload }) => {
104
+ observe: { onDeliveryError: ({ cfg, accountId, error, plannedTarget, request, approvalKind, pendingPayload }) => {
99
105
  log.error(`msteams approvals: failed to deliver request ${request.id}: ${String(error)}`);
100
106
  const decisions = pendingPayload.allowedDecisions.join("|");
101
107
  require_send.sendMessageMSTeams({
102
108
  cfg,
109
+ accountId: (0, openclaw_plugin_sdk_approval_handler_runtime.resolvePreparedApprovalAccountId)({
110
+ contextAccountId: accountId,
111
+ fallbackAccountId: openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID
112
+ }),
103
113
  to: plannedTarget.target.to,
104
114
  text: `⚠️ Could not deliver the ${approvalKind} approval card for ${request.id}. Reply "/approve ${request.id} <${decisions}>" to resolve it.`
105
115
  }).catch((fallbackError) => {
@@ -1,4 +1,11 @@
1
+ let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
1
2
  let openclaw_plugin_sdk_ssrf_policy = require("openclaw/plugin-sdk/ssrf-policy");
3
+ //#region extensions/msteams/src/accounts-webhook.ts
4
+ function resolveMSTeamsWebhookPath(channelConfig, accountId, account) {
5
+ const rootPath = channelConfig?.webhook?.path?.trim() || "/api/messages";
6
+ return account?.webhook?.path?.trim() || (accountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID ? rootPath : `${rootPath.replace(/\/+$/u, "")}/${accountId}`);
7
+ }
8
+ //#endregion
2
9
  //#region extensions/msteams/src/bot-framework-service-url.ts
3
10
  const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = (0, openclaw_plugin_sdk_ssrf_policy.normalizeHostnameSuffixAllowlist)([
4
11
  "smba.trafficmanager.net",
@@ -43,6 +50,12 @@ Object.defineProperty(exports, "normalizeBotFrameworkServiceUrl", {
43
50
  return normalizeBotFrameworkServiceUrl;
44
51
  }
45
52
  });
53
+ Object.defineProperty(exports, "resolveMSTeamsWebhookPath", {
54
+ enumerable: true,
55
+ get: function() {
56
+ return resolveMSTeamsWebhookPath;
57
+ }
58
+ });
46
59
  Object.defineProperty(exports, "tryNormalizeBotFrameworkServiceUrl", {
47
60
  enumerable: true,
48
61
  get: function() {