A small TypeScript kit for describing agent processes as human-oriented IR and compiling them into deterministic runtime playbooks.
This repository exists because agent process authoring is a different problem from:
- governance architecture
- runner execution
- MCP tool surfaces
- rich answer rendering
It sits between those layers.
It is part of a small public code series:
agent-code-playbook-kitfor process IR and compiled runtime playbooksagent-code-runner-sandboxfor bounded execution primitivesagent-code-observer-mcpfor semantic tool surfaces and MCP bridgingagent-code-a2ui-contractsfor structured rich-answer contractsorg-aware-agentsfor the docs-first architecture layer
src/types.ts— IR and runtime playbook typessrc/compile.ts— deterministicIR -> playbookcompilersrc/lint.ts— lightweight linting and warning surfaceexamples/— public-safe process examplestest/— focused tests for invariants
Many agent systems jump directly from:
- natural-language process description
- to prompt glue
- to side effects
That is not enough for stable production behavior.
A stronger setup uses:
- human-oriented process IR
- deterministic compilation
- explicit tool allowlists
- field-level write policies
- machine-checkable definition of done
npm install
npm test
npm run build
npm run demoThe included example compiles a content-draft task flow into a runtime playbook with:
- queue entry by status
- task context reading
- task update field allowlist
- comment and artifact write permissions
- deterministic started/done recipe steps
- delivery requirements
- human intent first, runtime contract second
- deterministic compilation over prompt magic
- fail closed where possible
- keep invariants explicit