adhdev 0.9.74 → 0.9.76-rc.1
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 +129 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +59 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +34 -8
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -1541,6 +1541,7 @@ function normalizeConfig(raw) {
|
|
|
1541
1541
|
ideSettings: isPlainObject(parsed.ideSettings) ? parsed.ideSettings : {},
|
|
1542
1542
|
providerSourceMode: resolveProviderSourceMode(parsed.providerSourceMode, parsed.disableUpstream),
|
|
1543
1543
|
providerDir: asOptionalString(parsed.providerDir),
|
|
1544
|
+
updateChannel: parsed.updateChannel === "preview" ? "preview" : "stable",
|
|
1544
1545
|
terminalSizingMode: parsed.terminalSizingMode === "fit" ? "fit" : "measured"
|
|
1545
1546
|
};
|
|
1546
1547
|
}
|
|
@@ -1690,6 +1691,7 @@ var init_config = __esm({
|
|
|
1690
1691
|
machineProviders: {},
|
|
1691
1692
|
ideSettings: {},
|
|
1692
1693
|
providerSourceMode: "normal",
|
|
1694
|
+
updateChannel: "stable",
|
|
1693
1695
|
terminalSizingMode: "measured"
|
|
1694
1696
|
};
|
|
1695
1697
|
MACHINE_ID_PREFIX = "mach_";
|
|
@@ -2385,7 +2387,7 @@ function buildNodeConfigSection(mesh) {
|
|
|
2385
2387
|
for (const n of mesh.nodes) {
|
|
2386
2388
|
const labels = [];
|
|
2387
2389
|
if (n.isLocalWorktree) labels.push("worktree");
|
|
2388
|
-
if (n.policy
|
|
2390
|
+
if (n.policy?.readOnly) labels.push("read-only");
|
|
2389
2391
|
const suffix = labels.length ? ` [${labels.join(", ")}]` : "";
|
|
2390
2392
|
lines.push(`- **${n.workspace}** (${n.id})${suffix}`);
|
|
2391
2393
|
}
|
|
@@ -2431,18 +2433,20 @@ var init_coordinator_prompt = __esm({
|
|
|
2431
2433
|
3. **Delegate** \u2014 For each task:
|
|
2432
2434
|
a. Pick the best node (consider: health, dirty state, current workload).
|
|
2433
2435
|
b. If no session exists, call \`mesh_launch_session\` to start one.
|
|
2434
|
-
c. Call \`mesh_send_task\` with a
|
|
2436
|
+
c. Call \`mesh_send_task\` with a **complete, self-contained** instruction that includes all context the agent needs (file paths, line numbers, what to change, why). Do not send partial instructions expecting future follow-up.
|
|
2435
2437
|
4. **Monitor** \u2014 Periodically call \`mesh_read_chat\` to check progress. Handle approvals via \`mesh_approve\`.
|
|
2436
2438
|
5. **Verify** \u2014 When a task reports completion, call \`mesh_git_status\` to verify changes were made.
|
|
2437
2439
|
6. **Checkpoint** \u2014 Call \`mesh_checkpoint\` to save the work.
|
|
2438
2440
|
7. **Report** \u2014 Summarize what was done, what changed, and any issues.`;
|
|
2439
2441
|
RULES_SECTION = `## Rules
|
|
2440
2442
|
|
|
2441
|
-
- **
|
|
2442
|
-
- **
|
|
2443
|
+
- **Minimize coordinator context.** The coordinator's job is routing, not implementing. Do not read source files, run commands, or analyze code directly \u2014 delegate all of that to node agents. Your context should stay lean.
|
|
2444
|
+
- **Delegate analysis too.** If you need to understand a bug or explore the codebase, send that investigation as a task to a node. Do not do it yourself.
|
|
2445
|
+
- **Front-load the task message.** When calling \`mesh_send_task\`, include everything the agent needs: what files to touch, what the problem is, what the fix should look like. The agent won't ask follow-up questions.
|
|
2446
|
+
- **Don't inspect code.** Trust the agent's output. Verify via \`mesh_git_status\`, not by reading source files.
|
|
2443
2447
|
- **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed.
|
|
2444
2448
|
- **Handle failures gracefully.** If a task fails, read the chat to understand why, then retry or reassign.
|
|
2445
|
-
- **Keep the user informed.** Report progress after each delegation round.
|
|
2449
|
+
- **Keep the user informed.** Report progress after each delegation round \u2014 one or two sentences, not a narration.
|
|
2446
2450
|
- **Respect node capabilities.** Don't send build tasks to read-only nodes. Don't push from nodes that aren't allowed to.
|
|
2447
2451
|
- **Never fabricate tool results.** Always call the actual tool; never pretend you did.`;
|
|
2448
2452
|
}
|
|
@@ -13670,6 +13674,17 @@ var init_provider_cli_adapter = __esm({
|
|
|
13670
13674
|
this.lastScreenSnapshotReadAt = now;
|
|
13671
13675
|
return screenText;
|
|
13672
13676
|
}
|
|
13677
|
+
getParseScreenText(screenText) {
|
|
13678
|
+
const currentSnapshot = normalizeScreenSnapshot(screenText);
|
|
13679
|
+
const lastSnapshot = this.lastScreenSnapshot;
|
|
13680
|
+
if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
|
|
13681
|
+
const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
|
|
13682
|
+
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:\n|\r|$)/.test(screenText) && !/\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(screenText);
|
|
13683
|
+
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
13684
|
+
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
13685
|
+
return `${screenText}
|
|
13686
|
+
${lastSnapshot}`;
|
|
13687
|
+
}
|
|
13673
13688
|
shouldReadTerminalScreenSnapshot(now) {
|
|
13674
13689
|
if (!this.lastScreenText) return true;
|
|
13675
13690
|
return now - this.lastScreenSnapshotReadAt >= _ProviderCliAdapter.SCREEN_SNAPSHOT_MIN_INTERVAL_MS;
|
|
@@ -14660,12 +14675,13 @@ var init_provider_cli_adapter = __esm({
|
|
|
14660
14675
|
}
|
|
14661
14676
|
try {
|
|
14662
14677
|
const screenText = this.terminalScreen.getText();
|
|
14678
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
14663
14679
|
const tail = this.recentOutputBuffer.slice(-500);
|
|
14664
14680
|
const input = buildCliParseInput({
|
|
14665
14681
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
14666
14682
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
14667
14683
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
14668
|
-
terminalScreenText:
|
|
14684
|
+
terminalScreenText: parseScreenText,
|
|
14669
14685
|
baseMessages: [],
|
|
14670
14686
|
partialResponse: this.responseBuffer,
|
|
14671
14687
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -14759,8 +14775,9 @@ var init_provider_cli_adapter = __esm({
|
|
|
14759
14775
|
*/
|
|
14760
14776
|
getScriptParsedStatus() {
|
|
14761
14777
|
const screenText = this.readTerminalScreenText();
|
|
14778
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
14762
14779
|
const cached2 = this.parsedStatusCache;
|
|
14763
|
-
if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.screenText ===
|
|
14780
|
+
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) {
|
|
14764
14781
|
return cached2.result;
|
|
14765
14782
|
}
|
|
14766
14783
|
const parsed = this.runParseSession();
|
|
@@ -14788,7 +14805,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
14788
14805
|
currentTurnScope: this.currentTurnScope,
|
|
14789
14806
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
14790
14807
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
14791
|
-
screenText,
|
|
14808
|
+
screenText: parseScreenText,
|
|
14792
14809
|
currentStatus: this.currentStatus,
|
|
14793
14810
|
activeModal: this.activeModal,
|
|
14794
14811
|
cliName: this.cliName,
|
|
@@ -14805,7 +14822,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
14805
14822
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
14806
14823
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
14807
14824
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
14808
|
-
terminalScreenText: this.terminalScreen.getText(),
|
|
14825
|
+
terminalScreenText: this.getParseScreenText(this.terminalScreen.getText()),
|
|
14809
14826
|
baseMessages: [],
|
|
14810
14827
|
partialResponse: this.responseBuffer,
|
|
14811
14828
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -39101,6 +39118,8 @@ function resolveAdhdevMcpEntryPath(explicitPath) {
|
|
|
39101
39118
|
addCandidate((0, import_node_path2.resolve)(dir, "../vendor/mcp-server/index.js"));
|
|
39102
39119
|
addCandidate((0, import_node_path2.resolve)(dir, "../../vendor/mcp-server/index.js"));
|
|
39103
39120
|
addCandidate((0, import_node_path2.resolve)(dir, "../../../vendor/mcp-server/index.js"));
|
|
39121
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../mcp-server/dist/index.js"));
|
|
39122
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../../mcp-server/dist/index.js"));
|
|
39104
39123
|
};
|
|
39105
39124
|
addPackagedCandidates(process.argv[1]);
|
|
39106
39125
|
for (const candidate of candidates) {
|
|
@@ -39807,6 +39826,16 @@ var init_upgrade_helper = __esm({
|
|
|
39807
39826
|
});
|
|
39808
39827
|
|
|
39809
39828
|
// ../../oss/packages/daemon-core/src/commands/router.ts
|
|
39829
|
+
function normalizeReleaseChannel(value) {
|
|
39830
|
+
if (typeof value !== "string") return null;
|
|
39831
|
+
const normalized = value.trim().toLowerCase();
|
|
39832
|
+
if (normalized === "stable" || normalized === "latest") return "stable";
|
|
39833
|
+
if (normalized === "preview" || normalized === "next") return "preview";
|
|
39834
|
+
return null;
|
|
39835
|
+
}
|
|
39836
|
+
function resolveUpgradeChannel(args) {
|
|
39837
|
+
return normalizeReleaseChannel(args?.channel) || normalizeReleaseChannel(args?.updatePolicy?.channel) || normalizeReleaseChannel(args?.npmTag) || normalizeReleaseChannel(loadConfig().updateChannel) || "stable";
|
|
39838
|
+
}
|
|
39810
39839
|
function normalizeCommandSource(source) {
|
|
39811
39840
|
switch (source) {
|
|
39812
39841
|
case "ws":
|
|
@@ -39888,7 +39917,7 @@ function summarizeSessionHostPruneResult(result) {
|
|
|
39888
39917
|
keptCount: Array.isArray(value.keptSessionIds) ? value.keptSessionIds.length : void 0
|
|
39889
39918
|
};
|
|
39890
39919
|
}
|
|
39891
|
-
var fs10, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
39920
|
+
var fs10, CHANNEL_NPM_TAG, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
39892
39921
|
var init_router = __esm({
|
|
39893
39922
|
"../../oss/packages/daemon-core/src/commands/router.ts"() {
|
|
39894
39923
|
"use strict";
|
|
@@ -39915,6 +39944,7 @@ var init_router = __esm({
|
|
|
39915
39944
|
init_snapshot();
|
|
39916
39945
|
init_upgrade_helper();
|
|
39917
39946
|
fs10 = __toESM(require("fs"));
|
|
39947
|
+
CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
|
|
39918
39948
|
CHAT_COMMANDS = [
|
|
39919
39949
|
"send_chat",
|
|
39920
39950
|
"new_chat",
|
|
@@ -40516,8 +40546,10 @@ var init_router = __esm({
|
|
|
40516
40546
|
const isStandalone = this.deps.packageName === "@adhdev/daemon-standalone" || process.argv[1]?.includes("daemon-standalone");
|
|
40517
40547
|
const pkgName = isStandalone ? "@adhdev/daemon-standalone" : "adhdev";
|
|
40518
40548
|
const npmSurface = resolveCurrentGlobalInstallSurface({ packageName: pkgName });
|
|
40519
|
-
const
|
|
40520
|
-
|
|
40549
|
+
const channel = resolveUpgradeChannel(args);
|
|
40550
|
+
const npmTag = CHANNEL_NPM_TAG[channel];
|
|
40551
|
+
const latest = String(execNpmCommandSync(["view", `${pkgName}@${npmTag}`, "version"], { encoding: "utf-8", timeout: 1e4 }, npmSurface)).trim();
|
|
40552
|
+
LOG.info("Upgrade", `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
40521
40553
|
let currentInstalled = null;
|
|
40522
40554
|
try {
|
|
40523
40555
|
const currentJson = String(execNpmCommandSync(["ls", "-g", pkgName, "--depth=0", "--json"], {
|
|
@@ -40531,8 +40563,8 @@ var init_router = __esm({
|
|
|
40531
40563
|
}
|
|
40532
40564
|
const runningVersion = typeof this.deps.statusVersion === "string" ? this.deps.statusVersion.trim().replace(/^v/, "") : null;
|
|
40533
40565
|
if (currentInstalled === latest && runningVersion === latest) {
|
|
40534
|
-
LOG.info("Upgrade", `Already on
|
|
40535
|
-
return { success: true, upgraded: false, alreadyLatest: true, version: latest };
|
|
40566
|
+
LOG.info("Upgrade", `Already on ${channel} channel version v${latest}; skipping install`);
|
|
40567
|
+
return { success: true, upgraded: false, alreadyLatest: true, version: latest, channel, npmTag };
|
|
40536
40568
|
}
|
|
40537
40569
|
if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
|
|
40538
40570
|
LOG.info("Upgrade", `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
|
|
@@ -40545,12 +40577,12 @@ var init_router = __esm({
|
|
|
40545
40577
|
cwd: process.cwd(),
|
|
40546
40578
|
sessionHostAppName: process.env.ADHDEV_SESSION_HOST_NAME || "adhdev"
|
|
40547
40579
|
});
|
|
40548
|
-
LOG.info("Upgrade", `Scheduled detached upgrade to v${latest}`);
|
|
40580
|
+
LOG.info("Upgrade", `Scheduled detached ${channel} upgrade to v${latest}`);
|
|
40549
40581
|
setTimeout(() => {
|
|
40550
40582
|
LOG.info("Upgrade", "Exiting daemon so detached upgrader can continue...");
|
|
40551
40583
|
process.exit(0);
|
|
40552
40584
|
}, 3e3);
|
|
40553
|
-
return { success: true, upgraded: true, version: latest, restarting: true };
|
|
40585
|
+
return { success: true, upgraded: true, version: latest, restarting: true, channel, npmTag };
|
|
40554
40586
|
} catch (e) {
|
|
40555
40587
|
LOG.error("Upgrade", `Failed: ${e.message}`);
|
|
40556
40588
|
return { success: false, error: e.message };
|
|
@@ -40714,14 +40746,20 @@ var init_router = __esm({
|
|
|
40714
40746
|
} catch {
|
|
40715
40747
|
}
|
|
40716
40748
|
}
|
|
40749
|
+
const mcpServerEntry = {
|
|
40750
|
+
command: coordinatorSetup.mcpServer.command,
|
|
40751
|
+
args: coordinatorSetup.mcpServer.args
|
|
40752
|
+
};
|
|
40753
|
+
if (args?.inlineMesh) {
|
|
40754
|
+
mcpServerEntry.env = {
|
|
40755
|
+
ADHDEV_INLINE_MESH: JSON.stringify(mesh)
|
|
40756
|
+
};
|
|
40757
|
+
}
|
|
40717
40758
|
const mcpConfig = {
|
|
40718
40759
|
...existingMcpConfig,
|
|
40719
40760
|
mcpServers: {
|
|
40720
40761
|
...existingMcpConfig.mcpServers || {},
|
|
40721
|
-
[coordinatorSetup.serverName]:
|
|
40722
|
-
command: coordinatorSetup.mcpServer.command,
|
|
40723
|
-
args: coordinatorSetup.mcpServer.args
|
|
40724
|
-
}
|
|
40762
|
+
[coordinatorSetup.serverName]: mcpServerEntry
|
|
40725
40763
|
}
|
|
40726
40764
|
};
|
|
40727
40765
|
writeFileSync14(mcpConfigPath, JSON.stringify(mcpConfig, null, 2), "utf-8");
|
|
@@ -59116,7 +59154,7 @@ var init_adhdev_daemon = __esm({
|
|
|
59116
59154
|
init_version();
|
|
59117
59155
|
init_src();
|
|
59118
59156
|
init_runtime_defaults();
|
|
59119
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
59157
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.1" });
|
|
59120
59158
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
59121
59159
|
localHttpServer = null;
|
|
59122
59160
|
localWss = null;
|