Skip to content

When to add TS handlers

Reach for src/ when you want to:

  • Shape a raw API into idiomatic methods the LLM uses well (e.g. docsEditor.getOutline over docs.documentsGet + heading-walking).
  • Enforce safety invariants that can’t be expressed in the raw spec (e.g. a propose/apply edit flow with a revisionId guard, where you DON’T expose the raw mutating method to the LLM).
  • Compose multiple primitives into one call (e.g. paginate, retry, dedupe, post-process).

Realms without TS handlers continue to work exactly as before — src/ is purely additive.