@nicknisi/pi-workflows 0.3.0 → 0.3.1

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.
@@ -100,16 +100,19 @@ const choice = await ask(`Recommended: ${advice.recommended} — ${advice.why}\n
100
100
  ...ordered.map((o) => `${o.id}: ${o.title} — ${o.gist}`),
101
101
  REJECT,
102
102
  ]);
103
- if (!choice || choice === REJECT) {
103
+ const picked = choice && choice !== REJECT ? ordered.find((o) => choice.startsWith(`${o.id}:`)) : undefined;
104
+ if (!picked) {
105
+ // Dismissed, reject-all, or off-list custom text — never silently decide
106
+ // for the human; hand the outcome (and any custom answer) back to re-mine.
104
107
  return {
105
108
  decided: false,
109
+ ...(choice && choice !== REJECT ? { custom: choice } : {}),
106
110
  options: advice.options,
107
111
  recommended: advice.recommended,
108
112
  why: advice.why,
109
113
  rejections: advice.rejections,
110
114
  };
111
115
  }
112
- const picked = ordered.find((o) => choice.startsWith(`${o.id}:`)) ?? ordered[0];
113
116
  log(`human picked: ${picked.id} ${picked.title}`);
114
117
 
115
118
  phase('plan');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicknisi/pi-workflows",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Model-facing front door to the first-party workflow engine — run JS workflow scripts over the subagent runtime, replacing the third-party @quintinshaw/pi-dynamic-workflows extension",
5
5
  "keywords": [
6
6
  "pi",
@@ -25,5 +25,6 @@ If `workflow` `list` shows no `autoplan`, install it first: copy `examples/autop
25
25
 
26
26
  - `decided: false` — the user rejected every option or dismissed the gate. Present the options and
27
27
  the advisor's recommendation; offer to re-mine with new constraints or a proposed new option.
28
- Never write a plan for an undecided run.
28
+ When the result carries `custom`, the user typed an off-list answer — treat it as their proposed
29
+ direction and offer to re-mine around it. Never write a plan for an undecided run.
29
30
  - `decided: true` — present `choice` and the `plan`. Elaborate sections on request.