@openclaw/msteams 2026.5.2 → 2026.5.3-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.
- package/dist/api.js +3 -0
- package/dist/channel-D7hdreTh.js +984 -0
- package/dist/channel-config-api.js +2 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.runtime-BC1ruIfN.js +573 -0
- package/dist/config-schema-B8QezH6t.js +15 -0
- package/dist/contract-api.js +2 -0
- package/dist/graph-users-9uQJepqr.js +1354 -0
- package/dist/index.js +22 -0
- package/dist/oauth-BWJyilR1.js +114 -0
- package/dist/oauth.token-xxpoLWy5.js +115 -0
- package/dist/policy-DTnU2GR7.js +142 -0
- package/dist/probe-D_H8yFps.js +2194 -0
- package/dist/resolve-allowlist-D41JSziq.js +219 -0
- package/dist/runtime-api-DV1iVMn1.js +28 -0
- package/dist/runtime-api.js +2 -0
- package/dist/secret-contract-BuoEXmPS.js +35 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/setup-entry.js +15 -0
- package/dist/setup-plugin-api.js +64 -0
- package/dist/setup-surface-BLkFQYIQ.js +313 -0
- package/dist/src-CFp1QpFd.js +4064 -0
- package/dist/test-api.js +2 -0
- package/package.json +14 -6
- package/api.ts +0 -3
- package/channel-config-api.ts +0 -1
- package/channel-plugin-api.ts +0 -2
- package/config-api.ts +0 -4
- package/contract-api.ts +0 -4
- package/index.ts +0 -20
- package/runtime-api.ts +0 -73
- package/secret-contract-api.ts +0 -5
- package/setup-entry.ts +0 -13
- package/setup-plugin-api.ts +0 -3
- package/src/ai-entity.ts +0 -7
- package/src/approval-auth.ts +0 -44
- package/src/attachments/bot-framework.test.ts +0 -461
- package/src/attachments/bot-framework.ts +0 -362
- package/src/attachments/download.ts +0 -311
- package/src/attachments/graph.test.ts +0 -416
- package/src/attachments/graph.ts +0 -484
- package/src/attachments/html.ts +0 -122
- package/src/attachments/payload.ts +0 -14
- package/src/attachments/remote-media.test.ts +0 -137
- package/src/attachments/remote-media.ts +0 -112
- package/src/attachments/shared.test.ts +0 -530
- package/src/attachments/shared.ts +0 -626
- package/src/attachments/types.ts +0 -47
- package/src/attachments.graph.test.ts +0 -342
- package/src/attachments.helpers.test.ts +0 -246
- package/src/attachments.test-helpers.ts +0 -17
- package/src/attachments.test.ts +0 -687
- package/src/attachments.ts +0 -18
- package/src/block-streaming-config.test.ts +0 -61
- package/src/channel-api.ts +0 -1
- package/src/channel.actions.test.ts +0 -742
- package/src/channel.directory.test.ts +0 -200
- package/src/channel.runtime.ts +0 -56
- package/src/channel.setup.ts +0 -77
- package/src/channel.test.ts +0 -128
- package/src/channel.ts +0 -1136
- package/src/config-schema.ts +0 -6
- package/src/config-ui-hints.ts +0 -12
- package/src/conversation-store-fs.test.ts +0 -74
- package/src/conversation-store-fs.ts +0 -149
- package/src/conversation-store-helpers.test.ts +0 -202
- package/src/conversation-store-helpers.ts +0 -105
- package/src/conversation-store-memory.ts +0 -51
- package/src/conversation-store.shared.test.ts +0 -225
- package/src/conversation-store.ts +0 -71
- package/src/directory-live.test.ts +0 -156
- package/src/directory-live.ts +0 -111
- package/src/doctor.ts +0 -27
- package/src/errors.test.ts +0 -133
- package/src/errors.ts +0 -246
- package/src/feedback-reflection-prompt.ts +0 -117
- package/src/feedback-reflection-store.ts +0 -114
- package/src/feedback-reflection.test.ts +0 -237
- package/src/feedback-reflection.ts +0 -283
- package/src/file-consent-helpers.test.ts +0 -326
- package/src/file-consent-helpers.ts +0 -126
- package/src/file-consent-invoke.ts +0 -150
- package/src/file-consent.test.ts +0 -363
- package/src/file-consent.ts +0 -287
- package/src/graph-chat.ts +0 -55
- package/src/graph-group-management.test.ts +0 -318
- package/src/graph-group-management.ts +0 -168
- package/src/graph-members.test.ts +0 -89
- package/src/graph-members.ts +0 -48
- package/src/graph-messages.actions.test.ts +0 -243
- package/src/graph-messages.read.test.ts +0 -391
- package/src/graph-messages.search.test.ts +0 -213
- package/src/graph-messages.test-helpers.ts +0 -50
- package/src/graph-messages.ts +0 -534
- package/src/graph-teams.test.ts +0 -215
- package/src/graph-teams.ts +0 -114
- package/src/graph-thread.test.ts +0 -246
- package/src/graph-thread.ts +0 -146
- package/src/graph-upload.test.ts +0 -258
- package/src/graph-upload.ts +0 -531
- package/src/graph-users.ts +0 -29
- package/src/graph.test.ts +0 -516
- package/src/graph.ts +0 -293
- package/src/inbound.test.ts +0 -221
- package/src/inbound.ts +0 -148
- package/src/index.ts +0 -4
- package/src/media-helpers.test.ts +0 -202
- package/src/media-helpers.ts +0 -105
- package/src/mentions.test.ts +0 -244
- package/src/mentions.ts +0 -114
- package/src/messenger.test.ts +0 -865
- package/src/messenger.ts +0 -605
- package/src/monitor-handler/access.ts +0 -125
- package/src/monitor-handler/inbound-media.test.ts +0 -289
- package/src/monitor-handler/inbound-media.ts +0 -180
- package/src/monitor-handler/message-handler-mock-support.test-support.ts +0 -28
- package/src/monitor-handler/message-handler.authz.test.ts +0 -669
- package/src/monitor-handler/message-handler.dm-media.test.ts +0 -54
- package/src/monitor-handler/message-handler.test-support.ts +0 -100
- package/src/monitor-handler/message-handler.thread-parent.test.ts +0 -223
- package/src/monitor-handler/message-handler.thread-session.test.ts +0 -77
- package/src/monitor-handler/message-handler.ts +0 -1000
- package/src/monitor-handler/reaction-handler.test.ts +0 -267
- package/src/monitor-handler/reaction-handler.ts +0 -210
- package/src/monitor-handler/thread-session.ts +0 -17
- package/src/monitor-handler.adaptive-card.test.ts +0 -162
- package/src/monitor-handler.feedback-authz.test.ts +0 -314
- package/src/monitor-handler.file-consent.test.ts +0 -423
- package/src/monitor-handler.sso.test.ts +0 -563
- package/src/monitor-handler.test-helpers.ts +0 -180
- package/src/monitor-handler.ts +0 -534
- package/src/monitor-handler.types.ts +0 -27
- package/src/monitor-types.ts +0 -6
- package/src/monitor.lifecycle.test.ts +0 -278
- package/src/monitor.test.ts +0 -119
- package/src/monitor.ts +0 -442
- package/src/oauth.flow.ts +0 -77
- package/src/oauth.shared.ts +0 -37
- package/src/oauth.test.ts +0 -305
- package/src/oauth.token.ts +0 -158
- package/src/oauth.ts +0 -130
- package/src/outbound.test.ts +0 -130
- package/src/outbound.ts +0 -71
- package/src/pending-uploads-fs.test.ts +0 -246
- package/src/pending-uploads-fs.ts +0 -235
- package/src/pending-uploads.test.ts +0 -173
- package/src/pending-uploads.ts +0 -121
- package/src/policy.test.ts +0 -240
- package/src/policy.ts +0 -262
- package/src/polls-store-memory.ts +0 -32
- package/src/polls.test.ts +0 -160
- package/src/polls.ts +0 -323
- package/src/presentation.ts +0 -68
- package/src/probe.test.ts +0 -77
- package/src/probe.ts +0 -132
- package/src/reply-dispatcher.test.ts +0 -437
- package/src/reply-dispatcher.ts +0 -346
- package/src/reply-stream-controller.test.ts +0 -235
- package/src/reply-stream-controller.ts +0 -147
- package/src/resolve-allowlist.test.ts +0 -250
- package/src/resolve-allowlist.ts +0 -309
- package/src/revoked-context.ts +0 -17
- package/src/runtime.ts +0 -9
- package/src/sdk-types.ts +0 -59
- package/src/sdk.test.ts +0 -666
- package/src/sdk.ts +0 -884
- package/src/secret-contract.ts +0 -49
- package/src/secret-input.ts +0 -7
- package/src/send-context.ts +0 -231
- package/src/send.test.ts +0 -493
- package/src/send.ts +0 -637
- package/src/sent-message-cache.test.ts +0 -15
- package/src/sent-message-cache.ts +0 -56
- package/src/session-route.ts +0 -40
- package/src/setup-core.ts +0 -160
- package/src/setup-surface.test.ts +0 -202
- package/src/setup-surface.ts +0 -320
- package/src/sso-token-store.test.ts +0 -72
- package/src/sso-token-store.ts +0 -166
- package/src/sso.ts +0 -300
- package/src/storage.ts +0 -25
- package/src/store-fs.ts +0 -44
- package/src/streaming-message.test.ts +0 -262
- package/src/streaming-message.ts +0 -297
- package/src/test-runtime.ts +0 -16
- package/src/thread-parent-context.test.ts +0 -224
- package/src/thread-parent-context.ts +0 -159
- package/src/token-response.ts +0 -11
- package/src/token.test.ts +0 -259
- package/src/token.ts +0 -195
- package/src/user-agent.test.ts +0 -86
- package/src/user-agent.ts +0 -53
- package/src/webhook-timeouts.ts +0 -27
- package/src/welcome-card.test.ts +0 -81
- package/src/welcome-card.ts +0 -57
- package/test-api.ts +0 -1
- package/tsconfig.json +0 -16
package/src/secret-contract.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
collectSecretInputAssignment,
|
|
3
|
-
getChannelRecord,
|
|
4
|
-
type ResolverContext,
|
|
5
|
-
type SecretDefaults,
|
|
6
|
-
} from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
7
|
-
|
|
8
|
-
export const secretTargetRegistryEntries: import("openclaw/plugin-sdk/channel-secret-basic-runtime").SecretTargetRegistryEntry[] =
|
|
9
|
-
[
|
|
10
|
-
{
|
|
11
|
-
id: "channels.msteams.appPassword",
|
|
12
|
-
targetType: "channels.msteams.appPassword",
|
|
13
|
-
configFile: "openclaw.json",
|
|
14
|
-
pathPattern: "channels.msteams.appPassword",
|
|
15
|
-
secretShape: "secret_input",
|
|
16
|
-
expectedResolvedValue: "string",
|
|
17
|
-
includeInPlan: true,
|
|
18
|
-
includeInConfigure: true,
|
|
19
|
-
includeInAudit: true,
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export function collectRuntimeConfigAssignments(params: {
|
|
24
|
-
config: { channels?: Record<string, unknown> };
|
|
25
|
-
defaults?: SecretDefaults;
|
|
26
|
-
context: ResolverContext;
|
|
27
|
-
}): void {
|
|
28
|
-
const msteams = getChannelRecord(params.config, "msteams");
|
|
29
|
-
if (!msteams) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
collectSecretInputAssignment({
|
|
33
|
-
value: msteams.appPassword,
|
|
34
|
-
path: "channels.msteams.appPassword",
|
|
35
|
-
expected: "string",
|
|
36
|
-
defaults: params.defaults,
|
|
37
|
-
context: params.context,
|
|
38
|
-
active: msteams.enabled !== false,
|
|
39
|
-
inactiveReason: "Microsoft Teams channel is disabled.",
|
|
40
|
-
apply: (value) => {
|
|
41
|
-
msteams.appPassword = value;
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const channelSecrets = {
|
|
47
|
-
secretTargetRegistryEntries,
|
|
48
|
-
collectRuntimeConfigAssignments,
|
|
49
|
-
};
|
package/src/secret-input.ts
DELETED
package/src/send-context.ts
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
|
2
|
-
import {
|
|
3
|
-
resolveChannelMediaMaxBytes,
|
|
4
|
-
type OpenClawConfig,
|
|
5
|
-
type PluginRuntime,
|
|
6
|
-
} from "../runtime-api.js";
|
|
7
|
-
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
|
8
|
-
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
|
9
|
-
import type {
|
|
10
|
-
MSTeamsConversationStore,
|
|
11
|
-
StoredConversationReference,
|
|
12
|
-
} from "./conversation-store.js";
|
|
13
|
-
import { formatUnknownError } from "./errors.js";
|
|
14
|
-
import { resolveGraphChatId } from "./graph-upload.js";
|
|
15
|
-
import type { MSTeamsAdapter } from "./messenger.js";
|
|
16
|
-
import { getMSTeamsRuntime } from "./runtime.js";
|
|
17
|
-
import { createMSTeamsAdapter, createMSTeamsTokenProvider, loadMSTeamsSdkWithAuth } from "./sdk.js";
|
|
18
|
-
import { resolveMSTeamsCredentials } from "./token.js";
|
|
19
|
-
|
|
20
|
-
type MSTeamsConversationType = "personal" | "groupChat" | "channel";
|
|
21
|
-
|
|
22
|
-
export type MSTeamsProactiveContext = {
|
|
23
|
-
appId: string;
|
|
24
|
-
conversationId: string;
|
|
25
|
-
ref: StoredConversationReference;
|
|
26
|
-
adapter: MSTeamsAdapter;
|
|
27
|
-
log: ReturnType<PluginRuntime["logging"]["getChildLogger"]>;
|
|
28
|
-
/** The type of conversation: personal (1:1), groupChat, or channel */
|
|
29
|
-
conversationType: MSTeamsConversationType;
|
|
30
|
-
/** Token provider for Graph API / OneDrive operations */
|
|
31
|
-
tokenProvider: MSTeamsAccessTokenProvider;
|
|
32
|
-
/** SharePoint site ID for file uploads in group chats/channels */
|
|
33
|
-
sharePointSiteId?: string;
|
|
34
|
-
/** Resolved media max bytes from config (default: 100MB) */
|
|
35
|
-
mediaMaxBytes?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Graph API-native chat ID for this conversation.
|
|
38
|
-
* Bot Framework personal DM IDs (`a:1xxx` / `8:orgid:xxx`) cannot be used directly
|
|
39
|
-
* with Graph chat endpoints. This field holds the resolved `19:xxx` format ID.
|
|
40
|
-
* Null if resolution failed or not applicable.
|
|
41
|
-
*/
|
|
42
|
-
graphChatId?: string | null;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Parse the target value into a conversation reference lookup key.
|
|
47
|
-
* Supported formats:
|
|
48
|
-
* - conversation:19:abc@thread.tacv2 → lookup by conversation ID
|
|
49
|
-
* - user:aad-object-id → lookup by user AAD object ID
|
|
50
|
-
* - 19:abc@thread.tacv2 → direct conversation ID
|
|
51
|
-
*/
|
|
52
|
-
function parseRecipient(to: string): {
|
|
53
|
-
type: "conversation" | "user";
|
|
54
|
-
id: string;
|
|
55
|
-
} {
|
|
56
|
-
const trimmed = to.trim();
|
|
57
|
-
const finalize = (type: "conversation" | "user", id: string) => {
|
|
58
|
-
const normalized = id.trim();
|
|
59
|
-
if (!normalized) {
|
|
60
|
-
throw new Error(`Invalid target value: missing ${type} id`);
|
|
61
|
-
}
|
|
62
|
-
return { type, id: normalized };
|
|
63
|
-
};
|
|
64
|
-
if (trimmed.startsWith("conversation:")) {
|
|
65
|
-
return finalize("conversation", trimmed.slice("conversation:".length));
|
|
66
|
-
}
|
|
67
|
-
if (trimmed.startsWith("user:")) {
|
|
68
|
-
return finalize("user", trimmed.slice("user:".length));
|
|
69
|
-
}
|
|
70
|
-
// Assume it's a conversation ID if it looks like one
|
|
71
|
-
if (trimmed.startsWith("19:") || trimmed.includes("@thread")) {
|
|
72
|
-
return finalize("conversation", trimmed);
|
|
73
|
-
}
|
|
74
|
-
// Otherwise treat as user ID
|
|
75
|
-
return finalize("user", trimmed);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Find a stored conversation reference for the given recipient.
|
|
80
|
-
*/
|
|
81
|
-
async function findConversationReference(recipient: {
|
|
82
|
-
type: "conversation" | "user";
|
|
83
|
-
id: string;
|
|
84
|
-
store: MSTeamsConversationStore;
|
|
85
|
-
}): Promise<{
|
|
86
|
-
conversationId: string;
|
|
87
|
-
ref: StoredConversationReference;
|
|
88
|
-
} | null> {
|
|
89
|
-
if (recipient.type === "conversation") {
|
|
90
|
-
const ref = await recipient.store.get(recipient.id);
|
|
91
|
-
if (ref) {
|
|
92
|
-
return { conversationId: recipient.id, ref };
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const found = await recipient.store.findPreferredDmByUserId(recipient.id);
|
|
98
|
-
if (!found) {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
return { conversationId: found.conversationId, ref: found.reference };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export async function resolveMSTeamsSendContext(params: {
|
|
105
|
-
cfg: OpenClawConfig;
|
|
106
|
-
to: string;
|
|
107
|
-
}): Promise<MSTeamsProactiveContext> {
|
|
108
|
-
const msteamsCfg = params.cfg.channels?.msteams;
|
|
109
|
-
|
|
110
|
-
if (!msteamsCfg?.enabled) {
|
|
111
|
-
throw new Error("msteams provider is not enabled");
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const creds = resolveMSTeamsCredentials(msteamsCfg);
|
|
115
|
-
if (!creds) {
|
|
116
|
-
throw new Error("msteams credentials not configured");
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const store = createMSTeamsConversationStoreFs();
|
|
120
|
-
|
|
121
|
-
// Parse recipient and find conversation reference
|
|
122
|
-
const recipient = parseRecipient(params.to);
|
|
123
|
-
const found = await findConversationReference({ ...recipient, store });
|
|
124
|
-
|
|
125
|
-
if (!found) {
|
|
126
|
-
throw new Error(
|
|
127
|
-
`No conversation reference found for ${recipient.type}:${recipient.id}. ` +
|
|
128
|
-
`The bot must receive a message from this conversation before it can send proactively.`,
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const { conversationId, ref } = found;
|
|
133
|
-
|
|
134
|
-
// Safety check: when the caller targeted a specific user (DM), verify the
|
|
135
|
-
// resolved conversation is actually a personal DM. Without this guard a
|
|
136
|
-
// stale or mismatched conversation store could route a private DM reply
|
|
137
|
-
// into a shared channel or group chat -- see #54520.
|
|
138
|
-
if (recipient.type === "user") {
|
|
139
|
-
const resolvedType = normalizeLowercaseStringOrEmpty(ref.conversation?.conversationType ?? "");
|
|
140
|
-
if (resolvedType && resolvedType !== "personal") {
|
|
141
|
-
throw new Error(
|
|
142
|
-
`Conversation reference for user:${recipient.id} resolved to a ${resolvedType} ` +
|
|
143
|
-
`conversation (${conversationId}) instead of a personal DM. ` +
|
|
144
|
-
`The bot must receive a DM from this user before it can send proactively.`,
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const core = getMSTeamsRuntime();
|
|
149
|
-
const log = core.logging.getChildLogger({ name: "msteams:send" });
|
|
150
|
-
|
|
151
|
-
const { sdk, app } = await loadMSTeamsSdkWithAuth(creds);
|
|
152
|
-
const adapter = createMSTeamsAdapter(app, sdk);
|
|
153
|
-
|
|
154
|
-
// Create token provider adapter for Graph API / OneDrive operations
|
|
155
|
-
const tokenProvider: MSTeamsAccessTokenProvider = createMSTeamsTokenProvider(app);
|
|
156
|
-
|
|
157
|
-
// Determine conversation type from stored reference
|
|
158
|
-
const storedConversationType = normalizeLowercaseStringOrEmpty(
|
|
159
|
-
ref.conversation?.conversationType ?? "",
|
|
160
|
-
);
|
|
161
|
-
let conversationType: MSTeamsConversationType;
|
|
162
|
-
if (storedConversationType === "personal") {
|
|
163
|
-
conversationType = "personal";
|
|
164
|
-
} else if (storedConversationType === "channel") {
|
|
165
|
-
conversationType = "channel";
|
|
166
|
-
} else {
|
|
167
|
-
// groupChat, or unknown defaults to groupChat behavior
|
|
168
|
-
conversationType = "groupChat";
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Get SharePoint site ID from config (required for file uploads in group chats/channels)
|
|
172
|
-
const sharePointSiteId = msteamsCfg.sharePointSiteId;
|
|
173
|
-
|
|
174
|
-
// Resolve media max bytes from config
|
|
175
|
-
const mediaMaxBytes = resolveChannelMediaMaxBytes({
|
|
176
|
-
cfg: params.cfg,
|
|
177
|
-
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb,
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// Resolve Graph API-native chat ID if needed for SharePoint per-user sharing.
|
|
181
|
-
// Bot Framework personal DM conversation IDs (e.g. `a:1xxx` or `8:orgid:xxx`) cannot
|
|
182
|
-
// be used directly with Graph /chats/{chatId} endpoints — the Graph API requires the
|
|
183
|
-
// `19:xxx@thread.tacv2` or `19:xxx@unq.gbl.spaces` format.
|
|
184
|
-
// We check the cached value first, then resolve via Graph API and cache for future sends.
|
|
185
|
-
let graphChatId: string | null | undefined = ref.graphChatId ?? undefined;
|
|
186
|
-
if (graphChatId === undefined && sharePointSiteId) {
|
|
187
|
-
// Only resolve when SharePoint is configured (the only place chatId matters currently)
|
|
188
|
-
try {
|
|
189
|
-
const resolved = await resolveGraphChatId({
|
|
190
|
-
botFrameworkConversationId: conversationId,
|
|
191
|
-
userAadObjectId: ref.user?.aadObjectId,
|
|
192
|
-
tokenProvider,
|
|
193
|
-
});
|
|
194
|
-
graphChatId = resolved;
|
|
195
|
-
|
|
196
|
-
// Cache in the conversation store so subsequent sends skip the Graph lookup.
|
|
197
|
-
// NOTE: We intentionally do NOT cache null results. Transient Graph API failures
|
|
198
|
-
// (network, 401, rate limit) should be retried on subsequent sends rather than
|
|
199
|
-
// permanently blocking file uploads for this conversation.
|
|
200
|
-
if (resolved) {
|
|
201
|
-
await store.upsert(conversationId, { ...ref, graphChatId: resolved });
|
|
202
|
-
} else {
|
|
203
|
-
log.warn?.("could not resolve Graph chat ID; file uploads may fail for this conversation", {
|
|
204
|
-
conversationId,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
} catch (err) {
|
|
208
|
-
log.warn?.(
|
|
209
|
-
"failed to resolve Graph chat ID; file uploads may fall back to Bot Framework ID",
|
|
210
|
-
{
|
|
211
|
-
conversationId,
|
|
212
|
-
error: formatUnknownError(err),
|
|
213
|
-
},
|
|
214
|
-
);
|
|
215
|
-
graphChatId = null;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return {
|
|
220
|
-
appId: creds.appId,
|
|
221
|
-
conversationId,
|
|
222
|
-
ref,
|
|
223
|
-
adapter: adapter as unknown as MSTeamsAdapter,
|
|
224
|
-
log,
|
|
225
|
-
conversationType,
|
|
226
|
-
tokenProvider,
|
|
227
|
-
sharePointSiteId,
|
|
228
|
-
mediaMaxBytes,
|
|
229
|
-
graphChatId,
|
|
230
|
-
};
|
|
231
|
-
}
|