mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-19 14:00:51 +00:00
Plugins: internalize googlechat SDK imports
This commit is contained in:
104
extensions/googlechat/runtime-api.ts
Normal file
104
extensions/googlechat/runtime-api.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
// Private runtime barrel for the bundled Google Chat extension.
|
||||
// Keep this curated to the symbols used by production code under extensions/googlechat/src.
|
||||
|
||||
export {
|
||||
createActionGate,
|
||||
jsonResult,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "../../src/agents/tools/common.js";
|
||||
export {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
} from "../../src/plugin-sdk/channel-config-helpers.js";
|
||||
export {
|
||||
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
resolveMentionGatingWithBypass,
|
||||
} from "../../src/channels/channel-policy.js";
|
||||
export { formatNormalizedAllowFromEntries } from "../../src/channels/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/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";
|
||||
@@ -1,6 +1,5 @@
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
||||
import { isSecretRef } from "openclaw/plugin-sdk/googlechat";
|
||||
import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
import { isSecretRef, createAccountListHelpers, type OpenClawConfig } from "../runtime-api.js";
|
||||
import type { GoogleChatAccountConfig } from "./types.config.js";
|
||||
|
||||
export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none";
|
||||
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
ChannelMessageActionAdapter,
|
||||
ChannelMessageActionName,
|
||||
OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
} from "../runtime-api.js";
|
||||
import {
|
||||
createActionGate,
|
||||
extractToolSend,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
} from "../runtime-api.js";
|
||||
import { listEnabledGoogleChatAccounts, resolveGoogleChatAccount } from "./accounts.js";
|
||||
import {
|
||||
createGoogleChatReaction,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import crypto from "node:crypto";
|
||||
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/googlechat";
|
||||
import { fetchWithSsrFGuard } from "../runtime-api.js";
|
||||
import type { ResolvedGoogleChatAccount } from "./accounts.js";
|
||||
import { getGoogleChatAccessToken } from "./auth.js";
|
||||
import type { GoogleChatReaction } from "./types.js";
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
||||
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildChannelConfigSchema,
|
||||
@@ -24,10 +26,8 @@ import {
|
||||
type ChannelPlugin,
|
||||
type ChannelStatusIssue,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
import { GoogleChatConfigSchema } from "openclaw/plugin-sdk/googlechat";
|
||||
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
||||
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
|
||||
} from "../runtime-api.js";
|
||||
import { GoogleChatConfigSchema } from "../runtime-api.js";
|
||||
import {
|
||||
listGoogleChatAccountIds,
|
||||
resolveDefaultGoogleChatAccountId,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
import type { OpenClawConfig } from "../runtime-api.js";
|
||||
|
||||
type GoogleChatGroupContext = {
|
||||
cfg: OpenClawConfig;
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
resolveMentionGatingWithBypass,
|
||||
resolveSenderScopedGroupPolicy,
|
||||
warnMissingProviderGroupPolicyFallbackOnce,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
type OpenClawConfig,
|
||||
} from "../runtime-api.js";
|
||||
import type { ResolvedGoogleChatAccount } from "./accounts.js";
|
||||
import { sendGoogleChatMessage } from "./api.js";
|
||||
import type { GoogleChatCoreRuntime } from "./monitor-types.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
import type { OpenClawConfig } from "../runtime-api.js";
|
||||
import type { ResolvedGoogleChatAccount } from "./accounts.js";
|
||||
import type { GoogleChatAudienceType } from "./auth.js";
|
||||
import { getGoogleChatRuntime } from "./runtime.js";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
resolveWebhookTargetWithAuthOrReject,
|
||||
withResolvedWebhookRequestPipeline,
|
||||
type WebhookInFlightLimiter,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
} from "../runtime-api.js";
|
||||
import { verifyGoogleChatRequest } from "./auth.js";
|
||||
import type { WebhookTarget } from "./monitor-types.js";
|
||||
import type {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
import type { OpenClawConfig } from "../runtime-api.js";
|
||||
import {
|
||||
createWebhookInFlightLimiter,
|
||||
createReplyPrefixOptions,
|
||||
registerWebhookTargetWithPluginRoute,
|
||||
resolveInboundRouteEnvelopeBuilderWithRuntime,
|
||||
resolveWebhookPath,
|
||||
} from "openclaw/plugin-sdk/googlechat";
|
||||
} from "../runtime-api.js";
|
||||
import { type ResolvedGoogleChatAccount } from "./accounts.js";
|
||||
import {
|
||||
downloadGoogleChatMedia,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/googlechat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "../runtime-api.js";
|
||||
|
||||
const { setRuntime: setGoogleChatRuntime, getRuntime: getGoogleChatRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Google Chat runtime not initialized");
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import type { GoogleChatAccountConfig, GoogleChatConfig } from "openclaw/plugin-sdk/googlechat";
|
||||
import type { GoogleChatAccountConfig, GoogleChatConfig } from "../runtime-api.js";
|
||||
|
||||
export type { GoogleChatAccountConfig, GoogleChatConfig };
|
||||
|
||||
Reference in New Issue
Block a user