@felan-ai/ext-prewalk 0.3.1 → 0.3.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 +43 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +239 -80
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +2 -4
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +5 -16
- package/dist/prompts.js.map +1 -1
- package/dist/state.d.ts +7 -14
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +18 -164
- package/dist/state.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# @felan-ai/ext-prewalk
|
|
2
2
|
|
|
3
|
-
Same-session Prewalk for Felan: the current model explores and plans the work
|
|
3
|
+
Same-session Prewalk for Felan: the current model explores and plans the work in the session task graph, then makes one focused mutation. Felan switches the next model request to the `low` model tier, which finishes and verifies the task with the full conversation and tool history intact. Tier resolution prefers the planner's provider and model family before falling back to another authenticated provider.
|
|
4
4
|
|
|
5
5
|
After the run settles, Prewalk restores the original planner model and thinking level by default.
|
|
6
6
|
|
|
7
|
+
For ordinary file-changing requests, the model can enter Prewalk itself by calling `enter_prewalk` before it explores or mutates the repository. `/prewalk` remains available when the user wants to enter explicitly. Read-only requests do not use Prewalk.
|
|
8
|
+
|
|
7
9
|
## Requirements
|
|
8
10
|
|
|
9
|
-
- An authenticated target model
|
|
10
|
-
-
|
|
11
|
-
- At least one active mutation tool: `edit`, `write`, or `apply_patch`
|
|
11
|
+
- An authenticated model in the configured target tier, or an authenticated exact target model
|
|
12
|
+
- At least one explicit mutation tool: Pi's `edit` or `write`, or the Codex extension's `apply_patch`
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Prewalk refuses to arm when no explicit mutation tool is active. Shell tools such as `bash` and Codex `exec_command` do not qualify because they are also used for exploration and verification. The planning and verification prompts direct the models to use the Tasks workflow, but Prewalk does not inspect task activity at runtime.
|
|
14
15
|
|
|
15
16
|
## Commands
|
|
16
17
|
|
|
@@ -18,46 +19,73 @@ When `/prewalk` is armed, it probes the current working directory with `bd statu
|
|
|
18
19
|
/prewalk <task> Arm Prewalk and start the task immediately
|
|
19
20
|
/prewalk Arm Prewalk for the next ordinary prompt
|
|
20
21
|
/prewalk status Show the phase, target model, and restoration setting
|
|
21
|
-
/prewalk
|
|
22
|
+
/prewalk exit Exit Prewalk
|
|
23
|
+
/prewalk off Alias for exit
|
|
24
|
+
/prewalk cancel Alias for exit
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
`status` and `
|
|
27
|
+
`status`, `exit`, `off`, and `cancel` are handled locally and do not make a provider request. In TUI mode, an inline task is submitted as a user message. In JSON and print modes, it is submitted as a visible custom message and the command waits for the run to become idle. Exiting during planning cancels the pending handoff immediately. Exiting while the target model is actively running defers planner restoration until that run settles; it does not abort the current provider request or the underlying task. A manual model selection cancels Prewalk and keeps the model selected by the user.
|
|
28
|
+
|
|
29
|
+
## Model entry tool
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
enter_prewalk {} Enter Prewalk for the current file-changing task
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The no-argument tool transitions the current run directly into planning, so it works while the agent is active. It must be called once, by itself, before repository exploration or mutation. A mutation in the same model turn as the entry call cannot trigger handoff; the planning guidance must reach a later model turn first.
|
|
36
|
+
|
|
37
|
+
The successful entry call and result are orchestration controls. They remain in the stored session transcript but are removed from model context, along with phase guidance, so the target receives the useful exploration, task graph, and first valid change rather than an instruction to keep planning.
|
|
25
38
|
|
|
26
39
|
## Lifecycle
|
|
27
40
|
|
|
28
41
|
1. The planner explores the relevant repository surface and determines the complete implementation scope.
|
|
29
|
-
2. The planner
|
|
30
|
-
3. The planner performs one focused successful `edit`, `write`, or `apply_patch
|
|
31
|
-
4. At that turn boundary, Felan switches to the configured target model.
|
|
32
|
-
5. The target model completes the existing
|
|
42
|
+
2. The planner creates a concise graph of at most nine outcome-oriented tasks with `TaskCreate`, includes concrete validation in their acceptance criteria, links them with `blocked_by` dependencies that encode the execution order, and claims the first ready task with `TaskUpdate`.
|
|
43
|
+
3. The planner performs one focused successful `edit`, `write`, or `apply_patch`.
|
|
44
|
+
4. At that turn boundary, Felan resolves and switches to the configured target tier or exact model.
|
|
45
|
+
5. The target model completes the existing session task graph and runs the relevant verification.
|
|
33
46
|
6. Once the agent run has fully settled, Felan restores the planner model and thinking level.
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
A successful mutation qualifies the turn for handoff regardless of Tasks activity. Failed mutation calls do not qualify. If the planner stops after prose or partial tool progress, Prewalk can queue a bounded hidden continuation, with a maximum of three per run.
|
|
36
49
|
|
|
37
50
|
The handoff does not fork, summarize, or replace the session. Planning guidance and implementation guidance are transient context messages; user messages, assistant responses, task-tracking results, mutations, and verification results remain in one trajectory.
|
|
38
51
|
|
|
52
|
+
This follows the [Prewalk design described by Stencil](https://stencil.so/blog/prewalk): transfer the grounded exploration, bounded work list, and first valid move rather than handing a detached plan document to a second reader.
|
|
53
|
+
|
|
39
54
|
The extension also registers concise static `prewalk` capability guidance
|
|
40
55
|
during initialization. Phase-specific planning and implementation instructions
|
|
41
56
|
remain transient context messages.
|
|
42
57
|
|
|
58
|
+
## Thinking levels
|
|
59
|
+
|
|
60
|
+
Prewalk does not force a planner or executor thinking level. It snapshots the current level, Pi carries and clamps that preference to the target model's supported levels during handoff, and Prewalk restores the planner model before restoring the exact original level. This keeps user and subagent thinking choices authoritative and avoids assuming that every low-tier executor supports or performs well at the same fixed effort.
|
|
61
|
+
|
|
62
|
+
The referenced Prewalk design requires deep planning and a cheaper executor, but does not prescribe a separate executor effort. Select the desired thinking level before starting the task; model-tier routing supplies the default cost reduction.
|
|
63
|
+
|
|
64
|
+
## Subagents
|
|
65
|
+
|
|
66
|
+
`enter_prewalk` is loaded into mutation-capable general and custom child sessions whenever Prewalk is enabled. Each child owns an independent lifecycle and snapshots its own selected model and thinking level. Child handoffs honor the root session's configured model scope. Inspection-only `explore` and `reviewer` children do not receive the entry tool because their mutation tools are intentionally disabled.
|
|
67
|
+
|
|
43
68
|
## Flags
|
|
44
69
|
|
|
45
70
|
Prewalk uses Pi's namespaced extension flags and does not read a configuration file.
|
|
46
71
|
|
|
47
72
|
```text
|
|
48
|
-
--prewalk-target-model <provider/model-id>
|
|
73
|
+
--prewalk-target-model <high|medium|low|provider/model-id>
|
|
49
74
|
--prewalk-restore-planner
|
|
50
75
|
--no-prewalk-restore-planner
|
|
51
76
|
```
|
|
52
77
|
|
|
53
|
-
`prewalk-target-model` defaults to `
|
|
78
|
+
`prewalk-target-model` defaults to `low`. Tier selection uses the authenticated models allowed by the current session, preferring the planner's provider and model family. An exact `provider/model-id` overrides tier selection but must remain inside a nonempty session model scope. `prewalk-restore-planner` defaults to `true`.
|
|
54
79
|
|
|
55
80
|
## Failure behavior
|
|
56
81
|
|
|
57
|
-
-
|
|
82
|
+
- A target tier with no authenticated candidate, or a missing exact target model or authentication, clears the handoff and keeps the existing trajectory.
|
|
83
|
+
- An exact target outside a nonempty session model scope is rejected before switching.
|
|
58
84
|
- A failed target-model switch clears Prewalk and reports the failure once.
|
|
59
85
|
- A failed planner restoration clears Prewalk, reports the failure once, and keeps the current model.
|
|
60
86
|
- A manual model change cancels Prewalk without restoring over the user's selection.
|
|
87
|
+
- Repeated entry calls do not replace the active run or its planner snapshot.
|
|
88
|
+
- Exit requests during active target inference restore only after the run settles.
|
|
61
89
|
- Session quit, reload, replacement, or fork while the target is active attempts planner restoration as a graceful shutdown backstop.
|
|
62
90
|
- Reaching the automatic continuation limit lets the run settle normally.
|
|
63
91
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAuD9B,QAAA,MAAM,gBAAgB,EAAE,cAgevB,CAAC;AAmJF,eAAe,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { formatModelReference, isModelTier, parseModelReference, selectModelForTier, } from '@felan-ai/agent-core';
|
|
2
|
+
import { Type } from 'typebox';
|
|
3
|
+
import { CONTINUATION_MESSAGE_TYPE, CONTROL_MESSAGE_PREFIX, IMPLEMENTATION_MESSAGE_TYPE, PLANNING_INSTRUCTION, PLANNING_MESSAGE_TYPE, VERIFICATION_INSTRUCTION, } from './prompts.js';
|
|
4
|
+
import { beginTurn, createRunState, recordToolCall, reduceTurn, validateArmingTools, } from './state.js';
|
|
3
5
|
const DEFAULT_CONFIG = {
|
|
4
|
-
targetModel: '
|
|
6
|
+
targetModel: 'low',
|
|
5
7
|
restorePlanner: true,
|
|
6
8
|
};
|
|
7
9
|
const TARGET_MODEL_FLAG = 'prewalk-target-model';
|
|
8
10
|
const RESTORE_PLANNER_FLAG = 'prewalk-restore-planner';
|
|
9
11
|
const HEADLESS_TASK_MESSAGE_TYPE = 'pi-prewalk-task';
|
|
12
|
+
const ENTER_PREWALK_TOOL = 'enter_prewalk';
|
|
13
|
+
const EnterPrewalkParams = Type.Object({}, { additionalProperties: false });
|
|
10
14
|
const prewalkExtension = (pi) => {
|
|
11
15
|
pi.registerCapability({
|
|
12
16
|
id: 'prewalk',
|
|
13
|
-
instructions: 'Prewalk
|
|
17
|
+
instructions: 'Use Prewalk for user tasks that require creating, editing, moving, renaming, or deleting files. When such a task begins and no injected planning or implementation guidance is already present, call enter_prewalk as the first and only tool call before repository exploration or mutation. Do not call it when the context already directs you to explore and build a task graph or to continue an existing session task graph, and do not enter Prewalk for read-only requests. The tool is available in the root session and mutation-capable subagents. During an active run, follow the injected planning, task-tracking, implementation, and verification guidance. The user can exit with /prewalk exit (or /prewalk off).',
|
|
14
18
|
});
|
|
15
19
|
pi.registerFlag(TARGET_MODEL_FLAG, {
|
|
16
|
-
description: 'Model used to implement a planned Prewalk task
|
|
20
|
+
description: 'Model tier or exact provider/model-id used to implement a planned Prewalk task',
|
|
17
21
|
type: 'string',
|
|
18
22
|
default: DEFAULT_CONFIG.targetModel,
|
|
19
23
|
});
|
|
@@ -28,8 +32,10 @@ const prewalkExtension = (pi) => {
|
|
|
28
32
|
let configWarningShown = false;
|
|
29
33
|
let state = { phase: 'idle' };
|
|
30
34
|
let plannerSnapshot;
|
|
31
|
-
let
|
|
32
|
-
let
|
|
35
|
+
let exitRequested = false;
|
|
36
|
+
let modelTransition;
|
|
37
|
+
let handoffPromise;
|
|
38
|
+
let restorationPromise;
|
|
33
39
|
function refreshConfig() {
|
|
34
40
|
loadedConfig = loadConfig(pi);
|
|
35
41
|
config = loadedConfig.config;
|
|
@@ -58,18 +64,19 @@ const prewalkExtension = (pi) => {
|
|
|
58
64
|
const continuationText = state.phase === 'planning' && continuationCount > 0
|
|
59
65
|
? ` · ${continuationCount}/3`
|
|
60
66
|
: '';
|
|
61
|
-
|
|
67
|
+
const exitText = exitRequested ? ' · exit pending' : '';
|
|
68
|
+
ctx.ui.setStatus('prewalk', `Prewalk ${state.phase}${continuationText}${exitText} → ${targetModel.key}`);
|
|
62
69
|
}
|
|
63
70
|
function publishStatus(ctx) {
|
|
64
71
|
publishConfigWarning(ctx);
|
|
65
72
|
const planner = plannerSnapshot ? ` | planner ${plannerSnapshot.modelKey}` : '';
|
|
66
|
-
|
|
73
|
+
const exit = exitRequested ? ' | exit pending' : '';
|
|
74
|
+
notify(ctx, `Prewalk: ${state.phase} | target ${targetModel.key} | restore planner ${config.restorePlanner ? 'on' : 'off'}${planner}${exit}`);
|
|
67
75
|
}
|
|
68
76
|
function clearAutomation(ctx) {
|
|
69
77
|
state = { phase: 'idle' };
|
|
70
78
|
plannerSnapshot = undefined;
|
|
71
|
-
|
|
72
|
-
useBeads = false;
|
|
79
|
+
exitRequested = false;
|
|
73
80
|
updateStatus(ctx);
|
|
74
81
|
}
|
|
75
82
|
function failAutomation(ctx, message) {
|
|
@@ -86,32 +93,35 @@ const prewalkExtension = (pi) => {
|
|
|
86
93
|
notify(ctx, 'Prewalk can only be armed while the agent is idle.', 'warning');
|
|
87
94
|
return false;
|
|
88
95
|
}
|
|
89
|
-
|
|
90
|
-
const validation = validateArmingTools(pi.getActiveTools(), useBeads);
|
|
96
|
+
const validation = validateArmingTools(pi.getActiveTools());
|
|
91
97
|
if (!validation.ok) {
|
|
92
98
|
notify(ctx, validation.reason, 'error');
|
|
93
99
|
return false;
|
|
94
100
|
}
|
|
95
101
|
state = { phase: 'armed' };
|
|
96
102
|
updateStatus(ctx);
|
|
97
|
-
|
|
98
|
-
notify(ctx, `Prewalk armed with ${tracking}. The next task will plan, make one mutation, then hand off to ${targetModel.key}.`);
|
|
103
|
+
notify(ctx, `Prewalk armed. The next task will plan, make one mutation, then hand off to ${targetModel.key}.`);
|
|
99
104
|
return true;
|
|
100
105
|
}
|
|
101
|
-
function
|
|
102
|
-
if (state.phase !== 'armed')
|
|
103
|
-
return;
|
|
106
|
+
function startRun(ctx, handoffArmed = true) {
|
|
104
107
|
if (!ctx.model) {
|
|
105
108
|
failAutomation(ctx, 'Prewalk requires a selected planner model.');
|
|
106
|
-
return;
|
|
109
|
+
return false;
|
|
107
110
|
}
|
|
108
111
|
plannerSnapshot = {
|
|
109
112
|
model: ctx.model,
|
|
110
113
|
modelKey: modelKey(ctx.model),
|
|
111
114
|
thinkingLevel: pi.getThinkingLevel(),
|
|
112
115
|
};
|
|
113
|
-
|
|
116
|
+
exitRequested = false;
|
|
117
|
+
state = { phase: 'planning', run: createRunState({ handoffArmed }) };
|
|
114
118
|
updateStatus(ctx);
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
function beginRun(ctx) {
|
|
122
|
+
if (state.phase !== 'armed')
|
|
123
|
+
return;
|
|
124
|
+
startRun(ctx);
|
|
115
125
|
}
|
|
116
126
|
async function switchToTarget(ctx) {
|
|
117
127
|
if (state.phase !== 'planning' || !state.run || !plannerSnapshot)
|
|
@@ -120,39 +130,70 @@ const prewalkExtension = (pi) => {
|
|
|
120
130
|
const snapshot = plannerSnapshot;
|
|
121
131
|
state = { phase: 'handoff', run };
|
|
122
132
|
updateStatus(ctx);
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
let target;
|
|
134
|
+
if (targetModel.kind === 'tier') {
|
|
135
|
+
const availableModels = ctx.scopedModels.length > 0
|
|
136
|
+
? ctx.scopedModels.map(({ model }) => model)
|
|
137
|
+
: ctx.modelRegistry.getAvailable();
|
|
138
|
+
const selected = selectModelForTier(targetModel.tier, availableModels, {
|
|
139
|
+
preferredModel: snapshot.model,
|
|
140
|
+
});
|
|
141
|
+
if (!selected) {
|
|
142
|
+
failAutomation(ctx, `Prewalk has no authenticated model for the ${targetModel.tier} tier.`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
target = selected.model;
|
|
127
146
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
147
|
+
else {
|
|
148
|
+
const exactReference = targetModel.model;
|
|
149
|
+
const registeredTarget = ctx.modelRegistry.find(exactReference.provider, exactReference.id);
|
|
150
|
+
if (!registeredTarget) {
|
|
151
|
+
failAutomation(ctx, `Prewalk target model is unavailable: ${targetModel.key}.`);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const scopedTarget = ctx.scopedModels.find(({ model }) => (model.provider === exactReference.provider && model.id === exactReference.id))?.model;
|
|
155
|
+
if (ctx.scopedModels.length > 0 && !scopedTarget) {
|
|
156
|
+
failAutomation(ctx, `Prewalk target model is outside the current session model scope: ${targetModel.key}.`);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
target = scopedTarget ?? registeredTarget;
|
|
160
|
+
if (!ctx.modelRegistry.hasConfiguredAuth(target)) {
|
|
161
|
+
failAutomation(ctx, `Prewalk target model is not authenticated: ${targetModel.key}.`);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
131
164
|
}
|
|
165
|
+
const targetKey = formatModelReference(target);
|
|
132
166
|
try {
|
|
133
|
-
|
|
134
|
-
const switched = await pi.setModel(target);
|
|
167
|
+
const switched = await setModelPreservingExternalSelection(target, ctx);
|
|
135
168
|
if (state.phase !== 'handoff' || plannerSnapshot !== snapshot)
|
|
136
169
|
return;
|
|
137
170
|
if (!switched) {
|
|
138
|
-
failAutomation(ctx, `Prewalk could not switch to ${
|
|
171
|
+
failAutomation(ctx, `Prewalk could not switch to ${targetKey}.`);
|
|
139
172
|
return;
|
|
140
173
|
}
|
|
141
174
|
state = { phase: 'implementing', run };
|
|
142
175
|
updateStatus(ctx);
|
|
143
|
-
notify(ctx, `Prewalk handed implementation to ${
|
|
176
|
+
notify(ctx, `Prewalk handed implementation to ${targetKey}.`);
|
|
144
177
|
}
|
|
145
178
|
catch (error) {
|
|
146
179
|
if (state.phase === 'handoff' && plannerSnapshot === snapshot) {
|
|
147
|
-
failAutomation(ctx, `Prewalk could not switch to ${
|
|
180
|
+
failAutomation(ctx, `Prewalk could not switch to ${targetKey}: ${errorMessage(error)}`);
|
|
148
181
|
}
|
|
149
182
|
}
|
|
150
|
-
finally {
|
|
151
|
-
if (expectedModelKey === targetModel.key)
|
|
152
|
-
expectedModelKey = undefined;
|
|
153
|
-
}
|
|
154
183
|
}
|
|
155
|
-
|
|
184
|
+
function restorePlanner(ctx) {
|
|
185
|
+
if (restorationPromise)
|
|
186
|
+
return restorationPromise;
|
|
187
|
+
const restoration = performPlannerRestoration(ctx).finally(() => {
|
|
188
|
+
if (restorationPromise === restoration)
|
|
189
|
+
restorationPromise = undefined;
|
|
190
|
+
});
|
|
191
|
+
restorationPromise = restoration;
|
|
192
|
+
return restoration;
|
|
193
|
+
}
|
|
194
|
+
async function performPlannerRestoration(ctx) {
|
|
195
|
+
if (handoffPromise)
|
|
196
|
+
await handoffPromise;
|
|
156
197
|
const snapshot = plannerSnapshot;
|
|
157
198
|
if (!snapshot) {
|
|
158
199
|
clearAutomation(ctx);
|
|
@@ -162,8 +203,7 @@ const prewalkExtension = (pi) => {
|
|
|
162
203
|
updateStatus(ctx);
|
|
163
204
|
try {
|
|
164
205
|
if (modelKey(ctx.model) !== snapshot.modelKey) {
|
|
165
|
-
|
|
166
|
-
const restored = await pi.setModel(snapshot.model);
|
|
206
|
+
const restored = await setModelPreservingExternalSelection(snapshot.model, ctx);
|
|
167
207
|
if (state.phase !== 'restoring' || plannerSnapshot !== snapshot)
|
|
168
208
|
return false;
|
|
169
209
|
if (!restored)
|
|
@@ -182,9 +222,40 @@ const prewalkExtension = (pi) => {
|
|
|
182
222
|
}
|
|
183
223
|
return false;
|
|
184
224
|
}
|
|
225
|
+
}
|
|
226
|
+
async function setModelPreservingExternalSelection(model, ctx) {
|
|
227
|
+
if (modelTransition)
|
|
228
|
+
throw new Error('another Prewalk model transition is already active');
|
|
229
|
+
const transition = { expectedModelKey: modelKey(model) };
|
|
230
|
+
modelTransition = transition;
|
|
231
|
+
try {
|
|
232
|
+
let switched;
|
|
233
|
+
try {
|
|
234
|
+
switched = await pi.setModel(model);
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
await reapplyExternalModel(ctx, transition);
|
|
238
|
+
}
|
|
239
|
+
return switched;
|
|
240
|
+
}
|
|
185
241
|
finally {
|
|
186
|
-
if (
|
|
187
|
-
|
|
242
|
+
if (modelTransition === transition)
|
|
243
|
+
modelTransition = undefined;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async function reapplyExternalModel(ctx, transition) {
|
|
247
|
+
while (transition.externalModel
|
|
248
|
+
&& modelKey(ctx.model) !== modelKey(transition.externalModel)) {
|
|
249
|
+
const externalModel = transition.externalModel;
|
|
250
|
+
transition.expectedModelKey = modelKey(externalModel);
|
|
251
|
+
const restored = await pi.setModel(externalModel);
|
|
252
|
+
if (!restored)
|
|
253
|
+
throw new Error(`could not retain manual model ${modelKey(externalModel)}`);
|
|
254
|
+
}
|
|
255
|
+
if (transition.externalModel
|
|
256
|
+
&& transition.externalThinkingLevel !== undefined
|
|
257
|
+
&& modelKey(ctx.model) === modelKey(transition.externalModel)) {
|
|
258
|
+
pi.setThinkingLevel(transition.externalThinkingLevel);
|
|
188
259
|
}
|
|
189
260
|
}
|
|
190
261
|
async function turnOff(ctx) {
|
|
@@ -192,10 +263,26 @@ const prewalkExtension = (pi) => {
|
|
|
192
263
|
notify(ctx, 'Prewalk is already off.');
|
|
193
264
|
return;
|
|
194
265
|
}
|
|
266
|
+
if (state.phase === 'restoring') {
|
|
267
|
+
const restored = await restorePlanner(ctx);
|
|
268
|
+
if (restored)
|
|
269
|
+
notify(ctx, 'Prewalk is off and the planner model has been restored.');
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
195
272
|
const targetIsActive = state.phase === 'handoff'
|
|
196
|
-
|| state.phase === 'implementing'
|
|
197
|
-
|| state.phase === 'restoring';
|
|
273
|
+
|| state.phase === 'implementing';
|
|
198
274
|
if (targetIsActive && config.restorePlanner && plannerSnapshot) {
|
|
275
|
+
if (state.phase === 'handoff' || !ctx.isIdle()) {
|
|
276
|
+
if (!exitRequested) {
|
|
277
|
+
exitRequested = true;
|
|
278
|
+
updateStatus(ctx);
|
|
279
|
+
notify(ctx, 'Prewalk will exit and restore the planner when the current agent run settles.');
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
notify(ctx, 'Prewalk exit is already pending.');
|
|
283
|
+
}
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
199
286
|
const restored = await restorePlanner(ctx);
|
|
200
287
|
if (restored)
|
|
201
288
|
notify(ctx, 'Prewalk is off and the planner model has been restored.');
|
|
@@ -204,8 +291,37 @@ const prewalkExtension = (pi) => {
|
|
|
204
291
|
clearAutomation(ctx);
|
|
205
292
|
notify(ctx, 'Prewalk is off.');
|
|
206
293
|
}
|
|
294
|
+
pi.registerTool({
|
|
295
|
+
name: ENTER_PREWALK_TOOL,
|
|
296
|
+
label: 'Enter Prewalk',
|
|
297
|
+
description: 'Enter same-session Prewalk for the current user task. Call this once, as the only tool call in the response and before exploration or mutation, when completing the request requires creating, editing, moving, renaming, or deleting files. Do not call it for read-only work or when injected guidance already directs planning or implementation.',
|
|
298
|
+
promptSnippet: 'Enter Prewalk before starting a task that will mutate files',
|
|
299
|
+
executionMode: 'sequential',
|
|
300
|
+
parameters: EnterPrewalkParams,
|
|
301
|
+
async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
|
|
302
|
+
if (state.phase === 'idle')
|
|
303
|
+
refreshConfig();
|
|
304
|
+
publishConfigWarning(ctx);
|
|
305
|
+
if (state.phase !== 'idle') {
|
|
306
|
+
return prewalkToolError(`Prewalk is already ${state.phase}; continue the active run without calling ${ENTER_PREWALK_TOOL} again.`, state.phase);
|
|
307
|
+
}
|
|
308
|
+
const validation = validateArmingTools(pi.getActiveTools());
|
|
309
|
+
if (!validation.ok)
|
|
310
|
+
return prewalkToolError(validation.reason, state.phase);
|
|
311
|
+
if (!ctx.model)
|
|
312
|
+
return prewalkToolError('Prewalk requires a selected planner model.', state.phase);
|
|
313
|
+
startRun(ctx, false);
|
|
314
|
+
return {
|
|
315
|
+
content: [{
|
|
316
|
+
type: 'text',
|
|
317
|
+
text: `Prewalk entered for the current task. Follow the injected planning guidance, keep the task graph concise, and make one focused mutation before the handoff to ${targetModel.key}.`,
|
|
318
|
+
}],
|
|
319
|
+
details: { phase: 'planning', targetModel: targetModel.key },
|
|
320
|
+
};
|
|
321
|
+
},
|
|
322
|
+
});
|
|
207
323
|
pi.registerCommand('prewalk', {
|
|
208
|
-
description: '
|
|
324
|
+
description: 'Enter Prewalk, inspect status, or exit its model-routing lifecycle',
|
|
209
325
|
handler: async (args, ctx) => {
|
|
210
326
|
if (state.phase === 'idle')
|
|
211
327
|
refreshConfig();
|
|
@@ -214,7 +330,7 @@ const prewalkExtension = (pi) => {
|
|
|
214
330
|
publishStatus(ctx);
|
|
215
331
|
return;
|
|
216
332
|
}
|
|
217
|
-
if (command === 'off') {
|
|
333
|
+
if (command === 'off' || command === 'exit' || command === 'cancel') {
|
|
218
334
|
await turnOff(ctx);
|
|
219
335
|
return;
|
|
220
336
|
}
|
|
@@ -247,7 +363,7 @@ const prewalkExtension = (pi) => {
|
|
|
247
363
|
beginRun(ctx);
|
|
248
364
|
});
|
|
249
365
|
pi.on('context', (event) => {
|
|
250
|
-
return { messages: buildContextMessages(event.messages, state.phase
|
|
366
|
+
return { messages: buildContextMessages(event.messages, state.phase) };
|
|
251
367
|
});
|
|
252
368
|
pi.on('turn_start', () => {
|
|
253
369
|
if (state.phase !== 'planning' || !state.run)
|
|
@@ -257,14 +373,9 @@ const prewalkExtension = (pi) => {
|
|
|
257
373
|
pi.on('tool_call', (event) => {
|
|
258
374
|
if (state.phase !== 'planning' || !state.run)
|
|
259
375
|
return;
|
|
260
|
-
if (!useBeads && event.toolName === 'todo_write') {
|
|
261
|
-
const validation = validateTodoWriteInput(event.input);
|
|
262
|
-
if (!validation.ok)
|
|
263
|
-
return { block: true, reason: validation.reason };
|
|
264
|
-
}
|
|
265
376
|
state = {
|
|
266
377
|
phase: 'planning',
|
|
267
|
-
run: recordToolCall(state.run, { toolCallId: event.toolCallId, toolName: event.toolName
|
|
378
|
+
run: recordToolCall(state.run, { toolCallId: event.toolCallId, toolName: event.toolName }),
|
|
268
379
|
};
|
|
269
380
|
});
|
|
270
381
|
pi.on('turn_end', async (event, ctx) => {
|
|
@@ -276,7 +387,12 @@ const prewalkExtension = (pi) => {
|
|
|
276
387
|
state = { phase: 'planning', run: decision.state };
|
|
277
388
|
updateStatus(ctx);
|
|
278
389
|
if (decision.shouldHandoff) {
|
|
279
|
-
|
|
390
|
+
const handoff = switchToTarget(ctx).finally(() => {
|
|
391
|
+
if (handoffPromise === handoff)
|
|
392
|
+
handoffPromise = undefined;
|
|
393
|
+
});
|
|
394
|
+
handoffPromise = handoff;
|
|
395
|
+
await handoff;
|
|
280
396
|
return;
|
|
281
397
|
}
|
|
282
398
|
if (decision.shouldContinue) {
|
|
@@ -288,13 +404,15 @@ const prewalkExtension = (pi) => {
|
|
|
288
404
|
}
|
|
289
405
|
});
|
|
290
406
|
pi.on('model_select', (event, ctx) => {
|
|
291
|
-
if (state.phase === 'idle')
|
|
292
|
-
return;
|
|
293
407
|
const selectedModelKey = modelKey(event.model);
|
|
294
|
-
if (expectedModelKey === selectedModelKey)
|
|
295
|
-
expectedModelKey = undefined;
|
|
408
|
+
if (modelTransition?.expectedModelKey === selectedModelKey)
|
|
296
409
|
return;
|
|
410
|
+
if (modelTransition) {
|
|
411
|
+
modelTransition.externalModel = event.model;
|
|
412
|
+
modelTransition.externalThinkingLevel = pi.getThinkingLevel();
|
|
297
413
|
}
|
|
414
|
+
if (state.phase === 'idle')
|
|
415
|
+
return;
|
|
298
416
|
clearAutomation(ctx);
|
|
299
417
|
notify(ctx, `Prewalk cancelled after the model changed to ${selectedModelKey}.`, 'warning');
|
|
300
418
|
});
|
|
@@ -328,14 +446,22 @@ const prewalkExtension = (pi) => {
|
|
|
328
446
|
}
|
|
329
447
|
});
|
|
330
448
|
};
|
|
331
|
-
function buildContextMessages(messages, phase
|
|
332
|
-
const
|
|
449
|
+
function buildContextMessages(messages, phase) {
|
|
450
|
+
const successfulEntries = successfulEntryCallIds(messages);
|
|
451
|
+
const filtered = [];
|
|
452
|
+
for (const message of structuredClone(messages)) {
|
|
453
|
+
if (isControlMessage(message) || isSuccessfulEntryResult(message, successfulEntries))
|
|
454
|
+
continue;
|
|
455
|
+
const stripped = stripSuccessfulEntryCall(message, successfulEntries);
|
|
456
|
+
if (stripped !== undefined)
|
|
457
|
+
filtered.push(stripped);
|
|
458
|
+
}
|
|
333
459
|
const instruction = phase === 'planning'
|
|
334
|
-
? { customType: PLANNING_MESSAGE_TYPE, content:
|
|
460
|
+
? { customType: PLANNING_MESSAGE_TYPE, content: PLANNING_INSTRUCTION }
|
|
335
461
|
: phase === 'implementing'
|
|
336
462
|
? {
|
|
337
463
|
customType: IMPLEMENTATION_MESSAGE_TYPE,
|
|
338
|
-
content:
|
|
464
|
+
content: VERIFICATION_INSTRUCTION,
|
|
339
465
|
}
|
|
340
466
|
: undefined;
|
|
341
467
|
if (!instruction)
|
|
@@ -351,15 +477,6 @@ function buildContextMessages(messages, phase, useBeads) {
|
|
|
351
477
|
},
|
|
352
478
|
];
|
|
353
479
|
}
|
|
354
|
-
async function hasBeadsWorkspace(pi, cwd) {
|
|
355
|
-
try {
|
|
356
|
-
const result = await pi.exec('bd', ['-C', cwd, '--readonly', '--json', 'status', '--no-activity'], { timeout: 5_000 });
|
|
357
|
-
return result.code === 0;
|
|
358
|
-
}
|
|
359
|
-
catch {
|
|
360
|
-
return false;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
480
|
function isTextOnlyCompletion(message) {
|
|
364
481
|
return isRecord(message)
|
|
365
482
|
&& message.role === 'assistant'
|
|
@@ -373,25 +490,60 @@ function isControlMessage(message) {
|
|
|
373
490
|
&& typeof message.customType === 'string'
|
|
374
491
|
&& message.customType.startsWith(CONTROL_MESSAGE_PREFIX);
|
|
375
492
|
}
|
|
493
|
+
function successfulEntryCallIds(messages) {
|
|
494
|
+
const callIds = new Set();
|
|
495
|
+
for (const message of messages) {
|
|
496
|
+
if (isRecord(message)
|
|
497
|
+
&& message.role === 'toolResult'
|
|
498
|
+
&& message.toolName === ENTER_PREWALK_TOOL
|
|
499
|
+
&& message.isError !== true
|
|
500
|
+
&& typeof message.toolCallId === 'string') {
|
|
501
|
+
callIds.add(message.toolCallId);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return callIds;
|
|
505
|
+
}
|
|
506
|
+
function isSuccessfulEntryResult(message, callIds) {
|
|
507
|
+
return isRecord(message)
|
|
508
|
+
&& message.role === 'toolResult'
|
|
509
|
+
&& message.toolName === ENTER_PREWALK_TOOL
|
|
510
|
+
&& typeof message.toolCallId === 'string'
|
|
511
|
+
&& callIds.has(message.toolCallId);
|
|
512
|
+
}
|
|
513
|
+
function stripSuccessfulEntryCall(message, callIds) {
|
|
514
|
+
if (!isRecord(message) || message.role !== 'assistant' || !Array.isArray(message.content)) {
|
|
515
|
+
return message;
|
|
516
|
+
}
|
|
517
|
+
const isEntryCall = (item) => (isRecord(item)
|
|
518
|
+
&& item.type === 'toolCall'
|
|
519
|
+
&& item.name === ENTER_PREWALK_TOOL
|
|
520
|
+
&& typeof item.id === 'string'
|
|
521
|
+
&& callIds.has(item.id));
|
|
522
|
+
if (!message.content.some(isEntryCall))
|
|
523
|
+
return message;
|
|
524
|
+
const hasOtherToolCalls = message.content.some((item) => (isRecord(item) && item.type === 'toolCall' && !isEntryCall(item)));
|
|
525
|
+
if (!hasOtherToolCalls)
|
|
526
|
+
return undefined;
|
|
527
|
+
const content = message.content.filter((item) => !isEntryCall(item));
|
|
528
|
+
return content.length === 0 ? undefined : { ...message, content };
|
|
529
|
+
}
|
|
376
530
|
function modelKey(model) {
|
|
377
531
|
return model ? `${model.provider}/${model.id}` : 'none';
|
|
378
532
|
}
|
|
379
533
|
function parseTargetModel(value) {
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
382
|
-
return
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
if (!provider || !modelId)
|
|
386
|
-
return undefined;
|
|
387
|
-
return { provider, modelId, key: `${provider}/${modelId}` };
|
|
534
|
+
const normalized = value.trim();
|
|
535
|
+
if (isModelTier(normalized))
|
|
536
|
+
return { kind: 'tier', tier: normalized, key: normalized };
|
|
537
|
+
const model = parseModelReference(normalized);
|
|
538
|
+
return model ? { kind: 'model', model, key: formatModelReference(model) } : undefined;
|
|
388
539
|
}
|
|
389
540
|
function loadConfig(pi) {
|
|
390
541
|
const targetModel = pi.getFlag(TARGET_MODEL_FLAG);
|
|
391
542
|
const restorePlanner = pi.getFlag(RESTORE_PLANNER_FLAG);
|
|
392
543
|
const parsedTarget = typeof targetModel === 'string' ? parseTargetModel(targetModel) : undefined;
|
|
393
|
-
if (!parsedTarget)
|
|
394
|
-
return invalidConfig(`${TARGET_MODEL_FLAG} must
|
|
544
|
+
if (!parsedTarget) {
|
|
545
|
+
return invalidConfig(`${TARGET_MODEL_FLAG} must be high, medium, low, or an exact provider/model-id`);
|
|
546
|
+
}
|
|
395
547
|
if (typeof restorePlanner !== 'boolean')
|
|
396
548
|
return invalidConfig(`${RESTORE_PLANNER_FLAG} must be a boolean`);
|
|
397
549
|
return {
|
|
@@ -407,6 +559,13 @@ function invalidConfig(reason) {
|
|
|
407
559
|
function errorMessage(error) {
|
|
408
560
|
return error instanceof Error ? error.message : String(error);
|
|
409
561
|
}
|
|
562
|
+
function prewalkToolError(message, phase) {
|
|
563
|
+
return {
|
|
564
|
+
content: [{ type: 'text', text: message }],
|
|
565
|
+
details: { error: message, phase },
|
|
566
|
+
isError: true,
|
|
567
|
+
};
|
|
568
|
+
}
|
|
410
569
|
function isRecord(value) {
|
|
411
570
|
return typeof value === 'object' && value !== null;
|
|
412
571
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,sBAAsB,GAGvB,MAAM,YAAY,CAAC;AAuBpB,MAAM,cAAc,GAAkB;IACpC,WAAW,EAAE,2BAA2B;IACxC,cAAc,EAAE,IAAI;CACrB,CAAC;AACF,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACjD,MAAM,oBAAoB,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C,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC,GAAG,iBAAiB,2DAA2D,CAAC,CAAC;IACxG,CAAC;IACD,IAAI,OAAO,cAAc,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC,GAAG,oBAAoB,oBAAoB,CAAC,CAAC;IAE3G,OAAO;QACL,MAAM,EAAE;YACN,WAAW,EAAE,YAAY,CAAC,GAAG;YAC7B,cAAc;SACf;KACF,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC;AAClE,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAe,EAAE,KAAmB;IAC5D,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACnD,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;QAClC,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/prompts.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export declare const PLANNING_MESSAGE_TYPE = "pi-prewalk:planning";
|
|
|
3
3
|
export declare const IMPLEMENTATION_MESSAGE_TYPE = "pi-prewalk:implementation";
|
|
4
4
|
export declare const CONTINUATION_MESSAGE_TYPE = "pi-prewalk:continuation";
|
|
5
5
|
export declare const MAX_AUTOMATIC_CONTINUATIONS = 3;
|
|
6
|
-
export declare const PLANNING_INSTRUCTION = "Explore the repository thoroughly and determine the complete work required for the user's request.\n\nFollow this order:\n1. Inspect the relevant source, tests, configuration, documentation, and constraints.\n2. Determine the full implementation scope, affected files and symbols, risks, and verification required.\n3.
|
|
7
|
-
export declare const VERIFICATION_INSTRUCTION = "Continue implementing the existing
|
|
8
|
-
export declare const BEADS_PLANNING_INSTRUCTION = "Explore the repository thoroughly and determine the complete work required for the user's request.\n\nUse the beads skill and direct bd CLI commands for task tracking. Track the work with Beads instead of todo_write.\n\nFollow this order:\n1. Inspect the relevant source, tests, configuration, documentation, and constraints.\n2. Determine the full implementation scope, affected files and symbols, risks, and verification required.\n3. Create detailed Beads tasks for all implementation and validation work. Give each task a concrete scope and acceptance criteria, add dependencies that represent the required execution order, and mark the first ready task in_progress.\n4. Start implementing immediately. Work through ready Beads while honoring their dependencies, keep task statuses current, validate each completed task, and continue until every task for the request is complete.\n\nKeep the implementation focused on the requested scope and update the Beads graph when repository evidence changes the plan.";
|
|
9
|
-
export declare const BEADS_VERIFICATION_INSTRUCTION = "Continue implementing the existing Beads task graph. Honor task dependencies, work through ready Beads in execution order, and keep their statuses current with direct bd CLI commands instead of todo_write. Validate and close each completed Bead, keep the changes limited to the requested scope, run the full relevant test module or suite, resolve failures, and continue until every task is complete.";
|
|
6
|
+
export declare const PLANNING_INSTRUCTION = "Explore the repository thoroughly and determine the complete work required for the user's request.\n\nFollow this order:\n1. Inspect the relevant source, tests, configuration, documentation, and constraints.\n2. Determine the full implementation scope, affected files and symbols, risks, and verification required.\n3. Use TaskCreate to record a concise graph of no more than 9 outcome-oriented tasks. Put concrete validation in each task's acceptance criteria, using a dedicated validation task only when it covers multiple changes. Link tasks with blocked_by dependencies that encode the required implementation and validation order, so the next ready task is unambiguous at each step.\n4. Use TaskUpdate to claim the first ready task by setting it in_progress.\n5. Start implementing immediately with one focused change. Work through ready tasks in dependency order, keep task statuses current, record verified results when completing them, and continue until the request is complete.\n\nKeep the implementation focused on the requested scope and revise the task graph when repository evidence changes the plan.";
|
|
7
|
+
export declare const VERIFICATION_INSTRUCTION = "Continue implementing the existing session task graph. Honor task dependencies, claim ready work with TaskUpdate, keep statuses current, and complete every remaining task with a verified result. Keep the changes limited to the requested scope, run the full relevant test module or suite, resolve failures, and continue until every task is complete.";
|
|
10
8
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,qBAAqB,wBAAsC,CAAC;AACzE,eAAO,MAAM,2BAA2B,8BAA4C,CAAC;AACrF,eAAO,MAAM,yBAAyB,4BAA0C,CAAC;AACjF,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,eAAO,MAAM,oBAAoB,+
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,qBAAqB,wBAAsC,CAAC;AACzE,eAAO,MAAM,2BAA2B,8BAA4C,CAAC;AACrF,eAAO,MAAM,yBAAyB,4BAA0C,CAAC;AACjF,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,eAAO,MAAM,oBAAoB,+lCAS2F,CAAC;AAE7H,eAAO,MAAM,wBAAwB,iWAAiW,CAAC"}
|
package/dist/prompts.js
CHANGED
|
@@ -8,21 +8,10 @@ export const PLANNING_INSTRUCTION = `Explore the repository thoroughly and deter
|
|
|
8
8
|
Follow this order:
|
|
9
9
|
1. Inspect the relevant source, tests, configuration, documentation, and constraints.
|
|
10
10
|
2. Determine the full implementation scope, affected files and symbols, risks, and verification required.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
11
|
+
3. Use TaskCreate to record a concise graph of no more than 9 outcome-oriented tasks. Put concrete validation in each task's acceptance criteria, using a dedicated validation task only when it covers multiple changes. Link tasks with blocked_by dependencies that encode the required implementation and validation order, so the next ready task is unambiguous at each step.
|
|
12
|
+
4. Use TaskUpdate to claim the first ready task by setting it in_progress.
|
|
13
|
+
5. Start implementing immediately with one focused change. Work through ready tasks in dependency order, keep task statuses current, record verified results when completing them, and continue until the request is complete.
|
|
13
14
|
|
|
14
|
-
Keep the implementation focused on the requested scope and revise the
|
|
15
|
-
export const VERIFICATION_INSTRUCTION = `Continue implementing the existing
|
|
16
|
-
export const BEADS_PLANNING_INSTRUCTION = `Explore the repository thoroughly and determine the complete work required for the user's request.
|
|
17
|
-
|
|
18
|
-
Use the beads skill and direct bd CLI commands for task tracking. Track the work with Beads instead of todo_write.
|
|
19
|
-
|
|
20
|
-
Follow this order:
|
|
21
|
-
1. Inspect the relevant source, tests, configuration, documentation, and constraints.
|
|
22
|
-
2. Determine the full implementation scope, affected files and symbols, risks, and verification required.
|
|
23
|
-
3. Create detailed Beads tasks for all implementation and validation work. Give each task a concrete scope and acceptance criteria, add dependencies that represent the required execution order, and mark the first ready task in_progress.
|
|
24
|
-
4. Start implementing immediately. Work through ready Beads while honoring their dependencies, keep task statuses current, validate each completed task, and continue until every task for the request is complete.
|
|
25
|
-
|
|
26
|
-
Keep the implementation focused on the requested scope and update the Beads graph when repository evidence changes the plan.`;
|
|
27
|
-
export const BEADS_VERIFICATION_INSTRUCTION = `Continue implementing the existing Beads task graph. Honor task dependencies, work through ready Beads in execution order, and keep their statuses current with direct bd CLI commands instead of todo_write. Validate and close each completed Bead, keep the changes limited to the requested scope, run the full relevant test module or suite, resolve failures, and continue until every task is complete.`;
|
|
15
|
+
Keep the implementation focused on the requested scope and revise the task graph when repository evidence changes the plan.`;
|
|
16
|
+
export const VERIFICATION_INSTRUCTION = `Continue implementing the existing session task graph. Honor task dependencies, claim ready work with TaskUpdate, keep statuses current, and complete every remaining task with a verified result. Keep the changes limited to the requested scope, run the full relevant test module or suite, resolve failures, and continue until every task is complete.`;
|
|
28
17
|
//# sourceMappingURL=prompts.js.map
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,sBAAsB,UAAU,CAAC;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,sBAAsB,gBAAgB,CAAC;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,sBAAsB,cAAc,CAAC;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,sBAAsB,UAAU,CAAC;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,sBAAsB,gBAAgB,CAAC;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,sBAAsB,cAAc,CAAC;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;4HASwF,CAAC;AAE7H,MAAM,CAAC,MAAM,wBAAwB,GAAG,8VAA8V,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -4,16 +4,14 @@ export interface PrewalkState {
|
|
|
4
4
|
run?: PrewalkRunState;
|
|
5
5
|
}
|
|
6
6
|
export interface PrewalkRunState {
|
|
7
|
-
|
|
8
|
-
toolCalls: RecordedToolCall[];
|
|
9
|
-
nextOrdinal: number;
|
|
7
|
+
mutationCallIds: string[];
|
|
10
8
|
continuationCount: number;
|
|
11
9
|
continuationArmed: boolean;
|
|
10
|
+
handoffArmed: boolean;
|
|
12
11
|
}
|
|
13
12
|
export interface ToolCallSummary {
|
|
14
13
|
toolCallId: string;
|
|
15
14
|
toolName: string;
|
|
16
|
-
input?: unknown;
|
|
17
15
|
}
|
|
18
16
|
export interface ToolResultSummary {
|
|
19
17
|
toolCallId: string;
|
|
@@ -30,19 +28,14 @@ export type ValidationResult = {
|
|
|
30
28
|
ok: false;
|
|
31
29
|
reason: string;
|
|
32
30
|
};
|
|
33
|
-
type RecordedToolCall = {
|
|
34
|
-
toolCallId: string;
|
|
35
|
-
kind: 'tracking' | 'mutation';
|
|
36
|
-
ordinal: number;
|
|
37
|
-
};
|
|
38
31
|
export declare const MUTATION_TOOL_NAMES: ReadonlySet<string>;
|
|
39
|
-
export declare function validateArmingTools(activeTools: readonly string[]
|
|
40
|
-
export declare function
|
|
41
|
-
|
|
32
|
+
export declare function validateArmingTools(activeTools: readonly string[]): ValidationResult;
|
|
33
|
+
export declare function createRunState(options?: {
|
|
34
|
+
handoffArmed?: boolean;
|
|
35
|
+
}): PrewalkRunState;
|
|
42
36
|
export declare function beginTurn(state: PrewalkRunState): PrewalkRunState;
|
|
43
|
-
export declare function recordToolCall(state: PrewalkRunState, call: ToolCallSummary
|
|
37
|
+
export declare function recordToolCall(state: PrewalkRunState, call: ToolCallSummary): PrewalkRunState;
|
|
44
38
|
export declare function reduceTurn(state: PrewalkRunState, results: readonly ToolResultSummary[], options?: {
|
|
45
39
|
allowContinuation?: boolean;
|
|
46
40
|
}): TurnDecision;
|
|
47
|
-
export {};
|
|
48
41
|
//# sourceMappingURL=state.d.ts.map
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.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AAW,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAIpF;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,eAAe,CAOxF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAMjE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,GAAG,eAAe,CAO7F;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,YAAY,CA+Bd"}
|
package/dist/state.js
CHANGED
|
@@ -1,98 +1,38 @@
|
|
|
1
1
|
import { MAX_AUTOMATIC_CONTINUATIONS } from './prompts.js';
|
|
2
2
|
const MUTATION_TOOLS = ['edit', 'write', 'apply_patch'];
|
|
3
|
-
const TODO_STATUSES = new Set(['pending', 'in_progress', 'completed']);
|
|
4
|
-
const BEADS_MUTATIONS = new Set([
|
|
5
|
-
'create',
|
|
6
|
-
'new',
|
|
7
|
-
'q',
|
|
8
|
-
'update',
|
|
9
|
-
'close',
|
|
10
|
-
'done',
|
|
11
|
-
'link',
|
|
12
|
-
'dep',
|
|
13
|
-
'reopen',
|
|
14
|
-
'assign',
|
|
15
|
-
'priority',
|
|
16
|
-
'tag',
|
|
17
|
-
'label',
|
|
18
|
-
'note',
|
|
19
|
-
'comment',
|
|
20
|
-
'edit',
|
|
21
|
-
'set-state',
|
|
22
|
-
]);
|
|
23
3
|
export const MUTATION_TOOL_NAMES = new Set(MUTATION_TOOLS);
|
|
24
|
-
export function validateArmingTools(activeTools
|
|
25
|
-
|
|
26
|
-
?
|
|
27
|
-
:
|
|
28
|
-
const missingMutation = !activeTools.some((toolName) => MUTATION_TOOL_NAMES.has(toolName));
|
|
29
|
-
if (!missingTracking && !missingMutation)
|
|
30
|
-
return { ok: true };
|
|
31
|
-
const requirements = [];
|
|
32
|
-
if (missingTracking) {
|
|
33
|
-
requirements.push(useBeads ? 'an active shell tool (bash or exec_command)' : 'the active todo_write tool');
|
|
34
|
-
}
|
|
35
|
-
if (missingMutation)
|
|
36
|
-
requirements.push('an active mutation tool (edit, write, or apply_patch)');
|
|
37
|
-
return {
|
|
38
|
-
ok: false,
|
|
39
|
-
reason: `Prewalk requires ${requirements.join(' and ')}.`,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export function validateTodoWriteInput(input) {
|
|
43
|
-
if (!isRecord(input) || !Array.isArray(input.todos)) {
|
|
44
|
-
return { ok: false, reason: 'Prewalk requires todo_write input with a todos array.' };
|
|
45
|
-
}
|
|
46
|
-
if (input.todos.length < 5 || input.todos.length > 9) {
|
|
47
|
-
return { ok: false, reason: 'Prewalk requires 5-9 todo items before the first mutation.' };
|
|
48
|
-
}
|
|
49
|
-
if (input.todos.some((todo) => !isRecord(todo) || !TODO_STATUSES.has(String(todo.status)))) {
|
|
50
|
-
return { ok: false, reason: 'Every Prewalk todo must have a valid pending, in_progress, or completed status.' };
|
|
51
|
-
}
|
|
52
|
-
const inProgressCount = input.todos.filter((todo) => todo.status === 'in_progress').length;
|
|
53
|
-
if (inProgressCount !== 1) {
|
|
54
|
-
return { ok: false, reason: 'Prewalk requires exactly one in_progress todo item.' };
|
|
55
|
-
}
|
|
56
|
-
return { ok: true };
|
|
4
|
+
export function validateArmingTools(activeTools) {
|
|
5
|
+
return activeTools.some((toolName) => MUTATION_TOOL_NAMES.has(toolName))
|
|
6
|
+
? { ok: true }
|
|
7
|
+
: { ok: false, reason: 'Prewalk requires an active mutation tool (edit, write, or apply_patch).' };
|
|
57
8
|
}
|
|
58
|
-
export function createRunState() {
|
|
9
|
+
export function createRunState(options = {}) {
|
|
59
10
|
return {
|
|
60
|
-
|
|
61
|
-
toolCalls: [],
|
|
62
|
-
nextOrdinal: 0,
|
|
11
|
+
mutationCallIds: [],
|
|
63
12
|
continuationCount: 0,
|
|
64
13
|
continuationArmed: true,
|
|
14
|
+
handoffArmed: options.handoffArmed ?? true,
|
|
65
15
|
};
|
|
66
16
|
}
|
|
67
17
|
export function beginTurn(state) {
|
|
68
18
|
return {
|
|
69
19
|
...state,
|
|
70
|
-
|
|
71
|
-
|
|
20
|
+
mutationCallIds: [],
|
|
21
|
+
handoffArmed: true,
|
|
72
22
|
};
|
|
73
23
|
}
|
|
74
|
-
export function recordToolCall(state, call
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const kind = isTrackingCall(call, useBeads)
|
|
78
|
-
? 'tracking'
|
|
79
|
-
: MUTATION_TOOL_NAMES.has(call.toolName)
|
|
80
|
-
? 'mutation'
|
|
81
|
-
: undefined;
|
|
82
|
-
if (!kind)
|
|
83
|
-
return nextState;
|
|
24
|
+
export function recordToolCall(state, call) {
|
|
25
|
+
if (!MUTATION_TOOL_NAMES.has(call.toolName))
|
|
26
|
+
return state;
|
|
84
27
|
return {
|
|
85
|
-
...
|
|
86
|
-
|
|
28
|
+
...state,
|
|
29
|
+
mutationCallIds: [...state.mutationCallIds, call.toolCallId],
|
|
87
30
|
};
|
|
88
31
|
}
|
|
89
32
|
export function reduceTurn(state, results, options = {}) {
|
|
90
33
|
const successfulIds = new Set(results.filter((result) => !result.isError).map((result) => result.toolCallId));
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
const shouldHandoff = state.trackingGateOpen
|
|
94
|
-
? successfulMutations.length > 0
|
|
95
|
-
: successfulMutations.some((mutation) => successfulTracking.some((tracking) => tracking.ordinal < mutation.ordinal));
|
|
34
|
+
const shouldHandoff = state.handoffArmed
|
|
35
|
+
&& state.mutationCallIds.some((toolCallId) => successfulIds.has(toolCallId));
|
|
96
36
|
let continuationArmed = results.some((result) => !result.isError) || state.continuationArmed;
|
|
97
37
|
let continuationCount = state.continuationCount;
|
|
98
38
|
let shouldContinue = false;
|
|
@@ -107,99 +47,13 @@ export function reduceTurn(state, results, options = {}) {
|
|
|
107
47
|
}
|
|
108
48
|
return {
|
|
109
49
|
state: {
|
|
110
|
-
|
|
111
|
-
toolCalls: [],
|
|
112
|
-
nextOrdinal: 0,
|
|
50
|
+
mutationCallIds: [],
|
|
113
51
|
continuationCount,
|
|
114
52
|
continuationArmed,
|
|
53
|
+
handoffArmed: state.handoffArmed,
|
|
115
54
|
},
|
|
116
55
|
shouldHandoff,
|
|
117
56
|
shouldContinue,
|
|
118
57
|
};
|
|
119
58
|
}
|
|
120
|
-
function isTrackingCall(call, useBeads) {
|
|
121
|
-
if (!useBeads)
|
|
122
|
-
return call.toolName === 'todo_write';
|
|
123
|
-
if (call.toolName !== 'bash' && call.toolName !== 'exec_command')
|
|
124
|
-
return false;
|
|
125
|
-
if (!isRecord(call.input))
|
|
126
|
-
return false;
|
|
127
|
-
const command = call.input.command ?? call.input.cmd;
|
|
128
|
-
return typeof command === 'string' && shellCommandSegments(command).some(isBeadsMutationSegment);
|
|
129
|
-
}
|
|
130
|
-
function isBeadsMutationSegment(argv) {
|
|
131
|
-
const commandIndex = argv.findIndex((argument) => !/^[A-Za-z_][A-Za-z0-9_]*=/.test(argument));
|
|
132
|
-
if (commandIndex === -1 || argv[commandIndex] !== 'bd')
|
|
133
|
-
return false;
|
|
134
|
-
return BEADS_MUTATIONS.has(argv[commandIndex + 1] ?? '');
|
|
135
|
-
}
|
|
136
|
-
function shellCommandSegments(command) {
|
|
137
|
-
const segments = [];
|
|
138
|
-
let argv = [];
|
|
139
|
-
let token = '';
|
|
140
|
-
let tokenStarted = false;
|
|
141
|
-
let quote;
|
|
142
|
-
const finishToken = () => {
|
|
143
|
-
if (!tokenStarted)
|
|
144
|
-
return;
|
|
145
|
-
argv.push(token);
|
|
146
|
-
token = '';
|
|
147
|
-
tokenStarted = false;
|
|
148
|
-
};
|
|
149
|
-
const finishSegment = () => {
|
|
150
|
-
finishToken();
|
|
151
|
-
if (argv.length > 0)
|
|
152
|
-
segments.push(argv);
|
|
153
|
-
argv = [];
|
|
154
|
-
};
|
|
155
|
-
for (let index = 0; index < command.length; index += 1) {
|
|
156
|
-
const character = command[index];
|
|
157
|
-
if (quote !== undefined) {
|
|
158
|
-
if (character === quote) {
|
|
159
|
-
quote = undefined;
|
|
160
|
-
}
|
|
161
|
-
else if (character === '\\' && quote !== "'" && index + 1 < command.length) {
|
|
162
|
-
token += command[index + 1];
|
|
163
|
-
index += 1;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
token += character;
|
|
167
|
-
}
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
if (character === "'" || character === '"' || character === '`') {
|
|
171
|
-
quote = character;
|
|
172
|
-
tokenStarted = true;
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
if (character === '\\' && index + 1 < command.length) {
|
|
176
|
-
token += command[index + 1];
|
|
177
|
-
tokenStarted = true;
|
|
178
|
-
index += 1;
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
if (character === '#' && !tokenStarted) {
|
|
182
|
-
while (index + 1 < command.length && command[index + 1] !== '\n')
|
|
183
|
-
index += 1;
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
if (character === ';' || character === '&' || character === '|' || character === '\n') {
|
|
187
|
-
finishSegment();
|
|
188
|
-
if ((character === '&' || character === '|') && command[index + 1] === character)
|
|
189
|
-
index += 1;
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
if (/\s/.test(character)) {
|
|
193
|
-
finishToken();
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
token += character;
|
|
197
|
-
tokenStarted = true;
|
|
198
|
-
}
|
|
199
|
-
finishSegment();
|
|
200
|
-
return segments;
|
|
201
|
-
}
|
|
202
|
-
function isRecord(value) {
|
|
203
|
-
return typeof value === 'object' && value !== null;
|
|
204
|
-
}
|
|
205
59
|
//# sourceMappingURL=state.js.map
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAkC3D,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAU,CAAC;AAEjE,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;AAEhF,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAChE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE;QACd,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,yEAAyE,EAAE,CAAC;AACvG,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAsC,EAAE;IACrE,OAAO;QACL,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,CAAC;QACpB,iBAAiB,EAAE,IAAI;QACvB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,IAAI;KAC3C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAsB;IAC9C,OAAO;QACL,GAAG,KAAK;QACR,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,IAAI;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,IAAqB;IAC1E,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAE1D,OAAO;QACL,GAAG,KAAK;QACR,eAAe,EAAE,CAAC,GAAG,KAAK,CAA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
2
|
"name": "@felan-ai/ext-prewalk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Same-session planner-to-implementation model handoff for Felan",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,11 +24,15 @@
|
|
|
24
24
|
"import": "./dist/index.js"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"typebox": "1.1.38"
|
|
29
|
+
},
|
|
27
30
|
"peerDependencies": {
|
|
28
|
-
"@felan-ai/agent-core": "^0.4.
|
|
31
|
+
"@felan-ai/agent-core": "^0.4.3",
|
|
32
|
+
"@felan-ai/ext-tasks": "^0.1.0"
|
|
29
33
|
},
|
|
30
34
|
"devDependencies": {
|
|
31
|
-
"@felan-ai/agent-core": "0.4.
|
|
35
|
+
"@felan-ai/agent-core": "0.4.9"
|
|
32
36
|
},
|
|
33
37
|
"publishConfig": {
|
|
34
38
|
"access": "public",
|