The codework repository is a monorepo dedicated to providing a high-performance toolkit for building AI agents and LLM (Large Language Model) workflows package.json2-5 It provides a structured, type-safe environment for interacting with various AI providers, managing complex agentic loops, and handling streaming data.
The project aims to bridge the gap between raw LLM APIs and sophisticated agent behaviors. It provides a layered architecture that allows developers to choose between low-level stream control and high-level autonomous agent execution packages/aikit/README.md136-146
The following diagram illustrates how the primary code entities bridge the gap between natural language interaction and executable code.
Entity Mapping: Natural Language to Code Space
Sources: packages/aikit/README.md14-32 packages/aikit/README.md183-213
The repository is managed via pnpm workspaces and contains the following core packages package.json15-17:
| Package | Path | Description |
|---|---|---|
@codeworksh/aikit | packages/aikit | The primary toolkit for AI agents, LLM streaming, and tool execution packages/aikit/README.md1-3 |
@codeworksh/utils | packages/utils | Shared TypeScript utilities including filesystem helpers, lazy evaluation, and error handling AGENTS.md5 |
buntils | packages/buntils | Legacy utility package maintained for compatibility AGENTS.md5 |
For a detailed breakdown of the file layout and package interdependencies, see Repository Structure.
The llm() function is used to resolve model definitions from a central registry packages/aikit/README.md48 Once a model is resolved, the stream() facade provides a normalized interface to communicate with different providers (like Anthropic) using a consistent event format packages/aikit/README.md149-157
The Agent system, invoked via agent.run(), manages a stateful execution loop packages/aikit/README.md73 It handles:
parallel or sequential modes packages/aikit/README.md254-260beforeToolExecution and afterToolExecution callbacks for policy enforcement packages/aikit/README.md273-284Agent Execution Flow
Sources: packages/aikit/README.md126-134 packages/aikit/README.md161-177
The monorepo requires specific environment settings for stability and performance:
>=24.14.1 package.json39 AGENTS.md9pnpm@10 package.json39vite-plus (vp) for linting, testing, and building package.json37 AGENTS.md12-15For installation instructions and a guide to the development CLI, see Getting Started.
Sources: package.json1-40 README.md1-22 AGENTS.md1-36 packages/aikit/README.md1-284
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.