export const shellProcessManagementDependencyDeclarations = [
    { dependencyId: "runtime.execEngine.shellManagement.manageProcess", kind: "runtime", required: true, description: "Runtime-owned shell process management port exposed through BaseToolExecutorPort.shell.manageProcess" },
    { dependencyId: "runtime.governancePlane.toolInvocationGrant", kind: "permission", required: true, description: "Runtime governance decision carried in context.guard for real process dispatch" },
    { dependencyId: "runtime.shellProcessOwnership", kind: "runtime", required: true, description: "Runtime owns process handles, signaling, reaping, priority changes, and process scope checks" },
];
export function createHostExecutorShellProcessManagementProvider(executor) {
    const run = executor?.shell?.manageProcess;
    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;
    };
}
