pi-usereq 0.10.0 → 0.11.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 +1 -1
- package/pi-usereq/docs/REFERENCES.md +365 -335
- package/pi-usereq/docs/REQUIREMENTS.md +25 -22
- package/pi-usereq/docs/WORKFLOW.md +57 -28
- package/src/core/debug-runtime.ts +2 -2
- package/src/core/extension-status.ts +35 -30
- package/src/core/prompt-command-runtime.ts +168 -2
- package/src/core/runtime-project-paths.ts +21 -1
- package/src/index.ts +10 -22
- package/tests/debug-extension-harness.test.ts +9 -3
- package/tests/extension-registration.test.ts +111 -25
|
@@ -1127,13 +1127,12 @@ import {
|
|
|
1127
1127
|
|
|
1128
1128
|
---
|
|
1129
1129
|
|
|
1130
|
-
# extension-status.ts | TypeScript |
|
|
1130
|
+
# extension-status.ts | TypeScript | 823L | 43 symbols | 5 imports | 45 comments
|
|
1131
1131
|
> Path: `src/core/extension-status.ts`
|
|
1132
1132
|
- @brief Tracks pi-usereq extension status state and renders status-bar telemetry.
|
|
1133
|
-
- @details Centralizes hook interception, context-usage snapshots, run timing,
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
rendering. Side effects are limited to in-memory state mutation and interval
|
|
1133
|
+
- @details Centralizes hook interception, context-usage snapshots, active-branch lookup, run timing, and deterministic status-bar formatting for the pi-usereq extension. Runtime
|
|
1134
|
+
is O(1) per event plus interval-driven re-renders while a prompt remains
|
|
1135
|
+
active. Side effects are limited to in-memory state mutation and interval
|
|
1137
1136
|
scheduling through exported controller helpers.
|
|
1138
1137
|
|
|
1139
1138
|
## Imports
|
|
@@ -1142,125 +1141,125 @@ import type {
|
|
|
1142
1141
|
import type { UseReqConfig } from "./config.js";
|
|
1143
1142
|
import type { PromptCommandExecutionPlan } from "./prompt-command-runtime.js";
|
|
1144
1143
|
import {
|
|
1145
|
-
import {
|
|
1144
|
+
import { resolveRuntimeGitBranchName } from "./runtime-project-paths.js";
|
|
1146
1145
|
```
|
|
1147
1146
|
|
|
1148
1147
|
## Definitions
|
|
1149
1148
|
|
|
1150
|
-
- type `type StatusForegroundColor = Extract<` (
|
|
1149
|
+
- type `type StatusForegroundColor = Extract<` (L30)
|
|
1151
1150
|
- @brief Enumerates the CLI-supported theme tokens consumed by status rendering.
|
|
1152
1151
|
- @details Restricts the status formatter to documented pi theme tokens so the
|
|
1153
1152
|
status bar remains compatible with the active CLI theme schema. Compile-time
|
|
1154
1153
|
only and introduces no runtime cost.
|
|
1155
|
-
### iface `interface RawStatusTheme` (
|
|
1154
|
+
### iface `interface RawStatusTheme` (L40-42)
|
|
1156
1155
|
- @brief Describes the raw theme capabilities required for status rendering.
|
|
1157
1156
|
- @details Accepts the `ctx.ui.theme` foreground renderer used by the
|
|
1158
1157
|
single-line footer. Compile-time only and introduces no runtime cost.
|
|
1159
1158
|
|
|
1160
|
-
### iface `interface StatusThemeAdapter` (
|
|
1159
|
+
### iface `interface StatusThemeAdapter` (L50-55)
|
|
1161
1160
|
- @brief Describes the normalized theme adapter used by status formatters.
|
|
1162
1161
|
- @details Exposes deterministic label, value, foreground, and separator
|
|
1163
1162
|
renderers so status text generation stays independent from the raw theme API.
|
|
1164
1163
|
Compile-time only and introduces no runtime cost.
|
|
1165
1164
|
|
|
1166
|
-
- type `export type PiUsereqStatusHookName = (typeof PI_USEREQ_STATUS_HOOK_NAMES)[number];` (
|
|
1165
|
+
- type `export type PiUsereqStatusHookName = (typeof PI_USEREQ_STATUS_HOOK_NAMES)[number];` (L98)
|
|
1167
1166
|
- @brief Represents one hook name handled by the pi-usereq status controller.
|
|
1168
1167
|
- @details Narrows hook registration and event-update calls to the canonical
|
|
1169
1168
|
intercepted-hook set. Compile-time only and introduces no runtime cost.
|
|
1170
|
-
- type `export type PiUsereqPromptRequest = PromptCommandExecutionPlan;` (
|
|
1169
|
+
- type `export type PiUsereqPromptRequest = PromptCommandExecutionPlan;` (L104)
|
|
1171
1170
|
- @brief Describes one prompt request tracked across extension command delivery and runtime execution.
|
|
1172
1171
|
- @details Reuses the prepared prompt-command execution plan so status rendering and prompt-end side effects can recover the original project base, active execution base, and optional worktree metadata for the current prompt run. The alias is compile-time only and introduces no runtime cost.
|
|
1173
|
-
- type `export type PiUsereqWorkflowState = "idle" | "checking" | "running" | "merging" | "error";` (
|
|
1172
|
+
- type `export type PiUsereqWorkflowState = "idle" | "checking" | "running" | "merging" | "error";` (L110)
|
|
1174
1173
|
- @brief Represents one prompt-orchestration workflow state displayed in the status bar.
|
|
1175
1174
|
- @details Narrows workflow tracking to the documented `idle`, `checking`, `running`, `merging`, and `error` states reused by prompt-command gating, prompt-end orchestration, and status rendering. Compile-time only and introduces no runtime cost.
|
|
1176
|
-
### iface `export interface PiUsereqStatusState` (
|
|
1175
|
+
### iface `export interface PiUsereqStatusState` (L116-124)
|
|
1177
1176
|
- @brief Stores the mutable runtime facts displayed by the status bar.
|
|
1178
1177
|
- @details Persists the prompt-orchestration workflow state, the latest context-usage snapshot, the active run start timestamp, the most recent normally completed run duration, the accumulated duration of all normally completed runs, and prompt-request metadata carried from command dispatch into the next runtime execution. Runtime state is mutated in-place by controller helpers. Compile-time only and introduces no runtime cost.
|
|
1179
1178
|
|
|
1180
|
-
### iface `export interface PiUsereqStatusController` (
|
|
1179
|
+
### iface `export interface PiUsereqStatusController` (L133-138)
|
|
1181
1180
|
- @brief Stores the controller state required for event-driven status updates.
|
|
1182
1181
|
- @details Keeps the mutable status snapshot, the current configuration, the
|
|
1183
1182
|
latest extension context used for rendering, and the interval handle used
|
|
1184
1183
|
for live elapsed-time refreshes. Compile-time only and introduces no runtime
|
|
1185
1184
|
cost.
|
|
1186
1185
|
|
|
1187
|
-
### iface `interface PiUsereqStatusPersistenceStore` (
|
|
1186
|
+
### iface `interface PiUsereqStatusPersistenceStore` (L144-147)
|
|
1188
1187
|
- @brief Stores the process-scoped elapsed-timer snapshot reused across session replacement.
|
|
1189
1188
|
- @details Preserves only the latest completed duration and accumulated completed runtime so `/new`, `/resume`, and `/fork` can restore elapsed counters after the extension runtime is rebound. Compile-time only and introduces no runtime cost.
|
|
1190
1189
|
|
|
1191
|
-
### fn `function getPiUsereqStatusPersistenceStore(): PiUsereqStatusPersistenceStore` (
|
|
1190
|
+
### fn `function getPiUsereqStatusPersistenceStore(): PiUsereqStatusPersistenceStore` (L161-170)
|
|
1192
1191
|
- @brief Returns the process-scoped elapsed-timer persistence store.
|
|
1193
1192
|
- @details Lazily initializes one internal `globalThis` record because pi rebinds extension modules for `/new`, `/resume`, `/fork`, and `/reload`, but the hosting process persists across those operations. Runtime is O(1). Side effect: initializes internal process-scoped state on first access.
|
|
1194
1193
|
- @return {PiUsereqStatusPersistenceStore} Mutable persistence record.
|
|
1195
1194
|
- @note Design rationale: required to preserve elapsed counters across session replacement without writing session-global menu state into project configuration.
|
|
1196
1195
|
|
|
1197
|
-
### fn `function restorePersistedElapsedState(state: PiUsereqStatusState): void` (
|
|
1196
|
+
### fn `function restorePersistedElapsedState(state: PiUsereqStatusState): void` (L178-182)
|
|
1198
1197
|
- @brief Restores persisted elapsed counters into one mutable status snapshot.
|
|
1199
1198
|
- @details Copies the process-scoped last-run and accumulated completed durations into the supplied controller state so rebinding events can continue showing prior counters. Runtime is O(1). Side effect: mutates `state`.
|
|
1200
1199
|
- @param[in,out] state {PiUsereqStatusState} Mutable status state.
|
|
1201
1200
|
- @return {void} No return value.
|
|
1202
1201
|
|
|
1203
|
-
### fn `function persistElapsedState(state: PiUsereqStatusState): void` (
|
|
1202
|
+
### fn `function persistElapsedState(state: PiUsereqStatusState): void` (L190-194)
|
|
1204
1203
|
- @brief Persists elapsed counters from one mutable status snapshot.
|
|
1205
1204
|
- @details Copies the current last-run and accumulated completed durations into the process-scoped store so later extension instances can restore them after session replacement. Runtime is O(1). Side effect: mutates internal process-scoped state.
|
|
1206
1205
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
1207
1206
|
- @return {void} No return value.
|
|
1208
1207
|
|
|
1209
|
-
### fn `function persistPromptCommandState(state: PiUsereqStatusState): void` (
|
|
1208
|
+
### fn `function persistPromptCommandState(state: PiUsereqStatusState): void` (L202-208)
|
|
1210
1209
|
- @brief Mirrors one controller prompt state into the process-scoped persistence store.
|
|
1211
1210
|
- @details Persists the current workflow state plus the pending and active prompt execution plans so prompt orchestration can survive session replacement. Runtime is O(1). Side effect: mutates process-scoped prompt-command persistence state.
|
|
1212
1211
|
- @param[in] state {PiUsereqStatusState} Current controller state snapshot.
|
|
1213
1212
|
- @return {void} No return value.
|
|
1214
1213
|
|
|
1215
|
-
### fn `export function shouldPreservePromptCommandStateOnShutdown(state: PiUsereqStatusState): boolean` (
|
|
1214
|
+
### fn `export function shouldPreservePromptCommandStateOnShutdown(state: PiUsereqStatusState): boolean` (L217-220)
|
|
1216
1215
|
- @brief Detects whether `session_shutdown` must preserve prompt-command state.
|
|
1217
1216
|
- @details Keeps both the in-memory controller prompt state and the process-scoped prompt execution plan intact while pi switches from the original session into the forked execution session, because the old extension instance can keep running the initiating command handler after `session_shutdown` fires and before the replacement session fully takes over. Runtime is O(1). No external state is mutated.
|
|
1218
1217
|
- @param[in] state {PiUsereqStatusState} Controller state before shutdown mutation.
|
|
1219
1218
|
- @return {boolean} `true` when prompt-command state must survive the shutdown event.
|
|
1220
1219
|
- @satisfies REQ-278
|
|
1221
1220
|
|
|
1222
|
-
### fn `function restorePersistedPromptCommandState(` (
|
|
1221
|
+
### fn `function restorePersistedPromptCommandState(` (L229-240)
|
|
1223
1222
|
- @brief Restores prompt-command persistence into one fresh controller when the active session matches.
|
|
1224
1223
|
- @details Rehydrates workflow state plus pending or active prompt execution plans only when the current session file targets the persisted execution session created for prompt orchestration. Runtime is O(1). Side effect: mutates `state` when persisted prompt state is available.
|
|
1225
1224
|
- @param[in] sessionFile {string | undefined} Current active session file.
|
|
1226
1225
|
- @param[in,out] state {PiUsereqStatusState} Mutable controller state.
|
|
1227
1226
|
- @return {void} No return value.
|
|
1228
1227
|
|
|
1229
|
-
### fn `function getContextSessionFile(ctx: ExtensionContext): string | undefined` (
|
|
1228
|
+
### fn `function getContextSessionFile(ctx: ExtensionContext): string | undefined` (L248-252)
|
|
1230
1229
|
- @brief Resolves the active session file exposed by one extension context.
|
|
1231
1230
|
- @details Reads the session-manager session-file getter when available so prompt-command persistence can be resynchronized on every lifecycle hook after session replacement. Runtime is O(1). No external state is mutated.
|
|
1232
1231
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1233
1232
|
- @return {string | undefined} Current session file when available.
|
|
1234
1233
|
|
|
1235
|
-
### fn `export function isStaleExtensionContextError(error: unknown): boolean` (
|
|
1234
|
+
### fn `export function isStaleExtensionContextError(error: unknown): boolean` (L261-264)
|
|
1236
1235
|
- @brief Detects stale extension-context access after session replacement.
|
|
1237
1236
|
- @details Matches the guarded pi runtime error emitted when one invalidated extension context, command context, or replacement-session context is accessed after session replacement or reload. Runtime is O(n) in message length only when an error is supplied. No external state is mutated.
|
|
1238
1237
|
- @param[in] error {unknown} Candidate thrown value.
|
|
1239
1238
|
- @return {boolean} `true` when the value matches the stale-extension-context runtime error.
|
|
1240
1239
|
- @satisfies REQ-280
|
|
1241
1240
|
|
|
1242
|
-
### fn `function resetElapsedState(state: PiUsereqStatusState): void` (
|
|
1241
|
+
### fn `function resetElapsedState(state: PiUsereqStatusState): void` (L273-277)
|
|
1243
1242
|
- @brief Resets the in-memory and persisted elapsed counters.
|
|
1244
1243
|
- @details Clears both completed-duration fields in the supplied state and mirrors that cleared snapshot into the process-scoped store. Runtime is O(1). Side effects include mutable state reset and process-scoped persistence update.
|
|
1245
1244
|
- @param[in,out] state {PiUsereqStatusState} Mutable status state.
|
|
1246
1245
|
- @return {void} No return value.
|
|
1247
1246
|
- @satisfies REQ-217
|
|
1248
1247
|
|
|
1249
|
-
### fn `function shouldResetElapsedStateOnSessionStart(event: unknown): boolean` (
|
|
1248
|
+
### fn `function shouldResetElapsedStateOnSessionStart(event: unknown): boolean` (L286-289)
|
|
1250
1249
|
- @brief Detects whether a `session_start` event must reset elapsed counters.
|
|
1251
1250
|
- @details Treats `startup` and `reload` as hard-reset boundaries while preserving counters for `new`, `resume`, and `fork`. Runtime is O(1). No external state is mutated.
|
|
1252
1251
|
- @param[in] event {unknown} Session-start payload.
|
|
1253
1252
|
- @return {boolean} `true` when elapsed counters must reset.
|
|
1254
1253
|
- @satisfies REQ-217
|
|
1255
1254
|
|
|
1256
|
-
### fn `function shouldResetWorkflowStateOnSessionStart(event: unknown): boolean` (
|
|
1255
|
+
### fn `function shouldResetWorkflowStateOnSessionStart(event: unknown): boolean` (L298-301)
|
|
1257
1256
|
- @brief Detects whether a `session_start` event must reset the workflow state to `idle`.
|
|
1258
1257
|
- @details Treats `startup`, `new`, and `reload` as workflow-reset boundaries so prompt-orchestration state never leaks across boot, explicit session replacement, or extension reload. Runtime is O(1). No external state is mutated.
|
|
1259
1258
|
- @param[in] event {unknown} Session-start payload.
|
|
1260
1259
|
- @return {boolean} `true` when workflow state must reset to `idle`.
|
|
1261
1260
|
- @satisfies REQ-009, REQ-221
|
|
1262
1261
|
|
|
1263
|
-
### fn `function createStatusThemeAdapter(theme: RawStatusTheme): StatusThemeAdapter` (
|
|
1262
|
+
### fn `function createStatusThemeAdapter(theme: RawStatusTheme): StatusThemeAdapter` (L311-320)
|
|
1264
1263
|
- @brief Builds the normalized theme adapter used by pi-usereq status formatters.
|
|
1265
1264
|
- @details Precomputes label, value, foreground, and separator renderers so
|
|
1266
1265
|
status formatting remains stable across real TUI themes and deterministic
|
|
@@ -1268,9 +1267,16 @@ test doubles. Runtime is O(1). No external state is mutated.
|
|
|
1268
1267
|
- @param[in] theme {RawStatusTheme} Raw theme implementation from `ctx.ui.theme`.
|
|
1269
1268
|
- @return {StatusThemeAdapter} Normalized status-theme adapter.
|
|
1270
1269
|
|
|
1271
|
-
### fn `const colorize = (color: StatusForegroundColor, text: string): string =>` (
|
|
1270
|
+
### fn `const colorize = (color: StatusForegroundColor, text: string): string =>` (L312-319)
|
|
1271
|
+
|
|
1272
|
+
### fn `function resolveStatusBranchValue(ctx: ExtensionContext): string` (L329-331)
|
|
1273
|
+
- @brief Resolves the active git branch value rendered in the status bar.
|
|
1274
|
+
- @details Reads the current branch from the active context working directory on every status render so worktree switches and restored base-session renders expose the latest branch immediately. Runtime is dominated by git execution when the working directory belongs to a repository. Side effects include subprocess creation.
|
|
1275
|
+
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1276
|
+
- @return {string} Active branch name or `unknown` when unavailable.
|
|
1277
|
+
- @satisfies REQ-121, REQ-283
|
|
1272
1278
|
|
|
1273
|
-
### fn `function normalizeContextUsage(` (
|
|
1279
|
+
### fn `function normalizeContextUsage(` (L342-359)
|
|
1274
1280
|
- @brief Normalizes one raw context-usage snapshot.
|
|
1275
1281
|
- @details Preserves the runtime token and context-window counts, derives a
|
|
1276
1282
|
percentage when the runtime omits it, clamps negative percentages to `0`,
|
|
@@ -1279,7 +1285,7 @@ external state is mutated.
|
|
|
1279
1285
|
- @param[in] contextUsage {ContextUsage | undefined} Raw runtime snapshot.
|
|
1280
1286
|
- @return {ContextUsage | undefined} Normalized snapshot.
|
|
1281
1287
|
|
|
1282
|
-
### fn `function refreshContextUsage(` (
|
|
1288
|
+
### fn `function refreshContextUsage(` (L371-376)
|
|
1283
1289
|
- @brief Refreshes the stored context-usage snapshot from the active extension context.
|
|
1284
1290
|
- @details Calls `ctx.getContextUsage()` on every intercepted event so the
|
|
1285
1291
|
controller retains the newest context-usage facts available from the pi
|
|
@@ -1289,24 +1295,22 @@ runtime. Runtime is O(1). Side effect: mutates `state.contextUsage`.
|
|
|
1289
1295
|
- @return {void} No return value.
|
|
1290
1296
|
- @satisfies REQ-118, REQ-119
|
|
1291
1297
|
|
|
1292
|
-
### fn `function resolveContextUsageIconText(` (
|
|
1298
|
+
### fn `function resolveContextUsageIconText(` (L385-402)
|
|
1293
1299
|
- @brief Resolves the icon text for one normalized context-usage snapshot.
|
|
1294
|
-
- @details Maps context usage to one fixed-width icon band so footer rendering
|
|
1295
|
-
remains compact and deterministic. Unavailable usage degrades to the `0%`
|
|
1296
|
-
icon. Runtime is O(1). No external state is mutated.
|
|
1300
|
+
- @details Maps context usage to one fixed-width icon band so footer rendering remains compact and deterministic across the documented `0`, `>0-<25`, `>=25-<50`, `>=50-<75`, and `>=75` percent bands. Unavailable usage degrades to the `0%` icon. Runtime is O(1). No external state is mutated.
|
|
1297
1301
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
1298
1302
|
- @return {string} Fixed-width gauge icon text.
|
|
1299
|
-
- @satisfies REQ-
|
|
1303
|
+
- @satisfies REQ-122, REQ-284
|
|
1300
1304
|
|
|
1301
|
-
### fn `function formatContextUsageBar(` (
|
|
1305
|
+
### fn `function formatContextUsageBar(` (L412-424)
|
|
1302
1306
|
- @brief Formats one icon-based context-usage gauge.
|
|
1303
|
-
- @details Renders the documented
|
|
1307
|
+
- @details Renders the documented gauge icon with theme `error` for `>=90%`, enables terminal blink only for `>=100%`, and otherwise leaves the gauge in the default terminal color. Runtime is O(1). No external state is mutated.
|
|
1304
1308
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1305
1309
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
1306
1310
|
- @return {string} Rendered fixed-width gauge icon.
|
|
1307
|
-
- @satisfies REQ-
|
|
1311
|
+
- @satisfies REQ-122, REQ-126, REQ-127, REQ-128, REQ-233, REQ-284
|
|
1308
1312
|
|
|
1309
|
-
### fn `function formatStatusDuration(durationMs: number): string` (
|
|
1313
|
+
### fn `function formatStatusDuration(durationMs: number): string` (L435-440)
|
|
1310
1314
|
- @brief Formats one elapsed-duration value as `M:SS`.
|
|
1311
1315
|
- @details Floors the input to whole seconds, keeps minutes unbounded above 59,
|
|
1312
1316
|
and zero-pads seconds to two digits. Runtime is O(1). No external state is
|
|
@@ -1315,7 +1319,7 @@ mutated.
|
|
|
1315
1319
|
- @return {string} Duration rendered as `M:SS`.
|
|
1316
1320
|
- @satisfies REQ-125
|
|
1317
1321
|
|
|
1318
|
-
### fn `function formatCompletedStatusDuration(` (
|
|
1322
|
+
### fn `function formatCompletedStatusDuration(` (L451-455)
|
|
1319
1323
|
- @brief Formats one optional completed-duration value.
|
|
1320
1324
|
- @details Returns the canonical unset placeholder `--:--` until the supplied
|
|
1321
1325
|
timer receives a normally completed prompt duration, then delegates to
|
|
@@ -1324,7 +1328,7 @@ timer receives a normally completed prompt duration, then delegates to
|
|
|
1324
1328
|
- @return {string} Rendered duration or unset placeholder.
|
|
1325
1329
|
- @satisfies REQ-124
|
|
1326
1330
|
|
|
1327
|
-
### fn `function formatElapsedStatusValue(` (
|
|
1331
|
+
### fn `function formatElapsedStatusValue(` (L468-478)
|
|
1328
1332
|
- @brief Formats the consolidated `elapsed` status-bar value.
|
|
1329
1333
|
- @details Emits the active prompt segment `⏱︎ <active>`, the latest normally
|
|
1330
1334
|
completed segment `⚑ <last>`, and the accumulated successful-runtime segment
|
|
@@ -1335,7 +1339,7 @@ mutated.
|
|
|
1335
1339
|
- @return {string} Consolidated `elapsed` field value.
|
|
1336
1340
|
- @satisfies REQ-123, REQ-124, REQ-125, REQ-159
|
|
1337
1341
|
|
|
1338
|
-
### fn `function formatStatusField(` (
|
|
1342
|
+
### fn `function formatStatusField(` (L489-495)
|
|
1339
1343
|
- @brief Formats one standard status-bar field.
|
|
1340
1344
|
- @details Renders the field label in accent color and the value in warning
|
|
1341
1345
|
color. Runtime is O(n) in combined text length. No external state is mutated.
|
|
@@ -1344,7 +1348,7 @@ color. Runtime is O(n) in combined text length. No external state is mutated.
|
|
|
1344
1348
|
- @param[in] value {string} Unstyled field value.
|
|
1345
1349
|
- @return {string} Rendered status-field fragment.
|
|
1346
1350
|
|
|
1347
|
-
### fn `function formatRenderedStatusField(` (
|
|
1351
|
+
### fn `function formatRenderedStatusField(` (L507-513)
|
|
1348
1352
|
- @brief Formats one pre-rendered status-bar field value.
|
|
1349
1353
|
- @details Preserves the accent-colored field label while allowing callers to
|
|
1350
1354
|
provide a custom styled value such as the context-usage bar. Runtime is O(n)
|
|
@@ -1354,7 +1358,7 @@ in combined text length. No external state is mutated.
|
|
|
1354
1358
|
- @param[in] renderedValue {string} Pre-rendered field value.
|
|
1355
1359
|
- @return {string} Rendered status-field fragment.
|
|
1356
1360
|
|
|
1357
|
-
### fn `function formatWorkflowStateValue(` (
|
|
1361
|
+
### fn `function formatWorkflowStateValue(` (L523-531)
|
|
1358
1362
|
- @brief Formats the rendered workflow-state value for the `status` field.
|
|
1359
1363
|
- @details Uses the standard warning-colored value renderer for non-error states and emits a blinking `error`-colored value for `status:error` so the footer highlights orchestration failures immediately. Runtime is O(n) in text length. No external state is mutated.
|
|
1360
1364
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
@@ -1362,7 +1366,7 @@ in combined text length. No external state is mutated.
|
|
|
1362
1366
|
- @return {string} Rendered workflow-state value.
|
|
1363
1367
|
- @satisfies REQ-112, REQ-223
|
|
1364
1368
|
|
|
1365
|
-
### fn `function didAgentEndAbort(messages: AgentEndEvent["messages"]): boolean` (
|
|
1369
|
+
### fn `function didAgentEndAbort(messages: AgentEndEvent["messages"]): boolean` (L542-549)
|
|
1366
1370
|
- @brief Detects whether an agent run ended through abort semantics.
|
|
1367
1371
|
- @details Treats any assistant message whose `stopReason` equals `aborted` as
|
|
1368
1372
|
an escape-triggered termination that must not overwrite the `last` timer.
|
|
@@ -1371,18 +1375,18 @@ Runtime is O(n) in message count. No external state is mutated.
|
|
|
1371
1375
|
- @return {boolean} `true` when the run ended in aborted state.
|
|
1372
1376
|
- @satisfies REQ-125
|
|
1373
1377
|
|
|
1374
|
-
### fn `function buildPiUsereqStatusText(` (
|
|
1378
|
+
### fn `function buildPiUsereqStatusText(` (L562-586)
|
|
1375
1379
|
- @brief Builds the full single-line pi-usereq status-bar payload.
|
|
1376
|
-
- @details Renders status,
|
|
1377
|
-
- @param[in] cwd {string} Runtime working directory used for context-path derivation.
|
|
1380
|
+
- @details Renders status, branch, context, elapsed, and sound fields in the canonical order with dim bullet separators, workflow-state highlighting, and the documented icon-based context gauge. Runtime is O(1). No external state is mutated.
|
|
1378
1381
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
1379
1382
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1380
1383
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
1384
|
+
- @param[in] branchName {string} Active git branch name shown in the footer.
|
|
1381
1385
|
- @param[in] nowMs {number} Current wall-clock time in milliseconds.
|
|
1382
1386
|
- @return {string} Single-line status-bar text.
|
|
1383
|
-
- @satisfies REQ-109, REQ-112, REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-
|
|
1387
|
+
- @satisfies REQ-109, REQ-112, REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-156, REQ-159, REQ-180, REQ-222, REQ-223, REQ-233, REQ-283, REQ-284
|
|
1384
1388
|
|
|
1385
|
-
### fn `function stopStatusTicker(controller: PiUsereqStatusController): void` (
|
|
1389
|
+
### fn `function stopStatusTicker(controller: PiUsereqStatusController): void` (L596-601)
|
|
1386
1390
|
- @brief Stops the live elapsed-time ticker when it is active.
|
|
1387
1391
|
- @details Clears the interval handle and resets the stored timer reference so
|
|
1388
1392
|
subsequent runs can reinitialize live status refreshes deterministically.
|
|
@@ -1390,7 +1394,7 @@ Runtime is O(1). Side effect: mutates `controller.tickHandle`.
|
|
|
1390
1394
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1391
1395
|
- @return {void} No return value.
|
|
1392
1396
|
|
|
1393
|
-
### fn `function syncPiUsereqStatusTicker(` (
|
|
1397
|
+
### fn `function syncPiUsereqStatusTicker(` (L613-629)
|
|
1394
1398
|
- @brief Synchronizes the live elapsed-time ticker with the current run state.
|
|
1395
1399
|
- @details Starts a 1-second render ticker while a run is active and stops the
|
|
1396
1400
|
ticker when the run returns to idle. Runtime is O(1). Side effects include
|
|
@@ -1400,13 +1404,13 @@ ticks.
|
|
|
1400
1404
|
- @return {void} No return value.
|
|
1401
1405
|
- @satisfies REQ-123
|
|
1402
1406
|
|
|
1403
|
-
### fn `export function createPiUsereqStatusController(): PiUsereqStatusController` (
|
|
1407
|
+
### fn `export function createPiUsereqStatusController(): PiUsereqStatusController` (L637-652)
|
|
1404
1408
|
- @brief Creates an empty pi-usereq status controller.
|
|
1405
1409
|
- @details Initializes the mutable status snapshot, including empty prompt-request tracking, and starts with no config, no context, and no live ticker. Runtime is O(1). No external state is mutated.
|
|
1406
1410
|
- @return {PiUsereqStatusController} New status controller.
|
|
1407
1411
|
- @satisfies DES-010
|
|
1408
1412
|
|
|
1409
|
-
### fn `export function setPiUsereqStatusConfig(` (
|
|
1413
|
+
### fn `export function setPiUsereqStatusConfig(` (L664-669)
|
|
1410
1414
|
- @brief Stores the effective project configuration used by status rendering.
|
|
1411
1415
|
- @details Replaces the controller's cached configuration so later status
|
|
1412
1416
|
renders reuse the latest docs, tests, source-path, and pi-notify values
|
|
@@ -1416,15 +1420,15 @@ mutates `controller.config`.
|
|
|
1416
1420
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1417
1421
|
- @return {void} No return value.
|
|
1418
1422
|
|
|
1419
|
-
### fn `export function renderPiUsereqStatus(` (
|
|
1423
|
+
### fn `export function renderPiUsereqStatus(` (L679-709)
|
|
1420
1424
|
- @brief Renders the current pi-usereq status bar into the active UI context.
|
|
1421
|
-
- @details Updates the controller's latest context pointer and writes the single-line status text only when configuration is available,
|
|
1425
|
+
- @details Updates the controller's latest context pointer and writes the single-line status text only when configuration is available, including the active branch field and documented icon-based context gauge. When pi has already invalidated the supplied context after session replacement or reload, the helper clears the stale cached context and returns without surfacing the stale-instance exception. Runtime is O(1) plus git execution for branch refresh. Side effect: mutates `ctx.ui` status when the context is still active.
|
|
1422
1426
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1423
1427
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1424
1428
|
- @return {void} No return value.
|
|
1425
|
-
- @satisfies REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-
|
|
1429
|
+
- @satisfies REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-159, REQ-180, REQ-233, REQ-280, REQ-283, REQ-284
|
|
1426
1430
|
|
|
1427
|
-
### fn `export function setPiUsereqWorkflowState(` (
|
|
1431
|
+
### fn `export function setPiUsereqWorkflowState(` (L720-731)
|
|
1428
1432
|
- @brief Transitions the prompt-orchestration workflow state and refreshes the status bar.
|
|
1429
1433
|
- @details Mutates the tracked workflow state, preserves the latest extension context when available, and re-renders the single-line footer immediately so internal command transitions and pi lifecycle transitions stay visible to the user. Runtime is O(1). Side effect: mutates workflow state and may update `ctx.ui` status.
|
|
1430
1434
|
- @param[in] workflowState {PiUsereqWorkflowState} Next workflow state.
|
|
@@ -1433,7 +1437,7 @@ mutates `controller.config`.
|
|
|
1433
1437
|
- @return {void} No return value.
|
|
1434
1438
|
- @satisfies REQ-221, REQ-222, REQ-223
|
|
1435
1439
|
|
|
1436
|
-
### fn `export function updateExtensionStatus(` (
|
|
1440
|
+
### fn `export function updateExtensionStatus(` (L743-807)
|
|
1437
1441
|
- @brief Updates mutable status state for one intercepted lifecycle hook.
|
|
1438
1442
|
- @details Refreshes stored context usage on every hook, resets or restores persisted elapsed counters during `session_start`, restores persisted prompt-command metadata when the active session matches a forked execution session, resynchronizes that metadata on later lifecycle hooks so post-switch workflow transitions performed by the initiating command handler become visible to the replacement-session runtime, resets workflow state to `idle` for documented session-start reasons, starts run timing on `agent_start`, promotes pending prompt-request metadata into the active run, captures non-aborted run duration on `agent_end`, accumulates successful runtime into `Σ`, preserves in-memory prompt-command state plus process-scoped persistence across switch-triggered `session_shutdown`, tolerates stale post-replacement render contexts, synchronizes the live ticker, and re-renders the status bar when configuration is available. Runtime is O(n) in `agent_end` message count and otherwise O(1). Side effects include in-memory state mutation, interval scheduling, process-scoped persistence mutation, and footer-status updates.
|
|
1439
1443
|
- @param[in] hookName {PiUsereqStatusHookName} Intercepted hook name.
|
|
@@ -1443,7 +1447,7 @@ mutates `controller.config`.
|
|
|
1443
1447
|
- @return {void} No return value.
|
|
1444
1448
|
- @satisfies REQ-009, REQ-117, REQ-118, REQ-119, REQ-123, REQ-124, REQ-125, REQ-159, REQ-169, REQ-217, REQ-221, REQ-278, REQ-279, REQ-280
|
|
1445
1449
|
|
|
1446
|
-
### fn `export function disposePiUsereqStatusController(` (
|
|
1450
|
+
### fn `export function disposePiUsereqStatusController(` (L818-823)
|
|
1447
1451
|
- @brief Disposes the pi-usereq status controller.
|
|
1448
1452
|
- @details Stops the live ticker, clears the cached context pointer, and leaves
|
|
1449
1453
|
the last captured status snapshot available for inspection until the
|
|
@@ -1455,48 +1459,49 @@ limited to interval disposal and in-memory state mutation.
|
|
|
1455
1459
|
## Symbol Index
|
|
1456
1460
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
1457
1461
|
|---|---|---|---|---|
|
|
1458
|
-
|`StatusForegroundColor`|type||
|
|
1459
|
-
|`RawStatusTheme`|iface||
|
|
1460
|
-
|`StatusThemeAdapter`|iface||
|
|
1461
|
-
|`PiUsereqStatusHookName`|type||
|
|
1462
|
-
|`PiUsereqPromptRequest`|type||
|
|
1463
|
-
|`PiUsereqWorkflowState`|type||
|
|
1464
|
-
|`PiUsereqStatusState`|iface||
|
|
1465
|
-
|`PiUsereqStatusController`|iface||
|
|
1466
|
-
|`PiUsereqStatusPersistenceStore`|iface||
|
|
1467
|
-
|`getPiUsereqStatusPersistenceStore`|fn||
|
|
1468
|
-
|`restorePersistedElapsedState`|fn||182
|
|
1469
|
-
|`persistElapsedState`|fn||194
|
|
1470
|
-
|`persistPromptCommandState`|fn||
|
|
1471
|
-
|`shouldPreservePromptCommandStateOnShutdown`|fn||
|
|
1472
|
-
|`restorePersistedPromptCommandState`|fn||
|
|
1473
|
-
|`getContextSessionFile`|fn||252
|
|
1474
|
-
|`isStaleExtensionContextError`|fn||
|
|
1475
|
-
|`resetElapsedState`|fn||277
|
|
1476
|
-
|`shouldResetElapsedStateOnSessionStart`|fn||
|
|
1477
|
-
|`shouldResetWorkflowStateOnSessionStart`|fn||
|
|
1478
|
-
|`createStatusThemeAdapter`|fn||
|
|
1479
|
-
|`colorize`|fn||
|
|
1480
|
-
|`
|
|
1481
|
-
|`
|
|
1482
|
-
|`
|
|
1483
|
-
|`
|
|
1484
|
-
|`
|
|
1485
|
-
|`
|
|
1486
|
-
|`
|
|
1487
|
-
|`
|
|
1488
|
-
|`
|
|
1489
|
-
|`
|
|
1490
|
-
|`
|
|
1491
|
-
|`
|
|
1492
|
-
|`
|
|
1493
|
-
|`
|
|
1494
|
-
|`
|
|
1495
|
-
|`
|
|
1496
|
-
|`
|
|
1497
|
-
|`
|
|
1498
|
-
|`
|
|
1499
|
-
|`
|
|
1462
|
+
|`StatusForegroundColor`|type||30||
|
|
1463
|
+
|`RawStatusTheme`|iface||40-42|interface RawStatusTheme|
|
|
1464
|
+
|`StatusThemeAdapter`|iface||50-55|interface StatusThemeAdapter|
|
|
1465
|
+
|`PiUsereqStatusHookName`|type||98||
|
|
1466
|
+
|`PiUsereqPromptRequest`|type||104||
|
|
1467
|
+
|`PiUsereqWorkflowState`|type||110||
|
|
1468
|
+
|`PiUsereqStatusState`|iface||116-124|export interface PiUsereqStatusState|
|
|
1469
|
+
|`PiUsereqStatusController`|iface||133-138|export interface PiUsereqStatusController|
|
|
1470
|
+
|`PiUsereqStatusPersistenceStore`|iface||144-147|interface PiUsereqStatusPersistenceStore|
|
|
1471
|
+
|`getPiUsereqStatusPersistenceStore`|fn||161-170|function getPiUsereqStatusPersistenceStore(): PiUsereqSta...|
|
|
1472
|
+
|`restorePersistedElapsedState`|fn||178-182|function restorePersistedElapsedState(state: PiUsereqStat...|
|
|
1473
|
+
|`persistElapsedState`|fn||190-194|function persistElapsedState(state: PiUsereqStatusState):...|
|
|
1474
|
+
|`persistPromptCommandState`|fn||202-208|function persistPromptCommandState(state: PiUsereqStatusS...|
|
|
1475
|
+
|`shouldPreservePromptCommandStateOnShutdown`|fn||217-220|export function shouldPreservePromptCommandStateOnShutdow...|
|
|
1476
|
+
|`restorePersistedPromptCommandState`|fn||229-240|function restorePersistedPromptCommandState(|
|
|
1477
|
+
|`getContextSessionFile`|fn||248-252|function getContextSessionFile(ctx: ExtensionContext): st...|
|
|
1478
|
+
|`isStaleExtensionContextError`|fn||261-264|export function isStaleExtensionContextError(error: unkno...|
|
|
1479
|
+
|`resetElapsedState`|fn||273-277|function resetElapsedState(state: PiUsereqStatusState): void|
|
|
1480
|
+
|`shouldResetElapsedStateOnSessionStart`|fn||286-289|function shouldResetElapsedStateOnSessionStart(event: unk...|
|
|
1481
|
+
|`shouldResetWorkflowStateOnSessionStart`|fn||298-301|function shouldResetWorkflowStateOnSessionStart(event: un...|
|
|
1482
|
+
|`createStatusThemeAdapter`|fn||311-320|function createStatusThemeAdapter(theme: RawStatusTheme):...|
|
|
1483
|
+
|`colorize`|fn||312-319|const colorize = (color: StatusForegroundColor, text: str...|
|
|
1484
|
+
|`resolveStatusBranchValue`|fn||329-331|function resolveStatusBranchValue(ctx: ExtensionContext):...|
|
|
1485
|
+
|`normalizeContextUsage`|fn||342-359|function normalizeContextUsage(|
|
|
1486
|
+
|`refreshContextUsage`|fn||371-376|function refreshContextUsage(|
|
|
1487
|
+
|`resolveContextUsageIconText`|fn||385-402|function resolveContextUsageIconText(|
|
|
1488
|
+
|`formatContextUsageBar`|fn||412-424|function formatContextUsageBar(|
|
|
1489
|
+
|`formatStatusDuration`|fn||435-440|function formatStatusDuration(durationMs: number): string|
|
|
1490
|
+
|`formatCompletedStatusDuration`|fn||451-455|function formatCompletedStatusDuration(|
|
|
1491
|
+
|`formatElapsedStatusValue`|fn||468-478|function formatElapsedStatusValue(|
|
|
1492
|
+
|`formatStatusField`|fn||489-495|function formatStatusField(|
|
|
1493
|
+
|`formatRenderedStatusField`|fn||507-513|function formatRenderedStatusField(|
|
|
1494
|
+
|`formatWorkflowStateValue`|fn||523-531|function formatWorkflowStateValue(|
|
|
1495
|
+
|`didAgentEndAbort`|fn||542-549|function didAgentEndAbort(messages: AgentEndEvent["messag...|
|
|
1496
|
+
|`buildPiUsereqStatusText`|fn||562-586|function buildPiUsereqStatusText(|
|
|
1497
|
+
|`stopStatusTicker`|fn||596-601|function stopStatusTicker(controller: PiUsereqStatusContr...|
|
|
1498
|
+
|`syncPiUsereqStatusTicker`|fn||613-629|function syncPiUsereqStatusTicker(|
|
|
1499
|
+
|`createPiUsereqStatusController`|fn||637-652|export function createPiUsereqStatusController(): PiUsere...|
|
|
1500
|
+
|`setPiUsereqStatusConfig`|fn||664-669|export function setPiUsereqStatusConfig(|
|
|
1501
|
+
|`renderPiUsereqStatus`|fn||679-709|export function renderPiUsereqStatus(|
|
|
1502
|
+
|`setPiUsereqWorkflowState`|fn||720-731|export function setPiUsereqWorkflowState(|
|
|
1503
|
+
|`updateExtensionStatus`|fn||743-807|export function updateExtensionStatus(|
|
|
1504
|
+
|`disposePiUsereqStatusController`|fn||818-823|export function disposePiUsereqStatusController(|
|
|
1500
1505
|
|
|
1501
1506
|
|
|
1502
1507
|
---
|
|
@@ -2524,10 +2529,10 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2524
2529
|
|
|
2525
2530
|
---
|
|
2526
2531
|
|
|
2527
|
-
# prompt-command-runtime.ts | TypeScript |
|
|
2532
|
+
# prompt-command-runtime.ts | TypeScript | 1816L | 54 symbols | 12 imports | 58 comments
|
|
2528
2533
|
> Path: `src/core/prompt-command-runtime.ts`
|
|
2529
2534
|
- @brief Implements prompt-command preflight and worktree orchestration.
|
|
2530
|
-
- @details Centralizes `req-<prompt>` repository validation, prompt-specific required-document checks, slash-command-owned worktree naming and lifecycle handling, session-backed cwd switching plus verification, persisted replacement-session context reuse for non-command lifecycle handlers, matched-success fast-forward merge finalization, and command-side abort cleanup. Runtime is dominated by git subprocess execution plus bounded filesystem and session-file metadata checks. Side effects include active-session replacement, worktree creation and deletion, branch merges, and filesystem reads and writes.
|
|
2535
|
+
- @details Centralizes `req-<prompt>` repository validation, prompt-specific required-document checks, slash-command-owned worktree naming and lifecycle handling, session-backed cwd switching plus verification, persisted replacement-session context reuse for non-command lifecycle handlers, matched-success fast-forward merge finalization with restored-session transcript preservation, and command-side abort cleanup. Runtime is dominated by git subprocess execution plus bounded filesystem and session-file metadata checks. Side effects include active-session replacement, worktree creation and deletion, branch merges, and filesystem reads and writes.
|
|
2531
2536
|
|
|
2532
2537
|
## Imports
|
|
2533
2538
|
```
|
|
@@ -2669,7 +2674,22 @@ import {
|
|
|
2669
2674
|
- @param[in] sessionFile {string} Absolute session-file path.
|
|
2670
2675
|
- @return {string | undefined} Persisted session cwd when readable; otherwise undefined.
|
|
2671
2676
|
|
|
2672
|
-
### fn `function
|
|
2677
|
+
### fn `function readPromptSessionJsonLines(` (L431-478)
|
|
2678
|
+
- @brief Reads one persisted session file as ordered parsed JSONL records.
|
|
2679
|
+
- @details Loads the raw session file, preserves every non-empty serialized line verbatim, parses each line as one JSON object, and rejects unreadable or structurally invalid files so prompt-closure helpers can replay exact execution-session transcript records into the restored base session without reserialization drift. Runtime is O(n) in session-file size. No external state is mutated.
|
|
2680
|
+
- @param[in] sessionFile {string} Absolute session-file path.
|
|
2681
|
+
- @return {Array<{ rawLine: string; parsed: Record<string, unknown> }>} Parsed non-empty JSONL lines in file order.
|
|
2682
|
+
- @throws {ReqError} Throws when the file cannot be read, when it contains no JSONL records, when any record is not a JSON object, or when the header record is missing.
|
|
2683
|
+
|
|
2684
|
+
### fn `function preservePromptCommandExecutionTranscript(plan: PromptCommandExecutionPlan): void` (L488-585)
|
|
2685
|
+
- @brief Copies successful execution-session transcript records into the restored base session file.
|
|
2686
|
+
- @details Reads the execution session JSONL file, preserves the original base-session header when it already exists, materializes a restored base-session header when the reserved original session file is still pending persistence, appends any execution-session records missing from the original session in original execution order, and re-reads the restored file to verify both `base-path` cwd and copied entry identifiers. Runtime is O(n) in combined session-file size. Side effects include session-file creation or append operations for the restored base session.
|
|
2687
|
+
- @param[in] plan {PromptCommandExecutionPlan} Prompt execution plan whose original and execution session files must be synchronized.
|
|
2688
|
+
- @return {void} No return value.
|
|
2689
|
+
- @throws {ReqError} Throws when either session file is unreadable or when appended execution records are not persisted to the original session file.
|
|
2690
|
+
- @satisfies REQ-208
|
|
2691
|
+
|
|
2692
|
+
### fn `function verifyPromptCommandSessionTarget(` (L598-642)
|
|
2673
2693
|
- @brief Verifies that the active session file and cwd surfaces match one expected prompt-orchestration target.
|
|
2674
2694
|
- @details Re-reads the persisted session-file header when present plus the host `process.cwd()` and throws on the first mismatch so prompt commands abort before prompt dispatch or prompt-end handling whenever session switching leaves execution attached to the wrong cwd. A missing persisted session file is treated as a non-fatal lazy-persistence state because pi's `SessionManager` writes session files on first assistant flush rather than eagerly during `ctx.switchSession(sessionPath)`; when the file is absent, pi aligns its internal session cwd to the live `process.cwd()`, so verifying `process.cwd()` alone is authoritative in that state. Reads of `ctx.cwd`, `ctx.sessionManager.getCwd()`, and `ctx.sessionManager.getSessionFile()` are advisory only because the pi `ctx.switchSession(sessionPath)` SDK contract does not mutate the handler-scoped `ctx` object, so those probes stay bound to the pre-switch session and a divergent value alone never triggers abort; they only surface a mismatch when they disagree with both the persisted header cwd and the live `process.cwd()`. Runtime is O(p) in aggregate path length plus one session-file header read. No external state is mutated.
|
|
2675
2695
|
- @param[in] expectedSessionFile {string} Session file that must remain active.
|
|
@@ -2680,7 +2700,7 @@ import {
|
|
|
2680
2700
|
- @throws {ReqError} Throws when the persisted session-file header cwd diverges from the expected target or when `process.cwd()` diverges from the expected target.
|
|
2681
2701
|
- @satisfies REQ-257, REQ-272
|
|
2682
2702
|
|
|
2683
|
-
### fn `function verifyPromptCommandClosureArtifacts(` (
|
|
2703
|
+
### fn `function verifyPromptCommandClosureArtifacts(` (L652-687)
|
|
2684
2704
|
- @brief Verifies persisted prompt execution artifacts before successful closure merge.
|
|
2685
2705
|
- @details Re-reads the persisted execution-session header, verifies the worktree path still exists, confirms the sibling worktree remains registered, and confirms the linked branch is still present before prompt-end closure attempts to restore `base-path` and merge from the original repository. Unlike prompt-start activation checks, this helper intentionally does not require the live process cwd or current session-bound context to remain on `worktree-path`, because pi CLI may already have started end-of-session session replacement or other post-run housekeeping before the extension finishes closure handling. Runtime is dominated by one session-file read, two git subprocess checks, and bounded filesystem probes. No external state is mutated.
|
|
2686
2706
|
- @param[in] plan {PromptCommandExecutionPlan} Prompt execution plan.
|
|
@@ -2688,7 +2708,7 @@ import {
|
|
|
2688
2708
|
- @throws {ReqError} Throws when persisted execution-session metadata or worktree artifacts no longer match the expected worktree target.
|
|
2689
2709
|
- @satisfies REQ-208, REQ-219, REQ-258, REQ-282
|
|
2690
2710
|
|
|
2691
|
-
### fn `async function switchPromptCommandSession(` (
|
|
2711
|
+
### fn `async function switchPromptCommandSession(` (L698-727)
|
|
2692
2712
|
- @brief Switches the active prompt session to one persisted session file when required.
|
|
2693
2713
|
- @details Calls `ctx.switchSession(sessionPath, { withSession })` so current pi runtimes can expose a fresh replacement-session context for every post-switch session-bound operation. When a runtime ignores the callback, the helper falls back to the caller-supplied context and downstream verification continues to rely on the persisted session-file header plus `process.cwd()`. If pi surfaces only the documented stale-extension-context error while invalidating the old execution-session closure, the helper treats that side effect as non-fatal and lets downstream verification confirm whether the target session actually became active. Runtime is dominated by the session switch. Side effects include active-session replacement and cwd mutation by the host runtime.
|
|
2694
2714
|
- @param[in] sessionFile {string} Target persisted session file.
|
|
@@ -2697,47 +2717,47 @@ import {
|
|
|
2697
2717
|
- @throws {ReqError} Throws when the context cannot switch sessions, when the host cancels the switch, or when later verification proves the target session never became active.
|
|
2698
2718
|
- @satisfies REQ-068, REQ-271, REQ-272
|
|
2699
2719
|
|
|
2700
|
-
### fn `function isPromptCommandStaleContextError(error: unknown): boolean` (
|
|
2720
|
+
### fn `function isPromptCommandStaleContextError(error: unknown): boolean` (L736-739)
|
|
2701
2721
|
- @brief Detects the documented stale-extension-context runtime error during prompt-command session switching.
|
|
2702
2722
|
- @details Matches the guarded pi runtime error emitted when the old execution-session closure is invalidated during a session replacement or reload. Prompt-command session-switch helpers use this detector to distinguish a late stale-context side effect from genuine switch failures, then rely on post-switch verification to confirm whether the target session actually became active. Runtime is O(n) in message length only when an error is supplied. No external state is mutated.
|
|
2703
2723
|
- @param[in] error {unknown} Candidate thrown value.
|
|
2704
2724
|
- @return {boolean} `true` when the value matches the stale-extension-context runtime error.
|
|
2705
2725
|
- @satisfies REQ-280
|
|
2706
2726
|
|
|
2707
|
-
### fn `function attachPromptCommandErrorContext(` (
|
|
2727
|
+
### fn `function attachPromptCommandErrorContext(` (L748-756)
|
|
2708
2728
|
- @brief Attaches the last valid prompt-command context to one thrown error.
|
|
2709
2729
|
- @details Preserves the replacement-session context discovered after `ctx.switchSession(...)` so outer callers can continue UI notifications and cleanup without reusing stale pre-switch command objects. Runtime is O(1). Side effect: mutates the error object when it is an `Error` instance.
|
|
2710
2730
|
- @param[in] error {unknown} Thrown value.
|
|
2711
2731
|
- @param[in] ctx {PromptCommandSessionContext | undefined} Last valid prompt-command context.
|
|
2712
2732
|
- @return {unknown} Original thrown value with optional attached prompt context.
|
|
2713
2733
|
|
|
2714
|
-
### fn `export function getPromptCommandErrorContext(` (
|
|
2734
|
+
### fn `export function getPromptCommandErrorContext(` (L764-770)
|
|
2715
2735
|
- @brief Reads an attached prompt-command context from one thrown error.
|
|
2716
2736
|
- @details Returns the replacement-session context captured by prompt orchestration helpers when a switch-triggered failure occurs after the original command context became stale. Runtime is O(1). No external state is mutated.
|
|
2717
2737
|
- @param[in] error {unknown} Thrown value.
|
|
2718
2738
|
- @return {PromptCommandSessionContext | undefined} Attached prompt-command context when available.
|
|
2719
2739
|
|
|
2720
|
-
### fn `function runCapture(command: string[], cwd: string): ReturnType<typeof spawnSync>` (
|
|
2740
|
+
### fn `function runCapture(command: string[], cwd: string): ReturnType<typeof spawnSync>` (L851-856)
|
|
2721
2741
|
- @brief Executes one git subprocess synchronously and captures UTF-8 output.
|
|
2722
2742
|
- @details Delegates to `spawnSync`, preserves the supplied working directory, and returns the raw subprocess result used by prompt-command orchestration. Runtime is dominated by external process execution. Side effects include process spawning.
|
|
2723
2743
|
- @param[in] command {string[]} Executable plus argument vector.
|
|
2724
2744
|
- @param[in] cwd {string} Working directory for the subprocess.
|
|
2725
2745
|
- @return {ReturnType<typeof spawnSync>} Captured subprocess result.
|
|
2726
2746
|
|
|
2727
|
-
### fn `export function setPromptCommandPostCreateHookForTests(` (
|
|
2747
|
+
### fn `export function setPromptCommandPostCreateHookForTests(` (L864-868)
|
|
2728
2748
|
- @brief Stores or clears the prompt-command post-create test hook.
|
|
2729
2749
|
- @details Enables deterministic simulation of post-create worktree verification failures without altering production control flow. Runtime is O(1). Side effect: mutates module-local test state.
|
|
2730
2750
|
- @param[in] hook {PromptCommandPostCreateHook | undefined} Optional replacement hook.
|
|
2731
2751
|
- @return {void} No return value.
|
|
2732
2752
|
|
|
2733
|
-
### fn `function resolvePromptDocsRoot(projectBase: string, config: UseReqConfig): string` (
|
|
2753
|
+
### fn `function resolvePromptDocsRoot(projectBase: string, config: UseReqConfig): string` (L877-880)
|
|
2734
2754
|
- @brief Resolves the configured docs root for one project base.
|
|
2735
2755
|
- @details Joins the project base with the normalized `docs-dir` value while stripping trailing separators from the persisted config field. Runtime is O(p) in path length. No external state is mutated.
|
|
2736
2756
|
- @param[in] projectBase {string} Absolute project root.
|
|
2737
2757
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
2738
2758
|
- @return {string} Absolute canonical docs root path.
|
|
2739
2759
|
|
|
2740
|
-
### fn `function resolveWorktreePaths(` (
|
|
2760
|
+
### fn `function resolveWorktreePaths(` (L890-917)
|
|
2741
2761
|
- @brief Resolves the effective worktree project base relative to the git root.
|
|
2742
2762
|
- @details Reuses the original project-base location relative to the git root so nested repository subdirectories remain aligned inside the sibling worktree. Runtime is O(p) in path length. No external state is mutated.
|
|
2743
2763
|
- @param[in] projectBase {string} Original absolute project base path.
|
|
@@ -2745,25 +2765,25 @@ import {
|
|
|
2745
2765
|
- @param[in] worktreeName {string} Created worktree name.
|
|
2746
2766
|
- @return {{ worktreePath: string; worktreeBasePath: string }} Derived worktree paths.
|
|
2747
2767
|
|
|
2748
|
-
### fn `function sanitizePromptWorktreeBranchName(branch: string): string` (
|
|
2768
|
+
### fn `function sanitizePromptWorktreeBranchName(branch: string): string` (L925-927)
|
|
2749
2769
|
- @brief Rewrites a branch name into a filesystem-safe token for prompt worktrees.
|
|
2750
2770
|
- @details Replaces characters invalid for worktree directory and branch-name generation with `-`. Runtime is O(n). No external state is mutated.
|
|
2751
2771
|
- @param[in] branch {string} Raw branch name.
|
|
2752
2772
|
- @return {string} Sanitized token.
|
|
2753
2773
|
|
|
2754
|
-
### fn `function validatePromptWorktreeName(wtName: string): boolean` (
|
|
2774
|
+
### fn `function validatePromptWorktreeName(wtName: string): boolean` (L935-940)
|
|
2755
2775
|
- @brief Validates a prompt-command-generated worktree or branch name.
|
|
2756
2776
|
- @details Rejects empty names, dot-path markers, whitespace, and filesystem-invalid characters. Runtime is O(n). No external state is mutated.
|
|
2757
2777
|
- @param[in] wtName {string} Candidate worktree name.
|
|
2758
2778
|
- @return {boolean} `true` when the name is acceptable for worktree creation.
|
|
2759
2779
|
|
|
2760
|
-
### fn `function throwPromptGitStatusError(): never` (
|
|
2780
|
+
### fn `function throwPromptGitStatusError(): never` (L948-950)
|
|
2761
2781
|
- @brief Throws the canonical prompt-command git-preflight failure.
|
|
2762
2782
|
- @details Normalizes all repository-validation failures to the contractually stable prompt-command error string consumed by tests and downstream prompt workflows. Runtime is O(1). No external state is mutated.
|
|
2763
2783
|
- @return {never} Always throws.
|
|
2764
2784
|
- @throws {ReqError} Always throws with exit code `1`.
|
|
2765
2785
|
|
|
2766
|
-
### fn `function validatePromptGitState(projectBase: string, config?: UseReqConfig): string` (
|
|
2786
|
+
### fn `function validatePromptGitState(projectBase: string, config?: UseReqConfig): string` (L961-1005)
|
|
2767
2787
|
- @brief Runs prompt-command-owned git validation and returns the runtime git root.
|
|
2768
2788
|
- @details Validates work-tree membership, porcelain cleanliness, and symbolic or detached `HEAD` presence without invoking extension custom-tool executors. Runtime is dominated by git subprocess execution. Side effects include process spawning.
|
|
2769
2789
|
- @param[in] projectBase {string} Absolute current project base.
|
|
@@ -2772,24 +2792,24 @@ import {
|
|
|
2772
2792
|
- @throws {ReqError} Throws the canonical prompt-command git-preflight error on any validation failure.
|
|
2773
2793
|
- @satisfies REQ-200, REQ-220
|
|
2774
2794
|
|
|
2775
|
-
### fn `function resolveCurrentPromptBranchName(gitRoot: string): string` (
|
|
2795
|
+
### fn `function resolveCurrentPromptBranchName(gitRoot: string): string` (L1013-1018)
|
|
2776
2796
|
- @brief Resolves the current local branch name used by prompt-command orchestration.
|
|
2777
2797
|
- @details Reads `git branch --show-current`, falls back to `unknown` when git cannot provide a branch name, and preserves the raw branch token for later worktree-name generation and state tracking. Runtime is dominated by one git subprocess. Side effects include process spawning.
|
|
2778
2798
|
- @param[in] gitRoot {string} Absolute runtime git root.
|
|
2779
2799
|
- @return {string} Current branch name or `unknown` when unavailable.
|
|
2780
2800
|
|
|
2781
|
-
### fn `function formatPromptWorktreeExecutionId(timestamp: Date): string` (
|
|
2801
|
+
### fn `function formatPromptWorktreeExecutionId(timestamp: Date): string` (L1032-1034)
|
|
2782
2802
|
- @brief Formats one prompt-worktree execution identifier.
|
|
2783
2803
|
- @details Serializes the supplied timestamp as `YYYYMMDDHHMMSS` with zero-padded calendar and clock fields so generated worktree names remain stable, lexicographically sortable, and requirement-compatible. Runtime is O(1). No external state is mutated.
|
|
2784
2804
|
- @param[in] timestamp {Date} Timestamp to encode.
|
|
2785
2805
|
- @return {string} Formatted execution identifier.
|
|
2786
2806
|
|
|
2787
|
-
### fn `function getNextPromptWorktreeExecutionId(): string` (
|
|
2807
|
+
### fn `function getNextPromptWorktreeExecutionId(): string` (L1041-1054)
|
|
2788
2808
|
- @brief Resolves the next unique prompt-worktree execution identifier.
|
|
2789
2809
|
- @details Formats the current wall-clock second as `YYYYMMDDHHMMSS`, then monotonically advances by one-second steps until the identifier is strictly greater than the last value emitted in the current host process. This preserves the documented timestamp-only name shape while preventing immediate same-process worktree-name reuse after fast back-to-back prompt starts. Runtime is O(1) in the common case and O(k) in repeated same-second collisions. Side effect: mutates process-scoped execution-id persistence.
|
|
2790
2810
|
- @return {string} Unique execution identifier for worktree naming.
|
|
2791
2811
|
|
|
2792
|
-
### fn `function buildPromptWorktreeName(gitRoot: string, config: UseReqConfig): string` (
|
|
2812
|
+
### fn `function buildPromptWorktreeName(gitRoot: string, config: UseReqConfig): string` (L1065-1076)
|
|
2793
2813
|
- @brief Builds the prompt-command worktree name without invoking agent-tool executors.
|
|
2794
2814
|
- @details Combines the normalized persisted worktree prefix, repository basename, sanitized current branch, and timestamp execution identifier into the dedicated prompt-command worktree name. Runtime is O(1) plus git execution cost. Side effects include process spawning.
|
|
2795
2815
|
- @param[in] gitRoot {string} Absolute runtime git root.
|
|
@@ -2798,21 +2818,21 @@ import {
|
|
|
2798
2818
|
- @throws {ReqError} Throws when the generated name is invalid.
|
|
2799
2819
|
- @satisfies REQ-206, REQ-220
|
|
2800
2820
|
|
|
2801
|
-
### fn `function promptWorktreeBranchExists(gitRoot: string, branchName: string): boolean` (
|
|
2821
|
+
### fn `function promptWorktreeBranchExists(gitRoot: string, branchName: string): boolean` (L1085-1094)
|
|
2802
2822
|
- @brief Tests whether the exact prompt-command branch is present in the local branch list.
|
|
2803
2823
|
- @details Queries `git branch --list --format=%(refname:short)` and returns a boolean without mutating repository state. Runtime is dominated by one git subprocess plus O(n) parsing in listed branch count. Side effects include process spawning.
|
|
2804
2824
|
- @param[in] gitRoot {string} Absolute runtime git root.
|
|
2805
2825
|
- @param[in] branchName {string} Candidate local branch name.
|
|
2806
2826
|
- @return {boolean} `true` when the exact local branch is listed.
|
|
2807
2827
|
|
|
2808
|
-
### fn `function promptWorktreeRegistered(gitRoot: string, worktreePath: string): boolean` (
|
|
2828
|
+
### fn `function promptWorktreeRegistered(gitRoot: string, worktreePath: string): boolean` (L1103-1114)
|
|
2809
2829
|
- @brief Tests whether the exact prompt-command worktree is registered.
|
|
2810
2830
|
- @details Scans `git worktree list --porcelain` for the resolved target path so cleanup and verification can distinguish registered worktrees from unrelated sibling directories. Runtime is dominated by one git subprocess plus O(n) parsing in listed worktree count. Side effects include process spawning.
|
|
2811
2831
|
- @param[in] gitRoot {string} Absolute runtime git root.
|
|
2812
2832
|
- @param[in] worktreePath {string} Absolute sibling worktree path.
|
|
2813
2833
|
- @return {boolean} `true` when the exact path is registered as a git worktree.
|
|
2814
2834
|
|
|
2815
|
-
### fn `function cleanupPromptWorktreeCreation(` (
|
|
2835
|
+
### fn `function cleanupPromptWorktreeCreation(` (L1124-1138)
|
|
2816
2836
|
- @brief Removes partially created prompt-command worktree resources.
|
|
2817
2837
|
- @details Force-removes the registered sibling worktree when present, deletes the matching local branch, and falls back to filesystem removal for leftover directories so failed prompt preflight leaves no reusable worktree residue. Runtime is dominated by git subprocess execution. Side effects include branch deletion and directory removal.
|
|
2818
2838
|
- @param[in] gitRoot {string} Absolute runtime git root.
|
|
@@ -2820,7 +2840,7 @@ import {
|
|
|
2820
2840
|
- @param[in] worktreeName {string} Exact worktree and branch name.
|
|
2821
2841
|
- @return {void} No return value.
|
|
2822
2842
|
|
|
2823
|
-
### fn `function createPromptWorktree(` (
|
|
2843
|
+
### fn `function createPromptWorktree(` (L1152-1272)
|
|
2824
2844
|
- @brief Creates and verifies the prompt-command worktree and branch.
|
|
2825
2845
|
- @details Creates the sibling worktree, mirrors project config when present, runs the optional post-create test hook, verifies git worktree registration, verifies git branch listing, verifies filesystem paths before prompt dispatch, and appends selected debug entries for worktree creation. Failed verification triggers immediate rollback. Runtime is dominated by git subprocess execution and filesystem metadata checks. Side effects include worktree creation, branch creation, directory creation, file copying, optional debug-log writes, and rollback on failure.
|
|
2826
2846
|
- @param[in] projectBase {string} Absolute original project base.
|
|
@@ -2832,7 +2852,7 @@ import {
|
|
|
2832
2852
|
- @throws {ReqError} Throws when worktree creation, verification, or rollback finalization fails.
|
|
2833
2853
|
- @satisfies REQ-206, REQ-219, REQ-220, REQ-245
|
|
2834
2854
|
|
|
2835
|
-
### fn `function deletePromptWorktree(` (
|
|
2855
|
+
### fn `function deletePromptWorktree(` (L1285-1345)
|
|
2836
2856
|
- @brief Deletes prompt-command worktree resources without invoking custom-tool executors.
|
|
2837
2857
|
- @details Force-removes the sibling worktree and matching branch, verifies both are absent so prompt finalization remains independent from agent-tool implementations, and appends selected debug entries for worktree deletion. Runtime is dominated by git subprocess execution plus filesystem probes. Side effects include worktree deletion, branch deletion, and optional debug-log writes.
|
|
2838
2858
|
- @param[in] projectBase {string} Absolute original project base.
|
|
@@ -2843,14 +2863,14 @@ import {
|
|
|
2843
2863
|
- @throws {ReqError} Throws when cleanup cannot remove the worktree and branch fully.
|
|
2844
2864
|
- @satisfies REQ-208, REQ-220, REQ-245
|
|
2845
2865
|
|
|
2846
|
-
### fn `export function getPromptRequiredDocs(promptName: PromptCommandName): readonly PromptRequiredDocSpec[]` (
|
|
2866
|
+
### fn `export function getPromptRequiredDocs(promptName: PromptCommandName): readonly PromptRequiredDocSpec[]` (L1354-1356)
|
|
2847
2867
|
- @brief Returns the canonical required-document probes for one prompt command.
|
|
2848
2868
|
- @details Performs a constant-time lookup in the prompt-doc matrix used by command preflight validation. No filesystem access occurs.
|
|
2849
2869
|
- @param[in] promptName {PromptCommandName} Bundled prompt identifier.
|
|
2850
2870
|
- @return {readonly PromptRequiredDocSpec[]} Required-doc definitions in probe order.
|
|
2851
2871
|
- @satisfies REQ-201, REQ-202
|
|
2852
2872
|
|
|
2853
|
-
### fn `export function validatePromptRequiredDocs(` (
|
|
2873
|
+
### fn `export function validatePromptRequiredDocs(` (L1369-1420)
|
|
2854
2874
|
- @brief Runs prompt-specific required-document validation.
|
|
2855
2875
|
- @details Resolves the configured docs root, verifies the prompt-mapped canonical docs exist as files, throws a deterministic remediation error for the first missing document, and appends selected debug entries for required-doc checks. Runtime is O(d) in required-doc count plus filesystem metadata cost. Side effects are limited to filesystem reads and optional debug-log writes.
|
|
2856
2876
|
- @param[in] promptName {PromptCommandName} Bundled prompt identifier.
|
|
@@ -2861,7 +2881,7 @@ import {
|
|
|
2861
2881
|
- @throws {ReqError} Throws when a required canonical doc is missing.
|
|
2862
2882
|
- @satisfies REQ-201, REQ-202, REQ-203, REQ-245
|
|
2863
2883
|
|
|
2864
|
-
### fn `export function preparePromptCommandExecution(` (
|
|
2884
|
+
### fn `export function preparePromptCommandExecution(` (L1437-1513)
|
|
2865
2885
|
- @brief Prepares prompt-command execution for one bundled prompt.
|
|
2866
2886
|
- @details Runs slash-command-owned git validation, enforces the prompt-specific required-doc matrix, resolves persisted origin and execution session files, applies the effective worktree policy, generates and verifies a dedicated worktree when enabled, and returns the execution plan consumed by prompt rendering plus lifecycle hooks. Worktree-backed execution reuses the active session directory for the forked session file. Runtime is dominated by git subprocesses, worktree creation, and optional session-file cloning. Side effects include worktree creation, session-file creation, filesystem reads, and optional prompt debug-log writes.
|
|
2867
2887
|
- @param[in] promptName {PromptCommandName} Bundled prompt identifier.
|
|
@@ -2876,7 +2896,7 @@ import {
|
|
|
2876
2896
|
- @throws {ReqError} Throws when repository validation, required-doc validation, worktree creation, or session preparation fails.
|
|
2877
2897
|
- @satisfies REQ-200, REQ-203, REQ-206, REQ-207, REQ-215, REQ-219, REQ-220, REQ-245, REQ-256, REQ-271
|
|
2878
2898
|
|
|
2879
|
-
### fn `export async function activatePromptCommandExecution(` (
|
|
2899
|
+
### fn `export async function activatePromptCommandExecution(` (L1524-1557)
|
|
2880
2900
|
- @brief Activates the prepared prompt execution path before prompt dispatch or agent start.
|
|
2881
2901
|
- @details Switches the active session to the execution-session file when worktree routing changed the cwd, re-aligns `process.cwd()` to the execution path, verifies active-session cwd plus cwd mirrors after the switch completes, and stores the verified command-capable replacement-session context for later closure handling. Runtime is dominated by the optional session switch and one optional cwd mutation. Side effects include active-session replacement, host-process cwd mutation, runtime-path state mutation, and process-scoped command-context persistence.
|
|
2882
2902
|
- @param[in] plan {PromptCommandExecutionPlan} Prepared prompt execution plan.
|
|
@@ -2885,7 +2905,7 @@ import {
|
|
|
2885
2905
|
- @throws {ReqError} Throws when the session switch or cwd verification fails.
|
|
2886
2906
|
- @satisfies REQ-206, REQ-207, REQ-257, REQ-272, REQ-276
|
|
2887
2907
|
|
|
2888
|
-
### fn `export async function restorePromptCommandExecution(` (
|
|
2908
|
+
### fn `export async function restorePromptCommandExecution(` (L1569-1633)
|
|
2889
2909
|
- @brief Restores the original project base path before merge or session-closure return.
|
|
2890
2910
|
- @details Switches the active session back to the original session file when worktree routing changed the cwd, re-aligns `process.cwd()` to `base-path`, verifies the restored session target, reuses the persisted replacement-session context when lifecycle handlers receive non-command contexts, tolerates the documented stale-extension-context error when the old replacement-session closure becomes invalid immediately after a successful restore, emits optional workflow restoration debug entries, and clears active worktree path facts before session closure continues. Runtime is dominated by the optional session switch and one optional cwd mutation. Side effects include active-session replacement, host-process cwd mutation, runtime-path state mutation, and optional workflow-debug writes.
|
|
2891
2911
|
- @param[in] plan {PromptCommandExecutionPlan} Prompt execution plan whose original base should be restored.
|
|
@@ -2895,7 +2915,7 @@ import {
|
|
|
2895
2915
|
- @throws {ReqError} Throws when the session switch or cwd verification fails.
|
|
2896
2916
|
- @satisfies REQ-208, REQ-209, REQ-245, REQ-257, REQ-272, REQ-276
|
|
2897
2917
|
|
|
2898
|
-
### fn `export async function abortPromptCommandExecution(` (
|
|
2918
|
+
### fn `export async function abortPromptCommandExecution(` (L1644-1690)
|
|
2899
2919
|
- @brief Aborts one prepared prompt-command execution before pi CLI takes ownership.
|
|
2900
2920
|
- @details Restores the original session-backed cwd and deletes any created worktree plus branch when command-side preflight, prompt rendering, or prompt handoff fails before agent completion. Restoration failures are returned as structured cleanup errors so the original preflight failure is not masked. Runtime is dominated by the optional session switch plus git subprocess execution. Side effects include active-session replacement, optional worktree deletion, and optional debug-log writes.
|
|
2901
2921
|
- @param[in] plan {PromptCommandExecutionPlan} Prepared prompt execution plan.
|
|
@@ -2904,16 +2924,16 @@ import {
|
|
|
2904
2924
|
- @return {Promise<{ cleanupSucceeded: boolean; errorMessage?: string; activeContext?: PromptCommandSessionContext }>} Abort-cleanup facts plus the last valid active prompt-command context.
|
|
2905
2925
|
- @satisfies REQ-226, REQ-220, REQ-245
|
|
2906
2926
|
|
|
2907
|
-
### fn `export async function finalizePromptCommandExecution(` (
|
|
2927
|
+
### fn `export async function finalizePromptCommandExecution(` (L1701-1804)
|
|
2908
2928
|
- @brief Finalizes one matched successful worktree-backed prompt execution.
|
|
2909
|
-
- @details Re-verifies persisted execution-session metadata plus worktree artifacts, restores the original session-backed `base-path`, fast-forward merges the successful worktree branch from `base-path`, deletes the worktree after merge success, and preserves the restored base session across closure failures. Closure intentionally treats `base-path` restoration as authoritative even when pi CLI has already started end-of-session session replacement or other housekeeping that moved the live runtime away from `worktree-path`. Runtime is dominated by session switching plus git subprocess execution. Side effects include active-session replacement, branch merges, worktree deletion, and optional debug-log writes.
|
|
2929
|
+
- @details Re-verifies persisted execution-session metadata plus worktree artifacts, copies any execution-session transcript records missing from the original session file, restores the original session-backed `base-path`, fast-forward merges the successful worktree branch from `base-path`, deletes the worktree after merge success, and preserves the restored base session across closure failures. Closure intentionally treats `base-path` restoration as authoritative even when pi CLI has already started end-of-session session replacement or other housekeeping that moved the live runtime away from `worktree-path`. Runtime is dominated by session switching plus git subprocess execution. Side effects include session-file appends, active-session replacement, branch merges, worktree deletion, and optional debug-log writes.
|
|
2910
2930
|
- @param[in] plan {PromptCommandExecutionPlan} Prompt execution plan.
|
|
2911
2931
|
- @param[in] ctx {PromptCommandSessionContext | undefined} Optional prompt-command context.
|
|
2912
2932
|
- @param[in] debugOptions {PromptCommandDebugOptions | undefined} Optional prompt debug logging context.
|
|
2913
2933
|
- @return {Promise<{ mergeAttempted: boolean; mergeSucceeded: boolean; cleanupSucceeded: boolean; errorMessage?: string; activeContext?: PromptCommandSessionContext }>} Finalization facts plus the last valid active prompt-command context.
|
|
2914
2934
|
- @satisfies REQ-208, REQ-209, REQ-220, REQ-245, REQ-282
|
|
2915
2935
|
|
|
2916
|
-
### fn `export function classifyPromptCommandOutcome(` (
|
|
2936
|
+
### fn `export function classifyPromptCommandOutcome(` (L1812-1816)
|
|
2917
2937
|
- @brief Maps one `agent_end` payload into the canonical prompt-worktree finalization outcome.
|
|
2918
2938
|
- @details Delegates to the shared notification outcome classifier so worktree merge and fork-session retention decisions stay aligned with prompt-end notification routing. Runtime is O(m) in assistant message count. No external state is mutated.
|
|
2919
2939
|
- @param[in] event {Pick<import("@mariozechner/pi-coding-agent").AgentEndEvent, "messages">} Agent-end payload subset.
|
|
@@ -2943,37 +2963,39 @@ import {
|
|
|
2943
2963
|
|`resolvePromptCommandSwitchContext`|fn||344-359|function resolvePromptCommandSwitchContext(|
|
|
2944
2964
|
|`syncPromptCommandProcessCwd`|fn||370-390|function syncPromptCommandProcessCwd(expectedPath: string...|
|
|
2945
2965
|
|`readPromptSessionFileCwd`|fn||398-422|function readPromptSessionFileCwd(sessionFile: string): s...|
|
|
2946
|
-
|`
|
|
2947
|
-
|`
|
|
2948
|
-
|`
|
|
2949
|
-
|`
|
|
2950
|
-
|`
|
|
2951
|
-
|`
|
|
2952
|
-
|`
|
|
2953
|
-
|`
|
|
2954
|
-
|`
|
|
2955
|
-
|`
|
|
2956
|
-
|`
|
|
2957
|
-
|`
|
|
2958
|
-
|`
|
|
2959
|
-
|`
|
|
2960
|
-
|`
|
|
2961
|
-
|`
|
|
2962
|
-
|`
|
|
2963
|
-
|`
|
|
2964
|
-
|`
|
|
2965
|
-
|`
|
|
2966
|
-
|`
|
|
2967
|
-
|`
|
|
2968
|
-
|`
|
|
2969
|
-
|`
|
|
2970
|
-
|`
|
|
2971
|
-
|`
|
|
2972
|
-
|`
|
|
2973
|
-
|`
|
|
2974
|
-
|`
|
|
2975
|
-
|`
|
|
2976
|
-
|`
|
|
2966
|
+
|`readPromptSessionJsonLines`|fn||431-478|function readPromptSessionJsonLines(|
|
|
2967
|
+
|`preservePromptCommandExecutionTranscript`|fn||488-585|function preservePromptCommandExecutionTranscript(plan: P...|
|
|
2968
|
+
|`verifyPromptCommandSessionTarget`|fn||598-642|function verifyPromptCommandSessionTarget(|
|
|
2969
|
+
|`verifyPromptCommandClosureArtifacts`|fn||652-687|function verifyPromptCommandClosureArtifacts(|
|
|
2970
|
+
|`switchPromptCommandSession`|fn||698-727|async function switchPromptCommandSession(|
|
|
2971
|
+
|`isPromptCommandStaleContextError`|fn||736-739|function isPromptCommandStaleContextError(error: unknown)...|
|
|
2972
|
+
|`attachPromptCommandErrorContext`|fn||748-756|function attachPromptCommandErrorContext(|
|
|
2973
|
+
|`getPromptCommandErrorContext`|fn||764-770|export function getPromptCommandErrorContext(|
|
|
2974
|
+
|`runCapture`|fn||851-856|function runCapture(command: string[], cwd: string): Retu...|
|
|
2975
|
+
|`setPromptCommandPostCreateHookForTests`|fn||864-868|export function setPromptCommandPostCreateHookForTests(|
|
|
2976
|
+
|`resolvePromptDocsRoot`|fn||877-880|function resolvePromptDocsRoot(projectBase: string, confi...|
|
|
2977
|
+
|`resolveWorktreePaths`|fn||890-917|function resolveWorktreePaths(|
|
|
2978
|
+
|`sanitizePromptWorktreeBranchName`|fn||925-927|function sanitizePromptWorktreeBranchName(branch: string)...|
|
|
2979
|
+
|`validatePromptWorktreeName`|fn||935-940|function validatePromptWorktreeName(wtName: string): boolean|
|
|
2980
|
+
|`throwPromptGitStatusError`|fn||948-950|function throwPromptGitStatusError(): never|
|
|
2981
|
+
|`validatePromptGitState`|fn||961-1005|function validatePromptGitState(projectBase: string, conf...|
|
|
2982
|
+
|`resolveCurrentPromptBranchName`|fn||1013-1018|function resolveCurrentPromptBranchName(gitRoot: string):...|
|
|
2983
|
+
|`formatPromptWorktreeExecutionId`|fn||1032-1034|function formatPromptWorktreeExecutionId(timestamp: Date)...|
|
|
2984
|
+
|`getNextPromptWorktreeExecutionId`|fn||1041-1054|function getNextPromptWorktreeExecutionId(): string|
|
|
2985
|
+
|`buildPromptWorktreeName`|fn||1065-1076|function buildPromptWorktreeName(gitRoot: string, config:...|
|
|
2986
|
+
|`promptWorktreeBranchExists`|fn||1085-1094|function promptWorktreeBranchExists(gitRoot: string, bran...|
|
|
2987
|
+
|`promptWorktreeRegistered`|fn||1103-1114|function promptWorktreeRegistered(gitRoot: string, worktr...|
|
|
2988
|
+
|`cleanupPromptWorktreeCreation`|fn||1124-1138|function cleanupPromptWorktreeCreation(|
|
|
2989
|
+
|`createPromptWorktree`|fn||1152-1272|function createPromptWorktree(|
|
|
2990
|
+
|`deletePromptWorktree`|fn||1285-1345|function deletePromptWorktree(|
|
|
2991
|
+
|`getPromptRequiredDocs`|fn||1354-1356|export function getPromptRequiredDocs(promptName: PromptC...|
|
|
2992
|
+
|`validatePromptRequiredDocs`|fn||1369-1420|export function validatePromptRequiredDocs(|
|
|
2993
|
+
|`preparePromptCommandExecution`|fn||1437-1513|export function preparePromptCommandExecution(|
|
|
2994
|
+
|`activatePromptCommandExecution`|fn||1524-1557|export async function activatePromptCommandExecution(|
|
|
2995
|
+
|`restorePromptCommandExecution`|fn||1569-1633|export async function restorePromptCommandExecution(|
|
|
2996
|
+
|`abortPromptCommandExecution`|fn||1644-1690|export async function abortPromptCommandExecution(|
|
|
2997
|
+
|`finalizePromptCommandExecution`|fn||1701-1804|export async function finalizePromptCommandExecution(|
|
|
2998
|
+
|`classifyPromptCommandOutcome`|fn||1812-1816|export function classifyPromptCommandOutcome(|
|
|
2977
2999
|
|
|
2978
3000
|
|
|
2979
3001
|
---
|
|
@@ -3447,10 +3469,10 @@ import { getInstallationPath, RESOURCE_ROOT_DIRNAME } from "./path-context.js";
|
|
|
3447
3469
|
|
|
3448
3470
|
---
|
|
3449
3471
|
|
|
3450
|
-
# runtime-project-paths.ts | TypeScript |
|
|
3472
|
+
# runtime-project-paths.ts | TypeScript | 90L | 5 symbols | 4 imports | 6 comments
|
|
3451
3473
|
> Path: `src/core/runtime-project-paths.ts`
|
|
3452
3474
|
- @brief Derives runtime-only repository facts.
|
|
3453
|
-
- @details Centralizes git-repository probing
|
|
3475
|
+
- @details Centralizes git-repository probing, repository-root resolution, and active-branch lookup for extension status, tool execution, and CLI flows. Runtime is dominated by git subprocess execution plus path normalization. Side effects are limited to subprocess spawning.
|
|
3454
3476
|
|
|
3455
3477
|
## Imports
|
|
3456
3478
|
```
|
|
@@ -3491,6 +3513,13 @@ import { isSameOrAncestorPath } from "./path-context.js";
|
|
|
3491
3513
|
- @return {string | undefined} Absolute repository-root path or `undefined` when unavailable.
|
|
3492
3514
|
- @satisfies REQ-105, REQ-145
|
|
3493
3515
|
|
|
3516
|
+
### fn `export function resolveRuntimeGitBranchName(executionPath: string): string` (L77-88)
|
|
3517
|
+
- @brief Resolves the active branch name for one runtime execution path.
|
|
3518
|
+
- @details Resolves the enclosing git work tree from the supplied execution path, reads `git branch --show-current`, and falls back to `unknown` when the path is outside git or HEAD has no branch name. Runtime is dominated by git execution. Side effects include subprocess creation.
|
|
3519
|
+
- @param[in] executionPath {string} Runtime execution path.
|
|
3520
|
+
- @return {string} Active branch name or `unknown` when unavailable.
|
|
3521
|
+
- @satisfies REQ-121, REQ-283
|
|
3522
|
+
|
|
3494
3523
|
## Symbol Index
|
|
3495
3524
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
3496
3525
|
|---|---|---|---|---|
|
|
@@ -3498,6 +3527,7 @@ import { isSameOrAncestorPath } from "./path-context.js";
|
|
|
3498
3527
|
|`isInsideGitRepo`|fn||33-36|export function isInsideGitRepo(targetPath: string): boolean|
|
|
3499
3528
|
|`resolveGitRoot`|fn||46-52|export function resolveGitRoot(targetPath: string): string|
|
|
3500
3529
|
|`resolveRuntimeGitPath`|fn||61-68|export function resolveRuntimeGitPath(executionPath: stri...|
|
|
3530
|
+
|`resolveRuntimeGitBranchName`|fn||77-88|export function resolveRuntimeGitBranchName(executionPath...|
|
|
3501
3531
|
|
|
3502
3532
|
|
|
3503
3533
|
---
|
|
@@ -4420,7 +4450,7 @@ import path from "node:path";
|
|
|
4420
4450
|
|
|
4421
4451
|
---
|
|
4422
4452
|
|
|
4423
|
-
# index.ts | TypeScript |
|
|
4453
|
+
# index.ts | TypeScript | 3765L | 87 symbols | 25 imports | 93 comments
|
|
4424
4454
|
> Path: `src/index.ts`
|
|
4425
4455
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4426
4456
|
- @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.
|
|
@@ -4509,25 +4539,25 @@ cost.
|
|
|
4509
4539
|
- @return {string} `~`-relative or absolute config path display value.
|
|
4510
4540
|
- @satisfies REQ-162
|
|
4511
4541
|
|
|
4512
|
-
### fn `function buildTerminalSettingsMenuChoices(options:` (L287-
|
|
4542
|
+
### fn `function buildTerminalSettingsMenuChoices(options:` (L287-298)
|
|
4513
4543
|
- @brief Builds the standardized terminal rows appended to every configuration menu.
|
|
4514
|
-
- @details Returns the canonical `Reset defaults` row so all configuration menus and descendant selector menus share the same terminal ordering contract without rendering `Save and close`. Runtime is O(1). No external state is mutated.
|
|
4515
|
-
- @param[in] options {{ resetDefaultsDescription: string
|
|
4544
|
+
- @details Returns the canonical value-less `Reset defaults` row so all configuration menus and descendant selector menus share the same terminal ordering contract without rendering `Save and close`. Runtime is O(1). No external state is mutated.
|
|
4545
|
+
- @param[in] options {{ resetDefaultsDescription: string }} Menu-specific terminal-row metadata.
|
|
4516
4546
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered terminal menu rows.
|
|
4517
4547
|
- @satisfies REQ-193
|
|
4518
4548
|
|
|
4519
|
-
### iface `interface ResetConfirmationChange` (
|
|
4549
|
+
### iface `interface ResetConfirmationChange` (L304-308)
|
|
4520
4550
|
- @brief Describes one pending reset value change shown in confirmation menus.
|
|
4521
4551
|
- @details Stores the row label plus its previous and next values so reset-confirmation submenus can expose machine-readable and human-verifiable change previews. The interface is compile-time only and introduces no runtime cost.
|
|
4522
4552
|
|
|
4523
|
-
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (
|
|
4553
|
+
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L317-319)
|
|
4524
4554
|
- @brief Formats one reset-confirmation value pair for menu display.
|
|
4525
4555
|
- @details Serializes the previous and next values into a deterministic `previous -> next` preview string used by confirmation submenus. Runtime is O(n) in combined value length. No external state is mutated.
|
|
4526
4556
|
- @param[in] previousValue {string} Current persisted value.
|
|
4527
4557
|
- @param[in] nextValue {string} Candidate default value.
|
|
4528
4558
|
- @return {string} Rendered preview string.
|
|
4529
4559
|
|
|
4530
|
-
### fn `function buildResetConfirmationChoices(` (
|
|
4560
|
+
### fn `function buildResetConfirmationChoices(` (L329-368)
|
|
4531
4561
|
- @brief Builds the shared settings-menu choices for one reset-confirmation submenu.
|
|
4532
4562
|
- @details Renders each pending changed value as a disabled preview row, appends explicit approve and abort actions, and falls back to one disabled no-op row when no values would change. Runtime is O(n) in changed-value count. No external state is mutated.
|
|
4533
4563
|
- @param[in] changes {ResetConfirmationChange[]} Changed-value preview rows.
|
|
@@ -4535,7 +4565,7 @@ cost.
|
|
|
4535
4565
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4536
4566
|
- @return {PiUsereqSettingsMenuChoice[]} Reset-confirmation submenu choices.
|
|
4537
4567
|
|
|
4538
|
-
### fn `async function confirmResetChanges(` (
|
|
4568
|
+
### fn `async function confirmResetChanges(` (L380-393)
|
|
4539
4569
|
- @brief Opens one explicit reset-confirmation submenu.
|
|
4540
4570
|
- @details Uses the shared settings-menu renderer to show every changed value before reset application and returns `true` only when the user selects the explicit approval action. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
4541
4571
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4545,7 +4575,7 @@ cost.
|
|
|
4545
4575
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4546
4576
|
- @return {Promise<boolean>} `true` when the reset is explicitly approved.
|
|
4547
4577
|
|
|
4548
|
-
### fn `function writePersistedProjectConfigToEditor(` (
|
|
4578
|
+
### fn `function writePersistedProjectConfigToEditor(` (L404-411)
|
|
4549
4579
|
- @brief Writes the already-persisted project configuration file text into the editor.
|
|
4550
4580
|
- @details Reads the current `.pi-usereq.json` file content from disk after the caller has saved any pending configuration changes and forwards that exact persisted text into the editor. Runtime is O(n) in serialized config size. Side effects include filesystem reads and editor-text mutation.
|
|
4551
4581
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4554,51 +4584,51 @@ cost.
|
|
|
4554
4584
|
- @return {void} No return value.
|
|
4555
4585
|
- @satisfies REQ-031
|
|
4556
4586
|
|
|
4557
|
-
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (
|
|
4587
|
+
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L472-476)
|
|
4558
4588
|
- @brief Builds the supported-tag guidance lines embedded in search-tool registrations.
|
|
4559
4589
|
- @details Emits one deterministic line per supported language containing its canonical registration label and sorted tag list so downstream agents can specialize requests without invoking the tool first. Runtime is O(l * t log t). No side effects occur.
|
|
4560
4590
|
- @return {string[]} Supported-tag guidance lines.
|
|
4561
4591
|
|
|
4562
|
-
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (
|
|
4592
|
+
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L484-489)
|
|
4563
4593
|
- @brief Builds the schema description for one search-tool registration.
|
|
4564
4594
|
- @details Specializes the explicit-file and configured-directory input contracts while documenting the monolithic markdown output channel and minimal execution details shape. Runtime is O(1). No side effects occur.
|
|
4565
4595
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4566
4596
|
- @return {string} Parameter-schema description.
|
|
4567
4597
|
|
|
4568
|
-
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (
|
|
4598
|
+
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L497-510)
|
|
4569
4599
|
- @brief Builds the prompt-guideline set for one search-tool registration.
|
|
4570
4600
|
- @details Encodes scope selection, monolithic markdown output semantics, regex semantics, line-number behavior, tag-filter rules, and the full language-to-tag matrix as stable agent-oriented strings. Runtime is O(l * t log t). No side effects occur.
|
|
4571
4601
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4572
4602
|
- @return {string[]} Prompt-guideline strings.
|
|
4573
4603
|
|
|
4574
|
-
- type `type MonolithicToolRenderResult = {` (
|
|
4604
|
+
- type `type MonolithicToolRenderResult = {` (L516)
|
|
4575
4605
|
- @brief Describes the monolithic tool-result surface consumed by tool-row renderers.
|
|
4576
4606
|
- @details Narrows execute-result data to the primary text content block plus the minimal `details.execution` metadata returned by monolithic tool wrappers. The alias is compile-time only and introduces no runtime cost.
|
|
4577
|
-
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (
|
|
4607
|
+
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L533-536)
|
|
4578
4608
|
- @brief Extracts the primary monolithic text block from one tool result.
|
|
4579
4609
|
- @details Returns the first text content block when present and falls back to an empty string when the tool emitted no LLM-facing content. Runtime is O(1). No external state is mutated.
|
|
4580
4610
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4581
4611
|
- @return {string} Primary monolithic content text.
|
|
4582
4612
|
|
|
4583
|
-
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (
|
|
4613
|
+
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L544-554)
|
|
4584
4614
|
- @brief Reads the first residual execution error string from one monolithic tool result.
|
|
4585
4615
|
- @details Prefers the first `stderr_lines` entry when present and otherwise falls back to the first line of `stderr`. Runtime is O(1) plus first-line split cost. No external state is mutated.
|
|
4586
4616
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4587
4617
|
- @return {string | undefined} First residual execution error string.
|
|
4588
4618
|
|
|
4589
|
-
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (
|
|
4619
|
+
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L562-601)
|
|
4590
4620
|
- @brief Formats one scalar or structural tool argument for compact render summaries.
|
|
4591
4621
|
- @details Truncates long strings, compresses arrays into short previews, and renders plain object arguments as key indexes so collapsed tool rows stay compact while still exposing the essential invocation shape. Runtime is O(n) in preview size. No external state is mutated.
|
|
4592
4622
|
- @param[in] value {unknown} Candidate tool argument value.
|
|
4593
4623
|
- @return {string | undefined} Compact preview string or `undefined` when the value carries no useful summary.
|
|
4594
4624
|
|
|
4595
|
-
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (
|
|
4625
|
+
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L609-620)
|
|
4596
4626
|
- @brief Builds the compact invocation summary appended to collapsed tool rows.
|
|
4597
4627
|
- @details Renders only caller-supplied parameters that have stable, non-empty compact previews and joins them in insertion order so agents can infer how the tool was used without expanding the full result. Runtime is O(n) in argument count and preview size. No external state is mutated.
|
|
4598
4628
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4599
4629
|
- @return {string} Compact invocation summary prefixed with one separating space, or the empty string when no useful preview exists.
|
|
4600
4630
|
|
|
4601
|
-
### fn `function summarizeStructuredToolResult(` (
|
|
4631
|
+
### fn `function summarizeStructuredToolResult(` (L630-645)
|
|
4602
4632
|
- @brief Builds the compact default text for one monolithic tool result row.
|
|
4603
4633
|
- @details Prefers the tool name, compact invocation preview, and success marker for collapsed rows, and falls back to residual execution diagnostics when the tool failed before completing successfully. Runtime is O(n) in compact argument-preview size. No external state is mutated.
|
|
4604
4634
|
- @param[in] toolName {string} Registered tool name.
|
|
@@ -4606,20 +4636,20 @@ cost.
|
|
|
4606
4636
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4607
4637
|
- @return {string} Compact single-line summary.
|
|
4608
4638
|
|
|
4609
|
-
### fn `function buildStructuredToolRenderResult(toolName: string)` (
|
|
4639
|
+
### fn `function buildStructuredToolRenderResult(toolName: string)` (L654-673)
|
|
4610
4640
|
- @brief Builds a custom `renderResult` implementation for one monolithic tool.
|
|
4611
4641
|
- @details Reuses a mutable `Text` component when possible, keeps the default collapsed row compact with essential invocation parameters plus result status, and reveals the full monolithic content only when the tool row is expanded. Runtime is O(n) in expanded content length and compact argument-preview size. No external state is mutated.
|
|
4612
4642
|
- @param[in] toolName {string} Registered tool name.
|
|
4613
4643
|
- @return {(result: MonolithicToolRenderResult, options: { expanded?: boolean; isPartial?: boolean }, _theme: unknown, context: { args?: Record<string, unknown>; lastComponent?: unknown }) => Text} Custom result renderer.
|
|
4614
4644
|
- @satisfies REQ-210
|
|
4615
4645
|
|
|
4616
|
-
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4646
|
+
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L681-687)
|
|
4617
4647
|
- @brief Executes one CLI-style runner for a monolithic agent tool.
|
|
4618
4648
|
- @details Reuses the standalone tool-runner contract, normalizes thrown failures into `ToolResult`, and wraps the selected stdout or stderr text into the monolithic content channel. Runtime is dominated by the delegated runner. Side effects depend on the selected tool.
|
|
4619
4649
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4620
4650
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Monolithic tool execute result.
|
|
4621
4651
|
|
|
4622
|
-
### fn `function deliverPromptCommand(` (
|
|
4652
|
+
### fn `function deliverPromptCommand(` (L698-716)
|
|
4623
4653
|
- @brief Starts delivery of one rendered prompt into the current active session.
|
|
4624
4654
|
- @details Prefers the replacement-session `sendUserMessage(...)` helper exposed by `withSession(...)` callbacks after session replacement so post-switch prompt delivery never reuses stale pre-switch session-bound extension objects. Returns the underlying delivery promise without awaiting it so callers can record the `running` workflow transition as soon as prompt handoff is accepted instead of waiting for the full agent turn to complete on runtimes whose async replacement-session helpers resolve only after `agent_end`. When pi later invalidates that replacement-session context during successful prompt-end restoration, the helper suppresses the documented stale-extension-context rejection because the prompt was already accepted and late rethrow would surface a false orchestration failure. Falls back to `pi.sendUserMessage(...)` only for non-replacement flows or runtimes that do not expose replacement-session helpers. Runtime is O(n) in prompt length. Side effects are limited to user-message delivery.
|
|
4625
4655
|
- @param[in] pi {ExtensionAPI} Handler-scoped extension API instance retained as the fallback dispatcher.
|
|
@@ -4628,7 +4658,7 @@ cost.
|
|
|
4628
4658
|
- @return {Promise<void>} Promise representing eventual prompt-delivery completion.
|
|
4629
4659
|
- @satisfies REQ-004, REQ-067, REQ-068, REQ-227, REQ-281
|
|
4630
4660
|
|
|
4631
|
-
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (
|
|
4661
|
+
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L727-743)
|
|
4632
4662
|
- @brief Detects prompt-delivery failures that can be ignored after prompt ownership has moved past the command handler.
|
|
4633
4663
|
- @details Matches the documented stale-extension-context runtime error once prompt ownership has already moved beyond command-side preflight. The helper treats the failure as ignorable when the persisted prompt runtime state shows the same execution session as the active prompt run or when the persisted workflow state has already advanced beyond `checking|running`, because rethrowing at that point would incorrectly re-enter command-side abort logic after the prompt was already accepted. Runtime is O(n) in error-message length plus path length. No external state is mutated.
|
|
4634
4664
|
- @param[in] error {unknown} Candidate prompt-delivery failure.
|
|
@@ -4637,7 +4667,7 @@ cost.
|
|
|
4637
4667
|
- @return {boolean} `true` when the failure is a late stale-context delivery rejection that MUST be ignored.
|
|
4638
4668
|
- @satisfies REQ-208, REQ-280, REQ-281, REQ-282
|
|
4639
4669
|
|
|
4640
|
-
### fn `function logPromptWorkflowStateChange(` (
|
|
4670
|
+
### fn `function logPromptWorkflowStateChange(` (L756-775)
|
|
4641
4671
|
- @brief Appends one workflow-state debug entry for a bundled prompt when selected.
|
|
4642
4672
|
- @details Reuses the shared debug logger so `req-*` command handlers and prompt-end orchestration can record deterministic workflow transitions without duplicating JSON payload shaping. Runtime is O(n) in serialized payload size only when logging is enabled and O(1) otherwise. Side effects include debug-log file writes for matching enabled prompts.
|
|
4643
4673
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4648,7 +4678,7 @@ cost.
|
|
|
4648
4678
|
- @return {void} No return value.
|
|
4649
4679
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
4650
4680
|
|
|
4651
|
-
### fn `function logPromptWorkflowEvent(` (
|
|
4681
|
+
### fn `function logPromptWorkflowEvent(` (L791-811)
|
|
4652
4682
|
- @brief Appends one dedicated prompt workflow debug entry when selected.
|
|
4653
4683
|
- @details Reuses the shared workflow-event logger so prompt activation, restoration, closure, and session-shutdown paths can emit higher-granularity orchestration diagnostics without duplicating JSON payload shaping. Runtime is O(n) in serialized payload size only when logging is enabled and O(1) otherwise. Side effects include debug-log file writes for matching enabled prompts.
|
|
4654
4684
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4662,7 +4692,7 @@ cost.
|
|
|
4662
4692
|
- @return {void} No return value.
|
|
4663
4693
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
4664
4694
|
|
|
4665
|
-
### fn `function transitionPromptWorkflowState(` (
|
|
4695
|
+
### fn `function transitionPromptWorkflowState(` (L824-837)
|
|
4666
4696
|
- @brief Transitions one prompt workflow state and logs the transition immediately after the state update.
|
|
4667
4697
|
- @details Captures the previous workflow state, applies the new state through the shared status helper, and appends the gated `workflow_state` debug entry only after the transition has completed. Runtime is O(1). Side effects include status mutation, status-bar rendering, and optional debug-log writes.
|
|
4668
4698
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -4673,20 +4703,20 @@ cost.
|
|
|
4673
4703
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4674
4704
|
- @return {void} No return value.
|
|
4675
4705
|
|
|
4676
|
-
### fn `function resolvePromptCommandDescription(` (
|
|
4706
|
+
### fn `function resolvePromptCommandDescription(` (L845-849)
|
|
4677
4707
|
- @brief Resolves the runtime slash-command description for one bundled prompt.
|
|
4678
4708
|
- @details Reads the bundled prompt front matter, extracts its normalized `description` field, and falls back to the historical generated label when the prompt metadata omits a description. Runtime is O(n) in prompt length. Side effects are limited to filesystem reads.
|
|
4679
4709
|
- @param[in] promptName {import("./core/prompt-command-catalog.js").PromptCommandName} Bundled prompt name.
|
|
4680
4710
|
- @return {string} Runtime command description.
|
|
4681
4711
|
|
|
4682
|
-
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (
|
|
4712
|
+
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L858-862)
|
|
4683
4713
|
- @brief Resolves the original project base used for debug-log file writes.
|
|
4684
4714
|
- @details Prefers the active or pending prompt execution plan so tool-result logging during worktree-backed prompt runs persists into the original repository path instead of transient worktree directories. Runtime is O(1). No external state is mutated.
|
|
4685
4715
|
- @param[in] cwd {string} Current extension working directory.
|
|
4686
4716
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4687
4717
|
- @return {string} Absolute original project base path for debug logging.
|
|
4688
4718
|
|
|
4689
|
-
### fn `function notifyContextSafely(` (
|
|
4719
|
+
### fn `function notifyContextSafely(` (L873-890)
|
|
4690
4720
|
- @brief Delivers one best-effort UI notification without failing on stale replacement contexts.
|
|
4691
4721
|
- @details Attempts to use the supplied extension context for UI notification delivery and suppresses the documented stale-extension-context runtime error raised after session replacement, because prompt-orchestration closure can outlive the context that initiated the switch. Runtime is O(n) in message length. Side effects are limited to user notification delivery when the context is still active.
|
|
4692
4722
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext | undefined} Candidate UI context.
|
|
@@ -4695,20 +4725,20 @@ cost.
|
|
|
4695
4725
|
- @return {boolean} `true` when the notification was delivered and `false` when the context was already stale.
|
|
4696
4726
|
- @satisfies REQ-280
|
|
4697
4727
|
|
|
4698
|
-
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (
|
|
4728
|
+
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L899-907)
|
|
4699
4729
|
- @brief Returns the configurable active-tool inventory visible to the extension.
|
|
4700
4730
|
- @details Filters runtime tools against the canonical configurable-tool set, keeps only builtin-backed embedded tools, and orders the result by the documented custom/files/embedded/default-disabled grouping. Runtime is O(t log t). No external state is mutated.
|
|
4701
4731
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4702
4732
|
- @return {ToolInfo[]} Sorted configurable tool descriptors.
|
|
4703
4733
|
- @satisfies REQ-007, REQ-063, REQ-231, REQ-232
|
|
4704
4734
|
|
|
4705
|
-
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (
|
|
4735
|
+
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L915-919)
|
|
4706
4736
|
- @brief Normalizes and returns the configured enabled active tools.
|
|
4707
4737
|
- @details Reuses repository normalization rules, updates the config object in place, and returns the normalized array. Runtime is O(n) in configured tool count. Side effect: mutates `config["enabled-tools"]`.
|
|
4708
4738
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4709
4739
|
- @return {string[]} Normalized enabled tool names.
|
|
4710
4740
|
|
|
4711
|
-
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (
|
|
4741
|
+
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L929-946)
|
|
4712
4742
|
- @brief Applies the configured active-tool enablement to the current session.
|
|
4713
4743
|
- @details Preserves non-configurable active tools, removes every configurable tool from the active set, then re-adds only configured tools that exist in the current runtime inventory. Runtime is O(t). Side effects include `pi.setActiveTools(...)`.
|
|
4714
4744
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4716,7 +4746,7 @@ cost.
|
|
|
4716
4746
|
- @return {void} No return value.
|
|
4717
4747
|
- @satisfies REQ-009, REQ-064
|
|
4718
4748
|
|
|
4719
|
-
### fn `async function handleExtensionStatusEvent(` (
|
|
4749
|
+
### fn `async function handleExtensionStatusEvent(` (L959-1219)
|
|
4720
4750
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
4721
4751
|
- @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()`, merges and deletes the worktree only for matched successful completions, 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.
|
|
4722
4752
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4727,7 +4757,7 @@ cost.
|
|
|
4727
4757
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
4728
4758
|
- @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
|
|
4729
4759
|
|
|
4730
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
4760
|
+
### fn `function registerExtensionStatusHooks(` (L1235-1254)
|
|
4731
4761
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
4732
4762
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
4733
4763
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -4741,7 +4771,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4741
4771
|
- @return {void} No return value.
|
|
4742
4772
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
4743
4773
|
|
|
4744
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
4774
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1264-1267)
|
|
4745
4775
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
4746
4776
|
- @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.
|
|
4747
4777
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4749,26 +4779,26 @@ registered hook count. Side effects include hook registration.
|
|
|
4749
4779
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4750
4780
|
- @return {void} No return value.
|
|
4751
4781
|
|
|
4752
|
-
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (
|
|
4782
|
+
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1275-1277)
|
|
4753
4783
|
- @brief Returns the canonical debug-tool toggle order.
|
|
4754
4784
|
- @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.
|
|
4755
4785
|
- @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
|
|
4756
4786
|
- @satisfies REQ-242
|
|
4757
4787
|
|
|
4758
|
-
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (
|
|
4788
|
+
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1286-1294)
|
|
4759
4789
|
- @brief Restores the debug configuration subtree to its documented defaults.
|
|
4760
4790
|
- @details Resets global debug enablement, log path, 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`.
|
|
4761
4791
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4762
4792
|
- @return {void} No return value.
|
|
4763
4793
|
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277
|
|
4764
4794
|
|
|
4765
|
-
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (
|
|
4795
|
+
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1302-1308)
|
|
4766
4796
|
- @brief Formats the top-level Debug summary value.
|
|
4767
4797
|
- @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.
|
|
4768
4798
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4769
4799
|
- @return {string} Compact debug summary string.
|
|
4770
4800
|
|
|
4771
|
-
### fn `function buildDebugMenuChoice(` (
|
|
4801
|
+
### fn `function buildDebugMenuChoice(` (L1318-1331)
|
|
4772
4802
|
- @brief Builds one debug-menu row with optional disabled styling.
|
|
4773
4803
|
- @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.
|
|
4774
4804
|
- @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
|
|
@@ -4776,21 +4806,21 @@ registered hook count. Side effects include hook registration.
|
|
|
4776
4806
|
- @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
|
|
4777
4807
|
- @satisfies REQ-241
|
|
4778
4808
|
|
|
4779
|
-
### fn `async function selectDebugLogOnStatus(` (
|
|
4809
|
+
### fn `async function selectDebugLogOnStatus(` (L1340-1368)
|
|
4780
4810
|
- @brief Opens the workflow-state filter selector used by the Debug submenu.
|
|
4781
4811
|
- @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.
|
|
4782
4812
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4783
4813
|
- @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
|
|
4784
4814
|
- @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
|
|
4785
4815
|
|
|
4786
|
-
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4816
|
+
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1377-1448)
|
|
4787
4817
|
- @brief Builds the shared settings-menu choices for debug logging configuration.
|
|
4788
4818
|
- @details Serializes global debug controls plus 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.
|
|
4789
4819
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4790
4820
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
|
|
4791
4821
|
- @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277
|
|
4792
4822
|
|
|
4793
|
-
### fn `async function configureDebugMenu(` (
|
|
4823
|
+
### fn `async function configureDebugMenu(` (L1458-1575)
|
|
4794
4824
|
- @brief Runs the interactive Debug submenu.
|
|
4795
4825
|
- @details Lets the user toggle global debug enablement, edit debug file and workflow filters, toggle dedicated workflow-event logging, mutate per-tool and per-prompt debug selectors, and restore subtree defaults while preserving row focus across re-renders. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
4796
4826
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4798,45 +4828,45 @@ registered hook count. Side effects include hook registration.
|
|
|
4798
4828
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
4799
4829
|
- @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
|
|
4800
4830
|
|
|
4801
|
-
- type `type PiNotifyBooleanConfigKey =` (
|
|
4831
|
+
- type `type PiNotifyBooleanConfigKey =` (L1581)
|
|
4802
4832
|
- @brief Represents one persisted boolean notification-setting key.
|
|
4803
4833
|
- @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.
|
|
4804
|
-
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (
|
|
4834
|
+
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1598)
|
|
4805
4835
|
- @brief Represents one persisted boolean notification event-toggle key.
|
|
4806
4836
|
- @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.
|
|
4807
|
-
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (
|
|
4837
|
+
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1607)
|
|
4808
4838
|
- @brief Represents one shared prompt-end event identifier used by notification menus.
|
|
4809
4839
|
- @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.
|
|
4810
|
-
### iface `interface PiNotifyEventRowDefinition` (
|
|
4840
|
+
### iface `interface PiNotifyEventRowDefinition` (L1613-1617)
|
|
4811
4841
|
- @brief Describes one shared prompt-end event row rendered inside notification event submenus.
|
|
4812
4842
|
- @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.
|
|
4813
4843
|
|
|
4814
|
-
### iface `interface PiNotifyEventMenuDefinition` (
|
|
4844
|
+
### iface `interface PiNotifyEventMenuDefinition` (L1623-1629)
|
|
4815
4845
|
- @brief Describes one notification-system event submenu contract.
|
|
4816
4846
|
- @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.
|
|
4817
4847
|
|
|
4818
|
-
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (
|
|
4848
|
+
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1638-1641)
|
|
4819
4849
|
- @brief Flips one persisted boolean notification setting.
|
|
4820
4850
|
- @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`.
|
|
4821
4851
|
- @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
|
|
4822
4852
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4823
4853
|
- @return {boolean} Next enabled state.
|
|
4824
4854
|
|
|
4825
|
-
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (
|
|
4855
|
+
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L1650-1674)
|
|
4826
4856
|
- @brief Restores notification-related settings to their documented defaults.
|
|
4827
4857
|
- @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`.
|
|
4828
4858
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4829
4859
|
- @return {void} No return value.
|
|
4830
4860
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
|
|
4831
4861
|
|
|
4832
|
-
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (
|
|
4862
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L1683-1685)
|
|
4833
4863
|
- @brief Formats one persisted Pushover priority for menu display.
|
|
4834
4864
|
- @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.
|
|
4835
4865
|
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
4836
4866
|
- @return {string} Menu-display label.
|
|
4837
4867
|
- @satisfies REQ-172
|
|
4838
4868
|
|
|
4839
|
-
### fn `function formatPiNotifyEventMenuSummary(` (
|
|
4869
|
+
### fn `function formatPiNotifyEventMenuSummary(` (L1762-1770)
|
|
4840
4870
|
- @brief Formats the top-level summary value for one notification event submenu.
|
|
4841
4871
|
- @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.
|
|
4842
4872
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -4844,7 +4874,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4844
4874
|
- @return {string} Compact enabled-toggle summary.
|
|
4845
4875
|
- @satisfies REQ-198
|
|
4846
4876
|
|
|
4847
|
-
### fn `function buildPiNotifyEventLauncherChoice(` (
|
|
4877
|
+
### fn `function buildPiNotifyEventLauncherChoice(` (L1780-1790)
|
|
4848
4878
|
- @brief Builds the top-level launcher row for one notification event submenu.
|
|
4849
4879
|
- @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.
|
|
4850
4880
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -4852,15 +4882,15 @@ registered hook count. Side effects include hook registration.
|
|
|
4852
4882
|
- @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
|
|
4853
4883
|
- @satisfies REQ-181, REQ-183, REQ-165, REQ-198
|
|
4854
4884
|
|
|
4855
|
-
### fn `function buildPiNotifyEventMenuChoices(` (
|
|
4885
|
+
### fn `function buildPiNotifyEventMenuChoices(` (L1800-1815)
|
|
4856
4886
|
- @brief Builds the shared settings-menu choices for one notification event submenu.
|
|
4857
|
-
- @details Serializes completed/interrupted/failed rows with right-aligned `on|off` values, then appends `Reset defaults`
|
|
4887
|
+
- @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.
|
|
4858
4888
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4859
4889
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
4860
4890
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
|
|
4861
4891
|
- @satisfies REQ-188, REQ-193, REQ-198
|
|
4862
4892
|
|
|
4863
|
-
### fn `function resetPiNotifyEventMenuToDefaults(` (
|
|
4893
|
+
### fn `function resetPiNotifyEventMenuToDefaults(` (L1825-1833)
|
|
4864
4894
|
- @brief Restores one notification event submenu to its documented defaults.
|
|
4865
4895
|
- @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`.
|
|
4866
4896
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
@@ -4868,7 +4898,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4868
4898
|
- @return {void} No return value.
|
|
4869
4899
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195
|
|
4870
4900
|
|
|
4871
|
-
### fn `function resolvePiNotifyEventLabel(` (
|
|
4901
|
+
### fn `function resolvePiNotifyEventLabel(` (L1843-1850)
|
|
4872
4902
|
- @brief Resolves the human-readable event label for one event-toggle config key.
|
|
4873
4903
|
- @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.
|
|
4874
4904
|
- @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
|
|
@@ -4876,7 +4906,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4876
4906
|
- @return {string} Human-readable event label.
|
|
4877
4907
|
- @satisfies REQ-188, REQ-198
|
|
4878
4908
|
|
|
4879
|
-
### fn `async function configurePiNotifyEventMenu(` (
|
|
4909
|
+
### fn `async function configurePiNotifyEventMenu(` (L1861-1921)
|
|
4880
4910
|
- @brief Runs one dedicated notification event submenu.
|
|
4881
4911
|
- @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.
|
|
4882
4912
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4885,37 +4915,37 @@ registered hook count. Side effects include hook registration.
|
|
|
4885
4915
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
4886
4916
|
- @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
|
|
4887
4917
|
|
|
4888
|
-
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4918
|
+
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1930-1979)
|
|
4889
4919
|
- @brief Builds the direct Pushover rows rendered inside `Notifications`.
|
|
4890
4920
|
- @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, 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.
|
|
4891
4921
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4892
4922
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
|
|
4893
4923
|
- @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
|
|
4894
4924
|
|
|
4895
|
-
### fn `async function selectPiNotifyPushoverPriority(` (
|
|
4925
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L1989-2017)
|
|
4896
4926
|
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
4897
|
-
- @details Reuses the pi-usereq settings-menu renderer so Pushover priority selection remains stylistically aligned with the notification menus and appends subtree-local `Reset defaults`
|
|
4927
|
+
- @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.
|
|
4898
4928
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4899
4929
|
- @param[in] currentPriority {PiNotifyPushoverPriority} Persisted priority value.
|
|
4900
4930
|
- @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
|
|
4901
4931
|
- @satisfies REQ-172, REQ-192
|
|
4902
4932
|
|
|
4903
|
-
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4933
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2026-2083)
|
|
4904
4934
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
4905
4935
|
- @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 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.
|
|
4906
4936
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4907
4937
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
4908
4938
|
- @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
|
|
4909
4939
|
|
|
4910
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
4940
|
+
### fn `async function selectPiNotifySoundLevel(` (L2093-2133)
|
|
4911
4941
|
- @brief Opens the shared settings-menu selector for the active sound level.
|
|
4912
|
-
- @details Reuses the pi-usereq settings-menu renderer so sound-level selection remains stylistically aligned with the notification menu and appends subtree-local `Reset defaults`
|
|
4942
|
+
- @details Reuses the pi-usereq settings-menu renderer so sound-level selection remains stylistically aligned with the notification menu 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.
|
|
4913
4943
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4914
4944
|
- @param[in] currentLevel {PiNotifySoundLevel} Currently selected sound level.
|
|
4915
4945
|
- @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected sound level, reset action, or `undefined` when cancelled.
|
|
4916
4946
|
- @satisfies REQ-131, REQ-179, REQ-192
|
|
4917
4947
|
|
|
4918
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
4948
|
+
### fn `async function configurePiNotifyMenu(` (L2143-2409)
|
|
4919
4949
|
- @brief Runs the interactive notification-configuration menu.
|
|
4920
4950
|
- @details Exposes command-notify, sound, and Pushover controls through the shared settings-menu renderer, delegates completed/interrupted/failed toggles to dedicated event submenus, 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.
|
|
4921
4951
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4923,7 +4953,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4923
4953
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
4924
4954
|
- @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
|
|
4925
4955
|
|
|
4926
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
4956
|
+
### fn `function registerPiNotifyShortcut(` (L2424-2444)
|
|
4927
4957
|
- @brief Registers the configurable notification-sound shortcut when supported.
|
|
4928
4958
|
- @details Loads the current project config, registers one raw pi shortcut when
|
|
4929
4959
|
the runtime exposes `registerShortcut(...)`, cycles persisted sound state on
|
|
@@ -4936,7 +4966,7 @@ updates.
|
|
|
4936
4966
|
- @return {void} No return value.
|
|
4937
4967
|
- @satisfies REQ-131, REQ-134, REQ-180
|
|
4938
4968
|
|
|
4939
|
-
### fn `function registerPromptCommands(` (
|
|
4969
|
+
### fn `function registerPromptCommands(` (L2454-2572)
|
|
4940
4970
|
- @brief Registers bundled prompt commands with the extension.
|
|
4941
4971
|
- @details Creates one `req-<prompt>` command per bundled prompt name. Each handler rejects non-`idle` workflow state, 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.
|
|
4942
4972
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4944,14 +4974,14 @@ updates.
|
|
|
4944
4974
|
- @return {void} No return value.
|
|
4945
4975
|
- @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
|
|
4946
4976
|
|
|
4947
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
4977
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L2582-2881)
|
|
4948
4978
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
4949
4979
|
- @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.
|
|
4950
4980
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4951
4981
|
- @return {void} No return value.
|
|
4952
4982
|
- @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
|
|
4953
4983
|
|
|
4954
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4984
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2899-2924)
|
|
4955
4985
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
4956
4986
|
- @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.
|
|
4957
4987
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4959,15 +4989,15 @@ updates.
|
|
|
4959
4989
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
4960
4990
|
- @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
4961
4991
|
|
|
4962
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4992
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2934-2947)
|
|
4963
4993
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
4964
|
-
- @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 subtree-local `Reset defaults`
|
|
4994
|
+
- @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.
|
|
4965
4995
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4966
4996
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4967
4997
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
4968
4998
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
|
|
4969
4999
|
|
|
4970
|
-
### fn `async function configurePiUsereqToolsMenu(` (
|
|
5000
|
+
### fn `async function configurePiUsereqToolsMenu(` (L2958-3053)
|
|
4971
5001
|
- @brief Runs the interactive active-tool configuration menu.
|
|
4972
5002
|
- @details Synchronizes runtime active tools with persisted config, renders startup-tool actions through the shared settings-menu UI, 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.
|
|
4973
5003
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4976,58 +5006,58 @@ updates.
|
|
|
4976
5006
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
4977
5007
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
|
|
4978
5008
|
|
|
4979
|
-
### fn `function getStaticCheckLanguageConfigForMenu(` (
|
|
5009
|
+
### fn `function getStaticCheckLanguageConfigForMenu(` (L3062-3067)
|
|
4980
5010
|
- @brief Resolves one static-check language config for menu rendering.
|
|
4981
5011
|
- @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.
|
|
4982
5012
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4983
5013
|
- @param[in] language {string} Canonical language name.
|
|
4984
5014
|
- @return {StaticCheckLanguageConfig} Resolved per-language config object.
|
|
4985
5015
|
|
|
4986
|
-
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5016
|
+
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3075-3077)
|
|
4987
5017
|
- @brief Counts languages that currently expose at least one configured checker.
|
|
4988
5018
|
- @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.
|
|
4989
5019
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4990
5020
|
- @return {number} Number of languages with at least one configured checker.
|
|
4991
5021
|
|
|
4992
|
-
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5022
|
+
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3085-3087)
|
|
4993
5023
|
- @brief Counts languages whose static-check enable flag is on.
|
|
4994
5024
|
- @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.
|
|
4995
5025
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4996
5026
|
- @return {number} Number of enabled languages.
|
|
4997
5027
|
|
|
4998
|
-
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (
|
|
5028
|
+
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3096-3098)
|
|
4999
5029
|
- @brief Restores the documented static-check default configuration.
|
|
5000
5030
|
- @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`.
|
|
5001
5031
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5002
5032
|
- @return {void} No return value.
|
|
5003
5033
|
- @satisfies REQ-250, REQ-251, REQ-252
|
|
5004
5034
|
|
|
5005
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
5035
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3106-3108)
|
|
5006
5036
|
- @brief Summarizes enabled and configured static-check languages.
|
|
5007
5037
|
- @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.
|
|
5008
5038
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5009
5039
|
- @return {string} Compact summary string.
|
|
5010
5040
|
|
|
5011
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5041
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3117-3148)
|
|
5012
5042
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
5013
5043
|
- @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.
|
|
5014
5044
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5015
5045
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
5016
5046
|
- @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
|
|
5017
5047
|
|
|
5018
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5048
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3156-3173)
|
|
5019
5049
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
5020
5050
|
- @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.
|
|
5021
5051
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5022
5052
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
5023
5053
|
|
|
5024
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5054
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3181-3198)
|
|
5025
5055
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
5026
5056
|
- @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.
|
|
5027
5057
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5028
5058
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
5029
5059
|
|
|
5030
|
-
### fn `async function configureStaticCheckMenu(` (
|
|
5060
|
+
### fn `async function configureStaticCheckMenu(` (L3208-3341)
|
|
5031
5061
|
- @brief Runs the interactive static-check configuration menu.
|
|
5032
5062
|
- @details Lets the user add Command entries by guided prompts, remove configured language entries, toggle direct 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.
|
|
5033
5063
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5035,7 +5065,7 @@ updates.
|
|
|
5035
5065
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5036
5066
|
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
|
|
5037
5067
|
|
|
5038
|
-
### fn `function buildPiUsereqMenuChoices(` (
|
|
5068
|
+
### fn `function buildPiUsereqMenuChoices(` (L3351-3440)
|
|
5039
5069
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
5040
5070
|
- @details Serializes primary configuration actions into right-valued menu rows consumed by the shared settings-menu renderer, including automatic git-commit mode, effective prompt-command worktree state, notification summary, debug summary, locked worktree rows when automatic git commit is disabled, and the display-only config path beside `show-config`. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
5041
5071
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -5043,21 +5073,21 @@ updates.
|
|
|
5043
5073
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
5044
5074
|
- @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
|
|
5045
5075
|
|
|
5046
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5076
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3449-3467)
|
|
5047
5077
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
5048
5078
|
- @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.
|
|
5049
5079
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5050
5080
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
5051
5081
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5052
5082
|
|
|
5053
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5083
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3476-3488)
|
|
5054
5084
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
5055
|
-
- @details Exposes every configured `src-dir` entry as one removable row and appends subtree-local `Reset defaults`
|
|
5085
|
+
- @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.
|
|
5056
5086
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5057
5087
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
5058
5088
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
5059
5089
|
|
|
5060
|
-
### fn `async function configurePiUsereq(` (
|
|
5090
|
+
### fn `async function configurePiUsereq(` (L3499-3719)
|
|
5061
5091
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
5062
5092
|
- @details Loads project 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 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.
|
|
5063
5093
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5066,9 +5096,9 @@ updates.
|
|
|
5066
5096
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
5067
5097
|
- @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
|
|
5068
5098
|
|
|
5069
|
-
### fn `const persistConfigChange = () =>` (
|
|
5099
|
+
### fn `const persistConfigChange = () =>` (L3510-3515)
|
|
5070
5100
|
|
|
5071
|
-
### fn `function registerConfigCommands(` (
|
|
5101
|
+
### fn `function registerConfigCommands(` (L3729-3739)
|
|
5072
5102
|
- @brief Registers configuration-management commands.
|
|
5073
5103
|
- @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.
|
|
5074
5104
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5076,7 +5106,7 @@ updates.
|
|
|
5076
5106
|
- @return {void} No return value.
|
|
5077
5107
|
- @satisfies REQ-006, REQ-031
|
|
5078
5108
|
|
|
5079
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
5109
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L3757-3765)
|
|
5080
5110
|
- @brief Registers the complete pi-usereq extension.
|
|
5081
5111
|
- @details Validates installation-owned bundled resources, registers prompt and
|
|
5082
5112
|
configuration commands plus agent tools, registers the configurable
|
|
@@ -5090,7 +5120,7 @@ command/tool/shortcut registration, UI updates, active-tool changes,
|
|
|
5090
5120
|
optional debug-log writes, and timer scheduling.
|
|
5091
5121
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5092
5122
|
- @return {void} No return value.
|
|
5093
|
-
- @satisfies DES-002, REQ-004, REQ-005, REQ-009, REQ-044, REQ-067, REQ-068, REQ-109, REQ-111, REQ-112, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117, REQ-118, REQ-119, REQ-120, REQ-121, REQ-122, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-131, REQ-132, REQ-133, REQ-134, REQ-137, REQ-
|
|
5123
|
+
- @satisfies DES-002, REQ-004, REQ-005, REQ-009, REQ-044, REQ-067, REQ-068, REQ-109, REQ-111, REQ-112, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117, REQ-118, REQ-119, REQ-120, REQ-121, REQ-122, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-131, REQ-132, REQ-133, REQ-134, REQ-137, REQ-159, REQ-163, REQ-164, REQ-165, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-174, REQ-179, REQ-180, REQ-184, REQ-188, REQ-190, REQ-191, REQ-192, REQ-193, REQ-194, REQ-195, REQ-196, REQ-197, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-244, REQ-245, REQ-246, REQ-247
|
|
5094
5124
|
|
|
5095
5125
|
## Symbol Index
|
|
5096
5126
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
@@ -5103,83 +5133,83 @@ optional debug-log writes, and timer scheduling.
|
|
|
5103
5133
|
|`loadProjectConfig`|fn||249-252|function loadProjectConfig(cwd: string): UseReqConfig|
|
|
5104
5134
|
|`saveProjectConfig`|fn||262-265|function saveProjectConfig(cwd: string, config: UseReqCon...|
|
|
5105
5135
|
|`formatProjectConfigPathForMenu`|fn||274-278|function formatProjectConfigPathForMenu(cwd: string): string|
|
|
5106
|
-
|`buildTerminalSettingsMenuChoices`|fn||287-
|
|
5107
|
-
|`ResetConfirmationChange`|iface||
|
|
5108
|
-
|`formatResetConfirmationValue`|fn||
|
|
5109
|
-
|`buildResetConfirmationChoices`|fn||
|
|
5110
|
-
|`confirmResetChanges`|fn||
|
|
5111
|
-
|`writePersistedProjectConfigToEditor`|fn||
|
|
5112
|
-
|`buildSearchToolSupportedTagGuidelines`|fn||
|
|
5113
|
-
|`buildSearchToolSchemaDescription`|fn||
|
|
5114
|
-
|`buildSearchToolPromptGuidelines`|fn||
|
|
5115
|
-
|`MonolithicToolRenderResult`|type||
|
|
5116
|
-
|`getMonolithicToolText`|fn||
|
|
5117
|
-
|`getMonolithicToolErrorText`|fn||
|
|
5118
|
-
|`formatCompactToolArgumentValue`|fn||
|
|
5119
|
-
|`buildCompactToolInvocationText`|fn||
|
|
5120
|
-
|`summarizeStructuredToolResult`|fn||
|
|
5121
|
-
|`buildStructuredToolRenderResult`|fn||
|
|
5122
|
-
|`executeMonolithicTool`|fn||
|
|
5123
|
-
|`deliverPromptCommand`|fn||
|
|
5124
|
-
|`shouldIgnoreLatePromptDeliveryFailure`|fn||
|
|
5125
|
-
|`logPromptWorkflowStateChange`|fn||
|
|
5126
|
-
|`logPromptWorkflowEvent`|fn||
|
|
5127
|
-
|`transitionPromptWorkflowState`|fn||
|
|
5128
|
-
|`resolvePromptCommandDescription`|fn||
|
|
5129
|
-
|`resolveDebugProjectBase`|fn||
|
|
5130
|
-
|`notifyContextSafely`|fn||
|
|
5131
|
-
|`getPiUsereqStartupTools`|fn||
|
|
5132
|
-
|`getConfiguredEnabledPiUsereqTools`|fn||
|
|
5133
|
-
|`applyConfiguredPiUsereqTools`|fn||
|
|
5134
|
-
|`handleExtensionStatusEvent`|fn||
|
|
5135
|
-
|`registerExtensionStatusHooks`|fn||
|
|
5136
|
-
|`setConfiguredPiUsereqTools`|fn||
|
|
5137
|
-
|`getDebugToolToggleNames`|fn||
|
|
5138
|
-
|`resetDebugConfigToDefaults`|fn||
|
|
5139
|
-
|`formatDebugMenuSummary`|fn||
|
|
5140
|
-
|`buildDebugMenuChoice`|fn||
|
|
5141
|
-
|`selectDebugLogOnStatus`|fn||
|
|
5142
|
-
|`buildDebugMenuChoices`|fn||
|
|
5143
|
-
|`configureDebugMenu`|fn||
|
|
5144
|
-
|`PiNotifyBooleanConfigKey`|type||
|
|
5145
|
-
|`PiNotifyEventBooleanConfigKey`|type||
|
|
5146
|
-
|`PiNotifyEventId`|type||
|
|
5147
|
-
|`PiNotifyEventRowDefinition`|iface||
|
|
5148
|
-
|`PiNotifyEventMenuDefinition`|iface||
|
|
5149
|
-
|`togglePiNotifyFlag`|fn||1641
|
|
5150
|
-
|`resetPiNotifyConfigToDefaults`|fn||
|
|
5151
|
-
|`formatPiNotifyPushoverPriority`|fn||
|
|
5152
|
-
|`formatPiNotifyEventMenuSummary`|fn||
|
|
5153
|
-
|`buildPiNotifyEventLauncherChoice`|fn||
|
|
5154
|
-
|`buildPiNotifyEventMenuChoices`|fn||
|
|
5155
|
-
|`resetPiNotifyEventMenuToDefaults`|fn||
|
|
5156
|
-
|`resolvePiNotifyEventLabel`|fn||
|
|
5157
|
-
|`configurePiNotifyEventMenu`|fn||
|
|
5158
|
-
|`buildPiNotifyPushoverRows`|fn||
|
|
5159
|
-
|`selectPiNotifyPushoverPriority`|fn||
|
|
5160
|
-
|`buildPiNotifyMenuChoices`|fn||
|
|
5161
|
-
|`selectPiNotifySoundLevel`|fn||
|
|
5162
|
-
|`configurePiNotifyMenu`|fn||
|
|
5163
|
-
|`registerPiNotifyShortcut`|fn||
|
|
5164
|
-
|`registerPromptCommands`|fn||
|
|
5165
|
-
|`registerAgentTools`|fn||
|
|
5166
|
-
|`buildPiUsereqToolsMenuChoices`|fn||
|
|
5167
|
-
|`buildPiUsereqToolToggleChoices`|fn||
|
|
5168
|
-
|`configurePiUsereqToolsMenu`|fn||
|
|
5169
|
-
|`getStaticCheckLanguageConfigForMenu`|fn||
|
|
5170
|
-
|`countConfiguredStaticCheckLanguages`|fn||
|
|
5171
|
-
|`countEnabledStaticCheckLanguages`|fn||
|
|
5172
|
-
|`resetStaticCheckConfig`|fn||
|
|
5173
|
-
|`formatStaticCheckLanguagesSummary`|fn||
|
|
5174
|
-
|`buildStaticCheckMenuChoices`|fn||
|
|
5175
|
-
|`buildSupportedStaticCheckLanguageChoices`|fn||
|
|
5176
|
-
|`buildConfiguredStaticCheckLanguageChoices`|fn||
|
|
5177
|
-
|`configureStaticCheckMenu`|fn||
|
|
5178
|
-
|`buildPiUsereqMenuChoices`|fn||
|
|
5179
|
-
|`buildSrcDirMenuChoices`|fn||
|
|
5180
|
-
|`buildSrcDirRemovalChoices`|fn||
|
|
5181
|
-
|`configurePiUsereq`|fn||
|
|
5182
|
-
|`persistConfigChange`|fn||
|
|
5183
|
-
|`registerConfigCommands`|fn||
|
|
5184
|
-
|`piUsereqExtension`|fn||
|
|
5136
|
+
|`buildTerminalSettingsMenuChoices`|fn||287-298|function buildTerminalSettingsMenuChoices(options:|
|
|
5137
|
+
|`ResetConfirmationChange`|iface||304-308|interface ResetConfirmationChange|
|
|
5138
|
+
|`formatResetConfirmationValue`|fn||317-319|function formatResetConfirmationValue(previousValue: stri...|
|
|
5139
|
+
|`buildResetConfirmationChoices`|fn||329-368|function buildResetConfirmationChoices(|
|
|
5140
|
+
|`confirmResetChanges`|fn||380-393|async function confirmResetChanges(|
|
|
5141
|
+
|`writePersistedProjectConfigToEditor`|fn||404-411|function writePersistedProjectConfigToEditor(|
|
|
5142
|
+
|`buildSearchToolSupportedTagGuidelines`|fn||472-476|function buildSearchToolSupportedTagGuidelines(): string[]|
|
|
5143
|
+
|`buildSearchToolSchemaDescription`|fn||484-489|function buildSearchToolSchemaDescription(scope: FindTool...|
|
|
5144
|
+
|`buildSearchToolPromptGuidelines`|fn||497-510|function buildSearchToolPromptGuidelines(scope: FindToolS...|
|
|
5145
|
+
|`MonolithicToolRenderResult`|type||516||
|
|
5146
|
+
|`getMonolithicToolText`|fn||533-536|function getMonolithicToolText(result: MonolithicToolRend...|
|
|
5147
|
+
|`getMonolithicToolErrorText`|fn||544-554|function getMonolithicToolErrorText(result: MonolithicToo...|
|
|
5148
|
+
|`formatCompactToolArgumentValue`|fn||562-601|function formatCompactToolArgumentValue(value: unknown): ...|
|
|
5149
|
+
|`buildCompactToolInvocationText`|fn||609-620|function buildCompactToolInvocationText(args: Record<stri...|
|
|
5150
|
+
|`summarizeStructuredToolResult`|fn||630-645|function summarizeStructuredToolResult(|
|
|
5151
|
+
|`buildStructuredToolRenderResult`|fn||654-673|function buildStructuredToolRenderResult(toolName: string)|
|
|
5152
|
+
|`executeMonolithicTool`|fn||681-687|function executeMonolithicTool(operation: () => ToolResul...|
|
|
5153
|
+
|`deliverPromptCommand`|fn||698-716|function deliverPromptCommand(|
|
|
5154
|
+
|`shouldIgnoreLatePromptDeliveryFailure`|fn||727-743|function shouldIgnoreLatePromptDeliveryFailure(|
|
|
5155
|
+
|`logPromptWorkflowStateChange`|fn||756-775|function logPromptWorkflowStateChange(|
|
|
5156
|
+
|`logPromptWorkflowEvent`|fn||791-811|function logPromptWorkflowEvent(|
|
|
5157
|
+
|`transitionPromptWorkflowState`|fn||824-837|function transitionPromptWorkflowState(|
|
|
5158
|
+
|`resolvePromptCommandDescription`|fn||845-849|function resolvePromptCommandDescription(|
|
|
5159
|
+
|`resolveDebugProjectBase`|fn||858-862|function resolveDebugProjectBase(cwd: string, statusContr...|
|
|
5160
|
+
|`notifyContextSafely`|fn||873-890|function notifyContextSafely(|
|
|
5161
|
+
|`getPiUsereqStartupTools`|fn||899-907|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
|
|
5162
|
+
|`getConfiguredEnabledPiUsereqTools`|fn||915-919|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
|
|
5163
|
+
|`applyConfiguredPiUsereqTools`|fn||929-946|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
|
|
5164
|
+
|`handleExtensionStatusEvent`|fn||959-1219|async function handleExtensionStatusEvent(|
|
|
5165
|
+
|`registerExtensionStatusHooks`|fn||1235-1254|function registerExtensionStatusHooks(|
|
|
5166
|
+
|`setConfiguredPiUsereqTools`|fn||1264-1267|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
|
|
5167
|
+
|`getDebugToolToggleNames`|fn||1275-1277|function getDebugToolToggleNames(): PiUsereqStartupToolNa...|
|
|
5168
|
+
|`resetDebugConfigToDefaults`|fn||1286-1294|function resetDebugConfigToDefaults(config: UseReqConfig)...|
|
|
5169
|
+
|`formatDebugMenuSummary`|fn||1302-1308|function formatDebugMenuSummary(config: UseReqConfig): st...|
|
|
5170
|
+
|`buildDebugMenuChoice`|fn||1318-1331|function buildDebugMenuChoice(|
|
|
5171
|
+
|`selectDebugLogOnStatus`|fn||1340-1368|async function selectDebugLogOnStatus(|
|
|
5172
|
+
|`buildDebugMenuChoices`|fn||1377-1448|function buildDebugMenuChoices(config: UseReqConfig): PiU...|
|
|
5173
|
+
|`configureDebugMenu`|fn||1458-1575|async function configureDebugMenu(|
|
|
5174
|
+
|`PiNotifyBooleanConfigKey`|type||1581||
|
|
5175
|
+
|`PiNotifyEventBooleanConfigKey`|type||1598||
|
|
5176
|
+
|`PiNotifyEventId`|type||1607||
|
|
5177
|
+
|`PiNotifyEventRowDefinition`|iface||1613-1617|interface PiNotifyEventRowDefinition|
|
|
5178
|
+
|`PiNotifyEventMenuDefinition`|iface||1623-1629|interface PiNotifyEventMenuDefinition|
|
|
5179
|
+
|`togglePiNotifyFlag`|fn||1638-1641|function togglePiNotifyFlag(config: UseReqConfig, key: Pi...|
|
|
5180
|
+
|`resetPiNotifyConfigToDefaults`|fn||1650-1674|function resetPiNotifyConfigToDefaults(config: UseReqConf...|
|
|
5181
|
+
|`formatPiNotifyPushoverPriority`|fn||1683-1685|function formatPiNotifyPushoverPriority(priority: PiNotif...|
|
|
5182
|
+
|`formatPiNotifyEventMenuSummary`|fn||1762-1770|function formatPiNotifyEventMenuSummary(|
|
|
5183
|
+
|`buildPiNotifyEventLauncherChoice`|fn||1780-1790|function buildPiNotifyEventLauncherChoice(|
|
|
5184
|
+
|`buildPiNotifyEventMenuChoices`|fn||1800-1815|function buildPiNotifyEventMenuChoices(|
|
|
5185
|
+
|`resetPiNotifyEventMenuToDefaults`|fn||1825-1833|function resetPiNotifyEventMenuToDefaults(|
|
|
5186
|
+
|`resolvePiNotifyEventLabel`|fn||1843-1850|function resolvePiNotifyEventLabel(|
|
|
5187
|
+
|`configurePiNotifyEventMenu`|fn||1861-1921|async function configurePiNotifyEventMenu(|
|
|
5188
|
+
|`buildPiNotifyPushoverRows`|fn||1930-1979|function buildPiNotifyPushoverRows(config: UseReqConfig):...|
|
|
5189
|
+
|`selectPiNotifyPushoverPriority`|fn||1989-2017|async function selectPiNotifyPushoverPriority(|
|
|
5190
|
+
|`buildPiNotifyMenuChoices`|fn||2026-2083|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
|
|
5191
|
+
|`selectPiNotifySoundLevel`|fn||2093-2133|async function selectPiNotifySoundLevel(|
|
|
5192
|
+
|`configurePiNotifyMenu`|fn||2143-2409|async function configurePiNotifyMenu(|
|
|
5193
|
+
|`registerPiNotifyShortcut`|fn||2424-2444|function registerPiNotifyShortcut(|
|
|
5194
|
+
|`registerPromptCommands`|fn||2454-2572|function registerPromptCommands(|
|
|
5195
|
+
|`registerAgentTools`|fn||2582-2881|function registerAgentTools(pi: ExtensionAPI): void|
|
|
5196
|
+
|`buildPiUsereqToolsMenuChoices`|fn||2899-2924|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
|
|
5197
|
+
|`buildPiUsereqToolToggleChoices`|fn||2934-2947|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
|
|
5198
|
+
|`configurePiUsereqToolsMenu`|fn||2958-3053|async function configurePiUsereqToolsMenu(|
|
|
5199
|
+
|`getStaticCheckLanguageConfigForMenu`|fn||3062-3067|function getStaticCheckLanguageConfigForMenu(|
|
|
5200
|
+
|`countConfiguredStaticCheckLanguages`|fn||3075-3077|function countConfiguredStaticCheckLanguages(config: UseR...|
|
|
5201
|
+
|`countEnabledStaticCheckLanguages`|fn||3085-3087|function countEnabledStaticCheckLanguages(config: UseReqC...|
|
|
5202
|
+
|`resetStaticCheckConfig`|fn||3096-3098|function resetStaticCheckConfig(config: UseReqConfig): void|
|
|
5203
|
+
|`formatStaticCheckLanguagesSummary`|fn||3106-3108|function formatStaticCheckLanguagesSummary(config: UseReq...|
|
|
5204
|
+
|`buildStaticCheckMenuChoices`|fn||3117-3148|function buildStaticCheckMenuChoices(config: UseReqConfig...|
|
|
5205
|
+
|`buildSupportedStaticCheckLanguageChoices`|fn||3156-3173|function buildSupportedStaticCheckLanguageChoices(config:...|
|
|
5206
|
+
|`buildConfiguredStaticCheckLanguageChoices`|fn||3181-3198|function buildConfiguredStaticCheckLanguageChoices(config...|
|
|
5207
|
+
|`configureStaticCheckMenu`|fn||3208-3341|async function configureStaticCheckMenu(|
|
|
5208
|
+
|`buildPiUsereqMenuChoices`|fn||3351-3440|function buildPiUsereqMenuChoices(|
|
|
5209
|
+
|`buildSrcDirMenuChoices`|fn||3449-3467|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
|
|
5210
|
+
|`buildSrcDirRemovalChoices`|fn||3476-3488|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
|
|
5211
|
+
|`configurePiUsereq`|fn||3499-3719|async function configurePiUsereq(|
|
|
5212
|
+
|`persistConfigChange`|fn||3510-3515|const persistConfigChange = () =>|
|
|
5213
|
+
|`registerConfigCommands`|fn||3729-3739|function registerConfigCommands(|
|
|
5214
|
+
|`piUsereqExtension`|fn||3757-3765|export default function piUsereqExtension(pi: ExtensionAP...|
|
|
5185
5215
|
|