@the-open-engine/zeroshot 6.31.3 → 6.32.1

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 (47) hide show
  1. package/README.md +66 -98
  2. package/cli/index.js +251 -252
  3. package/cli/lib/setup-provider-readiness.js +86 -0
  4. package/cli/lib/setup-scanner-worker.js +120 -0
  5. package/cli/lib/setup-scanner.js +185 -0
  6. package/cli/lib/setup-wizard-input.js +146 -0
  7. package/cli/lib/setup-wizard-model.js +205 -0
  8. package/cli/lib/setup-wizard-plan-view.js +157 -0
  9. package/cli/lib/setup-wizard-scan-view.js +144 -0
  10. package/cli/lib/setup-wizard-terminal.js +237 -0
  11. package/cli/lib/setup-wizard-view.js +180 -0
  12. package/cli/lib/setup-wizard.js +281 -0
  13. package/cli/message-formatters-normal.js +14 -18
  14. package/cli/message-formatters-watch.js +53 -141
  15. package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
  16. package/lib/agent-cli-provider/adapters/codex.js +8 -2
  17. package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
  18. package/lib/agent-cli-provider/provider-registry.d.ts +4 -2
  19. package/lib/agent-cli-provider/provider-registry.d.ts.map +1 -1
  20. package/lib/agent-cli-provider/provider-registry.js +13 -3
  21. package/lib/agent-cli-provider/provider-registry.js.map +1 -1
  22. package/lib/agent-cli-provider/single-agent-runtime.d.ts.map +1 -1
  23. package/lib/agent-cli-provider/single-agent-runtime.js +7 -4
  24. package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -1
  25. package/lib/agent-cli-provider/types.d.ts +2 -0
  26. package/lib/agent-cli-provider/types.d.ts.map +1 -1
  27. package/lib/agent-cli-provider/types.js.map +1 -1
  28. package/lib/completion.js +102 -153
  29. package/lib/settings.js +10 -2
  30. package/lib/setup-apply.js +62 -55
  31. package/lib/setup-plan.js +32 -52
  32. package/lib/start-cluster.js +65 -25
  33. package/npm-shrinkwrap.json +2 -2
  34. package/package.json +3 -3
  35. package/scripts/postinstall.js +54 -0
  36. package/src/agent/agent-lifecycle.js +11 -1
  37. package/src/agent/agent-task-executor.js +25 -7
  38. package/src/agent/structured-output-error.js +42 -0
  39. package/src/agent-cli-provider/adapters/codex.ts +8 -12
  40. package/src/agent-cli-provider/provider-registry.ts +15 -3
  41. package/src/agent-cli-provider/single-agent-runtime.ts +11 -11
  42. package/src/agent-cli-provider/types.ts +2 -0
  43. package/src/preflight.js +27 -1
  44. package/src/status-footer.js +19 -12
  45. package/task-lib/commands/list.js +90 -78
  46. package/task-lib/commands/status.js +97 -40
  47. package/task-lib/effective-status.js +52 -0
package/README.md CHANGED
@@ -24,16 +24,7 @@
24
24
 
25
25
  **The agent that wrote the code shouldn't be the one that says it works.**
26
26
 
27
- Zeroshot is an open-source, multi-agent orchestration engine for autonomous software engineering. It drives a coding agent you already run (Claude Code, OpenAI Codex, Gemini CLI, or OpenCode) through an **executor-verifier loop**: an agent writes the change, then an _independent_ verifier that never saw how it was made approves it, or hands back a reproducible failure. The loop runs until the change is verified.
28
-
29
- <div align="center">
30
- <picture>
31
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/zeroshot-architecture-dark.webp">
32
- <img alt="One Zeroshot run drawn as a graph: an issue enters, a level-2 conductor scores it on a complexity matrix, lands on uncertain and escalates to level 3, which calls it critical; the config router sizes the cluster, a planner and worker execute, two stages of validators judge the result, and the change is rejected once before it is approved" src="docs/assets/zeroshot-architecture-light.webp" width="100%">
33
- </picture>
34
- <br>
35
- <em>One run, drawn as it happens. A conductor scores the issue, escalates what it can't call, the router sizes the cluster, and the change is rejected once before it is approved.</em>
36
- </div>
27
+ Independent executor–verifier orchestration for software changes.
37
28
 
38
29
  ## Install
39
30
 
@@ -41,123 +32,100 @@ Zeroshot is an open-source, multi-agent orchestration engine for autonomous soft
41
32
 
42
33
  ```bash
43
34
  npm install -g @the-open-engine/zeroshot
35
+ zeroshot
44
36
  ```
45
37
 
46
- Requires **Node ≥ 22** and at least one provider CLI (Claude Code, Codex, Gemini, or OpenCode). The package includes the pinned Opcore constraints CLI; repository hook activation remains explicit. Linux and macOS today; Windows is deferred.
38
+ Requires **Node ≥ 22** and one supported provider. Guided setup detects installed providers, chooses a default, and configures worktree isolation for fresh repositories. Linux and macOS today; Windows is deferred.
47
39
 
48
- <div align="center">
49
- <img src="docs/assets/zeroshot-demo.gif" alt="Zeroshot resolving an issue through the executor-verifier loop" width="760">
50
- <br>
51
- <em>And here it is actually running. Unattended, 100× speed · 90-minute run · 5 iterations to approval.</em>
52
- </div>
53
-
54
- ## How it works
55
-
56
- Zeroshot separates the agent that **writes** the code from the agent that **judges** it.
57
-
58
- A conductor sizes the workflow to the task. An executor (an AI coding agent) implements the change in an isolated workspace (git worktree or Docker). Then an **independent verifier** inspects the result without ever seeing the executor's context or history, so it cannot approve its own reasoning. The verifier returns `APPROVED`, or `REJECTED` with an actionable, reproducible failure, and the loop repeats until the change is verified or hands back a concrete reason it isn't. Every step is written to a crash-safe SQLite ledger, so a run survives a reboot and resumes where it stopped.
59
-
60
- Bring your own provider and your own backend. Zeroshot orchestrates the agents that write your code; it doesn't store your keys or replace your models.
61
-
62
- ## How is this different from a single coding agent?
63
-
64
- | | A single coding agent | Zeroshot |
65
- | --------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------- |
66
- | Who says it is correct? | the same agent that wrote it | a separate agent that never saw how it was written |
67
- | Is the code actually run? | usually just claimed | executed against your real tests |
68
- | When it fails, you get | an assertion it is fine | a reproducible failure |
69
- | When does it stop? | when it decides it is done | when the change is verified, or provably is not |
70
- | Which coding agent runs it? | one, fixed | any you already run: Zeroshot is the harness around Claude Code, Codex, Gemini, or OpenCode |
71
-
72
- ## Quick start
40
+ ## First run
73
41
 
74
42
  ```bash
75
- zeroshot run 123 # a GitHub issue number
76
- zeroshot run feature.md # a markdown spec
77
- zeroshot run "Add a --json flag" # inline text
43
+ cd your-repo
44
+ zeroshot run "Add a --json flag with tests"
78
45
  ```
79
46
 
80
- Describe a non-trivial task inline and let the loop run it to a verified change:
47
+ In a git repository, the guided default runs in a separate worktree, so the current checkout is not edited. Use `--no-isolation` only when you explicitly want the run to modify the current checkout.
48
+
49
+ Observe the result from another terminal:
81
50
 
82
51
  ```bash
83
- zeroshot run "Add optimistic locking with automatic retry: when updating a user,
84
- retry with exponential backoff up to 3 times, merge non-conflicting field changes,
85
- and surface conflicts with details. Handle the ABA problem where version goes A->B->A."
52
+ zeroshot list
53
+ zeroshot logs <id> -f
86
54
  ```
87
55
 
88
- <details>
89
- <summary><strong>Command reference</strong></summary>
56
+ <div align="center">
57
+ <img src="docs/assets/zeroshot-demo.gif" alt="Zeroshot resolving an issue through the executor-verifier loop" width="760">
58
+ <br>
59
+ <em>Unattended, 100× speed · 90-minute run · 5 iterations to approval.</em>
60
+ </div>
90
61
 
91
- ```bash
92
- # Run
93
- zeroshot run <input> # issue number / URL / key / markdown file / inline text
94
- zeroshot run 123 --worktree # isolate in a git worktree
95
- zeroshot run 123 --docker # isolate in a container
96
- zeroshot run 123 --pr # worktree + open a pull request
97
- zeroshot run 123 --ship # worktree + PR + auto-merge on approval
98
- zeroshot run 123 -d # background (daemon)
99
- zeroshot run 123 --provider gemini # override the provider for this run
100
-
101
- # Monitor & manage
102
- zeroshot list # all clusters (--json)
103
- zeroshot status <id> # cluster details
104
- zeroshot logs <id> -f # stream logs
105
- zeroshot resume <id> [prompt] # resume a stopped/failed run
106
- zeroshot stop <id> # graceful stop
107
- zeroshot kill <id> # force kill
108
- zeroshot export <id> # export the conversation
109
-
110
- # Library & config
111
- zeroshot providers # list providers / set-default / setup
112
- zeroshot agents list # available agents (agents show <name>)
113
- zeroshot settings # view / get / set settings
114
- zeroshot cmdproof check <id> # reuse a verified command result
115
- ```
62
+ ## How it works
116
63
 
117
- </details>
64
+ Zeroshot drives a coding agent through an **executor–verifier loop**. A conductor sizes the workflow, an executor implements the change in an isolated workspace, and a separate verifier judges the observable result. Validators do not share the executor's session or reasoning context; they may receive explicit handoff artifacts and must reproduce reported failures. The loop continues until the change is verified or returns a concrete reason it is not.
65
+
66
+ Every step is written to a crash-safe SQLite ledger. Bring your own provider and backend: Zeroshot orchestrates their CLIs without storing provider keys.
118
67
 
119
- ## Providers and backends
68
+ <div align="center">
69
+ <picture>
70
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/zeroshot-architecture-dark.webp">
71
+ <img alt="One Zeroshot run drawn as a graph: an issue enters, a conductor sizes the cluster, an executor implements it, and validators reject or approve the result" src="docs/assets/zeroshot-architecture-light.webp" width="100%">
72
+ </picture>
73
+ <br>
74
+ <em>One run: classify, execute, verify, and repeat when evidence fails.</em>
75
+ </div>
120
76
 
121
- Zeroshot shells out to provider CLIs; it stores no API keys and manages no auth. Pick a default and override per run.
77
+ ## Providers and issue sources
122
78
 
123
- | Provider | CLI |
124
- | ------------ | -------------------------------------- |
125
- | Claude Code | `npm i -g @anthropic-ai/claude-code` |
126
- | OpenAI Codex | `npm i -g @openai/codex` |
127
- | Gemini CLI | `npm i -g @google/gemini-cli` |
128
- | OpenCode | see [opencode.ai](https://opencode.ai) |
79
+ Provider engines come from the registry: **Claude, Codex, bundled Gateway, Gemini, OpenCode, Pi, OMP, Kiro, and Copilot**. Model gateways stay behind the single Gateway provider.
129
80
 
130
81
  ```bash
131
- zeroshot providers # see what's installed
82
+ zeroshot providers
132
83
  zeroshot providers set-default codex
133
84
  zeroshot run 123 --provider gemini
134
85
  ```
135
86
 
136
- Issue backends are **auto-detected from your git remote**: **GitHub, GitLab, Jira, and Azure DevOps**. Paste a number, key, or URL:
87
+ Issue sources are auto-detected from repository context or explicit URLs: **GitHub, GitLab, Jira, Azure DevOps, and Linear**. Each source requires its own authenticated client where applicable. See [`docs/providers.md`](docs/providers.md) for provider installation, model levels, and credentials.
137
88
 
138
- ```bash
139
- zeroshot run 123 # GitHub
140
- zeroshot run https://gitlab.com/org/repo/-/issues/456 # GitLab
141
- zeroshot run PROJ-789 # Jira
142
- zeroshot run https://dev.azure.com/org/project/_workitems/edit/999 # Azure DevOps
143
- ```
89
+ ## Isolation and delivery
144
90
 
145
- Each backend needs its own CLI installed (`gh`, `glab`, `jira`, or `az`). See [`docs/providers.md`](docs/providers.md) for model levels and setup.
91
+ Guided setup defaults fresh repositories to git worktree isolation. Delivery flags cascade: `--ship` implies `--pr`, which implies `--worktree`.
146
92
 
147
- ## Isolation
93
+ | Mode | Flag | Behavior |
94
+ | ---------------- | ---------------- | --------------------------------------------------- |
95
+ | Git worktree | `--worktree` | isolated branch and checkout; guided default |
96
+ | Docker | `--docker` | container isolation for riskier workloads |
97
+ | Current checkout | `--no-isolation` | explicit escape hatch; modifies the active checkout |
98
+ | Pull request | `--pr` | worktree plus PR creation |
99
+ | Ship | `--ship` | worktree, PR, and merge after approval |
148
100
 
149
- By default, agents modify files only; they do **not** commit or push. Opt into isolation to let the loop own a branch (the flags cascade: `--ship` → `--pr` → `--worktree`).
101
+ <details>
102
+ <summary><strong>Command reference</strong></summary>
150
103
 
151
- | Mode | Flag | Use when |
152
- | ------------ | ------------ | ------------------------------------------------ |
153
- | None | _(default)_ | quick task, you review the changes yourself |
154
- | Git worktree | `--worktree` | PR workflows, lightweight branch isolation |
155
- | Docker | `--docker` | risky experiments, parallel runs, full isolation |
104
+ ```bash
105
+ zeroshot run <input> # issue, URL, markdown file, or inline text
106
+ zeroshot run 123 --docker # container isolation
107
+ zeroshot run 123 --pr # worktree + pull request
108
+ zeroshot run 123 --ship # worktree + PR + merge after approval
109
+ zeroshot run 123 -d # background run
110
+
111
+ zeroshot list # tasks and clusters (--json)
112
+ zeroshot status <id> # detailed status (--json)
113
+ zeroshot logs <id> -f # stream logs
114
+ zeroshot resume <id> [prompt] # resume a stopped or failed run
115
+ zeroshot stop <id> # graceful stop
116
+ zeroshot kill <id> # force stop
117
+
118
+ zeroshot providers # provider availability and defaults
119
+ zeroshot settings # effective settings
120
+ zeroshot agents list # available agents
121
+ ```
122
+
123
+ </details>
156
124
 
157
125
  <details>
158
- <summary><strong>Docker credential mounts</strong></summary>
126
+ <summary><strong>Docker credential configuration</strong></summary>
159
127
 
160
- When using `--docker`, Zeroshot mounts credential directories so agents can reach provider CLIs and tools. Defaults: `gh`, `git`, `ssh`. Presets include `aws`, `azure`, `kube`, `terraform`, `gcloud`, and the provider configs.
128
+ Docker mounts and environment forwarding are explicit and provider-aware. Defaults include `gh`, `git`, and `ssh`; provider-specific authentication follows the registry contract.
161
129
 
162
130
  ```bash
163
131
  zeroshot settings set dockerMounts '["gh","git","ssh","aws"]'
@@ -165,7 +133,7 @@ zeroshot run 123 --docker --mount ~/.aws:/root/.aws:ro
165
133
  zeroshot run 123 --docker --no-mounts
166
134
  ```
167
135
 
168
- See [`docs/providers.md`](docs/providers.md) for mount details.
136
+ See [`docs/providers.md`](docs/providers.md) for details.
169
137
 
170
138
  </details>
171
139