pi-usereq 0.11.0 → 0.13.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/CHANGELOG.md +59 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +1135 -834
- package/pi-usereq/docs/REQUIREMENTS.md +177 -110
- package/pi-usereq/docs/WORKFLOW.md +244 -79
- package/scripts/lib/extension-debug-harness.ts +2 -2
- package/scripts/tool-args-to-params.ts +2 -2
- package/src/cli.ts +12 -12
- package/src/core/config.ts +541 -180
- package/src/core/extension-status.ts +69 -12
- package/src/core/path-context.ts +19 -4
- package/src/core/pi-notify.ts +5 -5
- package/src/core/pi-usereq-tools.ts +4 -2
- package/src/core/prompt-command-catalog.ts +4 -5
- package/src/core/prompt-command-runtime.ts +183 -44
- package/src/core/prompts.ts +0 -2
- package/src/core/req-references-command.ts +175 -0
- package/src/core/req-reset-command.ts +323 -0
- package/src/core/resources.ts +6 -23
- package/src/core/settings-menu.ts +85 -28
- package/src/core/tool-runner.ts +26 -6
- package/src/index.ts +601 -116
- package/tests/attended-results-scenarios.ts +15 -9
- package/tests/cli-command-option-parity.test.ts +53 -35
- package/tests/debug-extension-harness.test.ts +8 -10
- package/tests/extension-registration.test.ts +1204 -205
- package/tests/helpers.ts +29 -6
- package/tests/oracle-project.test.ts +4 -4
- package/tests/oracle-standalone.test.ts +5 -5
- package/src/core/reference-payload.ts +0 -752
- package/src/resources/prompts/references.md +0 -64
- /package/tests/fixtures_attended_results/project/{references.json → summarize.json} +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_c.c.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_cpp.cpp.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_csharp.cs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_elixir.ex.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_go.go.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_haskell.hs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_java.java.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_javascript.js.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_kotlin.kt.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_lua.lua.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_perl.pl.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_php.php.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_python.py.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_ruby.rb.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_rust.rs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_scala.scala.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_shell.sh.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_swift.swift.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_typescript.ts.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_zig.zig.json +0 -0
|
@@ -211,10 +211,10 @@ const PROMPT_COMMAND_EXAMPLES: Record<string, string> = {
|
|
|
211
211
|
*/
|
|
212
212
|
const TOOL_EXAMPLES: Record<string, string> = {
|
|
213
213
|
"files-tokens": `npm run debug:ext:tool -- --name files-tokens --params '{"files":["pi-usereq/docs/REQUIREMENTS.md","pi-usereq/docs/WORKFLOW.md"]}' --cwd . --format json`,
|
|
214
|
-
"files-
|
|
214
|
+
"files-summarize": `npm run debug:ext:tool -- --name files-summarize --params '{"files":["src/index.ts","src/core/tool-runner.ts"]}' --cwd . --format pretty`,
|
|
215
215
|
"files-compress": `npm run debug:ext:tool -- --name files-compress --params '{"files":["src/index.ts"],"enableLineNumbers":true}' --cwd . --format json`,
|
|
216
216
|
"files-search": `npm run debug:ext:tool -- --name files-search --params '{"tag":"FUNCTION|METHOD","pattern":"^run","files":["src/core/tool-runner.ts"],"enableLineNumbers":true}' --cwd . --format pretty`,
|
|
217
|
-
|
|
217
|
+
summarize: "npm run debug:ext:tool -- --name summarize --cwd . --format pretty",
|
|
218
218
|
compress: `npm run debug:ext:tool -- --name compress --params '{"enableLineNumbers":true}' --cwd . --format json`,
|
|
219
219
|
search: `npm run debug:ext:tool -- --name search --params '{"tag":"FUNCTION","pattern":"^run","enableLineNumbers":true}' --cwd . --format pretty`,
|
|
220
220
|
tokens: "npm run debug:ext:tool -- --name tokens --cwd . --format json",
|
|
@@ -97,7 +97,7 @@ function takeBooleanFlag(tokens: string[], flag: string): { tokens: string[]; pr
|
|
|
97
97
|
export function buildToolParamsFromArgsText(toolName: string, argsText: string): Record<string, unknown> {
|
|
98
98
|
const tokens = shellSplit(argsText);
|
|
99
99
|
switch (toolName) {
|
|
100
|
-
case "
|
|
100
|
+
case "summarize":
|
|
101
101
|
case "tokens":
|
|
102
102
|
case "static-check":
|
|
103
103
|
if (tokens.length !== 0) {
|
|
@@ -105,7 +105,7 @@ export function buildToolParamsFromArgsText(toolName: string, argsText: string):
|
|
|
105
105
|
}
|
|
106
106
|
return {};
|
|
107
107
|
case "files-tokens":
|
|
108
|
-
case "files-
|
|
108
|
+
case "files-summarize":
|
|
109
109
|
case "files-static-check":
|
|
110
110
|
return { files: tokens };
|
|
111
111
|
case "files-compress": {
|
package/src/cli.ts
CHANGED
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
runCompress,
|
|
21
21
|
runFilesCompress,
|
|
22
22
|
runFilesSearch,
|
|
23
|
-
|
|
23
|
+
runFilesSummarize,
|
|
24
24
|
runFilesStaticCheck,
|
|
25
25
|
runFilesTokens,
|
|
26
26
|
runSearch,
|
|
27
27
|
runProjectStaticCheck,
|
|
28
|
-
|
|
28
|
+
runSummarize,
|
|
29
29
|
runTokens,
|
|
30
30
|
} from "./core/tool-runner.js";
|
|
31
31
|
import {
|
|
@@ -46,10 +46,10 @@ interface ParsedArgs {
|
|
|
46
46
|
enableLineNumbers?: boolean;
|
|
47
47
|
enableStaticCheck?: string[];
|
|
48
48
|
filesTokens?: string[];
|
|
49
|
-
|
|
49
|
+
filesSummarize?: string[];
|
|
50
50
|
filesCompress?: string[];
|
|
51
51
|
filesSearch?: string[];
|
|
52
|
-
|
|
52
|
+
summarize?: boolean;
|
|
53
53
|
compress?: boolean;
|
|
54
54
|
search?: [string, string];
|
|
55
55
|
tokens?: boolean;
|
|
@@ -106,9 +106,9 @@ function parseArgs(argv: string[]): ParsedArgs {
|
|
|
106
106
|
index = next;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
|
-
case "--files-
|
|
109
|
+
case "--files-summarize": {
|
|
110
110
|
const [values, next] = takeUntilOption(index + 1);
|
|
111
|
-
parsed.
|
|
111
|
+
parsed.filesSummarize = values;
|
|
112
112
|
index = next;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
@@ -124,8 +124,8 @@ function parseArgs(argv: string[]): ParsedArgs {
|
|
|
124
124
|
index = next;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
|
-
case "--
|
|
128
|
-
parsed.
|
|
127
|
+
case "--summarize":
|
|
128
|
+
parsed.summarize = true;
|
|
129
129
|
index += 1;
|
|
130
130
|
break;
|
|
131
131
|
case "--compress":
|
|
@@ -256,12 +256,12 @@ export function main(argv = process.argv.slice(2)): number {
|
|
|
256
256
|
}
|
|
257
257
|
const args = parseArgs(argv);
|
|
258
258
|
const hereOnlyProjectCommand = !!(
|
|
259
|
-
args.
|
|
259
|
+
args.summarize || args.compress || args.tokens || args.search || args.staticCheck
|
|
260
260
|
);
|
|
261
261
|
if (hereOnlyProjectCommand) {
|
|
262
262
|
if (args.base) {
|
|
263
263
|
throw new ReqError(
|
|
264
|
-
"Error: --
|
|
264
|
+
"Error: --summarize, --compress, --tokens, --find, and --static-check do not allow --base; use --here.",
|
|
265
265
|
1,
|
|
266
266
|
);
|
|
267
267
|
}
|
|
@@ -281,12 +281,12 @@ export function main(argv = process.argv.slice(2)): number {
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
if (args.filesTokens) return writeResult(runFilesTokens(args.filesTokens));
|
|
284
|
-
if (args.
|
|
284
|
+
if (args.filesSummarize) return writeResult(runFilesSummarize(args.filesSummarize, process.cwd(), args.verbose));
|
|
285
285
|
if (args.filesCompress) return writeResult(runFilesCompress(args.filesCompress, process.cwd(), args.enableLineNumbers, args.verbose));
|
|
286
286
|
if (args.filesSearch) return writeResult(runFilesSearch(args.filesSearch, args.enableLineNumbers, args.verbose));
|
|
287
287
|
if (args.testStaticCheck) return runStaticCheck(args.testStaticCheck);
|
|
288
288
|
if (args.filesStaticCheck) return writeResult(runFilesStaticCheck(args.filesStaticCheck, projectBase, config));
|
|
289
|
-
if (args.
|
|
289
|
+
if (args.summarize) return writeResult(runSummarize(projectBase, config, args.verbose));
|
|
290
290
|
if (args.compress) return writeResult(runCompress(projectBase, config, args.enableLineNumbers, args.verbose));
|
|
291
291
|
if (args.search) return writeResult(runSearch(projectBase, args.search[0], args.search[1], config, args.enableLineNumbers, args.verbose));
|
|
292
292
|
if (args.tokens) return writeResult(runTokens(projectBase, config));
|