@andorra-labs/code 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +28 -208
  2. package/THIRD_PARTY_NOTICES.md +15 -0
  3. package/dist/src/agent-execution.js +36 -0
  4. package/dist/src/app-server/protocol.d.ts +1 -0
  5. package/dist/src/app-server.d.ts +34 -1
  6. package/dist/src/app-server.js +264 -54
  7. package/dist/src/automation-service.js +1 -1
  8. package/dist/src/browser-session.d.ts +8 -0
  9. package/dist/src/browser-session.js +27 -1
  10. package/dist/src/browser-ui/app.js +237 -15
  11. package/dist/src/browser-ui/index.html +5 -5
  12. package/dist/src/browser-ui/style.css +110 -65
  13. package/dist/src/browser-ui/tokens.css +27 -26
  14. package/dist/src/coding-tools.d.ts +24 -0
  15. package/dist/src/coding-tools.js +71 -8
  16. package/dist/src/command-screens.js +1 -1
  17. package/dist/src/commands.js +1 -1
  18. package/dist/src/completion-gates.d.ts +42 -7
  19. package/dist/src/completion-gates.js +55 -9
  20. package/dist/src/completion.d.ts +8 -0
  21. package/dist/src/completion.js +19 -1
  22. package/dist/src/dashboard-view.js +2 -2
  23. package/dist/src/deadline.js +4 -0
  24. package/dist/src/graph-manager-chat.js +13 -13
  25. package/dist/src/graph-runner.js +39 -2
  26. package/dist/src/graph-server.js +9 -9
  27. package/dist/src/graph-sync.d.ts +8 -0
  28. package/dist/src/graph-sync.js +54 -3
  29. package/dist/src/graph-tool.js +1 -1
  30. package/dist/src/graph-ui/app.js +262 -93
  31. package/dist/src/graph-ui/controls.css +43 -22
  32. package/dist/src/graph-ui/controls.js +31 -1
  33. package/dist/src/graph-ui/embed.js +62 -13
  34. package/dist/src/graph-ui/icons.js +4 -0
  35. package/dist/src/graph-ui/index.html +3 -3
  36. package/dist/src/graph-ui/manager-state.js +2 -2
  37. package/dist/src/graph-ui/manager.css +19 -18
  38. package/dist/src/graph-ui/manager.js +11 -11
  39. package/dist/src/graph-ui/skill-picker.js +1 -1
  40. package/dist/src/graph-ui/studio-canvas.js +8 -8
  41. package/dist/src/graph-ui/studio.css +18 -15
  42. package/dist/src/graph-ui/studio.js +92 -35
  43. package/dist/src/graph-ui/style.css +122 -79
  44. package/dist/src/graph-ui/theme.js +2 -2
  45. package/dist/src/graph-ui/tokens.css +33 -29
  46. package/dist/src/graphs.d.ts +3 -2
  47. package/dist/src/graphs.js +3 -2
  48. package/dist/src/membership-errors.d.ts +7 -1
  49. package/dist/src/membership-errors.js +9 -3
  50. package/dist/src/pull-requests.d.ts +42 -6
  51. package/dist/src/pull-requests.js +11 -3
  52. package/dist/src/react-runtime.js +121 -14
  53. package/dist/src/read-document-doc.d.ts +20 -0
  54. package/dist/src/read-document-doc.js +524 -0
  55. package/dist/src/read-document-docx.d.ts +21 -0
  56. package/dist/src/read-document-docx.js +584 -0
  57. package/dist/src/read-document-text.d.ts +29 -0
  58. package/dist/src/read-document-text.js +67 -0
  59. package/dist/src/read-document-tool.d.ts +48 -0
  60. package/dist/src/read-document-tool.js +162 -0
  61. package/dist/src/read-document.d.ts +78 -0
  62. package/dist/src/read-document.js +353 -0
  63. package/dist/src/read-image.d.ts +29 -2
  64. package/dist/src/read-image.js +42 -17
  65. package/dist/src/runtime.d.ts +19 -0
  66. package/dist/src/runtime.js +10 -1
  67. package/dist/src/session-changes.d.ts +6 -1
  68. package/dist/src/session-changes.js +13 -5
  69. package/dist/src/side-panel.d.ts +6 -1
  70. package/dist/src/side-panel.js +12 -10
  71. package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
  72. package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
  73. package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
  74. package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
  75. package/dist/src/skills/bundled/provenance.json +4 -4
  76. package/dist/src/skills/runtime-skills.js +3 -3
  77. package/dist/src/stall-recovery.d.ts +6 -2
  78. package/dist/src/stall-recovery.js +7 -2
  79. package/dist/src/terminal-ui.js +2 -2
  80. package/dist/src/time-limit.d.ts +53 -0
  81. package/dist/src/time-limit.js +79 -0
  82. package/dist/src/tools.js +92 -7
  83. package/dist/src/transcript.js +1 -1
  84. package/dist/src/types.d.ts +6 -0
  85. package/dist/src/usage-analytics.d.ts +3 -1
  86. package/dist/src/usage-analytics.js +16 -2
  87. package/package.json +6 -26
  88. package/docs/README.md +0 -36
  89. package/docs/agents/README.md +0 -62
  90. package/docs/agents/install-for-agents.md +0 -56
  91. package/docs/agents/mcp-server.md +0 -212
  92. package/docs/agents/subagent-mode.md +0 -149
  93. package/docs/concepts/README.md +0 -47
  94. package/docs/concepts/jev-actionable-routing.md +0 -113
  95. package/docs/concepts/jev-decision-thresholds.md +0 -412
  96. package/docs/concepts/jev-efficiency.md +0 -217
  97. package/docs/concepts/jev-eval-2026-11-01.md +0 -78
  98. package/docs/concepts/limits.md +0 -52
  99. package/docs/concepts/memory.md +0 -10
  100. package/docs/concepts/security.md +0 -50
  101. package/docs/concepts/workspace-instructions.md +0 -29
  102. package/docs/getting-started/README.md +0 -82
  103. package/docs/getting-started/accounts.md +0 -78
  104. package/docs/getting-started/configure-providers.md +0 -132
  105. package/docs/guides/README.md +0 -13
  106. package/docs/guides/browser.md +0 -39
  107. package/docs/guides/desktop-app.md +0 -414
  108. package/docs/guides/extensions.md +0 -102
  109. package/docs/guides/graph-builder.md +0 -116
  110. package/docs/guides/headless.md +0 -46
  111. package/docs/guides/tui.md +0 -75
  112. package/docs/guides/update.md +0 -70
  113. package/docs/guides/web-search.md +0 -51
  114. package/docs/guides/windows-code-signing.md +0 -319
  115. package/docs/llms.txt +0 -45
  116. package/docs/reference/README.md +0 -7
  117. package/docs/reference/cli.md +0 -76
  118. package/docs/reference/config.md +0 -91
  119. package/docs/reference/slash-commands.md +0 -59
  120. package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
  121. package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
  122. package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
  123. package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
  124. package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
  125. package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
  126. package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
  127. package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
  128. package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
  129. package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
  130. package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
  131. package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
  132. package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
  133. package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
  134. package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
  135. package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
  136. package/scripts/jev-efficiency-eval.mjs +0 -187
  137. package/scripts/jev-efficiency-live.mjs +0 -193
  138. package/scripts/zcode-engine-replay.mjs +0 -223
  139. package/tests/agent-centric-mcp-test-plan.md +0 -208
  140. package/tests/analytics-settings-test-plan.md +0 -165
  141. package/tests/browser-cli-smoke.mjs +0 -276
  142. package/tests/browser-test-plan.md +0 -280
  143. package/tests/chat-side-panel-test-plan.md +0 -309
  144. package/tests/decision-engine-test-plan.md +0 -163
  145. package/tests/default-active-jev-test-plan.md +0 -85
  146. package/tests/harness-extensions-test-plan.md +0 -113
  147. package/tests/jev-all-decisions-test-plan.md +0 -156
  148. package/tests/jev-efficiency/criteria.json +0 -158
  149. package/tests/jev-efficiency/workloads.mjs +0 -242
  150. package/tests/jev-efficiency-test-plan.md +0 -198
  151. package/tests/permissions-sandbox-probe.mjs +0 -74
  152. package/tests/permissions-test-plan.md +0 -191
  153. package/tests/product-telemetry-test-plan.md +0 -536
  154. package/tests/thinking-stream-preview-test-plan.md +0 -136
  155. package/tests/zcode-react-engine-test-plan.md +0 -396
package/README.md CHANGED
@@ -1,231 +1,51 @@
1
1
  # Andorra Code
2
2
 
3
- Andorra Code is a **terminal-first coding agent with a configurable graph-based harness** from Andorra Labs.
3
+ Andorra Code is a terminal-first coding agent from Andorra Labs. Run `andorra` in a project folder, describe the work, and watch the agent read the repository, run tools, and make the change, with approvals for anything risky.
4
4
 
5
- Free and signed-out users run a single Software Engineer agent. A free account can build one custom graph of up to 3 nodes in the graph editor; an Andorra paid membership enables more and larger graphs and the Orchestrator. Run `andorra login` (or `/login`) to sign in or create an account; credentials persist securely on this machine. See [accounts, membership and hosted Jev setup](docs/getting-started/accounts.md).
5
+ Work runs on a **graph**: visible stages, decisions and handoffs that you can inspect, edit and rerun, instead of one fixed agent loop. You bring your own models.
6
6
 
7
- The primary product experience is the `andorra` CLI. Running it from a repository opens an interactive TUI in the same general class of workflow as Codex CLI, Claude Code, and Kimi CLI: the user can describe software work, watch tools execute, inspect progress, answer questions, approve gated actions, and continue interacting with the coding agent from the terminal.
7
+ ## Install
8
8
 
9
- The difference is that Andorra Code's coding behavior is not fixed in one hard-coded agent loop. The active coding harness is a graph composed of full autonomous Agent nodes, deterministic actions, conditions, loops, parallel branches, review stages, approvals, and terminal states. Users can use bundled preset graphs or build their own.
9
+ Requires Node.js 22.19 or newer.
10
10
 
11
- ## Primary experience
12
-
13
- From a project directory:
14
-
15
- ```bash
16
- andorra
17
- ```
18
-
19
- This opens the Andorra Code TUI and loads the currently selected graph for that project/user context. If no custom selection exists, Andorra Code can start with a bundled default software-engineering graph.
20
-
21
- ```text
22
- ┌ Andorra Code · Software Engineer ───────────────────────────────────────────┐
23
- │ cwd ~/code/portal branch feature/auth runtime local · connected │
24
- ├───────────────────────┬─────────────────────────────────────────────────────┤
25
- │ GRAPH │ RUN │
26
- │ │ │
27
- │ ✓ Understand task │ Andorra │
28
- │ ✓ Repository analyst │ I found the authentication flow in src/auth/. │
29
- │ ● Software engineer │ │
30
- │ ○ Tests │ ● shell pnpm test auth │
31
- │ ○ Browser QA │ ● edit src/auth/session.ts │
32
- │ ○ Security review │ │
33
- │ ○ Code review │ │
34
- │ │ │
35
- ├───────────────────────┴─────────────────────────────────────────────────────┤
36
- │ > Add coverage for expired refresh tokens too. │
37
- ├─────────────────────────────────────────────────────────────────────────────┤
38
- │ /graph /node /state /logs /artifacts /pause /help ctrl+c │
39
- └─────────────────────────────────────────────────────────────────────────────┘
40
- ```
41
-
42
- ### Manage harness extensions and sign-in
43
-
44
- Use `/skills` to list, install, enable, disable or remove local/GitHub skills; `/mcp` to add, edit, enable, disable or delete stdio and HTTP servers; and `/plugins` to manage bundles of skills and MCP servers. Files live under `~/.andorracode` (or `ANDORRACODE_HOME`), and changes apply to the next task. `/logout` signs out of your Andorra account (then `/login` to switch accounts); `/logout codex` signs out of Codex and exits while retaining configuration and API-key settings. See [extension management](docs/guides/extensions.md) for formats, authentication, permissions and examples.
45
-
46
- ### Track the task plan
47
-
48
- `/dashboard` opens persistent cards for per-model session tokens, current/latest task timing, todos, and the active graph neighbourhood. Ctrl+B returns to the preserved transcript; Ctrl+N cycles displayed model statistics, and Ctrl+G pages the ASCII graph. Steering, clarification and approvals use the same bottom composer. See [Dashboard](docs/guides/tui.md#dashboard).
49
-
50
- `/browser` opens a local GUI with projects and sessions in a sidebar, conversation and tool activity, and progress. Send prompts, steer or cancel runs, and answer runtime questions and approvals while the CLI remains available. Sessions retain history; settings control the age filter and light/dark appearance. See [Browser workspace](docs/guides/browser.md).
51
-
52
- The Orchestrator creates a shared Todo list at the start of a run. Agent stages update it with `?` pending, `?` in progress, and `?` completed items. Press **Ctrl+T** to expand or collapse the list; **Ctrl+O** toggles tool and approval details. See [Todo progress](docs/guides/tui.md#todo-progress).
53
-
54
- ### Switch harness graphs inside the TUI
55
-
56
- The `/graph` command opens the graph selector:
57
-
58
- ```text
59
- /graph
60
-
61
- Graphs
62
- ● Software Engineer preset
63
- Fast Fix custom
64
- Full SDLC custom
65
- Review Only custom
66
- ```
67
-
68
- The user can switch between bundled presets and graphs they created in the configuration application. A run is always pinned to one immutable graph revision. If work is already executing, changing graphs starts or prepares a new run rather than silently mutating the graph underneath the active run.
69
-
70
- ### Graph editor (implemented)
71
-
72
- ```bash
73
- andorra # Use /providers to add or edit a provider first
74
- andorra graph # Open the bundled browser editor
75
- ```
76
-
77
- The editor ships inside the npm package and runs on localhost. `andorracode --configure` also opens it. Use the searchable Node Library to add your own Agents, import Agents others shared, or insert the built-in Orchestrator, Software Engineer and QA Tester presets. Right-click an Agent to Use, Clone, Share (export as JSON) or Delete it; built-in Agents cannot be deleted. Configure models, capabilities, completion ports, typed inputs/outputs and internal subagent roles in the Inspector. Connect one outcome to several destinations, edit each edge's input mappings, and use Join all/any for explicit synchronization.
78
-
79
- New graphs begin with an optional Orchestrator that researches the codebase and clarifies requirements and design choices with you before routing to Engineering, QA or another configured stage. Delete it to start directly at the first connected successor, falling back to the first remaining node when no successor remains. Saved version 3 graphs retain that start without restoring intake. Its optional subagent maximum is a ceiling, not a target. Ctrl-click matching node types to route a shared outcome to one destination in bulk. See [Graph Builder](docs/guides/graph-builder.md) for editing behavior and [Orchestrator intake and bulk routing](design/decisions/0011-orchestrator-entry-and-bulk-routing.md) for the original design.
80
-
81
- Save immutable revision snapshots, then select a graph with `/graph` in the TUI or `andorra --graph <id>`. Headless `--prompt` runs cannot answer Orchestrator questions and return `needs_clarification`. Existing graphs load without destructive migration. The current top-level scheduler runs ready nodes serially; bounded subagents can run inside an Agent invocation. `andorra graph --no-open` prints the URL without opening a browser; Ctrl+C stops the server. Missing providers produce guidance to run `andorra` and open `/providers`.
82
-
83
- ### Agent MCP server (graph automation and session monitoring)
84
-
85
- Trusted external agents such as Hermes and OpenClaw can launch `andorra mcp-server --stdio` and use MCP tools to create graph drafts, upsert Agent/Condition/Loop/Join nodes, connect outcome ports, configure prompts/providers, validate actionable errors, and publish immutable revisions. The MCP resource `andorra://graph/architecture` teaches agents the graph structure before editing. Other tools query saved sessions by project, status, and last X minutes or identify work needing human feedback. See [agent MCP setup, tool contract and examples](docs/agents/mcp-server.md) and the [QA plan](tests/agent-centric-mcp-test-plan.md). The same server also runs Andorra as a subagent for a host that wants the work done rather than the graph authored; see [subagent mode](docs/agents/subagent-mode.md).
86
-
87
- ### Session debug log
88
-
89
- Every conversation already keeps a trajectory journal (shown with `/status` in the interactive TUI, or at startup with `--debug`) with each model request and response — including per-call token usage and duration — plus every runtime event such as tool calls with arguments, outputs and timings. Add `--debug` (`andorra --debug` or `andorra --prompt "task" --debug`) to also record the conversation layer around them: a `session.started` banner with the invocation details (created before the first fallible startup step, so failed invocations still explain themselves), a `session.context` record with the resolved providers and workspace; `command.started` / `command.completed` entries with the wall-clock cost of every prompt and slash command, including commands issued while a run is active (steering messages are marked `command.steer`); `command.error` entries for CLI-level failures that never reach the runtime; and a closing `session.ended` summary with session-wide token totals, written even when startup or a run crashes. Credentials (stored keys and the values of provider-named environment variables, including ones added mid-session through `/providers`) and provider reasoning content are redacted from every record, and in `--json` mode the trajectory path is announced on stderr so stdout stays machine-readable.
90
-
91
- This browser delivery replaces the earlier Electron plan. See [manual Agents, routing and handoffs](design/decisions/0010-manual-agents-routing-handoffs.md) for schema version 2, explicit data mapping, subagent authority/workspace rules and current limitations. The visual editor follows the [AndorraBot V3 baseline](design/gui-design/). Alongside manual editing, Graph Studio offers an AI edit proposal route, and the agent MCP server supports external agent-driven graph authoring.
92
-
93
- ## How the harness works
94
-
95
- A graph is not merely a sequence of LLM calls. Agent nodes are full autonomous tool-using loops that can inspect repositories, run shell commands, edit files, use Git, browse, test, and iterate until their assigned responsibility is complete.
96
-
97
- The default Agent-node executor is a shared **basic ReAct loop**. Each Agent-node invocation has its own role, tools, permissions, and execution counters. Direct handoffs can reuse conversation history with the same provider profile and model; isolation is configurable:
98
-
99
- ```text
100
- model
101
- ↓
102
- tool call → tool result
103
- ↑ ↓
104
- └──── model ──┘
105
- ...
106
- ↓
107
- validated node completion
108
- ↓
109
- graph chooses the next edge/node
110
- ```
111
-
112
- The same `react-basic` executor can power an Orchestrator, Implementer, PR Review Fixer, QA Agent, or Deployment Troubleshooter while each node has its own model, system prompt, tools, permissions, context, and completion contract.
113
-
114
- Edges never own ReAct loops. Deterministic operations such as running a known test command, evaluating a condition, waiting for CI, or deploying a known artifact should normally use deterministic nodes rather than an LLM loop.
115
-
116
- See [`design/architecture/react-agent-loop.md`](design/architecture/react-agent-loop.md) for the implementation contract.
117
-
118
- A full software-development graph may look like:
119
-
120
- ```text
121
- Task
122
- ↓
123
- Understand / Requirements
124
- ↓
125
- Repository Analysis
126
- ↓
127
- Plan
128
- ↓
129
- Software Engineer
130
- ↓
131
- Automated Tests ─────────── fail ─────┐
132
- ↓ pass │
133
- Browser QA ───────────────── fail ────┤
134
- ↓ pass │
135
- Security Review ──────────── fail ────┤
136
- ↓ pass │
137
- Code Review / PR Review ─── issues ───┘
138
- ↓ pass
139
- Deploy / Final Verification
140
- ↓
141
- Done
11
+ ```sh
12
+ npm install -g @andorra-labs/code
142
13
  ```
143
14
 
144
- The graph controls **who works next, what context they receive, what they must produce, how failures route, what tools/models they can use, and what constitutes completion**.
145
-
146
- ## One harness, multiple interfaces
15
+ This installs `andorra` and the alias `andorracode`. Keep it current with `andorra update`.
147
16
 
148
- The executable harness is not owned by the TUI or browser frontend.
17
+ ## First run
149
18
 
150
- ```text
151
- Andorra Code TUI ────────────┐
152
- │
153
- Browser Configure app ──────┼──► Andorra Code Runtime ───► Harness revision
154
- Desktop client (app-server) ─┤
155
- │
156
- Headless CLI / SDK (future) ─┘
19
+ ```sh
20
+ cd /path/to/your/project
21
+ andorra
157
22
  ```
158
23
 
159
- All clients operate on the same persisted harness format and runtime semantics. The configuration app may store canvas layout as presentation metadata, but execution never depends on browser state.
160
-
161
- This allows a graph created visually to be selected immediately with `/graph` in the TUI without export or translation.
24
+ On first launch, type `/providers` to add a model provider: an OpenAI-compatible or Anthropic API key, a ChatGPT subscription (Codex), or a local server such as LM Studio. Keys are stored in your operating system's credential store.
162
25
 
163
- The desktop client is a client of the same runtime: it starts `andorra app-server --stdio` and speaks a
164
- line-delimited JSON protocol, so its sessions, run records, configuration, and account are the CLI's own.
165
- See [`docs/guides/desktop-app.md`](docs/guides/desktop-app.md) and [ADR 0014](design/decisions/0014-tauri-desktop-client-and-app-server.md).
26
+ Useful commands inside the TUI:
166
27
 
167
- ## Product surfaces
28
+ | Command | What it does |
29
+ | --- | --- |
30
+ | `/providers`, `/model` | Add providers and pick the model |
31
+ | `/graph` | Choose the graph (harness) a task runs on |
32
+ | `/permissions` | Read Only, Ask for approval (default), Approve for me, or Full Access |
33
+ | `/skills`, `/mcp`, `/plugins` | Manage skills, MCP servers and plugins |
34
+ | `/login`, `/logout` | Sign in to an Andorra account |
35
+ | `/help` | Everything else |
168
36
 
169
- - **CLI / TUI** — primary coding-agent experience launched with `andorra`.
170
- - **Graph selector** — `/graph` switches between preset and custom harness graphs.
171
- - **Configure application** — bundled local browser UI launched with `andorra graph` or `andorra --configure`.
172
- - **Graph Builder** — Shopify Flow-like canvas for creating and wiring harness graphs.
173
- - **Node Library** — built-in primitives and reusable user-created nodes.
174
- - **Manual Agent configuration** - editable shared-executor presets, typed handoffs, reusable custom definitions and optional internal subagents.
175
- - **Settings / Providers** — configure hosted providers, provider-supported authentication, and OpenAI-compatible local endpoints; configured models become selectable per Agent node.
176
- - **Headless execution** — machine-readable execution for scripting/CI without requiring the TUI.
177
- - **Subagent mode** — run Andorra from another agent (Claude CLI, Codex CLI) over MCP or the CLI; the host names a provider/model and gets one Software Engineer run back. See [`docs/agents/subagent-mode.md`](docs/agents/subagent-mode.md).
178
- - **Session debug log** — `--debug` adds per-command timing, CLI error records and session token totals to the always-on trajectory journal.
179
- - **Command lessons** — recognizable shell failures leave a short local lesson per repository that later runs receive; see [`docs/concepts/memory.md`](docs/concepts/memory.md).
180
-
181
- ## Key principles
182
-
183
- 1. **Andorra Code is CLI-first.** `andorra` opens the coding-agent TUI; the browser editor is opened explicitly for configuration.
184
- 2. **The graph is the harness.** The selected graph defines how the coding agent behaves.
185
- 3. **Agent nodes use a shared basic ReAct executor.** One Agent-node attempt owns one independent ReAct loop; graph edges route only after the node returns.
186
- 4. **Agent nodes remain full agents.** Graph orchestration does not replace their inner model/tool autonomy.
187
- 5. **Graphs are swappable.** `/graph` lets users choose preset or custom harnesses without rebuilding the application.
188
- 6. **Runs are revision-pinned.** Switching graphs never silently changes an already-running execution plan.
189
- 7. **Models are configuration, not node identity.** Each Agent node references a configured model profile and can use a different provider/model.
190
- 8. **Verification is independent.** Workers are not trusted simply because they claim success; QA/review/security stages can prove completion.
191
- 9. **State is explicit and durable.** Requirements, findings, diffs, tests, artifacts, approvals, and checkpoints are inspectable and survive client disconnects where configured.
192
- 10. **Permissions follow capabilities.** Nodes receive only the tools, secrets, and destructive permissions they require.
193
- 11. **One runtime, multiple clients.** TUI, browser configuration, headless CLI, and future SDK/API clients use the same harness semantics.
194
-
195
- ## Documentation
196
-
197
- Start at [`docs/README.md`](docs/README.md).
198
-
199
- The CLI uses [hosted Jev decisions](design/decision-engine.md) by default for signed-in free and paid users to select eligible CodeGraph context. Runs using the enabled hosted service send a compact, question-scoped routing snapshot to that service: bounded task/node-instruction excerpts plus only the capability metadata needed by the current Jev questions. Retrieved source and conversation history are excluded. Use `/jev off` before submitting work you do not want sent to Jev, `/jev on` to re-enable it, and `/jev status` to inspect the persisted preference (enabled when omitted). Paid users can also disable Jev per Agent in the graph builder. The shared Jev key stays in AWS; no personal Jev key is required.
200
-
201
- The coding model still implements the task. Authentication, quota, capability restrictions and safe fallback remain enforced; Jev does not change tool permissions or graph edges. Signed-out users retain ordinary retrieval routing unless they configure a local decision service. [QA evidence](tests/default-active-jev-test-plan.md) records a successful live hosted CLI run; prediction quality and token savings have not been measured. Configure a local model under **Settings > Runtime > Jev decisions > Configure decisions**, with its structured decision API URL, model name and optional authentication environment-variable name. CLI, desktop and browser honor the saved `decisions` configuration; global `/jev off` disables both local and hosted calls. Direct Jev supports shadow evaluation and Laya supports shadow/active CodeGraph and memory routing; ordinary OpenAI-compatible chat models are insufficient. Explicit embedded runtimes retain off/none library defaults.
202
-
203
- See [`design/product/tui-design.md`](design/product/tui-design.md) for the primary terminal UX, [`design/product/graph-builder.md`](design/product/graph-builder.md) for the `--configure` graph editor, [`design/architecture/react-agent-loop.md`](design/architecture/react-agent-loop.md) for the default Agent executor, [`design/gui-design/`](design/gui-design/) for the AndorraBot-derived desktop design baseline, and [`design/architecture/overview.md`](design/architecture/overview.md) for the shared runtime architecture.
204
-
205
- ## Status
206
-
207
- Initial executable CLI/runtime is available. See [Getting started](docs/getting-started/README.md) for installation, provider setup, slash commands, headless use and current limitations.
37
+ Run a single task without the TUI:
208
38
 
209
39
  ```sh
210
- npm ci
211
- npm run build
212
- npm start
40
+ andorra --prompt "Add a test for the date parser" --json
213
41
  ```
214
42
 
215
- The current CLI includes `/dashboard`, `/model`, `/providers`, `/graph`, `/usage`, `/yolo`, `/tools`, `/status`, `/clear`, `/help`, and `/exit`. The browser Graph Builder adds editable Agent definitions, typed handoffs, fan-out/Join routing and internal subagents. Broader product-direction examples remain subject to the implementation limits documented in ADR 0010.
216
-
217
- ### Workspace permissions
218
-
219
- Use `/permissions` to choose **Read Only**, **Ask for approval** (default), **Approve for me**, or **Full Access**. Selections persist per canonical workspace directory in your global Andorra configuration. The selector marks the current mode; Escape cancels. `/permissions read-only|ask-for-approval|approve-for-me|full-access` also selects directly.
220
-
221
- Workspace writes are automatic in Ask for approval and Approve for me; Read Only asks before native writes. Native file operations require per-operation approval outside the workspace or for protected repository/runtime metadata, including a custom `CODEX_HOME`. Graph capability limits remain in force.
222
-
223
- Read Only suspends CodeGraph because indexing writes its workspace cache. Switching to Read Only stops active cache writers before saving the mode; if they cannot stop, the change reports an error. Switching back to a writable mode resumes CodeGraph when enabled. Native reads and searches remain available while indexing is suspended.
43
+ `andorra graph` opens the visual graph builder in your browser.
224
44
 
225
- Restricted shell profiles request workspace-only reads, limited runtime reads, workspace writes according to the selected mode, and no network. **Restricted shell execution currently fails closed before spawning any command. Installed Windows Codex CLI 0.160.0 was observed accepting this profile while still reading an owned Documents file outside the workspace and runtime allowances; no backend has been verified to enforce the required read boundary.** Other operating systems are unsupported. Native file tools and remembered permissions still work. Explicit `sandbox_permissions=require_escalated` with a justification can request approval for one host command; no failed command is automatically retried outside the sandbox.
45
+ ## Accounts
226
46
 
227
- Restricted shell launcher discovery accepts standard Codex desktop, global npm, or Cargo installation roots. A nested workspace does not trust executables elsewhere in its parent repository. For a custom installation, set `ANDORRA_CODEX_PATH` to an absolute external native executable or npm shim in your launch environment; this explicitly trusts that installation, and the shim is resolved without executing it. Bare names, relative overrides and repository-controlled targets are rejected. File tools ask before following workspace symlinks or junctions; the grant applies only to that operation. Live shell permission changes are checked again after launcher discovery, immediately before spawn; only explicit per-call host approvals survive a downgrade.
47
+ The coding agent runs on your machine with your providers, and it works signed out. Signing in (`andorra login`) adds custom graphs, and an Andorra membership unlocks larger graphs and the Orchestrator. See [andorracode.com](https://andorracode.com).
228
48
 
229
- Full Access permits host filesystem/network access without prompts while recording automatic authorization events. `/yolo on` and `--yolo` are session-only Full Access overrides; `/yolo off` selects Ask for approval for the session. They do not replace the saved workspace choice. Native reads and writes of protected credential/config roots require approval; recursive searches skip those roots. Restricted Grep uses bounded native file operations without invoking PATH helpers (type, multiline, and only-matching options are unavailable). Git reads and host QA/browser/terminal actions, including QA status probes, require a scoped approval in restricted modes. Each sandbox attempt uses a unique permission profile and a trusted absolute Codex executable outside the workspace; workspace PATH shims cannot supply the launcher. The model provider connection itself is outside the child-command sandbox.
49
+ ## License
230
50
 
231
- See [the permissions QA plan](tests/permissions-test-plan.md) for setup, exact checks, and platform validation limits.
51
+ Proprietary; free to use under the terms in `LICENSE.md`. Third-party notices are in `THIRD_PARTY_NOTICES.md`.
@@ -55,3 +55,18 @@ files from its own origin. The font files are the unmodified `latin` subsets of
55
55
  - Copyright: Copyright 2023 Vercel, made in collaboration with basement.studio
56
56
  - License: SIL Open Font License 1.1
57
57
  - License copy: `licenses/GEIST-OFL-1.1.txt`
58
+
59
+ ## PDFium
60
+
61
+ Read opens PDF files, for the text of each page and for page images, with PDFium compiled to
62
+ WebAssembly (`src/read-document.ts`). It is installed as the npm dependency `@hyzyla/pdfium`
63
+ version 3.0.0; no source from either project is copied into this repository.
64
+
65
+ - Wrapper: https://github.com/hyzyla/pdfium, by Yevhenii Hyzyla
66
+ - Wrapper license: MIT, as shipped in the package's `LICENSE.md`
67
+ - Engine: https://pdfium.googlesource.com/pdfium
68
+ - Engine copyright: Copyright 2014 The PDFium Authors
69
+ - Engine license: BSD 3-Clause and Apache License 2.0, as stated in PDFium's `LICENSE`
70
+
71
+ The WebAssembly build links the libraries PDFium vendors under `third_party`, among them FreeType
72
+ and OpenJPEG, each under its own permissive license recorded in the PDFium source tree.
@@ -504,6 +504,42 @@ export async function executeAgentNode(node, options) {
504
504
  await emit('agent.clarification.answered', { answered: true });
505
505
  return JSON.stringify({ answer, proposedDesign: args.proposedDesign });
506
506
  } });
507
+ // A top-level execution agent asks through the same prompt the Orchestrator's intake uses.
508
+ // Without the tool its only way to ask is prose: a question written beside a tool call pauses
509
+ // nothing, and a reply that is only a question is a stalled turn the runtime sends back, so
510
+ // the user watches the question scroll past while the run keeps working. It is offered only
511
+ // where a person can answer; a headless run keeps the complete_agent handoff, and a delegated
512
+ // child reports to its parent rather than to the user.
513
+ if (!orchestrator && depth === 0 && options.context.approvalMode !== 'headless' && options.context.askUser)
514
+ tools.push({ name: 'ask_user', executionMode: 'sequential', description: 'Ask the user a question only they can answer and wait for the answer. Use it whenever a choice is theirs to make: a skill or instruction that says to ask, a preference, a missing requirement. A question written in your reply does not pause the run and may go unseen, so never ask that way. Ask one short question per call in plain language; when the options are known give 2-4 short choices, the recommended one first and labelled (Recommended). Do not ask what your tools can find out or what you can reasonably decide yourself.',
515
+ parameters: { type: 'object', properties: { question: { type: 'string', minLength: 1, maxLength: 500, description: 'One plain-language question.' }, choices: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 200 }, minItems: 2, maxItems: 8, description: 'Short answers the user can pick from; they can always type their own.' } }, required: ['question'], additionalProperties: false },
516
+ execute: async (args, ctx) => {
517
+ ctx.signal.throwIfAborted();
518
+ if (Object.keys(args).some(key => !['question', 'choices'].includes(key)) || typeof args.question !== 'string' || !args.question.trim() || args.question.length > 500)
519
+ throw new Error('Ask one simple question of at most 500 characters in question; put the possible answers in choices.');
520
+ if (args.choices !== undefined && (!Array.isArray(args.choices) || args.choices.length < 2 || args.choices.length > 8 || args.choices.some(item => typeof item !== 'string' || !item.trim() || item.length > 200)))
521
+ throw new Error('Optional choices must be an array of 2-8 nonempty strings, each at most 200 characters.');
522
+ const choices = args.choices === undefined ? undefined : [...args.choices];
523
+ if (ctx.approvalMode === 'headless' || !ctx.askUser)
524
+ throw new Error('No user can answer on this surface. Decide with the recommended option and say so, or hand off with complete_agent and put the question first in the summary.');
525
+ const question = args.question.trim();
526
+ await emit('agent.clarification.requested', { question, ...(choices ? { choices } : {}) });
527
+ const answer = await ctx.askUser(question, ctx.userSignal ?? ctx.signal, choices);
528
+ ctx.signal.throwIfAborted();
529
+ const answered = typeof answer === 'string' && !!answer.trim() && answer.trim().toLowerCase() !== '/cancel';
530
+ await emit('agent.clarification.answered', { answered });
531
+ // The surfaces report two different refusals. No answer at all, or /cancel, is the user
532
+ // cancelling: the terminal's choice is labelled "Cancel this task", so the run stops as it
533
+ // does for an Orchestrator question. An empty answer is the desktop's Skip, which declines
534
+ // this one question and lets the work go on.
535
+ if (typeof answer !== 'string' || answer.trim().toLowerCase() === '/cancel')
536
+ throw new ClarificationRequiredError('Needs clarification: the user cancelled the task at a question. Nothing further was done.');
537
+ if (!answered)
538
+ return JSON.stringify({ answered: false, note: 'The user skipped the question without answering. Do not ask it again: continue with the recommended option and say which one you chose, or hand off with complete_agent if the work cannot continue without their decision.' });
539
+ if (answer.length > 16000)
540
+ throw new Error('The answer exceeds 16000 characters; ask for a shorter decision.');
541
+ return JSON.stringify({ answered: true, answer });
542
+ } });
507
543
  // Plan mode is offered at the run's top level regardless of the mode this attempt composed
508
544
  // under: the mode is the user's pick and can change while the task runs (the live picker or
509
545
  // /permissions plan), and a catalog keyed to the starting mode would leave a switched-in run
@@ -348,6 +348,7 @@ export interface AppServerUsageAnalytics {
348
348
  savedInputEstimate: number;
349
349
  savedOutputEstimate: number;
350
350
  bypassedTurns: number;
351
+ jevCalls: number;
351
352
  unestimatedTurns: number;
352
353
  contextEstimatedTurns: number;
353
354
  jevInputTokens: number;
@@ -148,6 +148,14 @@ export declare class AppServer {
148
148
  private readonly sessionChanges;
149
149
  /** The wakes this engine armed for Auto-fix, checked against the PR record again before delivery. */
150
150
  private readonly autoFixWakes;
151
+ /**
152
+ * A run of the session waiting inside the `pull_request` tool's `await_review` for its PR's next review, by
153
+ * session: the review comments the watcher finds go to it instead of to a wake, and it hears when the PR is
154
+ * merged, closed, dismissed or has Auto-fix switched off.
155
+ */
156
+ private readonly reviewWaiters;
157
+ /** Sessions whose review wait is reserved and still being prepared (`awaitReview`). */
158
+ private readonly reviewWaitsStarting;
151
159
  /**
152
160
  * The account's graph sync, so a graph saved on another machine is listed here too. A first pass that
153
161
  * outlasts the listing's bounded wait publishes `graphs.changed`: that listing already answered from
@@ -1061,6 +1069,21 @@ export declare class AppServer {
1061
1069
  private updateSessionSkill;
1062
1070
  /** Say what a session is waiting on. An empty list is a real answer: it is what ends a wait. */
1063
1071
  private emitPullRequest;
1072
+ /**
1073
+ * Hold the calling run until its PR's next review: the comments the watcher finds are handed to it as the Auto-fix
1074
+ * prompt would be, instead of being armed as a wake. A wake already armed for comments it has not delivered is
1075
+ * taken at once. `origin` (the waiting node) becomes the node later Auto-fix wakes go to, since it owns the loop.
1076
+ */
1077
+ private awaitReview;
1078
+ /**
1079
+ * What the session's PR record says a review wait should end with, handed to `deliver`: the PR is gone, finished or
1080
+ * has Auto-fix off, or it holds comments found and not yet carried by a run. Those are taken under the lock, handed
1081
+ * over first and only then marked handled, so a wait that ended meanwhile never loses them. A wake this engine is
1082
+ * delivering now is left to that delivery.
1083
+ */
1084
+ private reviewWaitFromRecord;
1085
+ /** A run now carries the Auto-fix prompt behind `wakeId`: its comments are handled. */
1086
+ private recordAutoFixDelivered;
1064
1087
  /** The pending set as a change left it, without diffs: a client reads those with `sessions.changes.list`. */
1065
1088
  private emitSessionChanges;
1066
1089
  /**
@@ -1080,7 +1103,8 @@ export declare class AppServer {
1080
1103
  /**
1081
1104
  * Hand an Auto-fix prompt to the session through the same wake a `set_timer` arms, under the selections the
1082
1105
  * session's PR was configured from: without them the continuation would run under whatever graph and model
1083
- * the configuration names today, with different tools than the work it is fixing.
1106
+ * the configuration names today, with different tools than the work it is fixing. `origin` addresses the prompt to
1107
+ * the graph node that switched Auto-fix on (`deliverDueTimers`), rather than to the graph's entry node.
1084
1108
  */
1085
1109
  private wakeForPullRequest;
1086
1110
  private emitTimers;
@@ -1112,6 +1136,15 @@ export declare class AppServer {
1112
1136
  * so the reason goes out with `timers.spent` - which a window shows as a notice - and into the log.
1113
1137
  */
1114
1138
  private spendWake;
1139
+ /**
1140
+ * Whether a wake is a `set_timer` reminder a graph node set about the work it was doing. Those belong to that work:
1141
+ * they are read by the node while its attempt runs, and spent once the node or the attempt is done with it.
1142
+ *
1143
+ * An Auto-fix wake also names a node (the one that switched Auto-fix on), but only as its address: review comments
1144
+ * are new work that outlives the attempt that turned Auto-fix on, so they are never spent with it and always wait
1145
+ * for the engine to be free (`deliverDueTimers`).
1146
+ */
1147
+ private nodeReminder;
1115
1148
  /**
1116
1149
  * Spend the session's node-armed wakes that belong to an attempt in `attempts` and satisfy `spent`.
1117
1150
  *