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.
Files changed (50) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +6 -6
  3. package/package.json +1 -1
  4. package/pi-usereq/docs/REFERENCES.md +818 -691
  5. package/pi-usereq/docs/REQUIREMENTS.md +131 -77
  6. package/pi-usereq/docs/WORKFLOW.md +185 -51
  7. package/scripts/lib/extension-debug-harness.ts +2 -2
  8. package/scripts/tool-args-to-params.ts +2 -2
  9. package/src/cli.ts +12 -12
  10. package/src/core/extension-status.ts +69 -12
  11. package/src/core/pi-notify.ts +5 -5
  12. package/src/core/pi-usereq-tools.ts +4 -2
  13. package/src/core/prompt-command-catalog.ts +4 -5
  14. package/src/core/prompt-command-runtime.ts +183 -44
  15. package/src/core/prompts.ts +0 -2
  16. package/src/core/req-references-command.ts +175 -0
  17. package/src/core/req-reset-command.ts +323 -0
  18. package/src/core/resources.ts +6 -23
  19. package/src/core/settings-menu.ts +85 -28
  20. package/src/core/tool-runner.ts +26 -6
  21. package/src/index.ts +523 -85
  22. package/tests/attended-results-scenarios.ts +5 -5
  23. package/tests/cli-command-option-parity.test.ts +25 -25
  24. package/tests/debug-extension-harness.test.ts +1 -1
  25. package/tests/extension-registration.test.ts +1029 -82
  26. package/tests/oracle-project.test.ts +4 -4
  27. package/tests/oracle-standalone.test.ts +5 -5
  28. package/src/core/reference-payload.ts +0 -752
  29. package/src/resources/prompts/references.md +0 -64
  30. /package/tests/fixtures_attended_results/project/{references.json → summarize.json} +0 -0
  31. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_c.c.json +0 -0
  32. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_cpp.cpp.json +0 -0
  33. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_csharp.cs.json +0 -0
  34. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_elixir.ex.json +0 -0
  35. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_go.go.json +0 -0
  36. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_haskell.hs.json +0 -0
  37. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_java.java.json +0 -0
  38. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_javascript.js.json +0 -0
  39. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_kotlin.kt.json +0 -0
  40. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_lua.lua.json +0 -0
  41. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_perl.pl.json +0 -0
  42. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_php.php.json +0 -0
  43. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_python.py.json +0 -0
  44. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_ruby.rb.json +0 -0
  45. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_rust.rs.json +0 -0
  46. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_scala.scala.json +0 -0
  47. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_shell.sh.json +0 -0
  48. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_swift.swift.json +0 -0
  49. /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_typescript.ts.json +0 -0
  50. /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-references/${fixtureName}`,
316
- path.posix.join("standalone", "files-references", `${fixtureName}.json`),
317
- ["--files-references", relativeFixturePath],
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/references", path.posix.join("project", "references.json"), () => {
372
+ createProjectScenario("project/summarize", path.posix.join("project", "summarize.json"), () => {
373
373
  const { projectBase } = initFixtureRepo();
374
374
  return {
375
- args: ["--references"],
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::TestFilesReferencesCommand::test_files_references_basic", targetId: "direct::files-references-explicit-files" },
175
- { sourceId: "test_files_commands.py::TestFilesReferencesCommand::test_files_references_no_base_required", targetId: "direct::files-references-explicit-files" },
176
- { sourceId: "test_files_commands.py::TestFilesReferencesCommand::test_files_references_verbose_outputs_progress", targetId: "direct::files-references-verbose" },
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::TestReferencesCommand::test_rejects_base", targetId: "direct::references-modes" },
183
- { sourceId: "test_files_commands.py::TestReferencesCommand::test_references_with_here", targetId: "direct::references-modes" },
184
- { sourceId: "test_files_commands.py::TestReferencesCommand::test_references_prepends_files_structure", targetId: "direct::references-modes" },
185
- { sourceId: "test_files_commands.py::TestReferencesCommand::test_references_from_config", targetId: "direct::references-modes" },
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-references-explicit-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-references", filePath], cwd);
266
- const python = runPythonCli(["--files-references", filePath], cwd);
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-references-verbose",
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-references", filePath], cwd);
281
- const python = runPythonCli(["--verbose", "--files-references", filePath], cwd);
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::references-modes",
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(["--references"], projectBase);
313
- const directPython = runPythonCli(["--references"], projectBase);
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", "--references"], projectBase);
322
- const herePython = runPythonCli(["--here", "--references"], projectBase);
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, "--references"], 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-references-fixture-shape",
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-references", fixture], cwd);
721
- const python = runPythonCli(["--files-references", fixture], cwd);
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 references = runNodeCli(["--files-references", fixture], cwd);
752
- assert.equal(references.status, 0, references.stderr);
753
- assert.match(references.stdout, /\tvar wg sync\.WaitGroup/);
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>/);