@narumitw/pi-plan-mode 0.57.0 → 0.57.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.
@@ -15,10 +15,9 @@ import {
15
15
  planModeSettingsPath,
16
16
  readPlanModeSettings,
17
17
  retentionLabel,
18
- safeImplementationText,
19
18
  toolPolicyLabel,
20
19
  updatePlanModeSettings
21
- } from "./chunk-YUFPCQVG.js";
20
+ } from "./chunk-57OBPS7P.js";
22
21
 
23
22
  // src/active-implementation-menu.ts
24
23
  import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
@@ -90,144 +89,28 @@ async function showActiveImplementationMenu(ctx, options) {
90
89
 
91
90
  // src/plan-action-menus.ts
92
91
  import { defineMenu as defineMenu2, runMenu as runMenu2 } from "@narumitw/pi-tui-kit";
93
-
94
- // src/implementation-options.ts
95
- function implementationModelLabel(model) {
96
- return model ? safeImplementationText(`${model.provider} / ${model.id}`) : "Use current";
97
- }
98
- function implementationSummary(preferences) {
99
- return `Model: ${implementationModelLabel(preferences.implementationModel)} \xB7 Thinking: ${preferences.implementationThinkingLevel && preferences.implementationThinkingLevel !== "inherit" ? preferences.implementationThinkingLevel : "Use normal behavior"}`;
100
- }
101
- function implementationSettingItems(preferences) {
102
- return [
103
- {
104
- id: "implementationModel",
105
- label: "Implementation model",
106
- currentValue: implementationModelLabel(preferences.implementationModel),
107
- description: "Select the model only when implementation starts; never switch back automatically.",
108
- action: "open-implementation-model"
109
- },
110
- {
111
- id: "implementationThinkingLevel",
112
- label: "Implementation thinking",
113
- currentValue: preferences.implementationThinkingLevel ?? "inherit",
114
- values: PLAN_MODE_THINKING_LEVELS,
115
- description: "inherit preserves normal behavior, including restoration of Plan thinking. Explicit levels apply after model selection and are clamped by Pi.",
116
- action: "set-implementation-thinking"
117
- }
118
- ];
119
- }
120
- function createImplementationModelPicker(ctx) {
121
- const models = ctx.scopedModels?.length ? ctx.scopedModels.map(({ model }) => model) : ctx.modelRegistry.getAvailable();
122
- const byId = new Map(
123
- models.map((model, index) => [
124
- `implementation-model:${index}`,
125
- { provider: model.provider, id: model.id }
126
- ])
127
- );
128
- return {
129
- selection(itemId) {
130
- return itemId === "implementation-current" ? null : byId.get(itemId);
131
- },
132
- screen(preferences) {
133
- return {
134
- kind: "choice",
135
- title: "Implementation model",
136
- enableSearch: true,
137
- viewportSize: 10,
138
- hint: "back",
139
- action: "set-implementation-model",
140
- lines: [
141
- "Use current makes no model change. Reopen this menu to refresh the catalogue.",
142
- "Implement here sends the planning conversation to the selected provider; fresh transfers only the approved plan and normal destination resources.",
143
- `Selected: ${implementationModelLabel(preferences.implementationModel)}`
144
- ],
145
- items: [
146
- { id: "implementation-current", label: "Use current" },
147
- ...[...byId].map(([id, model]) => ({ id, label: implementationModelLabel(model) }))
148
- ]
149
- };
150
- }
151
- };
152
- }
153
- function createImplementationOptions(ctx, initial = {}) {
154
- let preferences = { ...initial };
155
- let picker;
156
- return {
157
- get: () => preferences,
158
- summary: () => implementationSummary(preferences),
159
- screens: {
160
- "implementation-options": () => ({
161
- kind: "settings",
162
- title: "Implementation options",
163
- lines: [
164
- "Applies to both implementation actions in this menu only.",
165
- "Changes take effect only when implementation starts. No automatic restoration afterwards.",
166
- `Current model: ${implementationModelLabel(ctx.model)}`,
167
- "inherit keeps normal thinking behavior, not necessarily the temporary Plan thinking level."
168
- ],
169
- items: implementationSettingItems(preferences)
170
- }),
171
- "implementation-model": () => {
172
- picker ??= createImplementationModelPicker(ctx);
173
- return picker.screen(preferences);
174
- }
175
- },
176
- actions: {
177
- "open-implementation-model": async () => ({
178
- kind: "to",
179
- screen: "implementation-model"
180
- }),
181
- "set-implementation-model": async ({ itemId }) => {
182
- const selected = picker?.selection(itemId);
183
- if (selected === void 0) return { kind: "rejected" };
184
- preferences = { ...preferences, implementationModel: selected ?? void 0 };
185
- return { kind: "back" };
186
- },
187
- "set-implementation-thinking": async ({ value }) => {
188
- const level = PLAN_MODE_THINKING_LEVELS.find((level2) => level2 === value);
189
- if (!level) return { kind: "rejected" };
190
- preferences = { ...preferences, implementationThinkingLevel: level };
191
- return { kind: "stay" };
192
- }
193
- }
194
- };
195
- }
196
-
197
- // src/plan-action-menus.ts
198
- function showPlanModeMenu(ctx, options) {
199
- return showActions(ctx, options, options);
200
- }
201
- function showReadyPlanMenu(ctx, options) {
202
- return showActions(ctx, options);
203
- }
204
- async function showActions(ctx, options, current) {
205
- const implementation = createImplementationOptions(ctx, options.implementationPreferences);
206
- const ready = current?.hasReadyPlan ?? true;
92
+ var IMPLEMENTATION_CONTEXT_LINES = [
93
+ "Implement here keeps this planning conversation.",
94
+ "Start fresh transfers only the approved plan to a new session."
95
+ ];
96
+ async function showPlanModeMenu(ctx, options) {
207
97
  const menu = defineMenu2({
208
98
  start: "main",
209
99
  screens: {
210
- ...implementation.screens,
211
100
  main: () => ({
212
101
  kind: "actions",
213
- title: current ? "Plan mode" : "Proposed plan ready. What next?",
102
+ title: "Plan mode",
214
103
  lines: [
215
- ...current ? [current.statusText] : [],
216
- ...ready ? [
217
- "Implement here keeps this planning conversation.",
218
- "Start fresh transfers only the approved plan to a new session.",
219
- options.implementationOutcome(),
220
- implementation.summary()
221
- ] : []
104
+ options.statusText,
105
+ ...options.hasReadyPlan ? [...IMPLEMENTATION_CONTEXT_LINES, options.implementationOutcome()] : []
222
106
  ],
223
- items: ready ? [
224
- ...current ? [{ id: "show", label: "Show latest proposed plan", action: "show" }] : [],
107
+ items: options.hasReadyPlan ? [
108
+ { id: "show", label: "Show latest proposed plan", action: "show" },
225
109
  {
226
110
  id: "implement-here",
227
111
  label: "Implement here",
228
112
  description: "Continue in this session with the planning conversation.",
229
- action: "implement-here",
230
- busyLabel: "Preparing implementation\u2026"
113
+ action: "implement-here"
231
114
  },
232
115
  {
233
116
  id: "implement-fresh",
@@ -236,11 +119,6 @@ async function showActions(ctx, options, current) {
236
119
  action: "implement-fresh",
237
120
  busyLabel: "Starting fresh implementation session\u2026"
238
121
  },
239
- {
240
- id: "implementation-options",
241
- label: "Implementation options\u2026",
242
- to: "implementation-options"
243
- },
244
122
  { id: "export", label: "Export plan\u2026", to: "export" },
245
123
  { id: "save", label: "Save for later", action: "save" },
246
124
  { id: "stay", label: "Stay in Plan mode", action: "stay" },
@@ -255,21 +133,81 @@ async function showActions(ctx, options, current) {
255
133
  export: () => planExportInputScreen(options.getExportDestination)
256
134
  },
257
135
  actions: {
258
- ...implementation.actions,
259
136
  show: async () => {
260
- current?.show();
137
+ options.show();
261
138
  return { kind: "close" };
262
139
  },
263
140
  finalize: async () => {
264
- current?.finalize();
141
+ options.finalize();
142
+ return { kind: "close" };
143
+ },
144
+ "implement-here": async () => {
145
+ await options.implementHere();
146
+ return { kind: "close" };
147
+ },
148
+ "implement-fresh": async ({ signal }) => {
149
+ await options.implementFresh(signal);
150
+ return { kind: "close" };
151
+ },
152
+ export: async ({ value, signal }) => await options.exportPlan(value ?? "", signal) ? { kind: "close" } : { kind: "rejected" },
153
+ save: async () => {
154
+ options.save();
265
155
  return { kind: "close" };
266
156
  },
267
- "implement-here": async ({ signal }) => {
268
- await options.implementHere(implementation.get(), signal);
157
+ stay: async () => {
158
+ options.stay();
159
+ return { kind: "close" };
160
+ },
161
+ exit: async () => {
162
+ options.exit();
163
+ return { kind: "close" };
164
+ }
165
+ }
166
+ });
167
+ await runMenu2(ctx, menu, {
168
+ getState: () => void 0,
169
+ signal: options.signal,
170
+ isCurrent: options.isCurrent
171
+ });
172
+ }
173
+ async function showReadyPlanMenu(ctx, options) {
174
+ const menu = defineMenu2({
175
+ start: "ready",
176
+ screens: {
177
+ ready: () => ({
178
+ kind: "actions",
179
+ title: "Proposed plan ready. What next?",
180
+ lines: [...IMPLEMENTATION_CONTEXT_LINES, options.implementationOutcome()],
181
+ items: [
182
+ {
183
+ id: "implement-here",
184
+ label: "Implement here",
185
+ description: "Continue in this session with the planning conversation.",
186
+ action: "implement-here"
187
+ },
188
+ {
189
+ id: "implement-fresh",
190
+ label: "Start fresh and implement",
191
+ description: "Open a new linked session; transfer only the approved plan.",
192
+ action: "implement-fresh",
193
+ busyLabel: "Starting fresh implementation session\u2026"
194
+ },
195
+ { id: "export", label: "Export plan\u2026", to: "export" },
196
+ { id: "save", label: "Save for later", action: "save" },
197
+ { id: "stay", label: "Stay in Plan mode", action: "stay" },
198
+ { id: "exit", label: "Discard plan and exit", action: "exit" }
199
+ ],
200
+ hint: "close"
201
+ }),
202
+ export: () => planExportInputScreen(options.getExportDestination)
203
+ },
204
+ actions: {
205
+ "implement-here": async () => {
206
+ await options.implementHere();
269
207
  return { kind: "close" };
270
208
  },
271
209
  "implement-fresh": async ({ signal }) => {
272
- await options.implementFresh(signal, implementation.get());
210
+ await options.implementFresh(signal);
273
211
  return { kind: "close" };
274
212
  },
275
213
  export: async ({ value, signal }) => await options.exportPlan(value ?? "", signal) ? { kind: "close" } : { kind: "rejected" },
@@ -408,11 +346,9 @@ async function showSavedPlanMenu(ctx, options) {
408
346
  `${options.statusText} Use /plan show, /plan implement, /plan export, or /plan exit.`
409
347
  );
410
348
  }
411
- const implementation = createImplementationOptions(ctx, options.implementationPreferences);
412
349
  const menu = defineMenu4({
413
350
  start: "saved",
414
351
  screens: {
415
- ...implementation.screens,
416
352
  saved: () => ({
417
353
  kind: "actions",
418
354
  title: "Saved plan",
@@ -420,8 +356,7 @@ async function showSavedPlanMenu(ctx, options) {
420
356
  options.statusText,
421
357
  "Implement here keeps this planning conversation.",
422
358
  "Start fresh transfers only the approved plan to a new session.",
423
- options.implementationOutcome(),
424
- implementation.summary()
359
+ options.implementationOutcome()
425
360
  ],
426
361
  items: [
427
362
  { id: "show", label: "Show saved plan", action: "show" },
@@ -438,11 +373,6 @@ async function showSavedPlanMenu(ctx, options) {
438
373
  action: "implement-fresh",
439
374
  busyLabel: "Starting fresh implementation session\u2026"
440
375
  },
441
- {
442
- id: "implementation-options",
443
- label: "Implementation options\u2026",
444
- to: "implementation-options"
445
- },
446
376
  { id: "export", label: "Export plan\u2026", to: "export" },
447
377
  { id: "settings", label: "Settings", action: "settings" },
448
378
  { id: "clear", label: "Clear saved plan", action: "clear" }
@@ -452,17 +382,16 @@ async function showSavedPlanMenu(ctx, options) {
452
382
  export: () => planExportInputScreen(options.getExportDestination)
453
383
  },
454
384
  actions: {
455
- ...implementation.actions,
456
385
  show: async () => {
457
386
  options.show();
458
387
  return { kind: "close" };
459
388
  },
460
- "implement-here": async ({ signal }) => {
461
- await options.implementHere(implementation.get(), signal);
389
+ "implement-here": async () => {
390
+ await options.implementHere();
462
391
  return { kind: "close" };
463
392
  },
464
393
  "implement-fresh": async ({ signal }) => {
465
- await options.implementFresh(signal, implementation.get());
394
+ await options.implementFresh(signal);
466
395
  return { kind: "close" };
467
396
  },
468
397
  export: async ({ value, signal }) => await options.exportPlan(value ?? "", signal) ? { kind: "close" } : { kind: "rejected" },
@@ -516,7 +445,6 @@ async function showPlanModeSettings(ctx, options) {
516
445
  notice: loaded.notice
517
446
  };
518
447
  };
519
- let implementationPicker;
520
448
  const menu = defineMenu5({
521
449
  start: "settings",
522
450
  screens: {
@@ -563,14 +491,9 @@ async function showPlanModeSettings(ctx, options) {
563
491
  description: "Set the global shortcut used to toggle Plan mode.",
564
492
  currentValue: configuredPlanModeToggleShortcut(state.settings) ?? "none",
565
493
  action: "open-shortcut"
566
- },
567
- ...implementationSettingItems(state.settings)
494
+ }
568
495
  ]
569
496
  },
570
- "implementation-model": ({ state }) => {
571
- implementationPicker ??= createImplementationModelPicker(ctx);
572
- return implementationPicker.screen(state.settings);
573
- },
574
497
  tools: ({ state }) => ({
575
498
  kind: "multiSelect",
576
499
  title: "Default Plan policy allowlist",
@@ -628,28 +551,6 @@ async function showPlanModeSettings(ctx, options) {
628
551
  })
629
552
  },
630
553
  actions: {
631
- "open-implementation-model": async () => ({ kind: "to", screen: "implementation-model" }),
632
- "set-implementation-model": async ({ ctx: actionCtx, itemId, signal }) => {
633
- const model = implementationPicker?.selection(itemId);
634
- if (model === void 0) return { kind: "rejected" };
635
- const result = await savePatch(
636
- actionCtx,
637
- { implementationModel: model },
638
- signal,
639
- "Implementation model saved. Applies when implementation starts."
640
- );
641
- return result.kind === "stay" ? { kind: "back" } : result;
642
- },
643
- "set-implementation-thinking": async ({ ctx: actionCtx, value, signal }) => {
644
- const level = PLAN_MODE_THINKING_LEVELS.find((level2) => level2 === value);
645
- if (!level) return { kind: "rejected" };
646
- return savePatch(
647
- actionCtx,
648
- { implementationThinkingLevel: level },
649
- signal,
650
- "Implementation thinking saved. Applies when implementation starts."
651
- );
652
- },
653
554
  "set-thinking": async ({ ctx: actionCtx, value, signal }) => {
654
555
  if (!PLAN_MODE_THINKING_LEVELS.includes(value)) {
655
556
  return { kind: "rejected" };
@@ -839,4 +740,4 @@ export {
839
740
  showReadyPlanMenu,
840
741
  showSavedPlanMenu
841
742
  };
842
- //# sourceMappingURL=interactive-ui-M3GEZN4M.js.map
743
+ //# sourceMappingURL=interactive-ui-N2ZKBVNE.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/active-implementation-menu.ts", "../../src/plan-export-screen.ts", "../../src/plan-action-menus.ts", "../../src/plan-launch-menu.ts", "../../src/saved-plan-menu.ts", "../../src/settings-menu.ts"],
4
+ "sourcesContent": ["import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { type PlanExportDestinationProvider, planExportInputScreen } from \"./plan-export-screen.js\";\n\ninterface ActiveImplementationMenuOptions {\n\tstatusText: string;\n\tgetExportDestination: PlanExportDestinationProvider;\n\tsignal: AbortSignal;\n\tisCurrent(): boolean;\n\tshow(): void;\n\texportPlan(path: string, signal: AbortSignal): Promise<boolean>;\n\tsettings(signal: AbortSignal): Promise<boolean>;\n\tstartNew(): void;\n\tclear(): void;\n}\n\nexport async function showActiveImplementationMenu(\n\tctx: ExtensionContext,\n\toptions: ActiveImplementationMenuOptions,\n) {\n\ttype Screen = \"active\" | \"export\";\n\ttype Action = \"show\" | \"export\" | \"settings\" | \"start-new\" | \"clear\";\n\tconst menu = defineMenu<undefined, Screen, Action, ExtensionContext>({\n\t\tstart: \"active\",\n\t\tscreens: {\n\t\t\tactive: () => ({\n\t\t\t\tkind: \"actions\",\n\t\t\t\ttitle: \"Active implementation plan\",\n\t\t\t\tlines: [options.statusText],\n\t\t\t\titems: [\n\t\t\t\t\t{ id: \"show\", label: \"Show active implementation plan\", action: \"show\" },\n\t\t\t\t\t{ id: \"export\", label: \"Export plan\u2026\", to: \"export\" },\n\t\t\t\t\t{ id: \"settings\", label: \"Settings\", action: \"settings\" },\n\t\t\t\t\t{ id: \"start-new\", label: \"Start a new plan\", action: \"start-new\" },\n\t\t\t\t\t{ id: \"clear\", label: \"Clear active implementation plan\", action: \"clear\" },\n\t\t\t\t],\n\t\t\t\thint: \"close\",\n\t\t\t}),\n\t\t\texport: () => planExportInputScreen(options.getExportDestination),\n\t\t},\n\t\tactions: {\n\t\t\tshow: async () => {\n\t\t\t\toptions.show();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texport: async ({ value, signal }) =>\n\t\t\t\t(await options.exportPlan(value ?? \"\", signal)) ? { kind: \"close\" } : { kind: \"rejected\" },\n\t\t\tsettings: async ({ signal }) => {\n\t\t\t\tconst close = await options.settings(signal);\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\treturn close ? { kind: \"close\" } : { kind: \"stay\" };\n\t\t\t},\n\t\t\t\"start-new\": async () => {\n\t\t\t\toptions.startNew();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\tclear: async () => {\n\t\t\t\toptions.clear();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t},\n\t});\n\tawait runMenu(ctx, menu, {\n\t\tgetState: () => undefined,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n}\n", "import type { PlanExportDestination } from \"./plan-export.js\";\n\nexport type PlanExportDestinationProvider = () => PlanExportDestination;\n\nexport function planExportInputScreen(getDestination: PlanExportDestinationProvider) {\n\tconst destination = getDestination();\n\treturn {\n\t\tkind: \"input\" as const,\n\t\ttitle: \"Export plan\",\n\t\tlines: [\n\t\t\t\"Existing paths are never overwritten.\",\n\t\t\t`Default: ${destination.configuredPath}`,\n\t\t\t`Resolves to: ${destination.resolvedPath}`,\n\t\t],\n\t\tplaceholder: destination.configuredPath,\n\t\taction: \"export\" as const,\n\t\thint: \"back\" as const,\n\t};\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { type PlanExportDestinationProvider, planExportInputScreen } from \"./plan-export-screen.js\";\n\ninterface MenuLifecycle {\n\tsignal: AbortSignal;\n\tisCurrent(): boolean;\n}\n\nconst IMPLEMENTATION_CONTEXT_LINES = [\n\t\"Implement here keeps this planning conversation.\",\n\t\"Start fresh transfers only the approved plan to a new session.\",\n] as const;\n\ninterface PlanMenuOptions extends MenuLifecycle {\n\tstatusText: string;\n\thasReadyPlan: boolean;\n\timplementationOutcome(): string;\n\tgetExportDestination: PlanExportDestinationProvider;\n\tshow(): void;\n\tfinalize(): void;\n\timplementHere(): void | Promise<void>;\n\timplementFresh(signal: AbortSignal): void | Promise<void>;\n\texportPlan(path: string, signal: AbortSignal): Promise<boolean>;\n\tsave(): void;\n\tstay(): void;\n\texit(): void;\n}\n\nexport async function showPlanModeMenu(ctx: ExtensionContext, options: PlanMenuOptions) {\n\ttype Screen = \"main\" | \"export\";\n\ttype Action =\n\t\t| \"show\"\n\t\t| \"finalize\"\n\t\t| \"implement-here\"\n\t\t| \"implement-fresh\"\n\t\t| \"export\"\n\t\t| \"save\"\n\t\t| \"stay\"\n\t\t| \"exit\";\n\tconst menu = defineMenu<undefined, Screen, Action, ExtensionContext>({\n\t\tstart: \"main\",\n\t\tscreens: {\n\t\t\tmain: () => ({\n\t\t\t\tkind: \"actions\",\n\t\t\t\ttitle: \"Plan mode\",\n\t\t\t\tlines: [\n\t\t\t\t\toptions.statusText,\n\t\t\t\t\t...(options.hasReadyPlan\n\t\t\t\t\t\t? [...IMPLEMENTATION_CONTEXT_LINES, options.implementationOutcome()]\n\t\t\t\t\t\t: []),\n\t\t\t\t],\n\t\t\t\titems: options.hasReadyPlan\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{ id: \"show\", label: \"Show latest proposed plan\", action: \"show\" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"implement-here\",\n\t\t\t\t\t\t\t\tlabel: \"Implement here\",\n\t\t\t\t\t\t\t\tdescription: \"Continue in this session with the planning conversation.\",\n\t\t\t\t\t\t\t\taction: \"implement-here\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"implement-fresh\",\n\t\t\t\t\t\t\t\tlabel: \"Start fresh and implement\",\n\t\t\t\t\t\t\t\tdescription: \"Open a new linked session; transfer only the approved plan.\",\n\t\t\t\t\t\t\t\taction: \"implement-fresh\",\n\t\t\t\t\t\t\t\tbusyLabel: \"Starting fresh implementation session\u2026\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ id: \"export\", label: \"Export plan\u2026\", to: \"export\" },\n\t\t\t\t\t\t\t{ id: \"save\", label: \"Save for later\", action: \"save\" },\n\t\t\t\t\t\t\t{ id: \"stay\", label: \"Stay in Plan mode\", action: \"stay\" },\n\t\t\t\t\t\t\t{ id: \"exit\", label: \"Discard plan and exit\", action: \"exit\" },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{ id: \"finalize\", label: \"Request final plan\", action: \"finalize\" },\n\t\t\t\t\t\t\t{ id: \"stay\", label: \"Stay in Plan mode\", action: \"stay\" },\n\t\t\t\t\t\t\t{ id: \"exit\", label: \"Exit Plan mode\", action: \"exit\" },\n\t\t\t\t\t\t],\n\t\t\t\thint: \"close\",\n\t\t\t}),\n\t\t\texport: () => planExportInputScreen(options.getExportDestination),\n\t\t},\n\t\tactions: {\n\t\t\tshow: async () => {\n\t\t\t\toptions.show();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\tfinalize: async () => {\n\t\t\t\toptions.finalize();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"implement-here\": async () => {\n\t\t\t\tawait options.implementHere();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"implement-fresh\": async ({ signal }) => {\n\t\t\t\tawait options.implementFresh(signal);\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texport: async ({ value, signal }) =>\n\t\t\t\t(await options.exportPlan(value ?? \"\", signal)) ? { kind: \"close\" } : { kind: \"rejected\" },\n\t\t\tsave: async () => {\n\t\t\t\toptions.save();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\tstay: async () => {\n\t\t\t\toptions.stay();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texit: async () => {\n\t\t\t\toptions.exit();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t},\n\t});\n\tawait runMenu(ctx, menu, {\n\t\tgetState: () => undefined,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n}\n\ninterface ReadyPlanMenuOptions extends MenuLifecycle {\n\timplementationOutcome(): string;\n\tgetExportDestination: PlanExportDestinationProvider;\n\timplementHere(): void | Promise<void>;\n\timplementFresh(signal: AbortSignal): void | Promise<void>;\n\texportPlan(path: string, signal: AbortSignal): Promise<boolean>;\n\tsave(): void;\n\tstay(): void;\n\texit(): void;\n}\n\nexport async function showReadyPlanMenu(ctx: ExtensionContext, options: ReadyPlanMenuOptions) {\n\ttype Screen = \"ready\" | \"export\";\n\ttype Action = \"implement-here\" | \"implement-fresh\" | \"export\" | \"save\" | \"stay\" | \"exit\";\n\tconst menu = defineMenu<undefined, Screen, Action, ExtensionContext>({\n\t\tstart: \"ready\",\n\t\tscreens: {\n\t\t\tready: () => ({\n\t\t\t\tkind: \"actions\",\n\t\t\t\ttitle: \"Proposed plan ready. What next?\",\n\t\t\t\tlines: [...IMPLEMENTATION_CONTEXT_LINES, options.implementationOutcome()],\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"implement-here\",\n\t\t\t\t\t\tlabel: \"Implement here\",\n\t\t\t\t\t\tdescription: \"Continue in this session with the planning conversation.\",\n\t\t\t\t\t\taction: \"implement-here\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"implement-fresh\",\n\t\t\t\t\t\tlabel: \"Start fresh and implement\",\n\t\t\t\t\t\tdescription: \"Open a new linked session; transfer only the approved plan.\",\n\t\t\t\t\t\taction: \"implement-fresh\",\n\t\t\t\t\t\tbusyLabel: \"Starting fresh implementation session\u2026\",\n\t\t\t\t\t},\n\t\t\t\t\t{ id: \"export\", label: \"Export plan\u2026\", to: \"export\" },\n\t\t\t\t\t{ id: \"save\", label: \"Save for later\", action: \"save\" },\n\t\t\t\t\t{ id: \"stay\", label: \"Stay in Plan mode\", action: \"stay\" },\n\t\t\t\t\t{ id: \"exit\", label: \"Discard plan and exit\", action: \"exit\" },\n\t\t\t\t],\n\t\t\t\thint: \"close\",\n\t\t\t}),\n\t\t\texport: () => planExportInputScreen(options.getExportDestination),\n\t\t},\n\t\tactions: {\n\t\t\t\"implement-here\": async () => {\n\t\t\t\tawait options.implementHere();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"implement-fresh\": async ({ signal }) => {\n\t\t\t\tawait options.implementFresh(signal);\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texport: async ({ value, signal }) =>\n\t\t\t\t(await options.exportPlan(value ?? \"\", signal)) ? { kind: \"close\" } : { kind: \"rejected\" },\n\t\t\tsave: async () => {\n\t\t\t\toptions.save();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\tstay: async () => {\n\t\t\t\toptions.stay();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texit: async () => {\n\t\t\t\toptions.exit();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t},\n\t});\n\tawait runMenu(ctx, menu, {\n\t\tgetState: () => undefined,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\n\nexport interface PlanLaunchTool {\n\tname: string;\n\tlabel?: string;\n\tdescription: string;\n\tsearchText: string;\n\tdisabled: boolean;\n\tdisabledReason?: string;\n}\n\ninterface PlanLaunchMenuOptions {\n\tstatusText: string;\n\ttoolSummary(selectedNames: ReadonlySet<string>): string;\n\tgetSelectedNames(): ReadonlySet<string>;\n\ttools: readonly PlanLaunchTool[];\n\tsignal: AbortSignal;\n\tisCurrent(): boolean;\n\tinitialScreen?: \"main\" | \"tools\";\n\tstart(signal: AbortSignal): void;\n\tstartWithTools(toolNames: string[], signal: AbortSignal): void;\n\tsettings(signal: AbortSignal): Promise<boolean>;\n}\n\nexport async function showPlanLaunchMenu(ctx: ExtensionContext, options: PlanLaunchMenuOptions) {\n\ttype Screen = \"main\" | \"tools\" | \"help\";\n\ttype Action = \"start\" | \"toggle-tool\" | \"start-with-tools\" | \"settings\";\n\tconst selectedNames = new Set(options.getSelectedNames());\n\tconst toolItems = options.tools.map((tool, index) => ({\n\t\tid: `plan-tool:${index}`,\n\t\ttool,\n\t}));\n\tconst toolsByItemId = new Map(toolItems.map(({ id, tool }) => [id, tool]));\n\tlet draftChanged = false;\n\tconst menu = defineMenu<undefined, Screen, Action, ExtensionContext>({\n\t\tstart: options.initialScreen ?? \"main\",\n\t\tscreens: {\n\t\t\tmain: () => ({\n\t\t\t\tkind: \"actions\",\n\t\t\t\ttitle: \"Plan mode\",\n\t\t\t\tlines: [options.statusText, options.toolSummary(selectedNames)],\n\t\t\t\titems: [\n\t\t\t\t\t{ id: \"start\", label: \"Start Plan mode\", action: \"start\" },\n\t\t\t\t\t{ id: \"tools\", label: \"Choose tools, then start\u2026\", to: \"tools\" },\n\t\t\t\t\t{ id: \"settings\", label: \"Settings\", action: \"settings\" },\n\t\t\t\t\t{ id: \"help\", label: \"How Plan mode works\", to: \"help\" },\n\t\t\t\t],\n\t\t\t\thint: \"close\",\n\t\t\t}),\n\t\t\ttools: () => ({\n\t\t\t\tkind: \"multiSelect\",\n\t\t\t\ttitle: \"Choose Plan policy allowlist\",\n\t\t\t\tlines: [\n\t\t\t\t\t\"Policy changes apply only when you start Plan mode; first use may also reveal Plan helpers.\",\n\t\t\t\t\toptions.toolSummary(selectedNames),\n\t\t\t\t\t\"Active tools can be chosen now; retained names resolve before the first request.\",\n\t\t\t\t\t\"Plan mode never activates tools, and non-built-ins run at user risk.\",\n\t\t\t\t],\n\t\t\t\tenableSearch: true,\n\t\t\t\tviewportSize: 10,\n\t\t\t\titems: toolItems.map(({ id, tool }) => ({\n\t\t\t\t\tid,\n\t\t\t\t\tlabel: tool.label ?? tool.name,\n\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\tsearchText: tool.searchText,\n\t\t\t\t\tselected: selectedNames.has(tool.name),\n\t\t\t\t\tdisabled: tool.disabled,\n\t\t\t\t\tdisabledReason: tool.disabledReason,\n\t\t\t\t})),\n\t\t\t\taction: \"toggle-tool\",\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"start-with-tools\",\n\t\t\t\t\t\tlabel: \"Done \u2014 start with this policy\",\n\t\t\t\t\t\taction: \"start-with-tools\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\thint: \"back\",\n\t\t\t}),\n\t\t\thelp: () => ({\n\t\t\t\tkind: \"detail\",\n\t\t\t\ttitle: \"How Plan mode works\",\n\t\t\t\tlines: [\n\t\t\t\t\t\"Plan mode uses read-only exploration to understand the project before implementation.\",\n\t\t\t\t\t\"The agent can ask important decision questions, then returns a complete implementation-ready plan.\",\n\t\t\t\t\t\"File mutation stays blocked until you explicitly choose to implement the completed plan.\",\n\t\t\t\t],\n\t\t\t\thint: \"back\",\n\t\t\t}),\n\t\t},\n\t\tactions: {\n\t\t\tstart: async ({ signal }) => {\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\toptions.start(signal);\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"toggle-tool\": async ({ itemId, selected, signal }) => {\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\tconst tool = itemId ? toolsByItemId.get(itemId) : undefined;\n\t\t\t\tif (!tool || tool.disabled) return { kind: \"rejected\" };\n\t\t\t\tif (selected) selectedNames.add(tool.name);\n\t\t\t\telse selectedNames.delete(tool.name);\n\t\t\t\tdraftChanged = true;\n\t\t\t\treturn { kind: \"stay\" };\n\t\t\t},\n\t\t\t\"start-with-tools\": async ({ signal }) => {\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\toptions.startWithTools(Array.from(selectedNames), signal);\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\tsettings: async ({ signal }) => {\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\tconst close = await options.settings(signal);\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\tif (close) return { kind: \"close\" };\n\t\t\t\tif (!draftChanged) {\n\t\t\t\t\tselectedNames.clear();\n\t\t\t\t\tfor (const name of options.getSelectedNames()) selectedNames.add(name);\n\t\t\t\t}\n\t\t\t\treturn { kind: \"stay\" };\n\t\t\t},\n\t\t},\n\t});\n\tawait runMenu(ctx, menu, {\n\t\tgetState: () => undefined,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n}\n", "import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { type PlanExportDestinationProvider, planExportInputScreen } from \"./plan-export-screen.js\";\n\ninterface SavedPlanMenuOptions {\n\tstatusText: string;\n\timplementationOutcome(): string;\n\tgetExportDestination: PlanExportDestinationProvider;\n\tsignal: AbortSignal;\n\tisCurrent(): boolean;\n\tshow(): void;\n\timplementHere(): void | Promise<void>;\n\timplementFresh(signal: AbortSignal): void | Promise<void>;\n\texportPlan(path: string, signal: AbortSignal): Promise<boolean>;\n\tsettings(signal: AbortSignal): Promise<boolean>;\n\tclear(): void;\n}\n\nexport async function showSavedPlanMenu(ctx: ExtensionContext, options: SavedPlanMenuOptions) {\n\tif (!ctx.hasUI) {\n\t\tthrow new Error(\n\t\t\t`${options.statusText} Use /plan show, /plan implement, /plan export, or /plan exit.`,\n\t\t);\n\t}\n\ttype Screen = \"saved\" | \"export\";\n\ttype Action = \"show\" | \"implement-here\" | \"implement-fresh\" | \"export\" | \"settings\" | \"clear\";\n\tconst menu = defineMenu<undefined, Screen, Action, ExtensionContext>({\n\t\tstart: \"saved\",\n\t\tscreens: {\n\t\t\tsaved: () => ({\n\t\t\t\tkind: \"actions\",\n\t\t\t\ttitle: \"Saved plan\",\n\t\t\t\tlines: [\n\t\t\t\t\toptions.statusText,\n\t\t\t\t\t\"Implement here keeps this planning conversation.\",\n\t\t\t\t\t\"Start fresh transfers only the approved plan to a new session.\",\n\t\t\t\t\toptions.implementationOutcome(),\n\t\t\t\t],\n\t\t\t\titems: [\n\t\t\t\t\t{ id: \"show\", label: \"Show saved plan\", action: \"show\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"implement-here\",\n\t\t\t\t\t\tlabel: \"Implement here\",\n\t\t\t\t\t\tdescription: \"Continue in this session with the planning conversation.\",\n\t\t\t\t\t\taction: \"implement-here\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"implement-fresh\",\n\t\t\t\t\t\tlabel: \"Start fresh and implement\",\n\t\t\t\t\t\tdescription: \"Open a new linked session; transfer only the approved plan.\",\n\t\t\t\t\t\taction: \"implement-fresh\",\n\t\t\t\t\t\tbusyLabel: \"Starting fresh implementation session\u2026\",\n\t\t\t\t\t},\n\t\t\t\t\t{ id: \"export\", label: \"Export plan\u2026\", to: \"export\" },\n\t\t\t\t\t{ id: \"settings\", label: \"Settings\", action: \"settings\" },\n\t\t\t\t\t{ id: \"clear\", label: \"Clear saved plan\", action: \"clear\" },\n\t\t\t\t],\n\t\t\t\thint: \"close\",\n\t\t\t}),\n\t\t\texport: () => planExportInputScreen(options.getExportDestination),\n\t\t},\n\t\tactions: {\n\t\t\tshow: async () => {\n\t\t\t\toptions.show();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"implement-here\": async () => {\n\t\t\t\tawait options.implementHere();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\t\"implement-fresh\": async ({ signal }) => {\n\t\t\t\tawait options.implementFresh(signal);\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t\texport: async ({ value, signal }) =>\n\t\t\t\t(await options.exportPlan(value ?? \"\", signal)) ? { kind: \"close\" } : { kind: \"rejected\" },\n\t\t\tsettings: async ({ signal }) => {\n\t\t\t\tconst close = await options.settings(signal);\n\t\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" };\n\t\t\t\treturn close ? { kind: \"close\" } : { kind: \"stay\" };\n\t\t\t},\n\t\t\tclear: async () => {\n\t\t\t\toptions.clear();\n\t\t\t\treturn { kind: \"close\" };\n\t\t\t},\n\t\t},\n\t});\n\tawait runMenu(ctx, menu, {\n\t\tgetState: () => undefined,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n}\n", "import type { ExtensionContext, ToolInfo } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, type RunMenuResult, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { PLAN_MODE_COMPLETE_TOOL_NAME } from \"./completion-tool.js\";\nimport { retentionLabel } from \"./implementation-retention.js\";\nimport { planExportDestination } from \"./plan-export.js\";\nimport { PLAN_MODE_QUESTION_TOOL_NAME } from \"./question-tool.js\";\nimport {\n\tconfiguredImplementationPlanRetention,\n\tconfiguredPlanExportPath,\n\tconfiguredPlanModeToggleShortcut,\n\tIMPLEMENTATION_PLAN_RETENTIONS,\n\tnormalizeKeyId,\n\tPLAN_MODE_THINKING_LEVELS,\n\ttype PlanModeSettings,\n\ttype PlanModeSettingsLoadResult,\n\ttype PlanModeSettingsPatch,\n\tplanModeSettingsPath,\n\treadPlanModeSettings,\n\ttype UpdatePlanModeSettingsOptions,\n\tupdatePlanModeSettings,\n} from \"./settings.js\";\nimport { canSelectToolInPlanMode } from \"./tool-policy.js\";\nimport { defaultPlanModeToolNames, toolPolicyLabel } from \"./tool-selection.js\";\n\ninterface SettingsMenuState {\n\tkind: \"valid\" | \"invalid\";\n\tsettings: PlanModeSettings;\n\tnotice?: string;\n\treason?: string;\n}\n\nexport interface PlanModeSettingsMenuOptions {\n\ttools: readonly ToolInfo[];\n\tactiveToolNames?: readonly string[];\n\tsignal: AbortSignal;\n\tisCurrent(): boolean;\n\tsettingsPath?: string;\n\tlegacySettingsPath?: string;\n\treadSettings?: (settingsPath?: string) => Promise<PlanModeSettingsLoadResult>;\n\tupdateSettings?: (\n\t\tpatch: PlanModeSettingsPatch,\n\t\toptions?: UpdatePlanModeSettingsOptions,\n\t) => Promise<PlanModeSettings>;\n\tonSaved(settings: PlanModeSettings): void;\n}\n\ntype Screen = \"settings\" | \"tools\" | \"export\" | \"shortcut\";\ntype Action =\n\t| \"set-thinking\"\n\t| \"open-tools\"\n\t| \"toggle-tool\"\n\t| \"reset-tools\"\n\t| \"set-retention\"\n\t| \"open-export\"\n\t| \"set-export\"\n\t| \"open-shortcut\"\n\t| \"set-shortcut\";\n\nexport async function showPlanModeSettings(\n\tctx: ExtensionContext,\n\toptions: PlanModeSettingsMenuOptions,\n): Promise<RunMenuResult> {\n\tconst settingsPath = options.settingsPath ?? planModeSettingsPath();\n\tconst readSettings = options.readSettings ?? readPlanModeSettings;\n\tconst updateSettings = options.updateSettings ?? updatePlanModeSettings;\n\tconst activeToolNames = new Set(\n\t\toptions.activeToolNames ?? options.tools.map((tool) => tool.name),\n\t);\n\tconst tools = options.tools.filter(\n\t\t(tool) =>\n\t\t\ttool.name !== PLAN_MODE_QUESTION_TOOL_NAME && tool.name !== PLAN_MODE_COMPLETE_TOOL_NAME,\n\t);\n\tconst toolItemIds = new Map(\n\t\ttools.map((tool, index) => [tool.name, `plan-settings-tool:${index}`]),\n\t);\n\tconst toolsByItemId = new Map(tools.map((tool) => [toolItemIds.get(tool.name) as string, tool]));\n\n\tconst loadState = async (): Promise<SettingsMenuState> => {\n\t\tconst loaded = await readSettings(options.settingsPath);\n\t\tif (loaded.kind === \"invalid\") {\n\t\t\treturn {\n\t\t\t\tkind: \"invalid\",\n\t\t\t\tsettings: { thinkingLevel: \"inherit\" },\n\t\t\t\tnotice: loaded.notice,\n\t\t\t\treason: loaded.reason,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"valid\",\n\t\t\tsettings: loaded.kind === \"loaded\" ? loaded.settings : { thinkingLevel: \"inherit\" },\n\t\t\tnotice: loaded.notice,\n\t\t};\n\t};\n\n\tconst menu = defineMenu<SettingsMenuState, Screen, Action, ExtensionContext>({\n\t\tstart: \"settings\",\n\t\tscreens: {\n\t\t\tsettings: ({ state }) =>\n\t\t\t\tstate.kind === \"invalid\"\n\t\t\t\t\t? invalidScreen(settingsPath, state)\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tkind: \"settings\",\n\t\t\t\t\t\t\ttitle: \"Plan Mode Settings\",\n\t\t\t\t\t\t\tlines: settingsLines(settingsPath, state.notice),\n\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: \"thinkingLevel\",\n\t\t\t\t\t\t\t\t\tlabel: \"Plan thinking\",\n\t\t\t\t\t\t\t\t\tdescription: \"Set the thinking level when the next Plan workflow starts.\",\n\t\t\t\t\t\t\t\t\tcurrentValue: state.settings.thinkingLevel,\n\t\t\t\t\t\t\t\t\tvalues: PLAN_MODE_THINKING_LEVELS,\n\t\t\t\t\t\t\t\t\taction: \"set-thinking\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: \"defaultPlanTools\",\n\t\t\t\t\t\t\t\t\tlabel: \"Plan policy tools\",\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\"Choose active tools or retain names to resolve before the first request.\",\n\t\t\t\t\t\t\t\t\tcurrentValue: defaultToolsValue(state.settings.defaultPlanTools),\n\t\t\t\t\t\t\t\t\taction: \"open-tools\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: \"implementationPlanRetention\",\n\t\t\t\t\t\t\t\t\tlabel: \"Plan reinjection\",\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\"Choose how long Plan mode restores the exact plan when ordinary context no longer contains it.\",\n\t\t\t\t\t\t\t\t\tcurrentValue: retentionLabel(\n\t\t\t\t\t\t\t\t\t\tconfiguredImplementationPlanRetention(state.settings),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tvalues: IMPLEMENTATION_PLAN_RETENTIONS.map(retentionLabel),\n\t\t\t\t\t\t\t\t\taction: \"set-retention\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: \"defaultPlanExportPath\",\n\t\t\t\t\t\t\t\t\tlabel: \"Export destination\",\n\t\t\t\t\t\t\t\t\tdescription: \"Set the destination used when an export omits its path.\",\n\t\t\t\t\t\t\t\t\tcurrentValue: safeTerminalText(configuredPlanExportPath(state.settings)),\n\t\t\t\t\t\t\t\t\taction: \"open-export\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: \"toggleShortcut\",\n\t\t\t\t\t\t\t\t\tlabel: \"Plan mode shortcut\",\n\t\t\t\t\t\t\t\t\tdescription: \"Set the global shortcut used to toggle Plan mode.\",\n\t\t\t\t\t\t\t\t\tcurrentValue: configuredPlanModeToggleShortcut(state.settings) ?? \"none\",\n\t\t\t\t\t\t\t\t\taction: \"open-shortcut\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\ttools: ({ state }) => ({\n\t\t\t\tkind: \"multiSelect\",\n\t\t\t\ttitle: \"Default Plan policy allowlist\",\n\t\t\t\tlines: [\n\t\t\t\t\t\"Changes apply when a later Plan workflow starts; model-visible tools stay unchanged.\",\n\t\t\t\t\t\"Retained inactive names resolve before that workflow's first request.\",\n\t\t\t\t\t\"Plan mode never activates tools, and non-built-ins run at user risk.\",\n\t\t\t\t],\n\t\t\t\tenableSearch: true,\n\t\t\t\tviewportSize: 10,\n\t\t\t\titems: defaultToolItems(\n\t\t\t\t\ttools,\n\t\t\t\t\tstate.settings.defaultPlanTools,\n\t\t\t\t\tactiveToolNames,\n\t\t\t\t\ttoolItemIds,\n\t\t\t\t),\n\t\t\t\taction: \"toggle-tool\",\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"reset-tools\",\n\t\t\t\t\t\tlabel: \"Use automatic safe built-ins\",\n\t\t\t\t\t\taction: \"reset-tools\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\thint: \"back\",\n\t\t\t}),\n\t\t\texport: ({ state }) => {\n\t\t\t\tconst configured = configuredPlanExportPath(state.settings);\n\t\t\t\tconst destination = planExportDestination(configured, ctx.cwd);\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"input\",\n\t\t\t\t\ttitle: \"Export destination\",\n\t\t\t\t\tlines: [\n\t\t\t\t\t\t`Configured: ${destination.configuredPath}`,\n\t\t\t\t\t\t`Resolves here to: ${destination.resolvedPath}`,\n\t\t\t\t\t\t\"Submit an empty value to reset to PLAN.md. Changes affect the next export.\",\n\t\t\t\t\t],\n\t\t\t\t\tplaceholder: configured,\n\t\t\t\t\taction: \"set-export\",\n\t\t\t\t\thint: \"back\",\n\t\t\t\t};\n\t\t\t},\n\t\t\tshortcut: ({ state }) => ({\n\t\t\t\tkind: \"input\",\n\t\t\t\ttitle: \"Plan mode shortcut\",\n\t\t\t\tlines: [\n\t\t\t\t\t`Configured: ${configuredPlanModeToggleShortcut(state.settings) ?? \"none\"}`,\n\t\t\t\t\t\"Use Pi key identifiers.\",\n\t\t\t\t\t\"Submit an empty value to clear the shortcut.\",\n\t\t\t\t\t\"When unset, Plan mode has no global shortcut.\",\n\t\t\t\t],\n\t\t\t\tplaceholder: configuredPlanModeToggleShortcut(state.settings) ?? \"\",\n\t\t\t\taction: \"set-shortcut\",\n\t\t\t\thint: \"back\",\n\t\t\t}),\n\t\t},\n\t\tactions: {\n\t\t\t\"set-thinking\": async ({ ctx: actionCtx, value, signal }) => {\n\t\t\t\tif (\n\t\t\t\t\t!PLAN_MODE_THINKING_LEVELS.includes(value as (typeof PLAN_MODE_THINKING_LEVELS)[number])\n\t\t\t\t) {\n\t\t\t\t\treturn { kind: \"rejected\" };\n\t\t\t\t}\n\t\t\t\treturn savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ thinkingLevel: value as PlanModeSettings[\"thinkingLevel\"] },\n\t\t\t\t\tsignal,\n\t\t\t\t\t`Plan mode thinking level: ${value}. Applies to the next Plan workflow.`,\n\t\t\t\t);\n\t\t\t},\n\t\t\t\"open-tools\": async () => ({ kind: \"to\", screen: \"tools\" }),\n\t\t\t\"set-retention\": async ({ ctx: actionCtx, value, signal }) => {\n\t\t\t\tconst implementationPlanRetention = retentionFromLabel(value);\n\t\t\t\tif (!implementationPlanRetention) return { kind: \"rejected\" };\n\t\t\t\treturn savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ implementationPlanRetention },\n\t\t\t\t\tsignal,\n\t\t\t\t\t`Plan reinjection: ${retentionLabel(implementationPlanRetention)}. Applies to the next Implement action.`,\n\t\t\t\t);\n\t\t\t},\n\t\t\t\"open-export\": async () => ({ kind: \"to\", screen: \"export\" }),\n\t\t\t\"set-export\": async ({ ctx: actionCtx, value, signal }) => {\n\t\t\t\tconst defaultPlanExportPath = value?.trim() || null;\n\t\t\t\tconst result = await savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ defaultPlanExportPath },\n\t\t\t\t\tsignal,\n\t\t\t\t\tdefaultPlanExportPath\n\t\t\t\t\t\t? `Default Plan export destination: ${safeTerminalText(defaultPlanExportPath)}.`\n\t\t\t\t\t\t: \"Default Plan export destination reset to PLAN.md.\",\n\t\t\t\t);\n\t\t\t\treturn result.kind === \"stay\" ? { kind: \"to\", screen: \"settings\" } : result;\n\t\t\t},\n\t\t\t\"open-shortcut\": async () => ({ kind: \"to\", screen: \"shortcut\" }),\n\t\t\t\"set-shortcut\": async ({ ctx: actionCtx, value, signal }) => {\n\t\t\t\tconst raw = value?.trim() || null;\n\t\t\t\tif (raw && !normalizeKeyId(raw)) {\n\t\t\t\t\tactionCtx.ui.notify(\n\t\t\t\t\t\t`Invalid key identifier: ${safeTerminalText(raw)}. Use Pi key identifiers like ctrl+alt+p.`,\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t);\n\t\t\t\t\treturn { kind: \"stay\" as const };\n\t\t\t\t}\n\t\t\t\tconst toggleShortcut = raw as PlanModeSettingsPatch[\"toggleShortcut\"];\n\t\t\t\tconst result = await savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ toggleShortcut },\n\t\t\t\t\tsignal,\n\t\t\t\t\ttoggleShortcut\n\t\t\t\t\t\t? `Plan mode shortcut: ${safeTerminalText(toggleShortcut)}.`\n\t\t\t\t\t\t: \"Plan mode shortcut cleared (no global shortcut).\",\n\t\t\t\t);\n\t\t\t\treturn result.kind === \"stay\" ? { kind: \"to\", screen: \"settings\" } : result;\n\t\t\t},\n\t\t\t\"toggle-tool\": async ({ ctx: actionCtx, state, itemId, selected, signal }) => {\n\t\t\t\tconst tool = itemId ? toolsByItemId.get(itemId) : undefined;\n\t\t\t\tif (!tool || !activeToolNames.has(tool.name) || !canSelectToolInPlanMode(tool)) {\n\t\t\t\t\treturn { kind: \"rejected\" };\n\t\t\t\t}\n\t\t\t\tconst names = explicitToolNames(tools, state.settings.defaultPlanTools);\n\t\t\t\tconst next = selected\n\t\t\t\t\t? Array.from(new Set([...names, tool.name]))\n\t\t\t\t\t: names.filter((name) => name !== tool.name);\n\t\t\t\treturn savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ defaultPlanTools: next },\n\t\t\t\t\tsignal,\n\t\t\t\t\t`Default Plan policy: ${next.length === 0 ? \"no optional tools\" : `${next.length} allowed`}.`,\n\t\t\t\t);\n\t\t\t},\n\t\t\t\"reset-tools\": async ({ ctx: actionCtx, state, signal }) => {\n\t\t\t\tif (state.settings.defaultPlanTools === undefined) return { kind: \"stay\" };\n\t\t\t\treturn savePatch(\n\t\t\t\t\tactionCtx,\n\t\t\t\t\t{ defaultPlanTools: null },\n\t\t\t\t\tsignal,\n\t\t\t\t\t\"Default Plan-mode tools: automatic safe built-ins.\",\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t});\n\n\treturn runMenu(ctx, menu, {\n\t\tgetState: loadState,\n\t\tsignal: options.signal,\n\t\tisCurrent: options.isCurrent,\n\t});\n\n\tasync function savePatch(\n\t\tactionCtx: ExtensionContext,\n\t\tpatch: PlanModeSettingsPatch,\n\t\tsignal: AbortSignal,\n\t\tsuccessMessage: string,\n\t) {\n\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" as const };\n\t\ttry {\n\t\t\tconst saved = await updateSettings(patch, {\n\t\t\t\tsettingsPath: options.settingsPath,\n\t\t\t\tlegacySettingsPath: options.legacySettingsPath,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (options.isCurrent()) options.onSaved(saved);\n\t\t\tif (signal.aborted || !options.isCurrent()) return { kind: \"rejected\" as const };\n\t\t\tactionCtx.ui.notify(successMessage, \"info\");\n\t\t\treturn { kind: \"stay\" as const };\n\t\t} catch (error) {\n\t\t\tif (!signal.aborted && options.isCurrent()) {\n\t\t\t\tactionCtx.ui.notify(\n\t\t\t\t\t`Could not save Plan mode settings; the previous value remains: ${safeTerminalText(formatError(error))}`,\n\t\t\t\t\t\"error\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn { kind: \"rejected\" as const };\n\t\t}\n\t}\n}\n\nfunction settingsLines(settingsPath: string, notice: string | undefined) {\n\treturn [\n\t\t`User settings \u00B7 ${safeTerminalText(settingsPath)}`,\n\t\t\"Plan defaults apply to the next workflow; reinjection and export choices apply to their next action.\",\n\t\t...(notice ? [safeTerminalText(notice)] : []),\n\t];\n}\n\nfunction invalidScreen(settingsPath: string, state: SettingsMenuState) {\n\treturn {\n\t\tkind: \"detail\" as const,\n\t\ttitle: \"Plan Mode Settings \u00B7 Read only\",\n\t\tlines: [\n\t\t\t`Invalid settings file. Fix ${safeTerminalText(settingsPath)} before saving.`,\n\t\t\tsafeTerminalText(state.reason ?? \"The settings file is invalid.\"),\n\t\t\t...(state.notice ? [safeTerminalText(state.notice)] : []),\n\t\t],\n\t\thint: \"back\" as const,\n\t};\n}\n\nfunction retentionFromLabel(value: string | undefined) {\n\treturn IMPLEMENTATION_PLAN_RETENTIONS.find((retention) => retentionLabel(retention) === value);\n}\n\nfunction defaultToolsValue(configured: string[] | undefined) {\n\tif (configured === undefined) return \"Automatic safe built-ins\";\n\tif (configured.length === 0) return \"No optional tools\";\n\treturn `${configured.length} selected`;\n}\n\nfunction defaultToolItems(\n\ttools: readonly ToolInfo[],\n\tconfigured: string[] | undefined,\n\tactiveToolNames: ReadonlySet<string>,\n\ttoolItemIds: ReadonlyMap<string, string>,\n) {\n\tconst selected = new Set(explicitToolNames(tools, configured));\n\tconst availableNames = new Set(tools.map((tool) => tool.name));\n\tconst items = tools.map((tool) => {\n\t\tconst active = activeToolNames.has(tool.name);\n\t\tconst selectable = active && canSelectToolInPlanMode(tool);\n\t\tconst policy = active\n\t\t\t? toolPolicyLabel(tool)\n\t\t\t: selected.has(tool.name)\n\t\t\t\t? \"not active yet; retained for first-request resolution\"\n\t\t\t\t: \"not active in this Pi session\";\n\t\tconst description = tool.description ?? \"No description available\";\n\t\treturn {\n\t\t\tid: toolItemIds.get(tool.name) as string,\n\t\t\tlabel: tool.name,\n\t\t\tdescription: `${policy} \u00B7 ${description}`,\n\t\t\tsearchText: `${policy} ${description}`,\n\t\t\tselected: selected.has(tool.name),\n\t\t\tdisabled: !selectable,\n\t\t\tdisabledReason: !active\n\t\t\t\t? selected.has(tool.name)\n\t\t\t\t\t? \"Not active yet; retained and resolved before the first request\"\n\t\t\t\t\t: \"Not active in Pi; Plan mode will not activate it\"\n\t\t\t\t: selectable\n\t\t\t\t\t? undefined\n\t\t\t\t\t: \"Blocked by Plan-mode policy\",\n\t\t};\n\t});\n\tfor (const [index, name] of (configured ?? []).entries()) {\n\t\tif (availableNames.has(name)) continue;\n\t\tconst label = terminalToolName(name);\n\t\titems.push({\n\t\t\tid: `plan-settings-pending:${index}`,\n\t\t\tlabel,\n\t\t\tdescription: \"pending registration \u00B7 Retained and resolved before the first request\",\n\t\t\tsearchText: `${label} pending registration retained settings first request`,\n\t\t\tselected: true,\n\t\t\tdisabled: true,\n\t\t\tdisabledReason: \"Not registered yet; reset defaults to remove retained names\",\n\t\t});\n\t}\n\treturn items;\n}\n\nfunction explicitToolNames(tools: readonly ToolInfo[], configured: string[] | undefined) {\n\treturn configured === undefined\n\t\t? defaultPlanModeToolNames([...tools], undefined)\n\t\t: [...configured];\n}\n\nfunction terminalToolName(value: string) {\n\tconst safe = safeTerminalText(value) || \"(unnamed tool)\";\n\treturn safe.length > 120 ? `${safe.slice(0, 119)}\u2026` : safe;\n}\n\nfunction safeTerminalText(value: string) {\n\treturn [...value]\n\t\t.map((character) => {\n\t\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\t\t\treturn codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f) ? \" \" : character;\n\t\t})\n\t\t.join(\"\")\n\t\t.trim();\n}\n\nfunction formatError(error: unknown) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,YAAY,eAAe;;;ACG7B,SAAS,sBAAsB,gBAA+C;AACpF,QAAM,cAAc,eAAe;AACnC,SAAO;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,MACN;AAAA,MACA,YAAY,YAAY,cAAc;AAAA,MACtC,gBAAgB,YAAY,YAAY;AAAA,IACzC;AAAA,IACA,aAAa,YAAY;AAAA,IACzB,QAAQ;AAAA,IACR,MAAM;AAAA,EACP;AACD;;;ADFA,eAAsB,6BACrB,KACA,SACC;AAGD,QAAM,OAAO,WAAwD;AAAA,IACpE,OAAO;AAAA,IACP,SAAS;AAAA,MACR,QAAQ,OAAO;AAAA,QACd,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO,CAAC,QAAQ,UAAU;AAAA,QAC1B,OAAO;AAAA,UACN,EAAE,IAAI,QAAQ,OAAO,mCAAmC,QAAQ,OAAO;AAAA,UACvE,EAAE,IAAI,UAAU,OAAO,qBAAgB,IAAI,SAAS;AAAA,UACpD,EAAE,IAAI,YAAY,OAAO,YAAY,QAAQ,WAAW;AAAA,UACxD,EAAE,IAAI,aAAa,OAAO,oBAAoB,QAAQ,YAAY;AAAA,UAClE,EAAE,IAAI,SAAS,OAAO,oCAAoC,QAAQ,QAAQ;AAAA,QAC3E;AAAA,QACA,MAAM;AAAA,MACP;AAAA,MACA,QAAQ,MAAM,sBAAsB,QAAQ,oBAAoB;AAAA,IACjE;AAAA,IACA,SAAS;AAAA,MACR,MAAM,Y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A,MACA,aAAa;AAAA,MACb,YAAY,GAAG,KAAK;AAAA,MACpB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB,CAAC;AAAA,EACF;AACA,SAAO;AACR;AAEA,SAAS,kBAAkB,OAA4B,YAAkC;AACxF,SAAO,eAAe,SACnB,yBAAyB,CAAC,GAAG,KAAK,GAAG,MAAS,IAC9C,CAAC,GAAG,UAAU;AAClB;AAEA,SAAS,iBAAiB,OAAe;AACxC,QAAM,OAAO,iBAAiB,KAAK,KAAK;AACxC,SAAO,KAAK,SAAS,MAAM,GAAG,KAAK,MAAM,GAAG,GAAG,CAAC,WAAM;AACvD;AAEA,SAAS,iBAAiB,OAAe;AACxC,SAAO,CAAC,GAAG,KAAK,EACd,IAAI,CAAC,cAAc;AACnB,UAAM,YAAY,UAAU,YAAY,CAAC,KAAK;AAC9C,WAAO,aAAa,MAAS,aAAa,OAAQ,aAAa,MAAQ,MAAM;AAAA,EAC9E,CAAC,EACA,KAAK,EAAE,EACP,KAAK;AACR;AAEA,SAAS,YAAY,OAAgB;AACpC,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC7D;",
6
+ "names": ["defineMenu", "runMenu", "defineMenu", "runMenu", "defineMenu", "runMenu", "defineMenu", "runMenu", "defineMenu", "runMenu", "defineMenu", "runMenu", "defineMenu", "runMenu"]
7
+ }