adhdev 0.9.76-rc.1 → 0.9.76-rc.10
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/index.js +330 -273
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +286 -231
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/vendor/mcp-server/index.js +52030 -41
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -8397,6 +8397,14 @@ function getActiveChatOptions(profile) {
|
|
|
8397
8397
|
if (profile === "full") return {};
|
|
8398
8398
|
return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
|
|
8399
8399
|
}
|
|
8400
|
+
function resolveSessionStatus(activeChat, providerStatus) {
|
|
8401
|
+
const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
|
|
8402
|
+
const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
|
|
8403
|
+
if (chatStatus === "waiting_approval" || topLevelStatus === "waiting_approval") return "waiting_approval";
|
|
8404
|
+
if (chatStatus === "generating" || topLevelStatus === "generating") return "generating";
|
|
8405
|
+
if (topLevelStatus !== "idle") return topLevelStatus;
|
|
8406
|
+
return chatStatus;
|
|
8407
|
+
}
|
|
8400
8408
|
function shouldIncludeSessionControls(profile) {
|
|
8401
8409
|
return profile !== "live";
|
|
8402
8410
|
}
|
|
@@ -8452,9 +8460,7 @@ function buildIdeWorkspaceSession(state, cdpManagers, options) {
|
|
|
8452
8460
|
providerName: state.name,
|
|
8453
8461
|
kind: "workspace",
|
|
8454
8462
|
transport: "cdp-page",
|
|
8455
|
-
status:
|
|
8456
|
-
activeModal: activeChat?.activeModal || null
|
|
8457
|
-
}),
|
|
8463
|
+
status: resolveSessionStatus(activeChat, state.status),
|
|
8458
8464
|
title,
|
|
8459
8465
|
workspace,
|
|
8460
8466
|
...git && { git },
|
|
@@ -8489,9 +8495,7 @@ function buildExtensionAgentSession(parent, ext, options) {
|
|
|
8489
8495
|
providerSessionId: ext.providerSessionId,
|
|
8490
8496
|
kind: "agent",
|
|
8491
8497
|
transport: "cdp-webview",
|
|
8492
|
-
status:
|
|
8493
|
-
activeModal: activeChat?.activeModal || null
|
|
8494
|
-
}),
|
|
8498
|
+
status: resolveSessionStatus(activeChat, ext.status),
|
|
8495
8499
|
title: activeChat?.title || ext.name,
|
|
8496
8500
|
workspace,
|
|
8497
8501
|
...git && { git },
|
|
@@ -8541,9 +8545,7 @@ function buildCliSession(state, options) {
|
|
|
8541
8545
|
providerSessionId: state.providerSessionId,
|
|
8542
8546
|
kind: "agent",
|
|
8543
8547
|
transport: "pty",
|
|
8544
|
-
status:
|
|
8545
|
-
activeModal: activeChat?.activeModal || null
|
|
8546
|
-
}),
|
|
8548
|
+
status: resolveSessionStatus(activeChat, state.status),
|
|
8547
8549
|
title: activeChat?.title || state.name,
|
|
8548
8550
|
workspace,
|
|
8549
8551
|
...git && { git },
|
|
@@ -8591,9 +8593,7 @@ function buildAcpSession(state, options) {
|
|
|
8591
8593
|
providerName: state.name,
|
|
8592
8594
|
kind: "agent",
|
|
8593
8595
|
transport: "acp",
|
|
8594
|
-
status:
|
|
8595
|
-
activeModal: activeChat?.activeModal || null
|
|
8596
|
-
}),
|
|
8596
|
+
status: resolveSessionStatus(activeChat, state.status),
|
|
8597
8597
|
title: activeChat?.title || state.name,
|
|
8598
8598
|
workspace,
|
|
8599
8599
|
...git && { git },
|
|
@@ -13678,8 +13678,9 @@ var init_provider_cli_adapter = __esm({
|
|
|
13678
13678
|
const currentSnapshot = normalizeScreenSnapshot(screenText);
|
|
13679
13679
|
const lastSnapshot = this.lastScreenSnapshot;
|
|
13680
13680
|
if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
|
|
13681
|
-
const
|
|
13682
|
-
const
|
|
13681
|
+
const activeScreenPattern = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel|Enter to confirm\s*[·•-]\s*Esc to cancel|\b(?:MCP servers?|tool calls?)\b[^\n\r]{0,160}\brequire approval\b/i;
|
|
13682
|
+
const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
|
|
13683
|
+
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
|
|
13683
13684
|
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
13684
13685
|
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
13685
13686
|
return `${screenText}
|
|
@@ -34827,7 +34828,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
34827
34828
|
}
|
|
34828
34829
|
});
|
|
34829
34830
|
|
|
34830
|
-
// ../../oss/
|
|
34831
|
+
// ../../oss/node_modules/readdirp/esm/index.js
|
|
34831
34832
|
function readdirp(root, options = {}) {
|
|
34832
34833
|
let type = options.entryType || options.type;
|
|
34833
34834
|
if (type === "both")
|
|
@@ -34844,13 +34845,13 @@ function readdirp(root, options = {}) {
|
|
|
34844
34845
|
options.root = root;
|
|
34845
34846
|
return new ReaddirpStream(options);
|
|
34846
34847
|
}
|
|
34847
|
-
var import_promises3,
|
|
34848
|
-
var
|
|
34849
|
-
"../../oss/
|
|
34848
|
+
var import_promises3, import_node_stream, import_node_path, EntryTypes, defaultOptions, RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream;
|
|
34849
|
+
var init_esm = __esm({
|
|
34850
|
+
"../../oss/node_modules/readdirp/esm/index.js"() {
|
|
34850
34851
|
"use strict";
|
|
34851
34852
|
import_promises3 = require("fs/promises");
|
|
34852
|
-
import_node_path = require("path");
|
|
34853
34853
|
import_node_stream = require("stream");
|
|
34854
|
+
import_node_path = require("path");
|
|
34854
34855
|
EntryTypes = {
|
|
34855
34856
|
FILE_TYPE: "files",
|
|
34856
34857
|
DIR_TYPE: "directories",
|
|
@@ -34905,20 +34906,6 @@ var init_readdirp = __esm({
|
|
|
34905
34906
|
return emptyFn;
|
|
34906
34907
|
};
|
|
34907
34908
|
ReaddirpStream = class extends import_node_stream.Readable {
|
|
34908
|
-
parents;
|
|
34909
|
-
reading;
|
|
34910
|
-
parent;
|
|
34911
|
-
_stat;
|
|
34912
|
-
_maxDepth;
|
|
34913
|
-
_wantsDir;
|
|
34914
|
-
_wantsFile;
|
|
34915
|
-
_wantsEverything;
|
|
34916
|
-
_root;
|
|
34917
|
-
_isDirent;
|
|
34918
|
-
_statsProp;
|
|
34919
|
-
_rdOptions;
|
|
34920
|
-
_fileFilter;
|
|
34921
|
-
_directoryFilter;
|
|
34922
34909
|
constructor(options = {}) {
|
|
34923
34910
|
super({
|
|
34924
34911
|
objectMode: true,
|
|
@@ -34935,7 +34922,7 @@ var init_readdirp = __esm({
|
|
|
34935
34922
|
} else {
|
|
34936
34923
|
this._stat = statMethod;
|
|
34937
34924
|
}
|
|
34938
|
-
this._maxDepth = opts.depth
|
|
34925
|
+
this._maxDepth = opts.depth ?? defaultOptions.depth;
|
|
34939
34926
|
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
34940
34927
|
this._wantsFile = type ? FILE_TYPES.has(type) : false;
|
|
34941
34928
|
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
@@ -35066,17 +35053,17 @@ var init_readdirp = __esm({
|
|
|
35066
35053
|
}
|
|
35067
35054
|
});
|
|
35068
35055
|
|
|
35069
|
-
// ../../oss/
|
|
35056
|
+
// ../../oss/node_modules/chokidar/esm/handler.js
|
|
35070
35057
|
function createFsWatchInstance(path33, options, listener, errHandler, emitRaw) {
|
|
35071
35058
|
const handleEvent = (rawEvent, evPath) => {
|
|
35072
35059
|
listener(path33);
|
|
35073
35060
|
emitRaw(rawEvent, evPath, { watchedPath: path33 });
|
|
35074
35061
|
if (evPath && path33 !== evPath) {
|
|
35075
|
-
fsWatchBroadcast(
|
|
35062
|
+
fsWatchBroadcast(sysPath.resolve(path33, evPath), KEY_LISTENERS, sysPath.join(path33, evPath));
|
|
35076
35063
|
}
|
|
35077
35064
|
};
|
|
35078
35065
|
try {
|
|
35079
|
-
return (0,
|
|
35066
|
+
return (0, import_fs7.watch)(path33, {
|
|
35080
35067
|
persistent: options.persistent
|
|
35081
35068
|
}, handleEvent);
|
|
35082
35069
|
} catch (error48) {
|
|
@@ -35084,14 +35071,14 @@ function createFsWatchInstance(path33, options, listener, errHandler, emitRaw) {
|
|
|
35084
35071
|
return void 0;
|
|
35085
35072
|
}
|
|
35086
35073
|
}
|
|
35087
|
-
var
|
|
35074
|
+
var import_fs7, import_promises4, sysPath, import_os3, STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl, isWindows, isMacos, isLinux, isFreeBSD, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler;
|
|
35088
35075
|
var init_handler2 = __esm({
|
|
35089
|
-
"../../oss/
|
|
35076
|
+
"../../oss/node_modules/chokidar/esm/handler.js"() {
|
|
35090
35077
|
"use strict";
|
|
35091
|
-
|
|
35078
|
+
import_fs7 = require("fs");
|
|
35092
35079
|
import_promises4 = require("fs/promises");
|
|
35093
|
-
|
|
35094
|
-
|
|
35080
|
+
sysPath = __toESM(require("path"), 1);
|
|
35081
|
+
import_os3 = require("os");
|
|
35095
35082
|
STR_DATA = "data";
|
|
35096
35083
|
STR_END = "end";
|
|
35097
35084
|
STR_CLOSE = "close";
|
|
@@ -35102,7 +35089,7 @@ var init_handler2 = __esm({
|
|
|
35102
35089
|
isMacos = pl === "darwin";
|
|
35103
35090
|
isLinux = pl === "linux";
|
|
35104
35091
|
isFreeBSD = pl === "freebsd";
|
|
35105
|
-
isIBMi = (0,
|
|
35092
|
+
isIBMi = (0, import_os3.type)() === "OS400";
|
|
35106
35093
|
EVENTS = {
|
|
35107
35094
|
ALL: "all",
|
|
35108
35095
|
READY: "ready",
|
|
@@ -35384,7 +35371,7 @@ var init_handler2 = __esm({
|
|
|
35384
35371
|
"zip",
|
|
35385
35372
|
"zipx"
|
|
35386
35373
|
]);
|
|
35387
|
-
isBinaryPath = (filePath) => binaryExtensions.has(
|
|
35374
|
+
isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());
|
|
35388
35375
|
foreach = (val, fn) => {
|
|
35389
35376
|
if (val instanceof Set) {
|
|
35390
35377
|
val.forEach(fn);
|
|
@@ -35492,7 +35479,7 @@ var init_handler2 = __esm({
|
|
|
35492
35479
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
35493
35480
|
const copts = cont && cont.options;
|
|
35494
35481
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
35495
|
-
(0,
|
|
35482
|
+
(0, import_fs7.unwatchFile)(fullPath);
|
|
35496
35483
|
cont = void 0;
|
|
35497
35484
|
}
|
|
35498
35485
|
if (cont) {
|
|
@@ -35503,7 +35490,7 @@ var init_handler2 = __esm({
|
|
|
35503
35490
|
listeners: listener,
|
|
35504
35491
|
rawEmitters: rawEmitter,
|
|
35505
35492
|
options,
|
|
35506
|
-
watcher: (0,
|
|
35493
|
+
watcher: (0, import_fs7.watchFile)(fullPath, options, (curr, prev) => {
|
|
35507
35494
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
35508
35495
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
35509
35496
|
});
|
|
@@ -35520,15 +35507,13 @@ var init_handler2 = __esm({
|
|
|
35520
35507
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
35521
35508
|
if (isEmptySet(cont.listeners)) {
|
|
35522
35509
|
FsWatchFileInstances.delete(fullPath);
|
|
35523
|
-
(0,
|
|
35510
|
+
(0, import_fs7.unwatchFile)(fullPath);
|
|
35524
35511
|
cont.options = cont.watcher = void 0;
|
|
35525
35512
|
Object.freeze(cont);
|
|
35526
35513
|
}
|
|
35527
35514
|
};
|
|
35528
35515
|
};
|
|
35529
35516
|
NodeFsHandler = class {
|
|
35530
|
-
fsw;
|
|
35531
|
-
_boundHandleError;
|
|
35532
35517
|
constructor(fsW) {
|
|
35533
35518
|
this.fsw = fsW;
|
|
35534
35519
|
this._boundHandleError = (error48) => fsW._handleError(error48);
|
|
@@ -35541,11 +35526,11 @@ var init_handler2 = __esm({
|
|
|
35541
35526
|
*/
|
|
35542
35527
|
_watchWithNodeFs(path33, listener) {
|
|
35543
35528
|
const opts = this.fsw.options;
|
|
35544
|
-
const directory =
|
|
35545
|
-
const basename9 =
|
|
35529
|
+
const directory = sysPath.dirname(path33);
|
|
35530
|
+
const basename9 = sysPath.basename(path33);
|
|
35546
35531
|
const parent = this.fsw._getWatchedDir(directory);
|
|
35547
35532
|
parent.add(basename9);
|
|
35548
|
-
const absolutePath =
|
|
35533
|
+
const absolutePath = sysPath.resolve(path33);
|
|
35549
35534
|
const options = {
|
|
35550
35535
|
persistent: opts.persistent
|
|
35551
35536
|
};
|
|
@@ -35576,8 +35561,8 @@ var init_handler2 = __esm({
|
|
|
35576
35561
|
if (this.fsw.closed) {
|
|
35577
35562
|
return;
|
|
35578
35563
|
}
|
|
35579
|
-
const dirname11 =
|
|
35580
|
-
const basename9 =
|
|
35564
|
+
const dirname11 = sysPath.dirname(file2);
|
|
35565
|
+
const basename9 = sysPath.basename(file2);
|
|
35581
35566
|
const parent = this.fsw._getWatchedDir(dirname11);
|
|
35582
35567
|
let prevStats = stats;
|
|
35583
35568
|
if (parent.has(basename9))
|
|
@@ -35668,9 +35653,8 @@ var init_handler2 = __esm({
|
|
|
35668
35653
|
this.fsw._symlinkPaths.set(full, true);
|
|
35669
35654
|
}
|
|
35670
35655
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
35671
|
-
directory =
|
|
35672
|
-
|
|
35673
|
-
throttler = this.fsw._throttle("readdir", throttleKey, 1e3);
|
|
35656
|
+
directory = sysPath.join(directory, "");
|
|
35657
|
+
throttler = this.fsw._throttle("readdir", directory, 1e3);
|
|
35674
35658
|
if (!throttler)
|
|
35675
35659
|
return;
|
|
35676
35660
|
const previous = this.fsw._getWatchedDir(wh.path);
|
|
@@ -35687,7 +35671,7 @@ var init_handler2 = __esm({
|
|
|
35687
35671
|
return;
|
|
35688
35672
|
}
|
|
35689
35673
|
const item = entry.path;
|
|
35690
|
-
let path33 =
|
|
35674
|
+
let path33 = sysPath.join(directory, item);
|
|
35691
35675
|
current.add(item);
|
|
35692
35676
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path33, item)) {
|
|
35693
35677
|
return;
|
|
@@ -35698,7 +35682,7 @@ var init_handler2 = __esm({
|
|
|
35698
35682
|
}
|
|
35699
35683
|
if (item === target || !target && !previous.has(item)) {
|
|
35700
35684
|
this.fsw._incrReadyCount();
|
|
35701
|
-
path33 =
|
|
35685
|
+
path33 = sysPath.join(dir, sysPath.relative(dir, path33));
|
|
35702
35686
|
this._addToNodeFs(path33, initialAdd, wh, depth + 1);
|
|
35703
35687
|
}
|
|
35704
35688
|
}).on(EV.ERROR, this._boundHandleError);
|
|
@@ -35735,12 +35719,12 @@ var init_handler2 = __esm({
|
|
|
35735
35719
|
* @returns closer for the watcher instance.
|
|
35736
35720
|
*/
|
|
35737
35721
|
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath4) {
|
|
35738
|
-
const parentDir = this.fsw._getWatchedDir(
|
|
35739
|
-
const tracked = parentDir.has(
|
|
35722
|
+
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
|
|
35723
|
+
const tracked = parentDir.has(sysPath.basename(dir));
|
|
35740
35724
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
35741
35725
|
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
35742
35726
|
}
|
|
35743
|
-
parentDir.add(
|
|
35727
|
+
parentDir.add(sysPath.basename(dir));
|
|
35744
35728
|
this.fsw._getWatchedDir(dir);
|
|
35745
35729
|
let throttler;
|
|
35746
35730
|
let closer;
|
|
@@ -35790,7 +35774,7 @@ var init_handler2 = __esm({
|
|
|
35790
35774
|
const follow = this.fsw.options.followSymlinks;
|
|
35791
35775
|
let closer;
|
|
35792
35776
|
if (stats.isDirectory()) {
|
|
35793
|
-
const absPath =
|
|
35777
|
+
const absPath = sysPath.resolve(path33);
|
|
35794
35778
|
const targetPath = follow ? await (0, import_promises4.realpath)(path33) : path33;
|
|
35795
35779
|
if (this.fsw.closed)
|
|
35796
35780
|
return;
|
|
@@ -35804,14 +35788,14 @@ var init_handler2 = __esm({
|
|
|
35804
35788
|
const targetPath = follow ? await (0, import_promises4.realpath)(path33) : path33;
|
|
35805
35789
|
if (this.fsw.closed)
|
|
35806
35790
|
return;
|
|
35807
|
-
const parent =
|
|
35791
|
+
const parent = sysPath.dirname(wh.watchPath);
|
|
35808
35792
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
35809
35793
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
35810
35794
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path33, wh, targetPath);
|
|
35811
35795
|
if (this.fsw.closed)
|
|
35812
35796
|
return;
|
|
35813
35797
|
if (targetPath !== void 0) {
|
|
35814
|
-
this.fsw._symlinkPaths.set(
|
|
35798
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path33), targetPath);
|
|
35815
35799
|
}
|
|
35816
35800
|
} else {
|
|
35817
35801
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -35831,7 +35815,7 @@ var init_handler2 = __esm({
|
|
|
35831
35815
|
}
|
|
35832
35816
|
});
|
|
35833
35817
|
|
|
35834
|
-
// ../../oss/
|
|
35818
|
+
// ../../oss/node_modules/chokidar/esm/index.js
|
|
35835
35819
|
function arrify(item) {
|
|
35836
35820
|
return Array.isArray(item) ? item : [item];
|
|
35837
35821
|
}
|
|
@@ -35847,11 +35831,11 @@ function createPattern(matcher) {
|
|
|
35847
35831
|
if (matcher.path === string4)
|
|
35848
35832
|
return true;
|
|
35849
35833
|
if (matcher.recursive) {
|
|
35850
|
-
const relative5 =
|
|
35834
|
+
const relative5 = sysPath2.relative(matcher.path, string4);
|
|
35851
35835
|
if (!relative5) {
|
|
35852
35836
|
return false;
|
|
35853
35837
|
}
|
|
35854
|
-
return !relative5.startsWith("..") && !
|
|
35838
|
+
return !relative5.startsWith("..") && !sysPath2.isAbsolute(relative5);
|
|
35855
35839
|
}
|
|
35856
35840
|
return false;
|
|
35857
35841
|
};
|
|
@@ -35861,12 +35845,14 @@ function createPattern(matcher) {
|
|
|
35861
35845
|
function normalizePath(path33) {
|
|
35862
35846
|
if (typeof path33 !== "string")
|
|
35863
35847
|
throw new Error("string expected");
|
|
35864
|
-
path33 =
|
|
35848
|
+
path33 = sysPath2.normalize(path33);
|
|
35865
35849
|
path33 = path33.replace(/\\/g, "/");
|
|
35866
35850
|
let prepend = false;
|
|
35867
35851
|
if (path33.startsWith("//"))
|
|
35868
35852
|
prepend = true;
|
|
35869
|
-
|
|
35853
|
+
const DOUBLE_SLASH_RE2 = /\/\//;
|
|
35854
|
+
while (path33.match(DOUBLE_SLASH_RE2))
|
|
35855
|
+
path33 = path33.replace(DOUBLE_SLASH_RE2, "/");
|
|
35870
35856
|
if (prepend)
|
|
35871
35857
|
path33 = "/" + path33;
|
|
35872
35858
|
return path33;
|
|
@@ -35899,15 +35885,15 @@ function watch(paths, options = {}) {
|
|
|
35899
35885
|
watcher.add(paths);
|
|
35900
35886
|
return watcher;
|
|
35901
35887
|
}
|
|
35902
|
-
var
|
|
35903
|
-
var
|
|
35904
|
-
"../../oss/
|
|
35888
|
+
var import_fs8, import_promises5, import_events, sysPath2, SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher;
|
|
35889
|
+
var init_esm2 = __esm({
|
|
35890
|
+
"../../oss/node_modules/chokidar/esm/index.js"() {
|
|
35905
35891
|
"use strict";
|
|
35906
|
-
|
|
35907
|
-
import_node_fs3 = require("fs");
|
|
35892
|
+
import_fs8 = require("fs");
|
|
35908
35893
|
import_promises5 = require("fs/promises");
|
|
35909
|
-
|
|
35910
|
-
|
|
35894
|
+
import_events = require("events");
|
|
35895
|
+
sysPath2 = __toESM(require("path"), 1);
|
|
35896
|
+
init_esm();
|
|
35911
35897
|
init_handler2();
|
|
35912
35898
|
SLASH = "/";
|
|
35913
35899
|
SLASH_SLASH = "//";
|
|
@@ -35915,7 +35901,7 @@ var init_chokidar = __esm({
|
|
|
35915
35901
|
TWO_DOTS = "..";
|
|
35916
35902
|
STRING_TYPE = "string";
|
|
35917
35903
|
BACK_SLASH_RE = /\\/g;
|
|
35918
|
-
DOUBLE_SLASH_RE =
|
|
35904
|
+
DOUBLE_SLASH_RE = /\/\//;
|
|
35919
35905
|
DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
35920
35906
|
REPLACER_RE = /^\.[/\\]/;
|
|
35921
35907
|
isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
@@ -35932,31 +35918,30 @@ var init_chokidar = __esm({
|
|
|
35932
35918
|
if (str.startsWith(SLASH_SLASH)) {
|
|
35933
35919
|
prepend = true;
|
|
35934
35920
|
}
|
|
35935
|
-
|
|
35921
|
+
while (str.match(DOUBLE_SLASH_RE)) {
|
|
35922
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
35923
|
+
}
|
|
35936
35924
|
if (prepend) {
|
|
35937
35925
|
str = SLASH + str;
|
|
35938
35926
|
}
|
|
35939
35927
|
return str;
|
|
35940
35928
|
};
|
|
35941
|
-
normalizePathToUnix = (path33) => toUnix(
|
|
35929
|
+
normalizePathToUnix = (path33) => toUnix(sysPath2.normalize(toUnix(path33)));
|
|
35942
35930
|
normalizeIgnored = (cwd = "") => (path33) => {
|
|
35943
35931
|
if (typeof path33 === "string") {
|
|
35944
|
-
return normalizePathToUnix(
|
|
35932
|
+
return normalizePathToUnix(sysPath2.isAbsolute(path33) ? path33 : sysPath2.join(cwd, path33));
|
|
35945
35933
|
} else {
|
|
35946
35934
|
return path33;
|
|
35947
35935
|
}
|
|
35948
35936
|
};
|
|
35949
35937
|
getAbsolutePath = (path33, cwd) => {
|
|
35950
|
-
if (
|
|
35938
|
+
if (sysPath2.isAbsolute(path33)) {
|
|
35951
35939
|
return path33;
|
|
35952
35940
|
}
|
|
35953
|
-
return
|
|
35941
|
+
return sysPath2.join(cwd, path33);
|
|
35954
35942
|
};
|
|
35955
35943
|
EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
35956
35944
|
DirEntry = class {
|
|
35957
|
-
path;
|
|
35958
|
-
_removeWatcher;
|
|
35959
|
-
items;
|
|
35960
35945
|
constructor(dir, removeWatcher) {
|
|
35961
35946
|
this.path = dir;
|
|
35962
35947
|
this._removeWatcher = removeWatcher;
|
|
@@ -35981,7 +35966,7 @@ var init_chokidar = __esm({
|
|
|
35981
35966
|
await (0, import_promises5.readdir)(dir);
|
|
35982
35967
|
} catch (err) {
|
|
35983
35968
|
if (this._removeWatcher) {
|
|
35984
|
-
this._removeWatcher(
|
|
35969
|
+
this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
|
|
35985
35970
|
}
|
|
35986
35971
|
}
|
|
35987
35972
|
}
|
|
@@ -36008,19 +35993,12 @@ var init_chokidar = __esm({
|
|
|
36008
35993
|
STAT_METHOD_F = "stat";
|
|
36009
35994
|
STAT_METHOD_L = "lstat";
|
|
36010
35995
|
WatchHelper = class {
|
|
36011
|
-
fsw;
|
|
36012
|
-
path;
|
|
36013
|
-
watchPath;
|
|
36014
|
-
fullWatchPath;
|
|
36015
|
-
dirParts;
|
|
36016
|
-
followSymlinks;
|
|
36017
|
-
statMethod;
|
|
36018
35996
|
constructor(path33, follow, fsw) {
|
|
36019
35997
|
this.fsw = fsw;
|
|
36020
35998
|
const watchPath = path33;
|
|
36021
35999
|
this.path = path33 = path33.replace(REPLACER_RE, "");
|
|
36022
36000
|
this.watchPath = watchPath;
|
|
36023
|
-
this.fullWatchPath =
|
|
36001
|
+
this.fullWatchPath = sysPath2.resolve(watchPath);
|
|
36024
36002
|
this.dirParts = [];
|
|
36025
36003
|
this.dirParts.forEach((parts) => {
|
|
36026
36004
|
if (parts.length > 1)
|
|
@@ -36030,7 +36008,7 @@ var init_chokidar = __esm({
|
|
|
36030
36008
|
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
36031
36009
|
}
|
|
36032
36010
|
entryPath(entry) {
|
|
36033
|
-
return
|
|
36011
|
+
return sysPath2.join(this.watchPath, sysPath2.relative(this.watchPath, entry.fullPath));
|
|
36034
36012
|
}
|
|
36035
36013
|
filterPath(entry) {
|
|
36036
36014
|
const { stats } = entry;
|
|
@@ -36043,25 +36021,7 @@ var init_chokidar = __esm({
|
|
|
36043
36021
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
36044
36022
|
}
|
|
36045
36023
|
};
|
|
36046
|
-
FSWatcher = class extends
|
|
36047
|
-
closed;
|
|
36048
|
-
options;
|
|
36049
|
-
_closers;
|
|
36050
|
-
_ignoredPaths;
|
|
36051
|
-
_throttled;
|
|
36052
|
-
_streams;
|
|
36053
|
-
_symlinkPaths;
|
|
36054
|
-
_watched;
|
|
36055
|
-
_pendingWrites;
|
|
36056
|
-
_pendingUnlinks;
|
|
36057
|
-
_readyCount;
|
|
36058
|
-
_emitReady;
|
|
36059
|
-
_closePromise;
|
|
36060
|
-
_userIgnored;
|
|
36061
|
-
_readyEmitted;
|
|
36062
|
-
_emitRaw;
|
|
36063
|
-
_boundRemove;
|
|
36064
|
-
_nodeFsHandler;
|
|
36024
|
+
FSWatcher = class extends import_events.EventEmitter {
|
|
36065
36025
|
// Not indenting methods for history sake; for now.
|
|
36066
36026
|
constructor(_opts = {}) {
|
|
36067
36027
|
super();
|
|
@@ -36180,7 +36140,7 @@ var init_chokidar = __esm({
|
|
|
36180
36140
|
return;
|
|
36181
36141
|
results.forEach((item) => {
|
|
36182
36142
|
if (item)
|
|
36183
|
-
this.add(
|
|
36143
|
+
this.add(sysPath2.dirname(item), sysPath2.basename(_origAdd || item));
|
|
36184
36144
|
});
|
|
36185
36145
|
});
|
|
36186
36146
|
return this;
|
|
@@ -36194,10 +36154,10 @@ var init_chokidar = __esm({
|
|
|
36194
36154
|
const paths = unifyPaths(paths_);
|
|
36195
36155
|
const { cwd } = this.options;
|
|
36196
36156
|
paths.forEach((path33) => {
|
|
36197
|
-
if (!
|
|
36157
|
+
if (!sysPath2.isAbsolute(path33) && !this._closers.has(path33)) {
|
|
36198
36158
|
if (cwd)
|
|
36199
|
-
path33 =
|
|
36200
|
-
path33 =
|
|
36159
|
+
path33 = sysPath2.join(cwd, path33);
|
|
36160
|
+
path33 = sysPath2.resolve(path33);
|
|
36201
36161
|
}
|
|
36202
36162
|
this._closePath(path33);
|
|
36203
36163
|
this._addIgnoredPath(path33);
|
|
@@ -36246,7 +36206,7 @@ var init_chokidar = __esm({
|
|
|
36246
36206
|
getWatched() {
|
|
36247
36207
|
const watchList = {};
|
|
36248
36208
|
this._watched.forEach((entry, dir) => {
|
|
36249
|
-
const key = this.options.cwd ?
|
|
36209
|
+
const key = this.options.cwd ? sysPath2.relative(this.options.cwd, dir) : dir;
|
|
36250
36210
|
const index = key || ONE_DOT;
|
|
36251
36211
|
watchList[index] = entry.getChildren().sort();
|
|
36252
36212
|
});
|
|
@@ -36272,9 +36232,9 @@ var init_chokidar = __esm({
|
|
|
36272
36232
|
return;
|
|
36273
36233
|
const opts = this.options;
|
|
36274
36234
|
if (isWindows)
|
|
36275
|
-
path33 =
|
|
36235
|
+
path33 = sysPath2.normalize(path33);
|
|
36276
36236
|
if (opts.cwd)
|
|
36277
|
-
path33 =
|
|
36237
|
+
path33 = sysPath2.relative(opts.cwd, path33);
|
|
36278
36238
|
const args = [path33];
|
|
36279
36239
|
if (stats != null)
|
|
36280
36240
|
args.push(stats);
|
|
@@ -36325,7 +36285,7 @@ var init_chokidar = __esm({
|
|
|
36325
36285
|
return this;
|
|
36326
36286
|
}
|
|
36327
36287
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
36328
|
-
const fullPath = opts.cwd ?
|
|
36288
|
+
const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path33) : path33;
|
|
36329
36289
|
let stats2;
|
|
36330
36290
|
try {
|
|
36331
36291
|
stats2 = await (0, import_promises5.stat)(fullPath);
|
|
@@ -36401,13 +36361,13 @@ var init_chokidar = __esm({
|
|
|
36401
36361
|
const pollInterval = awf.pollInterval;
|
|
36402
36362
|
let timeoutHandler;
|
|
36403
36363
|
let fullPath = path33;
|
|
36404
|
-
if (this.options.cwd && !
|
|
36405
|
-
fullPath =
|
|
36364
|
+
if (this.options.cwd && !sysPath2.isAbsolute(path33)) {
|
|
36365
|
+
fullPath = sysPath2.join(this.options.cwd, path33);
|
|
36406
36366
|
}
|
|
36407
36367
|
const now = /* @__PURE__ */ new Date();
|
|
36408
36368
|
const writes = this._pendingWrites;
|
|
36409
36369
|
function awaitWriteFinishFn(prevStat) {
|
|
36410
|
-
(0,
|
|
36370
|
+
(0, import_fs8.stat)(fullPath, (err, curStat) => {
|
|
36411
36371
|
if (err || !writes.has(path33)) {
|
|
36412
36372
|
if (err && err.code !== "ENOENT")
|
|
36413
36373
|
awfEmit(err);
|
|
@@ -36472,7 +36432,7 @@ var init_chokidar = __esm({
|
|
|
36472
36432
|
* @param directory path of the directory
|
|
36473
36433
|
*/
|
|
36474
36434
|
_getWatchedDir(directory) {
|
|
36475
|
-
const dir =
|
|
36435
|
+
const dir = sysPath2.resolve(directory);
|
|
36476
36436
|
if (!this._watched.has(dir))
|
|
36477
36437
|
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
36478
36438
|
return this._watched.get(dir);
|
|
@@ -36495,8 +36455,8 @@ var init_chokidar = __esm({
|
|
|
36495
36455
|
* @param item base path of item/directory
|
|
36496
36456
|
*/
|
|
36497
36457
|
_remove(directory, item, isDirectory) {
|
|
36498
|
-
const path33 =
|
|
36499
|
-
const fullPath =
|
|
36458
|
+
const path33 = sysPath2.join(directory, item);
|
|
36459
|
+
const fullPath = sysPath2.resolve(path33);
|
|
36500
36460
|
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path33) || this._watched.has(fullPath);
|
|
36501
36461
|
if (!this._throttle("remove", path33, 100))
|
|
36502
36462
|
return;
|
|
@@ -36514,7 +36474,7 @@ var init_chokidar = __esm({
|
|
|
36514
36474
|
}
|
|
36515
36475
|
let relPath = path33;
|
|
36516
36476
|
if (this.options.cwd)
|
|
36517
|
-
relPath =
|
|
36477
|
+
relPath = sysPath2.relative(this.options.cwd, path33);
|
|
36518
36478
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
36519
36479
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
36520
36480
|
if (event === EVENTS.ADD)
|
|
@@ -36532,8 +36492,8 @@ var init_chokidar = __esm({
|
|
|
36532
36492
|
*/
|
|
36533
36493
|
_closePath(path33) {
|
|
36534
36494
|
this._closeFile(path33);
|
|
36535
|
-
const dir =
|
|
36536
|
-
this._getWatchedDir(dir).remove(
|
|
36495
|
+
const dir = sysPath2.dirname(path33);
|
|
36496
|
+
this._getWatchedDir(dir).remove(sysPath2.basename(path33));
|
|
36537
36497
|
}
|
|
36538
36498
|
/**
|
|
36539
36499
|
* Closes only file-specific watchers
|
|
@@ -36878,7 +36838,7 @@ var init_provider_loader = __esm({
|
|
|
36878
36838
|
fs7 = __toESM(require("fs"));
|
|
36879
36839
|
path17 = __toESM(require("path"));
|
|
36880
36840
|
os16 = __toESM(require("os"));
|
|
36881
|
-
|
|
36841
|
+
init_esm2();
|
|
36882
36842
|
init_ide_detector();
|
|
36883
36843
|
init_logger();
|
|
36884
36844
|
init_provider_schema();
|
|
@@ -39099,7 +39059,7 @@ function resolveAdhdevMcpServerLaunch(options) {
|
|
|
39099
39059
|
if (!entryPath) return null;
|
|
39100
39060
|
return {
|
|
39101
39061
|
command: options.nodeExecutable?.trim() || process.execPath,
|
|
39102
|
-
args: [entryPath, "--repo-mesh", options.meshId]
|
|
39062
|
+
args: [entryPath, "--mode", "ipc", "--repo-mesh", options.meshId]
|
|
39103
39063
|
};
|
|
39104
39064
|
}
|
|
39105
39065
|
function resolveAdhdevMcpEntryPath(explicitPath) {
|
|
@@ -39137,17 +39097,17 @@ function resolveAdhdevMcpEntryPath(explicitPath) {
|
|
|
39137
39097
|
}
|
|
39138
39098
|
function normalizeExistingPath(filePath) {
|
|
39139
39099
|
try {
|
|
39140
|
-
if (!(0,
|
|
39141
|
-
return
|
|
39100
|
+
if (!(0, import_node_fs2.existsSync)(filePath)) return null;
|
|
39101
|
+
return import_node_fs2.realpathSync.native(filePath);
|
|
39142
39102
|
} catch {
|
|
39143
39103
|
return null;
|
|
39144
39104
|
}
|
|
39145
39105
|
}
|
|
39146
|
-
var
|
|
39106
|
+
var import_node_fs2, import_node_module2, import_node_path2, DEFAULT_SERVER_NAME, DEFAULT_ADHDEV_MCP_COMMAND;
|
|
39147
39107
|
var init_mesh_coordinator = __esm({
|
|
39148
39108
|
"../../oss/packages/daemon-core/src/commands/mesh-coordinator.ts"() {
|
|
39149
39109
|
"use strict";
|
|
39150
|
-
|
|
39110
|
+
import_node_fs2 = require("fs");
|
|
39151
39111
|
import_node_module2 = require("module");
|
|
39152
39112
|
import_node_path2 = require("path");
|
|
39153
39113
|
DEFAULT_SERVER_NAME = "adhdev-mesh";
|
|
@@ -39917,7 +39877,7 @@ function summarizeSessionHostPruneResult(result) {
|
|
|
39917
39877
|
keptCount: Array.isArray(value.keptSessionIds) ? value.keptSessionIds.length : void 0
|
|
39918
39878
|
};
|
|
39919
39879
|
}
|
|
39920
|
-
var fs10, CHANNEL_NPM_TAG, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
39880
|
+
var fs10, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
39921
39881
|
var init_router = __esm({
|
|
39922
39882
|
"../../oss/packages/daemon-core/src/commands/router.ts"() {
|
|
39923
39883
|
"use strict";
|
|
@@ -39945,6 +39905,10 @@ var init_router = __esm({
|
|
|
39945
39905
|
init_upgrade_helper();
|
|
39946
39906
|
fs10 = __toESM(require("fs"));
|
|
39947
39907
|
CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
|
|
39908
|
+
CHANNEL_SERVER_URL = {
|
|
39909
|
+
stable: "https://api.adhf.dev",
|
|
39910
|
+
preview: "https://api-preview.adhf.dev"
|
|
39911
|
+
};
|
|
39948
39912
|
CHAT_COMMANDS = [
|
|
39949
39913
|
"send_chat",
|
|
39950
39914
|
"new_chat",
|
|
@@ -40550,6 +40514,7 @@ var init_router = __esm({
|
|
|
40550
40514
|
const npmTag = CHANNEL_NPM_TAG[channel];
|
|
40551
40515
|
const latest = String(execNpmCommandSync(["view", `${pkgName}@${npmTag}`, "version"], { encoding: "utf-8", timeout: 1e4 }, npmSurface)).trim();
|
|
40552
40516
|
LOG.info("Upgrade", `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
40517
|
+
updateConfig({ updateChannel: channel, serverUrl: CHANNEL_SERVER_URL[channel] });
|
|
40553
40518
|
let currentInstalled = null;
|
|
40554
40519
|
try {
|
|
40555
40520
|
const currentJson = String(execNpmCommandSync(["ls", "-g", pkgName, "--depth=0", "--json"], {
|
|
@@ -40752,7 +40717,8 @@ var init_router = __esm({
|
|
|
40752
40717
|
};
|
|
40753
40718
|
if (args?.inlineMesh) {
|
|
40754
40719
|
mcpServerEntry.env = {
|
|
40755
|
-
ADHDEV_INLINE_MESH: JSON.stringify(mesh)
|
|
40720
|
+
ADHDEV_INLINE_MESH: JSON.stringify(mesh),
|
|
40721
|
+
ADHDEV_MCP_TRANSPORT: "ipc"
|
|
40756
40722
|
};
|
|
40757
40723
|
}
|
|
40758
40724
|
const mcpConfig = {
|
|
@@ -42532,7 +42498,7 @@ function runCommand(cmd, timeout = 1e4) {
|
|
|
42532
42498
|
}
|
|
42533
42499
|
}
|
|
42534
42500
|
function findBinary2(name) {
|
|
42535
|
-
const cmd = (0,
|
|
42501
|
+
const cmd = (0, import_os4.platform)() === "win32" ? `where ${name}` : `which ${name}`;
|
|
42536
42502
|
const result = runCommand(cmd, 5e3);
|
|
42537
42503
|
return result ? result.split("\n")[0] : null;
|
|
42538
42504
|
}
|
|
@@ -42580,7 +42546,7 @@ function checkPathExists2(paths) {
|
|
|
42580
42546
|
return null;
|
|
42581
42547
|
}
|
|
42582
42548
|
function getMacAppVersion(appPath) {
|
|
42583
|
-
if ((0,
|
|
42549
|
+
if ((0, import_os4.platform)() !== "darwin" || !appPath.endsWith(".app")) return null;
|
|
42584
42550
|
const plistPath = path21.join(appPath, "Contents", "Info.plist");
|
|
42585
42551
|
if (!fs11.existsSync(plistPath)) return null;
|
|
42586
42552
|
const raw = runCommand(`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${plistPath}"`);
|
|
@@ -42588,7 +42554,7 @@ function getMacAppVersion(appPath) {
|
|
|
42588
42554
|
}
|
|
42589
42555
|
async function detectAllVersions(loader, archive) {
|
|
42590
42556
|
const results = [];
|
|
42591
|
-
const currentOs = (0,
|
|
42557
|
+
const currentOs = (0, import_os4.platform)();
|
|
42592
42558
|
for (const provider of loader.getAll()) {
|
|
42593
42559
|
const info = {
|
|
42594
42560
|
type: provider.type,
|
|
@@ -42644,7 +42610,7 @@ async function detectAllVersions(loader, archive) {
|
|
|
42644
42610
|
}
|
|
42645
42611
|
return results;
|
|
42646
42612
|
}
|
|
42647
|
-
var fs11, path21, os21, import_child_process10,
|
|
42613
|
+
var fs11, path21, os21, import_child_process10, import_os4, ARCHIVE_PATH, MAX_ENTRIES_PER_PROVIDER, VersionArchive;
|
|
42648
42614
|
var init_version_archive = __esm({
|
|
42649
42615
|
"../../oss/packages/daemon-core/src/providers/version-archive.ts"() {
|
|
42650
42616
|
"use strict";
|
|
@@ -42652,7 +42618,7 @@ var init_version_archive = __esm({
|
|
|
42652
42618
|
path21 = __toESM(require("path"));
|
|
42653
42619
|
os21 = __toESM(require("os"));
|
|
42654
42620
|
import_child_process10 = require("child_process");
|
|
42655
|
-
|
|
42621
|
+
import_os4 = require("os");
|
|
42656
42622
|
ARCHIVE_PATH = path21.join(os21.homedir(), ".adhdev", "version-history.json");
|
|
42657
42623
|
MAX_ENTRIES_PER_PROVIDER = 20;
|
|
42658
42624
|
VersionArchive = class {
|
|
@@ -42678,7 +42644,7 @@ var init_version_archive = __esm({
|
|
|
42678
42644
|
entries.push({
|
|
42679
42645
|
version: version2,
|
|
42680
42646
|
detectedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
42681
|
-
os: (0,
|
|
42647
|
+
os: (0, import_os4.platform)()
|
|
42682
42648
|
});
|
|
42683
42649
|
if (entries.length > MAX_ENTRIES_PER_PROVIDER) {
|
|
42684
42650
|
this.history[type] = entries.slice(-MAX_ENTRIES_PER_PROVIDER);
|
|
@@ -49347,13 +49313,14 @@ var init_server_connection = __esm({
|
|
|
49347
49313
|
reject(new Error(`Mesh command timed out after ${timeoutMs}ms`));
|
|
49348
49314
|
}, timeoutMs);
|
|
49349
49315
|
const handler = (msg) => {
|
|
49350
|
-
|
|
49316
|
+
const body = msg.payload && typeof msg.payload === "object" ? { ...msg, ...msg.payload } : msg;
|
|
49317
|
+
if (body.requestId !== requestId) return;
|
|
49351
49318
|
this.off("daemon_mesh_result", handler);
|
|
49352
49319
|
clearTimeout(timer);
|
|
49353
|
-
if (
|
|
49354
|
-
reject(new Error(
|
|
49320
|
+
if (body.success === false) {
|
|
49321
|
+
reject(new Error(body.error ?? "Mesh command failed"));
|
|
49355
49322
|
} else {
|
|
49356
|
-
resolve20(
|
|
49323
|
+
resolve20(body.result);
|
|
49357
49324
|
}
|
|
49358
49325
|
};
|
|
49359
49326
|
this.on("daemon_mesh_result", handler);
|
|
@@ -49455,17 +49422,19 @@ var init_server_connection = __esm({
|
|
|
49455
49422
|
return;
|
|
49456
49423
|
} else if (message.type === "version_mismatch") {
|
|
49457
49424
|
const p = message.payload;
|
|
49425
|
+
const updateCommand = typeof p.updateCommand === "string" && p.updateCommand.trim() ? p.updateCommand.trim() : "adhdev daemon:upgrade";
|
|
49458
49426
|
LOG.info("Server", `
|
|
49459
49427
|
\u{1F504} Update available: v${p.current} \u2192 v${p.latest}`);
|
|
49460
|
-
LOG.info("Server", ` Run:
|
|
49428
|
+
LOG.info("Server", ` Run: ${updateCommand}
|
|
49461
49429
|
`);
|
|
49462
49430
|
} else if (message.type === "force_update_required") {
|
|
49463
49431
|
this.compatBlocked = true;
|
|
49464
49432
|
const p = message.payload;
|
|
49433
|
+
const updateCommand = typeof p.updateCommand === "string" && p.updateCommand.trim() ? p.updateCommand.trim() : "adhdev daemon:upgrade";
|
|
49465
49434
|
LOG.error("Server", `
|
|
49466
49435
|
\u26D4 Daemon v${this.options.daemonVersion} is no longer compatible.`);
|
|
49467
49436
|
LOG.error("Server", ` Minimum required: v${p.minVersion}`);
|
|
49468
|
-
LOG.error("Server", ` Run:
|
|
49437
|
+
LOG.error("Server", ` Run: ${updateCommand}
|
|
49469
49438
|
`);
|
|
49470
49439
|
}
|
|
49471
49440
|
const handlers = this.messageHandlers.get(message.type);
|
|
@@ -55341,10 +55310,10 @@ var require_color = __commonJS({
|
|
|
55341
55310
|
const b = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
55342
55311
|
const lp = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
55343
55312
|
const mp = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
55344
|
-
const
|
|
55345
|
-
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 *
|
|
55346
|
-
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 *
|
|
55347
|
-
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 *
|
|
55313
|
+
const sp = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
55314
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
55315
|
+
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
55316
|
+
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
55348
55317
|
return [l * 100, aa * 100, bb * 100];
|
|
55349
55318
|
};
|
|
55350
55319
|
convert.rgb.cmyk = function(rgb) {
|
|
@@ -55606,10 +55575,10 @@ var require_color = __commonJS({
|
|
|
55606
55575
|
const z2 = xyz[2] / 100;
|
|
55607
55576
|
const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y - 0.1288597137 * z2);
|
|
55608
55577
|
const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y + 0.0361456387 * z2);
|
|
55609
|
-
const
|
|
55610
|
-
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 *
|
|
55611
|
-
const a = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 *
|
|
55612
|
-
const b = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 *
|
|
55578
|
+
const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y + 0.633851707 * z2);
|
|
55579
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
55580
|
+
const a = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
55581
|
+
const b = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
55613
55582
|
return [l * 100, a * 100, b * 100];
|
|
55614
55583
|
};
|
|
55615
55584
|
convert.oklab.oklch = function(oklab) {
|
|
@@ -58531,7 +58500,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
58531
58500
|
return min;
|
|
58532
58501
|
}
|
|
58533
58502
|
if (import_node_process2.default.platform === "win32") {
|
|
58534
|
-
const osRelease =
|
|
58503
|
+
const osRelease = import_node_os2.default.release().split(".");
|
|
58535
58504
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
58536
58505
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
58537
58506
|
}
|
|
@@ -58590,12 +58559,12 @@ function createSupportsColor2(stream, options = {}) {
|
|
|
58590
58559
|
});
|
|
58591
58560
|
return translateLevel2(level);
|
|
58592
58561
|
}
|
|
58593
|
-
var import_node_process2,
|
|
58562
|
+
var import_node_process2, import_node_os2, import_node_tty2, env2, flagForceColor2, supportsColor2, supports_color_default2;
|
|
58594
58563
|
var init_supports_color2 = __esm({
|
|
58595
58564
|
"../../node_modules/chalk/source/vendor/supports-color/index.js"() {
|
|
58596
58565
|
"use strict";
|
|
58597
58566
|
import_node_process2 = __toESM(require("process"), 1);
|
|
58598
|
-
|
|
58567
|
+
import_node_os2 = __toESM(require("os"), 1);
|
|
58599
58568
|
import_node_tty2 = __toESM(require("tty"), 1);
|
|
58600
58569
|
({ env: env2 } = import_node_process2.default);
|
|
58601
58570
|
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
@@ -58813,18 +58782,18 @@ function resolvePackageVersion(options) {
|
|
|
58813
58782
|
];
|
|
58814
58783
|
for (const p of possiblePaths) {
|
|
58815
58784
|
try {
|
|
58816
|
-
const data = JSON.parse((0,
|
|
58785
|
+
const data = JSON.parse((0, import_fs9.readFileSync)(p, "utf-8"));
|
|
58817
58786
|
if (data.version) return data.version;
|
|
58818
58787
|
} catch {
|
|
58819
58788
|
}
|
|
58820
58789
|
}
|
|
58821
58790
|
return injectedVersion;
|
|
58822
58791
|
}
|
|
58823
|
-
var
|
|
58792
|
+
var import_fs9, import_path4;
|
|
58824
58793
|
var init_version = __esm({
|
|
58825
58794
|
"src/version.ts"() {
|
|
58826
58795
|
"use strict";
|
|
58827
|
-
|
|
58796
|
+
import_fs9 = require("fs");
|
|
58828
58797
|
import_path4 = require("path");
|
|
58829
58798
|
}
|
|
58830
58799
|
});
|
|
@@ -58863,7 +58832,9 @@ var init_daemon_mesh_manager = __esm({
|
|
|
58863
58832
|
"read_chat",
|
|
58864
58833
|
"git_status",
|
|
58865
58834
|
"git_diff_summary",
|
|
58866
|
-
"launch_cli"
|
|
58835
|
+
"launch_cli",
|
|
58836
|
+
"git_checkpoint",
|
|
58837
|
+
"resolve_action"
|
|
58867
58838
|
]);
|
|
58868
58839
|
setRules(rules) {
|
|
58869
58840
|
const valid = [];
|
|
@@ -59154,7 +59125,7 @@ var init_adhdev_daemon = __esm({
|
|
|
59154
59125
|
init_version();
|
|
59155
59126
|
init_src();
|
|
59156
59127
|
init_runtime_defaults();
|
|
59157
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.
|
|
59128
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.10" });
|
|
59158
59129
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
59159
59130
|
localHttpServer = null;
|
|
59160
59131
|
localWss = null;
|
|
@@ -59990,6 +59961,19 @@ ${err?.stack || ""}`);
|
|
|
59990
59961
|
void this.statusReporter?.sendUnifiedStatusReport({ forceServer: true, reason });
|
|
59991
59962
|
void this.flushP2PDaemonMetadataSubscriptions();
|
|
59992
59963
|
}
|
|
59964
|
+
emitMeshCheckpointCompleteIfNeeded(commandType, result, normalizedData) {
|
|
59965
|
+
if (commandType !== "git_checkpoint" || result?.success !== true || !this.meshManager) return;
|
|
59966
|
+
const workspace = String(normalizedData.workspace ?? "");
|
|
59967
|
+
const baseContext = {
|
|
59968
|
+
workspace,
|
|
59969
|
+
checkpoint_message: result.checkpoint?.message ?? String(normalizedData.message ?? ""),
|
|
59970
|
+
commit: result.checkpoint?.commit ?? "",
|
|
59971
|
+
source_session_id: String(normalizedData.targetSessionId ?? "")
|
|
59972
|
+
};
|
|
59973
|
+
void this.buildMeshCheckpointContext(workspace, baseContext).then((ctx) => {
|
|
59974
|
+
this.meshManager.emit({ trigger: "git_checkpoint_complete", context: ctx });
|
|
59975
|
+
});
|
|
59976
|
+
}
|
|
59993
59977
|
async handleCommand(msg, cmd, args) {
|
|
59994
59978
|
const normalizedArgs = this.ensureInteractionContext(args);
|
|
59995
59979
|
const interactionId = String(normalizedArgs._interactionId);
|
|
@@ -60024,6 +60008,10 @@ ${err?.stack || ""}`);
|
|
|
60024
60008
|
if (cmd === "resolve_action" || cmd === "send_chat" || cmd === "read_chat") {
|
|
60025
60009
|
void this.flushP2PSessionModalSubscriptions();
|
|
60026
60010
|
}
|
|
60011
|
+
if (cmd.startsWith("git_")) {
|
|
60012
|
+
void this.flushP2PWorkspaceGitSubscriptions();
|
|
60013
|
+
}
|
|
60014
|
+
this.emitMeshCheckpointCompleteIfNeeded(cmd, result, normalizedArgs);
|
|
60027
60015
|
this.sendResult(msg, result.success, { ...result, interactionId });
|
|
60028
60016
|
recordDebugTrace({
|
|
60029
60017
|
interactionId,
|
|
@@ -60105,18 +60093,7 @@ ${err?.stack || ""}`);
|
|
|
60105
60093
|
if (cmdType.startsWith("git_")) {
|
|
60106
60094
|
void this.flushP2PWorkspaceGitSubscriptions();
|
|
60107
60095
|
}
|
|
60108
|
-
|
|
60109
|
-
const workspace = String(normalizedData.workspace ?? "");
|
|
60110
|
-
const baseContext = {
|
|
60111
|
-
workspace,
|
|
60112
|
-
checkpoint_message: routed.checkpoint?.message ?? String(normalizedData.message ?? ""),
|
|
60113
|
-
commit: routed.checkpoint?.commit ?? "",
|
|
60114
|
-
source_session_id: String(normalizedData.targetSessionId ?? "")
|
|
60115
|
-
};
|
|
60116
|
-
void this.buildMeshCheckpointContext(workspace, baseContext).then((ctx) => {
|
|
60117
|
-
this.meshManager.emit({ trigger: "git_checkpoint_complete", context: ctx });
|
|
60118
|
-
});
|
|
60119
|
-
}
|
|
60096
|
+
this.emitMeshCheckpointCompleteIfNeeded(cmdType, routed, normalizedData);
|
|
60120
60097
|
return { ...routed, interactionId };
|
|
60121
60098
|
} catch (e) {
|
|
60122
60099
|
logCommand({ ts: (/* @__PURE__ */ new Date()).toISOString(), cmd: cmdType, source: "p2p", interactionId, success: false, error: e.message, durationMs: Date.now() - cmdStart });
|
|
@@ -60256,7 +60233,21 @@ ${err?.stack || ""}`);
|
|
|
60256
60233
|
return;
|
|
60257
60234
|
}
|
|
60258
60235
|
try {
|
|
60259
|
-
|
|
60236
|
+
let result;
|
|
60237
|
+
if (command === "mesh_relay_command") {
|
|
60238
|
+
if (!this.meshManager) throw new Error("Mesh manager is not initialized");
|
|
60239
|
+
const targetDaemonId = typeof normalizedArgs.targetDaemonId === "string" ? normalizedArgs.targetDaemonId : "";
|
|
60240
|
+
const relayedCommand = typeof normalizedArgs.command === "string" ? normalizedArgs.command : "";
|
|
60241
|
+
const relayedArgs = normalizedArgs.args && typeof normalizedArgs.args === "object" ? normalizedArgs.args : {};
|
|
60242
|
+
if (!targetDaemonId || !relayedCommand) {
|
|
60243
|
+
throw new Error("mesh_relay_command requires targetDaemonId and command");
|
|
60244
|
+
}
|
|
60245
|
+
const relayResult = await this.meshManager.sendCommand(targetDaemonId, relayedCommand, relayedArgs);
|
|
60246
|
+
result = { success: true, result: relayResult };
|
|
60247
|
+
} else {
|
|
60248
|
+
result = await this.components.router.execute(command, normalizedArgs, "ipc");
|
|
60249
|
+
this.emitMeshCheckpointCompleteIfNeeded(command, result, normalizedArgs);
|
|
60250
|
+
}
|
|
60260
60251
|
ws.send(JSON.stringify({
|
|
60261
60252
|
type: "ext:command_result",
|
|
60262
60253
|
payload: {
|
|
@@ -60587,7 +60578,7 @@ function isUnicodeSupported() {
|
|
|
60587
60578
|
import_node_process3.default.env["TERM_PROGRAM"] === "Terminus-Sublime" || import_node_process3.default.env["TERM_PROGRAM"] === "vscode" || import_node_process3.default.env["TERM"] === "xterm-256color" || import_node_process3.default.env["TERM"] === "alacritty" || import_node_process3.default.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
60588
60579
|
}
|
|
60589
60580
|
var import_node_process3, common, specialMainSymbols, specialFallbackSymbols, mainSymbols, fallbackSymbols, shouldUseMain, figures, esm_default, replacements;
|
|
60590
|
-
var
|
|
60581
|
+
var init_esm3 = __esm({
|
|
60591
60582
|
"../../node_modules/@inquirer/figures/dist/esm/index.js"() {
|
|
60592
60583
|
"use strict";
|
|
60593
60584
|
import_node_process3 = __toESM(require("process"), 1);
|
|
@@ -70508,7 +70499,7 @@ var init_separator = __esm({
|
|
|
70508
70499
|
"../../node_modules/inquirer/lib/objects/separator.js"() {
|
|
70509
70500
|
"use strict";
|
|
70510
70501
|
import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
|
70511
|
-
|
|
70502
|
+
init_esm3();
|
|
70512
70503
|
Separator = class {
|
|
70513
70504
|
constructor(line) {
|
|
70514
70505
|
this.type = "separator";
|
|
@@ -78632,7 +78623,7 @@ var init_list = __esm({
|
|
|
78632
78623
|
"use strict";
|
|
78633
78624
|
import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
|
78634
78625
|
import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
|
78635
|
-
|
|
78626
|
+
init_esm3();
|
|
78636
78627
|
import_run_async2 = __toESM(require_run_async(), 1);
|
|
78637
78628
|
import_rxjs3 = __toESM(require_cjs(), 1);
|
|
78638
78629
|
init_events();
|
|
@@ -79327,7 +79318,7 @@ var init_checkbox = __esm({
|
|
|
79327
79318
|
"use strict";
|
|
79328
79319
|
import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
|
79329
79320
|
import_yoctocolors_cjs9 = __toESM(require_yoctocolors_cjs(), 1);
|
|
79330
|
-
|
|
79321
|
+
init_esm3();
|
|
79331
79322
|
import_rxjs8 = __toESM(require_cjs(), 1);
|
|
79332
79323
|
init_events();
|
|
79333
79324
|
init_paginator();
|
|
@@ -89081,15 +89072,15 @@ function splitStringBySpace(str) {
|
|
|
89081
89072
|
}
|
|
89082
89073
|
return pieces;
|
|
89083
89074
|
}
|
|
89084
|
-
var import_chardet, import_child_process14,
|
|
89085
|
-
var
|
|
89075
|
+
var import_chardet, import_child_process14, import_fs10, import_node_path3, import_node_os3, import_node_crypto2, import_iconv_lite, ExternalEditor;
|
|
89076
|
+
var init_esm4 = __esm({
|
|
89086
89077
|
"../../node_modules/@inquirer/external-editor/dist/esm/index.js"() {
|
|
89087
89078
|
"use strict";
|
|
89088
89079
|
import_chardet = __toESM(require_lib2(), 1);
|
|
89089
89080
|
import_child_process14 = require("child_process");
|
|
89090
|
-
|
|
89081
|
+
import_fs10 = require("fs");
|
|
89091
89082
|
import_node_path3 = __toESM(require("path"), 1);
|
|
89092
|
-
|
|
89083
|
+
import_node_os3 = __toESM(require("os"), 1);
|
|
89093
89084
|
import_node_crypto2 = require("crypto");
|
|
89094
89085
|
import_iconv_lite = __toESM(require_lib3(), 1);
|
|
89095
89086
|
init_CreateFileError();
|
|
@@ -89148,7 +89139,7 @@ var init_esm2 = __esm({
|
|
|
89148
89139
|
}
|
|
89149
89140
|
createTemporaryFile() {
|
|
89150
89141
|
try {
|
|
89151
|
-
const baseDir = this.fileOptions.dir ??
|
|
89142
|
+
const baseDir = this.fileOptions.dir ?? import_node_os3.default.tmpdir();
|
|
89152
89143
|
const id = (0, import_node_crypto2.randomUUID)();
|
|
89153
89144
|
const prefix = sanitizeAffix(this.fileOptions.prefix);
|
|
89154
89145
|
const postfix = sanitizeAffix(this.fileOptions.postfix);
|
|
@@ -89163,14 +89154,14 @@ var init_esm2 = __esm({
|
|
|
89163
89154
|
if (Object.prototype.hasOwnProperty.call(this.fileOptions, "mode")) {
|
|
89164
89155
|
opt.mode = this.fileOptions.mode;
|
|
89165
89156
|
}
|
|
89166
|
-
(0,
|
|
89157
|
+
(0, import_fs10.writeFileSync)(this.tempFile, this.text, opt);
|
|
89167
89158
|
} catch (createFileError) {
|
|
89168
89159
|
throw new CreateFileError(createFileError);
|
|
89169
89160
|
}
|
|
89170
89161
|
}
|
|
89171
89162
|
readTemporaryFile() {
|
|
89172
89163
|
try {
|
|
89173
|
-
const tempFileBuffer = (0,
|
|
89164
|
+
const tempFileBuffer = (0, import_fs10.readFileSync)(this.tempFile);
|
|
89174
89165
|
if (tempFileBuffer.length === 0) {
|
|
89175
89166
|
this.text = "";
|
|
89176
89167
|
} else {
|
|
@@ -89186,7 +89177,7 @@ var init_esm2 = __esm({
|
|
|
89186
89177
|
}
|
|
89187
89178
|
removeTemporaryFile() {
|
|
89188
89179
|
try {
|
|
89189
|
-
(0,
|
|
89180
|
+
(0, import_fs10.unlinkSync)(this.tempFile);
|
|
89190
89181
|
} catch (removeFileError) {
|
|
89191
89182
|
throw new RemoveFileError(removeFileError);
|
|
89192
89183
|
}
|
|
@@ -89220,7 +89211,7 @@ var init_editor = __esm({
|
|
|
89220
89211
|
"../../node_modules/inquirer/lib/prompts/editor.js"() {
|
|
89221
89212
|
"use strict";
|
|
89222
89213
|
import_yoctocolors_cjs11 = __toESM(require_yoctocolors_cjs(), 1);
|
|
89223
|
-
|
|
89214
|
+
init_esm4();
|
|
89224
89215
|
import_rxjs10 = __toESM(require_cjs(), 1);
|
|
89225
89216
|
init_events();
|
|
89226
89217
|
init_base();
|
|
@@ -90905,7 +90896,58 @@ init_lib();
|
|
|
90905
90896
|
init_ora();
|
|
90906
90897
|
init_src();
|
|
90907
90898
|
init_version();
|
|
90908
|
-
var
|
|
90899
|
+
var CHANNEL_NPM_TAG2 = {
|
|
90900
|
+
stable: "latest",
|
|
90901
|
+
preview: "next"
|
|
90902
|
+
};
|
|
90903
|
+
var CHANNEL_SERVER_URL2 = {
|
|
90904
|
+
stable: "https://api.adhf.dev",
|
|
90905
|
+
preview: "https://api-preview.adhf.dev"
|
|
90906
|
+
};
|
|
90907
|
+
function normalizeSetupReleaseChannel(value) {
|
|
90908
|
+
if (typeof value !== "string") return null;
|
|
90909
|
+
const normalized = value.trim().toLowerCase();
|
|
90910
|
+
if (normalized === "stable" || normalized === "latest") return "stable";
|
|
90911
|
+
if (normalized === "preview" || normalized === "next") return "preview";
|
|
90912
|
+
return null;
|
|
90913
|
+
}
|
|
90914
|
+
function inferReleaseChannelFromServerUrl(serverUrl) {
|
|
90915
|
+
if (typeof serverUrl !== "string") return null;
|
|
90916
|
+
const normalized = serverUrl.trim().toLowerCase();
|
|
90917
|
+
if (!normalized) return null;
|
|
90918
|
+
if (normalized.includes("api-preview.adhf.dev") || normalized.includes("dev.adhf.dev")) return "preview";
|
|
90919
|
+
if (normalized.includes("api.adhf.dev") || normalized.includes("adhf.dev")) return "stable";
|
|
90920
|
+
return null;
|
|
90921
|
+
}
|
|
90922
|
+
function buildDashboardUrl(serverUrl, channel) {
|
|
90923
|
+
try {
|
|
90924
|
+
const url2 = new URL(serverUrl);
|
|
90925
|
+
if (url2.hostname === "api-preview.adhf.dev") return "https://dev.adhf.dev/dashboard";
|
|
90926
|
+
if (url2.hostname === "api.adhf.dev") return "https://adhf.dev/dashboard";
|
|
90927
|
+
if (url2.hostname === "127.0.0.1" || url2.hostname === "localhost") {
|
|
90928
|
+
url2.port = url2.port === "3100" ? "3000" : url2.port;
|
|
90929
|
+
url2.pathname = "/dashboard";
|
|
90930
|
+
url2.search = "";
|
|
90931
|
+
url2.hash = "";
|
|
90932
|
+
return url2.toString();
|
|
90933
|
+
}
|
|
90934
|
+
} catch {
|
|
90935
|
+
}
|
|
90936
|
+
return channel === "preview" ? "https://dev.adhf.dev/dashboard" : "https://adhf.dev/dashboard";
|
|
90937
|
+
}
|
|
90938
|
+
function buildSetupReleaseContext(options = {}) {
|
|
90939
|
+
const env3 = options.env || process.env;
|
|
90940
|
+
const envServerUrl = typeof env3.ADHDEV_SERVER_URL === "string" && env3.ADHDEV_SERVER_URL.trim() ? env3.ADHDEV_SERVER_URL.trim() : null;
|
|
90941
|
+
const config2 = options.config || {};
|
|
90942
|
+
const channel = normalizeSetupReleaseChannel(config2.updateChannel) || inferReleaseChannelFromServerUrl(envServerUrl) || inferReleaseChannelFromServerUrl(config2.serverUrl) || "stable";
|
|
90943
|
+
const serverUrl = envServerUrl || CHANNEL_SERVER_URL2[channel];
|
|
90944
|
+
return {
|
|
90945
|
+
channel,
|
|
90946
|
+
npmTag: CHANNEL_NPM_TAG2[channel],
|
|
90947
|
+
serverUrl,
|
|
90948
|
+
dashboardUrl: buildDashboardUrl(serverUrl, channel)
|
|
90949
|
+
};
|
|
90950
|
+
}
|
|
90909
90951
|
var LOGO = `
|
|
90910
90952
|
${source_default2.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}
|
|
90911
90953
|
${source_default2.cyan("\u2551")} ${source_default2.bold.white("\u{1F9A6} ADHDev Setup Wizard")} ${source_default2.cyan("\u2551")}
|
|
@@ -90921,10 +90963,10 @@ function hasCloudMachineAuth() {
|
|
|
90921
90963
|
const config2 = loadConfig();
|
|
90922
90964
|
return Boolean(config2.machineSecret && config2.machineSecret.trim());
|
|
90923
90965
|
}
|
|
90924
|
-
function readLatestPublishedCliVersion(execFileSyncLocal) {
|
|
90966
|
+
function readLatestPublishedCliVersion(execFileSyncLocal, npmTag = "latest") {
|
|
90925
90967
|
const surface = resolveCurrentGlobalInstallSurface({ packageName: "adhdev" });
|
|
90926
90968
|
try {
|
|
90927
|
-
return execFileSyncLocal(surface.npmExecutable, [...surface.npmArgsPrefix || [], "view",
|
|
90969
|
+
return execFileSyncLocal(surface.npmExecutable, [...surface.npmArgsPrefix || [], "view", `adhdev@${npmTag}`, "version"], {
|
|
90928
90970
|
encoding: "utf-8",
|
|
90929
90971
|
timeout: 5e3,
|
|
90930
90972
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -90955,38 +90997,41 @@ function readInstalledGlobalCliVersion(execFileSyncLocal) {
|
|
|
90955
90997
|
}
|
|
90956
90998
|
async function runWizard(options = {}) {
|
|
90957
90999
|
console.log(LOGO);
|
|
91000
|
+
const config2 = loadConfig();
|
|
91001
|
+
const releaseContext = buildSetupReleaseContext({ config: config2 });
|
|
90958
91002
|
if (isSetupComplete() && hasCloudMachineAuth() && !options.force) {
|
|
90959
|
-
const config2 = loadConfig();
|
|
90960
91003
|
console.log(source_default2.green("\u2713") + " ADHDev is already configured.");
|
|
90961
91004
|
console.log(source_default2.gray(` Account: ${config2.userEmail || "not logged in"}`));
|
|
91005
|
+
console.log(source_default2.gray(` Server: ${releaseContext.serverUrl}`));
|
|
90962
91006
|
console.log();
|
|
90963
|
-
await checkForUpdate();
|
|
90964
|
-
await startDaemonFlow();
|
|
91007
|
+
await checkForUpdate(releaseContext);
|
|
91008
|
+
await startDaemonFlow(releaseContext);
|
|
90965
91009
|
return;
|
|
90966
91010
|
}
|
|
90967
|
-
await quickSetup();
|
|
91011
|
+
await quickSetup(releaseContext);
|
|
90968
91012
|
}
|
|
90969
|
-
async function checkForUpdate() {
|
|
91013
|
+
async function checkForUpdate(releaseContext) {
|
|
90970
91014
|
try {
|
|
90971
91015
|
const { execFileSync: execFileSync5 } = await import("child_process");
|
|
90972
91016
|
const currentVersion = resolvePackageVersion();
|
|
90973
|
-
const latestVersion = readLatestPublishedCliVersion(execFileSync5);
|
|
91017
|
+
const latestVersion = readLatestPublishedCliVersion(execFileSync5, releaseContext.npmTag);
|
|
90974
91018
|
if (!latestVersion) return;
|
|
90975
91019
|
if (!currentVersion || !latestVersion || currentVersion === latestVersion) return;
|
|
90976
|
-
console.log(source_default2.yellow(` Update available: ${currentVersion} \u2192 ${latestVersion}`));
|
|
91020
|
+
console.log(source_default2.yellow(` Update available (${releaseContext.channel}/${releaseContext.npmTag}): ${currentVersion} \u2192 ${latestVersion}`));
|
|
90977
91021
|
const { doUpdate } = await (await Promise.resolve().then(() => (init_lib(), lib_exports))).default.prompt([{
|
|
90978
91022
|
type: "confirm",
|
|
90979
91023
|
name: "doUpdate",
|
|
90980
|
-
message: `Update adhdev CLI to v${latestVersion}?`,
|
|
91024
|
+
message: `Update adhdev CLI to v${latestVersion} from ${releaseContext.npmTag}?`,
|
|
90981
91025
|
default: true
|
|
90982
91026
|
}]);
|
|
90983
91027
|
if (!doUpdate) {
|
|
90984
|
-
console.log(source_default2.gray(
|
|
91028
|
+
console.log(source_default2.gray(` Skipping update. Run: npm install -g adhdev@${releaseContext.npmTag}
|
|
91029
|
+
`));
|
|
90985
91030
|
return;
|
|
90986
91031
|
}
|
|
90987
91032
|
const spinner = (await Promise.resolve().then(() => (init_ora(), ora_exports))).default("Updating adhdev CLI...").start();
|
|
90988
91033
|
try {
|
|
90989
|
-
const installCommand = buildPinnedGlobalInstallCommand({ packageName: "adhdev", targetVersion:
|
|
91034
|
+
const installCommand = buildPinnedGlobalInstallCommand({ packageName: "adhdev", targetVersion: releaseContext.npmTag });
|
|
90990
91035
|
execFileSync5(installCommand.command, installCommand.args, {
|
|
90991
91036
|
encoding: "utf-8",
|
|
90992
91037
|
timeout: 6e4,
|
|
@@ -90997,14 +91042,17 @@ async function checkForUpdate() {
|
|
|
90997
91042
|
console.log();
|
|
90998
91043
|
} catch (e) {
|
|
90999
91044
|
spinner.fail("Update failed");
|
|
91000
|
-
console.log(source_default2.gray(
|
|
91045
|
+
console.log(source_default2.gray(` Manual: npm install -g adhdev@${releaseContext.npmTag}
|
|
91046
|
+
`));
|
|
91001
91047
|
}
|
|
91002
91048
|
} catch {
|
|
91003
91049
|
}
|
|
91004
91050
|
}
|
|
91005
|
-
async function quickSetup() {
|
|
91051
|
+
async function quickSetup(releaseContext) {
|
|
91006
91052
|
console.log(source_default2.bold("\n\u{1F680} Quick Setup\n"));
|
|
91007
|
-
|
|
91053
|
+
console.log(source_default2.gray(` Channel: ${releaseContext.channel} (${releaseContext.npmTag})`));
|
|
91054
|
+
console.log(source_default2.gray(` Server: ${releaseContext.serverUrl}`));
|
|
91055
|
+
const loginResult = await loginFlow(releaseContext);
|
|
91008
91056
|
const setupDate = (/* @__PURE__ */ new Date()).toISOString();
|
|
91009
91057
|
if (!loginResult) {
|
|
91010
91058
|
updateConfig({
|
|
@@ -91015,7 +91063,9 @@ async function quickSetup() {
|
|
|
91015
91063
|
setupDate,
|
|
91016
91064
|
userEmail: null,
|
|
91017
91065
|
userName: null,
|
|
91018
|
-
machineSecret: null
|
|
91066
|
+
machineSecret: null,
|
|
91067
|
+
updateChannel: releaseContext.channel,
|
|
91068
|
+
serverUrl: releaseContext.serverUrl
|
|
91019
91069
|
});
|
|
91020
91070
|
console.log(source_default2.yellow("\u26A0 Setup is not complete without login. Run `adhdev setup` after signing in."));
|
|
91021
91071
|
}
|
|
@@ -91026,14 +91076,16 @@ async function quickSetup() {
|
|
|
91026
91076
|
userEmail: loginResult.email,
|
|
91027
91077
|
userName: loginResult.name,
|
|
91028
91078
|
setupDate,
|
|
91079
|
+
updateChannel: releaseContext.channel,
|
|
91080
|
+
serverUrl: releaseContext.serverUrl,
|
|
91029
91081
|
...loginResult.registeredMachineId ? { registeredMachineId: loginResult.registeredMachineId } : {}
|
|
91030
91082
|
};
|
|
91031
91083
|
updateConfig(configUpdate);
|
|
91032
91084
|
console.log(source_default2.green(` \u2713 Machine registered`));
|
|
91033
91085
|
}
|
|
91034
|
-
await installCliOnly();
|
|
91086
|
+
await installCliOnly(releaseContext);
|
|
91035
91087
|
if (loginResult) {
|
|
91036
|
-
await startDaemonFlow();
|
|
91088
|
+
await startDaemonFlow(releaseContext);
|
|
91037
91089
|
} else {
|
|
91038
91090
|
console.log(source_default2.gray(" Start daemon after login: adhdev setup"));
|
|
91039
91091
|
console.log();
|
|
@@ -91042,6 +91094,7 @@ async function quickSetup() {
|
|
|
91042
91094
|
console.log(source_default2.bold("\n\u{1F389} Setup Complete!\n"));
|
|
91043
91095
|
console.log(` ${source_default2.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
91044
91096
|
console.log(` ${source_default2.bold("Status:")} ${loginResult ? source_default2.green("Ready to connect") : source_default2.yellow("Login required")}`);
|
|
91097
|
+
console.log(` ${source_default2.bold("Server:")} ${releaseContext.serverUrl}`);
|
|
91045
91098
|
console.log();
|
|
91046
91099
|
console.log(source_default2.gray(" Next steps:"));
|
|
91047
91100
|
console.log(source_default2.gray(` ${loginResult ? "adhdev daemon \u2014 Start the main daemon (IDE / remote features)" : "adhdev setup \u2014 Sign in to finish setup and enable the daemon"}`));
|
|
@@ -91052,11 +91105,12 @@ async function quickSetup() {
|
|
|
91052
91105
|
console.log(source_default2.gray(" adhdev launch claude \u2014 Start Claude Code agent"));
|
|
91053
91106
|
console.log(source_default2.gray(" adhdev status \u2014 Check setup status"));
|
|
91054
91107
|
console.log();
|
|
91055
|
-
console.log(source_default2.cyan(
|
|
91108
|
+
console.log(source_default2.cyan(` Dashboard: ${releaseContext.dashboardUrl}`));
|
|
91056
91109
|
console.log();
|
|
91057
91110
|
}
|
|
91058
|
-
async function loginFlow() {
|
|
91111
|
+
async function loginFlow(releaseContext) {
|
|
91059
91112
|
console.log(source_default2.bold("\n\u{1F510} Login to ADHDev\n"));
|
|
91113
|
+
console.log(source_default2.gray(` Auth server: ${releaseContext.serverUrl}`));
|
|
91060
91114
|
const { wantLogin } = await lib_default.prompt([
|
|
91061
91115
|
{
|
|
91062
91116
|
type: "confirm",
|
|
@@ -91073,7 +91127,7 @@ async function loginFlow() {
|
|
|
91073
91127
|
try {
|
|
91074
91128
|
const config2 = loadConfig();
|
|
91075
91129
|
const os29 = await import("os");
|
|
91076
|
-
const res = await fetch(`${
|
|
91130
|
+
const res = await fetch(`${releaseContext.serverUrl}/auth/cli/init`, {
|
|
91077
91131
|
method: "POST",
|
|
91078
91132
|
headers: { "Content-Type": "application/json" },
|
|
91079
91133
|
body: JSON.stringify({
|
|
@@ -91115,7 +91169,7 @@ async function loginFlow() {
|
|
|
91115
91169
|
while (Date.now() - startTime < timeout) {
|
|
91116
91170
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
91117
91171
|
try {
|
|
91118
|
-
const res = await fetch(`${
|
|
91172
|
+
const res = await fetch(`${releaseContext.serverUrl}/auth/cli/poll`, {
|
|
91119
91173
|
method: "POST",
|
|
91120
91174
|
headers: { "Content-Type": "application/json" },
|
|
91121
91175
|
body: JSON.stringify({ deviceCode })
|
|
@@ -91145,9 +91199,9 @@ async function loginFlow() {
|
|
|
91145
91199
|
console.log();
|
|
91146
91200
|
console.log(source_default2.yellow(" To fix this, do one of the following:"));
|
|
91147
91201
|
console.log(source_default2.gray(" 1. Remove an unused machine from the dashboard:"));
|
|
91148
|
-
console.log(source_default2.gray(
|
|
91202
|
+
console.log(source_default2.gray(` ${releaseContext.dashboardUrl.replace(/\/dashboard$/, "/account")} \u2192 Registered Machines \u2192 \u2715 Remove`));
|
|
91149
91203
|
console.log(source_default2.gray(" 2. Upgrade your plan:"));
|
|
91150
|
-
console.log(source_default2.gray(
|
|
91204
|
+
console.log(source_default2.gray(` ${releaseContext.dashboardUrl.replace(/\/dashboard$/, "/account?tab=billing")}`));
|
|
91151
91205
|
console.log();
|
|
91152
91206
|
console.log(source_default2.gray(" Then run `adhdev setup` again."));
|
|
91153
91207
|
console.log();
|
|
@@ -91159,11 +91213,12 @@ async function loginFlow() {
|
|
|
91159
91213
|
pollSpinner.fail("Authentication timed out");
|
|
91160
91214
|
return null;
|
|
91161
91215
|
}
|
|
91162
|
-
async function startDaemonFlow() {
|
|
91216
|
+
async function startDaemonFlow(releaseContext) {
|
|
91163
91217
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
91164
91218
|
if (isDaemonRunning2()) {
|
|
91165
91219
|
console.log(source_default2.green(" \u2713 Daemon is already running"));
|
|
91166
|
-
console.log(source_default2.gray(
|
|
91220
|
+
console.log(source_default2.gray(` Dashboard: ${releaseContext.dashboardUrl}
|
|
91221
|
+
`));
|
|
91167
91222
|
return;
|
|
91168
91223
|
}
|
|
91169
91224
|
const { startDaemon } = await lib_default.prompt([
|
|
@@ -91217,7 +91272,7 @@ async function startDaemonFlow() {
|
|
|
91217
91272
|
} else {
|
|
91218
91273
|
daemonSpinner.warn("Daemon starting in background (may take a few seconds)");
|
|
91219
91274
|
}
|
|
91220
|
-
console.log(source_default2.gray(
|
|
91275
|
+
console.log(source_default2.gray(` Dashboard: ${releaseContext.dashboardUrl}`));
|
|
91221
91276
|
console.log(source_default2.gray(` Logs: ${logPath}`));
|
|
91222
91277
|
console.log();
|
|
91223
91278
|
} catch (e) {
|
|
@@ -91225,7 +91280,7 @@ async function startDaemonFlow() {
|
|
|
91225
91280
|
console.log(source_default2.gray(" Manual: adhdev daemon\n"));
|
|
91226
91281
|
}
|
|
91227
91282
|
}
|
|
91228
|
-
async function installCliOnly() {
|
|
91283
|
+
async function installCliOnly(releaseContext) {
|
|
91229
91284
|
const { execFileSync: execFileSyncLocal } = await import("child_process");
|
|
91230
91285
|
const currentVersion = readInstalledGlobalCliVersion(execFileSyncLocal);
|
|
91231
91286
|
const isNpx = process.env.npm_execpath?.includes("npx") || process.argv[1]?.includes("npx") || process.argv[1]?.includes("_npx");
|
|
@@ -91238,7 +91293,7 @@ async function installCliOnly() {
|
|
|
91238
91293
|
console.log();
|
|
91239
91294
|
if (currentVersion) {
|
|
91240
91295
|
console.log(source_default2.green(` \u2713 Currently installed: v${currentVersion}`));
|
|
91241
|
-
const latestVersion = readLatestPublishedCliVersion(execFileSyncLocal);
|
|
91296
|
+
const latestVersion = readLatestPublishedCliVersion(execFileSyncLocal, releaseContext.npmTag);
|
|
91242
91297
|
if (latestVersion && currentVersion === latestVersion) {
|
|
91243
91298
|
console.log(source_default2.gray(" (Already up to date)"));
|
|
91244
91299
|
return;
|
|
@@ -91247,12 +91302,12 @@ async function installCliOnly() {
|
|
|
91247
91302
|
const { doUpdate } = await lib_default.prompt([{
|
|
91248
91303
|
type: "confirm",
|
|
91249
91304
|
name: "doUpdate",
|
|
91250
|
-
message: `Update to
|
|
91305
|
+
message: `Update to ${releaseContext.npmTag} version${latestVersion ? ` (v${latestVersion})` : ""}?`,
|
|
91251
91306
|
default: true
|
|
91252
91307
|
}]);
|
|
91253
91308
|
if (!doUpdate) return;
|
|
91254
91309
|
} else {
|
|
91255
|
-
console.log(source_default2.gray(
|
|
91310
|
+
console.log(source_default2.gray(` Updating to ${releaseContext.npmTag}...`));
|
|
91256
91311
|
}
|
|
91257
91312
|
} else {
|
|
91258
91313
|
console.log(source_default2.yellow(" \u2717 Not installed globally"));
|
|
@@ -91260,7 +91315,7 @@ async function installCliOnly() {
|
|
|
91260
91315
|
const { doInstall } = await lib_default.prompt([{
|
|
91261
91316
|
type: "confirm",
|
|
91262
91317
|
name: "doInstall",
|
|
91263
|
-
message:
|
|
91318
|
+
message: `Install adhdev CLI globally? (npm install -g adhdev@${releaseContext.npmTag})`,
|
|
91264
91319
|
default: true
|
|
91265
91320
|
}]);
|
|
91266
91321
|
if (!doInstall) {
|
|
@@ -91273,14 +91328,14 @@ async function installCliOnly() {
|
|
|
91273
91328
|
}
|
|
91274
91329
|
const installSpinner = ora2("Installing adhdev CLI...").start();
|
|
91275
91330
|
try {
|
|
91276
|
-
const installCommand = buildPinnedGlobalInstallCommand({ packageName: "adhdev", targetVersion:
|
|
91331
|
+
const installCommand = buildPinnedGlobalInstallCommand({ packageName: "adhdev", targetVersion: releaseContext.npmTag });
|
|
91277
91332
|
execFileSyncLocal(installCommand.command, installCommand.args, {
|
|
91278
91333
|
encoding: "utf-8",
|
|
91279
91334
|
timeout: 6e4,
|
|
91280
91335
|
stdio: ["pipe", "pipe", "pipe"],
|
|
91281
91336
|
...installCommand.execOptions
|
|
91282
91337
|
});
|
|
91283
|
-
const newVersion = readInstalledGlobalCliVersion(execFileSyncLocal) ||
|
|
91338
|
+
const newVersion = readInstalledGlobalCliVersion(execFileSyncLocal) || releaseContext.npmTag;
|
|
91284
91339
|
installSpinner.succeed(`adhdev CLI ${currentVersion ? "updated" : "installed"} \u2713 (v${newVersion})`);
|
|
91285
91340
|
console.log(source_default2.gray(" Try: adhdev daemon"));
|
|
91286
91341
|
console.log();
|
|
@@ -91291,7 +91346,7 @@ async function installCliOnly() {
|
|
|
91291
91346
|
if (osModule.platform() === "win32") {
|
|
91292
91347
|
console.log(source_default2.gray(" On Windows, run PowerShell as Administrator"));
|
|
91293
91348
|
}
|
|
91294
|
-
console.log(source_default2.gray(
|
|
91349
|
+
console.log(source_default2.gray(` Manual: npm install -g adhdev@${releaseContext.npmTag}`));
|
|
91295
91350
|
console.log();
|
|
91296
91351
|
}
|
|
91297
91352
|
}
|
|
@@ -91306,7 +91361,7 @@ async function installCliOnly() {
|
|
|
91306
91361
|
});
|
|
91307
91362
|
/*! Bundled license information:
|
|
91308
91363
|
|
|
91309
|
-
chokidar/index.js:
|
|
91364
|
+
chokidar/esm/index.js:
|
|
91310
91365
|
(*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
|
|
91311
91366
|
|
|
91312
91367
|
sharp/lib/is.js:
|