@phren/cli 0.1.17 → 0.1.19
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/dist/cli/cli.js +0 -4
- package/dist/cli/hooks.js +5 -1
- package/dist/entrypoint.d.ts +0 -3
- package/dist/entrypoint.js +19 -74
- package/dist/generated/memory-ui-graph.browser.js +27 -27
- package/dist/hooks.d.ts +43 -3
- package/dist/hooks.js +196 -16
- package/dist/index.js +5 -6
- package/dist/init/config.d.ts +28 -0
- package/dist/init/config.js +107 -2
- package/dist/init/init-configure.js +13 -1
- package/dist/init/preferences.d.ts +8 -0
- package/dist/link/doctor.js +13 -6
- package/dist/memory-ui-graph.runtime.js +27 -27
- package/dist/shell/render-api.d.ts +1 -1
- package/dist/tools/hooks.js +38 -0
- package/dist/ui/deep-void.d.ts +1 -0
- package/dist/ui/deep-void.js +413 -0
- package/dist/ui/graph.js +3 -0
- package/dist/ui/page.js +3 -1
- package/package.json +3 -3
- package/dist/agent-launch.d.ts +0 -1
- package/dist/agent-launch.js +0 -48
package/dist/link/doctor.js
CHANGED
|
@@ -22,19 +22,25 @@ import { readInstallPreferences } from "../init/preferences.js";
|
|
|
22
22
|
import { logger } from "../logger.js";
|
|
23
23
|
// ── Doctor ──────────────────────────────────────────────────────────────────
|
|
24
24
|
function isWrapperActive(tool) {
|
|
25
|
-
const
|
|
25
|
+
const isWindows = process.platform === "win32";
|
|
26
|
+
const wrapperName = isWindows ? `${tool}.cmd` : tool;
|
|
27
|
+
const wrapperPath = homePath(".local", "bin", wrapperName);
|
|
26
28
|
if (!fs.existsSync(wrapperPath))
|
|
27
29
|
return false;
|
|
28
30
|
try {
|
|
29
|
-
const
|
|
31
|
+
const whichCmd = isWindows ? "where.exe" : "which";
|
|
32
|
+
const whichArgs = isWindows ? [tool] : [tool];
|
|
33
|
+
const raw = execFileSync(whichCmd, whichArgs, {
|
|
30
34
|
encoding: "utf8",
|
|
31
35
|
stdio: ["ignore", "pipe", "ignore"],
|
|
32
36
|
timeout: EXEC_TIMEOUT_QUICK_MS,
|
|
33
37
|
}).trim();
|
|
34
|
-
|
|
38
|
+
// `where.exe` can print multiple paths, one per line; check the first hit.
|
|
39
|
+
const first = raw.split(/\r?\n/).map((line) => line.trim()).find(Boolean) ?? "";
|
|
40
|
+
return path.resolve(first).toLowerCase() === path.resolve(wrapperPath).toLowerCase();
|
|
35
41
|
}
|
|
36
42
|
catch (err) {
|
|
37
|
-
debugLog(`isWrapperActive:
|
|
43
|
+
debugLog(`isWrapperActive: resolve ${tool} failed: ${errorMessage(err)}`);
|
|
38
44
|
return false;
|
|
39
45
|
}
|
|
40
46
|
}
|
|
@@ -434,6 +440,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
434
440
|
detail: codexWritable ? `writable: ${codexHooks}` : `not writable: ${codexHooks}`,
|
|
435
441
|
});
|
|
436
442
|
}
|
|
443
|
+
const wrapperSuffix = process.platform === "win32" ? ".cmd" : "";
|
|
437
444
|
for (const tool of ["copilot", "cursor", "codex"]) {
|
|
438
445
|
if (!detected.has(tool))
|
|
439
446
|
continue;
|
|
@@ -442,7 +449,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
442
449
|
name: `wrapper:${tool}`,
|
|
443
450
|
ok: active,
|
|
444
451
|
detail: active
|
|
445
|
-
? `${tool} wrapper active via ~/.local/bin/${tool}`
|
|
452
|
+
? `${tool} wrapper active via ~/.local/bin/${tool}${wrapperSuffix}`
|
|
446
453
|
: `${tool} wrapper missing or not first in PATH`,
|
|
447
454
|
});
|
|
448
455
|
}
|
|
@@ -452,7 +459,7 @@ export async function runDoctor(phrenPath, fix = false, checkData = false) {
|
|
|
452
459
|
name: "wrapper:phren-cli",
|
|
453
460
|
ok: phrenCliActive,
|
|
454
461
|
detail: phrenCliActive
|
|
455
|
-
?
|
|
462
|
+
? `phren CLI wrapper active via ~/.local/bin/phren${wrapperSuffix}`
|
|
456
463
|
: "phren CLI wrapper missing — run 'npx @phren/cli init' to install",
|
|
457
464
|
});
|
|
458
465
|
if (fix) {
|