export const outputCaptureDependencyDeclarations = [
    { dependencyId: "runtime.execEngine.shellInteraction.captureOutput", kind: "runtime", required: true, description: "Runtime-owned shell interaction port exposed through BaseToolExecutorPort.shell.captureOutput" },
    { dependencyId: "runtime.governancePlane.toolInvocationGrant", kind: "permission", required: true, description: "Runtime governance decision carried in context.guard for real interaction dispatch" },
    { dependencyId: "runtime.shellSessionOwnership", kind: "runtime", required: true, description: "Runtime owns shell session/process lifecycle and validates session scope before side effects" },
];
export function createHostExecutorShellOutputCaptureProvider(executor) {
    const run = executor?.shell?.captureOutput;
    if (run === undefined)
        return undefined;
    return async (request, context) => {
        const result = await run({
            target: (request.target ?? {}),
            context: context,
        });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
