NOIR
Reference

Plugins and capability hooks

Reference for optional tools, prompts, services, routes, lifecycle, and interception hooks.

A Noir plugin normalizes to AgentCapability. Capabilities compose cross-cutting behavior without placing it inside the model prompt.

Static contributions

A capability can declare:

  • name and dependency names in requires
  • tools and prompt modules
  • host-only services
  • HTTP routes
  • request and response interception
  • health, start, and close lifecycle
  • runtime event observation

Dependency resolution rejects missing names and cycles. Start runs in dependency order; shutdown runs in reverse.

Turn hooks

beforeTurn can transform or skip a turn. resumeTurn observes an approval continuation. afterTurn receives completed, paused, skipped, or failed status and duration.

Model and tool hooks

beforeModelCall can block a model call; afterModelCall receives duration, token usage, and error. beforeToolCall can transform or block an exact call; afterToolCall can project a result or observe failure.

Output and delivery hooks

beforeOutput can block output. transformOutput can replace or drop it. beforeDelivery can transform, skip, or return an already-delivered receipt. settleDelivery runs at the settlement boundary, and afterDelivery observes the final result.

Control hooks

controlRun receives the active abort controller and may return a close function. Steering and cancellation use this boundary instead of global module state.

Rules

Keep routing and authorization in code. Hooks must be bounded and should not silently swallow errors. A capability instance that owns mutable state must not be shared between agents unless its implementation explicitly supports that. Use services for host collaboration; never stringify raw services into model context.

On this page