refactor(plugins): decouple bundled plugin runtime loading

This commit is contained in:
Peter Steinberger
2026-03-29 09:08:06 +01:00
parent 1738d540f4
commit 8e0ab35b0e
582 changed files with 8057 additions and 22869 deletions

View File

@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
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 { beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
const resolveMatrixTargetsMock = vi.hoisted(() => vi.fn(async () => []));

View File

@@ -1,7 +1,7 @@
import path from "node:path";
import { z } from "openclaw/plugin-sdk/zod";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { loadRuntimeApiExportTypesViaJiti } from "../../../../../test/helpers/extensions/jiti-runtime-api.ts";
import { loadRuntimeApiExportTypesViaJiti } from "../../../../../test/helpers/plugins/jiti-runtime-api.ts";
const hoisted = vi.hoisted(() => {
const callOrder: string[] = [];
@@ -112,10 +112,6 @@ vi.mock("../../resolve-targets.js", () => ({
resolveMatrixTargets: vi.fn(async () => []),
}));
vi.mock("../../../../../src/generated/bundled-channel-entries.generated.ts", () => ({
GENERATED_BUNDLED_CHANNEL_ENTRIES: [],
}));
vi.mock("../../runtime.js", () => ({
getMatrixRuntime: () => ({
config: {

View File

@@ -6,7 +6,7 @@ import {
resolveAgentRoute,
setActivePluginRegistry,
type OpenClawConfig,
} from "../../../../../test/helpers/extensions/matrix-monitor-route.js";
} from "../../../../../test/helpers/plugins/matrix-monitor-route.js";
import { matrixPlugin } from "../../channel.js";
import { resolveMatrixInboundRoute } from "./route.js";