mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 18:41:24 +00:00
chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { checkTwitchAccessControl, extractMentions } from "./access-control.js";
|
||||
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
|
||||
import { checkTwitchAccessControl, extractMentions } from "./access-control.js";
|
||||
|
||||
describe("checkTwitchAccessControl", () => {
|
||||
const mockAccount: TwitchAccountConfig = {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Handles tool-based actions for Twitch, such as sending messages.
|
||||
*/
|
||||
|
||||
import type { ChannelMessageActionAdapter, ChannelMessageActionContext } from "./types.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { twitchOutbound } from "./outbound.js";
|
||||
import type { ChannelMessageActionAdapter, ChannelMessageActionContext } from "./types.js";
|
||||
|
||||
/**
|
||||
* Create a tool result with error content.
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* ensuring proper cleanup when accounts are stopped or reconfigured.
|
||||
*/
|
||||
|
||||
import { TwitchClientManager } from "./twitch-client.js";
|
||||
import type { ChannelLogSink } from "./types.js";
|
||||
import { TwitchClientManager } from "./twitch-client.js";
|
||||
|
||||
/**
|
||||
* Registry entry tracking a client manager and its associated account.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getAccountConfig } from "./config.js";
|
||||
|
||||
describe("getAccountConfig", () => {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
|
||||
import { checkTwitchAccessControl } from "./access-control.js";
|
||||
import { getTwitchRuntime } from "./runtime.js";
|
||||
import { getOrCreateClientManager } from "./client-manager-registry.js";
|
||||
import { getTwitchRuntime } from "./runtime.js";
|
||||
import { stripMarkdownForTwitch } from "./utils/markdown.js";
|
||||
|
||||
export type TwitchRuntimeEnv = {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* - setTwitchAccount config updates
|
||||
*/
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { WizardPrompter } from "openclaw/plugin-sdk";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { TwitchAccountConfig } from "./types.js";
|
||||
|
||||
// Mock the helpers we're testing
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Twitch onboarding adapter for CLI setup wizard.
|
||||
*/
|
||||
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import {
|
||||
formatDocsLink,
|
||||
promptChannelAccessConfig,
|
||||
@@ -9,10 +10,9 @@ import {
|
||||
type ChannelOnboardingDmPolicy,
|
||||
type WizardPrompter,
|
||||
} from "openclaw/plugin-sdk";
|
||||
import type { TwitchAccountConfig, TwitchRole } from "./types.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { isAccountConfigured } from "./utils/twitch.js";
|
||||
import type { TwitchAccountConfig, TwitchRole } from "./types.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
|
||||
const channel = "twitch" as const;
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
* - Abort signal handling
|
||||
*/
|
||||
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { twitchOutbound } from "./outbound.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock("./config.js", () => ({
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
* Supports text and media (URL) sending with markdown stripping and chunking.
|
||||
*/
|
||||
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { sendMessageTwitchInternal } from "./send.js";
|
||||
import type {
|
||||
ChannelOutboundAdapter,
|
||||
ChannelOutboundContext,
|
||||
OutboundDeliveryResult,
|
||||
} from "./types.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { sendMessageTwitchInternal } from "./send.js";
|
||||
import { chunkTextForTwitch } from "./utils/markdown.js";
|
||||
import { missingTargetError, normalizeTwitchChannel } from "./utils/twitch.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { twitchPlugin } from "./plugin.js";
|
||||
|
||||
describe("twitchPlugin.status.buildAccountSnapshot", () => {
|
||||
|
||||
@@ -7,17 +7,6 @@
|
||||
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { buildChannelConfigSchema } from "openclaw/plugin-sdk";
|
||||
import { twitchMessageActions } from "./actions.js";
|
||||
import { TwitchConfigSchema } from "./config-schema.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig, listAccountIds } from "./config.js";
|
||||
import { twitchOnboardingAdapter } from "./onboarding.js";
|
||||
import { twitchOutbound } from "./outbound.js";
|
||||
import { probeTwitch } from "./probe.js";
|
||||
import { resolveTwitchTargets } from "./resolver.js";
|
||||
import { collectTwitchStatusIssues } from "./status.js";
|
||||
import { removeClientManager } from "./client-manager-registry.js";
|
||||
import { resolveTwitchToken } from "./token.js";
|
||||
import { isAccountConfigured } from "./utils/twitch.js";
|
||||
import type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelCapabilities,
|
||||
@@ -28,6 +17,17 @@ import type {
|
||||
ChannelResolveResult,
|
||||
TwitchAccountConfig,
|
||||
} from "./types.js";
|
||||
import { twitchMessageActions } from "./actions.js";
|
||||
import { removeClientManager } from "./client-manager-registry.js";
|
||||
import { TwitchConfigSchema } from "./config-schema.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig, listAccountIds } from "./config.js";
|
||||
import { twitchOnboardingAdapter } from "./onboarding.js";
|
||||
import { twitchOutbound } from "./outbound.js";
|
||||
import { probeTwitch } from "./probe.js";
|
||||
import { resolveTwitchTargets } from "./resolver.js";
|
||||
import { collectTwitchStatusIssues } from "./status.js";
|
||||
import { resolveTwitchToken } from "./token.js";
|
||||
import { isAccountConfigured } from "./utils/twitch.js";
|
||||
|
||||
/**
|
||||
* Twitch channel plugin.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { probeTwitch } from "./probe.js";
|
||||
import type { TwitchAccountConfig } from "./types.js";
|
||||
import { probeTwitch } from "./probe.js";
|
||||
|
||||
// Mock Twurple modules - Vitest v4 compatible mocking
|
||||
const mockUnbind = vi.fn();
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
* - Registry integration
|
||||
*/
|
||||
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { sendMessageTwitchInternal } from "./send.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock("./config.js", () => ({
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* They support dependency injection via the `deps` parameter for testability.
|
||||
*/
|
||||
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { getClientManager as getRegistryClientManager } from "./client-manager-registry.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { getClientManager as getRegistryClientManager } from "./client-manager-registry.js";
|
||||
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
|
||||
import { resolveTwitchToken } from "./token.js";
|
||||
import { stripMarkdownForTwitch } from "./utils/markdown.js";
|
||||
import { generateMessageId, isAccountConfigured, normalizeTwitchChannel } from "./utils/twitch.js";
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { collectTwitchStatusIssues } from "./status.js";
|
||||
import type { ChannelAccountSnapshot } from "./types.js";
|
||||
import { collectTwitchStatusIssues } from "./status.js";
|
||||
|
||||
describe("status", () => {
|
||||
describe("collectTwitchStatusIssues", () => {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Detects and reports configuration issues for Twitch accounts.
|
||||
*/
|
||||
|
||||
import { getAccountConfig } from "./config.js";
|
||||
import type { ChannelAccountSnapshot, ChannelStatusIssue } from "./types.js";
|
||||
import { getAccountConfig } from "./config.js";
|
||||
import { resolveTwitchToken } from "./token.js";
|
||||
import { isAccountConfigured } from "./utils/twitch.js";
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* - Account ID normalization
|
||||
*/
|
||||
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { resolveTwitchToken, type TwitchTokenSource } from "./token.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
|
||||
describe("token", () => {
|
||||
// Multi-account config for testing non-default accounts
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { TwitchClientManager } from "./twitch-client.js";
|
||||
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
|
||||
import { TwitchClientManager } from "./twitch-client.js";
|
||||
|
||||
// Mock @twurple dependencies
|
||||
const mockConnect = vi.fn().mockResolvedValue(undefined);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth";
|
||||
import { ChatClient, LogLevel } from "@twurple/chat";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
|
||||
import { resolveTwitchToken } from "./token.js";
|
||||
import { normalizeToken } from "./utils/twitch.js";
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
* from OpenClaw core.
|
||||
*/
|
||||
|
||||
import type {
|
||||
ChannelGatewayContext,
|
||||
ChannelOutboundAdapter,
|
||||
ChannelOutboundContext,
|
||||
ChannelResolveKind,
|
||||
ChannelResolveResult,
|
||||
ChannelStatusAdapter,
|
||||
} from "../../../src/channels/plugins/types.adapters.js";
|
||||
import type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelCapabilities,
|
||||
@@ -14,14 +22,6 @@ import type {
|
||||
ChannelMeta,
|
||||
} from "../../../src/channels/plugins/types.core.js";
|
||||
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
||||
import type {
|
||||
ChannelGatewayContext,
|
||||
ChannelOutboundAdapter,
|
||||
ChannelOutboundContext,
|
||||
ChannelResolveKind,
|
||||
ChannelResolveResult,
|
||||
ChannelStatusAdapter,
|
||||
} from "../../../src/channels/plugins/types.adapters.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { OutboundDeliveryResult } from "../../../src/infra/outbound/deliver.js";
|
||||
import type { RuntimeEnv } from "../../../src/runtime.js";
|
||||
@@ -132,9 +132,9 @@ export type {
|
||||
OutboundDeliveryResult,
|
||||
};
|
||||
|
||||
import type { z } from "zod";
|
||||
// Import and re-export the schema type
|
||||
import type { TwitchConfigSchema } from "./config-schema.js";
|
||||
import type { z } from "zod";
|
||||
export type TwitchConfig = z.infer<typeof TwitchConfigSchema>;
|
||||
|
||||
export type { OpenClawConfig };
|
||||
|
||||
Reference in New Issue
Block a user