diff --git a/CHANGELOG.md b/CHANGELOG.md index fa96121ab73..1b16e3f6efa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/extensions/googlechat/runtime-api.ts b/extensions/googlechat/runtime-api.ts index 28f7c81c4e9..6f0861114ec 100644 --- a/extensions/googlechat/runtime-api.ts +++ b/extensions/googlechat/runtime-api.ts @@ -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"; diff --git a/extensions/googlechat/src/accounts.ts b/extensions/googlechat/src/accounts.ts index 0e973cbe02f..314ae8272bb 100644 --- a/extensions/googlechat/src/accounts.ts +++ b/extensions/googlechat/src/accounts.ts @@ -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"; diff --git a/extensions/googlechat/src/group-policy.ts b/extensions/googlechat/src/group-policy.ts index ab10399e529..cf4de7018cf 100644 --- a/extensions/googlechat/src/group-policy.ts +++ b/extensions/googlechat/src/group-policy.ts @@ -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; diff --git a/extensions/googlechat/src/monitor-types.ts b/extensions/googlechat/src/monitor-types.ts index 4cddc70ea3b..26027be5d17 100644 --- a/extensions/googlechat/src/monitor-types.ts +++ b/extensions/googlechat/src/monitor-types.ts @@ -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"; diff --git a/src/plugin-sdk/core.ts b/src/plugin-sdk/core.ts index ba49614389d..124c37d6712 100644 --- a/src/plugin-sdk/core.ts +++ b/src/plugin-sdk/core.ts @@ -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, diff --git a/src/plugin-sdk/runtime-api-guardrails.test.ts b/src/plugin-sdk/runtime-api-guardrails.test.ts index 785ed9de224..1b29d1570c6 100644 --- a/src/plugin-sdk/runtime-api-guardrails.test.ts +++ b/src/plugin-sdk/runtime-api-guardrails.test.ts @@ -31,6 +31,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record = { '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";', ], diff --git a/src/plugin-sdk/subpaths.test.ts b/src/plugin-sdk/subpaths.test.ts index 606e7b623f8..313d2d4d263 100644 --- a/src/plugin-sdk/subpaths.test.ts +++ b/src/plugin-sdk/subpaths.test.ts @@ -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 () => {