@popoverai/dotrequirements 0.22.0 → 0.24.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/README.md +173 -23
- package/dist/cli.js +121 -61
- package/dist/codebase-to-spec/budget.d.ts +53 -0
- package/dist/codebase-to-spec/budget.js +80 -0
- package/dist/codebase-to-spec/cache.d.ts +49 -0
- package/dist/codebase-to-spec/cache.js +54 -0
- package/dist/codebase-to-spec/claude.d.ts +69 -0
- package/dist/codebase-to-spec/claude.js +126 -0
- package/dist/codebase-to-spec/compose.d.ts +49 -0
- package/dist/codebase-to-spec/compose.js +124 -0
- package/dist/codebase-to-spec/edit-loop.d.ts +54 -0
- package/dist/codebase-to-spec/edit-loop.js +195 -0
- package/dist/codebase-to-spec/editor.d.ts +54 -0
- package/dist/codebase-to-spec/editor.js +74 -0
- package/dist/codebase-to-spec/exit-codes.d.ts +40 -0
- package/dist/codebase-to-spec/exit-codes.js +58 -0
- package/dist/codebase-to-spec/fan-out.d.ts +63 -0
- package/dist/codebase-to-spec/fan-out.js +215 -0
- package/dist/codebase-to-spec/interactive.d.ts +30 -0
- package/dist/codebase-to-spec/interactive.js +48 -0
- package/dist/codebase-to-spec/outline-review-loop.d.ts +51 -0
- package/dist/codebase-to-spec/outline-review-loop.js +187 -0
- package/dist/codebase-to-spec/pack.d.ts +51 -0
- package/dist/codebase-to-spec/pack.js +127 -0
- package/dist/codebase-to-spec/planner.d.ts +41 -0
- package/dist/codebase-to-spec/planner.js +76 -0
- package/dist/codebase-to-spec/present.d.ts +94 -0
- package/dist/codebase-to-spec/present.js +288 -0
- package/dist/codebase-to-spec/progress.d.ts +33 -0
- package/dist/codebase-to-spec/progress.js +28 -0
- package/dist/codebase-to-spec/prompts/editor.d.ts +13 -0
- package/dist/codebase-to-spec/prompts/editor.js +57 -0
- package/dist/codebase-to-spec/prompts/outline-reviewer.d.ts +12 -0
- package/dist/codebase-to-spec/prompts/outline-reviewer.js +87 -0
- package/dist/codebase-to-spec/prompts/planner-apply.d.ts +12 -0
- package/dist/codebase-to-spec/prompts/planner-apply.js +32 -0
- package/dist/codebase-to-spec/prompts/planner-initial.d.ts +11 -0
- package/dist/codebase-to-spec/prompts/planner-initial.js +125 -0
- package/dist/codebase-to-spec/prompts/planner-revise.d.ts +14 -0
- package/dist/codebase-to-spec/prompts/planner-revise.js +60 -0
- package/dist/codebase-to-spec/prompts/spec-reviewer.d.ts +16 -0
- package/dist/codebase-to-spec/prompts/spec-reviewer.js +96 -0
- package/dist/codebase-to-spec/prompts/specifier.d.ts +12 -0
- package/dist/codebase-to-spec/prompts/specifier.js +100 -0
- package/dist/codebase-to-spec/prompts/style-check.d.ts +12 -0
- package/dist/codebase-to-spec/prompts/style-check.js +78 -0
- package/dist/codebase-to-spec/schemas.d.ts +257 -0
- package/dist/codebase-to-spec/schemas.js +183 -0
- package/dist/codebase-to-spec/skill-install.d.ts +57 -0
- package/dist/codebase-to-spec/skill-install.js +79 -0
- package/dist/codebase-to-spec/slice.d.ts +49 -0
- package/dist/codebase-to-spec/slice.js +111 -0
- package/dist/codebase-to-spec/specifier.d.ts +60 -0
- package/dist/codebase-to-spec/specifier.js +79 -0
- package/dist/codebase-to-spec/style-check.d.ts +29 -0
- package/dist/codebase-to-spec/style-check.js +33 -0
- package/dist/codebase-to-spec/summary.d.ts +51 -0
- package/dist/codebase-to-spec/summary.js +183 -0
- package/dist/codebase-to-spec/validate.d.ts +46 -0
- package/dist/codebase-to-spec/validate.js +130 -0
- package/dist/commands/acceptance-test.d.ts +6 -0
- package/dist/commands/acceptance-test.js +212 -0
- package/dist/commands/ai-setup.d.ts +5 -0
- package/dist/commands/ai-setup.js +441 -0
- package/dist/commands/browsertest.d.ts +0 -1
- package/dist/commands/browsertest.js +51 -26
- package/dist/commands/codebase-to-spec/compose.d.ts +14 -0
- package/dist/commands/codebase-to-spec/compose.js +57 -0
- package/dist/commands/codebase-to-spec/edit-loop.d.ts +16 -0
- package/dist/commands/codebase-to-spec/edit-loop.js +83 -0
- package/dist/commands/codebase-to-spec/fan-out.d.ts +19 -0
- package/dist/commands/codebase-to-spec/fan-out.js +77 -0
- package/dist/commands/codebase-to-spec/index.d.ts +9 -0
- package/dist/commands/codebase-to-spec/index.js +135 -0
- package/dist/commands/codebase-to-spec/pack.d.ts +22 -0
- package/dist/commands/codebase-to-spec/pack.js +76 -0
- package/dist/commands/codebase-to-spec/plan-loop.d.ts +26 -0
- package/dist/commands/codebase-to-spec/plan-loop.js +105 -0
- package/dist/commands/codebase-to-spec/present.d.ts +21 -0
- package/dist/commands/codebase-to-spec/present.js +92 -0
- package/dist/commands/codebase-to-spec/run.d.ts +20 -0
- package/dist/commands/codebase-to-spec/run.js +85 -0
- package/dist/commands/codebase-to-spec/skill-install.d.ts +20 -0
- package/dist/commands/codebase-to-spec/skill-install.js +51 -0
- package/dist/commands/codebase-to-spec/specify-area.d.ts +18 -0
- package/dist/commands/codebase-to-spec/specify-area.js +82 -0
- package/dist/commands/codebase-to-spec/style-check.d.ts +15 -0
- package/dist/commands/codebase-to-spec/style-check.js +42 -0
- package/dist/commands/codebase-to-spec/validate.d.ts +18 -0
- package/dist/commands/codebase-to-spec/validate.js +38 -0
- package/dist/commands/create-requirement-document.d.ts +2 -0
- package/dist/commands/create-requirement-document.js +41 -0
- package/dist/commands/finalize.js +7 -7
- package/dist/commands/get.d.ts +2 -0
- package/dist/commands/get.js +55 -0
- package/dist/commands/init.js +132 -117
- package/dist/commands/link.js +27 -27
- package/dist/commands/list.d.ts +6 -0
- package/dist/commands/list.js +43 -0
- package/dist/commands/mcp-setup.js +159 -149
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/prepare.js +4 -4
- package/dist/commands/pull.js +116 -121
- package/dist/commands/push.js +106 -112
- package/dist/commands/report.d.ts +6 -2
- package/dist/commands/report.js +177 -122
- package/dist/commands/requirements-for.d.ts +2 -0
- package/dist/commands/requirements-for.js +29 -0
- package/dist/commands/review-test.d.ts +2 -0
- package/dist/commands/review-test.js +75 -0
- package/dist/commands/search.d.ts +6 -0
- package/dist/commands/search.js +39 -0
- package/dist/commands/style-check.d.ts +7 -0
- package/dist/commands/style-check.js +75 -0
- package/dist/commands/test.js +53 -59
- package/dist/commands/tests-for.d.ts +2 -0
- package/dist/commands/tests-for.js +80 -0
- package/dist/commands/validate.d.ts +6 -0
- package/dist/commands/validate.js +72 -0
- package/dist/config.js +1 -1
- package/dist/convex.d.ts +34 -22
- package/dist/convex.js +38 -22
- package/dist/harness/cache.d.ts +1 -5
- package/dist/harness/cache.js +49 -59
- package/dist/harness/convexReporting.d.ts +1 -1
- package/dist/harness/convexReporting.js +9 -7
- package/dist/harness/coverageCache.js +3 -3
- package/dist/harness/finalize.js +59 -46
- package/dist/harness/index.d.ts +6 -7
- package/dist/harness/index.js +9 -10
- package/dist/harness/prepare.js +6 -5
- package/dist/harness/requirementsLoader.d.ts +2 -2
- package/dist/harness/requirementsLoader.js +13 -35
- package/dist/harness/tracking.js +18 -18
- package/dist/harness/types.d.ts +1 -1
- package/dist/mcp/convexClient.d.ts +0 -39
- package/dist/mcp/convexClient.js +2 -107
- package/dist/mcp/grep.d.ts +1 -1
- package/dist/mcp/grep.js +87 -42
- package/dist/mcp/handlers/authoring.d.ts +1 -1
- package/dist/mcp/handlers/authoring.js +30 -234
- package/dist/mcp/handlers/coverage.d.ts +1 -1
- package/dist/mcp/handlers/coverage.js +13 -15
- package/dist/mcp/handlers/debug.d.ts +2 -3
- package/dist/mcp/handlers/debug.js +10 -10
- package/dist/mcp/handlers/get.d.ts +1 -1
- package/dist/mcp/handlers/get.js +11 -10
- package/dist/mcp/handlers/index.d.ts +20 -20
- package/dist/mcp/handlers/index.js +10 -10
- package/dist/mcp/handlers/list.d.ts +4 -33
- package/dist/mcp/handlers/list.js +16 -38
- package/dist/mcp/handlers/push.d.ts +1 -1
- package/dist/mcp/handlers/push.js +28 -18
- package/dist/mcp/handlers/report.d.ts +16 -0
- package/dist/mcp/handlers/report.js +134 -0
- package/dist/mcp/handlers/review.d.ts +1 -1
- package/dist/mcp/handlers/review.js +40 -59
- package/dist/mcp/handlers/search.d.ts +1 -1
- package/dist/mcp/handlers/search.js +7 -9
- package/dist/mcp/handlers/test-mapping.d.ts +1 -1
- package/dist/mcp/handlers/test-mapping.js +14 -14
- package/dist/mcp/handlers/types.d.ts +3 -3
- package/dist/mcp/handlers/types.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +156 -178
- package/dist/mcp/requirements.d.ts +2 -2
- package/dist/mcp/requirements.js +30 -30
- package/dist/mcp/testCodeExtractor.js +24 -26
- package/dist/mcp/types.d.ts +1 -1
- package/dist/push/core.d.ts +2 -2
- package/dist/push/core.js +20 -20
- package/dist/push/index.d.ts +1 -1
- package/dist/push/index.js +2 -2
- package/dist/requirements/cloud-ai.d.ts +57 -0
- package/dist/requirements/cloud-ai.js +104 -0
- package/dist/requirements/cloud-coverage.d.ts +41 -0
- package/dist/requirements/cloud-coverage.js +60 -0
- package/dist/requirements/coverage.d.ts +45 -0
- package/dist/requirements/coverage.js +114 -0
- package/dist/requirements/grep.d.ts +33 -0
- package/dist/requirements/grep.js +306 -0
- package/dist/requirements/index.d.ts +73 -0
- package/dist/requirements/index.js +174 -0
- package/dist/requirements/style-guide.d.ts +67 -0
- package/dist/requirements/style-guide.js +299 -0
- package/dist/requirements/testCodeExtractor.d.ts +22 -0
- package/dist/requirements/testCodeExtractor.js +150 -0
- package/dist/schema/browser.d.ts +8 -6
- package/dist/schema/browser.js +14 -14
- package/dist/schema/builder.d.ts +1 -1
- package/dist/schema/builder.js +13 -44
- package/dist/schema/conversions.d.ts +2 -2
- package/dist/schema/conversions.js +11 -11
- package/dist/schema/index.d.ts +9 -7
- package/dist/schema/index.js +15 -13
- package/dist/schema/parser-core.d.ts +1 -1
- package/dist/schema/parser-core.js +23 -22
- package/dist/schema/parser.d.ts +3 -3
- package/dist/schema/parser.js +27 -31
- package/dist/schema/resolver.d.ts +1 -1
- package/dist/schema/resolver.js +9 -9
- package/dist/schema/scenario.d.ts +91 -0
- package/dist/schema/scenario.js +82 -0
- package/dist/schema/schemas.d.ts +3 -3
- package/dist/schema/schemas.js +41 -28
- package/dist/schema/test-schema.js +27 -27
- package/dist/templates/context-file-section.md +3 -2
- package/dist/templates/example-requirements.js +1 -1
- package/dist/templates/example-requirements.ts +3 -1
- package/dist/templates/requirements-readme.js +1 -1
- package/dist/templates/requirements-readme.ts +1 -1
- package/dist/templates/skills/codebase-to-spec/SKILL.md +118 -0
- package/dist/utils/brand.js +3 -3
- package/dist/utils/browser-launch.js +4 -4
- package/dist/utils/context-file.d.ts +1 -1
- package/dist/utils/context-file.js +26 -26
- package/dist/utils/env.js +7 -7
- package/dist/utils/gitignore.js +7 -7
- package/dist/utils/oauth-callback-server.d.ts +1 -1
- package/dist/utils/oauth-callback-server.js +27 -25
- package/dist/utils/oauth-flow.js +32 -29
- package/dist/utils/project-discovery.d.ts +3 -3
- package/dist/utils/project-discovery.js +18 -17
- package/dist/utils/project-name.js +8 -8
- package/dist/utils/project-selector.d.ts +1 -1
- package/dist/utils/project-selector.js +24 -21
- package/dist/utils/project-settings.d.ts +5 -4
- package/dist/utils/project-settings.js +28 -20
- package/dist/utils/templates.js +6 -6
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as fs from
|
|
2
|
-
import * as path from
|
|
3
|
-
const REQUIREMENTS_DIR =
|
|
4
|
-
const SETTINGS_FILE =
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
const REQUIREMENTS_DIR = ".requirements";
|
|
4
|
+
const SETTINGS_FILE = "project-settings.json";
|
|
5
5
|
/**
|
|
6
6
|
* Get project credentials from environment variables.
|
|
7
7
|
* Used in CI/CD environments where credentials are passed via env vars
|
|
@@ -27,14 +27,16 @@ export function findProjectRoot(startDir = process.cwd()) {
|
|
|
27
27
|
const root = path.parse(currentDir).root;
|
|
28
28
|
while (currentDir !== root) {
|
|
29
29
|
const requirementsDir = path.join(currentDir, REQUIREMENTS_DIR);
|
|
30
|
-
if (fs.existsSync(requirementsDir) &&
|
|
30
|
+
if (fs.existsSync(requirementsDir) &&
|
|
31
|
+
fs.statSync(requirementsDir).isDirectory()) {
|
|
31
32
|
return currentDir;
|
|
32
33
|
}
|
|
33
34
|
currentDir = path.dirname(currentDir);
|
|
34
35
|
}
|
|
35
36
|
// Check root directory as well
|
|
36
37
|
const rootRequirementsDir = path.join(root, REQUIREMENTS_DIR);
|
|
37
|
-
if (fs.existsSync(rootRequirementsDir) &&
|
|
38
|
+
if (fs.existsSync(rootRequirementsDir) &&
|
|
39
|
+
fs.statSync(rootRequirementsDir).isDirectory()) {
|
|
38
40
|
return root;
|
|
39
41
|
}
|
|
40
42
|
return undefined;
|
|
@@ -50,7 +52,7 @@ export function readProjectSettings(projectRoot) {
|
|
|
50
52
|
}
|
|
51
53
|
let content;
|
|
52
54
|
try {
|
|
53
|
-
content = fs.readFileSync(settingsPath,
|
|
55
|
+
content = fs.readFileSync(settingsPath, "utf-8");
|
|
54
56
|
}
|
|
55
57
|
catch (err) {
|
|
56
58
|
throw new Error(`Could not read project-settings.json: ${err.message}`);
|
|
@@ -62,11 +64,11 @@ export function readProjectSettings(projectRoot) {
|
|
|
62
64
|
catch (err) {
|
|
63
65
|
throw new Error(`project-settings.json is invalid: ${err.message}`);
|
|
64
66
|
}
|
|
65
|
-
if (typeof parsed !==
|
|
67
|
+
if (typeof parsed !== "object" ||
|
|
66
68
|
parsed === null ||
|
|
67
|
-
typeof parsed.projectId !==
|
|
68
|
-
typeof parsed.projectSecret !==
|
|
69
|
-
throw new Error(
|
|
69
|
+
typeof parsed.projectId !== "string" ||
|
|
70
|
+
typeof parsed.projectSecret !== "string") {
|
|
71
|
+
throw new Error("project-settings.json is invalid: missing projectId or projectSecret");
|
|
70
72
|
}
|
|
71
73
|
const record = parsed;
|
|
72
74
|
const settings = {
|
|
@@ -74,22 +76,28 @@ export function readProjectSettings(projectRoot) {
|
|
|
74
76
|
projectSecret: record.projectSecret,
|
|
75
77
|
};
|
|
76
78
|
// Optional fields
|
|
77
|
-
if (typeof record.defaultURL ===
|
|
79
|
+
if (typeof record.defaultURL === "string") {
|
|
78
80
|
settings.defaultURL = record.defaultURL;
|
|
79
81
|
}
|
|
80
|
-
if (typeof record.browserTest ===
|
|
82
|
+
if (typeof record.browserTest === "object" && record.browserTest !== null) {
|
|
81
83
|
const bt = record.browserTest;
|
|
82
84
|
settings.browserTest = {};
|
|
83
|
-
if (typeof bt.
|
|
85
|
+
if (typeof bt.modelName === "string") {
|
|
86
|
+
settings.browserTest.modelName = bt.modelName;
|
|
87
|
+
}
|
|
88
|
+
if (typeof bt.modelApiKey === "string") {
|
|
89
|
+
settings.browserTest.modelApiKey = bt.modelApiKey;
|
|
90
|
+
}
|
|
91
|
+
if (typeof bt.geminiApiKey === "string") {
|
|
84
92
|
settings.browserTest.geminiApiKey = bt.geminiApiKey;
|
|
85
93
|
}
|
|
86
|
-
if (typeof bt.vercelBypassSecret ===
|
|
94
|
+
if (typeof bt.vercelBypassSecret === "string") {
|
|
87
95
|
settings.browserTest.vercelBypassSecret = bt.vercelBypassSecret;
|
|
88
96
|
}
|
|
89
|
-
if (typeof bt.browserbaseApiKey ===
|
|
97
|
+
if (typeof bt.browserbaseApiKey === "string") {
|
|
90
98
|
settings.browserTest.browserbaseApiKey = bt.browserbaseApiKey;
|
|
91
99
|
}
|
|
92
|
-
if (typeof bt.browserbaseProjectId ===
|
|
100
|
+
if (typeof bt.browserbaseProjectId === "string") {
|
|
93
101
|
settings.browserTest.browserbaseProjectId = bt.browserbaseProjectId;
|
|
94
102
|
}
|
|
95
103
|
}
|
|
@@ -106,8 +114,8 @@ export function writeProjectSettings(projectRoot, settings) {
|
|
|
106
114
|
if (!fs.existsSync(requirementsDir)) {
|
|
107
115
|
fs.mkdirSync(requirementsDir, { recursive: true });
|
|
108
116
|
}
|
|
109
|
-
const content = JSON.stringify(settings, null, 2)
|
|
110
|
-
fs.writeFileSync(settingsPath, content,
|
|
117
|
+
const content = `${JSON.stringify(settings, null, 2)}\n`;
|
|
118
|
+
fs.writeFileSync(settingsPath, content, "utf-8");
|
|
111
119
|
}
|
|
112
120
|
/**
|
|
113
121
|
* Get project info including status and credentials
|
|
@@ -128,7 +136,7 @@ export function getProjectInfo(startDir = process.cwd()) {
|
|
|
128
136
|
}
|
|
129
137
|
return {
|
|
130
138
|
rootPath,
|
|
131
|
-
status: credentials ?
|
|
139
|
+
status: credentials ? "cloud-connected" : "local-only",
|
|
132
140
|
credentials,
|
|
133
141
|
};
|
|
134
142
|
}
|
package/dist/utils/templates.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readFileSync } from
|
|
2
|
-
import {
|
|
3
|
-
import { fileURLToPath } from
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
4
|
/**
|
|
5
5
|
* Get the templates directory path
|
|
6
6
|
*/
|
|
@@ -10,7 +10,7 @@ function getTemplatesDir() {
|
|
|
10
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
11
|
const __dirname = dirname(__filename);
|
|
12
12
|
// Go up from utils/ to src/ or dist/, then into templates/
|
|
13
|
-
return join(__dirname,
|
|
13
|
+
return join(__dirname, "..", "templates");
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Load a template file and replace placeholders
|
|
@@ -18,10 +18,10 @@ function getTemplatesDir() {
|
|
|
18
18
|
export function loadTemplate(templateName, replacements = {}) {
|
|
19
19
|
const templatesDir = getTemplatesDir();
|
|
20
20
|
const templatePath = join(templatesDir, templateName);
|
|
21
|
-
let content = readFileSync(templatePath,
|
|
21
|
+
let content = readFileSync(templatePath, "utf-8");
|
|
22
22
|
// Replace placeholders
|
|
23
23
|
for (const [key, value] of Object.entries(replacements)) {
|
|
24
|
-
content = content.replace(new RegExp(`{{${key}}}`,
|
|
24
|
+
content = content.replace(new RegExp(`{{${key}}}`, "g"), value);
|
|
25
25
|
}
|
|
26
26
|
return content;
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popoverai/dotrequirements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Requirements tracking CLI, test harness, and MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"glob": "^11.0.0",
|
|
62
62
|
"open": "^11.0.0",
|
|
63
63
|
"prompts": "^2.4.2",
|
|
64
|
+
"repomix": "^1.14.0",
|
|
64
65
|
"uuid": "^13.0.0",
|
|
65
66
|
"yaml": "^2.8.1",
|
|
66
67
|
"zod": "^3.25.76",
|