diff --git a/extensions/bluebubbles/src/setup-core.ts b/extensions/bluebubbles/src/setup-core.ts index 83a079dbaab..6509c5f240b 100644 --- a/extensions/bluebubbles/src/setup-core.ts +++ b/extensions/bluebubbles/src/setup-core.ts @@ -1,13 +1,14 @@ import { applyAccountNameToChannelSection, + DEFAULT_ACCOUNT_ID, migrateBaseNameToDefaultAccount, patchScopedAccountConfig, -} from "../../../src/channels/plugins/setup-helpers.js"; -import { setTopLevelChannelDmPolicyWithAllowFrom } from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy } from "../../../src/config/types.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + normalizeAccountId, + setTopLevelChannelDmPolicyWithAllowFrom, + type ChannelSetupAdapter, + type DmPolicy, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { applyBlueBubblesConnectionConfig } from "./config-apply.js"; const channel = "bluebubbles" as const; diff --git a/extensions/bluebubbles/src/setup-surface.ts b/extensions/bluebubbles/src/setup-surface.ts index 1a138b8e73d..f6922ed4861 100644 --- a/extensions/bluebubbles/src/setup-surface.ts +++ b/extensions/bluebubbles/src/setup-surface.ts @@ -1,14 +1,14 @@ import { + DEFAULT_ACCOUNT_ID, + formatDocsLink, mergeAllowFromEntries, resolveSetupAccountId, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy } from "../../../src/config/types.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; -import type { WizardPrompter } from "../../../src/wizard/prompts.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type DmPolicy, + type OpenClawConfig, + type WizardPrompter, +} from "openclaw/plugin-sdk/setup"; import { listBlueBubblesAccountIds, resolveBlueBubblesAccount, diff --git a/extensions/discord/src/actions/handle-action.ts b/extensions/discord/src/actions/handle-action.ts index 4beb7d76de4..c938d675955 100644 --- a/extensions/discord/src/actions/handle-action.ts +++ b/extensions/discord/src/actions/handle-action.ts @@ -1,4 +1,5 @@ import type { AgentToolResult } from "@mariozechner/pi-agent-core"; +import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param"; import { readNumberParam, readStringArrayParam, @@ -9,7 +10,6 @@ import { handleDiscordAction } from "../../../../src/agents/tools/discord-action import { resolveReactionMessageId } from "../../../../src/channels/plugins/actions/reaction-message-id.js"; import type { ChannelMessageActionContext } from "../../../../src/channels/plugins/types.js"; import { normalizeInteractiveReply } from "../../../../src/interactive/payload.js"; -import { readBooleanParam } from "../../../../src/plugin-sdk/boolean-param.js"; import { buildDiscordInteractiveComponents } from "../shared-interactive.js"; import { resolveDiscordChannelId } from "../targets.js"; import { tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin.js"; diff --git a/extensions/discord/src/monitor/allow-list.ts b/extensions/discord/src/monitor/allow-list.ts index 6391ad5c3a5..a6208eaf63a 100644 --- a/extensions/discord/src/monitor/allow-list.ts +++ b/extensions/discord/src/monitor/allow-list.ts @@ -1,4 +1,5 @@ import type { Guild, User } from "@buape/carbon"; +import { evaluateGroupRouteAccessForPolicy } from "openclaw/plugin-sdk/group-access"; import type { AllowlistMatch } from "../../../../src/channels/allowlist-match.js"; import { buildChannelKeyCandidates, @@ -6,7 +7,6 @@ import { resolveChannelMatchConfig, type ChannelMatchSource, } from "../../../../src/channels/channel-config.js"; -import { evaluateGroupRouteAccessForPolicy } from "../../../../src/plugin-sdk/group-access.js"; import { formatDiscordUserTag } from "./format.js"; export type DiscordAllowList = { diff --git a/extensions/discord/src/monitor/inbound-worker.ts b/extensions/discord/src/monitor/inbound-worker.ts index 214eb6a8020..cbc8e246704 100644 --- a/extensions/discord/src/monitor/inbound-worker.ts +++ b/extensions/discord/src/monitor/inbound-worker.ts @@ -1,7 +1,7 @@ +import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue"; import { createRunStateMachine } from "../../../../src/channels/run-state-machine.js"; import { danger } from "../../../../src/globals.js"; import { formatDurationSeconds } from "../../../../src/infra/format-time/format-duration.ts"; -import { KeyedAsyncQueue } from "../../../../src/plugin-sdk/keyed-async-queue.js"; import { materializeDiscordInboundJob, type DiscordInboundJob } from "./inbound-job.js"; import type { RuntimeEnv } from "./message-handler.preflight.types.js"; import { processDiscordMessage } from "./message-handler.process.js"; diff --git a/extensions/discord/src/monitor/model-picker-preferences.ts b/extensions/discord/src/monitor/model-picker-preferences.ts index e75ce013403..8657ed66436 100644 --- a/extensions/discord/src/monitor/model-picker-preferences.ts +++ b/extensions/discord/src/monitor/model-picker-preferences.ts @@ -1,14 +1,11 @@ import os from "node:os"; import path from "node:path"; +import { normalizeAccountId as normalizeSharedAccountId } from "openclaw/plugin-sdk/account-id"; +import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store"; import { normalizeProviderId } from "../../../../src/agents/model-selection.js"; import { resolveStateDir } from "../../../../src/config/paths.js"; import { withFileLock } from "../../../../src/infra/file-lock.js"; import { resolveRequiredHomeDir } from "../../../../src/infra/home-dir.js"; -import { - readJsonFileWithFallback, - writeJsonFileAtomically, -} from "../../../../src/plugin-sdk/json-store.js"; -import { normalizeAccountId as normalizeSharedAccountId } from "../../../../src/routing/account-id.js"; const MODEL_PICKER_PREFERENCES_LOCK_OPTIONS = { retries: { diff --git a/extensions/feishu/src/setup-core.ts b/extensions/feishu/src/setup-core.ts index ada8ef79933..a9c6639a2f7 100644 --- a/extensions/feishu/src/setup-core.ts +++ b/extensions/feishu/src/setup-core.ts @@ -1,6 +1,8 @@ -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; +import { + DEFAULT_ACCOUNT_ID, + type ChannelSetupAdapter, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import type { FeishuConfig } from "./types.js"; export function setFeishuNamedAccountEnabled( diff --git a/extensions/feishu/src/setup-surface.ts b/extensions/feishu/src/setup-surface.ts index 4f92b07a804..e990f308624 100644 --- a/extensions/feishu/src/setup-surface.ts +++ b/extensions/feishu/src/setup-surface.ts @@ -1,20 +1,20 @@ import { buildSingleChannelSecretPromptState, + DEFAULT_ACCOUNT_ID, + formatDocsLink, + hasConfiguredSecretInput, mergeAllowFromEntries, promptSingleChannelSecretInput, setTopLevelChannelAllowFrom, setTopLevelChannelDmPolicyWithAllowFrom, setTopLevelChannelGroupPolicy, splitSetupEntries, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy } from "../../../src/config/types.js"; -import type { SecretInput } from "../../../src/config/types.secrets.js"; -import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type DmPolicy, + type OpenClawConfig, + type SecretInput, +} from "openclaw/plugin-sdk/setup"; import { listFeishuAccountIds, resolveFeishuCredentials } from "./accounts.js"; import { probeFeishu } from "./probe.js"; import { feishuSetupAdapter } from "./setup-core.js"; diff --git a/extensions/google/gemini-cli-provider.ts b/extensions/google/gemini-cli-provider.ts index 926913f7390..e235a0dfebc 100644 --- a/extensions/google/gemini-cli-provider.ts +++ b/extensions/google/gemini-cli-provider.ts @@ -1,5 +1,5 @@ +import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/core"; import { fetchGeminiUsage } from "../../src/infra/provider-usage.fetch.js"; -import { buildOauthProviderAuthResult } from "../../src/plugin-sdk/provider-auth-result.js"; import type { OpenClawPluginApi, ProviderAuthContext, diff --git a/extensions/googlechat/src/setup-core.ts b/extensions/googlechat/src/setup-core.ts index d4d2de49e06..b12d2704b2d 100644 --- a/extensions/googlechat/src/setup-core.ts +++ b/extensions/googlechat/src/setup-core.ts @@ -1,10 +1,11 @@ import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, + DEFAULT_ACCOUNT_ID, migrateBaseNameToDefaultAccount, -} from "../../../src/channels/plugins/setup-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + normalizeAccountId, + type ChannelSetupAdapter, +} from "openclaw/plugin-sdk/setup"; const channel = "googlechat" as const; diff --git a/extensions/googlechat/src/setup-surface.ts b/extensions/googlechat/src/setup-surface.ts index 5561989543f..0af6e3d4f54 100644 --- a/extensions/googlechat/src/setup-surface.ts +++ b/extensions/googlechat/src/setup-surface.ts @@ -1,19 +1,17 @@ -import { - applySetupAccountConfigPatch, - migrateBaseNameToDefaultAccount, -} from "../../../src/channels/plugins/setup-helpers.js"; import { addWildcardAllowFrom, + applySetupAccountConfigPatch, + DEFAULT_ACCOUNT_ID, + formatDocsLink, mergeAllowFromEntries, + migrateBaseNameToDefaultAccount, setTopLevelChannelDmPolicyWithAllowFrom, splitSetupEntries, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy } from "../../../src/config/types.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type DmPolicy, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { listGoogleChatAccountIds, resolveDefaultGoogleChatAccountId, diff --git a/extensions/matrix/src/setup-core.ts b/extensions/matrix/src/setup-core.ts index f0fc395a344..d78049262a1 100644 --- a/extensions/matrix/src/setup-core.ts +++ b/extensions/matrix/src/setup-core.ts @@ -1,10 +1,11 @@ import { applyAccountNameToChannelSection, + DEFAULT_ACCOUNT_ID, migrateBaseNameToDefaultAccount, -} from "../../../src/channels/plugins/setup-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import { normalizeSecretInputString } from "../../../src/config/types.secrets.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + normalizeAccountId, + normalizeSecretInputString, + type ChannelSetupAdapter, +} from "openclaw/plugin-sdk/setup"; import type { CoreConfig } from "./types.js"; const channel = "matrix" as const; diff --git a/extensions/matrix/src/setup-surface.ts b/extensions/matrix/src/setup-surface.ts index 0f79545358e..09e9438a410 100644 --- a/extensions/matrix/src/setup-surface.ts +++ b/extensions/matrix/src/setup-surface.ts @@ -1,20 +1,20 @@ import { addWildcardAllowFrom, buildSingleChannelSecretPromptState, + DEFAULT_ACCOUNT_ID, + formatDocsLink, + formatResolvedUnresolvedNote, + hasConfiguredSecretInput, mergeAllowFromEntries, promptSingleChannelSecretInput, setTopLevelChannelGroupPolicy, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy } from "../../../src/config/types.js"; -import type { SecretInput } from "../../../src/config/types.secrets.js"; -import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js"; -import { formatResolvedUnresolvedNote } from "../../../src/plugin-sdk/resolution-notes.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; -import type { WizardPrompter } from "../../../src/wizard/prompts.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type DmPolicy, + type OpenClawConfig, + type SecretInput, + type WizardPrompter, +} from "openclaw/plugin-sdk/setup"; import { listMatrixDirectoryGroupsLive } from "./directory-live.js"; import { resolveMatrixAccount } from "./matrix/accounts.js"; import { ensureMatrixSdkInstalled, isMatrixSdkAvailable } from "./matrix/deps.js"; diff --git a/extensions/msteams/src/setup-core.ts b/extensions/msteams/src/setup-core.ts index 74079aaf389..fb4246a8d0a 100644 --- a/extensions/msteams/src/setup-core.ts +++ b/extensions/msteams/src/setup-core.ts @@ -1,5 +1,4 @@ -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; +import { DEFAULT_ACCOUNT_ID, type ChannelSetupAdapter } from "openclaw/plugin-sdk/setup"; export const msteamsSetupAdapter: ChannelSetupAdapter = { resolveAccountId: () => DEFAULT_ACCOUNT_ID, diff --git a/extensions/msteams/src/setup-surface.ts b/extensions/msteams/src/setup-surface.ts index e3bc6169f6c..185bf3d7362 100644 --- a/extensions/msteams/src/setup-surface.ts +++ b/extensions/msteams/src/setup-surface.ts @@ -1,17 +1,18 @@ +import type { MSTeamsTeamConfig } from "openclaw/plugin-sdk/msteams"; import { + DEFAULT_ACCOUNT_ID, + formatDocsLink, mergeAllowFromEntries, setTopLevelChannelAllowFrom, setTopLevelChannelDmPolicyWithAllowFrom, setTopLevelChannelGroupPolicy, splitSetupEntries, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { DmPolicy, MSTeamsTeamConfig } from "../../../src/config/types.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; -import type { WizardPrompter } from "../../../src/wizard/prompts.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type DmPolicy, + type OpenClawConfig, + type WizardPrompter, +} from "openclaw/plugin-sdk/setup"; import { parseMSTeamsTeamEntry, resolveMSTeamsChannelAllowlist, diff --git a/extensions/openai/openai-codex-provider.ts b/extensions/openai/openai-codex-provider.ts index 49c6f7272a9..e8be8bd4eb1 100644 --- a/extensions/openai/openai-codex-provider.ts +++ b/extensions/openai/openai-codex-provider.ts @@ -4,6 +4,7 @@ import type { ProviderResolveDynamicModelContext, ProviderRuntimeModel, } from "openclaw/plugin-sdk/core"; +import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/core"; import { CODEX_CLI_PROFILE_ID } from "../../src/agents/auth-profiles.js"; import { listProfilesForProvider } from "../../src/agents/auth-profiles/profiles.js"; import { ensureAuthProfileStore } from "../../src/agents/auth-profiles/store.js"; @@ -13,7 +14,6 @@ import { normalizeModelCompat } from "../../src/agents/model-compat.js"; import { normalizeProviderId } from "../../src/agents/provider-id.js"; import { loginOpenAICodexOAuth } from "../../src/commands/openai-codex-oauth.js"; import { fetchCodexUsage } from "../../src/infra/provider-usage.fetch.js"; -import { buildOauthProviderAuthResult } from "../../src/plugin-sdk/provider-auth-result.js"; import type { ProviderPlugin } from "../../src/plugins/types.js"; import { buildOpenAICodexProvider } from "./openai-codex-catalog.js"; import { diff --git a/extensions/slack/src/monitor/media.ts b/extensions/slack/src/monitor/media.ts index 7c5a619129f..ef494f2e48c 100644 --- a/extensions/slack/src/monitor/media.ts +++ b/extensions/slack/src/monitor/media.ts @@ -1,9 +1,9 @@ import type { WebClient as SlackWebClient } from "@slack/web-api"; +import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url"; import { normalizeHostname } from "../../../../src/infra/net/hostname.js"; import type { FetchLike } from "../../../../src/media/fetch.js"; import { fetchRemoteMedia } from "../../../../src/media/fetch.js"; import { saveMediaBuffer } from "../../../../src/media/store.js"; -import { resolveRequestUrl } from "../../../../src/plugin-sdk/request-url.js"; import type { SlackAttachment, SlackFile } from "../types.js"; function isSlackHostname(hostname: string): boolean { diff --git a/extensions/slack/src/monitor/policy.ts b/extensions/slack/src/monitor/policy.ts index ab5d9230a62..9f58c758c51 100644 --- a/extensions/slack/src/monitor/policy.ts +++ b/extensions/slack/src/monitor/policy.ts @@ -1,4 +1,4 @@ -import { evaluateGroupRouteAccessForPolicy } from "../../../../src/plugin-sdk/group-access.js"; +import { evaluateGroupRouteAccessForPolicy } from "openclaw/plugin-sdk/group-access"; export function isSlackChannelAllowedByPolicy(params: { groupPolicy: "open" | "disabled" | "allowlist"; diff --git a/extensions/slack/src/shared.ts b/extensions/slack/src/shared.ts index 7345de3a22c..de7238a7a78 100644 --- a/extensions/slack/src/shared.ts +++ b/extensions/slack/src/shared.ts @@ -1,12 +1,14 @@ -import { patchChannelConfigForAccount } from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js"; -import { formatAllowFromLowercase } from "../../../src/plugin-sdk/allow-from.js"; +import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from"; import { createScopedAccountConfigAccessors, createScopedChannelConfigBase, -} from "../../../src/plugin-sdk/channel-config-helpers.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; +} from "openclaw/plugin-sdk/channel-config-helpers"; +import { + formatDocsLink, + hasConfiguredSecretInput, + patchChannelConfigForAccount, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { inspectSlackAccount } from "./account-inspect.js"; import { listSlackAccountIds, diff --git a/extensions/synology-chat/src/setup-surface.ts b/extensions/synology-chat/src/setup-surface.ts index d998022365b..7985199eda6 100644 --- a/extensions/synology-chat/src/setup-surface.ts +++ b/extensions/synology-chat/src/setup-surface.ts @@ -1,13 +1,14 @@ import { + DEFAULT_ACCOUNT_ID, + formatDocsLink, mergeAllowFromEntries, + normalizeAccountId, setSetupChannelEnabled, splitSetupEntries, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; + type ChannelSetupAdapter, + type ChannelSetupWizard, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { listAccountIds, resolveAccount } from "./accounts.js"; import type { SynologyChatAccountRaw, SynologyChatChannelConfig } from "./types.js"; diff --git a/extensions/telegram/src/channel.ts b/extensions/telegram/src/channel.ts index 720bc2985b7..d73e63b0996 100644 --- a/extensions/telegram/src/channel.ts +++ b/extensions/telegram/src/channel.ts @@ -14,7 +14,6 @@ import { import { buildAgentSessionKey, resolveThreadSessionKeys, - type ChannelPlugin, type RoutePeer, } from "../../../src/plugin-sdk-internal/core.js"; import { @@ -31,6 +30,7 @@ import { resolveTelegramGroupRequireMention, resolveTelegramGroupToolPolicy, TelegramConfigSchema, + type ChannelPlugin, type ChannelMessageActionAdapter, type OpenClawConfig, } from "../../../src/plugin-sdk-internal/telegram.js"; diff --git a/extensions/tlon/src/setup-core.ts b/extensions/tlon/src/setup-core.ts index a237a813edf..ae95819af52 100644 --- a/extensions/tlon/src/setup-core.ts +++ b/extensions/tlon/src/setup-core.ts @@ -1,11 +1,12 @@ import { applyAccountNameToChannelSection, + DEFAULT_ACCOUNT_ID, + normalizeAccountId, patchScopedAccountConfig, -} from "../../../src/channels/plugins/setup-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import type { ChannelSetupInput } from "../../../src/channels/plugins/types.core.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + type ChannelSetupAdapter, + type ChannelSetupInput, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { buildTlonAccountFields } from "./account-fields.js"; import { resolveTlonAccount } from "./types.js"; diff --git a/extensions/tlon/src/setup-surface.ts b/extensions/tlon/src/setup-surface.ts index ec6258277bd..e3c1b43f0c1 100644 --- a/extensions/tlon/src/setup-surface.ts +++ b/extensions/tlon/src/setup-surface.ts @@ -1,6 +1,8 @@ -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; +import { + DEFAULT_ACCOUNT_ID, + formatDocsLink, + type ChannelSetupWizard, +} from "openclaw/plugin-sdk/setup"; import { applyTlonSetupConfig, type TlonSetupInput, tlonSetupAdapter } from "./setup-core.js"; import { normalizeShip } from "./targets.js"; import { listTlonAccountIds, resolveTlonAccount, type TlonResolvedAccount } from "./types.js"; diff --git a/extensions/twitch/src/setup-surface.ts b/extensions/twitch/src/setup-surface.ts index 3113bfd9e3b..ec8a7e741b4 100644 --- a/extensions/twitch/src/setup-surface.ts +++ b/extensions/twitch/src/setup-surface.ts @@ -2,12 +2,14 @@ * Twitch setup wizard surface for CLI setup. */ -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; -import type { WizardPrompter } from "../../../src/wizard/prompts.js"; +import { + formatDocsLink, + type ChannelSetupAdapter, + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type OpenClawConfig, + type WizardPrompter, +} from "openclaw/plugin-sdk/setup"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import type { TwitchAccountConfig, TwitchRole } from "./types.js"; import { isAccountConfigured } from "./utils/twitch.js"; diff --git a/extensions/whatsapp/src/setup-surface.ts b/extensions/whatsapp/src/setup-surface.ts index 41204ecfcb9..805bd7eb397 100644 --- a/extensions/whatsapp/src/setup-surface.ts +++ b/extensions/whatsapp/src/setup-surface.ts @@ -1,5 +1,4 @@ import path from "node:path"; -import type { DmPolicy } from "openclaw/plugin-sdk/whatsapp"; import { DEFAULT_ACCOUNT_ID, formatCliCommand, diff --git a/extensions/zalo/src/setup-core.ts b/extensions/zalo/src/setup-core.ts index 6e194a41652..fd6d09449ad 100644 --- a/extensions/zalo/src/setup-core.ts +++ b/extensions/zalo/src/setup-core.ts @@ -1,10 +1,11 @@ import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, + DEFAULT_ACCOUNT_ID, migrateBaseNameToDefaultAccount, -} from "../../../src/channels/plugins/setup-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + normalizeAccountId, + type ChannelSetupAdapter, +} from "openclaw/plugin-sdk/setup"; const channel = "zalo" as const; diff --git a/extensions/zalo/src/setup-surface.ts b/extensions/zalo/src/setup-surface.ts index 6ae6a78be0f..50e6761b35a 100644 --- a/extensions/zalo/src/setup-surface.ts +++ b/extensions/zalo/src/setup-surface.ts @@ -1,17 +1,18 @@ import { buildSingleChannelSecretPromptState, + DEFAULT_ACCOUNT_ID, + formatDocsLink, + hasConfiguredSecretInput, mergeAllowFromEntries, + normalizeAccountId, promptSingleChannelSecretInput, runSingleChannelSecretStep, setTopLevelChannelDmPolicyWithAllowFrom, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import type { SecretInput } from "../../../src/config/types.secrets.js"; -import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type OpenClawConfig, + type SecretInput, +} from "openclaw/plugin-sdk/setup"; import { listZaloAccountIds, resolveDefaultZaloAccountId, resolveZaloAccount } from "./accounts.js"; import { zaloSetupAdapter } from "./setup-core.js"; diff --git a/extensions/zalouser/src/setup-core.ts b/extensions/zalouser/src/setup-core.ts index 45f412ed9f6..9e66e2c63c6 100644 --- a/extensions/zalouser/src/setup-core.ts +++ b/extensions/zalouser/src/setup-core.ts @@ -1,10 +1,11 @@ import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, + DEFAULT_ACCOUNT_ID, migrateBaseNameToDefaultAccount, -} from "../../../src/channels/plugins/setup-helpers.js"; -import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; + normalizeAccountId, + type ChannelSetupAdapter, +} from "openclaw/plugin-sdk/setup"; const channel = "zalouser" as const; diff --git a/extensions/zalouser/src/setup-surface.ts b/extensions/zalouser/src/setup-surface.ts index 74f940e5077..f51b55ff068 100644 --- a/extensions/zalouser/src/setup-surface.ts +++ b/extensions/zalouser/src/setup-surface.ts @@ -1,14 +1,15 @@ -import { patchScopedAccountConfig } from "../../../src/channels/plugins/setup-helpers.js"; import { + DEFAULT_ACCOUNT_ID, + formatDocsLink, + formatResolvedUnresolvedNote, mergeAllowFromEntries, + normalizeAccountId, + patchScopedAccountConfig, setTopLevelChannelDmPolicyWithAllowFrom, -} from "../../../src/channels/plugins/setup-wizard-helpers.js"; -import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js"; -import type { OpenClawConfig } from "../../../src/config/config.js"; -import { formatResolvedUnresolvedNote } from "../../../src/plugin-sdk/resolution-notes.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js"; -import { formatDocsLink } from "../../../src/terminal/links.js"; + type ChannelSetupDmPolicy, + type ChannelSetupWizard, + type OpenClawConfig, +} from "openclaw/plugin-sdk/setup"; import { listZalouserAccountIds, resolveDefaultZalouserAccountId, diff --git a/package.json b/package.json index eaae91d6a40..95763eb8a0f 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,10 @@ "types": "./dist/plugin-sdk/routing.d.ts", "default": "./dist/plugin-sdk/routing.js" }, + "./plugin-sdk/setup": { + "types": "./dist/plugin-sdk/setup.d.ts", + "default": "./dist/plugin-sdk/setup.js" + }, "./plugin-sdk/telegram": { "types": "./dist/plugin-sdk/telegram.d.ts", "default": "./dist/plugin-sdk/telegram.js" @@ -226,10 +230,34 @@ "types": "./dist/plugin-sdk/account-id.d.ts", "default": "./dist/plugin-sdk/account-id.js" }, + "./plugin-sdk/allow-from": { + "types": "./dist/plugin-sdk/allow-from.d.ts", + "default": "./dist/plugin-sdk/allow-from.js" + }, + "./plugin-sdk/boolean-param": { + "types": "./dist/plugin-sdk/boolean-param.d.ts", + "default": "./dist/plugin-sdk/boolean-param.js" + }, + "./plugin-sdk/channel-config-helpers": { + "types": "./dist/plugin-sdk/channel-config-helpers.d.ts", + "default": "./dist/plugin-sdk/channel-config-helpers.js" + }, + "./plugin-sdk/group-access": { + "types": "./dist/plugin-sdk/group-access.d.ts", + "default": "./dist/plugin-sdk/group-access.js" + }, + "./plugin-sdk/json-store": { + "types": "./dist/plugin-sdk/json-store.d.ts", + "default": "./dist/plugin-sdk/json-store.js" + }, "./plugin-sdk/keyed-async-queue": { "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", "default": "./dist/plugin-sdk/keyed-async-queue.js" }, + "./plugin-sdk/request-url": { + "types": "./dist/plugin-sdk/request-url.d.ts", + "default": "./dist/plugin-sdk/request-url.js" + }, "./cli-entry": "./openclaw.mjs" }, "scripts": { diff --git a/scripts/lib/plugin-sdk-entrypoints.json b/scripts/lib/plugin-sdk-entrypoints.json index a6de3f4e24e..f99be019a69 100644 --- a/scripts/lib/plugin-sdk-entrypoints.json +++ b/scripts/lib/plugin-sdk-entrypoints.json @@ -7,6 +7,7 @@ "sandbox", "self-hosted-provider-setup", "routing", + "setup", "telegram", "discord", "slack", @@ -46,5 +47,11 @@ "zalo", "zalouser", "account-id", - "keyed-async-queue" + "allow-from", + "boolean-param", + "channel-config-helpers", + "group-access", + "json-store", + "keyed-async-queue", + "request-url" ] diff --git a/src/plugin-sdk/subpaths.test.ts b/src/plugin-sdk/subpaths.test.ts index 7b15bcfce97..d7d15f88748 100644 --- a/src/plugin-sdk/subpaths.test.ts +++ b/src/plugin-sdk/subpaths.test.ts @@ -14,6 +14,7 @@ import * as ollamaSetupSdk from "openclaw/plugin-sdk/ollama-setup"; import * as providerSetupSdk from "openclaw/plugin-sdk/provider-setup"; import * as sandboxSdk from "openclaw/plugin-sdk/sandbox"; import * as selfHostedProviderSetupSdk from "openclaw/plugin-sdk/self-hosted-provider-setup"; +import * as setupSdk from "openclaw/plugin-sdk/setup"; import * as signalSdk from "openclaw/plugin-sdk/signal"; import * as slackSdk from "openclaw/plugin-sdk/slack"; import * as telegramSdk from "openclaw/plugin-sdk/telegram"; @@ -63,6 +64,14 @@ describe("plugin-sdk subpath exports", () => { ); }); + it("exports shared setup helpers from the dedicated subpath", () => { + expect(typeof setupSdk.DEFAULT_ACCOUNT_ID).toBe("string"); + expect(typeof setupSdk.formatDocsLink).toBe("function"); + expect(typeof setupSdk.mergeAllowFromEntries).toBe("function"); + expect(typeof setupSdk.setTopLevelChannelDmPolicyWithAllowFrom).toBe("function"); + expect(typeof setupSdk.formatResolvedUnresolvedNote).toBe("function"); + }); + it("exports narrow self-hosted provider setup helpers", () => { expect(typeof selfHostedProviderSetupSdk.buildVllmProvider).toBe("function"); expect(typeof selfHostedProviderSetupSdk.buildSglangProvider).toBe("function");