@actagent/googlechat 2026.6.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/README.md +11 -0
- package/actagent.plugin.json +17 -0
- package/api.ts +4 -0
- package/channel-config-api.ts +2 -0
- package/channel-plugin-api.ts +2 -0
- package/config-api.ts +3 -0
- package/contract-api.ts +6 -0
- package/directory-contract-api.ts +7 -0
- package/doctor-contract-api.ts +2 -0
- package/index.ts +21 -0
- package/npm-shrinkwrap.json +314 -0
- package/package.json +88 -0
- package/runtime-api.ts +61 -0
- package/secret-contract-api.ts +6 -0
- package/setup-entry.ts +14 -0
- package/setup-plugin-api.ts +3 -0
- package/src/accounts.ts +185 -0
- package/src/actions.test.ts +312 -0
- package/src/actions.ts +228 -0
- package/src/api.ts +346 -0
- package/src/approval-auth.test.ts +25 -0
- package/src/approval-auth.ts +38 -0
- package/src/approval-card-actions.test.ts +113 -0
- package/src/approval-card-actions.ts +307 -0
- package/src/approval-card-click.test.ts +279 -0
- package/src/approval-card-click.ts +94 -0
- package/src/approval-handler.runtime.test.ts +388 -0
- package/src/approval-handler.runtime.ts +413 -0
- package/src/approval-native.test.ts +399 -0
- package/src/approval-native.ts +246 -0
- package/src/auth.ts +219 -0
- package/src/channel-base.ts +123 -0
- package/src/channel-config.test.ts +174 -0
- package/src/channel.adapters.ts +363 -0
- package/src/channel.deps.runtime.ts +30 -0
- package/src/channel.runtime.ts +18 -0
- package/src/channel.setup.ts +7 -0
- package/src/channel.test.ts +845 -0
- package/src/channel.ts +214 -0
- package/src/config-schema.test.ts +32 -0
- package/src/config-schema.ts +4 -0
- package/src/doctor-contract.test.ts +76 -0
- package/src/doctor-contract.ts +181 -0
- package/src/doctor.ts +58 -0
- package/src/gateway.ts +84 -0
- package/src/google-auth.runtime.test.ts +571 -0
- package/src/google-auth.runtime.ts +570 -0
- package/src/group-policy.ts +18 -0
- package/src/monitor-access.test.ts +492 -0
- package/src/monitor-access.ts +466 -0
- package/src/monitor-durable.test.ts +40 -0
- package/src/monitor-durable.ts +24 -0
- package/src/monitor-reply-delivery.ts +162 -0
- package/src/monitor-routing.ts +66 -0
- package/src/monitor-types.ts +34 -0
- package/src/monitor-webhook.test.ts +670 -0
- package/src/monitor-webhook.ts +361 -0
- package/src/monitor.reply-delivery.test.ts +145 -0
- package/src/monitor.test.ts +389 -0
- package/src/monitor.ts +530 -0
- package/src/monitor.webhook-routing.test.ts +258 -0
- package/src/runtime.ts +10 -0
- package/src/secret-contract.test.ts +61 -0
- package/src/secret-contract.ts +162 -0
- package/src/setup-core.ts +41 -0
- package/src/setup-surface.ts +244 -0
- package/src/setup.test.ts +620 -0
- package/src/targets.test.ts +562 -0
- package/src/targets.ts +67 -0
- package/src/types.config.ts +4 -0
- package/src/types.ts +139 -0
- package/test-api.ts +3 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
// Googlechat plugin module implements channel.adapters behavior.
|
|
2
|
+
import { adaptScopedAccountAccessor } from "actagent/plugin-sdk/channel-config-helpers";
|
|
3
|
+
import type {
|
|
4
|
+
ChannelThreadingContext,
|
|
5
|
+
ChannelThreadingToolContext,
|
|
6
|
+
} from "actagent/plugin-sdk/channel-contract";
|
|
7
|
+
import {
|
|
8
|
+
createMessageReceiptFromOutboundResults,
|
|
9
|
+
defineChannelMessageAdapter,
|
|
10
|
+
type MessageReceiptPartKind,
|
|
11
|
+
} from "actagent/plugin-sdk/channel-outbound";
|
|
12
|
+
import { sanitizeForPlainText } from "actagent/plugin-sdk/channel-outbound";
|
|
13
|
+
import {
|
|
14
|
+
composeAccountWarningCollectors,
|
|
15
|
+
createAllowlistProviderOpenWarningCollector,
|
|
16
|
+
} from "actagent/plugin-sdk/channel-policy";
|
|
17
|
+
import {
|
|
18
|
+
createChannelDirectoryAdapter,
|
|
19
|
+
listResolvedDirectoryGroupEntriesFromMapKeys,
|
|
20
|
+
listResolvedDirectoryUserEntriesFromAllowFrom,
|
|
21
|
+
} from "actagent/plugin-sdk/directory-runtime";
|
|
22
|
+
import { createLazyRuntimeNamedExport } from "actagent/plugin-sdk/lazy-runtime";
|
|
23
|
+
import type { OutboundMediaLoadOptions } from "actagent/plugin-sdk/outbound-media";
|
|
24
|
+
import type { ReplyPayload } from "actagent/plugin-sdk/reply-runtime";
|
|
25
|
+
import { normalizeOptionalString } from "actagent/plugin-sdk/string-coerce-runtime";
|
|
26
|
+
import { shouldSuppressGoogleChatManualExecApprovalFollowupPayload } from "./approval-card-actions.js";
|
|
27
|
+
import { formatGoogleChatAllowFromEntry } from "./channel-base.js";
|
|
28
|
+
import {
|
|
29
|
+
type ResolvedGoogleChatAccount,
|
|
30
|
+
chunkTextForOutbound,
|
|
31
|
+
readRemoteMediaBuffer,
|
|
32
|
+
isGoogleChatUserTarget,
|
|
33
|
+
loadOutboundMediaFromUrl,
|
|
34
|
+
missingTargetError,
|
|
35
|
+
normalizeGoogleChatTarget,
|
|
36
|
+
PAIRING_APPROVED_MESSAGE,
|
|
37
|
+
resolveChannelMediaMaxBytes,
|
|
38
|
+
resolveGoogleChatAccount,
|
|
39
|
+
resolveGoogleChatOutboundSpace,
|
|
40
|
+
type ACTAgentConfig,
|
|
41
|
+
} from "./channel.deps.runtime.js";
|
|
42
|
+
import { resolveGoogleChatGroupRequireMention } from "./group-policy.js";
|
|
43
|
+
|
|
44
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(
|
|
45
|
+
() => import("./channel.runtime.js"),
|
|
46
|
+
"googleChatChannelRuntime",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
function createGoogleChatSendReceipt(params: {
|
|
50
|
+
messageId?: string;
|
|
51
|
+
chatId: string;
|
|
52
|
+
kind: MessageReceiptPartKind;
|
|
53
|
+
}) {
|
|
54
|
+
const messageId = params.messageId?.trim();
|
|
55
|
+
return createMessageReceiptFromOutboundResults({
|
|
56
|
+
results: messageId
|
|
57
|
+
? [
|
|
58
|
+
{
|
|
59
|
+
channel: "googlechat",
|
|
60
|
+
messageId,
|
|
61
|
+
chatId: params.chatId,
|
|
62
|
+
conversationId: params.chatId,
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
: [],
|
|
66
|
+
threadId: params.chatId,
|
|
67
|
+
kind: params.kind,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const formatAllowFromEntry = formatGoogleChatAllowFromEntry;
|
|
72
|
+
|
|
73
|
+
const collectGoogleChatGroupPolicyWarnings =
|
|
74
|
+
createAllowlistProviderOpenWarningCollector<ResolvedGoogleChatAccount>({
|
|
75
|
+
providerConfigPresent: (cfg) => cfg.channels?.googlechat !== undefined,
|
|
76
|
+
resolveGroupPolicy: (account) => account.config.groupPolicy,
|
|
77
|
+
buildOpenWarning: {
|
|
78
|
+
surface: "Google Chat spaces",
|
|
79
|
+
openBehavior: "allows any space to trigger (mention-gated)",
|
|
80
|
+
remediation:
|
|
81
|
+
'Set channels.googlechat.groupPolicy="allowlist" and configure channels.googlechat.groups',
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const collectGoogleChatSecurityWarnings = composeAccountWarningCollectors<
|
|
86
|
+
ResolvedGoogleChatAccount,
|
|
87
|
+
{
|
|
88
|
+
cfg: ACTAgentConfig;
|
|
89
|
+
account: ResolvedGoogleChatAccount;
|
|
90
|
+
}
|
|
91
|
+
>(
|
|
92
|
+
collectGoogleChatGroupPolicyWarnings,
|
|
93
|
+
(account) =>
|
|
94
|
+
account.config.dm?.policy === "open" &&
|
|
95
|
+
'- Google Chat DMs are open to anyone. Set channels.googlechat.dm.policy="pairing" or "allowlist".',
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
export const googlechatGroupsAdapter = {
|
|
99
|
+
resolveRequireMention: resolveGoogleChatGroupRequireMention,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const googlechatDirectoryAdapter = createChannelDirectoryAdapter({
|
|
103
|
+
listPeers: async (params) =>
|
|
104
|
+
listResolvedDirectoryUserEntriesFromAllowFrom<ResolvedGoogleChatAccount>({
|
|
105
|
+
...params,
|
|
106
|
+
resolveAccount: adaptScopedAccountAccessor(resolveGoogleChatAccount),
|
|
107
|
+
resolveAllowFrom: (account) => account.config.dm?.allowFrom,
|
|
108
|
+
normalizeId: (entry) => normalizeGoogleChatTarget(entry) ?? entry,
|
|
109
|
+
}),
|
|
110
|
+
listGroups: async (params) =>
|
|
111
|
+
listResolvedDirectoryGroupEntriesFromMapKeys<ResolvedGoogleChatAccount>({
|
|
112
|
+
...params,
|
|
113
|
+
resolveAccount: adaptScopedAccountAccessor(resolveGoogleChatAccount),
|
|
114
|
+
resolveGroups: (account) => account.config.groups,
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export const googlechatSecurityAdapter = {
|
|
119
|
+
dm: {
|
|
120
|
+
channelKey: "googlechat",
|
|
121
|
+
resolvePolicy: (account: ResolvedGoogleChatAccount) => account.config.dm?.policy,
|
|
122
|
+
resolveAllowFrom: (account: ResolvedGoogleChatAccount) => account.config.dm?.allowFrom,
|
|
123
|
+
allowFromPathSuffix: "dm.",
|
|
124
|
+
normalizeEntry: (raw: string) => formatAllowFromEntry(raw),
|
|
125
|
+
},
|
|
126
|
+
collectWarnings: collectGoogleChatSecurityWarnings,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const googlechatThreadingAdapter = {
|
|
130
|
+
scopedAccountReplyToMode: {
|
|
131
|
+
resolveAccount: (cfg: ACTAgentConfig, accountId?: string | null) =>
|
|
132
|
+
resolveGoogleChatAccount({ cfg, accountId }),
|
|
133
|
+
resolveReplyToMode: (account: ResolvedGoogleChatAccount, _chatType?: string | null) =>
|
|
134
|
+
account.config.replyToMode,
|
|
135
|
+
fallback: "off" as const,
|
|
136
|
+
},
|
|
137
|
+
buildToolContext: ({
|
|
138
|
+
cfg,
|
|
139
|
+
accountId,
|
|
140
|
+
context,
|
|
141
|
+
hasRepliedRef,
|
|
142
|
+
}: {
|
|
143
|
+
cfg: ACTAgentConfig;
|
|
144
|
+
accountId?: string | null;
|
|
145
|
+
context: ChannelThreadingContext;
|
|
146
|
+
hasRepliedRef?: { value: boolean };
|
|
147
|
+
}): ChannelThreadingToolContext => {
|
|
148
|
+
const currentChannelId = normalizeGoogleChatTarget(context.To);
|
|
149
|
+
const replyToId =
|
|
150
|
+
normalizeOptionalString(context.ReplyToIdFull) ?? normalizeOptionalString(context.ReplyToId);
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
currentChannelId,
|
|
154
|
+
currentMessageId: replyToId,
|
|
155
|
+
currentThreadTs: replyToId,
|
|
156
|
+
replyToMode: resolveGoogleChatAccount({ cfg, accountId }).config.replyToMode,
|
|
157
|
+
hasRepliedRef,
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const googlechatPairingTextAdapter = {
|
|
163
|
+
idLabel: "googlechatUserId",
|
|
164
|
+
message: PAIRING_APPROVED_MESSAGE,
|
|
165
|
+
normalizeAllowEntry: (entry: string) => formatAllowFromEntry(entry),
|
|
166
|
+
notify: async ({
|
|
167
|
+
cfg,
|
|
168
|
+
id,
|
|
169
|
+
message,
|
|
170
|
+
accountId,
|
|
171
|
+
}: {
|
|
172
|
+
cfg: ACTAgentConfig;
|
|
173
|
+
id: string;
|
|
174
|
+
message: string;
|
|
175
|
+
accountId?: string | null;
|
|
176
|
+
}) => {
|
|
177
|
+
const account = resolveGoogleChatAccount({ cfg, accountId });
|
|
178
|
+
if (account.credentialSource === "none") {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const user = normalizeGoogleChatTarget(id) ?? id;
|
|
182
|
+
const target = isGoogleChatUserTarget(user) ? user : `users/${user}`;
|
|
183
|
+
const space = await resolveGoogleChatOutboundSpace({ account, target });
|
|
184
|
+
const { sendGoogleChatMessage } = await loadGoogleChatChannelRuntime();
|
|
185
|
+
await sendGoogleChatMessage({
|
|
186
|
+
account,
|
|
187
|
+
space,
|
|
188
|
+
text: message,
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const googlechatOutboundAdapter = {
|
|
194
|
+
base: {
|
|
195
|
+
deliveryMode: "direct" as const,
|
|
196
|
+
chunker: chunkTextForOutbound,
|
|
197
|
+
chunkerMode: "markdown" as const,
|
|
198
|
+
textChunkLimit: 4000,
|
|
199
|
+
sanitizeText: ({ text }: { text: string }) => sanitizeForPlainText(text),
|
|
200
|
+
normalizePayload: ({ payload }: { payload: ReplyPayload }) =>
|
|
201
|
+
shouldSuppressGoogleChatManualExecApprovalFollowupPayload(payload) ? null : payload,
|
|
202
|
+
resolveTarget: ({ to }: { to?: string }) => {
|
|
203
|
+
const trimmed = normalizeOptionalString(to) ?? "";
|
|
204
|
+
|
|
205
|
+
if (trimmed) {
|
|
206
|
+
const normalized = normalizeGoogleChatTarget(trimmed);
|
|
207
|
+
if (!normalized) {
|
|
208
|
+
return {
|
|
209
|
+
ok: false as const,
|
|
210
|
+
error: missingTargetError("Google Chat", "<spaces/{space}|users/{user}>"),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return { ok: true as const, to: normalized };
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
ok: false as const,
|
|
218
|
+
error: missingTargetError("Google Chat", "<spaces/{space}|users/{user}>"),
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
attachedResults: {
|
|
223
|
+
channel: "googlechat" as const,
|
|
224
|
+
sendText: async ({
|
|
225
|
+
cfg,
|
|
226
|
+
to,
|
|
227
|
+
text,
|
|
228
|
+
accountId,
|
|
229
|
+
replyToId,
|
|
230
|
+
threadId,
|
|
231
|
+
}: {
|
|
232
|
+
cfg: ACTAgentConfig;
|
|
233
|
+
to: string;
|
|
234
|
+
text: string;
|
|
235
|
+
accountId?: string | null;
|
|
236
|
+
replyToId?: string | null;
|
|
237
|
+
threadId?: string | number | null;
|
|
238
|
+
}) => {
|
|
239
|
+
const account = resolveGoogleChatAccount({
|
|
240
|
+
cfg,
|
|
241
|
+
accountId,
|
|
242
|
+
});
|
|
243
|
+
const space = await resolveGoogleChatOutboundSpace({ account, target: to });
|
|
244
|
+
const thread =
|
|
245
|
+
typeof threadId === "number" ? String(threadId) : (threadId ?? replyToId ?? undefined);
|
|
246
|
+
const { sendGoogleChatMessage } = await loadGoogleChatChannelRuntime();
|
|
247
|
+
const result = await sendGoogleChatMessage({
|
|
248
|
+
account,
|
|
249
|
+
space,
|
|
250
|
+
text,
|
|
251
|
+
thread,
|
|
252
|
+
});
|
|
253
|
+
const messageId = result?.messageName ?? "";
|
|
254
|
+
return {
|
|
255
|
+
messageId,
|
|
256
|
+
chatId: space,
|
|
257
|
+
receipt: createGoogleChatSendReceipt({ messageId, chatId: space, kind: "text" }),
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
sendMedia: async ({
|
|
261
|
+
cfg,
|
|
262
|
+
to,
|
|
263
|
+
text,
|
|
264
|
+
mediaUrl,
|
|
265
|
+
mediaAccess,
|
|
266
|
+
mediaLocalRoots,
|
|
267
|
+
mediaReadFile,
|
|
268
|
+
accountId,
|
|
269
|
+
replyToId,
|
|
270
|
+
threadId,
|
|
271
|
+
}: {
|
|
272
|
+
cfg: ACTAgentConfig;
|
|
273
|
+
to: string;
|
|
274
|
+
text?: string;
|
|
275
|
+
mediaUrl?: string;
|
|
276
|
+
mediaAccess?: OutboundMediaLoadOptions["mediaAccess"];
|
|
277
|
+
mediaLocalRoots?: OutboundMediaLoadOptions["mediaLocalRoots"];
|
|
278
|
+
mediaReadFile?: OutboundMediaLoadOptions["mediaReadFile"];
|
|
279
|
+
accountId?: string | null;
|
|
280
|
+
replyToId?: string | null;
|
|
281
|
+
threadId?: string | number | null;
|
|
282
|
+
}) => {
|
|
283
|
+
if (!mediaUrl) {
|
|
284
|
+
throw new Error("Google Chat mediaUrl is required.");
|
|
285
|
+
}
|
|
286
|
+
const account = resolveGoogleChatAccount({
|
|
287
|
+
cfg,
|
|
288
|
+
accountId,
|
|
289
|
+
});
|
|
290
|
+
const space = await resolveGoogleChatOutboundSpace({ account, target: to });
|
|
291
|
+
const thread =
|
|
292
|
+
typeof threadId === "number" ? String(threadId) : (threadId ?? replyToId ?? undefined);
|
|
293
|
+
const maxBytes = resolveChannelMediaMaxBytes({
|
|
294
|
+
cfg,
|
|
295
|
+
resolveChannelLimitMb: ({ cfg: cfgLocal, accountId: accountIdLocal }) =>
|
|
296
|
+
(
|
|
297
|
+
cfgLocal.channels?.googlechat as
|
|
298
|
+
| { accounts?: Record<string, { mediaMaxMb?: number }>; mediaMaxMb?: number }
|
|
299
|
+
| undefined
|
|
300
|
+
)?.accounts?.[accountIdLocal]?.mediaMaxMb ??
|
|
301
|
+
(cfgLocal.channels?.googlechat as { mediaMaxMb?: number } | undefined)?.mediaMaxMb,
|
|
302
|
+
accountId,
|
|
303
|
+
});
|
|
304
|
+
const effectiveMaxBytes = maxBytes ?? (account.config.mediaMaxMb ?? 20) * 1024 * 1024;
|
|
305
|
+
const loaded = /^https?:\/\//i.test(mediaUrl)
|
|
306
|
+
? await readRemoteMediaBuffer({
|
|
307
|
+
url: mediaUrl,
|
|
308
|
+
maxBytes: effectiveMaxBytes,
|
|
309
|
+
})
|
|
310
|
+
: await loadOutboundMediaFromUrl(mediaUrl, {
|
|
311
|
+
maxBytes: effectiveMaxBytes,
|
|
312
|
+
mediaAccess,
|
|
313
|
+
mediaLocalRoots,
|
|
314
|
+
mediaReadFile,
|
|
315
|
+
});
|
|
316
|
+
const { sendGoogleChatMessage, uploadGoogleChatAttachment } =
|
|
317
|
+
await loadGoogleChatChannelRuntime();
|
|
318
|
+
const upload = await uploadGoogleChatAttachment({
|
|
319
|
+
account,
|
|
320
|
+
space,
|
|
321
|
+
filename: loaded.fileName ?? "attachment",
|
|
322
|
+
buffer: loaded.buffer,
|
|
323
|
+
contentType: loaded.contentType,
|
|
324
|
+
});
|
|
325
|
+
const result = await sendGoogleChatMessage({
|
|
326
|
+
account,
|
|
327
|
+
space,
|
|
328
|
+
text,
|
|
329
|
+
thread,
|
|
330
|
+
attachments: upload.attachmentUploadToken
|
|
331
|
+
? [
|
|
332
|
+
{
|
|
333
|
+
attachmentUploadToken: upload.attachmentUploadToken,
|
|
334
|
+
contentName: loaded.fileName,
|
|
335
|
+
},
|
|
336
|
+
]
|
|
337
|
+
: undefined,
|
|
338
|
+
});
|
|
339
|
+
const messageId = result?.messageName ?? "";
|
|
340
|
+
return {
|
|
341
|
+
messageId,
|
|
342
|
+
chatId: space,
|
|
343
|
+
receipt: createGoogleChatSendReceipt({ messageId, chatId: space, kind: "media" }),
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
350
|
+
id: "googlechat",
|
|
351
|
+
durableFinal: {
|
|
352
|
+
capabilities: {
|
|
353
|
+
text: true,
|
|
354
|
+
media: true,
|
|
355
|
+
thread: true,
|
|
356
|
+
messageSendingHooks: true,
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
send: {
|
|
360
|
+
text: googlechatOutboundAdapter.attachedResults.sendText,
|
|
361
|
+
media: googlechatOutboundAdapter.attachedResults.sendMedia,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Googlechat plugin module implements channeleps behavior.
|
|
2
|
+
export {
|
|
3
|
+
buildChannelConfigSchema,
|
|
4
|
+
chunkTextForOutbound,
|
|
5
|
+
DEFAULT_ACCOUNT_ID,
|
|
6
|
+
readRemoteMediaBuffer,
|
|
7
|
+
GoogleChatConfigSchema,
|
|
8
|
+
loadOutboundMediaFromUrl,
|
|
9
|
+
missingTargetError,
|
|
10
|
+
PAIRING_APPROVED_MESSAGE,
|
|
11
|
+
resolveChannelMediaMaxBytes,
|
|
12
|
+
type ChannelMessageActionAdapter,
|
|
13
|
+
type ChannelMessageActionName,
|
|
14
|
+
type ChannelStatusIssue,
|
|
15
|
+
type ACTAgentConfig,
|
|
16
|
+
} from "../runtime-api.js";
|
|
17
|
+
export {
|
|
18
|
+
type GoogleChatConfigAccessorAccount,
|
|
19
|
+
listGoogleChatAccountIds,
|
|
20
|
+
resolveGoogleChatConfigAccessorAccount,
|
|
21
|
+
resolveDefaultGoogleChatAccountId,
|
|
22
|
+
resolveGoogleChatAccount,
|
|
23
|
+
type ResolvedGoogleChatAccount,
|
|
24
|
+
} from "./accounts.js";
|
|
25
|
+
export {
|
|
26
|
+
isGoogleChatSpaceTarget,
|
|
27
|
+
isGoogleChatUserTarget,
|
|
28
|
+
normalizeGoogleChatTarget,
|
|
29
|
+
resolveGoogleChatOutboundSpace,
|
|
30
|
+
} from "./targets.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Googlechat plugin module implements channel behavior.
|
|
2
|
+
import {
|
|
3
|
+
probeGoogleChat as probeGoogleChatImpl,
|
|
4
|
+
sendGoogleChatMessage as sendGoogleChatMessageImpl,
|
|
5
|
+
uploadGoogleChatAttachment as uploadGoogleChatAttachmentImpl,
|
|
6
|
+
} from "./api.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveGoogleChatWebhookPath as resolveGoogleChatWebhookPathImpl,
|
|
9
|
+
startGoogleChatMonitor as startGoogleChatMonitorImpl,
|
|
10
|
+
} from "./monitor.js";
|
|
11
|
+
|
|
12
|
+
export const googleChatChannelRuntime = {
|
|
13
|
+
probeGoogleChat: probeGoogleChatImpl,
|
|
14
|
+
sendGoogleChatMessage: sendGoogleChatMessageImpl,
|
|
15
|
+
uploadGoogleChatAttachment: uploadGoogleChatAttachmentImpl,
|
|
16
|
+
resolveGoogleChatWebhookPath: resolveGoogleChatWebhookPathImpl,
|
|
17
|
+
startGoogleChatMonitor: startGoogleChatMonitorImpl,
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Googlechat plugin module implements channel.setup behavior.
|
|
2
|
+
import type { ChannelPlugin } from "actagent/plugin-sdk/channel-core";
|
|
3
|
+
import type { ResolvedGoogleChatAccount } from "./accounts.js";
|
|
4
|
+
import { createGoogleChatPluginBase } from "./channel-base.js";
|
|
5
|
+
|
|
6
|
+
export const googlechatSetupPlugin: ChannelPlugin<ResolvedGoogleChatAccount> =
|
|
7
|
+
createGoogleChatPluginBase();
|