@felan-ai/ext-prewalk 0.3.2 → 0.3.4

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 CHANGED
@@ -1,15 +1,17 @@
1
1
  # @felan-ai/ext-prewalk
2
2
 
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.
3
+ Same-session Prewalk for Felan's complex repository work: 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 complex repository work that benefits from substantial exploration, coordinated multi-file changes, dependency-aware planning, or broad verification, the model can enter Prewalk itself by calling `enter_prewalk` before it explores or mutates the repository. Small localized edits and routine one-file fixes should normally stay on the regular path. `/prewalk` remains available when the user wants to enter explicitly. Read-only requests do not use Prewalk.
8
+
7
9
  ## Requirements
8
10
 
9
11
  - An authenticated model in the configured target tier, or an authenticated exact target model
10
12
  - At least one explicit mutation tool: Pi's `edit` or `write`, or the Codex extension's `apply_patch`
11
13
 
12
- 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
+ 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. When both `TaskCreate` and `TaskUpdate` are active, handoff also waits for successful task creation and an in-progress task claim; if those tools are unavailable, mutation-only handoff remains available. Prewalk does not inspect `TaskList`, `TaskGet`, todo, or Beads activity.
13
15
 
14
16
  ## Commands
15
17
 
@@ -17,27 +19,53 @@ Prewalk refuses to arm when no explicit mutation tool is active. Shell tools suc
17
19
  /prewalk <task> Arm Prewalk and start the task immediately
18
20
  /prewalk Arm Prewalk for the next ordinary prompt
19
21
  /prewalk status Show the phase, target model, and restoration setting
20
- /prewalk off Cancel Prewalk
22
+ /prewalk exit Exit Prewalk
23
+ /prewalk off Alias for exit
24
+ /prewalk cancel Alias for exit
21
25
  ```
22
26
 
23
- `status` and `off` 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. Turning Prewalk off after handoff restores the original planner when restoration is enabled. A manual model selection cancels Prewalk and keeps the model selected by the user.
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 complex repository work
33
+ ```
34
+
35
+ The no-argument tool transitions the current run directly into planning, so it works while the agent is active. Use it for complex repository work rather than small localized edits or routine one-file fixes. 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. Current phase guidance is transient and replaced at the phase boundary, so the target receives the useful exploration, task graph, and first valid change with implementation guidance rather than an instruction to keep planning.
24
38
 
25
39
  ## Lifecycle
26
40
 
27
41
  1. The planner explores the relevant repository surface and determines the complete implementation scope.
28
- 2. The planner creates outcome-oriented implementation and validation tasks with `TaskCreate`, links them with `blocked_by` dependencies that encode the execution order, and claims the first ready task with `TaskUpdate`.
29
- 3. The planner performs one focused successful `edit`, `write`, or `apply_patch`.
42
+ 2. When the task tools are available, 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. When both task tools are active, successful `TaskCreate` and `TaskUpdate`
44
+ calls claiming `in_progress` work open the task gate. The planner then
45
+ performs one focused successful `edit`, `write`, or `apply_patch`.
30
46
  4. At that turn boundary, Felan resolves and switches to the configured target tier or exact model.
31
47
  5. The target model completes the existing session task graph and runs the relevant verification.
32
48
  6. Once the agent run has fully settled, Felan restores the planner model and thinking level.
33
49
 
34
- 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.
50
+ When both task tools are active, successful `TaskCreate` and `TaskUpdate` calls claiming `in_progress` work are required before a successful mutation qualifies the turn for handoff. Failed or unrelated task calls do not open that gate. If the task tools are unavailable, a successful explicit mutation qualifies directly. Failed mutation calls never qualify. If the planner stops after prose or partial tool progress, Prewalk can append a compact hidden continuation that directs the next tool action without repeating the full planning instructions. It sends at most one continuation per no-progress stretch and three per run.
35
51
 
36
- 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.
52
+ The handoff does not fork, summarize, or replace the session. Planning and implementation guidance are transient context messages. Within a phase, the current guidance stays at one stable context position while assistant responses, tool results, and compact continuations append after it. At the phase boundary, Prewalk replaces that guidance once; after the run, it removes all Prewalk controls. User messages, assistant responses, task-tracking results, mutations, and verification results remain in one trajectory.
53
+
54
+ 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.
37
55
 
38
56
  The extension also registers concise static `prewalk` capability guidance
39
57
  during initialization. Phase-specific planning and implementation instructions
40
- remain transient context messages.
58
+ remain transient, stable-position context messages.
59
+
60
+ ## Thinking levels
61
+
62
+ 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.
63
+
64
+ 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.
65
+
66
+ ## Subagents
67
+
68
+ `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.
41
69
 
42
70
  ## Flags
43
71
 
@@ -49,17 +77,43 @@ Prewalk uses Pi's namespaced extension flags and does not read a configuration f
49
77
  --no-prewalk-restore-planner
50
78
  ```
51
79
 
52
- `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. `prewalk-restore-planner` defaults to `true`.
80
+ `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`.
53
81
 
54
82
  ## Failure behavior
55
83
 
56
84
  - A target tier with no authenticated candidate, or a missing exact target model or authentication, clears the handoff and keeps the existing trajectory.
85
+ - A target that already matches the active planner model clears Prewalk without performing a model handoff.
86
+ - An exact target outside a nonempty session model scope is rejected before switching.
57
87
  - A failed target-model switch clears Prewalk and reports the failure once.
58
88
  - A failed planner restoration clears Prewalk, reports the failure once, and keeps the current model.
59
89
  - A manual model change cancels Prewalk without restoring over the user's selection.
90
+ - Repeated entry calls do not replace the active run or its planner snapshot.
91
+ - Exit requests during active target inference restore only after the run settles.
60
92
  - Session quit, reload, replacement, or fork while the target is active attempts planner restoration as a graceful shutdown backstop.
61
93
  - Reaching the automatic continuation limit lets the run settle normally.
62
94
 
95
+ ## Attribution
96
+
97
+ This package adapts the MIT-licensed `packages/pi-prewalk` implementation from `mslavov/pi-extensions` at commit `7e72e509fe45a5a87c4c2e176cb711de994a8c1d`. See [NOTICE](./NOTICE) and [LICENSE](./LICENSE).
98
+
99
+ ## Composition and package boundary
100
+
101
+ ```ts
102
+ import prewalkExtension from '@felan-ai/ext-prewalk';
103
+
104
+ const extension = prewalkExtension;
105
+ ```
106
+
107
+ The extension owns the same-session state machine, explicit mutation
108
+ qualification, stable-position transient planning/implementation guidance,
109
+ target selection, and restoration lifecycle. Agent Core supplies model tiers and the host supplies
110
+ authenticated model scope, session lifecycle, and active tools. Prewalk does not
111
+ inspect or execute the task graph beyond the successful TaskCreate/TaskUpdate
112
+ handoff gate described above, and it is not a sandbox or approval mode.
113
+
114
+ The package requires compatible Agent Core and Tasks peers plus an explicit
115
+ `edit`, `write`, or Codex `apply_patch` tool in the composed session.
116
+
63
117
  ## Development
64
118
 
65
119
  Source: `packages/ext-prewalk` in <https://github.com/felan-ai/felan>.
@@ -68,9 +122,12 @@ Source: `packages/ext-prewalk` in <https://github.com/felan-ai/felan>.
68
122
  corepack enable
69
123
  pnpm install --frozen-lockfile
70
124
  pnpm --filter @felan-ai/ext-prewalk build
125
+ pnpm --filter @felan-ai/ext-prewalk type-check
71
126
  pnpm --filter @felan-ai/ext-prewalk test
72
127
  ```
73
128
 
74
- ## Attribution
129
+ ## Related documentation
75
130
 
76
- This package adapts the MIT-licensed `packages/pi-prewalk` implementation from `mslavov/pi-extensions` at commit `7e72e509fe45a5a87c4c2e176cb711de994a8c1d`. See [NOTICE](./NOTICE) and [LICENSE](./LICENSE).
131
+ - [Agents, tasks, and Prewalk](../../docs/user-guide/agents-tasks-and-prewalk.md)
132
+ - [Architecture](../../docs/concepts/architecture.md)
133
+ - [Extension catalog](../../docs/reference/extension-catalog.md)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AA8C9B,QAAA,MAAM,gBAAgB,EAAE,cAuWvB,CAAC;AAmFF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAsE9B,QAAA,MAAM,gBAAgB,EAAE,cAkfvB,CAAC;AAoNF,eAAe,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { formatModelReference, isModelTier, parseModelReference, selectModelForTier, } from '@felan-ai/agent-core';
2
- import { CONTINUATION_MESSAGE_TYPE, CONTROL_MESSAGE_PREFIX, IMPLEMENTATION_MESSAGE_TYPE, PLANNING_INSTRUCTION, PLANNING_MESSAGE_TYPE, VERIFICATION_INSTRUCTION, } from './prompts.js';
2
+ import { Type } from 'typebox';
3
+ import { CONTINUATION_INSTRUCTION, CONTINUATION_MESSAGE_TYPE, CONTROL_MESSAGE_PREFIX, IMPLEMENTATION_MESSAGE_TYPE, PLANNING_INSTRUCTION, PLANNING_MESSAGE_TYPE, VERIFICATION_INSTRUCTION, } from './prompts.js';
3
4
  import { beginTurn, createRunState, recordToolCall, reduceTurn, validateArmingTools, } from './state.js';
4
5
  const DEFAULT_CONFIG = {
5
6
  targetModel: 'low',
@@ -8,10 +9,12 @@ const DEFAULT_CONFIG = {
8
9
  const TARGET_MODEL_FLAG = 'prewalk-target-model';
9
10
  const RESTORE_PLANNER_FLAG = 'prewalk-restore-planner';
10
11
  const HEADLESS_TASK_MESSAGE_TYPE = 'pi-prewalk-task';
12
+ const ENTER_PREWALK_TOOL = 'enter_prewalk';
13
+ const EnterPrewalkParams = Type.Object({}, { additionalProperties: false });
11
14
  const prewalkExtension = (pi) => {
12
15
  pi.registerCapability({
13
16
  id: 'prewalk',
14
- instructions: 'Prewalk can coordinate a same-session planning-to-implementation handoff when the user invokes /prewalk. During an active run, follow the phase-specific planning, task-tracking, implementation, and verification guidance injected into the conversation.',
17
+ instructions: 'Use Prewalk for complex repository work that benefits from substantial exploration, coordinated multi-file changes, dependency-aware planning, or broad verification. Do not use it for small localized edits, routine one-file fixes, read-only requests, or when injected planning or implementation guidance is already present. When a complex file-changing task begins without that guidance, call enter_prewalk as the first and only tool call before repository exploration or mutation. 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).',
15
18
  });
16
19
  pi.registerFlag(TARGET_MODEL_FLAG, {
17
20
  description: 'Model tier or exact provider/model-id used to implement a planned Prewalk task',
@@ -29,7 +32,11 @@ const prewalkExtension = (pi) => {
29
32
  let configWarningShown = false;
30
33
  let state = { phase: 'idle' };
31
34
  let plannerSnapshot;
32
- let expectedModelKey;
35
+ let exitRequested = false;
36
+ let modelTransition;
37
+ let handoffPromise;
38
+ let restorationPromise;
39
+ let phaseContextAnchor;
33
40
  function refreshConfig() {
34
41
  loadedConfig = loadConfig(pi);
35
42
  config = loadedConfig.config;
@@ -58,17 +65,20 @@ const prewalkExtension = (pi) => {
58
65
  const continuationText = state.phase === 'planning' && continuationCount > 0
59
66
  ? ` · ${continuationCount}/3`
60
67
  : '';
61
- ctx.ui.setStatus('prewalk', `Prewalk ${state.phase}${continuationText} ${targetModel.key}`);
68
+ const exitText = exitRequested ? ' · exit pending' : '';
69
+ ctx.ui.setStatus('prewalk', `Prewalk ${state.phase}${continuationText}${exitText}`);
62
70
  }
63
71
  function publishStatus(ctx) {
64
72
  publishConfigWarning(ctx);
65
73
  const planner = plannerSnapshot ? ` | planner ${plannerSnapshot.modelKey}` : '';
66
- notify(ctx, `Prewalk: ${state.phase} | target ${targetModel.key} | restore planner ${config.restorePlanner ? 'on' : 'off'}${planner}`);
74
+ const exit = exitRequested ? ' | exit pending' : '';
75
+ notify(ctx, `Prewalk: ${state.phase} | target ${targetModel.key} | restore planner ${config.restorePlanner ? 'on' : 'off'}${planner}${exit}`);
67
76
  }
68
77
  function clearAutomation(ctx) {
69
78
  state = { phase: 'idle' };
70
79
  plannerSnapshot = undefined;
71
- expectedModelKey = undefined;
80
+ phaseContextAnchor = undefined;
81
+ exitRequested = false;
72
82
  updateStatus(ctx);
73
83
  }
74
84
  function failAutomation(ctx, message) {
@@ -92,23 +102,36 @@ const prewalkExtension = (pi) => {
92
102
  }
93
103
  state = { phase: 'armed' };
94
104
  updateStatus(ctx);
95
- notify(ctx, `Prewalk armed. The next task will plan, make one mutation, then hand off to ${targetModel.key}.`);
105
+ notify(ctx, `Prewalk armed. The next task will plan, initialize Tasks when both task tools are active, make one mutation, then hand off to ${targetModel.key}.`);
96
106
  return true;
97
107
  }
98
- function beginRun(ctx) {
99
- if (state.phase !== 'armed')
100
- return;
108
+ function startRun(ctx, handoffArmed = true) {
101
109
  if (!ctx.model) {
102
110
  failAutomation(ctx, 'Prewalk requires a selected planner model.');
103
- return;
111
+ return false;
104
112
  }
105
113
  plannerSnapshot = {
106
114
  model: ctx.model,
107
115
  modelKey: modelKey(ctx.model),
108
116
  thinkingLevel: pi.getThinkingLevel(),
109
117
  };
110
- state = { phase: 'planning', run: createRunState() };
118
+ phaseContextAnchor = undefined;
119
+ exitRequested = false;
120
+ const activeTools = pi.getActiveTools();
121
+ state = {
122
+ phase: 'planning',
123
+ run: createRunState({
124
+ handoffArmed,
125
+ taskGateRequired: activeTools.includes('TaskCreate') && activeTools.includes('TaskUpdate'),
126
+ }),
127
+ };
111
128
  updateStatus(ctx);
129
+ return true;
130
+ }
131
+ function beginRun(ctx) {
132
+ if (state.phase !== 'armed')
133
+ return;
134
+ startRun(ctx);
112
135
  }
113
136
  async function switchToTarget(ctx) {
114
137
  if (state.phase !== 'planning' || !state.run || !plannerSnapshot)
@@ -116,6 +139,7 @@ const prewalkExtension = (pi) => {
116
139
  const run = state.run;
117
140
  const snapshot = plannerSnapshot;
118
141
  state = { phase: 'handoff', run };
142
+ phaseContextAnchor = undefined;
119
143
  updateStatus(ctx);
120
144
  let target;
121
145
  if (targetModel.kind === 'tier') {
@@ -132,21 +156,31 @@ const prewalkExtension = (pi) => {
132
156
  target = selected.model;
133
157
  }
134
158
  else {
135
- const exactTarget = ctx.modelRegistry.find(targetModel.model.provider, targetModel.model.id);
136
- if (!exactTarget) {
159
+ const exactReference = targetModel.model;
160
+ const registeredTarget = ctx.modelRegistry.find(exactReference.provider, exactReference.id);
161
+ if (!registeredTarget) {
137
162
  failAutomation(ctx, `Prewalk target model is unavailable: ${targetModel.key}.`);
138
163
  return;
139
164
  }
140
- if (!ctx.modelRegistry.hasConfiguredAuth(exactTarget)) {
165
+ const scopedTarget = ctx.scopedModels.find(({ model }) => (model.provider === exactReference.provider && model.id === exactReference.id))?.model;
166
+ if (ctx.scopedModels.length > 0 && !scopedTarget) {
167
+ failAutomation(ctx, `Prewalk target model is outside the current session model scope: ${targetModel.key}.`);
168
+ return;
169
+ }
170
+ target = scopedTarget ?? registeredTarget;
171
+ if (!ctx.modelRegistry.hasConfiguredAuth(target)) {
141
172
  failAutomation(ctx, `Prewalk target model is not authenticated: ${targetModel.key}.`);
142
173
  return;
143
174
  }
144
- target = exactTarget;
145
175
  }
146
176
  const targetKey = formatModelReference(target);
177
+ if (sameModel(ctx.model, target)) {
178
+ clearAutomation(ctx);
179
+ notify(ctx, `Prewalk target ${targetKey} already matches the planner model; continuing without a model handoff.`);
180
+ return;
181
+ }
147
182
  try {
148
- expectedModelKey = targetKey;
149
- const switched = await pi.setModel(target);
183
+ const switched = await setModelPreservingExternalSelection(target, ctx);
150
184
  if (state.phase !== 'handoff' || plannerSnapshot !== snapshot)
151
185
  return;
152
186
  if (!switched) {
@@ -162,12 +196,20 @@ const prewalkExtension = (pi) => {
162
196
  failAutomation(ctx, `Prewalk could not switch to ${targetKey}: ${errorMessage(error)}`);
163
197
  }
164
198
  }
165
- finally {
166
- if (expectedModelKey === targetKey)
167
- expectedModelKey = undefined;
168
- }
169
199
  }
170
- async function restorePlanner(ctx) {
200
+ function restorePlanner(ctx) {
201
+ if (restorationPromise)
202
+ return restorationPromise;
203
+ const restoration = performPlannerRestoration(ctx).finally(() => {
204
+ if (restorationPromise === restoration)
205
+ restorationPromise = undefined;
206
+ });
207
+ restorationPromise = restoration;
208
+ return restoration;
209
+ }
210
+ async function performPlannerRestoration(ctx) {
211
+ if (handoffPromise)
212
+ await handoffPromise;
171
213
  const snapshot = plannerSnapshot;
172
214
  if (!snapshot) {
173
215
  clearAutomation(ctx);
@@ -177,8 +219,7 @@ const prewalkExtension = (pi) => {
177
219
  updateStatus(ctx);
178
220
  try {
179
221
  if (modelKey(ctx.model) !== snapshot.modelKey) {
180
- expectedModelKey = snapshot.modelKey;
181
- const restored = await pi.setModel(snapshot.model);
222
+ const restored = await setModelPreservingExternalSelection(snapshot.model, ctx);
182
223
  if (state.phase !== 'restoring' || plannerSnapshot !== snapshot)
183
224
  return false;
184
225
  if (!restored)
@@ -197,9 +238,40 @@ const prewalkExtension = (pi) => {
197
238
  }
198
239
  return false;
199
240
  }
241
+ }
242
+ async function setModelPreservingExternalSelection(model, ctx) {
243
+ if (modelTransition)
244
+ throw new Error('another Prewalk model transition is already active');
245
+ const transition = { expectedModelKey: modelKey(model) };
246
+ modelTransition = transition;
247
+ try {
248
+ let switched;
249
+ try {
250
+ switched = await pi.setModel(model);
251
+ }
252
+ finally {
253
+ await reapplyExternalModel(ctx, transition);
254
+ }
255
+ return switched;
256
+ }
200
257
  finally {
201
- if (expectedModelKey === snapshot.modelKey)
202
- expectedModelKey = undefined;
258
+ if (modelTransition === transition)
259
+ modelTransition = undefined;
260
+ }
261
+ }
262
+ async function reapplyExternalModel(ctx, transition) {
263
+ while (transition.externalModel
264
+ && modelKey(ctx.model) !== modelKey(transition.externalModel)) {
265
+ const externalModel = transition.externalModel;
266
+ transition.expectedModelKey = modelKey(externalModel);
267
+ const restored = await pi.setModel(externalModel);
268
+ if (!restored)
269
+ throw new Error(`could not retain manual model ${modelKey(externalModel)}`);
270
+ }
271
+ if (transition.externalModel
272
+ && transition.externalThinkingLevel !== undefined
273
+ && modelKey(ctx.model) === modelKey(transition.externalModel)) {
274
+ pi.setThinkingLevel(transition.externalThinkingLevel);
203
275
  }
204
276
  }
205
277
  async function turnOff(ctx) {
@@ -207,10 +279,26 @@ const prewalkExtension = (pi) => {
207
279
  notify(ctx, 'Prewalk is already off.');
208
280
  return;
209
281
  }
282
+ if (state.phase === 'restoring') {
283
+ const restored = await restorePlanner(ctx);
284
+ if (restored)
285
+ notify(ctx, 'Prewalk is off and the planner model has been restored.');
286
+ return;
287
+ }
210
288
  const targetIsActive = state.phase === 'handoff'
211
- || state.phase === 'implementing'
212
- || state.phase === 'restoring';
289
+ || state.phase === 'implementing';
213
290
  if (targetIsActive && config.restorePlanner && plannerSnapshot) {
291
+ if (state.phase === 'handoff' || !ctx.isIdle()) {
292
+ if (!exitRequested) {
293
+ exitRequested = true;
294
+ updateStatus(ctx);
295
+ notify(ctx, 'Prewalk will exit and restore the planner when the current agent run settles.');
296
+ }
297
+ else {
298
+ notify(ctx, 'Prewalk exit is already pending.');
299
+ }
300
+ return;
301
+ }
214
302
  const restored = await restorePlanner(ctx);
215
303
  if (restored)
216
304
  notify(ctx, 'Prewalk is off and the planner model has been restored.');
@@ -219,8 +307,37 @@ const prewalkExtension = (pi) => {
219
307
  clearAutomation(ctx);
220
308
  notify(ctx, 'Prewalk is off.');
221
309
  }
310
+ pi.registerTool({
311
+ name: ENTER_PREWALK_TOOL,
312
+ label: 'Enter Prewalk',
313
+ description: 'Enter same-session Prewalk for a complex repository task that requires substantial exploration, coordinated multi-file changes, dependency-aware planning, or broad verification. Do not call it for small localized edits, routine one-file fixes, read-only work, or when injected guidance already directs planning or implementation. Call this once, as the only tool call in the response and before exploration or mutation.',
314
+ promptSnippet: 'Enter Prewalk for complex repository work before exploration',
315
+ executionMode: 'sequential',
316
+ parameters: EnterPrewalkParams,
317
+ async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
318
+ if (state.phase === 'idle')
319
+ refreshConfig();
320
+ publishConfigWarning(ctx);
321
+ if (state.phase !== 'idle') {
322
+ return prewalkToolError(`Prewalk is already ${state.phase}; continue the active run without calling ${ENTER_PREWALK_TOOL} again.`, state.phase);
323
+ }
324
+ const validation = validateArmingTools(pi.getActiveTools());
325
+ if (!validation.ok)
326
+ return prewalkToolError(validation.reason, state.phase);
327
+ if (!ctx.model)
328
+ return prewalkToolError('Prewalk requires a selected planner model.', state.phase);
329
+ startRun(ctx, false);
330
+ return {
331
+ content: [{
332
+ type: 'text',
333
+ text: `Prewalk entered for the current task. Follow the injected planning guidance, initialize Tasks when both task tools are active, keep the task graph concise, and make one focused mutation before the handoff to ${targetModel.key}.`,
334
+ }],
335
+ details: { phase: 'planning', targetModel: targetModel.key },
336
+ };
337
+ },
338
+ });
222
339
  pi.registerCommand('prewalk', {
223
- description: 'Plan with the current model, make one mutation, then hand off implementation',
340
+ description: 'Enter Prewalk, inspect status, or exit its model-routing lifecycle',
224
341
  handler: async (args, ctx) => {
225
342
  if (state.phase === 'idle')
226
343
  refreshConfig();
@@ -229,7 +346,7 @@ const prewalkExtension = (pi) => {
229
346
  publishStatus(ctx);
230
347
  return;
231
348
  }
232
- if (command === 'off') {
349
+ if (command === 'off' || command === 'exit' || command === 'cancel') {
233
350
  await turnOff(ctx);
234
351
  return;
235
352
  }
@@ -262,7 +379,9 @@ const prewalkExtension = (pi) => {
262
379
  beginRun(ctx);
263
380
  });
264
381
  pi.on('context', (event) => {
265
- return { messages: buildContextMessages(event.messages, state.phase) };
382
+ const result = buildContextMessages(event.messages, state.phase, phaseContextAnchor);
383
+ phaseContextAnchor = result.anchor;
384
+ return { messages: result.messages };
266
385
  });
267
386
  pi.on('turn_start', () => {
268
387
  if (state.phase !== 'planning' || !state.run)
@@ -274,7 +393,7 @@ const prewalkExtension = (pi) => {
274
393
  return;
275
394
  state = {
276
395
  phase: 'planning',
277
- run: recordToolCall(state.run, { toolCallId: event.toolCallId, toolName: event.toolName }),
396
+ run: recordToolCall(state.run, { toolCallId: event.toolCallId, toolName: event.toolName, input: event.input }),
278
397
  };
279
398
  });
280
399
  pi.on('turn_end', async (event, ctx) => {
@@ -286,25 +405,32 @@ const prewalkExtension = (pi) => {
286
405
  state = { phase: 'planning', run: decision.state };
287
406
  updateStatus(ctx);
288
407
  if (decision.shouldHandoff) {
289
- await switchToTarget(ctx);
408
+ const handoff = switchToTarget(ctx).finally(() => {
409
+ if (handoffPromise === handoff)
410
+ handoffPromise = undefined;
411
+ });
412
+ handoffPromise = handoff;
413
+ await handoff;
290
414
  return;
291
415
  }
292
416
  if (decision.shouldContinue) {
293
417
  pi.sendMessage({
294
418
  customType: CONTINUATION_MESSAGE_TYPE,
295
- content: '',
419
+ content: CONTINUATION_INSTRUCTION,
296
420
  display: false,
297
421
  }, { deliverAs: 'followUp' });
298
422
  }
299
423
  });
300
424
  pi.on('model_select', (event, ctx) => {
301
- if (state.phase === 'idle')
302
- return;
303
425
  const selectedModelKey = modelKey(event.model);
304
- if (expectedModelKey === selectedModelKey) {
305
- expectedModelKey = undefined;
426
+ if (modelTransition?.expectedModelKey === selectedModelKey)
306
427
  return;
428
+ if (modelTransition) {
429
+ modelTransition.externalModel = event.model;
430
+ modelTransition.externalThinkingLevel = pi.getThinkingLevel();
307
431
  }
432
+ if (state.phase === 'idle')
433
+ return;
308
434
  clearAutomation(ctx);
309
435
  notify(ctx, `Prewalk cancelled after the model changed to ${selectedModelKey}.`, 'warning');
310
436
  });
@@ -338,28 +464,78 @@ const prewalkExtension = (pi) => {
338
464
  }
339
465
  });
340
466
  };
341
- function buildContextMessages(messages, phase) {
342
- const filtered = structuredClone(messages).filter((message) => !isControlMessage(message));
343
- const instruction = phase === 'planning'
467
+ function buildContextMessages(messages, phase, currentAnchor) {
468
+ const successfulEntries = successfulEntryCallIds(messages);
469
+ const filtered = [];
470
+ for (const message of structuredClone(messages)) {
471
+ if (isControlMessage(message)) {
472
+ if (phase === 'planning' && isCurrentContinuationMessage(message))
473
+ filtered.push(message);
474
+ continue;
475
+ }
476
+ if (isSuccessfulEntryResult(message, successfulEntries))
477
+ continue;
478
+ const stripped = stripSuccessfulEntryCall(message, successfulEntries);
479
+ if (stripped !== undefined)
480
+ filtered.push(stripped);
481
+ }
482
+ const guidedPhase = phase === 'planning' || phase === 'implementing' ? phase : undefined;
483
+ const instruction = guidedPhase === 'planning'
344
484
  ? { customType: PLANNING_MESSAGE_TYPE, content: PLANNING_INSTRUCTION }
345
- : phase === 'implementing'
485
+ : guidedPhase === 'implementing'
346
486
  ? {
347
487
  customType: IMPLEMENTATION_MESSAGE_TYPE,
348
488
  content: VERIFICATION_INSTRUCTION,
349
489
  }
350
490
  : undefined;
351
- if (!instruction)
352
- return filtered;
353
- return [
354
- ...filtered,
355
- {
356
- role: 'custom',
357
- customType: instruction.customType,
358
- content: instruction.content,
359
- display: false,
360
- timestamp: Date.now(),
361
- },
362
- ];
491
+ if (guidedPhase === undefined || instruction === undefined)
492
+ return { messages: filtered };
493
+ const { anchor, index } = resolvePhaseContextAnchor(filtered, guidedPhase, currentAnchor);
494
+ const phaseMessage = {
495
+ role: 'custom',
496
+ customType: instruction.customType,
497
+ content: instruction.content,
498
+ display: false,
499
+ timestamp: anchor.instructionTimestamp,
500
+ };
501
+ return {
502
+ messages: [...filtered.slice(0, index), phaseMessage, ...filtered.slice(index)],
503
+ anchor,
504
+ };
505
+ }
506
+ function resolvePhaseContextAnchor(messages, phase, currentAnchor) {
507
+ if (currentAnchor?.phase === phase) {
508
+ if (currentAnchor.afterKey !== undefined) {
509
+ const anchoredIndex = messages.findIndex((message) => contextMessageKey(message) === currentAnchor.afterKey);
510
+ if (anchoredIndex >= 0)
511
+ return { anchor: currentAnchor, index: anchoredIndex + 1 };
512
+ }
513
+ else if (currentAnchor.fallbackIndex <= messages.length) {
514
+ return { anchor: currentAnchor, index: currentAnchor.fallbackIndex };
515
+ }
516
+ }
517
+ const fallbackIndex = messages.length;
518
+ const afterKey = fallbackIndex > 0 ? contextMessageKey(messages[fallbackIndex - 1]) : undefined;
519
+ const anchor = {
520
+ phase,
521
+ fallbackIndex,
522
+ instructionTimestamp: Date.now(),
523
+ ...(afterKey === undefined ? {} : { afterKey }),
524
+ };
525
+ return { anchor, index: fallbackIndex };
526
+ }
527
+ function contextMessageKey(message) {
528
+ if (!isRecord(message) || typeof message.role !== 'string')
529
+ return undefined;
530
+ const timestamp = message.timestamp;
531
+ if (typeof timestamp !== 'number' && typeof timestamp !== 'string')
532
+ return undefined;
533
+ return JSON.stringify([
534
+ message.role,
535
+ timestamp,
536
+ typeof message.toolCallId === 'string' ? message.toolCallId : '',
537
+ typeof message.customType === 'string' ? message.customType : '',
538
+ ]);
363
539
  }
364
540
  function isTextOnlyCompletion(message) {
365
541
  return isRecord(message)
@@ -374,9 +550,57 @@ function isControlMessage(message) {
374
550
  && typeof message.customType === 'string'
375
551
  && message.customType.startsWith(CONTROL_MESSAGE_PREFIX);
376
552
  }
553
+ function isCurrentContinuationMessage(message) {
554
+ return isRecord(message)
555
+ && message.role === 'custom'
556
+ && message.customType === CONTINUATION_MESSAGE_TYPE
557
+ && message.content === CONTINUATION_INSTRUCTION;
558
+ }
559
+ function successfulEntryCallIds(messages) {
560
+ const callIds = new Set();
561
+ for (const message of messages) {
562
+ if (isRecord(message)
563
+ && message.role === 'toolResult'
564
+ && message.toolName === ENTER_PREWALK_TOOL
565
+ && message.isError !== true
566
+ && typeof message.toolCallId === 'string') {
567
+ callIds.add(message.toolCallId);
568
+ }
569
+ }
570
+ return callIds;
571
+ }
572
+ function isSuccessfulEntryResult(message, callIds) {
573
+ return isRecord(message)
574
+ && message.role === 'toolResult'
575
+ && message.toolName === ENTER_PREWALK_TOOL
576
+ && typeof message.toolCallId === 'string'
577
+ && callIds.has(message.toolCallId);
578
+ }
579
+ function stripSuccessfulEntryCall(message, callIds) {
580
+ if (!isRecord(message) || message.role !== 'assistant' || !Array.isArray(message.content)) {
581
+ return message;
582
+ }
583
+ const isEntryCall = (item) => (isRecord(item)
584
+ && item.type === 'toolCall'
585
+ && item.name === ENTER_PREWALK_TOOL
586
+ && typeof item.id === 'string'
587
+ && callIds.has(item.id));
588
+ if (!message.content.some(isEntryCall))
589
+ return message;
590
+ const hasOtherToolCalls = message.content.some((item) => (isRecord(item) && item.type === 'toolCall' && !isEntryCall(item)));
591
+ if (!hasOtherToolCalls)
592
+ return undefined;
593
+ const content = message.content.filter((item) => !isEntryCall(item));
594
+ return content.length === 0 ? undefined : { ...message, content };
595
+ }
377
596
  function modelKey(model) {
378
597
  return model ? `${model.provider}/${model.id}` : 'none';
379
598
  }
599
+ function sameModel(left, right) {
600
+ return left !== undefined
601
+ && left.provider.toLowerCase() === right.provider.toLowerCase()
602
+ && left.id.toLowerCase() === right.id.toLowerCase();
603
+ }
380
604
  function parseTargetModel(value) {
381
605
  const normalized = value.trim();
382
606
  if (isModelTier(normalized))
@@ -406,6 +630,13 @@ function invalidConfig(reason) {
406
630
  function errorMessage(error) {
407
631
  return error instanceof Error ? error.message : String(error);
408
632
  }
633
+ function prewalkToolError(message, phase) {
634
+ return {
635
+ content: [{ type: 'text', text: message }],
636
+ details: { error: message, phase },
637
+ isError: true,
638
+ };
639
+ }
409
640
  function isRecord(value) {
410
641
  return typeof value === 'object' && value !== null;
411
642
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,GAMnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,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,GAGpB,MAAM,YAAY,CAAC;AAqBpB,MAAM,cAAc,GAAkB;IACpC,WAAW,E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AAmB;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,6 +3,7 @@ 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. Use TaskCreate to record detailed, outcome-oriented implementation and validation tasks. Link them 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. 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.";
6
+ export declare const CONTINUATION_INSTRUCTION = "Continue from the existing findings and task progress without repeating prior analysis. Take the next required tool action and proceed toward the focused mutation.";
7
+ 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
8
  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.";
8
9
  //# sourceMappingURL=prompts.d.ts.map
@@ -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,w8BAS2F,CAAC;AAE7H,eAAO,MAAM,wBAAwB,iWAAiW,CAAC"}
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,wBAAwB,wKAAwK,CAAC;AAE9M,eAAO,MAAM,oBAAoB,+lCAS2F,CAAC;AAE7H,eAAO,MAAM,wBAAwB,iWAAiW,CAAC"}
package/dist/prompts.js CHANGED
@@ -3,14 +3,15 @@ export const PLANNING_MESSAGE_TYPE = `${CONTROL_MESSAGE_PREFIX}planning`;
3
3
  export const IMPLEMENTATION_MESSAGE_TYPE = `${CONTROL_MESSAGE_PREFIX}implementation`;
4
4
  export const CONTINUATION_MESSAGE_TYPE = `${CONTROL_MESSAGE_PREFIX}continuation`;
5
5
  export const MAX_AUTOMATIC_CONTINUATIONS = 3;
6
+ export const CONTINUATION_INSTRUCTION = `Continue from the existing findings and task progress without repeating prior analysis. Take the next required tool action and proceed toward the focused mutation.`;
6
7
  export const PLANNING_INSTRUCTION = `Explore the repository thoroughly and determine the complete work required for the user's request.
7
8
 
8
9
  Follow this order:
9
10
  1. Inspect the relevant source, tests, configuration, documentation, and constraints.
10
11
  2. Determine the full implementation scope, affected files and symbols, risks, and verification required.
11
- 3. Use TaskCreate to record detailed, outcome-oriented implementation and validation tasks. Link them with blocked_by dependencies that encode the required implementation and validation order, so the next ready task is unambiguous at each step.
12
+ 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
13
  4. Use TaskUpdate to claim the first ready task by setting it in_progress.
13
- 5. Start implementing immediately. Work through ready tasks in dependency order, keep task statuses current, record verified results when completing them, and continue until the request is complete.
14
+ 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.
14
15
 
15
16
  Keep the implementation focused on the requested scope and revise the task graph when repository evidence changes the plan.`;
16
17
  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.`;
@@ -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;;;;;;;;;4HASwF,CAAC;AAE7H,MAAM,CAAC,MAAM,wBAAwB,GAAG,8VAA8V,CAAC"}
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,wBAAwB,GAAG,qKAAqK,CAAC;AAE9M,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;4HASwF,CAAC;AAE7H,MAAM,CAAC,MAAM,wBAAwB,GAAG,8VAA8V,CAAC"}
package/dist/state.d.ts CHANGED
@@ -5,12 +5,20 @@ export interface PrewalkState {
5
5
  }
6
6
  export interface PrewalkRunState {
7
7
  mutationCallIds: string[];
8
+ taskCreateCallIds: string[];
9
+ taskClaimCallIds: string[];
10
+ taskCreateSucceeded: boolean;
11
+ taskClaimSucceeded: boolean;
12
+ taskGateRequired: boolean;
13
+ taskGraphReady: boolean;
8
14
  continuationCount: number;
9
15
  continuationArmed: boolean;
16
+ handoffArmed: boolean;
10
17
  }
11
18
  export interface ToolCallSummary {
12
19
  toolCallId: string;
13
20
  toolName: string;
21
+ input?: unknown;
14
22
  }
15
23
  export interface ToolResultSummary {
16
24
  toolCallId: string;
@@ -29,7 +37,10 @@ export type ValidationResult = {
29
37
  };
30
38
  export declare const MUTATION_TOOL_NAMES: ReadonlySet<string>;
31
39
  export declare function validateArmingTools(activeTools: readonly string[]): ValidationResult;
32
- export declare function createRunState(): PrewalkRunState;
40
+ export declare function createRunState(options?: {
41
+ handoffArmed?: boolean;
42
+ taskGateRequired?: boolean;
43
+ }): PrewalkRunState;
33
44
  export declare function beginTurn(state: PrewalkRunState): PrewalkRunState;
34
45
  export declare function recordToolCall(state: PrewalkRunState, call: ToolCallSummary): PrewalkRunState;
35
46
  export declare function reduceTurn(state: PrewalkRunState, results: readonly ToolResultSummary[], options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,GAAG,WAAW,CAAC;AAEpG,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,eAAe,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,cA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6
  ? { ok: true }
7
7
  : { ok: false, reason: 'Prewalk requires an active mutation tool (edit, write, or apply_patch).' };
8
8
  }
9
- export function createRunState() {
9
+ export function createRunState(options = {}) {
10
+ const taskGateRequired = options.taskGateRequired ?? false;
10
11
  return {
11
12
  mutationCallIds: [],
13
+ taskCreateCallIds: [],
14
+ taskClaimCallIds: [],
15
+ taskCreateSucceeded: false,
16
+ taskClaimSucceeded: false,
17
+ taskGateRequired,
18
+ taskGraphReady: !taskGateRequired,
12
19
  continuationCount: 0,
13
20
  continuationArmed: true,
21
+ handoffArmed: options.handoffArmed ?? true,
14
22
  };
15
23
  }
16
24
  export function beginTurn(state) {
17
25
  return {
18
26
  ...state,
19
27
  mutationCallIds: [],
28
+ taskCreateCallIds: [],
29
+ taskClaimCallIds: [],
30
+ handoffArmed: true,
20
31
  };
21
32
  }
22
33
  export function recordToolCall(state, call) {
23
- if (!MUTATION_TOOL_NAMES.has(call.toolName))
34
+ const isMutation = MUTATION_TOOL_NAMES.has(call.toolName);
35
+ const isTaskCreate = call.toolName === 'TaskCreate';
36
+ const isTaskClaim = call.toolName === 'TaskUpdate' && isInProgressClaim(call.input);
37
+ if (!isMutation && !isTaskCreate && !isTaskClaim)
24
38
  return state;
25
39
  return {
26
40
  ...state,
27
- mutationCallIds: [...state.mutationCallIds, call.toolCallId],
41
+ mutationCallIds: isMutation
42
+ ? [...state.mutationCallIds, call.toolCallId]
43
+ : state.mutationCallIds,
44
+ taskCreateCallIds: isTaskCreate
45
+ ? [...state.taskCreateCallIds, call.toolCallId]
46
+ : state.taskCreateCallIds,
47
+ taskClaimCallIds: isTaskClaim
48
+ ? [...state.taskClaimCallIds, call.toolCallId]
49
+ : state.taskClaimCallIds,
28
50
  };
29
51
  }
30
52
  export function reduceTurn(state, results, options = {}) {
31
53
  const successfulIds = new Set(results.filter((result) => !result.isError).map((result) => result.toolCallId));
32
- const shouldHandoff = state.mutationCallIds.some((toolCallId) => successfulIds.has(toolCallId));
54
+ const taskCreateSucceeded = state.taskCreateSucceeded
55
+ || hasSuccessfulCall(state.taskCreateCallIds, successfulIds);
56
+ const taskClaimSucceeded = state.taskClaimSucceeded
57
+ || hasSuccessfulCall(state.taskClaimCallIds, successfulIds);
58
+ const taskGraphReady = !state.taskGateRequired || (taskCreateSucceeded && taskClaimSucceeded);
59
+ const shouldHandoff = state.handoffArmed
60
+ && taskGraphReady
61
+ && state.mutationCallIds.some((toolCallId) => successfulIds.has(toolCallId));
33
62
  let continuationArmed = results.some((result) => !result.isError) || state.continuationArmed;
34
63
  let continuationCount = state.continuationCount;
35
64
  let shouldContinue = false;
@@ -45,11 +74,27 @@ export function reduceTurn(state, results, options = {}) {
45
74
  return {
46
75
  state: {
47
76
  mutationCallIds: [],
77
+ taskCreateCallIds: [],
78
+ taskClaimCallIds: [],
79
+ taskCreateSucceeded,
80
+ taskClaimSucceeded,
81
+ taskGateRequired: state.taskGateRequired,
82
+ taskGraphReady,
48
83
  continuationCount,
49
84
  continuationArmed,
85
+ handoffArmed: state.handoffArmed,
50
86
  },
51
87
  shouldHandoff,
52
88
  shouldContinue,
53
89
  };
54
90
  }
91
+ function hasSuccessfulCall(callIds, successfulIds) {
92
+ return callIds.some((callId) => successfulIds.has(callId));
93
+ }
94
+ function isInProgressClaim(input) {
95
+ return isRecord(input) && input.status === 'in_progress';
96
+ }
97
+ function isRecord(value) {
98
+ return typeof value === 'object' && value !== null;
99
+ }
55
100
  //# 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;AAiC3D,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,W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CAAC,iBAAiB,KAAK,KAAK;WACnC,OAAO,CAAC,MAAM,KAAK,CAAC;WACpB,iBAAiB;WACjB,iBAAiB,GAAG,2BAA2B,EAClD,CAAC;QACD,cAAc,GAAG,IAAI,CAAC;QACtB,iBAAiB,IAAI,CAAC,CAAC;QACvB,iBAAiB,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,OAAO;QACL,KAAK,EAAE;YACL,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,mBAAmB;YACnB,kBAAkB;YAClB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,cAAc;YACd,iBAAiB;YACjB,iBAAiB;YACjB,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC;QACD,aAAa;QACb,cAAc;KACf,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAA0B,EAAE,aAAkC;IACvF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,aAAa,CAAC;AAC3D,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felan-ai/ext-prewalk",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Same-session planner-to-implementation model handoff for Felan",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,12 +24,15 @@
24
24
  "import": "./dist/index.js"
25
25
  }
26
26
  },
27
+ "dependencies": {
28
+ "typebox": "1.1.38"
29
+ },
27
30
  "peerDependencies": {
28
31
  "@felan-ai/agent-core": "^0.4.3",
29
32
  "@felan-ai/ext-tasks": "^0.1.0"
30
33
  },
31
34
  "devDependencies": {
32
- "@felan-ai/agent-core": "0.4.3"
35
+ "@felan-ai/agent-core": "0.4.9"
33
36
  },
34
37
  "publishConfig": {
35
38
  "access": "public",