@adhdev/daemon-core 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/index.js CHANGED
@@ -1766,8 +1766,9 @@ var init_provider_cli_adapter = __esm({
1766
1766
  const currentSnapshot = normalizeScreenSnapshot(screenText);
1767
1767
  const lastSnapshot = this.lastScreenSnapshot;
1768
1768
  if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
1769
- const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
1770
- 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);
1769
+ 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;
1770
+ const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
1771
+ const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
1771
1772
  if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
1772
1773
  if (currentSnapshot.length >= lastSnapshot.length) return screenText;
1773
1774
  return `${screenText}
@@ -11191,6 +11192,14 @@ function getActiveChatOptions(profile) {
11191
11192
  if (profile === "full") return {};
11192
11193
  return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
11193
11194
  }
11195
+ function resolveSessionStatus(activeChat, providerStatus) {
11196
+ const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
11197
+ const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
11198
+ if (chatStatus === "waiting_approval" || topLevelStatus === "waiting_approval") return "waiting_approval";
11199
+ if (chatStatus === "generating" || topLevelStatus === "generating") return "generating";
11200
+ if (topLevelStatus !== "idle") return topLevelStatus;
11201
+ return chatStatus;
11202
+ }
11194
11203
  function shouldIncludeSessionControls(profile) {
11195
11204
  return profile !== "live";
11196
11205
  }
@@ -11269,9 +11278,7 @@ function buildIdeWorkspaceSession(state, cdpManagers, options) {
11269
11278
  providerName: state.name,
11270
11279
  kind: "workspace",
11271
11280
  transport: "cdp-page",
11272
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11273
- activeModal: activeChat?.activeModal || null
11274
- }),
11281
+ status: resolveSessionStatus(activeChat, state.status),
11275
11282
  title,
11276
11283
  workspace,
11277
11284
  ...git && { git },
@@ -11306,9 +11313,7 @@ function buildExtensionAgentSession(parent, ext, options) {
11306
11313
  providerSessionId: ext.providerSessionId,
11307
11314
  kind: "agent",
11308
11315
  transport: "cdp-webview",
11309
- status: normalizeManagedStatus(activeChat?.status || ext.status, {
11310
- activeModal: activeChat?.activeModal || null
11311
- }),
11316
+ status: resolveSessionStatus(activeChat, ext.status),
11312
11317
  title: activeChat?.title || ext.name,
11313
11318
  workspace,
11314
11319
  ...git && { git },
@@ -11358,9 +11363,7 @@ function buildCliSession(state, options) {
11358
11363
  providerSessionId: state.providerSessionId,
11359
11364
  kind: "agent",
11360
11365
  transport: "pty",
11361
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11362
- activeModal: activeChat?.activeModal || null
11363
- }),
11366
+ status: resolveSessionStatus(activeChat, state.status),
11364
11367
  title: activeChat?.title || state.name,
11365
11368
  workspace,
11366
11369
  ...git && { git },
@@ -11408,9 +11411,7 @@ function buildAcpSession(state, options) {
11408
11411
  providerName: state.name,
11409
11412
  kind: "agent",
11410
11413
  transport: "acp",
11411
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11412
- activeModal: activeChat?.activeModal || null
11413
- }),
11414
+ status: resolveSessionStatus(activeChat, state.status),
11414
11415
  title: activeChat?.title || state.name,
11415
11416
  workspace,
11416
11417
  ...git && { git },
@@ -20090,7 +20091,7 @@ function resolveAdhdevMcpServerLaunch(options) {
20090
20091
  if (!entryPath) return null;
20091
20092
  return {
20092
20093
  command: options.nodeExecutable?.trim() || process.execPath,
20093
- args: [entryPath, "--repo-mesh", options.meshId]
20094
+ args: [entryPath, "--mode", "ipc", "--repo-mesh", options.meshId]
20094
20095
  };
20095
20096
  }
20096
20097
  function resolveAdhdevMcpEntryPath(explicitPath) {
@@ -20789,6 +20790,10 @@ async function maybeRunDaemonUpgradeHelperFromEnv() {
20789
20790
  // src/commands/router.ts
20790
20791
  var fs10 = __toESM(require("fs"));
20791
20792
  var CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
20793
+ var CHANNEL_SERVER_URL = {
20794
+ stable: "https://api.adhf.dev",
20795
+ preview: "https://api-preview.adhf.dev"
20796
+ };
20792
20797
  function normalizeReleaseChannel(value) {
20793
20798
  if (typeof value !== "string") return null;
20794
20799
  const normalized = value.trim().toLowerCase();
@@ -21485,6 +21490,7 @@ var DaemonCommandRouter = class {
21485
21490
  const npmTag = CHANNEL_NPM_TAG[channel];
21486
21491
  const latest = String(execNpmCommandSync(["view", `${pkgName}@${npmTag}`, "version"], { encoding: "utf-8", timeout: 1e4 }, npmSurface)).trim();
21487
21492
  LOG.info("Upgrade", `Latest ${pkgName}@${npmTag}: v${latest}`);
21493
+ updateConfig({ updateChannel: channel, serverUrl: CHANNEL_SERVER_URL[channel] });
21488
21494
  let currentInstalled = null;
21489
21495
  try {
21490
21496
  const currentJson = String(execNpmCommandSync(["ls", "-g", pkgName, "--depth=0", "--json"], {
@@ -21687,7 +21693,8 @@ var DaemonCommandRouter = class {
21687
21693
  };
21688
21694
  if (args?.inlineMesh) {
21689
21695
  mcpServerEntry.env = {
21690
- ADHDEV_INLINE_MESH: JSON.stringify(mesh)
21696
+ ADHDEV_INLINE_MESH: JSON.stringify(mesh),
21697
+ ADHDEV_MCP_TRANSPORT: "ipc"
21691
21698
  };
21692
21699
  }
21693
21700
  const mcpConfig = {