refactor: trim msteams helper exports · openclaw/openclaw@3f002b1
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,12 +34,12 @@ type InlineImageLimitOptions = {
|
34 | 34 | maxInlineTotalBytes?: number; |
35 | 35 | }; |
36 | 36 | |
37 | | -export const IMAGE_EXT_RE = /\.(avif|bmp|gif|heic|heif|jpe?g|png|tiff?|webp)$/i; |
| 37 | +const IMAGE_EXT_RE = /\.(avif|bmp|gif|heic|heif|jpe?g|png|tiff?|webp)$/i; |
38 | 38 | |
39 | 39 | export const IMG_SRC_RE = /<img[^>]+src=["']([^"']+)["'][^>]*>/gi; |
40 | 40 | export const ATTACHMENT_TAG_RE = /<attachment[^>]+id=["']([^"']+)["'][^>]*>/gi; |
41 | 41 | |
42 | | -export const DEFAULT_MEDIA_HOST_ALLOWLIST = [ |
| 42 | +const DEFAULT_MEDIA_HOST_ALLOWLIST = [ |
43 | 43 | "graph.microsoft.com", |
44 | 44 | "graph.microsoft.us", |
45 | 45 | "graph.microsoft.de", |
@@ -67,7 +67,7 @@ export const DEFAULT_MEDIA_HOST_ALLOWLIST = [
|
67 | 67 | "microsoft.com", |
68 | 68 | ] as const; |
69 | 69 | |
70 | | -export const DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST = [ |
| 70 | +const DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST = [ |
71 | 71 | "api.botframework.com", |
72 | 72 | "botframework.com", |
73 | 73 | // Bot Framework Service URL (smba.trafficmanager.net) used for outbound |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -149,9 +149,9 @@ function extractRetryAfterMs(err: unknown): number | null {
|
149 | 149 | return null; |
150 | 150 | } |
151 | 151 | |
152 | | -export type MSTeamsSendErrorKind = "auth" | "throttled" | "transient" | "permanent" | "unknown"; |
| 152 | +type MSTeamsSendErrorKind = "auth" | "throttled" | "transient" | "permanent" | "unknown"; |
153 | 153 | |
154 | | -export type MSTeamsSendErrorClassification = { |
| 154 | +type MSTeamsSendErrorClassification = { |
155 | 155 | kind: MSTeamsSendErrorKind; |
156 | 156 | statusCode?: number; |
157 | 157 | retryAfterMs?: number; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/text-runti
|
3 | 3 | /** Max chars of the thumbed-down response to include in the reflection prompt. */ |
4 | 4 | const MAX_RESPONSE_CHARS = 500; |
5 | 5 | |
6 | | -export type ParsedReflectionResponse = { |
| 6 | +type ParsedReflectionResponse = { |
7 | 7 | learning: string; |
8 | 8 | followUp: boolean; |
9 | 9 | userMessage?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,7 @@ import { buildConversationReference } from "./messenger.js";
|
31 | 31 | import type { MSTeamsMonitorLogger } from "./monitor-types.js"; |
32 | 32 | import { getMSTeamsRuntime } from "./runtime.js"; |
33 | 33 | |
34 | | -export type FeedbackEvent = { |
| 34 | +type FeedbackEvent = { |
35 | 35 | type: "custom"; |
36 | 36 | event: "feedback"; |
37 | 37 | ts: number; |
@@ -65,7 +65,7 @@ export function buildFeedbackEvent(params: {
|
65 | 65 | }; |
66 | 66 | } |
67 | 67 | |
68 | | -export type RunFeedbackReflectionParams = { |
| 68 | +type RunFeedbackReflectionParams = { |
69 | 69 | cfg: OpenClawConfig; |
70 | 70 | adapter: MSTeamsAdapter; |
71 | 71 | appId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,13 +14,13 @@ import { buildFileConsentCard } from "./file-consent.js";
|
14 | 14 | import { storePendingUploadFs } from "./pending-uploads-fs.js"; |
15 | 15 | import { storePendingUpload } from "./pending-uploads.js"; |
16 | 16 | |
17 | | -export type FileConsentMedia = { |
| 17 | +type FileConsentMedia = { |
18 | 18 | buffer: Buffer; |
19 | 19 | filename: string; |
20 | 20 | contentType?: string; |
21 | 21 | }; |
22 | 22 | |
23 | | -export type FileConsentActivityResult = { |
| 23 | +type FileConsentActivityResult = { |
24 | 24 | activity: Record<string, unknown>; |
25 | 25 | uploadId: string; |
26 | 26 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import type { MSTeamsTurnContext } from "./sdk-types.js";
|
10 | 10 | /** |
11 | 11 | * Handle fileConsent/invoke activities for large file uploads. |
12 | 12 | */ |
13 | | -export async function handleMSTeamsFileConsentInvoke( |
| 13 | +async function handleMSTeamsFileConsentInvoke( |
14 | 14 | context: MSTeamsTurnContext, |
15 | 15 | log: MSTeamsMonitorLogger, |
16 | 16 | ): Promise<boolean> { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -159,15 +159,15 @@ export async function validateConsentUploadUrl(
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | | -export interface FileConsentCardParams { |
| 162 | +interface FileConsentCardParams { |
163 | 163 | filename: string; |
164 | 164 | description?: string; |
165 | 165 | sizeInBytes: number; |
166 | 166 | /** Custom context data to include in the card (passed back in the invoke) */ |
167 | 167 | context?: Record<string, unknown>; |
168 | 168 | } |
169 | 169 | |
170 | | -export interface FileInfoCardParams { |
| 170 | +interface FileInfoCardParams { |
171 | 171 | filename: string; |
172 | 172 | contentUrl: string; |
173 | 173 | uniqueId: string; |
@@ -207,15 +207,15 @@ export function buildFileInfoCard(params: FileInfoCardParams) {
|
207 | 207 | }; |
208 | 208 | } |
209 | 209 | |
210 | | -export interface FileConsentUploadInfo { |
| 210 | +interface FileConsentUploadInfo { |
211 | 211 | name: string; |
212 | 212 | uploadUrl: string; |
213 | 213 | contentUrl: string; |
214 | 214 | uniqueId: string; |
215 | 215 | fileType: string; |
216 | 216 | } |
217 | 217 | |
218 | | -export interface FileConsentResponse { |
| 218 | +interface FileConsentResponse { |
219 | 219 | action: "accept" | "decline"; |
220 | 220 | uploadInfo?: FileConsentUploadInfo; |
221 | 221 | context?: Record<string, unknown>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,14 +13,14 @@ import {
|
13 | 13 | // Add Participant |
14 | 14 | // --------------------------------------------------------------------------- |
15 | 15 | |
16 | | -export type AddParticipantMSTeamsParams = { |
| 16 | +type AddParticipantMSTeamsParams = { |
17 | 17 | cfg: OpenClawConfig; |
18 | 18 | to: string; |
19 | 19 | userId: string; |
20 | 20 | role?: string; |
21 | 21 | }; |
22 | 22 | |
23 | | -export type AddParticipantMSTeamsResult = { |
| 23 | +type AddParticipantMSTeamsResult = { |
24 | 24 | added: { userId: string; chatId: string }; |
25 | 25 | }; |
26 | 26 | |
@@ -66,13 +66,13 @@ export async function addParticipantMSTeams(
|
66 | 66 | // Remove Participant |
67 | 67 | // --------------------------------------------------------------------------- |
68 | 68 | |
69 | | -export type RemoveParticipantMSTeamsParams = { |
| 69 | +type RemoveParticipantMSTeamsParams = { |
70 | 70 | cfg: OpenClawConfig; |
71 | 71 | to: string; |
72 | 72 | userId: string; |
73 | 73 | }; |
74 | 74 | |
75 | | -export type RemoveParticipantMSTeamsResult = { |
| 75 | +type RemoveParticipantMSTeamsResult = { |
76 | 76 | removed: { userId: string; chatId: string }; |
77 | 77 | }; |
78 | 78 | |
@@ -136,13 +136,13 @@ export async function removeParticipantMSTeams(
|
136 | 136 | // Rename Group |
137 | 137 | // --------------------------------------------------------------------------- |
138 | 138 | |
139 | | -export type RenameGroupMSTeamsParams = { |
| 139 | +type RenameGroupMSTeamsParams = { |
140 | 140 | cfg: OpenClawConfig; |
141 | 141 | to: string; |
142 | 142 | name: string; |
143 | 143 | }; |
144 | 144 | |
145 | | -export type RenameGroupMSTeamsResult = { |
| 145 | +type RenameGroupMSTeamsResult = { |
146 | 146 | renamed: { chatId: string; newName: string }; |
147 | 147 | }; |
148 | 148 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,12 +10,12 @@ type GraphUserProfile = {
|
10 | 10 | officeLocation?: string; |
11 | 11 | }; |
12 | 12 | |
13 | | -export type GetMemberInfoMSTeamsParams = { |
| 13 | +type GetMemberInfoMSTeamsParams = { |
14 | 14 | cfg: OpenClawConfig; |
15 | 15 | userId: string; |
16 | 16 | }; |
17 | 17 | |
18 | | -export type GetMemberInfoMSTeamsResult = { |
| 18 | +type GetMemberInfoMSTeamsResult = { |
19 | 19 | user: { |
20 | 20 | id: string | undefined; |
21 | 21 | displayName: string | undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ import { type GraphResponse, fetchGraphJson, resolveGraphToken } from "./graph.j
|
5 | 5 | // Types |
6 | 6 | // --------------------------------------------------------------------------- |
7 | 7 | |
8 | | -export type GraphTeamsChannel = { |
| 8 | +type GraphTeamsChannel = { |
9 | 9 | id?: string; |
10 | 10 | displayName?: string; |
11 | 11 | description?: string; |
@@ -14,12 +14,12 @@ export type GraphTeamsChannel = {
|
14 | 14 | createdDateTime?: string; |
15 | 15 | }; |
16 | 16 | |
17 | | -export type ListChannelsMSTeamsParams = { |
| 17 | +type ListChannelsMSTeamsParams = { |
18 | 18 | cfg: OpenClawConfig; |
19 | 19 | teamId: string; |
20 | 20 | }; |
21 | 21 | |
22 | | -export type ListChannelsMSTeamsResult = { |
| 22 | +type ListChannelsMSTeamsResult = { |
23 | 23 | channels: Array<{ |
24 | 24 | id: string | undefined; |
25 | 25 | displayName: string | undefined; |
@@ -29,13 +29,13 @@ export type ListChannelsMSTeamsResult = {
|
29 | 29 | truncated?: boolean; |
30 | 30 | }; |
31 | 31 | |
32 | | -export type GetChannelInfoMSTeamsParams = { |
| 32 | +type GetChannelInfoMSTeamsParams = { |
33 | 33 | cfg: OpenClawConfig; |
34 | 34 | teamId: string; |
35 | 35 | channelId: string; |
36 | 36 | }; |
37 | 37 | |
38 | | -export type GetChannelInfoMSTeamsResult = { |
| 38 | +type GetChannelInfoMSTeamsResult = { |
39 | 39 | channel: { |
40 | 40 | id: string | undefined; |
41 | 41 | displayName: string | undefined; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。