pi-usereq 0.12.0 → 0.32.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 +13 -6
- package/.gitignore +1 -2
- package/CHANGELOG.md +145 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +629 -396
- package/pi-usereq/docs/REQUIREMENTS.md +70 -46
- package/pi-usereq/docs/WORKFLOW.md +83 -42
- package/src/core/config.ts +553 -180
- package/src/core/debug-runtime.ts +24 -0
- package/src/core/extension-status.ts +2 -2
- package/src/core/path-context.ts +19 -4
- package/src/index.ts +248 -44
- package/tests/attended-results-scenarios.ts +10 -4
- package/tests/cli-command-option-parity.test.ts +28 -10
- package/tests/debug-extension-harness.test.ts +7 -9
- package/tests/extension-registration.test.ts +314 -123
- package/tests/helpers.ts +29 -6
- 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,10 +581,10 @@ 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
|
-
- @brief Loads, normalizes, and persists pi-usereq
|
|
587
|
-
- @details Defines the configuration schema,
|
|
586
|
+
- @brief Loads, normalizes, merges, and persists pi-usereq configuration.
|
|
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`.
|
|
588
588
|
|
|
589
589
|
## Imports
|
|
590
590
|
```
|
|
@@ -600,41 +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` (
|
|
615
|
-
- @brief Defines the
|
|
616
|
-
- @details Captures documentation paths, source/test directory selection, per-language static-check enablement
|
|
614
|
+
### iface `export interface UseReqConfig` (L83-122)
|
|
615
|
+
- @brief Defines the effective pi-usereq configuration schema.
|
|
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
|
-
###
|
|
618
|
+
### iface `interface LocalStaticCheckLanguageConfig` (L128-130)
|
|
619
|
+
- @brief Defines one persisted local static-check language configuration.
|
|
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
|
+
|
|
622
|
+
### iface `interface GlobalStaticCheckLanguageConfig` (L136-138)
|
|
623
|
+
- @brief Defines one persisted global static-check language configuration.
|
|
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
|
+
|
|
626
|
+
### iface `interface UseReqLocalConfig` (L144-157)
|
|
627
|
+
- @brief Defines the persisted local pi-usereq configuration schema.
|
|
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
|
+
|
|
630
|
+
### iface `interface UseReqGlobalConfig` (L163-191)
|
|
631
|
+
- @brief Defines the persisted global pi-usereq configuration schema.
|
|
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
|
+
|
|
634
|
+
### fn `function cloneStaticCheckEntry(entry: StaticCheckEntry): StaticCheckEntry` (L308-317)
|
|
619
635
|
- @brief Clones one static-check entry into its persisted shape.
|
|
620
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.
|
|
621
637
|
- @param[in] entry {StaticCheckEntry} Source static-check entry.
|
|
622
638
|
- @return {StaticCheckEntry} Persistable static-check entry clone.
|
|
623
639
|
|
|
624
|
-
### fn `export function createStaticCheckLanguageConfig(` (
|
|
640
|
+
### fn `export function createStaticCheckLanguageConfig(` (L326-335)
|
|
625
641
|
- @brief Builds one per-language static-check configuration object.
|
|
626
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.
|
|
627
643
|
- @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
|
|
628
644
|
- @param[in] enabled {StaticCheckEnabled | undefined} Optional explicit enable flag.
|
|
629
645
|
- @return {StaticCheckLanguageConfig} Normalized per-language config object.
|
|
630
646
|
|
|
631
|
-
### fn `
|
|
647
|
+
### fn `function createLocalStaticCheckLanguageConfig(` (L343-347)
|
|
648
|
+
- @brief Builds one persisted local static-check language configuration object.
|
|
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
|
+
- @param[in] enabled {StaticCheckEnabled} Canonical per-language enable flag.
|
|
651
|
+
- @return {LocalStaticCheckLanguageConfig} Persistable local static-check language config.
|
|
652
|
+
|
|
653
|
+
### fn `function createGlobalStaticCheckLanguageConfig(` (L355-361)
|
|
654
|
+
- @brief Builds one persisted global static-check language configuration object.
|
|
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
|
+
- @param[in] checkers {StaticCheckEntry[]} Ordered checker entries.
|
|
657
|
+
- @return {GlobalStaticCheckLanguageConfig} Persistable global static-check language config.
|
|
658
|
+
|
|
659
|
+
### fn `function getDefaultGlobalStaticCheckConfig(): Record<string, GlobalStaticCheckLanguageConfig>` (L368-373)
|
|
660
|
+
- @brief Returns the documented default global static-check checker map.
|
|
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
|
+
- @return {Record<string, GlobalStaticCheckLanguageConfig>} Fresh default global checker map.
|
|
663
|
+
|
|
664
|
+
### fn `function getDefaultLocalStaticCheckConfig(` (L381-390)
|
|
665
|
+
- @brief Returns the documented default local static-check enable map.
|
|
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
|
+
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker map used to derive default enablement.
|
|
668
|
+
- @return {Record<string, LocalStaticCheckLanguageConfig>} Fresh default local enable map.
|
|
669
|
+
|
|
670
|
+
### fn `function mergeStaticCheckConfig(` (L399-418)
|
|
671
|
+
- @brief Merges local enable flags with global checker definitions into the effective static-check map.
|
|
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
|
+
- @param[in] localStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Persisted local enable map.
|
|
674
|
+
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Persisted global checker map.
|
|
675
|
+
- @return {Record<string, StaticCheckLanguageConfig>} Effective per-language static-check config.
|
|
676
|
+
|
|
677
|
+
### fn `export function getDefaultStaticCheckConfig(): Record<string, StaticCheckLanguageConfig>` (L426-432)
|
|
632
678
|
- @brief Returns the documented default static-check configuration.
|
|
633
|
-
- @details Emits one per-language config object for every supported language
|
|
634
|
-
- @return {Record<string, StaticCheckLanguageConfig>} Fresh default static-check config.
|
|
635
|
-
- @satisfies REQ-249, REQ-250, REQ-251, REQ-252
|
|
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
|
+
- @return {Record<string, StaticCheckLanguageConfig>} Fresh default effective static-check config.
|
|
681
|
+
- @satisfies REQ-249, REQ-250, REQ-251, REQ-252, REQ-316
|
|
636
682
|
|
|
637
|
-
### fn `export function normalizeStaticCheckEnabled(` (
|
|
683
|
+
### fn `export function normalizeStaticCheckEnabled(` (L442-447)
|
|
638
684
|
- @brief Normalizes one persisted per-language static-check enable flag.
|
|
639
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.
|
|
640
686
|
- @param[in] value {unknown} Candidate persisted enable flag.
|
|
@@ -642,7 +688,7 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
642
688
|
- @return {StaticCheckEnabled} Canonical per-language enable flag.
|
|
643
689
|
- @satisfies REQ-249
|
|
644
690
|
|
|
645
|
-
### fn `export function getActiveStaticCheckEntries(` (
|
|
691
|
+
### fn `export function getActiveStaticCheckEntries(` (L457-466)
|
|
646
692
|
- @brief Resolves the active checker list for one language.
|
|
647
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.
|
|
648
694
|
- @param[in] staticCheckConfig {Record<string, StaticCheckLanguageConfig>} Effective static-check config.
|
|
@@ -650,21 +696,21 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
650
696
|
- @return {StaticCheckEntry[]} Active checker list for the language.
|
|
651
697
|
- @satisfies REQ-019
|
|
652
698
|
|
|
653
|
-
### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (
|
|
699
|
+
### fn `export function normalizeAutoGitCommit(value: unknown): "enable" | "disable"` (L481-483)
|
|
654
700
|
- @brief Normalizes one persisted automatic git-commit mode value.
|
|
655
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.
|
|
656
702
|
- @param[in] value {unknown} Candidate persisted automatic git-commit payload.
|
|
657
703
|
- @return {"enable" | "disable"} Canonical automatic git-commit mode.
|
|
658
704
|
- @satisfies REQ-212
|
|
659
705
|
|
|
660
|
-
### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (
|
|
706
|
+
### fn `export function normalizeGitWorktreeEnabled(value: unknown): "enable" | "disable"` (L497-499)
|
|
661
707
|
- @brief Normalizes one persisted worktree-enable flag value.
|
|
662
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.
|
|
663
709
|
- @param[in] value {unknown} Candidate persisted worktree-enable payload.
|
|
664
710
|
- @return {"enable" | "disable"} Canonical persisted worktree-enable mode.
|
|
665
711
|
- @satisfies REQ-204
|
|
666
712
|
|
|
667
|
-
### fn `export function resolveEffectiveGitWorktreeEnabled(` (
|
|
713
|
+
### fn `export function resolveEffectiveGitWorktreeEnabled(` (L508-513)
|
|
668
714
|
- @brief Resolves the effective worktree mode after automatic-commit policy is applied.
|
|
669
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.
|
|
670
716
|
- @param[in] autoGitCommit {"enable" | "disable"} Effective automatic git-commit mode.
|
|
@@ -672,70 +718,151 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
672
718
|
- @return {"enable" | "disable"} Effective worktree mode used by menus, persistence, and prompt execution.
|
|
673
719
|
- @satisfies REQ-204, REQ-215
|
|
674
720
|
|
|
675
|
-
### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (
|
|
721
|
+
### fn `export function normalizeGitWorktreePrefix(value: unknown): string` (L527-533)
|
|
676
722
|
- @brief Normalizes one persisted worktree-name prefix value.
|
|
677
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.
|
|
678
724
|
- @param[in] value {unknown} Candidate persisted prefix payload.
|
|
679
725
|
- @return {string} Canonical worktree-name prefix.
|
|
680
726
|
- @satisfies REQ-205
|
|
681
727
|
|
|
682
|
-
### fn `export function getProjectConfigPath(projectBase: string): string` (
|
|
683
|
-
- @brief Computes the per-project config file path.
|
|
684
|
-
- @details Joins the project base with `.pi-usereq.json`, producing the canonical persistence location used by CLI and extension code. Time complexity is O(1). No I/O side effects occur.
|
|
685
|
-
- @param[in] projectBase {string} Absolute project root path.
|
|
686
|
-
- @return {string} Absolute config file path.
|
|
687
|
-
|
|
688
|
-
### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (L393-433)
|
|
689
|
-
- @brief Builds the default project configuration.
|
|
690
|
-
- @details Populates canonical docs/test/source directories, documented per-language static-check defaults, default prompt-command worktree settings, default debug fields including dedicated workflow-event logging, the default startup tool set, default command-notify, sound, and Pushover fields, and excludes runtime-derived path metadata. Time complexity is O(n) in default selector count plus default static-check entry count. No filesystem side effects occur.
|
|
728
|
+
### fn `export function getProjectConfigPath(projectBase: string): string` (L540-542)
|
|
729
|
+
- @brief Computes the per-project local config file path.
|
|
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.
|
|
691
731
|
- @param[in] projectBase {string} Absolute project root path.
|
|
692
|
-
- @return {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
732
|
+
- @return {string} Absolute local config file path.
|
|
733
|
+
|
|
734
|
+
### fn `export function getGlobalConfigPath(): string` (L549-551)
|
|
735
|
+
- @brief Computes the cross-project global config file path.
|
|
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
|
+
- @return {string} Absolute global config file path.
|
|
738
|
+
|
|
739
|
+
### fn `function getDefaultLocalConfig(` (L560-577)
|
|
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 including tool-wrapper command registration without any cross-project fields. Runtime is O(l). No filesystem side effects occur.
|
|
742
|
+
- @param[in] globalStaticCheckConfig {Record<string, GlobalStaticCheckLanguageConfig>} Global checker definitions used to derive local enable defaults.
|
|
743
|
+
- @return {UseReqLocalConfig} Fresh default local configuration object.
|
|
744
|
+
- @satisfies CTN-019
|
|
745
|
+
|
|
746
|
+
### fn `function getDefaultGlobalConfig(): UseReqGlobalConfig` (L584-614)
|
|
747
|
+
- @brief Builds the default persisted global configuration.
|
|
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.
|
|
749
|
+
- @return {UseReqGlobalConfig} Fresh default global configuration object.
|
|
750
|
+
|
|
751
|
+
### fn `function mergeConfigScopes(` (L623-690)
|
|
752
|
+
- @brief Merges persisted local and global configuration scopes into the effective runtime config.
|
|
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.
|
|
754
|
+
- @param[in] localConfig {UseReqLocalConfig} Persisted local configuration.
|
|
755
|
+
- @param[in] globalConfig {UseReqGlobalConfig} Persisted global configuration.
|
|
756
|
+
- @return {UseReqConfig} Effective merged configuration.
|
|
757
|
+
|
|
758
|
+
### fn `export function getDefaultConfig(_projectBase: string): UseReqConfig` (L699-705)
|
|
759
|
+
- @brief Builds the default effective configuration.
|
|
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.
|
|
761
|
+
- @param[in] _projectBase {string} Absolute project root path retained for stable call sites.
|
|
762
|
+
- @return {UseReqConfig} Fresh default effective configuration object.
|
|
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
|
|
764
|
+
|
|
765
|
+
### fn `function normalizeStaticCheckEntries(value: unknown): StaticCheckEntry[]` (L713-733)
|
|
696
766
|
- @brief Normalizes one raw checker-entry array from persisted config.
|
|
697
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.
|
|
698
768
|
- @param[in] value {unknown} Candidate persisted checker array.
|
|
699
769
|
- @return {StaticCheckEntry[]} Normalized checker-entry vector.
|
|
700
770
|
|
|
701
|
-
### fn `function
|
|
702
|
-
- @brief
|
|
703
|
-
- @details
|
|
704
|
-
- @param[in]
|
|
705
|
-
- @return {Record<string,
|
|
706
|
-
- @
|
|
771
|
+
### fn `function readConfigPayload(configPath: string): Record<string, unknown> | undefined` (L742-758)
|
|
772
|
+
- @brief Reads and validates one persisted config payload.
|
|
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.
|
|
774
|
+
- @param[in] configPath {string} Absolute config file path.
|
|
775
|
+
- @return {Record<string, unknown> | undefined} Parsed object payload or `undefined` when the file is absent.
|
|
776
|
+
- @throws {ReqError} Throws with exit code `11` when the config file contains invalid JSON or a non-object payload.
|
|
707
777
|
|
|
708
|
-
### fn `
|
|
709
|
-
- @brief
|
|
710
|
-
- @details
|
|
778
|
+
### fn `function normalizeLocalStaticCheckConfig(` (L768-792)
|
|
779
|
+
- @brief Normalizes the persisted local static-check enable map.
|
|
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.
|
|
781
|
+
- @param[in] value {unknown} Candidate persisted local static-check payload.
|
|
782
|
+
- @param[in] defaultConfig {Record<string, LocalStaticCheckLanguageConfig>} Default enable map derived from global checker definitions.
|
|
783
|
+
- @return {Record<string, LocalStaticCheckLanguageConfig>} Normalized local static-check enable map.
|
|
784
|
+
- @satisfies REQ-249, REQ-316
|
|
785
|
+
|
|
786
|
+
### fn `function normalizeGlobalStaticCheckConfig(` (L801-818)
|
|
787
|
+
- @brief Normalizes the persisted global static-check checker map.
|
|
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.
|
|
789
|
+
- @param[in] value {unknown} Candidate persisted global static-check payload.
|
|
790
|
+
- @return {Record<string, GlobalStaticCheckLanguageConfig>} Normalized global static-check checker map.
|
|
791
|
+
- @satisfies REQ-249, REQ-250, REQ-251, REQ-252
|
|
792
|
+
|
|
793
|
+
### fn `function loadLocalConfig(` (L828-876)
|
|
794
|
+
- @brief Loads and sanitizes the persisted local configuration.
|
|
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.
|
|
796
|
+
- @param[in] projectBase {string} Absolute project root path.
|
|
797
|
+
- @param[in] defaultStaticCheckConfig {Record<string, LocalStaticCheckLanguageConfig>} Local static-check enable defaults derived from the current global checker map.
|
|
798
|
+
- @return {UseReqLocalConfig} Sanitized local configuration.
|
|
799
|
+
- @satisfies CTN-019
|
|
800
|
+
|
|
801
|
+
### fn `function loadGlobalConfig(): UseReqGlobalConfig` (L883-924)
|
|
802
|
+
- @brief Loads and sanitizes the persisted global configuration.
|
|
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.
|
|
804
|
+
- @return {UseReqGlobalConfig} Sanitized global configuration.
|
|
805
|
+
|
|
806
|
+
### fn `export function loadConfig(projectBase: string): UseReqConfig` (L934-941)
|
|
807
|
+
- @brief Loads and sanitizes the effective merged configuration.
|
|
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.
|
|
711
809
|
- @param[in] projectBase {string} Absolute project root path.
|
|
712
810
|
- @return {UseReqConfig} Sanitized effective configuration.
|
|
713
|
-
- @throws {ReqError} Throws with exit code `11` when
|
|
714
|
-
- @satisfies CTN-012, CTN-013, REQ-066, 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
|
|
811
|
+
- @throws {ReqError} Throws with exit code `11` when either persisted config file contains invalid JSON or a non-object payload.
|
|
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
|
|
715
813
|
|
|
716
|
-
### fn `function
|
|
717
|
-
- @brief Builds the persisted configuration payload
|
|
718
|
-
- @details Copies only
|
|
814
|
+
### fn `function buildPersistedLocalConfig(config: UseReqConfig): UseReqLocalConfig` (L950-978)
|
|
815
|
+
- @brief Builds the persisted local configuration payload.
|
|
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.
|
|
719
817
|
- @param[in] config {UseReqConfig} Effective configuration object.
|
|
720
|
-
- @return {
|
|
721
|
-
- @satisfies CTN-012, CTN-013,
|
|
818
|
+
- @return {UseReqLocalConfig} Persistable local configuration payload.
|
|
819
|
+
- @satisfies CTN-012, CTN-013, CTN-019, REQ-104, REQ-146, REQ-249, REQ-316, REQ-277
|
|
722
820
|
|
|
723
|
-
### fn `
|
|
724
|
-
- @brief
|
|
725
|
-
- @details
|
|
821
|
+
### fn `function buildPersistedGlobalConfig(config: UseReqConfig): UseReqGlobalConfig` (L987-1026)
|
|
822
|
+
- @brief Builds the persisted global configuration payload.
|
|
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.
|
|
824
|
+
- @param[in] config {UseReqConfig} Effective configuration object.
|
|
825
|
+
- @return {UseReqGlobalConfig} Persistable global configuration payload.
|
|
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
|
|
827
|
+
|
|
828
|
+
### fn `function writeConfigFile(configPath: string, payload: object): void` (L1035-1038)
|
|
829
|
+
- @brief Writes one normalized config payload to disk.
|
|
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.
|
|
831
|
+
- @param[in] configPath {string} Absolute destination config path.
|
|
832
|
+
- @param[in] payload {object} Persistable config payload.
|
|
833
|
+
- @return {void} No return value.
|
|
834
|
+
|
|
835
|
+
### fn `export function saveLocalConfig(projectBase: string, config: UseReqConfig): void` (L1048-1050)
|
|
836
|
+
- @brief Persists the local configuration scope to disk.
|
|
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.
|
|
726
838
|
- @param[in] projectBase {string} Absolute project root path.
|
|
727
|
-
- @param[in] config {UseReqConfig}
|
|
839
|
+
- @param[in] config {UseReqConfig} Effective configuration object to persist.
|
|
728
840
|
- @return {void} No return value.
|
|
729
|
-
- @satisfies CTN-012, REQ-146
|
|
841
|
+
- @satisfies CTN-012, REQ-104, REQ-146
|
|
730
842
|
|
|
731
|
-
### fn `export function
|
|
843
|
+
### fn `export function saveGlobalConfig(config: UseReqConfig): void` (L1059-1061)
|
|
844
|
+
- @brief Persists the global configuration scope to disk.
|
|
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.
|
|
846
|
+
- @param[in] config {UseReqConfig} Effective configuration object to persist.
|
|
847
|
+
- @return {void} No return value.
|
|
848
|
+
- @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
|
|
849
|
+
|
|
850
|
+
### fn `export function saveConfig(projectBase: string, config: UseReqConfig): void` (L1071-1074)
|
|
851
|
+
- @brief Persists the effective configuration to local and global config files.
|
|
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.
|
|
853
|
+
- @param[in] projectBase {string} Absolute project root path.
|
|
854
|
+
- @param[in] config {UseReqConfig} Effective configuration object to persist.
|
|
855
|
+
- @return {void} No return value.
|
|
856
|
+
- @satisfies CTN-012, CTN-018, REQ-137, REQ-146, REQ-315
|
|
857
|
+
|
|
858
|
+
### fn `export function normalizeConfigPaths(projectBase: string, config: UseReqConfig): UseReqConfig` (L1083-1101)
|
|
732
859
|
- @brief Normalizes persisted directory fields to project-relative forms.
|
|
733
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.
|
|
734
861
|
- @param[in] projectBase {string} Absolute project root path.
|
|
735
862
|
- @param[in] config {UseReqConfig} Configuration object to normalize.
|
|
736
863
|
- @return {UseReqConfig} Normalized configuration copy.
|
|
737
864
|
|
|
738
|
-
### fn `export function buildPromptReplacementPaths(` (
|
|
865
|
+
### fn `export function buildPromptReplacementPaths(` (L1111-1153)
|
|
739
866
|
- @brief Builds placeholder replacements for bundled prompt rendering.
|
|
740
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.
|
|
741
868
|
- @param[in] projectBase {string} Absolute project root path.
|
|
@@ -746,33 +873,54 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
746
873
|
## Symbol Index
|
|
747
874
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
748
875
|
|---|---|---|---|---|
|
|
749
|
-
|`StaticCheckEntry`|iface||
|
|
750
|
-
|`StaticCheckEnabled`|type||
|
|
751
|
-
|`StaticCheckLanguageConfig`|iface||
|
|
752
|
-
|`UseReqConfig`|iface||
|
|
753
|
-
|`
|
|
754
|
-
|`
|
|
755
|
-
|`
|
|
756
|
-
|`
|
|
757
|
-
|`
|
|
758
|
-
|`
|
|
759
|
-
|`
|
|
760
|
-
|`
|
|
761
|
-
|`
|
|
762
|
-
|`
|
|
763
|
-
|`
|
|
764
|
-
|`
|
|
765
|
-
|`
|
|
766
|
-
|`
|
|
767
|
-
|`
|
|
768
|
-
|`
|
|
769
|
-
|`
|
|
770
|
-
|`
|
|
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(|
|
|
771
919
|
|
|
772
920
|
|
|
773
921
|
---
|
|
774
922
|
|
|
775
|
-
# debug-runtime.ts | TypeScript |
|
|
923
|
+
# debug-runtime.ts | TypeScript | 566L | 28 symbols | 5 imports | 39 comments
|
|
776
924
|
> Path: `src/core/debug-runtime.ts`
|
|
777
925
|
- @brief Declares debug inventories, normalizers, and JSON log persistence helpers.
|
|
778
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.
|
|
@@ -788,84 +936,94 @@ import {
|
|
|
788
936
|
|
|
789
937
|
## Definitions
|
|
790
938
|
|
|
791
|
-
- type `export type DebugToolName =` (
|
|
939
|
+
- type `export type DebugToolName =` (L66)
|
|
792
940
|
- @brief Represents one valid debug-enabled tool selector.
|
|
793
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.
|
|
794
|
-
- type `export type DebugPromptName = `req-${PromptCommandName}`;` (
|
|
942
|
+
- type `export type DebugPromptName = `req-${PromptCommandName}`;` (L74)
|
|
795
943
|
- @brief Represents one valid debug-enabled prompt selector.
|
|
796
944
|
- @details Restricts prompt debug toggles to invokable bundled `req-*` slash-command names derived from `PROMPT_COMMAND_NAMES`. The alias introduces no runtime cost.
|
|
797
|
-
- type `export type DebugWorkflowState =` (
|
|
945
|
+
- type `export type DebugWorkflowState =` (L92)
|
|
798
946
|
- @brief Represents one workflow-state value used by debug gating and payloads.
|
|
799
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.
|
|
800
|
-
- type `export type DebugStatusChanges = "enable" | "disable";` (
|
|
948
|
+
- type `export type DebugStatusChanges = "enable" | "disable";` (L100)
|
|
801
949
|
- @brief Represents one persisted workflow-transition logging flag.
|
|
802
950
|
- @details Restricts `workflow_state` emission to the documented `enable|disable` domain. The alias is compile-time only and introduces no runtime cost.
|
|
803
|
-
- type `export type DebugWorkflowEvents = "enable" | "disable";` (
|
|
951
|
+
- type `export type DebugWorkflowEvents = "enable" | "disable";` (L106)
|
|
804
952
|
- @brief Represents one persisted dedicated workflow-event logging flag.
|
|
805
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.
|
|
806
|
-
- 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)
|
|
807
958
|
- @brief Represents one persisted workflow-status filter value.
|
|
808
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.
|
|
809
|
-
### iface `export interface DebugLogEntry` (
|
|
960
|
+
### iface `export interface DebugLogEntry` (L124-133)
|
|
810
961
|
- @brief Describes one append-only JSON debug log entry.
|
|
811
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.
|
|
812
963
|
|
|
813
|
-
### fn `export function normalizeDebugEnabled(value: unknown): "enable" | "disable"` (
|
|
964
|
+
### fn `export function normalizeDebugEnabled(value: unknown): "enable" | "disable"` (L166-168)
|
|
814
965
|
- @brief Normalizes one persisted debug enable flag.
|
|
815
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.
|
|
816
967
|
- @param[in] value {unknown} Candidate persisted debug-enable payload.
|
|
817
968
|
- @return {"enable" | "disable"} Canonical debug-enable value.
|
|
818
969
|
- @satisfies REQ-236
|
|
819
970
|
|
|
820
|
-
### fn `export function normalizeDebugLogFile(value: unknown): string` (
|
|
971
|
+
### fn `export function normalizeDebugLogFile(value: unknown): string` (L177-183)
|
|
821
972
|
- @brief Normalizes one persisted debug log file value.
|
|
822
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.
|
|
823
974
|
- @param[in] value {unknown} Candidate persisted debug-log file payload.
|
|
824
975
|
- @return {string} Canonical debug-log file value.
|
|
825
976
|
- @satisfies REQ-237
|
|
826
977
|
|
|
827
|
-
### fn `export function normalizeDebugStatusChanges(value: unknown): DebugStatusChanges` (
|
|
978
|
+
### fn `export function normalizeDebugStatusChanges(value: unknown): DebugStatusChanges` (L192-194)
|
|
828
979
|
- @brief Normalizes one persisted workflow-transition logging flag.
|
|
829
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.
|
|
830
981
|
- @param[in] value {unknown} Candidate persisted workflow-transition logging payload.
|
|
831
982
|
- @return {DebugStatusChanges} Canonical workflow-transition logging flag.
|
|
832
983
|
- @satisfies REQ-254
|
|
833
984
|
|
|
834
|
-
### fn `export function normalizeDebugWorkflowEvents(value: unknown): DebugWorkflowEvents` (
|
|
985
|
+
### fn `export function normalizeDebugWorkflowEvents(value: unknown): DebugWorkflowEvents` (L203-205)
|
|
835
986
|
- @brief Normalizes one persisted dedicated workflow-event logging flag.
|
|
836
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.
|
|
837
988
|
- @param[in] value {unknown} Candidate persisted workflow-event logging payload.
|
|
838
989
|
- @return {DebugWorkflowEvents} Canonical workflow-event logging flag.
|
|
839
990
|
- @satisfies REQ-277
|
|
840
991
|
|
|
841
|
-
### 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)
|
|
842
1000
|
- @brief Normalizes one persisted debug workflow-status filter.
|
|
843
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.
|
|
844
1002
|
- @param[in] value {unknown} Candidate persisted debug workflow-status filter.
|
|
845
1003
|
- @return {DebugLogOnStatus} Canonical debug workflow-status filter.
|
|
846
1004
|
- @satisfies REQ-238
|
|
847
1005
|
|
|
848
|
-
### fn `export function normalizeDebugEnabledTools(value: unknown): DebugToolName[]` (
|
|
1006
|
+
### fn `export function normalizeDebugEnabledTools(value: unknown): DebugToolName[]` (L241-249)
|
|
849
1007
|
- @brief Normalizes one persisted debug-tool selector array.
|
|
850
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.
|
|
851
1009
|
- @param[in] value {unknown} Candidate persisted debug-tool selector payload.
|
|
852
1010
|
- @return {DebugToolName[]} Deduplicated canonical debug-tool selectors.
|
|
853
1011
|
- @satisfies REQ-239, REQ-242
|
|
854
1012
|
|
|
855
|
-
### fn `export function normalizeDebugEnabledPrompts(value: unknown): DebugPromptName[]` (
|
|
1013
|
+
### fn `export function normalizeDebugEnabledPrompts(value: unknown): DebugPromptName[]` (L258-266)
|
|
856
1014
|
- @brief Normalizes one persisted debug-prompt selector array.
|
|
857
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.
|
|
858
1016
|
- @param[in] value {unknown} Candidate persisted debug-prompt selector payload.
|
|
859
1017
|
- @return {DebugPromptName[]} Deduplicated canonical debug-prompt selectors.
|
|
860
1018
|
- @satisfies REQ-239, REQ-243
|
|
861
1019
|
|
|
862
|
-
### fn `export function getDebugPromptName(promptName: PromptCommandName): DebugPromptName` (
|
|
1020
|
+
### fn `export function getDebugPromptName(promptName: PromptCommandName): DebugPromptName` (L274-276)
|
|
863
1021
|
- @brief Resolves the canonical debug prompt selector for one bundled prompt.
|
|
864
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.
|
|
865
1023
|
- @param[in] promptName {PromptCommandName} Canonical bundled prompt name.
|
|
866
1024
|
- @return {DebugPromptName} Canonical debug prompt selector.
|
|
867
1025
|
|
|
868
|
-
### fn `export function matchesDebugWorkflowState(` (
|
|
1026
|
+
### fn `export function matchesDebugWorkflowState(` (L286-291)
|
|
869
1027
|
- @brief Tests whether one debug workflow-state filter matches the current state.
|
|
870
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.
|
|
871
1029
|
- @param[in] logOnStatus {DebugLogOnStatus} Persisted debug workflow-state filter.
|
|
@@ -873,7 +1031,7 @@ import {
|
|
|
873
1031
|
- @return {boolean} `true` when the entry should be emitted for the supplied state.
|
|
874
1032
|
- @satisfies REQ-247
|
|
875
1033
|
|
|
876
|
-
### fn `export function resolveDebugLogPath(projectBase: string, config: UseReqConfig): string` (
|
|
1034
|
+
### fn `export function resolveDebugLogPath(projectBase: string, config: UseReqConfig): string` (L301-306)
|
|
877
1035
|
- @brief Resolves the absolute debug log file path for one project base.
|
|
878
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.
|
|
879
1037
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -881,7 +1039,7 @@ import {
|
|
|
881
1039
|
- @return {string} Absolute debug log path.
|
|
882
1040
|
- @satisfies REQ-237
|
|
883
1041
|
|
|
884
|
-
### fn `export function shouldLogDebugTool(` (
|
|
1042
|
+
### fn `export function shouldLogDebugTool(` (L317-325)
|
|
885
1043
|
- @brief Tests whether one tool execution should be appended to the debug log.
|
|
886
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.
|
|
887
1045
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -890,7 +1048,7 @@ import {
|
|
|
890
1048
|
- @return {boolean} `true` when the tool execution should be logged.
|
|
891
1049
|
- @satisfies REQ-242, REQ-246, REQ-247
|
|
892
1050
|
|
|
893
|
-
### fn `export function shouldLogDebugPrompt(` (
|
|
1051
|
+
### fn `export function shouldLogDebugPrompt(` (L336-344)
|
|
894
1052
|
- @brief Tests whether one prompt event should be appended to the debug log.
|
|
895
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.
|
|
896
1054
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -899,7 +1057,7 @@ import {
|
|
|
899
1057
|
- @return {boolean} `true` when the prompt event should be logged.
|
|
900
1058
|
- @satisfies REQ-243, REQ-246, REQ-247
|
|
901
1059
|
|
|
902
|
-
### fn `export function shouldLogDebugPromptWorkflowState(` (
|
|
1060
|
+
### fn `export function shouldLogDebugPromptWorkflowState(` (L355-362)
|
|
903
1061
|
- @brief Tests whether one prompt workflow-state transition should be appended to the debug log.
|
|
904
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.
|
|
905
1063
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -908,7 +1066,7 @@ import {
|
|
|
908
1066
|
- @return {boolean} `true` when the prompt workflow-state entry should be logged.
|
|
909
1067
|
- @satisfies REQ-246, REQ-247, REQ-255
|
|
910
1068
|
|
|
911
|
-
### fn `export function shouldLogDebugPromptWorkflowEvent(` (
|
|
1069
|
+
### fn `export function shouldLogDebugPromptWorkflowEvent(` (L373-380)
|
|
912
1070
|
- @brief Tests whether one dedicated prompt workflow event should be appended to the debug log.
|
|
913
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.
|
|
914
1072
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -917,13 +1075,13 @@ import {
|
|
|
917
1075
|
- @return {boolean} `true` when the dedicated workflow event should be logged.
|
|
918
1076
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
919
1077
|
|
|
920
|
-
### fn `function normalizeDebugValue(value: unknown): unknown` (
|
|
1078
|
+
### fn `function normalizeDebugValue(value: unknown): unknown` (L388-416)
|
|
921
1079
|
- @brief Serializes arbitrary debug payloads into deterministic JSON-compatible values.
|
|
922
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.
|
|
923
1081
|
- @param[in] value {unknown} Arbitrary debug payload.
|
|
924
1082
|
- @return {unknown} JSON-compatible debug payload.
|
|
925
1083
|
|
|
926
|
-
### fn `function appendDebugLogEntry(` (
|
|
1084
|
+
### fn `function appendDebugLogEntry(` (L426-451)
|
|
927
1085
|
- @brief Appends one normalized debug log entry to the configured JSON log file.
|
|
928
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.
|
|
929
1087
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -931,7 +1089,7 @@ import {
|
|
|
931
1089
|
- @param[in] entry {DebugLogEntry} Candidate debug log entry.
|
|
932
1090
|
- @return {boolean} `true` when the entry is written successfully; `false` when filesystem writing fails.
|
|
933
1091
|
|
|
934
|
-
### fn `export function logDebugToolExecution(` (
|
|
1092
|
+
### fn `export function logDebugToolExecution(` (L466-488)
|
|
935
1093
|
- @brief Appends one tool-execution debug entry when the current config enables it.
|
|
936
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.
|
|
937
1095
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -944,7 +1102,7 @@ import {
|
|
|
944
1102
|
- @return {boolean} `true` when the tool entry is written; otherwise `false`.
|
|
945
1103
|
- @satisfies REQ-244, REQ-246, REQ-247
|
|
946
1104
|
|
|
947
|
-
### fn `export function logDebugPromptEvent(` (
|
|
1105
|
+
### fn `export function logDebugPromptEvent(` (L504-527)
|
|
948
1106
|
- @brief Appends one prompt debug entry when the current config enables it.
|
|
949
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.
|
|
950
1108
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -958,7 +1116,7 @@ import {
|
|
|
958
1116
|
- @return {boolean} `true` when the prompt entry is written; otherwise `false`.
|
|
959
1117
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
960
1118
|
|
|
961
|
-
### fn `export function logDebugPromptWorkflowEvent(` (
|
|
1119
|
+
### fn `export function logDebugPromptWorkflowEvent(` (L543-566)
|
|
962
1120
|
- @brief Appends one dedicated prompt workflow debug entry when the current config enables it.
|
|
963
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.
|
|
964
1122
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -975,32 +1133,34 @@ import {
|
|
|
975
1133
|
## Symbol Index
|
|
976
1134
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
977
1135
|
|---|---|---|---|---|
|
|
978
|
-
|`DebugToolName`|type||
|
|
979
|
-
|`DebugPromptName`|type||
|
|
980
|
-
|`DebugWorkflowState`|type||
|
|
981
|
-
|`DebugStatusChanges`|type||
|
|
982
|
-
|`DebugWorkflowEvents`|type||
|
|
983
|
-
|`
|
|
984
|
-
|`
|
|
985
|
-
|`
|
|
986
|
-
|`
|
|
987
|
-
|`
|
|
988
|
-
|`
|
|
989
|
-
|`
|
|
990
|
-
|`
|
|
991
|
-
|`
|
|
992
|
-
|`
|
|
993
|
-
|`
|
|
994
|
-
|`
|
|
995
|
-
|`
|
|
996
|
-
|`
|
|
997
|
-
|`
|
|
998
|
-
|`
|
|
999
|
-
|`
|
|
1000
|
-
|`
|
|
1001
|
-
|`
|
|
1002
|
-
|`
|
|
1003
|
-
|`
|
|
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(|
|
|
1004
1164
|
|
|
1005
1165
|
|
|
1006
1166
|
---
|
|
@@ -1433,14 +1593,14 @@ mutates `controller.config`.
|
|
|
1433
1593
|
|
|
1434
1594
|
### fn `export function getPiUsereqRuntimeSoundLevel(` (L697-701)
|
|
1435
1595
|
- @brief Returns the active runtime sound level tracked by the status controller.
|
|
1436
|
-
- @details Exposes the in-memory runtime sound state so shortcut handlers and prompt-end notification dispatch can stay decoupled from the persisted boot value stored in
|
|
1596
|
+
- @details Exposes the in-memory runtime sound state so shortcut handlers and prompt-end notification dispatch can stay decoupled from the persisted boot value stored in global configuration. Runtime is O(1). No external state is mutated.
|
|
1437
1597
|
- @param[in] controller {PiUsereqStatusController} Mutable status controller.
|
|
1438
1598
|
- @return {PiNotifySoundLevel} Active runtime sound level.
|
|
1439
1599
|
- @satisfies REQ-180, REQ-285
|
|
1440
1600
|
|
|
1441
1601
|
### fn `export function setPiUsereqRuntimeSoundLevel(` (L712-722)
|
|
1442
1602
|
- @brief Stores one new runtime sound level and refreshes the status bar.
|
|
1443
|
-
- @details Mutates only the in-memory runtime sound state so shortcut-driven sound changes do not update
|
|
1603
|
+
- @details Mutates only the in-memory runtime sound state so shortcut-driven sound changes do not update persisted local or global configuration, then re-renders the footer when an active extension context is available. Runtime is O(1). Side effect: mutates `controller.state.runtimeSoundLevel` and may update `ctx.ui` status.
|
|
1444
1604
|
- @param[in] runtimeSoundLevel {PiNotifySoundLevel} Next active runtime sound level.
|
|
1445
1605
|
- @param[in] ctx {ExtensionContext | undefined} Optional active extension context.
|
|
1446
1606
|
- @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
@@ -1924,7 +2084,7 @@ import { SourceAnalyzer, formatMarkdown } from "./source-analyzer.js";
|
|
|
1924
2084
|
|
|
1925
2085
|
---
|
|
1926
2086
|
|
|
1927
|
-
# path-context.ts | TypeScript |
|
|
2087
|
+
# path-context.ts | TypeScript | 476L | 23 symbols | 5 imports | 28 comments
|
|
1928
2088
|
> Path: `src/core/path-context.ts`
|
|
1929
2089
|
- @brief Derives shared runtime path contracts for prompts, tools, and configuration flows.
|
|
1930
2090
|
- @details Centralizes the static bootstrap paths and dynamic cwd-aligned paths used across the extension runtime. The module also exposes home-relative display formatting, trailing-slash-free normalization, and prompt-facing path facts. Runtime is O(s + p) where s is the configured source-directory count and p is aggregate path length. Side effects are limited to module-local runtime-path state mutation.
|
|
@@ -1940,122 +2100,127 @@ import type { UseReqConfig } from "./config.js";
|
|
|
1940
2100
|
|
|
1941
2101
|
## Definitions
|
|
1942
2102
|
|
|
1943
|
-
### iface `export interface RuntimePathState` (
|
|
2103
|
+
### iface `export interface RuntimePathState` (L35-43)
|
|
1944
2104
|
- @brief Stores the mutable runtime path state shared across extension callbacks.
|
|
1945
2105
|
- @details Persists the static bootstrap `base-path`, the dynamic `context-path`, the optional repository-derived `git-path`, the derived `parent-path` and `base-dir`, and the optional active worktree facts. The interface is compile-time only and introduces no runtime cost.
|
|
1946
2106
|
|
|
1947
|
-
### iface `export interface RuntimePathContext extends RuntimePathState` : RuntimePathState (
|
|
2107
|
+
### iface `export interface RuntimePathContext extends RuntimePathState` : RuntimePathState (L49-62)
|
|
1948
2108
|
- @brief Describes the absolute runtime path context shared across extension components.
|
|
1949
2109
|
- @details Aggregates the static installation, base, git, parent, and config paths with the dynamic context and optional worktree paths plus execution-resolved docs/tests/source absolute paths. The interface is compile-time only and introduces no runtime cost.
|
|
1950
2110
|
|
|
1951
|
-
### iface `export interface RuntimePathFacts` (
|
|
2111
|
+
### iface `export interface RuntimePathFacts` (L68-89)
|
|
1952
2112
|
- @brief Describes the prompt/tool-facing runtime paths rendered for display.
|
|
1953
2113
|
- @details Mirrors `RuntimePathContext` in a serialization-oriented shape so downstream agents can consume stable `~`-relative absolute paths and trailing-slash-free relative directories without reparsing platform-specific separators. The interface is compile-time only and introduces no runtime cost.
|
|
1954
2114
|
|
|
1955
|
-
### fn `export function getInstallationPath(): string` (
|
|
2115
|
+
### fn `export function getInstallationPath(): string` (L104-106)
|
|
1956
2116
|
- @brief Resolves the installed extension root that owns `index.ts` and bundled resources.
|
|
1957
2117
|
- @details Uses the current module location under `src/core` or its installed equivalent, then moves one directory upward so the returned path is the runtime installation root containing `resources/`. Runtime is O(1). No external state is mutated.
|
|
1958
2118
|
- @return {string} Absolute installation path.
|
|
1959
2119
|
|
|
1960
|
-
### fn `export function normalizePathSlashes(value: string): string` (
|
|
2120
|
+
### fn `export function normalizePathSlashes(value: string): string` (L114-116)
|
|
1961
2121
|
- @brief Formats one path with slash separators.
|
|
1962
2122
|
- @details Rewrites backslashes to `/` without changing semantic path identity so serialized payloads remain stable across operating systems. Runtime is O(p) in path length. No external state is mutated.
|
|
1963
2123
|
- @param[in] value {string} Absolute or relative filesystem path.
|
|
1964
2124
|
- @return {string} Slash-normalized path string.
|
|
1965
2125
|
|
|
1966
|
-
### fn `function trimTrailingSeparatorsPreserveRoot(value: string): string` (
|
|
2126
|
+
### fn `function trimTrailingSeparatorsPreserveRoot(value: string): string` (L124-138)
|
|
1967
2127
|
- @brief Removes trailing separators while preserving a filesystem root.
|
|
1968
2128
|
- @details Keeps `/`, drive roots, and UNC roots intact while trimming redundant trailing separators from every other absolute or relative path string. Runtime is O(p) in path length. No external state is mutated.
|
|
1969
2129
|
- @param[in] value {string} Raw path string.
|
|
1970
2130
|
- @return {string} Trailing-slash-free path string.
|
|
1971
2131
|
|
|
1972
|
-
### fn `export function normalizeAbsolutePathContract(value: string): string` (
|
|
2132
|
+
### fn `export function normalizeAbsolutePathContract(value: string): string` (L146-148)
|
|
1973
2133
|
- @brief Normalizes one absolute path contract value.
|
|
1974
2134
|
- @details Resolves the supplied value to an absolute path, removes trailing separators except for the filesystem root, and rewrites separators to `/`. Runtime is O(p) in path length. No external state is mutated.
|
|
1975
2135
|
- @param[in] value {string} Absolute or relative path candidate.
|
|
1976
2136
|
- @return {string} Canonical trailing-slash-free absolute path.
|
|
1977
2137
|
|
|
1978
|
-
### fn `export function normalizeRelativeDirContract(value: string): string` (
|
|
2138
|
+
### fn `export function normalizeRelativeDirContract(value: string): string` (L156-161)
|
|
1979
2139
|
- @brief Normalizes one relative-directory contract value.
|
|
1980
2140
|
- @details Trims whitespace, rewrites separators to `/`, removes a leading `./`, and removes trailing separators so persisted `*-dir` values stay relative and trailing-slash-free. Runtime is O(p) in path length. No external state is mutated.
|
|
1981
2141
|
- @param[in] value {string} Relative-directory candidate.
|
|
1982
2142
|
- @return {string} Canonical trailing-slash-free relative-directory string.
|
|
1983
2143
|
|
|
1984
|
-
### fn `export function getConfigPath(basePath: string): string` (
|
|
1985
|
-
- @brief Computes the absolute project config path for one base path.
|
|
2144
|
+
### fn `export function getConfigPath(basePath: string): string` (L169-171)
|
|
2145
|
+
- @brief Computes the absolute local project config path for one base path.
|
|
1986
2146
|
- @details Appends `.pi-usereq.json` to the supplied base path using the canonical repository-local configuration layout. Runtime is O(1). No external state is mutated.
|
|
1987
2147
|
- @param[in] basePath {string} Absolute or relative base path.
|
|
1988
|
-
- @return {string} Absolute config-file path.
|
|
2148
|
+
- @return {string} Absolute local config-file path.
|
|
1989
2149
|
|
|
1990
|
-
### fn `export function
|
|
2150
|
+
### fn `export function getGlobalConfigPath(): string` (L178-180)
|
|
2151
|
+
- @brief Computes the absolute global config path for the current user.
|
|
2152
|
+
- @details Resolves `~/.config/pi-usereq/config.json` from the current user home directory without consulting project state. Runtime is O(1). No external state is mutated.
|
|
2153
|
+
- @return {string} Absolute global config-file path.
|
|
2154
|
+
|
|
2155
|
+
### fn `export function isSameOrAncestorPath(` (L189-203)
|
|
1991
2156
|
- @brief Tests whether one path is identical to or an ancestor of another path.
|
|
1992
2157
|
- @details Resolves both inputs, computes a relative traversal from the candidate ancestor to the candidate child, and accepts only exact matches or descendant traversals that stay within the ancestor subtree. Runtime is O(p) in path length. No external state is mutated.
|
|
1993
2158
|
- @param[in] ancestorPath {string} Candidate ancestor or identical path.
|
|
1994
2159
|
- @param[in] childPath {string} Candidate child or identical path.
|
|
1995
2160
|
- @return {boolean} `true` when `ancestorPath` equals `childPath` or strictly contains it.
|
|
1996
2161
|
|
|
1997
|
-
### fn `function deriveStaticRuntimePathState(` (
|
|
2162
|
+
### fn `function deriveStaticRuntimePathState(` (L212-237)
|
|
1998
2163
|
- @brief Derives repository-relative runtime state from one base path and optional git path.
|
|
1999
2164
|
- @details Normalizes `base-path`, keeps `git-path` only when it is identical to or an ancestor of `base-path`, derives `parent-path` from `git-path`, and derives `base-dir` as `base-path` relative to `git-path`. Runtime is O(p) in path length. No external state is mutated.
|
|
2000
2165
|
- @param[in] basePath {string} Static base path candidate.
|
|
2001
2166
|
- @param[in] gitPath {string | undefined} Optional repository-root candidate.
|
|
2002
2167
|
- @return {{ basePath: string; gitPath?: string; parentPath?: string; baseDir: string }} Derived static path facts.
|
|
2003
2168
|
|
|
2004
|
-
### fn `export function bootstrapRuntimePathState(` (
|
|
2169
|
+
### fn `export function bootstrapRuntimePathState(` (L246-248)
|
|
2005
2170
|
- @brief Bootstraps the shared runtime path state for one extension session or command preflight.
|
|
2006
2171
|
- @details Sets static `base-path`, initializes dynamic `context-path` to the same value, stores derived `git-path`, `parent-path`, and `base-dir`, and clears any prior worktree facts. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2007
2172
|
- @param[in] basePath {string} Bootstrap cwd that becomes the static base path.
|
|
2008
2173
|
- @param[in] options {{ gitPath?: string | undefined } | undefined} Optional repository-root override.
|
|
2009
2174
|
- @return {void} No return value.
|
|
2010
2175
|
|
|
2011
|
-
### fn `export function ensureRuntimePathState(cwd: string): void` (
|
|
2176
|
+
### fn `export function ensureRuntimePathState(cwd: string): void` (L266-272)
|
|
2012
2177
|
- @brief Ensures the shared runtime path state has at least fallback base and context values.
|
|
2013
2178
|
- @details Lazily bootstraps the module-local state from the supplied cwd only when no prior bootstrap has occurred, preserving any already-established static or dynamic path state. Runtime is O(1). Side effect: may initialize module-local runtime-path state.
|
|
2014
2179
|
- @param[in] cwd {string} Fallback cwd.
|
|
2015
2180
|
- @return {void} No return value.
|
|
2016
2181
|
|
|
2017
|
-
### fn `export function getRuntimeBasePath(fallbackPath: string): string` (
|
|
2182
|
+
### fn `export function getRuntimeBasePath(fallbackPath: string): string` (L280-285)
|
|
2018
2183
|
- @brief Returns the current static base path.
|
|
2019
2184
|
- @details Falls back to the supplied path only when the runtime path state has not been bootstrapped yet. Runtime is O(1). No external state is mutated.
|
|
2020
2185
|
- @param[in] fallbackPath {string} Fallback cwd.
|
|
2021
2186
|
- @return {string} Static base path.
|
|
2022
2187
|
|
|
2023
|
-
### fn `export function getRuntimeContextPath(fallbackPath: string): string` (
|
|
2188
|
+
### fn `export function getRuntimeContextPath(fallbackPath: string): string` (L293-298)
|
|
2024
2189
|
- @brief Returns the current dynamic context path.
|
|
2025
2190
|
- @details Falls back to the supplied path only when the runtime path state has not been bootstrapped yet. Runtime is O(1). No external state is mutated.
|
|
2026
2191
|
- @param[in] fallbackPath {string} Fallback cwd.
|
|
2027
2192
|
- @return {string} Dynamic context path.
|
|
2028
2193
|
|
|
2029
|
-
### fn `export function setRuntimeGitPath(gitPath?: string): void` (
|
|
2194
|
+
### fn `export function setRuntimeGitPath(gitPath?: string): void` (L306-313)
|
|
2030
2195
|
- @brief Stores the derived git-root facts in the shared runtime path state.
|
|
2031
2196
|
- @details Re-derives `parent-path` and `base-dir` from the stored static `base-path` plus the supplied `git-path`, preserving the existing dynamic context path. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2032
2197
|
- @param[in] gitPath {string | undefined} Optional repository-root path.
|
|
2033
2198
|
- @return {void} No return value.
|
|
2034
2199
|
|
|
2035
|
-
### fn `export function setRuntimeContextPath(contextPath: string): void` (
|
|
2200
|
+
### fn `export function setRuntimeContextPath(contextPath: string): void` (L321-323)
|
|
2036
2201
|
- @brief Stores the current dynamic context path.
|
|
2037
2202
|
- @details Replaces the module-local `context-path` with the supplied trailing-slash-free absolute path. Runtime is O(1). Side effect: mutates module-local runtime-path state.
|
|
2038
2203
|
- @param[in] contextPath {string} Next context path.
|
|
2039
2204
|
- @return {void} No return value.
|
|
2040
2205
|
|
|
2041
|
-
### fn `export function setRuntimeWorktreePathState(options:` (
|
|
2206
|
+
### fn `export function setRuntimeWorktreePathState(options:` (L331-341)
|
|
2042
2207
|
- @brief Stores the current worktree directory and path facts.
|
|
2043
2208
|
- @details Normalizes the supplied relative `worktree-dir` and absolute `worktree-path` so later prompt rendering and tool execution can reuse the derived values across modules. Runtime is O(p) in path length. Side effect: mutates module-local runtime-path state.
|
|
2044
2209
|
- @param[in] options {{ worktreeDir?: string | undefined; worktreePath?: string | undefined }} Optional active worktree facts.
|
|
2045
2210
|
- @return {void} No return value.
|
|
2046
2211
|
|
|
2047
|
-
### fn `export function getRuntimePathState(): RuntimePathState` (
|
|
2212
|
+
### fn `export function getRuntimePathState(): RuntimePathState` (L348-359)
|
|
2048
2213
|
- @brief Returns a snapshot of the shared runtime path state.
|
|
2049
2214
|
- @details Materializes the current static and dynamic path facts into a read-only copy suitable for prompt rendering, tool execution, and tests. Runtime is O(1). No external state is mutated.
|
|
2050
2215
|
- @return {RuntimePathState} Snapshot of the current runtime path state.
|
|
2051
2216
|
|
|
2052
|
-
### fn `export function formatRuntimePathForDisplay(absolutePath: string): string` (
|
|
2217
|
+
### fn `export function formatRuntimePathForDisplay(absolutePath: string): string` (L367-380)
|
|
2053
2218
|
- @brief Formats one absolute path relative to the user home using `~` when possible.
|
|
2054
2219
|
- @details Returns `~` when the path equals the current home directory and returns `~/...` when the path descends from it; otherwise returns the normalized absolute path unchanged. Runtime is O(p) in path length. No external state is mutated.
|
|
2055
2220
|
- @param[in] absolutePath {string} Absolute or relative path candidate.
|
|
2056
2221
|
- @return {string} Home-relative or trailing-slash-free absolute path.
|
|
2057
2222
|
|
|
2058
|
-
### fn `export function buildRuntimePathContext(` (
|
|
2223
|
+
### fn `export function buildRuntimePathContext(` (L391-400)
|
|
2059
2224
|
- @brief Builds the absolute runtime path context for one base path, context path, and configuration.
|
|
2060
2225
|
- @details Derives static `install-path`, `git-path`, `parent-path`, and `base-dir`, resolves the static `config-path`, preserves the dynamic `context-path`, and resolves docs/tests/source absolute paths against `context-path` so worktree-backed execution uses the active checkout. Runtime is O(s + p) where s is configured source-directory count and p is aggregate path length. No external state is mutated.
|
|
2061
2226
|
- @param[in] basePath {string} Static base path.
|
|
@@ -2064,7 +2229,7 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2064
2229
|
- @param[in] options {{ installationPath?: string; gitPath?: string | undefined; worktreeDir?: string | undefined; worktreePath?: string | undefined } | undefined} Optional installation, repository, and worktree overrides.
|
|
2065
2230
|
- @return {RuntimePathContext} Absolute runtime path context.
|
|
2066
2231
|
|
|
2067
|
-
### fn `export function buildRuntimePathFacts(` (
|
|
2232
|
+
### fn `export function buildRuntimePathFacts(` (L451-476)
|
|
2068
2233
|
- @brief Converts the absolute runtime path context into prompt/tool-facing path facts.
|
|
2069
2234
|
- @details Re-encodes every absolute path with the home-relative formatter while preserving trailing-slash-free relative directories for `base-dir` and `worktree-dir`. Runtime is O(s + p) where s is source-directory count and p is aggregate path length. No external state is mutated.
|
|
2070
2235
|
- @param[in] context {RuntimePathContext} Absolute runtime path context.
|
|
@@ -2073,28 +2238,29 @@ import type { UseReqConfig } from "./config.js";
|
|
|
2073
2238
|
## Symbol Index
|
|
2074
2239
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
2075
2240
|
|---|---|---|---|---|
|
|
2076
|
-
|`RuntimePathState`|iface||
|
|
2077
|
-
|`RuntimePathContext`|iface||
|
|
2078
|
-
|`RuntimePathFacts`|iface||
|
|
2079
|
-
|`getInstallationPath`|fn||
|
|
2080
|
-
|`normalizePathSlashes`|fn||
|
|
2081
|
-
|`trimTrailingSeparatorsPreserveRoot`|fn||
|
|
2082
|
-
|`normalizeAbsolutePathContract`|fn||
|
|
2083
|
-
|`normalizeRelativeDirContract`|fn||
|
|
2084
|
-
|`getConfigPath`|fn||
|
|
2085
|
-
|`
|
|
2086
|
-
|`
|
|
2087
|
-
|`
|
|
2088
|
-
|`
|
|
2089
|
-
|`
|
|
2090
|
-
|`
|
|
2091
|
-
|`
|
|
2092
|
-
|`
|
|
2093
|
-
|`
|
|
2094
|
-
|`
|
|
2095
|
-
|`
|
|
2096
|
-
|`
|
|
2097
|
-
|`
|
|
2241
|
+
|`RuntimePathState`|iface||35-43|export interface RuntimePathState|
|
|
2242
|
+
|`RuntimePathContext`|iface||49-62|export interface RuntimePathContext extends RuntimePathState|
|
|
2243
|
+
|`RuntimePathFacts`|iface||68-89|export interface RuntimePathFacts|
|
|
2244
|
+
|`getInstallationPath`|fn||104-106|export function getInstallationPath(): string|
|
|
2245
|
+
|`normalizePathSlashes`|fn||114-116|export function normalizePathSlashes(value: string): string|
|
|
2246
|
+
|`trimTrailingSeparatorsPreserveRoot`|fn||124-138|function trimTrailingSeparatorsPreserveRoot(value: string...|
|
|
2247
|
+
|`normalizeAbsolutePathContract`|fn||146-148|export function normalizeAbsolutePathContract(value: stri...|
|
|
2248
|
+
|`normalizeRelativeDirContract`|fn||156-161|export function normalizeRelativeDirContract(value: strin...|
|
|
2249
|
+
|`getConfigPath`|fn||169-171|export function getConfigPath(basePath: string): string|
|
|
2250
|
+
|`getGlobalConfigPath`|fn||178-180|export function getGlobalConfigPath(): string|
|
|
2251
|
+
|`isSameOrAncestorPath`|fn||189-203|export function isSameOrAncestorPath(|
|
|
2252
|
+
|`deriveStaticRuntimePathState`|fn||212-237|function deriveStaticRuntimePathState(|
|
|
2253
|
+
|`bootstrapRuntimePathState`|fn||246-248|export function bootstrapRuntimePathState(|
|
|
2254
|
+
|`ensureRuntimePathState`|fn||266-272|export function ensureRuntimePathState(cwd: string): void|
|
|
2255
|
+
|`getRuntimeBasePath`|fn||280-285|export function getRuntimeBasePath(fallbackPath: string):...|
|
|
2256
|
+
|`getRuntimeContextPath`|fn||293-298|export function getRuntimeContextPath(fallbackPath: strin...|
|
|
2257
|
+
|`setRuntimeGitPath`|fn||306-313|export function setRuntimeGitPath(gitPath?: string): void|
|
|
2258
|
+
|`setRuntimeContextPath`|fn||321-323|export function setRuntimeContextPath(contextPath: string...|
|
|
2259
|
+
|`setRuntimeWorktreePathState`|fn||331-341|export function setRuntimeWorktreePathState(options:|
|
|
2260
|
+
|`getRuntimePathState`|fn||348-359|export function getRuntimePathState(): RuntimePathState|
|
|
2261
|
+
|`formatRuntimePathForDisplay`|fn||367-380|export function formatRuntimePathForDisplay(absolutePath:...|
|
|
2262
|
+
|`buildRuntimePathContext`|fn||391-400|export function buildRuntimePathContext(|
|
|
2263
|
+
|`buildRuntimePathFacts`|fn||451-476|export function buildRuntimePathFacts(|
|
|
2098
2264
|
|
|
2099
2265
|
|
|
2100
2266
|
---
|
|
@@ -4537,7 +4703,7 @@ import path from "node:path";
|
|
|
4537
4703
|
|
|
4538
4704
|
---
|
|
4539
4705
|
|
|
4540
|
-
# index.ts | TypeScript |
|
|
4706
|
+
# index.ts | TypeScript | 4407L | 102 symbols | 27 imports | 107 comments
|
|
4541
4707
|
> Path: `src/index.ts`
|
|
4542
4708
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4543
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.
|
|
@@ -4575,78 +4741,120 @@ import { makeRelativeIfContainsProject, shellSplit } from "./core/utils.js";
|
|
|
4575
4741
|
|
|
4576
4742
|
## Definitions
|
|
4577
4743
|
|
|
4578
|
-
### iface `interface PiShortcutRegistrar` (
|
|
4744
|
+
### iface `interface PiShortcutRegistrar` (L180-188)
|
|
4579
4745
|
- @brief Describes the optional shortcut-registration surface used by pi-usereq.
|
|
4580
4746
|
- @details Narrows the runtime API to the documented `registerShortcut(...)`
|
|
4581
4747
|
method so the extension can remain compatible with offline harnesses that do
|
|
4582
4748
|
not implement shortcut capture. Compile-time only and introduces no runtime
|
|
4583
4749
|
cost.
|
|
4584
4750
|
|
|
4585
|
-
### fn `function getProjectBase(cwd: string): string` (
|
|
4751
|
+
### fn `function getProjectBase(cwd: string): string` (L196-205)
|
|
4586
4752
|
- @brief Resolves the effective project base from a working directory.
|
|
4587
4753
|
- @details Normalizes the provided cwd into an absolute path without consulting configuration. Time complexity is O(1). No I/O side effects occur.
|
|
4588
4754
|
- @param[in] cwd {string} Current working directory.
|
|
4589
4755
|
- @return {string} Absolute project base path.
|
|
4590
4756
|
|
|
4591
|
-
### fn `function getProcessCwdSafe(): string` (
|
|
4757
|
+
### fn `function getProcessCwdSafe(): string` (L212-221)
|
|
4592
4758
|
- @brief Resolves a safe process working directory for extension-load paths.
|
|
4593
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.
|
|
4594
4760
|
- @return {string} Absolute fallback-safe process working directory.
|
|
4595
4761
|
|
|
4596
|
-
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (
|
|
4762
|
+
### fn `function resolveLiveBootstrapCwd(cwd: string): string` (L229-241)
|
|
4597
4763
|
- @brief Resolves the live working directory used for bootstrap-sensitive flows.
|
|
4598
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.
|
|
4599
4765
|
- @param[in] cwd {string} Candidate context cwd.
|
|
4600
4766
|
- @return {string} Existing absolute cwd used for bootstrap work.
|
|
4601
4767
|
|
|
4602
|
-
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (
|
|
4768
|
+
### fn `function syncContextCwdMirror(ctx: { cwd?: string }, cwd: string): void` (L250-259)
|
|
4603
4769
|
- @brief Best-effort synchronizes one context `cwd` mirror with bootstrap reality.
|
|
4604
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.
|
|
4605
4771
|
- @param[in] cwd {string} Resolved live cwd.
|
|
4606
4772
|
- @param[in,out] ctx {{ cwd?: string }} Mutable context-like object.
|
|
4607
4773
|
- @return {void} No return value.
|
|
4608
4774
|
|
|
4609
|
-
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (
|
|
4775
|
+
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L268-271)
|
|
4610
4776
|
- @brief Loads project configuration for the extension runtime.
|
|
4611
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.
|
|
4612
4778
|
- @param[in] cwd {string} Current working directory.
|
|
4613
4779
|
- @return {UseReqConfig} Effective project configuration.
|
|
4614
4780
|
- @satisfies REQ-030, REQ-145, REQ-146
|
|
4615
4781
|
|
|
4616
|
-
|
|
4617
|
-
- @brief
|
|
4618
|
-
- @details
|
|
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)
|
|
4819
|
+
- @brief Persists effective project configuration from the extension runtime.
|
|
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.
|
|
4619
4821
|
- @param[in] cwd {string} Current working directory.
|
|
4620
|
-
- @param[in] config {UseReqConfig}
|
|
4822
|
+
- @param[in] config {UseReqConfig} Effective configuration to persist.
|
|
4621
4823
|
- @return {void} No return value.
|
|
4622
|
-
- @satisfies REQ-146
|
|
4824
|
+
- @satisfies REQ-146, REQ-315
|
|
4623
4825
|
|
|
4624
|
-
### fn `function
|
|
4625
|
-
- @brief Formats the current
|
|
4626
|
-
- @details Resolves `<base-path>/.pi-usereq.json` from the cwd-derived project base
|
|
4826
|
+
### fn `function formatLocalConfigPathForMenu(cwd: string): string` (L412-416)
|
|
4827
|
+
- @brief Formats the current local config path for top-level menu display.
|
|
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.
|
|
4627
4829
|
- @param[in] cwd {string} Current working directory.
|
|
4628
|
-
- @return {string} `~`-relative or absolute config
|
|
4830
|
+
- @return {string} `~`-relative or absolute local config-path display value.
|
|
4629
4831
|
- @satisfies REQ-162
|
|
4630
4832
|
|
|
4631
|
-
### fn `function
|
|
4833
|
+
### fn `function formatGlobalConfigPathForMenu(): string` (L424-426)
|
|
4834
|
+
- @brief Formats the current global config path for top-level menu display.
|
|
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.
|
|
4836
|
+
- @return {string} `~`-relative or absolute global config-path display value.
|
|
4837
|
+
- @satisfies REQ-319
|
|
4838
|
+
|
|
4839
|
+
### fn `function buildTerminalSettingsMenuChoices(options:` (L435-446)
|
|
4632
4840
|
- @brief Builds the standardized terminal rows appended to every configuration menu.
|
|
4633
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.
|
|
4634
4842
|
- @param[in] options {{ resetDefaultsDescription: string }} Menu-specific terminal-row metadata.
|
|
4635
4843
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered terminal menu rows.
|
|
4636
4844
|
- @satisfies REQ-193
|
|
4637
4845
|
|
|
4638
|
-
### iface `interface ResetConfirmationChange` (
|
|
4846
|
+
### iface `interface ResetConfirmationChange` (L452-456)
|
|
4639
4847
|
- @brief Describes one pending reset value change shown in confirmation menus.
|
|
4640
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.
|
|
4641
4849
|
|
|
4642
|
-
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (
|
|
4850
|
+
### fn `function formatResetConfirmationValue(previousValue: string, nextValue: string): string` (L465-467)
|
|
4643
4851
|
- @brief Formats one reset-confirmation value pair for menu display.
|
|
4644
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.
|
|
4645
4853
|
- @param[in] previousValue {string} Current persisted value.
|
|
4646
4854
|
- @param[in] nextValue {string} Candidate default value.
|
|
4647
4855
|
- @return {string} Rendered preview string.
|
|
4648
4856
|
|
|
4649
|
-
### fn `function buildResetConfirmationChoices(` (
|
|
4857
|
+
### fn `function buildResetConfirmationChoices(` (L477-516)
|
|
4650
4858
|
- @brief Builds the shared settings-menu choices for one reset-confirmation submenu.
|
|
4651
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.
|
|
4652
4860
|
- @param[in] changes {ResetConfirmationChange[]} Changed-value preview rows.
|
|
@@ -4654,7 +4862,7 @@ cost.
|
|
|
4654
4862
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4655
4863
|
- @return {PiUsereqSettingsMenuChoice[]} Reset-confirmation submenu choices.
|
|
4656
4864
|
|
|
4657
|
-
### fn `async function confirmResetChanges(` (
|
|
4865
|
+
### fn `async function confirmResetChanges(` (L528-541)
|
|
4658
4866
|
- @brief Opens one explicit reset-confirmation submenu.
|
|
4659
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.
|
|
4660
4868
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4664,60 +4872,73 @@ cost.
|
|
|
4664
4872
|
- @param[in] abortDescription {string} Description for the abort action.
|
|
4665
4873
|
- @return {Promise<boolean>} `true` when the reset is explicitly approved.
|
|
4666
4874
|
|
|
4667
|
-
### fn `function
|
|
4668
|
-
- @brief Writes
|
|
4669
|
-
- @details Reads the
|
|
4875
|
+
### fn `function writePersistedConfigToEditor(` (L550-555)
|
|
4876
|
+
- @brief Writes one already-persisted config file text into the editor.
|
|
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.
|
|
4878
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4879
|
+
- @param[in] configPath {string} Absolute persisted config path.
|
|
4880
|
+
- @return {void} No return value.
|
|
4881
|
+
|
|
4882
|
+
### fn `function writePersistedLocalConfigToEditor(` (L565-571)
|
|
4883
|
+
- @brief Writes the already-persisted local configuration file text into the editor.
|
|
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.
|
|
4670
4885
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4671
4886
|
- @param[in] cwd {string} Current working directory.
|
|
4672
|
-
- @param[in] _config {UseReqConfig} Unused effective project configuration retained for stable call-site shape.
|
|
4673
4887
|
- @return {void} No return value.
|
|
4674
4888
|
- @satisfies REQ-031
|
|
4675
4889
|
|
|
4676
|
-
### fn `function
|
|
4890
|
+
### fn `function writePersistedGlobalConfigToEditor(` (L580-584)
|
|
4891
|
+
- @brief Writes the already-persisted global configuration file text into the editor.
|
|
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.
|
|
4893
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4894
|
+
- @return {void} No return value.
|
|
4895
|
+
- @satisfies REQ-318
|
|
4896
|
+
|
|
4897
|
+
### fn `function buildSearchToolSupportedTagGuidelines(): string[]` (L645-649)
|
|
4677
4898
|
- @brief Builds the supported-tag guidance lines embedded in search-tool registrations.
|
|
4678
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.
|
|
4679
4900
|
- @return {string[]} Supported-tag guidance lines.
|
|
4680
4901
|
|
|
4681
|
-
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (
|
|
4902
|
+
### fn `function buildSearchToolSchemaDescription(scope: FindToolScope): string` (L657-662)
|
|
4682
4903
|
- @brief Builds the schema description for one search-tool registration.
|
|
4683
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.
|
|
4684
4905
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4685
4906
|
- @return {string} Parameter-schema description.
|
|
4686
4907
|
|
|
4687
|
-
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (
|
|
4908
|
+
### fn `function buildSearchToolPromptGuidelines(scope: FindToolScope): string[]` (L670-683)
|
|
4688
4909
|
- @brief Builds the prompt-guideline set for one search-tool registration.
|
|
4689
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.
|
|
4690
4911
|
- @param[in] scope {FindToolScope} Search-tool scope.
|
|
4691
4912
|
- @return {string[]} Prompt-guideline strings.
|
|
4692
4913
|
|
|
4693
|
-
- type `type MonolithicToolRenderResult = {` (
|
|
4914
|
+
- type `type MonolithicToolRenderResult = {` (L689)
|
|
4694
4915
|
- @brief Describes the monolithic tool-result surface consumed by tool-row renderers.
|
|
4695
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.
|
|
4696
|
-
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (
|
|
4917
|
+
### fn `function getMonolithicToolText(result: MonolithicToolRenderResult): string` (L706-709)
|
|
4697
4918
|
- @brief Extracts the primary monolithic text block from one tool result.
|
|
4698
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.
|
|
4699
4920
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4700
4921
|
- @return {string} Primary monolithic content text.
|
|
4701
4922
|
|
|
4702
|
-
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (
|
|
4923
|
+
### fn `function getMonolithicToolErrorText(result: MonolithicToolRenderResult): string | undefined` (L717-727)
|
|
4703
4924
|
- @brief Reads the first residual execution error string from one monolithic tool result.
|
|
4704
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.
|
|
4705
4926
|
- @param[in] result {MonolithicToolRenderResult} Tool result wrapper.
|
|
4706
4927
|
- @return {string | undefined} First residual execution error string.
|
|
4707
4928
|
|
|
4708
|
-
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (
|
|
4929
|
+
### fn `function formatCompactToolArgumentValue(value: unknown): string | undefined` (L735-774)
|
|
4709
4930
|
- @brief Formats one scalar or structural tool argument for compact render summaries.
|
|
4710
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.
|
|
4711
4932
|
- @param[in] value {unknown} Candidate tool argument value.
|
|
4712
4933
|
- @return {string | undefined} Compact preview string or `undefined` when the value carries no useful summary.
|
|
4713
4934
|
|
|
4714
|
-
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (
|
|
4935
|
+
### fn `function buildCompactToolInvocationText(args: Record<string, unknown> | undefined): string` (L782-793)
|
|
4715
4936
|
- @brief Builds the compact invocation summary appended to collapsed tool rows.
|
|
4716
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.
|
|
4717
4938
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4718
4939
|
- @return {string} Compact invocation summary prefixed with one separating space, or the empty string when no useful preview exists.
|
|
4719
4940
|
|
|
4720
|
-
### fn `function summarizeStructuredToolResult(` (
|
|
4941
|
+
### fn `function summarizeStructuredToolResult(` (L803-818)
|
|
4721
4942
|
- @brief Builds the compact default text for one monolithic tool result row.
|
|
4722
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.
|
|
4723
4944
|
- @param[in] toolName {string} Registered tool name.
|
|
@@ -4725,27 +4946,27 @@ cost.
|
|
|
4725
4946
|
- @param[in] args {Record<string, unknown> | undefined} Current tool call arguments.
|
|
4726
4947
|
- @return {string} Compact single-line summary.
|
|
4727
4948
|
|
|
4728
|
-
### fn `function buildStructuredToolRenderResult(toolName: string)` (
|
|
4949
|
+
### fn `function buildStructuredToolRenderResult(toolName: string)` (L827-846)
|
|
4729
4950
|
- @brief Builds a custom `renderResult` implementation for one monolithic tool.
|
|
4730
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.
|
|
4731
4952
|
- @param[in] toolName {string} Registered tool name.
|
|
4732
4953
|
- @return {(result: MonolithicToolRenderResult, options: { expanded?: boolean; isPartial?: boolean }, _theme: unknown, context: { args?: Record<string, unknown>; lastComponent?: unknown }) => Text} Custom result renderer.
|
|
4733
4954
|
- @satisfies REQ-210
|
|
4734
4955
|
|
|
4735
|
-
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4956
|
+
### fn `function executeMonolithicTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L854-860)
|
|
4736
4957
|
- @brief Executes one CLI-style runner for a monolithic agent tool.
|
|
4737
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.
|
|
4738
4959
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4739
4960
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Monolithic tool execute result.
|
|
4740
4961
|
|
|
4741
|
-
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (
|
|
4962
|
+
### fn `function executeStatusTool(operation: () => ToolResult): ReturnType<typeof buildMonolithicToolExecuteResult>` (L869-898)
|
|
4742
4963
|
- @brief Executes one CLI-style runner for a status-only agent tool.
|
|
4743
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.
|
|
4744
4965
|
- @param[in] operation {() => ToolResult} Runner callback.
|
|
4745
4966
|
- @return {ReturnType<typeof buildMonolithicToolExecuteResult>} Status-only tool execute result.
|
|
4746
4967
|
- @satisfies REQ-294, REQ-295, REQ-296
|
|
4747
4968
|
|
|
4748
|
-
### fn `function deliverPromptCommand(` (
|
|
4969
|
+
### fn `function deliverPromptCommand(` (L909-927)
|
|
4749
4970
|
- @brief Starts delivery of one rendered prompt into the current active session.
|
|
4750
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.
|
|
4751
4972
|
- @param[in] pi {ExtensionAPI} Handler-scoped extension API instance retained as the fallback dispatcher.
|
|
@@ -4754,7 +4975,7 @@ cost.
|
|
|
4754
4975
|
- @return {Promise<void>} Promise representing eventual prompt-delivery completion.
|
|
4755
4976
|
- @satisfies REQ-004, REQ-067, REQ-068, REQ-227, REQ-281
|
|
4756
4977
|
|
|
4757
|
-
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (
|
|
4978
|
+
### fn `function shouldIgnoreLatePromptDeliveryFailure(` (L938-954)
|
|
4758
4979
|
- @brief Detects prompt-delivery failures that can be ignored after prompt ownership has moved past the command handler.
|
|
4759
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.
|
|
4760
4981
|
- @param[in] error {unknown} Candidate prompt-delivery failure.
|
|
@@ -4763,7 +4984,7 @@ cost.
|
|
|
4763
4984
|
- @return {boolean} `true` when the failure is a late stale-context delivery rejection that MUST be ignored.
|
|
4764
4985
|
- @satisfies REQ-208, REQ-280, REQ-281, REQ-282
|
|
4765
4986
|
|
|
4766
|
-
### fn `function logPromptWorkflowStateChange(` (
|
|
4987
|
+
### fn `function logPromptWorkflowStateChange(` (L967-986)
|
|
4767
4988
|
- @brief Appends one workflow-state debug entry for a bundled prompt when selected.
|
|
4768
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.
|
|
4769
4990
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4774,7 +4995,7 @@ cost.
|
|
|
4774
4995
|
- @return {void} No return value.
|
|
4775
4996
|
- @satisfies REQ-245, REQ-246, REQ-247
|
|
4776
4997
|
|
|
4777
|
-
### fn `function logPromptWorkflowEvent(` (
|
|
4998
|
+
### fn `function logPromptWorkflowEvent(` (L1002-1022)
|
|
4778
4999
|
- @brief Appends one dedicated prompt workflow debug entry when selected.
|
|
4779
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.
|
|
4780
5001
|
- @param[in] projectBase {string} Absolute original project base path.
|
|
@@ -4788,7 +5009,7 @@ cost.
|
|
|
4788
5009
|
- @return {void} No return value.
|
|
4789
5010
|
- @satisfies REQ-245, REQ-246, REQ-247, REQ-277
|
|
4790
5011
|
|
|
4791
|
-
### fn `function transitionPromptWorkflowState(` (
|
|
5012
|
+
### fn `function transitionPromptWorkflowState(` (L1035-1048)
|
|
4792
5013
|
- @brief Transitions one prompt workflow state and logs the transition immediately after the state update.
|
|
4793
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.
|
|
4794
5015
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -4799,20 +5020,20 @@ cost.
|
|
|
4799
5020
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4800
5021
|
- @return {void} No return value.
|
|
4801
5022
|
|
|
4802
|
-
### fn `function resolvePromptCommandDescription(` (
|
|
5023
|
+
### fn `function resolvePromptCommandDescription(` (L1056-1060)
|
|
4803
5024
|
- @brief Resolves the runtime slash-command description for one bundled prompt.
|
|
4804
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.
|
|
4805
5026
|
- @param[in] promptName {import("./core/prompt-command-catalog.js").PromptCommandName} Bundled prompt name.
|
|
4806
5027
|
- @return {string} Runtime command description.
|
|
4807
5028
|
|
|
4808
|
-
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (
|
|
5029
|
+
### fn `function resolveDebugProjectBase(cwd: string, statusController: PiUsereqStatusController): string` (L1069-1073)
|
|
4809
5030
|
- @brief Resolves the original project base used for debug-log file writes.
|
|
4810
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.
|
|
4811
5032
|
- @param[in] cwd {string} Current extension working directory.
|
|
4812
5033
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4813
5034
|
- @return {string} Absolute original project base path for debug logging.
|
|
4814
5035
|
|
|
4815
|
-
### fn `function notifyContextSafely(` (
|
|
5036
|
+
### fn `function notifyContextSafely(` (L1084-1101)
|
|
4816
5037
|
- @brief Delivers one best-effort UI notification without failing on stale replacement contexts.
|
|
4817
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.
|
|
4818
5039
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext | undefined} Candidate UI context.
|
|
@@ -4821,7 +5042,7 @@ cost.
|
|
|
4821
5042
|
- @return {boolean} `true` when the notification was delivered and `false` when the context was already stale.
|
|
4822
5043
|
- @satisfies REQ-280
|
|
4823
5044
|
|
|
4824
|
-
### fn `function rejectNonIdleReqCommand(` (
|
|
5045
|
+
### fn `function rejectNonIdleReqCommand(` (L1113-1133)
|
|
4825
5046
|
- @brief Rejects one non-`idle` req-command invocation and records the workflow error state.
|
|
4826
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.
|
|
4827
5048
|
- @param[in] ctx {ExtensionContext | ExtensionCommandContext} Active extension context.
|
|
@@ -4831,20 +5052,20 @@ cost.
|
|
|
4831
5052
|
- @throws {ReqError} Always throws because non-`idle` req commands are rejected.
|
|
4832
5053
|
- @satisfies REQ-224
|
|
4833
5054
|
|
|
4834
|
-
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (
|
|
5055
|
+
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L1142-1150)
|
|
4835
5056
|
- @brief Returns the configurable active-tool inventory visible to the extension.
|
|
4836
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.
|
|
4837
5058
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4838
5059
|
- @return {ToolInfo[]} Sorted configurable tool descriptors.
|
|
4839
5060
|
- @satisfies REQ-007, REQ-063, REQ-231, REQ-232
|
|
4840
5061
|
|
|
4841
|
-
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (
|
|
5062
|
+
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L1158-1162)
|
|
4842
5063
|
- @brief Normalizes and returns the configured enabled active tools.
|
|
4843
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"]`.
|
|
4844
5065
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4845
5066
|
- @return {string[]} Normalized enabled tool names.
|
|
4846
5067
|
|
|
4847
|
-
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (
|
|
5068
|
+
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L1172-1189)
|
|
4848
5069
|
- @brief Applies the configured active-tool enablement to the current session.
|
|
4849
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(...)`.
|
|
4850
5071
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4852,7 +5073,7 @@ cost.
|
|
|
4852
5073
|
- @return {void} No return value.
|
|
4853
5074
|
- @satisfies REQ-009, REQ-064
|
|
4854
5075
|
|
|
4855
|
-
### fn `async function handleExtensionStatusEvent(` (
|
|
5076
|
+
### fn `async function handleExtensionStatusEvent(` (L1202-1473)
|
|
4856
5077
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
4857
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.
|
|
4858
5079
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4863,7 +5084,7 @@ cost.
|
|
|
4863
5084
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
4864
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
|
|
4865
5086
|
|
|
4866
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
5087
|
+
### fn `function registerExtensionStatusHooks(` (L1489-1508)
|
|
4867
5088
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
4868
5089
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
4869
5090
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -4877,7 +5098,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4877
5098
|
- @return {void} No return value.
|
|
4878
5099
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
4879
5100
|
|
|
4880
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
5101
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L1518-1521)
|
|
4881
5102
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
4882
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.
|
|
4883
5104
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4885,26 +5106,26 @@ registered hook count. Side effects include hook registration.
|
|
|
4885
5106
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4886
5107
|
- @return {void} No return value.
|
|
4887
5108
|
|
|
4888
|
-
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (
|
|
5109
|
+
### fn `function getDebugToolToggleNames(): PiUsereqStartupToolName[]` (L1529-1531)
|
|
4889
5110
|
- @brief Returns the canonical debug-tool toggle order.
|
|
4890
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.
|
|
4891
5112
|
- @return {PiUsereqStartupToolName[]} Ordered debug-tool toggle names.
|
|
4892
5113
|
- @satisfies REQ-242
|
|
4893
5114
|
|
|
4894
|
-
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (
|
|
5115
|
+
### fn `function resetDebugConfigToDefaults(config: UseReqConfig): void` (L1540-1549)
|
|
4895
5116
|
- @brief Restores the debug configuration subtree to its documented defaults.
|
|
4896
|
-
- @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`.
|
|
4897
5118
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4898
5119
|
- @return {void} No return value.
|
|
4899
|
-
- @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
|
|
4900
5121
|
|
|
4901
|
-
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (
|
|
5122
|
+
### fn `function formatDebugMenuSummary(config: UseReqConfig): string` (L1557-1563)
|
|
4902
5123
|
- @brief Formats the top-level Debug summary value.
|
|
4903
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.
|
|
4904
5125
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4905
5126
|
- @return {string} Compact debug summary string.
|
|
4906
5127
|
|
|
4907
|
-
### fn `function buildDebugMenuChoice(` (
|
|
5128
|
+
### fn `function buildDebugMenuChoice(` (L1573-1586)
|
|
4908
5129
|
- @brief Builds one debug-menu row with optional disabled styling.
|
|
4909
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.
|
|
4910
5131
|
- @param[in] choice {PiUsereqSettingsMenuChoice} Base debug-menu row.
|
|
@@ -4912,67 +5133,70 @@ registered hook count. Side effects include hook registration.
|
|
|
4912
5133
|
- @return {PiUsereqSettingsMenuChoice} Styled debug-menu row.
|
|
4913
5134
|
- @satisfies REQ-241
|
|
4914
5135
|
|
|
4915
|
-
### fn `async function selectDebugLogOnStatus(` (
|
|
5136
|
+
### fn `async function selectDebugLogOnStatus(` (L1595-1623)
|
|
4916
5137
|
- @brief Opens the workflow-state filter selector used by the Debug submenu.
|
|
4917
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.
|
|
4918
5139
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4919
5140
|
- @param[in] currentValue {DebugLogOnStatus} Current persisted workflow-state filter.
|
|
4920
5141
|
- @return {Promise<DebugLogOnStatus | undefined>} Selected workflow-state filter or `undefined` when cancelled.
|
|
4921
5142
|
|
|
4922
|
-
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5143
|
+
### fn `function buildDebugMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1632-1718)
|
|
4923
5144
|
- @brief Builds the shared settings-menu choices for debug logging configuration.
|
|
4924
|
-
- @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.
|
|
4925
5146
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4926
5147
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered debug-menu choices.
|
|
4927
|
-
- @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
|
|
4928
5149
|
|
|
4929
|
-
### fn `async function configureDebugMenu(` (
|
|
5150
|
+
### fn `async function configureDebugMenu(` (L1729-1919)
|
|
4930
5151
|
- @brief Runs the interactive Debug submenu.
|
|
4931
|
-
- @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.
|
|
4932
5154
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4933
5155
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4934
5156
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
4935
|
-
- @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)
|
|
4936
5160
|
|
|
4937
|
-
- type `type PiNotifyBooleanConfigKey =` (
|
|
5161
|
+
- type `type PiNotifyBooleanConfigKey =` (L1925)
|
|
4938
5162
|
- @brief Represents one persisted boolean notification-setting key.
|
|
4939
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.
|
|
4940
|
-
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (
|
|
5164
|
+
- type `type PiNotifyEventBooleanConfigKey = Exclude<` (L1942)
|
|
4941
5165
|
- @brief Represents one persisted boolean notification event-toggle key.
|
|
4942
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.
|
|
4943
|
-
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (
|
|
5167
|
+
- type `type PiNotifyEventId = "completed" | "interrupted" | "failed";` (L1951)
|
|
4944
5168
|
- @brief Represents one shared prompt-end event identifier used by notification menus.
|
|
4945
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.
|
|
4946
|
-
### iface `interface PiNotifyEventRowDefinition` (
|
|
5170
|
+
### iface `interface PiNotifyEventRowDefinition` (L1957-1961)
|
|
4947
5171
|
- @brief Describes one shared prompt-end event row rendered inside notification event submenus.
|
|
4948
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.
|
|
4949
5173
|
|
|
4950
|
-
### iface `interface PiNotifyEventMenuDefinition` (
|
|
5174
|
+
### iface `interface PiNotifyEventMenuDefinition` (L1967-1973)
|
|
4951
5175
|
- @brief Describes one notification-system event submenu contract.
|
|
4952
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.
|
|
4953
5177
|
|
|
4954
|
-
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (
|
|
5178
|
+
### fn `function togglePiNotifyFlag(config: UseReqConfig, key: PiNotifyBooleanConfigKey): boolean` (L1982-1985)
|
|
4955
5179
|
- @brief Flips one persisted boolean notification setting.
|
|
4956
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`.
|
|
4957
5181
|
- @param[in] key {PiNotifyBooleanConfigKey} Boolean configuration key to toggle.
|
|
4958
5182
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4959
5183
|
- @return {boolean} Next enabled state.
|
|
4960
5184
|
|
|
4961
|
-
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (
|
|
5185
|
+
### fn `function resetPiNotifyConfigToDefaults(config: UseReqConfig): void` (L1994-2018)
|
|
4962
5186
|
- @brief Restores notification-related settings to their documented defaults.
|
|
4963
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`.
|
|
4964
5188
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4965
5189
|
- @return {void} No return value.
|
|
4966
5190
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195, REQ-196
|
|
4967
5191
|
|
|
4968
|
-
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (
|
|
5192
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L2027-2029)
|
|
4969
5193
|
- @brief Formats one persisted Pushover priority for menu display.
|
|
4970
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.
|
|
4971
5195
|
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
4972
5196
|
- @return {string} Menu-display label.
|
|
4973
5197
|
- @satisfies REQ-172
|
|
4974
5198
|
|
|
4975
|
-
### fn `function formatPiNotifyEventMenuSummary(` (
|
|
5199
|
+
### fn `function formatPiNotifyEventMenuSummary(` (L2113-2121)
|
|
4976
5200
|
- @brief Formats the top-level summary value for one notification event submenu.
|
|
4977
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.
|
|
4978
5202
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -4980,7 +5204,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4980
5204
|
- @return {string} Compact enabled-toggle summary.
|
|
4981
5205
|
- @satisfies REQ-198
|
|
4982
5206
|
|
|
4983
|
-
### fn `function buildPiNotifyEventLauncherChoice(` (
|
|
5207
|
+
### fn `function buildPiNotifyEventLauncherChoice(` (L2131-2141)
|
|
4984
5208
|
- @brief Builds the top-level launcher row for one notification event submenu.
|
|
4985
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.
|
|
4986
5210
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -4988,7 +5212,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4988
5212
|
- @return {PiUsereqSettingsMenuChoice} Launcher row for the selected event submenu.
|
|
4989
5213
|
- @satisfies REQ-181, REQ-183, REQ-165, REQ-198
|
|
4990
5214
|
|
|
4991
|
-
### fn `function buildPiNotifyEventMenuChoices(` (
|
|
5215
|
+
### fn `function buildPiNotifyEventMenuChoices(` (L2151-2167)
|
|
4992
5216
|
- @brief Builds the shared settings-menu choices for one notification event submenu.
|
|
4993
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.
|
|
4994
5218
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -4996,7 +5220,7 @@ registered hook count. Side effects include hook registration.
|
|
|
4996
5220
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered event-submenu choice vector.
|
|
4997
5221
|
- @satisfies REQ-188, REQ-193, REQ-198
|
|
4998
5222
|
|
|
4999
|
-
### fn `function resetPiNotifyEventMenuToDefaults(` (
|
|
5223
|
+
### fn `function resetPiNotifyEventMenuToDefaults(` (L2177-2185)
|
|
5000
5224
|
- @brief Restores one notification event submenu to its documented defaults.
|
|
5001
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`.
|
|
5002
5226
|
- @param[in] eventMenu {PiNotifyEventMenuDefinition} Notification-system event submenu contract.
|
|
@@ -5004,7 +5228,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5004
5228
|
- @return {void} No return value.
|
|
5005
5229
|
- @satisfies REQ-174, REQ-178, REQ-184, REQ-195
|
|
5006
5230
|
|
|
5007
|
-
### fn `function resolvePiNotifyEventLabel(` (
|
|
5231
|
+
### fn `function resolvePiNotifyEventLabel(` (L2195-2202)
|
|
5008
5232
|
- @brief Resolves the human-readable event label for one event-toggle config key.
|
|
5009
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.
|
|
5010
5234
|
- @param[in] key {PiNotifyEventBooleanConfigKey} Event-toggle configuration key.
|
|
@@ -5012,7 +5236,7 @@ registered hook count. Side effects include hook registration.
|
|
|
5012
5236
|
- @return {string} Human-readable event label.
|
|
5013
5237
|
- @satisfies REQ-188, REQ-198
|
|
5014
5238
|
|
|
5015
|
-
### fn `async function configurePiNotifyEventMenu(` (
|
|
5239
|
+
### fn `async function configurePiNotifyEventMenu(` (L2213-2289)
|
|
5016
5240
|
- @brief Runs one dedicated notification event submenu.
|
|
5017
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.
|
|
5018
5242
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5021,14 +5245,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5021
5245
|
- @return {Promise<void>} Promise resolved when the submenu closes.
|
|
5022
5246
|
- @satisfies REQ-188, REQ-192, REQ-193, REQ-195, REQ-198
|
|
5023
5247
|
|
|
5024
|
-
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5248
|
+
### fn `function buildPiNotifyPushoverRows(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2298-2348)
|
|
5025
5249
|
- @brief Builds the direct Pushover rows rendered inside `Notifications`.
|
|
5026
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.
|
|
5027
5251
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5028
5252
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered direct Pushover rows.
|
|
5029
5253
|
- @satisfies REQ-163, REQ-165, REQ-172, REQ-184, REQ-185, REQ-198, REQ-234, REQ-235
|
|
5030
5254
|
|
|
5031
|
-
### fn `async function selectPiNotifyPushoverPriority(` (
|
|
5255
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L2358-2386)
|
|
5032
5256
|
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
5033
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.
|
|
5034
5258
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5036,14 +5260,14 @@ registered hook count. Side effects include hook registration.
|
|
|
5036
5260
|
- @return {Promise<PiNotifyPushoverPriority | "reset-defaults" | undefined>} Selected priority, reset action, or `undefined` when cancelled.
|
|
5037
5261
|
- @satisfies REQ-172, REQ-192
|
|
5038
5262
|
|
|
5039
|
-
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5263
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2395-2453)
|
|
5040
5264
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
5041
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.
|
|
5042
5266
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5043
5267
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
5044
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
|
|
5045
5269
|
|
|
5046
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
5270
|
+
### fn `async function selectPiNotifySoundLevel(` (L2463-2503)
|
|
5047
5271
|
- @brief Opens the shared settings-menu selector for the persisted boot sound level.
|
|
5048
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.
|
|
5049
5273
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -5051,20 +5275,20 @@ registered hook count. Side effects include hook registration.
|
|
|
5051
5275
|
- @return {Promise<PiNotifySoundLevel | "reset-defaults" | undefined>} Selected boot sound level, reset action, or `undefined` when cancelled.
|
|
5052
5276
|
- @satisfies REQ-131, REQ-179, REQ-192, REQ-289
|
|
5053
5277
|
|
|
5054
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
5278
|
+
### fn `async function configurePiNotifyMenu(` (L2513-2799)
|
|
5055
5279
|
- @brief Runs the interactive notification-configuration menu.
|
|
5056
|
-
- @details Exposes command-notify, sound, and Pushover controls through the shared settings-menu renderer, delegates completed/interrupted/failed toggles to dedicated event submenus,
|
|
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.
|
|
5057
5281
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5058
5282
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5059
5283
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
5060
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
|
|
5061
5285
|
|
|
5062
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
5286
|
+
### fn `function registerPiNotifyShortcut(` (L2814-2837)
|
|
5063
5287
|
- @brief Registers the configurable notification-sound shortcut when supported.
|
|
5064
|
-
- @details Loads the current
|
|
5288
|
+
- @details Loads the current effective config, registers one raw pi shortcut when
|
|
5065
5289
|
the runtime exposes `registerShortcut(...)`, cycles only the active runtime
|
|
5066
|
-
sound level on invocation, leaves
|
|
5067
|
-
status bar, and emits one info notification. Runtime is O(1) for registration
|
|
5290
|
+
sound level on invocation, leaves persisted local and global configuration
|
|
5291
|
+
unchanged, refreshes the status bar, and emits one info notification. Runtime is O(1) for registration
|
|
5068
5292
|
plus one status update per shortcut use. Side effects include shortcut
|
|
5069
5293
|
registration and status updates.
|
|
5070
5294
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5072,15 +5296,15 @@ registration and status updates.
|
|
|
5072
5296
|
- @return {void} No return value.
|
|
5073
5297
|
- @satisfies REQ-134, REQ-180, REQ-286, REQ-287
|
|
5074
5298
|
|
|
5075
|
-
### fn `function resolveReqResetPromptRequest(` (
|
|
5299
|
+
### fn `function resolveReqResetPromptRequest(` (L2845-2871)
|
|
5076
5300
|
- @brief Resolves the prompt execution plan targeted by `req-reset` recovery.
|
|
5077
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.
|
|
5078
5302
|
- @param[in] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5079
5303
|
- @return {PromptCommandExecutionPlan | undefined} Recoverable prompt execution plan when one remains available.
|
|
5080
5304
|
|
|
5081
|
-
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (
|
|
5305
|
+
### fn `const isWorktreeBacked = (request: PromptCommandExecutionPlan | undefined): request is PromptCommandExecutionPlan =>` (L2848-2855)
|
|
5082
5306
|
|
|
5083
|
-
### fn `function registerReqResetCommand(` (
|
|
5307
|
+
### fn `function registerReqResetCommand(` (L2881-2935)
|
|
5084
5308
|
- @brief Registers the specialized `req-reset` slash command.
|
|
5085
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.
|
|
5086
5310
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5088,7 +5312,7 @@ registration and status updates.
|
|
|
5088
5312
|
- @return {void} No return value.
|
|
5089
5313
|
- @satisfies REQ-304, REQ-305, REQ-306, REQ-307, REQ-308, REQ-309, REQ-310, REQ-311, REQ-312, REQ-313
|
|
5090
5314
|
|
|
5091
|
-
### fn `function registerReqReferencesCommand(` (
|
|
5315
|
+
### fn `function registerReqReferencesCommand(` (L2945-2985)
|
|
5092
5316
|
- @brief Registers the specialized `req-references` slash command.
|
|
5093
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.
|
|
5094
5318
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5096,7 +5320,7 @@ registration and status updates.
|
|
|
5096
5320
|
- @return {void} No return value.
|
|
5097
5321
|
- @satisfies REQ-200, REQ-221, REQ-224, REQ-298, REQ-299, REQ-300, REQ-301, REQ-302, REQ-303
|
|
5098
5322
|
|
|
5099
|
-
### fn `function registerPromptCommands(` (
|
|
5323
|
+
### fn `function registerPromptCommands(` (L2995-3111)
|
|
5100
5324
|
- @brief Registers bundled prompt-backed commands with the extension.
|
|
5101
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.
|
|
5102
5326
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5104,14 +5328,14 @@ registration and status updates.
|
|
|
5104
5328
|
- @return {void} No return value.
|
|
5105
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
|
|
5106
5330
|
|
|
5107
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
5331
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L3121-3420)
|
|
5108
5332
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
5109
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.
|
|
5110
5334
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5111
5335
|
- @return {void} No return value.
|
|
5112
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
|
|
5113
5337
|
|
|
5114
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5338
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3465-3490)
|
|
5115
5339
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
5116
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.
|
|
5117
5341
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5119,7 +5343,7 @@ registration and status updates.
|
|
|
5119
5343
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
5120
5344
|
- @satisfies REQ-007, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5121
5345
|
|
|
5122
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5346
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3500-3514)
|
|
5123
5347
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
5124
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.
|
|
5125
5349
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5127,108 +5351,108 @@ registration and status updates.
|
|
|
5127
5351
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
5128
5352
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154, REQ-231, REQ-232
|
|
5129
5353
|
|
|
5130
|
-
### fn `async function configurePiUsereqToolsMenu(` (
|
|
5354
|
+
### fn `async function configurePiUsereqToolsMenu(` (L3525-3642)
|
|
5131
5355
|
- @brief Runs the interactive active-tool configuration menu.
|
|
5132
|
-
- @details Synchronizes runtime active tools with
|
|
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.
|
|
5133
5357
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5134
5358
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5135
5359
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5136
5360
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5137
5361
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193, REQ-231, REQ-232
|
|
5138
5362
|
|
|
5139
|
-
### fn `function getStaticCheckLanguageConfigForMenu(` (
|
|
5363
|
+
### fn `function getStaticCheckLanguageConfigForMenu(` (L3651-3656)
|
|
5140
5364
|
- @brief Resolves one static-check language config for menu rendering.
|
|
5141
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.
|
|
5142
5366
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5143
5367
|
- @param[in] language {string} Canonical language name.
|
|
5144
5368
|
- @return {StaticCheckLanguageConfig} Resolved per-language config object.
|
|
5145
5369
|
|
|
5146
|
-
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5370
|
+
### fn `function countConfiguredStaticCheckLanguages(config: UseReqConfig): number` (L3664-3666)
|
|
5147
5371
|
- @brief Counts languages that currently expose at least one configured checker.
|
|
5148
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.
|
|
5149
5373
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5150
5374
|
- @return {number} Number of languages with at least one configured checker.
|
|
5151
5375
|
|
|
5152
|
-
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (
|
|
5376
|
+
### fn `function countEnabledStaticCheckLanguages(config: UseReqConfig): number` (L3674-3676)
|
|
5153
5377
|
- @brief Counts languages whose static-check enable flag is on.
|
|
5154
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.
|
|
5155
5379
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5156
5380
|
- @return {number} Number of enabled languages.
|
|
5157
5381
|
|
|
5158
|
-
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (
|
|
5382
|
+
### fn `function resetStaticCheckConfig(config: UseReqConfig): void` (L3685-3687)
|
|
5159
5383
|
- @brief Restores the documented static-check default configuration.
|
|
5160
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`.
|
|
5161
5385
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5162
5386
|
- @return {void} No return value.
|
|
5163
5387
|
- @satisfies REQ-250, REQ-251, REQ-252
|
|
5164
5388
|
|
|
5165
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
5389
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L3695-3697)
|
|
5166
5390
|
- @brief Summarizes enabled and configured static-check languages.
|
|
5167
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.
|
|
5168
5392
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5169
5393
|
- @return {string} Compact summary string.
|
|
5170
5394
|
|
|
5171
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5395
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3706-3738)
|
|
5172
5396
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
5173
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.
|
|
5174
5398
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5175
5399
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
5176
5400
|
- @satisfies REQ-008, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-248
|
|
5177
5401
|
|
|
5178
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5402
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3746-3763)
|
|
5179
5403
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
5180
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.
|
|
5181
5405
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5182
5406
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
5183
5407
|
|
|
5184
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5408
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L3771-3788)
|
|
5185
5409
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
5186
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.
|
|
5187
5411
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5188
5412
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
5189
5413
|
|
|
5190
|
-
### fn `async function configureStaticCheckMenu(` (
|
|
5414
|
+
### fn `async function configureStaticCheckMenu(` (L3798-3944)
|
|
5191
5415
|
- @brief Runs the interactive static-check configuration menu.
|
|
5192
|
-
- @details Lets the user add
|
|
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.
|
|
5193
5417
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5194
5418
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
5195
5419
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
5196
5420
|
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154, REQ-160, REQ-161, REQ-193, REQ-195, REQ-248, REQ-253
|
|
5197
5421
|
|
|
5198
|
-
### fn `function buildPiUsereqMenuChoices(` (
|
|
5422
|
+
### fn `function buildPiUsereqMenuChoices(` (L3954-4053)
|
|
5199
5423
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
5200
|
-
- @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
|
|
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.
|
|
5201
5425
|
- @param[in] cwd {string} Current working directory.
|
|
5202
5426
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5203
5427
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
5204
|
-
- @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
|
|
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
|
|
5205
5429
|
|
|
5206
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5430
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4062-4080)
|
|
5207
5431
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
5208
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.
|
|
5209
5433
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5210
5434
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
5211
5435
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154, REQ-193
|
|
5212
5436
|
|
|
5213
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
5437
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L4089-4101)
|
|
5214
5438
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
5215
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.
|
|
5216
5440
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
5217
5441
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
5218
5442
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
5219
5443
|
|
|
5220
|
-
### fn `async function configurePiUsereq(` (
|
|
5444
|
+
### fn `async function configurePiUsereq(` (L4112-4365)
|
|
5221
5445
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
5222
|
-
- @details Loads
|
|
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.
|
|
5223
5447
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5224
5448
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
5225
5449
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
5226
5450
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
5227
|
-
- @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
|
|
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
|
|
5228
5452
|
|
|
5229
|
-
### fn `const persistConfigChange = () =>` (
|
|
5453
|
+
### fn `const persistConfigChange = () =>` (L4123-4128)
|
|
5230
5454
|
|
|
5231
|
-
### fn `function registerConfigCommands(` (
|
|
5455
|
+
### fn `function registerConfigCommands(` (L4375-4385)
|
|
5232
5456
|
- @brief Registers configuration-management commands.
|
|
5233
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.
|
|
5234
5458
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -5236,107 +5460,116 @@ registration and status updates.
|
|
|
5236
5460
|
- @return {void} No return value.
|
|
5237
5461
|
- @satisfies REQ-006, REQ-031
|
|
5238
5462
|
|
|
5239
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
5463
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L4394-4407)
|
|
5240
5464
|
- @brief Registers the complete pi-usereq extension.
|
|
5241
|
-
- @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.
|
|
5242
5466
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
5243
5467
|
- @return {void} No return value.
|
|
5244
|
-
- @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
|
|
5245
5469
|
|
|
5246
5470
|
## Symbol Index
|
|
5247
5471
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
5248
5472
|
|---|---|---|---|---|
|
|
5249
|
-
|`PiShortcutRegistrar`|iface||
|
|
5250
|
-
|`getProjectBase`|fn||
|
|
5251
|
-
|`getProcessCwdSafe`|fn||
|
|
5252
|
-
|`resolveLiveBootstrapCwd`|fn||
|
|
5253
|
-
|`syncContextCwdMirror`|fn||
|
|
5254
|
-
|`loadProjectConfig`|fn||
|
|
5255
|
-
|`
|
|
5256
|
-
|`
|
|
5257
|
-
|`
|
|
5258
|
-
|`
|
|
5259
|
-
|`
|
|
5260
|
-
|`
|
|
5261
|
-
|`
|
|
5262
|
-
|`
|
|
5263
|
-
|`
|
|
5264
|
-
|`
|
|
5265
|
-
|`
|
|
5266
|
-
|`
|
|
5267
|
-
|`
|
|
5268
|
-
|`
|
|
5269
|
-
|`
|
|
5270
|
-
|`
|
|
5271
|
-
|`
|
|
5272
|
-
|`
|
|
5273
|
-
|`
|
|
5274
|
-
|`
|
|
5275
|
-
|`
|
|
5276
|
-
|`
|
|
5277
|
-
|`
|
|
5278
|
-
|`
|
|
5279
|
-
|`
|
|
5280
|
-
|`
|
|
5281
|
-
|`
|
|
5282
|
-
|`
|
|
5283
|
-
|`
|
|
5284
|
-
|`
|
|
5285
|
-
|`
|
|
5286
|
-
|`
|
|
5287
|
-
|`
|
|
5288
|
-
|`
|
|
5289
|
-
|`
|
|
5290
|
-
|`
|
|
5291
|
-
|`
|
|
5292
|
-
|`
|
|
5293
|
-
|`
|
|
5294
|
-
|`
|
|
5295
|
-
|`
|
|
5296
|
-
|`
|
|
5297
|
-
|`
|
|
5298
|
-
|`
|
|
5299
|
-
|`
|
|
5300
|
-
|`
|
|
5301
|
-
|`
|
|
5302
|
-
|`
|
|
5303
|
-
|`
|
|
5304
|
-
|`
|
|
5305
|
-
|`
|
|
5306
|
-
|`
|
|
5307
|
-
|`
|
|
5308
|
-
|`
|
|
5309
|
-
|`
|
|
5310
|
-
|`
|
|
5311
|
-
|`
|
|
5312
|
-
|`
|
|
5313
|
-
|`
|
|
5314
|
-
|`
|
|
5315
|
-
|`
|
|
5316
|
-
|`
|
|
5317
|
-
|`
|
|
5318
|
-
|`
|
|
5319
|
-
|`
|
|
5320
|
-
|`
|
|
5321
|
-
|`
|
|
5322
|
-
|`
|
|
5323
|
-
|`
|
|
5324
|
-
|`
|
|
5325
|
-
|`
|
|
5326
|
-
|`
|
|
5327
|
-
|`
|
|
5328
|
-
|`
|
|
5329
|
-
|`
|
|
5330
|
-
|`
|
|
5331
|
-
|`
|
|
5332
|
-
|`
|
|
5333
|
-
|`
|
|
5334
|
-
|`
|
|
5335
|
-
|`
|
|
5336
|
-
|`
|
|
5337
|
-
|`
|
|
5338
|
-
|`
|
|
5339
|
-
|`
|
|
5340
|
-
|`
|
|
5341
|
-
|`
|
|
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...|
|
|
5342
5575
|
|