Start here
Start here when you need the fastest coherent mental model of copilot-cli-pkg/app.js. This chapter answers three questions before sending readers into deep source-anchored pages:
- What is the extracted bundle?
- What major runtime capabilities does it contain?
- Which path should I follow for a specific investigation?
app.js is a bundled and minified production artifact, so this wiki uses stable semantic aliases in prose and keeps minified names only as searchable anchors.
Source-anchor policy
This page is an orientation document, not a direct implementation trace. Concrete anchors live in the linked pages.
| Semantic alias | Minified anchor | Scope |
|---|---|---|
| Start page | N/A — navigation page | Establishes the first reading path and the wiki’s conceptual map. |
| Bundle identity | See what-is-app-js.md | Explains artifact boundaries, package layout, and caveats. |
| Runtime capability map | See main-feature-map.md | Maps the major systems implemented by the bundle. |
First reading path
| Step | Read | Why |
|---|---|---|
| 1 | app.js overview | Defines what the artifact is and what it is not. |
| 2 | Main feature map | Shows how CLI modes, sessions, tools, models, agents, policy, and ops connect. |
| 3 | Mode dispatch and runtime startup | Explains how argv/stdin/TTY/options route into TUI, prompt, server/headless, or ACP mode. |
| 4 | Conversation session end-to-end | Shows the durable path through replay, tools, UI projection, persistence, remote export, and shutdown. |
Choose your route
| Question | Go to |
|---|---|
| How does the binary/package start and select a mode? | Runtime lifecycle |
| What does the model see, and how is the request shaped? | Context and model loop |
| Which tools are exposed, executed, filtered, or permissioned? | Tools, integrations, and security |
| Where do session events, state files, indexes, and remote control live? | Sessions, persistence, and remote |
| Which env vars and operational contracts define hosted jobs? | Hosted agent ops |
| How are subagents, custom agents, fleet, and scheduled prompts run? | Agents and automation |
Internals map
flowchart TD Start[Start here] --> Runtime[Runtime lifecycle] Runtime --> Loop[Context and model loop] Loop --> Tools[Tools, integrations, and security] Runtime --> Sessions[Sessions, persistence, and remote] Sessions --> Hosted[Hosted agent ops] Loop --> Agents[Agents and automation]
click Start "./" "Open Start here" click Runtime "../01-runtime-lifecycle/" "Open Runtime lifecycle" click Loop "../02-context-model-loop/" "Open Context and model loop" click Tools "../03-tools-integrations-security/" "Open Tools, integrations, and security" click Sessions "../04-sessions-persistence-remote/" "Open Sessions, persistence, and remote" click Hosted "../05-hosted-agent-ops/" "Open Hosted agent ops" click Agents "../06-agents-automation/" "Open Agents and automation"Reading strategy
- Use section README pages as narrative guides.
- Use implementation pages when you need source anchors, event names, env vars, call paths, or edge cases.
- Use the generated atlas only as a discovery layer; every behavioral claim should point back to a focused page or source anchor.
Navigation
Created and maintained by Yingting Huang.