@adhdev/daemon-standalone 0.9.74 → 0.9.75
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/index.js +46 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/index-CJ15gPBY.css +1 -0
- package/public/assets/index-QCRCggSl.js +94 -0
- package/public/index.html +2 -2
- package/vendor/mcp-server/index.js +59 -17
- package/vendor/mcp-server/index.js.map +1 -1
- package/vendor/mcp-server/package.json +1 -1
- package/public/assets/index-Bu3OpXMi.js +0 -94
- package/public/assets/index-CVquu5qt.css +0 -1
package/dist/index.js
CHANGED
|
@@ -27980,6 +27980,7 @@ var require_dist2 = __commonJS({
|
|
|
27980
27980
|
ideSettings: isPlainObject2(parsed.ideSettings) ? parsed.ideSettings : {},
|
|
27981
27981
|
providerSourceMode: resolveProviderSourceMode(parsed.providerSourceMode, parsed.disableUpstream),
|
|
27982
27982
|
providerDir: asOptionalString(parsed.providerDir),
|
|
27983
|
+
updateChannel: parsed.updateChannel === "preview" ? "preview" : "stable",
|
|
27983
27984
|
terminalSizingMode: parsed.terminalSizingMode === "fit" ? "fit" : "measured"
|
|
27984
27985
|
};
|
|
27985
27986
|
}
|
|
@@ -28134,6 +28135,7 @@ var require_dist2 = __commonJS({
|
|
|
28134
28135
|
machineProviders: {},
|
|
28135
28136
|
ideSettings: {},
|
|
28136
28137
|
providerSourceMode: "normal",
|
|
28138
|
+
updateChannel: "stable",
|
|
28137
28139
|
terminalSizingMode: "measured"
|
|
28138
28140
|
};
|
|
28139
28141
|
MACHINE_ID_PREFIX = "mach_";
|
|
@@ -29627,6 +29629,13 @@ ${rules.join("\n")}`;
|
|
|
29627
29629
|
this.lastScreenSnapshotReadAt = now;
|
|
29628
29630
|
return screenText;
|
|
29629
29631
|
}
|
|
29632
|
+
getParseScreenText(screenText) {
|
|
29633
|
+
const currentSnapshot = normalizeScreenSnapshot(screenText);
|
|
29634
|
+
const lastSnapshot = this.lastScreenSnapshot;
|
|
29635
|
+
if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
|
|
29636
|
+
return `${screenText}
|
|
29637
|
+
${lastSnapshot}`;
|
|
29638
|
+
}
|
|
29630
29639
|
shouldReadTerminalScreenSnapshot(now) {
|
|
29631
29640
|
if (!this.lastScreenText) return true;
|
|
29632
29641
|
return now - this.lastScreenSnapshotReadAt >= _ProviderCliAdapter.SCREEN_SNAPSHOT_MIN_INTERVAL_MS;
|
|
@@ -30617,12 +30626,13 @@ ${rules.join("\n")}`;
|
|
|
30617
30626
|
}
|
|
30618
30627
|
try {
|
|
30619
30628
|
const screenText = this.terminalScreen.getText();
|
|
30629
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
30620
30630
|
const tail = this.recentOutputBuffer.slice(-500);
|
|
30621
30631
|
const input = buildCliParseInput({
|
|
30622
30632
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
30623
30633
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
30624
30634
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
30625
|
-
terminalScreenText:
|
|
30635
|
+
terminalScreenText: parseScreenText,
|
|
30626
30636
|
baseMessages: [],
|
|
30627
30637
|
partialResponse: this.responseBuffer,
|
|
30628
30638
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -30716,8 +30726,9 @@ ${rules.join("\n")}`;
|
|
|
30716
30726
|
*/
|
|
30717
30727
|
getScriptParsedStatus() {
|
|
30718
30728
|
const screenText = this.readTerminalScreenText();
|
|
30729
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
30719
30730
|
const cached2 = this.parsedStatusCache;
|
|
30720
|
-
if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.screenText ===
|
|
30731
|
+
if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.screenText === parseScreenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName) {
|
|
30721
30732
|
return cached2.result;
|
|
30722
30733
|
}
|
|
30723
30734
|
const parsed = this.runParseSession();
|
|
@@ -30745,7 +30756,7 @@ ${rules.join("\n")}`;
|
|
|
30745
30756
|
currentTurnScope: this.currentTurnScope,
|
|
30746
30757
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
30747
30758
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
30748
|
-
screenText,
|
|
30759
|
+
screenText: parseScreenText,
|
|
30749
30760
|
currentStatus: this.currentStatus,
|
|
30750
30761
|
activeModal: this.activeModal,
|
|
30751
30762
|
cliName: this.cliName,
|
|
@@ -30762,7 +30773,7 @@ ${rules.join("\n")}`;
|
|
|
30762
30773
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
30763
30774
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
30764
30775
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
30765
|
-
terminalScreenText: this.terminalScreen.getText(),
|
|
30776
|
+
terminalScreenText: this.getParseScreenText(this.terminalScreen.getText()),
|
|
30766
30777
|
baseMessages: [],
|
|
30767
30778
|
partialResponse: this.responseBuffer,
|
|
30768
30779
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -47801,6 +47812,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47801
47812
|
addCandidate((0, import_node_path2.resolve)(dir, "../vendor/mcp-server/index.js"));
|
|
47802
47813
|
addCandidate((0, import_node_path2.resolve)(dir, "../../vendor/mcp-server/index.js"));
|
|
47803
47814
|
addCandidate((0, import_node_path2.resolve)(dir, "../../../vendor/mcp-server/index.js"));
|
|
47815
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../mcp-server/dist/index.js"));
|
|
47816
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../../mcp-server/dist/index.js"));
|
|
47804
47817
|
};
|
|
47805
47818
|
addPackagedCandidates(process.argv[1]);
|
|
47806
47819
|
for (const candidate of candidates) {
|
|
@@ -48472,6 +48485,17 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48472
48485
|
}
|
|
48473
48486
|
}
|
|
48474
48487
|
var fs10 = __toESM2(require("fs"));
|
|
48488
|
+
var CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
|
|
48489
|
+
function normalizeReleaseChannel(value) {
|
|
48490
|
+
if (typeof value !== "string") return null;
|
|
48491
|
+
const normalized = value.trim().toLowerCase();
|
|
48492
|
+
if (normalized === "stable" || normalized === "latest") return "stable";
|
|
48493
|
+
if (normalized === "preview" || normalized === "next") return "preview";
|
|
48494
|
+
return null;
|
|
48495
|
+
}
|
|
48496
|
+
function resolveUpgradeChannel(args) {
|
|
48497
|
+
return normalizeReleaseChannel(args?.channel) || normalizeReleaseChannel(args?.updatePolicy?.channel) || normalizeReleaseChannel(args?.npmTag) || normalizeReleaseChannel(loadConfig2().updateChannel) || "stable";
|
|
48498
|
+
}
|
|
48475
48499
|
var CHAT_COMMANDS = [
|
|
48476
48500
|
"send_chat",
|
|
48477
48501
|
"new_chat",
|
|
@@ -49154,8 +49178,10 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49154
49178
|
const isStandalone = this.deps.packageName === "@adhdev/daemon-standalone" || process.argv[1]?.includes("daemon-standalone");
|
|
49155
49179
|
const pkgName = isStandalone ? "@adhdev/daemon-standalone" : "adhdev";
|
|
49156
49180
|
const npmSurface = resolveCurrentGlobalInstallSurface({ packageName: pkgName });
|
|
49157
|
-
const
|
|
49158
|
-
|
|
49181
|
+
const channel = resolveUpgradeChannel(args);
|
|
49182
|
+
const npmTag = CHANNEL_NPM_TAG[channel];
|
|
49183
|
+
const latest = String(execNpmCommandSync(["view", `${pkgName}@${npmTag}`, "version"], { encoding: "utf-8", timeout: 1e4 }, npmSurface)).trim();
|
|
49184
|
+
LOG2.info("Upgrade", `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
49159
49185
|
let currentInstalled = null;
|
|
49160
49186
|
try {
|
|
49161
49187
|
const currentJson = String(execNpmCommandSync(["ls", "-g", pkgName, "--depth=0", "--json"], {
|
|
@@ -49169,8 +49195,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49169
49195
|
}
|
|
49170
49196
|
const runningVersion = typeof this.deps.statusVersion === "string" ? this.deps.statusVersion.trim().replace(/^v/, "") : null;
|
|
49171
49197
|
if (currentInstalled === latest && runningVersion === latest) {
|
|
49172
|
-
LOG2.info("Upgrade", `Already on
|
|
49173
|
-
return { success: true, upgraded: false, alreadyLatest: true, version: latest };
|
|
49198
|
+
LOG2.info("Upgrade", `Already on ${channel} channel version v${latest}; skipping install`);
|
|
49199
|
+
return { success: true, upgraded: false, alreadyLatest: true, version: latest, channel, npmTag };
|
|
49174
49200
|
}
|
|
49175
49201
|
if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
|
|
49176
49202
|
LOG2.info("Upgrade", `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
|
|
@@ -49183,12 +49209,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49183
49209
|
cwd: process.cwd(),
|
|
49184
49210
|
sessionHostAppName: process.env.ADHDEV_SESSION_HOST_NAME || "adhdev"
|
|
49185
49211
|
});
|
|
49186
|
-
LOG2.info("Upgrade", `Scheduled detached upgrade to v${latest}`);
|
|
49212
|
+
LOG2.info("Upgrade", `Scheduled detached ${channel} upgrade to v${latest}`);
|
|
49187
49213
|
setTimeout(() => {
|
|
49188
49214
|
LOG2.info("Upgrade", "Exiting daemon so detached upgrader can continue...");
|
|
49189
49215
|
process.exit(0);
|
|
49190
49216
|
}, 3e3);
|
|
49191
|
-
return { success: true, upgraded: true, version: latest, restarting: true };
|
|
49217
|
+
return { success: true, upgraded: true, version: latest, restarting: true, channel, npmTag };
|
|
49192
49218
|
} catch (e) {
|
|
49193
49219
|
LOG2.error("Upgrade", `Failed: ${e.message}`);
|
|
49194
49220
|
return { success: false, error: e.message };
|
|
@@ -49352,14 +49378,20 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49352
49378
|
} catch {
|
|
49353
49379
|
}
|
|
49354
49380
|
}
|
|
49381
|
+
const mcpServerEntry = {
|
|
49382
|
+
command: coordinatorSetup.mcpServer.command,
|
|
49383
|
+
args: coordinatorSetup.mcpServer.args
|
|
49384
|
+
};
|
|
49385
|
+
if (args?.inlineMesh) {
|
|
49386
|
+
mcpServerEntry.env = {
|
|
49387
|
+
ADHDEV_INLINE_MESH: JSON.stringify(mesh)
|
|
49388
|
+
};
|
|
49389
|
+
}
|
|
49355
49390
|
const mcpConfig = {
|
|
49356
49391
|
...existingMcpConfig,
|
|
49357
49392
|
mcpServers: {
|
|
49358
49393
|
...existingMcpConfig.mcpServers || {},
|
|
49359
|
-
[coordinatorSetup.serverName]:
|
|
49360
|
-
command: coordinatorSetup.mcpServer.command,
|
|
49361
|
-
args: coordinatorSetup.mcpServer.args
|
|
49362
|
-
}
|
|
49394
|
+
[coordinatorSetup.serverName]: mcpServerEntry
|
|
49363
49395
|
}
|
|
49364
49396
|
};
|
|
49365
49397
|
writeFileSync12(mcpConfigPath, JSON.stringify(mcpConfig, null, 2), "utf-8");
|