Five articles built the runtime. The sixth made it observable. This one introduces the agent primitive: runAgent plus AgentScope, with budgets, replayable events, and structured cancellation in the box.
The whole loop:
import { runAgent, AgentToolCalls, OpenAITokens } from "@workit/core/ai";
import { CostBudget, run } from "@workit/core";
const { result, events } = await runAgent(async (agent, ctx) => {






