pi-usereq 0.11.0 → 0.12.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 +48 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +818 -691
- package/pi-usereq/docs/REQUIREMENTS.md +131 -77
- package/pi-usereq/docs/WORKFLOW.md +185 -51
- 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/extension-status.ts +69 -12
- 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 +523 -85
- package/tests/attended-results-scenarios.ts +5 -5
- package/tests/cli-command-option-parity.test.ts +25 -25
- package/tests/debug-extension-harness.test.ts +1 -1
- package/tests/extension-registration.test.ts +1029 -82
- 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
|
@@ -312,9 +312,9 @@ function buildStandaloneScenarios(): AttendedScenario[] {
|
|
|
312
312
|
["--files-tokens", relativeFixturePath],
|
|
313
313
|
),
|
|
314
314
|
createStandaloneScenario(
|
|
315
|
-
`standalone/files-
|
|
316
|
-
path.posix.join("standalone", "files-
|
|
317
|
-
["--files-
|
|
315
|
+
`standalone/files-summarize/${fixtureName}`,
|
|
316
|
+
path.posix.join("standalone", "files-summarize", `${fixtureName}.json`),
|
|
317
|
+
["--files-summarize", relativeFixturePath],
|
|
318
318
|
),
|
|
319
319
|
createStandaloneScenario(
|
|
320
320
|
`standalone/files-compress/${fixtureName}`,
|
|
@@ -369,10 +369,10 @@ function getFailingStaticCheckConfig(): UseReqConfig["static-check"] {
|
|
|
369
369
|
*/
|
|
370
370
|
function buildProjectScenarios(): AttendedScenario[] {
|
|
371
371
|
return [
|
|
372
|
-
createProjectScenario("project/
|
|
372
|
+
createProjectScenario("project/summarize", path.posix.join("project", "summarize.json"), () => {
|
|
373
373
|
const { projectBase } = initFixtureRepo();
|
|
374
374
|
return {
|
|
375
|
-
args: ["--
|
|
375
|
+
args: ["--summarize"],
|
|
376
376
|
cwd: projectBase,
|
|
377
377
|
normalize: createProjectNormalizer(projectBase),
|
|
378
378
|
cleanup: () => removePath(projectBase),
|
|
@@ -171,18 +171,18 @@ const IMPORTED_CASE_MAPPINGS: ImportedCaseMapping[] = [
|
|
|
171
171
|
{ sourceId: "test_files_commands.py::TestFilesTokensCommand::test_files_tokens_no_base_required", targetId: "oracle::standalone::files-tokens-explicit-files" },
|
|
172
172
|
{ sourceId: "test_files_commands.py::TestFilesTokensCommand::test_files_tokens_skip_missing", targetId: "oracle::standalone::files-tokens-explicit-files" },
|
|
173
173
|
{ sourceId: "test_files_commands.py::TestFilesTokensCommand::test_files_tokens_all_missing_errors", targetId: "oracle::standalone::files-tokens-explicit-files" },
|
|
174
|
-
{ sourceId: "test_files_commands.py::
|
|
175
|
-
{ sourceId: "test_files_commands.py::
|
|
176
|
-
{ sourceId: "test_files_commands.py::
|
|
174
|
+
{ sourceId: "test_files_commands.py::TestFilesSummarizeCommand::test_files_summarize_basic", targetId: "direct::files-summarize-explicit-files" },
|
|
175
|
+
{ sourceId: "test_files_commands.py::TestFilesSummarizeCommand::test_files_summarize_no_base_required", targetId: "direct::files-summarize-explicit-files" },
|
|
176
|
+
{ sourceId: "test_files_commands.py::TestFilesSummarizeCommand::test_files_summarize_verbose_outputs_progress", targetId: "direct::files-summarize-verbose" },
|
|
177
177
|
{ sourceId: "test_files_commands.py::TestFilesCompressCommand::test_files_compress_basic", targetId: "oracle::standalone::files-compress-line-number-modes" },
|
|
178
178
|
{ sourceId: "test_files_commands.py::TestFilesCompressCommand::test_files_compress_no_base_required", targetId: "oracle::standalone::files-compress-line-number-modes" },
|
|
179
179
|
{ sourceId: "test_files_commands.py::TestFilesCompressCommand::test_files_compress_no_line_numbers_by_default", targetId: "oracle::standalone::files-compress-line-number-modes" },
|
|
180
180
|
{ sourceId: "test_files_commands.py::TestFilesCompressCommand::test_files_compress_enable_line_numbers", targetId: "oracle::standalone::files-compress-line-number-modes" },
|
|
181
181
|
{ sourceId: "test_files_commands.py::TestFilesCompressCommand::test_files_compress_verbose_outputs_progress", targetId: "oracle::standalone::files-compress-verbose" },
|
|
182
|
-
{ sourceId: "test_files_commands.py::
|
|
183
|
-
{ sourceId: "test_files_commands.py::
|
|
184
|
-
{ sourceId: "test_files_commands.py::
|
|
185
|
-
{ sourceId: "test_files_commands.py::
|
|
182
|
+
{ sourceId: "test_files_commands.py::TestSummarizeCommand::test_rejects_base", targetId: "direct::summarize-modes" },
|
|
183
|
+
{ sourceId: "test_files_commands.py::TestSummarizeCommand::test_summarize_with_here", targetId: "direct::summarize-modes" },
|
|
184
|
+
{ sourceId: "test_files_commands.py::TestSummarizeCommand::test_summarize_prepends_files_structure", targetId: "direct::summarize-modes" },
|
|
185
|
+
{ sourceId: "test_files_commands.py::TestSummarizeCommand::test_summarize_from_config", targetId: "direct::summarize-modes" },
|
|
186
186
|
{ sourceId: "test_files_commands.py::TestCompressCommand::test_rejects_base", targetId: "oracle::project::compress-modes" },
|
|
187
187
|
{ sourceId: "test_files_commands.py::TestCompressCommand::test_compress_with_here", targetId: "oracle::project::compress-modes" },
|
|
188
188
|
{ sourceId: "test_files_commands.py::TestCompressCommand::test_compress_no_line_numbers_by_default", targetId: "oracle::project::compress-modes" },
|
|
@@ -254,7 +254,7 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
254
254
|
},
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
|
-
id: "direct::files-
|
|
257
|
+
id: "direct::files-summarize-explicit-files",
|
|
258
258
|
run(t) {
|
|
259
259
|
const filePath = createScratchFile(
|
|
260
260
|
t,
|
|
@@ -262,8 +262,8 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
262
262
|
"/**\n * @file\n * @brief Sample file.\n */\n\n/**\n * @brief Build sample value.\n * @param[in] input {string} Caller text.\n * @return {string} Upper-cased text.\n */\nexport function buildSample(input: string): string {\n return input.toUpperCase();\n}\n",
|
|
263
263
|
);
|
|
264
264
|
const cwd = path.dirname(filePath);
|
|
265
|
-
const node = runNodeCli(["--files-
|
|
266
|
-
const python = runPythonCli(["--files-
|
|
265
|
+
const node = runNodeCli(["--files-summarize", filePath], cwd);
|
|
266
|
+
const python = runPythonCli(["--files-summarize", filePath], cwd);
|
|
267
267
|
assert.equal(node.status, python.status);
|
|
268
268
|
assert.equal(node.stdout, python.stdout);
|
|
269
269
|
assert.equal(node.stderr, python.stderr);
|
|
@@ -273,12 +273,12 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
273
273
|
},
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
|
-
id: "direct::files-
|
|
276
|
+
id: "direct::files-summarize-verbose",
|
|
277
277
|
run(t) {
|
|
278
278
|
const filePath = createScratchFile(t, "sample.py", "value = 1\n");
|
|
279
279
|
const cwd = path.dirname(filePath);
|
|
280
|
-
const node = runNodeCli(["--verbose", "--files-
|
|
281
|
-
const python = runPythonCli(["--verbose", "--files-
|
|
280
|
+
const node = runNodeCli(["--verbose", "--files-summarize", filePath], cwd);
|
|
281
|
+
const python = runPythonCli(["--verbose", "--files-summarize", filePath], cwd);
|
|
282
282
|
assert.equal(node.status, python.status);
|
|
283
283
|
assert.equal(node.stdout, python.stdout);
|
|
284
284
|
assert.equal(node.stderr, python.stderr);
|
|
@@ -302,15 +302,15 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
302
302
|
},
|
|
303
303
|
},
|
|
304
304
|
{
|
|
305
|
-
id: "direct::
|
|
305
|
+
id: "direct::summarize-modes",
|
|
306
306
|
run(t) {
|
|
307
307
|
const { projectBase } = createFixtureRepo(t, { fixtures: [] });
|
|
308
308
|
fs.writeFileSync(path.join(projectBase, "src", "alpha.ts"), "export const ALPHA = 1;\n", "utf8");
|
|
309
309
|
fs.mkdirSync(path.join(projectBase, "src", "nested"), { recursive: true });
|
|
310
310
|
fs.writeFileSync(path.join(projectBase, "src", "nested", "beta.ts"), "export function beta(): number {\n return 2;\n}\n", "utf8");
|
|
311
311
|
|
|
312
|
-
const directNode = runNodeCli(["--
|
|
313
|
-
const directPython = runPythonCli(["--
|
|
312
|
+
const directNode = runNodeCli(["--summarize"], projectBase);
|
|
313
|
+
const directPython = runPythonCli(["--summarize"], projectBase);
|
|
314
314
|
assert.equal(directNode.status, directPython.status);
|
|
315
315
|
assert.equal(directNode.stdout, directPython.stdout);
|
|
316
316
|
assert.equal(directNode.stderr, directPython.stderr);
|
|
@@ -318,13 +318,13 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
318
318
|
assert.match(directNode.stdout, /src\/nested\/beta\.ts/);
|
|
319
319
|
assert.match(directNode.stdout, /# beta\.ts \| TypeScript/);
|
|
320
320
|
|
|
321
|
-
const hereNode = runNodeCli(["--here", "--
|
|
322
|
-
const herePython = runPythonCli(["--here", "--
|
|
321
|
+
const hereNode = runNodeCli(["--here", "--summarize"], projectBase);
|
|
322
|
+
const herePython = runPythonCli(["--here", "--summarize"], projectBase);
|
|
323
323
|
assert.equal(hereNode.status, herePython.status);
|
|
324
324
|
assert.equal(hereNode.stdout, herePython.stdout);
|
|
325
325
|
assert.equal(hereNode.stderr, herePython.stderr);
|
|
326
326
|
|
|
327
|
-
const baseRejected = runNodeCli(["--base", projectBase, "--
|
|
327
|
+
const baseRejected = runNodeCli(["--base", projectBase, "--summarize"], projectBase);
|
|
328
328
|
assert.notEqual(baseRejected.status, 0);
|
|
329
329
|
assert.match(baseRejected.stderr, /do not allow --base/);
|
|
330
330
|
},
|
|
@@ -709,7 +709,7 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
709
709
|
},
|
|
710
710
|
},
|
|
711
711
|
{
|
|
712
|
-
id: "direct::fixtures::files-
|
|
712
|
+
id: "direct::fixtures::files-summarize-fixture-shape",
|
|
713
713
|
async run(t) {
|
|
714
714
|
for (const fixture of getFixtureFiles()) {
|
|
715
715
|
if (path.basename(fixture) === TAB_SENSITIVE_FIXTURE_NAME) {
|
|
@@ -717,8 +717,8 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
717
717
|
}
|
|
718
718
|
await t.test(path.basename(fixture), () => {
|
|
719
719
|
const cwd = path.dirname(fixture);
|
|
720
|
-
const node = runNodeCli(["--files-
|
|
721
|
-
const python = runPythonCli(["--files-
|
|
720
|
+
const node = runNodeCli(["--files-summarize", fixture], cwd);
|
|
721
|
+
const python = runPythonCli(["--files-summarize", fixture], cwd);
|
|
722
722
|
assert.equal(node.status, python.status);
|
|
723
723
|
assert.equal(node.stdout, python.stdout);
|
|
724
724
|
assert.equal(node.stderr, python.stderr);
|
|
@@ -748,9 +748,9 @@ const TARGET_CASES: TargetParityCase[] = [
|
|
|
748
748
|
assert.ok(fixture, `missing ${TAB_SENSITIVE_FIXTURE_NAME}`);
|
|
749
749
|
const cwd = path.dirname(fixture);
|
|
750
750
|
|
|
751
|
-
const
|
|
752
|
-
assert.equal(
|
|
753
|
-
assert.match(
|
|
751
|
+
const summarize = runNodeCli(["--files-summarize", fixture], cwd);
|
|
752
|
+
assert.equal(summarize.status, 0, summarize.stderr);
|
|
753
|
+
assert.match(summarize.stdout, /\tvar wg sync\.WaitGroup/);
|
|
754
754
|
|
|
755
755
|
const compress = runNodeCli(["--files-compress", fixture, "--enable-line-numbers"], cwd);
|
|
756
756
|
assert.equal(compress.status, 0, compress.stderr);
|
|
@@ -237,7 +237,7 @@ test("replaySessionStart captures active tools, statuses, and cwd semantics", as
|
|
|
237
237
|
assert.match(status, /<accent>status:<\/accent><warning>idle<\/warning>/);
|
|
238
238
|
assert.match(status, new RegExp(`<accent>branch:<\\/accent><warning>${escapedBranch}<\\/warning>`));
|
|
239
239
|
assert.doesNotMatch(status, /<accent>current-path:<\/accent>/);
|
|
240
|
-
assert.match(status, /<accent>context:<\/accent>▕_
|
|
240
|
+
assert.match(status, /<accent>context:<\/accent><warning>▕_▏<\/warning>/);
|
|
241
241
|
assert.match(status, /<accent>elapsed:<\/accent><warning>⏱︎ --:-- ⚑ --:-- ⌛︎--:--<\/warning>/);
|
|
242
242
|
assert.match(status, /<accent>sound:<\/accent><warning>none<\/warning>/);
|
|
243
243
|
assert.doesNotMatch(status, /<accent>beep:<\/accent>/);
|