thevoidforge 21.0.3 → 21.0.5
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.
|
@@ -148,8 +148,10 @@ function sendJson(res, status, data) {
|
|
|
148
148
|
res.end(JSON.stringify(data));
|
|
149
149
|
}
|
|
150
150
|
// ── Route Registration ──────────────────────────────
|
|
151
|
-
addRoute('GET', '/api/blueprint/detect', async (
|
|
152
|
-
const
|
|
151
|
+
addRoute('GET', '/api/blueprint/detect', async (req, res) => {
|
|
152
|
+
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
153
|
+
const dirParam = url.searchParams.get('dir');
|
|
154
|
+
const projectRoot = dirParam && dirParam !== 'undefined' ? dirParam : process.cwd();
|
|
153
155
|
const prdPath = join(projectRoot, 'docs/PRD.md');
|
|
154
156
|
if (existsSync(prdPath)) {
|
|
155
157
|
const content = await readFile(prdPath, 'utf-8');
|
package/dist/wizard/ui/app.js
CHANGED
|
@@ -177,10 +177,11 @@
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
// Blueprint auto-detection: when moving from Step 3 → Step 4,
|
|
180
|
-
// check if docs/PRD.md already exists in the project directory
|
|
180
|
+
// check if docs/PRD.md already exists in the TARGET project directory (not CWD).
|
|
181
|
+
// During init, the project dir doesn't exist yet — detection is skipped.
|
|
181
182
|
if (currentStep === 3 && state.projectDir) {
|
|
182
183
|
try {
|
|
183
|
-
const detectRes = await fetch('/api/blueprint/detect');
|
|
184
|
+
const detectRes = await fetch('/api/blueprint/detect?dir=' + encodeURIComponent(state.projectDir));
|
|
184
185
|
const detectData = await detectRes.json();
|
|
185
186
|
if (detectData.detected) {
|
|
186
187
|
const blueprintBanner = $('#blueprint-detection');
|