Skip to content

Commit 2b67a3f

Browse files
committed
Plugins: internalize googlechat SDK imports
1 parent 4285eb3 commit 2b67a3f

12 files changed

Lines changed: 121 additions & 18 deletions

File tree

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// Private runtime barrel for the bundled Google Chat extension.
2+
// Keep this curated to the symbols used by production code under extensions/googlechat/src.
3+
4+
export {
5+
createActionGate,
6+
jsonResult,
7+
readNumberParam,
8+
readReactionParams,
9+
readStringParam,
10+
} from "../../src/agents/tools/common.js";
11+
export {
12+
createScopedAccountConfigAccessors,
13+
createScopedChannelConfigBase,
14+
createScopedDmSecurityResolver,
15+
} from "../../src/plugin-sdk/channel-config-helpers.js";
16+
export {
17+
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
18+
collectAllowlistProviderGroupPolicyWarnings,
19+
resolveMentionGatingWithBypass,
20+
} from "../../src/channels/channel-policy.js";
21+
export { formatNormalizedAllowFromEntries } from "../../src/channels/allow-from.js";
22+
export { buildComputedAccountStatusSnapshot } from "../../src/plugin-sdk/status-helpers.js";
23+
export {
24+
createAccountStatusSink,
25+
runPassiveAccountLifecycle,
26+
} from "../../src/plugin-sdk/channel-lifecycle.js";
27+
export { buildChannelConfigSchema } from "../../src/channels/plugins/config-schema.js";
28+
export {
29+
deleteAccountFromConfigSection,
30+
setAccountEnabledInConfigSection,
31+
} from "../../src/channels/plugins/config-helpers.js";
32+
export {
33+
listDirectoryGroupEntriesFromMapKeys,
34+
listDirectoryUserEntriesFromAllowFrom,
35+
} from "../../src/channels/plugins/directory-config-helpers.js";
36+
export { formatPairingApproveHint } from "../../src/channels/plugins/helpers.js";
37+
export { resolveChannelMediaMaxBytes } from "../../src/channels/plugins/media-limits.js";
38+
export {
39+
addWildcardAllowFrom,
40+
mergeAllowFromEntries,
41+
splitSetupEntries,
42+
setTopLevelChannelDmPolicyWithAllowFrom,
43+
} from "../../src/channels/plugins/setup-wizard-helpers.js";
44+
export { PAIRING_APPROVED_MESSAGE } from "../../src/channels/plugins/pairing-message.js";
45+
export {
46+
applyAccountNameToChannelSection,
47+
applySetupAccountConfigPatch,
48+
migrateBaseNameToDefaultAccount,
49+
} from "../../src/channels/plugins/setup-helpers.js";
50+
export { createAccountListHelpers } from "../../src/channels/plugins/account-helpers.js";
51+
export type {
52+
ChannelAccountSnapshot,
53+
ChannelMessageActionAdapter,
54+
ChannelMessageActionName,
55+
ChannelStatusIssue,
56+
} from "../../src/channels/plugins/types.js";
57+
export type { ChannelPlugin } from "../../src/channels/plugins/types.plugin.js";
58+
export { getChatChannelMeta } from "../../src/channels/registry.js";
59+
export { createReplyPrefixOptions } from "../../src/channels/reply-prefix.js";
60+
export type { OpenClawConfig } from "../../src/config/config.js";
61+
export { isDangerousNameMatchingEnabled } from "../../src/config/dangerous-name-matching.js";
62+
export {
63+
GROUP_POLICY_BLOCKED_LABEL,
64+
resolveAllowlistProviderRuntimeGroupPolicy,
65+
resolveDefaultGroupPolicy,
66+
warnMissingProviderGroupPolicyFallbackOnce,
67+
} from "../../src/config/runtime-group-policy.js";
68+
export type {
69+
DmPolicy,
70+
GoogleChatAccountConfig,
71+
GoogleChatConfig,
72+
} from "../../src/config/types.js";
73+
export { isSecretRef } from "../../src/config/types.secrets.js";
74+
export { GoogleChatConfigSchema } from "../../src/config/zod-schema.providers-core.js";
75+
export { fetchWithSsrFGuard } from "../../src/infra/net/fetch-guard.js";
76+
export { missingTargetError } from "../../src/infra/outbound/target-errors.js";
77+
export { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
78+
export type { PluginRuntime } from "../../src/plugins/runtime/types.js";
79+
export type { OpenClawPluginApi } from "../../src/plugins/types.js";
80+
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../src/routing/session-key.js";
81+
export { resolveDmGroupAccessWithLists } from "../../src/security/dm-policy-shared.js";
82+
export { formatDocsLink } from "../../src/terminal/links.js";
83+
export type { WizardPrompter } from "../../src/wizard/prompts.js";
84+
export { resolveInboundRouteEnvelopeBuilderWithRuntime } from "../../src/plugin-sdk/inbound-envelope.js";
85+
export { createScopedPairingAccess } from "../../src/plugin-sdk/pairing-access.js";
86+
export { issuePairingChallenge } from "../../src/pairing/pairing-challenge.js";
87+
export {
88+
evaluateGroupRouteAccessForPolicy,
89+
resolveSenderScopedGroupPolicy,
90+
} from "./src/group-access.js";
91+
export { extractToolSend } from "../../src/plugin-sdk/tool-send.js";
92+
export { resolveWebhookPath } from "../../src/plugin-sdk/webhook-path.js";
93+
export type { WebhookInFlightLimiter } from "../../src/plugin-sdk/webhook-request-guards.js";
94+
export {
95+
beginWebhookRequestPipelineOrReject,
96+
createWebhookInFlightLimiter,
97+
readJsonWebhookBodyOrReject,
98+
} from "../../src/plugin-sdk/webhook-request-guards.js";
99+
export {
100+
registerWebhookTargetWithPluginRoute,
101+
resolveWebhookTargets,
102+
resolveWebhookTargetWithAuthOrReject,
103+
withResolvedWebhookRequestPipeline,
104+
} from "../../src/plugin-sdk/webhook-targets.js";

extensions/googlechat/src/accounts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
2-
import { isSecretRef } from "openclaw/plugin-sdk/googlechat";
3-
import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
2+
import { isSecretRef, createAccountListHelpers, type OpenClawConfig } from "../runtime-api.js";
43
import type { GoogleChatAccountConfig } from "./types.config.js";
54

65
export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none";

extensions/googlechat/src/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import type {
22
ChannelMessageActionAdapter,
33
ChannelMessageActionName,
44
OpenClawConfig,
5-
} from "openclaw/plugin-sdk/googlechat";
5+
} from "../runtime-api.js";
66
import {
77
createActionGate,
88
extractToolSend,
99
jsonResult,
1010
readNumberParam,
1111
readReactionParams,
1212
readStringParam,
13-
} from "openclaw/plugin-sdk/googlechat";
13+
} from "../runtime-api.js";
1414
import { listEnabledGoogleChatAccounts, resolveGoogleChatAccount } from "./accounts.js";
1515
import {
1616
createGoogleChatReaction,

extensions/googlechat/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import crypto from "node:crypto";
2-
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/googlechat";
2+
import { fetchWithSsrFGuard } from "../runtime-api.js";
33
import type { ResolvedGoogleChatAccount } from "./accounts.js";
44
import { getGoogleChatAccessToken } from "./auth.js";
55
import type { GoogleChatReaction } from "./types.js";

extensions/googlechat/src/channel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
99
collectAllowlistProviderGroupPolicyWarnings,
1010
} from "openclaw/plugin-sdk/channel-policy";
11+
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
12+
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
1113
import {
1214
buildComputedAccountStatusSnapshot,
1315
buildChannelConfigSchema,
@@ -24,10 +26,8 @@ import {
2426
type ChannelPlugin,
2527
type ChannelStatusIssue,
2628
type OpenClawConfig,
27-
} from "openclaw/plugin-sdk/googlechat";
28-
import { GoogleChatConfigSchema } from "openclaw/plugin-sdk/googlechat";
29-
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
30-
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
29+
} from "../runtime-api.js";
30+
import { GoogleChatConfigSchema } from "../runtime-api.js";
3131
import {
3232
listGoogleChatAccountIds,
3333
resolveDefaultGoogleChatAccountId,

extensions/googlechat/src/group-policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
2-
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
2+
import type { OpenClawConfig } from "../runtime-api.js";
33

44
type GoogleChatGroupContext = {
55
cfg: OpenClawConfig;

extensions/googlechat/src/monitor-access.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
resolveMentionGatingWithBypass,
1111
resolveSenderScopedGroupPolicy,
1212
warnMissingProviderGroupPolicyFallbackOnce,
13-
} from "openclaw/plugin-sdk/googlechat";
14-
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
13+
type OpenClawConfig,
14+
} from "../runtime-api.js";
1515
import type { ResolvedGoogleChatAccount } from "./accounts.js";
1616
import { sendGoogleChatMessage } from "./api.js";
1717
import type { GoogleChatCoreRuntime } from "./monitor-types.js";

extensions/googlechat/src/monitor-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
1+
import type { OpenClawConfig } from "../runtime-api.js";
22
import type { ResolvedGoogleChatAccount } from "./accounts.js";
33
import type { GoogleChatAudienceType } from "./auth.js";
44
import { getGoogleChatRuntime } from "./runtime.js";

extensions/googlechat/src/monitor-webhook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
resolveWebhookTargetWithAuthOrReject,
55
withResolvedWebhookRequestPipeline,
66
type WebhookInFlightLimiter,
7-
} from "openclaw/plugin-sdk/googlechat";
7+
} from "../runtime-api.js";
88
import { verifyGoogleChatRequest } from "./auth.js";
99
import type { WebhookTarget } from "./monitor-types.js";
1010
import type {

extensions/googlechat/src/monitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { IncomingMessage, ServerResponse } from "node:http";
2-
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
2+
import type { OpenClawConfig } from "../runtime-api.js";
33
import {
44
createWebhookInFlightLimiter,
55
createReplyPrefixOptions,
66
registerWebhookTargetWithPluginRoute,
77
resolveInboundRouteEnvelopeBuilderWithRuntime,
88
resolveWebhookPath,
9-
} from "openclaw/plugin-sdk/googlechat";
9+
} from "../runtime-api.js";
1010
import { type ResolvedGoogleChatAccount } from "./accounts.js";
1111
import {
1212
downloadGoogleChatMedia,

0 commit comments

Comments
 (0)