export const shellResourceManagementDependencyDeclarations = [
    { dependencyId: "runtime.execEngine.shellManagement.manageResource", kind: "runtime", required: true, description: "Runtime-owned shell resource management port exposed through BaseToolExecutorPort.shell.manageResource" },
    { dependencyId: "runtime.governancePlane.toolInvocationGrant", kind: "permission", required: true, description: "Runtime governance decision carried in context.guard for real resource dispatch" },
    { dependencyId: "runtime.shellResourceOwnership", kind: "runtime", required: true, description: "Runtime owns shell resource reservation, release, limit changes, and resource-scope checks" },
];
export function createHostExecutorShellResourceManagementProvider(executor) {
    const run = executor?.shell?.manageResource;
    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;
    };
}
