@andorra-labs/code 0.1.10 → 0.1.12
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.
- package/README.md +31 -205
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/src/agent-execution.js +50 -2
- package/dist/src/agent-mcp.js +5 -0
- package/dist/src/app-server/protocol.d.ts +9 -1
- package/dist/src/app-server/protocol.js +1 -1
- package/dist/src/app-server.d.ts +49 -1
- package/dist/src/app-server.js +353 -64
- package/dist/src/automation-service.js +1 -1
- package/dist/src/browser-panel-tool.d.ts +24 -3
- package/dist/src/browser-panel-tool.js +80 -6
- package/dist/src/browser-runner.js +3 -1
- package/dist/src/browser-session.d.ts +8 -0
- package/dist/src/browser-session.js +27 -1
- package/dist/src/browser-ui/app.js +237 -15
- package/dist/src/browser-ui/index.html +5 -5
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/browser-view.d.ts +16 -0
- package/dist/src/browser-view.js +38 -2
- package/dist/src/claude-provider.js +15 -2
- package/dist/src/cli.d.ts +2 -1
- package/dist/src/cli.js +175 -43
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +1 -1
- package/dist/src/codex-provider.js +6 -3
- package/dist/src/coding-tools.d.ts +26 -1
- package/dist/src/coding-tools.js +104 -33
- package/dist/src/command-screens.js +1 -1
- package/dist/src/commands.js +1 -1
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +51 -1
- package/dist/src/completion.js +164 -5
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.js +2 -0
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/decision/PreparedSteps.js +1 -1
- package/dist/src/delegation-changes.js +19 -2
- package/dist/src/diff-preview.d.ts +1 -0
- package/dist/src/diff-preview.js +12 -3
- package/dist/src/engine-streams.d.ts +22 -0
- package/dist/src/engine-streams.js +16 -0
- package/dist/src/extensions.js +17 -6
- package/dist/src/file-read-key.d.ts +8 -0
- package/dist/src/file-read-key.js +12 -0
- package/dist/src/graph-editor-session.js +2 -1
- package/dist/src/graph-health.d.ts +21 -0
- package/dist/src/graph-health.js +46 -0
- package/dist/src/graph-manager-chat.d.ts +52 -3
- package/dist/src/graph-manager-chat.js +62 -17
- package/dist/src/graph-runner.js +62 -5
- package/dist/src/graph-server.d.ts +1 -1
- package/dist/src/graph-server.js +48 -27
- package/dist/src/graph-sync.d.ts +8 -0
- package/dist/src/graph-sync.js +54 -3
- package/dist/src/graph-tool.js +1 -1
- package/dist/src/graph-ui/app.js +362 -123
- package/dist/src/graph-ui/controls.css +95 -22
- package/dist/src/graph-ui/controls.js +31 -1
- package/dist/src/graph-ui/embed.js +62 -13
- package/dist/src/graph-ui/icons.js +7 -0
- package/dist/src/graph-ui/index.html +4 -4
- package/dist/src/graph-ui/manager-state.js +143 -5
- package/dist/src/graph-ui/manager.css +21 -20
- package/dist/src/graph-ui/manager.js +337 -75
- package/dist/src/graph-ui/model-picker.js +279 -0
- package/dist/src/graph-ui/provider-glyphs/alibaba-cloud.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/anthropic.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/aws-bedrock.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/claude.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/deepseek.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/fireworks.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/kimi.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/minimax.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/openai.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/opencode.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/openrouter.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/xai.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/xiaomi-mimo.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/zai.png +0 -0
- package/dist/src/graph-ui/skill-picker.js +1 -1
- package/dist/src/graph-ui/studio-canvas.js +8 -8
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +92 -35
- package/dist/src/graph-ui/style.css +122 -79
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +5 -2
- package/dist/src/graphs.js +10 -9
- package/dist/src/mcp.d.ts +52 -14
- package/dist/src/mcp.js +285 -128
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/memory/ProjectMemory.d.ts +77 -0
- package/dist/src/memory/ProjectMemory.js +310 -0
- package/dist/src/memory/index.d.ts +1 -0
- package/dist/src/memory/index.js +1 -0
- package/dist/src/opencode-provider.js +5 -6
- package/dist/src/package-name.d.ts +3 -0
- package/dist/src/package-name.js +3 -0
- package/dist/src/provider-engine.js +2 -2
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/qa/runtime/PtyManager.js +2 -1
- package/dist/src/react-runtime.js +137 -22
- package/dist/src/read-document-doc.d.ts +20 -0
- package/dist/src/read-document-doc.js +524 -0
- package/dist/src/read-document-docx.d.ts +21 -0
- package/dist/src/read-document-docx.js +584 -0
- package/dist/src/read-document-text.d.ts +29 -0
- package/dist/src/read-document-text.js +67 -0
- package/dist/src/read-document-tool.d.ts +48 -0
- package/dist/src/read-document-tool.js +162 -0
- package/dist/src/read-document.d.ts +78 -0
- package/dist/src/read-document.js +353 -0
- package/dist/src/read-image.d.ts +29 -2
- package/dist/src/read-image.js +42 -17
- package/dist/src/remote/cert.d.ts +1 -1
- package/dist/src/remote/cert.js +2 -7
- package/dist/src/remote/client.js +1 -1
- package/dist/src/remote/pem.d.ts +6 -0
- package/dist/src/remote/pem.js +11 -0
- package/dist/src/run-records.js +49 -10
- package/dist/src/runtime.d.ts +21 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/session-changes.d.ts +6 -1
- package/dist/src/session-changes.js +13 -5
- package/dist/src/sessions.d.ts +3 -1
- package/dist/src/sessions.js +5 -3
- package/dist/src/side-panel.d.ts +6 -1
- package/dist/src/side-panel.js +12 -10
- package/dist/src/sign-in-detection.d.ts +82 -0
- package/dist/src/sign-in-detection.js +197 -0
- package/dist/src/sign-in-offer.d.ts +35 -0
- package/dist/src/sign-in-offer.js +116 -0
- package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
- package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +59 -7
- package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
- package/dist/src/skills/bundled/provenance.json +4 -4
- package/dist/src/skills/runtime-skills.d.ts +6 -0
- package/dist/src/skills/runtime-skills.js +16 -3
- package/dist/src/stall-recovery.d.ts +6 -2
- package/dist/src/stall-recovery.js +7 -2
- package/dist/src/stray-files.d.ts +14 -0
- package/dist/src/stray-files.js +81 -0
- package/dist/src/subagent-run.js +6 -1
- package/dist/src/terminal-ui.d.ts +1 -1
- package/dist/src/terminal-ui.js +11 -5
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tool-activity.js +1 -1
- package/dist/src/tool-schema-compatibility.d.ts +7 -2
- package/dist/src/tool-schema-compatibility.js +8 -4
- package/dist/src/tools.js +92 -7
- package/dist/src/transcript.d.ts +5 -0
- package/dist/src/transcript.js +12 -4
- package/dist/src/types.d.ts +8 -0
- package/dist/src/untracked-file-removal.d.ts +3 -0
- package/dist/src/untracked-file-removal.js +125 -0
- package/dist/src/update-check.js +1 -1
- package/dist/src/update.d.ts +11 -1
- package/dist/src/update.js +27 -5
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/dist/src/workspace-git-metadata.d.ts +15 -0
- package/dist/src/workspace-git-metadata.js +50 -1
- package/dist/src/workspace-instructions.js +1 -1
- package/package.json +6 -26
- package/docs/README.md +0 -36
- package/docs/agents/README.md +0 -62
- package/docs/agents/install-for-agents.md +0 -56
- package/docs/agents/mcp-server.md +0 -212
- package/docs/agents/subagent-mode.md +0 -149
- package/docs/concepts/README.md +0 -47
- package/docs/concepts/jev-actionable-routing.md +0 -113
- package/docs/concepts/jev-decision-thresholds.md +0 -412
- package/docs/concepts/jev-efficiency.md +0 -217
- package/docs/concepts/jev-eval-2026-11-01.md +0 -78
- package/docs/concepts/limits.md +0 -52
- package/docs/concepts/memory.md +0 -10
- package/docs/concepts/security.md +0 -50
- package/docs/concepts/workspace-instructions.md +0 -29
- package/docs/getting-started/README.md +0 -82
- package/docs/getting-started/accounts.md +0 -78
- package/docs/getting-started/configure-providers.md +0 -132
- package/docs/guides/README.md +0 -13
- package/docs/guides/browser.md +0 -39
- package/docs/guides/desktop-app.md +0 -414
- package/docs/guides/extensions.md +0 -102
- package/docs/guides/graph-builder.md +0 -116
- package/docs/guides/headless.md +0 -46
- package/docs/guides/tui.md +0 -75
- package/docs/guides/update.md +0 -70
- package/docs/guides/web-search.md +0 -51
- package/docs/guides/windows-code-signing.md +0 -319
- package/docs/llms.txt +0 -45
- package/docs/reference/README.md +0 -7
- package/docs/reference/cli.md +0 -76
- package/docs/reference/config.md +0 -91
- package/docs/reference/slash-commands.md +0 -59
- package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
- package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
- package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
- package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
- package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
- package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
- package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
- package/scripts/jev-efficiency-eval.mjs +0 -187
- package/scripts/jev-efficiency-live.mjs +0 -193
- package/scripts/zcode-engine-replay.mjs +0 -223
- package/tests/agent-centric-mcp-test-plan.md +0 -208
- package/tests/analytics-settings-test-plan.md +0 -165
- package/tests/browser-cli-smoke.mjs +0 -276
- package/tests/browser-test-plan.md +0 -280
- package/tests/chat-side-panel-test-plan.md +0 -309
- package/tests/decision-engine-test-plan.md +0 -163
- package/tests/default-active-jev-test-plan.md +0 -85
- package/tests/harness-extensions-test-plan.md +0 -113
- package/tests/jev-all-decisions-test-plan.md +0 -156
- package/tests/jev-efficiency/criteria.json +0 -158
- package/tests/jev-efficiency/workloads.mjs +0 -242
- package/tests/jev-efficiency-test-plan.md +0 -198
- package/tests/permissions-sandbox-probe.mjs +0 -74
- package/tests/permissions-test-plan.md +0 -191
- package/tests/product-telemetry-test-plan.md +0 -536
- package/tests/thinking-stream-preview-test-plan.md +0 -136
- package/tests/zcode-react-engine-test-plan.md +0 -396
package/README.md
CHANGED
|
@@ -1,231 +1,57 @@
|
|
|
1
1
|
# Andorra Code
|
|
2
2
|
|
|
3
|
-
Andorra Code is a
|
|
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
|
-
|
|
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
|
-
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
macOS and Linux:
|
|
10
10
|
|
|
11
|
-
|
|
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
|
|
11
|
+
```sh
|
|
12
|
+
curl -fsSL https://updates.andorralabs.com/cli/install.sh | sh
|
|
75
13
|
```
|
|
76
14
|
|
|
77
|
-
The
|
|
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
|
|
15
|
+
The script brings its own Node.js 22 runtime into `~/.andorracode`, so the Node.js on your machine (or none at all) does not matter. With Node.js 22.19 or newer already installed, npm works too, and it is the way to install on Windows:
|
|
88
16
|
|
|
89
|
-
|
|
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
|
|
17
|
+
```sh
|
|
18
|
+
npm install -g @andorra-labs/code
|
|
142
19
|
```
|
|
143
20
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
## One harness, multiple interfaces
|
|
21
|
+
Either way you get `andorra` and the alias `andorracode`. Keep it current with `andorra update`.
|
|
147
22
|
|
|
148
|
-
|
|
23
|
+
## First run
|
|
149
24
|
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Browser Configure app ──────┼──► Andorra Code Runtime ───► Harness revision
|
|
154
|
-
Desktop client (app-server) ─┤
|
|
155
|
-
│
|
|
156
|
-
Headless CLI / SDK (future) ─┘
|
|
25
|
+
```sh
|
|
26
|
+
cd /path/to/your/project
|
|
27
|
+
andorra
|
|
157
28
|
```
|
|
158
29
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
This allows a graph created visually to be selected immediately with `/graph` in the TUI without export or translation.
|
|
162
|
-
|
|
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).
|
|
30
|
+
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.
|
|
166
31
|
|
|
167
|
-
|
|
32
|
+
Useful commands inside the TUI:
|
|
168
33
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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).
|
|
34
|
+
| Command | What it does |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `/providers`, `/model` | Add providers and pick the model |
|
|
37
|
+
| `/graph` | Choose the graph (harness) a task runs on |
|
|
38
|
+
| `/permissions` | Read Only, Ask for approval (default), Approve for me, or Full Access |
|
|
39
|
+
| `/skills`, `/mcp`, `/plugins` | Manage skills, MCP servers and plugins |
|
|
40
|
+
| `/login`, `/logout` | Sign in to an Andorra account |
|
|
41
|
+
| `/help` | Everything else |
|
|
180
42
|
|
|
181
|
-
|
|
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.
|
|
43
|
+
Run a single task without the TUI:
|
|
208
44
|
|
|
209
45
|
```sh
|
|
210
|
-
|
|
211
|
-
npm run build
|
|
212
|
-
npm start
|
|
46
|
+
andorra --prompt "Add a test for the date parser" --json
|
|
213
47
|
```
|
|
214
48
|
|
|
215
|
-
|
|
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.
|
|
49
|
+
`andorra graph` opens the visual graph builder in your browser.
|
|
224
50
|
|
|
225
|
-
|
|
51
|
+
## Accounts
|
|
226
52
|
|
|
227
|
-
|
|
53
|
+
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
54
|
|
|
229
|
-
|
|
55
|
+
## License
|
|
230
56
|
|
|
231
|
-
|
|
57
|
+
Proprietary; free to use under the terms in `LICENSE.md`. Third-party notices are in `THIRD_PARTY_NOTICES.md`.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -55,3 +55,33 @@ 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.
|
|
73
|
+
|
|
74
|
+
## ELK (elkjs)
|
|
75
|
+
|
|
76
|
+
The desktop app lays out the diagrams it draws from `mermaid` fences with the Eclipse Layout Kernel
|
|
77
|
+
(`desktop/src/engine/diagram.ts`). It is installed as the npm dependency `elkjs` version 0.9.3,
|
|
78
|
+
through `@mermaid-js/layout-elk` version 0.2.3 (MIT, Copyright (c) 2014 - 2022 Knut Sveidqvist), and
|
|
79
|
+
is bundled into the desktop app unmodified. No source from either project is copied into this
|
|
80
|
+
repository.
|
|
81
|
+
|
|
82
|
+
- Project: https://github.com/kieler/elkjs, compiled from https://github.com/eclipse/elk
|
|
83
|
+
- Copyright: Copyright (c) 2017 Kiel University and others
|
|
84
|
+
- License: Eclipse Public License 2.0
|
|
85
|
+
- License copy: `licenses/ELKJS-EPL-2.0.txt`
|
|
86
|
+
- Source code: elkjs is made available under the EPL-2.0 by its authors. The source of the version
|
|
87
|
+
shipped is at https://github.com/kieler/elkjs/tree/0.9.3 and in the npm package `elkjs@0.9.3`.
|
|
@@ -25,13 +25,13 @@ import { createAgentEngine } from './hardened-runtime.js';
|
|
|
25
25
|
import { completionTool } from './completion.js';
|
|
26
26
|
import { DELIVERED_OUTCOME, GRAPH_MANAGER_GRAPH_ID, capabilitySubset, delegatesWriting, effectiveCapabilities, intakeCapabilities, isTestingNode, isWritingRole, laterAgentNodes, permitsBuiltInTool, testerOnEveryRoute } from './graphs.js';
|
|
27
27
|
import { DELEGATION_DIFF_LIMIT, LandingRestoreError, addChangeWorktree, assertDelegationGit, applyLanding, collectChange, prepareLanding, removeChangeWorktree, repositoryRoot, snapshotWorkspace } from './delegation-changes.js';
|
|
28
|
-
import { classifyWorkspaceWrites } from './tools.js';
|
|
29
28
|
import { stopQaProcessesUnder } from './qa/runtime/ProcessManager.js';
|
|
30
29
|
import { qaGuidance } from './qa/guidance.js';
|
|
31
30
|
import { disposePooledPowerShellUnder } from './powershell-pool.js';
|
|
32
31
|
import { validateValue } from './handoffs.js';
|
|
33
32
|
import { ArtifactStore } from './artifacts.js';
|
|
34
33
|
import { approveOperation, capabilityTools, gitReadTool } from './capabilities.js';
|
|
34
|
+
import { removeUntrackedFileTool } from './untracked-file-removal.js';
|
|
35
35
|
import { permissionMode, serializeApprovals, assertPlanMutationAllowed } from './permissions.js';
|
|
36
36
|
import { adaptLegacyCodingToolArguments, canonicalToolName, canonicalizeToolList } from './tool-names.js';
|
|
37
37
|
const exec = promisify(execFile);
|
|
@@ -58,7 +58,7 @@ Clarify first on either path: publish the plan with update_todos, research, and
|
|
|
58
58
|
Delegate implementation to the writing roles with spawn_subagent, several in parallel when their tasks are independent. Each runs in its own Git worktree started from the working folder as it stands and may run commands and tests there. Give each one a bounded task carrying the confirmed requirements and acceptance criteria, and ask it to report the commands and tests it ran.
|
|
59
59
|
Each writing spawn returns a change record: an id (use it exactly as returned), the changed files, the diff (the full diff is behind read_artifact when truncated), the worktree path, and the tests report the subagent gave. Review every change: read the diff, read files inside the worktree with your read tools when the diff is not enough, and weigh the tests report; a failure report is grounds for a fix.
|
|
60
60
|
Decide every change: accept_change with its id lands it in the working folder as uncommitted edits; discard_change drops it. A new subagent starts from the working folder, so it sees landed work only, never a change still waiting for your decision. To build on a change, accept it first and then spawn the follow-up. When work is wrong or incomplete, discard it and spawn a redo whose task carries your review findings, then review the redo. A conflict lands nothing and names the files: the change no longer fits the working folder and accepting it again conflicts again, so discard it, spawn a redo (it starts from the folder as it now stands) and accept the redo.
|
|
61
|
-
Complete with "delivered" only when no subagent is still running, at least one change landed, and every change is accepted or discarded. Never write code or run commands yourself: you have no write or shell tools, and the change tools take only an id.`;
|
|
61
|
+
Complete with "delivered" only when no subagent is still running, at least one change landed, and every change is accepted or discarded. Never write code or run commands yourself: you have no write or shell tools, and the change tools take only an id. The one exception is remove_untracked_file, for a stray untracked file left by mistake (such as one named nul or after a sentence); remove it yourself instead of asking the user to.`;
|
|
62
62
|
/**
|
|
63
63
|
* Appended to a delegating Orchestrator's instructions when it continues a resumed conversation:
|
|
64
64
|
* the change registry is per visit and is not restored.
|
|
@@ -463,6 +463,13 @@ export async function executeAgentNode(node, options) {
|
|
|
463
463
|
}
|
|
464
464
|
if (codeLedger && codeIntel)
|
|
465
465
|
tools.push(codeIntel.exploreTool(codeLedger));
|
|
466
|
+
// Project memory is a session facility like update_todos: node allowlists and capability
|
|
467
|
+
// policies do not govern it (it never touches the workspace); contextPolicy.projectMemory
|
|
468
|
+
// false turns it off for a node. Delegated children work from their parent's brief.
|
|
469
|
+
if (options.projectMemory && depth === 0 && configured.contextPolicy?.projectMemory !== false) {
|
|
470
|
+
const present = new Set(tools.map(tool => tool.name));
|
|
471
|
+
tools.push(...options.projectMemory.tools().filter(tool => !present.has(tool.name)));
|
|
472
|
+
}
|
|
466
473
|
if (orchestrator)
|
|
467
474
|
for (let index = 0; index < tools.length; index++) {
|
|
468
475
|
const tool = tools[index];
|
|
@@ -504,6 +511,46 @@ export async function executeAgentNode(node, options) {
|
|
|
504
511
|
await emit('agent.clarification.answered', { answered: true });
|
|
505
512
|
return JSON.stringify({ answer, proposedDesign: args.proposedDesign });
|
|
506
513
|
} });
|
|
514
|
+
// A top-level execution agent asks through the same prompt the Orchestrator's intake uses.
|
|
515
|
+
// Without the tool its only way to ask is prose: a question written beside a tool call pauses
|
|
516
|
+
// nothing, and a reply that is only a question is a stalled turn the runtime sends back, so
|
|
517
|
+
// the user watches the question scroll past while the run keeps working. It is offered only
|
|
518
|
+
// where a person can answer; a headless run keeps the complete_agent handoff, and a delegated
|
|
519
|
+
// child reports to its parent rather than to the user.
|
|
520
|
+
// The one write an Orchestrator makes itself: clearing a stray untracked file, which can be what
|
|
521
|
+
// stops a subagent from starting. It takes a path and nothing else, so it cannot write code.
|
|
522
|
+
if (orchestrator && depth === 0 && effectiveCapabilities(configured).filesystem !== 'none')
|
|
523
|
+
tools.push(removeUntrackedFileTool());
|
|
524
|
+
if (!orchestrator && depth === 0 && options.context.approvalMode !== 'headless' && options.context.askUser)
|
|
525
|
+
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. Before asking where something is or what a name refers to, finish a search for it by file name and by content; a search that was cut short or timed out does not count.',
|
|
526
|
+
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 },
|
|
527
|
+
execute: async (args, ctx) => {
|
|
528
|
+
ctx.signal.throwIfAborted();
|
|
529
|
+
if (Object.keys(args).some(key => !['question', 'choices'].includes(key)) || typeof args.question !== 'string' || !args.question.trim() || args.question.length > 500)
|
|
530
|
+
throw new Error('Ask one simple question of at most 500 characters in question; put the possible answers in choices.');
|
|
531
|
+
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)))
|
|
532
|
+
throw new Error('Optional choices must be an array of 2-8 nonempty strings, each at most 200 characters.');
|
|
533
|
+
const choices = args.choices === undefined ? undefined : [...args.choices];
|
|
534
|
+
if (ctx.approvalMode === 'headless' || !ctx.askUser)
|
|
535
|
+
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.');
|
|
536
|
+
const question = args.question.trim();
|
|
537
|
+
await emit('agent.clarification.requested', { question, ...(choices ? { choices } : {}) });
|
|
538
|
+
const answer = await ctx.askUser(question, ctx.userSignal ?? ctx.signal, choices);
|
|
539
|
+
ctx.signal.throwIfAborted();
|
|
540
|
+
const answered = typeof answer === 'string' && !!answer.trim() && answer.trim().toLowerCase() !== '/cancel';
|
|
541
|
+
await emit('agent.clarification.answered', { answered });
|
|
542
|
+
// The surfaces report two different refusals. No answer at all, or /cancel, is the user
|
|
543
|
+
// cancelling: the terminal's choice is labelled "Cancel this task", so the run stops as it
|
|
544
|
+
// does for an Orchestrator question. An empty answer is the desktop's Skip, which declines
|
|
545
|
+
// this one question and lets the work go on.
|
|
546
|
+
if (typeof answer !== 'string' || answer.trim().toLowerCase() === '/cancel')
|
|
547
|
+
throw new ClarificationRequiredError('Needs clarification: the user cancelled the task at a question. Nothing further was done.');
|
|
548
|
+
if (!answered)
|
|
549
|
+
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.' });
|
|
550
|
+
if (answer.length > 16000)
|
|
551
|
+
throw new Error('The answer exceeds 16000 characters; ask for a shorter decision.');
|
|
552
|
+
return JSON.stringify({ answered: true, answer });
|
|
553
|
+
} });
|
|
507
554
|
// Plan mode is offered at the run's top level regardless of the mode this attempt composed
|
|
508
555
|
// under: the mode is the user's pick and can change while the task runs (the live picker or
|
|
509
556
|
// /permissions plan), and a catalog keyed to the starting mode would leave a switched-in run
|
|
@@ -868,6 +915,7 @@ export async function executeAgentNode(node, options) {
|
|
|
868
915
|
// workspace, the modes that auto-approve workspace writes land without a prompt and
|
|
869
916
|
// audit the grant.
|
|
870
917
|
const files = prepared.landing.files;
|
|
918
|
+
const { classifyWorkspaceWrites } = await import('./tools.js');
|
|
871
919
|
const { outside, protected: protectedPaths } = await classifyWorkspaceWrites(ctx.workspace, prepared.landing.root, files);
|
|
872
920
|
const automatic = () => !outside.length && !protectedPaths.length && ['ask-for-approval', 'approve-for-me'].includes(permissionMode(ctx) ?? '');
|
|
873
921
|
while (!(asked && files.every(file => granted.has(file)))) {
|
package/dist/src/agent-mcp.js
CHANGED
|
@@ -38,6 +38,11 @@ export const GRAPH_AGENT_GUIDE = [
|
|
|
38
38
|
' For multi-outcome agents supply completion: {mode: "outcomes", outcomes: ["pass", "fail"]}.',
|
|
39
39
|
' Every declared outcome must have an outgoing edge unless completion.requireRoutes is explicitly false.',
|
|
40
40
|
' Agents created or modified through MCP must set provider; never assume the active provider is inherited.',
|
|
41
|
+
' subagents {enabled, maxConcurrent, maxTotal, maxDepth, workspace, modelPolicy, toolInheritance, context, roles}:',
|
|
42
|
+
' workspace is shared-read-only (default; roles only read), shared-write (writes in place; maxConcurrent 1 when roles write)',
|
|
43
|
+
' or worktree (each child gets its own Git worktree; required for writing roles on an Orchestrator; needs parent git write).',
|
|
44
|
+
' modelPolicy: inherit | specific | per-role. toolInheritance: restricted | inherit. context: selected | task-only.',
|
|
45
|
+
' Validation messages name the field and the values to set. This guide and those messages are the whole reference: never search source code for them.',
|
|
41
46
|
'condition: requires condition {source, path, equals}; ports true and false; source must run before it on every path.',
|
|
42
47
|
'loop: requires loop {maxIterations}; ports body and done. A body edge may return to the loop.',
|
|
43
48
|
' Node visits are unlimited unless the graph sets graph.limits.maxNodeVisits; 0 means unlimited there too.',
|
|
@@ -44,7 +44,7 @@ export declare const APP_SERVER_PROTOCOL_VERSION = 2;
|
|
|
44
44
|
* one when a client omits it. An engine without it rebuilds a replaced entry from its own field
|
|
45
45
|
* list, so a save through it silently drops the rename and every surface falls back to the id; a
|
|
46
46
|
* client that can show the field must refuse the write first. */
|
|
47
|
-
export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "automations", "providers.models", "providers.test", "providers.test.model", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.workspaces.probe", "remote.engine.relay", "remote.hosting.device.grant", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "sessions.compact", "sessions.changes"];
|
|
47
|
+
export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "automations", "providers.models", "providers.test", "providers.test.model", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.detectSignIns", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.workspaces.probe", "remote.engine.relay", "remote.hosting.device.grant", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.codeIntel", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "sessions.compact", "sessions.changes"];
|
|
48
48
|
/** One client call. `params` is omitted only for calls that take no arguments. */
|
|
49
49
|
export interface AppServerRequest {
|
|
50
50
|
id: number | string;
|
|
@@ -195,6 +195,13 @@ export interface AppServerConfig {
|
|
|
195
195
|
jevEnabled?: boolean;
|
|
196
196
|
decisions?: import('../decision/types.js').DecisionConfig;
|
|
197
197
|
commandMemory?: boolean;
|
|
198
|
+
/** The saved CodeGraph default and its per-repository overrides. Absent means the default: on. */
|
|
199
|
+
codeIntel?: {
|
|
200
|
+
enabled?: boolean;
|
|
201
|
+
disabledRepos?: string[];
|
|
202
|
+
enabledRepos?: string[];
|
|
203
|
+
};
|
|
204
|
+
projectMemory?: boolean;
|
|
198
205
|
/**
|
|
199
206
|
* The anonymous-feedback preference. An absent block means the default: reporting is on.
|
|
200
207
|
*
|
|
@@ -348,6 +355,7 @@ export interface AppServerUsageAnalytics {
|
|
|
348
355
|
savedInputEstimate: number;
|
|
349
356
|
savedOutputEstimate: number;
|
|
350
357
|
bypassedTurns: number;
|
|
358
|
+
jevCalls: number;
|
|
351
359
|
unestimatedTurns: number;
|
|
352
360
|
contextEstimatedTurns: number;
|
|
353
361
|
jevInputTokens: number;
|
|
@@ -130,4 +130,4 @@ export const APP_SERVER_PROTOCOL_VERSION = 2;
|
|
|
130
130
|
// carries the pending set, without diffs, whenever it changes. A completed Write or Edit also reports its
|
|
131
131
|
// own change as `fileDiff` on `node.tool.completed`. An engine without it answers `unknown-method` and sends
|
|
132
132
|
// neither, so a window on such an engine shows no review bar and no Keep or Undo.
|
|
133
|
-
export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.workspaces.probe', 'remote.engine.relay', 'remote.hosting.device.grant', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'sessions.compact', 'sessions.changes'];
|
|
133
|
+
export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.detectSignIns', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.workspaces.probe', 'remote.engine.relay', 'remote.hosting.device.grant', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.codeIntel', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'sessions.compact', 'sessions.changes'];
|
package/dist/src/app-server.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { removeCodexAccount } from './codex-auth.js';
|
|
|
3
3
|
import { CodexAccountAuth } from './codex-browser-auth.js';
|
|
4
4
|
import { AnthropicConsoleAuth } from './anthropic-console-auth.js';
|
|
5
5
|
import { OpenCodeSignIn } from './managed-sign-in.js';
|
|
6
|
+
import { type SignInProbes } from './sign-in-detection.js';
|
|
6
7
|
import type { CliSignIn } from './cli-sign-in.js';
|
|
7
8
|
import { checkGraphModelHealth } from './graph-health.js';
|
|
8
9
|
import { loadAccessibleGraph } from './membership.js';
|
|
@@ -111,6 +112,8 @@ export interface AppServerOptions {
|
|
|
111
112
|
grok?: ManagedSignInService;
|
|
112
113
|
opencode?: OpenCodeSignInService;
|
|
113
114
|
};
|
|
115
|
+
/** How each vendor CLI is asked whether it is signed in; overridable so a test never spawns one. */
|
|
116
|
+
signInProbes?: Partial<SignInProbes>;
|
|
114
117
|
/** Overridable so a test can answer `gh` without reaching GitHub. */
|
|
115
118
|
gh?: GhRunner;
|
|
116
119
|
/** How often the pull request watcher polls; a test shortens it. */
|
|
@@ -138,6 +141,9 @@ export declare class AppServer {
|
|
|
138
141
|
private readonly claudeSignIn;
|
|
139
142
|
private readonly grokSignIn;
|
|
140
143
|
private readonly openCodeSignIn;
|
|
144
|
+
private readonly signInProbes;
|
|
145
|
+
/** The last detection of each tool: an import names a type and a model, and is checked against this. */
|
|
146
|
+
private readonly detectedSignIns;
|
|
141
147
|
/** Retires a removed provider's slot home; a seam so a test never has to spawn the Codex CLI. */
|
|
142
148
|
private readonly retireCodexAccount;
|
|
143
149
|
/** The `gh` the pull request settings and watcher run through. */
|
|
@@ -148,6 +154,14 @@ export declare class AppServer {
|
|
|
148
154
|
private readonly sessionChanges;
|
|
149
155
|
/** The wakes this engine armed for Auto-fix, checked against the PR record again before delivery. */
|
|
150
156
|
private readonly autoFixWakes;
|
|
157
|
+
/**
|
|
158
|
+
* A run of the session waiting inside the `pull_request` tool's `await_review` for its PR's next review, by
|
|
159
|
+
* session: the review comments the watcher finds go to it instead of to a wake, and it hears when the PR is
|
|
160
|
+
* merged, closed, dismissed or has Auto-fix switched off.
|
|
161
|
+
*/
|
|
162
|
+
private readonly reviewWaiters;
|
|
163
|
+
/** Sessions whose review wait is reserved and still being prepared (`awaitReview`). */
|
|
164
|
+
private readonly reviewWaitsStarting;
|
|
151
165
|
/**
|
|
152
166
|
* The account's graph sync, so a graph saved on another machine is listed here too. A first pass that
|
|
153
167
|
* outlasts the listing's bounded wait publishes `graphs.changed`: that listing already answered from
|
|
@@ -448,6 +462,15 @@ export declare class AppServer {
|
|
|
448
462
|
*/
|
|
449
463
|
private retireSlots;
|
|
450
464
|
private discoverModels;
|
|
465
|
+
/**
|
|
466
|
+
* Which vendor CLIs on this machine are signed in and have no provider yet.
|
|
467
|
+
*
|
|
468
|
+
* Local-client only, like the sign-ins themselves: these logins belong to this machine. Only display
|
|
469
|
+
* fields and model ids are answered; a probe that fails says nothing rather than surfacing CLI output.
|
|
470
|
+
*/
|
|
471
|
+
private detectProviderSignIns;
|
|
472
|
+
/** Add the chosen detected sign-ins as providers; each must name a tool and model the last detection reported. */
|
|
473
|
+
private importProviderSignIns;
|
|
451
474
|
/** Local-client only. The remote engine relay deliberately does not admit these methods. */
|
|
452
475
|
private providerAuth;
|
|
453
476
|
/**
|
|
@@ -1061,6 +1084,21 @@ export declare class AppServer {
|
|
|
1061
1084
|
private updateSessionSkill;
|
|
1062
1085
|
/** Say what a session is waiting on. An empty list is a real answer: it is what ends a wait. */
|
|
1063
1086
|
private emitPullRequest;
|
|
1087
|
+
/**
|
|
1088
|
+
* Hold the calling run until its PR's next review: the comments the watcher finds are handed to it as the Auto-fix
|
|
1089
|
+
* prompt would be, instead of being armed as a wake. A wake already armed for comments it has not delivered is
|
|
1090
|
+
* taken at once. `origin` (the waiting node) becomes the node later Auto-fix wakes go to, since it owns the loop.
|
|
1091
|
+
*/
|
|
1092
|
+
private awaitReview;
|
|
1093
|
+
/**
|
|
1094
|
+
* What the session's PR record says a review wait should end with, handed to `deliver`: the PR is gone, finished or
|
|
1095
|
+
* has Auto-fix off, or it holds comments found and not yet carried by a run. Those are taken under the lock, handed
|
|
1096
|
+
* over first and only then marked handled, so a wait that ended meanwhile never loses them. A wake this engine is
|
|
1097
|
+
* delivering now is left to that delivery.
|
|
1098
|
+
*/
|
|
1099
|
+
private reviewWaitFromRecord;
|
|
1100
|
+
/** A run now carries the Auto-fix prompt behind `wakeId`: its comments are handled. */
|
|
1101
|
+
private recordAutoFixDelivered;
|
|
1064
1102
|
/** The pending set as a change left it, without diffs: a client reads those with `sessions.changes.list`. */
|
|
1065
1103
|
private emitSessionChanges;
|
|
1066
1104
|
/**
|
|
@@ -1080,7 +1118,8 @@ export declare class AppServer {
|
|
|
1080
1118
|
/**
|
|
1081
1119
|
* Hand an Auto-fix prompt to the session through the same wake a `set_timer` arms, under the selections the
|
|
1082
1120
|
* 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.
|
|
1121
|
+
* the configuration names today, with different tools than the work it is fixing. `origin` addresses the prompt to
|
|
1122
|
+
* the graph node that switched Auto-fix on (`deliverDueTimers`), rather than to the graph's entry node.
|
|
1084
1123
|
*/
|
|
1085
1124
|
private wakeForPullRequest;
|
|
1086
1125
|
private emitTimers;
|
|
@@ -1112,6 +1151,15 @@ export declare class AppServer {
|
|
|
1112
1151
|
* so the reason goes out with `timers.spent` - which a window shows as a notice - and into the log.
|
|
1113
1152
|
*/
|
|
1114
1153
|
private spendWake;
|
|
1154
|
+
/**
|
|
1155
|
+
* Whether a wake is a `set_timer` reminder a graph node set about the work it was doing. Those belong to that work:
|
|
1156
|
+
* they are read by the node while its attempt runs, and spent once the node or the attempt is done with it.
|
|
1157
|
+
*
|
|
1158
|
+
* An Auto-fix wake also names a node (the one that switched Auto-fix on), but only as its address: review comments
|
|
1159
|
+
* are new work that outlives the attempt that turned Auto-fix on, so they are never spent with it and always wait
|
|
1160
|
+
* for the engine to be free (`deliverDueTimers`).
|
|
1161
|
+
*/
|
|
1162
|
+
private nodeReminder;
|
|
1115
1163
|
/**
|
|
1116
1164
|
* Spend the session's node-armed wakes that belong to an attempt in `attempts` and satisfy `spent`.
|
|
1117
1165
|
*
|