Production-grade TypeScript agent runtime with provider routing, tools, MCP, skills, workflows, structured output, streaming, budgets, and observability.
npm install @deskcreate/agentcraft
import { Agent, Provider } from "@deskcreate/agentcraft";
const agent = Agent.create({
model: Provider.openai["gpt-4o-mini"],
apiKey: process.env.OPENAI_API_KEY!,
});
const result = await agent.run({
prompt: "Summarize why typed tool calls matter.",
responseSchema: {
type: "object",
required: ["summary", "risks"],
properties: {
summary: { type: "string" },
risks: { type: "array", items: { type: "string" } },
},
},
structuredOutput: { retries: 1 },
trace: true,
});
console.log(result.structuredResponse);
console.log(result.trace);
AgentWorkflow for repeatable step graphs with retries, approvals, branches, parallel fan-out, Zod-validated input, and resumable failed runs.AgentWorkspace for shared runtime context wiring cache, adapters, tool policy, budget, events, and artifact stores once for teams and workflows.ArtifactStore for typed durable persistence with MemoryArtifactStore, FileArtifactStore, and SQLiteArtifactStore backends.ArtifactRegistry for 19 built-in creator artifact schemas with custom extension support.For the local documentation site:
npm run docs:dev
See the examples guide for basic chat, structured output, streaming with tools, safe filesystem usage, GitHub review, MCP GitHub, research, AgentTeam, AgentWorkflow, ArtifactStore, cost budgeting, and custom adapter patterns.
AgentCraft treats prompt, file, browser, MCP, retrieval, and tool inputs as untrusted by default. Side-effecting tools require approval metadata and should be run with policy controls in production.
Pricing metadata is source-stamped and estimator-grade. Update the model catalog against official provider pricing before using estimates for billing or hard financial commitments.
Unit tests are mocked and do not require live API keys:
npm test
Live integration tests are opt-in and should be run with cost-bounded provider keys only:
INTEGRATION_TESTS=true npm run test:int:light