Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
694
test/vitest/vitest.shared.config.ts
Normal file
694
test/vitest/vitest.shared.config.ts
Normal file
@@ -0,0 +1,694 @@
|
||||
// Vitest shared config wires the shared test shard.
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import acpCorePackageJson from "../../packages/acp-core/package.json" with { type: "json" };
|
||||
import { pluginSdkSubpaths } from "../../scripts/lib/plugin-sdk-entries.mjs";
|
||||
import privateLocalOnlyPluginSdkSubpaths from "../../scripts/lib/plugin-sdk-private-local-only-subpaths.json" with { type: "json" };
|
||||
import {
|
||||
detectVitestHostInfo as detectVitestHostInfoImpl,
|
||||
isCiLikeEnv,
|
||||
resolveLocalVitestMaxWorkers as resolveLocalVitestMaxWorkersImpl,
|
||||
resolveLocalVitestScheduling as resolveLocalVitestSchedulingImpl,
|
||||
} from "../../scripts/lib/vitest-local-scheduling.mjs";
|
||||
import {
|
||||
BUNDLED_PLUGIN_ROOT_DIR,
|
||||
BUNDLED_PLUGIN_TEST_GLOB,
|
||||
} from "./vitest.bundled-plugin-paths.ts";
|
||||
import { loadVitestExperimentalConfig } from "./vitest.performance-config.ts";
|
||||
import { shouldPrintVitestThrottle } from "./vitest.system-load.ts";
|
||||
|
||||
type VitestHostInfo = {
|
||||
cpuCount?: number;
|
||||
loadAverage1m?: number;
|
||||
totalMemoryBytes?: number;
|
||||
};
|
||||
|
||||
export type OpenClawVitestPool = "forks" | "threads";
|
||||
|
||||
export type LocalVitestScheduling = {
|
||||
maxWorkers: number;
|
||||
fileParallelism: boolean;
|
||||
throttledBySystem: boolean;
|
||||
};
|
||||
|
||||
export const jsdomOptimizedDeps = {
|
||||
optimizer: {
|
||||
web: {
|
||||
enabled: true,
|
||||
include: ["lit", "lit-html", "@lit/reactive-element", "marked"] as string[],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function detectVitestHostInfo(): Required<VitestHostInfo> {
|
||||
return detectVitestHostInfoImpl() as Required<VitestHostInfo>;
|
||||
}
|
||||
|
||||
export function resolveLocalVitestMaxWorkers(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
system: VitestHostInfo = detectVitestHostInfo(),
|
||||
pool: OpenClawVitestPool = resolveDefaultVitestPool(env),
|
||||
): number {
|
||||
return resolveLocalVitestMaxWorkersImpl(env, system, pool);
|
||||
}
|
||||
|
||||
export function resolveLocalVitestScheduling(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
system: VitestHostInfo = detectVitestHostInfo(),
|
||||
pool: OpenClawVitestPool = resolveDefaultVitestPool(env),
|
||||
): LocalVitestScheduling {
|
||||
return resolveLocalVitestSchedulingImpl(env, system, pool) as LocalVitestScheduling;
|
||||
}
|
||||
|
||||
export function resolveDefaultVitestPool(
|
||||
_env: Record<string, string | undefined> = process.env,
|
||||
): OpenClawVitestPool {
|
||||
return "threads";
|
||||
}
|
||||
|
||||
export const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
export const nonIsolatedRunnerPath = path.join(repoRoot, "test", "non-isolated-runner.ts");
|
||||
export function resolveRepoRootPath(value: string): string {
|
||||
return path.isAbsolute(value) ? value : path.join(repoRoot, value);
|
||||
}
|
||||
const isCI = isCiLikeEnv(process.env);
|
||||
const isWindows = process.platform === "win32";
|
||||
const defaultPool = resolveDefaultVitestPool();
|
||||
const localScheduling = resolveLocalVitestScheduling(
|
||||
process.env,
|
||||
detectVitestHostInfo(),
|
||||
defaultPool,
|
||||
);
|
||||
|
||||
function hasWorkerOverride(env: Record<string, string | undefined>): boolean {
|
||||
return Boolean((env.OPENCLAW_VITEST_MAX_WORKERS ?? env.OPENCLAW_TEST_WORKERS)?.trim());
|
||||
}
|
||||
|
||||
function sourcePackageAlias(packageId: string, subpath?: string) {
|
||||
return {
|
||||
find: `@openclaw/${packageId}${subpath ? `/${subpath}` : ""}`,
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
packageId,
|
||||
"src",
|
||||
...(subpath ? subpath.split("/") : ["index"]).map((part, index, parts) =>
|
||||
index === parts.length - 1 ? `${part}.ts` : part,
|
||||
),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
function sourcePackageAliasesFromExports(packageId: string, exports: Record<string, unknown>) {
|
||||
return Object.keys(exports)
|
||||
.map((exportKey) => (exportKey === "." ? undefined : exportKey.slice(2)))
|
||||
.filter((subpath) => subpath === undefined || (subpath && !subpath.includes("..")))
|
||||
.toSorted((a, b) => (a ?? "").localeCompare(b ?? ""))
|
||||
.map((subpath) => sourcePackageAlias(packageId, subpath));
|
||||
}
|
||||
|
||||
export function resolveSharedVitestWorkerConfig(params: {
|
||||
env?: Record<string, string | undefined>;
|
||||
isCI?: boolean;
|
||||
isWindows?: boolean;
|
||||
localScheduling?: LocalVitestScheduling;
|
||||
}): Pick<LocalVitestScheduling, "fileParallelism" | "maxWorkers"> {
|
||||
const env = params.env ?? process.env;
|
||||
const local = params.localScheduling ?? localScheduling;
|
||||
if (hasWorkerOverride(env)) {
|
||||
return {
|
||||
fileParallelism: local.fileParallelism,
|
||||
maxWorkers: local.maxWorkers,
|
||||
};
|
||||
}
|
||||
if (params.isCI ?? isCI) {
|
||||
return {
|
||||
fileParallelism: true,
|
||||
maxWorkers: (params.isWindows ?? isWindows) ? 2 : 3,
|
||||
};
|
||||
}
|
||||
return {
|
||||
fileParallelism: local.fileParallelism,
|
||||
maxWorkers: local.maxWorkers,
|
||||
};
|
||||
}
|
||||
|
||||
const workerConfig = resolveSharedVitestWorkerConfig({
|
||||
env: process.env,
|
||||
isCI,
|
||||
isWindows,
|
||||
localScheduling,
|
||||
});
|
||||
const dependencyModuleDirectories = ["/node_modules/", "/openclaw-pnpm-node-modules/"];
|
||||
const dependencyExternalPatterns = [
|
||||
/\/openclaw-pnpm-node-modules\/(?!.*\/?vite\w*\/dist\/client\/env\.mjs$).*\.(?:cjs\.js|mjs)$/u,
|
||||
];
|
||||
const sourcePluginSdkSubpaths = [
|
||||
...new Set([...pluginSdkSubpaths, ...privateLocalOnlyPluginSdkSubpaths]),
|
||||
].toSorted((left, right) => left.localeCompare(right));
|
||||
|
||||
if (!isCI && localScheduling.throttledBySystem && shouldPrintVitestThrottle(process.env)) {
|
||||
console.error(
|
||||
`[vitest] throttling local workers to ${localScheduling.maxWorkers}${
|
||||
localScheduling.fileParallelism ? "" : " with file parallelism disabled"
|
||||
} because the host already looks busy.`,
|
||||
);
|
||||
}
|
||||
|
||||
export const sharedVitestConfig = {
|
||||
root: repoRoot,
|
||||
envFile: false,
|
||||
resolve: {
|
||||
alias: [
|
||||
{
|
||||
find: "discord-api-types/v10",
|
||||
replacement: path.join(repoRoot, "test", "vitest", "discord-api-types-v10-runtime.ts"),
|
||||
},
|
||||
{
|
||||
find: "discord-api-types/payloads/v10",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"test",
|
||||
"vitest",
|
||||
"discord-api-types-payloads-v10-runtime.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "openclaw/extension-api",
|
||||
replacement: path.join(repoRoot, "src", "extensionAPI.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/qa-channel/api.js",
|
||||
replacement: path.join(repoRoot, "extensions", "qa-channel", "api.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/discord/api.js",
|
||||
replacement: path.join(repoRoot, "extensions", "discord", "api.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/slack/api.js",
|
||||
replacement: path.join(repoRoot, "extensions", "slack", "api.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/whatsapp/api.js",
|
||||
replacement: path.join(repoRoot, "extensions", "whatsapp", "api.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-client/readiness",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-client", "src", "readiness.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-client/timeouts",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-client", "src", "timeouts.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-client",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-client", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol/client-info",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-protocol", "src", "client-info.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol/connect-error-details",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"gateway-protocol",
|
||||
"src",
|
||||
"connect-error-details.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol/schema",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-protocol", "src", "schema.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol/startup-unavailable",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"gateway-protocol",
|
||||
"src",
|
||||
"startup-unavailable.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol/version",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-protocol", "src", "version.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/gateway-protocol",
|
||||
replacement: path.join(repoRoot, "packages", "gateway-protocol", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: /^@openclaw\/ai\/internal\/(.+)$/,
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "internal", "$1.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai/diagnostics",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "utils", "diagnostics.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai/event-stream",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "utils", "event-stream.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai/providers",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "providers.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai/types",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "types.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai/validation",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "validation.ts"),
|
||||
},
|
||||
{
|
||||
find: /^@openclaw\/ai\/(.+)$/,
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "$1.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/ai",
|
||||
replacement: path.join(repoRoot, "packages", "ai", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/llm-core/diagnostics",
|
||||
replacement: path.join(repoRoot, "packages", "llm-core", "src", "utils", "diagnostics.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/llm-core/event-stream",
|
||||
replacement: path.join(repoRoot, "packages", "llm-core", "src", "utils", "event-stream.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/llm-core/validation",
|
||||
replacement: path.join(repoRoot, "packages", "llm-core", "src", "validation.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/llm-core",
|
||||
replacement: path.join(repoRoot, "packages", "llm-core", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/configured-model-refs",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"configured-model-refs.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/model-catalog-refs",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"model-catalog-refs.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/model-catalog-normalize",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"model-catalog-normalize.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/model-catalog-types",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"model-catalog-types.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/provider-id",
|
||||
replacement: path.join(repoRoot, "packages", "model-catalog-core", "src", "provider-id.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/provider-model-id-normalization",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"provider-model-id-normalization.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core/provider-model-id-normalize",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"model-catalog-core",
|
||||
"src",
|
||||
"provider-model-id-normalize.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/model-catalog-core",
|
||||
replacement: path.join(repoRoot, "packages", "model-catalog-core", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy/ip",
|
||||
replacement: path.join(repoRoot, "packages", "net-policy", "src", "ip.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy/ipv4",
|
||||
replacement: path.join(repoRoot, "packages", "net-policy", "src", "ipv4.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy/redact-sensitive-url",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"net-policy",
|
||||
"src",
|
||||
"redact-sensitive-url.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy/url-protocol",
|
||||
replacement: path.join(repoRoot, "packages", "net-policy", "src", "url-protocol.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy/url-userinfo",
|
||||
replacement: path.join(repoRoot, "packages", "net-policy", "src", "url-userinfo.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/net-policy",
|
||||
replacement: path.join(repoRoot, "packages", "net-policy", "src", "index.ts"),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/boolean-coercion",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"boolean-coercion.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/error-coercion",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"error-coercion.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/number-coercion",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"number-coercion.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/record-coerce",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"record-coerce.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/string-coerce",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"string-coerce.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/string-normalization",
|
||||
replacement: path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"normalization-core",
|
||||
"src",
|
||||
"string-normalization.ts",
|
||||
),
|
||||
},
|
||||
{
|
||||
find: "@openclaw/normalization-core/utf16-slice",
|
||||
replacement: path.join(repoRoot, "packages", "normalization-core", "src", "utf16-slice.ts"),
|
||||
},
|
||||
{
|
||||
find: /^@openclaw\/normalization-core$/u,
|
||||
replacement: path.join(repoRoot, "packages", "normalization-core", "src", "index.ts"),
|
||||
},
|
||||
sourcePackageAlias("markdown-core", "code-spans"),
|
||||
sourcePackageAlias("markdown-core", "fences"),
|
||||
sourcePackageAlias("media-core", "base64"),
|
||||
sourcePackageAlias("media-core", "constants"),
|
||||
sourcePackageAlias("media-core", "content-length"),
|
||||
sourcePackageAlias("media-core", "file-name"),
|
||||
sourcePackageAlias("media-core", "inbound-path-policy"),
|
||||
sourcePackageAlias("media-core", "inline-image-data-url"),
|
||||
sourcePackageAlias("media-core", "media-source-url"),
|
||||
sourcePackageAlias("media-core", "mime"),
|
||||
sourcePackageAlias("media-core", "read-byte-stream-with-limit"),
|
||||
sourcePackageAlias("media-core"),
|
||||
...sourcePackageAliasesFromExports("acp-core", acpCorePackageJson.exports),
|
||||
...sourcePluginSdkSubpaths.map((subpath) => ({
|
||||
find: `openclaw/plugin-sdk/${subpath}`,
|
||||
replacement: path.join(repoRoot, "src", "plugin-sdk", `${subpath}.ts`),
|
||||
})),
|
||||
...pluginSdkSubpaths.map((subpath) => ({
|
||||
find: `@openclaw/plugin-sdk/${subpath}`,
|
||||
replacement: path.join(repoRoot, "packages", "plugin-sdk", "src", `${subpath}.ts`),
|
||||
})),
|
||||
{
|
||||
find: "openclaw/plugin-sdk",
|
||||
replacement: path.join(repoRoot, "src", "plugin-sdk", "index.ts"),
|
||||
},
|
||||
],
|
||||
},
|
||||
test: {
|
||||
dir: repoRoot,
|
||||
testTimeout: 120_000,
|
||||
hookTimeout: isWindows ? 180_000 : 120_000,
|
||||
unstubEnvs: true,
|
||||
unstubGlobals: true,
|
||||
isolate: false,
|
||||
pool: defaultPool,
|
||||
runner: nonIsolatedRunnerPath,
|
||||
maxWorkers: workerConfig.maxWorkers,
|
||||
fileParallelism: workerConfig.fileParallelism,
|
||||
deps: {
|
||||
moduleDirectories: dependencyModuleDirectories,
|
||||
},
|
||||
server: {
|
||||
deps: {
|
||||
external: dependencyExternalPatterns,
|
||||
},
|
||||
},
|
||||
forceRerunTriggers: [
|
||||
"package.json",
|
||||
"pnpm-lock.yaml",
|
||||
"test/setup.ts",
|
||||
"test/setup.shared.ts",
|
||||
"test/setup.extensions.ts",
|
||||
"test/setup-openclaw-runtime.ts",
|
||||
"test/vitest/vitest.channel-paths.mjs",
|
||||
"test/vitest/vitest.agents-paths.mjs",
|
||||
"test/vitest/vitest.agents-core.config.ts",
|
||||
"test/vitest/vitest.agents-embedded-agent.config.ts",
|
||||
"test/vitest/vitest.agents-support.config.ts",
|
||||
"test/vitest/vitest.agents-tools.config.ts",
|
||||
"test/vitest/vitest.channels.config.ts",
|
||||
"test/vitest/vitest.acp.config.ts",
|
||||
"test/vitest/vitest.boundary.config.ts",
|
||||
"test/vitest/vitest.bundled.config.ts",
|
||||
"test/vitest/vitest.cli.config.ts",
|
||||
"vitest.config.ts",
|
||||
"test/vitest/vitest.contracts-shared.ts",
|
||||
"test/vitest/vitest.contracts-channel-surface.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-config.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-registry.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-session.config.ts",
|
||||
"test/vitest/vitest.contracts-plugin.config.ts",
|
||||
"test/vitest/vitest.cron.config.ts",
|
||||
"test/vitest/vitest.daemon.config.ts",
|
||||
"test/vitest/vitest.e2e.config.ts",
|
||||
"test/vitest/vitest.extension-acpx-paths.mjs",
|
||||
"test/vitest/vitest.extension-acpx.config.ts",
|
||||
"test/vitest/vitest.extension-channel-single-config.ts",
|
||||
"test/vitest/vitest.extension-channel-split-paths.mjs",
|
||||
"test/vitest/vitest.extension-channels.config.ts",
|
||||
"test/vitest/vitest.extension-diffs-paths.mjs",
|
||||
"test/vitest/vitest.extension-diffs.config.ts",
|
||||
"test/vitest/vitest.extension-discord.config.ts",
|
||||
"test/vitest/vitest.extension-active-memory-paths.mjs",
|
||||
"test/vitest/vitest.extension-active-memory.config.ts",
|
||||
"test/vitest/vitest.extension-codex-paths.mjs",
|
||||
"test/vitest/vitest.extension-codex.config.ts",
|
||||
"test/vitest/vitest.extension-feishu-paths.mjs",
|
||||
"test/vitest/vitest.extension-feishu.config.ts",
|
||||
"test/vitest/vitest.extension-imessage.config.ts",
|
||||
"test/vitest/vitest.extension-irc-paths.mjs",
|
||||
"test/vitest/vitest.extension-irc.config.ts",
|
||||
"test/vitest/vitest.extension-line.config.ts",
|
||||
"test/vitest/vitest.extension-mattermost-paths.mjs",
|
||||
"test/vitest/vitest.extension-mattermost.config.ts",
|
||||
"test/vitest/vitest.extension-matrix-paths.mjs",
|
||||
"test/vitest/vitest.extension-matrix.config.ts",
|
||||
"test/vitest/vitest.extension-memory-paths.mjs",
|
||||
"test/vitest/vitest.extension-memory.config.ts",
|
||||
"test/vitest/vitest.extension-messaging-paths.mjs",
|
||||
"test/vitest/vitest.extension-messaging.config.ts",
|
||||
"test/vitest/vitest.extension-msteams-paths.mjs",
|
||||
"test/vitest/vitest.extension-msteams.config.ts",
|
||||
"test/vitest/vitest.extensions.config.ts",
|
||||
"test/vitest/vitest.gateway.config.ts",
|
||||
"test/vitest/vitest.gateway-core.config.ts",
|
||||
"test/vitest/vitest.gateway-client.config.ts",
|
||||
"test/vitest/vitest.gateway-methods.config.ts",
|
||||
"test/vitest/vitest.gateway-server.config.ts",
|
||||
"test/vitest/vitest.hooks.config.ts",
|
||||
"test/vitest/vitest.infra.config.ts",
|
||||
"test/vitest/vitest.live.config.ts",
|
||||
"test/vitest/vitest.media.config.ts",
|
||||
"test/vitest/vitest.media-understanding.config.ts",
|
||||
"test/vitest/vitest.performance-config.ts",
|
||||
"test/vitest/vitest.unit-fast.config.ts",
|
||||
"test/vitest/vitest.unit-fast-fake-timers.config.ts",
|
||||
"test/vitest/vitest.unit-fast-paths.mjs",
|
||||
"test/vitest/vitest.scoped-config.ts",
|
||||
"test/vitest/vitest.shared-core.config.ts",
|
||||
"test/vitest/vitest.shared.config.ts",
|
||||
"test/vitest/vitest.tooling-isolated.config.ts",
|
||||
"test/vitest/vitest.tooling.config.ts",
|
||||
"test/vitest/vitest.tui.config.ts",
|
||||
"test/vitest/vitest.ui.config.ts",
|
||||
"test/vitest/vitest.utils.config.ts",
|
||||
"test/vitest/vitest.unit.config.ts",
|
||||
"test/vitest/vitest.unit-paths.mjs",
|
||||
"test/vitest/vitest.runtime-config.config.ts",
|
||||
"test/vitest/vitest.secrets.config.ts",
|
||||
"test/vitest/vitest.plugin-sdk.config.ts",
|
||||
"test/vitest/vitest.plugins.config.ts",
|
||||
"test/vitest/vitest.extension-telegram-paths.mjs",
|
||||
"test/vitest/vitest.extension-telegram.config.ts",
|
||||
"test/vitest/vitest.extension-voice-call-paths.mjs",
|
||||
"test/vitest/vitest.extension-voice-call.config.ts",
|
||||
"test/vitest/vitest.extension-whatsapp-paths.mjs",
|
||||
"test/vitest/vitest.extension-whatsapp.config.ts",
|
||||
"test/vitest/vitest.extension-zalo-paths.mjs",
|
||||
"test/vitest/vitest.extension-zalo.config.ts",
|
||||
"test/vitest/vitest.extension-provider-paths.mjs",
|
||||
"test/vitest/vitest.extension-provider-openai.config.ts",
|
||||
"test/vitest/vitest.extension-providers.config.ts",
|
||||
"test/vitest/vitest.extension-signal.config.ts",
|
||||
"test/vitest/vitest.extension-slack.config.ts",
|
||||
"test/vitest/vitest.logging.config.ts",
|
||||
"test/vitest/vitest.process.config.ts",
|
||||
"test/vitest/vitest.tasks.config.ts",
|
||||
"test/vitest/vitest.wizard.config.ts",
|
||||
],
|
||||
include: [
|
||||
"src/**/*.test.ts",
|
||||
BUNDLED_PLUGIN_TEST_GLOB,
|
||||
"packages/**/*.test.ts",
|
||||
"test/**/*.test.ts",
|
||||
"ui/src/pages/chat/tool-stream.node.test.ts",
|
||||
],
|
||||
setupFiles: [resolveRepoRootPath("test/setup.ts")],
|
||||
exclude: [
|
||||
"dist/**",
|
||||
"test/fixtures/**",
|
||||
"apps/macos/**",
|
||||
"apps/macos/.build/**",
|
||||
"**/node_modules/**",
|
||||
"**/vendor/**",
|
||||
"dist/OpenClaw.app/**",
|
||||
"**/._*",
|
||||
"**/*.live.test.ts",
|
||||
"**/*.e2e.test.ts",
|
||||
],
|
||||
coverage: {
|
||||
provider: "v8" as const,
|
||||
reporter: ["text", "lcov"],
|
||||
all: false,
|
||||
thresholds: {
|
||||
lines: 70,
|
||||
functions: 70,
|
||||
branches: 55,
|
||||
statements: 70,
|
||||
},
|
||||
exclude: [
|
||||
`${BUNDLED_PLUGIN_ROOT_DIR}/**`,
|
||||
"apps/**",
|
||||
"ui/**",
|
||||
"test/**",
|
||||
"src/**/*.test.ts",
|
||||
"src/entry.ts",
|
||||
"src/index.ts",
|
||||
"src/runtime.ts",
|
||||
"src/logging.ts",
|
||||
"src/cli/**",
|
||||
"src/commands/**",
|
||||
"src/daemon/**",
|
||||
"src/hooks/**",
|
||||
"src/macos/**",
|
||||
"src/acp/**",
|
||||
"src/agents/**",
|
||||
"src/channels/**",
|
||||
"src/gateway/**",
|
||||
"src/line/**",
|
||||
"src/media-understanding/**",
|
||||
"src/node-host/**",
|
||||
"src/plugins/**",
|
||||
"src/providers/**",
|
||||
"src/secrets/**",
|
||||
"src/agents/model-scan.ts",
|
||||
"src/agents/embedded-agent-runner.ts",
|
||||
"src/agents/sandbox-paths.ts",
|
||||
"src/agents/sandbox.ts",
|
||||
"src/agents/agent-tool-definition-adapter.ts",
|
||||
"src/agents/tools/discord-actions*.ts",
|
||||
"src/infra/state-migrations.ts",
|
||||
"src/infra/update-check.ts",
|
||||
"src/infra/ports-inspect.ts",
|
||||
"src/infra/outbound/outbound-session.ts",
|
||||
"src/gateway/control-ui.ts",
|
||||
"src/gateway/server-channels.ts",
|
||||
"src/gateway/server-methods/config.ts",
|
||||
"src/gateway/server-methods/send.ts",
|
||||
"src/gateway/server-methods/skills.ts",
|
||||
"src/gateway/server-methods/talk.ts",
|
||||
"src/gateway/server-methods/web.ts",
|
||||
"src/gateway/server-methods/wizard.ts",
|
||||
"src/gateway/call.ts",
|
||||
"src/process/exec.ts",
|
||||
"src/tui/**",
|
||||
"src/wizard/**",
|
||||
"src/browser/**",
|
||||
"src/webchat/**",
|
||||
"src/gateway/server.ts",
|
||||
"src/gateway/client.ts",
|
||||
"packages/gateway-protocol/src/**",
|
||||
"src/infra/tailscale.ts",
|
||||
],
|
||||
},
|
||||
...loadVitestExperimentalConfig(),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user