@adhdev/daemon-core 0.9.76-rc.7 → 0.9.76-rc.8

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 },