(agent: Agent.Info | undefined, permission: string)
| 26 | |
| 27 | // Helper to evaluate permission for a tool with wildcard pattern |
| 28 | function evalPerm(agent: Agent.Info | undefined, permission: string): PermissionV1.Action | undefined { |
| 29 | if (!agent) return undefined |
| 30 | return Permission.evaluate(permission, "*", agent.permission).action |
| 31 | } |
| 32 | |
| 33 | function load<A>(fn: (svc: Agent.Interface) => Effect.Effect<A>) { |
| 34 | return Agent.Service.use(fn) |