@narumitw/pi-plan-mode 0.55.0 → 0.55.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 CHANGED
@@ -97,7 +97,9 @@ The extension does not register a startup flag; run `/plan start` after launch f
97
97
 
98
98
  Use **Choose tools, then start…** or the `/plan tools` compatibility shortcut to choose a session-specific Plan policy override before Planning starts.
99
99
  Both routes use the same draft selector: **Done — start with this policy** stores the allowlist and starts the workflow, while cancellation leaves Plan mode off and changes nothing.
100
- The bounded multi-select shows 10 rows at a time, supports viewport paging, descriptions, and explicit unavailable rows for blocked or currently inactive tools.
100
+ The bounded multi-select shows 10 rows at a time, supports viewport paging, descriptions, and explicit unavailable rows for blocked, currently inactive, or configured but not-yet-registered tools.
101
+ Configured or previously selected names without current metadata appear as pending registration and remain selected for first-request resolution.
102
+ Reopen the picker to refresh tools registered while it was closed because Pi exposes no live tool-registration event.
101
103
  In TUI mode, type to fuzzy-search tool names, descriptions, policy, and source metadata; RPC keeps the complete unfiltered list.
102
104
  Once Plan mode is active, tools are locked: `/plan` no longer offers tool or Settings actions, and `/plan tools` rejects the request.
103
105
  Exit and start a new workflow if a different tool set is required.
@@ -141,10 +143,10 @@ Configure persistent defaults or a one-workflow tool override before activation;
141
143
  Plan mode registers `plan_mode_question` and `plan_mode_complete` during extension load and never changes their active status itself.
142
144
  Another active-tool policy may hide them, in which case Plan start or restore fails without widening that policy.
143
145
  By default, the Plan policy allows active safe built-ins such as `read`, limited `bash`, limited `powershell`, `grep`, `find`, and `ls`.
144
- The optional native `powershell` tool must already be active, for example through Pi's Windows `defaultTools` setting, before Plan mode can select it.
145
- Built-in `edit` and `write`, `update_plan`, inactive tools, and deselected tools are blocked at execution time even though active schemas remain visible.
146
- Extension and custom tools are denied by default because Pi tools do not expose standardized mutability metadata; allow an already active custom tool before starting only when you accept the risk.
147
- For example, you can opt into an active `firecrawl_scrape`, `firecrawl_search`, or `lsp_diagnostics` tool when you want to use it during planning.
146
+ The optional native `powershell` tool must be active when an automatic Plan policy starts, for example through Pi's Windows `defaultTools` setting, unless its name was explicitly retained for first-request resolution.
147
+ Built-in `edit` and `write`, `update_plan`, tools still inactive at the first request, and deselected tools are blocked at execution time even though active schemas remain visible.
148
+ Extension and custom tools are denied by default because Pi tools do not expose standardized mutability metadata; explicitly allow a custom-tool name before starting only when you accept the risk.
149
+ For example, you can opt into `firecrawl_scrape`, `firecrawl_search`, or `lsp_diagnostics` when you want to use the effective active tool during planning.
148
150
  After they become visible, the Plan-only helpers remain visible in Normal mode, but their handlers and the `tool_call` policy reject calls unless Plan mode owns the active workflow.
149
151
 
150
152
  Limited `bash` uses a fail-closed Bash policy, including when an extension overrides the canonical `bash` tool name.
@@ -177,7 +179,8 @@ If you cancel or no interactive UI is available, the agent should ask a concise
177
179
 
178
180
  Pi identifies tools by tool name.
179
181
  The pre-start selector stores accepted session policy names and shows each effective tool's source from Pi metadata, such as `built-in`, a user extension path, or a project extension path.
180
- A selected name can run in Plan mode only when that effective tool was already active at session startup.
182
+ A selected name can run in Plan mode only when Pi has registered and activated the effective selectable tool by that workflow's first provider-bound context.
183
+ The allowlist freezes at that boundary, so a tool registered or activated later waits for the next Plan workflow.
181
184
  If an extension overrides a built-in tool with the same name, Pi exposes the effective tool for that name and the selector shows that source.
182
185
 
183
186
  A complete Plan mode answer should appear only after the agent has resolved discoverable facts and high-impact user decisions.
@@ -342,9 +345,13 @@ An explicit empty array appears as **No optional tools** and denies every ordina
342
345
  Neither setting changes model-visible tool schemas.
343
346
 
344
347
  Tool names must be non-empty strings; duplicates are removed in first-seen order.
345
- Unknown, inactive, and Plan-mode-blocked names are unavailable to the policy and never become active merely by entering Plan mode.
346
- Settings retains configured inactive names and shows them as unavailable; resetting to automatic removes the entire override.
347
- An ordinary tool registered or activated after the startup baseline is outside the current workflow policy; start a later session to include it in the selectable baseline.
348
+ Explicit configured or session-selected names remain policy intent when their tool is unknown or inactive, but Plan mode never registers or activates them.
349
+ The inactive menu takes a fresh registered and active tool snapshot each time it opens, while an already open picker does not update in place.
350
+ At the workflow's first provider-bound context, after every `before_agent_start` handler has settled, Plan mode resolves retained names against Pi's live registered and active tools and freezes the executable allowlist.
351
+ Automatic defaults recheck the effective source metadata at that boundary, so a custom override of a safe built-in name still requires explicit opt-in.
352
+ The resolved allowlist persists with the active workflow and restores without reopening the resolution boundary after reload, resume, or tree navigation.
353
+ Unknown, inactive, and Plan-mode-blocked names remain unavailable after that resolution, and a later registration or activation waits for the next Plan workflow rather than a new session.
354
+ Settings shows unresolved names as pending registration; resetting to automatic removes the entire override.
348
355
  Non-built-in names in this global setting are an explicit user-risk opt-in, just like selecting them in the pre-start workflow selector.
349
356
  Plan mode does not interpret a selected custom tool's arguments or actions: allowing one trusts the whole effective tool.
350
357
  Pi resolves tools by name, so if an extension overrides a built-in name, the effective extension tool is selected instead.
@@ -1649,20 +1649,14 @@ function toolSourceLabel(tool) {
1649
1649
  function unique(values) {
1650
1650
  return Array.from(new Set(values));
1651
1651
  }
1652
- function filterAvailableSelectedToolNames(names, tools) {
1653
- const availableNames = new Set(tools.filter(canSelectToolInPlanMode).map((tool) => tool.name));
1654
- return unique(names.filter((name) => availableNames.has(name)));
1655
- }
1656
1652
  function defaultPlanModeToolNames(tools, configuredNames) {
1657
- if (configuredNames !== void 0) {
1658
- return filterAvailableSelectedToolNames(configuredNames, tools);
1659
- }
1653
+ if (configuredNames !== void 0) return unique(configuredNames);
1660
1654
  return tools.filter((tool) => isBuiltinTool(tool) && SAFE_BUILTIN_PLAN_TOOLS.has(tool.name)).map((tool) => tool.name);
1661
1655
  }
1662
1656
  function snapshotPlanModeSelectedNames(tools, selection) {
1663
1657
  const selectedToolNames = selection.selectedToolNames ?? selection.selectedToolKeys?.map((key) => toolNameFromLegacyKey(key, tools)).filter((name) => name !== void 0);
1664
1658
  return new Set(
1665
- selectedToolNames === void 0 ? defaultPlanModeToolNames(tools, selection.defaultPlanTools) : filterAvailableSelectedToolNames(selectedToolNames, tools)
1659
+ selectedToolNames === void 0 ? defaultPlanModeToolNames(tools, selection.defaultPlanTools) : unique(selectedToolNames)
1666
1660
  );
1667
1661
  }
1668
1662
 
@@ -1707,9 +1701,7 @@ export {
1707
1701
  planModeQuestionCancelled,
1708
1702
  compareTools,
1709
1703
  toolPolicyLabel,
1710
- unique,
1711
- filterAvailableSelectedToolNames,
1712
1704
  defaultPlanModeToolNames,
1713
1705
  snapshotPlanModeSelectedNames
1714
1706
  };
1715
- //# sourceMappingURL=chunk-KSGLZ4S2.js.map
1707
+ //# sourceMappingURL=chunk-AS76FCC5.js.map