mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
674dd37cd0
* refactor(entry): privatize compile cache internals * refactor(logging): privatize diagnostic test seams * refactor(plugin-state): privatize store test seams * refactor(skills): privatize lifecycle test seams * refactor(node-host): privatize invoke test seam * refactor(system-agent): privatize turn test seam * chore(deadcode): shrink core test seam baseline
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import type { RunResult } from "./invoke-types.js";
|
|
import "./invoke.js";
|
|
|
|
type NodeHostInvokeTestApi = {
|
|
readonly MCP_TEXT_CONTENT_MAX_BYTES: number;
|
|
readonly MCP_INVOKE_PAYLOAD_MAX_BYTES: number;
|
|
clarifyNodeExecCwdSpawnError(error: NodeJS.ErrnoException, cwd: string | undefined): string;
|
|
runCommand(
|
|
argv: string[],
|
|
cwd: string | undefined,
|
|
env: Record<string, string> | undefined,
|
|
timeoutMs: number | undefined,
|
|
): Promise<RunResult>;
|
|
};
|
|
|
|
function getTestApi(): NodeHostInvokeTestApi {
|
|
return (globalThis as Record<PropertyKey, unknown>)[
|
|
Symbol.for("openclaw.nodeHostInvokeTestApi")
|
|
] as NodeHostInvokeTestApi;
|
|
}
|
|
|
|
export const testing: NodeHostInvokeTestApi = {
|
|
get MCP_TEXT_CONTENT_MAX_BYTES() {
|
|
return getTestApi().MCP_TEXT_CONTENT_MAX_BYTES;
|
|
},
|
|
get MCP_INVOKE_PAYLOAD_MAX_BYTES() {
|
|
return getTestApi().MCP_INVOKE_PAYLOAD_MAX_BYTES;
|
|
},
|
|
clarifyNodeExecCwdSpawnError(error, cwd) {
|
|
return getTestApi().clarifyNodeExecCwdSpawnError(error, cwd);
|
|
},
|
|
runCommand(argv, cwd, env, timeoutMs) {
|
|
return getTestApi().runCommand(argv, cwd, env, timeoutMs);
|
|
},
|
|
};
|