@adhdev/daemon-core 0.9.82-rc.201 → 0.9.82-rc.202

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.82-rc.201",
3
+ "version": "0.9.82-rc.202",
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",
@@ -20,6 +20,7 @@
20
20
 
21
21
  import { SpecDriver, type DashboardEvent } from './driver.js';
22
22
  import { evaluate } from './evaluator.js';
23
+ import { executeNativeHistory } from './native-history-executor.js';
23
24
  import { loadSpec } from './loader.js';
24
25
  import type { CliSpec } from './types.js';
25
26
  import type { CliAdapter, CliAdapterStatus } from '../../cli-adapter-types.js';
@@ -340,6 +341,22 @@ export class SpecCliAdapter implements CliAdapter {
340
341
  sections[(sec as any).id] = lines.slice(start, end).join('\n');
341
342
  }
342
343
  } catch { /* best-effort */ }
344
+ // Read native transcript messages for the debug snapshot
345
+ let messages: any[] = [];
346
+ if (this.spec.native_history?.source) {
347
+ try {
348
+ const nhResult = executeNativeHistory(this.spec.native_history, {
349
+ agentType: this.cliType,
350
+ providerSessionId: this.providerSessionId,
351
+ sessionStartedAtMs: this.spawnedAtMs,
352
+ envOverrides: this.spawnedEnv,
353
+ workspace: this.workingDir,
354
+ });
355
+ if (nhResult && Array.isArray(nhResult.messages)) messages = nhResult.messages;
356
+ } catch { /* best-effort */ }
357
+ } else {
358
+ messages = this.readClaudeScreenAssistantMessages();
359
+ }
343
360
  return {
344
361
  cliType: this.cliType,
345
362
  spec_id: this.spec.id,
@@ -353,6 +370,14 @@ export class SpecCliAdapter implements CliAdapter {
353
370
  idleHoldPending: this.driver.hasIdleHoldPending(),
354
371
  lastBusyAt: this.driver.getLastBusyAt(),
355
372
  specPath: this.driver.getSpecPath(),
373
+ // Extended fields
374
+ name: this.cliName,
375
+ status: this.getStatus().status,
376
+ workingDir: this.workingDir,
377
+ spawnedAtMs: this.spawnedAtMs,
378
+ providerSessionId: this.providerSessionId ?? null,
379
+ messages,
380
+ committedMessages: messages,
356
381
  };
357
382
  }
358
383
  getRuntimeMetadata(): unknown {
@@ -540,6 +565,29 @@ export class SpecCliAdapter implements CliAdapter {
540
565
  const screen = this.driver.getScreen?.() ?? '';
541
566
  const history = this.driver.getStateHistory();
542
567
  const status = this.getStatus();
568
+
569
+ let messages: any[] = [];
570
+ if (this.spec.native_history?.source) {
571
+ try {
572
+ const result = executeNativeHistory(this.spec.native_history, {
573
+ agentType: this.cliType,
574
+ providerSessionId: this.providerSessionId,
575
+ sessionStartedAtMs: this.spawnedAtMs,
576
+ envOverrides: this.spawnedEnv,
577
+ workspace: this.workingDir,
578
+ });
579
+ if (result && Array.isArray(result.messages)) {
580
+ messages = result.messages;
581
+ }
582
+ } catch (e) {
583
+ // Ignore native history read errors in debug state
584
+ }
585
+ } else {
586
+ messages = this.readClaudeScreenAssistantMessages();
587
+ }
588
+
589
+ const latestState = this.latestState;
590
+ const latestModal = this.latestModal;
543
591
  return {
544
592
  type: this.cliType,
545
593
  name: this.cliName,
@@ -547,10 +595,23 @@ export class SpecCliAdapter implements CliAdapter {
547
595
  rawStatus: status.status,
548
596
  projectedStatus: status.status,
549
597
  ready: this.spawned,
598
+ // Legacy snapshot-style fields for panels that read getDebugSnapshot shape
599
+ spec_id: this.spec.id,
600
+ current_state: latestState ?? null,
601
+ current_modal: latestModal ?? null,
602
+ exited: this.exited,
603
+ idleHoldPending: this.driver.hasIdleHoldPending?.() ?? false,
604
+ lastBusyAt: this.driver.getLastBusyAt?.() ?? 0,
605
+ screen: screen,
550
606
  screenText: screen,
607
+ workingDir: this.workingDir,
608
+ spawnedAtMs: this.spawnedAtMs,
609
+ providerSessionId: this.providerSessionId ?? null,
551
610
  sections: this.driver.getSections?.() ?? null,
552
611
  stateHistory: history,
553
612
  specPath: (this.driver as any).opts?.specPath ?? null,
613
+ messages,
614
+ committedMessages: messages,
554
615
  };
555
616
  }
556
617