Plugins/twitch: migrate to scoped plugin-sdk imports

This commit is contained in:
Gustavo Madeira Santana
2026-03-04 02:33:15 -05:00
parent 72e774431c
commit a9af933486
15 changed files with 20 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/twitch";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core"; import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/twitch";
import { twitchPlugin } from "./src/plugin.js"; import { twitchPlugin } from "./src/plugin.js";
import { setTwitchRuntime } from "./src/runtime.js"; import { setTwitchRuntime } from "./src/runtime.js";

View File

@@ -1,4 +1,4 @@
import { MarkdownConfigSchema } from "openclaw/plugin-sdk/compat"; import { MarkdownConfigSchema } from "openclaw/plugin-sdk/twitch";
import { z } from "zod"; import { z } from "zod";
/** /**

View File

@@ -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"; import type { TwitchAccountConfig } from "./types.js";
/** /**

View File

@@ -5,8 +5,8 @@
* resolves agent routes, and handles replies. * resolves agent routes, and handles replies.
*/ */
import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import { createReplyPrefixOptions } from "openclaw/plugin-sdk/compat"; import { createReplyPrefixOptions } from "openclaw/plugin-sdk/twitch";
import { checkTwitchAccessControl } from "./access-control.js"; import { checkTwitchAccessControl } from "./access-control.js";
import { getOrCreateClientManager } from "./client-manager-registry.js"; import { getOrCreateClientManager } from "./client-manager-registry.js";
import { getTwitchRuntime } from "./runtime.js"; import { getTwitchRuntime } from "./runtime.js";

View File

@@ -11,11 +11,11 @@
* - setTwitchAccount config updates * - 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 { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { TwitchAccountConfig } from "./types.js"; import type { TwitchAccountConfig } from "./types.js";
vi.mock("openclaw/plugin-sdk", () => ({ vi.mock("openclaw/plugin-sdk/twitch", () => ({
formatDocsLink: (url: string, fallback: string) => fallback || url, formatDocsLink: (url: string, fallback: string) => fallback || url,
promptChannelAccessConfig: vi.fn(async () => null), promptChannelAccessConfig: vi.fn(async () => null),
})); }));

View File

@@ -2,14 +2,14 @@
* Twitch onboarding adapter for CLI setup wizard. * Twitch onboarding adapter for CLI setup wizard.
*/ */
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import { import {
formatDocsLink, formatDocsLink,
promptChannelAccessConfig, promptChannelAccessConfig,
type ChannelOnboardingAdapter, type ChannelOnboardingAdapter,
type ChannelOnboardingDmPolicy, type ChannelOnboardingDmPolicy,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/twitch";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import type { TwitchAccountConfig, TwitchRole } from "./types.js"; import type { TwitchAccountConfig, TwitchRole } from "./types.js";
import { isAccountConfigured } from "./utils/twitch.js"; import { isAccountConfigured } from "./utils/twitch.js";

View File

@@ -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 { describe, expect, it } from "vitest";
import { twitchPlugin } from "./plugin.js"; import { twitchPlugin } from "./plugin.js";

View File

@@ -5,8 +5,8 @@
* This is the primary entry point for the Twitch channel integration. * This is the primary entry point for the Twitch channel integration.
*/ */
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/compat"; import { buildChannelConfigSchema } from "openclaw/plugin-sdk/twitch";
import { twitchMessageActions } from "./actions.js"; import { twitchMessageActions } from "./actions.js";
import { removeClientManager } from "./client-manager-registry.js"; import { removeClientManager } from "./client-manager-registry.js";
import { TwitchConfigSchema } from "./config-schema.js"; import { TwitchConfigSchema } from "./config-schema.js";

View File

@@ -1,6 +1,6 @@
import { StaticAuthProvider } from "@twurple/auth"; import { StaticAuthProvider } from "@twurple/auth";
import { ChatClient } from "@twurple/chat"; 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 type { TwitchAccountConfig } from "./types.js";
import { normalizeToken } from "./utils/twitch.js"; import { normalizeToken } from "./utils/twitch.js";

View File

@@ -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; let runtime: PluginRuntime | null = null;

View File

@@ -5,7 +5,7 @@
* They support dependency injection via the `deps` parameter for testability. * 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 { getClientManager as getRegistryClientManager } from "./client-manager-registry.js";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import { resolveTwitchToken } from "./token.js"; import { resolveTwitchToken } from "./token.js";

View File

@@ -4,7 +4,7 @@
* Detects and reports configuration issues for Twitch accounts. * 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 { getAccountConfig } from "./config.js";
import { resolveTwitchToken } from "./token.js"; import { resolveTwitchToken } from "./token.js";
import type { ChannelAccountSnapshot } from "./types.js"; import type { ChannelAccountSnapshot } from "./types.js";

View File

@@ -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"; import { afterEach, beforeEach, vi } from "vitest";
export const BASE_TWITCH_TEST_ACCOUNT = { export const BASE_TWITCH_TEST_ACCOUNT = {

View File

@@ -8,7 +8,7 @@
* - Account ID normalization * - 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 { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveTwitchToken, type TwitchTokenSource } from "./token.js"; import { resolveTwitchToken, type TwitchTokenSource } from "./token.js";

View File

@@ -1,6 +1,6 @@
import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth"; import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth";
import { ChatClient, LogLevel } from "@twurple/chat"; 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 { resolveTwitchToken } from "./token.js";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js"; import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { normalizeToken } from "./utils/twitch.js"; import { normalizeToken } from "./utils/twitch.js";