pi-usereq 0.4.0 → 0.6.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/.gitignore +3 -0
- package/CHANGELOG.md +41 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/{req → pi-usereq}/docs/REFERENCES.md +499 -491
- package/{req → pi-usereq}/docs/REQUIREMENTS.md +84 -62
- package/{req → pi-usereq}/docs/WORKFLOW.md +87 -102
- package/src/core/agent-tool-json.ts +42 -193
- package/src/core/compress-payload.ts +7 -15
- package/src/core/config.ts +39 -12
- package/src/core/extension-status.ts +94 -58
- package/src/core/find-payload.ts +21 -44
- package/src/core/pi-notify.ts +198 -11
- package/src/core/reference-payload.ts +6 -14
- package/src/core/runtime-project-paths.ts +3 -32
- package/src/core/settings-menu.ts +9 -4
- package/src/core/static-check.ts +35 -171
- package/src/core/token-counter.ts +3 -121
- package/src/index.ts +339 -180
- package/tests/attended-results-scenarios.ts +3 -13
- package/tests/cli-command-option-parity.test.ts +21 -12
- package/tests/debug-extension-harness.test.ts +20 -22
- package/tests/extension-registration.test.ts +394 -157
- package/tests/oracle-project.test.ts +8 -3
- package/tests/oracle-standalone.test.ts +7 -13
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_zig.zig.json +0 -5
|
@@ -918,7 +918,7 @@ import {
|
|
|
918
918
|
|
|
919
919
|
---
|
|
920
920
|
|
|
921
|
-
# agent-tool-json.ts | TypeScript |
|
|
921
|
+
# agent-tool-json.ts | TypeScript | 470L | 23 symbols | 6 imports | 24 comments
|
|
922
922
|
> Path: `src/core/agent-tool-json.ts`
|
|
923
923
|
- @brief Builds structured agent-tool JSON payloads for path, git, docs, worktree, and static-check tools.
|
|
924
924
|
- @details Converts extension-tool execution state into deterministic JSON-first payloads optimized for direct LLM traversal. The module normalizes execution metadata, path facts, required-doc status, worktree mutation facts, and static-check file-selection facts without depending on presentation-oriented text. Runtime is O(F) in the number of described files plus path normalization cost. Side effects are limited to filesystem reads.
|
|
@@ -928,7 +928,6 @@ import {
|
|
|
928
928
|
import fs from "node:fs";
|
|
929
929
|
import path from "node:path";
|
|
930
930
|
import type { StaticCheckEntry } from "./config.js";
|
|
931
|
-
import type { RuntimePathFacts } from "./path-context.js";
|
|
932
931
|
import { ReqError } from "./errors.js";
|
|
933
932
|
import { STATIC_CHECK_EXT_TO_LANG } from "./static-check.js";
|
|
934
933
|
import type { ToolResult } from "./tool-runner.js";
|
|
@@ -936,143 +935,138 @@ import type { ToolResult } from "./tool-runner.js";
|
|
|
936
935
|
|
|
937
936
|
## Definitions
|
|
938
937
|
|
|
939
|
-
### iface `export interface ToolExecutionSection` (
|
|
938
|
+
### iface `export interface ToolExecutionSection` (L18-22)
|
|
940
939
|
- @brief Describes normalized execution metadata shared by structured tool payloads.
|
|
941
|
-
- @details
|
|
940
|
+
- @details Stores only the exit code and residual stdout or stderr line arrays needed after response payload construction, omitting duplicate text and count fields to reduce token cost. The interface is compile-time only and introduces no runtime cost.
|
|
942
941
|
|
|
943
|
-
### iface `export interface StructuredToolExecuteResult<T>` (
|
|
942
|
+
### iface `export interface StructuredToolExecuteResult<T>` (L28-31)
|
|
944
943
|
- @brief Describes the standard execute return wrapper used by structured agent tools.
|
|
945
944
|
- @details Mirrors the same JSON payload into both the text content channel and the machine-readable details channel so agents can consume stable fields without reparsing ad-hoc prose. The interface is compile-time only and introduces no runtime cost.
|
|
946
945
|
|
|
947
|
-
### iface `export interface PathQueryToolPayload` (
|
|
946
|
+
### iface `export interface PathQueryToolPayload` (L37-43)
|
|
948
947
|
- @brief Describes the structured payload returned by path-query tools.
|
|
949
|
-
- @details Exposes the
|
|
948
|
+
- @details Exposes only the resolved path facts that can differ at runtime plus residual execution diagnostics, omitting caller-known request echoes and duplicated runtime-path inventories. The interface is compile-time only and introduces no runtime cost.
|
|
950
949
|
|
|
951
|
-
### iface `export interface GitCheckToolPayload` (
|
|
950
|
+
### iface `export interface GitCheckToolPayload` (L49-56)
|
|
952
951
|
- @brief Describes the structured payload returned by `git-check`.
|
|
953
|
-
- @details Exposes git-
|
|
952
|
+
- @details Exposes only the runtime git-path presence fact plus aggregate repository validation status, omitting intermediate request metadata whose semantics already live in the tool registration. The interface is compile-time only and introduces no runtime cost.
|
|
954
953
|
|
|
955
|
-
### iface `export interface DocsCheckFileRecord` (
|
|
954
|
+
### iface `export interface DocsCheckFileRecord` (L62-67)
|
|
956
955
|
- @brief Describes one canonical-doc status record returned by `docs-check`.
|
|
957
|
-
- @details
|
|
956
|
+
- @details Stores the canonical path, remediation prompt command, and presence status while omitting redundant filesystem probe fields already summarized by the status value. The interface is compile-time only and introduces no runtime cost.
|
|
958
957
|
|
|
959
|
-
### iface `export interface DocsCheckToolPayload` (
|
|
958
|
+
### iface `export interface DocsCheckToolPayload` (L73-80)
|
|
960
959
|
- @brief Describes the structured payload returned by `docs-check`.
|
|
961
|
-
- @details Exposes
|
|
960
|
+
- @details Exposes per-document presence facts and remediation commands plus residual execution diagnostics, omitting static request metadata that can be inferred from the tool registration and caller context. The interface is compile-time only and introduces no runtime cost.
|
|
962
961
|
|
|
963
|
-
### iface `export interface WorktreeNameToolPayload` (
|
|
962
|
+
### iface `export interface WorktreeNameToolPayload` (L86-92)
|
|
964
963
|
- @brief Describes the structured payload returned by `git-wt-name`.
|
|
965
|
-
- @details Exposes the generated worktree name,
|
|
964
|
+
- @details Exposes only the generated worktree name plus residual execution diagnostics, omitting the static normative format string because it already belongs in registration metadata. The interface is compile-time only and introduces no runtime cost.
|
|
966
965
|
|
|
967
|
-
### iface `export interface WorktreeMutationToolPayload` (
|
|
966
|
+
### iface `export interface WorktreeMutationToolPayload` (L98-105)
|
|
968
967
|
- @brief Describes the structured payload returned by worktree mutation tools.
|
|
969
|
-
- @details Exposes the
|
|
968
|
+
- @details Exposes only the exact worktree name and derived path that can vary per invocation plus residual execution diagnostics, omitting static operation descriptors and duplicated branch-name fields. The interface is compile-time only and introduces no runtime cost.
|
|
970
969
|
|
|
971
|
-
### iface `export interface StaticCheckFileRecord` (
|
|
970
|
+
### iface `export interface StaticCheckFileRecord` (L111-117)
|
|
972
971
|
- @brief Describes one file-selection record inside a static-check payload.
|
|
973
|
-
- @details Exposes
|
|
972
|
+
- @details Exposes canonical path, detected language, configured checker modules, and stable selection status without echoing caller inputs or redundant filesystem probe fields. The interface is compile-time only and introduces no runtime cost.
|
|
974
973
|
|
|
975
|
-
### iface `export interface StaticCheckToolPayload` (
|
|
974
|
+
### iface `export interface StaticCheckToolPayload` (L123-133)
|
|
976
975
|
- @brief Describes the structured payload returned by static-check agent tools.
|
|
977
|
-
- @details Exposes
|
|
976
|
+
- @details Exposes aggregate checker coverage, per-file selection facts, and normalized execution diagnostics while omitting request echoes whose semantics are already available in the tool registration and input parameters. The interface is compile-time only and introduces no runtime cost.
|
|
978
977
|
|
|
979
|
-
### fn `function formatJsonToolPayload(payload: unknown): string` (
|
|
978
|
+
### fn `function formatJsonToolPayload(payload: unknown): string` (L141-143)
|
|
980
979
|
- @brief Serializes one structured payload as pretty-printed JSON.
|
|
981
980
|
- @details Uses two-space indentation and omits a trailing newline so the mirrored text payload remains deterministic and compact. Runtime is O(n) in payload size. No external state is mutated.
|
|
982
981
|
- @param[in] payload {unknown} Structured JSON-compatible payload.
|
|
983
982
|
- @return {string} Pretty-printed JSON text.
|
|
984
983
|
|
|
985
|
-
### fn `function splitToolOutputLines(text: string): string[]` (
|
|
984
|
+
### fn `function splitToolOutputLines(text: string): string[]` (L151-154)
|
|
986
985
|
- @brief Splits one stdout or stderr text block into normalized non-empty lines.
|
|
987
986
|
- @details Trims trailing newlines, preserves internal line order, and omits empty records so downstream agents can branch on stable arrays without reparsing blank output. Runtime is O(n) in text length. No external state is mutated.
|
|
988
987
|
- @param[in] text {string} Raw output text.
|
|
989
988
|
- @return {string[]} Normalized non-empty output lines.
|
|
990
989
|
|
|
991
|
-
### fn `function canonicalizeToolPath(baseDir: string, candidatePath: string): string` (
|
|
990
|
+
### fn `function canonicalizeToolPath(baseDir: string, candidatePath: string): string` (L163-170)
|
|
992
991
|
- @brief Normalizes one path into a canonical slash-separated form relative to the project base when possible.
|
|
993
992
|
- @details Resolves the candidate against the provided base, emits a relative path for in-project targets, and falls back to an absolute slash-normalized path for external targets. Runtime is O(p) in path length. No external state is mutated.
|
|
994
993
|
- @param[in] baseDir {string} Absolute project base path.
|
|
995
994
|
- @param[in] candidatePath {string} Relative or absolute path candidate.
|
|
996
995
|
- @return {string} Canonical slash-normalized path.
|
|
997
996
|
|
|
998
|
-
- fn `export function buildStructuredToolExecuteResult<T extends { execution: ToolExecutionSection }>(` (
|
|
997
|
+
- fn `export function buildStructuredToolExecuteResult<T extends { execution: ToolExecutionSection }>(` (L178)
|
|
999
998
|
- @brief Converts one structured tool payload into the standard execute wrapper.
|
|
1000
999
|
- @details Mirrors the same payload into `content[0].text` and `details` so agents can use direct JSON fields or raw JSON text interchangeably without divergence. Runtime is O(n) in payload size. No external state is mutated.
|
|
1001
1000
|
- @param[in] payload {T} Structured payload containing an `execution` section.
|
|
1002
1001
|
- @return {StructuredToolExecuteResult<T>} Standard execute wrapper with mirrored payload.
|
|
1003
|
-
### fn `export function buildToolExecutionSection(result: ToolResult): ToolExecutionSection` (
|
|
1002
|
+
### fn `export function buildToolExecutionSection(result: ToolResult): ToolExecutionSection` (L193-203)
|
|
1004
1003
|
- @brief Converts one raw `ToolResult` into a normalized execution section.
|
|
1005
|
-
- @details
|
|
1004
|
+
- @details Preserves only the exit code plus non-empty stdout or stderr line arrays so downstream payloads carry residual diagnostics without duplicating the primary structured response body. Runtime is O(n) in output size. No external state is mutated.
|
|
1006
1005
|
- @param[in] result {ToolResult} Raw tool result.
|
|
1007
|
-
- @return {ToolExecutionSection} Normalized execution metadata.
|
|
1006
|
+
- @return {ToolExecutionSection} Normalized residual execution metadata.
|
|
1008
1007
|
|
|
1009
|
-
### fn `export function normalizeToolFailure(error: unknown): ToolResult` (
|
|
1008
|
+
### fn `export function normalizeToolFailure(error: unknown): ToolResult` (L212-221)
|
|
1010
1009
|
- @brief Converts one `ReqError` into a synthetic `ToolResult` for structured payload emission.
|
|
1011
1010
|
- @details Preserves the numeric exit code and message in stderr so agent tools can return deterministic JSON even when the underlying runner fails. Non-`ReqError` values are rethrown. Runtime is O(1). No external state is mutated.
|
|
1012
1011
|
- @param[in] error {unknown} Thrown value captured from a runner.
|
|
1013
1012
|
- @return {ToolResult} Synthetic tool result with empty stdout.
|
|
1014
1013
|
- @throws {unknown} Rethrows non-`ReqError` failures unchanged.
|
|
1015
1014
|
|
|
1016
|
-
### fn `export function buildPathQueryToolPayload(` (
|
|
1015
|
+
### fn `export function buildPathQueryToolPayload(` (L233-250)
|
|
1017
1016
|
- @brief Builds the structured payload returned by `git-path` or `get-base-path`.
|
|
1018
|
-
- @details Exposes the resolved runtime path value
|
|
1017
|
+
- @details Exposes only the resolved runtime path value plus residual execution metadata, omitting request echoes and duplicated runtime-path inventories from the runtime payload. Runtime is O(p) in path length. No external state is mutated.
|
|
1019
1018
|
- @param[in] toolName {"git-path" | "get-base-path"} Target tool name.
|
|
1020
1019
|
- @param[in] workingDirectoryPath {string} Caller working directory.
|
|
1021
1020
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1022
1021
|
- @param[in] resolvedPath {string} Resolved config path value.
|
|
1023
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1024
1022
|
- @param[in] execution {ToolExecutionSection} Normalized execution metadata.
|
|
1025
1023
|
- @return {PathQueryToolPayload} Structured path-query payload.
|
|
1026
1024
|
|
|
1027
|
-
### fn `export function buildGitCheckToolPayload(` (
|
|
1025
|
+
### fn `export function buildGitCheckToolPayload(` (L260-275)
|
|
1028
1026
|
- @brief Builds the structured payload returned by `git-check`.
|
|
1029
|
-
- @details Encodes runtime git-
|
|
1027
|
+
- @details Encodes runtime git-path presence plus aggregate clean-versus-error status while preserving raw diagnostics under execution. Runtime is O(p) in path length. No external state is mutated.
|
|
1030
1028
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1031
1029
|
- @param[in] configuredGitPath {string | undefined} Runtime git root path.
|
|
1032
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1033
1030
|
- @param[in] execution {ToolExecutionSection} Normalized execution metadata.
|
|
1034
1031
|
- @return {GitCheckToolPayload} Structured git-check payload.
|
|
1035
1032
|
|
|
1036
|
-
### fn `export function buildDocsCheckToolPayload(` (
|
|
1033
|
+
### fn `export function buildDocsCheckToolPayload(` (L284-321)
|
|
1037
1034
|
- @brief Builds the structured payload returned by `docs-check`.
|
|
1038
|
-
- @details Enumerates required canonical documents, binds each missing file to its remediation prompt command, and emits summary counts plus
|
|
1035
|
+
- @details Enumerates required canonical documents, binds each missing file to its remediation prompt command, and emits summary counts plus residual execution diagnostics while omitting static request metadata. Runtime is O(k) in required file count plus filesystem reads. Side effects are limited to filesystem reads.
|
|
1039
1036
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1040
1037
|
- @param[in] docsDirPath {string} Configured docs directory relative to the project base.
|
|
1041
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1042
1038
|
- @return {DocsCheckToolPayload} Structured docs-check payload.
|
|
1043
1039
|
|
|
1044
|
-
### fn `export function buildWorktreeNameToolPayload(` (
|
|
1040
|
+
### fn `export function buildWorktreeNameToolPayload(` (L331-346)
|
|
1045
1041
|
- @brief Builds the structured payload returned by `git-wt-name`.
|
|
1046
|
-
- @details Preserves the generated worktree name
|
|
1042
|
+
- @details Preserves only the generated worktree name and error diagnostics, leaving the static naming format in registration metadata instead of the runtime payload. Runtime is O(n) in output size. No external state is mutated.
|
|
1047
1043
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1048
1044
|
- @param[in] configuredGitPath {string | undefined} Runtime git root path.
|
|
1049
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1050
1045
|
- @param[in] execution {ToolExecutionSection} Normalized execution metadata.
|
|
1051
1046
|
- @return {WorktreeNameToolPayload} Structured worktree-name payload.
|
|
1052
1047
|
|
|
1053
|
-
### fn `export function buildWorktreeMutationToolPayload(` (
|
|
1048
|
+
### fn `export function buildWorktreeMutationToolPayload(` (L358-379)
|
|
1054
1049
|
- @brief Builds the structured payload returned by `git-wt-create` or `git-wt-delete`.
|
|
1055
|
-
- @details Exposes the
|
|
1050
|
+
- @details Exposes only the exact worktree name, derived worktree path, and error diagnostics, omitting static operation and branch-name echoes from the runtime payload. Runtime is O(p) in path length. No external state is mutated.
|
|
1056
1051
|
- @param[in] toolName {"git-wt-create" | "git-wt-delete"} Target tool name.
|
|
1057
1052
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1058
1053
|
- @param[in] configuredGitPath {string | undefined} Runtime git root path.
|
|
1059
1054
|
- @param[in] worktreeName {string} Exact requested worktree name.
|
|
1060
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1061
1055
|
- @param[in] execution {ToolExecutionSection} Normalized execution metadata.
|
|
1062
1056
|
- @return {WorktreeMutationToolPayload} Structured worktree mutation payload.
|
|
1063
1057
|
|
|
1064
|
-
### fn `function buildStaticCheckFileRecord(` (
|
|
1058
|
+
### fn `function buildStaticCheckFileRecord(` (L390-424)
|
|
1065
1059
|
- @brief Builds one static-check file-selection record.
|
|
1066
|
-
- @details Resolves filesystem status, detects the configured language by file extension,
|
|
1060
|
+
- @details Resolves filesystem status, detects the configured language by file extension, and emits the configured checker modules plus a stable selection status without echoing caller inputs or redundant filesystem facts. Runtime is O(p + c) in path length plus configured checker count. Side effects are limited to filesystem reads.
|
|
1067
1061
|
- @param[in] inputPath {string} Caller-supplied file path.
|
|
1068
1062
|
- @param[in] requestIndex {number} Zero-based request position.
|
|
1069
1063
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
1070
1064
|
- @param[in] staticCheckConfig {Record<string, StaticCheckEntry[]>} Effective static-check configuration.
|
|
1071
1065
|
- @return {StaticCheckFileRecord} Structured file-selection record.
|
|
1072
1066
|
|
|
1073
|
-
### fn `export function buildStaticCheckToolPayload(` (
|
|
1067
|
+
### fn `export function buildStaticCheckToolPayload(` (L439-470)
|
|
1074
1068
|
- @brief Builds the structured payload returned by `files-static-check` or `static-check`.
|
|
1075
|
-
- @details Exposes configured checker coverage, per-file selection facts, and normalized execution diagnostics while
|
|
1069
|
+
- @details Exposes configured checker coverage, per-file selection facts, and normalized execution diagnostics while omitting request echoes whose semantics already live in registration metadata. Runtime is O(F + C). Side effects are limited to filesystem reads.
|
|
1076
1070
|
- @param[in] toolName {"files-static-check" | "static-check"} Target tool name.
|
|
1077
1071
|
- @param[in] scope {"explicit-files" | "configured-source-and-test-directories"} Selection scope label.
|
|
1078
1072
|
- @param[in] projectBasePath {string} Resolved project base path.
|
|
@@ -1080,36 +1074,35 @@ import type { ToolResult } from "./tool-runner.js";
|
|
|
1080
1074
|
- @param[in] selectionDirectoryPaths {string[]} Directories that produced the selection.
|
|
1081
1075
|
- @param[in] excludedDirectoryPaths {string[]} Directory roots excluded from project selection.
|
|
1082
1076
|
- @param[in] staticCheckConfig {Record<string, StaticCheckEntry[]>} Effective static-check configuration.
|
|
1083
|
-
- @param[in] runtimePaths {RuntimePathFacts} Shared runtime path facts.
|
|
1084
1077
|
- @param[in] execution {ToolExecutionSection} Normalized execution metadata.
|
|
1085
1078
|
- @return {StaticCheckToolPayload} Structured static-check payload.
|
|
1086
1079
|
|
|
1087
1080
|
## Symbol Index
|
|
1088
1081
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
1089
1082
|
|---|---|---|---|---|
|
|
1090
|
-
|`ToolExecutionSection`|iface||
|
|
1091
|
-
|`StructuredToolExecuteResult`|iface||
|
|
1092
|
-
|`PathQueryToolPayload`|iface||
|
|
1093
|
-
|`GitCheckToolPayload`|iface||
|
|
1094
|
-
|`DocsCheckFileRecord`|iface||
|
|
1095
|
-
|`DocsCheckToolPayload`|iface||
|
|
1096
|
-
|`WorktreeNameToolPayload`|iface||
|
|
1097
|
-
|`WorktreeMutationToolPayload`|iface||
|
|
1098
|
-
|`StaticCheckFileRecord`|iface||
|
|
1099
|
-
|`StaticCheckToolPayload`|iface||
|
|
1100
|
-
|`formatJsonToolPayload`|fn||
|
|
1101
|
-
|`splitToolOutputLines`|fn||
|
|
1102
|
-
|`canonicalizeToolPath`|fn||
|
|
1103
|
-
|`buildStructuredToolExecuteResult`|fn||
|
|
1104
|
-
|`buildToolExecutionSection`|fn||
|
|
1105
|
-
|`normalizeToolFailure`|fn||
|
|
1106
|
-
|`buildPathQueryToolPayload`|fn||
|
|
1107
|
-
|`buildGitCheckToolPayload`|fn||
|
|
1108
|
-
|`buildDocsCheckToolPayload`|fn||
|
|
1109
|
-
|`buildWorktreeNameToolPayload`|fn||
|
|
1110
|
-
|`buildWorktreeMutationToolPayload`|fn||
|
|
1111
|
-
|`buildStaticCheckFileRecord`|fn||
|
|
1112
|
-
|`buildStaticCheckToolPayload`|fn||
|
|
1083
|
+
|`ToolExecutionSection`|iface||18-22|export interface ToolExecutionSection|
|
|
1084
|
+
|`StructuredToolExecuteResult`|iface||28-31|export interface StructuredToolExecuteResult<T>|
|
|
1085
|
+
|`PathQueryToolPayload`|iface||37-43|export interface PathQueryToolPayload|
|
|
1086
|
+
|`GitCheckToolPayload`|iface||49-56|export interface GitCheckToolPayload|
|
|
1087
|
+
|`DocsCheckFileRecord`|iface||62-67|export interface DocsCheckFileRecord|
|
|
1088
|
+
|`DocsCheckToolPayload`|iface||73-80|export interface DocsCheckToolPayload|
|
|
1089
|
+
|`WorktreeNameToolPayload`|iface||86-92|export interface WorktreeNameToolPayload|
|
|
1090
|
+
|`WorktreeMutationToolPayload`|iface||98-105|export interface WorktreeMutationToolPayload|
|
|
1091
|
+
|`StaticCheckFileRecord`|iface||111-117|export interface StaticCheckFileRecord|
|
|
1092
|
+
|`StaticCheckToolPayload`|iface||123-133|export interface StaticCheckToolPayload|
|
|
1093
|
+
|`formatJsonToolPayload`|fn||141-143|function formatJsonToolPayload(payload: unknown): string|
|
|
1094
|
+
|`splitToolOutputLines`|fn||151-154|function splitToolOutputLines(text: string): string[]|
|
|
1095
|
+
|`canonicalizeToolPath`|fn||163-170|function canonicalizeToolPath(baseDir: string, candidateP...|
|
|
1096
|
+
|`buildStructuredToolExecuteResult`|fn||178|export function buildStructuredToolExecuteResult<T extend...|
|
|
1097
|
+
|`buildToolExecutionSection`|fn||193-203|export function buildToolExecutionSection(result: ToolRes...|
|
|
1098
|
+
|`normalizeToolFailure`|fn||212-221|export function normalizeToolFailure(error: unknown): Too...|
|
|
1099
|
+
|`buildPathQueryToolPayload`|fn||233-250|export function buildPathQueryToolPayload(|
|
|
1100
|
+
|`buildGitCheckToolPayload`|fn||260-275|export function buildGitCheckToolPayload(|
|
|
1101
|
+
|`buildDocsCheckToolPayload`|fn||284-321|export function buildDocsCheckToolPayload(|
|
|
1102
|
+
|`buildWorktreeNameToolPayload`|fn||331-346|export function buildWorktreeNameToolPayload(|
|
|
1103
|
+
|`buildWorktreeMutationToolPayload`|fn||358-379|export function buildWorktreeMutationToolPayload(|
|
|
1104
|
+
|`buildStaticCheckFileRecord`|fn||390-424|function buildStaticCheckFileRecord(|
|
|
1105
|
+
|`buildStaticCheckToolPayload`|fn||439-470|export function buildStaticCheckToolPayload(|
|
|
1113
1106
|
|
|
1114
1107
|
|
|
1115
1108
|
---
|
|
@@ -1154,7 +1147,7 @@ import { compressFileDetailed, detectLanguage } from "./compress.js";
|
|
|
1154
1147
|
|
|
1155
1148
|
---
|
|
1156
1149
|
|
|
1157
|
-
# compress-payload.ts | TypeScript |
|
|
1150
|
+
# compress-payload.ts | TypeScript | 640L | 22 symbols | 5 imports | 23 comments
|
|
1158
1151
|
> Path: `src/core/compress-payload.ts`
|
|
1159
1152
|
- @brief Builds agent-oriented JSON payloads for `files-compress` and `compress`.
|
|
1160
1153
|
- @details Converts compression results into deterministic JSON sections ordered for LLM traversal, including request metadata, repository scope, structured file metrics, structured compressed lines, symbols, and Doxygen fields. Runtime is O(F log F + S) where F is file count and S is total source size. Side effects are limited to filesystem reads and optional stderr logging.
|
|
@@ -1210,48 +1203,48 @@ import {
|
|
|
1210
1203
|
- @brief Describes the repository section of the compression payload.
|
|
1211
1204
|
- @details Stores the base path, configured source-directory scope, and canonical file list used during compression. The interface is compile-time only and introduces no runtime cost.
|
|
1212
1205
|
|
|
1213
|
-
### iface `export interface CompressToolPayload` (L170-
|
|
1206
|
+
### iface `export interface CompressToolPayload` (L170-174)
|
|
1214
1207
|
- @brief Describes the full agent-oriented compression payload.
|
|
1215
|
-
- @details
|
|
1208
|
+
- @details Exposes only aggregate compression totals, repository scope, and per-file compression records, omitting request echoes that are already known to the caller or encoded in tool registration metadata. The interface is compile-time only and introduces no runtime cost.
|
|
1216
1209
|
|
|
1217
|
-
### iface `export interface BuildCompressToolPayloadOptions` (
|
|
1210
|
+
### iface `export interface BuildCompressToolPayloadOptions` (L180-188)
|
|
1218
1211
|
- @brief Describes the options required to build one compression payload.
|
|
1219
1212
|
- @details Supplies tool identity, scope, base directory, requested paths, line-number mode, and optional configured source directories while keeping payload construction deterministic. The interface is compile-time only and introduces no runtime cost.
|
|
1220
1213
|
|
|
1221
|
-
### fn `function canonicalizeCompressionPath(targetPath: string, baseDir: string): string` (
|
|
1214
|
+
### fn `function canonicalizeCompressionPath(targetPath: string, baseDir: string): string` (L197-205)
|
|
1222
1215
|
- @brief Canonicalizes one filesystem path relative to the payload base directory.
|
|
1223
1216
|
- @details Emits a slash-normalized relative path when the target is under the base directory; otherwise emits the normalized absolute path. Runtime is O(p) in path length. No side effects occur.
|
|
1224
1217
|
- @param[in] targetPath {string} Absolute or relative filesystem path.
|
|
1225
1218
|
- @param[in] baseDir {string} Base directory used for relative canonicalization.
|
|
1226
1219
|
- @return {string} Canonicalized path string.
|
|
1227
1220
|
|
|
1228
|
-
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): CompressLineRange` (
|
|
1221
|
+
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): CompressLineRange` (L214-220)
|
|
1229
1222
|
- @brief Builds one structured line-range record.
|
|
1230
1223
|
- @details Duplicates the inclusive range as start, end, and tuple fields so callers can address whichever shape is most convenient. Runtime is O(1). No side effects occur.
|
|
1231
1224
|
- @param[in] startLineNumber {number} Inclusive start line number.
|
|
1232
1225
|
- @param[in] endLineNumber {number} Inclusive end line number.
|
|
1233
1226
|
- @return {CompressLineRange} Structured line-range record.
|
|
1234
1227
|
|
|
1235
|
-
### fn `function resolveSymbolName(element: SourceElement): string` (
|
|
1228
|
+
### fn `function resolveSymbolName(element: SourceElement): string` (L228-230)
|
|
1236
1229
|
- @brief Resolves one stable symbol name from an analyzed element.
|
|
1237
1230
|
- @details Prefers explicit analyzer name metadata, then falls back to the derived signature or the first source line so every symbol retains a direct-access identifier. Runtime is O(1). No side effects occur.
|
|
1238
1231
|
- @param[in] element {SourceElement} Source element.
|
|
1239
1232
|
- @return {string} Stable symbol name.
|
|
1240
1233
|
|
|
1241
|
-
### fn `function resolveParentElement(definitions: SourceElement[], child: SourceElement): SourceElement | undefined` (
|
|
1234
|
+
### fn `function resolveParentElement(definitions: SourceElement[], child: SourceElement): SourceElement | undefined` (L239-248)
|
|
1242
1235
|
- @brief Resolves the direct parent element for one child symbol.
|
|
1243
1236
|
- @details Matches by parent name plus inclusive line containment and chooses the deepest enclosing definition. Runtime is O(n) in definition count. No side effects occur.
|
|
1244
1237
|
- @param[in] definitions {SourceElement[]} Sorted definition elements.
|
|
1245
1238
|
- @param[in] child {SourceElement} Candidate child symbol.
|
|
1246
1239
|
- @return {SourceElement | undefined} Matched parent definition when available.
|
|
1247
1240
|
|
|
1248
|
-
### fn `function mapCompressedLines(compressedLines: CompressedLineEntry[]): CompressToolLineEntry[]` (
|
|
1241
|
+
### fn `function mapCompressedLines(compressedLines: CompressedLineEntry[]): CompressToolLineEntry[]` (L256-263)
|
|
1249
1242
|
- @brief Maps structured compression lines into the payload line-entry contract.
|
|
1250
1243
|
- @details Performs a shallow field copy so the payload remains decoupled from the core compression result type. Runtime is O(n) in compressed line count. No side effects occur.
|
|
1251
1244
|
- @param[in] compressedLines {CompressedLineEntry[]} Structured compression lines.
|
|
1252
1245
|
- @return {CompressToolLineEntry[]} Payload line entries.
|
|
1253
1246
|
|
|
1254
|
-
### fn `function analyzeCompressedFileSymbols(` (
|
|
1247
|
+
### fn `function analyzeCompressedFileSymbols(` (L275-359)
|
|
1255
1248
|
- @brief Builds structured symbol entries for one successfully analyzed file.
|
|
1256
1249
|
- @details Extracts definition elements, computes parent-child relationships, attaches structured Doxygen metadata, and repeats the canonical file path inside each symbol record for direct-access agent indexing. Runtime is O(n log n) in definition count. No side effects occur.
|
|
1257
1250
|
- @param[in] analyzer {SourceAnalyzer} Shared analyzer instance.
|
|
@@ -1261,7 +1254,7 @@ import {
|
|
|
1261
1254
|
- @return {{ languageName: string | undefined; symbols: CompressToolSymbolEntry[]; fileDoxygen: StructuredDoxygenFields | undefined; fileDescriptionText: string | undefined; doxygenFieldCount: number }} Structured symbol-analysis result.
|
|
1262
1255
|
- @throws {Error} Throws when source analysis or enrichment fails.
|
|
1263
1256
|
|
|
1264
|
-
### fn `function analyzeCompressFile(` (
|
|
1257
|
+
### fn `function analyzeCompressFile(` (L373-504)
|
|
1265
1258
|
- @brief Analyzes one path into a structured compression file entry.
|
|
1266
1259
|
- @details Resolves path identity, performs compression, attempts supplementary symbol and Doxygen extraction, preserves stable skip or error reasons, and keeps compression success independent from symbol-analysis success. Runtime is dominated by file I/O and analyzer cost. Side effects are limited to filesystem reads and optional stderr logging.
|
|
1267
1260
|
- @param[in] analyzer {SourceAnalyzer} Shared analyzer instance.
|
|
@@ -1273,14 +1266,14 @@ import {
|
|
|
1273
1266
|
- @param[in] verbose {boolean} When `true`, emit per-file diagnostics to stderr.
|
|
1274
1267
|
- @return {CompressToolFileEntry} Structured file entry.
|
|
1275
1268
|
|
|
1276
|
-
### fn `export function buildCompressToolPayload(options: BuildCompressToolPayloadOptions): CompressToolPayload` (
|
|
1269
|
+
### fn `export function buildCompressToolPayload(options: BuildCompressToolPayloadOptions): CompressToolPayload` (L513-620)
|
|
1277
1270
|
- @brief Builds the full agent-oriented compression payload.
|
|
1278
|
-
- @details Validates requested paths against the filesystem, compresses processable files in caller order, preserves skipped and failed inputs in structured file entries, computes aggregate numeric totals, and emits repository scope metadata. Runtime is O(F log F + S). Side effects are limited to filesystem reads and optional stderr logging.
|
|
1271
|
+
- @details Validates requested paths against the filesystem, compresses processable files in caller order, preserves skipped and failed inputs in structured file entries, computes aggregate numeric totals, and emits repository scope metadata without echoing request facts already known to the caller. Runtime is O(F log F + S). Side effects are limited to filesystem reads and optional stderr logging.
|
|
1279
1272
|
- @param[in] options {BuildCompressToolPayloadOptions} Payload-construction options.
|
|
1280
|
-
- @return {CompressToolPayload} Structured compression payload ordered as
|
|
1273
|
+
- @return {CompressToolPayload} Structured compression payload ordered as summary, repository, and files.
|
|
1281
1274
|
- @satisfies REQ-081, REQ-082, REQ-083, REQ-084, REQ-085, REQ-087
|
|
1282
1275
|
|
|
1283
|
-
### fn `export function buildCompressToolExecutionStderr(payload: CompressToolPayload): string` (
|
|
1276
|
+
### fn `export function buildCompressToolExecutionStderr(payload: CompressToolPayload): string` (L629-640)
|
|
1284
1277
|
- @brief Builds execution diagnostics for one compression payload.
|
|
1285
1278
|
- @details Serializes skipped inputs, hard compression failures, and supplementary symbol-analysis warnings into stable stderr lines while keeping successful compressed files silent. Runtime is O(n) in issue count. No side effects occur.
|
|
1286
1279
|
- @param[in] payload {CompressToolPayload} Structured compression payload.
|
|
@@ -1301,17 +1294,17 @@ import {
|
|
|
1301
1294
|
|`CompressToolRequestSection`|iface||126-136|export interface CompressToolRequestSection|
|
|
1302
1295
|
|`CompressToolSummarySection`|iface||142-153|export interface CompressToolSummarySection|
|
|
1303
1296
|
|`CompressToolRepositorySection`|iface||159-164|export interface CompressToolRepositorySection|
|
|
1304
|
-
|`CompressToolPayload`|iface||170-
|
|
1305
|
-
|`BuildCompressToolPayloadOptions`|iface||
|
|
1306
|
-
|`canonicalizeCompressionPath`|fn||
|
|
1307
|
-
|`buildLineRange`|fn||
|
|
1308
|
-
|`resolveSymbolName`|fn||
|
|
1309
|
-
|`resolveParentElement`|fn||
|
|
1310
|
-
|`mapCompressedLines`|fn||
|
|
1311
|
-
|`analyzeCompressedFileSymbols`|fn||
|
|
1312
|
-
|`analyzeCompressFile`|fn||
|
|
1313
|
-
|`buildCompressToolPayload`|fn||
|
|
1314
|
-
|`buildCompressToolExecutionStderr`|fn||
|
|
1297
|
+
|`CompressToolPayload`|iface||170-174|export interface CompressToolPayload|
|
|
1298
|
+
|`BuildCompressToolPayloadOptions`|iface||180-188|export interface BuildCompressToolPayloadOptions|
|
|
1299
|
+
|`canonicalizeCompressionPath`|fn||197-205|function canonicalizeCompressionPath(targetPath: string, ...|
|
|
1300
|
+
|`buildLineRange`|fn||214-220|function buildLineRange(startLineNumber: number, endLineN...|
|
|
1301
|
+
|`resolveSymbolName`|fn||228-230|function resolveSymbolName(element: SourceElement): string|
|
|
1302
|
+
|`resolveParentElement`|fn||239-248|function resolveParentElement(definitions: SourceElement[...|
|
|
1303
|
+
|`mapCompressedLines`|fn||256-263|function mapCompressedLines(compressedLines: CompressedLi...|
|
|
1304
|
+
|`analyzeCompressedFileSymbols`|fn||275-359|function analyzeCompressedFileSymbols(|
|
|
1305
|
+
|`analyzeCompressFile`|fn||373-504|function analyzeCompressFile(|
|
|
1306
|
+
|`buildCompressToolPayload`|fn||513-620|export function buildCompressToolPayload(options: BuildCo...|
|
|
1307
|
+
|`buildCompressToolExecutionStderr`|fn||629-640|export function buildCompressToolExecutionStderr(payload:...|
|
|
1315
1308
|
|
|
1316
1309
|
|
|
1317
1310
|
---
|
|
@@ -1658,7 +1651,7 @@ import { makeRelativeIfContainsProject } from "./utils.js";
|
|
|
1658
1651
|
|
|
1659
1652
|
---
|
|
1660
1653
|
|
|
1661
|
-
# extension-status.ts | TypeScript |
|
|
1654
|
+
# extension-status.ts | TypeScript | 686L | 32 symbols | 5 imports | 32 comments
|
|
1662
1655
|
> Path: `src/core/extension-status.ts`
|
|
1663
1656
|
- @brief Tracks pi-usereq extension status state and renders status-bar telemetry.
|
|
1664
1657
|
- @details Centralizes hook interception, context-usage snapshots, run timing,
|
|
@@ -1669,10 +1662,11 @@ scheduling through exported controller helpers.
|
|
|
1669
1662
|
|
|
1670
1663
|
## Imports
|
|
1671
1664
|
```
|
|
1665
|
+
import path from "node:path";
|
|
1672
1666
|
import type {
|
|
1673
1667
|
import type { UseReqConfig } from "./config.js";
|
|
1668
|
+
import { normalizePathSlashes } from "./path-context.js";
|
|
1674
1669
|
import { formatPiNotifyBeepStatus } from "./pi-notify.js";
|
|
1675
|
-
import { formatAbsoluteGitPath, formatBasePathRelativeToGitPath, resolveRuntimeGitPath } from "./runtime-project-paths.js";
|
|
1676
1670
|
```
|
|
1677
1671
|
|
|
1678
1672
|
## Definitions
|
|
@@ -1768,19 +1762,19 @@ runtime. Runtime is O(1). Side effect: mutates `state.contextUsage`.
|
|
|
1768
1762
|
- @return {void} No return value.
|
|
1769
1763
|
- @satisfies REQ-118, REQ-119
|
|
1770
1764
|
|
|
1771
|
-
### fn `function countFilledContextCells(` (
|
|
1772
|
-
- @brief Counts the filled cells rendered by the
|
|
1765
|
+
### fn `function countFilledContextCells(` (L277-285)
|
|
1766
|
+
- @brief Counts the filled cells rendered by the 10-cell context bar.
|
|
1773
1767
|
- @details Uses ceiling semantics for positive percentages so any non-zero
|
|
1774
1768
|
usage occupies at least one cell and zero usage occupies none. Runtime is
|
|
1775
1769
|
O(1). No external state is mutated.
|
|
1776
1770
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
1777
|
-
- @return {number} Filled-cell count in the inclusive range `[0,
|
|
1771
|
+
- @return {number} Filled-cell count in the inclusive range `[0, 10]`.
|
|
1778
1772
|
- @satisfies REQ-122
|
|
1779
1773
|
|
|
1780
|
-
### fn `function resolveContextUsageOverlay(` (
|
|
1774
|
+
### fn `function resolveContextUsageOverlay(` (L297-316)
|
|
1781
1775
|
- @brief Resolves the threshold-specific context-bar overlay when required.
|
|
1782
|
-
- @details Returns the empty-state
|
|
1783
|
-
usage is unavailable or non-positive and returns the
|
|
1776
|
+
- @details Returns the empty-state `◀ CLEAR ▶ ` overlay when normalized context
|
|
1777
|
+
usage is unavailable or non-positive and returns the centered ` ◀ FULL ▶ `
|
|
1784
1778
|
overlay with the active theme `error` token when usage exceeds 90 percent.
|
|
1785
1779
|
Runtime is O(1). No external state is mutated.
|
|
1786
1780
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
@@ -1798,8 +1792,8 @@ width. No external state is mutated.
|
|
|
1798
1792
|
- @return {string} Rendered overlay text.
|
|
1799
1793
|
- @satisfies REQ-127, REQ-128
|
|
1800
1794
|
|
|
1801
|
-
### fn `function formatContextUsageBar(` (
|
|
1802
|
-
- @brief Formats one
|
|
1795
|
+
### fn `function formatContextUsageBar(` (L351-363)
|
|
1796
|
+
- @brief Formats one 10-cell context-usage bar.
|
|
1803
1797
|
- @details Renders threshold-specific overlays for empty and high-water states;
|
|
1804
1798
|
otherwise renders filled cells with the theme `warning` token on an
|
|
1805
1799
|
accent-derived background and unfilled cells in `dim` on the same background
|
|
@@ -1807,10 +1801,10 @@ to preserve constant bar width. Runtime is O(1). No external state is
|
|
|
1807
1801
|
mutated.
|
|
1808
1802
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1809
1803
|
- @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
1810
|
-
- @return {string} Rendered
|
|
1804
|
+
- @return {string} Rendered 10-cell bar or overlay.
|
|
1811
1805
|
- @satisfies REQ-121, REQ-122, REQ-126, REQ-127, REQ-128
|
|
1812
1806
|
|
|
1813
|
-
### fn `function formatStatusDuration(durationMs: number): string` (
|
|
1807
|
+
### fn `function formatStatusDuration(durationMs: number): string` (L374-379)
|
|
1814
1808
|
- @brief Formats one elapsed-duration value as `M:SS`.
|
|
1815
1809
|
- @details Floors the input to whole seconds, keeps minutes unbounded above 59,
|
|
1816
1810
|
and zero-pads seconds to two digits. Runtime is O(1). No external state is
|
|
@@ -1819,7 +1813,27 @@ mutated.
|
|
|
1819
1813
|
- @return {string} Duration rendered as `M:SS`.
|
|
1820
1814
|
- @satisfies REQ-125
|
|
1821
1815
|
|
|
1822
|
-
### fn `function
|
|
1816
|
+
### fn `function formatCompletedStatusDuration(` (L390-394)
|
|
1817
|
+
- @brief Formats one optional completed-duration value.
|
|
1818
|
+
- @details Returns the canonical unset placeholder `--:--` until the supplied
|
|
1819
|
+
timer receives a normally completed prompt duration, then delegates to
|
|
1820
|
+
`formatStatusDuration(...)`. Runtime is O(1). No external state is mutated.
|
|
1821
|
+
- @param[in] durationMs {number | undefined} Optional completed-duration value.
|
|
1822
|
+
- @return {string} Rendered duration or unset placeholder.
|
|
1823
|
+
- @satisfies REQ-124
|
|
1824
|
+
|
|
1825
|
+
### fn `function formatElapsedStatusValue(` (L407-417)
|
|
1826
|
+
- @brief Formats the consolidated `elapsed` status-bar value.
|
|
1827
|
+
- @details Emits the active prompt segment `⏱︎ <active>`, the latest normally
|
|
1828
|
+
completed segment `⚑ <last>`, and the accumulated successful-runtime segment
|
|
1829
|
+
`⌛︎ <total>` with fixed spacing. Runtime is O(1). No external state is
|
|
1830
|
+
mutated.
|
|
1831
|
+
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
1832
|
+
- @param[in] nowMs {number} Current wall-clock time in milliseconds.
|
|
1833
|
+
- @return {string} Consolidated `elapsed` field value.
|
|
1834
|
+
- @satisfies REQ-123, REQ-124, REQ-125, REQ-159
|
|
1835
|
+
|
|
1836
|
+
### fn `function formatStatusField(` (L428-434)
|
|
1823
1837
|
- @brief Formats one standard status-bar field.
|
|
1824
1838
|
- @details Renders the field label in accent color and the value in warning
|
|
1825
1839
|
color. Runtime is O(n) in combined text length. No external state is mutated.
|
|
@@ -1847,17 +1861,18 @@ Runtime is O(n) in message count. No external state is mutated.
|
|
|
1847
1861
|
- @return {boolean} `true` when the run ended in aborted state.
|
|
1848
1862
|
- @satisfies REQ-125
|
|
1849
1863
|
|
|
1850
|
-
### fn `function buildPiUsereqStatusText(` (
|
|
1864
|
+
### fn `function buildPiUsereqStatusText(` (L485-507)
|
|
1851
1865
|
- @brief Builds the full single-line pi-usereq status-bar payload.
|
|
1852
|
-
- @details Renders
|
|
1853
|
-
|
|
1866
|
+
- @details Renders base, context, elapsed, beep, and sound fields in the
|
|
1867
|
+
canonical order with dim bullet separators and threshold-specific context-bar
|
|
1868
|
+
overlays. Runtime is O(1). No external state is mutated.
|
|
1869
|
+
- @param[in] cwd {string} Runtime working directory used for base-path derivation.
|
|
1854
1870
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
1855
|
-
- @param[in] activeTools {readonly string[]} Active runtime tool names.
|
|
1856
1871
|
- @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
1857
1872
|
- @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
1858
1873
|
- @param[in] nowMs {number} Current wall-clock time in milliseconds.
|
|
1859
1874
|
- @return {string} Single-line status-bar text.
|
|
1860
|
-
- @satisfies REQ-109, REQ-112, REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-135, REQ-136, REQ-
|
|
1875
|
+
- @satisfies REQ-109, REQ-112, REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-135, REQ-136, REQ-148, REQ-156, REQ-159
|
|
1861
1876
|
|
|
1862
1877
|
### fn `function stopStatusTicker(controller: PiUsereqStatusController): void` (L491-496)
|
|
1863
1878
|
- @brief Stops the live elapsed-time ticker when it is active.
|
|
@@ -1948,15 +1963,17 @@ limited to interval disposal and in-memory state mutation.
|
|
|
1948
1963
|
|`backgroundize`|fn||203-219|const backgroundize = (color: StatusForegroundColor, text...|
|
|
1949
1964
|
|`normalizeContextUsage`|fn||230-247|function normalizeContextUsage(|
|
|
1950
1965
|
|`refreshContextUsage`|fn||259-264|function refreshContextUsage(|
|
|
1951
|
-
|`countFilledContextCells`|fn||
|
|
1952
|
-
|`resolveContextUsageOverlay`|fn||
|
|
1953
|
-
|`formatContextUsageOverlay`|fn||
|
|
1954
|
-
|`formatContextUsageBar`|fn||
|
|
1955
|
-
|`formatStatusDuration`|fn||
|
|
1956
|
-
|`
|
|
1957
|
-
|`
|
|
1958
|
-
|`
|
|
1959
|
-
|`
|
|
1966
|
+
|`countFilledContextCells`|fn||277-285|function countFilledContextCells(|
|
|
1967
|
+
|`resolveContextUsageOverlay`|fn||297-316|function resolveContextUsageOverlay(|
|
|
1968
|
+
|`formatContextUsageOverlay`|fn||329-337|function formatContextUsageOverlay(|
|
|
1969
|
+
|`formatContextUsageBar`|fn||351-363|function formatContextUsageBar(|
|
|
1970
|
+
|`formatStatusDuration`|fn||374-379|function formatStatusDuration(durationMs: number): string|
|
|
1971
|
+
|`formatCompletedStatusDuration`|fn||390-394|function formatCompletedStatusDuration(|
|
|
1972
|
+
|`formatElapsedStatusValue`|fn||407-417|function formatElapsedStatusValue(|
|
|
1973
|
+
|`formatStatusField`|fn||428-434|function formatStatusField(|
|
|
1974
|
+
|`formatRenderedStatusField`|fn||446-452|function formatRenderedStatusField(|
|
|
1975
|
+
|`didAgentEndAbort`|fn||463-470|function didAgentEndAbort(messages: AgentEndEvent["messag...|
|
|
1976
|
+
|`buildPiUsereqStatusText`|fn||485-507|function buildPiUsereqStatusText(|
|
|
1960
1977
|
|`stopStatusTicker`|fn||491-496|function stopStatusTicker(controller: PiUsereqStatusContr...|
|
|
1961
1978
|
|`syncPiUsereqStatusTicker`|fn||508-524|function syncPiUsereqStatusTicker(|
|
|
1962
1979
|
|`createPiUsereqStatusController`|fn||535-549|export function createPiUsereqStatusController(|
|
|
@@ -2085,7 +2102,7 @@ import { SourceAnalyzer, SourceElement, ElementType } from "./source-analyzer.js
|
|
|
2085
2102
|
|
|
2086
2103
|
---
|
|
2087
2104
|
|
|
2088
|
-
# find-payload.ts | TypeScript |
|
|
2105
|
+
# find-payload.ts | TypeScript | 892L | 31 symbols | 6 imports | 32 comments
|
|
2089
2106
|
> Path: `src/core/find-payload.ts`
|
|
2090
2107
|
- @brief Builds agent-oriented JSON payloads for `files-find` and `find`.
|
|
2091
2108
|
- @details Converts construct-search results into deterministic JSON sections ordered for LLM traversal, including request metadata, repository scope, file statuses, structured matches, structured Doxygen fields, typed line ranges, and normalized stripped code lines. Runtime is O(F log F + S + M) where F is file count, S is analyzed source size, and M is matched construct count. Side effects are limited to filesystem reads and optional stderr logging.
|
|
@@ -2137,87 +2154,82 @@ import {
|
|
|
2137
2154
|
- @brief Describes the request section of the find payload.
|
|
2138
2155
|
- @details Captures tool identity, scope, base directory, line-number mode, tag filter, regex, validation statuses, and requested path inventory so agents can reason about how the search was executed. The interface is compile-time only and introduces no runtime cost.
|
|
2139
2156
|
|
|
2140
|
-
### iface `export interface FindToolSummarySection` (L161-
|
|
2157
|
+
### iface `export interface FindToolSummarySection` (L161-172)
|
|
2141
2158
|
- @brief Describes the summary section of the find payload.
|
|
2142
|
-
- @details Exposes aggregate file, match, line, and Doxygen counts as numeric fields plus one stable search-status discriminator. The interface is compile-time only and introduces no runtime cost.
|
|
2159
|
+
- @details Exposes aggregate file, match, line, and Doxygen counts as numeric fields plus one stable search-status discriminator and the normalized validation error when request parsing fails. The interface is compile-time only and introduces no runtime cost.
|
|
2143
2160
|
|
|
2144
|
-
### iface `export interface FindToolRepositorySection` (
|
|
2161
|
+
### iface `export interface FindToolRepositorySection` (L178-183)
|
|
2145
2162
|
- @brief Describes the repository section of the find payload.
|
|
2146
|
-
- @details Stores the base path, configured source-directory scope, canonical file list
|
|
2163
|
+
- @details Stores the base path, configured source-directory scope, and canonical file list used during search while omitting the static supported-tag matrix because that data belongs in tool registration metadata. The interface is compile-time only and introduces no runtime cost.
|
|
2147
2164
|
|
|
2148
|
-
### iface `export interface FindToolPayload` (L189-
|
|
2165
|
+
### iface `export interface FindToolPayload` (L189-193)
|
|
2149
2166
|
- @brief Describes the full agent-oriented find payload.
|
|
2150
|
-
- @details
|
|
2167
|
+
- @details Exposes only aggregate search totals, repository scope, and per-file match records, omitting request echoes and static supported-tag matrices that already belong in registration metadata. The interface is compile-time only and introduces no runtime cost.
|
|
2151
2168
|
|
|
2152
|
-
### iface `export interface BuildFindToolPayloadOptions` (
|
|
2169
|
+
### iface `export interface BuildFindToolPayloadOptions` (L199-209)
|
|
2153
2170
|
- @brief Describes the options required to build one find payload.
|
|
2154
2171
|
- @details Supplies tool identity, scope, base directory, tag filter, regex, requested paths, line-number mode, and optional configured source directories while keeping payload construction deterministic. The interface is compile-time only and introduces no runtime cost.
|
|
2155
2172
|
|
|
2156
|
-
### iface `interface ValidatedRegex` (
|
|
2173
|
+
### iface `interface ValidatedRegex` (L215-219)
|
|
2157
2174
|
- @brief Describes the result of validating one regex pattern.
|
|
2158
2175
|
- @details Separates valid compiled regex instances from invalid user input while preserving a stable machine-readable status and error message. The interface is compile-time only and introduces no runtime cost.
|
|
2159
2176
|
|
|
2160
|
-
### iface `interface ValidatedTagFilter` (
|
|
2177
|
+
### iface `interface ValidatedTagFilter` (L225-230)
|
|
2161
2178
|
- @brief Describes the result of validating one tag filter.
|
|
2162
2179
|
- @details Separates normalized tag values from invalid or empty filters while preserving a stable status and error message. The interface is compile-time only and introduces no runtime cost.
|
|
2163
2180
|
|
|
2164
|
-
### fn `function canonicalizeFindPath(targetPath: string, baseDir: string): string` (
|
|
2181
|
+
### fn `function canonicalizeFindPath(targetPath: string, baseDir: string): string` (L239-247)
|
|
2165
2182
|
- @brief Canonicalizes one filesystem path relative to the payload base directory.
|
|
2166
2183
|
- @details Emits a slash-normalized relative path when the target is under the base directory; otherwise emits the normalized absolute path. Runtime is O(p) in path length. No side effects occur.
|
|
2167
2184
|
- @param[in] targetPath {string} Absolute or relative filesystem path.
|
|
2168
2185
|
- @param[in] baseDir {string} Base directory used for relative canonicalization.
|
|
2169
2186
|
- @return {string} Canonicalized path string.
|
|
2170
2187
|
|
|
2171
|
-
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): FindLineRange` (
|
|
2188
|
+
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): FindLineRange` (L256-262)
|
|
2172
2189
|
- @brief Builds one structured line-range record.
|
|
2173
2190
|
- @details Duplicates the inclusive range as start, end, and tuple fields so callers can address whichever shape is most convenient. Runtime is O(1). No side effects occur.
|
|
2174
2191
|
- @param[in] startLineNumber {number} Inclusive start line number.
|
|
2175
2192
|
- @param[in] endLineNumber {number} Inclusive end line number.
|
|
2176
2193
|
- @return {FindLineRange} Structured line-range record.
|
|
2177
2194
|
|
|
2178
|
-
### fn `function
|
|
2179
|
-
- @brief Returns the supported-tag matrix ordered for deterministic JSON emission.
|
|
2180
|
-
- @details Sorts languages alphabetically and tag arrays lexicographically so downstream agents can reuse the matrix without reparsing human prose. Runtime is O(l * t log t). No side effects occur.
|
|
2181
|
-
- @return {Record<string, string[]>} Supported tags keyed by canonical language identifier.
|
|
2182
|
-
|
|
2183
|
-
### fn `function resolveSymbolName(element: SourceElement): string` (L284-286)
|
|
2195
|
+
### fn `function resolveSymbolName(element: SourceElement): string` (L270-272)
|
|
2184
2196
|
- @brief Resolves one stable symbol name from an analyzed element.
|
|
2185
2197
|
- @details Prefers explicit analyzer name metadata, then falls back to the derived signature or the first source line so every matched construct retains a direct-access identifier. Runtime is O(1). No side effects occur.
|
|
2186
2198
|
- @param[in] element {SourceElement} Source element.
|
|
2187
2199
|
- @return {string} Stable symbol name.
|
|
2188
2200
|
|
|
2189
|
-
### fn `function resolveParentElement(definitions: SourceElement[], element: SourceElement): SourceElement | undefined` (
|
|
2201
|
+
### fn `function resolveParentElement(definitions: SourceElement[], element: SourceElement): SourceElement | undefined` (L281-290)
|
|
2190
2202
|
- @brief Resolves the direct parent definition for one source element.
|
|
2191
2203
|
- @details Matches by parent name plus inclusive line containment and chooses the deepest enclosing definition. Runtime is O(n) in definition count. No side effects occur.
|
|
2192
2204
|
- @param[in] definitions {SourceElement[]} Sorted definition elements.
|
|
2193
2205
|
- @param[in] element {SourceElement} Candidate child element.
|
|
2194
2206
|
- @return {SourceElement | undefined} Matched parent definition when available.
|
|
2195
2207
|
|
|
2196
|
-
### fn `function mapCodeLines(lineEntries: StrippedConstructLineEntry[]): FindToolCodeLineEntry[]` (
|
|
2208
|
+
### fn `function mapCodeLines(lineEntries: StrippedConstructLineEntry[]): FindToolCodeLineEntry[]` (L298-305)
|
|
2197
2209
|
- @brief Converts stripped-code line entries into the payload line-entry contract.
|
|
2198
2210
|
- @details Performs a shallow field copy so the payload remains decoupled from the lower-level strip helper type. Runtime is O(n) in stripped line count. No side effects occur.
|
|
2199
2211
|
- @param[in] lineEntries {StrippedConstructLineEntry[]} Normalized stripped-code line entries.
|
|
2200
2212
|
- @return {FindToolCodeLineEntry[]} Payload line entries.
|
|
2201
2213
|
|
|
2202
|
-
### fn `function buildStrippedSourceText(lineEntries: FindToolCodeLineEntry[]): string | undefined` (
|
|
2214
|
+
### fn `function buildStrippedSourceText(lineEntries: FindToolCodeLineEntry[]): string | undefined` (L313-318)
|
|
2203
2215
|
- @brief Joins stripped-code line entries into one optional monolithic text field.
|
|
2204
2216
|
- @details Preserves rendered display strings in line order so agents that need a contiguous excerpt can read one field without losing access to the structured line array. Runtime is O(n) in stripped line count. No side effects occur.
|
|
2205
2217
|
- @param[in] lineEntries {FindToolCodeLineEntry[]} Structured stripped-code line entries.
|
|
2206
2218
|
- @return {string | undefined} Joined stripped-source text, or `undefined` when no lines remain.
|
|
2207
2219
|
|
|
2208
|
-
### fn `function validateTagFilter(tagFilter: string): ValidatedTagFilter` (
|
|
2220
|
+
### fn `function validateTagFilter(tagFilter: string): ValidatedTagFilter` (L326-342)
|
|
2209
2221
|
- @brief Validates and normalizes one tag filter.
|
|
2210
2222
|
- @details Parses the raw pipe-delimited filter, sorts the resulting unique tag values, and marks the filter invalid when no recognized tag remains after normalization. Runtime is O(n log n) in requested tag count. No side effects occur.
|
|
2211
2223
|
- @param[in] tagFilter {string} Raw pipe-delimited tag filter.
|
|
2212
2224
|
- @return {ValidatedTagFilter} Validation result containing the normalized tag set and status.
|
|
2213
2225
|
|
|
2214
|
-
### fn `function validateRegexPattern(pattern: string): ValidatedRegex` (
|
|
2226
|
+
### fn `function validateRegexPattern(pattern: string): ValidatedRegex` (L350-362)
|
|
2215
2227
|
- @brief Validates and compiles one construct-name regex pattern.
|
|
2216
2228
|
- @details Uses the JavaScript `RegExp` engine with search-style `.test(...)` evaluation and records a stable error message when compilation fails. Runtime is O(n) in pattern length. No side effects occur.
|
|
2217
2229
|
- @param[in] pattern {string} Raw user pattern.
|
|
2218
2230
|
- @return {ValidatedRegex} Validation result containing the compiled regex when valid.
|
|
2219
2231
|
|
|
2220
|
-
### fn `function elementMatches(element: SourceElement, tagSet: Set<string>, regex: RegExp): boolean` (
|
|
2232
|
+
### fn `function elementMatches(element: SourceElement, tagSet: Set<string>, regex: RegExp): boolean` (L372-380)
|
|
2221
2233
|
- @brief Tests whether one element matches a validated tag filter and regex.
|
|
2222
2234
|
- @details Rejects unnamed elements and elements outside the requested tag set before applying the precompiled regex to the construct name. Runtime is O(1) plus regex evaluation. No side effects occur.
|
|
2223
2235
|
- @param[in] element {SourceElement} Candidate source element.
|
|
@@ -2225,13 +2237,13 @@ import {
|
|
|
2225
2237
|
- @param[in] regex {RegExp} Precompiled construct-name regex.
|
|
2226
2238
|
- @return {boolean} `true` when the element matches both filters.
|
|
2227
2239
|
|
|
2228
|
-
### fn `function countLogicalLines(fileContent: string): number` (
|
|
2240
|
+
### fn `function countLogicalLines(fileContent: string): number` (L388-393)
|
|
2229
2241
|
- @brief Counts logical source lines from one file content string.
|
|
2230
2242
|
- @details Preserves the repository's line-count convention that excludes the terminal empty split produced by trailing newlines. Runtime is O(n) in content length. No side effects occur.
|
|
2231
2243
|
- @param[in] fileContent {string} Raw file content.
|
|
2232
2244
|
- @return {number} Logical source-line count.
|
|
2233
2245
|
|
|
2234
|
-
### fn `function buildSkippedFileEntry(` (
|
|
2246
|
+
### fn `function buildSkippedFileEntry(` (L408-443)
|
|
2235
2247
|
- @brief Builds one skipped file entry for a request path.
|
|
2236
2248
|
- @details Preserves path identity, filesystem status, language metadata when detectable, supported tags for the language, and a stable skip reason without attempting search analysis. Runtime is O(t) in supported-tag count. No side effects occur.
|
|
2237
2249
|
- @param[in] inputPath {string} Caller-supplied path.
|
|
@@ -2244,7 +2256,7 @@ import {
|
|
|
2244
2256
|
- @param[in] isFile {boolean} Filesystem file-kind flag.
|
|
2245
2257
|
- @return {FindToolFileEntry} Structured skipped file entry.
|
|
2246
2258
|
|
|
2247
|
-
### fn `function buildMatchEntry(` (
|
|
2259
|
+
### fn `function buildMatchEntry(` (L457-500)
|
|
2248
2260
|
- @brief Builds one matched construct entry from an analyzed element.
|
|
2249
2261
|
- @details Resolves symbol identity, hierarchy hints, structured Doxygen fields, numeric declaration lines, and stripped code excerpts while keeping monolithic source text optional. Runtime is O(n) in construct span length plus Doxygen size. No side effects occur.
|
|
2250
2262
|
- @param[in] element {SourceElement} Matched element.
|
|
@@ -2256,7 +2268,7 @@ import {
|
|
|
2256
2268
|
- @param[in] includeLineNumbers {boolean} When `true`, rendered display strings include absolute source line prefixes.
|
|
2257
2269
|
- @return {FindToolMatchEntry} Structured match entry.
|
|
2258
2270
|
|
|
2259
|
-
### fn `function analyzeFindFile(` (
|
|
2271
|
+
### fn `function analyzeFindFile(` (L516-702)
|
|
2260
2272
|
- @brief Analyzes one path into a structured find file entry.
|
|
2261
2273
|
- @details Resolves path identity, validates language and tag support, parses the file with `SourceAnalyzer`, builds structured match entries, and preserves stable status facts for no-match or failure outcomes. Runtime is dominated by file I/O and analyzer cost. Side effects are limited to filesystem reads and optional stderr logging.
|
|
2262
2274
|
- @param[in] analyzer {SourceAnalyzer} Shared analyzer instance.
|
|
@@ -2270,14 +2282,14 @@ import {
|
|
|
2270
2282
|
- @param[in] verbose {boolean} When `true`, emit per-file diagnostics to stderr.
|
|
2271
2283
|
- @return {FindToolFileEntry} Structured file entry.
|
|
2272
2284
|
|
|
2273
|
-
### fn `export function buildFindToolPayload(options: BuildFindToolPayloadOptions): FindToolPayload` (
|
|
2285
|
+
### fn `export function buildFindToolPayload(options: BuildFindToolPayloadOptions): FindToolPayload` (L711-858)
|
|
2274
2286
|
- @brief Builds the full agent-oriented find payload.
|
|
2275
|
-
- @details Validates request parameters, analyzes requested files in caller order when the request is valid, preserves skipped and no-match outcomes in structured file entries, computes aggregate numeric totals, and
|
|
2287
|
+
- @details Validates request parameters, analyzes requested files in caller order when the request is valid, preserves skipped and no-match outcomes in structured file entries, computes aggregate numeric totals, and omits request echoes plus the static supported-tag matrix already encoded in registration metadata. Runtime is O(F log F + S + M). Side effects are limited to filesystem reads and optional stderr logging.
|
|
2276
2288
|
- @param[in] options {BuildFindToolPayloadOptions} Payload-construction options.
|
|
2277
|
-
- @return {FindToolPayload} Structured find payload ordered as
|
|
2289
|
+
- @return {FindToolPayload} Structured find payload ordered as summary, repository, and files.
|
|
2278
2290
|
- @satisfies REQ-089, REQ-090, REQ-091, REQ-092, REQ-093, REQ-094, REQ-096, REQ-098
|
|
2279
2291
|
|
|
2280
|
-
### fn `export function buildFindToolExecutionStderr(payload: FindToolPayload): string` (
|
|
2292
|
+
### fn `export function buildFindToolExecutionStderr(payload: FindToolPayload): string` (L867-892)
|
|
2281
2293
|
- @brief Builds deterministic stderr diagnostics from a find payload.
|
|
2282
2294
|
- @details Serializes invalid request states, skipped inputs, no-match files, and analysis failures into stable newline-delimited diagnostics while leaving successful matched files silent. Runtime is O(n) in file-entry count. No side effects occur.
|
|
2283
2295
|
- @param[in] payload {FindToolPayload} Structured find payload.
|
|
@@ -2297,28 +2309,27 @@ import {
|
|
|
2297
2309
|
|`FindToolMatchEntry`|iface||84-103|export interface FindToolMatchEntry extends FindLineRange|
|
|
2298
2310
|
|`FindToolFileEntry`|iface||109-131|export interface FindToolFileEntry extends FindLineRange|
|
|
2299
2311
|
|`FindToolRequestSection`|iface||137-155|export interface FindToolRequestSection|
|
|
2300
|
-
|`FindToolSummarySection`|iface||161-
|
|
2301
|
-
|`FindToolRepositorySection`|iface||
|
|
2302
|
-
|`FindToolPayload`|iface||189-
|
|
2303
|
-
|`BuildFindToolPayloadOptions`|iface||
|
|
2304
|
-
|`ValidatedRegex`|iface||
|
|
2305
|
-
|`ValidatedTagFilter`|iface||
|
|
2306
|
-
|`canonicalizeFindPath`|fn||
|
|
2307
|
-
|`buildLineRange`|fn||
|
|
2308
|
-
|`
|
|
2309
|
-
|`
|
|
2310
|
-
|`
|
|
2311
|
-
|`
|
|
2312
|
-
|`
|
|
2313
|
-
|`
|
|
2314
|
-
|`
|
|
2315
|
-
|`
|
|
2316
|
-
|`
|
|
2317
|
-
|`
|
|
2318
|
-
|`
|
|
2319
|
-
|`
|
|
2320
|
-
|`
|
|
2321
|
-
|`buildFindToolExecutionStderr`|fn||890-915|export function buildFindToolExecutionStderr(payload: Fin...|
|
|
2312
|
+
|`FindToolSummarySection`|iface||161-172|export interface FindToolSummarySection|
|
|
2313
|
+
|`FindToolRepositorySection`|iface||178-183|export interface FindToolRepositorySection|
|
|
2314
|
+
|`FindToolPayload`|iface||189-193|export interface FindToolPayload|
|
|
2315
|
+
|`BuildFindToolPayloadOptions`|iface||199-209|export interface BuildFindToolPayloadOptions|
|
|
2316
|
+
|`ValidatedRegex`|iface||215-219|interface ValidatedRegex|
|
|
2317
|
+
|`ValidatedTagFilter`|iface||225-230|interface ValidatedTagFilter|
|
|
2318
|
+
|`canonicalizeFindPath`|fn||239-247|function canonicalizeFindPath(targetPath: string, baseDir...|
|
|
2319
|
+
|`buildLineRange`|fn||256-262|function buildLineRange(startLineNumber: number, endLineN...|
|
|
2320
|
+
|`resolveSymbolName`|fn||270-272|function resolveSymbolName(element: SourceElement): string|
|
|
2321
|
+
|`resolveParentElement`|fn||281-290|function resolveParentElement(definitions: SourceElement[...|
|
|
2322
|
+
|`mapCodeLines`|fn||298-305|function mapCodeLines(lineEntries: StrippedConstructLineE...|
|
|
2323
|
+
|`buildStrippedSourceText`|fn||313-318|function buildStrippedSourceText(lineEntries: FindToolCod...|
|
|
2324
|
+
|`validateTagFilter`|fn||326-342|function validateTagFilter(tagFilter: string): ValidatedT...|
|
|
2325
|
+
|`validateRegexPattern`|fn||350-362|function validateRegexPattern(pattern: string): Validated...|
|
|
2326
|
+
|`elementMatches`|fn||372-380|function elementMatches(element: SourceElement, tagSet: S...|
|
|
2327
|
+
|`countLogicalLines`|fn||388-393|function countLogicalLines(fileContent: string): number|
|
|
2328
|
+
|`buildSkippedFileEntry`|fn||408-443|function buildSkippedFileEntry(|
|
|
2329
|
+
|`buildMatchEntry`|fn||457-500|function buildMatchEntry(|
|
|
2330
|
+
|`analyzeFindFile`|fn||516-702|function analyzeFindFile(|
|
|
2331
|
+
|`buildFindToolPayload`|fn||711-858|export function buildFindToolPayload(options: BuildFindTo...|
|
|
2332
|
+
|`buildFindToolExecutionStderr`|fn||867-892|export function buildFindToolExecutionStderr(payload: Fin...|
|
|
2322
2333
|
|
|
2323
2334
|
|
|
2324
2335
|
---
|
|
@@ -2769,7 +2780,7 @@ import { readBundledPrompt } from "./resources.js";
|
|
|
2769
2780
|
|
|
2770
2781
|
---
|
|
2771
2782
|
|
|
2772
|
-
# reference-payload.ts | TypeScript |
|
|
2783
|
+
# reference-payload.ts | TypeScript | 810L | 28 symbols | 5 imports | 27 comments
|
|
2773
2784
|
> Path: `src/core/reference-payload.ts`
|
|
2774
2785
|
- @brief Builds agent-oriented JSON payloads for `files-references` and `references`.
|
|
2775
2786
|
- @details Converts analyzed source files into deterministic JSON sections ordered for LLM traversal, including repository structure, per-file metrics, imports, symbols, structured Doxygen fields, and structured comment evidence. Runtime is O(F log F + S) where F is file count and S is total source size. Side effects are limited to filesystem reads and optional stderr logging.
|
|
@@ -2831,77 +2842,77 @@ import {
|
|
|
2831
2842
|
- @brief Describes the repository section of the references payload.
|
|
2832
2843
|
- @details Stores the base path, configured source-directory scope, canonical file list, and structured directory tree used during analysis. The interface is compile-time only and introduces no runtime cost.
|
|
2833
2844
|
|
|
2834
|
-
### iface `export interface ReferenceToolPayload` (L187-
|
|
2845
|
+
### iface `export interface ReferenceToolPayload` (L187-191)
|
|
2835
2846
|
- @brief Describes the full agent-oriented references payload.
|
|
2836
|
-
- @details
|
|
2847
|
+
- @details Exposes only aggregate analysis totals, repository structure, and per-file reference records, omitting request echoes that are already known to the caller or encoded in the tool registration. The interface is compile-time only and introduces no runtime cost.
|
|
2837
2848
|
|
|
2838
|
-
### iface `export interface BuildReferenceToolPayloadOptions` (
|
|
2849
|
+
### iface `export interface BuildReferenceToolPayloadOptions` (L197-204)
|
|
2839
2850
|
- @brief Describes the options required to build one references payload.
|
|
2840
2851
|
- @details Supplies tool identity, scope, base directory, requested paths, and optional configured source directories while keeping payload construction deterministic. The interface is compile-time only and introduces no runtime cost.
|
|
2841
2852
|
|
|
2842
|
-
### fn `function canonicalizeReferencePath(targetPath: string, baseDir: string): string` (
|
|
2853
|
+
### fn `function canonicalizeReferencePath(targetPath: string, baseDir: string): string` (L213-221)
|
|
2843
2854
|
- @brief Canonicalizes one filesystem path relative to the payload base directory.
|
|
2844
2855
|
- @details Emits a slash-normalized relative path when the target is under the base directory; otherwise emits the normalized absolute path. Runtime is O(p) in path length. No side effects occur.
|
|
2845
2856
|
- @param[in] targetPath {string} Absolute or relative filesystem path.
|
|
2846
2857
|
- @param[in] baseDir {string} Base directory used for relative canonicalization.
|
|
2847
2858
|
- @return {string} Canonicalized path string.
|
|
2848
2859
|
|
|
2849
|
-
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): ReferenceLineRange` (
|
|
2860
|
+
### fn `function buildLineRange(startLineNumber: number, endLineNumber: number): ReferenceLineRange` (L230-236)
|
|
2850
2861
|
- @brief Builds one structured line-range record.
|
|
2851
2862
|
- @details Duplicates the inclusive range as start, end, and tuple fields so callers can address whichever shape is most convenient. Runtime is O(1). No side effects occur.
|
|
2852
2863
|
- @param[in] startLineNumber {number} Inclusive start line number.
|
|
2853
2864
|
- @param[in] endLineNumber {number} Inclusive end line number.
|
|
2854
2865
|
- @return {ReferenceLineRange} Structured line-range record.
|
|
2855
2866
|
|
|
2856
|
-
### fn `function extractCommentText(commentElement: SourceElement, maxLength = 0): string` (
|
|
2867
|
+
### fn `function extractCommentText(commentElement: SourceElement, maxLength = 0): string` (L245-265)
|
|
2857
2868
|
- @brief Extracts normalized plain text from one comment element.
|
|
2858
2869
|
- @details Removes language comment markers, drops delimiter-only lines, joins content with spaces, and optionally truncates the result. Runtime is O(n) in comment length. No side effects occur.
|
|
2859
2870
|
- @param[in] commentElement {SourceElement} Comment element.
|
|
2860
2871
|
- @param[in] maxLength {number} Optional maximum output length; `0` disables truncation.
|
|
2861
2872
|
- @return {string} Cleaned comment text.
|
|
2862
2873
|
|
|
2863
|
-
### fn `function extractCommentLines(commentElement: SourceElement): string[]` (
|
|
2874
|
+
### fn `function extractCommentLines(commentElement: SourceElement): string[]` (L273-287)
|
|
2864
2875
|
- @brief Extracts cleaned individual lines from one comment element.
|
|
2865
2876
|
- @details Removes language comment markers while preserving line granularity for structured comment payloads. Runtime is O(n) in comment length. No side effects occur.
|
|
2866
2877
|
- @param[in] commentElement {SourceElement} Comment element.
|
|
2867
2878
|
- @return {string[]} Cleaned comment lines.
|
|
2868
2879
|
|
|
2869
|
-
### fn `function buildCommentMaps(elements: SourceElement[]): [Record<number, SourceElement[]>, SourceElement[], string]` (
|
|
2880
|
+
### fn `function buildCommentMaps(elements: SourceElement[]): [Record<number, SourceElement[]>, SourceElement[], string]` (L295-345)
|
|
2870
2881
|
- @brief Associates nearby comment blocks with definitions and standalone comment groups.
|
|
2871
2882
|
- @details Reuses the repository comment-attachment heuristic that binds comments within three lines of a definition while preserving early file-description text. Runtime is O(n log n). No side effects occur.
|
|
2872
2883
|
- @param[in] elements {SourceElement[]} Analyzed source elements.
|
|
2873
2884
|
- @return {[Record<number, SourceElement[]>, SourceElement[], string]} Attached-comment map, standalone comments, and compact file description.
|
|
2874
2885
|
|
|
2875
|
-
### fn `function resolveSymbolName(element: SourceElement): string` (
|
|
2886
|
+
### fn `function resolveSymbolName(element: SourceElement): string` (L353-355)
|
|
2876
2887
|
- @brief Resolves one stable symbol name from an analyzed element.
|
|
2877
2888
|
- @details Prefers explicit analyzer name metadata, then falls back to the derived signature or the first source line so every symbol retains a direct-access identifier. Runtime is O(1). No side effects occur.
|
|
2878
2889
|
- @param[in] element {SourceElement} Source element.
|
|
2879
2890
|
- @return {string} Stable symbol name.
|
|
2880
2891
|
|
|
2881
|
-
### fn `function resolveParentElement(definitions: SourceElement[], child: SourceElement): SourceElement | undefined` (
|
|
2892
|
+
### fn `function resolveParentElement(definitions: SourceElement[], child: SourceElement): SourceElement | undefined` (L364-373)
|
|
2882
2893
|
- @brief Resolves the direct parent element for one child symbol.
|
|
2883
2894
|
- @details Matches by parent name plus inclusive line containment and chooses the deepest enclosing definition. Runtime is O(n) in definition count. No side effects occur.
|
|
2884
2895
|
- @param[in] definitions {SourceElement[]} Sorted definition elements.
|
|
2885
2896
|
- @param[in] child {SourceElement} Candidate child symbol.
|
|
2886
2897
|
- @return {SourceElement | undefined} Matched parent definition when available.
|
|
2887
2898
|
|
|
2888
|
-
### fn `function buildCommentEntry(commentElement: SourceElement): ReferenceCommentEntry` (
|
|
2899
|
+
### fn `function buildCommentEntry(commentElement: SourceElement): ReferenceCommentEntry` (L381-388)
|
|
2889
2900
|
- @brief Builds one structured comment record from a comment element.
|
|
2890
2901
|
- @details Preserves numeric line-range metadata plus normalized text and per-line fragments. Runtime is O(n) in comment length. No side effects occur.
|
|
2891
2902
|
- @param[in] commentElement {SourceElement} Source comment element.
|
|
2892
2903
|
- @return {ReferenceCommentEntry} Structured comment record.
|
|
2893
2904
|
|
|
2894
|
-
### fn `function buildRepositoryTree(canonicalPaths: string[]): ReferenceRepositoryTreeNode` (
|
|
2905
|
+
### fn `function buildRepositoryTree(canonicalPaths: string[]): ReferenceRepositoryTreeNode` (L396-455)
|
|
2895
2906
|
- @brief Builds one structured repository tree from canonical file paths.
|
|
2896
2907
|
- @details Materializes a nested directory map and converts it into recursively ordered JSON nodes without decorative ASCII formatting. Runtime is O(n log n) in path count. No side effects occur.
|
|
2897
2908
|
- @param[in] canonicalPaths {string[]} Canonical file paths.
|
|
2898
2909
|
- @return {ReferenceRepositoryTreeNode} Structured repository tree rooted at `.`.
|
|
2899
2910
|
|
|
2900
|
-
### fn `const ensureDirectory = (parent: ReferenceRepositoryTreeNode, nodeName: string, relativePath: string): ReferenceRepositoryTreeNode =>` (
|
|
2911
|
+
### fn `const ensureDirectory = (parent: ReferenceRepositoryTreeNode, nodeName: string, relativePath: string): ReferenceRepositoryTreeNode =>` (L405-419)
|
|
2901
2912
|
|
|
2902
|
-
### fn `const finalizeNode = (node: ReferenceRepositoryTreeNode): ReferenceRepositoryTreeNode =>` (
|
|
2913
|
+
### fn `const finalizeNode = (node: ReferenceRepositoryTreeNode): ReferenceRepositoryTreeNode =>` (L441-452)
|
|
2903
2914
|
|
|
2904
|
-
### fn `function analyzeReferenceFile(` (
|
|
2915
|
+
### fn `function analyzeReferenceFile(` (L468-661)
|
|
2905
2916
|
- @brief Builds one analyzed file entry for the references payload.
|
|
2906
2917
|
- @details Parses the file with `SourceAnalyzer`, extracts structured imports and symbols, attaches structured Doxygen fields, and preserves standalone comment evidence. Runtime is O(S log S) in file size and symbol count. Side effects are limited to filesystem reads and optional stderr logging.
|
|
2907
2918
|
- @param[in] analyzer {SourceAnalyzer} Shared source analyzer instance.
|
|
@@ -2912,14 +2923,14 @@ import {
|
|
|
2912
2923
|
- @param[in] verbose {boolean} When `true`, emit per-file progress diagnostics to stderr.
|
|
2913
2924
|
- @return {ReferenceToolFileEntry} Structured file entry.
|
|
2914
2925
|
|
|
2915
|
-
### fn `export function buildReferenceToolPayload(options: BuildReferenceToolPayloadOptions): ReferenceToolPayload` (
|
|
2926
|
+
### fn `export function buildReferenceToolPayload(options: BuildReferenceToolPayloadOptions): ReferenceToolPayload` (L670-788)
|
|
2916
2927
|
- @brief Builds the full agent-oriented references payload.
|
|
2917
|
-
- @details Validates requested paths against the filesystem, analyzes processable files in caller order, preserves skipped and failed inputs in structured file entries, computes aggregate numeric totals, and emits
|
|
2928
|
+
- @details Validates requested paths against the filesystem, analyzes processable files in caller order, preserves skipped and failed inputs in structured file entries, computes aggregate numeric totals, and emits structured repository data without echoing request metadata already known to the caller. Runtime is O(F log F + S). Side effects are limited to filesystem reads and optional stderr logging.
|
|
2918
2929
|
- @param[in] options {BuildReferenceToolPayloadOptions} Payload-construction options.
|
|
2919
|
-
- @return {ReferenceToolPayload} Structured references payload ordered as
|
|
2930
|
+
- @return {ReferenceToolPayload} Structured references payload ordered as summary, repository, and files.
|
|
2920
2931
|
- @satisfies REQ-011, REQ-014, REQ-076, REQ-077, REQ-078, REQ-079
|
|
2921
2932
|
|
|
2922
|
-
### fn `export function buildReferenceToolExecutionStderr(payload: ReferenceToolPayload): string` (
|
|
2933
|
+
### fn `export function buildReferenceToolExecutionStderr(payload: ReferenceToolPayload): string` (L796-810)
|
|
2923
2934
|
- @brief Builds deterministic stderr diagnostics from a references payload.
|
|
2924
2935
|
- @details Serializes skipped-input and analysis-error entries into stable newline-delimited diagnostics while leaving fully analyzed payloads silent. Runtime is O(n) in file-entry count. No side effects occur.
|
|
2925
2936
|
- @param[in] payload {ReferenceToolPayload} Structured references payload.
|
|
@@ -2940,22 +2951,22 @@ import {
|
|
|
2940
2951
|
|`ReferenceToolSummarySection`|iface||146-157|export interface ReferenceToolSummarySection|
|
|
2941
2952
|
|`ReferenceRepositoryTreeNode`|iface||163-169|export interface ReferenceRepositoryTreeNode|
|
|
2942
2953
|
|`ReferenceToolRepositorySection`|iface||175-181|export interface ReferenceToolRepositorySection|
|
|
2943
|
-
|`ReferenceToolPayload`|iface||187-
|
|
2944
|
-
|`BuildReferenceToolPayloadOptions`|iface||
|
|
2945
|
-
|`canonicalizeReferencePath`|fn||
|
|
2946
|
-
|`buildLineRange`|fn||
|
|
2947
|
-
|`extractCommentText`|fn||
|
|
2948
|
-
|`extractCommentLines`|fn||
|
|
2949
|
-
|`buildCommentMaps`|fn||
|
|
2950
|
-
|`resolveSymbolName`|fn||
|
|
2951
|
-
|`resolveParentElement`|fn||
|
|
2952
|
-
|`buildCommentEntry`|fn||
|
|
2953
|
-
|`buildRepositoryTree`|fn||
|
|
2954
|
-
|`ensureDirectory`|fn||
|
|
2955
|
-
|`finalizeNode`|fn||
|
|
2956
|
-
|`analyzeReferenceFile`|fn||
|
|
2957
|
-
|`buildReferenceToolPayload`|fn||
|
|
2958
|
-
|`buildReferenceToolExecutionStderr`|fn||
|
|
2954
|
+
|`ReferenceToolPayload`|iface||187-191|export interface ReferenceToolPayload|
|
|
2955
|
+
|`BuildReferenceToolPayloadOptions`|iface||197-204|export interface BuildReferenceToolPayloadOptions|
|
|
2956
|
+
|`canonicalizeReferencePath`|fn||213-221|function canonicalizeReferencePath(targetPath: string, ba...|
|
|
2957
|
+
|`buildLineRange`|fn||230-236|function buildLineRange(startLineNumber: number, endLineN...|
|
|
2958
|
+
|`extractCommentText`|fn||245-265|function extractCommentText(commentElement: SourceElement...|
|
|
2959
|
+
|`extractCommentLines`|fn||273-287|function extractCommentLines(commentElement: SourceElemen...|
|
|
2960
|
+
|`buildCommentMaps`|fn||295-345|function buildCommentMaps(elements: SourceElement[]): [Re...|
|
|
2961
|
+
|`resolveSymbolName`|fn||353-355|function resolveSymbolName(element: SourceElement): string|
|
|
2962
|
+
|`resolveParentElement`|fn||364-373|function resolveParentElement(definitions: SourceElement[...|
|
|
2963
|
+
|`buildCommentEntry`|fn||381-388|function buildCommentEntry(commentElement: SourceElement)...|
|
|
2964
|
+
|`buildRepositoryTree`|fn||396-455|function buildRepositoryTree(canonicalPaths: string[]): R...|
|
|
2965
|
+
|`ensureDirectory`|fn||405-419|const ensureDirectory = (parent: ReferenceRepositoryTreeN...|
|
|
2966
|
+
|`finalizeNode`|fn||441-452|const finalizeNode = (node: ReferenceRepositoryTreeNode):...|
|
|
2967
|
+
|`analyzeReferenceFile`|fn||468-661|function analyzeReferenceFile(|
|
|
2968
|
+
|`buildReferenceToolPayload`|fn||670-788|export function buildReferenceToolPayload(options: BuildR...|
|
|
2969
|
+
|`buildReferenceToolExecutionStderr`|fn||796-810|export function buildReferenceToolExecutionStderr(payload...|
|
|
2959
2970
|
|
|
2960
2971
|
|
|
2961
2972
|
---
|
|
@@ -3008,17 +3019,17 @@ import { getInstallationPath, RESOURCE_ROOT_DIRNAME } from "./path-context.js";
|
|
|
3008
3019
|
|
|
3009
3020
|
---
|
|
3010
3021
|
|
|
3011
|
-
# runtime-project-paths.ts | TypeScript |
|
|
3022
|
+
# runtime-project-paths.ts | TypeScript | 70L | 4 symbols | 4 imports | 5 comments
|
|
3012
3023
|
> Path: `src/core/runtime-project-paths.ts`
|
|
3013
|
-
- @brief Derives runtime-only repository
|
|
3014
|
-
- @details Centralizes git-repository probing
|
|
3024
|
+
- @brief Derives runtime-only repository facts.
|
|
3025
|
+
- @details Centralizes git-repository probing and repository-root resolution for extension status, tool execution, and CLI flows. Runtime is dominated by git subprocess execution plus path normalization. Side effects are limited to subprocess spawning.
|
|
3015
3026
|
|
|
3016
3027
|
## Imports
|
|
3017
3028
|
```
|
|
3018
3029
|
import path from "node:path";
|
|
3019
3030
|
import { spawnSync } from "node:child_process";
|
|
3020
3031
|
import { ReqError } from "./errors.js";
|
|
3021
|
-
import { isSameOrAncestorPath
|
|
3032
|
+
import { isSameOrAncestorPath } from "./path-context.js";
|
|
3022
3033
|
```
|
|
3023
3034
|
|
|
3024
3035
|
## Definitions
|
|
@@ -3052,21 +3063,6 @@ import { isSameOrAncestorPath, normalizePathSlashes } from "./path-context.js";
|
|
|
3052
3063
|
- @return {string | undefined} Absolute repository-root path or `undefined` when unavailable.
|
|
3053
3064
|
- @satisfies REQ-105, REQ-145
|
|
3054
3065
|
|
|
3055
|
-
### fn `export function formatBasePathRelativeToGitPath(basePath: string, gitPath: string | undefined): string` (L78-88)
|
|
3056
|
-
- @brief Formats the runtime `base-path` relative to the runtime `git-path`.
|
|
3057
|
-
- @details Returns `.` when the repository root is unavailable or identical to the base path. Otherwise returns the slash-normalized relative path from `git-path` to `base-path`. Runtime is O(p) in path length. No external state is mutated.
|
|
3058
|
-
- @param[in] basePath {string} Runtime base path.
|
|
3059
|
-
- @param[in] gitPath {string | undefined} Runtime repository root.
|
|
3060
|
-
- @return {string} Relative base-path token for status rendering.
|
|
3061
|
-
- @satisfies REQ-148
|
|
3062
|
-
|
|
3063
|
-
### fn `export function formatAbsoluteGitPath(gitPath: string | undefined): string` (L97-99)
|
|
3064
|
-
- @brief Formats the runtime git path for status rendering.
|
|
3065
|
-
- @details Returns a slash-normalized absolute path or an empty string when no repository root is available. Runtime is O(p) in path length. No external state is mutated.
|
|
3066
|
-
- @param[in] gitPath {string | undefined} Runtime repository root.
|
|
3067
|
-
- @return {string} Absolute repository path or an empty string.
|
|
3068
|
-
- @satisfies REQ-147
|
|
3069
|
-
|
|
3070
3066
|
## Symbol Index
|
|
3071
3067
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
3072
3068
|
|---|---|---|---|---|
|
|
@@ -3074,13 +3070,11 @@ import { isSameOrAncestorPath, normalizePathSlashes } from "./path-context.js";
|
|
|
3074
3070
|
|`isInsideGitRepo`|fn||33-36|export function isInsideGitRepo(targetPath: string): boolean|
|
|
3075
3071
|
|`resolveGitRoot`|fn||46-52|export function resolveGitRoot(targetPath: string): string|
|
|
3076
3072
|
|`resolveRuntimeGitPath`|fn||61-68|export function resolveRuntimeGitPath(executionPath: stri...|
|
|
3077
|
-
|`formatBasePathRelativeToGitPath`|fn||78-88|export function formatBasePathRelativeToGitPath(basePath:...|
|
|
3078
|
-
|`formatAbsoluteGitPath`|fn||97-99|export function formatAbsoluteGitPath(gitPath: string | u...|
|
|
3079
3073
|
|
|
3080
3074
|
|
|
3081
3075
|
---
|
|
3082
3076
|
|
|
3083
|
-
# settings-menu.ts | TypeScript |
|
|
3077
|
+
# settings-menu.ts | TypeScript | 238L | 11 symbols | 2 imports | 12 comments
|
|
3084
3078
|
> Path: `src/core/settings-menu.ts`
|
|
3085
3079
|
- @brief Renders pi-usereq configuration menus with the shared pi.dev settings style.
|
|
3086
3080
|
- @details Wraps `SettingsList` in one extension-command helper that exposes right-aligned current values, built-in circular scrolling, bottom-line descriptions, and a deterministic bridge for offline test harnesses. Runtime is O(n) in visible choice count plus user interaction cost. Side effects are limited to transient custom-UI rendering.
|
|
@@ -3093,9 +3087,9 @@ import { Container, SettingsList, Text, type Component, type SettingItem, type S
|
|
|
3093
3087
|
|
|
3094
3088
|
## Definitions
|
|
3095
3089
|
|
|
3096
|
-
### iface `export interface PiUsereqSettingsMenuChoice` (L14-
|
|
3090
|
+
### iface `export interface PiUsereqSettingsMenuChoice` (L14-20)
|
|
3097
3091
|
- @brief Describes one selectable pi-usereq settings-menu choice.
|
|
3098
|
-
- @details Stores the stable action identifier, left-column label, right-column current value, and bottom-line description consumed by the shared settings-menu renderer. The interface is compile-time only and introduces no runtime cost.
|
|
3092
|
+
- @details Stores the stable action identifier, left-column label, right-column current value, optional value-tone override, and bottom-line description consumed by the shared settings-menu renderer. The interface is compile-time only and introduces no runtime cost.
|
|
3099
3093
|
|
|
3100
3094
|
### iface `export interface PiUsereqSettingsMenuBridge` (L25-30)
|
|
3101
3095
|
- @brief Describes the offline bridge exposed by shared settings-menu components.
|
|
@@ -3155,9 +3149,10 @@ Runtime is O(n) in title length. No external state is mutated.
|
|
|
3155
3149
|
- @param[in] done {(value?: string) => void} Outer custom-UI completion callback.
|
|
3156
3150
|
- @return {Component} Immediate-completion submenu component.
|
|
3157
3151
|
|
|
3158
|
-
### fn `function buildSettingItems(` (
|
|
3152
|
+
### fn `function buildSettingItems(` (L158-172)
|
|
3159
3153
|
- @brief Builds `SettingsList` items from one menu-choice vector.
|
|
3160
|
-
- @details Copies labels, current values, and descriptions into `SettingItem` records and attaches a submenu that resolves the outer custom UI with the selected choice identifier. Runtime is O(n) in choice count. No external state is mutated.
|
|
3154
|
+
- @details Copies labels, current values, value-tone overrides, and descriptions into `SettingItem` records and attaches a submenu that resolves the outer custom UI with the selected choice identifier. Runtime is O(n) in choice count. No external state is mutated.
|
|
3155
|
+
- @param[in] theme {PiUsereqSettingsTheme} Callback-local pi theme adapter.
|
|
3161
3156
|
- @param[in] choices {PiUsereqSettingsMenuChoice[]} Ordered menu-choice vector.
|
|
3162
3157
|
- @param[in] done {(value?: string) => void} Outer custom-UI completion callback.
|
|
3163
3158
|
- @return {SettingItem[]} `SettingsList` item vector.
|
|
@@ -3174,7 +3169,7 @@ Runtime is O(n) in title length. No external state is mutated.
|
|
|
3174
3169
|
## Symbol Index
|
|
3175
3170
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
3176
3171
|
|---|---|---|---|---|
|
|
3177
|
-
|`PiUsereqSettingsMenuChoice`|iface||14-
|
|
3172
|
+
|`PiUsereqSettingsMenuChoice`|iface||14-20|export interface PiUsereqSettingsMenuChoice|
|
|
3178
3173
|
|`PiUsereqSettingsMenuBridge`|iface||25-30|export interface PiUsereqSettingsMenuBridge|
|
|
3179
3174
|
|`PiUsereqSettingsMenuComponent`|iface||36-38|export interface PiUsereqSettingsMenuComponent extends Co...|
|
|
3180
3175
|
|`PiUsereqSettingsThemeColor`|type||46||
|
|
@@ -3183,8 +3178,8 @@ Runtime is O(n) in title length. No external state is mutated.
|
|
|
3183
3178
|
|`buildPiUsereqSettingsListTheme`|fn||95-109|function buildPiUsereqSettingsListTheme(|
|
|
3184
3179
|
|`formatPiUsereqSettingsMenuTitle`|fn||121-126|function formatPiUsereqSettingsMenuTitle(|
|
|
3185
3180
|
|`createImmediateSelectionComponent`|fn||135-147|function createImmediateSelectionComponent(choiceId: stri...|
|
|
3186
|
-
|`buildSettingItems`|fn||
|
|
3187
|
-
|`showPiUsereqSettingsMenu`|fn||
|
|
3181
|
+
|`buildSettingItems`|fn||158-172|function buildSettingItems(|
|
|
3182
|
+
|`showPiUsereqSettingsMenu`|fn||183-238|export async function showPiUsereqSettingsMenu(|
|
|
3188
3183
|
|
|
3189
3184
|
|
|
3190
3185
|
---
|
|
@@ -3332,10 +3327,10 @@ import { formatDoxygenFieldsAsMarkdown, parseDoxygenComment } from "./doxygen-pa
|
|
|
3332
3327
|
|
|
3333
3328
|
---
|
|
3334
3329
|
|
|
3335
|
-
# static-check.ts | TypeScript |
|
|
3330
|
+
# static-check.ts | TypeScript | 538L | 16 symbols | 7 imports | 29 comments
|
|
3336
3331
|
> Path: `src/core/static-check.ts`
|
|
3337
3332
|
- @brief Defines static-check language mappings and checker dispatch implementations.
|
|
3338
|
-
- @details Parses static-check
|
|
3333
|
+
- @details Parses Command-only user static-check specifications, preserves debug `Dummy` config handling, resolves file targets, and runs modular dummy or command-based analyzers. Runtime is linear in file count plus external tool cost. Side effects include filesystem reads, PATH probing, process spawning, and console output.
|
|
3339
3334
|
|
|
3340
3335
|
## Imports
|
|
3341
3336
|
```
|
|
@@ -3350,39 +3345,44 @@ import { ReqError } from "./errors.js";
|
|
|
3350
3345
|
|
|
3351
3346
|
## Definitions
|
|
3352
3347
|
|
|
3353
|
-
### iface `export interface StaticCheckLanguageSupport` (
|
|
3348
|
+
### iface `export interface StaticCheckLanguageSupport` (L91-94)
|
|
3354
3349
|
- @brief Describes supported extensions for one canonical static-check language.
|
|
3355
3350
|
- @details The interface is used for UI rendering and capability reporting only. It is compile-time only and adds no runtime cost.
|
|
3356
3351
|
|
|
3357
|
-
### fn `export function getSupportedStaticCheckLanguages(): string[]` (
|
|
3352
|
+
### fn `export function getSupportedStaticCheckLanguages(): string[]` (L109-111)
|
|
3358
3353
|
- @brief Returns the sorted list of canonical languages with extension support.
|
|
3359
3354
|
- @details Deduplicates the extension map values and sorts them alphabetically for stable UI and error messages. Runtime is O(n log n). No side effects occur.
|
|
3360
3355
|
- @return {string[]} Sorted canonical language names.
|
|
3361
3356
|
|
|
3362
|
-
### fn `export function getSupportedStaticCheckLanguageSupport(): StaticCheckLanguageSupport[]` (
|
|
3357
|
+
### fn `export function getSupportedStaticCheckLanguageSupport(): StaticCheckLanguageSupport[]` (L118-129)
|
|
3363
3358
|
- @brief Returns supported languages paired with their known file extensions.
|
|
3364
3359
|
- @details Groups extensions by canonical language and emits alphabetically sorted extension lists. Runtime is O(n log n). No external state is mutated.
|
|
3365
3360
|
- @return {StaticCheckLanguageSupport[]} Sorted language-support descriptors.
|
|
3366
3361
|
|
|
3367
|
-
### fn `function formatStaticCheckModules(): string` (
|
|
3368
|
-
- @brief Formats the
|
|
3369
|
-
- @details Joins `STATIC_CHECK_MODULES` with commas for direct insertion into error strings. Time complexity is O(n). No side effects occur.
|
|
3370
|
-
- @return {string} Comma-delimited module names.
|
|
3362
|
+
### fn `function formatStaticCheckModules(): string` (L136-138)
|
|
3363
|
+
- @brief Formats the user-configurable module list for diagnostics.
|
|
3364
|
+
- @details Joins `STATIC_CHECK_MODULES` with commas for direct insertion into user-facing error strings. Time complexity is O(n). No side effects occur.
|
|
3365
|
+
- @return {string} Comma-delimited user-configurable module names.
|
|
3366
|
+
|
|
3367
|
+
### fn `function formatDispatchStaticCheckModules(): string` (L145-147)
|
|
3368
|
+
- @brief Formats the persisted or debug-capable module list for dispatch diagnostics.
|
|
3369
|
+
- @details Joins `STATIC_CHECK_PERSISTED_MODULES` with commas for error strings emitted while executing existing config entries or debug-driver requests. Time complexity is O(n). No side effects occur.
|
|
3370
|
+
- @return {string} Comma-delimited persisted module names.
|
|
3371
3371
|
|
|
3372
|
-
### fn `function splitCsvLikeTokens(specRhs: string): string[]` (
|
|
3372
|
+
### fn `function splitCsvLikeTokens(specRhs: string): string[]` (L155-177)
|
|
3373
3373
|
- @brief Splits a comma-delimited static-check specification while honoring quotes.
|
|
3374
3374
|
- @details Performs a single pass over the right-hand side of `LANG=...`, preserving commas inside quoted segments. Runtime is O(n). No side effects occur.
|
|
3375
3375
|
- @param[in] specRhs {string} Right-hand side of the enable-static-check specification.
|
|
3376
3376
|
- @return {string[]} Parsed tokens with surrounding whitespace trimmed.
|
|
3377
3377
|
|
|
3378
|
-
### fn `export function parseEnableStaticCheck(spec: string): [string, StaticCheckEntry]` (
|
|
3379
|
-
- @brief Parses one `LANG=
|
|
3380
|
-
- @details Validates the language alias, canonicalizes the module name, enforces
|
|
3378
|
+
### fn `export function parseEnableStaticCheck(spec: string): [string, StaticCheckEntry]` (L186-234)
|
|
3379
|
+
- @brief Parses one `LANG=Command,CMD[,PARAM...]` static-check specification.
|
|
3380
|
+
- @details Validates the language alias, canonicalizes the Command module name, enforces the required executable argument, and returns a config entry ready for persistence. Runtime is O(n) in specification length. No external state is mutated.
|
|
3381
3381
|
- @param[in] spec {string} Raw static-check specification string.
|
|
3382
3382
|
- @return {[string, StaticCheckEntry]} Tuple of canonical language name and normalized checker configuration.
|
|
3383
|
-
- @throws {ReqError} Throws for missing separators, unknown languages,
|
|
3383
|
+
- @throws {ReqError} Throws for missing separators, unknown languages, non-Command modules, or missing required command arguments.
|
|
3384
3384
|
|
|
3385
|
-
### fn `export function buildStaticCheckEntryIdentity(language: string, entry: StaticCheckEntry): string` (
|
|
3385
|
+
### fn `export function buildStaticCheckEntryIdentity(language: string, entry: StaticCheckEntry): string` (L244-249)
|
|
3386
3386
|
- @brief Builds the duplicate-identity token for one static-check entry.
|
|
3387
3387
|
- @details Canonicalizes the language key, module name, command name, and parameter list into a stable JSON tuple used for merge deduplication. Runtime is O(p) in parameter count. No side effects occur.
|
|
3388
3388
|
- @param[in] language {string} Canonical or alias language name associated with the entry.
|
|
@@ -3390,7 +3390,7 @@ import { ReqError } from "./errors.js";
|
|
|
3390
3390
|
- @return {string} Stable identity token suitable for equality comparison.
|
|
3391
3391
|
- @satisfies REQ-036
|
|
3392
3392
|
|
|
3393
|
-
### fn `export function validateStaticCheckEntry(entry: StaticCheckEntry): void` (
|
|
3393
|
+
### fn `export function validateStaticCheckEntry(entry: StaticCheckEntry): void` (L259-270)
|
|
3394
3394
|
- @brief Validates pre-persistence invariants for one static-check entry.
|
|
3395
3395
|
- @details Rejects `Command` entries whose executable cannot be resolved before config writes while leaving non-command modules untouched. Runtime is O(p) in PATH entry count. Side effects are limited to filesystem reads.
|
|
3396
3396
|
- @param[in] entry {StaticCheckEntry} Static-check configuration entry to validate.
|
|
@@ -3398,32 +3398,18 @@ import { ReqError } from "./errors.js";
|
|
|
3398
3398
|
- @throws {ReqError} Throws when a `Command` entry omits `cmd` or resolves to a non-executable program.
|
|
3399
3399
|
- @satisfies REQ-037
|
|
3400
3400
|
|
|
3401
|
-
### fn `function resolveFiles(inputs: string[]): string[]` (
|
|
3401
|
+
### fn `function resolveFiles(inputs: string[]): string[]` (L278-302)
|
|
3402
3402
|
- @brief Resolves explicit files, directories, and glob patterns into absolute file paths.
|
|
3403
3403
|
- @details Expands glob inputs with `fast-glob`, enumerates direct children for directory inputs, accepts regular files, and warns for invalid entries. Runtime is O(n + m) where m is the total matched path count. Side effects are filesystem reads and warning output to stderr.
|
|
3404
3404
|
- @param[in] inputs {string[]} Raw file, directory, or glob inputs.
|
|
3405
3405
|
- @return {string[]} Unique absolute file paths.
|
|
3406
3406
|
|
|
3407
|
-
### class `export class StaticCheckBase` (
|
|
3408
|
-
- @brief Provides the base implementation for file-oriented static checks.
|
|
3409
|
-
- @details Resolves input files once, emits standardized headers, and defines overridable `checkFile`
|
|
3407
|
+
### class `export class StaticCheckBase` (L308-382)
|
|
3408
|
+
- @brief Provides the shared and debug-capable base implementation for file-oriented static checks.
|
|
3409
|
+
- @details Resolves input files once, emits standardized headers, implements the debug `Dummy` checker behavior, and defines overridable `checkFile` plus `emitLine` hooks used by concrete analyzers. Runtime is O(f) plus subclass checker cost. Side effects include console output.
|
|
3410
3410
|
|
|
3411
|
-
###
|
|
3412
|
-
- @brief
|
|
3413
|
-
- @details Checks the project virtual environment first, then `PI_USEREQ_PYTHON`, then `python3`, then `python`, and finally falls back to the literal `python3` string. Runtime is O(c) in candidate count. Side effects are filesystem reads and PATH probing.
|
|
3414
|
-
- @param[in] projectBase {string | undefined} Optional project root used to probe `.venv/bin/python`.
|
|
3415
|
-
- @return {string} Executable path or command name.
|
|
3416
|
-
|
|
3417
|
-
### class `export class StaticCheckPylance extends StaticCheckBase` : StaticCheckBase (L404-455)
|
|
3418
|
-
- @brief Runs Pyright/Pylance checks through the selected Python interpreter.
|
|
3419
|
-
- @details Invokes `python -m pyright` for each resolved file and emits standardized OK/FAIL records. Runtime is dominated by external checker execution. Side effects include process spawning and console output.
|
|
3420
|
-
|
|
3421
|
-
### class `export class StaticCheckRuff extends StaticCheckBase` : StaticCheckBase (L461-509)
|
|
3422
|
-
- @brief Runs Ruff checks through the selected Python interpreter.
|
|
3423
|
-
- @details Invokes `python -m ruff check` for each resolved file and emits standardized OK/FAIL records. Runtime is dominated by external checker execution. Side effects include process spawning and console output.
|
|
3424
|
-
|
|
3425
|
-
### class `export class StaticCheckCommand extends StaticCheckBase` : StaticCheckBase (L515-564)
|
|
3426
|
-
- @brief Runs an arbitrary external command as a static checker.
|
|
3411
|
+
### class `export class StaticCheckCommand extends StaticCheckBase` : StaticCheckBase (L388-437)
|
|
3412
|
+
- @brief Runs the user-facing external-command static checker.
|
|
3427
3413
|
- @brief Initializes a command-backed checker instance.
|
|
3428
3414
|
- @details Validates command availability on PATH during construction, then invokes the command with configured extra arguments plus one target file at a time. Runtime is dominated by external command execution. Side effects include PATH probing, process spawning, and console output.
|
|
3429
3415
|
- @details Validates that the executable exists on PATH before delegating file resolution to the base class and recording the command label. Runtime is O(p + f) where p is PATH entry count and f is resolved input count. Side effects are filesystem reads.
|
|
@@ -3433,30 +3419,30 @@ import { ReqError } from "./errors.js";
|
|
|
3433
3419
|
- @param[in] failOnly {boolean} When `true`, suppress successful-file output.
|
|
3434
3420
|
- @throws {ReqError} Throws when the executable cannot be found on PATH.
|
|
3435
3421
|
|
|
3436
|
-
### fn `function isExecutableFile(candidate: string): boolean` (
|
|
3422
|
+
### fn `function isExecutableFile(candidate: string): boolean` (L445-455)
|
|
3437
3423
|
- @brief Tests whether one filesystem path is executable.
|
|
3438
3424
|
- @details Requires the candidate to exist, be a regular file, and pass `X_OK` access checks. Runtime is O(1). Side effects are limited to filesystem reads.
|
|
3439
3425
|
- @param[in] candidate {string} Absolute or relative path to inspect.
|
|
3440
3426
|
- @return {boolean} `true` when the candidate is executable by the current process.
|
|
3441
3427
|
|
|
3442
|
-
### fn `function findExecutable(cmd: string): string | undefined` (
|
|
3428
|
+
### fn `function findExecutable(cmd: string): string | undefined` (L463-474)
|
|
3443
3429
|
- @brief Locates an executable by scanning the current PATH.
|
|
3444
3430
|
- @details Checks each PATH directory for an executable file named exactly as the requested command. Runtime is O(p) in PATH entry count. Side effects are filesystem reads.
|
|
3445
3431
|
- @param[in] cmd {string} Executable name to locate.
|
|
3446
3432
|
- @return {string | undefined} Absolute executable path, or `undefined` when not found.
|
|
3447
3433
|
|
|
3448
|
-
### fn `export function dispatchStaticCheckForFile(` (
|
|
3434
|
+
### fn `export function dispatchStaticCheckForFile(` (L485-488)
|
|
3449
3435
|
- @brief Dispatches one configured static checker for a single file.
|
|
3450
|
-
- @details Selects the
|
|
3436
|
+
- @details Selects the debug `Dummy` or user-facing `Command` implementation by module name, normalizes parameter arrays, and runs exactly one checker instance against the target file. Runtime is dominated by the selected checker. Side effects include console output and possible process spawning.
|
|
3451
3437
|
- @param[in] filePath {string} Absolute or relative file path to check.
|
|
3452
3438
|
- @param[in] langConfig {StaticCheckEntry} Normalized static-check configuration entry.
|
|
3453
3439
|
- @param[in] options {{ failOnly?: boolean; projectBase?: string }} Optional execution controls.
|
|
3454
3440
|
- @return {number} Checker exit status where `0` means success and non-zero means failure.
|
|
3455
3441
|
- @throws {ReqError} Throws when configuration is incomplete or names an unknown module.
|
|
3456
3442
|
|
|
3457
|
-
### fn `export function runStaticCheck(argv: string[]): number` (
|
|
3443
|
+
### fn `export function runStaticCheck(argv: string[]): number` (L517-538)
|
|
3458
3444
|
- @brief Runs the standalone static-check test driver.
|
|
3459
|
-
- @details Dispatches
|
|
3445
|
+
- @details Dispatches debug `dummy` or user-facing `command` subcommands without consulting project configuration. Runtime is O(n) in argument count plus checker cost. Side effects include console output and external process spawning.
|
|
3460
3446
|
- @param[in] argv {string[]} Raw static-check subcommand arguments.
|
|
3461
3447
|
- @return {number} Checker exit status where `0` means success.
|
|
3462
3448
|
- @throws {ReqError} Throws when no subcommand is provided, the subcommand is unknown, or required arguments are missing.
|
|
@@ -3464,29 +3450,27 @@ import { ReqError } from "./errors.js";
|
|
|
3464
3450
|
## Symbol Index
|
|
3465
3451
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
3466
3452
|
|---|---|---|---|---|
|
|
3467
|
-
|`StaticCheckLanguageSupport`|iface||
|
|
3468
|
-
|`getSupportedStaticCheckLanguages`|fn||
|
|
3469
|
-
|`getSupportedStaticCheckLanguageSupport`|fn||
|
|
3470
|
-
|`formatStaticCheckModules`|fn||
|
|
3471
|
-
|`
|
|
3472
|
-
|`
|
|
3473
|
-
|`
|
|
3474
|
-
|`
|
|
3475
|
-
|`
|
|
3476
|
-
|`
|
|
3477
|
-
|`
|
|
3478
|
-
|`
|
|
3479
|
-
|`
|
|
3480
|
-
|`
|
|
3481
|
-
|`
|
|
3482
|
-
|`
|
|
3483
|
-
|`dispatchStaticCheckForFile`|fn||612-615|export function dispatchStaticCheckForFile(|
|
|
3484
|
-
|`runStaticCheck`|fn||649-674|export function runStaticCheck(argv: string[]): number|
|
|
3453
|
+
|`StaticCheckLanguageSupport`|iface||91-94|export interface StaticCheckLanguageSupport|
|
|
3454
|
+
|`getSupportedStaticCheckLanguages`|fn||109-111|export function getSupportedStaticCheckLanguages(): string[]|
|
|
3455
|
+
|`getSupportedStaticCheckLanguageSupport`|fn||118-129|export function getSupportedStaticCheckLanguageSupport():...|
|
|
3456
|
+
|`formatStaticCheckModules`|fn||136-138|function formatStaticCheckModules(): string|
|
|
3457
|
+
|`formatDispatchStaticCheckModules`|fn||145-147|function formatDispatchStaticCheckModules(): string|
|
|
3458
|
+
|`splitCsvLikeTokens`|fn||155-177|function splitCsvLikeTokens(specRhs: string): string[]|
|
|
3459
|
+
|`parseEnableStaticCheck`|fn||186-234|export function parseEnableStaticCheck(spec: string): [st...|
|
|
3460
|
+
|`buildStaticCheckEntryIdentity`|fn||244-249|export function buildStaticCheckEntryIdentity(language: s...|
|
|
3461
|
+
|`validateStaticCheckEntry`|fn||259-270|export function validateStaticCheckEntry(entry: StaticChe...|
|
|
3462
|
+
|`resolveFiles`|fn||278-302|function resolveFiles(inputs: string[]): string[]|
|
|
3463
|
+
|`StaticCheckBase`|class||308-382|export class StaticCheckBase|
|
|
3464
|
+
|`StaticCheckCommand`|class||388-437|export class StaticCheckCommand extends StaticCheckBase|
|
|
3465
|
+
|`isExecutableFile`|fn||445-455|function isExecutableFile(candidate: string): boolean|
|
|
3466
|
+
|`findExecutable`|fn||463-474|function findExecutable(cmd: string): string | undefined|
|
|
3467
|
+
|`dispatchStaticCheckForFile`|fn||485-488|export function dispatchStaticCheckForFile(|
|
|
3468
|
+
|`runStaticCheck`|fn||517-538|export function runStaticCheck(argv: string[]): number|
|
|
3485
3469
|
|
|
3486
3470
|
|
|
3487
3471
|
---
|
|
3488
3472
|
|
|
3489
|
-
# token-counter.ts | TypeScript |
|
|
3473
|
+
# token-counter.ts | TypeScript | 611L | 28 symbols | 5 imports | 34 comments
|
|
3490
3474
|
> Path: `src/core/token-counter.ts`
|
|
3491
3475
|
- @brief Provides token, size, and structure counting utilities for agent-oriented file payloads.
|
|
3492
3476
|
- @details Wraps `js-tiktoken` encoding lookup, extracts per-file structural facts, and builds machine-oriented JSON payloads for token-centric tools. Runtime is linear in processed text size plus sort cost for derived ordering hints. Side effects are limited to filesystem reads in file-based helpers.
|
|
@@ -3548,80 +3532,72 @@ import { parseDoxygenComment, type DoxygenFieldMap } from "./doxygen-parser.js";
|
|
|
3548
3532
|
- @brief Describes the guidance section of the agent-oriented token payload.
|
|
3549
3533
|
- @details Separates source observations, derived recommendations, and actionable next-step hints so downstream agents can choose between raw evidence and planning heuristics without reparsing mixed prose. The interface is compile-time only and introduces no runtime cost.
|
|
3550
3534
|
|
|
3551
|
-
### iface `export interface TokenToolPayload` (L180-
|
|
3535
|
+
### iface `export interface TokenToolPayload` (L180-183)
|
|
3552
3536
|
- @brief Describes the full agent-oriented token payload.
|
|
3553
|
-
- @details
|
|
3537
|
+
- @details Exposes only aggregate numeric totals plus per-file metrics, omitting request echoes and derived guidance that can be inferred from tool registration or recomputed by the caller. The interface is compile-time only and introduces no runtime cost.
|
|
3554
3538
|
|
|
3555
|
-
### iface `export interface BuildTokenToolPayloadOptions` (
|
|
3539
|
+
### iface `export interface BuildTokenToolPayloadOptions` (L189-197)
|
|
3556
3540
|
- @brief Describes the options required to build one agent-oriented token payload.
|
|
3557
3541
|
- @details Supplies tool identity, scope, path base, requested paths, and optional canonical-doc metadata while keeping counting behavior configurable through a stable object contract. The interface is compile-time only and introduces no runtime cost.
|
|
3558
3542
|
|
|
3559
|
-
### class `export class TokenCounter` (
|
|
3543
|
+
### class `export class TokenCounter` (L203-243)
|
|
3560
3544
|
- @brief Encapsulates one tokenizer instance for repeated token counting.
|
|
3561
3545
|
- @brief Stores the tokenizer implementation used for subsequent counts.
|
|
3562
3546
|
- @details Caches a `js-tiktoken` encoding object so multiple documents can be counted without repeated encoding lookup. Counting cost is O(n) in content length. The class mutates only instance state during construction.
|
|
3563
3547
|
- @details The field holds the encoder returned by `getEncoding`. Access complexity is O(1). The value is initialized once per instance.
|
|
3564
3548
|
|
|
3565
|
-
### fn `function canonicalizeTokenPath(filePath: string, baseDir: string): string` (
|
|
3549
|
+
### fn `function canonicalizeTokenPath(filePath: string, baseDir: string): string` (L252-260)
|
|
3566
3550
|
- @brief Converts one filesystem path into the canonical token-payload path form.
|
|
3567
3551
|
- @details Emits a slash-normalized relative path when the target is under the supplied base directory; otherwise emits a slash-normalized absolute path. Runtime is O(p) in path length. No external state is mutated.
|
|
3568
3552
|
- @param[in] filePath {string} Candidate absolute or relative filesystem path.
|
|
3569
3553
|
- @param[in] baseDir {string} Reference directory used for relative canonicalization.
|
|
3570
3554
|
- @return {string} Canonicalized path string.
|
|
3571
3555
|
|
|
3572
|
-
### fn `function countLines(content: string): number` (
|
|
3556
|
+
### fn `function countLines(content: string): number` (L268-274)
|
|
3573
3557
|
- @brief Counts logical lines in one text payload.
|
|
3574
3558
|
- @details Counts newline separators while treating a trailing newline as line termination instead of an extra empty logical line. Runtime is O(n) in text length. No side effects occur.
|
|
3575
3559
|
- @param[in] content {string} Text payload.
|
|
3576
3560
|
- @return {number} Logical line count; `0` for empty content.
|
|
3577
3561
|
|
|
3578
|
-
### fn `function stripMarkdownFrontMatter(content: string): string` (
|
|
3562
|
+
### fn `function stripMarkdownFrontMatter(content: string): string` (L282-285)
|
|
3579
3563
|
- @brief Strips YAML front matter from markdown content before heading extraction.
|
|
3580
3564
|
- @details Removes the first `--- ... ---` block only when it appears at the file start so heading detection can operate on semantic markdown content instead of metadata. Runtime is O(n) in content length. No side effects occur.
|
|
3581
3565
|
- @param[in] content {string} Markdown payload.
|
|
3582
3566
|
- @return {string} Markdown body without the leading front matter block.
|
|
3583
3567
|
|
|
3584
|
-
### fn `function extractPrimaryHeadingText(content: string, filePath: string): string | undefined` (
|
|
3568
|
+
### fn `function extractPrimaryHeadingText(content: string, filePath: string): string | undefined` (L294-301)
|
|
3585
3569
|
- @brief Extracts the first level-one markdown heading when present.
|
|
3586
3570
|
- @details Restricts extraction to markdown-like files, skips YAML front matter, and returns the first `# ` heading payload without surrounding whitespace. Runtime is O(n) in content length. No side effects occur.
|
|
3587
3571
|
- @param[in] content {string} File content.
|
|
3588
3572
|
- @param[in] filePath {string} Source path used for extension-based markdown detection.
|
|
3589
3573
|
- @return {string | undefined} First heading text, or `undefined` when absent or the file is not markdown-like.
|
|
3590
3574
|
|
|
3591
|
-
### fn `function inferLanguageName(filePath: string): string | undefined` (
|
|
3575
|
+
### fn `function inferLanguageName(filePath: string): string | undefined` (L309-318)
|
|
3592
3576
|
- @brief Infers a file language label optimized for agent payloads.
|
|
3593
3577
|
- @details Reuses source-language detection when available, normalizes markdown extensions explicitly, and falls back to the lowercase extension name without the leading dot. Runtime is O(1). No side effects occur.
|
|
3594
3578
|
- @param[in] filePath {string} File path whose extension should be classified.
|
|
3595
3579
|
- @return {string | undefined} Normalized language label, or `undefined` when the path has no usable extension.
|
|
3596
3580
|
|
|
3597
|
-
### fn `function extractLeadingDoxygenFields(content: string): DoxygenFieldMap | undefined` (
|
|
3581
|
+
### fn `function extractLeadingDoxygenFields(content: string): DoxygenFieldMap | undefined` (L326-344)
|
|
3598
3582
|
- @brief Extracts leading Doxygen file fields when present.
|
|
3599
3583
|
- @details Tests common leading-comment syntaxes, normalizes an optional shebang away before matching, and returns the first non-empty parsed Doxygen map. Runtime is O(n) in comment length. No side effects occur.
|
|
3600
3584
|
- @param[in] content {string} File content.
|
|
3601
3585
|
- @return {DoxygenFieldMap | undefined} Parsed Doxygen field map, or `undefined` when no supported file-level fields are present.
|
|
3602
3586
|
|
|
3603
|
-
### fn `function roundRatio(numerator: number, denominator: number): number` (
|
|
3587
|
+
### fn `function roundRatio(numerator: number, denominator: number): number` (L353-358)
|
|
3604
3588
|
- @brief Rounds one ratio to six decimal places.
|
|
3605
3589
|
- @details Preserves zero exactly and otherwise limits floating-point noise so share fields remain stable across executions. Runtime is O(1). No side effects occur.
|
|
3606
3590
|
- @param[in] numerator {number} Partial numeric value.
|
|
3607
3591
|
- @param[in] denominator {number} Total numeric value.
|
|
3608
3592
|
- @return {number} Rounded ratio in range `[0, 1]` when the denominator is positive; `0` otherwise.
|
|
3609
3593
|
|
|
3610
|
-
### fn `function
|
|
3611
|
-
- @brief Orders canonical file paths by one numeric metric while removing duplicates.
|
|
3612
|
-
- @details Filters to counted file entries, sorts by the supplied metric direction, breaks ties by canonical path, and preserves only the first occurrence of each path. Runtime is O(n log n). No external state is mutated.
|
|
3613
|
-
- @param[in] files {TokenToolFileEntry[]} Token payload file entries.
|
|
3614
|
-
- @param[in] metric {(entry: TokenToolFileEntry) => number} Numeric metric selector.
|
|
3615
|
-
- @param[in] direction {"asc" | "desc"} Sort direction.
|
|
3616
|
-
- @return {string[]} Unique canonical paths ordered by the requested metric.
|
|
3617
|
-
|
|
3618
|
-
### fn `function probeRequestedPath(absolutePath: string): { exists: boolean; isFile: boolean; reason?: string }` (L403-417)
|
|
3594
|
+
### fn `function probeRequestedPath(absolutePath: string): { exists: boolean; isFile: boolean; reason?: string }` (L366-380)
|
|
3619
3595
|
- @brief Probes one requested path before token counting.
|
|
3620
3596
|
- @details Resolves whether the target exists and is a regular file while capturing a stable skip reason for missing or non-file inputs. Runtime is dominated by one filesystem stat. Side effects are limited to filesystem reads.
|
|
3621
3597
|
- @param[in] absolutePath {string} Absolute path to inspect.
|
|
3622
3598
|
- @return {{ exists: boolean; isFile: boolean; reason?: string }} Path probe result.
|
|
3623
3599
|
|
|
3624
|
-
### fn `function buildCountFileMetricsResult(filePath: string, content: string, counter: TokenCounter): CountFileMetricsResult` (
|
|
3600
|
+
### fn `function buildCountFileMetricsResult(filePath: string, content: string, counter: TokenCounter): CountFileMetricsResult` (L390-405)
|
|
3625
3601
|
- @brief Builds one rich per-file metrics record from readable content.
|
|
3626
3602
|
- @details Combines token, character, byte, and line counts with file-extension, inferred-language, heading, and Doxygen metadata extraction so agents can consume direct-access facts without reparsing the raw file. Runtime is O(n) in content length. No external state is mutated.
|
|
3627
3603
|
- @param[in] filePath {string} Absolute or project-local file path.
|
|
@@ -3629,14 +3605,14 @@ import { parseDoxygenComment, type DoxygenFieldMap } from "./doxygen-parser.js";
|
|
|
3629
3605
|
- @param[in] counter {TokenCounter} Reused token counter instance.
|
|
3630
3606
|
- @return {CountFileMetricsResult} Structured per-file metrics record.
|
|
3631
3607
|
|
|
3632
|
-
### fn `export function countFileMetrics(content: string, encodingName = TOKEN_COUNTER_ENCODING):` (
|
|
3608
|
+
### fn `export function countFileMetrics(content: string, encodingName = TOKEN_COUNTER_ENCODING):` (L414-427)
|
|
3633
3609
|
- @brief Counts tokens, characters, bytes, and lines for one in-memory content string.
|
|
3634
3610
|
- @details Instantiates a `TokenCounter`, tokenizes the supplied text, and pairs the result with raw character length, UTF-8 byte size, and logical line count. Runtime is O(n). No filesystem I/O occurs.
|
|
3635
3611
|
- @param[in] content {string} Text payload to measure.
|
|
3636
3612
|
- @param[in] encodingName {string} Tokenizer identifier. Defaults to `cl100k_base`.
|
|
3637
3613
|
- @return {{ tokens: number; chars: number; bytes: number; lines: number }} Aggregate metrics for the supplied content.
|
|
3638
3614
|
|
|
3639
|
-
### fn `export function countFilesMetrics(filePaths: string[], encodingName = TOKEN_COUNTER_ENCODING): CountFileMetricsResult[]` (
|
|
3615
|
+
### fn `export function countFilesMetrics(filePaths: string[], encodingName = TOKEN_COUNTER_ENCODING): CountFileMetricsResult[]` (L437-458)
|
|
3640
3616
|
- @brief Counts tokens, characters, bytes, and lines for multiple files.
|
|
3641
3617
|
- @details Reuses a single `TokenCounter`, reads each file as UTF-8, and returns per-file metrics plus direct-access metadata such as heading and Doxygen file fields. Read failures are captured as error strings instead of aborting the entire batch. Runtime is O(F + S). Side effects are limited to filesystem reads.
|
|
3642
3618
|
- @param[in] filePaths {string[]} File paths to measure.
|
|
@@ -3644,14 +3620,14 @@ import { parseDoxygenComment, type DoxygenFieldMap } from "./doxygen-parser.js";
|
|
|
3644
3620
|
- @return {CountFileMetricsResult[]} Per-file metrics and optional read errors.
|
|
3645
3621
|
- @satisfies REQ-010, REQ-070, REQ-073
|
|
3646
3622
|
|
|
3647
|
-
### fn `export function buildTokenToolPayload(options: BuildTokenToolPayloadOptions): TokenToolPayload` (
|
|
3623
|
+
### fn `export function buildTokenToolPayload(options: BuildTokenToolPayloadOptions): TokenToolPayload` (L467-579)
|
|
3648
3624
|
- @brief Builds the agent-oriented JSON payload for token-centric tools.
|
|
3649
|
-
- @details Validates requested paths against the filesystem, counts token metrics for processable files, preserves caller order in the file table,
|
|
3625
|
+
- @details Validates requested paths against the filesystem, counts token metrics for processable files, preserves caller order in the file table, and emits direct-access file facts such as sizes, headings, and optional Doxygen file fields while omitting request echoes and derived guidance. Runtime is O(F + S). Side effects are limited to filesystem reads.
|
|
3650
3626
|
- @param[in] options {BuildTokenToolPayloadOptions} Payload-construction options.
|
|
3651
|
-
- @return {TokenToolPayload} Structured token payload ordered as
|
|
3627
|
+
- @return {TokenToolPayload} Structured token payload ordered as summary then files.
|
|
3652
3628
|
- @satisfies REQ-010, REQ-017, REQ-069, REQ-070, REQ-071, REQ-073, REQ-074, REQ-075
|
|
3653
3629
|
|
|
3654
|
-
### fn `export function formatPackSummary(results: CountFileMetricsResult[]): string` (
|
|
3630
|
+
### fn `export function formatPackSummary(results: CountFileMetricsResult[]): string` (L587-611)
|
|
3655
3631
|
- @brief Formats per-file token metrics as a human-readable summary block.
|
|
3656
3632
|
- @details Aggregates totals, emits one status line per file, and appends a summary footer containing file, token, and character counts. Runtime is O(n). No external state is mutated.
|
|
3657
3633
|
- @param[in] results {CountFileMetricsResult[]} Per-file metric records.
|
|
@@ -3672,23 +3648,22 @@ import { parseDoxygenComment, type DoxygenFieldMap } from "./doxygen-parser.js";
|
|
|
3672
3648
|
|`TokenToolRecommendation`|iface||150-154|export interface TokenToolRecommendation|
|
|
3673
3649
|
|`TokenToolNextStepHint`|iface||160-164|export interface TokenToolNextStepHint|
|
|
3674
3650
|
|`TokenToolGuidanceSection`|iface||170-174|export interface TokenToolGuidanceSection|
|
|
3675
|
-
|`TokenToolPayload`|iface||180-
|
|
3676
|
-
|`BuildTokenToolPayloadOptions`|iface||
|
|
3677
|
-
|`TokenCounter`|class||
|
|
3678
|
-
|`canonicalizeTokenPath`|fn||
|
|
3679
|
-
|`countLines`|fn||
|
|
3680
|
-
|`stripMarkdownFrontMatter`|fn||
|
|
3681
|
-
|`extractPrimaryHeadingText`|fn||
|
|
3682
|
-
|`inferLanguageName`|fn||
|
|
3683
|
-
|`extractLeadingDoxygenFields`|fn||
|
|
3684
|
-
|`roundRatio`|fn||
|
|
3685
|
-
|`
|
|
3686
|
-
|`
|
|
3687
|
-
|`
|
|
3688
|
-
|`
|
|
3689
|
-
|`
|
|
3690
|
-
|`
|
|
3691
|
-
|`formatPackSummary`|fn||705-729|export function formatPackSummary(results: CountFileMetri...|
|
|
3651
|
+
|`TokenToolPayload`|iface||180-183|export interface TokenToolPayload|
|
|
3652
|
+
|`BuildTokenToolPayloadOptions`|iface||189-197|export interface BuildTokenToolPayloadOptions|
|
|
3653
|
+
|`TokenCounter`|class||203-243|export class TokenCounter|
|
|
3654
|
+
|`canonicalizeTokenPath`|fn||252-260|function canonicalizeTokenPath(filePath: string, baseDir:...|
|
|
3655
|
+
|`countLines`|fn||268-274|function countLines(content: string): number|
|
|
3656
|
+
|`stripMarkdownFrontMatter`|fn||282-285|function stripMarkdownFrontMatter(content: string): string|
|
|
3657
|
+
|`extractPrimaryHeadingText`|fn||294-301|function extractPrimaryHeadingText(content: string, fileP...|
|
|
3658
|
+
|`inferLanguageName`|fn||309-318|function inferLanguageName(filePath: string): string | un...|
|
|
3659
|
+
|`extractLeadingDoxygenFields`|fn||326-344|function extractLeadingDoxygenFields(content: string): Do...|
|
|
3660
|
+
|`roundRatio`|fn||353-358|function roundRatio(numerator: number, denominator: numbe...|
|
|
3661
|
+
|`probeRequestedPath`|fn||366-380|function probeRequestedPath(absolutePath: string): { exis...|
|
|
3662
|
+
|`buildCountFileMetricsResult`|fn||390-405|function buildCountFileMetricsResult(filePath: string, co...|
|
|
3663
|
+
|`countFileMetrics`|fn||414-427|export function countFileMetrics(content: string, encodin...|
|
|
3664
|
+
|`countFilesMetrics`|fn||437-458|export function countFilesMetrics(filePaths: string[], en...|
|
|
3665
|
+
|`buildTokenToolPayload`|fn||467-579|export function buildTokenToolPayload(options: BuildToken...|
|
|
3666
|
+
|`formatPackSummary`|fn||587-611|export function formatPackSummary(results: CountFileMetri...|
|
|
3692
3667
|
|
|
3693
3668
|
|
|
3694
3669
|
---
|
|
@@ -4099,7 +4074,7 @@ import path from "node:path";
|
|
|
4099
4074
|
|
|
4100
4075
|
---
|
|
4101
4076
|
|
|
4102
|
-
# index.ts | TypeScript |
|
|
4077
|
+
# index.ts | TypeScript | 2368L | 53 symbols | 21 imports | 56 comments
|
|
4103
4078
|
> Path: `src/index.ts`
|
|
4104
4079
|
- @brief Registers the pi-usereq extension commands, tools, and configuration UI.
|
|
4105
4080
|
- @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.
|
|
@@ -4116,7 +4091,7 @@ import {
|
|
|
4116
4091
|
import {
|
|
4117
4092
|
import {
|
|
4118
4093
|
import {
|
|
4119
|
-
import {
|
|
4094
|
+
import { formatRuntimePathForDisplay } from "./core/path-context.js";
|
|
4120
4095
|
import { resolveRuntimeGitPath } from "./core/runtime-project-paths.js";
|
|
4121
4096
|
import { showPiUsereqSettingsMenu, type PiUsereqSettingsMenuChoice } from "./core/settings-menu.js";
|
|
4122
4097
|
import {
|
|
@@ -4131,35 +4106,27 @@ import { makeRelativeIfContainsProject, shellSplit } from "./core/utils.js";
|
|
|
4131
4106
|
|
|
4132
4107
|
## Definitions
|
|
4133
4108
|
|
|
4134
|
-
### iface `interface PiShortcutRegistrar` (
|
|
4109
|
+
### iface `interface PiShortcutRegistrar` (L143-151)
|
|
4135
4110
|
- @brief Describes the optional shortcut-registration surface used by pi-usereq.
|
|
4136
4111
|
- @details Narrows the runtime API to the documented `registerShortcut(...)`
|
|
4137
4112
|
method so the extension can remain compatible with offline harnesses that do
|
|
4138
4113
|
not implement shortcut capture. Compile-time only and introduces no runtime
|
|
4139
4114
|
cost.
|
|
4140
4115
|
|
|
4141
|
-
### fn `function getProjectBase(cwd: string): string` (
|
|
4116
|
+
### fn `function getProjectBase(cwd: string): string` (L159-161)
|
|
4142
4117
|
- @brief Resolves the effective project base from a working directory.
|
|
4143
4118
|
- @details Normalizes the provided cwd into an absolute path without consulting configuration. Time complexity is O(1). No I/O side effects occur.
|
|
4144
4119
|
- @param[in] cwd {string} Current working directory.
|
|
4145
4120
|
- @return {string} Absolute project base path.
|
|
4146
4121
|
|
|
4147
|
-
### fn `function
|
|
4148
|
-
- @brief Builds the shared runtime path facts for the current command or tool context.
|
|
4149
|
-
- @details Derives installation, execution, base, config, resource, docs, test, source, and optional git paths from the cwd-derived project configuration plus runtime-only repository probing, then converts them into prompt/tool-facing strings. Runtime is O(s + p) where s is configured source-directory count and p is aggregate path length. Side effects are limited to git subprocess execution.
|
|
4150
|
-
- @param[in] cwd {string} Current working directory.
|
|
4151
|
-
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4152
|
-
- @return {import("./core/path-context.js").RuntimePathFacts} Shared runtime path facts.
|
|
4153
|
-
- @satisfies REQ-145, REQ-146
|
|
4154
|
-
|
|
4155
|
-
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L178-181)
|
|
4122
|
+
### fn `function loadProjectConfig(cwd: string): UseReqConfig` (L170-173)
|
|
4156
4123
|
- @brief Loads project configuration for the extension runtime.
|
|
4157
4124
|
- @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.
|
|
4158
4125
|
- @param[in] cwd {string} Current working directory.
|
|
4159
4126
|
- @return {UseReqConfig} Effective project configuration.
|
|
4160
4127
|
- @satisfies REQ-030, REQ-145, REQ-146
|
|
4161
4128
|
|
|
4162
|
-
### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (
|
|
4129
|
+
### fn `function saveProjectConfig(cwd: string, config: UseReqConfig): void` (L183-186)
|
|
4163
4130
|
- @brief Persists project configuration from the extension runtime.
|
|
4164
4131
|
- @details Resolves the project base, normalizes configured directory paths into project-relative form, and delegates persistence to `saveConfig` without serializing runtime-derived path metadata. Runtime is O(n) in config size. Side effects include config-file writes.
|
|
4165
4132
|
- @param[in] cwd {string} Current working directory.
|
|
@@ -4167,65 +4134,74 @@ cost.
|
|
|
4167
4134
|
- @return {void} No return value.
|
|
4168
4135
|
- @satisfies REQ-146
|
|
4169
4136
|
|
|
4170
|
-
### fn `function
|
|
4137
|
+
### fn `function formatProjectConfigPathForMenu(cwd: string): string` (L197-199)
|
|
4138
|
+
- @brief Formats the current project config path for top-level menu display.
|
|
4139
|
+
- @details Resolves `<base-path>/.pi-usereq/config.json` from the cwd-derived
|
|
4140
|
+
project base and formats it relative to the user home when possible. Runtime
|
|
4141
|
+
is O(p) in path length. No external state is mutated.
|
|
4142
|
+
- @param[in] cwd {string} Current working directory.
|
|
4143
|
+
- @return {string} User-home-relative or absolute config path display value.
|
|
4144
|
+
- @satisfies REQ-162
|
|
4145
|
+
|
|
4146
|
+
### fn `function collectProjectStaticCheckSelection(` (L208-239)
|
|
4171
4147
|
- @brief Collects the project-scoped static-check selection used by the agent tool.
|
|
4172
4148
|
- @details Resolves configured source plus test directories, reuses the same fixture-root exclusions as `runProjectStaticCheck`, and returns canonical relative file paths for structured payload emission. Runtime is O(F) plus project file-discovery cost. Side effects are limited to filesystem reads and git subprocesses delegated through `collectSourceFiles`.
|
|
4173
4149
|
- @param[in] projectBase {string} Resolved project base path.
|
|
4174
4150
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4175
4151
|
- @return {{ selectionDirectoryPaths: string[]; excludedDirectoryPaths: string[]; selectedPaths: string[] }} Structured static-check selection facts.
|
|
4176
4152
|
|
|
4177
|
-
### fn `function buildTokenToolExecutionStderr(payload: TokenToolPayload): string` (
|
|
4153
|
+
### fn `function buildTokenToolExecutionStderr(payload: TokenToolPayload): string` (L247-255)
|
|
4178
4154
|
- @brief Builds execution diagnostics for one token-tool payload.
|
|
4179
4155
|
- @details Serializes skipped-input and read-error observations into stable stderr lines while leaving successful counted files silent. Runtime is O(n) in issue count. No side effects occur.
|
|
4180
4156
|
- @param[in] payload {TokenToolPayload} Structured token payload.
|
|
4181
4157
|
- @return {string} Newline-delimited execution diagnostics.
|
|
4182
4158
|
|
|
4183
|
-
### fn `function buildTokenToolExecuteResult(` (
|
|
4159
|
+
### fn `function buildTokenToolExecuteResult(` (L264-279)
|
|
4184
4160
|
- @brief Builds the agent-oriented execute result returned by token-count tools.
|
|
4185
4161
|
- @details Mirrors the structured token payload into both the text `content` channel and the machine-readable `details` channel while isolating execution metadata under `execution`. Runtime is O(n) in payload size. No side effects occur.
|
|
4186
4162
|
- @param[in] payload {TokenToolPayload} Structured token payload.
|
|
4187
4163
|
- @return {{ content: Array<{ type: "text"; text: string }>; details: TokenToolPayload & { execution: { code: number; stderr: string } } }} Token-tool execute result.
|
|
4188
4164
|
- @satisfies REQ-069, REQ-070, REQ-071, REQ-073, REQ-074, REQ-075, REQ-099, REQ-102
|
|
4189
4165
|
|
|
4190
|
-
### fn `function buildReferenceToolExecuteResult(` (
|
|
4166
|
+
### fn `function buildReferenceToolExecuteResult(` (L288-304)
|
|
4191
4167
|
- @brief Builds the agent-oriented execute result returned by references tools.
|
|
4192
4168
|
- @details Mirrors the structured references payload into both the text `content` channel and the machine-readable `details` channel while isolating execution metadata under `execution`. Runtime is O(n) in payload size. No side effects occur.
|
|
4193
4169
|
- @param[in] payload {ReferenceToolPayload} Structured references payload.
|
|
4194
4170
|
- @return {{ content: Array<{ type: "text"; text: string }>; details: ReferenceToolPayload & { execution: { code: number; stderr: string } } }} References-tool execute result.
|
|
4195
4171
|
- @satisfies REQ-076, REQ-077, REQ-078, REQ-079, REQ-099, REQ-102
|
|
4196
4172
|
|
|
4197
|
-
### fn `function buildCompressionToolExecuteResult(` (
|
|
4173
|
+
### fn `function buildCompressionToolExecuteResult(` (L313-329)
|
|
4198
4174
|
- @brief Builds the agent-oriented execute result returned by compression tools.
|
|
4199
4175
|
- @details Mirrors the structured compression payload into both the text `content` channel and the machine-readable `details` channel while isolating execution metadata under `execution`. Runtime is O(n) in payload size. No side effects occur.
|
|
4200
4176
|
- @param[in] payload {CompressToolPayload} Structured compression payload.
|
|
4201
4177
|
- @return {{ content: Array<{ type: "text"; text: string }>; details: CompressToolPayload & { execution: { code: number; stderr: string } } }} Compression-tool execute result.
|
|
4202
4178
|
- @satisfies REQ-081, REQ-082, REQ-083, REQ-084, REQ-085, REQ-087, REQ-088, REQ-099, REQ-102
|
|
4203
4179
|
|
|
4204
|
-
### fn `function buildFindToolSupportedTagGuidelines(): string[]` (
|
|
4180
|
+
### fn `function buildFindToolSupportedTagGuidelines(): string[]` (L390-394)
|
|
4205
4181
|
- @brief Builds the supported-tag guidance lines embedded in find-tool registrations.
|
|
4206
4182
|
- @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.
|
|
4207
4183
|
- @return {string[]} Supported-tag guidance lines.
|
|
4208
4184
|
|
|
4209
|
-
### fn `function buildFindToolSchemaDescription(scope: FindToolScope): string` (
|
|
4185
|
+
### fn `function buildFindToolSchemaDescription(scope: FindToolScope): string` (L402-407)
|
|
4210
4186
|
- @brief Builds the schema description for one find-tool registration.
|
|
4211
4187
|
- @details Specializes the input-scope sentence for explicit-file or configured-directory searches while keeping the JSON output contract stable and fully machine-readable. Runtime is O(1). No side effects occur.
|
|
4212
4188
|
- @param[in] scope {FindToolScope} Find-tool scope.
|
|
4213
4189
|
- @return {string} Parameter-schema description.
|
|
4214
4190
|
|
|
4215
|
-
### fn `function buildFindToolPromptGuidelines(scope: FindToolScope): string[]` (
|
|
4191
|
+
### fn `function buildFindToolPromptGuidelines(scope: FindToolScope): string[]` (L415-431)
|
|
4216
4192
|
- @brief Builds the prompt-guideline set for one find-tool registration.
|
|
4217
4193
|
- @details Encodes scope selection, output schema, 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.
|
|
4218
4194
|
- @param[in] scope {FindToolScope} Find-tool scope.
|
|
4219
4195
|
- @return {string[]} Prompt-guideline strings.
|
|
4220
4196
|
|
|
4221
|
-
### fn `function buildFindToolExecuteResult(` (
|
|
4197
|
+
### fn `function buildFindToolExecuteResult(` (L440-457)
|
|
4222
4198
|
- @brief Builds the agent-oriented execute result returned by find tools.
|
|
4223
4199
|
- @details Mirrors the structured find payload into both the text `content` channel and the machine-readable `details` channel while isolating execution metadata under `execution`. Runtime is O(n) in payload size. No side effects occur.
|
|
4224
4200
|
- @param[in] payload {FindToolPayload} Structured find payload.
|
|
4225
4201
|
- @return {{ content: Array<{ type: "text"; text: string }>; details: FindToolPayload & { execution: { code: number; stderr: string } } }} Find-tool execute result.
|
|
4226
4202
|
- @satisfies REQ-089, REQ-090, REQ-091, REQ-092, REQ-093, REQ-094, REQ-097, REQ-098, REQ-099, REQ-102
|
|
4227
4203
|
|
|
4228
|
-
### fn `async function deliverPromptCommand(pi: ExtensionAPI, content: string): Promise<void>` (
|
|
4204
|
+
### fn `async function deliverPromptCommand(pi: ExtensionAPI, content: string): Promise<void>` (L467-469)
|
|
4229
4205
|
- @brief Delivers one rendered prompt into the active session.
|
|
4230
4206
|
- @details Writes the rendered prompt directly through `pi.sendUserMessage(...)` without creating replacement sessions or pre-reset flows. Runtime is O(n) in prompt length. Side effects are limited to user-message delivery.
|
|
4231
4207
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4233,26 +4209,26 @@ cost.
|
|
|
4233
4209
|
- @return {Promise<void>} Promise resolved after the prompt is queued for delivery.
|
|
4234
4210
|
- @satisfies REQ-004, REQ-067, REQ-068
|
|
4235
4211
|
|
|
4236
|
-
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (
|
|
4212
|
+
### fn `function getPiUsereqStartupTools(pi: ExtensionAPI): ToolInfo[]` (L478-483)
|
|
4237
4213
|
- @brief Returns the configurable active-tool inventory visible to the extension.
|
|
4238
4214
|
- @details Filters runtime tools against the canonical configurable-tool set, thereby combining extension-owned tools with supported embedded pi CLI tools. Output order is sorted by tool name. Runtime is O(t log t). No external state is mutated.
|
|
4239
4215
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4240
4216
|
- @return {ToolInfo[]} Sorted configurable tool descriptors.
|
|
4241
4217
|
- @satisfies REQ-007, REQ-063
|
|
4242
4218
|
|
|
4243
|
-
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (
|
|
4219
|
+
### fn `function getConfiguredEnabledPiUsereqTools(config: UseReqConfig): string[]` (L491-495)
|
|
4244
4220
|
- @brief Normalizes and returns the configured enabled active tools.
|
|
4245
4221
|
- @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"]`.
|
|
4246
4222
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4247
4223
|
- @return {string[]} Normalized enabled tool names.
|
|
4248
4224
|
|
|
4249
|
-
### fn `function getPiUsereqToolKind(tool: ToolInfo): "builtin" | "extension"` (
|
|
4225
|
+
### fn `function getPiUsereqToolKind(tool: ToolInfo): "builtin" | "extension"` (L503-508)
|
|
4250
4226
|
- @brief Classifies one configurable tool as embedded or extension-owned.
|
|
4251
4227
|
- @details Uses the runtime `sourceInfo.source` field plus the supported embedded-name subset to produce one stable UI label. Runtime is O(1). No external state is mutated.
|
|
4252
4228
|
- @param[in] tool {ToolInfo} Runtime tool descriptor.
|
|
4253
4229
|
- @return {"builtin" | "extension"} Stable tool-kind label.
|
|
4254
4230
|
|
|
4255
|
-
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (
|
|
4231
|
+
### fn `function applyConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig): void` (L518-535)
|
|
4256
4232
|
- @brief Applies the configured active-tool enablement to the current session.
|
|
4257
4233
|
- @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(...)`.
|
|
4258
4234
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4260,25 +4236,27 @@ cost.
|
|
|
4260
4236
|
- @return {void} No return value.
|
|
4261
4237
|
- @satisfies REQ-009, REQ-064
|
|
4262
4238
|
|
|
4263
|
-
### fn `async function handleExtensionStatusEvent(` (
|
|
4239
|
+
### fn `async function handleExtensionStatusEvent(` (L557-593)
|
|
4264
4240
|
- @brief Handles one intercepted pi lifecycle hook for pi-usereq status updates.
|
|
4265
4241
|
- @details Applies session-start-specific resource validation, project-config
|
|
4266
4242
|
refresh, and startup-tool enablement before forwarding the originating hook
|
|
4267
4243
|
name and payload into the shared `updateExtensionStatus(...)` pipeline.
|
|
4268
|
-
On `agent_end`, also dispatches configured pi-notify beep
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4244
|
+
On `agent_end`, also dispatches configured pi-notify beep, sound, and
|
|
4245
|
+
prompt-specific Pushover effects when the current run originates from a
|
|
4246
|
+
bundled prompt command. Runtime is dominated by configuration loading during
|
|
4247
|
+
`session_start`; all other hooks are O(1). Side effects include resource
|
|
4248
|
+
checks, active-tool mutation, status updates, live-ticker disposal on
|
|
4249
|
+
shutdown, stdout writes, optional child-process spawning, and outbound
|
|
4250
|
+
HTTPS requests.
|
|
4273
4251
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4274
4252
|
- @param[in] hookName {PiUsereqStatusHookName} Intercepted hook name.
|
|
4275
4253
|
- @param[in] event {unknown} Hook payload forwarded by pi.
|
|
4276
4254
|
- @param[in] ctx {ExtensionContext} Active extension context.
|
|
4277
4255
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4278
4256
|
- @return {Promise<void>} Promise resolved when hook processing completes.
|
|
4279
|
-
- @satisfies REQ-117, REQ-118, REQ-119, REQ-129, REQ-130, REQ-131, REQ-132, REQ-133
|
|
4257
|
+
- @satisfies REQ-117, REQ-118, REQ-119, REQ-129, REQ-130, REQ-131, REQ-132, REQ-133, REQ-166, REQ-167, REQ-168, REQ-169, REQ-172
|
|
4280
4258
|
|
|
4281
|
-
### fn `function registerExtensionStatusHooks(` (
|
|
4259
|
+
### fn `function registerExtensionStatusHooks(` (L606-619)
|
|
4282
4260
|
- @brief Registers shared wrappers for every supported pi lifecycle hook.
|
|
4283
4261
|
- @details Installs one generic wrapper per intercepted hook so every resource,
|
|
4284
4262
|
session, agent, model, tool, bash, and input event is routed through the
|
|
@@ -4289,7 +4267,7 @@ count. Side effects include hook registration.
|
|
|
4289
4267
|
- @return {void} No return value.
|
|
4290
4268
|
- @satisfies DES-002, REQ-113, REQ-114, REQ-115, REQ-116, REQ-117
|
|
4291
4269
|
|
|
4292
|
-
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (
|
|
4270
|
+
### fn `function setConfiguredPiUsereqTools(pi: ExtensionAPI, config: UseReqConfig, enabledTools: string[]): void` (L629-632)
|
|
4293
4271
|
- @brief Replaces the configured active-tool selection and applies it immediately.
|
|
4294
4272
|
- @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.
|
|
4295
4273
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4297,33 +4275,63 @@ count. Side effects include hook registration.
|
|
|
4297
4275
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4298
4276
|
- @return {void} No return value.
|
|
4299
4277
|
|
|
4300
|
-
### fn `function renderPiUsereqToolsReference(pi: ExtensionAPI, config: UseReqConfig): string` (
|
|
4278
|
+
### fn `function renderPiUsereqToolsReference(pi: ExtensionAPI, config: UseReqConfig): string` (L641-669)
|
|
4301
4279
|
- @brief Renders a textual reference for configurable-tool configuration and runtime state.
|
|
4302
4280
|
- @details Lists every configurable tool with configured enablement, runtime activation, builtin-versus-extension classification, source metadata, and optional descriptions. Runtime is O(t). No side effects occur.
|
|
4303
4281
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4304
4282
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4305
4283
|
- @return {string} Multiline tool-status report.
|
|
4306
4284
|
|
|
4307
|
-
- type `type PiNotifyBeepConfigKey =` (
|
|
4285
|
+
- type `type PiNotifyBeepConfigKey =` (L677)
|
|
4308
4286
|
- @brief Represents one persisted pi-notify beep flag key.
|
|
4309
4287
|
- @details Restricts menu toggles to the three independent prompt-end beep
|
|
4310
4288
|
flags stored in project configuration. Compile-time only and introduces no
|
|
4311
4289
|
runtime cost.
|
|
4312
|
-
### fn `function togglePiNotifyBeepFlag(config: UseReqConfig, key: PiNotifyBeepConfigKey): boolean` (
|
|
4290
|
+
### fn `function togglePiNotifyBeepFlag(config: UseReqConfig, key: PiNotifyBeepConfigKey): boolean` (L689-692)
|
|
4313
4291
|
- @brief Flips one persisted pi-notify beep flag.
|
|
4314
4292
|
- @details Negates the selected prompt-end beep flag in place and returns the resulting boolean value so callers can emit deterministic UI feedback. Runtime is O(1). Side effect: mutates `config`.
|
|
4315
4293
|
- @param[in] key {PiNotifyBeepConfigKey} Beep flag key to toggle.
|
|
4316
4294
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4317
4295
|
- @return {boolean} Next enabled state.
|
|
4318
4296
|
|
|
4319
|
-
### fn `function
|
|
4297
|
+
### fn `function formatPiNotifyPushoverPriority(priority: PiNotifyPushoverPriority): string` (L701-703)
|
|
4298
|
+
- @brief Formats one persisted Pushover priority for menu display.
|
|
4299
|
+
- @details Maps the canonical `0|1` priority domain to deterministic menu text reused by the Pushover configuration UI. Runtime is O(1). No external state is mutated.
|
|
4300
|
+
- @param[in] priority {PiNotifyPushoverPriority} Persisted Pushover priority.
|
|
4301
|
+
- @return {string} Menu-display label.
|
|
4302
|
+
- @satisfies REQ-165
|
|
4303
|
+
|
|
4304
|
+
### fn `function buildPiNotifyPushoverMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L712-751)
|
|
4305
|
+
- @brief Builds the shared settings-menu choices for Pushover configuration.
|
|
4306
|
+
- @details Serializes the Pushover global-disable flag, successful-completion enable flag, credential strings, and priority value into right-valued menu rows consumed by the shared settings-menu renderer. Runtime is O(1). No external state is mutated.
|
|
4307
|
+
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4308
|
+
- @return {PiUsereqSettingsMenuChoice[]} Ordered Pushover-menu choice vector.
|
|
4309
|
+
- @satisfies REQ-163, REQ-165, REQ-166, REQ-172
|
|
4310
|
+
|
|
4311
|
+
### fn `async function selectPiNotifyPushoverPriority(` (L761-783)
|
|
4312
|
+
- @brief Opens the shared settings-menu selector for Pushover priority.
|
|
4313
|
+
- @details Reuses the pi-usereq settings-menu renderer so Pushover priority selection remains stylistically aligned with the existing notification menus and returns the chosen priority or `undefined` on cancel. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
4314
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4315
|
+
- @param[in] currentPriority {PiNotifyPushoverPriority} Persisted priority value.
|
|
4316
|
+
- @return {Promise<PiNotifyPushoverPriority | undefined>} Selected priority or `undefined` when cancelled.
|
|
4317
|
+
- @satisfies REQ-165
|
|
4318
|
+
|
|
4319
|
+
### fn `async function configurePiNotifyPushoverMenu(` (L793-842)
|
|
4320
|
+
- @brief Runs the interactive Pushover-configuration menu.
|
|
4321
|
+
- @details Exposes the Pushover global-disable flag, successful-completion enable flag, user key, API token, and priority selector through the shared settings-menu renderer. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
4322
|
+
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4323
|
+
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4324
|
+
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
4325
|
+
- @satisfies REQ-163, REQ-165, REQ-166, REQ-172
|
|
4326
|
+
|
|
4327
|
+
### fn `function buildPiNotifyMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L851-914)
|
|
4320
4328
|
- @brief Builds the shared settings-menu choices for notification configuration.
|
|
4321
|
-
- @details Serializes the current beep flags, selected notify command, hotkey bind,
|
|
4329
|
+
- @details Serializes the current beep flags, selected notify command, hotkey bind, per-level notify commands, and the Pushover submenu entry into right-valued menu rows consumed by the shared settings-menu renderer. Runtime is O(1) plus command-length formatting. No external state is mutated.
|
|
4322
4330
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4323
4331
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered notification-menu choice vector.
|
|
4324
|
-
- @satisfies REQ-137, REQ-149, REQ-150, REQ-151, REQ-152
|
|
4332
|
+
- @satisfies REQ-137, REQ-149, REQ-150, REQ-151, REQ-152, REQ-163, REQ-164, REQ-165, REQ-166, REQ-172
|
|
4325
4333
|
|
|
4326
|
-
### fn `async function selectPiNotifySoundLevel(` (
|
|
4334
|
+
### fn `async function selectPiNotifySoundLevel(` (L924-955)
|
|
4327
4335
|
- @brief Opens the shared settings-menu selector for the selected notify command.
|
|
4328
4336
|
- @details Reuses the pi-usereq settings-menu renderer so notify-command selection remains stylistically aligned with the main configuration UI and returns the chosen sound level or `undefined` on cancel. Runtime depends on user interaction count. Side effects are limited to transient custom-UI rendering.
|
|
4329
4337
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
@@ -4331,15 +4339,15 @@ runtime cost.
|
|
|
4331
4339
|
- @return {Promise<PiNotifySoundLevel | undefined>} Selected sound level or `undefined` when cancelled.
|
|
4332
4340
|
- @satisfies REQ-131, REQ-137, REQ-149, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4333
4341
|
|
|
4334
|
-
### fn `async function configurePiNotifyMenu(` (
|
|
4342
|
+
### fn `async function configurePiNotifyMenu(` (L965-1034)
|
|
4335
4343
|
- @brief Runs the interactive notification-configuration menu.
|
|
4336
|
-
- @details Exposes prompt-end beep toggles, selected notify-command selection, hotkey-bind editing,
|
|
4344
|
+
- @details Exposes prompt-end beep toggles, selected notify-command selection, hotkey-bind editing, per-level notify-command editors, and the nested Pushover submenu through the shared settings-menu renderer. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
4337
4345
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4338
4346
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4339
4347
|
- @return {Promise<boolean>} `true` when the sound-toggle shortcut changed.
|
|
4340
|
-
- @satisfies REQ-129, REQ-131, REQ-133, REQ-134, REQ-137, REQ-149, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4348
|
+
- @satisfies REQ-129, REQ-131, REQ-133, REQ-134, REQ-137, REQ-149, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-163, REQ-164, REQ-165, REQ-166, REQ-172
|
|
4341
4349
|
|
|
4342
|
-
### fn `function registerPiNotifyShortcut(` (
|
|
4350
|
+
### fn `function registerPiNotifyShortcut(` (L1049-1069)
|
|
4343
4351
|
- @brief Registers the configurable successful-run sound shortcut when supported.
|
|
4344
4352
|
- @details Loads the current project config, registers one raw pi shortcut when
|
|
4345
4353
|
the runtime exposes `registerShortcut(...)`, cycles persisted sound state on
|
|
@@ -4352,21 +4360,22 @@ updates.
|
|
|
4352
4360
|
- @return {void} No return value.
|
|
4353
4361
|
- @satisfies REQ-131, REQ-134, REQ-136
|
|
4354
4362
|
|
|
4355
|
-
### fn `function registerPromptCommands(
|
|
4363
|
+
### fn `function registerPromptCommands(` (L1079-1099)
|
|
4356
4364
|
- @brief Registers bundled prompt commands with the extension.
|
|
4357
|
-
- @details Creates one `req-<prompt>` command per bundled prompt name. Each handler ensures resources exist, renders the prompt, and sends it into the current active session. Runtime is O(p) for registration; handler cost depends on prompt rendering plus prompt dispatch. Side effects include command registration and user-message delivery during execution.
|
|
4365
|
+
- @details Creates one `req-<prompt>` command per bundled prompt name. Each handler ensures resources exist, records the prompt metadata needed for successful completion notifications, renders the prompt, and sends it into the current active session. Runtime is O(p) for registration; handler cost depends on prompt rendering plus prompt dispatch. Side effects include command registration, status-controller mutation, and user-message delivery during execution.
|
|
4358
4366
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4367
|
+
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4359
4368
|
- @return {void} No return value.
|
|
4360
|
-
- @satisfies REQ-004, REQ-067, REQ-068
|
|
4369
|
+
- @satisfies REQ-004, REQ-067, REQ-068, REQ-169
|
|
4361
4370
|
|
|
4362
|
-
### fn `function registerAgentTools(pi: ExtensionAPI): void` (
|
|
4371
|
+
### fn `function registerAgentTools(pi: ExtensionAPI): void` (L1109-1408)
|
|
4363
4372
|
- @brief Registers pi-usereq agent tools exposed to the model.
|
|
4364
4373
|
- @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.
|
|
4365
4374
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4366
4375
|
- @return {void} No return value.
|
|
4367
4376
|
- @satisfies REQ-005, REQ-010, REQ-011, REQ-014, REQ-017, REQ-044, REQ-045, 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
|
|
4368
4377
|
|
|
4369
|
-
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4378
|
+
### fn `function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1737-1777)
|
|
4370
4379
|
- @brief Builds the shared settings-menu choices for startup-tool management.
|
|
4371
4380
|
- @details Serializes startup-tool actions into right-valued menu rows consumed by the shared settings-menu renderer. Runtime is O(t) in configurable-tool count. No external state is mutated.
|
|
4372
4381
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4374,7 +4383,7 @@ updates.
|
|
|
4374
4383
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered startup-tool menu choices.
|
|
4375
4384
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4376
4385
|
|
|
4377
|
-
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4386
|
+
### fn `function buildPiUsereqToolToggleChoices(pi: ExtensionAPI, config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1787-1803)
|
|
4378
4387
|
- @brief Builds the shared settings-menu choices for per-tool startup toggles.
|
|
4379
4388
|
- @details Exposes every configurable startup tool as one row whose right-side value reports the current enabled state. Runtime is O(t) in configurable-tool count. No external state is mutated.
|
|
4380
4389
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4382,7 +4391,7 @@ updates.
|
|
|
4382
4391
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered per-tool toggle choices.
|
|
4383
4392
|
- @satisfies REQ-007, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4384
4393
|
|
|
4385
|
-
### fn `async function configurePiUsereqToolsMenu(pi: ExtensionAPI, ctx: ExtensionCommandContext, config: UseReqConfig): Promise<void>` (
|
|
4394
|
+
### fn `async function configurePiUsereqToolsMenu(pi: ExtensionAPI, ctx: ExtensionCommandContext, config: UseReqConfig): Promise<void>` (L1814-1865)
|
|
4386
4395
|
- @brief Runs the interactive active-tool configuration menu.
|
|
4387
4396
|
- @details Synchronizes runtime active tools with persisted config, renders startup-tool actions through the shared settings-menu UI, 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.
|
|
4388
4397
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4391,92 +4400,87 @@ updates.
|
|
|
4391
4400
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
4392
4401
|
- @satisfies REQ-007, REQ-063, REQ-064, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4393
4402
|
|
|
4394
|
-
### fn `function formatStaticCheckEntry(entry: StaticCheckEntry): string` (
|
|
4403
|
+
### fn `function formatStaticCheckEntry(entry: StaticCheckEntry): string` (L1873-1879)
|
|
4395
4404
|
- @brief Formats one static-check configuration entry for UI display.
|
|
4396
4405
|
- @details Renders command-backed entries as `Command(cmd args...)` and all other modules as `Module(args...)`. Runtime is O(n) in parameter count. No side effects occur.
|
|
4397
4406
|
- @param[in] entry {StaticCheckEntry} Static-check configuration entry.
|
|
4398
4407
|
- @return {string} Human-readable entry summary.
|
|
4399
4408
|
|
|
4400
|
-
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (
|
|
4409
|
+
### fn `function formatStaticCheckLanguagesSummary(config: UseReqConfig): string` (L1887-1893)
|
|
4401
4410
|
- @brief Summarizes configured static-check languages.
|
|
4402
4411
|
- @details Keeps only languages with at least one configured checker, sorts them, and emits a compact `Language (count)` list. Runtime is O(l log l). No side effects occur.
|
|
4403
4412
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4404
4413
|
- @return {string} Compact summary string or `(none)`.
|
|
4405
4414
|
|
|
4406
|
-
### fn `function renderStaticCheckReference(config: UseReqConfig): string` (
|
|
4415
|
+
### fn `function renderStaticCheckReference(config: UseReqConfig): string` (L1901-1929)
|
|
4407
4416
|
- @brief Renders the static-check configuration reference view.
|
|
4408
|
-
- @details Produces a markdown-like summary containing configured entries, supported languages,
|
|
4417
|
+
- @details Produces a markdown-like summary containing configured entries, supported languages, the Command-only user module surface, and canonical example specifications. Runtime is O(l log l). No side effects occur.
|
|
4409
4418
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4410
4419
|
- @return {string} Reference text for the editor view.
|
|
4411
4420
|
|
|
4412
|
-
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4421
|
+
### fn `function buildStaticCheckMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1938-1973)
|
|
4413
4422
|
- @brief Builds the shared settings-menu choices for static-check management.
|
|
4414
|
-
- @details Serializes static-check actions into right-valued menu rows consumed by the shared settings-menu renderer. Runtime is O(1). No external state is mutated.
|
|
4423
|
+
- @details Serializes Command-oriented static-check actions into right-valued menu rows consumed by the shared settings-menu renderer while omitting user-facing module selection. Runtime is O(1). No external state is mutated.
|
|
4415
4424
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4416
4425
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered static-check menu choices.
|
|
4417
|
-
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4426
|
+
- @satisfies REQ-008, REQ-160, REQ-161, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4418
4427
|
|
|
4419
|
-
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4428
|
+
### fn `function buildSupportedStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1981-2000)
|
|
4420
4429
|
- @brief Builds the shared settings-menu choices for supported static-check languages.
|
|
4421
|
-
- @details Exposes every supported language as one row whose right-side value reports extensions plus the current configured checker count. Runtime is O(l log l). No external state is mutated.
|
|
4430
|
+
- @details Exposes every supported language as one row whose right-side value reports extensions plus the current configured checker count for Command-oriented configuration flows. Runtime is O(l log l). No external state is mutated.
|
|
4422
4431
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4423
4432
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered language-choice vector.
|
|
4424
4433
|
|
|
4425
|
-
### fn `function
|
|
4426
|
-
- @brief Builds the shared settings-menu choices for static-check modules.
|
|
4427
|
-
- @details Exposes every supported static-check module as one selectable row with a concise execution description. Runtime is O(m) in module count. No external state is mutated.
|
|
4428
|
-
- @param[in] language {string} Canonical selected language.
|
|
4429
|
-
- @return {PiUsereqSettingsMenuChoice[]} Ordered module-choice vector.
|
|
4430
|
-
|
|
4431
|
-
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L1853-1870)
|
|
4434
|
+
### fn `function buildConfiguredStaticCheckLanguageChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2008-2025)
|
|
4432
4435
|
- @brief Builds the shared settings-menu choices for configured static-check languages.
|
|
4433
4436
|
- @details Exposes only languages that currently have at least one configured checker so removal remains deterministic. Runtime is O(l log l). No external state is mutated.
|
|
4434
4437
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4435
4438
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered configured-language vector.
|
|
4436
4439
|
|
|
4437
|
-
### fn `async function configureStaticCheckMenu(ctx: ExtensionCommandContext, config: UseReqConfig): Promise<void>` (
|
|
4440
|
+
### fn `async function configureStaticCheckMenu(ctx: ExtensionCommandContext, config: UseReqConfig): Promise<void>` (L2035-2101)
|
|
4438
4441
|
- @brief Runs the interactive static-check configuration menu.
|
|
4439
|
-
- @details Lets the user inspect support, add entries by guided prompts or raw spec strings, and remove configured language entries through the shared settings-menu renderer until the user exits. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
4442
|
+
- @details Lets the user inspect support, add Command entries by guided prompts or raw spec strings, and remove configured language entries through the shared settings-menu renderer until the user exits. Runtime depends on user interaction count. Side effects include UI updates and config mutation.
|
|
4440
4443
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4441
4444
|
- @param[in,out] config {UseReqConfig} Mutable configuration object.
|
|
4442
4445
|
- @return {Promise<void>} Promise resolved when the menu closes.
|
|
4443
|
-
- @satisfies REQ-008, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4446
|
+
- @satisfies REQ-008, REQ-160, REQ-161, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4444
4447
|
|
|
4445
|
-
### fn `function buildPiUsereqMenuChoices(
|
|
4448
|
+
### fn `function buildPiUsereqMenuChoices(` (L2111-2172)
|
|
4446
4449
|
- @brief Builds the shared settings-menu choices for the top-level pi-usereq configuration UI.
|
|
4447
|
-
- @details Serializes primary configuration actions into right-valued menu rows consumed by the shared settings-menu renderer
|
|
4450
|
+
- @details Serializes primary configuration actions into right-valued menu rows consumed by the shared settings-menu renderer, including the display-only config path beside `show-config`. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
4451
|
+
- @param[in] cwd {string} Current working directory.
|
|
4448
4452
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4449
4453
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered top-level menu choices.
|
|
4450
|
-
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152
|
|
4454
|
+
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-162
|
|
4451
4455
|
|
|
4452
|
-
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4456
|
+
### fn `function buildSrcDirMenuChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2181-2202)
|
|
4453
4457
|
- @brief Builds the shared settings-menu choices for source-directory management.
|
|
4454
4458
|
- @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.
|
|
4455
4459
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4456
4460
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered source-directory management choices.
|
|
4457
4461
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4458
4462
|
|
|
4459
|
-
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (
|
|
4463
|
+
### fn `function buildSrcDirRemovalChoices(config: UseReqConfig): PiUsereqSettingsMenuChoice[]` (L2211-2226)
|
|
4460
4464
|
- @brief Builds the shared settings-menu choices for removing one source-directory entry.
|
|
4461
4465
|
- @details Exposes every configured `src-dir` entry as one removable row and appends a `Back` action for cancellation. Runtime is O(s) in source-directory count. No external state is mutated.
|
|
4462
4466
|
- @param[in] config {UseReqConfig} Effective project configuration.
|
|
4463
4467
|
- @return {PiUsereqSettingsMenuChoice[]} Ordered removable source-directory choices.
|
|
4464
4468
|
- @satisfies REQ-006, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4465
4469
|
|
|
4466
|
-
### fn `async function configurePiUsereq(` (
|
|
4470
|
+
### fn `async function configurePiUsereq(` (L2237-2322)
|
|
4467
4471
|
- @brief Runs the top-level pi-usereq configuration menu.
|
|
4468
|
-
- @details Loads project config, exposes docs/test/source/static-check/startup-tool/notification actions through the shared settings-menu renderer, persists changes on exit, and refreshes the single-line status bar. Runtime depends on user interaction count. Side effects include UI updates, config writes,
|
|
4472
|
+
- @details Loads project config, exposes docs/test/source/static-check/startup-tool/notification actions through the shared settings-menu renderer, persists changes on exit, 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.
|
|
4469
4473
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4470
4474
|
- @param[in] ctx {ExtensionCommandContext} Active command context.
|
|
4471
4475
|
- @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
|
|
4472
4476
|
- @return {Promise<void>} Promise resolved when configuration is saved and the menu closes.
|
|
4473
|
-
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154
|
|
4477
|
+
- @satisfies REQ-006, REQ-031, REQ-137, REQ-150, REQ-151, REQ-152, REQ-153, REQ-154, REQ-162
|
|
4474
4478
|
|
|
4475
|
-
### fn `const ensureSaved = () => saveProjectConfig(ctx.cwd, config)` (
|
|
4479
|
+
### fn `const ensureSaved = () => saveProjectConfig(ctx.cwd, config)` (L2245-2249)
|
|
4476
4480
|
|
|
4477
|
-
### fn `const refreshStatus = () =>` (
|
|
4481
|
+
### fn `const refreshStatus = () =>` (L2246-2249)
|
|
4478
4482
|
|
|
4479
|
-
### fn `function registerConfigCommands(` (
|
|
4483
|
+
### fn `function registerConfigCommands(` (L2332-2342)
|
|
4480
4484
|
- @brief Registers configuration-management commands.
|
|
4481
4485
|
- @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.
|
|
4482
4486
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
@@ -4484,71 +4488,75 @@ updates.
|
|
|
4484
4488
|
- @return {void} No return value.
|
|
4485
4489
|
- @satisfies REQ-006, REQ-031
|
|
4486
4490
|
|
|
4487
|
-
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (
|
|
4491
|
+
### fn `export default function piUsereqExtension(pi: ExtensionAPI): void` (L2360-2368)
|
|
4488
4492
|
- @brief Registers the complete pi-usereq extension.
|
|
4489
4493
|
- @details Validates installation-owned bundled resources, registers prompt and
|
|
4490
4494
|
configuration commands plus agent tools, registers the configurable
|
|
4491
4495
|
successful-run sound shortcut when the runtime supports shortcuts, and
|
|
4492
4496
|
installs shared wrappers for all supported pi lifecycle hooks so status
|
|
4493
|
-
telemetry, context usage, prompt timing,
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
+
telemetry, context usage, prompt timing, cumulative runtime, prompt-specific
|
|
4498
|
+
Pushover metadata, and pi-notify effects remain synchronized with runtime
|
|
4499
|
+
events. Runtime is O(h) in hook
|
|
4500
|
+
count during registration. Side effects include filesystem reads,
|
|
4501
|
+
command/tool/shortcut registration, UI updates, active-tool changes, and
|
|
4502
|
+
timer scheduling.
|
|
4497
4503
|
- @param[in] pi {ExtensionAPI} Active extension API instance.
|
|
4498
4504
|
- @return {void} No return value.
|
|
4499
|
-
- @satisfies DES-002, REQ-004, REQ-005, REQ-009, REQ-044, REQ-045, REQ-067, REQ-068, REQ-109, REQ-
|
|
4505
|
+
- @satisfies DES-002, REQ-004, REQ-005, REQ-009, REQ-044, REQ-045, 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-129, REQ-130, REQ-131, REQ-132, REQ-133, REQ-134, REQ-135, REQ-136, REQ-137, REQ-148, REQ-159, REQ-163, REQ-164, REQ-165, REQ-166, REQ-167, REQ-168, REQ-169, REQ-170, REQ-171, REQ-172
|
|
4500
4506
|
|
|
4501
4507
|
## Symbol Index
|
|
4502
4508
|
|Symbol|Kind|Vis|Lines|Sig|
|
|
4503
4509
|
|---|---|---|---|---|
|
|
4504
|
-
|`PiShortcutRegistrar`|iface||
|
|
4505
|
-
|`getProjectBase`|fn||
|
|
4506
|
-
|`
|
|
4507
|
-
|`
|
|
4508
|
-
|`
|
|
4509
|
-
|`collectProjectStaticCheckSelection`|fn||
|
|
4510
|
-
|`buildTokenToolExecutionStderr`|fn||
|
|
4511
|
-
|`buildTokenToolExecuteResult`|fn||
|
|
4512
|
-
|`buildReferenceToolExecuteResult`|fn||
|
|
4513
|
-
|`buildCompressionToolExecuteResult`|fn||
|
|
4514
|
-
|`buildFindToolSupportedTagGuidelines`|fn||
|
|
4515
|
-
|`buildFindToolSchemaDescription`|fn||
|
|
4516
|
-
|`buildFindToolPromptGuidelines`|fn||
|
|
4517
|
-
|`buildFindToolExecuteResult`|fn||
|
|
4518
|
-
|`deliverPromptCommand`|fn||
|
|
4519
|
-
|`getPiUsereqStartupTools`|fn||
|
|
4520
|
-
|`getConfiguredEnabledPiUsereqTools`|fn||
|
|
4521
|
-
|`getPiUsereqToolKind`|fn||
|
|
4522
|
-
|`applyConfiguredPiUsereqTools`|fn||
|
|
4523
|
-
|`handleExtensionStatusEvent`|fn||
|
|
4524
|
-
|`registerExtensionStatusHooks`|fn||
|
|
4525
|
-
|`setConfiguredPiUsereqTools`|fn||
|
|
4526
|
-
|`renderPiUsereqToolsReference`|fn||
|
|
4527
|
-
|`PiNotifyBeepConfigKey`|type||
|
|
4528
|
-
|`togglePiNotifyBeepFlag`|fn||
|
|
4529
|
-
|`
|
|
4530
|
-
|`
|
|
4531
|
-
|`
|
|
4532
|
-
|`
|
|
4533
|
-
|`
|
|
4534
|
-
|`
|
|
4535
|
-
|`
|
|
4536
|
-
|`
|
|
4537
|
-
|`
|
|
4538
|
-
|`
|
|
4539
|
-
|`
|
|
4540
|
-
|`
|
|
4541
|
-
|`
|
|
4542
|
-
|`
|
|
4543
|
-
|`
|
|
4544
|
-
|`
|
|
4545
|
-
|`
|
|
4546
|
-
|`
|
|
4547
|
-
|`
|
|
4548
|
-
|`
|
|
4549
|
-
|`
|
|
4550
|
-
|`
|
|
4551
|
-
|`
|
|
4552
|
-
|`
|
|
4553
|
-
|`
|
|
4554
|
-
|
|
4510
|
+
|`PiShortcutRegistrar`|iface||143-151|interface PiShortcutRegistrar|
|
|
4511
|
+
|`getProjectBase`|fn||159-161|function getProjectBase(cwd: string): string|
|
|
4512
|
+
|`loadProjectConfig`|fn||170-173|function loadProjectConfig(cwd: string): UseReqConfig|
|
|
4513
|
+
|`saveProjectConfig`|fn||183-186|function saveProjectConfig(cwd: string, config: UseReqCon...|
|
|
4514
|
+
|`formatProjectConfigPathForMenu`|fn||197-199|function formatProjectConfigPathForMenu(cwd: string): string|
|
|
4515
|
+
|`collectProjectStaticCheckSelection`|fn||208-239|function collectProjectStaticCheckSelection(|
|
|
4516
|
+
|`buildTokenToolExecutionStderr`|fn||247-255|function buildTokenToolExecutionStderr(payload: TokenTool...|
|
|
4517
|
+
|`buildTokenToolExecuteResult`|fn||264-279|function buildTokenToolExecuteResult(|
|
|
4518
|
+
|`buildReferenceToolExecuteResult`|fn||288-304|function buildReferenceToolExecuteResult(|
|
|
4519
|
+
|`buildCompressionToolExecuteResult`|fn||313-329|function buildCompressionToolExecuteResult(|
|
|
4520
|
+
|`buildFindToolSupportedTagGuidelines`|fn||390-394|function buildFindToolSupportedTagGuidelines(): string[]|
|
|
4521
|
+
|`buildFindToolSchemaDescription`|fn||402-407|function buildFindToolSchemaDescription(scope: FindToolSc...|
|
|
4522
|
+
|`buildFindToolPromptGuidelines`|fn||415-431|function buildFindToolPromptGuidelines(scope: FindToolSco...|
|
|
4523
|
+
|`buildFindToolExecuteResult`|fn||440-457|function buildFindToolExecuteResult(|
|
|
4524
|
+
|`deliverPromptCommand`|fn||467-469|async function deliverPromptCommand(pi: ExtensionAPI, con...|
|
|
4525
|
+
|`getPiUsereqStartupTools`|fn||478-483|function getPiUsereqStartupTools(pi: ExtensionAPI): ToolI...|
|
|
4526
|
+
|`getConfiguredEnabledPiUsereqTools`|fn||491-495|function getConfiguredEnabledPiUsereqTools(config: UseReq...|
|
|
4527
|
+
|`getPiUsereqToolKind`|fn||503-508|function getPiUsereqToolKind(tool: ToolInfo): "builtin" |...|
|
|
4528
|
+
|`applyConfiguredPiUsereqTools`|fn||518-535|function applyConfiguredPiUsereqTools(pi: ExtensionAPI, c...|
|
|
4529
|
+
|`handleExtensionStatusEvent`|fn||557-593|async function handleExtensionStatusEvent(|
|
|
4530
|
+
|`registerExtensionStatusHooks`|fn||606-619|function registerExtensionStatusHooks(|
|
|
4531
|
+
|`setConfiguredPiUsereqTools`|fn||629-632|function setConfiguredPiUsereqTools(pi: ExtensionAPI, con...|
|
|
4532
|
+
|`renderPiUsereqToolsReference`|fn||641-669|function renderPiUsereqToolsReference(pi: ExtensionAPI, c...|
|
|
4533
|
+
|`PiNotifyBeepConfigKey`|type||677||
|
|
4534
|
+
|`togglePiNotifyBeepFlag`|fn||689-692|function togglePiNotifyBeepFlag(config: UseReqConfig, key...|
|
|
4535
|
+
|`formatPiNotifyPushoverPriority`|fn||701-703|function formatPiNotifyPushoverPriority(priority: PiNotif...|
|
|
4536
|
+
|`buildPiNotifyPushoverMenuChoices`|fn||712-751|function buildPiNotifyPushoverMenuChoices(config: UseReqC...|
|
|
4537
|
+
|`selectPiNotifyPushoverPriority`|fn||761-783|async function selectPiNotifyPushoverPriority(|
|
|
4538
|
+
|`configurePiNotifyPushoverMenu`|fn||793-842|async function configurePiNotifyPushoverMenu(|
|
|
4539
|
+
|`buildPiNotifyMenuChoices`|fn||851-914|function buildPiNotifyMenuChoices(config: UseReqConfig): ...|
|
|
4540
|
+
|`selectPiNotifySoundLevel`|fn||924-955|async function selectPiNotifySoundLevel(|
|
|
4541
|
+
|`configurePiNotifyMenu`|fn||965-1034|async function configurePiNotifyMenu(|
|
|
4542
|
+
|`registerPiNotifyShortcut`|fn||1049-1069|function registerPiNotifyShortcut(|
|
|
4543
|
+
|`registerPromptCommands`|fn||1079-1099|function registerPromptCommands(|
|
|
4544
|
+
|`registerAgentTools`|fn||1109-1408|function registerAgentTools(pi: ExtensionAPI): void|
|
|
4545
|
+
|`buildPiUsereqToolsMenuChoices`|fn||1737-1777|function buildPiUsereqToolsMenuChoices(pi: ExtensionAPI, ...|
|
|
4546
|
+
|`buildPiUsereqToolToggleChoices`|fn||1787-1803|function buildPiUsereqToolToggleChoices(pi: ExtensionAPI,...|
|
|
4547
|
+
|`configurePiUsereqToolsMenu`|fn||1814-1865|async function configurePiUsereqToolsMenu(pi: ExtensionAP...|
|
|
4548
|
+
|`formatStaticCheckEntry`|fn||1873-1879|function formatStaticCheckEntry(entry: StaticCheckEntry):...|
|
|
4549
|
+
|`formatStaticCheckLanguagesSummary`|fn||1887-1893|function formatStaticCheckLanguagesSummary(config: UseReq...|
|
|
4550
|
+
|`renderStaticCheckReference`|fn||1901-1929|function renderStaticCheckReference(config: UseReqConfig)...|
|
|
4551
|
+
|`buildStaticCheckMenuChoices`|fn||1938-1973|function buildStaticCheckMenuChoices(config: UseReqConfig...|
|
|
4552
|
+
|`buildSupportedStaticCheckLanguageChoices`|fn||1981-2000|function buildSupportedStaticCheckLanguageChoices(config:...|
|
|
4553
|
+
|`buildConfiguredStaticCheckLanguageChoices`|fn||2008-2025|function buildConfiguredStaticCheckLanguageChoices(config...|
|
|
4554
|
+
|`configureStaticCheckMenu`|fn||2035-2101|async function configureStaticCheckMenu(ctx: ExtensionCom...|
|
|
4555
|
+
|`buildPiUsereqMenuChoices`|fn||2111-2172|function buildPiUsereqMenuChoices(|
|
|
4556
|
+
|`buildSrcDirMenuChoices`|fn||2181-2202|function buildSrcDirMenuChoices(config: UseReqConfig): Pi...|
|
|
4557
|
+
|`buildSrcDirRemovalChoices`|fn||2211-2226|function buildSrcDirRemovalChoices(config: UseReqConfig):...|
|
|
4558
|
+
|`configurePiUsereq`|fn||2237-2322|async function configurePiUsereq(|
|
|
4559
|
+
|`ensureSaved`|fn||2245-2249|const ensureSaved = () => saveProjectConfig(ctx.cwd, config)|
|
|
4560
|
+
|`refreshStatus`|fn||2246-2249|const refreshStatus = () =>|
|
|
4561
|
+
|`registerConfigCommands`|fn||2332-2342|function registerConfigCommands(|
|
|
4562
|
+
|`piUsereqExtension`|fn||2360-2368|export default function piUsereqExtension(pi: ExtensionAP...|
|