Google Chat: thin runtime api seam (#49504)

Merged via squash.

Prepared head SHA: 3369cf2c35cbf03bc4008d123e69f43f1cc083e9
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Reviewed-by: @scoootscooob
This commit is contained in:
scoootscooob 2026-03-17 23:02:30 -07:00 committed by GitHub
parent 75f98fe19a
commit 08a0219b1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 24 additions and 108 deletions

View File

@ -147,6 +147,7 @@ Docs: https://docs.openclaw.ai
- Tools/image generation: add bundled fal image generation support so `image_generate` can target `fal/*` models with `FAL_KEY`, including single-image edit flows via FLUX image-to-image. Thanks @vincentkoc.
- xAI/web search: add missing Grok credential metadata so the bundled provider registration type-checks again. (#49472) thanks @scoootscooob.
- Signal/runtime API: re-export `SignalAccountConfig` so Signal account resolution type-checks again. (#49470) Thanks @scoootscooob.
- Google Chat/runtime API: thin the private runtime barrel onto the curated public SDK surface while keeping public Google Chat exports intact. (#49504) Thanks @scoootscooob.
### Breaking

View File

@ -1,107 +1,4 @@
// Private runtime barrel for the bundled Google Chat extension.
// Keep this curated to the symbols used by production code under extensions/googlechat/src.
// Keep this seam thin and aligned with the curated plugin-sdk/googlechat surface.
export {
createActionGate,
jsonResult,
readNumberParam,
readReactionParams,
readStringParam,
} from "../../src/agents/tools/common.js";
export {
createScopedChannelConfigAdapter,
createScopedAccountConfigAccessors,
createScopedChannelConfigBase,
createTopLevelChannelConfigAdapter,
createHybridChannelConfigAdapter,
createScopedDmSecurityResolver,
} from "../../src/plugin-sdk/channel-config-helpers.js";
export {
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
collectAllowlistProviderGroupPolicyWarnings,
} from "../../src/plugin-sdk/channel-policy.js";
export { resolveMentionGatingWithBypass } from "../../src/channels/mention-gating.js";
export { formatNormalizedAllowFromEntries } from "../../src/plugin-sdk/allow-from.js";
export { buildComputedAccountStatusSnapshot } from "../../src/plugin-sdk/status-helpers.js";
export {
createAccountStatusSink,
runPassiveAccountLifecycle,
} from "../../src/plugin-sdk/channel-lifecycle.js";
export { buildChannelConfigSchema } from "../../src/channels/plugins/config-schema.js";
export {
deleteAccountFromConfigSection,
setAccountEnabledInConfigSection,
} from "../../src/channels/plugins/config-helpers.js";
export {
listDirectoryGroupEntriesFromMapKeys,
listDirectoryUserEntriesFromAllowFrom,
} from "../../src/channels/plugins/directory-config-helpers.js";
export { formatPairingApproveHint } from "../../src/channels/plugins/helpers.js";
export { resolveChannelMediaMaxBytes } from "../../src/channels/plugins/media-limits.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
splitSetupEntries,
setTopLevelChannelDmPolicyWithAllowFrom,
} from "../../src/channels/plugins/setup-wizard-helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../../src/channels/plugins/pairing-message.js";
export {
applyAccountNameToChannelSection,
applySetupAccountConfigPatch,
migrateBaseNameToDefaultAccount,
} from "../../src/channels/plugins/setup-helpers.js";
export { createAccountListHelpers } from "../../src/channels/plugins/account-helpers.js";
export type {
ChannelAccountSnapshot,
ChannelMessageActionAdapter,
ChannelMessageActionName,
ChannelStatusIssue,
} from "../../src/channels/plugins/types.js";
export type { ChannelPlugin } from "../../src/channels/plugins/types.plugin.js";
export { getChatChannelMeta } from "../../src/channels/registry.js";
export { createReplyPrefixOptions } from "../../src/channels/reply-prefix.js";
export type { OpenClawConfig } from "../../src/config/config.js";
export { isDangerousNameMatchingEnabled } from "../../src/config/dangerous-name-matching.js";
export {
GROUP_POLICY_BLOCKED_LABEL,
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
warnMissingProviderGroupPolicyFallbackOnce,
} from "../../src/config/runtime-group-policy.js";
export type {
DmPolicy,
GoogleChatAccountConfig,
GoogleChatConfig,
} from "../../src/config/types.js";
export { isSecretRef } from "../../src/config/types.secrets.js";
export { GoogleChatConfigSchema } from "../../src/config/zod-schema.providers-core.js";
export { fetchWithSsrFGuard } from "../../src/infra/net/fetch-guard.js";
export { missingTargetError } from "../../src/infra/outbound/target-errors.js";
export { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
export type { PluginRuntime } from "../../src/plugins/runtime/types.js";
export type { OpenClawPluginApi } from "../../src/plugins/types.js";
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../src/routing/session-key.js";
export { resolveDmGroupAccessWithLists } from "../../src/security/dm-policy-shared.js";
export { formatDocsLink } from "../../src/terminal/links.js";
export type { WizardPrompter } from "../../src/wizard/prompts.js";
export { resolveInboundRouteEnvelopeBuilderWithRuntime } from "../../src/plugin-sdk/inbound-envelope.js";
export { createScopedPairingAccess } from "../../src/plugin-sdk/pairing-access.js";
export { issuePairingChallenge } from "../../src/pairing/pairing-challenge.js";
export {
evaluateGroupRouteAccessForPolicy,
resolveSenderScopedGroupPolicy,
} from "../../src/plugin-sdk/group-access.js";
export { extractToolSend } from "../../src/plugin-sdk/tool-send.js";
export { resolveWebhookPath } from "../../src/plugin-sdk/webhook-path.js";
export type { WebhookInFlightLimiter } from "../../src/plugin-sdk/webhook-request-guards.js";
export {
beginWebhookRequestPipelineOrReject,
createWebhookInFlightLimiter,
readJsonWebhookBodyOrReject,
} from "../../src/plugin-sdk/webhook-request-guards.js";
export {
registerWebhookTargetWithPluginRoute,
resolveWebhookTargets,
resolveWebhookTargetWithAuthOrReject,
withResolvedWebhookRequestPipeline,
} from "../../src/plugin-sdk/webhook-targets.js";
export * from "openclaw/plugin-sdk/googlechat";

View File

@ -1,5 +1,6 @@
import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { isSecretRef, createAccountListHelpers, type OpenClawConfig } from "../runtime-api.js";
import { isSecretRef, type OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { GoogleChatAccountConfig } from "./types.config.js";
export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none";

View File

@ -1,5 +1,5 @@
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
import type { OpenClawConfig } from "../runtime-api.js";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
type GoogleChatGroupContext = {
cfg: OpenClawConfig;

View File

@ -1,4 +1,4 @@
import type { OpenClawConfig } from "../runtime-api.js";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
import type { GoogleChatAudienceType } from "./auth.js";
import { getGoogleChatRuntime } from "./runtime.js";

View File

@ -54,6 +54,7 @@ export type {
PluginInteractiveTelegramHandlerContext,
} from "../plugins/types.js";
export type { OpenClawConfig } from "../config/config.js";
export { isSecretRef } from "../config/types.secrets.js";
export type { GatewayRequestHandlerOptions } from "../gateway/server-methods/types.js";
export type {
ChannelOutboundSessionRoute,

View File

@ -31,6 +31,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
'export * from "./src/probe.js";',
'export * from "./src/send.js";',
],
"extensions/googlechat/runtime-api.ts": ['export * from "openclaw/plugin-sdk/googlechat";'],
"extensions/nextcloud-talk/runtime-api.ts": [
'export * from "openclaw/plugin-sdk/nextcloud-talk";',
],

View File

@ -73,6 +73,7 @@ describe("plugin-sdk subpath exports", () => {
expect(typeof coreSdk.defineChannelPluginEntry).toBe("function");
expect(typeof coreSdk.defineSetupPluginEntry).toBe("function");
expect(typeof coreSdk.createChannelPluginBase).toBe("function");
expect(typeof coreSdk.isSecretRef).toBe("function");
expect(typeof coreSdk.optionalStringEnum).toBe("function");
expect("runPassiveAccountLifecycle" in asExports(coreSdk)).toBe(false);
expect("createLoggerBackedRuntime" in asExports(coreSdk)).toBe(false);
@ -259,8 +260,22 @@ describe("plugin-sdk subpath exports", () => {
});
it("exports Google Chat helpers", async () => {
expect(typeof googlechatSdk.buildChannelConfigSchema).toBe("function");
expect(typeof googlechatSdk.createWebhookInFlightLimiter).toBe("function");
expect(typeof googlechatSdk.fetchWithSsrFGuard).toBe("function");
expect(typeof googlechatSdk.googlechatSetupWizard).toBe("object");
expect(typeof googlechatSdk.googlechatSetupAdapter).toBe("object");
expect(typeof googlechatSdk.resolveGoogleChatGroupRequireMention).toBe("function");
});
it("keeps the Google Chat runtime seam aligned with the public SDK subpath", async () => {
const googlechatRuntimeApi = await import("../../extensions/googlechat/runtime-api.js");
expect(typeof googlechatRuntimeApi.buildChannelConfigSchema).toBe("function");
expect(typeof googlechatRuntimeApi.createWebhookInFlightLimiter).toBe("function");
expect(typeof googlechatRuntimeApi.fetchWithSsrFGuard).toBe("function");
expect(typeof googlechatRuntimeApi.createActionGate).toBe("function");
expect(typeof googlechatRuntimeApi.resolveWebhookTargetWithAuthOrReject).toBe("function");
});
it("exports Zalo helpers", async () => {