From a9af9334868da48869719ed9640abc6142bd1a90 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Wed, 4 Mar 2026 02:33:15 -0500 Subject: [PATCH] Plugins/twitch: migrate to scoped plugin-sdk imports --- extensions/twitch/index.ts | 4 ++-- extensions/twitch/src/config-schema.ts | 2 +- extensions/twitch/src/config.ts | 2 +- extensions/twitch/src/monitor.ts | 4 ++-- extensions/twitch/src/onboarding.test.ts | 4 ++-- extensions/twitch/src/onboarding.ts | 4 ++-- extensions/twitch/src/plugin.test.ts | 2 +- extensions/twitch/src/plugin.ts | 4 ++-- extensions/twitch/src/probe.ts | 2 +- extensions/twitch/src/runtime.ts | 2 +- extensions/twitch/src/send.ts | 2 +- extensions/twitch/src/status.ts | 2 +- extensions/twitch/src/test-fixtures.ts | 2 +- extensions/twitch/src/token.test.ts | 2 +- extensions/twitch/src/twitch-client.ts | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions/twitch/index.ts b/extensions/twitch/index.ts index 7cf7b7f85e8..cbdb20bff4d 100644 --- a/extensions/twitch/index.ts +++ b/extensions/twitch/index.ts @@ -1,5 +1,5 @@ -import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core"; -import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk/twitch"; +import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/twitch"; import { twitchPlugin } from "./src/plugin.js"; import { setTwitchRuntime } from "./src/runtime.js"; diff --git a/extensions/twitch/src/config-schema.ts b/extensions/twitch/src/config-schema.ts index 2542591d8f9..1b45004ba6b 100644 --- a/extensions/twitch/src/config-schema.ts +++ b/extensions/twitch/src/config-schema.ts @@ -1,4 +1,4 @@ -import { MarkdownConfigSchema } from "openclaw/plugin-sdk/compat"; +import { MarkdownConfigSchema } from "openclaw/plugin-sdk/twitch"; import { z } from "zod"; /** diff --git a/extensions/twitch/src/config.ts b/extensions/twitch/src/config.ts index 7b65cce7e9a..de960f4dc8a 100644 --- a/extensions/twitch/src/config.ts +++ b/extensions/twitch/src/config.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import type { TwitchAccountConfig } from "./types.js"; /** diff --git a/extensions/twitch/src/monitor.ts b/extensions/twitch/src/monitor.ts index d70c04cc2d8..f5c3d690b52 100644 --- a/extensions/twitch/src/monitor.ts +++ b/extensions/twitch/src/monitor.ts @@ -5,8 +5,8 @@ * resolves agent routes, and handles replies. */ -import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk/compat"; -import { createReplyPrefixOptions } from "openclaw/plugin-sdk/compat"; +import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk/twitch"; +import { createReplyPrefixOptions } from "openclaw/plugin-sdk/twitch"; import { checkTwitchAccessControl } from "./access-control.js"; import { getOrCreateClientManager } from "./client-manager-registry.js"; import { getTwitchRuntime } from "./runtime.js"; diff --git a/extensions/twitch/src/onboarding.test.ts b/extensions/twitch/src/onboarding.test.ts index 4df95f39fb3..b8946eefc49 100644 --- a/extensions/twitch/src/onboarding.test.ts +++ b/extensions/twitch/src/onboarding.test.ts @@ -11,11 +11,11 @@ * - setTwitchAccount config updates */ -import type { WizardPrompter } from "openclaw/plugin-sdk/compat"; +import type { WizardPrompter } from "openclaw/plugin-sdk/twitch"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import type { TwitchAccountConfig } from "./types.js"; -vi.mock("openclaw/plugin-sdk", () => ({ +vi.mock("openclaw/plugin-sdk/twitch", () => ({ formatDocsLink: (url: string, fallback: string) => fallback || url, promptChannelAccessConfig: vi.fn(async () => null), })); diff --git a/extensions/twitch/src/onboarding.ts b/extensions/twitch/src/onboarding.ts index 6148f165fb4..060857bf383 100644 --- a/extensions/twitch/src/onboarding.ts +++ b/extensions/twitch/src/onboarding.ts @@ -2,14 +2,14 @@ * Twitch onboarding adapter for CLI setup wizard. */ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { formatDocsLink, promptChannelAccessConfig, type ChannelOnboardingAdapter, type ChannelOnboardingDmPolicy, type WizardPrompter, -} from "openclaw/plugin-sdk/compat"; +} from "openclaw/plugin-sdk/twitch"; 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/twitch/src/plugin.test.ts b/extensions/twitch/src/plugin.test.ts index fa1a9a51d39..cc52a7ca7c2 100644 --- a/extensions/twitch/src/plugin.test.ts +++ b/extensions/twitch/src/plugin.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { describe, expect, it } from "vitest"; import { twitchPlugin } from "./plugin.js"; diff --git a/extensions/twitch/src/plugin.ts b/extensions/twitch/src/plugin.ts index 25776af9c7b..f6cf576b6a0 100644 --- a/extensions/twitch/src/plugin.ts +++ b/extensions/twitch/src/plugin.ts @@ -5,8 +5,8 @@ * This is the primary entry point for the Twitch channel integration. */ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; -import { buildChannelConfigSchema } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; +import { buildChannelConfigSchema } from "openclaw/plugin-sdk/twitch"; import { twitchMessageActions } from "./actions.js"; import { removeClientManager } from "./client-manager-registry.js"; import { TwitchConfigSchema } from "./config-schema.js"; diff --git a/extensions/twitch/src/probe.ts b/extensions/twitch/src/probe.ts index 8a55f2425c8..7ce02501007 100644 --- a/extensions/twitch/src/probe.ts +++ b/extensions/twitch/src/probe.ts @@ -1,6 +1,6 @@ import { StaticAuthProvider } from "@twurple/auth"; import { ChatClient } from "@twurple/chat"; -import type { BaseProbeResult } from "openclaw/plugin-sdk/compat"; +import type { BaseProbeResult } from "openclaw/plugin-sdk/twitch"; import type { TwitchAccountConfig } from "./types.js"; import { normalizeToken } from "./utils/twitch.js"; diff --git a/extensions/twitch/src/runtime.ts b/extensions/twitch/src/runtime.ts index f20cbbf475d..5dfdd225c4c 100644 --- a/extensions/twitch/src/runtime.ts +++ b/extensions/twitch/src/runtime.ts @@ -1,4 +1,4 @@ -import type { PluginRuntime } from "openclaw/plugin-sdk/compat"; +import type { PluginRuntime } from "openclaw/plugin-sdk/twitch"; let runtime: PluginRuntime | null = null; diff --git a/extensions/twitch/src/send.ts b/extensions/twitch/src/send.ts index 67f8452296b..f62aadc0e10 100644 --- a/extensions/twitch/src/send.ts +++ b/extensions/twitch/src/send.ts @@ -5,7 +5,7 @@ * They support dependency injection via the `deps` parameter for testability. */ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { getClientManager as getRegistryClientManager } from "./client-manager-registry.js"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import { resolveTwitchToken } from "./token.js"; diff --git a/extensions/twitch/src/status.ts b/extensions/twitch/src/status.ts index 12f220c897b..c30e129f9f1 100644 --- a/extensions/twitch/src/status.ts +++ b/extensions/twitch/src/status.ts @@ -4,7 +4,7 @@ * Detects and reports configuration issues for Twitch accounts. */ -import type { ChannelStatusIssue } from "openclaw/plugin-sdk/compat"; +import type { ChannelStatusIssue } from "openclaw/plugin-sdk/twitch"; import { getAccountConfig } from "./config.js"; import { resolveTwitchToken } from "./token.js"; import type { ChannelAccountSnapshot } from "./types.js"; diff --git a/extensions/twitch/src/test-fixtures.ts b/extensions/twitch/src/test-fixtures.ts index f6c59f6f2df..efc5877765a 100644 --- a/extensions/twitch/src/test-fixtures.ts +++ b/extensions/twitch/src/test-fixtures.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { afterEach, beforeEach, vi } from "vitest"; export const BASE_TWITCH_TEST_ACCOUNT = { diff --git a/extensions/twitch/src/token.test.ts b/extensions/twitch/src/token.test.ts index f5b702ea9a6..132a87ae811 100644 --- a/extensions/twitch/src/token.test.ts +++ b/extensions/twitch/src/token.test.ts @@ -8,7 +8,7 @@ * - Account ID normalization */ -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { resolveTwitchToken, type TwitchTokenSource } from "./token.js"; diff --git a/extensions/twitch/src/twitch-client.ts b/extensions/twitch/src/twitch-client.ts index 4dd1ea8495c..deafd4e01b9 100644 --- a/extensions/twitch/src/twitch-client.ts +++ b/extensions/twitch/src/twitch-client.ts @@ -1,6 +1,6 @@ import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth"; import { ChatClient, LogLevel } from "@twurple/chat"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch"; import { resolveTwitchToken } from "./token.js"; import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js"; import { normalizeToken } from "./utils/twitch.js";