agentplane 0.4.2 → 0.4.3
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 +58 -105
- package/assets/AGENTS.md +4 -4
- package/assets/codex-plugin/assets/header.png +0 -0
- package/assets/policy/incidents.md +2 -0
- package/bin/agentplane.js +94 -1
- package/dist/.build-manifest.json +3 -3
- package/dist/cli.js +437 -374
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
# AgentPlane
|
|
1
|
+
# AgentPlane CLI
|
|
2
|
+
|
|
3
|
+
**The open-source audit layer for coding agents.**
|
|
4
|
+
|
|
5
|
+
`agentplane` is a local CLI that turns Claude Code, Codex, Cursor, Aider, and similar coding-agent
|
|
6
|
+
work into reviewable, reversible Git artifacts.
|
|
2
7
|
|
|
3
8
|
[](https://www.npmjs.com/package/agentplane)
|
|
4
9
|
[](https://www.npmjs.com/package/agentplane)
|
|
10
|
+
[](https://github.com/basilisk-labs/agentplane/stargazers)
|
|
5
11
|
[](https://github.com/basilisk-labs/agentplane/blob/main/LICENSE)
|
|
6
12
|
[](https://agentplane.org/docs/user/prerequisites)
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
work auditable inside your Git repository:
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
task -> plan -> approve -> implement -> verify -> finish
|
|
15
|
-
```
|
|
14
|
+
[](https://registry.npmjs.org/-/npm/v1/attestations/agentplane@latest)
|
|
15
|
+
[](https://docs.npmjs.com/generating-provenance-statements)
|
|
16
|
+
[](https://agentplane.org/docs/recipes)
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Install
|
|
18
|
+
## Install in 30 seconds
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
21
|
npm i -g agentplane
|
|
@@ -24,141 +23,95 @@ agentplane init
|
|
|
24
23
|
agentplane quickstart
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- Node.js 20+
|
|
30
|
-
- Git repository
|
|
31
|
-
- Local terminal
|
|
32
|
-
|
|
33
|
-
Prefer not to install globally:
|
|
26
|
+
Prefer no global install:
|
|
34
27
|
|
|
35
28
|
```bash
|
|
36
29
|
npx agentplane init
|
|
37
30
|
npx agentplane quickstart
|
|
38
31
|
```
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Coding agents can change files. Teams still need to know what happened:
|
|
43
|
-
|
|
44
|
-
- What task was the agent solving?
|
|
45
|
-
- What plan was approved?
|
|
46
|
-
- What changed in the repository?
|
|
47
|
-
- What was verified?
|
|
48
|
-
- Why was the task considered finished?
|
|
49
|
-
|
|
50
|
-
AgentPlane adds a visible workflow layer around agent work without replacing Git, your editor, or
|
|
51
|
-
your terminal.
|
|
33
|
+
Requirements: Node.js 20+, Git, and a local terminal.
|
|
52
34
|
|
|
53
|
-
## What
|
|
54
|
-
|
|
55
|
-
`agentplane init` creates a visible workflow surface:
|
|
35
|
+
## What you get after `agentplane init`
|
|
56
36
|
|
|
57
37
|
```text
|
|
58
38
|
AGENTS.md or CLAUDE.md Policy gateway for the repository
|
|
59
39
|
.agentplane/ Repo-local workflow workspace
|
|
60
|
-
.agentplane/
|
|
40
|
+
.agentplane/WORKFLOW.md Current workflow/config contract
|
|
61
41
|
.agentplane/agents/ Installed agent profiles
|
|
62
42
|
.agentplane/tasks/ Per-task records and evidence
|
|
63
|
-
.agentplane/
|
|
43
|
+
.agentplane/workflows/ Last-known-good workflow snapshot
|
|
64
44
|
```
|
|
65
45
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## First task flow
|
|
46
|
+
AgentPlane does not run a hosted control plane. It records the task trail inside the repository you
|
|
47
|
+
already review.
|
|
70
48
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
agentplane task new --title "First task" --description "Describe the change" --priority med --owner DOCS --tag docs
|
|
75
|
-
agentplane task plan set <task-id> --text "Explain the plan" --updated-by DOCS
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
If your repository requires explicit plan approval, run:
|
|
49
|
+
## One task loop
|
|
79
50
|
|
|
80
51
|
```bash
|
|
52
|
+
agentplane task new --title "Fix parser edge case" --description "Reject empty labels." --owner CODER --tag code
|
|
53
|
+
agentplane task plan set <task-id> --text "Add a fixture, tighten validation, and run focused tests." --updated-by CODER
|
|
81
54
|
agentplane task plan approve <task-id> --by ORCHESTRATOR
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Then start work, record verification, and finish:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
agentplane task start-ready <task-id> --author DOCS --body "Start: ..."
|
|
55
|
+
agentplane task start-ready <task-id> --author CODER --body "Start: implementing parser validation with focused tests."
|
|
56
|
+
# Run Claude Code, Codex, Cursor, Aider, or edit manually.
|
|
88
57
|
agentplane task verify-show <task-id>
|
|
89
|
-
agentplane verify <task-id> --ok --by
|
|
90
|
-
agentplane finish <task-id> --author
|
|
58
|
+
agentplane verify <task-id> --ok --by CODER --note "Focused tests passed."
|
|
59
|
+
agentplane finish <task-id> --author CODER --result "Parser rejects empty labels." --commit <git-rev>
|
|
91
60
|
```
|
|
92
61
|
|
|
93
|
-
|
|
94
|
-
|
|
62
|
+
The visible output is the point: a reviewer can inspect task intent, plan, verification, and closure
|
|
63
|
+
from Git-visible files.
|
|
95
64
|
|
|
96
|
-
|
|
65
|
+
Roles like `CODER` and `ORCHESTRATOR` are configurable agent IDs. See
|
|
66
|
+
[Agents](https://agentplane.org/docs/user/agents).
|
|
97
67
|
|
|
98
|
-
|
|
99
|
-
| ------------------------ | ------------------------------- |
|
|
100
|
-
| Prompt in chat | Task is recorded |
|
|
101
|
-
| Agent edits files | Plan is explicit |
|
|
102
|
-
| Human inspects diff | Approval is visible |
|
|
103
|
-
| Context is scattered | Verification is stored |
|
|
104
|
-
| Verification is implicit | Finish creates closure evidence |
|
|
105
|
-
| Closure is manual | Everything lives close to Git |
|
|
106
|
-
|
|
107
|
-
## Workflow modes
|
|
68
|
+
## Agent Change Record
|
|
108
69
|
|
|
109
|
-
|
|
70
|
+
Every task can produce an **Agent Change Record (ACR)**, a deterministic JSON evidence projection
|
|
71
|
+
of intent, accepted plan, verification result, policy decisions, and closure commit.
|
|
110
72
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
73
|
+
```bash
|
|
74
|
+
agentplane acr generate <task-id> --work-commit HEAD --write
|
|
75
|
+
agentplane acr validate .agentplane/tasks/<task-id>/acr.json
|
|
76
|
+
agentplane acr check <task-id> --require-plan-approved --require-verification
|
|
77
|
+
agentplane acr --help
|
|
78
|
+
```
|
|
117
79
|
|
|
118
|
-
|
|
80
|
+
Schema: https://agentplane.org/schemas/acr-v0.1.schema.json
|
|
119
81
|
|
|
120
|
-
|
|
121
|
-
- Maintainers who want agent changes to remain reviewable.
|
|
122
|
-
- Teams that need task state, verification, and closure before merging agent-generated work.
|
|
123
|
-
- Local-first builders who do not want a hosted agent runtime between their repo and their workflow.
|
|
82
|
+
## Workflow modes
|
|
124
83
|
|
|
125
|
-
|
|
84
|
+
- `direct` keeps work in the current checkout for fast local loops.
|
|
85
|
+
- `branch_pr` creates per-task branches, worktrees, PR artifacts, and integration handoff.
|
|
126
86
|
|
|
127
|
-
|
|
128
|
-
- Not a prompt framework.
|
|
129
|
-
- Not a replacement for Git.
|
|
130
|
-
- Not a replacement for your editor.
|
|
131
|
-
- Not a replacement for Claude Code, Codex, Cursor, or Aider.
|
|
87
|
+
## Compatible with
|
|
132
88
|
|
|
133
|
-
|
|
89
|
+
Claude Code, Codex CLI, Cursor agent, Aider, GitHub Actions agent runners, and MCP-driven
|
|
90
|
+
workflows. AgentPlane does not replace them; it records what they did and whether your gates passed.
|
|
134
91
|
|
|
135
|
-
|
|
92
|
+
## Recipes
|
|
136
93
|
|
|
137
|
-
|
|
138
|
-
- [AgentPlane + Codex](https://agentplane.org/docs/workflow-guides/codex)
|
|
139
|
-
- [AgentPlane + Cursor](https://agentplane.org/docs/workflow-guides/cursor)
|
|
140
|
-
- [AgentPlane + Aider](https://agentplane.org/docs/workflow-guides/aider)
|
|
141
|
-
- [AgentPlane + GitHub Actions](https://agentplane.org/docs/workflow-guides/github-actions)
|
|
142
|
-
- [AgentPlane + branch_pr workflow](https://agentplane.org/docs/workflow-guides/branch-pr)
|
|
94
|
+
Recipes are signed, versioned behavior modules for AgentPlane:
|
|
143
95
|
|
|
144
|
-
|
|
145
|
-
|
|
96
|
+
```bash
|
|
97
|
+
agentplane recipes list-remote
|
|
98
|
+
agentplane recipes install code-map --refresh --yes
|
|
99
|
+
```
|
|
146
100
|
|
|
147
|
-
|
|
101
|
+
Start with [Code Map](https://agentplane.org/docs/recipes/code-map).
|
|
148
102
|
|
|
149
|
-
|
|
103
|
+
## Docs
|
|
150
104
|
|
|
151
105
|
- [Overview](https://agentplane.org/docs/user/overview)
|
|
152
106
|
- [Setup](https://agentplane.org/docs/user/setup)
|
|
153
|
-
- [Workflow](https://agentplane.org/docs/user/workflow)
|
|
154
107
|
- [Task lifecycle](https://agentplane.org/docs/user/task-lifecycle)
|
|
155
|
-
- [
|
|
156
|
-
- [
|
|
108
|
+
- [Workflow guides](https://agentplane.org/docs/workflow-guides)
|
|
109
|
+
- [Recipes](https://agentplane.org/docs/recipes)
|
|
110
|
+
- [Comparison](https://agentplane.org/docs/compare)
|
|
157
111
|
|
|
158
|
-
##
|
|
112
|
+
## Repository
|
|
159
113
|
|
|
160
|
-
|
|
161
|
-
- [Contributing](https://github.com/basilisk-labs/agentplane/blob/main/CONTRIBUTING.md)
|
|
114
|
+
https://github.com/basilisk-labs/agentplane
|
|
162
115
|
|
|
163
116
|
## License
|
|
164
117
|
|
package/assets/AGENTS.md
CHANGED
|
@@ -21,7 +21,7 @@ Detailed procedures live in canonical modules from `## CANONICAL DOCS`.
|
|
|
21
21
|
- Repository type: user project initialized with `agentplane`.
|
|
22
22
|
- Gateway role: keep this file compact and deterministic; move scenario-specific details to policy modules.
|
|
23
23
|
- CLI rule: use `agentplane` from `PATH`; if unavailable, stop and request installation guidance (do not invent repo-local entrypoints).
|
|
24
|
-
- Startup shortcut: run `## COMMANDS -> Preflight`, then use `agentplane quickstart`; activate `agentplane role ORCHESTRATOR` for planning and `agentplane role <ROLE>` for the active owner before owner-scoped execution; then apply `## LOAD RULES` before any mutation. The guarded route is determined by `
|
|
24
|
+
- Startup shortcut: run `## COMMANDS -> Preflight`, then use `agentplane quickstart`; activate `agentplane role ORCHESTRATOR` for planning and `agentplane role <ROLE>` for the active owner before owner-scoped execution; then apply `## LOAD RULES` before any mutation. The guarded route is determined by `workflow.mode` in `.agentplane/WORKFLOW.md`; use `agentplane quickstart` as the canonical summary of the active path before mutating. In `branch_pr`, start from `agentplane work start ... --worktree`; in `direct`, stay in the current checkout and use the task lifecycle route.
|
|
25
25
|
|
|
26
26
|
<!-- /ap:fragment -->
|
|
27
27
|
<!-- ap:fragment id="gateway.agents.source_of_truth.sources.of.truth" slot="source_of_truth" mutability="replaceable" -->
|
|
@@ -33,7 +33,7 @@ Priority order (highest first):
|
|
|
33
33
|
1. Enforcement: CI, tests, linters, hooks, CLI validations.
|
|
34
34
|
2. Policy gateway: `AGENTS.md`.
|
|
35
35
|
3. Canonical policy modules from `## CANONICAL DOCS`.
|
|
36
|
-
4. CLI guidance: `agentplane quickstart`, `agentplane role <ROLE>`, `.agentplane/
|
|
36
|
+
4. CLI guidance: `agentplane quickstart`, `agentplane role <ROLE>`, `.agentplane/WORKFLOW.md`.
|
|
37
37
|
5. Reference examples from `## REFERENCE EXAMPLES`.
|
|
38
38
|
|
|
39
39
|
Conflict rule:
|
|
@@ -135,8 +135,8 @@ Condition: task includes mutation (file edits, task-state changes, commits, merg
|
|
|
135
135
|
|
|
136
136
|
### Conditional imports (linear IF -> LOAD contract)
|
|
137
137
|
|
|
138
|
-
1. IF `
|
|
139
|
-
2. IF `
|
|
138
|
+
1. IF `workflow.mode=direct` THEN LOAD `@.agentplane/policy/workflow.direct.md`.
|
|
139
|
+
2. IF `workflow.mode=branch_pr` THEN LOAD `@.agentplane/policy/workflow.branch_pr.md`.
|
|
140
140
|
3. IF task touches release/version/publish THEN LOAD `@.agentplane/policy/workflow.release.md`.
|
|
141
141
|
4. IF task runs `agentplane upgrade` or touches `.agentplane/.upgrade/**` THEN LOAD `@.agentplane/policy/workflow.upgrade.md`.
|
|
142
142
|
5. IF task modifies implementation code paths THEN LOAD `@.agentplane/policy/dod.code.md`.
|
|
Binary file
|
|
@@ -13,3 +13,5 @@
|
|
|
13
13
|
- id: INC-20260501-03 | date: 2026-05-01 | scope: Make post-publish release evidence PR recovery authenticate gh so successful releases do not end as failed after publication. | tags: ci, release, workflow | match: ci, release, workflow, make, post, publish, evidence, recovery, authenticate, successful, releases, not, end, failed, after, publication | failure: Release evidence gh CLI steps now set GH_TOKEN from github.token. | advice: Added GH_TOKEN env to release evidence PR check/create/merge steps and contract coverage. | rule: Analogous Make post-publish release evidence PR recovery authenticate gh so successful releases do not end as failed after publication. work MUST review and apply the recorded external incident advice before retrying. | evidence: task 202605012054-HS993A; commit c329da9be70f | enforcement: manual | fixability: external | state: open
|
|
14
14
|
- id: INC-20260501-04 | date: 2026-05-01 | scope: Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies. | tags: release, workflow | match: release, workflow, update, the, homebrew, formula, renderer, and, tap, fresh, agentplane, releases, install, without, npm, min | failure: Updated render-homebrew-formula to install the cached npm tarball without std_npm_args/min-release-age, added contract coverage, and pushed basilisk-labs/homebrew-tap c6d3e94 for v0.4.1. Local Homebrew install reached Cellar successfully; final link was blocked only by an existing /opt/homebrew/bin/agentplane npm-global symlink. | advice: Run brew link --overwrite agentplane when an old npm-global symlink is present; standalone no-Node install requires a future native/bundled CLI artifact. | rule: Analogous Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies. work MUST review and apply the recorded external incident advice before retrying. | evidence: task 202605012143-NEK3E8; commit 43bc2ed84a23 | enforcement: manual | fixability: external | state: open
|
|
15
15
|
- id: INC-20260503-01 | date: 2026-05-03 | scope: Port the artifacts_language configuration and PR artifact language validation from the stale cli-artifacts branch onto current main, preserving current v0.4.2 release state. | tags: code, release, workflow | match: code, release, workflow, port, the, artifacts, language, configuration, and, artifact, validation, from, stale, cli, branch, onto | failure: Ported artifacts_language=en and PR artifact language validation onto current main; stale trust branch was not merged because it would reintroduce old task states. | advice: No rework required before PR. | rule: Analogous Port the artifacts_language configuration and PR artifact language validation from the stale cli-artifacts branch onto current main, preserving current v0.4.2 release state. work MUST review and apply the recorded external incident advice before retrying. | evidence: task 202605030733-BHD4S4; commit c66cff3d6f16 | enforcement: manual | fixability: external | state: open
|
|
16
|
+
- id: INC-20260503-02 | date: 2026-05-03 | scope: Update standalone release artifact smoke testing to accept the current doctor OK output and surface doctor output on failures so v0.4.2 publish can complete. | tags: code, release, testing | match: code, release, testing, update, standalone, artifact, smoke, accept, the, current, doctor, output, and, surface, failures, publish | failure: Publish run 25273723107 failed before npm/tag at standalone linux-x64 doctor smoke because the script expected 'doctor OK' but current CLI emits 'doctor (OK)'. | advice: Smoke now accepts both legacy and current doctor OK markers and includes doctor output on failure. | rule: Analogous Update standalone release artifact smoke testing to accept the current doctor OK output and surface doctor output on failures so v0.4.2 publish can complete. work MUST review and apply the recorded external incident advice before retrying. | evidence: task 202605030807-DBY2RS; commit 2c98719336c8 | enforcement: manual | fixability: external | state: open
|
|
17
|
+
- id: INC-20260503-03 | date: 2026-05-03 | scope: Split AgentPlane default sign-off identity from repo-wide manual DCO validation and make .agentplane/tasks.json an optional generated export snapshot rather than tracked required state. | tags: code, git, tasks | match: code, git, tasks, split, agentplane, default, sign, off, identity, from, repo, wide, manual, dco, validation, and | failure: Full hook-run suite was not used as final evidence because an unrelated existing pre-push scenario still tries to git add .agentplane/config.json after the WORKFLOW-only migration. | advice: Focused checks pass; remaining doctor warning is outside this task scope. | rule: Analogous Split AgentPlane default sign-off identity from repo-wide manual DCO validation and make .agentplane/tasks.json an optional generated export snapshot rather than tracked required state. work MUST review and apply the recorded external incident advice before retrying. | evidence: task 202605031737-9A4FWX; commit eda55d00831b | enforcement: manual | fixability: external | state: open
|
package/bin/agentplane.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { stat } from "node:fs/promises";
|
|
5
|
+
import { mkdir, rm, stat } from "node:fs/promises";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { distExists, isPackageBuildFresh } from "./dist-guard.js";
|
|
@@ -186,6 +186,95 @@ function renderStalePolicyWarning(reason) {
|
|
|
186
186
|
return "warning: allowing read-only diagnostic command to run with a stale repo build inside the framework checkout.\n";
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
function staleAutoBootstrapEnabled() {
|
|
190
|
+
return (process.env.AGENTPLANE_DEV_AUTO_BOOTSTRAP ?? "1").trim() !== "0";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function alreadyTriedStaleAutoBootstrap() {
|
|
194
|
+
return (process.env.AGENTPLANE_DEV_AUTO_BOOTSTRAPPED ?? "").trim() === "1";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
async function withBootstrapLock(repoRoot, fn) {
|
|
198
|
+
const lockParent = path.join(repoRoot, ".agentplane", "cache");
|
|
199
|
+
const lockDir = path.join(lockParent, "framework-dev-bootstrap.lock");
|
|
200
|
+
await mkdir(lockParent, { recursive: true });
|
|
201
|
+
try {
|
|
202
|
+
await mkdir(lockDir, { recursive: false });
|
|
203
|
+
} catch (error) {
|
|
204
|
+
if (error?.code !== "EEXIST") throw error;
|
|
205
|
+
process.stderr.write(
|
|
206
|
+
"error: another framework dev bootstrap is already running.\n" +
|
|
207
|
+
`Retry after the lock is released: ${path.relative(repoRoot, lockDir)}\n`,
|
|
208
|
+
);
|
|
209
|
+
process.exitCode = 2;
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
try {
|
|
214
|
+
return await fn();
|
|
215
|
+
} finally {
|
|
216
|
+
await rm(lockDir, { recursive: true, force: true });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function autoBootstrapAndRerun(repoRoot, staleReasons, commandPolicy) {
|
|
221
|
+
if (!staleAutoBootstrapEnabled() || alreadyTriedStaleAutoBootstrap()) return false;
|
|
222
|
+
|
|
223
|
+
const commandText = process.argv
|
|
224
|
+
.slice(2)
|
|
225
|
+
.map((value) => String(value ?? "").trim())
|
|
226
|
+
.filter(Boolean)
|
|
227
|
+
.join(" ");
|
|
228
|
+
process.stderr.write(
|
|
229
|
+
"info: stale repo build detected; running framework dev bootstrap before command.\n" +
|
|
230
|
+
`command: ${commandText || "<unknown>"}\n` +
|
|
231
|
+
`detected: ${staleReasons.join(", ")}\n` +
|
|
232
|
+
`reason: ${commandPolicy.reason}\n`,
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
return await withBootstrapLock(repoRoot, async () => {
|
|
236
|
+
const bootstrap = spawnSync("bun", ["run", "framework:dev:bootstrap"], {
|
|
237
|
+
cwd: repoRoot,
|
|
238
|
+
stdio: "inherit",
|
|
239
|
+
env: {
|
|
240
|
+
...process.env,
|
|
241
|
+
AGENTPLANE_DEV_AUTO_BOOTSTRAP: "0",
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
if (bootstrap.error || bootstrap.status !== 0) {
|
|
246
|
+
const reason = bootstrap.error?.message ?? `exit ${bootstrap.status ?? "unknown"}`;
|
|
247
|
+
process.stderr.write(
|
|
248
|
+
`error: automatic framework dev bootstrap failed (${reason}).\n` +
|
|
249
|
+
"Manual fallback:\n" +
|
|
250
|
+
FRAMEWORK_DEV_MANUAL_REPAIR_COMMANDS.map((command) => ` ${command}\n`).join(""),
|
|
251
|
+
);
|
|
252
|
+
process.exitCode = bootstrap.status ?? 2;
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const rerun = spawnSync(
|
|
257
|
+
process.execPath,
|
|
258
|
+
[fileURLToPath(import.meta.url), ...process.argv.slice(2)],
|
|
259
|
+
{
|
|
260
|
+
cwd: process.cwd(),
|
|
261
|
+
stdio: "inherit",
|
|
262
|
+
env: {
|
|
263
|
+
...process.env,
|
|
264
|
+
AGENTPLANE_DEV_AUTO_BOOTSTRAPPED: "1",
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
);
|
|
268
|
+
if (rerun.error) {
|
|
269
|
+
process.stderr.write(`error: failed to rerun after bootstrap: ${rerun.error.message}\n`);
|
|
270
|
+
process.exitCode = 2;
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
process.exitCode = rerun.status ?? (rerun.signal ? 1 : 0);
|
|
274
|
+
return true;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
189
278
|
function missingRepoRuntimeDependencies(agentplaneRoot) {
|
|
190
279
|
const requireFromAgentplane = createRequire(path.join(agentplaneRoot, "package.json"));
|
|
191
280
|
const frameworkRoot = path.resolve(agentplaneRoot, "..", "..");
|
|
@@ -300,6 +389,10 @@ async function assertDistUpToDate() {
|
|
|
300
389
|
|
|
301
390
|
const commandPolicy = classifyStaleDistPolicy(process.argv);
|
|
302
391
|
if (commandPolicy.mode === "warn_and_run") {
|
|
392
|
+
if (await autoBootstrapAndRerun(repoRoot, staleReasons, commandPolicy)) {
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
|
|
303
396
|
const commandText = process.argv
|
|
304
397
|
.slice(2)
|
|
305
398
|
.map((value) => String(value ?? "").trim())
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"manifest_kind": "package",
|
|
4
4
|
"package_name": "agentplane",
|
|
5
|
-
"package_version": "0.4.
|
|
6
|
-
"git_head": "
|
|
7
|
-
"watched_runtime_snapshot_hash": "
|
|
5
|
+
"package_version": "0.4.3",
|
|
6
|
+
"git_head": "04ccc002125560cd2ec87094e20cd5a9907d2016",
|
|
7
|
+
"watched_runtime_snapshot_hash": "5a534e101008bc57436f81a2364408cd0c5368241c43b43a4a814875fa750f68"
|
|
8
8
|
}
|