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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.76-rc.7",
3
+ "version": "0.9.76-rc.9",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -266,9 +266,10 @@ export class ProviderCliAdapter implements CliAdapter {
266
266
  const currentSnapshot = normalizeScreenSnapshot(screenText);
267
267
  const lastSnapshot = this.lastScreenSnapshot;
268
268
  if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
269
- const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
270
- const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:\n|\r|$)/.test(screenText)
271
- && !/\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(screenText);
269
+ 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;
270
+ const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
271
+ const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText)
272
+ && !activeScreenPattern.test(screenText);
272
273
  if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
273
274
  if (currentSnapshot.length >= lastSnapshot.length) return screenText;
274
275
  // Terminal screen reads can miss a just-rendered completed Hermes box while
@@ -43,6 +43,19 @@ function getActiveChatOptions(profile: SessionEntryProfile): NormalizeActiveChat
43
43
  return LIVE_STATUS_ACTIVE_CHAT_OPTIONS;
44
44
  }
45
45
 
46
+ function resolveSessionStatus(
47
+ activeChat: { status?: string | null; activeModal?: { buttons?: unknown[] | null } | null } | null | undefined,
48
+ providerStatus?: string | null,
49
+ ) {
50
+ const chatStatus = normalizeManagedStatus(activeChat?.status, { activeModal: activeChat?.activeModal || null });
51
+ const topLevelStatus = normalizeManagedStatus(providerStatus, { activeModal: activeChat?.activeModal || null });
52
+
53
+ if (chatStatus === 'waiting_approval' || topLevelStatus === 'waiting_approval') return 'waiting_approval';
54
+ if (chatStatus === 'generating' || topLevelStatus === 'generating') return 'generating';
55
+ if (topLevelStatus !== 'idle') return topLevelStatus;
56
+ return chatStatus;
57
+ }
58
+
46
59
  function shouldIncludeSessionControls(profile: SessionEntryProfile): boolean {
47
60
  return profile !== 'live';
48
61
  }
@@ -170,9 +183,7 @@ function buildIdeWorkspaceSession(
170
183
  providerName: state.name,
171
184
  kind: 'workspace',
172
185
  transport: 'cdp-page',
173
- status: normalizeManagedStatus(activeChat?.status || state.status, {
174
- activeModal: activeChat?.activeModal || null,
175
- }),
186
+ status: resolveSessionStatus(activeChat, state.status),
176
187
  title,
177
188
  workspace,
178
189
  ...(git && { git }),
@@ -212,9 +223,7 @@ function buildExtensionAgentSession(
212
223
  providerSessionId: ext.providerSessionId,
213
224
  kind: 'agent',
214
225
  transport: 'cdp-webview',
215
- status: normalizeManagedStatus(activeChat?.status || ext.status, {
216
- activeModal: activeChat?.activeModal || null,
217
- }),
226
+ status: resolveSessionStatus(activeChat, ext.status),
218
227
  title: activeChat?.title || ext.name,
219
228
  workspace,
220
229
  ...(git && { git }),
@@ -277,9 +286,7 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
277
286
  providerSessionId: state.providerSessionId,
278
287
  kind: 'agent',
279
288
  transport: 'pty',
280
- status: normalizeManagedStatus(activeChat?.status || state.status, {
281
- activeModal: activeChat?.activeModal || null,
282
- }),
289
+ status: resolveSessionStatus(activeChat, state.status),
283
290
  title: activeChat?.title || state.name,
284
291
  workspace,
285
292
  ...(git && { git }),
@@ -328,9 +335,7 @@ function buildAcpSession(state: AcpProviderState, options: SessionEntryBuildOpti
328
335
  providerName: state.name,
329
336
  kind: 'agent',
330
337
  transport: 'acp',
331
- status: normalizeManagedStatus(activeChat?.status || state.status, {
332
- activeModal: activeChat?.activeModal || null,
333
- }),
338
+ status: resolveSessionStatus(activeChat, state.status),
334
339
  title: activeChat?.title || state.name,
335
340
  workspace,
336
341
  ...(git && { git }),