pi-usereq 0.40.0 → 0.41.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 +39 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +184 -184
- package/pi-usereq/docs/REQUIREMENTS.md +5 -3
- package/pi-usereq/docs/WORKFLOW.md +4 -4
- package/src/core/config.ts +3 -3
- package/src/core/prompt-command-runtime.ts +6 -6
- package/src/core/prompts.ts +6 -6
- package/src/core/req-references-command.ts +3 -3
- package/src/core/req-reset-command.ts +3 -3
- package/src/core/runtime-project-paths.ts +3 -3
- package/src/index.ts +24 -9
- package/tests/extension-registration.test.ts +290 -0
- package/tests/prompt-command-summary.test.ts +36 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_STATIC_CHECK_LANGUAGES,
|
|
5
|
+
getDefaultConfig,
|
|
6
|
+
} from "../src/core/config.js";
|
|
7
|
+
import { renderPromptCommandSummary } from "../src/core/prompts.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @brief Builds a configuration with no enabled context files, no enabled static-check languages, and no enabled tools.
|
|
11
|
+
* @details Clones the documented default configuration, disables every context-file flag, forces every canonical static-check language to `disable`, and empties the enabled-tool list so the command invocation summary is forced to render the `none` placeholder for all three empty-category fields. Runtime is O(l) in supported language count. No external state is mutated.
|
|
12
|
+
* @param[in] projectBase {string} Absolute project root path used to seed the default configuration.
|
|
13
|
+
* @return {ReturnType<typeof getDefaultConfig>} Configuration object with all three summary categories empty.
|
|
14
|
+
*/
|
|
15
|
+
function buildEmptySummaryConfig(projectBase: string): ReturnType<typeof getDefaultConfig> {
|
|
16
|
+
const config = getDefaultConfig(projectBase);
|
|
17
|
+
config["context-files-requirements"] = false;
|
|
18
|
+
config["context-files-references"] = false;
|
|
19
|
+
config["context-files-workflow"] = false;
|
|
20
|
+
for (const language of DEFAULT_STATIC_CHECK_LANGUAGES) {
|
|
21
|
+
config["static-check"][language] = { ...config["static-check"][language], enabled: "disable" };
|
|
22
|
+
}
|
|
23
|
+
config["enabled-tools"] = [];
|
|
24
|
+
return config;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
test("renderPromptCommandSummary renders none for empty context files, static code checks, and enabled tools", () => {
|
|
28
|
+
const projectBase = process.cwd();
|
|
29
|
+
const config = buildEmptySummaryConfig(projectBase);
|
|
30
|
+
const summary = renderPromptCommandSummary("analyze", "Inspect runtime behavior", config);
|
|
31
|
+
assert.match(summary, /Command: ANALYZE/);
|
|
32
|
+
assert.match(summary, /User's Request: Inspect runtime behavior/);
|
|
33
|
+
assert.match(summary, /- context files: none/);
|
|
34
|
+
assert.match(summary, /- static code checks: none/);
|
|
35
|
+
assert.match(summary, /- enabled tools: none/);
|
|
36
|
+
});
|