repowiseearendil-works/pi

Architecture of earendil-works/pi

earendil-works/pi is 2,010 source files holding 17,839 symbols across 4 modules, written mainly in TypeScript, JavaScript, Shell. The largest module is packages, with 1,737 files, and 34 files are entry points into the dependency graph.

How pi fits together

The packages directory holds the code for the separate npm packages: the unified LLM API, the agent runtime, the coding agent CLI and a terminal UI library. packages/ai/src/index.ts is the entry point of the LLM API, and packages/agent/src/index.ts is the entry point of the agent runtime, which defines the loop primitives agentLoop, runAgentLoop and runToolCall. AgentHarness in packages/agent coordinates session state, tool execution, compaction and reducer-driven lane snapshots. packages/coding-agent/src/core/agent-session.ts and packages/coding-agent/src/modes/interactive/interactive-mode.ts are listed as hotspot files, and the interactive mode file implements the interactive side of the coding agent CLI. User-facing output is drawn by the terminal UI library, which uses differential rendering.

Largest modules

  • packages: 1,737 files and 370,619 lines of code
  • scripts: 45 files and 7,829 lines of code
  • .pi: 4 files and 571 lines of code
  • root: 4 files and 225 lines of code

Languages

By file count: TypeScript 1,731 files, JavaScript 39 files, Shell 11 files, C 3 files, C++ 3 files, Dockerfile 1 file.

Documentation

Repowise documents pi in 1,733 pages generated from the source, 45 of them written explanations of the repository and its modules. Module guides include:

  • packages/ai/src/providers: AI Provider Registry
  • packages/ai/src/utils: AI Utility Helpers
  • packages/agent/src: Agent Loop Entrypoints

More on pi: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos