@adhdev/daemon-core 0.9.45 → 0.9.47

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.
@@ -50,13 +50,8 @@ export declare class CliProviderInstance implements ProviderInstance {
50
50
  private historyWriter;
51
51
  private runtimeMessages;
52
52
  private lastPersistedHistoryMessages;
53
- private lastCanonicalHermesSyncMtimeMs;
54
- private lastCanonicalHermesExistCheckAt;
55
- private lastCanonicalHermesWatchPath;
56
- private lastCanonicalClaudeRebuildMtimeMs;
57
- private lastCanonicalClaudeCheckAt;
58
- private lastCanonicalCodexRebuildMtimeMs;
59
- private lastCanonicalCodexCheckAt;
53
+ private lastNativeSourceCanonicalCheckAt;
54
+ private lastNativeSourceCanonicalCacheKey;
60
55
  private cachedSqliteDb;
61
56
  private cachedSqliteDbPath;
62
57
  private cachedSqliteDbMissingUntil;
@@ -499,24 +499,33 @@ export interface ProviderHistoryBehavior {
499
499
  /** If true, session ID must match sessionIdPattern exactly — reject and return '' if it doesn't match */
500
500
  requireStrictSessionIdFormat?: boolean;
501
501
  }
502
+ /**
503
+ * Provider-owned native history script names.
504
+ *
505
+ * These functions live in the provider's versioned CLI script bundle, not in
506
+ * daemon-core. They let each provider own native transcript file discovery and
507
+ * parsing while daemon-core only validates/pages the normalized result.
508
+ */
509
+ export interface ProviderCanonicalHistoryScriptsConfig {
510
+ /** Reads one native session. Default: 'readNativeHistory'. */
511
+ readSession?: string;
512
+ /** Lists native sessions with summary metadata. Default: 'listNativeHistory'. */
513
+ listSessions?: string;
514
+ }
502
515
  /**
503
516
  * Canonical history sync config — for providers that maintain their own native history files.
504
- * When set, daemon syncs from the provider's native format into the ADHDev JSONL store.
505
- * Replaces hardcoded hermes-cli / claude-cli checks in cli-provider-instance.ts.
517
+ *
518
+ * Preferred mode is provider-owned scripts via `scripts`. `format` is now an
519
+ * opaque provider label retained for diagnostics/backward compatibility; daemon
520
+ * live paths must not branch on provider-specific format values.
506
521
  */
507
522
  export interface ProviderCanonicalHistoryConfig {
508
- /**
509
- * Native history format.
510
- * - 'hermes-json': single JSON file per session (~/.hermes/sessions/session_{{sessionId}}.json)
511
- * - 'claude-jsonl': JSONL transcript under ~/.claude/projects/
512
- * - 'codex-jsonl': rollout JSONL transcript under ~/.codex/sessions/YYYY/MM/DD/
513
- */
514
- format: 'hermes-json' | 'claude-jsonl' | 'codex-jsonl';
515
- /**
516
- * Path to the native history file. Supports ~ and {{sessionId}} placeholder.
517
- * e.g. "~/.hermes/sessions/session_{{sessionId}}.json"
518
- */
519
- watchPath: string;
523
+ /** Opaque provider-owned history format label. */
524
+ format?: string;
525
+ /** Optional native history glob/template for diagnostics only. */
526
+ watchPath?: string;
527
+ /** Provider-owned script entry points for native transcript list/read. */
528
+ scripts?: ProviderCanonicalHistoryScriptsConfig;
520
529
  /**
521
530
  * How ADHDev should use native history.
522
531
  * - 'native-source': provider-native files are canonical; ADHDev reads them directly and keeps only in-memory/thin projections.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/session-host-core",
3
- "version": "0.9.45",
3
+ "version": "0.9.47",
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.45",
3
+ "version": "0.9.47",
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",
@@ -577,6 +577,7 @@ export async function handleChatHistory(h: CommandHelpers, args: any): Promise<C
577
577
  limit: limit || 30,
578
578
  excludeRecentCount,
579
579
  historyBehavior: provider?.historyBehavior,
580
+ scripts: provider?.scripts as any,
580
581
  });
581
582
  return { success: true, ...result, agent: agentStr };
582
583
  } catch (e: any) {
@@ -525,12 +525,13 @@ 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 providerMeta = this.deps.providerLoader.getMeta(providerType);
528
+ const providerMeta = this.deps.providerLoader.resolve?.(providerType) || this.deps.providerLoader.getMeta(providerType);
529
529
  const { sessions: historySessions, hasMore, source } = listProviderHistorySessions(providerType, {
530
530
  canonicalHistory: providerMeta?.canonicalHistory,
531
531
  offset,
532
532
  limit,
533
533
  historyBehavior: providerMeta?.historyBehavior,
534
+ scripts: providerMeta?.scripts as any,
534
535
  });
535
536
  const state = loadState();
536
537
  const savedSessions = getSavedProviderSessions(state, { providerType, kind });
@@ -559,6 +560,9 @@ export class DaemonCommandRouter {
559
560
  firstMessageAt: session.firstMessageAt,
560
561
  lastMessageAt: session.lastMessageAt,
561
562
  canResume: !!(saved?.workspace || recent?.workspace || session.workspace) && canResumeById,
563
+ historySource: session.source,
564
+ sourcePath: session.sourcePath,
565
+ sourceMtimeMs: session.sourceMtimeMs,
562
566
  };
563
567
  }),
564
568
  hasMore,