export const shellSessionManagementDependencyDeclarations = [
    { dependencyId: "runtime.execEngine.shellManagement.manageSession", kind: "runtime", required: true, description: "Runtime-owned shell session management port exposed through BaseToolExecutorPort.shell.manageSession" },
    { dependencyId: "runtime.governancePlane.toolInvocationGrant", kind: "permission", required: true, description: "Runtime governance decision carried in context.guard for real session dispatch" },
    { dependencyId: "runtime.shellSessionOwnership", kind: "runtime", required: true, description: "Runtime owns shell sessions, handles, attachment state, and cleanup" },
];
export function createHostExecutorShellSessionManagementProvider(executor) {
    const run = executor?.shell?.manageSession;
    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;
    };
}
