Plugins: internalize twitch SDK imports

This commit is contained in:
Vincent Koc
2026-03-17 21:41:01 -07:00
parent 645c5bda2c
commit 5642fb2682
13 changed files with 15 additions and 18 deletions

View File

@@ -1 +1,2 @@
export * from "openclaw/plugin-sdk/twitch";
export * from "./src/setup-surface.js";

View File

@@ -1,5 +1,5 @@
import { MarkdownConfigSchema } from "openclaw/plugin-sdk/twitch";
import { z } from "zod";
import { MarkdownConfigSchema } from "../api.js";
/**
* Twitch user roles that can be allowed to interact with the bot

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import type { OpenClawConfig } from "../api.js";
import type { TwitchAccountConfig } from "./types.js";
/**

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import { StaticAuthProvider } from "@twurple/auth";
import { ChatClient } from "@twurple/chat";
import type { BaseProbeResult } from "openclaw/plugin-sdk/twitch";
import type { BaseProbeResult } from "../api.js";
import type { TwitchAccountConfig } from "./types.js";
import { normalizeToken } from "./utils/twitch.js";

View File

@@ -1,5 +1,5 @@
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
import type { PluginRuntime } from "openclaw/plugin-sdk/twitch";
import type { PluginRuntime } from "../api.js";
const { setRuntime: setTwitchRuntime, getRuntime: getTwitchRuntime } =
createPluginRuntimeStore<PluginRuntime>("Twitch runtime not initialized");

View File

@@ -5,7 +5,7 @@
* They support dependency injection via the `deps` parameter for testability.
*/
import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import type { OpenClawConfig } from "../api.js";
import { getClientManager as getRegistryClientManager } from "./client-manager-registry.js";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import { resolveTwitchToken } from "./token.js";

View File

@@ -4,7 +4,7 @@
* Detects and reports configuration issues for Twitch accounts.
*/
import type { ChannelStatusIssue } from "openclaw/plugin-sdk/twitch";
import type { ChannelStatusIssue } from "../api.js";
import { getAccountConfig } from "./config.js";
import { resolveTwitchToken } from "./token.js";
import type { ChannelAccountSnapshot } from "./types.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import { afterEach, beforeEach, vi } from "vitest";
import type { OpenClawConfig } from "../api.js";
export const BASE_TWITCH_TEST_ACCOUNT = {
username: "testbot",

View File

@@ -9,11 +9,7 @@
* 2. Environment variable: OPENCLAW_TWITCH_ACCESS_TOKEN (default account only)
*/
import {
DEFAULT_ACCOUNT_ID,
normalizeAccountId,
type OpenClawConfig,
} from "openclaw/plugin-sdk/twitch";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, type OpenClawConfig } from "../api.js";
export type TwitchTokenSource = "env" | "config" | "none";

View File

@@ -1,6 +1,6 @@
import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth";
import { ChatClient, LogLevel } from "@twurple/chat";
import type { OpenClawConfig } from "openclaw/plugin-sdk/twitch";
import type { OpenClawConfig } from "../api.js";
import { resolveTwitchToken } from "./token.js";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { normalizeToken } from "./utils/twitch.js";

View File

@@ -22,7 +22,7 @@ import type {
OpenClawConfig,
OutboundDeliveryResult,
RuntimeEnv,
} from "openclaw/plugin-sdk/twitch";
} from "../api.js";
// ============================================================================
// Twitch-Specific Types