pi-usereq 0.34.0 → 0.36.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.
@@ -177,7 +177,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
177
177
  - **REQ-117**: MUST route every intercepted hook through `updateExtensionStatus` with the originating hook name and event payload, even when no hook-specific side effect exists.
178
178
  - **REQ-118**: MUST obtain latest context-usage facts from `ctx.getContextUsage()` or an equivalent runtime API and store them in extension session state.
179
179
  - **REQ-119**: MUST refresh stored context-usage facts during `session_start` and after intercepted events before rebuilding the status bar when newer data is available.
180
- - **REQ-120**: MUST render single-line status fields in this order: `status`, `branch`, `context`, `elapsed`, `sound`.
180
+ - **REQ-120**: MUST render single-line status fields in this order: `<extension>:v<version>`, `status`, `branch`, `context`, `elapsed`, `sound`, deriving `<extension>` and `<version>` from runtime extension package metadata.
181
181
  - **REQ-121**: MUST render `branch` immediately after `status` with separator ` • ` and the active git branch name.
182
182
  - **REQ-283**: MUST resolve `branch` from the current `context-path` git HEAD during every status-bar rebuild so worktree switches and base-path restoration update immediately.
183
183
  - **REQ-284**: MUST render `context` immediately after `branch` with separator ` • ` and one fixed-width gauge icon.
@@ -404,9 +404,9 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
404
404
  - **TST-112**: MUST verify `--enable-static-check` stores checker commands in global configuration and preserves local enablement according to the documented defaulting rules.
405
405
  - **TST-079**: MUST verify `files-static-check` and `static-check` execute zero checkers and expose empty configured-checker lists when the target language `enabled=disable`.
406
406
  - **TST-006**: MUST verify `session_start` activates configured startup tools, resets workflow state to `idle` for `startup|new|reload`, and updates the single-line `pi-usereq` status bar.
407
- - **TST-031**: MUST verify the status bar renders `status` before `branch`, omits `current-path`, `base`, `docs`, `src`, `tests`, `git`, and `tools`, and preserves documented field-value theme separation.
407
+ - **TST-031**: MUST verify the status bar renders runtime `<extension>:v<version>` before `status`, omits `current-path`, `base`, `docs`, `src`, `tests`, `git`, and `tools`, and preserves documented field-value theme separation.
408
408
  - **TST-032**: MUST verify extension registration installs wrappers for all documented lifecycle hooks and routes replayed hook payloads through `updateExtensionStatus`.
409
- - **TST-033**: MUST verify the status bar renders ordered `status`, `branch`, `context`, `elapsed`, and `sound` fields plus the documented icon-based `context` gauge thresholds.
409
+ - **TST-033**: MUST verify the status bar renders ordered `<extension>:v<version>`, `status`, `branch`, `context`, `elapsed`, and `sound` plus the documented icon-based `context` gauge thresholds.
410
410
  - **TST-037**: MUST verify the `Notifications` menu persists notification and boot-sound settings only in global configuration through `Notification events` and `Sound events` submenus using the documented labels and order.
411
411
  - **TST-038**: MUST verify the sound-toggle shortcut cycles only the active runtime sound level, leaves local and global configuration unchanged, and refreshes the status bar with the updated `sound` field.
412
412
  - **TST-097**: MUST verify `session_start` loads the active runtime sound level from persisted `notify-sound`.
@@ -414,7 +414,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
414
414
  - **TST-047**: MUST verify the `Notifications` menu exposes `Pushover events` before direct Pushover settings, keeps `Enable pushover` dimmed and locked until both credential fields are non-empty, and persists Pushover event and credential values only in global configuration.
415
415
  - **TST-072**: MUST verify `Pushover text` displays escaped control sequences in menus and decodes the documented escape sequences from input before persistence.
416
416
  - **TST-048**: MUST verify native Pushover requests honor global enable, completed/interrupted/failed Pushover toggles, credentials, priority, title, and text placeholder substitution including `%%RESULT%%` for enabled prompt-end outcomes.
417
- - **TST-049**: MUST verify the status bar renders ordered `status`, `branch`, `context`, `elapsed`, and `sound` fields and appends `sound:<level>`.
417
+ - **TST-049**: MUST verify the status bar renders ordered `<extension>:v<version>`, `status`, `branch`, `context`, `elapsed`, and `sound` fields and appends `sound:<level>`.
418
418
  - **TST-050**: MUST verify `PI_NOTIFY_CMD` placeholder substitution including `%%RESULT%%` and routing honor global notify enable plus completed/interrupted/failed notify toggles.
419
419
  - **TST-034**: MUST verify `ctx.getContextUsage()` snapshots refresh status updates and `elapsed` preserves `⚑` plus `⌛︎` across escape-triggered cancellation.
420
420
  - **TST-062**: MUST verify `Show local configuration` saves pending local and global config, closes the active configuration menu tree, and writes persisted `<base-path>/.pi-usereq.json` text into the editor.
@@ -503,14 +503,16 @@
503
503
  - `shouldResetWorkflowStateOnSessionStart(...)`: detect `startup|new|reload` workflow-reset boundaries [`src/core/extension-status.ts`]
504
504
  - `persistElapsedState(...)`: mirror completed timers into process-scoped persistence [`src/core/extension-status.ts`]
505
505
  - `syncPiUsereqStatusTicker(...)`: start or stop the live elapsed ticker [`src/core/extension-status.ts`]
506
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
506
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
507
507
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
508
508
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
509
509
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
510
510
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
511
511
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
512
512
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
513
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
513
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
514
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
515
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
514
516
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
515
517
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
516
518
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -587,14 +589,16 @@
587
589
  - `getSettingsListSelectedIndex(...)`: expose the focused row for the offline bridge after inline toggle handling [`src/core/settings-menu.ts`]
588
590
  - `saveProjectConfig(...)`: persist split local/global menu updates [`src/index.ts`]
589
591
  - `setPiUsereqStatusConfig(...)`: cache the saved config for footer rendering [`src/core/extension-status.ts`]
590
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
592
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
591
593
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
592
594
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
593
595
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
594
596
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
595
597
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
596
598
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
597
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, consolidated elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
599
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, consolidated elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
600
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
601
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
598
602
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
599
603
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
600
604
  - `formatContextUsageBar(...)`: render the icon-based context gauge with the non-error status value token below 90 percent and `error` at or above 90 percent [`src/core/extension-status.ts`]
@@ -705,14 +709,16 @@
705
709
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
706
710
  - `setPiUsereqStatusConfig(...)`: cache docs/tests/src and pi-notify values for status rendering [`src/core/extension-status.ts`]
707
711
  - `setPiUsereqWorkflowState(...)`: update workflow state directly for running, idle, or error during `req-reset` execution [`src/core/extension-status.ts`]
708
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
712
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
709
713
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
710
714
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
711
715
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
712
716
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
713
717
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
714
718
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
715
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
719
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
720
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
721
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
716
722
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
717
723
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
718
724
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -749,14 +755,16 @@
749
755
  - `normalizeEnabledPiUsereqTools(...)`: canonicalize startup tools [`src/core/pi-usereq-tools.ts`]
750
756
  - `setPiUsereqStatusConfig(...)`: cache docs/tests/src and pi-notify values for status rendering [`src/core/extension-status.ts`]
751
757
  - `setPiUsereqWorkflowState(...)`: update workflow state directly for checking, running, idle, or error during `req-references` execution [`src/core/extension-status.ts`]
752
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
758
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
753
759
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
754
760
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
755
761
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
756
762
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
757
763
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
758
764
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
759
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
765
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
766
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
767
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
760
768
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
761
769
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
762
770
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -782,14 +790,16 @@
782
790
  - `transitionPromptWorkflowState(...)`: update workflow state and append gated `workflow_state` debug entries only after the transition completes [`src/index.ts`]
783
791
  - `setPiUsereqWorkflowState(...)`: update workflow state before prompt preflight, prompt handoff, or command-side failure [`src/core/extension-status.ts`]
784
792
  - `logPromptWorkflowStateChange(...)`: append selected prompt workflow-transition debug entries [`src/index.ts`]
785
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
793
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
786
794
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
787
795
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
788
796
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
789
797
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
790
798
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
791
799
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
792
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
800
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
801
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
802
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
793
803
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
794
804
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
795
805
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -994,14 +1004,16 @@
994
1004
  - `persistPromptCommandState(...)`: mirror workflow state plus pending or active prompt execution plans into process-scoped persistence [`src/core/extension-status.ts`]
995
1005
  - `writePersistedPromptCommandRuntimeState(...)`: store workflow state plus pending or active prompt execution plans on `globalThis` [`src/core/prompt-command-state.ts`]
996
1006
  - `syncPiUsereqStatusTicker(...)`: start or stop the live elapsed ticker [`src/core/extension-status.ts`]
997
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
1007
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
998
1008
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
999
1009
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
1000
1010
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
1001
1011
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
1002
1012
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
1003
1013
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
1004
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
1014
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
1015
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
1016
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
1005
1017
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
1006
1018
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
1007
1019
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -1054,7 +1066,7 @@
1054
1066
  - `logPromptWorkflowEvent(...)`: append selected workflow-closure and workflow-session-shutdown debug entries [`src/index.ts`]
1055
1067
  - `transitionPromptWorkflowState(...)`: transition workflow state for matched-success merge handling and final idle restoration, and append gated workflow-state debug entries immediately after each transition [`src/index.ts`]
1056
1068
  - `setPiUsereqWorkflowState(...)`: transition workflow state for matched-success merge handling and final idle restoration [`src/core/extension-status.ts`]
1057
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
1069
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer with CLI-theme token overlays [`src/core/extension-status.ts`]
1058
1070
  - `logPromptWorkflowStateChange(...)`: append selected prompt workflow-transition debug entries [`src/index.ts`]
1059
1071
  - `finalizePromptCommandExecution(...)`: verify persisted execution-session header metadata plus live worktree artifacts, synchronize the successful execution transcript into the restored base session, restore the original session-backed base path through the persisted replacement-session context when lifecycle hooks omit `switchSession()`, execute the matched successful stash-assisted `base-path` merge sequence, delete the worktree and branch after merge success, and carry a warning-only closure result when restored `base-path` changes are reapplied [`src/core/prompt-command-runtime.ts`]
1060
1072
  - `verifyPromptCommandClosureArtifacts(...)`: verify execution-session header cwd, worktree registration, branch presence, and worktree-path existence without requiring worktree-session reactivation after prompt end [`src/core/prompt-command-runtime.ts`]
@@ -1141,14 +1153,16 @@
1141
1153
  - `writePersistedGlobalConfigToEditor(...)`: read the already-persisted global config file and write its exact text into the editor [`src/index.ts`]
1142
1154
  - `getGlobalConfigPath(...)`: resolve the persisted global config path [`src/core/config.ts`]
1143
1155
  - `setPiUsereqStatusConfig(...)`: cache the just-saved docs/tests/src and pi-notify values for status rendering [`src/core/extension-status.ts`]
1144
- - `renderPiUsereqStatus(...)`: refresh live context usage and render the status/branch/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
1156
+ - `renderPiUsereqStatus(...)`: refresh live context usage and render the extension/status/branch/context/elapsed/sound footer after save-and-close with CLI-theme token overlays [`src/core/extension-status.ts`]
1145
1157
  - `createStatusThemeAdapter(...)`: constrain status rendering to CLI-supported `accent`, `warning`, `dim`, and `error` theme tokens [`src/core/extension-status.ts`]
1146
1158
  - `resolveStatusBranchValue(...)`: resolve the active git branch from the current context cwd before footer rendering [`src/core/extension-status.ts`]
1147
1159
  - `resolveRuntimeGitBranchName(...)`: resolve the active git branch for the current execution path [`src/core/runtime-project-paths.ts`]
1148
1160
  - `resolveRuntimeGitPath(...)`: resolve the runtime git root for the active execution path [`src/core/runtime-project-paths.ts`]
1149
1161
  - `isInsideGitRepo(...)`: test git work-tree membership [`src/core/runtime-project-paths.ts`]
1150
1162
  - `resolveGitRoot(...)`: resolve repository root [`src/core/runtime-project-paths.ts`]
1151
- - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
1163
+ - `buildPiUsereqStatusText(...)`: compose the single-line footer payload with runtime extension identity, workflow state, branch, context gauge, elapsed semantics, and the active runtime sound status field [`src/core/extension-status.ts`]
1164
+ - `formatExtensionIdentityStatusField(...)`: render the runtime extension name and version prefix using standard non-error status tokens [`src/core/extension-status.ts`]
1165
+ - `getInstallationPackageMetadata(...)`: resolve cached runtime package name and version [`src/core/path-context.ts`]
1152
1166
  - `formatStatusField(...)`: render one colored text field [`src/core/extension-status.ts`]
1153
1167
  - `formatRenderedStatusField(...)`: render one pre-styled field [`src/core/extension-status.ts`]
1154
1168
  - `formatWorkflowStateValue(...)`: render the workflow-state value with error highlighting when required [`src/core/extension-status.ts`]
@@ -20,6 +20,7 @@ import {
20
20
  restorePersistedPromptCommandRuntimeStateForSession,
21
21
  writePersistedPromptCommandRuntimeState,
22
22
  } from "./prompt-command-state.js";
23
+ import { getInstallationPackageMetadata } from "./path-context.js";
23
24
  import { resolveRuntimeGitBranchName } from "./runtime-project-paths.js";
24
25
 
25
26
  /**
@@ -565,9 +566,23 @@ function resolvePiUsereqRuntimeSoundLevel(
565
566
  return state.runtimeSoundLevel ?? config?.["notify-sound"] ?? "none";
566
567
  }
567
568
 
569
+ /**
570
+ * @brief Formats the runtime extension identity prefix for the status bar.
571
+ * @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.
572
+ * @param[in] theme {StatusThemeAdapter} Normalized status theme.
573
+ * @return {string} Rendered extension identity prefix.
574
+ * @satisfies REQ-112, REQ-120
575
+ */
576
+ function formatExtensionIdentityStatusField(
577
+ theme: StatusThemeAdapter,
578
+ ): string {
579
+ const metadata = getInstallationPackageMetadata();
580
+ return `${theme.label(metadata.name)}${theme.value(`v${metadata.version}`)}`;
581
+ }
582
+
568
583
  /**
569
584
  * @brief Builds the full single-line pi-usereq status-bar payload.
570
- * @details Renders status, branch, context, elapsed, and sound fields in the canonical order 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.
585
+ * @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.
571
586
  * @param[in] config {UseReqConfig} Effective project configuration.
572
587
  * @param[in] theme {StatusThemeAdapter} Normalized status theme.
573
588
  * @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
@@ -586,6 +601,7 @@ function buildPiUsereqStatusText(
586
601
  const elapsedText = formatElapsedStatusValue(state, nowMs);
587
602
  const soundText = resolvePiUsereqRuntimeSoundLevel(state, config);
588
603
  return [
604
+ formatExtensionIdentityStatusField(theme),
589
605
  formatRenderedStatusField(
590
606
  theme,
591
607
  "status",
@@ -723,7 +739,7 @@ export function setPiUsereqRuntimeSoundLevel(
723
739
 
724
740
  /**
725
741
  * @brief Renders the current pi-usereq status bar into the active UI context.
726
- * @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.
742
+ * @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.
727
743
  * @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
728
744
  * @param[in] ctx {ExtensionContext} Active extension context.
729
745
  * @return {void} No return value.
@@ -786,7 +802,7 @@ export function setPiUsereqWorkflowState(
786
802
 
787
803
  /**
788
804
  * @brief Updates mutable status state for one intercepted lifecycle hook.
789
- * @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.
805
+ * @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.
790
806
  * @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
791
807
  * @param[in] hookName {PiUsereqStatusHookName} Intercepted hook name.
792
808
  * @param[in] event {unknown} Hook payload forwarded from the wrapper.
@@ -28,6 +28,30 @@ export const GLOBAL_CONFIG_RELATIVE_PATH = ".config/pi-usereq/config.json";
28
28
  */
29
29
  export const RESOURCE_ROOT_DIRNAME = "resources";
30
30
 
31
+ /**
32
+ * @brief Describes the installation package metadata used by runtime status rendering.
33
+ * @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.
34
+ */
35
+ export interface InstallationPackageMetadata {
36
+ name: string;
37
+ version: string;
38
+ }
39
+
40
+ /**
41
+ * @brief Defines the fallback installation package metadata used when `package.json` is unavailable.
42
+ * @details Preserves deterministic footer rendering if the installation-owned package manifest is missing or malformed at runtime. Access complexity is O(1).
43
+ */
44
+ const DEFAULT_INSTALLATION_PACKAGE_METADATA: InstallationPackageMetadata = {
45
+ name: "pi-usereq",
46
+ version: "unknown",
47
+ };
48
+
49
+ /**
50
+ * @brief Caches the parsed installation package metadata for the current process.
51
+ * @details Avoids repeated `package.json` reads while the footer ticker refreshes once per second during active prompt execution. Mutable module-local cache with O(1) access after first resolution.
52
+ */
53
+ let installationPackageMetadataCache: InstallationPackageMetadata | undefined;
54
+
31
55
  /**
32
56
  * @brief Stores the mutable runtime path state shared across extension callbacks.
33
57
  * @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.
@@ -105,6 +129,41 @@ export function getInstallationPath(): string {
105
129
  return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
106
130
  }
107
131
 
132
+ /**
133
+ * @brief Resolves the installation-owned extension package metadata.
134
+ * @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.
135
+ * @return {InstallationPackageMetadata} Cached package name and version used by runtime status rendering.
136
+ */
137
+ export function getInstallationPackageMetadata(): InstallationPackageMetadata {
138
+ if (installationPackageMetadataCache !== undefined) {
139
+ return installationPackageMetadataCache;
140
+ }
141
+ const packageJsonPath = path.resolve(
142
+ getInstallationPath(),
143
+ "..",
144
+ "package.json",
145
+ );
146
+ try {
147
+ const packageJson = JSON.parse(
148
+ fs.readFileSync(packageJsonPath, "utf8"),
149
+ ) as { name?: unknown; version?: unknown };
150
+ const name = typeof packageJson.name === "string"
151
+ ? packageJson.name.trim()
152
+ : "";
153
+ const version = typeof packageJson.version === "string"
154
+ ? packageJson.version.trim()
155
+ : "";
156
+ if (name !== "" && version !== "") {
157
+ installationPackageMetadataCache = { name, version };
158
+ return installationPackageMetadataCache;
159
+ }
160
+ } catch {
161
+ // Fallback handled below.
162
+ }
163
+ installationPackageMetadataCache = { ...DEFAULT_INSTALLATION_PACKAGE_METADATA };
164
+ return installationPackageMetadataCache;
165
+ }
166
+
108
167
  /**
109
168
  * @brief Formats one path with slash separators.
110
169
  * @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.
package/src/index.ts CHANGED
@@ -5,10 +5,10 @@
5
5
  */
6
6
 
7
7
  /**
8
- * @brief Declares the extension version string.
9
- * @details The value is exported for external inspection and packaging metadata alignment. Access complexity is O(1).
8
+ * @brief Declares the runtime extension version string.
9
+ * @details Reads the installed package metadata during module evaluation so exported version consumers stay aligned with the extension payload loaded by pi. Access complexity is O(1) after the cached metadata is initialized.
10
10
  */
11
- export const VERSION = "0.34.0";
11
+ export const VERSION = getInstallationPackageMetadata().version;
12
12
 
13
13
  import fs from "node:fs";
14
14
  import path from "node:path";
@@ -67,6 +67,7 @@ import {
67
67
  import {
68
68
  bootstrapRuntimePathState,
69
69
  formatRuntimePathForDisplay,
70
+ getInstallationPackageMetadata,
70
71
  getRuntimeBasePath,
71
72
  getRuntimeContextPath,
72
73
  setRuntimeGitPath,
@@ -475,10 +475,39 @@ function buildExpectedFakeContextBar(options: {
475
475
  return formatFakeThemeForeground("warning", "▕█▏");
476
476
  }
477
477
 
478
+ /**
479
+ * @brief Reads the repository package manifest fields used by status-bar tests.
480
+ * @details Loads `../package.json` relative to this test module so status-bar assertions derive the expected runtime extension name and version from repository metadata instead of hard-coded literals. Runtime is O(n) in file size. Side effects are limited to one filesystem read.
481
+ * @return {{ name: string; version: string }} Expected runtime extension package metadata.
482
+ */
483
+ function readExpectedRuntimeExtensionMetadata(): { name: string; version: string } {
484
+ const packageJson = JSON.parse(
485
+ fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"),
486
+ ) as { name?: unknown; version?: unknown };
487
+ return {
488
+ name: typeof packageJson.name === "string" && packageJson.name.trim() !== ""
489
+ ? packageJson.name.trim()
490
+ : "pi-usereq",
491
+ version: typeof packageJson.version === "string" && packageJson.version.trim() !== ""
492
+ ? packageJson.version.trim()
493
+ : "unknown",
494
+ };
495
+ }
496
+
497
+ /**
498
+ * @brief Builds the expected fake runtime extension identity prefix for status assertions.
499
+ * @details Renders `<extension>:v<version>` using the same accent-label and warning-value markers consumed by the fake status theme so prefix assertions remain aligned with runtime package metadata. Runtime is O(n) in rendered text length. No external state is mutated.
500
+ * @return {string} Encoded extension identity prefix.
501
+ */
502
+ function buildExpectedFakeExtensionIdentityStatusField(): string {
503
+ const metadata = readExpectedRuntimeExtensionMetadata();
504
+ return `${formatFakeThemeForeground("accent", `${metadata.name}:`)}${formatFakeThemeForeground("warning", `v${metadata.version}`)}`;
505
+ }
506
+
478
507
  /**
479
508
  * @brief Builds the expected fake pi-usereq status-bar string for assertions.
480
- * @details Reconstructs the field order, workflow-state highlighting, branch field, icon-based context gauge, consolidated elapsed field, and sound field emitted by the extension using deterministic fake theme markers. Runtime is O(1) plus optional git execution for branch discovery. No external state is mutated.
481
- * @param[in] options {{ workflowState?: string; basePath?: string; contextFilledCells: number; contextPercent?: number | null; et: string; sound?: string }} Expected status facts for rendered `status`, `branch`, `context`, `elapsed`, and `sound` fields.
509
+ * @details Reconstructs the runtime extension identity prefix, workflow-state highlighting, branch field, icon-based context gauge, consolidated elapsed field, and sound field emitted by the extension using deterministic fake theme markers. Runtime is O(1) plus optional git execution for branch discovery. No external state is mutated.
510
+ * @param[in] options {{ workflowState?: string; basePath?: string; contextFilledCells: number; contextPercent?: number | null; et: string; sound?: string }} Expected status facts for rendered runtime extension prefix, `status`, `branch`, `context`, `elapsed`, and `sound` fields.
482
511
  * @return {string} Encoded status-bar string.
483
512
  */
484
513
  function buildExpectedFakeStatusText(options: {
@@ -504,6 +533,7 @@ function buildExpectedFakeStatusText(options: {
504
533
  percent: options.contextPercent,
505
534
  });
506
535
  return [
536
+ buildExpectedFakeExtensionIdentityStatusField(),
507
537
  `${formatFakeThemeForeground("accent", "status:")}${workflowStateValue}`,
508
538
  buildField("branch", branchValue),
509
539
  `${formatFakeThemeForeground("accent", "context:")}${contextBar}`,
@@ -5025,6 +5055,27 @@ test("session_start applies configured pi-usereq startup tools", async () => {
5025
5055
  );
5026
5056
  });
5027
5057
 
5058
+ /**
5059
+ * @brief Verifies the status bar prepends runtime extension identity before the `status` field.
5060
+ * @details Emits `session_start`, reads the rendered footer text, and asserts the prefix starts with the runtime package name plus `v<version>` before `status:` using the same accent-label and warning-value markers used by other non-error status fields. Runtime is O(1). Side effects are limited to temporary filesystem mutation and in-memory status capture.
5061
+ * @return {Promise<void>} Promise resolved after the status-prefix assertion completes.
5062
+ * @throws {AssertionError} Throws when the footer omits or misorders the runtime extension identity prefix.
5063
+ * @satisfies TST-031, TST-033, TST-049
5064
+ */
5065
+ test("session_start status bar prepends runtime extension identity before status", async () => {
5066
+ const cwd = createTempDir("pi-usereq-extension-identity-status-");
5067
+ fs.mkdirSync(path.dirname(getProjectConfigPath(cwd)), { recursive: true });
5068
+ const pi = createFakePi();
5069
+ piUsereqExtension(pi);
5070
+ const ctx = createFakeCtx(cwd);
5071
+
5072
+ await pi.emit("session_start", { reason: "startup" }, ctx);
5073
+
5074
+ const statusText = ctx.__state.statuses.get("pi-usereq") ?? "";
5075
+ const expectedPrefix = `${buildExpectedFakeExtensionIdentityStatusField()}${formatFakeThemeForeground("dim", " • ")}${formatFakeThemeForeground("accent", "status:")}`;
5076
+ assert.ok(statusText.startsWith(expectedPrefix));
5077
+ });
5078
+
5028
5079
  test("session_start renders the 0-percent context icon when context usage is empty", async () => {
5029
5080
  const cwd = createTempDir("pi-usereq-context-empty-status-");
5030
5081
  fs.mkdirSync(path.dirname(getProjectConfigPath(cwd)), { recursive: true });