pi-usereq 0.37.0 → 0.39.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.
@@ -581,7 +581,7 @@ import { buildLanguageSpecs } from "./source-analyzer.js";
581
581
 
582
582
  ---
583
583
 
584
- # config.ts | TypeScript | 1153L | 43 symbols | 8 imports | 52 comments
584
+ # config.ts | TypeScript | 1192L | 44 symbols | 8 imports | 54 comments
585
585
  > Path: `src/core/config.ts`
586
586
  - @brief Loads, normalizes, merges, and persists pi-usereq configuration.
587
587
  - @details Defines the effective configuration schema, split local/global persistence contracts, JSON serialization helpers, and prompt placeholder expansion paths. Runtime is dominated by filesystem reads and writes plus linear normalization over configured entries. Side effects include config-file persistence under `.pi-usereq.json` and `~/.config/pi-usereq/config.json`.
@@ -611,76 +611,83 @@ import { makeRelativeIfContainsProject } from "./utils.js";
611
611
  - @brief Describes one persisted per-language static-check configuration object.
612
612
  - @details Couples the per-language enable flag with the ordered checker-entry list so menu toggles, config serialization, and execution dispatch can distinguish configured-but-disabled languages from enabled active checker lists. The interface is compile-time only and introduces no runtime cost.
613
613
 
614
- ### iface `export interface UseReqConfig` (L83-122)
614
+ ### iface `export interface UseReqConfig` (L83-125)
615
615
  - @brief Defines the effective pi-usereq configuration schema.
616
616
  - @details Captures the merged runtime view produced from project-local and cross-project persisted scopes, including documentation paths, source/test directory selection, per-language static-check enablement plus checker configuration, prompt-command worktree settings, enabled startup tools, and notification settings while excluding runtime-derived path metadata. The interface is compile-time only and introduces no runtime side effects.
617
617
 
618
- ### iface `interface LocalStaticCheckLanguageConfig` (L128-130)
618
+ ### iface `interface LocalStaticCheckLanguageConfig` (L131-133)
619
619
  - @brief Defines one persisted local static-check language configuration.
620
620
  - @details Stores only the project-local enable flag so checker command definitions can live exclusively in global configuration. The interface is compile-time only and introduces no runtime cost.
621
621
 
622
- ### iface `interface GlobalStaticCheckLanguageConfig` (L136-138)
622
+ ### iface `interface GlobalStaticCheckLanguageConfig` (L139-141)
623
623
  - @brief Defines one persisted global static-check language configuration.
624
624
  - @details Stores only the cross-project checker-entry array so project-local files do not duplicate command definitions. The interface is compile-time only and introduces no runtime cost.
625
625
 
626
- ### iface `interface UseReqLocalConfig` (L144-157)
626
+ ### iface `interface UseReqLocalConfig` (L147-163)
627
627
  - @brief Defines the persisted local pi-usereq configuration schema.
628
628
  - @details Captures project-scoped directory, debug, and static-check enablement fields written to `<base-path>/.pi-usereq.json` while excluding global notification, tool, git, and checker-command settings. The interface is compile-time only and introduces no runtime side effects.
629
629
 
630
- ### iface `interface UseReqGlobalConfig` (L163-191)
630
+ ### iface `interface UseReqGlobalConfig` (L169-197)
631
631
  - @brief Defines the persisted global pi-usereq configuration schema.
632
632
  - @details Captures cross-project static-check checker commands, enabled tool names, git automation fields, and notification settings written to `~/.config/pi-usereq/config.json` while excluding project-local directory and debug fields. The interface is compile-time only and introduces no runtime side effects.
633
633
 
634
- ### fn `function cloneStaticCheckEntry(entry: StaticCheckEntry): StaticCheckEntry` (L308-317)
634
+ ### fn `export function normalizeContextFilesFlag(value: unknown): boolean` (L229-231)
635
+ - @brief Normalizes one persisted context-file injection flag.
636
+ - @details Returns the documented default (`true`) for missing or non-boolean values and preserves only explicit boolean input, so any malformed persisted entry keeps context-file injection enabled. Runtime is O(1). No external state is mutated.
637
+ - @param[in] value {unknown} Candidate persisted context-file flag.
638
+ - @return {boolean} Normalized context-file injection flag.
639
+ - @satisfies REQ-328
640
+
641
+ ### fn `function cloneStaticCheckEntry(entry: StaticCheckEntry): StaticCheckEntry` (L331-340)
635
642
  - @brief Clones one static-check entry into its persisted shape.
636
643
  - @details Copies only the stable module, cmd, and params fields so runtime-only or unknown metadata never leaks into persisted configuration payloads. Runtime is O(p) in parameter count. No external state is mutated.
637
644
  - @param[in] entry {StaticCheckEntry} Source static-check entry.
638
645
  - @return {StaticCheckEntry} Persistable static-check entry clone.
639
646
 
640
- ### fn `export function createStaticCheckLanguageConfig(` (L326-335)
647
+ ### fn `export function createStaticCheckLanguageConfig(` (L349-358)
641
648
  - @brief Builds one per-language static-check configuration object.
642
649
  - @details Clones the supplied checker entries, derives `enabled` from the explicit argument or checker-list emptiness, and preserves checker order for menu and dispatch determinism. Runtime is O(c + p). No external state is mutated.
643
650
  - @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
644
651
  - @param[in] enabled {StaticCheckEnabled | undefined} Optional explicit enable flag.
645
652
  - @return {StaticCheckLanguageConfig} Normalized per-language config object.
646
653
 
647
- ### fn `function createLocalStaticCheckLanguageConfig(` (L343-347)
654
+ ### fn `function createLocalStaticCheckLanguageConfig(` (L366-370)
648
655
  - @brief Builds one persisted local static-check language configuration object.
649
656
  - @details Stores only the normalized enable flag so local project files do not duplicate checker command definitions. Runtime is O(1). No external state is mutated.
650
657
  - @param[in] enabled {StaticCheckEnabled} Canonical per-language enable flag.
651
658
  - @return {LocalStaticCheckLanguageConfig} Persistable local static-check language config.
652
659
 
653
- ### fn `function createGlobalStaticCheckLanguageConfig(` (L355-361)
660
+ ### fn `function createGlobalStaticCheckLanguageConfig(` (L378-384)
654
661
  - @brief Builds one persisted global static-check language configuration object.
655
662
  - @details Clones the supplied checker entries so global configuration retains only stable module, command, and parameter fields. Runtime is O(c + p). No external state is mutated.
656
663
  - @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
657
664
  - @return {GlobalStaticCheckLanguageConfig} Persistable global static-check language config.
658
665
 
659
- ### fn `function getDefaultGlobalStaticCheckConfig(): Record<string, GlobalStaticCheckLanguageConfig>` (L368-373)
666
+ ### fn `function getDefaultGlobalStaticCheckConfig(): Record<string, GlobalStaticCheckLanguageConfig>` (L391-396)
660
667
  - @brief Returns the documented default global static-check checker map.
661
668
  - @details Emits one checker-array object for every supported language, preserving documented Command entries for default-enabled languages and `[]` for every other language. Runtime is O(l + c). No external state is mutated.
662
669
  - @return {Record<string, GlobalStaticCheckLanguageConfig>} Fresh default global checker map.
663
670
 
664
- ### fn `function getDefaultLocalStaticCheckConfig(` (L381-390)
671
+ ### fn `function getDefaultLocalStaticCheckConfig(` (L404-413)
665
672
  - @brief Returns the documented default local static-check enable map.
666
673
  - @details Derives each per-language enable flag from the supplied global checker definitions using the rule `enable` when `checkers` is non-empty and `disable` otherwise. Runtime is O(l). No external state is mutated.
667
674
  - @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker map used to derive default enablement.
668
675
  - @return {Record<string, LocalStaticCheckLanguageConfig>} Fresh default local enable map.
669
676
 
670
- ### fn `function mergeStaticCheckConfig(` (L399-418)
677
+ ### fn `function mergeStaticCheckConfig(` (L422-441)
671
678
  - @brief Merges local enable flags with global checker definitions into the effective static-check map.
672
679
  - @details Unifies all language keys present in either persisted scope, applies the default-enable rule when the local scope omits a language, and clones checker entries into the effective runtime config. Runtime is O(l + c + p). No external state is mutated.
673
680
  - @param[in] localStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Persisted local enable map.
674
681
  - @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Persisted global checker map.
675
682
  - @return {Record<string, StaticCheckLanguageConfig>} Effective per-language static-check config.
676
683
 
677
- ### fn `export function getDefaultStaticCheckConfig(): Record<string, StaticCheckLanguageConfig>` (L426-432)
684
+ ### fn `export function getDefaultStaticCheckConfig(): Record<string, StaticCheckLanguageConfig>` (L449-455)
678
685
  - @brief Returns the documented default static-check configuration.
679
686
  - @details Emits one effective per-language config object for every supported language by merging documented global checker defaults with derived local enable defaults. Runtime is O(l + c). No external state is mutated.
680
687
  - @return {Record<string, StaticCheckLanguageConfig>} Fresh default effective static-check config.
681
688
  - @satisfies REQ-249, REQ-250, REQ-251, REQ-252, REQ-316
682
689
 
683
- ### fn `export function normalizeStaticCheckEnabled(` (L442-447)
690
+ ### fn `export function normalizeStaticCheckEnabled(` (L465-470)
684
691
  - @brief Normalizes one persisted per-language static-check enable flag.
685
692
  - @details Accepts only the documented `enable|disable` values and falls back to the supplied default when the candidate is absent or invalid. Runtime is O(1). No external state is mutated.
686
693
  - @param[in] value {unknown} Candidate persisted enable flag.
@@ -688,7 +695,7 @@ import { makeRelativeIfContainsProject } from "./utils.js";
688
695
  - @return {StaticCheckEnabled} Canonical per-language enable flag.
689
696
  - @satisfies REQ-249
690
697
 
691
- ### fn `export function getActiveStaticCheckEntries(` (L457-466)
698
+ ### fn `export function getActiveStaticCheckEntries(` (L480-489)
692
699
  - @brief Resolves the active checker list for one language.
693
700
  - @details Returns the persisted checker list only when the language is enabled; disabled or missing languages yield an empty list without mutating the source config. Runtime is O(c). No external state is mutated.
694
701
  - @param[in] staticCheckConfig {Record<string, StaticCheckLanguageConfig>} Effective static-check config.
@@ -696,21 +703,21 @@ import { makeRelativeIfContainsProject } from "./utils.js";
696
703
  - @return {StaticCheckEntry[]} Active checker list for the language.
697
704
  - @satisfies REQ-019
698
705
 
699
- ### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (L481-483)
706
+ ### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (L504-506)
700
707
  - @brief Normalizes one persisted automatic git-commit mode value.
701
708
  - @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_AUTO_GIT_COMMIT` for all other payloads. Runtime is O(1). No side effects occur.
702
709
  - @param[in] value {unknown} Candidate persisted automatic git-commit payload.
703
710
  - @return {"enable" | "disable"} Canonical automatic git-commit mode.
704
711
  - @satisfies REQ-212
705
712
 
706
- ### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (L497-499)
713
+ ### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (L520-522)
707
714
  - @brief Normalizes one persisted worktree-enable flag value.
708
715
  - @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_GIT_WORKTREE_ENABLED` for all other payloads. Runtime is O(1). No side effects occur.
709
716
  - @param[in] value {unknown} Candidate persisted worktree-enable payload.
710
717
  - @return {"enable" | "disable"} Canonical persisted worktree-enable mode.
711
718
  - @satisfies REQ-204
712
719
 
713
- ### fn `export function resolveEffectiveGitWorktreeEnabled(` (L508-513)
720
+ ### fn `export function resolveEffectiveGitWorktreeEnabled(` (L531-536)
714
721
  - @brief Resolves the effective worktree mode after automatic-commit policy is applied.
715
722
  - @details Forces `disable` whenever `AUTO_GIT_COMMIT` is disabled; otherwise preserves the normalized persisted worktree flag. Runtime is O(1). No side effects occur.
716
723
  - @param[in] autoGitCommit {"enable" | "disable"} Effective automatic git-commit mode.
@@ -718,64 +725,65 @@ import { makeRelativeIfContainsProject } from "./utils.js";
718
725
  - @return {"enable" | "disable"} Effective worktree mode used by menus, persistence, and prompt execution.
719
726
  - @satisfies REQ-204, REQ-215
720
727
 
721
- ### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (L527-533)
728
+ ### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (L550-556)
722
729
  - @brief Normalizes one persisted worktree-name prefix value.
723
730
  - @details Accepts only non-empty strings, trims surrounding whitespace, and falls back to `DEFAULT_GIT_WORKTREE_PREFIX` when the candidate is absent or blank. Runtime is O(n) in prefix length. No side effects occur.
724
731
  - @param[in] value {unknown} Candidate persisted prefix payload.
725
732
  - @return {string} Canonical worktree-name prefix.
726
733
  - @satisfies REQ-205
727
734
 
728
- ### fn `export function getProjectConfigPath(projectBase: string): string` (L540-542)
735
+ ### fn `export function getProjectConfigPath(projectBase: string): string` (L563-565)
729
736
  - @brief Computes the per-project local config file path.
730
737
  - @details Joins the project base with `.pi-usereq.json`, producing the canonical local persistence location used by CLI and extension code. Time complexity is O(1). No I/O side effects occur.
731
738
  - @param[in] projectBase {string} Absolute project root path.
732
739
  - @return {string} Absolute local config file path.
733
740
 
734
- ### fn `export function getGlobalConfigPath(): string` (L549-551)
741
+ ### fn `export function getGlobalConfigPath(): string` (L572-574)
735
742
  - @brief Computes the cross-project global config file path.
736
743
  - @details Resolves `~/.config/pi-usereq/config.json` through the shared runtime path helper so CLI and extension code use one canonical global persistence location. Time complexity is O(1). No I/O side effects occur.
737
744
  - @return {string} Absolute global config file path.
738
745
 
739
- ### fn `function getDefaultLocalConfig(` (L560-577)
746
+ ### fn `function getDefaultLocalConfig(` (L583-603)
740
747
  - @brief Builds the default persisted local configuration.
741
748
  - @details Populates canonical docs/test/source directories, derives local static-check enable defaults from the supplied global checker definitions, and seeds documented debug defaults including tool-wrapper command registration without any cross-project fields. Runtime is O(l). No filesystem side effects occur.
742
749
  - @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker definitions used to derive local enable defaults.
743
750
  - @return {UseReqLocalConfig} Fresh default local configuration object.
744
- - @satisfies CTN-019
751
+ - @satisfies CTN-019, REQ-328
745
752
 
746
- ### fn `function getDefaultGlobalConfig(): UseReqGlobalConfig` (L584-614)
753
+ ### fn `function getDefaultGlobalConfig(): UseReqGlobalConfig` (L610-640)
747
754
  - @brief Builds the default persisted global configuration.
748
755
  - @details Populates documented cross-project static-check checker commands, enabled tools, git automation fields, and notification defaults without any project-local directory or debug fields. Runtime is O(l + c). No filesystem side effects occur.
749
756
  - @return {UseReqGlobalConfig} Fresh default global configuration object.
750
757
 
751
- ### fn `function mergeConfigScopes(` (L623-690)
758
+ ### fn `function mergeConfigScopes(` (L650-720)
752
759
  - @brief Merges persisted local and global configuration scopes into the effective runtime config.
753
760
  - @details Normalizes local directories, combines local static-check enable flags with global checker arrays, resolves effective worktree disablement when automatic git commit is off, normalizes debug and notification fields including tool-wrapper command registration, and disables Pushover until both credentials are populated. Runtime is O(l + c + p). No external state is mutated.
754
761
  - @param[in] localConfig {UseReqLocalConfig} Persisted local configuration.
755
762
  - @param[in] globalConfig {UseReqGlobalConfig} Persisted global configuration.
756
763
  - @return {UseReqConfig} Effective merged configuration.
764
+ - @satisfies REQ-328
757
765
 
758
- ### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (L699-705)
766
+ ### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (L729-735)
759
767
  - @brief Builds the default effective configuration.
760
768
  - @details Composes documented local and global defaults, then merges them into the effective runtime config consumed by CLI and extension code. Time complexity is O(l + c). No filesystem side effects occur.
761
769
  - @param[in] _projectBase {string} Absolute project root path retained for stable call sites.
762
770
  - @return {UseReqConfig} Fresh default effective configuration object.
763
771
  - @satisfies CTN-001, CTN-012, CTN-013, CTN-018, CTN-019, REQ-066, REQ-137, REQ-146, REQ-163, REQ-174, REQ-178, REQ-184, REQ-185, REQ-196, REQ-204, REQ-205, REQ-212, REQ-236, REQ-237, REQ-238, REQ-239, REQ-249, REQ-250, REQ-251, REQ-252, REQ-277, REQ-315, REQ-316
764
772
 
765
- ### fn `function normalizeStaticCheckEntries(value: unknown): StaticCheckEntry[]` (L713-733)
773
+ ### fn `function normalizeStaticCheckEntries(value: unknown): StaticCheckEntry[]` (L743-763)
766
774
  - @brief Normalizes one raw checker-entry array from persisted config.
767
775
  - @details Accepts only object entries with a non-empty module string, trims optional command text, filters blank params, and drops malformed records without applying any legacy schema migrations. Runtime is O(c + p). No external state is mutated.
768
776
  - @param[in] value {unknown} Candidate persisted checker array.
769
777
  - @return {StaticCheckEntry[]} Normalized checker-entry vector.
770
778
 
771
- ### fn `function readConfigPayload(configPath: string): Record<string, unknown> | undefined` (L742-758)
779
+ ### fn `function readConfigPayload(configPath: string): Record<string, unknown> | undefined` (L772-788)
772
780
  - @brief Reads and validates one persisted config payload.
773
781
  - @details Returns `undefined` when the target file does not exist. Otherwise parses UTF-8 JSON, rejects array or primitive payloads, and surfaces deterministic `ReqError` diagnostics keyed by the exact path. Runtime is O(n) in file size. Side effects are limited to filesystem reads.
774
782
  - @param[in] configPath {string} Absolute config file path.
775
783
  - @return {Record<string, unknown> | undefined} Parsed object payload or `undefined` when the file is absent.
776
784
  - @throws {ReqError} Throws with exit code `11` when the config file contains invalid JSON or a non-object payload.
777
785
 
778
- ### fn `function normalizeLocalStaticCheckConfig(` (L768-792)
786
+ ### fn `function normalizeLocalStaticCheckConfig(` (L798-822)
779
787
  - @brief Normalizes the persisted local static-check enable map.
780
788
  - @details Starts from the supplied default enable map, accepts only object-valued language entries, reads only `enabled`, and ignores misplaced checker arrays or legacy non-object payloads without migration. Runtime is O(l). No external state is mutated.
781
789
  - @param[in] value {unknown} Candidate persisted local static-check payload.
@@ -783,27 +791,27 @@ import { makeRelativeIfContainsProject } from "./utils.js";
783
791
  - @return {Record<string, LocalStaticCheckLanguageConfig>} Normalized local static-check enable map.
784
792
  - @satisfies REQ-249, REQ-316
785
793
 
786
- ### fn `function normalizeGlobalStaticCheckConfig(` (L801-818)
794
+ ### fn `function normalizeGlobalStaticCheckConfig(` (L831-848)
787
795
  - @brief Normalizes the persisted global static-check checker map.
788
796
  - @details Starts from documented global checker defaults, accepts only object-valued language entries, reads only `checkers`, and ignores misplaced local enable flags or legacy non-object payloads without migration. Runtime is O(l + c + p). No external state is mutated.
789
797
  - @param[in] value {unknown} Candidate persisted global static-check payload.
790
798
  - @return {Record<string, GlobalStaticCheckLanguageConfig>} Normalized global static-check checker map.
791
799
  - @satisfies REQ-249, REQ-250, REQ-251, REQ-252
792
800
 
793
- ### fn `function loadLocalConfig(` (L828-876)
801
+ ### fn `function loadLocalConfig(` (L858-912)
794
802
  - @brief Loads and sanitizes the persisted local configuration.
795
803
  - @details Returns defaults when `<base-path>/.pi-usereq.json` is absent. Otherwise parses the local JSON payload, normalizes project-scoped directory, debug, tool-wrapper command registration, and static-check enable fields, and ignores misplaced global keys without migration. Runtime is O(n) in file size. Side effects are limited to filesystem reads.
796
804
  - @param[in] projectBase {string} Absolute project root path.
797
805
  - @param[in] defaultStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Local static-check enable defaults derived from the current global checker map.
798
806
  - @return {UseReqLocalConfig} Sanitized local configuration.
799
- - @satisfies CTN-019
807
+ - @satisfies CTN-019, REQ-328
800
808
 
801
- ### fn `function loadGlobalConfig(): UseReqGlobalConfig` (L883-924)
809
+ ### fn `function loadGlobalConfig(): UseReqGlobalConfig` (L919-960)
802
810
  - @brief Loads and sanitizes the persisted global configuration.
803
811
  - @details Returns defaults when `~/.config/pi-usereq/config.json` is absent. Otherwise parses the global JSON payload, normalizes cross-project checker, tool, git, and notification fields, and ignores misplaced local keys without migration. Runtime is O(n) in file size. Side effects are limited to filesystem reads.
804
812
  - @return {UseReqGlobalConfig} Sanitized global configuration.
805
813
 
806
- ### fn `export function loadConfig(projectBase: string): UseReqConfig` (L934-941)
814
+ ### fn `export function loadConfig(projectBase: string): UseReqConfig` (L970-977)
807
815
  - @brief Loads and sanitizes the effective merged configuration.
808
816
  - @details Loads global configuration first so local static-check enable defaults can be derived from the active global checker map, then merges both scopes into the effective runtime config without applying legacy single-file migrations. Runtime is O(n) in combined local and global config size. Side effects are limited to filesystem reads.
809
817
  - @param[in] projectBase {string} Absolute project root path.
@@ -811,28 +819,28 @@ import { makeRelativeIfContainsProject } from "./utils.js";
811
819
  - @throws {ReqError} Throws with exit code `11` when either persisted config file contains invalid JSON or a non-object payload.
812
820
  - @satisfies CTN-012, CTN-013, CTN-018, CTN-019, REQ-066, REQ-137, REQ-146, REQ-163, REQ-174, REQ-178, REQ-184, REQ-185, REQ-196, REQ-204, REQ-205, REQ-212, REQ-215, REQ-234, REQ-235, REQ-236, REQ-237, REQ-238, REQ-239, REQ-249, REQ-277, REQ-315, REQ-316
813
821
 
814
- ### fn `function buildPersistedLocalConfig(config: UseReqConfig): UseReqLocalConfig` (L950-978)
822
+ ### fn `function buildPersistedLocalConfig(config: UseReqConfig): UseReqLocalConfig` (L986-1017)
815
823
  - @brief Builds the persisted local configuration payload.
816
824
  - @details Copies only project-scoped keys into a fresh object so runtime-derived metadata plus global checker, tool, git, and notification fields never reach `.pi-usereq.json`, while preserving the debug tool-wrapper command flag beside other local debug settings. Runtime is O(n) in config size. No external state is mutated.
817
825
  - @param[in] config {UseReqConfig} Effective configuration object.
818
826
  - @return {UseReqLocalConfig} Persistable local configuration payload.
819
- - @satisfies CTN-012, CTN-013, CTN-019, REQ-104, REQ-146, REQ-249, REQ-316, REQ-277
827
+ - @satisfies CTN-012, CTN-013, CTN-019, REQ-104, REQ-146, REQ-249, REQ-316, REQ-277, REQ-328
820
828
 
821
- ### fn `function buildPersistedGlobalConfig(config: UseReqConfig): UseReqGlobalConfig` (L987-1026)
829
+ ### fn `function buildPersistedGlobalConfig(config: UseReqConfig): UseReqGlobalConfig` (L1026-1065)
822
830
  - @brief Builds the persisted global configuration payload.
823
831
  - @details Copies only cross-project keys into a fresh object so local directory and debug fields never reach `~/.config/pi-usereq/config.json`, while forcing persisted worktree disablement when automatic git commit is disabled and forcing persisted Pushover disablement until both credentials are populated. Runtime is O(n) in config size. No external state is mutated.
824
832
  - @param[in] config {UseReqConfig} Effective configuration object.
825
833
  - @return {UseReqGlobalConfig} Persistable global configuration payload.
826
834
  - @satisfies REQ-137, REQ-163, REQ-174, REQ-178, REQ-184, REQ-196, REQ-204, REQ-205, REQ-212, REQ-234, REQ-249, REQ-315
827
835
 
828
- ### fn `function writeConfigFile(configPath: string, payload: object): void` (L1035-1038)
836
+ ### fn `function writeConfigFile(configPath: string, payload: object): void` (L1074-1077)
829
837
  - @brief Writes one normalized config payload to disk.
830
838
  - @details Creates the parent directory when required, formats JSON with two-space indentation, and terminates the file with a newline. Runtime is O(n) in serialized payload size. Side effects include directory creation and file overwrite.
831
839
  - @param[in] configPath {string} Absolute destination config path.
832
840
  - @param[in] payload {object} Persistable config payload.
833
841
  - @return {void} No return value.
834
842
 
835
- ### fn `export function saveLocalConfig(projectBase: string, config: UseReqConfig): void` (L1048-1050)
843
+ ### fn `export function saveLocalConfig(projectBase: string, config: UseReqConfig): void` (L1087-1089)
836
844
  - @brief Persists the local configuration scope to disk.
837
845
  - @details Serializes only project-scoped fields into `<base-path>/.pi-usereq.json`, excluding runtime-derived metadata and every global-scope configuration key. Runtime is O(n) in serialized local config size. Side effects include directory creation and file overwrite.
838
846
  - @param[in] projectBase {string} Absolute project root path.
@@ -840,14 +848,14 @@ import { makeRelativeIfContainsProject } from "./utils.js";
840
848
  - @return {void} No return value.
841
849
  - @satisfies CTN-012, REQ-104, REQ-146
842
850
 
843
- ### fn `export function saveGlobalConfig(config: UseReqConfig): void` (L1059-1061)
851
+ ### fn `export function saveGlobalConfig(config: UseReqConfig): void` (L1098-1100)
844
852
  - @brief Persists the global configuration scope to disk.
845
853
  - @details Serializes only cross-project fields into `~/.config/pi-usereq/config.json`, excluding every project-local directory and debug setting. Runtime is O(n) in serialized global config size. Side effects include directory creation and file overwrite.
846
854
  - @param[in] config {UseReqConfig} Effective configuration object to persist.
847
855
  - @return {void} No return value.
848
856
  - @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
849
857
 
850
- ### fn `export function saveConfig(projectBase: string, config: UseReqConfig): void` (L1071-1074)
858
+ ### fn `export function saveConfig(projectBase: string, config: UseReqConfig): void` (L1110-1113)
851
859
  - @brief Persists the effective configuration to local and global config files.
852
860
  - @details Splits the effective runtime config into project-scoped and cross-project payloads, then writes both files with normalized JSON formatting. Runtime is O(n) in combined serialized config size. Side effects include directory creation and file overwrite in both persistence locations.
853
861
  - @param[in] projectBase {string} Absolute project root path.
@@ -855,14 +863,14 @@ import { makeRelativeIfContainsProject } from "./utils.js";
855
863
  - @return {void} No return value.
856
864
  - @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
857
865
 
858
- ### fn `export function normalizeConfigPaths(projectBase: string, config: UseReqConfig): UseReqConfig` (L1083-1101)
866
+ ### fn `export function normalizeConfigPaths(projectBase: string, config: UseReqConfig): UseReqConfig` (L1122-1140)
859
867
  - @brief Normalizes persisted directory fields to project-relative forms.
860
868
  - @details Rewrites docs, tests, and source directories using project containment heuristics, strips trailing separators, and restores defaults for empty results. Runtime is O(n) in configured path count plus path-length processing. No filesystem writes occur.
861
869
  - @param[in] projectBase {string} Absolute project root path.
862
870
  - @param[in] config {UseReqConfig} Configuration object to normalize.
863
871
  - @return {UseReqConfig} Normalized configuration copy.
864
872
 
865
- ### fn `export function buildPromptReplacementPaths(` (L1111-1153)
873
+ ### fn `export function buildPromptReplacementPaths(` (L1150-1192)
866
874
  - @brief Builds placeholder replacements for bundled prompt rendering.
867
875
  - @details Computes runtime path context from the execution path, derives installation-owned template and guideline paths, enumerates visible guideline files from the installed resource tree, and returns the token map consumed by prompt templates. Runtime is O(g log g + s) where g is guideline count and s is source-directory count. Side effects are limited to filesystem reads.
868
876
  - @param[in] projectBase {string} Absolute project root path.
@@ -876,46 +884,47 @@ import { makeRelativeIfContainsProject } from "./utils.js";
876
884
  |`StaticCheckEntry`|iface||58-62|export interface StaticCheckEntry|
877
885
  |`StaticCheckEnabled`|type||68||
878
886
  |`StaticCheckLanguageConfig`|iface||74-77|export interface StaticCheckLanguageConfig|
879
- |`UseReqConfig`|iface||83-122|export interface UseReqConfig|
880
- |`LocalStaticCheckLanguageConfig`|iface||128-130|interface LocalStaticCheckLanguageConfig|
881
- |`GlobalStaticCheckLanguageConfig`|iface||136-138|interface GlobalStaticCheckLanguageConfig|
882
- |`UseReqLocalConfig`|iface||144-157|interface UseReqLocalConfig|
883
- |`UseReqGlobalConfig`|iface||163-191|interface UseReqGlobalConfig|
884
- |`cloneStaticCheckEntry`|fn||308-317|function cloneStaticCheckEntry(entry: StaticCheckEntry): ...|
885
- |`createStaticCheckLanguageConfig`|fn||326-335|export function createStaticCheckLanguageConfig(|
886
- |`createLocalStaticCheckLanguageConfig`|fn||343-347|function createLocalStaticCheckLanguageConfig(|
887
- |`createGlobalStaticCheckLanguageConfig`|fn||355-361|function createGlobalStaticCheckLanguageConfig(|
888
- |`getDefaultGlobalStaticCheckConfig`|fn||368-373|function getDefaultGlobalStaticCheckConfig(): Record<stri...|
889
- |`getDefaultLocalStaticCheckConfig`|fn||381-390|function getDefaultLocalStaticCheckConfig(|
890
- |`mergeStaticCheckConfig`|fn||399-418|function mergeStaticCheckConfig(|
891
- |`getDefaultStaticCheckConfig`|fn||426-432|export function getDefaultStaticCheckConfig(): Record<str...|
892
- |`normalizeStaticCheckEnabled`|fn||442-447|export function normalizeStaticCheckEnabled(|
893
- |`getActiveStaticCheckEntries`|fn||457-466|export function getActiveStaticCheckEntries(|
894
- |`normalizeAutoGitCommit`|fn||481-483|export function normalizeAutoGitCommit(value: unknown): "...|
895
- |`normalizeGitWorktreeEnabled`|fn||497-499|export function normalizeGitWorktreeEnabled(value: unknow...|
896
- |`resolveEffectiveGitWorktreeEnabled`|fn||508-513|export function resolveEffectiveGitWorktreeEnabled(|
897
- |`normalizeGitWorktreePrefix`|fn||527-533|export function normalizeGitWorktreePrefix(value: unknown...|
898
- |`getProjectConfigPath`|fn||540-542|export function getProjectConfigPath(projectBase: string)...|
899
- |`getGlobalConfigPath`|fn||549-551|export function getGlobalConfigPath(): string|
900
- |`getDefaultLocalConfig`|fn||560-577|function getDefaultLocalConfig(|
901
- |`getDefaultGlobalConfig`|fn||584-614|function getDefaultGlobalConfig(): UseReqGlobalConfig|
902
- |`mergeConfigScopes`|fn||623-690|function mergeConfigScopes(|
903
- |`getDefaultConfig`|fn||699-705|export function getDefaultConfig(_projectBase: string): U...|
904
- |`normalizeStaticCheckEntries`|fn||713-733|function normalizeStaticCheckEntries(value: unknown): Sta...|
905
- |`readConfigPayload`|fn||742-758|function readConfigPayload(configPath: string): Record<st...|
906
- |`normalizeLocalStaticCheckConfig`|fn||768-792|function normalizeLocalStaticCheckConfig(|
907
- |`normalizeGlobalStaticCheckConfig`|fn||801-818|function normalizeGlobalStaticCheckConfig(|
908
- |`loadLocalConfig`|fn||828-876|function loadLocalConfig(|
909
- |`loadGlobalConfig`|fn||883-924|function loadGlobalConfig(): UseReqGlobalConfig|
910
- |`loadConfig`|fn||934-941|export function loadConfig(projectBase: string): UseReqCo...|
911
- |`buildPersistedLocalConfig`|fn||950-978|function buildPersistedLocalConfig(config: UseReqConfig):...|
912
- |`buildPersistedGlobalConfig`|fn||987-1026|function buildPersistedGlobalConfig(config: UseReqConfig)...|
913
- |`writeConfigFile`|fn||1035-1038|function writeConfigFile(configPath: string, payload: obj...|
914
- |`saveLocalConfig`|fn||1048-1050|export function saveLocalConfig(projectBase: string, conf...|
915
- |`saveGlobalConfig`|fn||1059-1061|export function saveGlobalConfig(config: UseReqConfig): void|
916
- |`saveConfig`|fn||1071-1074|export function saveConfig(projectBase: string, config: U...|
917
- |`normalizeConfigPaths`|fn||1083-1101|export function normalizeConfigPaths(projectBase: string,...|
918
- |`buildPromptReplacementPaths`|fn||1111-1153|export function buildPromptReplacementPaths(|
887
+ |`UseReqConfig`|iface||83-125|export interface UseReqConfig|
888
+ |`LocalStaticCheckLanguageConfig`|iface||131-133|interface LocalStaticCheckLanguageConfig|
889
+ |`GlobalStaticCheckLanguageConfig`|iface||139-141|interface GlobalStaticCheckLanguageConfig|
890
+ |`UseReqLocalConfig`|iface||147-163|interface UseReqLocalConfig|
891
+ |`UseReqGlobalConfig`|iface||169-197|interface UseReqGlobalConfig|
892
+ |`normalizeContextFilesFlag`|fn||229-231|export function normalizeContextFilesFlag(value: unknown)...|
893
+ |`cloneStaticCheckEntry`|fn||331-340|function cloneStaticCheckEntry(entry: StaticCheckEntry): ...|
894
+ |`createStaticCheckLanguageConfig`|fn||349-358|export function createStaticCheckLanguageConfig(|
895
+ |`createLocalStaticCheckLanguageConfig`|fn||366-370|function createLocalStaticCheckLanguageConfig(|
896
+ |`createGlobalStaticCheckLanguageConfig`|fn||378-384|function createGlobalStaticCheckLanguageConfig(|
897
+ |`getDefaultGlobalStaticCheckConfig`|fn||391-396|function getDefaultGlobalStaticCheckConfig(): Record<stri...|
898
+ |`getDefaultLocalStaticCheckConfig`|fn||404-413|function getDefaultLocalStaticCheckConfig(|
899
+ |`mergeStaticCheckConfig`|fn||422-441|function mergeStaticCheckConfig(|
900
+ |`getDefaultStaticCheckConfig`|fn||449-455|export function getDefaultStaticCheckConfig(): Record<str...|
901
+ |`normalizeStaticCheckEnabled`|fn||465-470|export function normalizeStaticCheckEnabled(|
902
+ |`getActiveStaticCheckEntries`|fn||480-489|export function getActiveStaticCheckEntries(|
903
+ |`normalizeAutoGitCommit`|fn||504-506|export function normalizeAutoGitCommit(value: unknown): "...|
904
+ |`normalizeGitWorktreeEnabled`|fn||520-522|export function normalizeGitWorktreeEnabled(value: unknow...|
905
+ |`resolveEffectiveGitWorktreeEnabled`|fn||531-536|export function resolveEffectiveGitWorktreeEnabled(|
906
+ |`normalizeGitWorktreePrefix`|fn||550-556|export function normalizeGitWorktreePrefix(value: unknown...|
907
+ |`getProjectConfigPath`|fn||563-565|export function getProjectConfigPath(projectBase: string)...|
908
+ |`getGlobalConfigPath`|fn||572-574|export function getGlobalConfigPath(): string|
909
+ |`getDefaultLocalConfig`|fn||583-603|function getDefaultLocalConfig(|
910
+ |`getDefaultGlobalConfig`|fn||610-640|function getDefaultGlobalConfig(): UseReqGlobalConfig|
911
+ |`mergeConfigScopes`|fn||650-720|function mergeConfigScopes(|
912
+ |`getDefaultConfig`|fn||729-735|export function getDefaultConfig(_projectBase: string): U...|
913
+ |`normalizeStaticCheckEntries`|fn||743-763|function normalizeStaticCheckEntries(value: unknown): Sta...|
914
+ |`readConfigPayload`|fn||772-788|function readConfigPayload(configPath: string): Record<st...|
915
+ |`normalizeLocalStaticCheckConfig`|fn||798-822|function normalizeLocalStaticCheckConfig(|
916
+ |`normalizeGlobalStaticCheckConfig`|fn||831-848|function normalizeGlobalStaticCheckConfig(|
917
+ |`loadLocalConfig`|fn||858-912|function loadLocalConfig(|
918
+ |`loadGlobalConfig`|fn||919-960|function loadGlobalConfig(): UseReqGlobalConfig|
919
+ |`loadConfig`|fn||970-977|export function loadConfig(projectBase: string): UseReqCo...|
920
+ |`buildPersistedLocalConfig`|fn||986-1017|function buildPersistedLocalConfig(config: UseReqConfig):...|
921
+ |`buildPersistedGlobalConfig`|fn||1026-1065|function buildPersistedGlobalConfig(config: UseReqConfig)...|
922
+ |`writeConfigFile`|fn||1074-1077|function writeConfigFile(configPath: string, payload: obj...|
923
+ |`saveLocalConfig`|fn||1087-1089|export function saveLocalConfig(projectBase: string, conf...|
924
+ |`saveGlobalConfig`|fn||1098-1100|export function saveGlobalConfig(config: UseReqConfig): void|
925
+ |`saveConfig`|fn||1110-1113|export function saveConfig(projectBase: string, config: U...|
926
+ |`normalizeConfigPaths`|fn||1122-1140|export function normalizeConfigPaths(projectBase: string,...|
927
+ |`buildPromptReplacementPaths`|fn||1150-1192|export function buildPromptReplacementPaths(|
919
928
 
920
929
 
921
930
  ---
@@ -3327,7 +3336,7 @@ import type { PromptCommandExecutionPlan } from "./prompt-command-runtime.js";
3327
3336
 
3328
3337
  ---
3329
3338
 
3330
- # prompts.ts | TypeScript | 314L | 9 symbols | 7 imports | 17 comments
3339
+ # prompts.ts | TypeScript | 357L | 10 symbols | 7 imports | 19 comments
3331
3340
  > Path: `src/core/prompts.ts`
3332
3341
  - @brief Renders bundled pi-usereq prompts for the current project context.
3333
3342
  - @details Applies placeholder substitution, legacy tool-name rewrites, and conditional pi.dev governance guidance before prompt text is sent to the agent. Runtime is linear in prompt size plus replacement count. Side effects are limited to filesystem reads used for manifest checks and bundled prompt loading.
@@ -3336,8 +3345,8 @@ import type { PromptCommandExecutionPlan } from "./prompt-command-runtime.js";
3336
3345
  ```
3337
3346
  import fs from "node:fs";
3338
3347
  import path from "node:path";
3339
- import { buildPromptReplacementPaths, type UseReqConfig } from "./config.js";
3340
- import { formatRuntimePathForDisplay } from "./path-context.js";
3348
+ import { buildPromptReplacementPaths, DEFAULT_DOCS_DIR, type UseReqConfig } from "./config.js";
3349
+ import { formatRuntimePathForDisplay, normalizeRelativeDirContract } from "./path-context.js";
3341
3350
  import type {
3342
3351
  import { getPromptRequiredDocs } from "./prompt-command-runtime.js";
3343
3352
  import { readBundledInstruction, readBundledPrompt } from "./resources.js";
@@ -3362,14 +3371,22 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3362
3371
  - @return {string} Prompt markdown with zero or one injected conformance block.
3363
3372
  - @satisfies REQ-032, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275
3364
3373
 
3365
- ### fn `export function adaptPromptForInternalTools(text: string): string` (L145-151)
3374
+ ### fn `function buildContextFilesBlock(projectBase: string, config: UseReqConfig): string` (L157-174)
3375
+ - @brief Builds the markdown block that replaces the `%%CONTEXT_FILES%%` prompt token.
3376
+ - @details Iterates the documented `REQUIREMENTS.md`, `REFERENCES.md`, `WORKFLOW.md` order, skips disabled flags and missing files without error, and renders each remaining file as a file-name heading, an HTML `<file name="<docs-dir>/<filename>">` reference with `%%DOC_PATH%%` pre-substituted, and the raw file content inside four-backtick `markdown` fences. Runtime is O(n) in aggregate context-file size. Side effects are limited to filesystem reads.
3377
+ - @param[in] projectBase {string} Absolute project root used to resolve the configured docs directory.
3378
+ - @param[in] config {UseReqConfig} Effective project configuration supplying the docs directory and context-file flags.
3379
+ - @return {string} Rendered markdown block, or the empty string when no enabled context file exists.
3380
+ - @satisfies REQ-329, REQ-330, REQ-331, REQ-332
3381
+
3382
+ ### fn `export function adaptPromptForInternalTools(text: string): string` (L183-189)
3366
3383
  - @brief Rewrites bundled prompt tool references from legacy `req --...` syntax to internal tool names.
3367
3384
  - @details Applies deterministic global regex replacements so prompt text matches the extension-registered tool surface instead of the standalone CLI spelling. Time complexity O(p*r) where p is pattern count and r is prompt length.
3368
3385
  - @param[in] text {string} Prompt markdown before tool-reference normalization.
3369
3386
  - @return {string} Prompt markdown with internal tool names.
3370
3387
  - @satisfies REQ-003
3371
3388
 
3372
- ### fn `export function applyReplacements(text: string, replacements: Record<string, string>): string` (L161-167)
3389
+ ### fn `export function applyReplacements(text: string, replacements: Record<string, string>): string` (L199-205)
3373
3390
  - @brief Applies literal placeholder replacements to bundled prompt markdown.
3374
3391
  - @details Replaces every placeholder token using split/join semantics so all occurrences are updated without regex escaping. Time complexity O(t*n) where t is replacement count and n is prompt length.
3375
3392
  - @param[in] text {string} Prompt markdown containing placeholder tokens.
@@ -3377,7 +3394,7 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3377
3394
  - @return {string} Prompt markdown with all placeholder tokens expanded.
3378
3395
  - @satisfies REQ-002
3379
3396
 
3380
- ### fn `function buildPromptExecutionBlock(` (L177-199)
3397
+ ### fn `function buildPromptExecutionBlock(` (L215-237)
3381
3398
  - @brief Builds the prompt-command execution block injected at prompt start.
3382
3399
  - @details Serializes the already-completed repository validation, prompt-specific required-doc validation, worktree routing decision, and extension-owned lifecycle responsibilities so downstream agents do not repeat command-side orchestration. Time complexity is O(d) in required-doc count. No external state is mutated.
3383
3400
  - @param[in] promptName {PromptCommandName} Bundled prompt identifier.
@@ -3385,7 +3402,7 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3385
3402
  - @return {string} Markdown block or the empty string when runtime execution metadata is unavailable.
3386
3403
  - @satisfies REQ-200, REQ-201, REQ-202, REQ-206, REQ-207, REQ-208, REQ-209
3387
3404
 
3388
- ### fn `function injectPromptExecutionBlock(` (L209-220)
3405
+ ### fn `function injectPromptExecutionBlock(` (L247-258)
3389
3406
  - @brief Injects the prompt-command execution block near the start of the rendered prompt.
3390
3407
  - @details Inserts the execution block immediately after the first level-1 heading so downstream agents evaluate extension-owned orchestration before workflow steps. Leaves prompts unchanged when no execution block is provided or when the block is already present. Time complexity O(n).
3391
3408
  - @param[in] text {string} Prompt markdown after placeholder replacement.
@@ -3393,7 +3410,7 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3393
3410
  - @param[in] executionPlan {PromptCommandExecutionPlan | undefined} Prepared execution plan.
3394
3411
  - @return {string} Prompt markdown with zero or one injected execution block.
3395
3412
 
3396
- ### fn `function buildPromptReplacements(` (L232-244)
3413
+ ### fn `function buildPromptReplacements(` (L270-282)
3397
3414
  - @brief Builds prompt-specific runtime placeholder replacements.
3398
3415
  - @details Merges shared path substitutions with prompt-scoped runtime values for `%%ARGS%%` and `%%PROMPT%%`. Time complexity is O(g log g + s) due to delegated path replacement building, where g is guideline count and s is source-directory count. Side effects are limited to filesystem reads delegated to shared path-context helpers.
3399
3416
  - @param[in] promptName {string} Bundled prompt identifier without the `req-` prefix.
@@ -3403,7 +3420,7 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3403
3420
  - @return {Record<string, string>} Prompt-specific placeholder-to-value map.
3404
3421
  - @satisfies REQ-002, REQ-211
3405
3422
 
3406
- ### fn `function renderBundledCommitInstruction(` (L256-270)
3423
+ ### fn `function renderBundledCommitInstruction(` (L294-308)
3407
3424
  - @brief Renders the bundled git instruction injected through `%%COMMIT%%`.
3408
3425
  - @details Selects `resources/instructions/git_commit.md` when automatic git commit is enabled and `resources/instructions/git_read-only.md` otherwise, then applies the same runtime placeholder substitutions used by bundled prompts before returning the rendered markdown. Time complexity is O(n + g log g + s) where n is instruction size, g is guideline count, and s is source-directory count. Side effects are limited to filesystem reads.
3409
3426
  - @param[in] promptName {string} Bundled prompt identifier without the `req-` prefix.
@@ -3413,7 +3430,7 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3413
3430
  - @return {string} Rendered bundled git instruction selected for the current automatic-commit mode.
3414
3431
  - @satisfies REQ-211, REQ-213, REQ-214
3415
3432
 
3416
- ### fn `export function renderPrompt(` (L283-314)
3433
+ ### fn `export function renderPrompt(` (L321-357)
3417
3434
  - @brief Renders a bundled prompt for the current project context.
3418
3435
  - @details Loads the bundled markdown template, expands configuration-derived placeholders, injects extension-owned execution guidance plus conditional pi.dev governance guidance, expands the optional bundled commit instruction, and rewrites legacy tool references to internal names. Time complexity O(n) relative to prompt size plus delegated commit-instruction rendering. No tracked files are modified.
3419
3436
  - @param[in] promptName {string} Bundled prompt identifier.
@@ -3422,20 +3439,21 @@ import { readBundledInstruction, readBundledPrompt } from "./resources.js";
3422
3439
  - @param[in] config {UseReqConfig} Effective project configuration used for path substitutions.
3423
3440
  - @param[in] executionPlan {PromptCommandExecutionPlan | undefined} Optional prompt-command execution plan used for injected runtime guidance.
3424
3441
  - @return {string} Fully rendered prompt markdown ready for `pi.sendUserMessage(...)`.
3425
- - @satisfies REQ-002, REQ-003, REQ-032, REQ-033, REQ-034, REQ-108, REQ-200, REQ-201, REQ-202, REQ-206, REQ-207, REQ-208, REQ-209, REQ-211, REQ-213, REQ-214, REQ-273, REQ-274, REQ-275
3442
+ - @satisfies REQ-002, REQ-003, REQ-032, REQ-033, REQ-034, REQ-108, REQ-200, REQ-201, REQ-202, REQ-206, REQ-207, REQ-208, REQ-209, REQ-211, REQ-213, REQ-214, REQ-273, REQ-274, REQ-275, REQ-329, REQ-330, REQ-331, REQ-332
3426
3443
 
3427
3444
  ## Symbol Index
3428
3445
  |Symbol|Kind|Vis|Lines|Sig|
3429
3446
  |---|---|---|---|---|
3430
3447
  |`buildPiDevConformanceBlock`|fn||109-118|function buildPiDevConformanceBlock(promptName: string, p...|
3431
3448
  |`injectPiDevConformanceBlock`|fn||129-136|function injectPiDevConformanceBlock(text: string, prompt...|
3432
- |`adaptPromptForInternalTools`|fn||145-151|export function adaptPromptForInternalTools(text: string)...|
3433
- |`applyReplacements`|fn||161-167|export function applyReplacements(text: string, replaceme...|
3434
- |`buildPromptExecutionBlock`|fn||177-199|function buildPromptExecutionBlock(|
3435
- |`injectPromptExecutionBlock`|fn||209-220|function injectPromptExecutionBlock(|
3436
- |`buildPromptReplacements`|fn||232-244|function buildPromptReplacements(|
3437
- |`renderBundledCommitInstruction`|fn||256-270|function renderBundledCommitInstruction(|
3438
- |`renderPrompt`|fn||283-314|export function renderPrompt(|
3449
+ |`buildContextFilesBlock`|fn||157-174|function buildContextFilesBlock(projectBase: string, conf...|
3450
+ |`adaptPromptForInternalTools`|fn||183-189|export function adaptPromptForInternalTools(text: string)...|
3451
+ |`applyReplacements`|fn||199-205|export function applyReplacements(text: string, replaceme...|
3452
+ |`buildPromptExecutionBlock`|fn||215-237|function buildPromptExecutionBlock(|
3453
+ |`injectPromptExecutionBlock`|fn||247-258|function injectPromptExecutionBlock(|
3454
+ |`buildPromptReplacements`|fn||270-282|function buildPromptReplacements(|
3455
+ |`renderBundledCommitInstruction`|fn||294-308|function renderBundledCommitInstruction(|
3456
+ |`renderPrompt`|fn||321-357|export function renderPrompt(|
3439
3457
 
3440
3458
 
3441
3459
  ---
@@ -4723,7 +4741,7 @@ import path from "node:path";
4723
4741
 
4724
4742
  ---
4725
4743
 
4726
- # index.ts | TypeScript | 4413L | 102 symbols | 27 imports | 107 comments
4744
+ # index.ts | TypeScript | 4541L | 106 symbols | 27 imports | 110 comments
4727
4745
  > Path: `src/index.ts`
4728
4746
  - @brief Registers the pi-usereq extension commands, tools, and configuration UI.
4729
4747
  - @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.
@@ -4761,55 +4779,55 @@ import { makeRelativeIfContainsProject, shellSplit } from "./core/utils.js";
4761
4779
 
4762
4780
  ## Definitions
4763
4781
 
4764
- ### iface `interface PiShortcutRegistrar` (L181-189)
4782
+ ### iface `interface PiShortcutRegistrar` (L182-190)
4765
4783
  - @brief Describes the optional shortcut-registration surface used by pi-usereq.
4766
4784
  - @details Narrows the runtime API to the documented `registerShortcut(...)`
4767
4785
  method so the extension can remain compatible with offline harnesses that do
4768
4786
  not implement shortcut capture. Compile-time only and introduces no runtime
4769
4787
  cost.
4770
4788
 
4771
- ### fn `function getProjectBase(cwd: string): string` (L197-206)
4789
+ ### fn `function getProjectBase(cwd: string): string` (L198-207)
4772
4790
  - @brief Resolves the effective project base from a working directory.
4773
4791
  - @details Normalizes the provided cwd into an absolute path without consulting configuration. Time complexity is O(1). No I/O side effects occur.
4774
4792
  - @param[in] cwd {string} Current working directory.
4775
4793
  - @return {string} Absolute project base path.
4776
4794
 
4777
- ### fn `function getProcessCwdSafe(): string` (L213-222)
4795
+ ### fn `function getProcessCwdSafe(): string` (L214-223)
4778
4796
  - @brief Resolves a safe process working directory for extension-load paths.
4779
4797
  - @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.
4780
4798
  - @return {string} Absolute fallback-safe process working directory.
4781
4799
 
4782
- ### fn `function resolveLiveBootstrapCwd(cwd: string): string` (L230-242)
4800
+ ### fn `function resolveLiveBootstrapCwd(cwd: string): string` (L231-243)
4783
4801
  - @brief Resolves the live working directory used for bootstrap-sensitive flows.
4784
4802
  - @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.
4785
4803
  - @param[in] cwd {string} Candidate context cwd.
4786
4804
  - @return {string} Existing absolute cwd used for bootstrap work.
4787
4805
 
4788
- ### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (L251-260)
4806
+ ### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (L252-261)
4789
4807
  - @brief Best-effort synchronizes one context `cwd` mirror with bootstrap reality.
4790
4808
  - @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.
4791
4809
  - @param[in] cwd {string} Resolved live cwd.
4792
4810
  - @param[in,out] ctx {{ cwd?: string }} Mutable context-like object.
4793
4811
  - @return {void} No return value.
4794
4812
 
4795
- ### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L269-272)
4813
+ ### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L270-273)
4796
4814
  - @brief Loads project configuration for the extension runtime.
4797
4815
  - @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.
4798
4816
  - @param[in] cwd {string} Current working directory.
4799
4817
  - @return {UseReqConfig} Effective project configuration.
4800
4818
  - @satisfies REQ-030, REQ-145, REQ-146
4801
4819
 
4802
- - type `type DebugToolCommandExecuteResult = ReturnType<typeof buildMonolithicToolExecuteResult>;` (L278)
4820
+ - type `type DebugToolCommandExecuteResult = ReturnType<typeof buildMonolithicToolExecuteResult>;` (L279)
4803
4821
  - @brief Describes the execute-result surface reused by debug tool wrapper commands.
4804
4822
  - @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.
4805
- ### fn `function shouldRegisterDebugToolCommands(cwd: string): boolean` (L287-293)
4823
+ ### fn `function shouldRegisterDebugToolCommands(cwd: string): boolean` (L288-294)
4806
4824
  - @brief Tests whether debug tool wrapper commands should be registered for one runtime cwd.
4807
4825
  - @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.
4808
4826
  - @param[in] cwd {string} Candidate runtime working directory.
4809
4827
  - @return {boolean} `true` when debug tool wrapper commands should be registered.
4810
4828
  - @satisfies REQ-323
4811
4829
 
4812
- ### fn `function writeDebugToolCommandResultToEditor(` (L304-318)
4830
+ ### fn `function writeDebugToolCommandResultToEditor(` (L305-319)
4813
4831
  - @brief Writes one debug tool-wrapper result into the editor and emits a status notification.
4814
4832
  - @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.
4815
4833
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -4818,7 +4836,7 @@ cost.
4818
4836
  - @return {void} No return value.
4819
4837
  - @satisfies REQ-324
4820
4838
 
4821
- ### fn `function executeDebugToolCommand(` (L330-348)
4839
+ ### fn `function executeDebugToolCommand(` (L331-349)
4822
4840
  - @brief Executes one config-gated debug tool wrapper slash command.
4823
4841
  - @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.
4824
4842
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -4828,14 +4846,14 @@ cost.
4828
4846
  - @throws {ReqError} Throws when debug tool wrapper commands are disabled for the active project.
4829
4847
  - @satisfies REQ-324, REQ-325
4830
4848
 
4831
- ### fn `function registerDebugToolCommands(pi: ExtensionAPI): void` (L357-396)
4849
+ ### fn `function registerDebugToolCommands(pi: ExtensionAPI): void` (L358-397)
4832
4850
  - @brief Registers config-gated debug slash-command wrappers for selected project analysis tools.
4833
4851
  - @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.
4834
4852
  - @param[in] pi {ExtensionAPI} Active extension API instance.
4835
4853
  - @return {void} No return value.
4836
4854
  - @satisfies DES-015, REQ-323, REQ-324, REQ-325
4837
4855
 
4838
- ### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (L406-409)
4856
+ ### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (L407-410)
4839
4857
  - @brief Persists effective project configuration from the extension runtime.
4840
4858
  - @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.
4841
4859
  - @param[in] cwd {string} Current working directory.
@@ -4843,38 +4861,38 @@ cost.
4843
4861
  - @return {void} No return value.
4844
4862
  - @satisfies REQ-146, REQ-315
4845
4863
 
4846
- ### fn `function formatLocalConfigPathForMenu(cwd: string): string` (L418-422)
4864
+ ### fn `function formatLocalConfigPathForMenu(cwd: string): string` (L419-423)
4847
4865
  - @brief Formats the current local config path for top-level menu display.
4848
4866
  - @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.
4849
4867
  - @param[in] cwd {string} Current working directory.
4850
4868
  - @return {string} `~`-relative or absolute local config-path display value.
4851
4869
  - @satisfies REQ-162
4852
4870
 
4853
- ### fn `function formatGlobalConfigPathForMenu(): string` (L430-432)
4871
+ ### fn `function formatGlobalConfigPathForMenu(): string` (L431-433)
4854
4872
  - @brief Formats the current global config path for top-level menu display.
4855
4873
  - @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.
4856
4874
  - @return {string} `~`-relative or absolute global config-path display value.
4857
4875
  - @satisfies REQ-319
4858
4876
 
4859
- ### fn `function buildTerminalSettingsMenuChoices(options:` (L441-452)
4877
+ ### fn `function buildTerminalSettingsMenuChoices(options:` (L442-453)
4860
4878
  - @brief Builds the standardized terminal rows appended to every configuration menu.
4861
4879
  - @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.
4862
4880
  - @param[in] options {{ resetDefaultsDescription: string }} Menu-specific terminal-row metadata.
4863
4881
  - @return {PiUsereqSettingsMenuChoice[]} Ordered terminal menu rows.
4864
4882
  - @satisfies REQ-193
4865
4883
 
4866
- ### iface `interface ResetConfirmationChange` (L458-462)
4884
+ ### iface `interface ResetConfirmationChange` (L459-463)
4867
4885
  - @brief Describes one pending reset value change shown in confirmation menus.
4868
4886
  - @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.
4869
4887
 
4870
- ### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L471-473)
4888
+ ### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L472-474)
4871
4889
  - @brief Formats one reset-confirmation value pair for menu display.
4872
4890
  - @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.
4873
4891
  - @param[in] previousValue {string} Current persisted value.
4874
4892
  - @param[in] nextValue {string} Candidate default value.
4875
4893
  - @return {string} Rendered preview string.
4876
4894
 
4877
- ### fn `function buildResetConfirmationChoices(` (L483-522)
4895
+ ### fn `function buildResetConfirmationChoices(` (L484-523)
4878
4896
  - @brief Builds the shared settings-menu choices for one reset-confirmation submenu.
4879
4897
  - @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.
4880
4898
  - @param[in] changes {ResetConfirmationChange[]} Changed-value preview rows.
@@ -4882,7 +4900,7 @@ cost.
4882
4900
  - @param[in] abortDescription {string} Description for the abort action.
4883
4901
  - @return {PiUsereqSettingsMenuChoice[]} Reset-confirmation submenu choices.
4884
4902
 
4885
- ### fn `async function confirmResetChanges(` (L534-547)
4903
+ ### fn `async function confirmResetChanges(` (L535-548)
4886
4904
  - @brief Opens one explicit reset-confirmation submenu.
4887
4905
  - @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.
4888
4906
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -4892,14 +4910,14 @@ cost.
4892
4910
  - @param[in] abortDescription {string} Description for the abort action.
4893
4911
  - @return {Promise<boolean>} `true` when the reset is explicitly approved.
4894
4912
 
4895
- ### fn `function writePersistedConfigToEditor(` (L556-561)
4913
+ ### fn `function writePersistedConfigToEditor(` (L557-562)
4896
4914
  - @brief Writes one already-persisted config file text into the editor.
4897
4915
  - @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.
4898
4916
  - @param[in] ctx {ExtensionCommandContext} Active command context.
4899
4917
  - @param[in] configPath {string} Absolute persisted config path.
4900
4918
  - @return {void} No return value.
4901
4919
 
4902
- ### fn `function writePersistedLocalConfigToEditor(` (L571-577)
4920
+ ### fn `function writePersistedLocalConfigToEditor(` (L572-578)
4903
4921
  - @brief Writes the already-persisted local configuration file text into the editor.
4904
4922
  - @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.
4905
4923
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -4907,58 +4925,58 @@ cost.
4907
4925
  - @return {void} No return value.
4908
4926
  - @satisfies REQ-031
4909
4927
 
4910
- ### fn `function writePersistedGlobalConfigToEditor(` (L586-590)
4928
+ ### fn `function writePersistedGlobalConfigToEditor(` (L587-591)
4911
4929
  - @brief Writes the already-persisted global configuration file text into the editor.
4912
4930
  - @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.
4913
4931
  - @param[in] ctx {ExtensionCommandContext} Active command context.
4914
4932
  - @return {void} No return value.
4915
4933
  - @satisfies REQ-318
4916
4934
 
4917
- ### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L651-655)
4935
+ ### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L652-656)
4918
4936
  - @brief Builds the supported-tag guidance lines embedded in search-tool registrations.
4919
4937
  - @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.
4920
4938
  - @return {string[]} Supported-tag guidance lines.
4921
4939
 
4922
- ### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L663-668)
4940
+ ### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L664-669)
4923
4941
  - @brief Builds the schema description for one search-tool registration.
4924
4942
  - @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.
4925
4943
  - @param[in] scope {FindToolScope} Search-tool scope.
4926
4944
  - @return {string} Parameter-schema description.
4927
4945
 
4928
- ### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L676-689)
4946
+ ### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L677-690)
4929
4947
  - @brief Builds the prompt-guideline set for one search-tool registration.
4930
4948
  - @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.
4931
4949
  - @param[in] scope {FindToolScope} Search-tool scope.
4932
4950
  - @return {string[]} Prompt-guideline strings.
4933
4951
 
4934
- - type `type MonolithicToolRenderResult = {` (L695)
4952
+ - type `type MonolithicToolRenderResult = {` (L696)
4935
4953
  - @brief Describes the monolithic tool-result surface consumed by tool-row renderers.
4936
4954
  - @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.
4937
- ### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L712-715)
4955
+ ### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L713-716)
4938
4956
  - @brief Extracts the primary monolithic text block from one tool result.
4939
4957
  - @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.
4940
4958
  - @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
4941
4959
  - @return {string} Primary monolithic content text.
4942
4960
 
4943
- ### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L723-733)
4961
+ ### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L724-734)
4944
4962
  - @brief Reads the first residual execution error string from one monolithic tool result.
4945
4963
  - @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.
4946
4964
  - @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
4947
4965
  - @return {string | undefined} First residual execution error string.
4948
4966
 
4949
- ### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L741-780)
4967
+ ### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L742-781)
4950
4968
  - @brief Formats one scalar or structural tool argument for compact render summaries.
4951
4969
  - @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.
4952
4970
  - @param[in] value {unknown} Candidate tool argument value.
4953
4971
  - @return {string | undefined} Compact preview string or `undefined` when the value carries no useful summary.
4954
4972
 
4955
- ### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L788-799)
4973
+ ### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L789-800)
4956
4974
  - @brief Builds the compact invocation summary appended to collapsed tool rows.
4957
4975
  - @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.
4958
4976
  - @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
4959
4977
  - @return {string} Compact invocation summary prefixed with one separating space, or the empty string when no useful preview exists.
4960
4978
 
4961
- ### fn `function summarizeStructuredToolResult(` (L809-824)
4979
+ ### fn `function summarizeStructuredToolResult(` (L810-825)
4962
4980
  - @brief Builds the compact default text for one monolithic tool result row.
4963
4981
  - @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.
4964
4982
  - @param[in] toolName {string} Registered tool name.
@@ -4966,27 +4984,27 @@ cost.
4966
4984
  - @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
4967
4985
  - @return {string} Compact single-line summary.
4968
4986
 
4969
- ### fn `function buildStructuredToolRenderResult(toolName: string)` (L833-852)
4987
+ ### fn `function buildStructuredToolRenderResult(toolName: string)` (L834-853)
4970
4988
  - @brief Builds a custom `renderResult` implementation for one monolithic tool.
4971
4989
  - @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.
4972
4990
  - @param[in] toolName {string} Registered tool name.
4973
4991
  - @return {(result: MonolithicToolRenderResult, options: { expanded?: boolean; isPartial?: boolean }, _theme: unknown, context: { args?: Record<string, unknown>; lastComponent?: unknown }) => Text} Custom result renderer.
4974
4992
  - @satisfies REQ-210
4975
4993
 
4976
- ### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L860-866)
4994
+ ### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L861-867)
4977
4995
  - @brief Executes one CLI-style runner for a monolithic agent tool.
4978
4996
  - @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.
4979
4997
  - @param[in] operation {() => ToolResult} Runner callback.
4980
4998
  - @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Monolithic tool execute result.
4981
4999
 
4982
- ### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L875-904)
5000
+ ### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L876-905)
4983
5001
  - @brief Executes one CLI-style runner for a status-only agent tool.
4984
5002
  - @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.
4985
5003
  - @param[in] operation {() => ToolResult} Runner callback.
4986
5004
  - @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Status-only tool execute result.
4987
5005
  - @satisfies REQ-294, REQ-295, REQ-296
4988
5006
 
4989
- ### fn `function deliverPromptCommand(` (L915-933)
5007
+ ### fn `function deliverPromptCommand(` (L916-934)
4990
5008
  - @brief Starts delivery of one rendered prompt into the current active session.
4991
5009
  - @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.
4992
5010
  - @param[in] pi {ExtensionAPI} Handler-scoped extension API instance retained as the fallback dispatcher.
@@ -4995,7 +5013,7 @@ cost.
4995
5013
  - @return {Promise<void>} Promise representing eventual prompt-delivery completion.
4996
5014
  - @satisfies REQ-004, REQ-067, REQ-068, REQ-227, REQ-281
4997
5015
 
4998
- ### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L944-960)
5016
+ ### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L945-961)
4999
5017
  - @brief Detects prompt-delivery failures that can be ignored after prompt ownership has moved past the command handler.
5000
5018
  - @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.
5001
5019
  - @param[in] error {unknown} Candidate prompt-delivery failure.
@@ -5004,7 +5022,7 @@ cost.
5004
5022
  - @return {boolean} `true` when the failure is a late stale-context delivery rejection that MUST be ignored.
5005
5023
  - @satisfies REQ-208, REQ-280, REQ-281, REQ-282
5006
5024
 
5007
- ### fn `function logPromptWorkflowStateChange(` (L973-992)
5025
+ ### fn `function logPromptWorkflowStateChange(` (L974-993)
5008
5026
  - @brief Appends one workflow-state debug entry for a bundled prompt when selected.
5009
5027
  - @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.
5010
5028
  - @param[in] projectBase {string} Absolute original project base path.
@@ -5015,7 +5033,7 @@ cost.
5015
5033
  - @return {void} No return value.
5016
5034
  - @satisfies REQ-245, REQ-246, REQ-247
5017
5035
 
5018
- ### fn `function logPromptWorkflowEvent(` (L1008-1028)
5036
+ ### fn `function logPromptWorkflowEvent(` (L1009-1029)
5019
5037
  - @brief Appends one dedicated prompt workflow debug entry when selected.
5020
5038
  - @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.
5021
5039
  - @param[in] projectBase {string} Absolute original project base path.
@@ -5029,7 +5047,7 @@ cost.
5029
5047
  - @return {void} No return value.
5030
5048
  - @satisfies REQ-245, REQ-246, REQ-247, REQ-277
5031
5049
 
5032
- ### fn `function transitionPromptWorkflowState(` (L1041-1054)
5050
+ ### fn `function transitionPromptWorkflowState(` (L1042-1055)
5033
5051
  - @brief Transitions one prompt workflow state and logs the transition immediately after the state update.
5034
5052
  - @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.
5035
5053
  - @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
@@ -5040,20 +5058,20 @@ cost.
5040
5058
  - @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
5041
5059
  - @return {void} No return value.
5042
5060
 
5043
- ### fn `function resolvePromptCommandDescription(` (L1062-1066)
5061
+ ### fn `function resolvePromptCommandDescription(` (L1063-1067)
5044
5062
  - @brief Resolves the runtime slash-command description for one bundled prompt.
5045
5063
  - @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.
5046
5064
  - @param[in] promptName {import("./core/prompt-command-catalog.js").PromptCommandName} Bundled prompt name.
5047
5065
  - @return {string} Runtime command description.
5048
5066
 
5049
- ### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L1075-1079)
5067
+ ### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L1076-1080)
5050
5068
  - @brief Resolves the original project base used for debug-log file writes.
5051
5069
  - @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.
5052
5070
  - @param[in] cwd {string} Current extension working directory.
5053
5071
  - @param[in] statusController {PiUsereqStatusController} Mutable status controller.
5054
5072
  - @return {string} Absolute original project base path for debug logging.
5055
5073
 
5056
- ### fn `function notifyContextSafely(` (L1090-1107)
5074
+ ### fn `function notifyContextSafely(` (L1091-1108)
5057
5075
  - @brief Delivers one best-effort UI notification without failing on stale replacement contexts.
5058
5076
  - @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.
5059
5077
  - @param[in] ctx {ExtensionContext | ExtensionCommandContext | undefined} Candidate UI context.
@@ -5062,7 +5080,7 @@ cost.
5062
5080
  - @return {boolean} `true` when the notification was delivered and `false` when the context was already stale.
5063
5081
  - @satisfies REQ-280
5064
5082
 
5065
- ### fn `function rejectNonIdleReqCommand(` (L1119-1139)
5083
+ ### fn `function rejectNonIdleReqCommand(` (L1120-1140)
5066
5084
  - @brief Rejects one non-`idle` req-command invocation and records the workflow error state.
5067
5085
  - @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.
5068
5086
  - @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
@@ -5072,20 +5090,20 @@ cost.
5072
5090
  - @throws {ReqError} Always throws because non-`idle` req commands are rejected.
5073
5091
  - @satisfies REQ-224
5074
5092
 
5075
- ### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L1148-1156)
5093
+ ### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L1149-1157)
5076
5094
  - @brief Returns the configurable active-tool inventory visible to the extension.
5077
5095
  - @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.
5078
5096
  - @param[in] pi {ExtensionAPI} Active extension API instance.
5079
5097
  - @return {ToolInfo[]} Sorted configurable tool descriptors.
5080
5098
  - @satisfies REQ-007, REQ-063, REQ-231, REQ-232
5081
5099
 
5082
- ### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L1164-1168)
5100
+ ### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L1165-1169)
5083
5101
  - @brief Normalizes and returns the configured enabled active tools.
5084
5102
  - @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"]`.
5085
5103
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5086
5104
  - @return {string[]} Normalized enabled tool names.
5087
5105
 
5088
- ### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L1178-1195)
5106
+ ### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L1179-1196)
5089
5107
  - @brief Applies the configured active-tool enablement to the current session.
5090
5108
  - @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(...)`.
5091
5109
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5093,7 +5111,7 @@ cost.
5093
5111
  - @return {void} No return value.
5094
5112
  - @satisfies REQ-009, REQ-064
5095
5113
 
5096
- ### fn `async function handleExtensionStatusEvent(` (L1208-1479)
5114
+ ### fn `async function handleExtensionStatusEvent(` (L1209-1480)
5097
5115
  - @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
5098
5116
  - @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.
5099
5117
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5104,7 +5122,7 @@ cost.
5104
5122
  - @return {Promise<void>} Promise resolved when hook processing completes.
5105
5123
  - @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
5106
5124
 
5107
- ### fn `function registerExtensionStatusHooks(` (L1495-1514)
5125
+ ### fn `function registerExtensionStatusHooks(` (L1496-1515)
5108
5126
  - @brief Registers shared wrappers for every supported pi lifecycle hook.
5109
5127
  - @details Installs one generic wrapper per intercepted hook so every resource,
5110
5128
  session, agent, model, tool, bash, and input event is routed through the
@@ -5118,7 +5136,7 @@ registered hook count. Side effects include hook registration.
5118
5136
  - @return {void} No return value.
5119
5137
  - @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
5120
5138
 
5121
- ### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1524-1527)
5139
+ ### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1525-1528)
5122
5140
  - @brief Replaces the configured active-tool selection and applies it immediately.
5123
5141
  - @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.
5124
5142
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5126,26 +5144,26 @@ registered hook count. Side effects include hook registration.
5126
5144
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5127
5145
  - @return {void} No return value.
5128
5146
 
5129
- ### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1535-1537)
5147
+ ### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1536-1538)
5130
5148
  - @brief Returns the canonical debug-tool toggle order.
5131
5149
  - @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.
5132
5150
  - @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
5133
5151
  - @satisfies REQ-242
5134
5152
 
5135
- ### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1546-1555)
5153
+ ### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1547-1556)
5136
5154
  - @brief Restores the debug configuration subtree to its documented defaults.
5137
5155
  - @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`.
5138
5156
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5139
5157
  - @return {void} No return value.
5140
5158
  - @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277, REQ-322
5141
5159
 
5142
- ### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1563-1569)
5160
+ ### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1564-1570)
5143
5161
  - @brief Formats the top-level Debug summary value.
5144
5162
  - @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.
5145
5163
  - @param[in] config {UseReqConfig} Effective project configuration.
5146
5164
  - @return {string} Compact debug summary string.
5147
5165
 
5148
- ### fn `function buildDebugMenuChoice(` (L1579-1592)
5166
+ ### fn `function buildDebugMenuChoice(` (L1580-1593)
5149
5167
  - @brief Builds one debug-menu row with optional disabled styling.
5150
5168
  - @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.
5151
5169
  - @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
@@ -5153,21 +5171,21 @@ registered hook count. Side effects include hook registration.
5153
5171
  - @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
5154
5172
  - @satisfies REQ-241
5155
5173
 
5156
- ### fn `async function selectDebugLogOnStatus(` (L1601-1629)
5174
+ ### fn `async function selectDebugLogOnStatus(` (L1602-1630)
5157
5175
  - @brief Opens the workflow-state filter selector used by the Debug submenu.
5158
5176
  - @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.
5159
5177
  - @param[in] ctx {ExtensionCommandContext} Active command context.
5160
5178
  - @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
5161
5179
  - @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
5162
5180
 
5163
- ### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1638-1724)
5181
+ ### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1639-1725)
5164
5182
  - @brief Builds the shared settings-menu choices for debug logging configuration.
5165
5183
  - @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.
5166
5184
  - @param[in] config {UseReqConfig} Effective project configuration.
5167
5185
  - @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
5168
5186
  - @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277, REQ-321, REQ-322
5169
5187
 
5170
- ### fn `async function configureDebugMenu(` (L1735-1925)
5188
+ ### fn `async function configureDebugMenu(` (L1736-1926)
5171
5189
  - @brief Runs the interactive Debug submenu.
5172
5190
  - @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.
5173
5191
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5176,47 +5194,47 @@ registered hook count. Side effects include hook registration.
5176
5194
  - @return {Promise<void>} Promise resolved when the submenu closes.
5177
5195
  - @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
5178
5196
 
5179
- ### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (L1741-1748)
5197
+ ### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (L1742-1749)
5180
5198
 
5181
- - type `type PiNotifyBooleanConfigKey =` (L1931)
5199
+ - type `type PiNotifyBooleanConfigKey =` (L1932)
5182
5200
  - @brief Represents one persisted boolean notification-setting key.
5183
5201
  - @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.
5184
- - type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1948)
5202
+ - type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1949)
5185
5203
  - @brief Represents one persisted boolean notification event-toggle key.
5186
5204
  - @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.
5187
- - type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1957)
5205
+ - type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1958)
5188
5206
  - @brief Represents one shared prompt-end event identifier used by notification menus.
5189
5207
  - @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.
5190
- ### iface `interface PiNotifyEventRowDefinition` (L1963-1967)
5208
+ ### iface `interface PiNotifyEventRowDefinition` (L1964-1968)
5191
5209
  - @brief Describes one shared prompt-end event row rendered inside notification event submenus.
5192
5210
  - @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.
5193
5211
 
5194
- ### iface `interface PiNotifyEventMenuDefinition` (L1973-1979)
5212
+ ### iface `interface PiNotifyEventMenuDefinition` (L1974-1980)
5195
5213
  - @brief Describes one notification-system event submenu contract.
5196
5214
  - @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.
5197
5215
 
5198
- ### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1988-1991)
5216
+ ### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1989-1992)
5199
5217
  - @brief Flips one persisted boolean notification setting.
5200
5218
  - @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`.
5201
5219
  - @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
5202
5220
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5203
5221
  - @return {boolean} Next enabled state.
5204
5222
 
5205
- ### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L2000-2024)
5223
+ ### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L2001-2025)
5206
5224
  - @brief Restores notification-related settings to their documented defaults.
5207
5225
  - @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`.
5208
5226
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5209
5227
  - @return {void} No return value.
5210
5228
  - @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
5211
5229
 
5212
- ### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2033-2035)
5230
+ ### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2034-2036)
5213
5231
  - @brief Formats one persisted Pushover priority for menu display.
5214
5232
  - @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.
5215
5233
  - @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
5216
5234
  - @return {string} Menu-display label.
5217
5235
  - @satisfies REQ-172
5218
5236
 
5219
- ### fn `function formatPiNotifyEventMenuSummary(` (L2119-2127)
5237
+ ### fn `function formatPiNotifyEventMenuSummary(` (L2120-2128)
5220
5238
  - @brief Formats the top-level summary value for one notification event submenu.
5221
5239
  - @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.
5222
5240
  - @param[in] config {UseReqConfig} Effective project configuration.
@@ -5224,7 +5242,7 @@ registered hook count. Side effects include hook registration.
5224
5242
  - @return {string} Compact enabled-toggle summary.
5225
5243
  - @satisfies REQ-198
5226
5244
 
5227
- ### fn `function buildPiNotifyEventLauncherChoice(` (L2137-2147)
5245
+ ### fn `function buildPiNotifyEventLauncherChoice(` (L2138-2148)
5228
5246
  - @brief Builds the top-level launcher row for one notification event submenu.
5229
5247
  - @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.
5230
5248
  - @param[in] config {UseReqConfig} Effective project configuration.
@@ -5232,7 +5250,7 @@ registered hook count. Side effects include hook registration.
5232
5250
  - @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
5233
5251
  - @satisfies REQ-181, REQ-183, REQ-165, REQ-198
5234
5252
 
5235
- ### fn `function buildPiNotifyEventMenuChoices(` (L2157-2173)
5253
+ ### fn `function buildPiNotifyEventMenuChoices(` (L2158-2174)
5236
5254
  - @brief Builds the shared settings-menu choices for one notification event submenu.
5237
5255
  - @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.
5238
5256
  - @param[in] config {UseReqConfig} Effective project configuration.
@@ -5240,7 +5258,7 @@ registered hook count. Side effects include hook registration.
5240
5258
  - @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
5241
5259
  - @satisfies REQ-188, REQ-193, REQ-198
5242
5260
 
5243
- ### fn `function resetPiNotifyEventMenuToDefaults(` (L2183-2191)
5261
+ ### fn `function resetPiNotifyEventMenuToDefaults(` (L2184-2192)
5244
5262
  - @brief Restores one notification event submenu to its documented defaults.
5245
5263
  - @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`.
5246
5264
  - @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
@@ -5248,7 +5266,7 @@ registered hook count. Side effects include hook registration.
5248
5266
  - @return {void} No return value.
5249
5267
  - @satisfies REQ-174, REQ-178, REQ-184, REQ-195
5250
5268
 
5251
- ### fn `function resolvePiNotifyEventLabel(` (L2201-2208)
5269
+ ### fn `function resolvePiNotifyEventLabel(` (L2202-2209)
5252
5270
  - @brief Resolves the human-readable event label for one event-toggle config key.
5253
5271
  - @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.
5254
5272
  - @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
@@ -5256,7 +5274,7 @@ registered hook count. Side effects include hook registration.
5256
5274
  - @return {string} Human-readable event label.
5257
5275
  - @satisfies REQ-188, REQ-198
5258
5276
 
5259
- ### fn `async function configurePiNotifyEventMenu(` (L2219-2295)
5277
+ ### fn `async function configurePiNotifyEventMenu(` (L2220-2296)
5260
5278
  - @brief Runs one dedicated notification event submenu.
5261
5279
  - @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.
5262
5280
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -5265,14 +5283,14 @@ registered hook count. Side effects include hook registration.
5265
5283
  - @return {Promise<void>} Promise resolved when the submenu closes.
5266
5284
  - @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
5267
5285
 
5268
- ### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2304-2354)
5286
+ ### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2305-2355)
5269
5287
  - @brief Builds the direct Pushover rows rendered inside `Notifications`.
5270
5288
  - @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.
5271
5289
  - @param[in] config {UseReqConfig} Effective project configuration.
5272
5290
  - @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
5273
5291
  - @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
5274
5292
 
5275
- ### fn `async function selectPiNotifyPushoverPriority(` (L2364-2392)
5293
+ ### fn `async function selectPiNotifyPushoverPriority(` (L2365-2393)
5276
5294
  - @brief Opens the shared settings-menu selector for Pushover priority.
5277
5295
  - @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.
5278
5296
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -5280,14 +5298,14 @@ registered hook count. Side effects include hook registration.
5280
5298
  - @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
5281
5299
  - @satisfies REQ-172, REQ-192
5282
5300
 
5283
- ### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2401-2459)
5301
+ ### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2402-2460)
5284
5302
  - @brief Builds the shared settings-menu choices for notification configuration.
5285
5303
  - @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.
5286
5304
  - @param[in] config {UseReqConfig} Effective project configuration.
5287
5305
  - @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
5288
5306
  - @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
5289
5307
 
5290
- ### fn `async function selectPiNotifySoundLevel(` (L2469-2509)
5308
+ ### fn `async function selectPiNotifySoundLevel(` (L2470-2510)
5291
5309
  - @brief Opens the shared settings-menu selector for the persisted boot sound level.
5292
5310
  - @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.
5293
5311
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -5295,7 +5313,7 @@ registered hook count. Side effects include hook registration.
5295
5313
  - @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected boot sound level, reset action, or `undefined` when cancelled.
5296
5314
  - @satisfies REQ-131, REQ-179, REQ-192, REQ-289
5297
5315
 
5298
- ### fn `async function configurePiNotifyMenu(` (L2519-2805)
5316
+ ### fn `async function configurePiNotifyMenu(` (L2520-2806)
5299
5317
  - @brief Runs the interactive notification-configuration menu.
5300
5318
  - @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.
5301
5319
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -5303,7 +5321,7 @@ registered hook count. Side effects include hook registration.
5303
5321
  - @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
5304
5322
  - @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
5305
5323
 
5306
- ### fn `function registerPiNotifyShortcut(` (L2820-2843)
5324
+ ### fn `function registerPiNotifyShortcut(` (L2821-2844)
5307
5325
  - @brief Registers the configurable notification-sound shortcut when supported.
5308
5326
  - @details Loads the current effective config, registers one raw pi shortcut when
5309
5327
  the runtime exposes `registerShortcut(...)`, cycles only the active runtime
@@ -5316,15 +5334,15 @@ registration and status updates.
5316
5334
  - @return {void} No return value.
5317
5335
  - @satisfies REQ-134, REQ-180, REQ-286, REQ-287
5318
5336
 
5319
- ### fn `function resolveReqResetPromptRequest(` (L2851-2877)
5337
+ ### fn `function resolveReqResetPromptRequest(` (L2852-2878)
5320
5338
  - @brief Resolves the prompt execution plan targeted by `req-reset` recovery.
5321
5339
  - @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.
5322
5340
  - @param[in] statusController {PiUsereqStatusController} Mutable status controller.
5323
5341
  - @return {PromptCommandExecutionPlan | undefined} Recoverable prompt execution plan when one remains available.
5324
5342
 
5325
- ### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2854-2861)
5343
+ ### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2855-2862)
5326
5344
 
5327
- ### fn `function registerReqResetCommand(` (L2887-2941)
5345
+ ### fn `function registerReqResetCommand(` (L2888-2942)
5328
5346
  - @brief Registers the specialized `req-reset` slash command.
5329
5347
  - @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.
5330
5348
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5332,7 +5350,7 @@ registration and status updates.
5332
5350
  - @return {void} No return value.
5333
5351
  - @satisfies REQ-304, REQ-305, REQ-306, REQ-307, REQ-308, REQ-309, REQ-310, REQ-311, REQ-312, REQ-313
5334
5352
 
5335
- ### fn `function registerReqReferencesCommand(` (L2951-2991)
5353
+ ### fn `function registerReqReferencesCommand(` (L2952-2992)
5336
5354
  - @brief Registers the specialized `req-references` slash command.
5337
5355
  - @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.
5338
5356
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5340,7 +5358,7 @@ registration and status updates.
5340
5358
  - @return {void} No return value.
5341
5359
  - @satisfies REQ-200, REQ-221, REQ-224, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303
5342
5360
 
5343
- ### fn `function registerPromptCommands(` (L3001-3117)
5361
+ ### fn `function registerPromptCommands(` (L3002-3118)
5344
5362
  - @brief Registers bundled prompt-backed commands with the extension.
5345
5363
  - @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.
5346
5364
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5348,14 +5366,14 @@ registration and status updates.
5348
5366
  - @return {void} No return value.
5349
5367
  - @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
5350
5368
 
5351
- ### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3127-3426)
5369
+ ### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3128-3427)
5352
5370
  - @brief Registers pi-usereq agent tools exposed to the model.
5353
5371
  - @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.
5354
5372
  - @param[in] pi {ExtensionAPI} Active extension API instance.
5355
5373
  - @return {void} No return value.
5356
5374
  - @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
5357
5375
 
5358
- ### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3471-3496)
5376
+ ### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3472-3497)
5359
5377
  - @brief Builds the shared settings-menu choices for startup-tool management.
5360
5378
  - @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.
5361
5379
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5363,7 +5381,7 @@ registration and status updates.
5363
5381
  - @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
5364
5382
  - @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
5365
5383
 
5366
- ### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3506-3520)
5384
+ ### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3507-3521)
5367
5385
  - @brief Builds the shared settings-menu choices for per-tool startup toggles.
5368
5386
  - @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.
5369
5387
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5371,7 +5389,7 @@ registration and status updates.
5371
5389
  - @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
5372
5390
  - @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
5373
5391
 
5374
- ### fn `async function configurePiUsereqToolsMenu(` (L3531-3648)
5392
+ ### fn `async function configurePiUsereqToolsMenu(` (L3532-3649)
5375
5393
  - @brief Runs the interactive active-tool configuration menu.
5376
5394
  - @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.
5377
5395
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5380,58 +5398,58 @@ registration and status updates.
5380
5398
  - @return {Promise<void>} Promise resolved when the menu closes.
5381
5399
  - @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
5382
5400
 
5383
- ### fn `function getStaticCheckLanguageConfigForMenu(` (L3657-3662)
5401
+ ### fn `function getStaticCheckLanguageConfigForMenu(` (L3658-3663)
5384
5402
  - @brief Resolves one static-check language config for menu rendering.
5385
5403
  - @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.
5386
5404
  - @param[in] config {UseReqConfig} Effective project configuration.
5387
5405
  - @param[in] language {string} Canonical language name.
5388
5406
  - @return {StaticCheckLanguageConfig} Resolved per-language config object.
5389
5407
 
5390
- ### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3670-3672)
5408
+ ### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3671-3673)
5391
5409
  - @brief Counts languages that currently expose at least one configured checker.
5392
5410
  - @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.
5393
5411
  - @param[in] config {UseReqConfig} Effective project configuration.
5394
5412
  - @return {number} Number of languages with at least one configured checker.
5395
5413
 
5396
- ### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3680-3682)
5414
+ ### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3681-3683)
5397
5415
  - @brief Counts languages whose static-check enable flag is on.
5398
5416
  - @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.
5399
5417
  - @param[in] config {UseReqConfig} Effective project configuration.
5400
5418
  - @return {number} Number of enabled languages.
5401
5419
 
5402
- ### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3691-3693)
5420
+ ### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3692-3694)
5403
5421
  - @brief Restores the documented static-check default configuration.
5404
5422
  - @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`.
5405
5423
  - @param[in,out] config {UseReqConfig} Mutable configuration object.
5406
5424
  - @return {void} No return value.
5407
5425
  - @satisfies REQ-250, REQ-251, REQ-252
5408
5426
 
5409
- ### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3701-3703)
5427
+ ### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3702-3704)
5410
5428
  - @brief Summarizes enabled and configured static-check languages.
5411
5429
  - @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.
5412
5430
  - @param[in] config {UseReqConfig} Effective project configuration.
5413
5431
  - @return {string} Compact summary string.
5414
5432
 
5415
- ### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3712-3744)
5433
+ ### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3713-3745)
5416
5434
  - @brief Builds the shared settings-menu choices for static-check management.
5417
5435
  - @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.
5418
5436
  - @param[in] config {UseReqConfig} Effective project configuration.
5419
5437
  - @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
5420
5438
  - @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
5421
5439
 
5422
- ### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3752-3769)
5440
+ ### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3753-3770)
5423
5441
  - @brief Builds the shared settings-menu choices for supported static-check languages.
5424
5442
  - @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.
5425
5443
  - @param[in] config {UseReqConfig} Effective project configuration.
5426
5444
  - @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
5427
5445
 
5428
- ### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3777-3794)
5446
+ ### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3778-3795)
5429
5447
  - @brief Builds the shared settings-menu choices for configured static-check languages.
5430
5448
  - @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.
5431
5449
  - @param[in] config {UseReqConfig} Effective project configuration.
5432
5450
  - @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
5433
5451
 
5434
- ### fn `async function configureStaticCheckMenu(` (L3804-3950)
5452
+ ### fn `async function configureStaticCheckMenu(` (L3805-3951)
5435
5453
  - @brief Runs the interactive static-check configuration menu.
5436
5454
  - @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.
5437
5455
  - @param[in] ctx {ExtensionCommandContext} Active command context.
@@ -5439,40 +5457,65 @@ registration and status updates.
5439
5457
  - @return {Promise<void>} Promise resolved when the menu closes.
5440
5458
  - @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
5441
5459
 
5442
- ### fn `function buildPiUsereqMenuChoices(` (L3960-4059)
5460
+ ### fn `function formatContextFilesSummary(config: UseReqConfig): string` (L3960-3962)
5461
+ - @brief Summarizes the `Context Files` flag state for the top-level menu value column.
5462
+ - @details Renders the three context-file flags as compact `name:on|off` segments in the documented order so the top-level row reflects the current injection configuration. Runtime is O(1). No external state is mutated.
5463
+ - @param[in] config {UseReqConfig} Effective project configuration.
5464
+ - @return {string} Compact `Context Files` summary string.
5465
+ - @satisfies REQ-327
5466
+
5467
+ ### fn `function buildContextFilesMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3971-3998)
5468
+ - @brief Builds the shared settings-menu choices for the `Context Files` submenu.
5469
+ - @details Exposes one inline on|off toggle row per context file in the documented `REQUIREMENTS.md`, `REFERENCES.md`, `WORKFLOW.md` order plus a value-less subtree-local `Reset defaults` row. Runtime is O(1). No external state is mutated.
5470
+ - @param[in] config {UseReqConfig} Effective project configuration.
5471
+ - @return {PiUsereqSettingsMenuChoice[]} Ordered `Context Files` submenu choices.
5472
+ - @satisfies REQ-327, REQ-328, REQ-333
5473
+
5474
+ ### fn `async function configureContextFilesMenu(` (L4009-4067)
5475
+ - @brief Runs the `Context Files` configuration submenu.
5476
+ - @details Loads the shared settings menu with the three context-file toggle rows, persists each inline toggle immediately through the shared change callback, restores all three flags to enabled on approved subtree reset, preserves focus on the toggled row, and returns to the top-level menu on cancel. Runtime depends on user interaction count. Side effects include config writes and UI notifications.
5477
+ - @param[in] ctx {ExtensionCommandContext} Active command context.
5478
+ - @param[in] onConfigChange {() => void} Shared persistence-plus-status callback.
5479
+ - @param[in,out] config {UseReqConfig} Mutable effective project configuration.
5480
+ - @return {Promise<void>} Promise resolved when the submenu closes.
5481
+ - @satisfies REQ-327, REQ-328, REQ-333
5482
+
5483
+ ### fn `const setFlag = (flagKey: "context-files-requirements" | "context-files-references" | "context-files-workflow", enabled: boolean): void =>` (L4014-4018)
5484
+
5485
+ ### fn `function buildPiUsereqMenuChoices(` (L4077-4182)
5443
5486
  - @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
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.
5487
+ - @details Serializes primary configuration actions into right-valued menu rows consumed by the shared settings-menu renderer, including the `Context Files` injection toggles, automatic git-commit mode, effective prompt-command worktree state, notification summary, debug summary, locked worktree rows when automatic git commit is disabled, and display-only local plus global config paths. Runtime is O(s) in source-directory count. No external state is mutated.
5445
5488
  - @param[in] cwd {string} Current working directory.
5446
5489
  - @param[in] config {UseReqConfig} Effective project configuration.
5447
5490
  - @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
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
5491
+ - @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-162, REQ-190, REQ-191, REQ-197, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-314, REQ-318, REQ-319, REQ-320, REQ-326
5449
5492
 
5450
- ### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4068-4086)
5493
+ ### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4191-4209)
5451
5494
  - @brief Builds the shared settings-menu choices for source-directory management.
5452
5495
  - @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.
5453
5496
  - @param[in] config {UseReqConfig} Effective project configuration.
5454
5497
  - @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
5455
5498
  - @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
5456
5499
 
5457
- ### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4095-4107)
5500
+ ### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4218-4230)
5458
5501
  - @brief Builds the shared settings-menu choices for removing one source-directory entry.
5459
5502
  - @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.
5460
5503
  - @param[in] config {UseReqConfig} Effective project configuration.
5461
5504
  - @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
5462
5505
  - @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
5463
5506
 
5464
- ### fn `async function configurePiUsereq(` (L4118-4371)
5507
+ ### fn `async function configurePiUsereq(` (L4241-4499)
5465
5508
  - @brief Runs the top-level pi-usereq configuration menu.
5466
5509
  - @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.
5467
5510
  - @param[in] pi {ExtensionAPI} Active extension API instance.
5468
5511
  - @param[in] ctx {ExtensionCommandContext} Active command context.
5469
5512
  - @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
5470
5513
  - @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
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
5514
+ - @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-162, REQ-190, REQ-191, REQ-192, REQ-194, REQ-195, REQ-204, REQ-205, REQ-212, REQ-215, REQ-216, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-314, REQ-318, REQ-319, REQ-320, REQ-326, REQ-327, REQ-328, REQ-333
5472
5515
 
5473
- ### fn `const persistConfigChange = () =>` (L4129-4134)
5516
+ ### fn `const persistConfigChange = () =>` (L4252-4257)
5474
5517
 
5475
- ### fn `function registerConfigCommands(` (L4381-4391)
5518
+ ### fn `function registerConfigCommands(` (L4509-4519)
5476
5519
  - @brief Registers configuration-management commands.
5477
5520
  - @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.
5478
5521
  - @param[in] pi {ExtensionAPI} Active extension API instance.
@@ -5480,116 +5523,120 @@ registration and status updates.
5480
5523
  - @return {void} No return value.
5481
5524
  - @satisfies REQ-006, REQ-031
5482
5525
 
5483
- ### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4400-4413)
5526
+ ### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4528-4541)
5484
5527
  - @brief Registers the complete pi-usereq extension.
5485
5528
  - @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.
5486
5529
  - @param[in] pi {ExtensionAPI} Active extension API instance.
5487
5530
  - @return {void} No return value.
5488
- - @satisfies DES-002, DES-015, REQ-004, REQ-005, REQ-009, REQ-044, REQ-067, REQ-068, REQ-109, REQ-111, REQ-112, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117, REQ-118, REQ-119, REQ-120, REQ-121, REQ-122, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-131, REQ-132, REQ-133, REQ-134, REQ-137, REQ-159, REQ-163, REQ-164, REQ-165, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-174, REQ-179, REQ-180, REQ-184, REQ-188, REQ-190, REQ-191, REQ-192, REQ-193, REQ-194, REQ-195, REQ-196, REQ-197, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-244, REQ-245, REQ-246, REQ-247, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303, REQ-304, REQ-305, REQ-306, REQ-312, REQ-313, REQ-323, REQ-324, REQ-325
5531
+ - @satisfies DES-002, DES-015, REQ-004, REQ-005, REQ-009, REQ-044, REQ-067, REQ-068, REQ-109, REQ-111, REQ-112, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117, REQ-118, REQ-119, REQ-120, REQ-121, REQ-122, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-131, REQ-132, REQ-133, REQ-134, REQ-137, REQ-159, REQ-163, REQ-164, REQ-165, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-174, REQ-179, REQ-180, REQ-184, REQ-188, REQ-190, REQ-191, REQ-192, REQ-193, REQ-194, REQ-195, REQ-196, REQ-197, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-244, REQ-245, REQ-246, REQ-247, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303, REQ-304, REQ-305, REQ-306, REQ-312, REQ-313, REQ-323, REQ-324, REQ-325, REQ-326, REQ-327
5489
5532
 
5490
5533
  ## Symbol Index
5491
5534
  |Symbol|Kind|Vis|Lines|Sig|
5492
5535
  |---|---|---|---|---|
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...|
5536
+ |`PiShortcutRegistrar`|iface||182-190|interface PiShortcutRegistrar|
5537
+ |`getProjectBase`|fn||198-207|function getProjectBase(cwd: string): string|
5538
+ |`getProcessCwdSafe`|fn||214-223|function getProcessCwdSafe(): string|
5539
+ |`resolveLiveBootstrapCwd`|fn||231-243|function resolveLiveBootstrapCwd(cwd: string): string|
5540
+ |`syncContextCwdMirror`|fn||252-261|function syncContextCwdMirror(ctx: { cwd?: string }, cwd:...|
5541
+ |`loadProjectConfig`|fn||270-273|function loadProjectConfig(cwd: string): UseReqConfig|
5542
+ |`DebugToolCommandExecuteResult`|type||279||
5543
+ |`shouldRegisterDebugToolCommands`|fn||288-294|function shouldRegisterDebugToolCommands(cwd: string): bo...|
5544
+ |`writeDebugToolCommandResultToEditor`|fn||305-319|function writeDebugToolCommandResultToEditor(|
5545
+ |`executeDebugToolCommand`|fn||331-349|function executeDebugToolCommand(|
5546
+ |`registerDebugToolCommands`|fn||358-397|function registerDebugToolCommands(pi: ExtensionAPI): void|
5547
+ |`saveProjectConfig`|fn||407-410|function saveProjectConfig(cwd: string, config: UseReqCon...|
5548
+ |`formatLocalConfigPathForMenu`|fn||419-423|function formatLocalConfigPathForMenu(cwd: string): string|
5549
+ |`formatGlobalConfigPathForMenu`|fn||431-433|function formatGlobalConfigPathForMenu(): string|
5550
+ |`buildTerminalSettingsMenuChoices`|fn||442-453|function buildTerminalSettingsMenuChoices(options:|
5551
+ |`ResetConfirmationChange`|iface||459-463|interface ResetConfirmationChange|
5552
+ |`formatResetConfirmationValue`|fn||472-474|function formatResetConfirmationValue(previousValue: stri...|
5553
+ |`buildResetConfirmationChoices`|fn||484-523|function buildResetConfirmationChoices(|
5554
+ |`confirmResetChanges`|fn||535-548|async function confirmResetChanges(|
5555
+ |`writePersistedConfigToEditor`|fn||557-562|function writePersistedConfigToEditor(|
5556
+ |`writePersistedLocalConfigToEditor`|fn||572-578|function writePersistedLocalConfigToEditor(|
5557
+ |`writePersistedGlobalConfigToEditor`|fn||587-591|function writePersistedGlobalConfigToEditor(|
5558
+ |`buildSearchToolSupportedTagGuidelines`|fn||652-656|function buildSearchToolSupportedTagGuidelines(): string[]|
5559
+ |`buildSearchToolSchemaDescription`|fn||664-669|function buildSearchToolSchemaDescription(scope: FindTool...|
5560
+ |`buildSearchToolPromptGuidelines`|fn||677-690|function buildSearchToolPromptGuidelines(scope: FindToolS...|
5561
+ |`MonolithicToolRenderResult`|type||696||
5562
+ |`getMonolithicToolText`|fn||713-716|function getMonolithicToolText(result: MonolithicToolRend...|
5563
+ |`getMonolithicToolErrorText`|fn||724-734|function getMonolithicToolErrorText(result: MonolithicToo...|
5564
+ |`formatCompactToolArgumentValue`|fn||742-781|function formatCompactToolArgumentValue(value: unknown): ...|
5565
+ |`buildCompactToolInvocationText`|fn||789-800|function buildCompactToolInvocationText(args: Record<stri...|
5566
+ |`summarizeStructuredToolResult`|fn||810-825|function summarizeStructuredToolResult(|
5567
+ |`buildStructuredToolRenderResult`|fn||834-853|function buildStructuredToolRenderResult(toolName: string)|
5568
+ |`executeMonolithicTool`|fn||861-867|function executeMonolithicTool(operation: () => ToolResul...|
5569
+ |`executeStatusTool`|fn||876-905|function executeStatusTool(operation: () => ToolResult): ...|
5570
+ |`deliverPromptCommand`|fn||916-934|function deliverPromptCommand(|
5571
+ |`shouldIgnoreLatePromptDeliveryFailure`|fn||945-961|function shouldIgnoreLatePromptDeliveryFailure(|
5572
+ |`logPromptWorkflowStateChange`|fn||974-993|function logPromptWorkflowStateChange(|
5573
+ |`logPromptWorkflowEvent`|fn||1009-1029|function logPromptWorkflowEvent(|
5574
+ |`transitionPromptWorkflowState`|fn||1042-1055|function transitionPromptWorkflowState(|
5575
+ |`resolvePromptCommandDescription`|fn||1063-1067|function resolvePromptCommandDescription(|
5576
+ |`resolveDebugProjectBase`|fn||1076-1080|function resolveDebugProjectBase(cwd: string, statusContr...|
5577
+ |`notifyContextSafely`|fn||1091-1108|function notifyContextSafely(|
5578
+ |`rejectNonIdleReqCommand`|fn||1120-1140|function rejectNonIdleReqCommand(|
5579
+ |`getPiUsereqStartupTools`|fn||1149-1157|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
5580
+ |`getConfiguredEnabledPiUsereqTools`|fn||1165-1169|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
5581
+ |`applyConfiguredPiUsereqTools`|fn||1179-1196|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
5582
+ |`handleExtensionStatusEvent`|fn||1209-1480|async function handleExtensionStatusEvent(|
5583
+ |`registerExtensionStatusHooks`|fn||1496-1515|function registerExtensionStatusHooks(|
5584
+ |`setConfiguredPiUsereqTools`|fn||1525-1528|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
5585
+ |`getDebugToolToggleNames`|fn||1536-1538|function getDebugToolToggleNames(): PiUsereqStartupToolNa...|
5586
+ |`resetDebugConfigToDefaults`|fn||1547-1556|function resetDebugConfigToDefaults(config: UseReqConfig)...|
5587
+ |`formatDebugMenuSummary`|fn||1564-1570|function formatDebugMenuSummary(config: UseReqConfig): st...|
5588
+ |`buildDebugMenuChoice`|fn||1580-1593|function buildDebugMenuChoice(|
5589
+ |`selectDebugLogOnStatus`|fn||1602-1630|async function selectDebugLogOnStatus(|
5590
+ |`buildDebugMenuChoices`|fn||1639-1725|function buildDebugMenuChoices(config: UseReqConfig): PiU...|
5591
+ |`configureDebugMenu`|fn||1736-1926|async function configureDebugMenu(|
5592
+ |`updateDebugToolCommandsEnabled`|fn||1742-1749|const updateDebugToolCommandsEnabled = (nextValue: unknow...|
5593
+ |`PiNotifyBooleanConfigKey`|type||1932||
5594
+ |`PiNotifyEventBooleanConfigKey`|type||1949||
5595
+ |`PiNotifyEventId`|type||1958||
5596
+ |`PiNotifyEventRowDefinition`|iface||1964-1968|interface PiNotifyEventRowDefinition|
5597
+ |`PiNotifyEventMenuDefinition`|iface||1974-1980|interface PiNotifyEventMenuDefinition|
5598
+ |`togglePiNotifyFlag`|fn||1989-1992|function togglePiNotifyFlag(config: UseReqConfig, key: Pi...|
5599
+ |`resetPiNotifyConfigToDefaults`|fn||2001-2025|function resetPiNotifyConfigToDefaults(config: UseReqConf...|
5600
+ |`formatPiNotifyPushoverPriority`|fn||2034-2036|function formatPiNotifyPushoverPriority(priority: PiNotif...|
5601
+ |`formatPiNotifyEventMenuSummary`|fn||2120-2128|function formatPiNotifyEventMenuSummary(|
5602
+ |`buildPiNotifyEventLauncherChoice`|fn||2138-2148|function buildPiNotifyEventLauncherChoice(|
5603
+ |`buildPiNotifyEventMenuChoices`|fn||2158-2174|function buildPiNotifyEventMenuChoices(|
5604
+ |`resetPiNotifyEventMenuToDefaults`|fn||2184-2192|function resetPiNotifyEventMenuToDefaults(|
5605
+ |`resolvePiNotifyEventLabel`|fn||2202-2209|function resolvePiNotifyEventLabel(|
5606
+ |`configurePiNotifyEventMenu`|fn||2220-2296|async function configurePiNotifyEventMenu(|
5607
+ |`buildPiNotifyPushoverRows`|fn||2305-2355|function buildPiNotifyPushoverRows(config: UseReqConfig):...|
5608
+ |`selectPiNotifyPushoverPriority`|fn||2365-2393|async function selectPiNotifyPushoverPriority(|
5609
+ |`buildPiNotifyMenuChoices`|fn||2402-2460|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
5610
+ |`selectPiNotifySoundLevel`|fn||2470-2510|async function selectPiNotifySoundLevel(|
5611
+ |`configurePiNotifyMenu`|fn||2520-2806|async function configurePiNotifyMenu(|
5612
+ |`registerPiNotifyShortcut`|fn||2821-2844|function registerPiNotifyShortcut(|
5613
+ |`resolveReqResetPromptRequest`|fn||2852-2878|function resolveReqResetPromptRequest(|
5614
+ |`isWorktreeBacked`|fn||2855-2862|const isWorktreeBacked = (request: PromptCommandExecution...|
5615
+ |`registerReqResetCommand`|fn||2888-2942|function registerReqResetCommand(|
5616
+ |`registerReqReferencesCommand`|fn||2952-2992|function registerReqReferencesCommand(|
5617
+ |`registerPromptCommands`|fn||3002-3118|function registerPromptCommands(|
5618
+ |`registerAgentTools`|fn||3128-3427|function registerAgentTools(pi: ExtensionAPI): void|
5619
+ |`buildPiUsereqToolsMenuChoices`|fn||3472-3497|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
5620
+ |`buildPiUsereqToolToggleChoices`|fn||3507-3521|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
5621
+ |`configurePiUsereqToolsMenu`|fn||3532-3649|async function configurePiUsereqToolsMenu(|
5622
+ |`getStaticCheckLanguageConfigForMenu`|fn||3658-3663|function getStaticCheckLanguageConfigForMenu(|
5623
+ |`countConfiguredStaticCheckLanguages`|fn||3671-3673|function countConfiguredStaticCheckLanguages(config: UseR...|
5624
+ |`countEnabledStaticCheckLanguages`|fn||3681-3683|function countEnabledStaticCheckLanguages(config: UseReqC...|
5625
+ |`resetStaticCheckConfig`|fn||3692-3694|function resetStaticCheckConfig(config: UseReqConfig): void|
5626
+ |`formatStaticCheckLanguagesSummary`|fn||3702-3704|function formatStaticCheckLanguagesSummary(config: UseReq...|
5627
+ |`buildStaticCheckMenuChoices`|fn||3713-3745|function buildStaticCheckMenuChoices(config: UseReqConfig...|
5628
+ |`buildSupportedStaticCheckLanguageChoices`|fn||3753-3770|function buildSupportedStaticCheckLanguageChoices(config:...|
5629
+ |`buildConfiguredStaticCheckLanguageChoices`|fn||3778-3795|function buildConfiguredStaticCheckLanguageChoices(config...|
5630
+ |`configureStaticCheckMenu`|fn||3805-3951|async function configureStaticCheckMenu(|
5631
+ |`formatContextFilesSummary`|fn||3960-3962|function formatContextFilesSummary(config: UseReqConfig):...|
5632
+ |`buildContextFilesMenuChoices`|fn||3971-3998|function buildContextFilesMenuChoices(config: UseReqConfi...|
5633
+ |`configureContextFilesMenu`|fn||4009-4067|async function configureContextFilesMenu(|
5634
+ |`setFlag`|fn||4014-4018|const setFlag = (flagKey: "context-files-requirements" | ...|
5635
+ |`buildPiUsereqMenuChoices`|fn||4077-4182|function buildPiUsereqMenuChoices(|
5636
+ |`buildSrcDirMenuChoices`|fn||4191-4209|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
5637
+ |`buildSrcDirRemovalChoices`|fn||4218-4230|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
5638
+ |`configurePiUsereq`|fn||4241-4499|async function configurePiUsereq(|
5639
+ |`persistConfigChange`|fn||4252-4257|const persistConfigChange = () =>|
5640
+ |`registerConfigCommands`|fn||4509-4519|function registerConfigCommands(|
5641
+ |`piUsereqExtension`|fn||4528-4541|export default function piUsereqExtension(pi: ExtensionAP...|
5595
5642