adhdev 0.5.0 → 0.5.2
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-entrypoint.js +16 -10
- package/dist/cli-entrypoint.js.map +1 -1
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20473,6 +20473,7 @@ var require_dist = __commonJS({
|
|
|
20473
20473
|
watchers = [];
|
|
20474
20474
|
logFn;
|
|
20475
20475
|
versionArchive = null;
|
|
20476
|
+
scriptsCache = /* @__PURE__ */ new Map();
|
|
20476
20477
|
/** Inject VersionArchive so resolve() can auto-detect installed versions */
|
|
20477
20478
|
setVersionArchive(archive) {
|
|
20478
20479
|
this.versionArchive = archive;
|
|
@@ -20825,12 +20826,15 @@ var require_dist = __commonJS({
|
|
|
20825
20826
|
this.log(` [loadScriptsFromDir] ${type}: dir not found: ${dir}`);
|
|
20826
20827
|
return null;
|
|
20827
20828
|
}
|
|
20829
|
+
const cached2 = this.scriptsCache.get(dir);
|
|
20830
|
+
if (cached2) return cached2;
|
|
20828
20831
|
const scriptsJs = path4.join(dir, "scripts.js");
|
|
20829
20832
|
if (fs4.existsSync(scriptsJs)) {
|
|
20830
20833
|
try {
|
|
20831
20834
|
delete require.cache[require.resolve(scriptsJs)];
|
|
20832
20835
|
const loaded = require(scriptsJs);
|
|
20833
20836
|
this.log(` [loadScriptsFromDir] ${type}: loaded scripts.js from ${dir} (${Object.keys(loaded).length} exports)`);
|
|
20837
|
+
this.scriptsCache.set(dir, loaded);
|
|
20834
20838
|
return loaded;
|
|
20835
20839
|
} catch (e) {
|
|
20836
20840
|
this.log(` \u26A0 scripts.js load failed: ${scriptsJs}: ${e.message}`);
|
|
@@ -20838,6 +20842,7 @@ var require_dist = __commonJS({
|
|
|
20838
20842
|
}
|
|
20839
20843
|
const result = this.buildScriptWrappersFromDir(dir);
|
|
20840
20844
|
this.log(` [loadScriptsFromDir] ${type}: built wrappers from ${dir} (${Object.keys(result).length} scripts)`);
|
|
20845
|
+
this.scriptsCache.set(dir, result);
|
|
20841
20846
|
return result;
|
|
20842
20847
|
}
|
|
20843
20848
|
/**
|
|
@@ -20885,6 +20890,7 @@ var require_dist = __commonJS({
|
|
|
20885
20890
|
*/
|
|
20886
20891
|
reload() {
|
|
20887
20892
|
this.log("Reloading all providers...");
|
|
20893
|
+
this.scriptsCache.clear();
|
|
20888
20894
|
for (const key of Object.keys(require.cache)) {
|
|
20889
20895
|
if (key.includes("providers") && (key.endsWith(".js") || key.endsWith(".json"))) {
|
|
20890
20896
|
delete require.cache[key];
|
|
@@ -22074,14 +22080,14 @@ var require_dist = __commonJS({
|
|
|
22074
22080
|
const acpSummary = acpStates.map((s) => `${s.type}(${s.status})`).join(", ");
|
|
22075
22081
|
const logLevel = opts?.p2pOnly ? "debug" : "info";
|
|
22076
22082
|
const summary = `\u2192${target} IDE: ${ideStates.length} [${ideSummary}] CLI: ${cliStates.length} [${cliSummary}] ACP: ${acpStates.length} [${acpSummary}]`;
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22083
|
+
const summaryChanged = summary !== this.lastStatusSummary;
|
|
22084
|
+
if (summaryChanged) {
|
|
22085
|
+
this.lastStatusSummary = summary;
|
|
22086
|
+
if (logLevel === "debug") {
|
|
22080
22087
|
LOG4.debug("StatusReport", summary);
|
|
22088
|
+
} else {
|
|
22089
|
+
LOG4.info("StatusReport", summary);
|
|
22081
22090
|
}
|
|
22082
|
-
} else {
|
|
22083
|
-
this.lastStatusSummary = summary;
|
|
22084
|
-
LOG4.info("StatusReport", summary);
|
|
22085
22091
|
}
|
|
22086
22092
|
const managedIdes = ideStates.map((s) => ({
|
|
22087
22093
|
ideType: s.type,
|
|
@@ -29421,7 +29427,7 @@ async function startDaemonFlow() {
|
|
|
29421
29427
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
29422
29428
|
if (isDaemonRunning2()) {
|
|
29423
29429
|
console.log(import_chalk2.default.green(" \u2713 Daemon is already running"));
|
|
29424
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://
|
|
29430
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard\n"));
|
|
29425
29431
|
return;
|
|
29426
29432
|
}
|
|
29427
29433
|
const { startDaemon } = await import_inquirer.default.prompt([
|
|
@@ -29456,11 +29462,11 @@ async function startDaemonFlow() {
|
|
|
29456
29462
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
29457
29463
|
if (isDaemonRunning2()) {
|
|
29458
29464
|
daemonSpinner.succeed("Daemon started");
|
|
29459
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://
|
|
29465
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
29460
29466
|
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
29461
29467
|
} else {
|
|
29462
29468
|
daemonSpinner.succeed("Daemon starting in background");
|
|
29463
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://
|
|
29469
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
29464
29470
|
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
29465
29471
|
}
|
|
29466
29472
|
console.log();
|