pi-usereq 0.42.0 → 0.44.0
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/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/package.json +3 -3
- package/pi-usereq/docs/REFERENCES.md +121 -121
- package/pi-usereq/docs/REQUIREMENTS.md +6 -5
- package/pi-usereq/docs/WORKFLOW.md +2 -2
- package/src/index.ts +35 -16
- package/tests/extension-registration.test.ts +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.44.0](https://github.com/Ogekuri/PI-useReq/compare/v0.43.0..v0.44.0) - 2026-07-13
|
|
4
|
+
### 🚜 Changes
|
|
5
|
+
- BREAKING CHANGE: park failed worktree runs in error without resuming base-path [useReq] *(prompt-closure)*
|
|
6
|
+
- REQ-209/REQ-230/TST-058: failed/interrupted/aborted/incomplete worktree-backed runs no longer resume the original base-path session.
|
|
7
|
+
- src/index.ts agent_end closure: the closure-failure branch keeps the worktree execution session visible, notifies the error, parks workflow in error, and retains the active request for req-reset recovery.
|
|
8
|
+
- tests/extension-registration.test.ts: realign the prompt-failure test to assert session retention + workflow error.
|
|
9
|
+
|
|
10
|
+
## [0.43.0](https://github.com/Ogekuri/PI-useReq/compare/v0.42.0..v0.43.0) - 2026-07-10
|
|
11
|
+
### 🚜 Changes
|
|
12
|
+
- make tsx a runtime dependency so postinstall resolves [useReq] *(packaging)*
|
|
13
|
+
- Move tsx from devDependencies to dependencies in package.json and the root entry of package-lock.json. The package ships .ts source with noEmit and no dist build, so node --import tsx is required for package scripts, the postinstall checker installer, and the .ts extension entry. tsx was only a devDependency, hence absent on consumer installs, causing ERR_MODULE_NOT_FOUND during pi update --extensions.
|
|
14
|
+
- Requirements: add CTN-020; update Section 5.2 note; bump front-matter to 0.0.75
|
|
15
|
+
- Verified: npm install --legacy-peer-deps runs postinstall with exit 0
|
|
16
|
+
|
|
3
17
|
## [0.42.0](https://github.com/Ogekuri/PI-useReq/compare/v0.41.0..v0.42.0) - 2026-07-10
|
|
4
18
|
### 🚜 Changes
|
|
5
19
|
- bundle pyright/ruff/eslint and add bundled-bin resolution [useReq] *(static-check)*
|
|
@@ -593,6 +607,8 @@
|
|
|
593
607
|
- \[0.40.0\]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.40.0
|
|
594
608
|
- \[0.41.0\]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.41.0
|
|
595
609
|
- \[0.42.0\]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.42.0
|
|
610
|
+
- \[0.43.0\]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.43.0
|
|
611
|
+
- \[0.44.0\]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.44.0
|
|
596
612
|
|
|
597
613
|
[0.1.0]: https://github.com/Ogekuri/PI-useReq/releases/tag/v0.1.0
|
|
598
614
|
[0.2.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.1.0..v0.2.0
|
|
@@ -634,3 +650,5 @@
|
|
|
634
650
|
[0.40.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.39.0..v0.40.0
|
|
635
651
|
[0.41.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.40.0..v0.41.0
|
|
636
652
|
[0.42.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.41.0..v0.42.0
|
|
653
|
+
[0.43.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.42.0..v0.43.0
|
|
654
|
+
[0.44.0]: https://github.com/Ogekuri/PI-useReq/compare/v0.43.0..v0.44.0
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-usereq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Ogekuri/PI-useReq.git"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"fast-glob": "^3.3.3",
|
|
39
39
|
"js-tiktoken": "^1.0.21",
|
|
40
40
|
"pyright": "^1.1.411",
|
|
41
|
-
"ruff": "^1.5.4"
|
|
41
|
+
"ruff": "^1.5.4",
|
|
42
|
+
"tsx": "^4.21.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@eslint/js": "^10.0.1",
|
|
45
|
-
"tsx": "^4.21.0",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"typescript-eslint": "^8.58.2"
|
|
48
48
|
}
|
|
@@ -4769,7 +4769,7 @@ import path from "node:path";
|
|
|
4769
4769
|
|
|
4770
4770
|
---
|
|
4771
4771
|
|
|
4772
|
-
# index.ts | TypeScript |
|
|
4772
|
+
# index.ts | TypeScript | 4624L | 106 symbols | 27 imports | 124 comments
|
|
4773
4773
|
> Path: `src/index.ts`
|
|
4774
4774
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4775
4775
|
- @details Bridges the standalone tool-runner layer into the pi extension API by registering prompt commands, agent tools, and interactive configuration menus. Runtime at module load is O(1); later behavior depends on the selected command or tool. Side effects include extension registration, UI updates, filesystem reads/writes, and delegated tool execution.
|
|
@@ -5140,7 +5140,7 @@ cost.
|
|
|
5140
5140
|
- @return {void} No return value.
|
|
5141
5141
|
- @satisfies REQ-009, REQ-064
|
|
5142
5142
|
|
|
5143
|
-
### fn `async function handleExtensionStatusEvent(` (L1261-
|
|
5143
|
+
### fn `async function handleExtensionStatusEvent(` (L1261-1558)
|
|
5144
5144
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
5145
5145
|
- @details Applies session-start-specific resource validation, project-config refresh, startup-tool enablement, and selected debug-tool logging before forwarding the originating hook name and payload into the shared `updateExtensionStatus(...)` pipeline. Before `agent_start`, re-verifies any prepared prompt execution session switch. On `agent_end`, dispatches configured command-notify, sound, and prompt-specific Pushover effects, logs dedicated workflow-closure diagnostics, restores the original session-backed `base-path` for every matched worktree-backed completion by reusing persisted replacement-session command contexts when event contexts omit `switchSession()`, executes the stash-assisted merge-and-delete finalization path for every matched successful worktree-backed completion even when a later busy-command rejection already moved workflow state to `error`, emits a warning-only notification when restored `base-path` changes are reapplied after merge, tolerates stale replacement-session notification contexts after session replacement, retains the worktree plus notifies closure failure for interrupted or failed outcomes, logs selected prompt workflow transitions, and transitions workflow state through `merging`, `error`, and `idle` as required. On `session_shutdown`, captures pre-update prompt snapshots so workflow-shutdown diagnostics and same-runtime command continuation preserve the active prompt workflow state across switch-triggered rebinding, then disposes the shared controller. Runtime is dominated by configuration loading during `session_start` and git finalization during matched successful `agent_end` handling; all other hooks are O(1). Side effects include resource checks, active-tool mutation, active-session replacement, status updates, live-ticker disposal on shutdown, optional child-process spawning, outbound HTTPS requests, branch merges, worktree deletion, and optional debug-log writes.
|
|
5146
5146
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5151,7 +5151,7 @@ cost.
|
|
|
5151
5151
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
5152
5152
|
- @satisfies REQ-117, REQ-118, REQ-119, REQ-131, REQ-132, REQ-133, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-176, REQ-178, REQ-184, REQ-185, REQ-186, REQ-187, REQ-208, REQ-209, REQ-221, REQ-228, REQ-229, REQ-230, REQ-244, REQ-245, REQ-246, REQ-247, REQ-276, REQ-277, REQ-278, REQ-279, REQ-280, REQ-291, REQ-292
|
|
5153
5153
|
|
|
5154
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
5154
|
+
### fn `function registerExtensionStatusHooks(` (L1574-1593)
|
|
5155
5155
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
5156
5156
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
5157
5157
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -5165,7 +5165,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5165
5165
|
- @return {void} No return value.
|
|
5166
5166
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
5167
5167
|
|
|
5168
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
5168
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1603-1606)
|
|
5169
5169
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
5170
5170
|
- @details Normalizes the requested tool names, stores them in config, and synchronizes the active tool set with runtime registration state. Runtime is O(n + t). Side effect: mutates config and active tools.
|
|
5171
5171
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5173,26 +5173,26 @@ registered hook count. Side effects include hook registration.
|
|
|
5173
5173
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5174
5174
|
- @return {void} No return value.
|
|
5175
5175
|
|
|
5176
|
-
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (
|
|
5176
|
+
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1614-1616)
|
|
5177
5177
|
- @brief Returns the canonical debug-tool toggle order.
|
|
5178
5178
|
- @details Reuses the documented configurable-tool ordering so debug toggles list extension-owned tools before embedded tools and remain deterministic across sessions. Runtime is O(t log t). No external state is mutated.
|
|
5179
5179
|
- @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
|
|
5180
5180
|
- @satisfies REQ-242
|
|
5181
5181
|
|
|
5182
|
-
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (
|
|
5182
|
+
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1625-1634)
|
|
5183
5183
|
- @brief Restores the debug configuration subtree to its documented defaults.
|
|
5184
5184
|
- @details Resets global debug enablement, log path, tool-wrapper command registration, workflow-state filter, dedicated workflow-event logging, and selected tool plus prompt debug toggles without mutating unrelated settings. Runtime is O(1). Side effect: mutates `config`.
|
|
5185
5185
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5186
5186
|
- @return {void} No return value.
|
|
5187
5187
|
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277, REQ-322
|
|
5188
5188
|
|
|
5189
|
-
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (
|
|
5189
|
+
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1642-1648)
|
|
5190
5190
|
- @brief Formats the top-level Debug summary value.
|
|
5191
5191
|
- @details Emits the current global debug mode plus compact selected-tool and selected-prompt counts for right-aligned menu display. Runtime is O(n) in configured selector count. No external state is mutated.
|
|
5192
5192
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5193
5193
|
- @return {string} Compact debug summary string.
|
|
5194
5194
|
|
|
5195
|
-
### fn `function buildDebugMenuChoice(` (
|
|
5195
|
+
### fn `function buildDebugMenuChoice(` (L1658-1671)
|
|
5196
5196
|
- @brief Builds one debug-menu row with optional disabled styling.
|
|
5197
5197
|
- @details Applies dim styling and disables selection whenever global debug is off for all rows except the global `Debug` toggle row. Runtime is O(1). No external state is mutated.
|
|
5198
5198
|
- @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
|
|
@@ -5200,21 +5200,21 @@ registered hook count. Side effects include hook registration.
|
|
|
5200
5200
|
- @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
|
|
5201
5201
|
- @satisfies REQ-241
|
|
5202
5202
|
|
|
5203
|
-
### fn `async function selectDebugLogOnStatus(` (
|
|
5203
|
+
### fn `async function selectDebugLogOnStatus(` (L1680-1708)
|
|
5204
5204
|
- @brief Opens the workflow-state filter selector used by the Debug submenu.
|
|
5205
5205
|
- @details Exposes `any` plus each canonical workflow state through the shared settings-menu renderer and returns the selected normalized filter or `undefined` when the user cancels the submenu. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
5206
5206
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5207
5207
|
- @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
|
|
5208
5208
|
- @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
|
|
5209
5209
|
|
|
5210
|
-
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5210
|
+
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1717-1803)
|
|
5211
5211
|
- @brief Builds the shared settings-menu choices for debug logging configuration.
|
|
5212
5212
|
- @details Serializes global debug controls plus tool-wrapper command registration, workflow-state, dedicated workflow-event, per-tool, and per-prompt toggles into one submenu, deriving inventories from the canonical tool and prompt lists and dimming locked rows while debug is disabled. Runtime is O(t + p). No external state is mutated.
|
|
5213
5213
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5214
5214
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
|
|
5215
5215
|
- @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277, REQ-321, REQ-322
|
|
5216
5216
|
|
|
5217
|
-
### fn `async function configureDebugMenu(` (
|
|
5217
|
+
### fn `async function configureDebugMenu(` (L1814-2004)
|
|
5218
5218
|
- @brief Runs the interactive Debug submenu.
|
|
5219
5219
|
- @details Lets the user toggle global debug enablement, tool-wrapper command registration, debug file and workflow filters, dedicated workflow-event logging, per-tool selectors, and per-prompt selectors while preserving row focus across re-renders. Runtime depends on user interaction count. Side effects include UI updates, config mutation, and optional debug command registration.
|
|
5220
5220
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5223,47 +5223,47 @@ registered hook count. Side effects include hook registration.
|
|
|
5223
5223
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5224
5224
|
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-192, REQ-193, REQ-195, REQ-277, REQ-321, REQ-322, REQ-323
|
|
5225
5225
|
|
|
5226
|
-
### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (
|
|
5226
|
+
### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (L1820-1827)
|
|
5227
5227
|
|
|
5228
|
-
- type `type PiNotifyBooleanConfigKey =` (
|
|
5228
|
+
- type `type PiNotifyBooleanConfigKey =` (L2010)
|
|
5229
5229
|
- @brief Represents one persisted boolean notification-setting key.
|
|
5230
5230
|
- @details Restricts menu toggles to the global enable flags and completed/interrupted/failed event toggles used by command-notify, sound, and Pushover configuration. Compile-time only and introduces no runtime cost.
|
|
5231
|
-
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (
|
|
5231
|
+
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (L2027)
|
|
5232
5232
|
- @brief Represents one persisted boolean notification event-toggle key.
|
|
5233
5233
|
- @details Restricts shared event-submenu mutation helpers to completed/interrupted/failed toggles and excludes global enable flags. Compile-time only and introduces no runtime cost.
|
|
5234
|
-
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (
|
|
5234
|
+
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L2036)
|
|
5235
5235
|
- @brief Represents one shared prompt-end event identifier used by notification menus.
|
|
5236
5236
|
- @details Restricts event-submenu rendering to the canonical completed/interrupted/failed domain shared by command-notify, sound, and Pushover routing. Compile-time only and introduces no runtime cost.
|
|
5237
|
-
### iface `interface PiNotifyEventRowDefinition` (
|
|
5237
|
+
### iface `interface PiNotifyEventRowDefinition` (L2042-2046)
|
|
5238
5238
|
- @brief Describes one shared prompt-end event row rendered inside notification event submenus.
|
|
5239
5239
|
- @details Binds one canonical event identifier to the human-readable label and terminal-outcome description reused across command-notify, sound, and Pushover event menus. The interface is compile-time only and introduces no runtime cost.
|
|
5240
5240
|
|
|
5241
|
-
### iface `interface PiNotifyEventMenuDefinition` (
|
|
5241
|
+
### iface `interface PiNotifyEventMenuDefinition` (L2052-2058)
|
|
5242
5242
|
- @brief Describes one notification-system event submenu contract.
|
|
5243
5243
|
- @details Binds the top-level launcher row, submenu title, toast prefix, and completed/interrupted/failed config keys for one notification transport. The interface is compile-time only and introduces no runtime cost.
|
|
5244
5244
|
|
|
5245
|
-
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (
|
|
5245
|
+
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L2067-2070)
|
|
5246
5246
|
- @brief Flips one persisted boolean notification setting.
|
|
5247
5247
|
- @details Negates the selected configuration flag in place and returns the resulting boolean value so callers can emit deterministic UI feedback. Runtime is O(1). Side effect: mutates `config`.
|
|
5248
5248
|
- @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
|
|
5249
5249
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5250
5250
|
- @return {boolean} Next enabled state.
|
|
5251
5251
|
|
|
5252
|
-
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (
|
|
5252
|
+
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L2079-2103)
|
|
5253
5253
|
- @brief Restores notification-related settings to their documented defaults.
|
|
5254
5254
|
- @details Copies the command-notify, sound, and Pushover configuration subtree from a fresh default config into the supplied mutable project config. Runtime is O(1). Side effect: mutates `config`.
|
|
5255
5255
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5256
5256
|
- @return {void} No return value.
|
|
5257
5257
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
|
|
5258
5258
|
|
|
5259
|
-
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (
|
|
5259
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2112-2114)
|
|
5260
5260
|
- @brief Formats one persisted Pushover priority for menu display.
|
|
5261
5261
|
- @details Maps the canonical `0|1` priority domain to deterministic `Normal|High` labels reused by the Pushover configuration UI. Runtime is O(1). No external state is mutated.
|
|
5262
5262
|
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
5263
5263
|
- @return {string} Menu-display label.
|
|
5264
5264
|
- @satisfies REQ-172
|
|
5265
5265
|
|
|
5266
|
-
### fn `function formatPiNotifyEventMenuSummary(` (
|
|
5266
|
+
### fn `function formatPiNotifyEventMenuSummary(` (L2198-2206)
|
|
5267
5267
|
- @brief Formats the top-level summary value for one notification event submenu.
|
|
5268
5268
|
- @details Counts enabled completed/interrupted/failed toggles for the selected transport and renders the result as `n/3 on` for right-aligned menu display. Runtime is O(1). No external state is mutated.
|
|
5269
5269
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5271,7 +5271,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5271
5271
|
- @return {string} Compact enabled-toggle summary.
|
|
5272
5272
|
- @satisfies REQ-198
|
|
5273
5273
|
|
|
5274
|
-
### fn `function buildPiNotifyEventLauncherChoice(` (
|
|
5274
|
+
### fn `function buildPiNotifyEventLauncherChoice(` (L2216-2226)
|
|
5275
5275
|
- @brief Builds the top-level launcher row for one notification event submenu.
|
|
5276
5276
|
- @details Reuses the shared completed/interrupted/failed summary renderer so the `Notifications` menu can expose dedicated event editors for command-notify, sound, and Pushover in a uniform shape. Runtime is O(1). No external state is mutated.
|
|
5277
5277
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5279,7 +5279,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5279
5279
|
- @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
|
|
5280
5280
|
- @satisfies REQ-181, REQ-183, REQ-165, REQ-198
|
|
5281
5281
|
|
|
5282
|
-
### fn `function buildPiNotifyEventMenuChoices(` (
|
|
5282
|
+
### fn `function buildPiNotifyEventMenuChoices(` (L2236-2252)
|
|
5283
5283
|
- @brief Builds the shared settings-menu choices for one notification event submenu.
|
|
5284
5284
|
- @details Serializes completed/interrupted/failed rows with right-aligned `on|off` values, then appends a value-less `Reset defaults` row for submenu-scoped mutation control. Runtime is O(1). No external state is mutated.
|
|
5285
5285
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5287,7 +5287,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5287
5287
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
|
|
5288
5288
|
- @satisfies REQ-188, REQ-193, REQ-198
|
|
5289
5289
|
|
|
5290
|
-
### fn `function resetPiNotifyEventMenuToDefaults(` (
|
|
5290
|
+
### fn `function resetPiNotifyEventMenuToDefaults(` (L2262-2270)
|
|
5291
5291
|
- @brief Restores one notification event submenu to its documented defaults.
|
|
5292
5292
|
- @details Copies only the completed/interrupted/failed toggles referenced by the supplied submenu contract from a fresh default config into the mutable project config. Runtime is O(1). Side effect: mutates `config`.
|
|
5293
5293
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
@@ -5295,7 +5295,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5295
5295
|
- @return {void} No return value.
|
|
5296
5296
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195
|
|
5297
5297
|
|
|
5298
|
-
### fn `function resolvePiNotifyEventLabel(` (
|
|
5298
|
+
### fn `function resolvePiNotifyEventLabel(` (L2280-2287)
|
|
5299
5299
|
- @brief Resolves the human-readable event label for one event-toggle config key.
|
|
5300
5300
|
- @details Matches the supplied config key against the submenu contract and returns the corresponding completed/interrupted/failed menu label for deterministic notification toasts. Runtime is O(1). No external state is mutated.
|
|
5301
5301
|
- @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
|
|
@@ -5303,7 +5303,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5303
5303
|
- @return {string} Human-readable event label.
|
|
5304
5304
|
- @satisfies REQ-188, REQ-198
|
|
5305
5305
|
|
|
5306
|
-
### fn `async function configurePiNotifyEventMenu(` (
|
|
5306
|
+
### fn `async function configurePiNotifyEventMenu(` (L2298-2374)
|
|
5307
5307
|
- @brief Runs one dedicated notification event submenu.
|
|
5308
5308
|
- @details Reuses the shared settings-menu renderer to toggle completed/interrupted/failed delivery flags, preserve row focus, and apply submenu-scoped reset semantics for command-notify, sound, or Pushover events. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
5309
5309
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5312,14 +5312,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5312
5312
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5313
5313
|
- @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
|
|
5314
5314
|
|
|
5315
|
-
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5315
|
+
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2383-2433)
|
|
5316
5316
|
- @brief Builds the direct Pushover rows rendered inside `Notifications`.
|
|
5317
5317
|
- @details Serializes the global enable flag, shared-event submenu launcher, priority, title, text, and credential rows into right-valued menu items appended after the sound-command rows, dims and disables the enable row until both credentials are populated, renders the locked value as `configure user/token keys first`, and escapes control characters for the single-line `Pushover text` value. Runtime is O(n) in the rendered text-template length. No external state is mutated.
|
|
5318
5318
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5319
5319
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
|
|
5320
5320
|
- @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
|
|
5321
5321
|
|
|
5322
|
-
### fn `async function selectPiNotifyPushoverPriority(` (
|
|
5322
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L2443-2471)
|
|
5323
5323
|
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
5324
5324
|
- @details Reuses the pi-usereq settings-menu renderer so Pushover priority selection remains stylistically aligned with the notification menus and appends a value-less subtree-local `Reset defaults` row. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
5325
5325
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5327,14 +5327,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5327
5327
|
- @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
|
|
5328
5328
|
- @satisfies REQ-172, REQ-192
|
|
5329
5329
|
|
|
5330
|
-
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5330
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2480-2538)
|
|
5331
5331
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
5332
5332
|
- @details Serializes command-notify, sound, and Pushover blocks with dedicated shared-event submenu launchers so the settings-menu renderer can expose one unified but modular configuration surface, including locked Pushover enablement, persisted boot-sound rows that stay decoupled from the active runtime sound level, and escaped single-line rendering for `Pushover text`. Runtime is O(n) in the longest rendered command or text field. No external state is mutated.
|
|
5333
5333
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5334
5334
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
5335
5335
|
- @satisfies REQ-137, REQ-149, REQ-150, REQ-151, REQ-152, REQ-163, REQ-164, REQ-165, REQ-172, REQ-179, REQ-181, REQ-183, REQ-188, REQ-193, REQ-198, REQ-234, REQ-235, REQ-289
|
|
5336
5336
|
|
|
5337
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
5337
|
+
### fn `async function selectPiNotifySoundLevel(` (L2548-2588)
|
|
5338
5338
|
- @brief Opens the shared settings-menu selector for the persisted boot sound level.
|
|
5339
5339
|
- @details Reuses the pi-usereq settings-menu renderer so boot-sound selection remains stylistically aligned with the notification menu, keeps the active runtime sound level unchanged, and appends a value-less subtree-local `Reset defaults` row. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
5340
5340
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5342,7 +5342,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5342
5342
|
- @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected boot sound level, reset action, or `undefined` when cancelled.
|
|
5343
5343
|
- @satisfies REQ-131, REQ-179, REQ-192, REQ-289
|
|
5344
5344
|
|
|
5345
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
5345
|
+
### fn `async function configurePiNotifyMenu(` (L2598-2884)
|
|
5346
5346
|
- @brief Runs the interactive notification-configuration menu.
|
|
5347
5347
|
- @details Exposes command-notify, sound, and Pushover controls through the shared settings-menu renderer, persists every notification subtree mutation into global configuration, delegates completed/interrupted/failed toggles to dedicated event submenus, preserves boot-sound edits without altering the active runtime sound level, keeps `Enable pushover` locked until both credentials are populated, decodes escaped control-sequence input for `Pushover text`, and preserves row focus across menu re-renders. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
5348
5348
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5350,7 +5350,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5350
5350
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
5351
5351
|
- @satisfies REQ-131, REQ-133, REQ-134, REQ-137, REQ-163, REQ-164, REQ-165, REQ-172, REQ-179, REQ-181, REQ-183, REQ-184, REQ-188, REQ-192, REQ-193, REQ-195, REQ-196, REQ-198, REQ-234, REQ-235, REQ-288, REQ-289
|
|
5352
5352
|
|
|
5353
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
5353
|
+
### fn `function registerPiNotifyShortcut(` (L2899-2922)
|
|
5354
5354
|
- @brief Registers the configurable notification-sound shortcut when supported.
|
|
5355
5355
|
- @details Loads the current effective config, registers one raw pi shortcut when
|
|
5356
5356
|
the runtime exposes `registerShortcut(...)`, cycles only the active runtime
|
|
@@ -5363,15 +5363,15 @@ registration and status updates.
|
|
|
5363
5363
|
- @return {void} No return value.
|
|
5364
5364
|
- @satisfies REQ-134, REQ-180, REQ-286, REQ-287
|
|
5365
5365
|
|
|
5366
|
-
### fn `function resolveReqResetPromptRequest(` (
|
|
5366
|
+
### fn `function resolveReqResetPromptRequest(` (L2930-2956)
|
|
5367
5367
|
- @brief Resolves the prompt execution plan targeted by `req-reset` recovery.
|
|
5368
5368
|
- @details Prefers the current in-memory active request, then the current in-memory pending request, then the process-scoped persisted prompt runtime state so the dedicated reset command can recover from same-host unclean prompt termination after session replacement. Runtime is O(1). No external state is mutated.
|
|
5369
5369
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5370
5370
|
- @return {PromptCommandExecutionPlan | undefined} Recoverable prompt execution plan when one remains available.
|
|
5371
5371
|
|
|
5372
|
-
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (
|
|
5372
|
+
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2933-2940)
|
|
5373
5373
|
|
|
5374
|
-
### fn `function registerReqResetCommand(` (
|
|
5374
|
+
### fn `function registerReqResetCommand(` (L2966-3020)
|
|
5375
5375
|
- @brief Registers the specialized `req-reset` slash command.
|
|
5376
5376
|
- @details Registers the non-agentic prompt-recovery command that accepts any current workflow state, reuses persisted prompt runtime state when available, restores the original session-backed `base-path`, force-removes matching generated worktrees plus branches, clears recoverable prompt state when restoration succeeds, and notifies pi without starting an LLM session or creating a worktree. Runtime is dominated by session restoration plus git cleanup. Side effects include command registration, status-controller mutation, active-session replacement, worktree deletion, branch deletion, and user notifications.
|
|
5377
5377
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5379,7 +5379,7 @@ registration and status updates.
|
|
|
5379
5379
|
- @return {void} No return value.
|
|
5380
5380
|
- @satisfies REQ-304, REQ-305, REQ-306, REQ-307, REQ-308, REQ-309, REQ-310, REQ-311, REQ-312, REQ-313
|
|
5381
5381
|
|
|
5382
|
-
### fn `function registerReqReferencesCommand(` (
|
|
5382
|
+
### fn `function registerReqReferencesCommand(` (L3030-3070)
|
|
5383
5383
|
- @brief Registers the specialized `req-references` slash command.
|
|
5384
5384
|
- @details Registers the non-agentic references-maintenance command that rejects non-`idle` invocations by transitioning workflow state to `error` before direct execution, otherwise reuses slash-command-owned git validation, transitions workflow state through `checking|running|idle`, regenerates `REFERENCES.md` directly from configured source directories, stages only the generated file, creates the fixed-message git commit, verifies repository cleanliness, and notifies pi without starting an LLM session or creating a worktree. Runtime is dominated by git subprocess execution plus source-summary generation. Side effects include command registration, status-controller mutation, filesystem writes, git index/history mutation, and user notifications.
|
|
5385
5385
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5387,7 +5387,7 @@ registration and status updates.
|
|
|
5387
5387
|
- @return {void} No return value.
|
|
5388
5388
|
- @satisfies REQ-200, REQ-221, REQ-224, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303
|
|
5389
5389
|
|
|
5390
|
-
### fn `function registerPromptCommands(` (
|
|
5390
|
+
### fn `function registerPromptCommands(` (L3080-3201)
|
|
5391
5391
|
- @brief Registers bundled prompt-backed commands with the extension.
|
|
5392
5392
|
- @details Creates one prompt-template-backed `req-<prompt>` command per bundled prompt name. Each handler rejects non-`idle` workflow state by transitioning the shared workflow state to `error` before command-side preflight, otherwise transitions the shared workflow state through `checking`, `error`, and `running`, runs dedicated prompt-command git and required-doc preflight checks, optionally prepares a dedicated worktree execution plan using the active session directory, persists the prompt metadata needed for switch-triggered rebinding, switches the active session to the verified execution cwd before prompt handoff, logs dedicated workflow-activation diagnostics, renders the prompt, starts prompt delivery into the forked active session, records `running` immediately after delivery handoff begins, and then awaits the wrapped prompt-delivery promise whose stale post-restore rejections are suppressed. Runtime is O(p) for registration; handler cost depends on prompt preflight, worktree preparation, session switching, prompt rendering, prompt dispatch, and optional debug logging. Side effects include command registration, status-controller mutation, worktree creation, active-session replacement, optional worktree rollback, user-message delivery during execution, and optional debug-log writes.
|
|
5393
5393
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5395,14 +5395,14 @@ registration and status updates.
|
|
|
5395
5395
|
- @return {void} No return value.
|
|
5396
5396
|
- @satisfies REQ-004, REQ-067, REQ-068, REQ-169, REQ-200, REQ-201, REQ-202, REQ-203, REQ-206, REQ-207, REQ-219, REQ-220, REQ-221, REQ-224, REQ-225, REQ-226, REQ-227, REQ-245, REQ-246, REQ-247, REQ-277, REQ-281
|
|
5397
5397
|
|
|
5398
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
5398
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3211-3510)
|
|
5399
5399
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
5400
5400
|
- @details Defines the tool schemas, prompt metadata, and execution handlers that bridge extension tool calls into tool-runner operations without registering duplicate custom slash commands for the same capabilities. Runtime is O(t) for registration; execution cost depends on the selected tool. Side effects include tool registration.
|
|
5401
5401
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5402
5402
|
- @return {void} No return value.
|
|
5403
5403
|
- @satisfies REQ-005, REQ-010, REQ-011, REQ-014, REQ-017, REQ-044, REQ-069, REQ-070, REQ-071, REQ-072, REQ-073, REQ-074, REQ-075, REQ-076, REQ-077, REQ-078, REQ-079, REQ-080, REQ-089, REQ-090, REQ-091, REQ-092, REQ-093, REQ-094, REQ-095, REQ-096, REQ-097, REQ-098, REQ-099, REQ-100, REQ-101, REQ-102, REQ-293, REQ-294, REQ-295, REQ-296, REQ-297
|
|
5404
5404
|
|
|
5405
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5405
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3555-3580)
|
|
5406
5406
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
5407
5407
|
- @details Serializes startup-tool actions into right-valued menu rows consumed by the shared settings-menu renderer while omitting the removed status-reference action. Runtime is O(t) in configurable-tool count. No external state is mutated.
|
|
5408
5408
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5410,7 +5410,7 @@ registration and status updates.
|
|
|
5410
5410
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
5411
5411
|
- @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5412
5412
|
|
|
5413
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5413
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3590-3604)
|
|
5414
5414
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
5415
5415
|
- @details Exposes every configurable startup tool as one row whose right-side value reports the current enabled state, preserves the documented custom/files/embedded/default-disabled ordering, and appends a value-less subtree-local `Reset defaults` row. Runtime is O(t) in configurable-tool count. No external state is mutated.
|
|
5416
5416
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5418,7 +5418,7 @@ registration and status updates.
|
|
|
5418
5418
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
5419
5419
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
|
|
5420
5420
|
|
|
5421
|
-
### fn `async function configurePiUsereqToolsMenu(` (
|
|
5421
|
+
### fn `async function configurePiUsereqToolsMenu(` (L3615-3732)
|
|
5422
5422
|
- @brief Runs the interactive active-tool configuration menu.
|
|
5423
5423
|
- @details Synchronizes runtime active tools with the effective config, renders startup-tool actions through the shared settings-menu UI, persists enablement changes into global configuration, preserves the documented per-tool ordering, and updates configuration state in response to selections until the user exits. Runtime depends on user interaction count. Side effects include UI updates, active-tool changes, and config mutation.
|
|
5424
5424
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5427,58 +5427,58 @@ registration and status updates.
|
|
|
5427
5427
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5428
5428
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
|
|
5429
5429
|
|
|
5430
|
-
### fn `function getStaticCheckLanguageConfigForMenu(` (
|
|
5430
|
+
### fn `function getStaticCheckLanguageConfigForMenu(` (L3741-3746)
|
|
5431
5431
|
- @brief Resolves one static-check language config for menu rendering.
|
|
5432
5432
|
- @details Returns the configured per-language static-check object when present and otherwise synthesizes a disabled empty-language object so menu code can render all supported languages deterministically. Runtime is O(1). No external state is mutated.
|
|
5433
5433
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5434
5434
|
- @param[in] language {string} Canonical language name.
|
|
5435
5435
|
- @return {StaticCheckLanguageConfig} Resolved per-language config object.
|
|
5436
5436
|
|
|
5437
|
-
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5437
|
+
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3754-3756)
|
|
5438
5438
|
- @brief Counts languages that currently expose at least one configured checker.
|
|
5439
5439
|
- @details Treats configured-but-disabled languages as configured when their checker list is non-empty so removal actions remain deterministic. Runtime is O(l). No external state is mutated.
|
|
5440
5440
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5441
5441
|
- @return {number} Number of languages with at least one configured checker.
|
|
5442
5442
|
|
|
5443
|
-
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5443
|
+
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3764-3766)
|
|
5444
5444
|
- @brief Counts languages whose static-check enable flag is on.
|
|
5445
5445
|
- @details Counts only languages whose persisted per-language config explicitly sets `enabled=enable`, regardless of checker count. Runtime is O(l). No external state is mutated.
|
|
5446
5446
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5447
5447
|
- @return {number} Number of enabled languages.
|
|
5448
5448
|
|
|
5449
|
-
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (
|
|
5449
|
+
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3775-3777)
|
|
5450
5450
|
- @brief Restores the documented static-check default configuration.
|
|
5451
5451
|
- @details Replaces the mutable config subtree with a fresh clone of the documented per-language defaults so menu reset actions restore both enable flags and checker lists in one step. Runtime is O(l + c). Side effect: mutates `config`.
|
|
5452
5452
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5453
5453
|
- @return {void} No return value.
|
|
5454
5454
|
- @satisfies REQ-250, REQ-251, REQ-252
|
|
5455
5455
|
|
|
5456
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
5456
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3785-3787)
|
|
5457
5457
|
- @brief Summarizes enabled and configured static-check languages.
|
|
5458
5458
|
- @details Counts enabled languages and languages with at least one checker, then emits one compact summary string suitable for the top-level configuration menu. Runtime is O(l). No external state is mutated.
|
|
5459
5459
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5460
5460
|
- @return {string} Compact summary string.
|
|
5461
5461
|
|
|
5462
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5462
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3796-3828)
|
|
5463
5463
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
5464
5464
|
- @details Serializes guided Command-oriented add and remove actions, renders one direct on/off toggle row for every supported language, and appends canonical terminal rows while omitting raw-spec and reference-only actions. Runtime is O(l). No external state is mutated.
|
|
5465
5465
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5466
5466
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
5467
5467
|
- @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
|
|
5468
5468
|
|
|
5469
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5469
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3836-3853)
|
|
5470
5470
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
5471
5471
|
- @details Exposes every supported language as one row whose right-side value reports extensions, enablement, and configured checker count for guided Command configuration flows, then appends subtree-local terminal rows. Runtime is O(l). No external state is mutated.
|
|
5472
5472
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5473
5473
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
5474
5474
|
|
|
5475
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5475
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3861-3878)
|
|
5476
5476
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
5477
5477
|
- @details Exposes only languages whose checker lists are non-empty so removal remains deterministic, then appends subtree-local terminal rows. Runtime is O(l). No external state is mutated.
|
|
5478
5478
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5479
5479
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
5480
5480
|
|
|
5481
|
-
### fn `async function configureStaticCheckMenu(` (
|
|
5481
|
+
### fn `async function configureStaticCheckMenu(` (L3888-4034)
|
|
5482
5482
|
- @brief Runs the interactive static-check configuration menu.
|
|
5483
5483
|
- @details Lets the user add and remove global Command entries, toggle direct local per-language enable flags, and reset the subtree to documented defaults through the shared settings-menu renderer until the user exits. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
5484
5484
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5486,21 +5486,21 @@ registration and status updates.
|
|
|
5486
5486
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5487
5487
|
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
|
|
5488
5488
|
|
|
5489
|
-
### fn `function formatContextFilesSummary(config: UseReqConfig): string` (
|
|
5489
|
+
### fn `function formatContextFilesSummary(config: UseReqConfig): string` (L4043-4045)
|
|
5490
5490
|
- @brief Summarizes the `Context Files` flag state for the top-level menu value column.
|
|
5491
5491
|
- @details Renders the three context-file flags as compact `name:on|off` segments in the documented order so the top-level row reflects the current injection configuration. Runtime is O(1). No external state is mutated.
|
|
5492
5492
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5493
5493
|
- @return {string} Compact `Context Files` summary string.
|
|
5494
5494
|
- @satisfies REQ-327
|
|
5495
5495
|
|
|
5496
|
-
### fn `function buildContextFilesMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5496
|
+
### fn `function buildContextFilesMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4054-4081)
|
|
5497
5497
|
- @brief Builds the shared settings-menu choices for the `Context Files` submenu.
|
|
5498
5498
|
- @details Exposes one inline on|off toggle row per context file in the documented `REQUIREMENTS.md`, `REFERENCES.md`, `WORKFLOW.md` order plus a value-less subtree-local `Reset defaults` row. Runtime is O(1). No external state is mutated.
|
|
5499
5499
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5500
5500
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered `Context Files` submenu choices.
|
|
5501
5501
|
- @satisfies REQ-327, REQ-328, REQ-333
|
|
5502
5502
|
|
|
5503
|
-
### fn `async function configureContextFilesMenu(` (
|
|
5503
|
+
### fn `async function configureContextFilesMenu(` (L4092-4150)
|
|
5504
5504
|
- @brief Runs the `Context Files` configuration submenu.
|
|
5505
5505
|
- @details Loads the shared settings menu with the three context-file toggle rows, persists each inline toggle immediately through the shared change callback, restores all three flags to enabled on approved subtree reset, preserves focus on the toggled row, and returns to the top-level menu on cancel. Runtime depends on user interaction count. Side effects include config writes and UI notifications.
|
|
5506
5506
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5509,9 +5509,9 @@ registration and status updates.
|
|
|
5509
5509
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5510
5510
|
- @satisfies REQ-327, REQ-328, REQ-333
|
|
5511
5511
|
|
|
5512
|
-
### fn `const setFlag = (flagKey: "context-files-requirements" | "context-files-references" | "context-files-workflow", enabled: boolean): void =>` (
|
|
5512
|
+
### fn `const setFlag = (flagKey: "context-files-requirements" | "context-files-references" | "context-files-workflow", enabled: boolean): void =>` (L4097-4101)
|
|
5513
5513
|
|
|
5514
|
-
### fn `function buildPiUsereqMenuChoices(` (
|
|
5514
|
+
### fn `function buildPiUsereqMenuChoices(` (L4160-4265)
|
|
5515
5515
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
5516
5516
|
- @details Serializes primary configuration actions into right-valued menu rows consumed by the shared settings-menu renderer, including the `Context Files` injection toggles, automatic git-commit mode, effective prompt-command worktree state, notification summary, debug summary, locked worktree rows when automatic git commit is disabled, and display-only local plus global config paths. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
5517
5517
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -5519,21 +5519,21 @@ registration and status updates.
|
|
|
5519
5519
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
5520
5520
|
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-162, REQ-190, REQ-191, REQ-197, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-314, REQ-318, REQ-319, REQ-320, REQ-326
|
|
5521
5521
|
|
|
5522
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5522
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4274-4292)
|
|
5523
5523
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
5524
5524
|
- @details Exposes add and remove actions for `src-dir` entries through right-valued menu rows consumed by the shared settings-menu renderer. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
5525
5525
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5526
5526
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
5527
5527
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5528
5528
|
|
|
5529
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5529
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4301-4313)
|
|
5530
5530
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
5531
5531
|
- @details Exposes every configured `src-dir` entry as one removable row and appends a value-less subtree-local `Reset defaults` row. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
5532
5532
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5533
5533
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
5534
5534
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
5535
5535
|
|
|
5536
|
-
### fn `async function configurePiUsereq(` (
|
|
5536
|
+
### fn `async function configurePiUsereq(` (L4324-4582)
|
|
5537
5537
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
5538
5538
|
- @details Loads the effective merged config, exposes docs/test/source/automatic-commit/worktree/static-check/startup-tool/notification/debug actions through the shared settings-menu renderer, forces worktree disablement when automatic git commit is disabled, prevents locked row edits, persists changes on exit, closes immediately after `Show local configuration` or `Show global configuration`, and refreshes the single-line status bar. Runtime depends on user interaction count. Side effects include UI updates, config writes, active-tool changes, and editor text updates.
|
|
5539
5539
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5542,9 +5542,9 @@ registration and status updates.
|
|
|
5542
5542
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
5543
5543
|
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-162, REQ-190, REQ-191, REQ-192, REQ-194, REQ-195, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-314, REQ-318, REQ-319, REQ-320, REQ-326, REQ-327, REQ-328, REQ-333
|
|
5544
5544
|
|
|
5545
|
-
### fn `const persistConfigChange = () =>` (
|
|
5545
|
+
### fn `const persistConfigChange = () =>` (L4335-4340)
|
|
5546
5546
|
|
|
5547
|
-
### fn `function registerConfigCommands(` (
|
|
5547
|
+
### fn `function registerConfigCommands(` (L4592-4602)
|
|
5548
5548
|
- @brief Registers configuration-management commands.
|
|
5549
5549
|
- @details Adds the interactive `pi-usereq` configuration command only; the config-viewer action is now exposed exclusively inside that menu. Runtime is O(1) for registration. Side effects include command registration.
|
|
5550
5550
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5552,7 +5552,7 @@ registration and status updates.
|
|
|
5552
5552
|
- @return {void} No return value.
|
|
5553
5553
|
- @satisfies REQ-006, REQ-031
|
|
5554
5554
|
|
|
5555
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
5555
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4611-4624)
|
|
5556
5556
|
- @brief Registers the complete pi-usereq extension.
|
|
5557
5557
|
- @details Validates installation-owned bundled resources, registers the specialized `req-reset` and `req-references` commands plus bundled prompt-backed commands and agent tools, conditionally registers config-gated debug tool wrapper commands when the current project enables them, registers configuration commands, registers the configurable notification-sound shortcut when the runtime supports shortcuts, and installs shared wrappers for all supported pi lifecycle hooks so status telemetry, context usage, prompt timing, cumulative runtime, prompt-specific Pushover metadata, tool-result debug logging, and prompt-orchestration effects remain synchronized with runtime events. Runtime is O(h) in hook count during registration. Side effects include filesystem reads, command/tool/shortcut registration, UI updates, active-tool changes, optional debug-log writes, and timer scheduling.
|
|
5558
5558
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5608,64 +5608,64 @@ registration and status updates.
|
|
|
5608
5608
|
|`getPiUsereqStartupTools`|fn||1201-1209|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
|
|
5609
5609
|
|`getConfiguredEnabledPiUsereqTools`|fn||1217-1221|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
|
|
5610
5610
|
|`applyConfiguredPiUsereqTools`|fn||1231-1248|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
|
|
5611
|
-
|`handleExtensionStatusEvent`|fn||1261-
|
|
5612
|
-
|`registerExtensionStatusHooks`|fn||
|
|
5613
|
-
|`setConfiguredPiUsereqTools`|fn||
|
|
5614
|
-
|`getDebugToolToggleNames`|fn||
|
|
5615
|
-
|`resetDebugConfigToDefaults`|fn||
|
|
5616
|
-
|`formatDebugMenuSummary`|fn||
|
|
5617
|
-
|`buildDebugMenuChoice`|fn||
|
|
5618
|
-
|`selectDebugLogOnStatus`|fn||
|
|
5619
|
-
|`buildDebugMenuChoices`|fn||
|
|
5620
|
-
|`configureDebugMenu`|fn||
|
|
5621
|
-
|`updateDebugToolCommandsEnabled`|fn||
|
|
5622
|
-
|`PiNotifyBooleanConfigKey`|type||
|
|
5623
|
-
|`PiNotifyEventBooleanConfigKey`|type||
|
|
5624
|
-
|`PiNotifyEventId`|type||
|
|
5625
|
-
|`PiNotifyEventRowDefinition`|iface||
|
|
5626
|
-
|`PiNotifyEventMenuDefinition`|iface||
|
|
5627
|
-
|`togglePiNotifyFlag`|fn||
|
|
5628
|
-
|`resetPiNotifyConfigToDefaults`|fn||
|
|
5629
|
-
|`formatPiNotifyPushoverPriority`|fn||
|
|
5630
|
-
|`formatPiNotifyEventMenuSummary`|fn||
|
|
5631
|
-
|`buildPiNotifyEventLauncherChoice`|fn||
|
|
5632
|
-
|`buildPiNotifyEventMenuChoices`|fn||
|
|
5633
|
-
|`resetPiNotifyEventMenuToDefaults`|fn||
|
|
5634
|
-
|`resolvePiNotifyEventLabel`|fn||
|
|
5635
|
-
|`configurePiNotifyEventMenu`|fn||
|
|
5636
|
-
|`buildPiNotifyPushoverRows`|fn||
|
|
5637
|
-
|`selectPiNotifyPushoverPriority`|fn||
|
|
5638
|
-
|`buildPiNotifyMenuChoices`|fn||
|
|
5639
|
-
|`selectPiNotifySoundLevel`|fn||
|
|
5640
|
-
|`configurePiNotifyMenu`|fn||
|
|
5641
|
-
|`registerPiNotifyShortcut`|fn||
|
|
5642
|
-
|`resolveReqResetPromptRequest`|fn||
|
|
5643
|
-
|`isWorktreeBacked`|fn||
|
|
5644
|
-
|`registerReqResetCommand`|fn||
|
|
5645
|
-
|`registerReqReferencesCommand`|fn||
|
|
5646
|
-
|`registerPromptCommands`|fn||
|
|
5647
|
-
|`registerAgentTools`|fn||
|
|
5648
|
-
|`buildPiUsereqToolsMenuChoices`|fn||
|
|
5649
|
-
|`buildPiUsereqToolToggleChoices`|fn||
|
|
5650
|
-
|`configurePiUsereqToolsMenu`|fn||
|
|
5651
|
-
|`getStaticCheckLanguageConfigForMenu`|fn||
|
|
5652
|
-
|`countConfiguredStaticCheckLanguages`|fn||
|
|
5653
|
-
|`countEnabledStaticCheckLanguages`|fn||
|
|
5654
|
-
|`resetStaticCheckConfig`|fn||
|
|
5655
|
-
|`formatStaticCheckLanguagesSummary`|fn||
|
|
5656
|
-
|`buildStaticCheckMenuChoices`|fn||
|
|
5657
|
-
|`buildSupportedStaticCheckLanguageChoices`|fn||
|
|
5658
|
-
|`buildConfiguredStaticCheckLanguageChoices`|fn||
|
|
5659
|
-
|`configureStaticCheckMenu`|fn||
|
|
5660
|
-
|`formatContextFilesSummary`|fn||
|
|
5661
|
-
|`buildContextFilesMenuChoices`|fn||
|
|
5662
|
-
|`configureContextFilesMenu`|fn||
|
|
5663
|
-
|`setFlag`|fn||
|
|
5664
|
-
|`buildPiUsereqMenuChoices`|fn||
|
|
5665
|
-
|`buildSrcDirMenuChoices`|fn||
|
|
5666
|
-
|`buildSrcDirRemovalChoices`|fn||
|
|
5667
|
-
|`configurePiUsereq`|fn||
|
|
5668
|
-
|`persistConfigChange`|fn||
|
|
5669
|
-
|`registerConfigCommands`|fn||
|
|
5670
|
-
|`piUsereqExtension`|fn||
|
|
5611
|
+
|`handleExtensionStatusEvent`|fn||1261-1558|async function handleExtensionStatusEvent(|
|
|
5612
|
+
|`registerExtensionStatusHooks`|fn||1574-1593|function registerExtensionStatusHooks(|
|
|
5613
|
+
|`setConfiguredPiUsereqTools`|fn||1603-1606|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
|
|
5614
|
+
|`getDebugToolToggleNames`|fn||1614-1616|function getDebugToolToggleNames(): PiUsereqStartupToolNa...|
|
|
5615
|
+
|`resetDebugConfigToDefaults`|fn||1625-1634|function resetDebugConfigToDefaults(config: UseReqConfig)...|
|
|
5616
|
+
|`formatDebugMenuSummary`|fn||1642-1648|function formatDebugMenuSummary(config: UseReqConfig): st...|
|
|
5617
|
+
|`buildDebugMenuChoice`|fn||1658-1671|function buildDebugMenuChoice(|
|
|
5618
|
+
|`selectDebugLogOnStatus`|fn||1680-1708|async function selectDebugLogOnStatus(|
|
|
5619
|
+
|`buildDebugMenuChoices`|fn||1717-1803|function buildDebugMenuChoices(config: UseReqConfig): PiU...|
|
|
5620
|
+
|`configureDebugMenu`|fn||1814-2004|async function configureDebugMenu(|
|
|
5621
|
+
|`updateDebugToolCommandsEnabled`|fn||1820-1827|const updateDebugToolCommandsEnabled = (nextValue: unknow...|
|
|
5622
|
+
|`PiNotifyBooleanConfigKey`|type||2010||
|
|
5623
|
+
|`PiNotifyEventBooleanConfigKey`|type||2027||
|
|
5624
|
+
|`PiNotifyEventId`|type||2036||
|
|
5625
|
+
|`PiNotifyEventRowDefinition`|iface||2042-2046|interface PiNotifyEventRowDefinition|
|
|
5626
|
+
|`PiNotifyEventMenuDefinition`|iface||2052-2058|interface PiNotifyEventMenuDefinition|
|
|
5627
|
+
|`togglePiNotifyFlag`|fn||2067-2070|function togglePiNotifyFlag(config: UseReqConfig, key: Pi...|
|
|
5628
|
+
|`resetPiNotifyConfigToDefaults`|fn||2079-2103|function resetPiNotifyConfigToDefaults(config: UseReqConf...|
|
|
5629
|
+
|`formatPiNotifyPushoverPriority`|fn||2112-2114|function formatPiNotifyPushoverPriority(priority: PiNotif...|
|
|
5630
|
+
|`formatPiNotifyEventMenuSummary`|fn||2198-2206|function formatPiNotifyEventMenuSummary(|
|
|
5631
|
+
|`buildPiNotifyEventLauncherChoice`|fn||2216-2226|function buildPiNotifyEventLauncherChoice(|
|
|
5632
|
+
|`buildPiNotifyEventMenuChoices`|fn||2236-2252|function buildPiNotifyEventMenuChoices(|
|
|
5633
|
+
|`resetPiNotifyEventMenuToDefaults`|fn||2262-2270|function resetPiNotifyEventMenuToDefaults(|
|
|
5634
|
+
|`resolvePiNotifyEventLabel`|fn||2280-2287|function resolvePiNotifyEventLabel(|
|
|
5635
|
+
|`configurePiNotifyEventMenu`|fn||2298-2374|async function configurePiNotifyEventMenu(|
|
|
5636
|
+
|`buildPiNotifyPushoverRows`|fn||2383-2433|function buildPiNotifyPushoverRows(config: UseReqConfig):...|
|
|
5637
|
+
|`selectPiNotifyPushoverPriority`|fn||2443-2471|async function selectPiNotifyPushoverPriority(|
|
|
5638
|
+
|`buildPiNotifyMenuChoices`|fn||2480-2538|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
|
|
5639
|
+
|`selectPiNotifySoundLevel`|fn||2548-2588|async function selectPiNotifySoundLevel(|
|
|
5640
|
+
|`configurePiNotifyMenu`|fn||2598-2884|async function configurePiNotifyMenu(|
|
|
5641
|
+
|`registerPiNotifyShortcut`|fn||2899-2922|function registerPiNotifyShortcut(|
|
|
5642
|
+
|`resolveReqResetPromptRequest`|fn||2930-2956|function resolveReqResetPromptRequest(|
|
|
5643
|
+
|`isWorktreeBacked`|fn||2933-2940|const isWorktreeBacked = (request: PromptCommandExecution...|
|
|
5644
|
+
|`registerReqResetCommand`|fn||2966-3020|function registerReqResetCommand(|
|
|
5645
|
+
|`registerReqReferencesCommand`|fn||3030-3070|function registerReqReferencesCommand(|
|
|
5646
|
+
|`registerPromptCommands`|fn||3080-3201|function registerPromptCommands(|
|
|
5647
|
+
|`registerAgentTools`|fn||3211-3510|function registerAgentTools(pi: ExtensionAPI): void|
|
|
5648
|
+
|`buildPiUsereqToolsMenuChoices`|fn||3555-3580|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
|
|
5649
|
+
|`buildPiUsereqToolToggleChoices`|fn||3590-3604|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
|
|
5650
|
+
|`configurePiUsereqToolsMenu`|fn||3615-3732|async function configurePiUsereqToolsMenu(|
|
|
5651
|
+
|`getStaticCheckLanguageConfigForMenu`|fn||3741-3746|function getStaticCheckLanguageConfigForMenu(|
|
|
5652
|
+
|`countConfiguredStaticCheckLanguages`|fn||3754-3756|function countConfiguredStaticCheckLanguages(config: UseR...|
|
|
5653
|
+
|`countEnabledStaticCheckLanguages`|fn||3764-3766|function countEnabledStaticCheckLanguages(config: UseReqC...|
|
|
5654
|
+
|`resetStaticCheckConfig`|fn||3775-3777|function resetStaticCheckConfig(config: UseReqConfig): void|
|
|
5655
|
+
|`formatStaticCheckLanguagesSummary`|fn||3785-3787|function formatStaticCheckLanguagesSummary(config: UseReq...|
|
|
5656
|
+
|`buildStaticCheckMenuChoices`|fn||3796-3828|function buildStaticCheckMenuChoices(config: UseReqConfig...|
|
|
5657
|
+
|`buildSupportedStaticCheckLanguageChoices`|fn||3836-3853|function buildSupportedStaticCheckLanguageChoices(config:...|
|
|
5658
|
+
|`buildConfiguredStaticCheckLanguageChoices`|fn||3861-3878|function buildConfiguredStaticCheckLanguageChoices(config...|
|
|
5659
|
+
|`configureStaticCheckMenu`|fn||3888-4034|async function configureStaticCheckMenu(|
|
|
5660
|
+
|`formatContextFilesSummary`|fn||4043-4045|function formatContextFilesSummary(config: UseReqConfig):...|
|
|
5661
|
+
|`buildContextFilesMenuChoices`|fn||4054-4081|function buildContextFilesMenuChoices(config: UseReqConfi...|
|
|
5662
|
+
|`configureContextFilesMenu`|fn||4092-4150|async function configureContextFilesMenu(|
|
|
5663
|
+
|`setFlag`|fn||4097-4101|const setFlag = (flagKey: "context-files-requirements" | ...|
|
|
5664
|
+
|`buildPiUsereqMenuChoices`|fn||4160-4265|function buildPiUsereqMenuChoices(|
|
|
5665
|
+
|`buildSrcDirMenuChoices`|fn||4274-4292|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
|
|
5666
|
+
|`buildSrcDirRemovalChoices`|fn||4301-4313|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
|
|
5667
|
+
|`configurePiUsereq`|fn||4324-4582|async function configurePiUsereq(|
|
|
5668
|
+
|`persistConfigChange`|fn||4335-4340|const persistConfigChange = () =>|
|
|
5669
|
+
|`registerConfigCommands`|fn||4592-4602|function registerConfigCommands(|
|
|
5670
|
+
|`piUsereqExtension`|fn||4611-4624|export default function piUsereqExtension(pi: ExtensionAP...|
|
|
5671
5671
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "PI-useReq Requirements"
|
|
3
3
|
description: Software requirements specification
|
|
4
|
-
version: "0.0.
|
|
4
|
+
version: "0.0.76"
|
|
5
5
|
date: "2026-07-10"
|
|
6
6
|
author: "OpenAI Codex"
|
|
7
7
|
scope:
|
|
@@ -70,6 +70,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
70
70
|
- **CTN-016**: MUST NOT modify any path under `docs/` during analysis, implementation, verification, or bug fixing.
|
|
71
71
|
- **CTN-017**: MUST NOT modify any path under `pi.dev-src/` during analysis, implementation, verification, or bug fixing.
|
|
72
72
|
- **CTN-019**: MUST persist local `DEBUG_TOOL_COMMANDS_ENABLED` with allowed values `enable` and `disable`, defaulting to `disable`.
|
|
73
|
+
- **CTN-020**: MUST declare `tsx` as a runtime `package.json` dependency so `node --import tsx` package scripts, the `postinstall` checker installer, and the `.ts` extension entry resolve on clean consumer installs.
|
|
73
74
|
|
|
74
75
|
## 3. Requirements
|
|
75
76
|
|
|
@@ -257,7 +258,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
257
258
|
- **REQ-290**: MUST preserve the successful worktree execution transcript in the restored client-visible session after successful closure.
|
|
258
259
|
- **REQ-291**: MUST detect staged or unstaged `base-path` changes before successful closure merge and execute `git stash`, merge, and `git stash pop` in that order when changes exist.
|
|
259
260
|
- **REQ-292**: MUST complete successful stash-assisted closure without surfacing an error and MUST emit a warning that the restored `base-path` is not clean after merge.
|
|
260
|
-
- **REQ-209**: MUST
|
|
261
|
+
- **REQ-209**: MUST retain the worktree execution session, worktree, and branch, notify the pi CLI of closure failure, park workflow state in `error`, and leave the original base-path session unresumed when orchestrated session closure is interrupted, failed, aborted, or incomplete.
|
|
261
262
|
- **REQ-221**: MUST maintain one prompt-orchestration state machine with states `idle`, `checking`, `running`, `merging`, and `error`.
|
|
262
263
|
- **REQ-222**: MUST render `status` as the first single-line status field and refresh it on every internal or pi CLI state transition.
|
|
263
264
|
- **REQ-223**: MUST render `status:error` with theme `error` plus terminal blink when supported, and other `status` values with the existing non-error status-bar convention.
|
|
@@ -282,7 +283,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
282
283
|
- **REQ-313**: MUST make failing `req-reset` surface restoration or cleanup failures, transition workflow state to `error`, and preserve already-completed cleanup effects.
|
|
283
284
|
- **REQ-228**: MUST transition workflow state to `merging` immediately before merge and worktree/branch deletion begin during successful orchestrated session closure.
|
|
284
285
|
- **REQ-229**: MUST transition workflow state to `error` and notify the pi CLI when base-path restoration, merge, or worktree/branch deletion verification fails during orchestrated session closure.
|
|
285
|
-
- **REQ-230**: MUST transition workflow state to `idle` before the orchestrated session-closure handler returns.
|
|
286
|
+
- **REQ-230**: MUST transition workflow state to `idle` before the orchestrated session-closure handler returns for completed runs.
|
|
286
287
|
- **REQ-219**: MUST verify created worktree registration via `git worktree list`, branch presence via `git branch` list, and filesystem path existence before changing the prompt execution path or dispatching a prompt message.
|
|
287
288
|
- **REQ-256**: MUST store `base-path`, `context-path`, `git-path`, `parent-path`, `base-dir`, `worktree-dir`, `worktree-path`, branch name, original session file, and execution session file inside prompt-orchestration runtime state.
|
|
288
289
|
- **REQ-272**: MUST verify post-switch execution targets before agent start using replacement-session context when available, the persisted execution-session header cwd, and `process.cwd()`, and MUST NOT rely on stale pre-switch session-bound objects.
|
|
@@ -509,7 +510,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
509
510
|
- **TST-055**: MUST verify bundled prompt-backed `req-<prompt>` commands enforce the documented required-doc matrix, create no worktree, and dispatch no prompt when a required doc is missing.
|
|
510
511
|
- **TST-056**: MUST verify worktree-backed `req-<prompt>` commands derive `worktree-dir` from persisted `GIT_WORKTREE_PREFIX` for both default and override values.
|
|
511
512
|
- **TST-057**: MUST verify `req-<prompt>` commands create `worktree-path`, dispatch prompts through the replacement-session context of the switched execution session, and run tool executions against prepared `context-path`.
|
|
512
|
-
- **TST-058**: MUST verify worktree-backed `req-<prompt>` commands skip merge plus worktree/branch deletion,
|
|
513
|
+
- **TST-058**: MUST verify worktree-backed `req-<prompt>` commands skip merge plus worktree/branch deletion, retain the worktree execution session, notify closure failure, and park workflow state `error` when the matched run ends interrupted, failed, or aborted.
|
|
513
514
|
- **TST-061**: MUST verify `req-<prompt>` commands skip worktree creation when `AUTO_GIT_COMMIT=disable`, even if persisted `GIT_WORKTREE_ENABLED=enable`.
|
|
514
515
|
- **TST-064**: MUST verify worktree-backed `req-<prompt>` commands confirm created worktree directory plus branch existence before prompt dispatch and abort without dispatch when verification fails.
|
|
515
516
|
- **TST-067**: MUST verify `status:error` renders with blinking error styling and non-error `status` values follow the documented status-bar theme convention.
|
|
@@ -556,7 +557,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
556
557
|
- `@sinclair/typebox` provides runtime tool parameter schemas and is declared as a peer dependency evidenced by `src/index.ts`, `package.json`, and `package-lock.json`.
|
|
557
558
|
- `js-tiktoken` provides token counting evidence in `src/core/token-counter.ts`, `package.json`, and `package-lock.json`.
|
|
558
559
|
- `fast-glob` provides wildcard expansion for static-check inputs evidence in `src/core/static-check.ts`, `package.json`, and `package-lock.json`.
|
|
559
|
-
- `tsx` is the manifest-declared TypeScript execution runner for
|
|
560
|
+
- `tsx` is the manifest-declared runtime dependency and TypeScript execution runner for package scripts, the `postinstall` checker installer, and the `.ts` extension entry, evidenced by `package.json` and `package-lock.json`.
|
|
560
561
|
- `typescript` is the manifest-declared compiler and type-checker evidenced by `package.json`, `package-lock.json`, and `tsconfig.json`.
|
|
561
562
|
- `git` CLI is a runtime dependency for repository discovery, source-file collection, bundled prompt-command worktree orchestration, and direct `req-references` commit orchestration evidenced in `src/core/tool-runner.ts`, `src/core/prompt-command-runtime.ts`, and `src/core/req-references-command.ts`.
|
|
562
563
|
|
|
@@ -990,7 +990,7 @@
|
|
|
990
990
|
- `setPiUsereqRuntimeSoundLevel(...)`: store the cycled runtime sound level and refresh the footer [`src/core/extension-status.ts`]
|
|
991
991
|
- `renderPiUsereqStatus(...)`: refresh the single-line footer after shortcut-driven runtime sound changes [`src/core/extension-status.ts`]
|
|
992
992
|
- `registerExtensionStatusHooks(...)`: register shared wrappers for lifecycle telemetry hooks and suppress the documented stale-extension-context callbacks that can arrive after successful session replacement [`src/index.ts`]
|
|
993
|
-
- `handleExtensionStatusEvent(...)`: process intercepted hook payloads through shared status helpers, tool-result debug logging, dedicated workflow-closure plus shutdown diagnostics built from pre-shutdown prompt snapshots, workflow-state transitions, recover a live bootstrap cwd during `session_start` when stale context mirrors still point at deleted worktrees, matched-success prompt-command restoration to `base-path` plus stash-assisted merge and worktree deletion even after a busy-command rejection moved workflow state to `error`, warning-only closure notifications when restored `base-path` changes are reapplied, stale-safe closure notifications, and matched-failure
|
|
993
|
+
- `handleExtensionStatusEvent(...)`: process intercepted hook payloads through shared status helpers, tool-result debug logging, dedicated workflow-closure plus shutdown diagnostics built from pre-shutdown prompt snapshots, workflow-state transitions, recover a live bootstrap cwd during `session_start` when stale context mirrors still point at deleted worktrees, matched-success prompt-command restoration to `base-path` plus stash-assisted merge and worktree deletion even after a busy-command rejection moved workflow state to `error`, warning-only closure notifications when restored `base-path` changes are reapplied, stale-safe closure notifications, and matched-failure worktree-execution-session retention plus closure-error notification and workflow `error` parking without resuming `base-path` so the failure stays visible, leaving `base-path` restoration plus worktree and branch cleanup to `req-reset` [`src/index.ts`]
|
|
994
994
|
- `resolveLiveBootstrapCwd(...)`: recover a live bootstrap cwd from the startup context, runtime path state, or process cwd when stale worktree paths no longer exist [`src/index.ts`]
|
|
995
995
|
- `syncContextCwdMirror(...)`: best-effort realign the startup context `cwd` mirror to the recovered live cwd before startup config loads [`src/index.ts`]
|
|
996
996
|
- `loadProjectConfig(...)`: session-start configuration load from the recovered live cwd [`src/index.ts`]
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
- `finalizePromptCommandMerge(...)`: inspect tracked `base-path` changes, run `git stash` plus `git stash pop` around the existing `--ff-only` merge when tracked changes exist, emit a warning-only merge result after reapplying local changes, and append selected merge debug entries [`src/core/prompt-command-runtime.ts`]
|
|
1099
1099
|
- `listPromptTrackedBasePathChanges(...)`: parse tracked staged or unstaged `git status --porcelain` rows and ignore untracked or ignored rows before stash-assisted merge selection [`src/core/prompt-command-runtime.ts`]
|
|
1100
1100
|
- `deletePromptWorktree(...)`: delete the merged worktree and branch after successful stash-assisted fast-forward merge [`src/core/prompt-command-runtime.ts`]
|
|
1101
|
-
- `restorePromptCommandExecution(...)`:
|
|
1101
|
+
- `restorePromptCommandExecution(...)`: reset runtime path state for non-worktree prompt-end events; worktree-backed interrupted, failed, aborted, or incomplete runs skip restoration, retain the worktree execution session, park workflow state in `error`, and leave `base-path` restoration plus worktree and branch cleanup to `req-reset` [`src/core/prompt-command-runtime.ts`]
|
|
1102
1102
|
- `shouldRunPiNotifyCommand(...)`: validate prompt-scoped command-notify prerequisites [`src/core/pi-notify.ts`]
|
|
1103
1103
|
- `isPiNotifyOutcomeEnabled(...)`: map `completed|interrupted|failed` to the selected toggle set [`src/core/pi-notify.ts`]
|
|
1104
1104
|
- `runPiNotifyCommand(...)`: execute `PI_NOTIFY_CMD` with runtime placeholder substitution [`src/core/pi-notify.ts`]
|
package/src/index.ts
CHANGED
|
@@ -1454,6 +1454,26 @@ async function handleExtensionStatusEvent(
|
|
|
1454
1454
|
) {
|
|
1455
1455
|
notifyContextSafely(promptContext, finalization.warningMessage, "info");
|
|
1456
1456
|
}
|
|
1457
|
+
} else if (closureFailureMessage !== undefined) {
|
|
1458
|
+
// Worktree-backed run that ended interrupted, failed, aborted, or
|
|
1459
|
+
// incomplete (REQ-209): keep the worktree execution session visible,
|
|
1460
|
+
// surface the closure-failure error, park the workflow in `error`, and
|
|
1461
|
+
// retain the active request so `req-reset` can restore `base-path` and
|
|
1462
|
+
// remove the retained worktree plus branch. The original base-path
|
|
1463
|
+
// session MUST NOT be resumed here so the failure stays visible.
|
|
1464
|
+
notifyContextSafely(promptContext, closureFailureMessage, "error");
|
|
1465
|
+
if (debugConfig) {
|
|
1466
|
+
transitionPromptWorkflowState(
|
|
1467
|
+
statusController,
|
|
1468
|
+
promptContext,
|
|
1469
|
+
activePromptRequest.basePath,
|
|
1470
|
+
debugConfig,
|
|
1471
|
+
activePromptRequest.promptName,
|
|
1472
|
+
"error",
|
|
1473
|
+
);
|
|
1474
|
+
} else {
|
|
1475
|
+
setPiUsereqWorkflowState(statusController, "error", promptContext);
|
|
1476
|
+
}
|
|
1457
1477
|
} else {
|
|
1458
1478
|
try {
|
|
1459
1479
|
promptContext = (await restorePromptCommandExecution(
|
|
@@ -1463,9 +1483,6 @@ async function handleExtensionStatusEvent(
|
|
|
1463
1483
|
? { config: debugConfig, workflowState: statusController.state.workflowState }
|
|
1464
1484
|
: undefined,
|
|
1465
1485
|
) ?? promptContext) as typeof ctx;
|
|
1466
|
-
if (closureFailureMessage !== undefined) {
|
|
1467
|
-
notifyContextSafely(promptContext, closureFailureMessage, "error");
|
|
1468
|
-
}
|
|
1469
1486
|
} catch (error) {
|
|
1470
1487
|
promptContext = (getPromptCommandErrorContext(error) ?? promptContext) as typeof ctx;
|
|
1471
1488
|
if (debugConfig) {
|
|
@@ -1483,19 +1500,21 @@ async function handleExtensionStatusEvent(
|
|
|
1483
1500
|
notifyContextSafely(promptContext, error instanceof Error ? error.message : String(error), "error");
|
|
1484
1501
|
}
|
|
1485
1502
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1503
|
+
if (closureFailureMessage === undefined) {
|
|
1504
|
+
statusController.state.pendingPromptRequest = undefined;
|
|
1505
|
+
statusController.state.activePromptRequest = undefined;
|
|
1506
|
+
if (debugConfig) {
|
|
1507
|
+
transitionPromptWorkflowState(
|
|
1508
|
+
statusController,
|
|
1509
|
+
promptContext,
|
|
1510
|
+
activePromptRequest.basePath,
|
|
1511
|
+
debugConfig,
|
|
1512
|
+
activePromptRequest.promptName,
|
|
1513
|
+
"idle",
|
|
1514
|
+
);
|
|
1515
|
+
} else {
|
|
1516
|
+
setPiUsereqWorkflowState(statusController, "idle", promptContext);
|
|
1517
|
+
}
|
|
1499
1518
|
}
|
|
1500
1519
|
}
|
|
1501
1520
|
}
|
|
@@ -3633,7 +3633,7 @@ test("worktree-enabled prompt commands honor overridden worktree prefixes", asyn
|
|
|
3633
3633
|
}
|
|
3634
3634
|
});
|
|
3635
3635
|
|
|
3636
|
-
test("worktree-backed prompt failures
|
|
3636
|
+
test("worktree-backed prompt failures keep the worktree session, retain worktree, and park in error", async () => {
|
|
3637
3637
|
const { projectBase } = initFixtureRepo({ fixtures: [] });
|
|
3638
3638
|
const previousCwd = process.cwd();
|
|
3639
3639
|
try {
|
|
@@ -3658,8 +3658,11 @@ test("worktree-backed prompt failures skip merge, restore base-path, and retain
|
|
|
3658
3658
|
messages: [{ role: "assistant", stopReason: "error", content: [] }],
|
|
3659
3659
|
}, ctx);
|
|
3660
3660
|
|
|
3661
|
-
|
|
3662
|
-
|
|
3661
|
+
// The original base-path session MUST NOT be resumed on failure; the
|
|
3662
|
+
// client stays on the worktree execution session so the failure stays
|
|
3663
|
+
// visible until req-reset restores base-path and removes the worktree.
|
|
3664
|
+
assert.equal(process.cwd(), executionBasePath);
|
|
3665
|
+
assert.equal(ctx.cwd, executionBasePath);
|
|
3663
3666
|
assert.equal(fs.existsSync(executionBasePath), true);
|
|
3664
3667
|
assert.equal(fs.existsSync(path.join(projectBase, "src", "failed.ts")), false);
|
|
3665
3668
|
assert.equal(
|
|
@@ -3674,8 +3677,8 @@ test("worktree-backed prompt failures skip merge, restore base-path, and retain
|
|
|
3674
3677
|
assert.equal(
|
|
3675
3678
|
ctx.__state.statuses.get("pi-usereq"),
|
|
3676
3679
|
buildExpectedFakeStatusText({
|
|
3677
|
-
workflowState: "
|
|
3678
|
-
basePath: buildExpectedFakeBasePath(
|
|
3680
|
+
workflowState: "error",
|
|
3681
|
+
basePath: buildExpectedFakeBasePath(executionBasePath),
|
|
3679
3682
|
docsDir: DEFAULT_DOCS_DIR,
|
|
3680
3683
|
testsDir: "tests",
|
|
3681
3684
|
srcDir: ["src"],
|