Expand description
Coding agent core: sessions, compaction, settings, resources, built-in tools, system prompt, packages, extension runner and MCP. An internal library of yapi, with no stable API.
Modules§
- agent_
session - A conversation: the agent loop bound to a session file, tools, the system prompt and the model registry.
- auth_
guidance - What to tell the user when no model or credential is usable.
- bash_
executor - User
!commands: run in the shell, stream sanitized output, keep the tail. - bug_
report - Bug reports for
/bug: what a report holds, its redaction, the zip archive, the summary the current model writes and the GitHub issue. - cache_
stats - Prompt cache misses: prompt tokens that were in the previous request’s prompt but were billed again instead of read from the cache.
- chest
- chest, a project package manager for skills, subagents and extensions:
the
chest.tomlmanifest, thechest.lock, content hashes, the placement of installed items, and the engine that installs them. It has no pi counterpart. - clipboard
- Copying text to the system clipboard, and reading what the paste key inserts.
- compaction
- Compaction: summarize older context so a long session fits the model.
- config
- Where yapi keeps its state. Same layout as pi, under yapi’s own directories.
- docs
- The documentation the model reads about yapi: the yapi book and pi’s
README, docs and examples, as each release’s
yapi-docs.tar.gzpacks them. install.sh unpacks the release’s copy into<agent dir>/docs, and yapi downloads it on its first run when installed another way. - extensions
- Extensions: code that registers tools and commands with a session and
handles its events, as pi’s extension runner (
core/extensionsin piv1.0.0) runs them. - glob
- Glob matching with the defaults of minimatch, which pi uses for package resource patterns and model scopes.
- images
- pi’s image pipeline: what an image becomes before it enters the
conversation. Formats models do not accept become PNG, and with
images.autoResizeimages are fitted to the model’s limits. - import
yapi import pi: copies pi’s state into yapi’s directories. yapi reads pi’s formats unchanged, so files are copied as they are, except pi’slastChangelogVersionand sign-ins. Files yapi already has are kept.- language
- pi’s
getLanguageFromPathinmodes/interactive/theme/theme.tsof piv1.0.0: the language name pi gives a file’s code, for code renderers. - llama
- pi’s built-in
llama.cppextension: the/llamacommand, which lists a llama.cpp router’s models, loads and unloads them, and downloads new ones from Hugging Face. The provider itself lives inyapi_ai::llama. - mcp
- Model Context Protocol: a client for stdio and streamable HTTP servers (pi-mcp), and the built-in extension that exposes their tools.
- messages
- Session message roles beyond the provider’s four, and their conversion.
- model_
resolver - Choosing a model from
--model, settings and available credentials. - packages
- Packages: npm, git and local sources that bring extensions, skills,
prompt templates and themes. Port of pi’s package manager
(
core/package-manager.tsin piv1.0.0), with a built-in npm client. - resources
- Context files, skills, prompt templates and system prompt files.
- session
- Session files: a JSONL tree of entries with a movable leaf.
- settings
- Settings: global
settings.jsonmerged with the trusted project’s. - system_
prompt - The system prompt: named sections the transcript holds and later patches.
- time
- Timestamps as pi writes them: Unix milliseconds and ISO 8601 UTC with milliseconds, and ids.
- tools
- Built-in tools:
read,bash,edit,write, and the optionalgrep,findandls. - trust
- Project trust: whether yapi may load a project’s
.yapisettings and resources. - zone
- The local time zone, chosen as Node chooses it: the zone
TZnames when it is set, else the system’s zone.