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