@veewo/claw 0.2.16 → 0.2.18
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 +141 -141
- package/dist/cli.js +13 -12
- package/dist/cli.js.map +1 -1
- package/dist/command-service.d.ts +1 -3
- package/dist/command-service.js +3 -2
- package/dist/command-service.js.map +1 -1
- package/dist/search-entry.js +31 -3
- package/dist/search-entry.js.map +1 -1
- package/package.json +45 -45
package/README.md
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
# @veewo/claw
|
|
2
|
-
|
|
3
|
-
`@veewo/claw` is the CLI entrypoint for running the `.claw` workflow in a project.
|
|
4
|
-
|
|
5
|
-
It gives agents and developers a concrete way to plan work, recall project knowledge, deposit truth and ADR notes, and close rounds out cleanly instead of leaving project state scattered across transient chats.
|
|
6
|
-
|
|
7
|
-
## What the CLI is for
|
|
8
|
-
|
|
9
|
-
- initialize and normalize the `.claw` project surface
|
|
10
|
-
- run project-scoped planning and task lifecycle commands
|
|
11
|
-
- index and query project documentation recall
|
|
12
|
-
- support truth ingestion and closeout flows
|
|
13
|
-
|
|
14
|
-
## Install
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install -g @veewo/claw
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
After installing the CLI, project search still needs one-time setup inside each `.claw` project:
|
|
21
|
-
|
|
22
|
-
1. Run `claw context` so `.claw/project.json` is normalized and the default local embedding config is present.
|
|
23
|
-
2. Run `claw search index --refresh` once so the local embedding model can be downloaded or reused and the first vector index can be built.
|
|
24
|
-
|
|
25
|
-
## Host startup context
|
|
26
|
-
|
|
27
|
-
`claw context --host <host>` is the single structured startup-state entrypoint
|
|
28
|
-
for host adapters. A host Hook owns its native event payload, validates its
|
|
29
|
-
trusted cwd and session identity, invokes `context`, and maps the JSON result
|
|
30
|
-
to its own prompt, card, or host-action surface. The CLI does not own platform
|
|
31
|
-
Hook event names or Hook-output envelopes.
|
|
32
|
-
|
|
33
|
-
The result may contain `activeWorkflow`, `error`, `startupRecovery.versionSync`,
|
|
34
|
-
and `searchGuidance`, in addition to project and session state. Adapters must
|
|
35
|
-
not accept cwd or session identity from model input. A missing `activeWorkflow`
|
|
36
|
-
means the session has no bound plan; it does not authorize plan discovery by
|
|
37
|
-
scanning unrelated project tasks.
|
|
38
|
-
|
|
39
|
-
Then run:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
claw init
|
|
43
|
-
claw search index --refresh
|
|
44
|
-
claw search "existing truth or ADR topic"
|
|
45
|
-
claw plan create --title "My task" --goal "Define the first task"
|
|
46
|
-
claw plan create "My templated task" --template default --goal "Route through the default template"
|
|
47
|
-
claw plan create "Ephemeral harness" --scope session --goal "Use plan and Goal workflows without project deposition"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
`claw plan create` uses explicit `--template` first, otherwise the project's configured `defaultPlanTemplate`, and finally falls back to the built-in `default` template. You can select a template explicitly with `claw plan create "<title>" --template <name>` or `claw plan create --template <name> --title "<title>"`.
|
|
51
|
-
|
|
52
|
-
New project tasks are grouped under `.claw/tasks/YYYY-MM-DD/`. On the first `claw context` call of each local calendar day, claw performs a lock-protected maintenance pass: it removes expired entries from `.claw/runtime/tmp/`, removes workflow task directories that exceed the task TTL even when incomplete, moves eligible date-scoped task folders into the archive, applies `maxTasksToKeep` and archive TTL, removes expired or invalid bindings, and sweeps expired session workflows. This is lazy maintenance, not a background scheduler.
|
|
53
|
-
|
|
54
|
-
`--scope session` stores the workflow in a user-level directory keyed by the platform session id, so it works without a project `.claw` directory and recovers across cwd changes. It preserves plan/task/subplan/Goal behavior while disabling project knowledge capture, memory/GitNexus refresh, and project retention. Use `claw session clean` for the current session or `claw session clean --expired` for the seven-day TTL sweep.
|
|
55
|
-
|
|
56
|
-
Projects can add reusable templates directly under `.claw/templates` with `.json`, `.js`, `.mjs`, or `.cjs` files. Put `defaultPlanTemplate` in `.claw/project.json` for a shared team default, or in `.claw/project-override.json` for a local personal override.
|
|
57
|
-
|
|
58
|
-
When `.claw/project.json` has `planning: true`, the default `default` template seeds one planning task in `process.discussing`. It loads the effective `externalPlanningSkill`, falling back to `claw-kit:planning`, and stays open while the requirements and proposed solution are discussed and confirmed with the user. Use `plan start` when execution tasks remain; when planning itself resolves the request, complete task 1 and close the plan.
|
|
59
|
-
|
|
60
|
-
When `planning: false`, `claw plan create` seeds the smallest executable plan directly in `process.active`.
|
|
61
|
-
|
|
62
|
-
## Workflow shape
|
|
63
|
-
|
|
64
|
-
In a typical round, the CLI helps land this loop in a project:
|
|
65
|
-
|
|
66
|
-
`plan` -> `search and recall` -> `execute` -> `deposit truth / ADR` -> `close out`
|
|
67
|
-
|
|
68
|
-
That project-level plan structure helps agents carry longer-running work more cleanly than leaving the task in loose chat state alone.
|
|
69
|
-
|
|
70
|
-
## Persistent sessions
|
|
71
|
-
|
|
72
|
-
Open a persistent terminal with:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
claw session open <dir> <agent-session-id>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
The workdir is immutable for the lifetime of that session. Opening another
|
|
79
|
-
directory closes the prior live connection and opens the composite identity
|
|
80
|
-
`(canonical workdir, agent session id)`; two directories with the same agent id
|
|
81
|
-
remain isolated.
|
|
82
|
-
|
|
83
|
-
Inside the terminal, these commands implicitly target `currentPlan`:
|
|
84
|
-
|
|
85
|
-
```text
|
|
86
|
-
plan show [--simple]
|
|
87
|
-
plan edit ...
|
|
88
|
-
plan wait
|
|
89
|
-
plan done --retrospective "..."
|
|
90
|
-
task add ...
|
|
91
|
-
task edit --id ...
|
|
92
|
-
task done --id ...
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Use `plan resume` to resume the retained current plan, `plan resume <planId>` to
|
|
96
|
-
make a specified resumable plan current, and `plan leave` to enter
|
|
97
|
-
`end.leave` and clear focus. Every `end.*` triggers end-state finalization;
|
|
98
|
-
`end.leave` remains resumable and does not set `completedAt`.
|
|
99
|
-
|
|
100
|
-
`search --dir <dir> <query>` changes only that search operation. It never
|
|
101
|
-
changes the session workdir or current plan.
|
|
102
|
-
|
|
103
|
-
On an interrupted connection, mutations are never replayed automatically.
|
|
104
|
-
Reopen with the exact command returned by the error, then inspect
|
|
105
|
-
`plan show --simple`. Retained v2 state expires seven days after its last
|
|
106
|
-
update. Legacy session caches are not migrated and canonical plans are never
|
|
107
|
-
deleted by v2 cleanup.
|
|
108
|
-
|
|
109
|
-
Host adapters remain compatible with the stateless CLI. They can adopt
|
|
110
|
-
`@veewo/claw-client` incrementally once they consume the same structured
|
|
111
|
-
post-commit effects; opening a persistent session does not change existing
|
|
112
|
-
adapter behavior.
|
|
113
|
-
|
|
114
|
-
Codex startup workflow should rely on the session hook or startup recovery path instead of treating any extra manual recovery step as required after plan creation.
|
|
115
|
-
|
|
116
|
-
## Search and recall
|
|
117
|
-
|
|
118
|
-
`claw search` is the project recall command for `.claw` memory, truth, ADR, and declared markdown docs. Use it for retained project context rather than code search.
|
|
119
|
-
|
|
120
|
-
When a task needs deeper code investigation or relationship tracing, GitNexus can complement this workflow, but it is optional rather than required for using `claw` itself.
|
|
121
|
-
|
|
122
|
-
Typical setup:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
claw context
|
|
126
|
-
claw search index --refresh
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
If you need deeper backup detail on config or recall behavior, use the adapter reference notes in [packages/codex-adapter/references/project-config-reference.md](../codex-adapter/references/project-config-reference.md) or [packages/opencode-adapter/references/project-config-reference.md](../opencode-adapter/references/project-config-reference.md).
|
|
130
|
-
|
|
131
|
-
## Configuration
|
|
132
|
-
|
|
133
|
-
If you need backup `.claw/project.json` detail, start with the adapter reference notes above and use [docs/project-json-reference.md](../../docs/project-json-reference.md) only for deeper canonical detail.
|
|
134
|
-
|
|
135
|
-
`claw-kit` also stays usable alongside other harnesses or external skills, so the CLI does not assume a single host or investigation surface.
|
|
136
|
-
|
|
137
|
-
The config model is team-friendly as well: `.claw/project.json` carries the shared canonical workflow, while `.claw/project-override.json` leaves room for personal runtime preferences.
|
|
138
|
-
|
|
139
|
-
## Repository
|
|
140
|
-
|
|
141
|
-
- [claw-kit](https://github.com/chanyuenpang/claw-kit)
|
|
1
|
+
# @veewo/claw
|
|
2
|
+
|
|
3
|
+
`@veewo/claw` is the CLI entrypoint for running the `.claw` workflow in a project.
|
|
4
|
+
|
|
5
|
+
It gives agents and developers a concrete way to plan work, recall project knowledge, deposit truth and ADR notes, and close rounds out cleanly instead of leaving project state scattered across transient chats.
|
|
6
|
+
|
|
7
|
+
## What the CLI is for
|
|
8
|
+
|
|
9
|
+
- initialize and normalize the `.claw` project surface
|
|
10
|
+
- run project-scoped planning and task lifecycle commands
|
|
11
|
+
- index and query project documentation recall
|
|
12
|
+
- support truth ingestion and closeout flows
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g @veewo/claw
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
After installing the CLI, project search still needs one-time setup inside each `.claw` project:
|
|
21
|
+
|
|
22
|
+
1. Run `claw context` so `.claw/project.json` is normalized and the default local embedding config is present.
|
|
23
|
+
2. Run `claw search index --refresh` once so the local embedding model can be downloaded or reused and the first vector index can be built.
|
|
24
|
+
|
|
25
|
+
## Host startup context
|
|
26
|
+
|
|
27
|
+
`claw context --host <host>` is the single structured startup-state entrypoint
|
|
28
|
+
for host adapters. A host Hook owns its native event payload, validates its
|
|
29
|
+
trusted cwd and session identity, invokes `context`, and maps the JSON result
|
|
30
|
+
to its own prompt, card, or host-action surface. The CLI does not own platform
|
|
31
|
+
Hook event names or Hook-output envelopes.
|
|
32
|
+
|
|
33
|
+
The result may contain `activeWorkflow`, `error`, `startupRecovery.versionSync`,
|
|
34
|
+
and `searchGuidance`, in addition to project and session state. Adapters must
|
|
35
|
+
not accept cwd or session identity from model input. A missing `activeWorkflow`
|
|
36
|
+
means the session has no bound plan; it does not authorize plan discovery by
|
|
37
|
+
scanning unrelated project tasks.
|
|
38
|
+
|
|
39
|
+
Then run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
claw init
|
|
43
|
+
claw search index --refresh
|
|
44
|
+
claw search "existing truth or ADR topic"
|
|
45
|
+
claw plan create --title "My task" --goal "Define the first task"
|
|
46
|
+
claw plan create "My templated task" --template default --goal "Route through the default template"
|
|
47
|
+
claw plan create "Ephemeral harness" --scope session --goal "Use plan and Goal workflows without project deposition"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`claw plan create` uses explicit `--template` first, otherwise the project's configured `defaultPlanTemplate`, and finally falls back to the built-in `default` template. You can select a template explicitly with `claw plan create "<title>" --template <name>` or `claw plan create --template <name> --title "<title>"`.
|
|
51
|
+
|
|
52
|
+
New project tasks are grouped under `.claw/tasks/YYYY-MM-DD/`. On the first `claw context` call of each local calendar day, claw performs a lock-protected maintenance pass: it removes expired entries from `.claw/runtime/tmp/`, removes workflow task directories that exceed the task TTL even when incomplete, moves eligible date-scoped task folders into the archive, applies `maxTasksToKeep` and archive TTL, removes expired or invalid bindings, and sweeps expired session workflows. This is lazy maintenance, not a background scheduler.
|
|
53
|
+
|
|
54
|
+
`--scope session` stores the workflow in a user-level directory keyed by the platform session id, so it works without a project `.claw` directory and recovers across cwd changes. It preserves plan/task/subplan/Goal behavior while disabling project knowledge capture, memory/GitNexus refresh, and project retention. Use `claw session clean` for the current session or `claw session clean --expired` for the seven-day TTL sweep.
|
|
55
|
+
|
|
56
|
+
Projects can add reusable templates directly under `.claw/templates` with `.json`, `.js`, `.mjs`, or `.cjs` files. Put `defaultPlanTemplate` in `.claw/project.json` for a shared team default, or in `.claw/project-override.json` for a local personal override.
|
|
57
|
+
|
|
58
|
+
When `.claw/project.json` has `planning: true`, the default `default` template seeds one planning task in `process.discussing`. It loads the effective `externalPlanningSkill`, falling back to `claw-kit:planning`, and stays open while the requirements and proposed solution are discussed and confirmed with the user. Use `plan start` when execution tasks remain; when planning itself resolves the request, complete task 1 and close the plan.
|
|
59
|
+
|
|
60
|
+
When `planning: false`, `claw plan create` seeds the smallest executable plan directly in `process.active`.
|
|
61
|
+
|
|
62
|
+
## Workflow shape
|
|
63
|
+
|
|
64
|
+
In a typical round, the CLI helps land this loop in a project:
|
|
65
|
+
|
|
66
|
+
`plan` -> `search and recall` -> `execute` -> `deposit truth / ADR` -> `close out`
|
|
67
|
+
|
|
68
|
+
That project-level plan structure helps agents carry longer-running work more cleanly than leaving the task in loose chat state alone.
|
|
69
|
+
|
|
70
|
+
## Persistent sessions
|
|
71
|
+
|
|
72
|
+
Open a persistent terminal with:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
claw session open <dir> <agent-session-id>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The workdir is immutable for the lifetime of that session. Opening another
|
|
79
|
+
directory closes the prior live connection and opens the composite identity
|
|
80
|
+
`(canonical workdir, agent session id)`; two directories with the same agent id
|
|
81
|
+
remain isolated.
|
|
82
|
+
|
|
83
|
+
Inside the terminal, these commands implicitly target `currentPlan`:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
plan show [--simple]
|
|
87
|
+
plan edit ...
|
|
88
|
+
plan wait
|
|
89
|
+
plan done --retrospective "..."
|
|
90
|
+
task add ...
|
|
91
|
+
task edit --id ...
|
|
92
|
+
task done --id ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Use `plan resume` to resume the retained current plan, `plan resume <planId>` to
|
|
96
|
+
make a specified resumable plan current, and `plan leave` to enter
|
|
97
|
+
`end.leave` and clear focus. Every `end.*` triggers end-state finalization;
|
|
98
|
+
`end.leave` remains resumable and does not set `completedAt`.
|
|
99
|
+
|
|
100
|
+
`search --dir <dir> <query>` changes only that search operation. It never
|
|
101
|
+
changes the session workdir or current plan.
|
|
102
|
+
|
|
103
|
+
On an interrupted connection, mutations are never replayed automatically.
|
|
104
|
+
Reopen with the exact command returned by the error, then inspect
|
|
105
|
+
`plan show --simple`. Retained v2 state expires seven days after its last
|
|
106
|
+
update. Legacy session caches are not migrated and canonical plans are never
|
|
107
|
+
deleted by v2 cleanup.
|
|
108
|
+
|
|
109
|
+
Host adapters remain compatible with the stateless CLI. They can adopt
|
|
110
|
+
`@veewo/claw-client` incrementally once they consume the same structured
|
|
111
|
+
post-commit effects; opening a persistent session does not change existing
|
|
112
|
+
adapter behavior.
|
|
113
|
+
|
|
114
|
+
Codex startup workflow should rely on the session hook or startup recovery path instead of treating any extra manual recovery step as required after plan creation.
|
|
115
|
+
|
|
116
|
+
## Search and recall
|
|
117
|
+
|
|
118
|
+
`claw search` is the project recall command for `.claw` memory, truth, ADR, and declared markdown docs. Use it for retained project context rather than code search.
|
|
119
|
+
|
|
120
|
+
When a task needs deeper code investigation or relationship tracing, GitNexus can complement this workflow, but it is optional rather than required for using `claw` itself.
|
|
121
|
+
|
|
122
|
+
Typical setup:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
claw context
|
|
126
|
+
claw search index --refresh
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If you need deeper backup detail on config or recall behavior, use the adapter reference notes in [packages/codex-adapter/references/project-config-reference.md](../codex-adapter/references/project-config-reference.md) or [packages/opencode-adapter/references/project-config-reference.md](../opencode-adapter/references/project-config-reference.md).
|
|
130
|
+
|
|
131
|
+
## Configuration
|
|
132
|
+
|
|
133
|
+
If you need backup `.claw/project.json` detail, start with the adapter reference notes above and use [docs/project-json-reference.md](../../docs/project-json-reference.md) only for deeper canonical detail.
|
|
134
|
+
|
|
135
|
+
`claw-kit` also stays usable alongside other harnesses or external skills, so the CLI does not assume a single host or investigation surface.
|
|
136
|
+
|
|
137
|
+
The config model is team-friendly as well: `.claw/project.json` carries the shared canonical workflow, while `.claw/project-override.json` leaves room for personal runtime preferences.
|
|
138
|
+
|
|
139
|
+
## Repository
|
|
140
|
+
|
|
141
|
+
- [claw-kit](https://github.com/chanyuenpang/claw-kit)
|
package/dist/cli.js
CHANGED
|
@@ -182,10 +182,10 @@ const COMMAND_HELP = {
|
|
|
182
182
|
},
|
|
183
183
|
done: {
|
|
184
184
|
usage: ["{script} plan done --retrospective <text> [options]"],
|
|
185
|
-
description: "Shortcut for applying closeout fields and --status end.completed in one ordered plan edit;
|
|
186
|
-
summary: "Shortcut for completing a plan
|
|
185
|
+
description: "Shortcut for applying closeout fields and --status end.completed in one ordered plan edit; project scope requires a retrospective, while session scope completes without document deposition. It retains the task for at least one hour, sweeps older completed tasks into the archive, and queues the async completion refresh.",
|
|
186
|
+
summary: "Shortcut for completing a plan and queueing completion refresh.",
|
|
187
187
|
options: [
|
|
188
|
-
{ flag: "--retrospective <text>", detail: "Retrospective summary (required)." },
|
|
188
|
+
{ flag: "--retrospective <text>", detail: "Retrospective summary (required for project scope)." },
|
|
189
189
|
{ flag: "--key-decision <text>", detail: "Append a durable key decision when one exists (repeatable)." },
|
|
190
190
|
{ flag: "--what-worked <text>", detail: "Append a retrospective success (repeatable)." },
|
|
191
191
|
{ flag: "--issue <text>", detail: "Append a retrospective issue (repeatable)." },
|
|
@@ -307,12 +307,13 @@ const COMMAND_HELP = {
|
|
|
307
307
|
],
|
|
308
308
|
},
|
|
309
309
|
search: {
|
|
310
|
-
usage: ["{script} search [<query>] [--dir <dir>] [--limit <n>]", "{script} search index --refresh"],
|
|
310
|
+
usage: ["{script} search [<query>] [--dir <dir>] [--limit <n>] [--json]", "{script} search index --refresh [--json]"],
|
|
311
311
|
description: "Project-scoped recall over .claw memory, truth, ADR, and declared markdown docs. Use a positional query or --query. Task-local scope (--task/--scope) is rejected; put task materials in plan.references instead.",
|
|
312
312
|
options: [
|
|
313
313
|
{ flag: "--query <text>", detail: "Search query (or pass the query positionally)." },
|
|
314
314
|
{ flag: "--dir <dir>", detail: "Override the project directory for this search only." },
|
|
315
315
|
{ flag: "--limit <n>", detail: "Max number of results." },
|
|
316
|
+
{ flag: "--json", detail: "Compatibility flag; search output is always JSON." },
|
|
316
317
|
],
|
|
317
318
|
subcommands: {
|
|
318
319
|
index: {
|
|
@@ -788,9 +789,6 @@ function parsePersistentSessionCommand(line) {
|
|
|
788
789
|
}
|
|
789
790
|
if (group === "plan" && action === "done") {
|
|
790
791
|
const retrospectiveSummary = consumeSessionFlag(tokens, "--retrospective");
|
|
791
|
-
if (!retrospectiveSummary) {
|
|
792
|
-
throw new ClawError("RETROSPECTIVE_REQUIRED", "plan done requires --retrospective.");
|
|
793
|
-
}
|
|
794
792
|
const keyDecisions = consumeAllSessionFlags(tokens, "--key-decision");
|
|
795
793
|
const whatWorked = consumeAllSessionFlags(tokens, "--what-worked");
|
|
796
794
|
const issues = consumeAllSessionFlags(tokens, "--issue");
|
|
@@ -801,7 +799,7 @@ function parsePersistentSessionCommand(line) {
|
|
|
801
799
|
request: {
|
|
802
800
|
operation: "plan.done",
|
|
803
801
|
input: {
|
|
804
|
-
retrospectiveSummary,
|
|
802
|
+
...(retrospectiveSummary ? { retrospectiveSummary } : {}),
|
|
805
803
|
...(keyDecisions.length ? { keyDecisions } : {}),
|
|
806
804
|
...(whatWorked.length ? { whatWorked } : {}),
|
|
807
805
|
...(issues.length ? { issues } : {}),
|
|
@@ -1334,11 +1332,8 @@ async function runPlan(args, effectiveHost) {
|
|
|
1334
1332
|
}
|
|
1335
1333
|
case "done": {
|
|
1336
1334
|
const retrospective = readOptionalFlag(args, "--retrospective");
|
|
1337
|
-
if (!retrospective?.trim()) {
|
|
1338
|
-
throw new ClawError("PROJECT_CONFIG_INVALID", "plan done requires --retrospective.");
|
|
1339
|
-
}
|
|
1340
1335
|
const updates = {
|
|
1341
|
-
retrospectiveSummary: retrospective,
|
|
1336
|
+
...(retrospective?.trim() ? { retrospectiveSummary: retrospective } : {}),
|
|
1342
1337
|
keyDecisions: readRepeatedFlag(args, "--key-decision"),
|
|
1343
1338
|
whatWorked: readRepeatedFlag(args, "--what-worked"),
|
|
1344
1339
|
issues: readRepeatedFlag(args, "--issue"),
|
|
@@ -1352,6 +1347,10 @@ async function runPlan(args, effectiveHost) {
|
|
|
1352
1347
|
...target,
|
|
1353
1348
|
ownerSessionKey,
|
|
1354
1349
|
});
|
|
1350
|
+
const currentProject = resolveWorkflowProjectContext(process.cwd(), ownerSessionKey);
|
|
1351
|
+
if (currentProject.scope !== "session" && !retrospective?.trim()) {
|
|
1352
|
+
throw new ClawError("RETROSPECTIVE_REQUIRED", "plan done requires --retrospective for project-scoped plans.");
|
|
1353
|
+
}
|
|
1355
1354
|
const project = tryResolveHookProject(process.cwd());
|
|
1356
1355
|
const effectiveWriter = resolveKnowledgeWriterForHost(project
|
|
1357
1356
|
? resolvePlanEffectiveConfig(project.projectConfig, current.plan)?.knowledgeWriter
|
|
@@ -1441,6 +1440,7 @@ async function runPlanSync(args, effectiveHost) {
|
|
|
1441
1440
|
plan: result.plan,
|
|
1442
1441
|
projectRoot: project.projectRoot,
|
|
1443
1442
|
projectConfig: project.projectConfig,
|
|
1443
|
+
scope: project.scope,
|
|
1444
1444
|
previousStatus: "process.wait",
|
|
1445
1445
|
host: effectiveHost,
|
|
1446
1446
|
recoveryResync: true,
|
|
@@ -2785,6 +2785,7 @@ async function tryResolveActiveWorkflowSnapshot(cwd, ownerSessionKey, effectiveH
|
|
|
2785
2785
|
plan: result.plan,
|
|
2786
2786
|
projectRoot: project.projectRoot,
|
|
2787
2787
|
projectConfig: project.projectConfig,
|
|
2788
|
+
scope: project.scope,
|
|
2788
2789
|
host: effectiveHost,
|
|
2789
2790
|
}),
|
|
2790
2791
|
};
|