refactor(athena): consolidate tool restriction deny lists to direct boolean records
This commit is contained in:
@@ -6,8 +6,6 @@ import { stripInvisibleAgentCharacters } from "./agent-display-names"
|
||||
* true = tool allowed, false = tool denied.
|
||||
*/
|
||||
|
||||
import { createAgentToolRestrictions } from "./permission-compat"
|
||||
|
||||
const EXPLORATION_AGENT_DENYLIST: Record<string, boolean> = {
|
||||
write: false,
|
||||
edit: false,
|
||||
@@ -15,10 +13,6 @@ const EXPLORATION_AGENT_DENYLIST: Record<string, boolean> = {
|
||||
call_omo_agent: false,
|
||||
}
|
||||
|
||||
const ATHENA_RESTRICTIONS = permissionToToolBooleans(
|
||||
createAgentToolRestrictions(["write", "edit", "call_omo_agent"]).permission
|
||||
)
|
||||
|
||||
const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
||||
explore: EXPLORATION_AGENT_DENYLIST,
|
||||
|
||||
@@ -51,7 +45,11 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
||||
task: false,
|
||||
},
|
||||
|
||||
athena: ATHENA_RESTRICTIONS,
|
||||
athena: {
|
||||
write: false,
|
||||
edit: false,
|
||||
call_omo_agent: false,
|
||||
},
|
||||
|
||||
"council-member": {
|
||||
write: false,
|
||||
@@ -61,14 +59,6 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
||||
},
|
||||
}
|
||||
|
||||
function permissionToToolBooleans(
|
||||
permission: Record<string, "ask" | "allow" | "deny">
|
||||
): Record<string, boolean> {
|
||||
return Object.fromEntries(
|
||||
Object.entries(permission).map(([tool, value]) => [tool, value === "allow"])
|
||||
)
|
||||
}
|
||||
|
||||
export function getAgentToolRestrictions(agentName: string): Record<string, boolean> {
|
||||
// Custom/unknown agents get no restrictions (empty object), matching Claude Code's
|
||||
// trust model where project-registered agents retain full tool access including bash.
|
||||
|
||||
Reference in New Issue
Block a user