@openclaw/msteams 2026.3.13 → 2026.5.1-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/api.ts +3 -0
- package/channel-config-api.ts +1 -0
- package/channel-plugin-api.ts +2 -0
- package/config-api.ts +4 -0
- package/contract-api.ts +4 -0
- package/index.ts +15 -12
- package/openclaw.plugin.json +553 -1
- package/package.json +46 -12
- package/runtime-api.ts +73 -0
- package/secret-contract-api.ts +5 -0
- package/setup-entry.ts +13 -0
- package/setup-plugin-api.ts +3 -0
- package/src/ai-entity.ts +7 -0
- package/src/approval-auth.ts +44 -0
- package/src/attachments/bot-framework.test.ts +461 -0
- package/src/attachments/bot-framework.ts +362 -0
- package/src/attachments/download.ts +63 -19
- package/src/attachments/graph.test.ts +416 -0
- package/src/attachments/graph.ts +163 -72
- package/src/attachments/html.ts +33 -1
- package/src/attachments/payload.ts +1 -1
- package/src/attachments/remote-media.test.ts +137 -0
- package/src/attachments/remote-media.ts +75 -8
- package/src/attachments/shared.test.ts +138 -1
- package/src/attachments/shared.ts +193 -26
- package/src/attachments/types.ts +10 -0
- package/src/attachments.graph.test.ts +342 -0
- package/src/attachments.helpers.test.ts +246 -0
- package/src/attachments.test-helpers.ts +17 -0
- package/src/attachments.test.ts +163 -418
- package/src/attachments.ts +5 -5
- package/src/block-streaming-config.test.ts +61 -0
- package/src/channel-api.ts +1 -0
- package/src/channel.actions.test.ts +742 -0
- package/src/channel.directory.test.ts +145 -4
- package/src/channel.runtime.ts +56 -0
- package/src/channel.setup.ts +77 -0
- package/src/channel.test.ts +128 -0
- package/src/channel.ts +1077 -395
- package/src/config-schema.ts +6 -0
- package/src/config-ui-hints.ts +12 -0
- package/src/conversation-store-fs.test.ts +4 -5
- package/src/conversation-store-fs.ts +35 -51
- package/src/conversation-store-helpers.test.ts +202 -0
- package/src/conversation-store-helpers.ts +105 -0
- package/src/conversation-store-memory.ts +27 -23
- package/src/conversation-store.shared.test.ts +225 -0
- package/src/conversation-store.ts +30 -0
- package/src/directory-live.test.ts +156 -0
- package/src/directory-live.ts +7 -4
- package/src/doctor.ts +27 -0
- package/src/errors.test.ts +64 -1
- package/src/errors.ts +50 -9
- package/src/feedback-reflection-prompt.ts +117 -0
- package/src/feedback-reflection-store.ts +114 -0
- package/src/feedback-reflection.test.ts +237 -0
- package/src/feedback-reflection.ts +283 -0
- package/src/file-consent-helpers.test.ts +83 -0
- package/src/file-consent-helpers.ts +64 -11
- package/src/file-consent-invoke.ts +150 -0
- package/src/file-consent.test.ts +363 -0
- package/src/file-consent.ts +165 -4
- package/src/graph-chat.ts +5 -3
- package/src/graph-group-management.test.ts +318 -0
- package/src/graph-group-management.ts +168 -0
- package/src/graph-members.test.ts +89 -0
- package/src/graph-members.ts +48 -0
- package/src/graph-messages.actions.test.ts +243 -0
- package/src/graph-messages.read.test.ts +391 -0
- package/src/graph-messages.search.test.ts +213 -0
- package/src/graph-messages.test-helpers.ts +50 -0
- package/src/graph-messages.ts +534 -0
- package/src/graph-teams.test.ts +215 -0
- package/src/graph-teams.ts +114 -0
- package/src/graph-thread.test.ts +246 -0
- package/src/graph-thread.ts +146 -0
- package/src/graph-upload.test.ts +161 -4
- package/src/graph-upload.ts +147 -56
- package/src/graph.test.ts +516 -0
- package/src/graph.ts +233 -21
- package/src/inbound.test.ts +156 -1
- package/src/inbound.ts +101 -1
- package/src/media-helpers.ts +1 -1
- package/src/mentions.test.ts +27 -18
- package/src/mentions.ts +2 -2
- package/src/messenger.test.ts +504 -23
- package/src/messenger.ts +133 -52
- package/src/monitor-handler/access.ts +125 -0
- package/src/monitor-handler/inbound-media.test.ts +289 -0
- package/src/monitor-handler/inbound-media.ts +57 -5
- package/src/monitor-handler/message-handler-mock-support.test-support.ts +28 -0
- package/src/monitor-handler/message-handler.authz.test.ts +588 -74
- package/src/monitor-handler/message-handler.dm-media.test.ts +54 -0
- package/src/monitor-handler/message-handler.test-support.ts +100 -0
- package/src/monitor-handler/message-handler.thread-parent.test.ts +223 -0
- package/src/monitor-handler/message-handler.thread-session.test.ts +77 -0
- package/src/monitor-handler/message-handler.ts +470 -164
- package/src/monitor-handler/reaction-handler.test.ts +267 -0
- package/src/monitor-handler/reaction-handler.ts +210 -0
- package/src/monitor-handler/thread-session.ts +17 -0
- package/src/monitor-handler.adaptive-card.test.ts +162 -0
- package/src/monitor-handler.feedback-authz.test.ts +314 -0
- package/src/monitor-handler.file-consent.test.ts +281 -79
- package/src/monitor-handler.sso.test.ts +563 -0
- package/src/monitor-handler.test-helpers.ts +180 -0
- package/src/monitor-handler.ts +459 -115
- package/src/monitor-handler.types.ts +27 -0
- package/src/monitor-types.ts +1 -0
- package/src/monitor.lifecycle.test.ts +74 -10
- package/src/monitor.test.ts +35 -1
- package/src/monitor.ts +143 -46
- package/src/oauth.flow.ts +77 -0
- package/src/oauth.shared.ts +37 -0
- package/src/oauth.test.ts +305 -0
- package/src/oauth.token.ts +158 -0
- package/src/oauth.ts +130 -0
- package/src/outbound.test.ts +10 -11
- package/src/outbound.ts +62 -44
- package/src/pending-uploads-fs.test.ts +246 -0
- package/src/pending-uploads-fs.ts +235 -0
- package/src/pending-uploads.test.ts +173 -0
- package/src/pending-uploads.ts +34 -2
- package/src/policy.test.ts +11 -5
- package/src/policy.ts +5 -5
- package/src/polls.test.ts +106 -5
- package/src/polls.ts +15 -7
- package/src/presentation.ts +68 -0
- package/src/probe.test.ts +27 -8
- package/src/probe.ts +43 -9
- package/src/reply-dispatcher.test.ts +437 -0
- package/src/reply-dispatcher.ts +259 -73
- package/src/reply-stream-controller.test.ts +235 -0
- package/src/reply-stream-controller.ts +147 -0
- package/src/resolve-allowlist.test.ts +105 -1
- package/src/resolve-allowlist.ts +112 -7
- package/src/runtime.ts +6 -3
- package/src/sdk-types.ts +43 -3
- package/src/sdk.test.ts +666 -0
- package/src/sdk.ts +867 -16
- package/src/secret-contract.ts +49 -0
- package/src/secret-input.ts +1 -1
- package/src/send-context.ts +76 -9
- package/src/send.test.ts +389 -5
- package/src/send.ts +140 -32
- package/src/sent-message-cache.ts +30 -18
- package/src/session-route.ts +40 -0
- package/src/setup-core.ts +160 -0
- package/src/setup-surface.test.ts +202 -0
- package/src/setup-surface.ts +320 -0
- package/src/sso-token-store.test.ts +72 -0
- package/src/sso-token-store.ts +166 -0
- package/src/sso.ts +300 -0
- package/src/storage.ts +1 -1
- package/src/store-fs.ts +2 -2
- package/src/streaming-message.test.ts +262 -0
- package/src/streaming-message.ts +297 -0
- package/src/test-runtime.ts +1 -1
- package/src/thread-parent-context.test.ts +224 -0
- package/src/thread-parent-context.ts +159 -0
- package/src/token.test.ts +237 -50
- package/src/token.ts +162 -7
- package/src/user-agent.test.ts +86 -0
- package/src/user-agent.ts +53 -0
- package/src/webhook-timeouts.ts +27 -0
- package/src/welcome-card.test.ts +81 -0
- package/src/welcome-card.ts +57 -0
- package/test-api.ts +1 -0
- package/tsconfig.json +16 -0
- package/CHANGELOG.md +0 -107
- package/src/file-lock.ts +0 -1
- package/src/graph-users.test.ts +0 -66
- package/src/onboarding.ts +0 -381
- package/src/polls-store.test.ts +0 -38
- package/src/revoked-context.test.ts +0 -39
- package/src/token-response.test.ts +0 -23
package/package.json
CHANGED
|
@@ -1,37 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/msteams",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.5.1-beta.1",
|
|
4
4
|
"description": "OpenClaw Microsoft Teams channel plugin",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/openclaw/openclaw"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"dependencies": {
|
|
7
|
-
"@
|
|
8
|
-
"
|
|
11
|
+
"@azure/identity": "4.13.1",
|
|
12
|
+
"@microsoft/teams.api": "2.0.9",
|
|
13
|
+
"@microsoft/teams.apps": "2.0.9",
|
|
14
|
+
"express": "5.2.1",
|
|
15
|
+
"jsonwebtoken": "9.0.3",
|
|
16
|
+
"jwks-rsa": "4.0.1",
|
|
17
|
+
"typebox": "1.1.37"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@openclaw/plugin-sdk": "workspace:*",
|
|
21
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
22
|
+
"openclaw": "workspace:*"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"openclaw": ">=2026.4.25"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"openclaw": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
9
31
|
},
|
|
10
32
|
"openclaw": {
|
|
11
33
|
"extensions": [
|
|
12
34
|
"./index.ts"
|
|
13
35
|
],
|
|
36
|
+
"setupEntry": "./setup-entry.ts",
|
|
14
37
|
"channel": {
|
|
15
38
|
"id": "msteams",
|
|
16
39
|
"label": "Microsoft Teams",
|
|
17
|
-
"selectionLabel": "Microsoft Teams (
|
|
40
|
+
"selectionLabel": "Microsoft Teams (Teams SDK)",
|
|
18
41
|
"docsPath": "/channels/msteams",
|
|
19
42
|
"docsLabel": "msteams",
|
|
20
|
-
"blurb": "
|
|
43
|
+
"blurb": "Teams SDK; enterprise support.",
|
|
21
44
|
"aliases": [
|
|
22
45
|
"teams"
|
|
23
46
|
],
|
|
24
|
-
"order": 60
|
|
47
|
+
"order": 60,
|
|
48
|
+
"doctorCapabilities": {
|
|
49
|
+
"dmAllowFromMode": "topOnly",
|
|
50
|
+
"groupModel": "hybrid",
|
|
51
|
+
"groupAllowFromFallbackToAllowFrom": false,
|
|
52
|
+
"warnOnEmptyGroupSenderAllowlist": true
|
|
53
|
+
}
|
|
25
54
|
},
|
|
26
55
|
"install": {
|
|
27
56
|
"npmSpec": "@openclaw/msteams",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
57
|
+
"defaultChoice": "npm",
|
|
58
|
+
"minHostVersion": ">=2026.4.10"
|
|
59
|
+
},
|
|
60
|
+
"compat": {
|
|
61
|
+
"pluginApi": ">=2026.4.25"
|
|
62
|
+
},
|
|
63
|
+
"build": {
|
|
64
|
+
"openclawVersion": "2026.5.1-beta.1"
|
|
30
65
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
]
|
|
66
|
+
"release": {
|
|
67
|
+
"publishToClawHub": true,
|
|
68
|
+
"publishToNpm": true
|
|
35
69
|
}
|
|
36
70
|
}
|
|
37
71
|
}
|
package/runtime-api.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Private runtime barrel for the bundled Microsoft Teams extension.
|
|
2
|
+
// Keep this barrel thin and aligned with the local extension surface.
|
|
3
|
+
|
|
4
|
+
export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
5
|
+
export type { AllowlistMatch } from "openclaw/plugin-sdk/allow-from";
|
|
6
|
+
export {
|
|
7
|
+
mergeAllowlist,
|
|
8
|
+
resolveAllowlistMatchSimple,
|
|
9
|
+
summarizeMapping,
|
|
10
|
+
} from "openclaw/plugin-sdk/allow-from";
|
|
11
|
+
export type {
|
|
12
|
+
BaseProbeResult,
|
|
13
|
+
ChannelDirectoryEntry,
|
|
14
|
+
ChannelGroupContext,
|
|
15
|
+
ChannelMessageActionName,
|
|
16
|
+
ChannelOutboundAdapter,
|
|
17
|
+
} from "openclaw/plugin-sdk/channel-contract";
|
|
18
|
+
export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
19
|
+
export { logTypingFailure } from "openclaw/plugin-sdk/channel-logging";
|
|
20
|
+
export { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
21
|
+
export {
|
|
22
|
+
evaluateSenderGroupAccessForPolicy,
|
|
23
|
+
readStoreAllowFromForDmPolicy,
|
|
24
|
+
resolveDmGroupAccessWithLists,
|
|
25
|
+
resolveEffectiveAllowFromLists,
|
|
26
|
+
resolveSenderScopedGroupPolicy,
|
|
27
|
+
resolveToolsBySender,
|
|
28
|
+
} from "openclaw/plugin-sdk/channel-policy";
|
|
29
|
+
export { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pipeline";
|
|
30
|
+
export {
|
|
31
|
+
PAIRING_APPROVED_MESSAGE,
|
|
32
|
+
buildProbeChannelStatusSummary,
|
|
33
|
+
createDefaultChannelRuntimeState,
|
|
34
|
+
} from "openclaw/plugin-sdk/channel-status";
|
|
35
|
+
export {
|
|
36
|
+
buildChannelKeyCandidates,
|
|
37
|
+
normalizeChannelSlug,
|
|
38
|
+
resolveChannelEntryMatchWithFallback,
|
|
39
|
+
resolveNestedAllowlistDecision,
|
|
40
|
+
} from "openclaw/plugin-sdk/channel-targets";
|
|
41
|
+
export type {
|
|
42
|
+
GroupPolicy,
|
|
43
|
+
GroupToolPolicyConfig,
|
|
44
|
+
MSTeamsChannelConfig,
|
|
45
|
+
MSTeamsConfig,
|
|
46
|
+
MSTeamsReplyStyle,
|
|
47
|
+
MSTeamsTeamConfig,
|
|
48
|
+
MarkdownTableMode,
|
|
49
|
+
OpenClawConfig,
|
|
50
|
+
} from "openclaw/plugin-sdk/config-types";
|
|
51
|
+
export { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
52
|
+
export { resolveDefaultGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
53
|
+
export { withFileLock } from "openclaw/plugin-sdk/file-lock";
|
|
54
|
+
export { keepHttpServerTaskAlive } from "openclaw/plugin-sdk/channel-lifecycle";
|
|
55
|
+
export {
|
|
56
|
+
detectMime,
|
|
57
|
+
extensionForMime,
|
|
58
|
+
extractOriginalFilename,
|
|
59
|
+
getFileExtension,
|
|
60
|
+
resolveChannelMediaMaxBytes,
|
|
61
|
+
} from "openclaw/plugin-sdk/media-runtime";
|
|
62
|
+
export { dispatchReplyFromConfigWithSettledDispatcher } from "openclaw/plugin-sdk/inbound-reply-dispatch";
|
|
63
|
+
export { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
64
|
+
export { buildMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
65
|
+
export type { ReplyPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
66
|
+
export type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
|
|
67
|
+
export type { RuntimeEnv } from "openclaw/plugin-sdk/runtime";
|
|
68
|
+
export type { SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
69
|
+
export { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
70
|
+
export { normalizeStringEntries } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
71
|
+
export { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
72
|
+
export { DEFAULT_WEBHOOK_MAX_BODY_BYTES } from "openclaw/plugin-sdk/webhook-ingress";
|
|
73
|
+
export { setMSTeamsRuntime } from "./src/runtime.js";
|
package/setup-entry.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
|
|
3
|
+
export default defineBundledChannelSetupEntry({
|
|
4
|
+
importMetaUrl: import.meta.url,
|
|
5
|
+
plugin: {
|
|
6
|
+
specifier: "./setup-plugin-api.js",
|
|
7
|
+
exportName: "msteamsSetupPlugin",
|
|
8
|
+
},
|
|
9
|
+
secrets: {
|
|
10
|
+
specifier: "./secret-contract-api.js",
|
|
11
|
+
exportName: "channelSecrets",
|
|
12
|
+
},
|
|
13
|
+
});
|
package/src/ai-entity.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createResolvedApproverActionAuthAdapter,
|
|
3
|
+
resolveApprovalApprovers,
|
|
4
|
+
} from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
5
|
+
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/text-runtime";
|
|
6
|
+
import type { OpenClawConfig } from "../runtime-api.js";
|
|
7
|
+
import { normalizeMSTeamsMessagingTarget } from "./resolve-allowlist.js";
|
|
8
|
+
|
|
9
|
+
const MSTEAMS_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
|
+
|
|
11
|
+
function normalizeMSTeamsApproverId(value: string | number): string | undefined {
|
|
12
|
+
const normalized = normalizeMSTeamsMessagingTarget(String(value));
|
|
13
|
+
if (!normalized?.startsWith("user:")) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const id = normalizeOptionalLowercaseString(normalized.slice("user:".length));
|
|
17
|
+
if (!id) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return MSTEAMS_ID_RE.test(id) ? id : undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function resolveMSTeamsChannelConfig(cfg: OpenClawConfig) {
|
|
24
|
+
return cfg.channels?.msteams;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const msTeamsApprovalAuth = createResolvedApproverActionAuthAdapter({
|
|
28
|
+
channelLabel: "Microsoft Teams",
|
|
29
|
+
resolveApprovers: ({ cfg }) => {
|
|
30
|
+
const channel = resolveMSTeamsChannelConfig(cfg);
|
|
31
|
+
return resolveApprovalApprovers({
|
|
32
|
+
allowFrom: channel?.allowFrom,
|
|
33
|
+
defaultTo: channel?.defaultTo,
|
|
34
|
+
normalizeApprover: normalizeMSTeamsApproverId,
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
normalizeSenderId: (value) => {
|
|
38
|
+
const trimmed = normalizeOptionalLowercaseString(value);
|
|
39
|
+
if (!trimmed) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return MSTEAMS_ID_RE.test(trimmed) ? trimmed : undefined;
|
|
43
|
+
},
|
|
44
|
+
});
|