pi-usereq 0.13.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-npm.yml +8 -7
- package/.gitignore +1 -2
- package/CHANGELOG.md +140 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +407 -348
- package/pi-usereq/docs/REQUIREMENTS.md +19 -8
- package/pi-usereq/docs/WORKFLOW.md +16 -6
- package/src/core/config.ts +19 -7
- package/src/core/debug-runtime.ts +24 -0
- package/src/index.ts +167 -10
- package/tests/extension-registration.test.ts +144 -5
- package/tests/release-workflow.test.ts +3 -2
- package/scripts/lib/extension-debug-harness.ts +0 -443
- package/scripts/lib/recording-extension-api.ts +0 -855
- package/scripts/lib/sdk-smoke.ts +0 -503
|
@@ -581,7 +581,7 @@ import { buildLanguageSpecs } from "./source-analyzer.js";
|
|
|
581
581
|
|
|
582
582
|
---
|
|
583
583
|
|
|
584
|
-
# config.ts | TypeScript |
|
|
584
|
+
# config.ts | TypeScript | 1153L | 43 symbols | 8 imports | 52 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`.
|
|
@@ -600,87 +600,87 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
600
600
|
|
|
601
601
|
## Definitions
|
|
602
602
|
|
|
603
|
-
### iface `export interface StaticCheckEntry` (
|
|
603
|
+
### iface `export interface StaticCheckEntry` (L58-62)
|
|
604
604
|
- @brief Describes one static-check module configuration entry.
|
|
605
605
|
- @details Each record identifies the checker module and optional command or parameter list used during per-language static analysis dispatch. The interface is type-only and has no runtime cost.
|
|
606
606
|
|
|
607
|
-
- type `export type StaticCheckEnabled = "enable" | "disable";` (
|
|
607
|
+
- type `export type StaticCheckEnabled = "enable" | "disable";` (L68)
|
|
608
608
|
- @brief Represents the persisted per-language static-check enable flag.
|
|
609
609
|
- @details Narrows persisted per-language enablement to the documented `enable|disable` domain reused by configuration loading, menu toggles, and static-check dispatch. The alias is compile-time only and introduces no runtime cost.
|
|
610
|
-
### iface `export interface StaticCheckLanguageConfig` (
|
|
610
|
+
### iface `export interface StaticCheckLanguageConfig` (L74-77)
|
|
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` (
|
|
614
|
+
### iface `export interface UseReqConfig` (L83-122)
|
|
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` (
|
|
618
|
+
### iface `interface LocalStaticCheckLanguageConfig` (L128-130)
|
|
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` (
|
|
622
|
+
### iface `interface GlobalStaticCheckLanguageConfig` (L136-138)
|
|
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` (
|
|
626
|
+
### iface `interface UseReqLocalConfig` (L144-157)
|
|
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` (
|
|
630
|
+
### iface `interface UseReqGlobalConfig` (L163-191)
|
|
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` (
|
|
634
|
+
### fn `function cloneStaticCheckEntry(entry: StaticCheckEntry): StaticCheckEntry` (L308-317)
|
|
635
635
|
- @brief Clones one static-check entry into its persisted shape.
|
|
636
636
|
- @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
637
|
- @param[in] entry {StaticCheckEntry} Source static-check entry.
|
|
638
638
|
- @return {StaticCheckEntry} Persistable static-check entry clone.
|
|
639
639
|
|
|
640
|
-
### fn `export function createStaticCheckLanguageConfig(` (
|
|
640
|
+
### fn `export function createStaticCheckLanguageConfig(` (L326-335)
|
|
641
641
|
- @brief Builds one per-language static-check configuration object.
|
|
642
642
|
- @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
643
|
- @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
|
|
644
644
|
- @param[in] enabled {StaticCheckEnabled | undefined} Optional explicit enable flag.
|
|
645
645
|
- @return {StaticCheckLanguageConfig} Normalized per-language config object.
|
|
646
646
|
|
|
647
|
-
### fn `function createLocalStaticCheckLanguageConfig(` (
|
|
647
|
+
### fn `function createLocalStaticCheckLanguageConfig(` (L343-347)
|
|
648
648
|
- @brief Builds one persisted local static-check language configuration object.
|
|
649
649
|
- @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
650
|
- @param[in] enabled {StaticCheckEnabled} Canonical per-language enable flag.
|
|
651
651
|
- @return {LocalStaticCheckLanguageConfig} Persistable local static-check language config.
|
|
652
652
|
|
|
653
|
-
### fn `function createGlobalStaticCheckLanguageConfig(` (
|
|
653
|
+
### fn `function createGlobalStaticCheckLanguageConfig(` (L355-361)
|
|
654
654
|
- @brief Builds one persisted global static-check language configuration object.
|
|
655
655
|
- @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
656
|
- @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
|
|
657
657
|
- @return {GlobalStaticCheckLanguageConfig} Persistable global static-check language config.
|
|
658
658
|
|
|
659
|
-
### fn `function getDefaultGlobalStaticCheckConfig(): Record<string, GlobalStaticCheckLanguageConfig>` (
|
|
659
|
+
### fn `function getDefaultGlobalStaticCheckConfig(): Record<string, GlobalStaticCheckLanguageConfig>` (L368-373)
|
|
660
660
|
- @brief Returns the documented default global static-check checker map.
|
|
661
661
|
- @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
662
|
- @return {Record<string, GlobalStaticCheckLanguageConfig>} Fresh default global checker map.
|
|
663
663
|
|
|
664
|
-
### fn `function getDefaultLocalStaticCheckConfig(` (
|
|
664
|
+
### fn `function getDefaultLocalStaticCheckConfig(` (L381-390)
|
|
665
665
|
- @brief Returns the documented default local static-check enable map.
|
|
666
666
|
- @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
667
|
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker map used to derive default enablement.
|
|
668
668
|
- @return {Record<string, LocalStaticCheckLanguageConfig>} Fresh default local enable map.
|
|
669
669
|
|
|
670
|
-
### fn `function mergeStaticCheckConfig(` (
|
|
670
|
+
### fn `function mergeStaticCheckConfig(` (L399-418)
|
|
671
671
|
- @brief Merges local enable flags with global checker definitions into the effective static-check map.
|
|
672
672
|
- @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
673
|
- @param[in] localStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Persisted local enable map.
|
|
674
674
|
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Persisted global checker map.
|
|
675
675
|
- @return {Record<string, StaticCheckLanguageConfig>} Effective per-language static-check config.
|
|
676
676
|
|
|
677
|
-
### fn `export function getDefaultStaticCheckConfig(): Record<string, StaticCheckLanguageConfig>` (
|
|
677
|
+
### fn `export function getDefaultStaticCheckConfig(): Record<string, StaticCheckLanguageConfig>` (L426-432)
|
|
678
678
|
- @brief Returns the documented default static-check configuration.
|
|
679
679
|
- @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
680
|
- @return {Record<string, StaticCheckLanguageConfig>} Fresh default effective static-check config.
|
|
681
681
|
- @satisfies REQ-249, REQ-250, REQ-251, REQ-252, REQ-316
|
|
682
682
|
|
|
683
|
-
### fn `export function normalizeStaticCheckEnabled(` (
|
|
683
|
+
### fn `export function normalizeStaticCheckEnabled(` (L442-447)
|
|
684
684
|
- @brief Normalizes one persisted per-language static-check enable flag.
|
|
685
685
|
- @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
686
|
- @param[in] value {unknown} Candidate persisted enable flag.
|
|
@@ -688,7 +688,7 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
688
688
|
- @return {StaticCheckEnabled} Canonical per-language enable flag.
|
|
689
689
|
- @satisfies REQ-249
|
|
690
690
|
|
|
691
|
-
### fn `export function getActiveStaticCheckEntries(` (
|
|
691
|
+
### fn `export function getActiveStaticCheckEntries(` (L457-466)
|
|
692
692
|
- @brief Resolves the active checker list for one language.
|
|
693
693
|
- @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
694
|
- @param[in] staticCheckConfig {Record<string, StaticCheckLanguageConfig>} Effective static-check config.
|
|
@@ -696,21 +696,21 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
696
696
|
- @return {StaticCheckEntry[]} Active checker list for the language.
|
|
697
697
|
- @satisfies REQ-019
|
|
698
698
|
|
|
699
|
-
### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (
|
|
699
|
+
### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (L481-483)
|
|
700
700
|
- @brief Normalizes one persisted automatic git-commit mode value.
|
|
701
701
|
- @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
702
|
- @param[in] value {unknown} Candidate persisted automatic git-commit payload.
|
|
703
703
|
- @return {"enable" | "disable"} Canonical automatic git-commit mode.
|
|
704
704
|
- @satisfies REQ-212
|
|
705
705
|
|
|
706
|
-
### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (
|
|
706
|
+
### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (L497-499)
|
|
707
707
|
- @brief Normalizes one persisted worktree-enable flag value.
|
|
708
708
|
- @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
709
|
- @param[in] value {unknown} Candidate persisted worktree-enable payload.
|
|
710
710
|
- @return {"enable" | "disable"} Canonical persisted worktree-enable mode.
|
|
711
711
|
- @satisfies REQ-204
|
|
712
712
|
|
|
713
|
-
### fn `export function resolveEffectiveGitWorktreeEnabled(` (
|
|
713
|
+
### fn `export function resolveEffectiveGitWorktreeEnabled(` (L508-513)
|
|
714
714
|
- @brief Resolves the effective worktree mode after automatic-commit policy is applied.
|
|
715
715
|
- @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
716
|
- @param[in] autoGitCommit {"enable" | "disable"} Effective automatic git-commit mode.
|
|
@@ -718,63 +718,64 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
718
718
|
- @return {"enable" | "disable"} Effective worktree mode used by menus, persistence, and prompt execution.
|
|
719
719
|
- @satisfies REQ-204, REQ-215
|
|
720
720
|
|
|
721
|
-
### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (
|
|
721
|
+
### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (L527-533)
|
|
722
722
|
- @brief Normalizes one persisted worktree-name prefix value.
|
|
723
723
|
- @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
724
|
- @param[in] value {unknown} Candidate persisted prefix payload.
|
|
725
725
|
- @return {string} Canonical worktree-name prefix.
|
|
726
726
|
- @satisfies REQ-205
|
|
727
727
|
|
|
728
|
-
### fn `export function getProjectConfigPath(projectBase: string): string` (
|
|
728
|
+
### fn `export function getProjectConfigPath(projectBase: string): string` (L540-542)
|
|
729
729
|
- @brief Computes the per-project local config file path.
|
|
730
730
|
- @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
731
|
- @param[in] projectBase {string} Absolute project root path.
|
|
732
732
|
- @return {string} Absolute local config file path.
|
|
733
733
|
|
|
734
|
-
### fn `export function getGlobalConfigPath(): string` (
|
|
734
|
+
### fn `export function getGlobalConfigPath(): string` (L549-551)
|
|
735
735
|
- @brief Computes the cross-project global config file path.
|
|
736
736
|
- @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
737
|
- @return {string} Absolute global config file path.
|
|
738
738
|
|
|
739
|
-
### fn `function getDefaultLocalConfig(` (
|
|
739
|
+
### fn `function getDefaultLocalConfig(` (L560-577)
|
|
740
740
|
- @brief Builds the default persisted local configuration.
|
|
741
|
-
- @details Populates canonical docs/test/source directories, derives local static-check enable defaults from the supplied global checker definitions, and seeds documented debug defaults without any cross-project fields. Runtime is O(l). No filesystem side effects occur.
|
|
741
|
+
- @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
742
|
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker definitions used to derive local enable defaults.
|
|
743
743
|
- @return {UseReqLocalConfig} Fresh default local configuration object.
|
|
744
|
+
- @satisfies CTN-019
|
|
744
745
|
|
|
745
|
-
### fn `function getDefaultGlobalConfig(): UseReqGlobalConfig` (
|
|
746
|
+
### fn `function getDefaultGlobalConfig(): UseReqGlobalConfig` (L584-614)
|
|
746
747
|
- @brief Builds the default persisted global configuration.
|
|
747
748
|
- @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.
|
|
748
749
|
- @return {UseReqGlobalConfig} Fresh default global configuration object.
|
|
749
750
|
|
|
750
|
-
### fn `function mergeConfigScopes(` (
|
|
751
|
+
### fn `function mergeConfigScopes(` (L623-690)
|
|
751
752
|
- @brief Merges persisted local and global configuration scopes into the effective runtime config.
|
|
752
|
-
- @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, and disables Pushover until both credentials are populated. Runtime is O(l + c + p). No external state is mutated.
|
|
753
|
+
- @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.
|
|
753
754
|
- @param[in] localConfig {UseReqLocalConfig} Persisted local configuration.
|
|
754
755
|
- @param[in] globalConfig {UseReqGlobalConfig} Persisted global configuration.
|
|
755
756
|
- @return {UseReqConfig} Effective merged configuration.
|
|
756
757
|
|
|
757
|
-
### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (
|
|
758
|
+
### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (L699-705)
|
|
758
759
|
- @brief Builds the default effective configuration.
|
|
759
760
|
- @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.
|
|
760
761
|
- @param[in] _projectBase {string} Absolute project root path retained for stable call sites.
|
|
761
762
|
- @return {UseReqConfig} Fresh default effective configuration object.
|
|
762
|
-
- @satisfies CTN-001, CTN-012, CTN-013, CTN-018, 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
|
|
763
|
+
- @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
|
|
763
764
|
|
|
764
|
-
### fn `function normalizeStaticCheckEntries(value: unknown): StaticCheckEntry[]` (
|
|
765
|
+
### fn `function normalizeStaticCheckEntries(value: unknown): StaticCheckEntry[]` (L713-733)
|
|
765
766
|
- @brief Normalizes one raw checker-entry array from persisted config.
|
|
766
767
|
- @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.
|
|
767
768
|
- @param[in] value {unknown} Candidate persisted checker array.
|
|
768
769
|
- @return {StaticCheckEntry[]} Normalized checker-entry vector.
|
|
769
770
|
|
|
770
|
-
### fn `function readConfigPayload(configPath: string): Record<string, unknown> | undefined` (
|
|
771
|
+
### fn `function readConfigPayload(configPath: string): Record<string, unknown> | undefined` (L742-758)
|
|
771
772
|
- @brief Reads and validates one persisted config payload.
|
|
772
773
|
- @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.
|
|
773
774
|
- @param[in] configPath {string} Absolute config file path.
|
|
774
775
|
- @return {Record<string, unknown> | undefined} Parsed object payload or `undefined` when the file is absent.
|
|
775
776
|
- @throws {ReqError} Throws with exit code `11` when the config file contains invalid JSON or a non-object payload.
|
|
776
777
|
|
|
777
|
-
### fn `function normalizeLocalStaticCheckConfig(` (
|
|
778
|
+
### fn `function normalizeLocalStaticCheckConfig(` (L768-792)
|
|
778
779
|
- @brief Normalizes the persisted local static-check enable map.
|
|
779
780
|
- @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.
|
|
780
781
|
- @param[in] value {unknown} Candidate persisted local static-check payload.
|
|
@@ -782,55 +783,56 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
782
783
|
- @return {Record<string, LocalStaticCheckLanguageConfig>} Normalized local static-check enable map.
|
|
783
784
|
- @satisfies REQ-249, REQ-316
|
|
784
785
|
|
|
785
|
-
### fn `function normalizeGlobalStaticCheckConfig(` (
|
|
786
|
+
### fn `function normalizeGlobalStaticCheckConfig(` (L801-818)
|
|
786
787
|
- @brief Normalizes the persisted global static-check checker map.
|
|
787
788
|
- @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.
|
|
788
789
|
- @param[in] value {unknown} Candidate persisted global static-check payload.
|
|
789
790
|
- @return {Record<string, GlobalStaticCheckLanguageConfig>} Normalized global static-check checker map.
|
|
790
791
|
- @satisfies REQ-249, REQ-250, REQ-251, REQ-252
|
|
791
792
|
|
|
792
|
-
### fn `function loadLocalConfig(` (
|
|
793
|
+
### fn `function loadLocalConfig(` (L828-876)
|
|
793
794
|
- @brief Loads and sanitizes the persisted local configuration.
|
|
794
|
-
- @details Returns defaults when `<base-path>/.pi-usereq.json` is absent. Otherwise parses the local JSON payload, normalizes project-scoped directory, debug, 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.
|
|
795
|
+
- @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.
|
|
795
796
|
- @param[in] projectBase {string} Absolute project root path.
|
|
796
797
|
- @param[in] defaultStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Local static-check enable defaults derived from the current global checker map.
|
|
797
798
|
- @return {UseReqLocalConfig} Sanitized local configuration.
|
|
799
|
+
- @satisfies CTN-019
|
|
798
800
|
|
|
799
|
-
### fn `function loadGlobalConfig(): UseReqGlobalConfig` (
|
|
801
|
+
### fn `function loadGlobalConfig(): UseReqGlobalConfig` (L883-924)
|
|
800
802
|
- @brief Loads and sanitizes the persisted global configuration.
|
|
801
803
|
- @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.
|
|
802
804
|
- @return {UseReqGlobalConfig} Sanitized global configuration.
|
|
803
805
|
|
|
804
|
-
### fn `export function loadConfig(projectBase: string): UseReqConfig` (
|
|
806
|
+
### fn `export function loadConfig(projectBase: string): UseReqConfig` (L934-941)
|
|
805
807
|
- @brief Loads and sanitizes the effective merged configuration.
|
|
806
808
|
- @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.
|
|
807
809
|
- @param[in] projectBase {string} Absolute project root path.
|
|
808
810
|
- @return {UseReqConfig} Sanitized effective configuration.
|
|
809
811
|
- @throws {ReqError} Throws with exit code `11` when either persisted config file contains invalid JSON or a non-object payload.
|
|
810
|
-
- @satisfies CTN-012, CTN-013, CTN-018, 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
|
|
812
|
+
- @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
|
|
811
813
|
|
|
812
|
-
### fn `function buildPersistedLocalConfig(config: UseReqConfig): UseReqLocalConfig` (
|
|
814
|
+
### fn `function buildPersistedLocalConfig(config: UseReqConfig): UseReqLocalConfig` (L950-978)
|
|
813
815
|
- @brief Builds the persisted local configuration payload.
|
|
814
|
-
- @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
|
|
816
|
+
- @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.
|
|
815
817
|
- @param[in] config {UseReqConfig} Effective configuration object.
|
|
816
818
|
- @return {UseReqLocalConfig} Persistable local configuration payload.
|
|
817
|
-
- @satisfies CTN-012, CTN-013, REQ-104, REQ-146, REQ-249, REQ-316, REQ-277
|
|
819
|
+
- @satisfies CTN-012, CTN-013, CTN-019, REQ-104, REQ-146, REQ-249, REQ-316, REQ-277
|
|
818
820
|
|
|
819
|
-
### fn `function buildPersistedGlobalConfig(config: UseReqConfig): UseReqGlobalConfig` (
|
|
821
|
+
### fn `function buildPersistedGlobalConfig(config: UseReqConfig): UseReqGlobalConfig` (L987-1026)
|
|
820
822
|
- @brief Builds the persisted global configuration payload.
|
|
821
823
|
- @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.
|
|
822
824
|
- @param[in] config {UseReqConfig} Effective configuration object.
|
|
823
825
|
- @return {UseReqGlobalConfig} Persistable global configuration payload.
|
|
824
826
|
- @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
|
|
825
827
|
|
|
826
|
-
### fn `function writeConfigFile(configPath: string, payload: object): void` (
|
|
828
|
+
### fn `function writeConfigFile(configPath: string, payload: object): void` (L1035-1038)
|
|
827
829
|
- @brief Writes one normalized config payload to disk.
|
|
828
830
|
- @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.
|
|
829
831
|
- @param[in] configPath {string} Absolute destination config path.
|
|
830
832
|
- @param[in] payload {object} Persistable config payload.
|
|
831
833
|
- @return {void} No return value.
|
|
832
834
|
|
|
833
|
-
### fn `export function saveLocalConfig(projectBase: string, config: UseReqConfig): void` (
|
|
835
|
+
### fn `export function saveLocalConfig(projectBase: string, config: UseReqConfig): void` (L1048-1050)
|
|
834
836
|
- @brief Persists the local configuration scope to disk.
|
|
835
837
|
- @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.
|
|
836
838
|
- @param[in] projectBase {string} Absolute project root path.
|
|
@@ -838,14 +840,14 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
838
840
|
- @return {void} No return value.
|
|
839
841
|
- @satisfies CTN-012, REQ-104, REQ-146
|
|
840
842
|
|
|
841
|
-
### fn `export function saveGlobalConfig(config: UseReqConfig): void` (
|
|
843
|
+
### fn `export function saveGlobalConfig(config: UseReqConfig): void` (L1059-1061)
|
|
842
844
|
- @brief Persists the global configuration scope to disk.
|
|
843
845
|
- @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.
|
|
844
846
|
- @param[in] config {UseReqConfig} Effective configuration object to persist.
|
|
845
847
|
- @return {void} No return value.
|
|
846
848
|
- @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
|
|
847
849
|
|
|
848
|
-
### fn `export function saveConfig(projectBase: string, config: UseReqConfig): void` (
|
|
850
|
+
### fn `export function saveConfig(projectBase: string, config: UseReqConfig): void` (L1071-1074)
|
|
849
851
|
- @brief Persists the effective configuration to local and global config files.
|
|
850
852
|
- @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.
|
|
851
853
|
- @param[in] projectBase {string} Absolute project root path.
|
|
@@ -853,14 +855,14 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
853
855
|
- @return {void} No return value.
|
|
854
856
|
- @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
|
|
855
857
|
|
|
856
|
-
### fn `export function normalizeConfigPaths(projectBase: string, config: UseReqConfig): UseReqConfig` (
|
|
858
|
+
### fn `export function normalizeConfigPaths(projectBase: string, config: UseReqConfig): UseReqConfig` (L1083-1101)
|
|
857
859
|
- @brief Normalizes persisted directory fields to project-relative forms.
|
|
858
860
|
- @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.
|
|
859
861
|
- @param[in] projectBase {string} Absolute project root path.
|
|
860
862
|
- @param[in] config {UseReqConfig} Configuration object to normalize.
|
|
861
863
|
- @return {UseReqConfig} Normalized configuration copy.
|
|
862
864
|
|
|
863
|
-
### fn `export function buildPromptReplacementPaths(` (
|
|
865
|
+
### fn `export function buildPromptReplacementPaths(` (L1111-1153)
|
|
864
866
|
- @brief Builds placeholder replacements for bundled prompt rendering.
|
|
865
867
|
- @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.
|
|
866
868
|
- @param[in] projectBase {string} Absolute project root path.
|
|
@@ -871,54 +873,54 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
871
873
|
## Symbol Index
|
|
872
874
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
873
875
|
|---|---|---|---|---|
|
|
874
|
-
|`StaticCheckEntry`|iface||
|
|
875
|
-
|`StaticCheckEnabled`|type||
|
|
876
|
-
|`StaticCheckLanguageConfig`|iface||
|
|
877
|
-
|`UseReqConfig`|iface||
|
|
878
|
-
|`LocalStaticCheckLanguageConfig`|iface||
|
|
879
|
-
|`GlobalStaticCheckLanguageConfig`|iface||
|
|
880
|
-
|`UseReqLocalConfig`|iface||
|
|
881
|
-
|`UseReqGlobalConfig`|iface||
|
|
882
|
-
|`cloneStaticCheckEntry`|fn||
|
|
883
|
-
|`createStaticCheckLanguageConfig`|fn||
|
|
884
|
-
|`createLocalStaticCheckLanguageConfig`|fn||
|
|
885
|
-
|`createGlobalStaticCheckLanguageConfig`|fn||
|
|
886
|
-
|`getDefaultGlobalStaticCheckConfig`|fn||
|
|
887
|
-
|`getDefaultLocalStaticCheckConfig`|fn||
|
|
888
|
-
|`mergeStaticCheckConfig`|fn||
|
|
889
|
-
|`getDefaultStaticCheckConfig`|fn||
|
|
890
|
-
|`normalizeStaticCheckEnabled`|fn||
|
|
891
|
-
|`getActiveStaticCheckEntries`|fn||
|
|
892
|
-
|`normalizeAutoGitCommit`|fn||
|
|
893
|
-
|`normalizeGitWorktreeEnabled`|fn||
|
|
894
|
-
|`resolveEffectiveGitWorktreeEnabled`|fn||
|
|
895
|
-
|`normalizeGitWorktreePrefix`|fn||
|
|
896
|
-
|`getProjectConfigPath`|fn||
|
|
897
|
-
|`getGlobalConfigPath`|fn||
|
|
898
|
-
|`getDefaultLocalConfig`|fn||
|
|
899
|
-
|`getDefaultGlobalConfig`|fn||
|
|
900
|
-
|`mergeConfigScopes`|fn||
|
|
901
|
-
|`getDefaultConfig`|fn||
|
|
902
|
-
|`normalizeStaticCheckEntries`|fn||
|
|
903
|
-
|`readConfigPayload`|fn||
|
|
904
|
-
|`normalizeLocalStaticCheckConfig`|fn||
|
|
905
|
-
|`normalizeGlobalStaticCheckConfig`|fn||
|
|
906
|
-
|`loadLocalConfig`|fn||
|
|
907
|
-
|`loadGlobalConfig`|fn||
|
|
908
|
-
|`loadConfig`|fn||
|
|
909
|
-
|`buildPersistedLocalConfig`|fn||
|
|
910
|
-
|`buildPersistedGlobalConfig`|fn||
|
|
911
|
-
|`writeConfigFile`|fn||
|
|
912
|
-
|`saveLocalConfig`|fn||
|
|
913
|
-
|`saveGlobalConfig`|fn||
|
|
914
|
-
|`saveConfig`|fn||
|
|
915
|
-
|`normalizeConfigPaths`|fn||
|
|
916
|
-
|`buildPromptReplacementPaths`|fn||
|
|
876
|
+
|`StaticCheckEntry`|iface||58-62|export interface StaticCheckEntry|
|
|
877
|
+
|`StaticCheckEnabled`|type||68||
|
|
878
|
+
|`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(|
|
|
917
919
|
|
|
918
920
|
|
|
919
921
|
---
|
|
920
922
|
|
|
921
|
-
# debug-runtime.ts | TypeScript |
|
|
923
|
+
# debug-runtime.ts | TypeScript | 566L | 28 symbols | 5 imports | 39 comments
|
|
922
924
|
> Path: `src/core/debug-runtime.ts`
|
|
923
925
|
- @brief Declares debug inventories, normalizers, and JSON log persistence helpers.
|
|
924
926
|
- @details Centralizes debug-menu selector inventories, config-field normalization, workflow-status gating, and append-only JSON log writing for tool, prompt, and dedicated workflow debug events. Runtime is dominated by JSON serialization plus filesystem I/O during log writes. Side effects include directory creation and file overwrite when debug entries are appended.
|
|
@@ -934,84 +936,94 @@ import {
|
|
|
934
936
|
|
|
935
937
|
## Definitions
|
|
936
938
|
|
|
937
|
-
- type `export type DebugToolName =` (
|
|
939
|
+
- type `export type DebugToolName =` (L66)
|
|
938
940
|
- @brief Represents one valid debug-enabled tool selector.
|
|
939
941
|
- @details Combines extension-owned tool names and supported embedded builtin tool names into one compile-time selector domain. The alias introduces no runtime cost.
|
|
940
|
-
- type `export type DebugPromptName = `req-${PromptCommandName}`;` (
|
|
942
|
+
- type `export type DebugPromptName = `req-${PromptCommandName}`;` (L74)
|
|
941
943
|
- @brief Represents one valid debug-enabled prompt selector.
|
|
942
944
|
- @details Restricts prompt debug toggles to invokable bundled `req-*` slash-command names derived from `PROMPT_COMMAND_NAMES`. The alias introduces no runtime cost.
|
|
943
|
-
- type `export type DebugWorkflowState =` (
|
|
945
|
+
- type `export type DebugWorkflowState =` (L92)
|
|
944
946
|
- @brief Represents one workflow-state value used by debug gating and payloads.
|
|
945
947
|
- @details Extends the documented prompt workflow states with `unknown` for callers that cannot recover a concrete state. The alias is compile-time only and introduces no runtime cost.
|
|
946
|
-
- type `export type DebugStatusChanges = "enable" | "disable";` (
|
|
948
|
+
- type `export type DebugStatusChanges = "enable" | "disable";` (L100)
|
|
947
949
|
- @brief Represents one persisted workflow-transition logging flag.
|
|
948
950
|
- @details Restricts `workflow_state` emission to the documented `enable|disable` domain. The alias is compile-time only and introduces no runtime cost.
|
|
949
|
-
- type `export type DebugWorkflowEvents = "enable" | "disable";` (
|
|
951
|
+
- type `export type DebugWorkflowEvents = "enable" | "disable";` (L106)
|
|
950
952
|
- @brief Represents one persisted dedicated workflow-event logging flag.
|
|
951
953
|
- @details Restricts session-activation, restoration, closure, and shutdown workflow-event emission to the documented `enable|disable` domain. The alias is compile-time only and introduces no runtime cost.
|
|
952
|
-
- type `export type
|
|
954
|
+
- type `export type DebugToolCommandsEnabled = "enable" | "disable";` (L112)
|
|
955
|
+
- @brief Represents one persisted debug-tool command-wrapper flag.
|
|
956
|
+
- @details Restricts debug slash-command wrapper registration to the documented `enable|disable` domain. The alias is compile-time only and introduces no runtime cost.
|
|
957
|
+
- type `export type DebugLogOnStatus = "any" | (typeof DEBUG_WORKFLOW_STATES)[number];` (L118)
|
|
953
958
|
- @brief Represents one persisted workflow-status filter value.
|
|
954
959
|
- @details Restricts debug log filtering to `any` or one explicit documented workflow state. The alias is compile-time only and introduces no runtime cost.
|
|
955
|
-
### iface `export interface DebugLogEntry` (
|
|
960
|
+
### iface `export interface DebugLogEntry` (L124-133)
|
|
956
961
|
- @brief Describes one append-only JSON debug log entry.
|
|
957
962
|
- @details Stores a timestamped tool or prompt event with workflow-state context plus optional input, result, and error metadata. The interface is compile-time only and introduces no runtime cost.
|
|
958
963
|
|
|
959
|
-
### fn `export function normalizeDebugEnabled(value: unknown): "enable" | "disable"` (
|
|
964
|
+
### fn `export function normalizeDebugEnabled(value: unknown): "enable" | "disable"` (L166-168)
|
|
960
965
|
- @brief Normalizes one persisted debug enable flag.
|
|
961
966
|
- @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_DEBUG_ENABLED` for all other payloads. Runtime is O(1). No external state is mutated.
|
|
962
967
|
- @param[in] value {unknown} Candidate persisted debug-enable payload.
|
|
963
968
|
- @return {"enable" | "disable"} Canonical debug-enable value.
|
|
964
969
|
- @satisfies REQ-236
|
|
965
970
|
|
|
966
|
-
### fn `export function normalizeDebugLogFile(value: unknown): string` (
|
|
971
|
+
### fn `export function normalizeDebugLogFile(value: unknown): string` (L177-183)
|
|
967
972
|
- @brief Normalizes one persisted debug log file value.
|
|
968
973
|
- @details Accepts only non-empty strings, trims surrounding whitespace, and falls back to `DEFAULT_DEBUG_LOG_FILE` when the candidate is absent or blank. Runtime is O(n) in path length. No external state is mutated.
|
|
969
974
|
- @param[in] value {unknown} Candidate persisted debug-log file payload.
|
|
970
975
|
- @return {string} Canonical debug-log file value.
|
|
971
976
|
- @satisfies REQ-237
|
|
972
977
|
|
|
973
|
-
### fn `export function normalizeDebugStatusChanges(value: unknown): DebugStatusChanges` (
|
|
978
|
+
### fn `export function normalizeDebugStatusChanges(value: unknown): DebugStatusChanges` (L192-194)
|
|
974
979
|
- @brief Normalizes one persisted workflow-transition logging flag.
|
|
975
980
|
- @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_DEBUG_STATUS_CHANGES` for all other payloads. Runtime is O(1). No external state is mutated.
|
|
976
981
|
- @param[in] value {unknown} Candidate persisted workflow-transition logging payload.
|
|
977
982
|
- @return {DebugStatusChanges} Canonical workflow-transition logging flag.
|
|
978
983
|
- @satisfies REQ-254
|
|
979
984
|
|
|
980
|
-
### fn `export function normalizeDebugWorkflowEvents(value: unknown): DebugWorkflowEvents` (
|
|
985
|
+
### fn `export function normalizeDebugWorkflowEvents(value: unknown): DebugWorkflowEvents` (L203-205)
|
|
981
986
|
- @brief Normalizes one persisted dedicated workflow-event logging flag.
|
|
982
987
|
- @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_DEBUG_WORKFLOW_EVENTS` for all other payloads. Runtime is O(1). No external state is mutated.
|
|
983
988
|
- @param[in] value {unknown} Candidate persisted workflow-event logging payload.
|
|
984
989
|
- @return {DebugWorkflowEvents} Canonical workflow-event logging flag.
|
|
985
990
|
- @satisfies REQ-277
|
|
986
991
|
|
|
987
|
-
### fn `export function
|
|
992
|
+
### fn `export function normalizeDebugToolCommandsEnabled(value: unknown): DebugToolCommandsEnabled` (L214-216)
|
|
993
|
+
- @brief Normalizes one persisted debug-tool command-wrapper flag.
|
|
994
|
+
- @details Accepts only the documented `enable|disable` values and falls back to `DEFAULT_DEBUG_TOOL_COMMANDS_ENABLED` for all other payloads. Runtime is O(1). No external state is mutated.
|
|
995
|
+
- @param[in] value {unknown} Candidate persisted debug-tool command-wrapper payload.
|
|
996
|
+
- @return {DebugToolCommandsEnabled} Canonical debug-tool command-wrapper flag.
|
|
997
|
+
- @satisfies CTN-019, REQ-322
|
|
998
|
+
|
|
999
|
+
### fn `export function normalizeDebugLogOnStatus(value: unknown): DebugLogOnStatus` (L225-232)
|
|
988
1000
|
- @brief Normalizes one persisted debug workflow-status filter.
|
|
989
1001
|
- @details Accepts only the documented `any` token or one explicit workflow state and falls back to `DEFAULT_DEBUG_LOG_ON_STATUS` for all other payloads. Runtime is O(1). No external state is mutated.
|
|
990
1002
|
- @param[in] value {unknown} Candidate persisted debug workflow-status filter.
|
|
991
1003
|
- @return {DebugLogOnStatus} Canonical debug workflow-status filter.
|
|
992
1004
|
- @satisfies REQ-238
|
|
993
1005
|
|
|
994
|
-
### fn `export function normalizeDebugEnabledTools(value: unknown): DebugToolName[]` (
|
|
1006
|
+
### fn `export function normalizeDebugEnabledTools(value: unknown): DebugToolName[]` (L241-249)
|
|
995
1007
|
- @brief Normalizes one persisted debug-tool selector array.
|
|
996
1008
|
- @details Filters to string entries, discards unknown tool names, deduplicates while preserving first-seen order, and returns an empty array for non-array payloads. Runtime is O(n). No external state is mutated.
|
|
997
1009
|
- @param[in] value {unknown} Candidate persisted debug-tool selector payload.
|
|
998
1010
|
- @return {DebugToolName[]} Deduplicated canonical debug-tool selectors.
|
|
999
1011
|
- @satisfies REQ-239, REQ-242
|
|
1000
1012
|
|
|
1001
|
-
### fn `export function normalizeDebugEnabledPrompts(value: unknown): DebugPromptName[]` (
|
|
1013
|
+
### fn `export function normalizeDebugEnabledPrompts(value: unknown): DebugPromptName[]` (L258-266)
|
|
1002
1014
|
- @brief Normalizes one persisted debug-prompt selector array.
|
|
1003
1015
|
- @details Filters to string entries, discards unknown `req-*` names, deduplicates while preserving first-seen order, and returns an empty array for non-array payloads. Runtime is O(n). No external state is mutated.
|
|
1004
1016
|
- @param[in] value {unknown} Candidate persisted debug-prompt selector payload.
|
|
1005
1017
|
- @return {DebugPromptName[]} Deduplicated canonical debug-prompt selectors.
|
|
1006
1018
|
- @satisfies REQ-239, REQ-243
|
|
1007
1019
|
|
|
1008
|
-
### fn `export function getDebugPromptName(promptName: PromptCommandName): DebugPromptName` (
|
|
1020
|
+
### fn `export function getDebugPromptName(promptName: PromptCommandName): DebugPromptName` (L274-276)
|
|
1009
1021
|
- @brief Resolves the canonical debug prompt selector for one bundled prompt.
|
|
1010
1022
|
- @details Reuses the shared prompt-command formatter so prompt-runtime and extension hook logging can target the same `DEBUG_ENABLED_PROMPTS` domain as the configuration menu. Runtime is O(n) in prompt-name length. No external state is mutated.
|
|
1011
1023
|
- @param[in] promptName {PromptCommandName} Canonical bundled prompt name.
|
|
1012
1024
|
- @return {DebugPromptName} Canonical debug prompt selector.
|
|
1013
1025
|
|
|
1014
|
-
### fn `export function matchesDebugWorkflowState(` (
|
|
1026
|
+
### fn `export function matchesDebugWorkflowState(` (L286-291)
|
|
1015
1027
|
- @brief Tests whether one debug workflow-state filter matches the current state.
|
|
1016
1028
|
- @details Treats `any` as an unconditional pass-through and otherwise requires `workflowState` to equal the configured explicit workflow state. Runtime is O(1). No external state is mutated.
|
|
1017
1029
|
- @param[in] logOnStatus {DebugLogOnStatus} Persisted debug workflow-state filter.
|
|
@@ -1019,7 +1031,7 @@ import {
|
|
|
1019
1031
|
- @return {boolean} `true` when the entry should be emitted for the supplied state.
|
|
1020
1032
|
- @satisfies REQ-247
|
|
1021
1033
|
|
|
1022
|
-
### fn `export function resolveDebugLogPath(projectBase: string, config: UseReqConfig): string` (
|
|
1034
|
+
### fn `export function resolveDebugLogPath(projectBase: string, config: UseReqConfig): string` (L301-306)
|
|
1023
1035
|
- @brief Resolves the absolute debug log file path for one project base.
|
|
1024
1036
|
- @details Preserves absolute configured paths and otherwise resolves relative values against the original project base so prompt-worktree cleanup cannot discard accumulated debug evidence. Runtime is O(p) in path length. No external state is mutated.
|
|
1025
1037
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -1027,7 +1039,7 @@ import {
|
|
|
1027
1039
|
- @return {string} Absolute debug log path.
|
|
1028
1040
|
- @satisfies REQ-237
|
|
1029
1041
|
|
|
1030
|
-
### fn `export function shouldLogDebugTool(` (
|
|
1042
|
+
### fn `export function shouldLogDebugTool(` (L317-325)
|
|
1031
1043
|
- @brief Tests whether one tool execution should be appended to the debug log.
|
|
1032
1044
|
- @details Requires global debug enablement, membership in `DEBUG_ENABLED_TOOLS`, and a matching workflow-state filter before any filesystem work occurs. Runtime is O(n) in configured selector count. No external state is mutated.
|
|
1033
1045
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -1036,7 +1048,7 @@ import {
|
|
|
1036
1048
|
- @return {boolean} `true` when the tool execution should be logged.
|
|
1037
1049
|
- @satisfies REQ-242, REQ-246, REQ-247
|
|
1038
1050
|
|
|
1039
|
-
### fn `export function shouldLogDebugPrompt(` (
|
|
1051
|
+
### fn `export function shouldLogDebugPrompt(` (L336-344)
|
|
1040
1052
|
- @brief Tests whether one prompt event should be appended to the debug log.
|
|
1041
1053
|
- @details Requires global debug enablement, membership in `DEBUG_ENABLED_PROMPTS`, and a matching workflow-state filter before any filesystem work occurs. Runtime is O(n) in configured selector count. No external state is mutated.
|
|
1042
1054
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -1045,7 +1057,7 @@ import {
|
|
|
1045
1057
|
- @return {boolean} `true` when the prompt event should be logged.
|
|
1046
1058
|
- @satisfies REQ-243, REQ-246, REQ-247
|
|
1047
1059
|
|
|
1048
|
-
### fn `export function shouldLogDebugPromptWorkflowState(` (
|
|
1060
|
+
### fn `export function shouldLogDebugPromptWorkflowState(` (L355-362)
|
|
1049
1061
|
- @brief Tests whether one prompt workflow-state transition should be appended to the debug log.
|
|
1050
1062
|
- @details Requires global debug enablement, prompt-selector membership, explicit `DEBUG_STATUS_CHANGES=enable`, and a matching post-transition workflow-state filter before any filesystem work occurs. Runtime is O(n) in configured selector count. No external state is mutated.
|
|
1051
1063
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -1054,7 +1066,7 @@ import {
|
|
|
1054
1066
|
- @return {boolean} `true` when the prompt workflow-state entry should be logged.
|
|
1055
1067
|
- @satisfies REQ-246, REQ-247, REQ-255
|
|
1056
1068
|
|
|
1057
|
-
### fn `export function shouldLogDebugPromptWorkflowEvent(` (
|
|
1069
|
+
### fn `export function shouldLogDebugPromptWorkflowEvent(` (L373-380)
|
|
1058
1070
|
- @brief Tests whether one dedicated prompt workflow event should be appended to the debug log.
|
|
1059
1071
|
- @details Requires global debug enablement, prompt-selector membership, explicit `DEBUG_WORKFLOW_EVENTS=enable`, and a matching workflow-state filter before any filesystem work occurs. Runtime is O(n) in configured selector count. No external state is mutated.
|
|
1060
1072
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -1063,13 +1075,13 @@ import {
|
|
|
1063
1075
|
- @return {boolean} `true` when the dedicated workflow event should be logged.
|
|
1064
1076
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
1065
1077
|
|
|
1066
|
-
### fn `function normalizeDebugValue(value: unknown): unknown` (
|
|
1078
|
+
### fn `function normalizeDebugValue(value: unknown): unknown` (L388-416)
|
|
1067
1079
|
- @brief Serializes arbitrary debug payloads into deterministic JSON-compatible values.
|
|
1068
1080
|
- @details Converts `Error` instances into structured records, elides functions, stringifies bigint values, and falls back to a best-effort string when JSON serialization fails. Runtime is O(n) in payload size. No external state is mutated.
|
|
1069
1081
|
- @param[in] value {unknown} Arbitrary debug payload.
|
|
1070
1082
|
- @return {unknown} JSON-compatible debug payload.
|
|
1071
1083
|
|
|
1072
|
-
### fn `function appendDebugLogEntry(` (
|
|
1084
|
+
### fn `function appendDebugLogEntry(` (L426-451)
|
|
1073
1085
|
- @brief Appends one normalized debug log entry to the configured JSON log file.
|
|
1074
1086
|
- @details Loads the existing JSON array when present, falls back to an empty array for missing or invalid files, appends the normalized entry, and rewrites the full file with a trailing newline. Runtime is dominated by JSON parse plus serialization and filesystem I/O. Side effects include directory creation and file overwrite.
|
|
1075
1087
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -1077,7 +1089,7 @@ import {
|
|
|
1077
1089
|
- @param[in] entry {DebugLogEntry} Candidate debug log entry.
|
|
1078
1090
|
- @return {boolean} `true` when the entry is written successfully; `false` when filesystem writing fails.
|
|
1079
1091
|
|
|
1080
|
-
### fn `export function logDebugToolExecution(` (
|
|
1092
|
+
### fn `export function logDebugToolExecution(` (L466-488)
|
|
1081
1093
|
- @brief Appends one tool-execution debug entry when the current config enables it.
|
|
1082
1094
|
- @details Applies tool-selector and workflow-state gating before serializing the executed tool input, final result payload, and error flag into the configured JSON log file. Runtime is dominated by JSON serialization plus filesystem I/O when enabled and O(n) in selector count otherwise. Side effects include directory creation and file overwrite only for enabled matching entries.
|
|
1083
1095
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -1090,7 +1102,7 @@ import {
|
|
|
1090
1102
|
- @return {boolean} `true` when the tool entry is written; otherwise `false`.
|
|
1091
1103
|
- @satisfies REQ-244, REQ-246, REQ-247
|
|
1092
1104
|
|
|
1093
|
-
### fn `export function logDebugPromptEvent(` (
|
|
1105
|
+
### fn `export function logDebugPromptEvent(` (L504-527)
|
|
1094
1106
|
- @brief Appends one prompt debug entry when the current config enables it.
|
|
1095
1107
|
- @details Applies prompt-selector and workflow-state gating before serializing the supplied action payload into the configured JSON log file. Runtime is dominated by JSON serialization plus filesystem I/O when enabled and O(n) in selector count otherwise. Side effects include directory creation and file overwrite only for enabled matching entries.
|
|
1096
1108
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -1104,7 +1116,7 @@ import {
|
|
|
1104
1116
|
- @return {boolean} `true` when the prompt entry is written; otherwise `false`.
|
|
1105
1117
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
1106
1118
|
|
|
1107
|
-
### fn `export function logDebugPromptWorkflowEvent(` (
|
|
1119
|
+
### fn `export function logDebugPromptWorkflowEvent(` (L543-566)
|
|
1108
1120
|
- @brief Appends one dedicated prompt workflow debug entry when the current config enables it.
|
|
1109
1121
|
- @details Applies prompt-selector, workflow-event-flag, and workflow-state gating before serializing session-activation, restoration, closure, or shutdown workflow payloads into the configured JSON log file. Runtime is dominated by JSON serialization plus filesystem I/O when enabled and O(n) in selector count otherwise. Side effects include directory creation and file overwrite only for enabled matching entries.
|
|
1110
1122
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -1121,32 +1133,34 @@ import {
|
|
|
1121
1133
|
## Symbol Index
|
|
1122
1134
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
1123
1135
|
|---|---|---|---|---|
|
|
1124
|
-
|`DebugToolName`|type||
|
|
1125
|
-
|`DebugPromptName`|type||
|
|
1126
|
-
|`DebugWorkflowState`|type||
|
|
1127
|
-
|`DebugStatusChanges`|type||
|
|
1128
|
-
|`DebugWorkflowEvents`|type||
|
|
1129
|
-
|`
|
|
1130
|
-
|`
|
|
1131
|
-
|`
|
|
1132
|
-
|`
|
|
1133
|
-
|`
|
|
1134
|
-
|`
|
|
1135
|
-
|`
|
|
1136
|
-
|`
|
|
1137
|
-
|`
|
|
1138
|
-
|`
|
|
1139
|
-
|`
|
|
1140
|
-
|`
|
|
1141
|
-
|`
|
|
1142
|
-
|`
|
|
1143
|
-
|`
|
|
1144
|
-
|`
|
|
1145
|
-
|`
|
|
1146
|
-
|`
|
|
1147
|
-
|`
|
|
1148
|
-
|`
|
|
1149
|
-
|`
|
|
1136
|
+
|`DebugToolName`|type||66||
|
|
1137
|
+
|`DebugPromptName`|type||74||
|
|
1138
|
+
|`DebugWorkflowState`|type||92||
|
|
1139
|
+
|`DebugStatusChanges`|type||100||
|
|
1140
|
+
|`DebugWorkflowEvents`|type||106||
|
|
1141
|
+
|`DebugToolCommandsEnabled`|type||112||
|
|
1142
|
+
|`DebugLogOnStatus`|type||118||
|
|
1143
|
+
|`DebugLogEntry`|iface||124-133|export interface DebugLogEntry|
|
|
1144
|
+
|`normalizeDebugEnabled`|fn||166-168|export function normalizeDebugEnabled(value: unknown): "e...|
|
|
1145
|
+
|`normalizeDebugLogFile`|fn||177-183|export function normalizeDebugLogFile(value: unknown): st...|
|
|
1146
|
+
|`normalizeDebugStatusChanges`|fn||192-194|export function normalizeDebugStatusChanges(value: unknow...|
|
|
1147
|
+
|`normalizeDebugWorkflowEvents`|fn||203-205|export function normalizeDebugWorkflowEvents(value: unkno...|
|
|
1148
|
+
|`normalizeDebugToolCommandsEnabled`|fn||214-216|export function normalizeDebugToolCommandsEnabled(value: ...|
|
|
1149
|
+
|`normalizeDebugLogOnStatus`|fn||225-232|export function normalizeDebugLogOnStatus(value: unknown)...|
|
|
1150
|
+
|`normalizeDebugEnabledTools`|fn||241-249|export function normalizeDebugEnabledTools(value: unknown...|
|
|
1151
|
+
|`normalizeDebugEnabledPrompts`|fn||258-266|export function normalizeDebugEnabledPrompts(value: unkno...|
|
|
1152
|
+
|`getDebugPromptName`|fn||274-276|export function getDebugPromptName(promptName: PromptComm...|
|
|
1153
|
+
|`matchesDebugWorkflowState`|fn||286-291|export function matchesDebugWorkflowState(|
|
|
1154
|
+
|`resolveDebugLogPath`|fn||301-306|export function resolveDebugLogPath(projectBase: string, ...|
|
|
1155
|
+
|`shouldLogDebugTool`|fn||317-325|export function shouldLogDebugTool(|
|
|
1156
|
+
|`shouldLogDebugPrompt`|fn||336-344|export function shouldLogDebugPrompt(|
|
|
1157
|
+
|`shouldLogDebugPromptWorkflowState`|fn||355-362|export function shouldLogDebugPromptWorkflowState(|
|
|
1158
|
+
|`shouldLogDebugPromptWorkflowEvent`|fn||373-380|export function shouldLogDebugPromptWorkflowEvent(|
|
|
1159
|
+
|`normalizeDebugValue`|fn||388-416|function normalizeDebugValue(value: unknown): unknown|
|
|
1160
|
+
|`appendDebugLogEntry`|fn||426-451|function appendDebugLogEntry(|
|
|
1161
|
+
|`logDebugToolExecution`|fn||466-488|export function logDebugToolExecution(|
|
|
1162
|
+
|`logDebugPromptEvent`|fn||504-527|export function logDebugPromptEvent(|
|
|
1163
|
+
|`logDebugPromptWorkflowEvent`|fn||543-566|export function logDebugPromptWorkflowEvent(|
|
|
1150
1164
|
|
|
1151
1165
|
|
|
1152
1166
|
---
|
|
@@ -4689,7 +4703,7 @@ import path from "node:path";
|
|
|
4689
4703
|
|
|
4690
4704
|
---
|
|
4691
4705
|
|
|
4692
|
-
# index.ts | TypeScript |
|
|
4706
|
+
# index.ts | TypeScript | 4407L | 102 symbols | 27 imports | 107 comments
|
|
4693
4707
|
> Path: `src/index.ts`
|
|
4694
4708
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4695
4709
|
- @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.
|
|
@@ -4727,45 +4741,81 @@ import { makeRelativeIfContainsProject, shellSplit } from "./core/utils.js";
|
|
|
4727
4741
|
|
|
4728
4742
|
## Definitions
|
|
4729
4743
|
|
|
4730
|
-
### iface `interface PiShortcutRegistrar` (
|
|
4744
|
+
### iface `interface PiShortcutRegistrar` (L180-188)
|
|
4731
4745
|
- @brief Describes the optional shortcut-registration surface used by pi-usereq.
|
|
4732
4746
|
- @details Narrows the runtime API to the documented `registerShortcut(...)`
|
|
4733
4747
|
method so the extension can remain compatible with offline harnesses that do
|
|
4734
4748
|
not implement shortcut capture. Compile-time only and introduces no runtime
|
|
4735
4749
|
cost.
|
|
4736
4750
|
|
|
4737
|
-
### fn `function getProjectBase(cwd: string): string` (
|
|
4751
|
+
### fn `function getProjectBase(cwd: string): string` (L196-205)
|
|
4738
4752
|
- @brief Resolves the effective project base from a working directory.
|
|
4739
4753
|
- @details Normalizes the provided cwd into an absolute path without consulting configuration. Time complexity is O(1). No I/O side effects occur.
|
|
4740
4754
|
- @param[in] cwd {string} Current working directory.
|
|
4741
4755
|
- @return {string} Absolute project base path.
|
|
4742
4756
|
|
|
4743
|
-
### fn `function getProcessCwdSafe(): string` (
|
|
4757
|
+
### fn `function getProcessCwdSafe(): string` (L212-221)
|
|
4744
4758
|
- @brief Resolves a safe process working directory for extension-load paths.
|
|
4745
4759
|
- @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.
|
|
4746
4760
|
- @return {string} Absolute fallback-safe process working directory.
|
|
4747
4761
|
|
|
4748
|
-
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (
|
|
4762
|
+
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (L229-241)
|
|
4749
4763
|
- @brief Resolves the live working directory used for bootstrap-sensitive flows.
|
|
4750
4764
|
- @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.
|
|
4751
4765
|
- @param[in] cwd {string} Candidate context cwd.
|
|
4752
4766
|
- @return {string} Existing absolute cwd used for bootstrap work.
|
|
4753
4767
|
|
|
4754
|
-
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (
|
|
4768
|
+
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (L250-259)
|
|
4755
4769
|
- @brief Best-effort synchronizes one context `cwd` mirror with bootstrap reality.
|
|
4756
4770
|
- @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.
|
|
4757
4771
|
- @param[in] cwd {string} Resolved live cwd.
|
|
4758
4772
|
- @param[in,out] ctx {{ cwd?: string }} Mutable context-like object.
|
|
4759
4773
|
- @return {void} No return value.
|
|
4760
4774
|
|
|
4761
|
-
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (
|
|
4775
|
+
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L268-271)
|
|
4762
4776
|
- @brief Loads project configuration for the extension runtime.
|
|
4763
4777
|
- @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.
|
|
4764
4778
|
- @param[in] cwd {string} Current working directory.
|
|
4765
4779
|
- @return {UseReqConfig} Effective project configuration.
|
|
4766
4780
|
- @satisfies REQ-030, REQ-145, REQ-146
|
|
4767
4781
|
|
|
4768
|
-
|
|
4782
|
+
- type `type DebugToolCommandExecuteResult = ReturnType<typeof buildMonolithicToolExecuteResult>;` (L277)
|
|
4783
|
+
- @brief Describes the execute-result surface reused by debug tool wrapper commands.
|
|
4784
|
+
- @details Narrows debug slash-command handlers to the same monolithic content-plus-execution wrapper returned by agent tools so editor output and notifications can reuse shared extraction helpers. The alias is compile-time only and introduces no runtime cost.
|
|
4785
|
+
### fn `function shouldRegisterDebugToolCommands(cwd: string): boolean` (L286-292)
|
|
4786
|
+
- @brief Tests whether debug tool wrapper commands should be registered for one runtime cwd.
|
|
4787
|
+
- @details Loads the effective project configuration for the supplied cwd and returns `true` only when `DEBUG_TOOL_COMMANDS_ENABLED` resolves to `enable`. Malformed or unreadable config payloads degrade to `false` so extension activation never aborts while deciding whether to register optional debug commands. Runtime is dominated by config I/O. Side effects are limited to filesystem reads.
|
|
4788
|
+
- @param[in] cwd {string} Candidate runtime working directory.
|
|
4789
|
+
- @return {boolean} `true` when debug tool wrapper commands should be registered.
|
|
4790
|
+
- @satisfies REQ-323
|
|
4791
|
+
|
|
4792
|
+
### fn `function writeDebugToolCommandResultToEditor(` (L303-317)
|
|
4793
|
+
- @brief Writes one debug tool-wrapper result into the editor and emits a status notification.
|
|
4794
|
+
- @details Extracts the primary monolithic content text from the wrapped tool result, forwards that exact text to the editor, and emits an informational or error notification keyed by the tool exit code. Runtime is O(n) in output length. Side effects include editor-text mutation and UI notifications.
|
|
4795
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4796
|
+
- @param[in] commandName {string} Invoked debug slash-command name without the leading `/`.
|
|
4797
|
+
- @param[in] result {DebugToolCommandExecuteResult} Wrapped tool execution result.
|
|
4798
|
+
- @return {void} No return value.
|
|
4799
|
+
- @satisfies REQ-324
|
|
4800
|
+
|
|
4801
|
+
### fn `function executeDebugToolCommand(` (L329-347)
|
|
4802
|
+
- @brief Executes one config-gated debug tool wrapper slash command.
|
|
4803
|
+
- @details Resolves a live cwd for the invoking command context, refreshes runtime path state, loads the effective project configuration, rejects execution when debug tool wrapper commands are disabled, and otherwise writes the selected wrapped tool output into the editor. Runtime is dominated by the delegated tool runner. Side effects include runtime-path bootstrap, filesystem reads, optional tool side effects, editor-text mutation, and UI notifications.
|
|
4804
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4805
|
+
- @param[in] commandName {string} Invoked debug slash-command name without the leading `/`.
|
|
4806
|
+
- @param[in] operation {(projectBase: string, config: UseReqConfig) => DebugToolCommandExecuteResult} Wrapped tool executor.
|
|
4807
|
+
- @return {void} No return value.
|
|
4808
|
+
- @throws {ReqError} Throws when debug tool wrapper commands are disabled for the active project.
|
|
4809
|
+
- @satisfies REQ-324, REQ-325
|
|
4810
|
+
|
|
4811
|
+
### fn `function registerDebugToolCommands(pi: ExtensionAPI): void` (L356-390)
|
|
4812
|
+
- @brief Registers config-gated debug slash-command wrappers for selected built-in analysis tools.
|
|
4813
|
+
- @details Registers `debug-compress`, `debug-references`, `debug-static-check`, and `debug-tokens` as extension commands that reuse the same runner paths as the corresponding agent tools and write the resulting monolithic text into the editor instead of the LLM content channel. Re-registering the same commands is idempotent because pi keeps the latest same-extension command definition per name. Runtime is O(1) for registration; handler cost depends on the selected runner. Side effects include command registration.
|
|
4814
|
+
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4815
|
+
- @return {void} No return value.
|
|
4816
|
+
- @satisfies DES-015, REQ-323, REQ-324, REQ-325
|
|
4817
|
+
|
|
4818
|
+
### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (L400-403)
|
|
4769
4819
|
- @brief Persists effective project configuration from the extension runtime.
|
|
4770
4820
|
- @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.
|
|
4771
4821
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -4773,38 +4823,38 @@ cost.
|
|
|
4773
4823
|
- @return {void} No return value.
|
|
4774
4824
|
- @satisfies REQ-146, REQ-315
|
|
4775
4825
|
|
|
4776
|
-
### fn `function formatLocalConfigPathForMenu(cwd: string): string` (
|
|
4826
|
+
### fn `function formatLocalConfigPathForMenu(cwd: string): string` (L412-416)
|
|
4777
4827
|
- @brief Formats the current local config path for top-level menu display.
|
|
4778
4828
|
- @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.
|
|
4779
4829
|
- @param[in] cwd {string} Current working directory.
|
|
4780
4830
|
- @return {string} `~`-relative or absolute local config-path display value.
|
|
4781
4831
|
- @satisfies REQ-162
|
|
4782
4832
|
|
|
4783
|
-
### fn `function formatGlobalConfigPathForMenu(): string` (
|
|
4833
|
+
### fn `function formatGlobalConfigPathForMenu(): string` (L424-426)
|
|
4784
4834
|
- @brief Formats the current global config path for top-level menu display.
|
|
4785
4835
|
- @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.
|
|
4786
4836
|
- @return {string} `~`-relative or absolute global config-path display value.
|
|
4787
4837
|
- @satisfies REQ-319
|
|
4788
4838
|
|
|
4789
|
-
### fn `function buildTerminalSettingsMenuChoices(options:` (
|
|
4839
|
+
### fn `function buildTerminalSettingsMenuChoices(options:` (L435-446)
|
|
4790
4840
|
- @brief Builds the standardized terminal rows appended to every configuration menu.
|
|
4791
4841
|
- @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.
|
|
4792
4842
|
- @param[in] options {{ resetDefaultsDescription: string }} Menu-specific terminal-row metadata.
|
|
4793
4843
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered terminal menu rows.
|
|
4794
4844
|
- @satisfies REQ-193
|
|
4795
4845
|
|
|
4796
|
-
### iface `interface ResetConfirmationChange` (
|
|
4846
|
+
### iface `interface ResetConfirmationChange` (L452-456)
|
|
4797
4847
|
- @brief Describes one pending reset value change shown in confirmation menus.
|
|
4798
4848
|
- @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.
|
|
4799
4849
|
|
|
4800
|
-
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (
|
|
4850
|
+
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L465-467)
|
|
4801
4851
|
- @brief Formats one reset-confirmation value pair for menu display.
|
|
4802
4852
|
- @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.
|
|
4803
4853
|
- @param[in] previousValue {string} Current persisted value.
|
|
4804
4854
|
- @param[in] nextValue {string} Candidate default value.
|
|
4805
4855
|
- @return {string} Rendered preview string.
|
|
4806
4856
|
|
|
4807
|
-
### fn `function buildResetConfirmationChoices(` (
|
|
4857
|
+
### fn `function buildResetConfirmationChoices(` (L477-516)
|
|
4808
4858
|
- @brief Builds the shared settings-menu choices for one reset-confirmation submenu.
|
|
4809
4859
|
- @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.
|
|
4810
4860
|
- @param[in] changes {ResetConfirmationChange[]} Changed-value preview rows.
|
|
@@ -4812,7 +4862,7 @@ cost.
|
|
|
4812
4862
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4813
4863
|
- @return {PiUsereqSettingsMenuChoice[]} Reset-confirmation submenu choices.
|
|
4814
4864
|
|
|
4815
|
-
### fn `async function confirmResetChanges(` (
|
|
4865
|
+
### fn `async function confirmResetChanges(` (L528-541)
|
|
4816
4866
|
- @brief Opens one explicit reset-confirmation submenu.
|
|
4817
4867
|
- @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.
|
|
4818
4868
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4822,14 +4872,14 @@ cost.
|
|
|
4822
4872
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4823
4873
|
- @return {Promise<boolean>} `true` when the reset is explicitly approved.
|
|
4824
4874
|
|
|
4825
|
-
### fn `function writePersistedConfigToEditor(` (
|
|
4875
|
+
### fn `function writePersistedConfigToEditor(` (L550-555)
|
|
4826
4876
|
- @brief Writes one already-persisted config file text into the editor.
|
|
4827
4877
|
- @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.
|
|
4828
4878
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4829
4879
|
- @param[in] configPath {string} Absolute persisted config path.
|
|
4830
4880
|
- @return {void} No return value.
|
|
4831
4881
|
|
|
4832
|
-
### fn `function writePersistedLocalConfigToEditor(` (
|
|
4882
|
+
### fn `function writePersistedLocalConfigToEditor(` (L565-571)
|
|
4833
4883
|
- @brief Writes the already-persisted local configuration file text into the editor.
|
|
4834
4884
|
- @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.
|
|
4835
4885
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4837,58 +4887,58 @@ cost.
|
|
|
4837
4887
|
- @return {void} No return value.
|
|
4838
4888
|
- @satisfies REQ-031
|
|
4839
4889
|
|
|
4840
|
-
### fn `function writePersistedGlobalConfigToEditor(` (
|
|
4890
|
+
### fn `function writePersistedGlobalConfigToEditor(` (L580-584)
|
|
4841
4891
|
- @brief Writes the already-persisted global configuration file text into the editor.
|
|
4842
4892
|
- @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.
|
|
4843
4893
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4844
4894
|
- @return {void} No return value.
|
|
4845
4895
|
- @satisfies REQ-318
|
|
4846
4896
|
|
|
4847
|
-
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (
|
|
4897
|
+
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L645-649)
|
|
4848
4898
|
- @brief Builds the supported-tag guidance lines embedded in search-tool registrations.
|
|
4849
4899
|
- @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.
|
|
4850
4900
|
- @return {string[]} Supported-tag guidance lines.
|
|
4851
4901
|
|
|
4852
|
-
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (
|
|
4902
|
+
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L657-662)
|
|
4853
4903
|
- @brief Builds the schema description for one search-tool registration.
|
|
4854
4904
|
- @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.
|
|
4855
4905
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4856
4906
|
- @return {string} Parameter-schema description.
|
|
4857
4907
|
|
|
4858
|
-
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (
|
|
4908
|
+
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L670-683)
|
|
4859
4909
|
- @brief Builds the prompt-guideline set for one search-tool registration.
|
|
4860
4910
|
- @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.
|
|
4861
4911
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4862
4912
|
- @return {string[]} Prompt-guideline strings.
|
|
4863
4913
|
|
|
4864
|
-
- type `type MonolithicToolRenderResult = {` (
|
|
4914
|
+
- type `type MonolithicToolRenderResult = {` (L689)
|
|
4865
4915
|
- @brief Describes the monolithic tool-result surface consumed by tool-row renderers.
|
|
4866
4916
|
- @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.
|
|
4867
|
-
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (
|
|
4917
|
+
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L706-709)
|
|
4868
4918
|
- @brief Extracts the primary monolithic text block from one tool result.
|
|
4869
4919
|
- @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.
|
|
4870
4920
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4871
4921
|
- @return {string} Primary monolithic content text.
|
|
4872
4922
|
|
|
4873
|
-
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (
|
|
4923
|
+
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L717-727)
|
|
4874
4924
|
- @brief Reads the first residual execution error string from one monolithic tool result.
|
|
4875
4925
|
- @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.
|
|
4876
4926
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4877
4927
|
- @return {string | undefined} First residual execution error string.
|
|
4878
4928
|
|
|
4879
|
-
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (
|
|
4929
|
+
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L735-774)
|
|
4880
4930
|
- @brief Formats one scalar or structural tool argument for compact render summaries.
|
|
4881
4931
|
- @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.
|
|
4882
4932
|
- @param[in] value {unknown} Candidate tool argument value.
|
|
4883
4933
|
- @return {string | undefined} Compact preview string or `undefined` when the value carries no useful summary.
|
|
4884
4934
|
|
|
4885
|
-
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (
|
|
4935
|
+
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L782-793)
|
|
4886
4936
|
- @brief Builds the compact invocation summary appended to collapsed tool rows.
|
|
4887
4937
|
- @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.
|
|
4888
4938
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4889
4939
|
- @return {string} Compact invocation summary prefixed with one separating space, or the empty string when no useful preview exists.
|
|
4890
4940
|
|
|
4891
|
-
### fn `function summarizeStructuredToolResult(` (
|
|
4941
|
+
### fn `function summarizeStructuredToolResult(` (L803-818)
|
|
4892
4942
|
- @brief Builds the compact default text for one monolithic tool result row.
|
|
4893
4943
|
- @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.
|
|
4894
4944
|
- @param[in] toolName {string} Registered tool name.
|
|
@@ -4896,27 +4946,27 @@ cost.
|
|
|
4896
4946
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4897
4947
|
- @return {string} Compact single-line summary.
|
|
4898
4948
|
|
|
4899
|
-
### fn `function buildStructuredToolRenderResult(toolName: string)` (
|
|
4949
|
+
### fn `function buildStructuredToolRenderResult(toolName: string)` (L827-846)
|
|
4900
4950
|
- @brief Builds a custom `renderResult` implementation for one monolithic tool.
|
|
4901
4951
|
- @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.
|
|
4902
4952
|
- @param[in] toolName {string} Registered tool name.
|
|
4903
4953
|
- @return {(result: MonolithicToolRenderResult, options: { expanded?: boolean; isPartial?: boolean }, _theme: unknown, context: { args?: Record<string, unknown>; lastComponent?: unknown }) => Text} Custom result renderer.
|
|
4904
4954
|
- @satisfies REQ-210
|
|
4905
4955
|
|
|
4906
|
-
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4956
|
+
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L854-860)
|
|
4907
4957
|
- @brief Executes one CLI-style runner for a monolithic agent tool.
|
|
4908
4958
|
- @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.
|
|
4909
4959
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4910
4960
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Monolithic tool execute result.
|
|
4911
4961
|
|
|
4912
|
-
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4962
|
+
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L869-898)
|
|
4913
4963
|
- @brief Executes one CLI-style runner for a status-only agent tool.
|
|
4914
4964
|
- @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.
|
|
4915
4965
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4916
4966
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Status-only tool execute result.
|
|
4917
4967
|
- @satisfies REQ-294, REQ-295, REQ-296
|
|
4918
4968
|
|
|
4919
|
-
### fn `function deliverPromptCommand(` (
|
|
4969
|
+
### fn `function deliverPromptCommand(` (L909-927)
|
|
4920
4970
|
- @brief Starts delivery of one rendered prompt into the current active session.
|
|
4921
4971
|
- @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.
|
|
4922
4972
|
- @param[in] pi {ExtensionAPI} Handler-scoped extension API instance retained as the fallback dispatcher.
|
|
@@ -4925,7 +4975,7 @@ cost.
|
|
|
4925
4975
|
- @return {Promise<void>} Promise representing eventual prompt-delivery completion.
|
|
4926
4976
|
- @satisfies REQ-004, REQ-067, REQ-068, REQ-227, REQ-281
|
|
4927
4977
|
|
|
4928
|
-
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (
|
|
4978
|
+
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L938-954)
|
|
4929
4979
|
- @brief Detects prompt-delivery failures that can be ignored after prompt ownership has moved past the command handler.
|
|
4930
4980
|
- @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.
|
|
4931
4981
|
- @param[in] error {unknown} Candidate prompt-delivery failure.
|
|
@@ -4934,7 +4984,7 @@ cost.
|
|
|
4934
4984
|
- @return {boolean} `true` when the failure is a late stale-context delivery rejection that MUST be ignored.
|
|
4935
4985
|
- @satisfies REQ-208, REQ-280, REQ-281, REQ-282
|
|
4936
4986
|
|
|
4937
|
-
### fn `function logPromptWorkflowStateChange(` (
|
|
4987
|
+
### fn `function logPromptWorkflowStateChange(` (L967-986)
|
|
4938
4988
|
- @brief Appends one workflow-state debug entry for a bundled prompt when selected.
|
|
4939
4989
|
- @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.
|
|
4940
4990
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4945,7 +4995,7 @@ cost.
|
|
|
4945
4995
|
- @return {void} No return value.
|
|
4946
4996
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
4947
4997
|
|
|
4948
|
-
### fn `function logPromptWorkflowEvent(` (
|
|
4998
|
+
### fn `function logPromptWorkflowEvent(` (L1002-1022)
|
|
4949
4999
|
- @brief Appends one dedicated prompt workflow debug entry when selected.
|
|
4950
5000
|
- @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.
|
|
4951
5001
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4959,7 +5009,7 @@ cost.
|
|
|
4959
5009
|
- @return {void} No return value.
|
|
4960
5010
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
4961
5011
|
|
|
4962
|
-
### fn `function transitionPromptWorkflowState(` (
|
|
5012
|
+
### fn `function transitionPromptWorkflowState(` (L1035-1048)
|
|
4963
5013
|
- @brief Transitions one prompt workflow state and logs the transition immediately after the state update.
|
|
4964
5014
|
- @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.
|
|
4965
5015
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -4970,20 +5020,20 @@ cost.
|
|
|
4970
5020
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4971
5021
|
- @return {void} No return value.
|
|
4972
5022
|
|
|
4973
|
-
### fn `function resolvePromptCommandDescription(` (
|
|
5023
|
+
### fn `function resolvePromptCommandDescription(` (L1056-1060)
|
|
4974
5024
|
- @brief Resolves the runtime slash-command description for one bundled prompt.
|
|
4975
5025
|
- @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.
|
|
4976
5026
|
- @param[in] promptName {import("./core/prompt-command-catalog.js").PromptCommandName} Bundled prompt name.
|
|
4977
5027
|
- @return {string} Runtime command description.
|
|
4978
5028
|
|
|
4979
|
-
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (
|
|
5029
|
+
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L1069-1073)
|
|
4980
5030
|
- @brief Resolves the original project base used for debug-log file writes.
|
|
4981
5031
|
- @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.
|
|
4982
5032
|
- @param[in] cwd {string} Current extension working directory.
|
|
4983
5033
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4984
5034
|
- @return {string} Absolute original project base path for debug logging.
|
|
4985
5035
|
|
|
4986
|
-
### fn `function notifyContextSafely(` (
|
|
5036
|
+
### fn `function notifyContextSafely(` (L1084-1101)
|
|
4987
5037
|
- @brief Delivers one best-effort UI notification without failing on stale replacement contexts.
|
|
4988
5038
|
- @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.
|
|
4989
5039
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext | undefined} Candidate UI context.
|
|
@@ -4992,7 +5042,7 @@ cost.
|
|
|
4992
5042
|
- @return {boolean} `true` when the notification was delivered and `false` when the context was already stale.
|
|
4993
5043
|
- @satisfies REQ-280
|
|
4994
5044
|
|
|
4995
|
-
### fn `function rejectNonIdleReqCommand(` (
|
|
5045
|
+
### fn `function rejectNonIdleReqCommand(` (L1113-1133)
|
|
4996
5046
|
- @brief Rejects one non-`idle` req-command invocation and records the workflow error state.
|
|
4997
5047
|
- @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.
|
|
4998
5048
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -5002,20 +5052,20 @@ cost.
|
|
|
5002
5052
|
- @throws {ReqError} Always throws because non-`idle` req commands are rejected.
|
|
5003
5053
|
- @satisfies REQ-224
|
|
5004
5054
|
|
|
5005
|
-
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (
|
|
5055
|
+
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L1142-1150)
|
|
5006
5056
|
- @brief Returns the configurable active-tool inventory visible to the extension.
|
|
5007
5057
|
- @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.
|
|
5008
5058
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5009
5059
|
- @return {ToolInfo[]} Sorted configurable tool descriptors.
|
|
5010
5060
|
- @satisfies REQ-007, REQ-063, REQ-231, REQ-232
|
|
5011
5061
|
|
|
5012
|
-
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (
|
|
5062
|
+
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L1158-1162)
|
|
5013
5063
|
- @brief Normalizes and returns the configured enabled active tools.
|
|
5014
5064
|
- @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"]`.
|
|
5015
5065
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5016
5066
|
- @return {string[]} Normalized enabled tool names.
|
|
5017
5067
|
|
|
5018
|
-
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (
|
|
5068
|
+
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L1172-1189)
|
|
5019
5069
|
- @brief Applies the configured active-tool enablement to the current session.
|
|
5020
5070
|
- @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(...)`.
|
|
5021
5071
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5023,7 +5073,7 @@ cost.
|
|
|
5023
5073
|
- @return {void} No return value.
|
|
5024
5074
|
- @satisfies REQ-009, REQ-064
|
|
5025
5075
|
|
|
5026
|
-
### fn `async function handleExtensionStatusEvent(` (
|
|
5076
|
+
### fn `async function handleExtensionStatusEvent(` (L1202-1473)
|
|
5027
5077
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
5028
5078
|
- @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.
|
|
5029
5079
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5034,7 +5084,7 @@ cost.
|
|
|
5034
5084
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
5035
5085
|
- @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
|
|
5036
5086
|
|
|
5037
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
5087
|
+
### fn `function registerExtensionStatusHooks(` (L1489-1508)
|
|
5038
5088
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
5039
5089
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
5040
5090
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -5048,7 +5098,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5048
5098
|
- @return {void} No return value.
|
|
5049
5099
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
5050
5100
|
|
|
5051
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
5101
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1518-1521)
|
|
5052
5102
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
5053
5103
|
- @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.
|
|
5054
5104
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5056,26 +5106,26 @@ registered hook count. Side effects include hook registration.
|
|
|
5056
5106
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5057
5107
|
- @return {void} No return value.
|
|
5058
5108
|
|
|
5059
|
-
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (
|
|
5109
|
+
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1529-1531)
|
|
5060
5110
|
- @brief Returns the canonical debug-tool toggle order.
|
|
5061
5111
|
- @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.
|
|
5062
5112
|
- @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
|
|
5063
5113
|
- @satisfies REQ-242
|
|
5064
5114
|
|
|
5065
|
-
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (
|
|
5115
|
+
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1540-1549)
|
|
5066
5116
|
- @brief Restores the debug configuration subtree to its documented defaults.
|
|
5067
|
-
- @details Resets global debug enablement, log path, workflow-state filter, dedicated workflow-event logging, and selected tool plus prompt debug toggles without mutating unrelated settings. Runtime is O(1). Side effect: mutates `config`.
|
|
5117
|
+
- @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`.
|
|
5068
5118
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5069
5119
|
- @return {void} No return value.
|
|
5070
|
-
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277
|
|
5120
|
+
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-195, REQ-277, REQ-322
|
|
5071
5121
|
|
|
5072
|
-
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (
|
|
5122
|
+
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1557-1563)
|
|
5073
5123
|
- @brief Formats the top-level Debug summary value.
|
|
5074
5124
|
- @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.
|
|
5075
5125
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5076
5126
|
- @return {string} Compact debug summary string.
|
|
5077
5127
|
|
|
5078
|
-
### fn `function buildDebugMenuChoice(` (
|
|
5128
|
+
### fn `function buildDebugMenuChoice(` (L1573-1586)
|
|
5079
5129
|
- @brief Builds one debug-menu row with optional disabled styling.
|
|
5080
5130
|
- @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.
|
|
5081
5131
|
- @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
|
|
@@ -5083,67 +5133,70 @@ registered hook count. Side effects include hook registration.
|
|
|
5083
5133
|
- @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
|
|
5084
5134
|
- @satisfies REQ-241
|
|
5085
5135
|
|
|
5086
|
-
### fn `async function selectDebugLogOnStatus(` (
|
|
5136
|
+
### fn `async function selectDebugLogOnStatus(` (L1595-1623)
|
|
5087
5137
|
- @brief Opens the workflow-state filter selector used by the Debug submenu.
|
|
5088
5138
|
- @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.
|
|
5089
5139
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5090
5140
|
- @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
|
|
5091
5141
|
- @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
|
|
5092
5142
|
|
|
5093
|
-
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5143
|
+
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1632-1718)
|
|
5094
5144
|
- @brief Builds the shared settings-menu choices for debug logging configuration.
|
|
5095
|
-
- @details Serializes global debug controls plus workflow-state, dedicated workflow-event, per-tool, and per-prompt toggles into one submenu, deriving inventories from the canonical tool and prompt lists and dimming locked rows while debug is disabled. Runtime is O(t + p). No external state is mutated.
|
|
5145
|
+
- @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.
|
|
5096
5146
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5097
5147
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
|
|
5098
|
-
- @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277
|
|
5148
|
+
- @satisfies REQ-240, REQ-241, REQ-242, REQ-243, REQ-193, REQ-277, REQ-321, REQ-322
|
|
5099
5149
|
|
|
5100
|
-
### fn `async function configureDebugMenu(` (
|
|
5150
|
+
### fn `async function configureDebugMenu(` (L1729-1919)
|
|
5101
5151
|
- @brief Runs the interactive Debug submenu.
|
|
5102
|
-
- @details Lets the user toggle global debug enablement,
|
|
5152
|
+
- @details Lets the user toggle global debug enablement, tool-wrapper command registration, debug file and workflow filters, dedicated workflow-event logging, per-tool selectors, and per-prompt selectors while preserving row focus across re-renders. Runtime depends on user interaction count. Side effects include UI updates, config mutation, and optional debug command registration.
|
|
5153
|
+
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5103
5154
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5104
5155
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5105
5156
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5106
|
-
- @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
|
|
5157
|
+
- @satisfies REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-192, REQ-193, REQ-195, REQ-277, REQ-321, REQ-322, REQ-323
|
|
5158
|
+
|
|
5159
|
+
### fn `const updateDebugToolCommandsEnabled = (nextValue: unknown): void =>` (L1735-1742)
|
|
5107
5160
|
|
|
5108
|
-
- type `type PiNotifyBooleanConfigKey =` (
|
|
5161
|
+
- type `type PiNotifyBooleanConfigKey =` (L1925)
|
|
5109
5162
|
- @brief Represents one persisted boolean notification-setting key.
|
|
5110
5163
|
- @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.
|
|
5111
|
-
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (
|
|
5164
|
+
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1942)
|
|
5112
5165
|
- @brief Represents one persisted boolean notification event-toggle key.
|
|
5113
5166
|
- @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.
|
|
5114
|
-
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (
|
|
5167
|
+
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1951)
|
|
5115
5168
|
- @brief Represents one shared prompt-end event identifier used by notification menus.
|
|
5116
5169
|
- @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.
|
|
5117
|
-
### iface `interface PiNotifyEventRowDefinition` (
|
|
5170
|
+
### iface `interface PiNotifyEventRowDefinition` (L1957-1961)
|
|
5118
5171
|
- @brief Describes one shared prompt-end event row rendered inside notification event submenus.
|
|
5119
5172
|
- @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.
|
|
5120
5173
|
|
|
5121
|
-
### iface `interface PiNotifyEventMenuDefinition` (
|
|
5174
|
+
### iface `interface PiNotifyEventMenuDefinition` (L1967-1973)
|
|
5122
5175
|
- @brief Describes one notification-system event submenu contract.
|
|
5123
5176
|
- @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.
|
|
5124
5177
|
|
|
5125
|
-
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (
|
|
5178
|
+
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1982-1985)
|
|
5126
5179
|
- @brief Flips one persisted boolean notification setting.
|
|
5127
5180
|
- @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`.
|
|
5128
5181
|
- @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
|
|
5129
5182
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5130
5183
|
- @return {boolean} Next enabled state.
|
|
5131
5184
|
|
|
5132
|
-
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (
|
|
5185
|
+
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L1994-2018)
|
|
5133
5186
|
- @brief Restores notification-related settings to their documented defaults.
|
|
5134
5187
|
- @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`.
|
|
5135
5188
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5136
5189
|
- @return {void} No return value.
|
|
5137
5190
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
|
|
5138
5191
|
|
|
5139
|
-
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (
|
|
5192
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2027-2029)
|
|
5140
5193
|
- @brief Formats one persisted Pushover priority for menu display.
|
|
5141
5194
|
- @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.
|
|
5142
5195
|
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
5143
5196
|
- @return {string} Menu-display label.
|
|
5144
5197
|
- @satisfies REQ-172
|
|
5145
5198
|
|
|
5146
|
-
### fn `function formatPiNotifyEventMenuSummary(` (
|
|
5199
|
+
### fn `function formatPiNotifyEventMenuSummary(` (L2113-2121)
|
|
5147
5200
|
- @brief Formats the top-level summary value for one notification event submenu.
|
|
5148
5201
|
- @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.
|
|
5149
5202
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5151,7 +5204,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5151
5204
|
- @return {string} Compact enabled-toggle summary.
|
|
5152
5205
|
- @satisfies REQ-198
|
|
5153
5206
|
|
|
5154
|
-
### fn `function buildPiNotifyEventLauncherChoice(` (
|
|
5207
|
+
### fn `function buildPiNotifyEventLauncherChoice(` (L2131-2141)
|
|
5155
5208
|
- @brief Builds the top-level launcher row for one notification event submenu.
|
|
5156
5209
|
- @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.
|
|
5157
5210
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5159,7 +5212,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5159
5212
|
- @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
|
|
5160
5213
|
- @satisfies REQ-181, REQ-183, REQ-165, REQ-198
|
|
5161
5214
|
|
|
5162
|
-
### fn `function buildPiNotifyEventMenuChoices(` (
|
|
5215
|
+
### fn `function buildPiNotifyEventMenuChoices(` (L2151-2167)
|
|
5163
5216
|
- @brief Builds the shared settings-menu choices for one notification event submenu.
|
|
5164
5217
|
- @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.
|
|
5165
5218
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -5167,7 +5220,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5167
5220
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
|
|
5168
5221
|
- @satisfies REQ-188, REQ-193, REQ-198
|
|
5169
5222
|
|
|
5170
|
-
### fn `function resetPiNotifyEventMenuToDefaults(` (
|
|
5223
|
+
### fn `function resetPiNotifyEventMenuToDefaults(` (L2177-2185)
|
|
5171
5224
|
- @brief Restores one notification event submenu to its documented defaults.
|
|
5172
5225
|
- @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`.
|
|
5173
5226
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
@@ -5175,7 +5228,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5175
5228
|
- @return {void} No return value.
|
|
5176
5229
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195
|
|
5177
5230
|
|
|
5178
|
-
### fn `function resolvePiNotifyEventLabel(` (
|
|
5231
|
+
### fn `function resolvePiNotifyEventLabel(` (L2195-2202)
|
|
5179
5232
|
- @brief Resolves the human-readable event label for one event-toggle config key.
|
|
5180
5233
|
- @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.
|
|
5181
5234
|
- @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
|
|
@@ -5183,7 +5236,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5183
5236
|
- @return {string} Human-readable event label.
|
|
5184
5237
|
- @satisfies REQ-188, REQ-198
|
|
5185
5238
|
|
|
5186
|
-
### fn `async function configurePiNotifyEventMenu(` (
|
|
5239
|
+
### fn `async function configurePiNotifyEventMenu(` (L2213-2289)
|
|
5187
5240
|
- @brief Runs one dedicated notification event submenu.
|
|
5188
5241
|
- @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.
|
|
5189
5242
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5192,14 +5245,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5192
5245
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5193
5246
|
- @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
|
|
5194
5247
|
|
|
5195
|
-
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5248
|
+
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2298-2348)
|
|
5196
5249
|
- @brief Builds the direct Pushover rows rendered inside `Notifications`.
|
|
5197
5250
|
- @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.
|
|
5198
5251
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5199
5252
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
|
|
5200
5253
|
- @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
|
|
5201
5254
|
|
|
5202
|
-
### fn `async function selectPiNotifyPushoverPriority(` (
|
|
5255
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L2358-2386)
|
|
5203
5256
|
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
5204
5257
|
- @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.
|
|
5205
5258
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5207,14 +5260,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5207
5260
|
- @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
|
|
5208
5261
|
- @satisfies REQ-172, REQ-192
|
|
5209
5262
|
|
|
5210
|
-
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5263
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2395-2453)
|
|
5211
5264
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
5212
5265
|
- @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.
|
|
5213
5266
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5214
5267
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
5215
5268
|
- @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
|
|
5216
5269
|
|
|
5217
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
5270
|
+
### fn `async function selectPiNotifySoundLevel(` (L2463-2503)
|
|
5218
5271
|
- @brief Opens the shared settings-menu selector for the persisted boot sound level.
|
|
5219
5272
|
- @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.
|
|
5220
5273
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5222,7 +5275,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5222
5275
|
- @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected boot sound level, reset action, or `undefined` when cancelled.
|
|
5223
5276
|
- @satisfies REQ-131, REQ-179, REQ-192, REQ-289
|
|
5224
5277
|
|
|
5225
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
5278
|
+
### fn `async function configurePiNotifyMenu(` (L2513-2799)
|
|
5226
5279
|
- @brief Runs the interactive notification-configuration menu.
|
|
5227
5280
|
- @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.
|
|
5228
5281
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5230,7 +5283,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5230
5283
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
5231
5284
|
- @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
|
|
5232
5285
|
|
|
5233
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
5286
|
+
### fn `function registerPiNotifyShortcut(` (L2814-2837)
|
|
5234
5287
|
- @brief Registers the configurable notification-sound shortcut when supported.
|
|
5235
5288
|
- @details Loads the current effective config, registers one raw pi shortcut when
|
|
5236
5289
|
the runtime exposes `registerShortcut(...)`, cycles only the active runtime
|
|
@@ -5243,15 +5296,15 @@ registration and status updates.
|
|
|
5243
5296
|
- @return {void} No return value.
|
|
5244
5297
|
- @satisfies REQ-134, REQ-180, REQ-286, REQ-287
|
|
5245
5298
|
|
|
5246
|
-
### fn `function resolveReqResetPromptRequest(` (
|
|
5299
|
+
### fn `function resolveReqResetPromptRequest(` (L2845-2871)
|
|
5247
5300
|
- @brief Resolves the prompt execution plan targeted by `req-reset` recovery.
|
|
5248
5301
|
- @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.
|
|
5249
5302
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5250
5303
|
- @return {PromptCommandExecutionPlan | undefined} Recoverable prompt execution plan when one remains available.
|
|
5251
5304
|
|
|
5252
|
-
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (
|
|
5305
|
+
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2848-2855)
|
|
5253
5306
|
|
|
5254
|
-
### fn `function registerReqResetCommand(` (
|
|
5307
|
+
### fn `function registerReqResetCommand(` (L2881-2935)
|
|
5255
5308
|
- @brief Registers the specialized `req-reset` slash command.
|
|
5256
5309
|
- @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.
|
|
5257
5310
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5259,7 +5312,7 @@ registration and status updates.
|
|
|
5259
5312
|
- @return {void} No return value.
|
|
5260
5313
|
- @satisfies REQ-304, REQ-305, REQ-306, REQ-307, REQ-308, REQ-309, REQ-310, REQ-311, REQ-312, REQ-313
|
|
5261
5314
|
|
|
5262
|
-
### fn `function registerReqReferencesCommand(` (
|
|
5315
|
+
### fn `function registerReqReferencesCommand(` (L2945-2985)
|
|
5263
5316
|
- @brief Registers the specialized `req-references` slash command.
|
|
5264
5317
|
- @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.
|
|
5265
5318
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5267,7 +5320,7 @@ registration and status updates.
|
|
|
5267
5320
|
- @return {void} No return value.
|
|
5268
5321
|
- @satisfies REQ-200, REQ-221, REQ-224, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303
|
|
5269
5322
|
|
|
5270
|
-
### fn `function registerPromptCommands(` (
|
|
5323
|
+
### fn `function registerPromptCommands(` (L2995-3111)
|
|
5271
5324
|
- @brief Registers bundled prompt-backed commands with the extension.
|
|
5272
5325
|
- @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.
|
|
5273
5326
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5275,14 +5328,14 @@ registration and status updates.
|
|
|
5275
5328
|
- @return {void} No return value.
|
|
5276
5329
|
- @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
|
|
5277
5330
|
|
|
5278
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
5331
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3121-3420)
|
|
5279
5332
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
5280
5333
|
- @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.
|
|
5281
5334
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5282
5335
|
- @return {void} No return value.
|
|
5283
5336
|
- @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
|
|
5284
5337
|
|
|
5285
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5338
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3465-3490)
|
|
5286
5339
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
5287
5340
|
- @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.
|
|
5288
5341
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5290,7 +5343,7 @@ registration and status updates.
|
|
|
5290
5343
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
5291
5344
|
- @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5292
5345
|
|
|
5293
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5346
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3500-3514)
|
|
5294
5347
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
5295
5348
|
- @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.
|
|
5296
5349
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5298,7 +5351,7 @@ registration and status updates.
|
|
|
5298
5351
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
5299
5352
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
|
|
5300
5353
|
|
|
5301
|
-
### fn `async function configurePiUsereqToolsMenu(` (
|
|
5354
|
+
### fn `async function configurePiUsereqToolsMenu(` (L3525-3642)
|
|
5302
5355
|
- @brief Runs the interactive active-tool configuration menu.
|
|
5303
5356
|
- @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.
|
|
5304
5357
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5307,58 +5360,58 @@ registration and status updates.
|
|
|
5307
5360
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5308
5361
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
|
|
5309
5362
|
|
|
5310
|
-
### fn `function getStaticCheckLanguageConfigForMenu(` (
|
|
5363
|
+
### fn `function getStaticCheckLanguageConfigForMenu(` (L3651-3656)
|
|
5311
5364
|
- @brief Resolves one static-check language config for menu rendering.
|
|
5312
5365
|
- @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.
|
|
5313
5366
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5314
5367
|
- @param[in] language {string} Canonical language name.
|
|
5315
5368
|
- @return {StaticCheckLanguageConfig} Resolved per-language config object.
|
|
5316
5369
|
|
|
5317
|
-
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5370
|
+
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3664-3666)
|
|
5318
5371
|
- @brief Counts languages that currently expose at least one configured checker.
|
|
5319
5372
|
- @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.
|
|
5320
5373
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5321
5374
|
- @return {number} Number of languages with at least one configured checker.
|
|
5322
5375
|
|
|
5323
|
-
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5376
|
+
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3674-3676)
|
|
5324
5377
|
- @brief Counts languages whose static-check enable flag is on.
|
|
5325
5378
|
- @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.
|
|
5326
5379
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5327
5380
|
- @return {number} Number of enabled languages.
|
|
5328
5381
|
|
|
5329
|
-
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (
|
|
5382
|
+
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3685-3687)
|
|
5330
5383
|
- @brief Restores the documented static-check default configuration.
|
|
5331
5384
|
- @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`.
|
|
5332
5385
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5333
5386
|
- @return {void} No return value.
|
|
5334
5387
|
- @satisfies REQ-250, REQ-251, REQ-252
|
|
5335
5388
|
|
|
5336
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
5389
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3695-3697)
|
|
5337
5390
|
- @brief Summarizes enabled and configured static-check languages.
|
|
5338
5391
|
- @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.
|
|
5339
5392
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5340
5393
|
- @return {string} Compact summary string.
|
|
5341
5394
|
|
|
5342
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5395
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3706-3738)
|
|
5343
5396
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
5344
5397
|
- @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.
|
|
5345
5398
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5346
5399
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
5347
5400
|
- @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
|
|
5348
5401
|
|
|
5349
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5402
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3746-3763)
|
|
5350
5403
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
5351
5404
|
- @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.
|
|
5352
5405
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5353
5406
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
5354
5407
|
|
|
5355
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5408
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3771-3788)
|
|
5356
5409
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
5357
5410
|
- @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.
|
|
5358
5411
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5359
5412
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
5360
5413
|
|
|
5361
|
-
### fn `async function configureStaticCheckMenu(` (
|
|
5414
|
+
### fn `async function configureStaticCheckMenu(` (L3798-3944)
|
|
5362
5415
|
- @brief Runs the interactive static-check configuration menu.
|
|
5363
5416
|
- @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.
|
|
5364
5417
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5366,7 +5419,7 @@ registration and status updates.
|
|
|
5366
5419
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5367
5420
|
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
|
|
5368
5421
|
|
|
5369
|
-
### fn `function buildPiUsereqMenuChoices(` (
|
|
5422
|
+
### fn `function buildPiUsereqMenuChoices(` (L3954-4053)
|
|
5370
5423
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
5371
5424
|
- @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.
|
|
5372
5425
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -5374,21 +5427,21 @@ registration and status updates.
|
|
|
5374
5427
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
5375
5428
|
- @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
|
|
5376
5429
|
|
|
5377
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5430
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4062-4080)
|
|
5378
5431
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
5379
5432
|
- @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.
|
|
5380
5433
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5381
5434
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
5382
5435
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5383
5436
|
|
|
5384
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5437
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4089-4101)
|
|
5385
5438
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
5386
5439
|
- @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.
|
|
5387
5440
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5388
5441
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
5389
5442
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
5390
5443
|
|
|
5391
|
-
### fn `async function configurePiUsereq(` (
|
|
5444
|
+
### fn `async function configurePiUsereq(` (L4112-4365)
|
|
5392
5445
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
5393
5446
|
- @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.
|
|
5394
5447
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5397,9 +5450,9 @@ registration and status updates.
|
|
|
5397
5450
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
5398
5451
|
- @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
|
|
5399
5452
|
|
|
5400
|
-
### fn `const persistConfigChange = () =>` (
|
|
5453
|
+
### fn `const persistConfigChange = () =>` (L4123-4128)
|
|
5401
5454
|
|
|
5402
|
-
### fn `function registerConfigCommands(` (
|
|
5455
|
+
### fn `function registerConfigCommands(` (L4375-4385)
|
|
5403
5456
|
- @brief Registers configuration-management commands.
|
|
5404
5457
|
- @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.
|
|
5405
5458
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5407,110 +5460,116 @@ registration and status updates.
|
|
|
5407
5460
|
- @return {void} No return value.
|
|
5408
5461
|
- @satisfies REQ-006, REQ-031
|
|
5409
5462
|
|
|
5410
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
5463
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4394-4407)
|
|
5411
5464
|
- @brief Registers the complete pi-usereq extension.
|
|
5412
|
-
- @details Validates installation-owned bundled resources, registers the specialized `req-reset` and `req-references` commands plus bundled prompt-backed commands and agent tools, 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.
|
|
5465
|
+
- @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.
|
|
5413
5466
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5414
5467
|
- @return {void} No return value.
|
|
5415
|
-
- @satisfies DES-002, REQ-004, REQ-005, REQ-009, REQ-044, REQ-067, REQ-068, REQ-109, REQ-111, REQ-112, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117, REQ-118, REQ-119, REQ-120, REQ-121, REQ-122, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-131, REQ-132, REQ-133, REQ-134, REQ-137, REQ-159, REQ-163, REQ-164, REQ-165, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172, REQ-174, REQ-179, REQ-180, REQ-184, REQ-188, REQ-190, REQ-191, REQ-192, REQ-193, REQ-194, REQ-195, REQ-196, REQ-197, REQ-236, REQ-237, REQ-238, REQ-239, REQ-240, REQ-241, REQ-242, REQ-243, REQ-244, REQ-245, REQ-246, REQ-247, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303, REQ-304, REQ-305, REQ-306, REQ-312, REQ-313
|
|
5468
|
+
- @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
|
|
5416
5469
|
|
|
5417
5470
|
## Symbol Index
|
|
5418
5471
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
5419
5472
|
|---|---|---|---|---|
|
|
5420
|
-
|`PiShortcutRegistrar`|iface||
|
|
5421
|
-
|`getProjectBase`|fn||
|
|
5422
|
-
|`getProcessCwdSafe`|fn||
|
|
5423
|
-
|`resolveLiveBootstrapCwd`|fn||
|
|
5424
|
-
|`syncContextCwdMirror`|fn||
|
|
5425
|
-
|`loadProjectConfig`|fn||
|
|
5426
|
-
|`
|
|
5427
|
-
|`
|
|
5428
|
-
|`
|
|
5429
|
-
|`
|
|
5430
|
-
|`
|
|
5431
|
-
|`
|
|
5432
|
-
|`
|
|
5433
|
-
|`
|
|
5434
|
-
|`
|
|
5435
|
-
|`
|
|
5436
|
-
|`
|
|
5437
|
-
|`
|
|
5438
|
-
|`
|
|
5439
|
-
|`
|
|
5440
|
-
|`
|
|
5441
|
-
|`
|
|
5442
|
-
|`
|
|
5443
|
-
|`
|
|
5444
|
-
|`
|
|
5445
|
-
|`
|
|
5446
|
-
|`
|
|
5447
|
-
|`
|
|
5448
|
-
|`
|
|
5449
|
-
|`
|
|
5450
|
-
|`
|
|
5451
|
-
|`
|
|
5452
|
-
|`
|
|
5453
|
-
|`
|
|
5454
|
-
|`
|
|
5455
|
-
|`
|
|
5456
|
-
|`
|
|
5457
|
-
|`
|
|
5458
|
-
|`
|
|
5459
|
-
|`
|
|
5460
|
-
|`
|
|
5461
|
-
|`
|
|
5462
|
-
|`
|
|
5463
|
-
|`
|
|
5464
|
-
|`
|
|
5465
|
-
|`
|
|
5466
|
-
|`
|
|
5467
|
-
|`
|
|
5468
|
-
|`
|
|
5469
|
-
|`
|
|
5470
|
-
|`
|
|
5471
|
-
|`
|
|
5472
|
-
|`
|
|
5473
|
-
|`
|
|
5474
|
-
|`
|
|
5475
|
-
|`
|
|
5476
|
-
|`
|
|
5477
|
-
|`
|
|
5478
|
-
|`
|
|
5479
|
-
|`
|
|
5480
|
-
|`
|
|
5481
|
-
|`
|
|
5482
|
-
|`
|
|
5483
|
-
|`
|
|
5484
|
-
|`
|
|
5485
|
-
|`
|
|
5486
|
-
|`
|
|
5487
|
-
|`
|
|
5488
|
-
|`
|
|
5489
|
-
|`
|
|
5490
|
-
|`
|
|
5491
|
-
|`
|
|
5492
|
-
|`
|
|
5493
|
-
|`
|
|
5494
|
-
|`
|
|
5495
|
-
|`
|
|
5496
|
-
|`
|
|
5497
|
-
|`
|
|
5498
|
-
|`
|
|
5499
|
-
|`
|
|
5500
|
-
|`
|
|
5501
|
-
|`
|
|
5502
|
-
|`
|
|
5503
|
-
|`
|
|
5504
|
-
|`
|
|
5505
|
-
|`
|
|
5506
|
-
|`
|
|
5507
|
-
|`
|
|
5508
|
-
|`
|
|
5509
|
-
|`
|
|
5510
|
-
|`
|
|
5511
|
-
|`
|
|
5512
|
-
|`
|
|
5513
|
-
|`
|
|
5514
|
-
|`
|
|
5515
|
-
|`
|
|
5473
|
+
|`PiShortcutRegistrar`|iface||180-188|interface PiShortcutRegistrar|
|
|
5474
|
+
|`getProjectBase`|fn||196-205|function getProjectBase(cwd: string): string|
|
|
5475
|
+
|`getProcessCwdSafe`|fn||212-221|function getProcessCwdSafe(): string|
|
|
5476
|
+
|`resolveLiveBootstrapCwd`|fn||229-241|function resolveLiveBootstrapCwd(cwd: string): string|
|
|
5477
|
+
|`syncContextCwdMirror`|fn||250-259|function syncContextCwdMirror(ctx: { cwd?: string }, cwd:...|
|
|
5478
|
+
|`loadProjectConfig`|fn||268-271|function loadProjectConfig(cwd: string): UseReqConfig|
|
|
5479
|
+
|`DebugToolCommandExecuteResult`|type||277||
|
|
5480
|
+
|`shouldRegisterDebugToolCommands`|fn||286-292|function shouldRegisterDebugToolCommands(cwd: string): bo...|
|
|
5481
|
+
|`writeDebugToolCommandResultToEditor`|fn||303-317|function writeDebugToolCommandResultToEditor(|
|
|
5482
|
+
|`executeDebugToolCommand`|fn||329-347|function executeDebugToolCommand(|
|
|
5483
|
+
|`registerDebugToolCommands`|fn||356-390|function registerDebugToolCommands(pi: ExtensionAPI): void|
|
|
5484
|
+
|`saveProjectConfig`|fn||400-403|function saveProjectConfig(cwd: string, config: UseReqCon...|
|
|
5485
|
+
|`formatLocalConfigPathForMenu`|fn||412-416|function formatLocalConfigPathForMenu(cwd: string): string|
|
|
5486
|
+
|`formatGlobalConfigPathForMenu`|fn||424-426|function formatGlobalConfigPathForMenu(): string|
|
|
5487
|
+
|`buildTerminalSettingsMenuChoices`|fn||435-446|function buildTerminalSettingsMenuChoices(options:|
|
|
5488
|
+
|`ResetConfirmationChange`|iface||452-456|interface ResetConfirmationChange|
|
|
5489
|
+
|`formatResetConfirmationValue`|fn||465-467|function formatResetConfirmationValue(previousValue: stri...|
|
|
5490
|
+
|`buildResetConfirmationChoices`|fn||477-516|function buildResetConfirmationChoices(|
|
|
5491
|
+
|`confirmResetChanges`|fn||528-541|async function confirmResetChanges(|
|
|
5492
|
+
|`writePersistedConfigToEditor`|fn||550-555|function writePersistedConfigToEditor(|
|
|
5493
|
+
|`writePersistedLocalConfigToEditor`|fn||565-571|function writePersistedLocalConfigToEditor(|
|
|
5494
|
+
|`writePersistedGlobalConfigToEditor`|fn||580-584|function writePersistedGlobalConfigToEditor(|
|
|
5495
|
+
|`buildSearchToolSupportedTagGuidelines`|fn||645-649|function buildSearchToolSupportedTagGuidelines(): string[]|
|
|
5496
|
+
|`buildSearchToolSchemaDescription`|fn||657-662|function buildSearchToolSchemaDescription(scope: FindTool...|
|
|
5497
|
+
|`buildSearchToolPromptGuidelines`|fn||670-683|function buildSearchToolPromptGuidelines(scope: FindToolS...|
|
|
5498
|
+
|`MonolithicToolRenderResult`|type||689||
|
|
5499
|
+
|`getMonolithicToolText`|fn||706-709|function getMonolithicToolText(result: MonolithicToolRend...|
|
|
5500
|
+
|`getMonolithicToolErrorText`|fn||717-727|function getMonolithicToolErrorText(result: MonolithicToo...|
|
|
5501
|
+
|`formatCompactToolArgumentValue`|fn||735-774|function formatCompactToolArgumentValue(value: unknown): ...|
|
|
5502
|
+
|`buildCompactToolInvocationText`|fn||782-793|function buildCompactToolInvocationText(args: Record<stri...|
|
|
5503
|
+
|`summarizeStructuredToolResult`|fn||803-818|function summarizeStructuredToolResult(|
|
|
5504
|
+
|`buildStructuredToolRenderResult`|fn||827-846|function buildStructuredToolRenderResult(toolName: string)|
|
|
5505
|
+
|`executeMonolithicTool`|fn||854-860|function executeMonolithicTool(operation: () => ToolResul...|
|
|
5506
|
+
|`executeStatusTool`|fn||869-898|function executeStatusTool(operation: () => ToolResult): ...|
|
|
5507
|
+
|`deliverPromptCommand`|fn||909-927|function deliverPromptCommand(|
|
|
5508
|
+
|`shouldIgnoreLatePromptDeliveryFailure`|fn||938-954|function shouldIgnoreLatePromptDeliveryFailure(|
|
|
5509
|
+
|`logPromptWorkflowStateChange`|fn||967-986|function logPromptWorkflowStateChange(|
|
|
5510
|
+
|`logPromptWorkflowEvent`|fn||1002-1022|function logPromptWorkflowEvent(|
|
|
5511
|
+
|`transitionPromptWorkflowState`|fn||1035-1048|function transitionPromptWorkflowState(|
|
|
5512
|
+
|`resolvePromptCommandDescription`|fn||1056-1060|function resolvePromptCommandDescription(|
|
|
5513
|
+
|`resolveDebugProjectBase`|fn||1069-1073|function resolveDebugProjectBase(cwd: string, statusContr...|
|
|
5514
|
+
|`notifyContextSafely`|fn||1084-1101|function notifyContextSafely(|
|
|
5515
|
+
|`rejectNonIdleReqCommand`|fn||1113-1133|function rejectNonIdleReqCommand(|
|
|
5516
|
+
|`getPiUsereqStartupTools`|fn||1142-1150|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
|
|
5517
|
+
|`getConfiguredEnabledPiUsereqTools`|fn||1158-1162|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
|
|
5518
|
+
|`applyConfiguredPiUsereqTools`|fn||1172-1189|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
|
|
5519
|
+
|`handleExtensionStatusEvent`|fn||1202-1473|async function handleExtensionStatusEvent(|
|
|
5520
|
+
|`registerExtensionStatusHooks`|fn||1489-1508|function registerExtensionStatusHooks(|
|
|
5521
|
+
|`setConfiguredPiUsereqTools`|fn||1518-1521|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
|
|
5522
|
+
|`getDebugToolToggleNames`|fn||1529-1531|function getDebugToolToggleNames(): PiUsereqStartupToolNa...|
|
|
5523
|
+
|`resetDebugConfigToDefaults`|fn||1540-1549|function resetDebugConfigToDefaults(config: UseReqConfig)...|
|
|
5524
|
+
|`formatDebugMenuSummary`|fn||1557-1563|function formatDebugMenuSummary(config: UseReqConfig): st...|
|
|
5525
|
+
|`buildDebugMenuChoice`|fn||1573-1586|function buildDebugMenuChoice(|
|
|
5526
|
+
|`selectDebugLogOnStatus`|fn||1595-1623|async function selectDebugLogOnStatus(|
|
|
5527
|
+
|`buildDebugMenuChoices`|fn||1632-1718|function buildDebugMenuChoices(config: UseReqConfig): PiU...|
|
|
5528
|
+
|`configureDebugMenu`|fn||1729-1919|async function configureDebugMenu(|
|
|
5529
|
+
|`updateDebugToolCommandsEnabled`|fn||1735-1742|const updateDebugToolCommandsEnabled = (nextValue: unknow...|
|
|
5530
|
+
|`PiNotifyBooleanConfigKey`|type||1925||
|
|
5531
|
+
|`PiNotifyEventBooleanConfigKey`|type||1942||
|
|
5532
|
+
|`PiNotifyEventId`|type||1951||
|
|
5533
|
+
|`PiNotifyEventRowDefinition`|iface||1957-1961|interface PiNotifyEventRowDefinition|
|
|
5534
|
+
|`PiNotifyEventMenuDefinition`|iface||1967-1973|interface PiNotifyEventMenuDefinition|
|
|
5535
|
+
|`togglePiNotifyFlag`|fn||1982-1985|function togglePiNotifyFlag(config: UseReqConfig, key: Pi...|
|
|
5536
|
+
|`resetPiNotifyConfigToDefaults`|fn||1994-2018|function resetPiNotifyConfigToDefaults(config: UseReqConf...|
|
|
5537
|
+
|`formatPiNotifyPushoverPriority`|fn||2027-2029|function formatPiNotifyPushoverPriority(priority: PiNotif...|
|
|
5538
|
+
|`formatPiNotifyEventMenuSummary`|fn||2113-2121|function formatPiNotifyEventMenuSummary(|
|
|
5539
|
+
|`buildPiNotifyEventLauncherChoice`|fn||2131-2141|function buildPiNotifyEventLauncherChoice(|
|
|
5540
|
+
|`buildPiNotifyEventMenuChoices`|fn||2151-2167|function buildPiNotifyEventMenuChoices(|
|
|
5541
|
+
|`resetPiNotifyEventMenuToDefaults`|fn||2177-2185|function resetPiNotifyEventMenuToDefaults(|
|
|
5542
|
+
|`resolvePiNotifyEventLabel`|fn||2195-2202|function resolvePiNotifyEventLabel(|
|
|
5543
|
+
|`configurePiNotifyEventMenu`|fn||2213-2289|async function configurePiNotifyEventMenu(|
|
|
5544
|
+
|`buildPiNotifyPushoverRows`|fn||2298-2348|function buildPiNotifyPushoverRows(config: UseReqConfig):...|
|
|
5545
|
+
|`selectPiNotifyPushoverPriority`|fn||2358-2386|async function selectPiNotifyPushoverPriority(|
|
|
5546
|
+
|`buildPiNotifyMenuChoices`|fn||2395-2453|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
|
|
5547
|
+
|`selectPiNotifySoundLevel`|fn||2463-2503|async function selectPiNotifySoundLevel(|
|
|
5548
|
+
|`configurePiNotifyMenu`|fn||2513-2799|async function configurePiNotifyMenu(|
|
|
5549
|
+
|`registerPiNotifyShortcut`|fn||2814-2837|function registerPiNotifyShortcut(|
|
|
5550
|
+
|`resolveReqResetPromptRequest`|fn||2845-2871|function resolveReqResetPromptRequest(|
|
|
5551
|
+
|`isWorktreeBacked`|fn||2848-2855|const isWorktreeBacked = (request: PromptCommandExecution...|
|
|
5552
|
+
|`registerReqResetCommand`|fn||2881-2935|function registerReqResetCommand(|
|
|
5553
|
+
|`registerReqReferencesCommand`|fn||2945-2985|function registerReqReferencesCommand(|
|
|
5554
|
+
|`registerPromptCommands`|fn||2995-3111|function registerPromptCommands(|
|
|
5555
|
+
|`registerAgentTools`|fn||3121-3420|function registerAgentTools(pi: ExtensionAPI): void|
|
|
5556
|
+
|`buildPiUsereqToolsMenuChoices`|fn||3465-3490|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
|
|
5557
|
+
|`buildPiUsereqToolToggleChoices`|fn||3500-3514|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
|
|
5558
|
+
|`configurePiUsereqToolsMenu`|fn||3525-3642|async function configurePiUsereqToolsMenu(|
|
|
5559
|
+
|`getStaticCheckLanguageConfigForMenu`|fn||3651-3656|function getStaticCheckLanguageConfigForMenu(|
|
|
5560
|
+
|`countConfiguredStaticCheckLanguages`|fn||3664-3666|function countConfiguredStaticCheckLanguages(config: UseR...|
|
|
5561
|
+
|`countEnabledStaticCheckLanguages`|fn||3674-3676|function countEnabledStaticCheckLanguages(config: UseReqC...|
|
|
5562
|
+
|`resetStaticCheckConfig`|fn||3685-3687|function resetStaticCheckConfig(config: UseReqConfig): void|
|
|
5563
|
+
|`formatStaticCheckLanguagesSummary`|fn||3695-3697|function formatStaticCheckLanguagesSummary(config: UseReq...|
|
|
5564
|
+
|`buildStaticCheckMenuChoices`|fn||3706-3738|function buildStaticCheckMenuChoices(config: UseReqConfig...|
|
|
5565
|
+
|`buildSupportedStaticCheckLanguageChoices`|fn||3746-3763|function buildSupportedStaticCheckLanguageChoices(config:...|
|
|
5566
|
+
|`buildConfiguredStaticCheckLanguageChoices`|fn||3771-3788|function buildConfiguredStaticCheckLanguageChoices(config...|
|
|
5567
|
+
|`configureStaticCheckMenu`|fn||3798-3944|async function configureStaticCheckMenu(|
|
|
5568
|
+
|`buildPiUsereqMenuChoices`|fn||3954-4053|function buildPiUsereqMenuChoices(|
|
|
5569
|
+
|`buildSrcDirMenuChoices`|fn||4062-4080|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
|
|
5570
|
+
|`buildSrcDirRemovalChoices`|fn||4089-4101|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
|
|
5571
|
+
|`configurePiUsereq`|fn||4112-4365|async function configurePiUsereq(|
|
|
5572
|
+
|`persistConfigChange`|fn||4123-4128|const persistConfigChange = () =>|
|
|
5573
|
+
|`registerConfigCommands`|fn||4375-4385|function registerConfigCommands(|
|
|
5574
|
+
|`piUsereqExtension`|fn||4394-4407|export default function piUsereqExtension(pi: ExtensionAP...|
|
|
5516
5575
|
|