@adhdev/daemon-core 0.9.49 → 0.9.50

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/session-host-core",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "description": "ADHDev local session host core \u2014 session registry, protocol, buffers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "description": "ADHDev daemon core \u2014 CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -653,9 +653,13 @@ function buildDebugBundleText(bundle: Record<string, unknown>): string {
653
653
  }
654
654
 
655
655
  export async function handleGetChatDebugBundle(h: CommandHelpers, args: any): Promise<CommandResult> {
656
+ const targetSessionId = typeof args?.targetSessionId === 'string' ? args.targetSessionId.trim() : '';
657
+ if (!targetSessionId && !h.currentSession) {
658
+ return { success: false, error: 'No targetSessionId specified — cannot route command' };
659
+ }
660
+
656
661
  const provider = h.getProvider(args?.agentType);
657
662
  const transport = getTargetTransport(h, provider);
658
- const targetSessionId = typeof args?.targetSessionId === 'string' ? args.targetSessionId.trim() : '';
659
663
  const providerType = provider?.type || getCurrentProviderType(h, args?.agentType || '');
660
664
  const adapter = isCliLikeTransport(transport) ? getTargetedCliAdapter(h, args, provider?.type) : null;
661
665
  const targetInstance = getTargetInstance(h, args);
@@ -380,6 +380,7 @@ export class DaemonCommandHandler implements CommandHelpers {
380
380
 
381
381
  const sessionScopedCommands = new Set([
382
382
  'read_chat',
383
+ 'get_chat_debug_bundle',
383
384
  'send_chat',
384
385
  'list_chats',
385
386
  'new_chat',
@@ -525,6 +525,12 @@ export class DaemonCommandRouter {
525
525
  const wantsAll = args?.all === true;
526
526
  const offset = wantsAll ? 0 : Math.max(0, Number(args?.offset) || 0);
527
527
  const limit = wantsAll ? Number.MAX_SAFE_INTEGER : Math.max(1, Math.min(100, Number(args?.limit) || 30));
528
+ const requestedWorkspace = typeof args?.workspace === 'string' ? args.workspace.trim() : '';
529
+ const requestedProviderSessionId = typeof args?.providerSessionId === 'string'
530
+ ? args.providerSessionId.trim()
531
+ : typeof args?.activeProviderSessionId === 'string'
532
+ ? args.activeProviderSessionId.trim()
533
+ : '';
528
534
  const providerMeta = this.deps.providerLoader.resolve?.(providerType) || this.deps.providerLoader.getMeta(providerType);
529
535
  const { sessions: historySessions, hasMore, source } = listProviderHistorySessions(providerType, {
530
536
  canonicalHistory: providerMeta?.canonicalHistory,
@@ -546,6 +552,10 @@ export class DaemonCommandRouter {
546
552
  sessions: historySessions.map(session => {
547
553
  const saved = savedSessionById.get(session.historySessionId);
548
554
  const recent = recentSessionById.get(session.historySessionId);
555
+ const workspace = saved?.workspace
556
+ || recent?.workspace
557
+ || session.workspace
558
+ || (requestedWorkspace && requestedProviderSessionId === session.historySessionId ? requestedWorkspace : undefined);
549
559
  return {
550
560
  id: session.historySessionId,
551
561
  providerSessionId: session.historySessionId,
@@ -553,13 +563,13 @@ export class DaemonCommandRouter {
553
563
  providerName: saved?.providerName || recent?.providerName || providerType,
554
564
  kind: saved?.kind || recent?.kind || kind,
555
565
  title: saved?.title || recent?.title || session.sessionTitle || session.preview || providerType,
556
- workspace: saved?.workspace || recent?.workspace || session.workspace,
566
+ workspace,
557
567
  summaryMetadata: saved?.summaryMetadata || recent?.summaryMetadata,
558
568
  preview: session.preview,
559
569
  messageCount: session.messageCount,
560
570
  firstMessageAt: session.firstMessageAt,
561
571
  lastMessageAt: session.lastMessageAt,
562
- canResume: !!(saved?.workspace || recent?.workspace || session.workspace) && canResumeById,
572
+ canResume: !!workspace && canResumeById,
563
573
  historySource: session.source,
564
574
  sourcePath: session.sourcePath,
565
575
  sourceMtimeMs: session.sourceMtimeMs,