@zedtech/zedkit-ai
Route an agent call to a model and effort from a policy file
Resolve kind (how the agent is used for this call) times stakes (how much is at risk) and the call's needs to a provider's model and effort, with the gates of…
At a glance
- Who: Agents and maintainers who pick a model per subagent call from one policy instead of hardcoding it.
- What: Resolve kind (how the agent is used for this call) times stakes (how much is at risk) and the call's needs to a provider's model and effort, with the gates of those stakes and the second review route for critical work. A model id with a
fasttoken is an error unless the call setsallowFast. - Use when: Before spawning a subagent, when the project keeps its model policy in
.agents/tokenomics.md. - Avoid when: When one session model is fine for everything, leave every cell on
inherit. - See also: Set up AI agent instructions, skills, subagents and commands in a repo
Install
pnpm add @zedtech/zedkit-aiLatest: 1.2.0 (via changesets).
Example
import { resolveRoute } from "@zedtech/zedkit-ai";
// `policy` is the project's tokenomics.md merged over the shipped defaults.
const route = resolveRoute(policy, {
kind: "check",
stakes: "standard",
provider: "cursor",
});
if (!route.ok) throw route.error;
console.log(route.value.model, route.value.effort, route.value.gates.review);Wraps: (none)
Run one gate command and keep a log that setup validation accepts
Run a shell command and write a gate log in the `CMD:` / `START:` / `END:` / `EXIT:<code>` shape that `zedkit-ai validate --setup` checks, with the V8 heap cap…
Write each tool's agent files from one source and a policy
Generate `.cursor/agents`, `.claude/agents`, and Muse-native files in `.agents/agents` from the unmarked/kit source and `.agents/tokenomics.md`, with the model…