@narumitw/pi-plan-mode 0.57.1 → 0.58.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.
- package/README.md +68 -4
- package/dist/chunks/{chunk-57OBPS7P.js → chunk-HF7ZEYIC.js} +169 -164
- package/dist/chunks/chunk-HF7ZEYIC.js.map +7 -0
- package/dist/chunks/{interactive-ui-N2ZKBVNE.js → interactive-ui-UK7IGPOE.js} +312 -32
- package/dist/chunks/interactive-ui-UK7IGPOE.js.map +7 -0
- package/dist/index.ts +670 -212
- package/dist/index.ts.map +4 -4
- package/docs/settings.md +26 -2
- package/package.json +50 -51
- package/src/active-implementation-menu.ts +57 -60
- package/src/command.ts +22 -21
- package/src/completion-tool.ts +53 -56
- package/src/extension-runtime.ts +5 -5
- package/src/finalization-request.ts +40 -44
- package/src/fresh-handoff-coordinator.ts +52 -0
- package/src/fresh-implementation.ts +312 -205
- package/src/implementation-models.ts +43 -0
- package/src/implementation-retention.ts +109 -123
- package/src/message-transform.ts +218 -252
- package/src/mode-contract.ts +46 -49
- package/src/plan-action-controller.ts +139 -89
- package/src/plan-action-menus.ts +414 -177
- package/src/plan-export-controller.ts +23 -28
- package/src/plan-export-screen.ts +13 -13
- package/src/plan-export.ts +85 -102
- package/src/plan-launch-menu.ts +119 -119
- package/src/plan-mode.ts +2027 -1675
- package/src/presentation.ts +84 -108
- package/src/prompt.ts +1 -1
- package/src/question-tool.ts +239 -267
- package/src/required-tools.ts +15 -19
- package/src/saved-plan-menu.ts +82 -84
- package/src/saved-plan-preflight.ts +29 -33
- package/src/settings-menu.ts +489 -377
- package/src/settings.ts +403 -382
- package/src/state.ts +177 -146
- package/src/tool-policy.ts +634 -699
- package/src/tool-selection.ts +39 -44
- package/src/workflow-mutex.ts +66 -66
- package/dist/chunks/chunk-57OBPS7P.js.map +0 -7
- package/dist/chunks/interactive-ui-N2ZKBVNE.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
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,I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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
|
-
}
|