{"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../../src/core/permissions/tiers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAyBvD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,cAAc,CAM3F","sourcesContent":["/**\n * Permission tiers for tools. Inspired by oh-my-pi's approval tiers.\n *\n * Every tool invocation is classified read/write/exec. The policy engine\n * (policy.ts) maps tiers and pattern rules to allow/deny/prompt decisions.\n */\n\nexport type PermissionTier = \"read\" | \"write\" | \"exec\";\n\n/** Core tool tiers. Extension tools declare theirs via the optional\n * `permissionTier` field on the tool definition; absent -> \"exec\" for bash-like\n * names is not guessable, so unknown tools default to \"write\" (middle tier). */\nconst CORE_TOOL_TIERS: Record<string, PermissionTier> = {\n\tread: \"read\",\n\tgrep: \"read\",\n\tfind: \"read\",\n\tls: \"read\",\n\tast_grep: \"read\",\n\tlsp: \"read\",\n\tmemory_search: \"read\",\n\tmemory_read: \"read\",\n\tmemory_status: \"read\",\n\tontology_query: \"read\",\n\twrite: \"write\",\n\tedit: \"write\",\n\tmemory_write: \"write\",\n\tontology_add: \"write\",\n\tontology_batch_add: \"write\",\n\tbash: \"exec\",\n\teval: \"exec\",\n};\n\nexport function tierForTool(toolName: string, declaredTier?: PermissionTier): PermissionTier {\n\tif (declaredTier) return declaredTier;\n\tconst core = CORE_TOOL_TIERS[toolName];\n\tif (core) return core;\n\t// Unknown/extension tools: middle tier, prompt by default policy.\n\treturn \"write\";\n}\n"]}