/**
 * App-owned mapping from concrete tool names to shared runtime capabilities.
 *
 * This file is intentionally small: the core layer owns capability identity,
 * while the app layer owns which built-in tools declare each capability.
 */
import { RUNTIME_CAPABILITY } from '../../core/permission-policy.js';
import { BASH, EDIT, EXECUTE_CODE, FIND, GREP, LS, READ, TASK, WRITE } from '../../tool-names.js';
export const RUNTIME_CAPABILITY_CATALOG = [
    {
        id: RUNTIME_CAPABILITY.FILESYSTEM_READ,
        toolNames: [READ, GREP, FIND, LS]
    },
    {
        id: RUNTIME_CAPABILITY.FILESYSTEM_WRITE,
        toolNames: [WRITE, EDIT]
    },
    {
        id: RUNTIME_CAPABILITY.SHELL_EXECUTE,
        toolNames: [BASH]
    },
    {
        id: RUNTIME_CAPABILITY.SPREADSHEET_MUTATE,
        toolNames: [EXECUTE_CODE]
    },
    {
        id: RUNTIME_CAPABILITY.SUBAGENT_SPAWN,
        toolNames: [TASK]
    }
];
/** Returns the capability set declared by the current runtime tool selection. */
export function getDeclaredCapabilityIds(toolNames) {
    const declaredTools = new Set(toolNames);
    return RUNTIME_CAPABILITY_CATALOG.filter((capability) => capability.toolNames.some((toolName) => declaredTools.has(toolName))).map((capability) => capability.id);
}
/** Convenience predicate for small capability-gated compiler decisions. */
export function hasCapability(capabilityIds, capabilityId) {
    return capabilityIds.includes(capabilityId);
}
//# sourceMappingURL=capability-catalog.js.map