pi-usereq 0.33.0 → 0.35.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/.g.conf +0 -4
- package/.github/workflows/release-npm.yml +4 -2
- package/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +370 -350
- package/pi-usereq/docs/REQUIREMENTS.md +12 -12
- package/pi-usereq/docs/WORKFLOW.md +32 -18
- package/src/core/extension-status.ts +19 -3
- package/src/core/path-context.ts +59 -0
- package/src/index.ts +20 -14
- package/tests/extension-registration.test.ts +84 -11
- package/tests/release-workflow.test.ts +61 -0
|
@@ -1288,7 +1288,7 @@ import {
|
|
|
1288
1288
|
|
|
1289
1289
|
---
|
|
1290
1290
|
|
|
1291
|
-
# extension-status.ts | TypeScript |
|
|
1291
|
+
# extension-status.ts | TypeScript | 896L | 47 symbols | 7 imports | 49 comments
|
|
1292
1292
|
> Path: `src/core/extension-status.ts`
|
|
1293
1293
|
- @brief Tracks pi-usereq extension status state and renders status-bar telemetry.
|
|
1294
1294
|
- @details Centralizes hook interception, context-usage snapshots, active-branch lookup, run timing, and deterministic status-bar formatting for the pi-usereq extension. Runtime
|
|
@@ -1303,125 +1303,126 @@ import type { UseReqConfig } from "./config.js";
|
|
|
1303
1303
|
import type { PiNotifySoundLevel } from "./pi-notify.js";
|
|
1304
1304
|
import type { PromptCommandExecutionPlan } from "./prompt-command-runtime.js";
|
|
1305
1305
|
import {
|
|
1306
|
+
import { getInstallationPackageMetadata } from "./path-context.js";
|
|
1306
1307
|
import { resolveRuntimeGitBranchName } from "./runtime-project-paths.js";
|
|
1307
1308
|
```
|
|
1308
1309
|
|
|
1309
1310
|
## Definitions
|
|
1310
1311
|
|
|
1311
|
-
- type `type StatusForegroundColor = Extract<` (
|
|
1312
|
+
- type `type StatusForegroundColor = Extract<` (L32)
|
|
1312
1313
|
- @brief Enumerates the CLI-supported theme tokens consumed by status rendering.
|
|
1313
1314
|
- @details Restricts the status formatter to documented pi theme tokens so the
|
|
1314
1315
|
status bar remains compatible with the active CLI theme schema. Compile-time
|
|
1315
1316
|
only and introduces no runtime cost.
|
|
1316
|
-
### iface `interface RawStatusTheme` (
|
|
1317
|
+
### iface `interface RawStatusTheme` (L42-44)
|
|
1317
1318
|
- @brief Describes the raw theme capabilities required for status rendering.
|
|
1318
1319
|
- @details Accepts the `ctx.ui.theme` foreground renderer used by the
|
|
1319
1320
|
single-line footer. Compile-time only and introduces no runtime cost.
|
|
1320
1321
|
|
|
1321
|
-
### iface `interface StatusThemeAdapter` (
|
|
1322
|
+
### iface `interface StatusThemeAdapter` (L52-57)
|
|
1322
1323
|
- @brief Describes the normalized theme adapter used by status formatters.
|
|
1323
1324
|
- @details Exposes deterministic label, value, foreground, and separator
|
|
1324
1325
|
renderers so status text generation stays independent from the raw theme API.
|
|
1325
1326
|
Compile-time only and introduces no runtime cost.
|
|
1326
1327
|
|
|
1327
|
-
- type `export type PiUsereqStatusHookName = (typeof PI_USEREQ_STATUS_HOOK_NAMES)[number];` (
|
|
1328
|
+
- type `export type PiUsereqStatusHookName = (typeof PI_USEREQ_STATUS_HOOK_NAMES)[number];` (L100)
|
|
1328
1329
|
- @brief Represents one hook name handled by the pi-usereq status controller.
|
|
1329
1330
|
- @details Narrows hook registration and event-update calls to the canonical
|
|
1330
1331
|
intercepted-hook set. Compile-time only and introduces no runtime cost.
|
|
1331
|
-
- type `export type PiUsereqPromptRequest = PromptCommandExecutionPlan;` (
|
|
1332
|
+
- type `export type PiUsereqPromptRequest = PromptCommandExecutionPlan;` (L106)
|
|
1332
1333
|
- @brief Describes one prompt request tracked across extension command delivery and runtime execution.
|
|
1333
1334
|
- @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.
|
|
1334
|
-
- type `export type PiUsereqWorkflowState = "idle" | "checking" | "running" | "merging" | "error";` (
|
|
1335
|
+
- type `export type PiUsereqWorkflowState = "idle" | "checking" | "running" | "merging" | "error";` (L112)
|
|
1335
1336
|
- @brief Represents one prompt-orchestration workflow state displayed in the status bar.
|
|
1336
1337
|
- @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.
|
|
1337
|
-
### iface `export interface PiUsereqStatusState` (
|
|
1338
|
+
### iface `export interface PiUsereqStatusState` (L118-127)
|
|
1338
1339
|
- @brief Stores the mutable runtime facts displayed by the status bar.
|
|
1339
1340
|
- @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, the in-memory runtime sound level, 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.
|
|
1340
1341
|
|
|
1341
|
-
### iface `export interface PiUsereqStatusController` (
|
|
1342
|
+
### iface `export interface PiUsereqStatusController` (L136-141)
|
|
1342
1343
|
- @brief Stores the controller state required for event-driven status updates.
|
|
1343
1344
|
- @details Keeps the mutable status snapshot, the current configuration, the
|
|
1344
1345
|
latest extension context used for rendering, and the interval handle used
|
|
1345
1346
|
for live elapsed-time refreshes. Compile-time only and introduces no runtime
|
|
1346
1347
|
cost.
|
|
1347
1348
|
|
|
1348
|
-
### iface `interface PiUsereqStatusPersistenceStore` (
|
|
1349
|
+
### iface `interface PiUsereqStatusPersistenceStore` (L147-150)
|
|
1349
1350
|
- @brief Stores the process-scoped elapsed-timer snapshot reused across session replacement.
|
|
1350
1351
|
- @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.
|
|
1351
1352
|
|
|
1352
|
-
### fn `function getPiUsereqStatusPersistenceStore(): PiUsereqStatusPersistenceStore` (
|
|
1353
|
+
### fn `function getPiUsereqStatusPersistenceStore(): PiUsereqStatusPersistenceStore` (L164-173)
|
|
1353
1354
|
- @brief Returns the process-scoped elapsed-timer persistence store.
|
|
1354
1355
|
- @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.
|
|
1355
1356
|
- @return {PiUsereqStatusPersistenceStore} Mutable persistence record.
|
|
1356
1357
|
- @note Design rationale: required to preserve elapsed counters across session replacement without writing session-global menu state into project configuration.
|
|
1357
1358
|
|
|
1358
|
-
### fn `function restorePersistedElapsedState(state: PiUsereqStatusState): void` (
|
|
1359
|
+
### fn `function restorePersistedElapsedState(state: PiUsereqStatusState): void` (L181-185)
|
|
1359
1360
|
- @brief Restores persisted elapsed counters into one mutable status snapshot.
|
|
1360
1361
|
- @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`.
|
|
1361
1362
|
- @param[in,out] state {PiUsereqStatusState} Mutable status state.
|
|
1362
1363
|
- @return {void} No return value.
|
|
1363
1364
|
|
|
1364
|
-
### fn `function persistElapsedState(state: PiUsereqStatusState): void` (
|
|
1365
|
+
### fn `function persistElapsedState(state: PiUsereqStatusState): void` (L193-197)
|
|
1365
1366
|
- @brief Persists elapsed counters from one mutable status snapshot.
|
|
1366
1367
|
- @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.
|
|
1367
1368
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
1368
1369
|
- @return {void} No return value.
|
|
1369
1370
|
|
|
1370
|
-
### fn `function persistPromptCommandState(state: PiUsereqStatusState): void` (
|
|
1371
|
+
### fn `function persistPromptCommandState(state: PiUsereqStatusState): void` (L205-211)
|
|
1371
1372
|
- @brief Mirrors one controller prompt state into the process-scoped persistence store.
|
|
1372
1373
|
- @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.
|
|
1373
1374
|
- @param[in] state {PiUsereqStatusState} Current controller state snapshot.
|
|
1374
1375
|
- @return {void} No return value.
|
|
1375
1376
|
|
|
1376
|
-
### fn `export function shouldPreservePromptCommandStateOnShutdown(state: PiUsereqStatusState): boolean` (
|
|
1377
|
+
### fn `export function shouldPreservePromptCommandStateOnShutdown(state: PiUsereqStatusState): boolean` (L220-223)
|
|
1377
1378
|
- @brief Detects whether `session_shutdown` must preserve prompt-command state.
|
|
1378
1379
|
- @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.
|
|
1379
1380
|
- @param[in] state {PiUsereqStatusState} Controller state before shutdown mutation.
|
|
1380
1381
|
- @return {boolean} `true` when prompt-command state must survive the shutdown event.
|
|
1381
1382
|
- @satisfies REQ-278
|
|
1382
1383
|
|
|
1383
|
-
### fn `function restorePersistedPromptCommandState(` (
|
|
1384
|
+
### fn `function restorePersistedPromptCommandState(` (L232-243)
|
|
1384
1385
|
- @brief Restores prompt-command persistence into one fresh controller when the active session matches.
|
|
1385
1386
|
- @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.
|
|
1386
1387
|
- @param[in] sessionFile {string | undefined} Current active session file.
|
|
1387
1388
|
- @param[in,out] state {PiUsereqStatusState} Mutable controller state.
|
|
1388
1389
|
- @return {void} No return value.
|
|
1389
1390
|
|
|
1390
|
-
### fn `function getContextSessionFile(ctx: ExtensionContext): string | undefined` (
|
|
1391
|
+
### fn `function getContextSessionFile(ctx: ExtensionContext): string | undefined` (L251-255)
|
|
1391
1392
|
- @brief Resolves the active session file exposed by one extension context.
|
|
1392
1393
|
- @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.
|
|
1393
1394
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1394
1395
|
- @return {string | undefined} Current session file when available.
|
|
1395
1396
|
|
|
1396
|
-
### fn `export function isStaleExtensionContextError(error: unknown): boolean` (
|
|
1397
|
+
### fn `export function isStaleExtensionContextError(error: unknown): boolean` (L264-267)
|
|
1397
1398
|
- @brief Detects stale extension-context access after session replacement.
|
|
1398
1399
|
- @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.
|
|
1399
1400
|
- @param[in] error {unknown} Candidate thrown value.
|
|
1400
1401
|
- @return {boolean} `true` when the value matches the stale-extension-context runtime error.
|
|
1401
1402
|
- @satisfies REQ-280
|
|
1402
1403
|
|
|
1403
|
-
### fn `function resetElapsedState(state: PiUsereqStatusState): void` (
|
|
1404
|
+
### fn `function resetElapsedState(state: PiUsereqStatusState): void` (L276-280)
|
|
1404
1405
|
- @brief Resets the in-memory and persisted elapsed counters.
|
|
1405
1406
|
- @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.
|
|
1406
1407
|
- @param[in,out] state {PiUsereqStatusState} Mutable status state.
|
|
1407
1408
|
- @return {void} No return value.
|
|
1408
1409
|
- @satisfies REQ-217
|
|
1409
1410
|
|
|
1410
|
-
### fn `function shouldResetElapsedStateOnSessionStart(event: unknown): boolean` (
|
|
1411
|
+
### fn `function shouldResetElapsedStateOnSessionStart(event: unknown): boolean` (L289-292)
|
|
1411
1412
|
- @brief Detects whether a `session_start` event must reset elapsed counters.
|
|
1412
1413
|
- @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.
|
|
1413
1414
|
- @param[in] event {unknown} Session-start payload.
|
|
1414
1415
|
- @return {boolean} `true` when elapsed counters must reset.
|
|
1415
1416
|
- @satisfies REQ-217
|
|
1416
1417
|
|
|
1417
|
-
### fn `function shouldResetWorkflowStateOnSessionStart(event: unknown): boolean` (
|
|
1418
|
+
### fn `function shouldResetWorkflowStateOnSessionStart(event: unknown): boolean` (L301-304)
|
|
1418
1419
|
- @brief Detects whether a `session_start` event must reset the workflow state to `idle`.
|
|
1419
1420
|
- @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.
|
|
1420
1421
|
- @param[in] event {unknown} Session-start payload.
|
|
1421
1422
|
- @return {boolean} `true` when workflow state must reset to `idle`.
|
|
1422
1423
|
- @satisfies REQ-009, REQ-221
|
|
1423
1424
|
|
|
1424
|
-
### fn `function createStatusThemeAdapter(theme: RawStatusTheme): StatusThemeAdapter` (
|
|
1425
|
+
### fn `function createStatusThemeAdapter(theme: RawStatusTheme): StatusThemeAdapter` (L314-323)
|
|
1425
1426
|
- @brief Builds the normalized theme adapter used by pi-usereq status formatters.
|
|
1426
1427
|
- @details Precomputes label, value, foreground, and separator renderers so
|
|
1427
1428
|
status formatting remains stable across real TUI themes and deterministic
|
|
@@ -1429,16 +1430,16 @@ test doubles. Runtime is O(1). No external state is mutated.
|
|
|
1429
1430
|
- @param[in] theme {RawStatusTheme} Raw theme implementation from `ctx.ui.theme`.
|
|
1430
1431
|
- @return {StatusThemeAdapter} Normalized status-theme adapter.
|
|
1431
1432
|
|
|
1432
|
-
### fn `const colorize = (color: StatusForegroundColor, text: string): string =>` (
|
|
1433
|
+
### fn `const colorize = (color: StatusForegroundColor, text: string): string =>` (L315-322)
|
|
1433
1434
|
|
|
1434
|
-
### fn `function resolveStatusBranchValue(ctx: ExtensionContext): string` (
|
|
1435
|
+
### fn `function resolveStatusBranchValue(ctx: ExtensionContext): string` (L332-334)
|
|
1435
1436
|
- @brief Resolves the active git branch value rendered in the status bar.
|
|
1436
1437
|
- @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.
|
|
1437
1438
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1438
1439
|
- @return {string} Active branch name or `unknown` when unavailable.
|
|
1439
1440
|
- @satisfies REQ-121, REQ-283
|
|
1440
1441
|
|
|
1441
|
-
### fn `function normalizeContextUsage(` (
|
|
1442
|
+
### fn `function normalizeContextUsage(` (L345-362)
|
|
1442
1443
|
- @brief Normalizes one raw context-usage snapshot.
|
|
1443
1444
|
- @details Preserves the runtime token and context-window counts, derives a
|
|
1444
1445
|
percentage when the runtime omits it, clamps negative percentages to `0`,
|
|
@@ -1447,7 +1448,7 @@ external state is mutated.
|
|
|
1447
1448
|
- @param[in] contextUsage {ContextUsage | undefined} Raw runtime snapshot.
|
|
1448
1449
|
- @return {ContextUsage | undefined} Normalized snapshot.
|
|
1449
1450
|
|
|
1450
|
-
### fn `function refreshContextUsage(` (
|
|
1451
|
+
### fn `function refreshContextUsage(` (L374-379)
|
|
1451
1452
|
- @brief Refreshes the stored context-usage snapshot from the active extension context.
|
|
1452
1453
|
- @details Calls `ctx.getContextUsage()` on every intercepted event so the
|
|
1453
1454
|
controller retains the newest context-usage facts available from the pi
|
|
@@ -1457,14 +1458,14 @@ runtime. Runtime is O(1). Side effect: mutates `state.contextUsage`.
|
|
|
1457
1458
|
- @return {void} No return value.
|
|
1458
1459
|
- @satisfies REQ-118, REQ-119
|
|
1459
1460
|
|
|
1460
|
-
### fn `function resolveContextUsageIconText(` (
|
|
1461
|
+
### fn `function resolveContextUsageIconText(` (L388-405)
|
|
1461
1462
|
- @brief Resolves the icon text for one normalized context-usage snapshot.
|
|
1462
1463
|
- @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.
|
|
1463
1464
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
1464
1465
|
- @return {string} Fixed-width gauge icon text.
|
|
1465
1466
|
- @satisfies REQ-122, REQ-284
|
|
1466
1467
|
|
|
1467
|
-
### fn `function formatContextUsageBar(` (
|
|
1468
|
+
### fn `function formatContextUsageBar(` (L415-427)
|
|
1468
1469
|
- @brief Formats one icon-based context-usage gauge.
|
|
1469
1470
|
- @details Renders the documented gauge icon with the same non-error status-value theme token used by `status` below `90%`, switches to theme `error` for `>=90%`, and enables terminal blink only for `>=100%`. Runtime is O(1). No external state is mutated.
|
|
1470
1471
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
@@ -1472,7 +1473,7 @@ runtime. Runtime is O(1). Side effect: mutates `state.contextUsage`.
|
|
|
1472
1473
|
- @return {string} Rendered fixed-width gauge icon.
|
|
1473
1474
|
- @satisfies REQ-122, REQ-126, REQ-127, REQ-128, REQ-233, REQ-284
|
|
1474
1475
|
|
|
1475
|
-
### fn `function formatStatusDuration(durationMs: number): string` (
|
|
1476
|
+
### fn `function formatStatusDuration(durationMs: number): string` (L438-443)
|
|
1476
1477
|
- @brief Formats one elapsed-duration value as `M:SS`.
|
|
1477
1478
|
- @details Floors the input to whole seconds, keeps minutes unbounded above 59,
|
|
1478
1479
|
and zero-pads seconds to two digits. Runtime is O(1). No external state is
|
|
@@ -1481,7 +1482,7 @@ mutated.
|
|
|
1481
1482
|
- @return {string} Duration rendered as `M:SS`.
|
|
1482
1483
|
- @satisfies REQ-125
|
|
1483
1484
|
|
|
1484
|
-
### fn `function formatCompletedStatusDuration(` (
|
|
1485
|
+
### fn `function formatCompletedStatusDuration(` (L454-458)
|
|
1485
1486
|
- @brief Formats one optional completed-duration value.
|
|
1486
1487
|
- @details Returns the canonical unset placeholder `--:--` until the supplied
|
|
1487
1488
|
timer receives a normally completed prompt duration, then delegates to
|
|
@@ -1490,7 +1491,7 @@ timer receives a normally completed prompt duration, then delegates to
|
|
|
1490
1491
|
- @return {string} Rendered duration or unset placeholder.
|
|
1491
1492
|
- @satisfies REQ-124
|
|
1492
1493
|
|
|
1493
|
-
### fn `function formatElapsedStatusValue(` (
|
|
1494
|
+
### fn `function formatElapsedStatusValue(` (L471-481)
|
|
1494
1495
|
- @brief Formats the consolidated `elapsed` status-bar value.
|
|
1495
1496
|
- @details Emits the active prompt segment `⏱︎ <active>`, the latest normally
|
|
1496
1497
|
completed segment `⚑ <last>`, and the accumulated successful-runtime segment
|
|
@@ -1501,7 +1502,7 @@ mutated.
|
|
|
1501
1502
|
- @return {string} Consolidated `elapsed` field value.
|
|
1502
1503
|
- @satisfies REQ-123, REQ-124, REQ-125, REQ-159
|
|
1503
1504
|
|
|
1504
|
-
### fn `function formatStatusField(` (
|
|
1505
|
+
### fn `function formatStatusField(` (L492-498)
|
|
1505
1506
|
- @brief Formats one standard status-bar field.
|
|
1506
1507
|
- @details Renders the field label in accent color and the value in warning
|
|
1507
1508
|
color. Runtime is O(n) in combined text length. No external state is mutated.
|
|
@@ -1510,7 +1511,7 @@ color. Runtime is O(n) in combined text length. No external state is mutated.
|
|
|
1510
1511
|
- @param[in] value {string} Unstyled field value.
|
|
1511
1512
|
- @return {string} Rendered status-field fragment.
|
|
1512
1513
|
|
|
1513
|
-
### fn `function formatRenderedStatusField(` (
|
|
1514
|
+
### fn `function formatRenderedStatusField(` (L510-516)
|
|
1514
1515
|
- @brief Formats one pre-rendered status-bar field value.
|
|
1515
1516
|
- @details Preserves the accent-colored field label while allowing callers to
|
|
1516
1517
|
provide a custom styled value such as the context-usage bar. Runtime is O(n)
|
|
@@ -1520,7 +1521,7 @@ in combined text length. No external state is mutated.
|
|
|
1520
1521
|
- @param[in] renderedValue {string} Pre-rendered field value.
|
|
1521
1522
|
- @return {string} Rendered status-field fragment.
|
|
1522
1523
|
|
|
1523
|
-
### fn `function formatWorkflowStateValue(` (
|
|
1524
|
+
### fn `function formatWorkflowStateValue(` (L526-534)
|
|
1524
1525
|
- @brief Formats the rendered workflow-state value for the `status` field.
|
|
1525
1526
|
- @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.
|
|
1526
1527
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
@@ -1528,7 +1529,7 @@ in combined text length. No external state is mutated.
|
|
|
1528
1529
|
- @return {string} Rendered workflow-state value.
|
|
1529
1530
|
- @satisfies REQ-112, REQ-223
|
|
1530
1531
|
|
|
1531
|
-
### fn `function didAgentEndAbort(messages: AgentEndEvent["messages"]): boolean` (
|
|
1532
|
+
### fn `function didAgentEndAbort(messages: AgentEndEvent["messages"]): boolean` (L545-552)
|
|
1532
1533
|
- @brief Detects whether an agent run ended through abort semantics.
|
|
1533
1534
|
- @details Treats any assistant message whose `stopReason` equals `aborted` as
|
|
1534
1535
|
an escape-triggered termination that must not overwrite the `last` timer.
|
|
@@ -1537,7 +1538,7 @@ Runtime is O(n) in message count. No external state is mutated.
|
|
|
1537
1538
|
- @return {boolean} `true` when the run ended in aborted state.
|
|
1538
1539
|
- @satisfies REQ-125
|
|
1539
1540
|
|
|
1540
|
-
### fn `function resolvePiUsereqRuntimeSoundLevel(` (
|
|
1541
|
+
### fn `function resolvePiUsereqRuntimeSoundLevel(` (L562-567)
|
|
1541
1542
|
- @brief Resolves the active runtime sound level used by status and notify flows.
|
|
1542
1543
|
- @details Prefers the mutable runtime sound state, then falls back to the cached persisted boot value, and finally defaults to `none` before `session_start` loads configuration. Runtime is O(1). No external state is mutated.
|
|
1543
1544
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
@@ -1545,9 +1546,16 @@ Runtime is O(n) in message count. No external state is mutated.
|
|
|
1545
1546
|
- @return {PiNotifySoundLevel} Active runtime sound level.
|
|
1546
1547
|
- @satisfies REQ-180, REQ-285
|
|
1547
1548
|
|
|
1548
|
-
### fn `function
|
|
1549
|
+
### fn `function formatExtensionIdentityStatusField(` (L576-581)
|
|
1550
|
+
- @brief Formats the runtime extension identity prefix for the status bar.
|
|
1551
|
+
- @details Reads cached installation package metadata and renders the package name plus `v<version>` using the same accent-label and warning-value token split used by standard non-error status fields. Runtime is O(n) in rendered text length. No external state is mutated.
|
|
1552
|
+
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1553
|
+
- @return {string} Rendered extension identity prefix.
|
|
1554
|
+
- @satisfies REQ-112, REQ-120
|
|
1555
|
+
|
|
1556
|
+
### fn `function buildPiUsereqStatusText(` (L594-619)
|
|
1549
1557
|
- @brief Builds the full single-line pi-usereq status-bar payload.
|
|
1550
|
-
- @details Renders status, branch, context, elapsed, and sound fields
|
|
1558
|
+
- @details Renders the runtime extension identity prefix before status, then renders status, branch, context, elapsed, and sound fields with dim bullet separators, workflow-state highlighting, the documented icon-based context gauge, and the active runtime sound level instead of the persisted boot value. Runtime is O(1). No external state is mutated.
|
|
1551
1559
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
1552
1560
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1553
1561
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
@@ -1556,7 +1564,7 @@ Runtime is O(n) in message count. No external state is mutated.
|
|
|
1556
1564
|
- @return {string} Single-line status-bar text.
|
|
1557
1565
|
- @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
|
|
1558
1566
|
|
|
1559
|
-
### fn `function stopStatusTicker(controller: PiUsereqStatusController): void` (
|
|
1567
|
+
### fn `function stopStatusTicker(controller: PiUsereqStatusController): void` (L629-634)
|
|
1560
1568
|
- @brief Stops the live elapsed-time ticker when it is active.
|
|
1561
1569
|
- @details Clears the interval handle and resets the stored timer reference so
|
|
1562
1570
|
subsequent runs can reinitialize live status refreshes deterministically.
|
|
@@ -1564,7 +1572,7 @@ Runtime is O(1). Side effect: mutates `controller.tickHandle`.
|
|
|
1564
1572
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1565
1573
|
- @return {void} No return value.
|
|
1566
1574
|
|
|
1567
|
-
### fn `function syncPiUsereqStatusTicker(` (
|
|
1575
|
+
### fn `function syncPiUsereqStatusTicker(` (L646-662)
|
|
1568
1576
|
- @brief Synchronizes the live elapsed-time ticker with the current run state.
|
|
1569
1577
|
- @details Starts a 1-second render ticker while a run is active and stops the
|
|
1570
1578
|
ticker when the run returns to idle. Runtime is O(1). Side effects include
|
|
@@ -1574,13 +1582,13 @@ ticks.
|
|
|
1574
1582
|
- @return {void} No return value.
|
|
1575
1583
|
- @satisfies REQ-123
|
|
1576
1584
|
|
|
1577
|
-
### fn `export function createPiUsereqStatusController(): PiUsereqStatusController` (
|
|
1585
|
+
### fn `export function createPiUsereqStatusController(): PiUsereqStatusController` (L670-686)
|
|
1578
1586
|
- @brief Creates an empty pi-usereq status controller.
|
|
1579
1587
|
- @details Initializes the mutable status snapshot, including empty prompt-request tracking and an unset runtime sound level that later loads from persisted config during `session_start`, and starts with no config, no context, and no live ticker. Runtime is O(1). No external state is mutated.
|
|
1580
1588
|
- @return {PiUsereqStatusController} New status controller.
|
|
1581
1589
|
- @satisfies DES-010
|
|
1582
1590
|
|
|
1583
|
-
### fn `export function setPiUsereqStatusConfig(` (
|
|
1591
|
+
### fn `export function setPiUsereqStatusConfig(` (L699-704)
|
|
1584
1592
|
- @brief Stores the effective project configuration used by status rendering.
|
|
1585
1593
|
- @details Replaces the controller's cached configuration so later status
|
|
1586
1594
|
renders reuse the latest docs, tests, source-path, and persisted pi-notify
|
|
@@ -1591,14 +1599,14 @@ mutates `controller.config`.
|
|
|
1591
1599
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1592
1600
|
- @return {void} No return value.
|
|
1593
1601
|
|
|
1594
|
-
### fn `export function getPiUsereqRuntimeSoundLevel(` (
|
|
1602
|
+
### fn `export function getPiUsereqRuntimeSoundLevel(` (L713-717)
|
|
1595
1603
|
- @brief Returns the active runtime sound level tracked by the status controller.
|
|
1596
1604
|
- @details Exposes the in-memory runtime sound state so shortcut handlers and prompt-end notification dispatch can stay decoupled from the persisted boot value stored in global configuration. Runtime is O(1). No external state is mutated.
|
|
1597
1605
|
- @param[in] controller {PiUsereqStatusController} Mutable status controller.
|
|
1598
1606
|
- @return {PiNotifySoundLevel} Active runtime sound level.
|
|
1599
1607
|
- @satisfies REQ-180, REQ-285
|
|
1600
1608
|
|
|
1601
|
-
### fn `export function setPiUsereqRuntimeSoundLevel(` (
|
|
1609
|
+
### fn `export function setPiUsereqRuntimeSoundLevel(` (L728-738)
|
|
1602
1610
|
- @brief Stores one new runtime sound level and refreshes the status bar.
|
|
1603
1611
|
- @details Mutates only the in-memory runtime sound state so shortcut-driven sound changes do not update persisted local or global configuration, then re-renders the footer when an active extension context is available. Runtime is O(1). Side effect: mutates `controller.state.runtimeSoundLevel` and may update `ctx.ui` status.
|
|
1604
1612
|
- @param[in] runtimeSoundLevel {PiNotifySoundLevel} Next active runtime sound level.
|
|
@@ -1607,15 +1615,15 @@ mutates `controller.config`.
|
|
|
1607
1615
|
- @return {void} No return value.
|
|
1608
1616
|
- @satisfies REQ-180, REQ-286, REQ-287
|
|
1609
1617
|
|
|
1610
|
-
### fn `export function renderPiUsereqStatus(` (
|
|
1618
|
+
### fn `export function renderPiUsereqStatus(` (L748-779)
|
|
1611
1619
|
- @brief Renders the current pi-usereq status bar into the active UI context.
|
|
1612
|
-
- @details Updates the controller's latest context pointer, refreshes the live `getContextUsage()` snapshot for direct render call sites that do not pass through `updateExtensionStatus(...)`, and writes the single-line status text only when configuration is available, including the active branch field, documented icon-based context gauge, and active runtime sound level. 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 `controller.state.contextUsage` and `ctx.ui` status when the context is still active.
|
|
1620
|
+
- @details Updates the controller's latest context pointer, refreshes the live `getContextUsage()` snapshot for direct render call sites that do not pass through `updateExtensionStatus(...)`, and writes the single-line status text only when configuration is available, including the runtime extension identity prefix, active branch field, documented icon-based context gauge, and active runtime sound level. 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 `controller.state.contextUsage` and `ctx.ui` status when the context is still active.
|
|
1613
1621
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
1614
1622
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
1615
1623
|
- @return {void} No return value.
|
|
1616
1624
|
- @satisfies REQ-118, REQ-119, 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
|
|
1617
1625
|
|
|
1618
|
-
### fn `export function setPiUsereqWorkflowState(` (
|
|
1626
|
+
### fn `export function setPiUsereqWorkflowState(` (L790-801)
|
|
1619
1627
|
- @brief Transitions the prompt-orchestration workflow state and refreshes the status bar.
|
|
1620
1628
|
- @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.
|
|
1621
1629
|
- @param[in] workflowState {PiUsereqWorkflowState} Next workflow state.
|
|
@@ -1624,9 +1632,9 @@ mutates `controller.config`.
|
|
|
1624
1632
|
- @return {void} No return value.
|
|
1625
1633
|
- @satisfies REQ-221, REQ-222, REQ-223
|
|
1626
1634
|
|
|
1627
|
-
### fn `export function updateExtensionStatus(` (
|
|
1635
|
+
### fn `export function updateExtensionStatus(` (L813-880)
|
|
1628
1636
|
- @brief Updates mutable status state for one intercepted lifecycle hook.
|
|
1629
|
-
- @details Refreshes stored context usage on every hook, resets or restores persisted elapsed counters during `session_start`, loads the active runtime sound level from persisted config 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.
|
|
1637
|
+
- @details Refreshes stored context usage on every hook, resets or restores persisted elapsed counters during `session_start`, loads the active runtime sound level from persisted config 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 with the runtime extension identity prefix 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.
|
|
1630
1638
|
- @param[in] hookName {PiUsereqStatusHookName} Intercepted hook name.
|
|
1631
1639
|
- @param[in] event {unknown} Hook payload forwarded from the wrapper.
|
|
1632
1640
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
@@ -1634,7 +1642,7 @@ mutates `controller.config`.
|
|
|
1634
1642
|
- @return {void} No return value.
|
|
1635
1643
|
- @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, REQ-285
|
|
1636
1644
|
|
|
1637
|
-
### fn `export function disposePiUsereqStatusController(` (
|
|
1645
|
+
### fn `export function disposePiUsereqStatusController(` (L891-896)
|
|
1638
1646
|
- @brief Disposes the pi-usereq status controller.
|
|
1639
1647
|
- @details Stops the live ticker, clears the cached context pointer, and leaves
|
|
1640
1648
|
the last captured status snapshot available for inspection until the
|
|
@@ -1646,52 +1654,53 @@ limited to interval disposal and in-memory state mutation.
|
|
|
1646
1654
|
## Symbol Index
|
|
1647
1655
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
1648
1656
|
|---|---|---|---|---|
|
|
1649
|
-
|`StatusForegroundColor`|type||
|
|
1650
|
-
|`RawStatusTheme`|iface||
|
|
1651
|
-
|`StatusThemeAdapter`|iface||
|
|
1652
|
-
|`PiUsereqStatusHookName`|type||
|
|
1653
|
-
|`PiUsereqPromptRequest`|type||
|
|
1654
|
-
|`PiUsereqWorkflowState`|type||
|
|
1655
|
-
|`PiUsereqStatusState`|iface||
|
|
1656
|
-
|`PiUsereqStatusController`|iface||
|
|
1657
|
-
|`PiUsereqStatusPersistenceStore`|iface||
|
|
1658
|
-
|`getPiUsereqStatusPersistenceStore`|fn||
|
|
1659
|
-
|`restorePersistedElapsedState`|fn||
|
|
1660
|
-
|`persistElapsedState`|fn||
|
|
1661
|
-
|`persistPromptCommandState`|fn||
|
|
1662
|
-
|`shouldPreservePromptCommandStateOnShutdown`|fn||
|
|
1663
|
-
|`restorePersistedPromptCommandState`|fn||
|
|
1664
|
-
|`getContextSessionFile`|fn||
|
|
1665
|
-
|`isStaleExtensionContextError`|fn||
|
|
1666
|
-
|`resetElapsedState`|fn||
|
|
1667
|
-
|`shouldResetElapsedStateOnSessionStart`|fn||
|
|
1668
|
-
|`shouldResetWorkflowStateOnSessionStart`|fn||
|
|
1669
|
-
|`createStatusThemeAdapter`|fn||
|
|
1670
|
-
|`colorize`|fn||
|
|
1671
|
-
|`resolveStatusBranchValue`|fn||
|
|
1672
|
-
|`normalizeContextUsage`|fn||
|
|
1673
|
-
|`refreshContextUsage`|fn||
|
|
1674
|
-
|`resolveContextUsageIconText`|fn||
|
|
1675
|
-
|`formatContextUsageBar`|fn||
|
|
1676
|
-
|`formatStatusDuration`|fn||
|
|
1677
|
-
|`formatCompletedStatusDuration`|fn||
|
|
1678
|
-
|`formatElapsedStatusValue`|fn||
|
|
1679
|
-
|`formatStatusField`|fn||
|
|
1680
|
-
|`formatRenderedStatusField`|fn||
|
|
1681
|
-
|`formatWorkflowStateValue`|fn||
|
|
1682
|
-
|`didAgentEndAbort`|fn||
|
|
1683
|
-
|`resolvePiUsereqRuntimeSoundLevel`|fn||
|
|
1684
|
-
|`
|
|
1685
|
-
|`
|
|
1686
|
-
|`
|
|
1687
|
-
|`
|
|
1688
|
-
|`
|
|
1689
|
-
|`
|
|
1690
|
-
|`
|
|
1691
|
-
|`
|
|
1692
|
-
|`
|
|
1693
|
-
|`
|
|
1694
|
-
|`
|
|
1657
|
+
|`StatusForegroundColor`|type||32||
|
|
1658
|
+
|`RawStatusTheme`|iface||42-44|interface RawStatusTheme|
|
|
1659
|
+
|`StatusThemeAdapter`|iface||52-57|interface StatusThemeAdapter|
|
|
1660
|
+
|`PiUsereqStatusHookName`|type||100||
|
|
1661
|
+
|`PiUsereqPromptRequest`|type||106||
|
|
1662
|
+
|`PiUsereqWorkflowState`|type||112||
|
|
1663
|
+
|`PiUsereqStatusState`|iface||118-127|export interface PiUsereqStatusState|
|
|
1664
|
+
|`PiUsereqStatusController`|iface||136-141|export interface PiUsereqStatusController|
|
|
1665
|
+
|`PiUsereqStatusPersistenceStore`|iface||147-150|interface PiUsereqStatusPersistenceStore|
|
|
1666
|
+
|`getPiUsereqStatusPersistenceStore`|fn||164-173|function getPiUsereqStatusPersistenceStore(): PiUsereqSta...|
|
|
1667
|
+
|`restorePersistedElapsedState`|fn||181-185|function restorePersistedElapsedState(state: PiUsereqStat...|
|
|
1668
|
+
|`persistElapsedState`|fn||193-197|function persistElapsedState(state: PiUsereqStatusState):...|
|
|
1669
|
+
|`persistPromptCommandState`|fn||205-211|function persistPromptCommandState(state: PiUsereqStatusS...|
|
|
1670
|
+
|`shouldPreservePromptCommandStateOnShutdown`|fn||220-223|export function shouldPreservePromptCommandStateOnShutdow...|
|
|
1671
|
+
|`restorePersistedPromptCommandState`|fn||232-243|function restorePersistedPromptCommandState(|
|
|
1672
|
+
|`getContextSessionFile`|fn||251-255|function getContextSessionFile(ctx: ExtensionContext): st...|
|
|
1673
|
+
|`isStaleExtensionContextError`|fn||264-267|export function isStaleExtensionContextError(error: unkno...|
|
|
1674
|
+
|`resetElapsedState`|fn||276-280|function resetElapsedState(state: PiUsereqStatusState): void|
|
|
1675
|
+
|`shouldResetElapsedStateOnSessionStart`|fn||289-292|function shouldResetElapsedStateOnSessionStart(event: unk...|
|
|
1676
|
+
|`shouldResetWorkflowStateOnSessionStart`|fn||301-304|function shouldResetWorkflowStateOnSessionStart(event: un...|
|
|
1677
|
+
|`createStatusThemeAdapter`|fn||314-323|function createStatusThemeAdapter(theme: RawStatusTheme):...|
|
|
1678
|
+
|`colorize`|fn||315-322|const colorize = (color: StatusForegroundColor, text: str...|
|
|
1679
|
+
|`resolveStatusBranchValue`|fn||332-334|function resolveStatusBranchValue(ctx: ExtensionContext):...|
|
|
1680
|
+
|`normalizeContextUsage`|fn||345-362|function normalizeContextUsage(|
|
|
1681
|
+
|`refreshContextUsage`|fn||374-379|function refreshContextUsage(|
|
|
1682
|
+
|`resolveContextUsageIconText`|fn||388-405|function resolveContextUsageIconText(|
|
|
1683
|
+
|`formatContextUsageBar`|fn||415-427|function formatContextUsageBar(|
|
|
1684
|
+
|`formatStatusDuration`|fn||438-443|function formatStatusDuration(durationMs: number): string|
|
|
1685
|
+
|`formatCompletedStatusDuration`|fn||454-458|function formatCompletedStatusDuration(|
|
|
1686
|
+
|`formatElapsedStatusValue`|fn||471-481|function formatElapsedStatusValue(|
|
|
1687
|
+
|`formatStatusField`|fn||492-498|function formatStatusField(|
|
|
1688
|
+
|`formatRenderedStatusField`|fn||510-516|function formatRenderedStatusField(|
|
|
1689
|
+
|`formatWorkflowStateValue`|fn||526-534|function formatWorkflowStateValue(|
|
|
1690
|
+
|`didAgentEndAbort`|fn||545-552|function didAgentEndAbort(messages: AgentEndEvent["messag...|
|
|
1691
|
+
|`resolvePiUsereqRuntimeSoundLevel`|fn||562-567|function resolvePiUsereqRuntimeSoundLevel(|
|
|
1692
|
+
|`formatExtensionIdentityStatusField`|fn||576-581|function formatExtensionIdentityStatusField(|
|
|
1693
|
+
|`buildPiUsereqStatusText`|fn||594-619|function buildPiUsereqStatusText(|
|
|
1694
|
+
|`stopStatusTicker`|fn||629-634|function stopStatusTicker(controller: PiUsereqStatusContr...|
|
|
1695
|
+
|`syncPiUsereqStatusTicker`|fn||646-662|function syncPiUsereqStatusTicker(|
|
|
1696
|
+
|`createPiUsereqStatusController`|fn||670-686|export function createPiUsereqStatusController(): PiUsere...|
|
|
1697
|
+
|`setPiUsereqStatusConfig`|fn||699-704|export function setPiUsereqStatusConfig(|
|
|
1698
|
+
|`getPiUsereqRuntimeSoundLevel`|fn||713-717|export function getPiUsereqRuntimeSoundLevel(|
|
|
1699
|
+
|`setPiUsereqRuntimeSoundLevel`|fn||728-738|export function setPiUsereqRuntimeSoundLevel(|
|
|
1700
|
+
|`renderPiUsereqStatus`|fn||748-779|export function renderPiUsereqStatus(|
|
|
1701
|
+
|`setPiUsereqWorkflowState`|fn||790-801|export function setPiUsereqWorkflowState(|
|
|
1702
|
+
|`updateExtensionStatus`|fn||813-880|export function updateExtensionStatus(|
|
|
1703
|
+
|`disposePiUsereqStatusController`|fn||891-896|export function disposePiUsereqStatusController(|
|
|
1695
1704
|
|
|
1696
1705
|
|
|
1697
1706
|
---
|
|
@@ -2084,7 +2093,7 @@ import { SourceAnalyzer, formatMarkdown } from "./source-analyzer.js";
|
|
|
2084
2093
|
|
|
2085
2094
|
---
|
|
2086
2095
|
|
|
2087
|
-
# path-context.ts | TypeScript |
|
|
2096
|
+
# path-context.ts | TypeScript | 535L | 25 symbols | 5 imports | 33 comments
|
|
2088
2097
|
> Path: `src/core/path-context.ts`
|
|
2089
2098
|
- @brief Derives shared runtime path contracts for prompts, tools, and configuration flows.
|
|
2090
2099
|
- @details Centralizes the static bootstrap paths and dynamic cwd-aligned paths used across the extension runtime. The module also exposes home-relative display formatting, trailing-slash-free normalization, and prompt-facing path facts. Runtime is O(s + p) where s is the configured source-directory count and p is aggregate path length. Side effects are limited to module-local runtime-path state mutation.
|
|
@@ -2100,127 +2109,136 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2100
2109
|
|
|
2101
2110
|
## Definitions
|
|
2102
2111
|
|
|
2103
|
-
### iface `export interface
|
|
2112
|
+
### iface `export interface InstallationPackageMetadata` (L35-38)
|
|
2113
|
+
- @brief Describes the installation package metadata used by runtime status rendering.
|
|
2114
|
+
- @details Stores the resolved extension package name and semantic version read from the installation-owned `package.json`. The interface is compile-time only and introduces no runtime side effects.
|
|
2115
|
+
|
|
2116
|
+
### iface `export interface RuntimePathState` (L59-67)
|
|
2104
2117
|
- @brief Stores the mutable runtime path state shared across extension callbacks.
|
|
2105
2118
|
- @details Persists the static bootstrap `base-path`, the dynamic `context-path`, the optional repository-derived `git-path`, the derived `parent-path` and `base-dir`, and the optional active worktree facts. The interface is compile-time only and introduces no runtime cost.
|
|
2106
2119
|
|
|
2107
|
-
### iface `export interface RuntimePathContext extends RuntimePathState` : RuntimePathState (
|
|
2120
|
+
### iface `export interface RuntimePathContext extends RuntimePathState` : RuntimePathState (L73-86)
|
|
2108
2121
|
- @brief Describes the absolute runtime path context shared across extension components.
|
|
2109
2122
|
- @details Aggregates the static installation, base, git, parent, and config paths with the dynamic context and optional worktree paths plus execution-resolved docs/tests/source absolute paths. The interface is compile-time only and introduces no runtime cost.
|
|
2110
2123
|
|
|
2111
|
-
### iface `export interface RuntimePathFacts` (
|
|
2124
|
+
### iface `export interface RuntimePathFacts` (L92-113)
|
|
2112
2125
|
- @brief Describes the prompt/tool-facing runtime paths rendered for display.
|
|
2113
2126
|
- @details Mirrors `RuntimePathContext` in a serialization-oriented shape so downstream agents can consume stable `~`-relative absolute paths and trailing-slash-free relative directories without reparsing platform-specific separators. The interface is compile-time only and introduces no runtime cost.
|
|
2114
2127
|
|
|
2115
|
-
### fn `export function getInstallationPath(): string` (
|
|
2128
|
+
### fn `export function getInstallationPath(): string` (L128-130)
|
|
2116
2129
|
- @brief Resolves the installed extension root that owns `index.ts` and bundled resources.
|
|
2117
2130
|
- @details Uses the current module location under `src/core` or its installed equivalent, then moves one directory upward so the returned path is the runtime installation root containing `resources/`. Runtime is O(1). No external state is mutated.
|
|
2118
2131
|
- @return {string} Absolute installation path.
|
|
2119
2132
|
|
|
2120
|
-
### fn `export function
|
|
2133
|
+
### fn `export function getInstallationPackageMetadata(): InstallationPackageMetadata` (L137-165)
|
|
2134
|
+
- @brief Resolves the installation-owned extension package metadata.
|
|
2135
|
+
- @details Reads `<installation-path>/../package.json` once per process, caches the parsed `name` and `version`, trims surrounding whitespace, and falls back to deterministic defaults when the manifest is missing, malformed, or incomplete. Runtime is O(n) on the first call in manifest size and O(1) on later calls. Side effects are limited to one filesystem read and module-local cache mutation.
|
|
2136
|
+
- @return {InstallationPackageMetadata} Cached package name and version used by runtime status rendering.
|
|
2137
|
+
|
|
2138
|
+
### fn `export function normalizePathSlashes(value: string): string` (L173-175)
|
|
2121
2139
|
- @brief Formats one path with slash separators.
|
|
2122
2140
|
- @details Rewrites backslashes to `/` without changing semantic path identity so serialized payloads remain stable across operating systems. Runtime is O(p) in path length. No external state is mutated.
|
|
2123
2141
|
- @param[in] value {string} Absolute or relative filesystem path.
|
|
2124
2142
|
- @return {string} Slash-normalized path string.
|
|
2125
2143
|
|
|
2126
|
-
### fn `function trimTrailingSeparatorsPreserveRoot(value: string): string` (
|
|
2144
|
+
### fn `function trimTrailingSeparatorsPreserveRoot(value: string): string` (L183-197)
|
|
2127
2145
|
- @brief Removes trailing separators while preserving a filesystem root.
|
|
2128
2146
|
- @details Keeps `/`, drive roots, and UNC roots intact while trimming redundant trailing separators from every other absolute or relative path string. Runtime is O(p) in path length. No external state is mutated.
|
|
2129
2147
|
- @param[in] value {string} Raw path string.
|
|
2130
2148
|
- @return {string} Trailing-slash-free path string.
|
|
2131
2149
|
|
|
2132
|
-
### fn `export function normalizeAbsolutePathContract(value: string): string` (
|
|
2150
|
+
### fn `export function normalizeAbsolutePathContract(value: string): string` (L205-207)
|
|
2133
2151
|
- @brief Normalizes one absolute path contract value.
|
|
2134
2152
|
- @details Resolves the supplied value to an absolute path, removes trailing separators except for the filesystem root, and rewrites separators to `/`. Runtime is O(p) in path length. No external state is mutated.
|
|
2135
2153
|
- @param[in] value {string} Absolute or relative path candidate.
|
|
2136
2154
|
- @return {string} Canonical trailing-slash-free absolute path.
|
|
2137
2155
|
|
|
2138
|
-
### fn `export function normalizeRelativeDirContract(value: string): string` (
|
|
2156
|
+
### fn `export function normalizeRelativeDirContract(value: string): string` (L215-220)
|
|
2139
2157
|
- @brief Normalizes one relative-directory contract value.
|
|
2140
2158
|
- @details Trims whitespace, rewrites separators to `/`, removes a leading `./`, and removes trailing separators so persisted `*-dir` values stay relative and trailing-slash-free. Runtime is O(p) in path length. No external state is mutated.
|
|
2141
2159
|
- @param[in] value {string} Relative-directory candidate.
|
|
2142
2160
|
- @return {string} Canonical trailing-slash-free relative-directory string.
|
|
2143
2161
|
|
|
2144
|
-
### fn `export function getConfigPath(basePath: string): string` (
|
|
2162
|
+
### fn `export function getConfigPath(basePath: string): string` (L228-230)
|
|
2145
2163
|
- @brief Computes the absolute local project config path for one base path.
|
|
2146
2164
|
- @details Appends `.pi-usereq.json` to the supplied base path using the canonical repository-local configuration layout. Runtime is O(1). No external state is mutated.
|
|
2147
2165
|
- @param[in] basePath {string} Absolute or relative base path.
|
|
2148
2166
|
- @return {string} Absolute local config-file path.
|
|
2149
2167
|
|
|
2150
|
-
### fn `export function getGlobalConfigPath(): string` (
|
|
2168
|
+
### fn `export function getGlobalConfigPath(): string` (L237-239)
|
|
2151
2169
|
- @brief Computes the absolute global config path for the current user.
|
|
2152
2170
|
- @details Resolves `~/.config/pi-usereq/config.json` from the current user home directory without consulting project state. Runtime is O(1). No external state is mutated.
|
|
2153
2171
|
- @return {string} Absolute global config-file path.
|
|
2154
2172
|
|
|
2155
|
-
### fn `export function isSameOrAncestorPath(` (
|
|
2173
|
+
### fn `export function isSameOrAncestorPath(` (L248-262)
|
|
2156
2174
|
- @brief Tests whether one path is identical to or an ancestor of another path.
|
|
2157
2175
|
- @details Resolves both inputs, computes a relative traversal from the candidate ancestor to the candidate child, and accepts only exact matches or descendant traversals that stay within the ancestor subtree. Runtime is O(p) in path length. No external state is mutated.
|
|
2158
2176
|
- @param[in] ancestorPath {string} Candidate ancestor or identical path.
|
|
2159
2177
|
- @param[in] childPath {string} Candidate child or identical path.
|
|
2160
2178
|
- @return {boolean} `true` when `ancestorPath` equals `childPath` or strictly contains it.
|
|
2161
2179
|
|
|
2162
|
-
### fn `function deriveStaticRuntimePathState(` (
|
|
2180
|
+
### fn `function deriveStaticRuntimePathState(` (L271-296)
|
|
2163
2181
|
- @brief Derives repository-relative runtime state from one base path and optional git path.
|
|
2164
2182
|
- @details Normalizes `base-path`, keeps `git-path` only when it is identical to or an ancestor of `base-path`, derives `parent-path` from `git-path`, and derives `base-dir` as `base-path` relative to `git-path`. Runtime is O(p) in path length. No external state is mutated.
|
|
2165
2183
|
- @param[in] basePath {string} Static base path candidate.
|
|
2166
2184
|
- @param[in] gitPath {string | undefined} Optional repository-root candidate.
|
|
2167
2185
|
- @return {{ basePath: string; gitPath?: string; parentPath?: string; baseDir: string }} Derived static path facts.
|
|
2168
2186
|
|
|
2169
|
-
### fn `export function bootstrapRuntimePathState(` (
|
|
2187
|
+
### fn `export function bootstrapRuntimePathState(` (L305-307)
|
|
2170
2188
|
- @brief Bootstraps the shared runtime path state for one extension session or command preflight.
|
|
2171
2189
|
- @details Sets static `base-path`, initializes dynamic `context-path` to the same value, stores derived `git-path`, `parent-path`, and `base-dir`, and clears any prior worktree facts. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2172
2190
|
- @param[in] basePath {string} Bootstrap cwd that becomes the static base path.
|
|
2173
2191
|
- @param[in] options {{ gitPath?: string | undefined } | undefined} Optional repository-root override.
|
|
2174
2192
|
- @return {void} No return value.
|
|
2175
2193
|
|
|
2176
|
-
### fn `export function ensureRuntimePathState(cwd: string): void` (
|
|
2194
|
+
### fn `export function ensureRuntimePathState(cwd: string): void` (L325-331)
|
|
2177
2195
|
- @brief Ensures the shared runtime path state has at least fallback base and context values.
|
|
2178
2196
|
- @details Lazily bootstraps the module-local state from the supplied cwd only when no prior bootstrap has occurred, preserving any already-established static or dynamic path state. Runtime is O(1). Side effect: may initialize module-local runtime-path state.
|
|
2179
2197
|
- @param[in] cwd {string} Fallback cwd.
|
|
2180
2198
|
- @return {void} No return value.
|
|
2181
2199
|
|
|
2182
|
-
### fn `export function getRuntimeBasePath(fallbackPath: string): string` (
|
|
2200
|
+
### fn `export function getRuntimeBasePath(fallbackPath: string): string` (L339-344)
|
|
2183
2201
|
- @brief Returns the current static base path.
|
|
2184
2202
|
- @details Falls back to the supplied path only when the runtime path state has not been bootstrapped yet. Runtime is O(1). No external state is mutated.
|
|
2185
2203
|
- @param[in] fallbackPath {string} Fallback cwd.
|
|
2186
2204
|
- @return {string} Static base path.
|
|
2187
2205
|
|
|
2188
|
-
### fn `export function getRuntimeContextPath(fallbackPath: string): string` (
|
|
2206
|
+
### fn `export function getRuntimeContextPath(fallbackPath: string): string` (L352-357)
|
|
2189
2207
|
- @brief Returns the current dynamic context path.
|
|
2190
2208
|
- @details Falls back to the supplied path only when the runtime path state has not been bootstrapped yet. Runtime is O(1). No external state is mutated.
|
|
2191
2209
|
- @param[in] fallbackPath {string} Fallback cwd.
|
|
2192
2210
|
- @return {string} Dynamic context path.
|
|
2193
2211
|
|
|
2194
|
-
### fn `export function setRuntimeGitPath(gitPath?: string): void` (
|
|
2212
|
+
### fn `export function setRuntimeGitPath(gitPath?: string): void` (L365-372)
|
|
2195
2213
|
- @brief Stores the derived git-root facts in the shared runtime path state.
|
|
2196
2214
|
- @details Re-derives `parent-path` and `base-dir` from the stored static `base-path` plus the supplied `git-path`, preserving the existing dynamic context path. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2197
2215
|
- @param[in] gitPath {string | undefined} Optional repository-root path.
|
|
2198
2216
|
- @return {void} No return value.
|
|
2199
2217
|
|
|
2200
|
-
### fn `export function setRuntimeContextPath(contextPath: string): void` (
|
|
2218
|
+
### fn `export function setRuntimeContextPath(contextPath: string): void` (L380-382)
|
|
2201
2219
|
- @brief Stores the current dynamic context path.
|
|
2202
2220
|
- @details Replaces the module-local `context-path` with the supplied trailing-slash-free absolute path. Runtime is O(1). Side effect: mutates module-local runtime-path state.
|
|
2203
2221
|
- @param[in] contextPath {string} Next context path.
|
|
2204
2222
|
- @return {void} No return value.
|
|
2205
2223
|
|
|
2206
|
-
### fn `export function setRuntimeWorktreePathState(options:` (
|
|
2224
|
+
### fn `export function setRuntimeWorktreePathState(options:` (L390-400)
|
|
2207
2225
|
- @brief Stores the current worktree directory and path facts.
|
|
2208
2226
|
- @details Normalizes the supplied relative `worktree-dir` and absolute `worktree-path` so later prompt rendering and tool execution can reuse the derived values across modules. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2209
2227
|
- @param[in] options {{ worktreeDir?: string | undefined; worktreePath?: string | undefined }} Optional active worktree facts.
|
|
2210
2228
|
- @return {void} No return value.
|
|
2211
2229
|
|
|
2212
|
-
### fn `export function getRuntimePathState(): RuntimePathState` (
|
|
2230
|
+
### fn `export function getRuntimePathState(): RuntimePathState` (L407-418)
|
|
2213
2231
|
- @brief Returns a snapshot of the shared runtime path state.
|
|
2214
2232
|
- @details Materializes the current static and dynamic path facts into a read-only copy suitable for prompt rendering, tool execution, and tests. Runtime is O(1). No external state is mutated.
|
|
2215
2233
|
- @return {RuntimePathState} Snapshot of the current runtime path state.
|
|
2216
2234
|
|
|
2217
|
-
### fn `export function formatRuntimePathForDisplay(absolutePath: string): string` (
|
|
2235
|
+
### fn `export function formatRuntimePathForDisplay(absolutePath: string): string` (L426-439)
|
|
2218
2236
|
- @brief Formats one absolute path relative to the user home using `~` when possible.
|
|
2219
2237
|
- @details Returns `~` when the path equals the current home directory and returns `~/...` when the path descends from it; otherwise returns the normalized absolute path unchanged. Runtime is O(p) in path length. No external state is mutated.
|
|
2220
2238
|
- @param[in] absolutePath {string} Absolute or relative path candidate.
|
|
2221
2239
|
- @return {string} Home-relative or trailing-slash-free absolute path.
|
|
2222
2240
|
|
|
2223
|
-
### fn `export function buildRuntimePathContext(` (
|
|
2241
|
+
### fn `export function buildRuntimePathContext(` (L450-459)
|
|
2224
2242
|
- @brief Builds the absolute runtime path context for one base path, context path, and configuration.
|
|
2225
2243
|
- @details Derives static `install-path`, `git-path`, `parent-path`, and `base-dir`, resolves the static `config-path`, preserves the dynamic `context-path`, and resolves docs/tests/source absolute paths against `context-path` so worktree-backed execution uses the active checkout. Runtime is O(s + p) where s is configured source-directory count and p is aggregate path length. No external state is mutated.
|
|
2226
2244
|
- @param[in] basePath {string} Static base path.
|
|
@@ -2229,7 +2247,7 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2229
2247
|
- @param[in] options {{ installationPath?: string; gitPath?: string | undefined; worktreeDir?: string | undefined; worktreePath?: string | undefined } | undefined} Optional installation, repository, and worktree overrides.
|
|
2230
2248
|
- @return {RuntimePathContext} Absolute runtime path context.
|
|
2231
2249
|
|
|
2232
|
-
### fn `export function buildRuntimePathFacts(` (
|
|
2250
|
+
### fn `export function buildRuntimePathFacts(` (L510-535)
|
|
2233
2251
|
- @brief Converts the absolute runtime path context into prompt/tool-facing path facts.
|
|
2234
2252
|
- @details Re-encodes every absolute path with the home-relative formatter while preserving trailing-slash-free relative directories for `base-dir` and `worktree-dir`. Runtime is O(s + p) where s is source-directory count and p is aggregate path length. No external state is mutated.
|
|
2235
2253
|
- @param[in] context {RuntimePathContext} Absolute runtime path context.
|
|
@@ -2238,29 +2256,31 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2238
2256
|
## Symbol Index
|
|
2239
2257
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
2240
2258
|
|---|---|---|---|---|
|
|
2241
|
-
|`
|
|
2242
|
-
|`
|
|
2243
|
-
|`
|
|
2244
|
-
|`
|
|
2245
|
-
|`
|
|
2246
|
-
|`
|
|
2247
|
-
|`
|
|
2248
|
-
|`
|
|
2249
|
-
|`
|
|
2250
|
-
|`
|
|
2251
|
-
|`
|
|
2252
|
-
|`
|
|
2253
|
-
|`
|
|
2254
|
-
|`
|
|
2255
|
-
|`
|
|
2256
|
-
|`
|
|
2257
|
-
|`
|
|
2258
|
-
|`
|
|
2259
|
-
|`
|
|
2260
|
-
|`
|
|
2261
|
-
|`
|
|
2262
|
-
|`
|
|
2263
|
-
|`
|
|
2259
|
+
|`InstallationPackageMetadata`|iface||35-38|export interface InstallationPackageMetadata|
|
|
2260
|
+
|`RuntimePathState`|iface||59-67|export interface RuntimePathState|
|
|
2261
|
+
|`RuntimePathContext`|iface||73-86|export interface RuntimePathContext extends RuntimePathState|
|
|
2262
|
+
|`RuntimePathFacts`|iface||92-113|export interface RuntimePathFacts|
|
|
2263
|
+
|`getInstallationPath`|fn||128-130|export function getInstallationPath(): string|
|
|
2264
|
+
|`getInstallationPackageMetadata`|fn||137-165|export function getInstallationPackageMetadata(): Install...|
|
|
2265
|
+
|`normalizePathSlashes`|fn||173-175|export function normalizePathSlashes(value: string): string|
|
|
2266
|
+
|`trimTrailingSeparatorsPreserveRoot`|fn||183-197|function trimTrailingSeparatorsPreserveRoot(value: string...|
|
|
2267
|
+
|`normalizeAbsolutePathContract`|fn||205-207|export function normalizeAbsolutePathContract(value: stri...|
|
|
2268
|
+
|`normalizeRelativeDirContract`|fn||215-220|export function normalizeRelativeDirContract(value: strin...|
|
|
2269
|
+
|`getConfigPath`|fn||228-230|export function getConfigPath(basePath: string): string|
|
|
2270
|
+
|`getGlobalConfigPath`|fn||237-239|export function getGlobalConfigPath(): string|
|
|
2271
|
+
|`isSameOrAncestorPath`|fn||248-262|export function isSameOrAncestorPath(|
|
|
2272
|
+
|`deriveStaticRuntimePathState`|fn||271-296|function deriveStaticRuntimePathState(|
|
|
2273
|
+
|`bootstrapRuntimePathState`|fn||305-307|export function bootstrapRuntimePathState(|
|
|
2274
|
+
|`ensureRuntimePathState`|fn||325-331|export function ensureRuntimePathState(cwd: string): void|
|
|
2275
|
+
|`getRuntimeBasePath`|fn||339-344|export function getRuntimeBasePath(fallbackPath: string):...|
|
|
2276
|
+
|`getRuntimeContextPath`|fn||352-357|export function getRuntimeContextPath(fallbackPath: strin...|
|
|
2277
|
+
|`setRuntimeGitPath`|fn||365-372|export function setRuntimeGitPath(gitPath?: string): void|
|
|
2278
|
+
|`setRuntimeContextPath`|fn||380-382|export function setRuntimeContextPath(contextPath: string...|
|
|
2279
|
+
|`setRuntimeWorktreePathState`|fn||390-400|export function setRuntimeWorktreePathState(options:|
|
|
2280
|
+
|`getRuntimePathState`|fn||407-418|export function getRuntimePathState(): RuntimePathState|
|
|
2281
|
+
|`formatRuntimePathForDisplay`|fn||426-439|export function formatRuntimePathForDisplay(absolutePath:...|
|
|
2282
|
+
|`buildRuntimePathContext`|fn||450-459|export function buildRuntimePathContext(|
|
|
2283
|
+
|`buildRuntimePathFacts`|fn||510-535|export function buildRuntimePathFacts(|
|
|
2264
2284
|
|
|
2265
2285
|
|
|
2266
2286
|
---
|
|
@@ -4703,7 +4723,7 @@ import path from "node:path";
|
|
|
4703
4723
|
|
|
4704
4724
|
---
|
|
4705
4725
|
|
|
4706
|
-
# index.ts | TypeScript |
|
|
4726
|
+
# index.ts | TypeScript | 4413L | 102 symbols | 27 imports | 107 comments
|
|
4707
4727
|
> Path: `src/index.ts`
|
|
4708
4728
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4709
4729
|
- @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.
|
|
@@ -4741,55 +4761,55 @@ import { makeRelativeIfContainsProject, shellSplit } from "./core/utils.js";
|
|
|
4741
4761
|
|
|
4742
4762
|
## Definitions
|
|
4743
4763
|
|
|
4744
|
-
### iface `interface PiShortcutRegistrar` (
|
|
4764
|
+
### iface `interface PiShortcutRegistrar` (L181-189)
|
|
4745
4765
|
- @brief Describes the optional shortcut-registration surface used by pi-usereq.
|
|
4746
4766
|
- @details Narrows the runtime API to the documented `registerShortcut(...)`
|
|
4747
4767
|
method so the extension can remain compatible with offline harnesses that do
|
|
4748
4768
|
not implement shortcut capture. Compile-time only and introduces no runtime
|
|
4749
4769
|
cost.
|
|
4750
4770
|
|
|
4751
|
-
### fn `function getProjectBase(cwd: string): string` (
|
|
4771
|
+
### fn `function getProjectBase(cwd: string): string` (L197-206)
|
|
4752
4772
|
- @brief Resolves the effective project base from a working directory.
|
|
4753
4773
|
- @details Normalizes the provided cwd into an absolute path without consulting configuration. Time complexity is O(1). No I/O side effects occur.
|
|
4754
4774
|
- @param[in] cwd {string} Current working directory.
|
|
4755
4775
|
- @return {string} Absolute project base path.
|
|
4756
4776
|
|
|
4757
|
-
### fn `function getProcessCwdSafe(): string` (
|
|
4777
|
+
### fn `function getProcessCwdSafe(): string` (L213-222)
|
|
4758
4778
|
- @brief Resolves a safe process working directory for extension-load paths.
|
|
4759
4779
|
- @details Returns `process.cwd()` when available and falls back to absolute `PWD`, `HOME`, or `/` when the current shell directory has been deleted. Runtime is O(1). No external state is mutated.
|
|
4760
4780
|
- @return {string} Absolute fallback-safe process working directory.
|
|
4761
4781
|
|
|
4762
|
-
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (
|
|
4782
|
+
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (L230-242)
|
|
4763
4783
|
- @brief Resolves the live working directory used for bootstrap-sensitive flows.
|
|
4764
4784
|
- @details Prefers the supplied cwd when it still exists. Otherwise reuses the tracked runtime context path when it remains live, then the tracked runtime base path, and finally a process-safe cwd so deleted worktree paths retained by stale contexts cannot poison later prompt preflight or lifecycle bootstrap. Runtime is O(1) plus bounded filesystem probes. No external state is mutated.
|
|
4765
4785
|
- @param[in] cwd {string} Candidate context cwd.
|
|
4766
4786
|
- @return {string} Existing absolute cwd used for bootstrap work.
|
|
4767
4787
|
|
|
4768
|
-
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (
|
|
4788
|
+
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (L251-260)
|
|
4769
4789
|
- @brief Best-effort synchronizes one context `cwd` mirror with bootstrap reality.
|
|
4770
4790
|
- @details Applies the resolved live cwd to the supplied context when writable and ignores stale or read-only mirrors so command bootstrap can continue using authoritative filesystem probes. Runtime is O(1). Side effects are limited to optional `ctx.cwd` mutation.
|
|
4771
4791
|
- @param[in] cwd {string} Resolved live cwd.
|
|
4772
4792
|
- @param[in,out] ctx {{ cwd?: string }} Mutable context-like object.
|
|
4773
4793
|
- @return {void} No return value.
|
|
4774
4794
|
|
|
4775
|
-
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (
|
|
4795
|
+
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L269-272)
|
|
4776
4796
|
- @brief Loads project configuration for the extension runtime.
|
|
4777
4797
|
- @details Resolves the project base, loads persisted config, and normalizes configured directory paths without reading or persisting runtime-derived `base-path` or `git-path` metadata. Runtime is dominated by config I/O. Side effects are limited to filesystem reads.
|
|
4778
4798
|
- @param[in] cwd {string} Current working directory.
|
|
4779
4799
|
- @return {UseReqConfig} Effective project configuration.
|
|
4780
4800
|
- @satisfies REQ-030, REQ-145, REQ-146
|
|
4781
4801
|
|
|
4782
|
-
- type `type DebugToolCommandExecuteResult = ReturnType<typeof buildMonolithicToolExecuteResult>;` (
|
|
4802
|
+
- type `type DebugToolCommandExecuteResult = ReturnType<typeof buildMonolithicToolExecuteResult>;` (L278)
|
|
4783
4803
|
- @brief Describes the execute-result surface reused by debug tool wrapper commands.
|
|
4784
4804
|
- @details Narrows debug slash-command handlers to the same monolithic content-plus-execution wrapper returned by agent tools so editor output and notifications can reuse shared extraction helpers. The alias is compile-time only and introduces no runtime cost.
|
|
4785
|
-
### fn `function shouldRegisterDebugToolCommands(cwd: string): boolean` (
|
|
4805
|
+
### fn `function shouldRegisterDebugToolCommands(cwd: string): boolean` (L287-293)
|
|
4786
4806
|
- @brief Tests whether debug tool wrapper commands should be registered for one runtime cwd.
|
|
4787
4807
|
- @details Loads the effective project configuration for the supplied cwd and returns `true` only when `DEBUG_TOOL_COMMANDS_ENABLED` resolves to `enable`. Malformed or unreadable config payloads degrade to `false` so extension activation never aborts while deciding whether to register optional debug commands. Runtime is dominated by config I/O. Side effects are limited to filesystem reads.
|
|
4788
4808
|
- @param[in] cwd {string} Candidate runtime working directory.
|
|
4789
4809
|
- @return {boolean} `true` when debug tool wrapper commands should be registered.
|
|
4790
4810
|
- @satisfies REQ-323
|
|
4791
4811
|
|
|
4792
|
-
### fn `function writeDebugToolCommandResultToEditor(` (
|
|
4812
|
+
### fn `function writeDebugToolCommandResultToEditor(` (L304-318)
|
|
4793
4813
|
- @brief Writes one debug tool-wrapper result into the editor and emits a status notification.
|
|
4794
4814
|
- @details Extracts the primary monolithic content text from the wrapped tool result, forwards that exact text to the editor, and emits an informational or error notification keyed by the tool exit code. Runtime is O(n) in output length. Side effects include editor-text mutation and UI notifications.
|
|
4795
4815
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4798,7 +4818,7 @@ cost.
|
|
|
4798
4818
|
- @return {void} No return value.
|
|
4799
4819
|
- @satisfies REQ-324
|
|
4800
4820
|
|
|
4801
|
-
### fn `function executeDebugToolCommand(` (
|
|
4821
|
+
### fn `function executeDebugToolCommand(` (L330-348)
|
|
4802
4822
|
- @brief Executes one config-gated debug tool wrapper slash command.
|
|
4803
4823
|
- @details Resolves a live cwd for the invoking command context, refreshes runtime path state, loads the effective project configuration, rejects execution when debug tool wrapper commands are disabled, and otherwise writes the selected wrapped tool output into the editor. Runtime is dominated by the delegated tool runner. Side effects include runtime-path bootstrap, filesystem reads, optional tool side effects, editor-text mutation, and UI notifications.
|
|
4804
4824
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4808,14 +4828,14 @@ cost.
|
|
|
4808
4828
|
- @throws {ReqError} Throws when debug tool wrapper commands are disabled for the active project.
|
|
4809
4829
|
- @satisfies REQ-324, REQ-325
|
|
4810
4830
|
|
|
4811
|
-
### fn `function registerDebugToolCommands(pi: ExtensionAPI): void` (
|
|
4812
|
-
- @brief Registers config-gated debug slash-command wrappers for selected
|
|
4813
|
-
- @details Registers `debug-compress`, `debug-references`, `debug-static-check`, and `debug-tokens` as extension commands that reuse the same runner paths as the corresponding agent tools and write the resulting monolithic text into the editor instead of the LLM content channel. Re-registering the same commands is idempotent because pi keeps the latest same-extension command definition per name. Runtime is O(1) for registration; handler cost depends on the selected runner. Side effects include command registration.
|
|
4831
|
+
### fn `function registerDebugToolCommands(pi: ExtensionAPI): void` (L357-396)
|
|
4832
|
+
- @brief Registers config-gated debug slash-command wrappers for selected project analysis tools.
|
|
4833
|
+
- @details Registers `debug-compress`, `debug-references`, `debug-static-check`, `debug-summarize`, and `debug-tokens` as extension commands that reuse the same runner paths as the corresponding agent tools and write the resulting monolithic text into the editor instead of the LLM content channel. Re-registering the same commands is idempotent because pi keeps the latest same-extension command definition per name. Runtime is O(1) for registration; handler cost depends on the selected runner. Side effects include command registration.
|
|
4814
4834
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4815
4835
|
- @return {void} No return value.
|
|
4816
4836
|
- @satisfies DES-015, REQ-323, REQ-324, REQ-325
|
|
4817
4837
|
|
|
4818
|
-
### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (
|
|
4838
|
+
### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (L406-409)
|
|
4819
4839
|
- @brief Persists effective project configuration from the extension runtime.
|
|
4820
4840
|
- @details Resolves the project base, normalizes configured local directory paths into project-relative form, and delegates split local/global persistence to `saveConfig` without serializing runtime-derived path metadata. Runtime is O(n) in config size. Side effects include config-file writes.
|
|
4821
4841
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -4823,38 +4843,38 @@ cost.
|
|
|
4823
4843
|
- @return {void} No return value.
|
|
4824
4844
|
- @satisfies REQ-146, REQ-315
|
|
4825
4845
|
|
|
4826
|
-
### fn `function formatLocalConfigPathForMenu(cwd: string): string` (
|
|
4846
|
+
### fn `function formatLocalConfigPathForMenu(cwd: string): string` (L418-422)
|
|
4827
4847
|
- @brief Formats the current local config path for top-level menu display.
|
|
4828
4848
|
- @details Resolves `<base-path>/.pi-usereq.json` from the cwd-derived project base and reuses the shared runtime-path formatter so the `Show local configuration` row uses the documented `~`-relative display contract. Runtime is O(p) in path length. No external state is mutated.
|
|
4829
4849
|
- @param[in] cwd {string} Current working directory.
|
|
4830
4850
|
- @return {string} `~`-relative or absolute local config-path display value.
|
|
4831
4851
|
- @satisfies REQ-162
|
|
4832
4852
|
|
|
4833
|
-
### fn `function formatGlobalConfigPathForMenu(): string` (
|
|
4853
|
+
### fn `function formatGlobalConfigPathForMenu(): string` (L430-432)
|
|
4834
4854
|
- @brief Formats the current global config path for top-level menu display.
|
|
4835
4855
|
- @details Resolves `~/.config/pi-usereq/config.json` through the shared runtime-path formatter so the `Show global configuration` row uses the documented `~`-relative display contract. Runtime is O(p) in path length. No external state is mutated.
|
|
4836
4856
|
- @return {string} `~`-relative or absolute global config-path display value.
|
|
4837
4857
|
- @satisfies REQ-319
|
|
4838
4858
|
|
|
4839
|
-
### fn `function buildTerminalSettingsMenuChoices(options:` (
|
|
4859
|
+
### fn `function buildTerminalSettingsMenuChoices(options:` (L441-452)
|
|
4840
4860
|
- @brief Builds the standardized terminal rows appended to every configuration menu.
|
|
4841
4861
|
- @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.
|
|
4842
4862
|
- @param[in] options {{ resetDefaultsDescription: string }} Menu-specific terminal-row metadata.
|
|
4843
4863
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered terminal menu rows.
|
|
4844
4864
|
- @satisfies REQ-193
|
|
4845
4865
|
|
|
4846
|
-
### iface `interface ResetConfirmationChange` (
|
|
4866
|
+
### iface `interface ResetConfirmationChange` (L458-462)
|
|
4847
4867
|
- @brief Describes one pending reset value change shown in confirmation menus.
|
|
4848
4868
|
- @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.
|
|
4849
4869
|
|
|
4850
|
-
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (
|
|
4870
|
+
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L471-473)
|
|
4851
4871
|
- @brief Formats one reset-confirmation value pair for menu display.
|
|
4852
4872
|
- @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.
|
|
4853
4873
|
- @param[in] previousValue {string} Current persisted value.
|
|
4854
4874
|
- @param[in] nextValue {string} Candidate default value.
|
|
4855
4875
|
- @return {string} Rendered preview string.
|
|
4856
4876
|
|
|
4857
|
-
### fn `function buildResetConfirmationChoices(` (
|
|
4877
|
+
### fn `function buildResetConfirmationChoices(` (L483-522)
|
|
4858
4878
|
- @brief Builds the shared settings-menu choices for one reset-confirmation submenu.
|
|
4859
4879
|
- @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.
|
|
4860
4880
|
- @param[in] changes {ResetConfirmationChange[]} Changed-value preview rows.
|
|
@@ -4862,7 +4882,7 @@ cost.
|
|
|
4862
4882
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4863
4883
|
- @return {PiUsereqSettingsMenuChoice[]} Reset-confirmation submenu choices.
|
|
4864
4884
|
|
|
4865
|
-
### fn `async function confirmResetChanges(` (
|
|
4885
|
+
### fn `async function confirmResetChanges(` (L534-547)
|
|
4866
4886
|
- @brief Opens one explicit reset-confirmation submenu.
|
|
4867
4887
|
- @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.
|
|
4868
4888
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4872,14 +4892,14 @@ cost.
|
|
|
4872
4892
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4873
4893
|
- @return {Promise<boolean>} `true` when the reset is explicitly approved.
|
|
4874
4894
|
|
|
4875
|
-
### fn `function writePersistedConfigToEditor(` (
|
|
4895
|
+
### fn `function writePersistedConfigToEditor(` (L556-561)
|
|
4876
4896
|
- @brief Writes one already-persisted config file text into the editor.
|
|
4877
4897
|
- @details Reads the target config file from disk after the caller has saved any pending changes and forwards the exact persisted text into the editor. Runtime is O(n) in serialized config size. Side effects include filesystem reads and editor-text mutation.
|
|
4878
4898
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4879
4899
|
- @param[in] configPath {string} Absolute persisted config path.
|
|
4880
4900
|
- @return {void} No return value.
|
|
4881
4901
|
|
|
4882
|
-
### fn `function writePersistedLocalConfigToEditor(` (
|
|
4902
|
+
### fn `function writePersistedLocalConfigToEditor(` (L571-577)
|
|
4883
4903
|
- @brief Writes the already-persisted local configuration file text into the editor.
|
|
4884
4904
|
- @details Reads `<base-path>/.pi-usereq.json` from disk after the caller has saved any pending local and global configuration changes, then 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.
|
|
4885
4905
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4887,58 +4907,58 @@ cost.
|
|
|
4887
4907
|
- @return {void} No return value.
|
|
4888
4908
|
- @satisfies REQ-031
|
|
4889
4909
|
|
|
4890
|
-
### fn `function writePersistedGlobalConfigToEditor(` (
|
|
4910
|
+
### fn `function writePersistedGlobalConfigToEditor(` (L586-590)
|
|
4891
4911
|
- @brief Writes the already-persisted global configuration file text into the editor.
|
|
4892
4912
|
- @details Reads `~/.config/pi-usereq/config.json` from disk after the caller has saved any pending local and global configuration changes, then 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.
|
|
4893
4913
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4894
4914
|
- @return {void} No return value.
|
|
4895
4915
|
- @satisfies REQ-318
|
|
4896
4916
|
|
|
4897
|
-
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (
|
|
4917
|
+
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L651-655)
|
|
4898
4918
|
- @brief Builds the supported-tag guidance lines embedded in search-tool registrations.
|
|
4899
4919
|
- @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.
|
|
4900
4920
|
- @return {string[]} Supported-tag guidance lines.
|
|
4901
4921
|
|
|
4902
|
-
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (
|
|
4922
|
+
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L663-668)
|
|
4903
4923
|
- @brief Builds the schema description for one search-tool registration.
|
|
4904
4924
|
- @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.
|
|
4905
4925
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4906
4926
|
- @return {string} Parameter-schema description.
|
|
4907
4927
|
|
|
4908
|
-
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (
|
|
4928
|
+
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L676-689)
|
|
4909
4929
|
- @brief Builds the prompt-guideline set for one search-tool registration.
|
|
4910
4930
|
- @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.
|
|
4911
4931
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4912
4932
|
- @return {string[]} Prompt-guideline strings.
|
|
4913
4933
|
|
|
4914
|
-
- type `type MonolithicToolRenderResult = {` (
|
|
4934
|
+
- type `type MonolithicToolRenderResult = {` (L695)
|
|
4915
4935
|
- @brief Describes the monolithic tool-result surface consumed by tool-row renderers.
|
|
4916
4936
|
- @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.
|
|
4917
|
-
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (
|
|
4937
|
+
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L712-715)
|
|
4918
4938
|
- @brief Extracts the primary monolithic text block from one tool result.
|
|
4919
4939
|
- @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.
|
|
4920
4940
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4921
4941
|
- @return {string} Primary monolithic content text.
|
|
4922
4942
|
|
|
4923
|
-
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (
|
|
4943
|
+
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L723-733)
|
|
4924
4944
|
- @brief Reads the first residual execution error string from one monolithic tool result.
|
|
4925
4945
|
- @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.
|
|
4926
4946
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4927
4947
|
- @return {string | undefined} First residual execution error string.
|
|
4928
4948
|
|
|
4929
|
-
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (
|
|
4949
|
+
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L741-780)
|
|
4930
4950
|
- @brief Formats one scalar or structural tool argument for compact render summaries.
|
|
4931
4951
|
- @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.
|
|
4932
4952
|
- @param[in] value {unknown} Candidate tool argument value.
|
|
4933
4953
|
- @return {string | undefined} Compact preview string or `undefined` when the value carries no useful summary.
|
|
4934
4954
|
|
|
4935
|
-
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (
|
|
4955
|
+
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L788-799)
|
|
4936
4956
|
- @brief Builds the compact invocation summary appended to collapsed tool rows.
|
|
4937
4957
|
- @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.
|
|
4938
4958
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4939
4959
|
- @return {string} Compact invocation summary prefixed with one separating space, or the empty string when no useful preview exists.
|
|
4940
4960
|
|
|
4941
|
-
### fn `function summarizeStructuredToolResult(` (
|
|
4961
|
+
### fn `function summarizeStructuredToolResult(` (L809-824)
|
|
4942
4962
|
- @brief Builds the compact default text for one monolithic tool result row.
|
|
4943
4963
|
- @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.
|
|
4944
4964
|
- @param[in] toolName {string} Registered tool name.
|
|
@@ -4946,27 +4966,27 @@ cost.
|
|
|
4946
4966
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4947
4967
|
- @return {string} Compact single-line summary.
|
|
4948
4968
|
|
|
4949
|
-
### fn `function buildStructuredToolRenderResult(toolName: string)` (
|
|
4969
|
+
### fn `function buildStructuredToolRenderResult(toolName: string)` (L833-852)
|
|
4950
4970
|
- @brief Builds a custom `renderResult` implementation for one monolithic tool.
|
|
4951
4971
|
- @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.
|
|
4952
4972
|
- @param[in] toolName {string} Registered tool name.
|
|
4953
4973
|
- @return {(result: MonolithicToolRenderResult, options: { expanded?: boolean; isPartial?: boolean }, _theme: unknown, context: { args?: Record<string, unknown>; lastComponent?: unknown }) => Text} Custom result renderer.
|
|
4954
4974
|
- @satisfies REQ-210
|
|
4955
4975
|
|
|
4956
|
-
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4976
|
+
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L860-866)
|
|
4957
4977
|
- @brief Executes one CLI-style runner for a monolithic agent tool.
|
|
4958
4978
|
- @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.
|
|
4959
4979
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4960
4980
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Monolithic tool execute result.
|
|
4961
4981
|
|
|
4962
|
-
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4982
|
+
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L875-904)
|
|
4963
4983
|
- @brief Executes one CLI-style runner for a status-only agent tool.
|
|
4964
4984
|
- @details Reuses the standalone tool-runner contract, preserves `content[0].text` as the status-only `success` or `error: <diagnostic>` payload, and strips success-path `stdout_lines` so `details.execution` stays limited to the numeric code plus optional residual stderr diagnostics. Runtime is dominated by the delegated runner. Side effects depend on the selected tool.
|
|
4965
4985
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4966
4986
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Status-only tool execute result.
|
|
4967
4987
|
- @satisfies REQ-294, REQ-295, REQ-296
|
|
4968
4988
|
|
|
4969
|
-
### fn `function deliverPromptCommand(` (
|
|
4989
|
+
### fn `function deliverPromptCommand(` (L915-933)
|
|
4970
4990
|
- @brief Starts delivery of one rendered prompt into the current active session.
|
|
4971
4991
|
- @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.
|
|
4972
4992
|
- @param[in] pi {ExtensionAPI} Handler-scoped extension API instance retained as the fallback dispatcher.
|
|
@@ -4975,7 +4995,7 @@ cost.
|
|
|
4975
4995
|
- @return {Promise<void>} Promise representing eventual prompt-delivery completion.
|
|
4976
4996
|
- @satisfies REQ-004, REQ-067, REQ-068, REQ-227, REQ-281
|
|
4977
4997
|
|
|
4978
|
-
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (
|
|
4998
|
+
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L944-960)
|
|
4979
4999
|
- @brief Detects prompt-delivery failures that can be ignored after prompt ownership has moved past the command handler.
|
|
4980
5000
|
- @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.
|
|
4981
5001
|
- @param[in] error {unknown} Candidate prompt-delivery failure.
|
|
@@ -4984,7 +5004,7 @@ cost.
|
|
|
4984
5004
|
- @return {boolean} `true` when the failure is a late stale-context delivery rejection that MUST be ignored.
|
|
4985
5005
|
- @satisfies REQ-208, REQ-280, REQ-281, REQ-282
|
|
4986
5006
|
|
|
4987
|
-
### fn `function logPromptWorkflowStateChange(` (
|
|
5007
|
+
### fn `function logPromptWorkflowStateChange(` (L973-992)
|
|
4988
5008
|
- @brief Appends one workflow-state debug entry for a bundled prompt when selected.
|
|
4989
5009
|
- @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.
|
|
4990
5010
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4995,7 +5015,7 @@ cost.
|
|
|
4995
5015
|
- @return {void} No return value.
|
|
4996
5016
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
4997
5017
|
|
|
4998
|
-
### fn `function logPromptWorkflowEvent(` (
|
|
5018
|
+
### fn `function logPromptWorkflowEvent(` (L1008-1028)
|
|
4999
5019
|
- @brief Appends one dedicated prompt workflow debug entry when selected.
|
|
5000
5020
|
- @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.
|
|
5001
5021
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -5009,7 +5029,7 @@ cost.
|
|
|
5009
5029
|
- @return {void} No return value.
|
|
5010
5030
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
5011
5031
|
|
|
5012
|
-
### fn `function transitionPromptWorkflowState(` (
|
|
5032
|
+
### fn `function transitionPromptWorkflowState(` (L1041-1054)
|
|
5013
5033
|
- @brief Transitions one prompt workflow state and logs the transition immediately after the state update.
|
|
5014
5034
|
- @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.
|
|
5015
5035
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -5020,20 +5040,20 @@ cost.
|
|
|
5020
5040
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5021
5041
|
- @return {void} No return value.
|
|
5022
5042
|
|
|
5023
|
-
### fn `function resolvePromptCommandDescription(` (
|
|
5043
|
+
### fn `function resolvePromptCommandDescription(` (L1062-1066)
|
|
5024
5044
|
- @brief Resolves the runtime slash-command description for one bundled prompt.
|
|
5025
5045
|
- @details Reads the bundled prompt markdown, extracts the first `# ` heading payload, and falls back to the historical generated label when the prompt omits a level-one heading. Runtime is O(n) in prompt length. Side effects are limited to filesystem reads.
|
|
5026
5046
|
- @param[in] promptName {import("./core/prompt-command-catalog.js").PromptCommandName} Bundled prompt name.
|
|
5027
5047
|
- @return {string} Runtime command description.
|
|
5028
5048
|
|
|
5029
|
-
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (
|
|
5049
|
+
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L1075-1079)
|
|
5030
5050
|
- @brief Resolves the original project base used for debug-log file writes.
|
|
5031
5051
|
- @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.
|
|
5032
5052
|
- @param[in] cwd {string} Current extension working directory.
|
|
5033
5053
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5034
5054
|
- @return {string} Absolute original project base path for debug logging.
|
|
5035
5055
|
|
|
5036
|
-
### fn `function notifyContextSafely(` (
|
|
5056
|
+
### fn `function notifyContextSafely(` (L1090-1107)
|
|
5037
5057
|
- @brief Delivers one best-effort UI notification without failing on stale replacement contexts.
|
|
5038
5058
|
- @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.
|
|
5039
5059
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext | undefined} Candidate UI context.
|
|
@@ -5042,7 +5062,7 @@ cost.
|
|
|
5042
5062
|
- @return {boolean} `true` when the notification was delivered and `false` when the context was already stale.
|
|
5043
5063
|
- @satisfies REQ-280
|
|
5044
5064
|
|
|
5045
|
-
### fn `function rejectNonIdleReqCommand(` (
|
|
5065
|
+
### fn `function rejectNonIdleReqCommand(` (L1119-1139)
|
|
5046
5066
|
- @brief Rejects one non-`idle` req-command invocation and records the workflow error state.
|
|
5047
5067
|
- @details Builds a deterministic busy-state diagnostic from the current workflow state, transitions the shared workflow state to `error`, preserves any pending or active prompt execution metadata for later closure handling, emits an error notification, and throws `ReqError`. Bundled prompt commands reuse `transitionPromptWorkflowState(...)` when cached configuration is available so prompt debug logging captures the actual state transition; specialized non-prompt commands fall back to direct status mutation. Runtime is O(1). Side effects include workflow-state mutation, status-bar rendering, optional debug-log writes, and user notification delivery.
|
|
5048
5068
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -5052,20 +5072,20 @@ cost.
|
|
|
5052
5072
|
- @throws {ReqError} Always throws because non-`idle` req commands are rejected.
|
|
5053
5073
|
- @satisfies REQ-224
|
|
5054
5074
|
|
|
5055
|
-
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (
|
|
5075
|
+
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L1148-1156)
|
|
5056
5076
|
- @brief Returns the configurable active-tool inventory visible to the extension.
|
|
5057
5077
|
- @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.
|
|
5058
5078
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5059
5079
|
- @return {ToolInfo[]} Sorted configurable tool descriptors.
|
|
5060
5080
|
- @satisfies REQ-007, REQ-063, REQ-231, REQ-232
|
|
5061
5081
|
|
|
5062
|
-
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (
|
|
5082
|
+
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L1164-1168)
|
|
5063
5083
|
- @brief Normalizes and returns the configured enabled active tools.
|
|
5064
5084
|
- @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"]`.
|
|
5065
5085
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5066
5086
|
- @return {string[]} Normalized enabled tool names.
|
|
5067
5087
|
|
|
5068
|
-
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (
|
|
5088
|
+
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L1178-1195)
|
|
5069
5089
|
- @brief Applies the configured active-tool enablement to the current session.
|
|
5070
5090
|
- @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(...)`.
|
|
5071
5091
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5073,7 +5093,7 @@ cost.
|
|
|
5073
5093
|
- @return {void} No return value.
|
|
5074
5094
|
- @satisfies REQ-009, REQ-064
|
|
5075
5095
|
|
|
5076
|
-
### fn `async function handleExtensionStatusEvent(` (
|
|
5096
|
+
### fn `async function handleExtensionStatusEvent(` (L1208-1479)
|
|
5077
5097
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
5078
5098
|
- @details Applies session-start-specific resource validation, project-config refresh, startup-tool enablement, and selected debug-tool logging before forwarding the originating hook name and payload into the shared `updateExtensionStatus(...)` pipeline. Before `agent_start`, re-verifies any prepared prompt execution session switch. On `agent_end`, dispatches configured command-notify, sound, and prompt-specific Pushover effects, logs dedicated workflow-closure diagnostics, restores the original session-backed `base-path` for every matched worktree-backed completion by reusing persisted replacement-session command contexts when event contexts omit `switchSession()`, executes the stash-assisted merge-and-delete finalization path for every matched successful worktree-backed completion even when a later busy-command rejection already moved workflow state to `error`, emits a warning-only notification when restored `base-path` changes are reapplied after merge, tolerates stale replacement-session notification contexts after session replacement, retains the worktree plus notifies closure failure for interrupted or failed outcomes, logs selected prompt workflow transitions, and transitions workflow state through `merging`, `error`, and `idle` as required. On `session_shutdown`, captures pre-update prompt snapshots so workflow-shutdown diagnostics and same-runtime command continuation preserve the active prompt workflow state across switch-triggered rebinding, then disposes the shared controller. Runtime is dominated by configuration loading during `session_start` and git finalization during matched successful `agent_end` handling; all other hooks are O(1). Side effects include resource checks, active-tool mutation, active-session replacement, status updates, live-ticker disposal on shutdown, optional child-process spawning, outbound HTTPS requests, branch merges, worktree deletion, and optional debug-log writes.
|
|
5079
5099
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5084,7 +5104,7 @@ cost.
|
|
|
5084
5104
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
5085
5105
|
- @satisfies REQ-117, REQ-118, REQ-119, REQ-131, REQ-132, REQ-133, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-176, REQ-178, REQ-184, REQ-185, REQ-186, REQ-187, REQ-208, REQ-209, REQ-221, REQ-228, REQ-229, REQ-230, REQ-244, REQ-245, REQ-246, REQ-247, REQ-276, REQ-277, REQ-278, REQ-279, REQ-280, REQ-291, REQ-292
|
|
5086
5106
|
|
|
5087
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
5107
|
+
### fn `function registerExtensionStatusHooks(` (L1495-1514)
|
|
5088
5108
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
5089
5109
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
5090
5110
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -5098,7 +5118,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5098
5118
|
- @return {void} No return value.
|
|
5099
5119
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
5100
5120
|
|
|
5101
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
5121
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1524-1527)
|
|
5102
5122
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
5103
5123
|
- @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.
|
|
5104
5124
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5106,26 +5126,26 @@ registered hook count. Side effects include hook registration.
|
|
|
5106
5126
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5107
5127
|
- @return {void} No return value.
|
|
5108
5128
|
|
|
5109
|
-
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (
|
|
5129
|
+
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1535-1537)
|
|
5110
5130
|
- @brief Returns the canonical debug-tool toggle order.
|
|
5111
5131
|
- @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.
|
|
5112
5132
|
- @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
|
|
5113
5133
|
- @satisfies REQ-242
|
|
5114
5134
|
|
|
5115
|
-
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (
|
|
5135
|
+
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1546-1555)
|
|
5116
5136
|
- @brief Restores the debug configuration subtree to its documented defaults.
|
|
5117
5137
|
- @details Resets global debug enablement, log path, tool-wrapper command registration, workflow-state filter, dedicated workflow-event logging, and selected tool plus prompt debug toggles without mutating unrelated settings. Runtime is O(1). Side effect: mutates `config`.
|
|
5118
5138
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5119
5139
|
- @return {void} No return value.
|
|
5120
5140
|
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277, REQ-322
|
|
5121
5141
|
|
|
5122
|
-
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (
|
|
5142
|
+
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1563-1569)
|
|
5123
5143
|
- @brief Formats the top-level Debug summary value.
|
|
5124
5144
|
- @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.
|
|
5125
5145
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5126
5146
|
- @return {string} Compact debug summary string.
|
|
5127
5147
|
|
|
5128
|
-
### fn `function buildDebugMenuChoice(` (
|
|
5148
|
+
### fn `function buildDebugMenuChoice(` (L1579-1592)
|
|
5129
5149
|
- @brief Builds one debug-menu row with optional disabled styling.
|
|
5130
5150
|
- @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.
|
|
5131
5151
|
- @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
|
|
@@ -5133,21 +5153,21 @@ registered hook count. Side effects include hook registration.
|
|
|
5133
5153
|
- @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
|
|
5134
5154
|
- @satisfies REQ-241
|
|
5135
5155
|
|
|
5136
|
-
### fn `async function selectDebugLogOnStatus(` (
|
|
5156
|
+
### fn `async function selectDebugLogOnStatus(` (L1601-1629)
|
|
5137
5157
|
- @brief Opens the workflow-state filter selector used by the Debug submenu.
|
|
5138
5158
|
- @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.
|
|
5139
5159
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5140
5160
|
- @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
|
|
5141
5161
|
- @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
|
|
5142
5162
|
|
|
5143
|
-
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5163
|
+
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1638-1724)
|
|
5144
5164
|
- @brief Builds the shared settings-menu choices for debug logging configuration.
|
|
5145
5165
|
- @details Serializes global debug controls plus tool-wrapper command registration, workflow-state, dedicated workflow-event, per-tool, and per-prompt toggles into one submenu, deriving inventories from the canonical tool and prompt lists and dimming locked rows while debug is disabled. Runtime is O(t + p). No external state is mutated.
|
|
5146
5166
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5147
5167
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
|
|
5148
5168
|
- @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277, REQ-321, REQ-322
|
|
5149
5169
|
|
|
5150
|
-
### fn `async function configureDebugMenu(` (
|
|
5170
|
+
### fn `async function configureDebugMenu(` (L1735-1925)
|
|
5151
5171
|
- @brief Runs the interactive Debug submenu.
|
|
5152
5172
|
- @details Lets the user toggle global debug enablement, tool-wrapper command registration, debug file and workflow filters, dedicated workflow-event logging, per-tool selectors, and per-prompt selectors while preserving row focus across re-renders. Runtime depends on user interaction count. Side effects include UI updates, config mutation, and optional debug command registration.
|
|
5153
5173
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5156,47 +5176,47 @@ registered hook count. Side effects include hook registration.
|
|
|
5156
5176
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5157
5177
|
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-192, REQ-193, REQ-195, REQ-277, REQ-321, REQ-322, REQ-323
|
|
5158
5178
|
|
|
5159
|
-
### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (
|
|
5179
|
+
### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (L1741-1748)
|
|
5160
5180
|
|
|
5161
|
-
- type `type PiNotifyBooleanConfigKey =` (
|
|
5181
|
+
- type `type PiNotifyBooleanConfigKey =` (L1931)
|
|
5162
5182
|
- @brief Represents one persisted boolean notification-setting key.
|
|
5163
5183
|
- @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.
|
|
5164
|
-
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (
|
|
5184
|
+
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1948)
|
|
5165
5185
|
- @brief Represents one persisted boolean notification event-toggle key.
|
|
5166
5186
|
- @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.
|
|
5167
|
-
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (
|
|
5187
|
+
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1957)
|
|
5168
5188
|
- @brief Represents one shared prompt-end event identifier used by notification menus.
|
|
5169
5189
|
- @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.
|
|
5170
|
-
### iface `interface PiNotifyEventRowDefinition` (
|
|
5190
|
+
### iface `interface PiNotifyEventRowDefinition` (L1963-1967)
|
|
5171
5191
|
- @brief Describes one shared prompt-end event row rendered inside notification event submenus.
|
|
5172
5192
|
- @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.
|
|
5173
5193
|
|
|
5174
|
-
### iface `interface PiNotifyEventMenuDefinition` (
|
|
5194
|
+
### iface `interface PiNotifyEventMenuDefinition` (L1973-1979)
|
|
5175
5195
|
- @brief Describes one notification-system event submenu contract.
|
|
5176
5196
|
- @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.
|
|
5177
5197
|
|
|
5178
|
-
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (
|
|
5198
|
+
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1988-1991)
|
|
5179
5199
|
- @brief Flips one persisted boolean notification setting.
|
|
5180
5200
|
- @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`.
|
|
5181
5201
|
- @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
|
|
5182
5202
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5183
5203
|
- @return {boolean} Next enabled state.
|
|
5184
5204
|
|
|
5185
|
-
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (
|
|
5205
|
+
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L2000-2024)
|
|
5186
5206
|
- @brief Restores notification-related settings to their documented defaults.
|
|
5187
5207
|
- @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`.
|
|
5188
5208
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5189
5209
|
- @return {void} No return value.
|
|
5190
5210
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
|
|
5191
5211
|
|
|
5192
|
-
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (
|
|
5212
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2033-2035)
|
|
5193
5213
|
- @brief Formats one persisted Pushover priority for menu display.
|
|
5194
5214
|
- @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.
|
|
5195
5215
|
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
5196
5216
|
- @return {string} Menu-display label.
|
|
5197
5217
|
- @satisfies REQ-172
|
|
5198
5218
|
|
|
5199
|
-
### fn `function formatPiNotifyEventMenuSummary(` (
|
|
5219
|
+
### fn `function formatPiNotifyEventMenuSummary(` (L2119-2127)
|
|
5200
5220
|
- @brief Formats the top-level summary value for one notification event submenu.
|
|
5201
5221
|
- @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.
|
|
5202
5222
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5204,7 +5224,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5204
5224
|
- @return {string} Compact enabled-toggle summary.
|
|
5205
5225
|
- @satisfies REQ-198
|
|
5206
5226
|
|
|
5207
|
-
### fn `function buildPiNotifyEventLauncherChoice(` (
|
|
5227
|
+
### fn `function buildPiNotifyEventLauncherChoice(` (L2137-2147)
|
|
5208
5228
|
- @brief Builds the top-level launcher row for one notification event submenu.
|
|
5209
5229
|
- @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.
|
|
5210
5230
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5212,7 +5232,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5212
5232
|
- @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
|
|
5213
5233
|
- @satisfies REQ-181, REQ-183, REQ-165, REQ-198
|
|
5214
5234
|
|
|
5215
|
-
### fn `function buildPiNotifyEventMenuChoices(` (
|
|
5235
|
+
### fn `function buildPiNotifyEventMenuChoices(` (L2157-2173)
|
|
5216
5236
|
- @brief Builds the shared settings-menu choices for one notification event submenu.
|
|
5217
5237
|
- @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.
|
|
5218
5238
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5220,7 +5240,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5220
5240
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
|
|
5221
5241
|
- @satisfies REQ-188, REQ-193, REQ-198
|
|
5222
5242
|
|
|
5223
|
-
### fn `function resetPiNotifyEventMenuToDefaults(` (
|
|
5243
|
+
### fn `function resetPiNotifyEventMenuToDefaults(` (L2183-2191)
|
|
5224
5244
|
- @brief Restores one notification event submenu to its documented defaults.
|
|
5225
5245
|
- @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`.
|
|
5226
5246
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
@@ -5228,7 +5248,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5228
5248
|
- @return {void} No return value.
|
|
5229
5249
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195
|
|
5230
5250
|
|
|
5231
|
-
### fn `function resolvePiNotifyEventLabel(` (
|
|
5251
|
+
### fn `function resolvePiNotifyEventLabel(` (L2201-2208)
|
|
5232
5252
|
- @brief Resolves the human-readable event label for one event-toggle config key.
|
|
5233
5253
|
- @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.
|
|
5234
5254
|
- @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
|
|
@@ -5236,7 +5256,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5236
5256
|
- @return {string} Human-readable event label.
|
|
5237
5257
|
- @satisfies REQ-188, REQ-198
|
|
5238
5258
|
|
|
5239
|
-
### fn `async function configurePiNotifyEventMenu(` (
|
|
5259
|
+
### fn `async function configurePiNotifyEventMenu(` (L2219-2295)
|
|
5240
5260
|
- @brief Runs one dedicated notification event submenu.
|
|
5241
5261
|
- @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.
|
|
5242
5262
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5245,14 +5265,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5245
5265
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5246
5266
|
- @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
|
|
5247
5267
|
|
|
5248
|
-
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5268
|
+
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2304-2354)
|
|
5249
5269
|
- @brief Builds the direct Pushover rows rendered inside `Notifications`.
|
|
5250
5270
|
- @details Serializes the global enable flag, shared-event submenu launcher, priority, title, text, and credential rows into right-valued menu items appended after the sound-command rows, dims and disables the enable row until both credentials are populated, renders the locked value as `configure user/token keys first`, and escapes control characters for the single-line `Pushover text` value. Runtime is O(n) in the rendered text-template length. No external state is mutated.
|
|
5251
5271
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5252
5272
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
|
|
5253
5273
|
- @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
|
|
5254
5274
|
|
|
5255
|
-
### fn `async function selectPiNotifyPushoverPriority(` (
|
|
5275
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L2364-2392)
|
|
5256
5276
|
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
5257
5277
|
- @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.
|
|
5258
5278
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5260,14 +5280,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5260
5280
|
- @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
|
|
5261
5281
|
- @satisfies REQ-172, REQ-192
|
|
5262
5282
|
|
|
5263
|
-
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5283
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2401-2459)
|
|
5264
5284
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
5265
5285
|
- @details Serializes command-notify, sound, and Pushover blocks with dedicated shared-event submenu launchers so the settings-menu renderer can expose one unified but modular configuration surface, including locked Pushover enablement, persisted boot-sound rows that stay decoupled from the active runtime sound level, and escaped single-line rendering for `Pushover text`. Runtime is O(n) in the longest rendered command or text field. No external state is mutated.
|
|
5266
5286
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5267
5287
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
5268
5288
|
- @satisfies REQ-137, REQ-149, REQ-150, REQ-151, REQ-152, REQ-163, REQ-164, REQ-165, REQ-172, REQ-179, REQ-181, REQ-183, REQ-188, REQ-193, REQ-198, REQ-234, REQ-235, REQ-289
|
|
5269
5289
|
|
|
5270
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
5290
|
+
### fn `async function selectPiNotifySoundLevel(` (L2469-2509)
|
|
5271
5291
|
- @brief Opens the shared settings-menu selector for the persisted boot sound level.
|
|
5272
5292
|
- @details Reuses the pi-usereq settings-menu renderer so boot-sound selection remains stylistically aligned with the notification menu, keeps the active runtime sound level unchanged, and appends a value-less subtree-local `Reset defaults` row. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
5273
5293
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5275,7 +5295,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5275
5295
|
- @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected boot sound level, reset action, or `undefined` when cancelled.
|
|
5276
5296
|
- @satisfies REQ-131, REQ-179, REQ-192, REQ-289
|
|
5277
5297
|
|
|
5278
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
5298
|
+
### fn `async function configurePiNotifyMenu(` (L2519-2805)
|
|
5279
5299
|
- @brief Runs the interactive notification-configuration menu.
|
|
5280
5300
|
- @details Exposes command-notify, sound, and Pushover controls through the shared settings-menu renderer, persists every notification subtree mutation into global configuration, delegates completed/interrupted/failed toggles to dedicated event submenus, preserves boot-sound edits without altering the active runtime sound level, keeps `Enable pushover` locked until both credentials are populated, decodes escaped control-sequence input for `Pushover text`, and preserves row focus across menu re-renders. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
5281
5301
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5283,7 +5303,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5283
5303
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
5284
5304
|
- @satisfies REQ-131, REQ-133, REQ-134, REQ-137, REQ-163, REQ-164, REQ-165, REQ-172, REQ-179, REQ-181, REQ-183, REQ-184, REQ-188, REQ-192, REQ-193, REQ-195, REQ-196, REQ-198, REQ-234, REQ-235, REQ-288, REQ-289
|
|
5285
5305
|
|
|
5286
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
5306
|
+
### fn `function registerPiNotifyShortcut(` (L2820-2843)
|
|
5287
5307
|
- @brief Registers the configurable notification-sound shortcut when supported.
|
|
5288
5308
|
- @details Loads the current effective config, registers one raw pi shortcut when
|
|
5289
5309
|
the runtime exposes `registerShortcut(...)`, cycles only the active runtime
|
|
@@ -5296,15 +5316,15 @@ registration and status updates.
|
|
|
5296
5316
|
- @return {void} No return value.
|
|
5297
5317
|
- @satisfies REQ-134, REQ-180, REQ-286, REQ-287
|
|
5298
5318
|
|
|
5299
|
-
### fn `function resolveReqResetPromptRequest(` (
|
|
5319
|
+
### fn `function resolveReqResetPromptRequest(` (L2851-2877)
|
|
5300
5320
|
- @brief Resolves the prompt execution plan targeted by `req-reset` recovery.
|
|
5301
5321
|
- @details Prefers the current in-memory active request, then the current in-memory pending request, then the process-scoped persisted prompt runtime state so the dedicated reset command can recover from same-host unclean prompt termination after session replacement. Runtime is O(1). No external state is mutated.
|
|
5302
5322
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5303
5323
|
- @return {PromptCommandExecutionPlan | undefined} Recoverable prompt execution plan when one remains available.
|
|
5304
5324
|
|
|
5305
|
-
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (
|
|
5325
|
+
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2854-2861)
|
|
5306
5326
|
|
|
5307
|
-
### fn `function registerReqResetCommand(` (
|
|
5327
|
+
### fn `function registerReqResetCommand(` (L2887-2941)
|
|
5308
5328
|
- @brief Registers the specialized `req-reset` slash command.
|
|
5309
5329
|
- @details Registers the non-agentic prompt-recovery command that accepts any current workflow state, reuses persisted prompt runtime state when available, restores the original session-backed `base-path`, force-removes matching generated worktrees plus branches, clears recoverable prompt state when restoration succeeds, and notifies pi without starting an LLM session or creating a worktree. Runtime is dominated by session restoration plus git cleanup. Side effects include command registration, status-controller mutation, active-session replacement, worktree deletion, branch deletion, and user notifications.
|
|
5310
5330
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5312,7 +5332,7 @@ registration and status updates.
|
|
|
5312
5332
|
- @return {void} No return value.
|
|
5313
5333
|
- @satisfies REQ-304, REQ-305, REQ-306, REQ-307, REQ-308, REQ-309, REQ-310, REQ-311, REQ-312, REQ-313
|
|
5314
5334
|
|
|
5315
|
-
### fn `function registerReqReferencesCommand(` (
|
|
5335
|
+
### fn `function registerReqReferencesCommand(` (L2951-2991)
|
|
5316
5336
|
- @brief Registers the specialized `req-references` slash command.
|
|
5317
5337
|
- @details Registers the non-agentic references-maintenance command that rejects non-`idle` invocations by transitioning workflow state to `error` before direct execution, otherwise reuses slash-command-owned git validation, transitions workflow state through `checking|running|idle`, regenerates `REFERENCES.md` directly from configured source directories, stages only the generated file, creates the fixed-message git commit, verifies repository cleanliness, and notifies pi without starting an LLM session or creating a worktree. Runtime is dominated by git subprocess execution plus source-summary generation. Side effects include command registration, status-controller mutation, filesystem writes, git index/history mutation, and user notifications.
|
|
5318
5338
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5320,7 +5340,7 @@ registration and status updates.
|
|
|
5320
5340
|
- @return {void} No return value.
|
|
5321
5341
|
- @satisfies REQ-200, REQ-221, REQ-224, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303
|
|
5322
5342
|
|
|
5323
|
-
### fn `function registerPromptCommands(` (
|
|
5343
|
+
### fn `function registerPromptCommands(` (L3001-3117)
|
|
5324
5344
|
- @brief Registers bundled prompt-backed commands with the extension.
|
|
5325
5345
|
- @details Creates one prompt-template-backed `req-<prompt>` command per bundled prompt name. Each handler rejects non-`idle` workflow state by transitioning the shared workflow state to `error` before command-side preflight, otherwise transitions the shared workflow state through `checking`, `error`, and `running`, runs dedicated prompt-command git and required-doc preflight checks, optionally prepares a dedicated worktree execution plan using the active session directory, persists the prompt metadata needed for switch-triggered rebinding, switches the active session to the verified execution cwd before prompt handoff, logs dedicated workflow-activation diagnostics, renders the prompt, starts prompt delivery into the forked active session, records `running` immediately after delivery handoff begins, and then awaits the wrapped prompt-delivery promise whose stale post-restore rejections are suppressed. Runtime is O(p) for registration; handler cost depends on prompt preflight, worktree preparation, session switching, prompt rendering, prompt dispatch, and optional debug logging. Side effects include command registration, status-controller mutation, worktree creation, active-session replacement, optional worktree rollback, user-message delivery during execution, and optional debug-log writes.
|
|
5326
5346
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5328,14 +5348,14 @@ registration and status updates.
|
|
|
5328
5348
|
- @return {void} No return value.
|
|
5329
5349
|
- @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
|
|
5330
5350
|
|
|
5331
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
5351
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3127-3426)
|
|
5332
5352
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
5333
5353
|
- @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.
|
|
5334
5354
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5335
5355
|
- @return {void} No return value.
|
|
5336
5356
|
- @satisfies REQ-005, REQ-010, REQ-011, REQ-014, REQ-017, REQ-044, REQ-069, REQ-070, REQ-071, REQ-072, REQ-073, REQ-074, REQ-075, REQ-076, REQ-077, REQ-078, REQ-079, REQ-080, REQ-089, REQ-090, REQ-091, REQ-092, REQ-093, REQ-094, REQ-095, REQ-096, REQ-097, REQ-098, REQ-099, REQ-100, REQ-101, REQ-102, REQ-293, REQ-294, REQ-295, REQ-296, REQ-297
|
|
5337
5357
|
|
|
5338
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5358
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3471-3496)
|
|
5339
5359
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
5340
5360
|
- @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.
|
|
5341
5361
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5343,7 +5363,7 @@ registration and status updates.
|
|
|
5343
5363
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
5344
5364
|
- @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5345
5365
|
|
|
5346
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5366
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3506-3520)
|
|
5347
5367
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
5348
5368
|
- @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.
|
|
5349
5369
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5351,7 +5371,7 @@ registration and status updates.
|
|
|
5351
5371
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
5352
5372
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
|
|
5353
5373
|
|
|
5354
|
-
### fn `async function configurePiUsereqToolsMenu(` (
|
|
5374
|
+
### fn `async function configurePiUsereqToolsMenu(` (L3531-3648)
|
|
5355
5375
|
- @brief Runs the interactive active-tool configuration menu.
|
|
5356
5376
|
- @details Synchronizes runtime active tools with the effective config, renders startup-tool actions through the shared settings-menu UI, persists enablement changes into global configuration, preserves the documented per-tool ordering, and updates configuration state in response to selections until the user exits. Runtime depends on user interaction count. Side effects include UI updates, active-tool changes, and config mutation.
|
|
5357
5377
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5360,58 +5380,58 @@ registration and status updates.
|
|
|
5360
5380
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5361
5381
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
|
|
5362
5382
|
|
|
5363
|
-
### fn `function getStaticCheckLanguageConfigForMenu(` (
|
|
5383
|
+
### fn `function getStaticCheckLanguageConfigForMenu(` (L3657-3662)
|
|
5364
5384
|
- @brief Resolves one static-check language config for menu rendering.
|
|
5365
5385
|
- @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.
|
|
5366
5386
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5367
5387
|
- @param[in] language {string} Canonical language name.
|
|
5368
5388
|
- @return {StaticCheckLanguageConfig} Resolved per-language config object.
|
|
5369
5389
|
|
|
5370
|
-
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5390
|
+
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3670-3672)
|
|
5371
5391
|
- @brief Counts languages that currently expose at least one configured checker.
|
|
5372
5392
|
- @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.
|
|
5373
5393
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5374
5394
|
- @return {number} Number of languages with at least one configured checker.
|
|
5375
5395
|
|
|
5376
|
-
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5396
|
+
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3680-3682)
|
|
5377
5397
|
- @brief Counts languages whose static-check enable flag is on.
|
|
5378
5398
|
- @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.
|
|
5379
5399
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5380
5400
|
- @return {number} Number of enabled languages.
|
|
5381
5401
|
|
|
5382
|
-
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (
|
|
5402
|
+
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3691-3693)
|
|
5383
5403
|
- @brief Restores the documented static-check default configuration.
|
|
5384
5404
|
- @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`.
|
|
5385
5405
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5386
5406
|
- @return {void} No return value.
|
|
5387
5407
|
- @satisfies REQ-250, REQ-251, REQ-252
|
|
5388
5408
|
|
|
5389
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
5409
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3701-3703)
|
|
5390
5410
|
- @brief Summarizes enabled and configured static-check languages.
|
|
5391
5411
|
- @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.
|
|
5392
5412
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5393
5413
|
- @return {string} Compact summary string.
|
|
5394
5414
|
|
|
5395
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5415
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3712-3744)
|
|
5396
5416
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
5397
5417
|
- @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.
|
|
5398
5418
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5399
5419
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
5400
5420
|
- @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
|
|
5401
5421
|
|
|
5402
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5422
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3752-3769)
|
|
5403
5423
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
5404
5424
|
- @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.
|
|
5405
5425
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5406
5426
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
5407
5427
|
|
|
5408
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5428
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3777-3794)
|
|
5409
5429
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
5410
5430
|
- @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.
|
|
5411
5431
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5412
5432
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
5413
5433
|
|
|
5414
|
-
### fn `async function configureStaticCheckMenu(` (
|
|
5434
|
+
### fn `async function configureStaticCheckMenu(` (L3804-3950)
|
|
5415
5435
|
- @brief Runs the interactive static-check configuration menu.
|
|
5416
5436
|
- @details Lets the user add and remove global Command entries, toggle direct local per-language enable flags, and reset the subtree to documented defaults through the shared settings-menu renderer until the user exits. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
5417
5437
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5419,7 +5439,7 @@ registration and status updates.
|
|
|
5419
5439
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5420
5440
|
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
|
|
5421
5441
|
|
|
5422
|
-
### fn `function buildPiUsereqMenuChoices(` (
|
|
5442
|
+
### fn `function buildPiUsereqMenuChoices(` (L3960-4059)
|
|
5423
5443
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
5424
5444
|
- @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 display-only local plus global config paths. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
5425
5445
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -5427,21 +5447,21 @@ registration and status updates.
|
|
|
5427
5447
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
5428
5448
|
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-162, REQ-190, REQ-191, REQ-197, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-314, REQ-318, REQ-319, REQ-320
|
|
5429
5449
|
|
|
5430
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5450
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4068-4086)
|
|
5431
5451
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
5432
5452
|
- @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.
|
|
5433
5453
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5434
5454
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
5435
5455
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5436
5456
|
|
|
5437
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5457
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4095-4107)
|
|
5438
5458
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
5439
5459
|
- @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.
|
|
5440
5460
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5441
5461
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
5442
5462
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
5443
5463
|
|
|
5444
|
-
### fn `async function configurePiUsereq(` (
|
|
5464
|
+
### fn `async function configurePiUsereq(` (L4118-4371)
|
|
5445
5465
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
5446
5466
|
- @details Loads the effective merged config, exposes docs/test/source/automatic-commit/worktree/static-check/startup-tool/notification/debug actions through the shared settings-menu renderer, forces worktree disablement when automatic git commit is disabled, prevents locked row edits, persists changes on exit, closes immediately after `Show local configuration` or `Show global configuration`, and refreshes the single-line status bar. Runtime depends on user interaction count. Side effects include UI updates, config writes, active-tool changes, and editor text updates.
|
|
5447
5467
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5450,9 +5470,9 @@ registration and status updates.
|
|
|
5450
5470
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
5451
5471
|
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-162, REQ-190, REQ-191, REQ-192, REQ-194, REQ-195, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-314, REQ-318, REQ-319, REQ-320
|
|
5452
5472
|
|
|
5453
|
-
### fn `const persistConfigChange = () =>` (
|
|
5473
|
+
### fn `const persistConfigChange = () =>` (L4129-4134)
|
|
5454
5474
|
|
|
5455
|
-
### fn `function registerConfigCommands(` (
|
|
5475
|
+
### fn `function registerConfigCommands(` (L4381-4391)
|
|
5456
5476
|
- @brief Registers configuration-management commands.
|
|
5457
5477
|
- @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.
|
|
5458
5478
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5460,7 +5480,7 @@ registration and status updates.
|
|
|
5460
5480
|
- @return {void} No return value.
|
|
5461
5481
|
- @satisfies REQ-006, REQ-031
|
|
5462
5482
|
|
|
5463
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
5483
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4400-4413)
|
|
5464
5484
|
- @brief Registers the complete pi-usereq extension.
|
|
5465
5485
|
- @details Validates installation-owned bundled resources, registers the specialized `req-reset` and `req-references` commands plus bundled prompt-backed commands and agent tools, conditionally registers config-gated debug tool wrapper commands when the current project enables them, registers configuration commands, registers the configurable notification-sound shortcut when the runtime supports shortcuts, and installs shared wrappers for all supported pi lifecycle hooks so status telemetry, context usage, prompt timing, cumulative runtime, prompt-specific Pushover metadata, tool-result debug logging, and prompt-orchestration effects remain synchronized with runtime events. Runtime is O(h) in hook count during registration. Side effects include filesystem reads, command/tool/shortcut registration, UI updates, active-tool changes, optional debug-log writes, and timer scheduling.
|
|
5466
5486
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5470,106 +5490,106 @@ registration and status updates.
|
|
|
5470
5490
|
## Symbol Index
|
|
5471
5491
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
5472
5492
|
|---|---|---|---|---|
|
|
5473
|
-
|`PiShortcutRegistrar`|iface||
|
|
5474
|
-
|`getProjectBase`|fn||
|
|
5475
|
-
|`getProcessCwdSafe`|fn||
|
|
5476
|
-
|`resolveLiveBootstrapCwd`|fn||
|
|
5477
|
-
|`syncContextCwdMirror`|fn||
|
|
5478
|
-
|`loadProjectConfig`|fn||
|
|
5479
|
-
|`DebugToolCommandExecuteResult`|type||
|
|
5480
|
-
|`shouldRegisterDebugToolCommands`|fn||
|
|
5481
|
-
|`writeDebugToolCommandResultToEditor`|fn||
|
|
5482
|
-
|`executeDebugToolCommand`|fn||
|
|
5483
|
-
|`registerDebugToolCommands`|fn||
|
|
5484
|
-
|`saveProjectConfig`|fn||
|
|
5485
|
-
|`formatLocalConfigPathForMenu`|fn||
|
|
5486
|
-
|`formatGlobalConfigPathForMenu`|fn||
|
|
5487
|
-
|`buildTerminalSettingsMenuChoices`|fn||
|
|
5488
|
-
|`ResetConfirmationChange`|iface||
|
|
5489
|
-
|`formatResetConfirmationValue`|fn||
|
|
5490
|
-
|`buildResetConfirmationChoices`|fn||
|
|
5491
|
-
|`confirmResetChanges`|fn||
|
|
5492
|
-
|`writePersistedConfigToEditor`|fn||
|
|
5493
|
-
|`writePersistedLocalConfigToEditor`|fn||
|
|
5494
|
-
|`writePersistedGlobalConfigToEditor`|fn||
|
|
5495
|
-
|`buildSearchToolSupportedTagGuidelines`|fn||
|
|
5496
|
-
|`buildSearchToolSchemaDescription`|fn||
|
|
5497
|
-
|`buildSearchToolPromptGuidelines`|fn||
|
|
5498
|
-
|`MonolithicToolRenderResult`|type||
|
|
5499
|
-
|`getMonolithicToolText`|fn||
|
|
5500
|
-
|`getMonolithicToolErrorText`|fn||
|
|
5501
|
-
|`formatCompactToolArgumentValue`|fn||
|
|
5502
|
-
|`buildCompactToolInvocationText`|fn||
|
|
5503
|
-
|`summarizeStructuredToolResult`|fn||
|
|
5504
|
-
|`buildStructuredToolRenderResult`|fn||
|
|
5505
|
-
|`executeMonolithicTool`|fn||
|
|
5506
|
-
|`executeStatusTool`|fn||
|
|
5507
|
-
|`deliverPromptCommand`|fn||
|
|
5508
|
-
|`shouldIgnoreLatePromptDeliveryFailure`|fn||
|
|
5509
|
-
|`logPromptWorkflowStateChange`|fn||
|
|
5510
|
-
|`logPromptWorkflowEvent`|fn||
|
|
5511
|
-
|`transitionPromptWorkflowState`|fn||
|
|
5512
|
-
|`resolvePromptCommandDescription`|fn||
|
|
5513
|
-
|`resolveDebugProjectBase`|fn||
|
|
5514
|
-
|`notifyContextSafely`|fn||
|
|
5515
|
-
|`rejectNonIdleReqCommand`|fn||
|
|
5516
|
-
|`getPiUsereqStartupTools`|fn||
|
|
5517
|
-
|`getConfiguredEnabledPiUsereqTools`|fn||
|
|
5518
|
-
|`applyConfiguredPiUsereqTools`|fn||
|
|
5519
|
-
|`handleExtensionStatusEvent`|fn||
|
|
5520
|
-
|`registerExtensionStatusHooks`|fn||
|
|
5521
|
-
|`setConfiguredPiUsereqTools`|fn||
|
|
5522
|
-
|`getDebugToolToggleNames`|fn||
|
|
5523
|
-
|`resetDebugConfigToDefaults`|fn||
|
|
5524
|
-
|`formatDebugMenuSummary`|fn||
|
|
5525
|
-
|`buildDebugMenuChoice`|fn||
|
|
5526
|
-
|`selectDebugLogOnStatus`|fn||
|
|
5527
|
-
|`buildDebugMenuChoices`|fn||
|
|
5528
|
-
|`configureDebugMenu`|fn||
|
|
5529
|
-
|`updateDebugToolCommandsEnabled`|fn||
|
|
5530
|
-
|`PiNotifyBooleanConfigKey`|type||
|
|
5531
|
-
|`PiNotifyEventBooleanConfigKey`|type||
|
|
5532
|
-
|`PiNotifyEventId`|type||
|
|
5533
|
-
|`PiNotifyEventRowDefinition`|iface||
|
|
5534
|
-
|`PiNotifyEventMenuDefinition`|iface||
|
|
5535
|
-
|`togglePiNotifyFlag`|fn||
|
|
5536
|
-
|`resetPiNotifyConfigToDefaults`|fn||
|
|
5537
|
-
|`formatPiNotifyPushoverPriority`|fn||
|
|
5538
|
-
|`formatPiNotifyEventMenuSummary`|fn||
|
|
5539
|
-
|`buildPiNotifyEventLauncherChoice`|fn||
|
|
5540
|
-
|`buildPiNotifyEventMenuChoices`|fn||
|
|
5541
|
-
|`resetPiNotifyEventMenuToDefaults`|fn||
|
|
5542
|
-
|`resolvePiNotifyEventLabel`|fn||
|
|
5543
|
-
|`configurePiNotifyEventMenu`|fn||
|
|
5544
|
-
|`buildPiNotifyPushoverRows`|fn||
|
|
5545
|
-
|`selectPiNotifyPushoverPriority`|fn||
|
|
5546
|
-
|`buildPiNotifyMenuChoices`|fn||
|
|
5547
|
-
|`selectPiNotifySoundLevel`|fn||
|
|
5548
|
-
|`configurePiNotifyMenu`|fn||
|
|
5549
|
-
|`registerPiNotifyShortcut`|fn||
|
|
5550
|
-
|`resolveReqResetPromptRequest`|fn||
|
|
5551
|
-
|`isWorktreeBacked`|fn||
|
|
5552
|
-
|`registerReqResetCommand`|fn||
|
|
5553
|
-
|`registerReqReferencesCommand`|fn||
|
|
5554
|
-
|`registerPromptCommands`|fn||
|
|
5555
|
-
|`registerAgentTools`|fn||
|
|
5556
|
-
|`buildPiUsereqToolsMenuChoices`|fn||
|
|
5557
|
-
|`buildPiUsereqToolToggleChoices`|fn||
|
|
5558
|
-
|`configurePiUsereqToolsMenu`|fn||
|
|
5559
|
-
|`getStaticCheckLanguageConfigForMenu`|fn||
|
|
5560
|
-
|`countConfiguredStaticCheckLanguages`|fn||
|
|
5561
|
-
|`countEnabledStaticCheckLanguages`|fn||
|
|
5562
|
-
|`resetStaticCheckConfig`|fn||
|
|
5563
|
-
|`formatStaticCheckLanguagesSummary`|fn||
|
|
5564
|
-
|`buildStaticCheckMenuChoices`|fn||
|
|
5565
|
-
|`buildSupportedStaticCheckLanguageChoices`|fn||
|
|
5566
|
-
|`buildConfiguredStaticCheckLanguageChoices`|fn||
|
|
5567
|
-
|`configureStaticCheckMenu`|fn||
|
|
5568
|
-
|`buildPiUsereqMenuChoices`|fn||
|
|
5569
|
-
|`buildSrcDirMenuChoices`|fn||
|
|
5570
|
-
|`buildSrcDirRemovalChoices`|fn||
|
|
5571
|
-
|`configurePiUsereq`|fn||
|
|
5572
|
-
|`persistConfigChange`|fn||
|
|
5573
|
-
|`registerConfigCommands`|fn||
|
|
5574
|
-
|`piUsereqExtension`|fn||
|
|
5493
|
+
|`PiShortcutRegistrar`|iface||181-189|interface PiShortcutRegistrar|
|
|
5494
|
+
|`getProjectBase`|fn||197-206|function getProjectBase(cwd: string): string|
|
|
5495
|
+
|`getProcessCwdSafe`|fn||213-222|function getProcessCwdSafe(): string|
|
|
5496
|
+
|`resolveLiveBootstrapCwd`|fn||230-242|function resolveLiveBootstrapCwd(cwd: string): string|
|
|
5497
|
+
|`syncContextCwdMirror`|fn||251-260|function syncContextCwdMirror(ctx: { cwd?: string }, cwd:...|
|
|
5498
|
+
|`loadProjectConfig`|fn||269-272|function loadProjectConfig(cwd: string): UseReqConfig|
|
|
5499
|
+
|`DebugToolCommandExecuteResult`|type||278||
|
|
5500
|
+
|`shouldRegisterDebugToolCommands`|fn||287-293|function shouldRegisterDebugToolCommands(cwd: string): bo...|
|
|
5501
|
+
|`writeDebugToolCommandResultToEditor`|fn||304-318|function writeDebugToolCommandResultToEditor(|
|
|
5502
|
+
|`executeDebugToolCommand`|fn||330-348|function executeDebugToolCommand(|
|
|
5503
|
+
|`registerDebugToolCommands`|fn||357-396|function registerDebugToolCommands(pi: ExtensionAPI): void|
|
|
5504
|
+
|`saveProjectConfig`|fn||406-409|function saveProjectConfig(cwd: string, config: UseReqCon...|
|
|
5505
|
+
|`formatLocalConfigPathForMenu`|fn||418-422|function formatLocalConfigPathForMenu(cwd: string): string|
|
|
5506
|
+
|`formatGlobalConfigPathForMenu`|fn||430-432|function formatGlobalConfigPathForMenu(): string|
|
|
5507
|
+
|`buildTerminalSettingsMenuChoices`|fn||441-452|function buildTerminalSettingsMenuChoices(options:|
|
|
5508
|
+
|`ResetConfirmationChange`|iface||458-462|interface ResetConfirmationChange|
|
|
5509
|
+
|`formatResetConfirmationValue`|fn||471-473|function formatResetConfirmationValue(previousValue: stri...|
|
|
5510
|
+
|`buildResetConfirmationChoices`|fn||483-522|function buildResetConfirmationChoices(|
|
|
5511
|
+
|`confirmResetChanges`|fn||534-547|async function confirmResetChanges(|
|
|
5512
|
+
|`writePersistedConfigToEditor`|fn||556-561|function writePersistedConfigToEditor(|
|
|
5513
|
+
|`writePersistedLocalConfigToEditor`|fn||571-577|function writePersistedLocalConfigToEditor(|
|
|
5514
|
+
|`writePersistedGlobalConfigToEditor`|fn||586-590|function writePersistedGlobalConfigToEditor(|
|
|
5515
|
+
|`buildSearchToolSupportedTagGuidelines`|fn||651-655|function buildSearchToolSupportedTagGuidelines(): string[]|
|
|
5516
|
+
|`buildSearchToolSchemaDescription`|fn||663-668|function buildSearchToolSchemaDescription(scope: FindTool...|
|
|
5517
|
+
|`buildSearchToolPromptGuidelines`|fn||676-689|function buildSearchToolPromptGuidelines(scope: FindToolS...|
|
|
5518
|
+
|`MonolithicToolRenderResult`|type||695||
|
|
5519
|
+
|`getMonolithicToolText`|fn||712-715|function getMonolithicToolText(result: MonolithicToolRend...|
|
|
5520
|
+
|`getMonolithicToolErrorText`|fn||723-733|function getMonolithicToolErrorText(result: MonolithicToo...|
|
|
5521
|
+
|`formatCompactToolArgumentValue`|fn||741-780|function formatCompactToolArgumentValue(value: unknown): ...|
|
|
5522
|
+
|`buildCompactToolInvocationText`|fn||788-799|function buildCompactToolInvocationText(args: Record<stri...|
|
|
5523
|
+
|`summarizeStructuredToolResult`|fn||809-824|function summarizeStructuredToolResult(|
|
|
5524
|
+
|`buildStructuredToolRenderResult`|fn||833-852|function buildStructuredToolRenderResult(toolName: string)|
|
|
5525
|
+
|`executeMonolithicTool`|fn||860-866|function executeMonolithicTool(operation: () => ToolResul...|
|
|
5526
|
+
|`executeStatusTool`|fn||875-904|function executeStatusTool(operation: () => ToolResult): ...|
|
|
5527
|
+
|`deliverPromptCommand`|fn||915-933|function deliverPromptCommand(|
|
|
5528
|
+
|`shouldIgnoreLatePromptDeliveryFailure`|fn||944-960|function shouldIgnoreLatePromptDeliveryFailure(|
|
|
5529
|
+
|`logPromptWorkflowStateChange`|fn||973-992|function logPromptWorkflowStateChange(|
|
|
5530
|
+
|`logPromptWorkflowEvent`|fn||1008-1028|function logPromptWorkflowEvent(|
|
|
5531
|
+
|`transitionPromptWorkflowState`|fn||1041-1054|function transitionPromptWorkflowState(|
|
|
5532
|
+
|`resolvePromptCommandDescription`|fn||1062-1066|function resolvePromptCommandDescription(|
|
|
5533
|
+
|`resolveDebugProjectBase`|fn||1075-1079|function resolveDebugProjectBase(cwd: string, statusContr...|
|
|
5534
|
+
|`notifyContextSafely`|fn||1090-1107|function notifyContextSafely(|
|
|
5535
|
+
|`rejectNonIdleReqCommand`|fn||1119-1139|function rejectNonIdleReqCommand(|
|
|
5536
|
+
|`getPiUsereqStartupTools`|fn||1148-1156|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
|
|
5537
|
+
|`getConfiguredEnabledPiUsereqTools`|fn||1164-1168|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
|
|
5538
|
+
|`applyConfiguredPiUsereqTools`|fn||1178-1195|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
|
|
5539
|
+
|`handleExtensionStatusEvent`|fn||1208-1479|async function handleExtensionStatusEvent(|
|
|
5540
|
+
|`registerExtensionStatusHooks`|fn||1495-1514|function registerExtensionStatusHooks(|
|
|
5541
|
+
|`setConfiguredPiUsereqTools`|fn||1524-1527|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
|
|
5542
|
+
|`getDebugToolToggleNames`|fn||1535-1537|function getDebugToolToggleNames(): PiUsereqStartupToolNa...|
|
|
5543
|
+
|`resetDebugConfigToDefaults`|fn||1546-1555|function resetDebugConfigToDefaults(config: UseReqConfig)...|
|
|
5544
|
+
|`formatDebugMenuSummary`|fn||1563-1569|function formatDebugMenuSummary(config: UseReqConfig): st...|
|
|
5545
|
+
|`buildDebugMenuChoice`|fn||1579-1592|function buildDebugMenuChoice(|
|
|
5546
|
+
|`selectDebugLogOnStatus`|fn||1601-1629|async function selectDebugLogOnStatus(|
|
|
5547
|
+
|`buildDebugMenuChoices`|fn||1638-1724|function buildDebugMenuChoices(config: UseReqConfig): PiU...|
|
|
5548
|
+
|`configureDebugMenu`|fn||1735-1925|async function configureDebugMenu(|
|
|
5549
|
+
|`updateDebugToolCommandsEnabled`|fn||1741-1748|const updateDebugToolCommandsEnabled = (nextValue: unknow...|
|
|
5550
|
+
|`PiNotifyBooleanConfigKey`|type||1931||
|
|
5551
|
+
|`PiNotifyEventBooleanConfigKey`|type||1948||
|
|
5552
|
+
|`PiNotifyEventId`|type||1957||
|
|
5553
|
+
|`PiNotifyEventRowDefinition`|iface||1963-1967|interface PiNotifyEventRowDefinition|
|
|
5554
|
+
|`PiNotifyEventMenuDefinition`|iface||1973-1979|interface PiNotifyEventMenuDefinition|
|
|
5555
|
+
|`togglePiNotifyFlag`|fn||1988-1991|function togglePiNotifyFlag(config: UseReqConfig, key: Pi...|
|
|
5556
|
+
|`resetPiNotifyConfigToDefaults`|fn||2000-2024|function resetPiNotifyConfigToDefaults(config: UseReqConf...|
|
|
5557
|
+
|`formatPiNotifyPushoverPriority`|fn||2033-2035|function formatPiNotifyPushoverPriority(priority: PiNotif...|
|
|
5558
|
+
|`formatPiNotifyEventMenuSummary`|fn||2119-2127|function formatPiNotifyEventMenuSummary(|
|
|
5559
|
+
|`buildPiNotifyEventLauncherChoice`|fn||2137-2147|function buildPiNotifyEventLauncherChoice(|
|
|
5560
|
+
|`buildPiNotifyEventMenuChoices`|fn||2157-2173|function buildPiNotifyEventMenuChoices(|
|
|
5561
|
+
|`resetPiNotifyEventMenuToDefaults`|fn||2183-2191|function resetPiNotifyEventMenuToDefaults(|
|
|
5562
|
+
|`resolvePiNotifyEventLabel`|fn||2201-2208|function resolvePiNotifyEventLabel(|
|
|
5563
|
+
|`configurePiNotifyEventMenu`|fn||2219-2295|async function configurePiNotifyEventMenu(|
|
|
5564
|
+
|`buildPiNotifyPushoverRows`|fn||2304-2354|function buildPiNotifyPushoverRows(config: UseReqConfig):...|
|
|
5565
|
+
|`selectPiNotifyPushoverPriority`|fn||2364-2392|async function selectPiNotifyPushoverPriority(|
|
|
5566
|
+
|`buildPiNotifyMenuChoices`|fn||2401-2459|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
|
|
5567
|
+
|`selectPiNotifySoundLevel`|fn||2469-2509|async function selectPiNotifySoundLevel(|
|
|
5568
|
+
|`configurePiNotifyMenu`|fn||2519-2805|async function configurePiNotifyMenu(|
|
|
5569
|
+
|`registerPiNotifyShortcut`|fn||2820-2843|function registerPiNotifyShortcut(|
|
|
5570
|
+
|`resolveReqResetPromptRequest`|fn||2851-2877|function resolveReqResetPromptRequest(|
|
|
5571
|
+
|`isWorktreeBacked`|fn||2854-2861|const isWorktreeBacked = (request: PromptCommandExecution...|
|
|
5572
|
+
|`registerReqResetCommand`|fn||2887-2941|function registerReqResetCommand(|
|
|
5573
|
+
|`registerReqReferencesCommand`|fn||2951-2991|function registerReqReferencesCommand(|
|
|
5574
|
+
|`registerPromptCommands`|fn||3001-3117|function registerPromptCommands(|
|
|
5575
|
+
|`registerAgentTools`|fn||3127-3426|function registerAgentTools(pi: ExtensionAPI): void|
|
|
5576
|
+
|`buildPiUsereqToolsMenuChoices`|fn||3471-3496|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
|
|
5577
|
+
|`buildPiUsereqToolToggleChoices`|fn||3506-3520|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
|
|
5578
|
+
|`configurePiUsereqToolsMenu`|fn||3531-3648|async function configurePiUsereqToolsMenu(|
|
|
5579
|
+
|`getStaticCheckLanguageConfigForMenu`|fn||3657-3662|function getStaticCheckLanguageConfigForMenu(|
|
|
5580
|
+
|`countConfiguredStaticCheckLanguages`|fn||3670-3672|function countConfiguredStaticCheckLanguages(config: UseR...|
|
|
5581
|
+
|`countEnabledStaticCheckLanguages`|fn||3680-3682|function countEnabledStaticCheckLanguages(config: UseReqC...|
|
|
5582
|
+
|`resetStaticCheckConfig`|fn||3691-3693|function resetStaticCheckConfig(config: UseReqConfig): void|
|
|
5583
|
+
|`formatStaticCheckLanguagesSummary`|fn||3701-3703|function formatStaticCheckLanguagesSummary(config: UseReq...|
|
|
5584
|
+
|`buildStaticCheckMenuChoices`|fn||3712-3744|function buildStaticCheckMenuChoices(config: UseReqConfig...|
|
|
5585
|
+
|`buildSupportedStaticCheckLanguageChoices`|fn||3752-3769|function buildSupportedStaticCheckLanguageChoices(config:...|
|
|
5586
|
+
|`buildConfiguredStaticCheckLanguageChoices`|fn||3777-3794|function buildConfiguredStaticCheckLanguageChoices(config...|
|
|
5587
|
+
|`configureStaticCheckMenu`|fn||3804-3950|async function configureStaticCheckMenu(|
|
|
5588
|
+
|`buildPiUsereqMenuChoices`|fn||3960-4059|function buildPiUsereqMenuChoices(|
|
|
5589
|
+
|`buildSrcDirMenuChoices`|fn||4068-4086|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
|
|
5590
|
+
|`buildSrcDirRemovalChoices`|fn||4095-4107|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
|
|
5591
|
+
|`configurePiUsereq`|fn||4118-4371|async function configurePiUsereq(|
|
|
5592
|
+
|`persistConfigChange`|fn||4129-4134|const persistConfigChange = () =>|
|
|
5593
|
+
|`registerConfigCommands`|fn||4381-4391|function registerConfigCommands(|
|
|
5594
|
+
|`piUsereqExtension`|fn||4400-4413|export default function piUsereqExtension(pi: ExtensionAP...|
|
|
5575
5595
|
|