agentplane 0.3.5 → 0.3.6
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 +103 -75
- package/assets/AGENTS.md +4 -2
- package/bin/dist-guard.js +13 -3
- package/bin/runtime-watch.d.ts +1 -0
- package/bin/runtime-watch.js +22 -5
- package/bin/stale-dist-policy.js +9 -2
- package/dist/.build-manifest.json +196 -776
- package/dist/backends/task-backend.test-helpers.d.ts +4 -0
- package/dist/backends/task-backend.test-helpers.d.ts.map +1 -0
- package/dist/backends/task-backend.test-helpers.js +33 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +1 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +3 -2
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +30 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/core.js +137 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.js +52 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/project.js +78 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts +19 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/shared.js +9 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/task.js +85 -0
- package/dist/cli/run-cli/command-catalog.d.ts +3 -18
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +8 -337
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +64 -2
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui.js +33 -13
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +41 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +2 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.js +6 -0
- package/dist/cli/run-cli.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +138 -6
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -2
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +3 -6
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/allow.d.ts +5 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +15 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +137 -18
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +8 -35
- package/dist/commands/recipes/impl/apply.d.ts +4 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +70 -11
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +24 -12
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +32 -36
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -4
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -11
- package/dist/commands/recipes/impl/constants.d.ts +2 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +2 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +219 -23
- package/dist/commands/recipes/impl/normalize.d.ts +3 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -1
- package/dist/commands/recipes/impl/normalize.js +28 -24
- package/dist/commands/recipes/impl/paths.d.ts +9 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +10 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +7 -0
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-installed-recipes.js +102 -0
- package/dist/commands/recipes/impl/resolver.d.ts +20 -0
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -0
- package/dist/commands/recipes/impl/resolver.js +220 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +40 -11
- package/dist/commands/recipes/impl/types.d.ts +145 -16
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.js +3 -2
- package/dist/commands/recipes.d.ts +6 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +5 -3
- package/dist/commands/recipes.test-helpers.d.ts +185 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -0
- package/dist/commands/recipes.test-helpers.js +339 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +192 -336
- package/dist/commands/scenario/info.command.d.ts.map +1 -1
- package/dist/commands/scenario/info.command.js +7 -2
- package/dist/commands/scenario/list.command.js +2 -2
- package/dist/commands/scenario/run.command.d.ts.map +1 -1
- package/dist/commands/scenario/run.command.js +7 -2
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +77 -2
- package/dist/commands/shared/task-store.d.ts +32 -1
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +166 -42
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +46 -29
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +12 -37
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +12 -30
- package/dist/commands/task/close-shared.d.ts +14 -0
- package/dist/commands/task/close-shared.d.ts.map +1 -0
- package/dist/commands/task/close-shared.js +76 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +35 -17
- package/dist/commands/task/doc-set.command.d.ts +2 -1
- package/dist/commands/task/doc-set.command.d.ts.map +1 -1
- package/dist/commands/task/doc-set.command.js +36 -4
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +2 -7
- package/dist/commands/task/doc.command.js +1 -1
- package/dist/commands/task/doc.d.ts +2 -1
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +123 -71
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +138 -76
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +2 -8
- package/dist/commands/task/plan-set.command.js +1 -1
- package/dist/commands/task/plan.command.d.ts +8 -0
- package/dist/commands/task/plan.command.d.ts.map +1 -0
- package/dist/commands/task/plan.command.js +37 -0
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +190 -93
- package/dist/commands/task/set-status.command.d.ts.map +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +40 -3
- package/dist/commands/task/shared/docs.d.ts +1 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +7 -0
- package/dist/commands/task/shared/transitions.d.ts +0 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +0 -6
- package/dist/commands/task/shared.d.ts +2 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +88 -63
- package/dist/commands/task/task.command.d.ts +8 -0
- package/dist/commands/task/task.command.d.ts.map +1 -0
- package/dist/commands/task/task.command.js +71 -0
- package/dist/commands/task/verify-command-shared.d.ts +16 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -0
- package/dist/commands/task/verify-command-shared.js +53 -0
- package/dist/commands/task/verify-ok.command.d.ts +2 -6
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +8 -50
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +119 -140
- package/dist/commands/task/verify-rework.command.d.ts +2 -6
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +8 -50
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +3 -12
- package/dist/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +13 -4
- package/dist/policy/rules/protected-paths.d.ts.map +1 -1
- package/dist/policy/rules/protected-paths.js +6 -1
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/protected-paths.d.ts +7 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +26 -10
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +9 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,122 +3,150 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/agentplane)
|
|
4
4
|
[](https://www.npmjs.com/package/agentplane)
|
|
5
5
|
[](https://github.com/basilisk-labs/agentplane/blob/main/LICENSE)
|
|
6
|
-
[](https://
|
|
6
|
+
[](https://agentplane.org/docs/user/prerequisites)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**Git-native control plane for auditable agent work.**
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Put coding agents on a governed Git workflow.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- You need human approvals, clear roles, and traceable artifacts.
|
|
14
|
-
- You want guardrails by default, not optional add-ons.
|
|
15
|
-
- You want an offline-first CLI that keeps state local and inspectable.
|
|
12
|
+
`agentplane` is the CLI for AgentPlane. It runs locally inside a git repository, not in a hosted runtime, and adds visible workflow artifacts such as `AGENTS.md` or `CLAUDE.md`, `.agentplane/`, task records, verification state, and deterministic closure. Teams use it when they want agent work to stay explicit, inspectable, and governed inside the repository instead of behaving like an opaque assistant.
|
|
16
13
|
|
|
17
|
-
##
|
|
14
|
+
## What agentplane is
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
`agentplane` is a repo-native CLI workflow for agent-driven development.
|
|
17
|
+
|
|
18
|
+
- It runs in your repository and keeps workflow state local.
|
|
19
|
+
- It adds approvals, task state, verification, and finish to agent work.
|
|
20
|
+
- It supports both `direct` and `branch_pr` workflow modes.
|
|
21
|
+
- It keeps repository artifacts visible instead of hiding execution behind a hosted control plane.
|
|
22
|
+
|
|
23
|
+
## Why teams use it
|
|
24
|
+
|
|
25
|
+
Teams use `agentplane` when changing files is not enough and they need the work itself to stay legible.
|
|
26
|
+
|
|
27
|
+
- **Trust comes from visible process.** Plans, verification, and finish are recorded instead of implied.
|
|
28
|
+
- **The workflow stays local.** There is no hosted control plane between your repository and your team.
|
|
29
|
+
- **Git remains first-class.** `agentplane` governs agent work inside commits and repository state instead of bypassing them.
|
|
30
|
+
- **The same CLI fits different review styles.** Use `direct` for short loops or `branch_pr` for stricter integration.
|
|
31
|
+
|
|
32
|
+
## What appears in your repository
|
|
33
|
+
|
|
34
|
+
`agentplane init` creates a visible workflow surface inside the repository.
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
AGENTS.md or CLAUDE.md Policy gateway for the repository
|
|
38
|
+
.agentplane/ Repo-local workspace and workflow state
|
|
39
|
+
.agentplane/config.json Current repo configuration
|
|
40
|
+
.agentplane/agents/ Installed agent profiles
|
|
41
|
+
.agentplane/tasks/ Per-task records and evidence
|
|
42
|
+
.agentplane/WORKFLOW.md Current workflow contract
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
You may also see `.agentplane/tasks.json` later if you export a task snapshot, and `.agentplane/workflows/last-known-good.md` as part of the workflow runtime state.
|
|
46
|
+
|
|
47
|
+
## Install and first run
|
|
20
48
|
|
|
21
49
|
```bash
|
|
22
50
|
npm install -g agentplane
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run the CLI inside the git repository you want to govern:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd /path/to/your-repository
|
|
23
57
|
agentplane init
|
|
24
58
|
agentplane quickstart
|
|
25
59
|
```
|
|
26
60
|
|
|
27
|
-
|
|
28
|
-
policy gateway selection (`--policy-gateway codex|claude` -> `AGENTS.md` or `CLAUDE.md`),
|
|
29
|
-
execution profile selection (`conservative|balanced|aggressive`), approval toggles, and optional recipes.
|
|
61
|
+
If the directory is not a git repository yet, `agentplane init` initializes git first.
|
|
30
62
|
|
|
31
|
-
|
|
63
|
+
`agentplane init` is interactive by default. It lets you choose the workflow mode, backend, gateway file (`AGENTS.md` or `CLAUDE.md`), execution profile, and optional recipe setup.
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
agentplane task new --title "First task" --description "Describe the change" --priority med --owner ORCHESTRATOR --tag docs
|
|
35
|
-
agentplane verify <task-id> --ok --by ORCHESTRATOR --note "Verified"
|
|
36
|
-
agentplane finish <task-id> --author ORCHESTRATOR --body "Verified: done" --result "First task completed"
|
|
37
|
-
```
|
|
65
|
+
On the first run it creates the visible workflow surface:
|
|
38
66
|
|
|
39
|
-
|
|
67
|
+
- `AGENTS.md` or `CLAUDE.md`
|
|
68
|
+
- `.agentplane/config.json`
|
|
69
|
+
- `.agentplane/tasks/`
|
|
70
|
+
- `.agentplane/agents/`
|
|
71
|
+
- `.agentplane/WORKFLOW.md`
|
|
72
|
+
|
|
73
|
+
Prefer not to install globally:
|
|
40
74
|
|
|
41
75
|
```bash
|
|
42
76
|
npx agentplane init
|
|
43
77
|
npx agentplane quickstart
|
|
44
78
|
```
|
|
45
79
|
|
|
46
|
-
##
|
|
80
|
+
## First task flow
|
|
47
81
|
|
|
48
|
-
|
|
49
|
-
- The selected policy gateway file is created if missing and defines the policy/guardrails:
|
|
50
|
-
`AGENTS.md` (Codex) or `CLAUDE.md` (Claude Code).
|
|
51
|
-
- Built-in agent definitions are copied into `.agentplane/agents/`.
|
|
52
|
-
- Optional recipes can install additional agents when you run `agentplane recipes install ...`.
|
|
53
|
-
- `.agentplane/config.json` stores execution defaults under `execution` (profile, reasoning effort, tool budget, safety gates).
|
|
82
|
+
Create a task and record the plan:
|
|
54
83
|
|
|
55
|
-
|
|
84
|
+
```bash
|
|
85
|
+
agentplane task new --title "First task" --description "Describe the change" --priority med --owner DOCS --tag docs
|
|
86
|
+
agentplane task plan set <task-id> --text "Explain the plan" --updated-by DOCS
|
|
87
|
+
```
|
|
56
88
|
|
|
57
|
-
|
|
89
|
+
If your repository requires explicit plan approval, run:
|
|
58
90
|
|
|
59
|
-
|
|
60
|
-
|
|
91
|
+
```bash
|
|
92
|
+
agentplane task plan approve <task-id> --by ORCHESTRATOR
|
|
93
|
+
```
|
|
61
94
|
|
|
62
|
-
|
|
95
|
+
Then start work, record verification, and finish:
|
|
63
96
|
|
|
64
|
-
|
|
97
|
+
```bash
|
|
98
|
+
agentplane task start-ready <task-id> --author DOCS --body "Start: ..."
|
|
99
|
+
agentplane task verify-show <task-id>
|
|
100
|
+
agentplane verify <task-id> --ok --by REVIEWER --note "Looks good"
|
|
101
|
+
agentplane finish <task-id> --author DOCS --body "Verified: ..." --result "One-line outcome" --commit <git-rev>
|
|
102
|
+
```
|
|
65
103
|
|
|
66
|
-
-
|
|
67
|
-
- Role boundaries (ORCHESTRATOR, PLANNER, CODER, INTEGRATOR, etc.).
|
|
68
|
-
- Agent definitions in `.agentplane/agents/`.
|
|
69
|
-
- Task records in `.agentplane/tasks/` with a snapshot export in `.agentplane/tasks.json`.
|
|
70
|
-
- A visible, reproducible pipeline:
|
|
104
|
+
That is the shortest believable first-win path: initialize the repo, create a task, verify the change, and close it through the recorded workflow instead of an unstructured agent session.
|
|
71
105
|
|
|
72
|
-
|
|
73
|
-
Preflight -> Plan -> Approval -> Tasks -> Verify -> Finish -> Export
|
|
74
|
-
```
|
|
106
|
+
## Workflow modes
|
|
75
107
|
|
|
76
|
-
|
|
108
|
+
### `direct`
|
|
77
109
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
- Recipes for repeatable setup and automation.
|
|
110
|
+
- single checkout
|
|
111
|
+
- fast local iteration
|
|
112
|
+
- deterministic close commit on `finish` by default
|
|
113
|
+
- best fit for solo work or short loops
|
|
83
114
|
|
|
84
|
-
|
|
115
|
+
### `branch_pr`
|
|
85
116
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
- per-task branch or worktree flow
|
|
118
|
+
- explicit PR artifacts under `.agentplane/tasks/<task-id>/pr/`
|
|
119
|
+
- stricter handoff and integration discipline
|
|
120
|
+
- better fit for teams that want implementation separated from integration
|
|
89
121
|
|
|
90
|
-
|
|
122
|
+
## When to use it
|
|
91
123
|
|
|
92
|
-
|
|
93
|
-
npx agentplane --help
|
|
94
|
-
```
|
|
124
|
+
Use `agentplane` when:
|
|
95
125
|
|
|
96
|
-
|
|
126
|
+
- you want coding agents to work inside a real git repository
|
|
127
|
+
- you need explicit task state, approvals, verification, and closure
|
|
128
|
+
- you want repo-local workflow artifacts instead of a hidden assistant session
|
|
97
129
|
|
|
98
|
-
|
|
130
|
+
Do not use `agentplane` when:
|
|
99
131
|
|
|
100
|
-
|
|
132
|
+
- you want a hosted agent platform
|
|
133
|
+
- you want a generic prompt framework
|
|
134
|
+
- you want the tool to hide git or replace your editor
|
|
101
135
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
agentplane role ORCHESTRATOR
|
|
106
|
-
agentplane role UPGRADER
|
|
107
|
-
agentplane config show
|
|
108
|
-
agentplane task list
|
|
109
|
-
agentplane task new --title "..." --description "..." --priority med --owner ORCHESTRATOR --tag docs
|
|
110
|
-
agentplane verify <task-id> --ok --by ORCHESTRATOR --note "Verified"
|
|
111
|
-
agentplane finish <task-id> --author ORCHESTRATOR --body "Verified: done" --result "Task completed"
|
|
112
|
-
agentplane recipes list
|
|
113
|
-
```
|
|
136
|
+
## Requirements
|
|
137
|
+
|
|
138
|
+
- Node.js 20+
|
|
114
139
|
|
|
115
|
-
##
|
|
140
|
+
## Documentation
|
|
116
141
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
142
|
+
- Overview: https://agentplane.org/docs/user/overview
|
|
143
|
+
- Setup: https://agentplane.org/docs/user/setup
|
|
144
|
+
- Workflow: https://agentplane.org/docs/user/workflow
|
|
145
|
+
- Commands: https://agentplane.org/docs/user/commands
|
|
146
|
+
- Backends: https://agentplane.org/docs/user/backends
|
|
147
|
+
- CLI reference: https://agentplane.org/docs/user/cli-reference.generated
|
|
148
|
+
- Release notes: https://agentplane.org/docs/releases
|
|
149
|
+
- Recipes repository: https://github.com/basilisk-labs/agentplane/tree/main/agentplane-recipes
|
|
122
150
|
|
|
123
151
|
## Support
|
|
124
152
|
|
package/assets/AGENTS.md
CHANGED
|
@@ -17,7 +17,7 @@ Detailed procedures live in canonical modules from `## CANONICAL DOCS`.
|
|
|
17
17
|
- Repository type: user project initialized with `agentplane`.
|
|
18
18
|
- Gateway role: keep this file compact and deterministic; move scenario-specific details to policy modules.
|
|
19
19
|
- CLI rule: use `agentplane` from `PATH`; if unavailable, stop and request installation guidance (do not invent repo-local entrypoints).
|
|
20
|
-
- Startup shortcut: run `## COMMANDS -> Preflight`, then use `agentplane quickstart
|
|
20
|
+
- 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.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -83,7 +83,7 @@ node .agentplane/policy/check-routing.mjs
|
|
|
83
83
|
## TOOLING
|
|
84
84
|
|
|
85
85
|
- Use `## COMMANDS` as the canonical command source.
|
|
86
|
-
- Use `agentplane quickstart` as the canonical installed startup path and `agentplane role <ROLE>`
|
|
86
|
+
- Use `agentplane quickstart` as the canonical installed startup path and `agentplane role <ROLE>` to activate the current role before role-scoped planning or execution.
|
|
87
87
|
- For policy changes, routing validation MUST pass via `node .agentplane/policy/check-routing.mjs`.
|
|
88
88
|
|
|
89
89
|
---
|
|
@@ -131,10 +131,12 @@ Routing constraints:
|
|
|
131
131
|
- MUST create/reuse executable task IDs for any repo-state mutation.
|
|
132
132
|
- MUST use `agentplane` commands for task lifecycle updates; MUST NOT manually edit `.agentplane/tasks.json`.
|
|
133
133
|
- MUST run `agentplane task plan approve ...` and `agentplane task start-ready ...` sequentially (never in parallel).
|
|
134
|
+
- MUST activate `agentplane role ORCHESTRATOR` for planning and `agentplane role <ROLE>` for the active task owner before owner-scoped execution or verification.
|
|
134
135
|
- MUST keep repository artifacts in English by default (unless user explicitly requests another language for a specific artifact).
|
|
135
136
|
- MUST NOT fabricate repository facts.
|
|
136
137
|
- MUST stage/commit only intentional changes for the active task scope.
|
|
137
138
|
- MUST stop and request re-approval when scope, risk, or verification criteria materially drift.
|
|
139
|
+
- MUST NOT let ORCHESTRATOR perform owner-scoped implementation or verification once a task owner is known, unless the approved plan explicitly makes ORCHESTRATOR the owner.
|
|
138
140
|
|
|
139
141
|
Role boundaries:
|
|
140
142
|
|
package/bin/dist-guard.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readFile, stat } from "node:fs/promises";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
collectWatchedRuntimeSnapshot,
|
|
6
|
+
compareWatchedRuntimeSnapshots,
|
|
7
|
+
isRuntimeRelevantWatchedFile,
|
|
8
|
+
} from "./runtime-watch.js";
|
|
5
9
|
|
|
6
10
|
async function exists(p) {
|
|
7
11
|
try {
|
|
@@ -63,14 +67,20 @@ function workingTreeChangedPaths(cwd, watchedPaths) {
|
|
|
63
67
|
const normalized = String(line ?? "");
|
|
64
68
|
return normalized.length > 3 ? normalized.slice(3).trim() : "";
|
|
65
69
|
})
|
|
66
|
-
.filter(Boolean),
|
|
70
|
+
.filter((filePath) => Boolean(filePath) && isRuntimeRelevantWatchedFile(filePath)),
|
|
67
71
|
);
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
function committedChangedPathsSince(cwd, fromGitHead, watchedPaths) {
|
|
71
75
|
if (!fromGitHead) return [];
|
|
72
76
|
return uniqueSorted(
|
|
73
|
-
listGitPaths(cwd, [
|
|
77
|
+
listGitPaths(cwd, [
|
|
78
|
+
"diff",
|
|
79
|
+
"--name-only",
|
|
80
|
+
`${fromGitHead}..HEAD`,
|
|
81
|
+
"--",
|
|
82
|
+
...watchedPaths,
|
|
83
|
+
]).filter((filePath) => isRuntimeRelevantWatchedFile(filePath)),
|
|
74
84
|
);
|
|
75
85
|
}
|
|
76
86
|
|
package/bin/runtime-watch.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type WatchedRuntimeSnapshotComparison = {
|
|
|
15
15
|
changedPaths: string[];
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
export function isRuntimeRelevantWatchedFile(filePath: string): boolean;
|
|
18
19
|
export function getWatchedRuntimePathsForPackage(packageName: string): string[];
|
|
19
20
|
export function collectWatchedRuntimeSnapshot(
|
|
20
21
|
packageDir: string,
|
package/bin/runtime-watch.js
CHANGED
|
@@ -17,6 +17,15 @@ function normalizePath(value) {
|
|
|
17
17
|
return value.split(path.sep).join("/");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export function isRuntimeRelevantWatchedFile(filePath) {
|
|
21
|
+
const normalized = normalizePath(filePath);
|
|
22
|
+
const inSourceTree = normalized.startsWith("src/") || normalized.includes("/src/");
|
|
23
|
+
if (!inSourceTree) return true;
|
|
24
|
+
if (normalized.includes("/__snapshots__/")) return false;
|
|
25
|
+
const baseName = path.posix.basename(normalized);
|
|
26
|
+
return !/\.(?:test)\.[cm]?[jt]sx?$/u.test(baseName);
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
async function exists(targetPath) {
|
|
21
30
|
try {
|
|
22
31
|
await stat(targetPath);
|
|
@@ -76,9 +85,11 @@ export async function collectWatchedRuntimeSnapshot(packageDir, watchedPaths) {
|
|
|
76
85
|
const uniqueAbsoluteFiles = [...new Set(absoluteFiles)].toSorted((a, b) => a.localeCompare(b));
|
|
77
86
|
const files = [];
|
|
78
87
|
for (const absolutePath of uniqueAbsoluteFiles) {
|
|
88
|
+
const relativePath = normalizePath(path.relative(packageDir, absolutePath));
|
|
89
|
+
if (!isRuntimeRelevantWatchedFile(relativePath)) continue;
|
|
79
90
|
const content = await readFile(absolutePath);
|
|
80
91
|
files.push({
|
|
81
|
-
path:
|
|
92
|
+
path: relativePath,
|
|
82
93
|
sha256: fileHash(content),
|
|
83
94
|
size_bytes: content.byteLength,
|
|
84
95
|
});
|
|
@@ -96,15 +107,21 @@ function snapshotFileMap(snapshot) {
|
|
|
96
107
|
}
|
|
97
108
|
|
|
98
109
|
export function compareWatchedRuntimeSnapshots(recordedSnapshot, currentSnapshot) {
|
|
110
|
+
const recordedFiles = recordedSnapshot.files.filter((file) =>
|
|
111
|
+
isRuntimeRelevantWatchedFile(file.path),
|
|
112
|
+
);
|
|
113
|
+
const currentFiles = currentSnapshot.files.filter((file) =>
|
|
114
|
+
isRuntimeRelevantWatchedFile(file.path),
|
|
115
|
+
);
|
|
99
116
|
if (
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
snapshotHash(recordedFiles) === snapshotHash(currentFiles) &&
|
|
118
|
+
recordedFiles.length === currentFiles.length
|
|
102
119
|
) {
|
|
103
120
|
return { ok: true, changedPaths: [] };
|
|
104
121
|
}
|
|
105
122
|
|
|
106
|
-
const recordedMap = snapshotFileMap(recordedSnapshot);
|
|
107
|
-
const currentMap = snapshotFileMap(currentSnapshot);
|
|
123
|
+
const recordedMap = snapshotFileMap({ ...recordedSnapshot, files: recordedFiles });
|
|
124
|
+
const currentMap = snapshotFileMap({ ...currentSnapshot, files: currentFiles });
|
|
108
125
|
const changedPaths = [...new Set([...recordedMap.keys(), ...currentMap.keys()])]
|
|
109
126
|
.filter((filePath) => recordedMap.get(filePath) !== currentMap.get(filePath))
|
|
110
127
|
.toSorted((a, b) => a.localeCompare(b));
|
package/bin/stale-dist-policy.js
CHANGED
|
@@ -21,13 +21,19 @@ function isConfigInspectionCommand(args) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function isTaskInspectionCommand(args) {
|
|
24
|
-
|
|
24
|
+
if (args[0] !== "task") return false;
|
|
25
|
+
if (["list", "show", "verify-show", "next", "search"].includes(args[1] ?? "")) return true;
|
|
26
|
+
return args[1] === "doc" && args[2] === "show";
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
function isRoleOrQuickstartCommand(args) {
|
|
28
30
|
return args[0] === "quickstart" || args[0] === "role";
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
function isReadyInspectionCommand(args) {
|
|
34
|
+
return args[0] === "ready";
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
export function classifyStaleDistPolicy(argv = process.argv) {
|
|
32
38
|
const args = normalizeArgs(argv);
|
|
33
39
|
if (
|
|
@@ -36,7 +42,8 @@ export function classifyStaleDistPolicy(argv = process.argv) {
|
|
|
36
42
|
isHelpOrVersionCommand(args) ||
|
|
37
43
|
isRoleOrQuickstartCommand(args) ||
|
|
38
44
|
isConfigInspectionCommand(args) ||
|
|
39
|
-
isTaskInspectionCommand(args)
|
|
45
|
+
isTaskInspectionCommand(args) ||
|
|
46
|
+
isReadyInspectionCommand(args)
|
|
40
47
|
) {
|
|
41
48
|
return { mode: "warn_and_run", reason: "read_only_diagnostic" };
|
|
42
49
|
}
|