@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.mjs CHANGED
@@ -1762,8 +1762,9 @@ var init_provider_cli_adapter = __esm({
1762
1762
  const currentSnapshot = normalizeScreenSnapshot(screenText);
1763
1763
  const lastSnapshot = this.lastScreenSnapshot;
1764
1764
  if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
1765
- const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
1766
- 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);
1765
+ 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;
1766
+ const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
1767
+ const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
1767
1768
  if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
1768
1769
  if (currentSnapshot.length >= lastSnapshot.length) return screenText;
1769
1770
  return `${screenText}
@@ -10999,6 +11000,14 @@ function getActiveChatOptions(profile) {
10999
11000
  if (profile === "full") return {};
11000
11001
  return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
11001
11002
  }
11003
+ function resolveSessionStatus(activeChat, providerStatus) {
11004
+ const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
11005
+ const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
11006
+ if (chatStatus === "waiting_approval" || topLevelStatus === "waiting_approval") return "waiting_approval";
11007
+ if (chatStatus === "generating" || topLevelStatus === "generating") return "generating";
11008
+ if (topLevelStatus !== "idle") return topLevelStatus;
11009
+ return chatStatus;
11010
+ }
11002
11011
  function shouldIncludeSessionControls(profile) {
11003
11012
  return profile !== "live";
11004
11013
  }
@@ -11077,9 +11086,7 @@ function buildIdeWorkspaceSession(state, cdpManagers, options) {
11077
11086
  providerName: state.name,
11078
11087
  kind: "workspace",
11079
11088
  transport: "cdp-page",
11080
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11081
- activeModal: activeChat?.activeModal || null
11082
- }),
11089
+ status: resolveSessionStatus(activeChat, state.status),
11083
11090
  title,
11084
11091
  workspace,
11085
11092
  ...git && { git },
@@ -11114,9 +11121,7 @@ function buildExtensionAgentSession(parent, ext, options) {
11114
11121
  providerSessionId: ext.providerSessionId,
11115
11122
  kind: "agent",
11116
11123
  transport: "cdp-webview",
11117
- status: normalizeManagedStatus(activeChat?.status || ext.status, {
11118
- activeModal: activeChat?.activeModal || null
11119
- }),
11124
+ status: resolveSessionStatus(activeChat, ext.status),
11120
11125
  title: activeChat?.title || ext.name,
11121
11126
  workspace,
11122
11127
  ...git && { git },
@@ -11166,9 +11171,7 @@ function buildCliSession(state, options) {
11166
11171
  providerSessionId: state.providerSessionId,
11167
11172
  kind: "agent",
11168
11173
  transport: "pty",
11169
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11170
- activeModal: activeChat?.activeModal || null
11171
- }),
11174
+ status: resolveSessionStatus(activeChat, state.status),
11172
11175
  title: activeChat?.title || state.name,
11173
11176
  workspace,
11174
11177
  ...git && { git },
@@ -11216,9 +11219,7 @@ function buildAcpSession(state, options) {
11216
11219
  providerName: state.name,
11217
11220
  kind: "agent",
11218
11221
  transport: "acp",
11219
- status: normalizeManagedStatus(activeChat?.status || state.status, {
11220
- activeModal: activeChat?.activeModal || null
11221
- }),
11222
+ status: resolveSessionStatus(activeChat, state.status),
11222
11223
  title: activeChat?.title || state.name,
11223
11224
  workspace,
11224
11225
  ...git && { git },
@@ -19903,7 +19904,7 @@ function resolveAdhdevMcpServerLaunch(options) {
19903
19904
  if (!entryPath) return null;
19904
19905
  return {
19905
19906
  command: options.nodeExecutable?.trim() || process.execPath,
19906
- args: [entryPath, "--repo-mesh", options.meshId]
19907
+ args: [entryPath, "--mode", "ipc", "--repo-mesh", options.meshId]
19907
19908
  };
19908
19909
  }
19909
19910
  function resolveAdhdevMcpEntryPath(explicitPath) {
@@ -20602,6 +20603,10 @@ async function maybeRunDaemonUpgradeHelperFromEnv() {
20602
20603
  // src/commands/router.ts
20603
20604
  import * as fs10 from "fs";
20604
20605
  var CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
20606
+ var CHANNEL_SERVER_URL = {
20607
+ stable: "https://api.adhf.dev",
20608
+ preview: "https://api-preview.adhf.dev"
20609
+ };
20605
20610
  function normalizeReleaseChannel(value) {
20606
20611
  if (typeof value !== "string") return null;
20607
20612
  const normalized = value.trim().toLowerCase();
@@ -21298,6 +21303,7 @@ var DaemonCommandRouter = class {
21298
21303
  const npmTag = CHANNEL_NPM_TAG[channel];
21299
21304
  const latest = String(execNpmCommandSync(["view", `${pkgName}@${npmTag}`, "version"], { encoding: "utf-8", timeout: 1e4 }, npmSurface)).trim();
21300
21305
  LOG.info("Upgrade", `Latest ${pkgName}@${npmTag}: v${latest}`);
21306
+ updateConfig({ updateChannel: channel, serverUrl: CHANNEL_SERVER_URL[channel] });
21301
21307
  let currentInstalled = null;
21302
21308
  try {
21303
21309
  const currentJson = String(execNpmCommandSync(["ls", "-g", pkgName, "--depth=0", "--json"], {
@@ -21500,7 +21506,8 @@ var DaemonCommandRouter = class {
21500
21506
  };
21501
21507
  if (args?.inlineMesh) {
21502
21508
  mcpServerEntry.env = {
21503
- ADHDEV_INLINE_MESH: JSON.stringify(mesh)
21509
+ ADHDEV_INLINE_MESH: JSON.stringify(mesh),
21510
+ ADHDEV_MCP_TRANSPORT: "ipc"
21504
21511
  };
21505
21512
  }
21506
21513
  const mcpConfig = {