export const codeTestDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.process.run",
        kind: "runtime",
        required: true,
        description: "Runtime-owned bounded process runner exposed through BaseToolExecutorPort.process.run.",
    },
    {
        dependencyId: "runtime.governancePlane.testExecutionGrant",
        kind: "permission",
        required: true,
        description: "dryRun:false must carry explicit guard/governance approval before spawning a test process.",
    },
];
export function createHostExecutorCodeTestProvider(executor) {
    const run = executor?.process?.run;
    if (run === undefined) {
        return undefined;
    }
    return async (request, context) => {
        const result = await run({
            command: request.command,
            args: request.args,
            cwd: request.cwd,
            timeoutMs: request.timeoutMs,
            stdin: request.stdin,
            env: request.env,
            intent: "test",
            context,
        });
        if (!result.ok) {
            throw new Error(result.error.message);
        }
        return result.output;
    };
}
