@kodelyth/googlechat 2026.5.42 → 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.
Files changed (61) hide show
  1. package/klaw.plugin.json +967 -2
  2. package/package.json +18 -6
  3. package/api.ts +0 -3
  4. package/channel-config-api.ts +0 -1
  5. package/channel-plugin-api.ts +0 -1
  6. package/config-api.ts +0 -2
  7. package/contract-api.ts +0 -5
  8. package/doctor-contract-api.ts +0 -1
  9. package/index.ts +0 -20
  10. package/runtime-api.ts +0 -55
  11. package/secret-contract-api.ts +0 -5
  12. package/setup-entry.ts +0 -13
  13. package/setup-plugin-api.ts +0 -3
  14. package/src/accounts.ts +0 -181
  15. package/src/actions.test.ts +0 -289
  16. package/src/actions.ts +0 -227
  17. package/src/api.ts +0 -316
  18. package/src/approval-auth.test.ts +0 -24
  19. package/src/approval-auth.ts +0 -32
  20. package/src/auth.ts +0 -218
  21. package/src/channel-config.test.ts +0 -39
  22. package/src/channel.adapters.ts +0 -340
  23. package/src/channel.deps.runtime.ts +0 -29
  24. package/src/channel.runtime.ts +0 -17
  25. package/src/channel.setup.ts +0 -98
  26. package/src/channel.test.ts +0 -784
  27. package/src/channel.ts +0 -277
  28. package/src/config-schema.test.ts +0 -31
  29. package/src/config-schema.ts +0 -3
  30. package/src/doctor-contract.test.ts +0 -75
  31. package/src/doctor-contract.ts +0 -182
  32. package/src/doctor.ts +0 -57
  33. package/src/gateway.ts +0 -63
  34. package/src/google-auth.runtime.test.ts +0 -543
  35. package/src/google-auth.runtime.ts +0 -568
  36. package/src/group-policy.ts +0 -17
  37. package/src/monitor-access.test.ts +0 -491
  38. package/src/monitor-access.ts +0 -465
  39. package/src/monitor-durable.test.ts +0 -39
  40. package/src/monitor-durable.ts +0 -23
  41. package/src/monitor-reply-delivery.ts +0 -156
  42. package/src/monitor-routing.ts +0 -65
  43. package/src/monitor-types.ts +0 -33
  44. package/src/monitor-webhook.test.ts +0 -587
  45. package/src/monitor-webhook.ts +0 -303
  46. package/src/monitor.reply-delivery.test.ts +0 -144
  47. package/src/monitor.test.ts +0 -159
  48. package/src/monitor.ts +0 -527
  49. package/src/monitor.webhook-routing.test.ts +0 -257
  50. package/src/runtime.ts +0 -9
  51. package/src/secret-contract.test.ts +0 -60
  52. package/src/secret-contract.ts +0 -161
  53. package/src/setup-core.ts +0 -40
  54. package/src/setup-surface.ts +0 -243
  55. package/src/setup.test.ts +0 -619
  56. package/src/targets.test.ts +0 -453
  57. package/src/targets.ts +0 -66
  58. package/src/types.config.ts +0 -3
  59. package/src/types.ts +0 -73
  60. package/test-api.ts +0 -2
  61. package/tsconfig.json +0 -16
@@ -1,98 +0,0 @@
1
- import { describeAccountSnapshot } from "klaw/plugin-sdk/account-helpers";
2
- import { formatNormalizedAllowFromEntries } from "klaw/plugin-sdk/allow-from";
3
- import {
4
- adaptScopedAccountAccessor,
5
- createScopedChannelConfigAdapter,
6
- } from "klaw/plugin-sdk/channel-config-helpers";
7
- import type { ChannelPlugin } from "klaw/plugin-sdk/channel-core";
8
- import { normalizeLowercaseStringOrEmpty } from "klaw/plugin-sdk/string-coerce-runtime";
9
- import {
10
- type GoogleChatConfigAccessorAccount,
11
- listGoogleChatAccountIds,
12
- resolveGoogleChatConfigAccessorAccount,
13
- resolveDefaultGoogleChatAccountId,
14
- resolveGoogleChatAccount,
15
- type ResolvedGoogleChatAccount,
16
- } from "./accounts.js";
17
- import { googlechatSetupAdapter } from "./setup-core.js";
18
- import { googlechatSetupWizard } from "./setup-surface.js";
19
-
20
- const formatGoogleChatAllowFromEntry = (entry: string) =>
21
- normalizeLowercaseStringOrEmpty(
22
- entry
23
- .trim()
24
- .replace(/^(googlechat|google-chat|gchat):/i, "")
25
- .replace(/^user:/i, "")
26
- .replace(/^users\//i, ""),
27
- );
28
-
29
- const googleChatConfigAdapter = createScopedChannelConfigAdapter<
30
- ResolvedGoogleChatAccount,
31
- GoogleChatConfigAccessorAccount
32
- >({
33
- sectionKey: "googlechat",
34
- listAccountIds: listGoogleChatAccountIds,
35
- resolveAccount: adaptScopedAccountAccessor(resolveGoogleChatAccount),
36
- resolveAccessorAccount: resolveGoogleChatConfigAccessorAccount,
37
- defaultAccountId: resolveDefaultGoogleChatAccountId,
38
- clearBaseFields: [
39
- "serviceAccount",
40
- "serviceAccountFile",
41
- "audienceType",
42
- "audience",
43
- "webhookPath",
44
- "webhookUrl",
45
- "botUser",
46
- "name",
47
- ],
48
- resolveAllowFrom: (account) => account.config.dm?.allowFrom,
49
- formatAllowFrom: (allowFrom) =>
50
- formatNormalizedAllowFromEntries({
51
- allowFrom,
52
- normalizeEntry: formatGoogleChatAllowFromEntry,
53
- }),
54
- resolveDefaultTo: (account) => account.config.defaultTo,
55
- });
56
-
57
- export const googlechatSetupPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
58
- id: "googlechat",
59
- meta: {
60
- id: "googlechat",
61
- label: "Google Chat",
62
- selectionLabel: "Google Chat (Chat API)",
63
- docsPath: "/channels/googlechat",
64
- docsLabel: "googlechat",
65
- blurb: "Google Workspace Chat app with HTTP webhook.",
66
- aliases: ["gchat", "google-chat"],
67
- order: 55,
68
- detailLabel: "Google Chat",
69
- systemImage: "message.badge",
70
- markdownCapable: true,
71
- },
72
- setup: googlechatSetupAdapter,
73
- setupWizard: googlechatSetupWizard,
74
- capabilities: {
75
- chatTypes: ["direct", "group", "thread"],
76
- reactions: true,
77
- threads: true,
78
- media: true,
79
- nativeCommands: false,
80
- blockStreaming: true,
81
- },
82
- streaming: {
83
- blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
84
- },
85
- reload: { configPrefixes: ["channels.googlechat"] },
86
- config: {
87
- ...googleChatConfigAdapter,
88
- isConfigured: (account) => account.credentialSource !== "none",
89
- describeAccount: (account) =>
90
- describeAccountSnapshot({
91
- account,
92
- configured: account.credentialSource !== "none",
93
- extra: {
94
- credentialSource: account.credentialSource,
95
- },
96
- }),
97
- },
98
- };