refactor: expose plugin test helpers via sdk

This commit is contained in:
Peter Steinberger
2026-04-27 23:45:08 +01:00
parent 6f09039b0c
commit 0df6e5a473
126 changed files with 659 additions and 349 deletions

View File

@@ -1,2 +1,2 @@
4e36981eb12b201f14b9d94ba44ab23793ed7555b2d736c1f477aeeb02e9ab9c plugin-sdk-api-baseline.json
8228f54b594b2462b1454c5c43c165ca8a57bec10da5b991fb4b3ba65427f61d plugin-sdk-api-baseline.jsonl
af72813b59c6f35912bb5eacb01365d7686e3b2ca4c8813f7582de10c5da3c81 plugin-sdk-api-baseline.json
71603527acce8f5e1112a035dad6def83c0b02afd831b288fb655f83f8cb3bd1 plugin-sdk-api-baseline.jsonl

View File

@@ -258,7 +258,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
| `plugin-sdk/webhook-path` | Webhook path normalization helpers |
| `plugin-sdk/web-media` | Shared remote/local media loading helpers |
| `plugin-sdk/zod` | Re-exported `zod` for plugin SDK consumers |
| `plugin-sdk/testing` | Public extension test helpers including plugin registry/runtime mocks, fetch/env/temp fixtures, schema/media/live-test helpers, `installCommonResolveTargetErrorCases`, `writeSkill`, `createTestRegistry`, and live generation env loading. Extension `*.test-support.ts` helpers stay on this or focused SDK subpaths, not core internals |
| `plugin-sdk/testing` | Public extension test helpers including plugin registry/runtime mocks, provider registration capture, setup-wizard helpers, fetch/env/temp/time fixtures, schema/media/live-test helpers, `installCommonResolveTargetErrorCases`, `writeSkill`, `createTestRegistry`, and live generation env loading. Extension `*.test-support.ts` helpers stay on this or focused SDK subpaths, not core internals |
</Accordion>
<Accordion title="Memory subpaths">

View File

@@ -47,6 +47,13 @@ import {
| `createTempHomeEnv` / `withTempDir` | Create isolated filesystem test fixtures |
| `createMockServerResponse` | Create a minimal HTTP server response mock |
| `registerSingleProviderPlugin` | Register one provider plugin in loader smoke tests |
| `registerProviderPlugin` | Capture all provider kinds from one plugin |
| `requireRegisteredProvider` | Assert that a provider collection contains an id |
| `createProviderUsageFetch` | Build provider usage fetch fixtures |
| `useFrozenTime` / `useRealTime` | Freeze and restore timers for time-sensitive tests |
| `createRuntimeEnv` | Build a mocked CLI/plugin runtime environment |
| `createTestWizardPrompter` | Build a mocked setup wizard prompter |
| `createPluginSetupWizardStatus` | Build setup status helpers for channel plugins |
| `createRuntimeTaskFlow` | Create isolated runtime task-flow state |
| `typedCases` | Preserve literal types for table-driven tests |

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import bedrockMantlePlugin from "./index.js";
describe("amazon-bedrock-mantle provider plugin", () => {

View File

@@ -2,9 +2,8 @@ import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import { buildPluginApi } from "openclaw/plugin-sdk/testing";
import { buildPluginApi, registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { resetBedrockDiscoveryCacheForTest } from "./discovery.js";
import amazonBedrockPlugin from "./index.js";
import {

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
function mockBedrockSdkImportTripwire(): () => number {
let importCount = 0;

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
const { hasAnthropicVertexAvailableAuthMock } = vi.hoisted(() => ({
hasAnthropicVertexAvailableAuthMock: vi.fn(),

View File

@@ -20,9 +20,8 @@ vi.mock("./cli-auth-seam.js", async (importActual) => {
});
const { buildAnthropicCliMigrationResult, hasClaudeCliAuth } = await import("./cli-migration.js");
const { registerSingleProviderPlugin } =
await import("../../test/helpers/plugins/plugin-registration.js");
const { createTestWizardPrompter } = await import("../../test/helpers/plugins/setup-wizard.js");
const { createTestWizardPrompter, registerSingleProviderPlugin } =
await import("openclaw/plugin-sdk/testing");
const { default: anthropicPlugin } = await import("./index.js");
async function resolveAnthropicCliAuthMethod() {

View File

@@ -2,9 +2,11 @@ import type {
ProviderResolveDynamicModelContext,
ProviderRuntimeModel,
} from "openclaw/plugin-sdk/plugin-entry";
import { capturePluginRegistration } from "openclaw/plugin-sdk/testing";
import {
capturePluginRegistration,
registerSingleProviderPlugin,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
const { readClaudeCliCredentialsForSetupMock, readClaudeCliCredentialsForRuntimeMock } = vi.hoisted(
() => ({

View File

@@ -1,7 +1,9 @@
import { resolveProviderAuthEnvVarCandidates } from "openclaw/plugin-sdk/provider-env-vars";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { runSingleProviderCatalog } from "../test-support/provider-model-test-helpers.js";
import arceePlugin from "./index.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
const AZURE_SPEECH_KEY =

View File

@@ -2,13 +2,13 @@ import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-h
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
import { isPrivateNetworkOptInEnabled } from "openclaw/plugin-sdk/ssrf-runtime";
import { describe, expect, it, vi } from "vitest";
import {
createSetupWizardAdapter,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { resolveBlueBubblesAccount } from "./accounts.js";
import { BlueBubblesConfigSchema } from "./config-schema.js";
import {

View File

@@ -1,7 +1,7 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
import { BYTEPLUS_CODING_MODEL_CATALOG, BYTEPLUS_MODEL_CATALOG } from "./models.js";

View File

@@ -1,6 +1,6 @@
import { resolveOAuthApiKeyMarker } from "openclaw/plugin-sdk/provider-auth";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
import { CHUTES_BASE_URL } from "./models.js";

View File

@@ -1,7 +1,9 @@
import fs from "node:fs";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
type ComfyManifest = {

View File

@@ -1,9 +1,11 @@
import type { Context, Model } from "@mariozechner/pi-ai";
import { createAssistantMessageEventStream } from "@mariozechner/pi-ai";
import { buildOpenAICompletionsParams } from "openclaw/plugin-sdk/provider-transport-runtime";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { runSingleProviderCatalog } from "../test-support/provider-model-test-helpers.js";
import deepseekPlugin from "./index.js";
import { createDeepSeekV4ThinkingWrapper } from "./stream.js";

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import type { IncomingMessage, ServerResponse } from "node:http";
import path from "node:path";
import { createMockServerResponse } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { createMockServerResponse } from "../../../test/helpers/plugins/mock-http-response.js";
import { createTestPluginApi } from "../../../test/helpers/plugins/plugin-api.js";
import type { OpenClawConfig } from "../api.js";
import type { OpenClawPluginApi, OpenClawPluginToolContext } from "../api.js";

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import type { IncomingMessage } from "node:http";
import path from "node:path";
import { createMockServerResponse } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createMockServerResponse } from "../../../test/helpers/plugins/mock-http-response.js";
import { createDiffsHttpHandler } from "./http.js";
import { DiffArtifactStore } from "./store.js";
import { createDiffStoreHarness } from "./test-helpers.js";

View File

@@ -1,6 +1,6 @@
import { ChannelType, type Guild } from "@buape/carbon";
import { typedCases } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { typedCases } from "../../../test/helpers/plugins/typed-cases.js";
import {
allowListMatches,
type DiscordGuildEntryResolved,

View File

@@ -9,11 +9,8 @@ import {
registerPluginCommand,
} from "openclaw/plugin-sdk/plugin-runtime";
import { dispatchReplyWithDispatcher } from "openclaw/plugin-sdk/reply-dispatch-runtime";
import { createTestRegistry, setActivePluginRegistry } from "openclaw/plugin-sdk/testing";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import {
createTestRegistry,
setActivePluginRegistry,
} from "../../../../test/helpers/plugins/plugin-registry.js";
import { defineThrowingDiscordChannelGetter } from "../test-support/partial-channel.js";
import { resolveDiscordNativeInteractionRouteState } from "./native-command-route.js";
import {

View File

@@ -1,6 +1,6 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { createNonExitingTypedRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingTypedRuntimeEnv } from "../../../../test/helpers/plugins/runtime-env.js";
import * as resolveChannelsModule from "../resolve-channels.js";
import * as resolveUsersModule from "../resolve-users.js";
import { resolveDiscordAllowlistConfig } from "./provider.allowlist.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
normalizeTranscriptForMatch,
runRealtimeSttLiveTest,

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
import {
FeishuRetryableCardActionError,

View File

@@ -1,7 +1,7 @@
import type * as ConversationRuntime from "openclaw/plugin-sdk/conversation-runtime";
import type { ResolvedAgentRoute } from "openclaw/plugin-sdk/routing";
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, PluginRuntime } from "../runtime-api.js";
import type { FeishuMessageEvent } from "./bot.js";
import { handleFeishuMessage } from "./bot.js";

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi, beforeEach } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
import {
expectFirstSentCardUsesFillWidthOnly,

View File

@@ -1,6 +1,6 @@
import "./lifecycle.test-support.js";
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig } from "../runtime-api.js";
import {
getFeishuLifecycleTestMocks,
@@ -30,7 +30,7 @@ const {
} = getFeishuLifecycleTestMocks();
let _handlers: Record<string, (data: unknown) => Promise<void>> = {};
let lastRuntime: ReturnType<typeof createRuntimeEnv> | null = null;
let lastRuntime = createRuntimeEnv();
const originalStateDir = process.env.OPENCLAW_STATE_DIR;
const { cfg: lifecycleConfig, account: lifecycleAccount } = createFeishuLifecycleFixture({
accountId: "acct-acp",
@@ -78,7 +78,7 @@ describe("Feishu ACP-init failure lifecycle", () => {
vi.useRealTimers();
resetFeishuLifecycleTestMocks();
_handlers = {};
lastRuntime = null;
lastRuntime = createRuntimeEnv();
setFeishuLifecycleStateDir("openclaw-feishu-acp-failure");
resolveBoundConversationMock.mockReturnValue(null);

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import "./lifecycle.test-support.js";
import {
getFeishuLifecycleTestMocks,
@@ -33,7 +33,7 @@ const {
} = getFeishuLifecycleTestMocks();
let _handlers: Record<string, (data: unknown) => Promise<void>> = {};
let lastRuntime: ReturnType<typeof createRuntimeEnv> | null = null;
let lastRuntime = createRuntimeEnv();
const originalStateDir = process.env.OPENCLAW_STATE_DIR;
const lifecycleConfig = createFeishuLifecycleConfig({
accountId: "acct-menu",
@@ -90,7 +90,7 @@ describe("Feishu bot-menu lifecycle", () => {
vi.useRealTimers();
resetFeishuLifecycleTestMocks();
_handlers = {};
lastRuntime = null;
lastRuntime = createRuntimeEnv();
setFeishuLifecycleStateDir("openclaw-feishu-bot-menu");
createFeishuReplyDispatcherMock.mockReturnValue(createFeishuLifecycleReplyDispatcher());

View File

@@ -1,6 +1,6 @@
import "./lifecycle.test-support.js";
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
import { FeishuConfigSchema } from "./config-schema.js";
import {

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import "./lifecycle.test-support.js";
import { resetProcessedFeishuCardActionTokensForTests } from "./card-action.js";
import { createFeishuCardInteractionEnvelope } from "./card-interaction.js";
@@ -35,7 +35,7 @@ const {
} = getFeishuLifecycleTestMocks();
let _handlers: Record<string, (data: unknown) => Promise<void>> = {};
let lastRuntime: ReturnType<typeof createRuntimeEnv> | null = null;
let lastRuntime = createRuntimeEnv();
const originalStateDir = process.env.OPENCLAW_STATE_DIR;
const lifecycleConfig = createFeishuLifecycleConfig({
accountId: "acct-card",
@@ -117,7 +117,7 @@ describe("Feishu card-action lifecycle", () => {
vi.useRealTimers();
resetFeishuLifecycleTestMocks();
_handlers = {};
lastRuntime = null;
lastRuntime = createRuntimeEnv();
resetProcessedFeishuCardActionTokensForTests();
setFeishuLifecycleStateDir("openclaw-feishu-card-action");

View File

@@ -1,5 +1,5 @@
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig } from "../runtime-api.js";
import * as dedup from "./dedup.js";
import { createFeishuDriveCommentNoticeHandler } from "./monitor.comment-notice-handler.js";
@@ -11,7 +11,7 @@ import {
const handleFeishuCommentEventMock = vi.hoisted(() => vi.fn(async () => {}));
const createFeishuClientMock = vi.hoisted(() => vi.fn());
let lastRuntime: ReturnType<typeof createNonExitingRuntimeEnv> | null = null;
let lastRuntime = createNonExitingRuntimeEnv();
const TEST_DOC_TOKEN = "ZsJfdxrBFo0RwuxteOLc1Ekvneb";
const TEST_WIKI_TOKEN = "OtYpd5pKOoMeQzxrzkocv9KIn4H";
@@ -804,7 +804,7 @@ describe("resolveDriveCommentEventTurn", () => {
describe("drive.notice.comment_add_v1 monitor handler", () => {
beforeEach(() => {
lastRuntime = null;
lastRuntime = createNonExitingRuntimeEnv();
handleFeishuCommentEventMock.mockClear();
createFeishuClientMock.mockReset().mockReturnValue(makeOpenApiClient({}) as never);
vi.spyOn(dedup, "claimUnprocessedFeishuMessage").mockResolvedValue("claimed");

View File

@@ -3,8 +3,8 @@ import {
resolveInboundDebounceMs,
} from "openclaw/plugin-sdk/channel-inbound-debounce";
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
import { createNonExitingTypedRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingTypedRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js";
import { parseFeishuMessageEvent, type FeishuMessageEvent } from "./bot.js";
import * as dedup from "./dedup.js";

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import "./lifecycle.test-support.js";
import {
getFeishuLifecycleTestMocks,
@@ -27,7 +27,7 @@ const {
withReplyDispatcherMock,
} = getFeishuLifecycleTestMocks();
let lastRuntime: ReturnType<typeof createRuntimeEnv> | null = null;
let lastRuntime = createRuntimeEnv();
let lifecycleCore: ReturnType<typeof installFeishuLifecycleReplyRuntime>;
const handleMessageMock = vi.fn();
const originalStateDir = process.env.OPENCLAW_STATE_DIR;
@@ -67,7 +67,7 @@ describe("Feishu reply-once lifecycle", () => {
vi.useRealTimers();
resetFeishuLifecycleTestMocks();
handleMessageMock.mockReset();
lastRuntime = null;
lastRuntime = createRuntimeEnv();
setFeishuLifecycleStateDir("openclaw-feishu-lifecycle");
createFeishuReplyDispatcherMock.mockReturnValue(createFeishuLifecycleReplyDispatcher());

View File

@@ -1,5 +1,5 @@
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig } from "../runtime-api.js";
import { monitorFeishuProvider, stopFeishuMonitor } from "./monitor.js";

View File

@@ -1,11 +1,11 @@
import { describe, expect, it, vi } from "vitest";
import { createNonExitingTypedRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import {
createNonExitingTypedRuntimeEnv,
createPluginSetupWizardConfigure,
createPluginSetupWizardStatus,
createTestWizardPrompter,
runSetupWizardConfigure,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
vi.mock("./probe.js", () => ({
probeFeishu: vi.fn(async () => ({ ok: false, error: "mocked" })),

View File

@@ -1,7 +1,9 @@
import type { ProviderRuntimeModel } from "openclaw/plugin-sdk/plugin-entry";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import {
createProviderDynamicModelContext,
runSingleProviderCatalog,

View File

@@ -1,8 +1,5 @@
import { createProviderUsageFetch, makeResponse } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import {
createProviderUsageFetch,
makeResponse,
} from "../../test/helpers/plugins/provider-usage-fetch.js";
import { buildCopilotModelDefinition, getDefaultCopilotModelIds } from "./models-defaults.js";
import { fetchCopilotUsage } from "./usage.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { normalizeTranscriptForMatch } from "../../test/helpers/stt-live-audio.js";
import plugin from "./index.js";
import { createGeminiWebSearchProvider } from "./src/gemini-web-search-provider.js";

View File

@@ -3,11 +3,8 @@ import type {
ProviderReplaySessionEntry,
ProviderSanitizeReplayHistoryContext,
} from "openclaw/plugin-sdk/plugin-entry";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { createCapturedThinkingConfigStream } from "../../test/helpers/plugins/stream-hooks.js";
import { registerGoogleGeminiCliProvider } from "./gemini-cli-provider.js";
import { registerGoogleProvider } from "./provider-registration.js";

View File

@@ -1,8 +1,11 @@
import { EventEmitter } from "node:events";
import type { IncomingMessage } from "node:http";
import { createEmptyPluginRegistry, setActivePluginRegistry } from "openclaw/plugin-sdk/testing";
import {
createEmptyPluginRegistry,
createMockServerResponse,
setActivePluginRegistry,
} from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createMockServerResponse } from "../../../test/helpers/plugins/mock-http-response.js";
import type { OpenClawConfig, PluginRuntime } from "../runtime-api.js";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { verifyGoogleChatRequest } from "./auth.js";

View File

@@ -1,12 +1,12 @@
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/setup";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createPluginSetupWizardStatus,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
expectLifecyclePatch,
expectPendingUntilAbort,

View File

@@ -1,12 +1,12 @@
import { writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
const LIVE = isLiveTestEnabled();

View File

@@ -1,7 +1,7 @@
import * as processRuntime from "openclaw/plugin-sdk/process-runtime";
import * as setupRuntime from "openclaw/plugin-sdk/setup";
import { createPluginSetupWizardStatus } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js";
import { resolveIMessageAccount } from "./accounts.js";
import * as channelRuntimeModule from "./channel.runtime.js";
import * as clientModule from "./client.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
const INWORLD_API_KEY = process.env.INWORLD_API_KEY?.trim() ?? "";

View File

@@ -1,4 +1,3 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardAdapter,
createPluginSetupWizardStatus,
@@ -6,7 +5,8 @@ import {
promptSetupWizardAllowFrom,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
expectStopPendingUntilAbort,
startAccountAndTrackLifecycle,
@@ -409,15 +409,16 @@ describe("irc setup", () => {
},
};
const updated = (await promptSetupWizardAllowFrom({
const updated = await promptSetupWizardAllowFrom({
promptAllowFrom,
cfg,
prompter,
accountId: "work",
})) as CoreConfig;
});
expect(updated).toBeDefined();
expect(updated.channels?.irc?.allowFrom).toEqual(["alice", "bob!ident@example.org"]);
expect(updated.channels?.irc?.accounts?.work?.allowFrom).toBeUndefined();
expect(updated?.channels?.irc?.allowFrom).toEqual(["alice", "bob!ident@example.org"]);
expect(updated?.channels?.irc?.accounts?.work?.allowFrom).toBeUndefined();
});
it("keeps startAccount pending until abort, then stops the monitor", async () => {

View File

@@ -1,7 +1,7 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import type { Context, Model } from "@mariozechner/pi-ai";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
import plugin from "./index.js";

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
async function runKimiCatalog(params: {

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
describe("kimi provider plugin", () => {

View File

@@ -5,11 +5,8 @@ import type { webhook } from "@line/bot-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
import { __testing as sessionBindingTesting } from "openclaw/plugin-sdk/conversation-runtime";
import { createTestRegistry, setActivePluginRegistry } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import {
createTestRegistry,
setActivePluginRegistry,
} from "../../../test/helpers/plugins/plugin-registry.js";
import { lineBindingsAdapter } from "./bindings.js";
import { buildLineMessageContext, buildLinePostbackContext } from "./bot-message-context.js";
import type { ResolvedLineAccount } from "./types.js";

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { OpenClawConfig, PluginRuntime, ResolvedLineAccount } from "../api.js";
import { lineGatewayAdapter } from "./gateway.js";
import { setLineRuntime } from "./runtime.js";

View File

@@ -1,14 +1,14 @@
import { readFileSync } from "node:fs";
import path from "node:path";
import ts from "typescript";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { bundledPluginRoot } from "../../../test/helpers/bundled-plugin-paths.js";
import {
createPluginSetupWizardConfigure,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import ts from "typescript";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { bundledPluginRoot } from "../../../test/helpers/bundled-plugin-paths.js";
import { createStartAccountContext } from "../../../test/helpers/plugins/start-account-context.js";
import type { OpenClawConfig, PluginRuntime, ResolvedLineAccount } from "../api.js";
import { linePlugin } from "./channel.js";

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { RuntimeEnv } from "../runtime-api.js";
import { matrixPlugin } from "./channel.js";
import { resolveMatrixAccount } from "./matrix/accounts.js";

View File

@@ -1,5 +1,5 @@
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
const resolveMatrixTargetsMock = vi.hoisted(() => vi.fn(async () => []));

View File

@@ -1,10 +1,7 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import type { Context, Model } from "@mariozechner/pi-ai";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { registerMinimaxProviders } from "./provider-registration.js";
import { createMiniMaxWebSearchProvider } from "./src/minimax-web-search-provider.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
import { buildMinimaxSpeechProvider } from "./speech-provider.js";
import { createMiniMaxWebSearchProvider } from "./src/minimax-web-search-provider.js";

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import type { Context, Model } from "@mariozechner/pi-ai";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { createCapturedThinkingConfigStream } from "../../test/helpers/plugins/stream-hooks.js";
import plugin from "./index.js";
import { createKimiWebSearchProvider } from "./src/kimi-web-search-provider.js";

View File

@@ -16,14 +16,12 @@ import {
parseCsvFilter,
parseProviderModelMap,
redactLiveApiKey,
registerProviderPlugin,
requireRegisteredProvider,
resolveConfiguredLiveMusicModels,
resolveLiveMusicAuthStore,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../test/helpers/plugins/provider-registration.js";
import googlePlugin from "./google/index.js";
import minimaxPlugin from "./minimax/index.js";
import { maybeLoadShellEnvForGenerationProviders } from "./test-support/generation-live-test-helpers.js";

View File

@@ -1,10 +1,10 @@
import { describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { nostrSetupWizard } from "./setup-surface.js";
import {

View File

@@ -1,7 +1,9 @@
import fs from "node:fs";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
type NvidiaManifest = {

View File

@@ -2,12 +2,9 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import * as providerAuth from "openclaw/plugin-sdk/provider-auth-runtime";
import * as providerHttp from "openclaw/plugin-sdk/provider-http";
import type { ProviderPlugin } from "openclaw/plugin-sdk/provider-model-shared";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.js";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { buildOpenAIImageGenerationProvider } from "./image-generation-provider.js";
import plugin from "./index.js";
import {

View File

@@ -8,11 +8,8 @@ import type { ResolvedTtsConfig } from "openclaw/plugin-sdk/agent-runtime";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { encodePngRgba, fillPixel } from "openclaw/plugin-sdk/media-runtime";
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { runRealtimeSttLiveTest } from "../../test/helpers/stt-live-audio.js";
import plugin from "./index.js";

View File

@@ -1,3 +1,4 @@
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, it, vi } from "vitest";
import {
expectAugmentedCodexCatalog,
@@ -8,10 +9,6 @@ import {
loadBundledPluginPublicSurface,
} from "../../../test/helpers/plugins/provider-catalog.js";
import type { ProviderPlugin } from "../../../test/helpers/plugins/provider-catalog.js";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../../test/helpers/plugins/provider-registration.js";
const PROVIDER_CATALOG_CONTRACT_TIMEOUT_MS = 300_000;

View File

@@ -1,7 +1,6 @@
import { getModels } from "@mariozechner/pi-ai";
import { registerProviderPlugin, registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { registerProviderPlugin } from "../../test/helpers/plugins/provider-registration.js";
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
import plugin from "./index.js";

View File

@@ -1,8 +1,5 @@
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
import plugin from "./index.js";

View File

@@ -1,6 +1,5 @@
import { registerProviderPlugin, registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { registerProviderPlugin } from "../../test/helpers/plugins/provider-registration.js";
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
import openrouterPlugin from "./index.js";
import {

View File

@@ -1,10 +1,7 @@
import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent";
import OpenAI from "openai";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import plugin from "./index.js";
const OPENROUTER_API_KEY = process.env.OPENROUTER_API_KEY ?? "";

View File

@@ -1,11 +1,11 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import {
createTestRegistry,
resetPluginRuntimeStateForTest,
setActivePluginRegistry,
} from "openclaw/plugin-sdk/testing";
import { extractToolPayload } from "openclaw/plugin-sdk/tool-payload";
import { afterEach, describe, expect, it } from "vitest";
import { createTestRegistry } from "../../../test/helpers/plugins/plugin-registry.js";
import { createStartAccountContext } from "../../../test/helpers/plugins/start-account-context.js";
import { createQaBusState, startQaBusServer } from "../../qa-lab/bus-api.js";
import { qaChannelPlugin, setQaChannelRuntime } from "../api.js";

View File

@@ -1,7 +1,9 @@
import { resolveAgentModelPrimaryValue } from "openclaw/plugin-sdk/provider-onboard";
import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing";
import {
registerSingleProviderPlugin,
resolveProviderPluginChoice,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { runSingleProviderCatalog } from "../test-support/provider-model-test-helpers.js";
import qianfanPlugin from "./index.js";
import {

View File

@@ -1,6 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/testing";
import { type OpenClawConfig, registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import qwenPlugin from "./index.js";
async function registerQwenProvider() {

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { createPluginSetupWizardStatus } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js";
import { signalPlugin } from "./channel.js";
import * as clientModule from "./client.js";
import { classifySignalCliLogLine } from "./daemon.js";

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import { slackPlugin } from "./channel.js";
import { slackOutbound } from "./outbound-adapter.js";
import * as probeModule from "./probe.js";

View File

@@ -1,7 +1,7 @@
import { expectChannelInboundContextContract } from "openclaw/plugin-sdk/channel-contract-testing";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { createTempHomeEnv } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { createTempHomeEnv } from "../../../test/helpers/plugins/temp-home.js";
import {
createInboundSlackTestContext,
prepareSlackMessage,

View File

@@ -1,10 +1,10 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { describe, expect, it, vi } from "vitest";
import {
createTestWizardPrompter,
runSetupWizardFinalize,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { createSlackSetupWizardBase } from "./setup-core.js";
const slackSetupWizard = createSlackSetupWizardBase({

View File

@@ -1,5 +1,5 @@
import { createPluginSetupWizardStatus } from "openclaw/plugin-sdk/testing";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js";
import type { ResolvedSynologyChatAccount } from "./types.js";
const securityAccountDefaults: ResolvedSynologyChatAccount = {

View File

@@ -1,11 +1,11 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { beforeEach, describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { listAccountIds, resolveAccount } from "./accounts.js";
import { SynologyChatChannelConfigSchema } from "./config-schema.js";
import {

View File

@@ -1,5 +1,5 @@
import { useFrozenTime, useRealTime } from "openclaw/plugin-sdk/testing";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { useFrozenTime, useRealTime } from "../../../test/helpers/plugins/frozen-time.js";
const harness = await import("./bot.create-telegram-bot.test-harness.js");
const {

View File

@@ -1,11 +1,11 @@
import { describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createPluginSetupWizardStatus,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../api.js";
import { TlonAuthorizationSchema, TlonConfigSchema } from "./config-schema.js";
import { tlonSetupWizard } from "./setup-surface.js";

View File

@@ -1,5 +1,5 @@
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
describe("venice provider plugin", () => {

View File

@@ -26,6 +26,8 @@ import {
parseProviderModelMap,
parseVideoGenerationModelRef,
redactLiveApiKey,
registerProviderPlugin,
requireRegisteredProvider,
resolveConfiguredLiveVideoModels,
resolveLiveVideoAuthStore,
resolveLiveVideoResolution,
@@ -36,10 +38,6 @@ import {
type VideoGenerationRequest,
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../test/helpers/plugins/provider-registration.js";
import alibabaPlugin from "./alibaba/index.js";
import byteplusPlugin from "./byteplus/index.js";
import falPlugin from "./fal/index.js";

View File

@@ -1,7 +1,7 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
import { DOUBAO_CODING_MODEL_CATALOG, DOUBAO_MODEL_CATALOG } from "./models.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
const LIVE = isLiveTestEnabled();

View File

@@ -1,8 +1,7 @@
import { EventEmitter } from "node:events";
import type { IncomingMessage } from "node:http";
import { createMockServerResponse, createRuntimeTaskFlow } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createMockServerResponse } from "../../../test/helpers/plugins/mock-http-response.js";
import { createRuntimeTaskFlow } from "../../../test/helpers/plugins/runtime-taskflow.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { createTaskFlowWebhookRequestHandler, type TaskFlowWebhookTarget } from "./http.js";

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import path from "node:path";
import { saveSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
import { withTempDir } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { withTempDir } from "../../../../test/helpers/plugins/temp-dir.js";
import {
debugMention,
isBotMentionedFromTargets,

View File

@@ -1,7 +1,7 @@
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { createQueuedWizardPrompter } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createQueuedWizardPrompter } from "../../../test/helpers/plugins/setup-wizard.js";
import { WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store.js";
import { whatsappSetupPlugin } from "./channel.setup.js";
import { checkWhatsAppHeartbeatReady } from "./heartbeat.js";

View File

@@ -1,11 +1,11 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { DEFAULT_ACCOUNT_ID, type OpenClawConfig } from "openclaw/plugin-sdk/setup";
import { beforeEach, describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardStatus,
createQueuedWizardPrompter,
runSetupWizardFinalize,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { whatsappSetupWizard } from "./setup-surface.js";
import {
createWhatsAppAllowlistModeInput,

View File

@@ -1,5 +1,5 @@
import { withFetchPreconnect } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { withFetchPreconnect } from "../../test/helpers/plugins/fetch-mock.js";
import { createCodeExecutionTool } from "./code-execution.js";
function installCodeExecutionFetch(payload?: Record<string, unknown>) {

View File

@@ -1,8 +1,7 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
import { registerProviderPlugin, registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.js";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { registerProviderPlugin } from "../../test/helpers/plugins/provider-registration.js";
import plugin from "./index.js";
import setupPlugin from "./setup-api.js";
import {

View File

@@ -1,7 +1,7 @@
import { NON_ENV_SECRETREF_MARKER } from "openclaw/plugin-sdk/provider-auth-runtime";
import { createNonExitingRuntime } from "openclaw/plugin-sdk/runtime-env";
import { withEnv, withEnvAsync } from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import { withEnv, withEnvAsync } from "../../test/helpers/plugins/env.js";
import { createWizardPrompter } from "../../test/helpers/wizard-prompter.js";
import { resolveXaiCatalogEntry } from "./model-definitions.js";
import { isModernXaiModel, resolveXaiForwardCompatModel } from "./provider-models.js";

View File

@@ -1,5 +1,5 @@
import { withFetchPreconnect } from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { withFetchPreconnect } from "../../test/helpers/plugins/fetch-mock.js";
import { createXSearchTool } from "./x-search.js";
function installXSearchFetch(payload?: Record<string, unknown>) {

View File

@@ -4,11 +4,8 @@ import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import { encodePngRgba, fillPixel } from "openclaw/plugin-sdk/media-runtime";
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
import { registerProviderPlugin, requireRegisteredProvider } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
import { runRealtimeSttLiveTest } from "../../test/helpers/stt-live-audio.js";
import plugin from "./index.js";
import { XAI_DEFAULT_STT_MODEL } from "./stt.js";

View File

@@ -1,9 +1,9 @@
import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import {
isLiveTestEnabled,
registerProviderPlugin,
requireRegisteredProvider,
} from "../../test/helpers/plugins/provider-registration.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
const XIAOMI_API_KEY = process.env.XIAOMI_API_KEY?.trim() ?? "";

View File

@@ -1,8 +1,8 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import type { Context, Model } from "@mariozechner/pi-ai";
import { buildOpenAICompletionsParams } from "openclaw/plugin-sdk/provider-transport-runtime";
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
function createGlm47Template() {

View File

@@ -1,5 +1,5 @@
import { createRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { afterAll, beforeEach, describe, expect, it } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import {
createImageLifecycleCore,
createImageUpdate,

View File

@@ -1,6 +1,9 @@
import { createEmptyPluginRegistry, setActivePluginRegistry } from "openclaw/plugin-sdk/testing";
import {
createEmptyPluginRegistry,
createRuntimeEnv,
setActivePluginRegistry,
} from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { OpenClawConfig } from "../runtime-api.js";
import type { ResolvedZaloAccount } from "./accounts.js";

View File

@@ -1,6 +1,9 @@
import { createEmptyPluginRegistry, setActivePluginRegistry } from "openclaw/plugin-sdk/testing";
import {
createEmptyPluginRegistry,
createRuntimeEnv,
setActivePluginRegistry,
} from "openclaw/plugin-sdk/testing";
import { afterAll, beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { PluginRuntime } from "../runtime-api.js";
import {
createLifecycleMonitorSetup,

View File

@@ -1,5 +1,5 @@
import { createPluginSetupWizardStatus } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { zaloSetupWizard } from "./setup-surface.js";

View File

@@ -1,11 +1,11 @@
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
import { describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { listZaloAccountIds, resolveDefaultZaloAccountId, resolveZaloAccount } from "./accounts.js";
import { zaloDmPolicy } from "./setup-core.js";

View File

@@ -1,10 +1,10 @@
import { vi, type Mock } from "vitest";
import {
createEmptyPluginRegistry,
createRuntimeEnv,
setActivePluginRegistry,
} from "../../../test/helpers/plugins/plugin-registry.js";
} from "openclaw/plugin-sdk/testing";
import { vi, type Mock } from "vitest";
import { createPluginRuntimeMock } from "../../../test/helpers/plugins/plugin-runtime-mock.js";
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { OpenClawConfig } from "../runtime-api.js";
import type { ResolvedZaloAccount } from "../src/types.js";

View File

@@ -1,9 +1,8 @@
import { mkdtemp, rm } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { withEnvAsync } from "openclaw/plugin-sdk/testing";
import { createPluginSetupWizardStatus, withEnvAsync } from "openclaw/plugin-sdk/testing";
import { describe, expect, it } from "vitest";
import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js";
import "./zalo-js.test-mocks.js";
import { zalouserSetupPlugin } from "./setup-test-helpers.js";

View File

@@ -1,5 +1,5 @@
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import "./zalo-js.test-mocks.js";
import {
zalouserAuthAdapter,

View File

@@ -1,9 +1,9 @@
import { describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardConfigure,
createTestWizardPrompter,
runSetupWizardConfigure,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import "./zalo-js.test-mocks.js";
import { zalouserSetupWizard } from "./setup-surface.js";

Some files were not shown because too many files have changed in this diff Show More