@adhdev/daemon-core 0.9.45 → 0.9.46
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/config/chat-history.d.ts +6 -4
- package/dist/index.js +190 -712
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -712
- package/dist/index.mjs.map +1 -1
- package/dist/providers/cli-provider-instance.d.ts +2 -7
- package/dist/providers/contracts.d.ts +23 -14
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +1 -0
- package/src/commands/router.ts +4 -0
- package/src/config/chat-history.ts +161 -680
- package/src/providers/cli-provider-instance.ts +32 -70
- package/src/providers/contracts.ts +24 -14
- package/src/providers/provider-schema.ts +40 -0
|
@@ -50,13 +50,8 @@ export declare class CliProviderInstance implements ProviderInstance {
|
|
|
50
50
|
private historyWriter;
|
|
51
51
|
private runtimeMessages;
|
|
52
52
|
private lastPersistedHistoryMessages;
|
|
53
|
-
private
|
|
54
|
-
private
|
|
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
|
-
*
|
|
505
|
-
*
|
|
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
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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.
|
package/package.json
CHANGED
|
@@ -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) {
|
package/src/commands/router.ts
CHANGED
|
@@ -531,6 +531,7 @@ export class DaemonCommandRouter {
|
|
|
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,
|