# GenAI Approval v0.1.0 - Table of Contents

> Interactive approval scripts for agents: a non-Turing-complete, steppable script format a human drives call-by-call, plus scoped allow/block command permissions.

## Modules

- [GenAI.Approval](GenAI.Approval.md): Interactive approval scripts for agents.
- [GenAI.Approval.Error](GenAI.Approval.Error.md): Structured error for script rejection (parse + static checks).
- [GenAI.Approval.Executor](GenAI.Approval.Executor.md): Behaviour for script execution targets (PRD §6.4).
- [GenAI.Approval.Executor.Local](GenAI.Approval.Executor.Local.md): Executes script calls against host-registered native handlers — no network,
no MCP. Config is a map of `"command" => handler`, where handler is a
2-arity fun `(args, run_ctx)` returning `{:ok, result} | {:error, reason}`,
or `{module, function}`.

- [GenAI.Approval.Executor.MCP](GenAI.Approval.Executor.MCP.md): Executes script calls against MCP servers via `Noizu.MCP.Client`
(M4, PRD §6.4 adapter 1). One client per declared endpoint, started
under `GenAI.Approval.ClientSupervisor` and closed when the run
terminates (R6.7).
- [GenAI.Approval.Expr](GenAI.Approval.Expr.md): Pure evaluator for script expressions against a string-keyed environment.
- [GenAI.Approval.Host](GenAI.Approval.Host.md): Behaviour a host application implements to surface approval runs
(PRD §7.2). Mirrors the proven park/respond split: the engine calls
`present/2` and streams `on_event/3`; the host answers by issuing
`GenAI.Approval.command/2`.
- [GenAI.Approval.Lexer](GenAI.Approval.Lexer.md): Splits script source into segments and tokenizes them.
- [GenAI.Approval.Live.RunView](GenAI.Approval.Live.RunView.md): Phoenix LiveView reference UI for an approval run (PRD R7.1).
- [GenAI.Approval.MCP.SubmitApprovalScript](GenAI.Approval.MCP.SubmitApprovalScript.md): The v1 interop surface (PRD §10): a standard MCP tool any client can
call to submit an approval script. Register it on a `Noizu.MCP.Server`
- [GenAI.Approval.Parser](GenAI.Approval.Parser.md): Recursive-descent parser for the approval-script grammar (PRD §5).
- [GenAI.Approval.Permission](GenAI.Approval.Permission.md): Allow/block command rules and their resolution (PRD §8).
- [GenAI.Approval.Permission.Rule](GenAI.Approval.Permission.Rule.md): One allow/block rule. `pattern` is `"endpoint:command"` with glob support.
- [GenAI.Approval.Permission.Store](GenAI.Approval.Permission.Store.md): Pluggable persistence for permission rules.
- [GenAI.Approval.Permission.Store.DETS](GenAI.Approval.Permission.Store.DETS.md): Durable permission-rule store (M3): DETS-backed, survives restarts.
- [GenAI.Approval.Permission.Store.ETS](GenAI.Approval.Permission.Store.ETS.md): Default in-memory rule store.
- [GenAI.Approval.Render](GenAI.Approval.Render.md): Shared rendering model for approval-script UIs (PRD §7.3).
- [GenAI.Approval.Result](GenAI.Approval.Result.md): Result-contract helpers (PRD §9).
- [GenAI.Approval.Runner](GenAI.Approval.Runner.md): One interactive approval run (PRD §6): a GenServer holding the run state
machine. Steps execute in supervised tasks so control commands (halt above
all) stay responsive while a call is in flight.
- [GenAI.Approval.Script](GenAI.Approval.Script.md): Parsed approval script: AST + metadata.
- [GenAI.Approval.Script.Assign](GenAI.Approval.Script.Assign.md): `{{assign var = expr}}` — expr may be a call expression.
- [GenAI.Approval.Script.Call](GenAI.Approval.Script.Call.md): `{{call "endpoint" "command" arg=expr ...}}` statement.
- [GenAI.Approval.Script.Endpoint](GenAI.Approval.Script.Endpoint.md): Preamble endpoint declaration. `auth` is `{:credential, id}` — never a secret.
- [GenAI.Approval.Script.If](GenAI.Approval.Script.If.md): Conditional. `{{#unless}}` parses to an If with `negate: true`.
- [GenAI.Approval.Script.Output](GenAI.Approval.Script.Output.md): One declared output, evaluated at end of run.
- [GenAI.Approval.Script.Step](GenAI.Approval.Script.Step.md): One approvable unit. `calls` is the statically-extracted `{endpoint, command}` list.
- [GenAI.Approval.Script.VarDecl](GenAI.Approval.Script.VarDecl.md): Typed variable declaration.
- [GenAI.Approval.StaticChecks](GenAI.Approval.StaticChecks.md): Post-parse validation (PRD R5.1–R5.6). Returns a list of `%Error{}` —
empty when the script is valid. All applicable errors are reported, not
just the first.

- [GenAI.Approval.SubmitHost](GenAI.Approval.SubmitHost.md): Behaviour the host application implements to accept agent-submitted
approval scripts (the v1 interop surface, PRD §10).

