mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-09 02:43:29 +08:00
feat: record canonical session snapshots via adapters (#511)
This commit is contained in:
@@ -11,10 +11,26 @@ const TARGET_TYPE_TO_ADAPTER_ID = Object.freeze({
|
||||
'session-file': 'claude-history'
|
||||
});
|
||||
|
||||
function createDefaultAdapters() {
|
||||
function buildDefaultAdapterOptions(options, adapterId) {
|
||||
const sharedOptions = {
|
||||
loadStateStoreImpl: options.loadStateStoreImpl,
|
||||
persistSnapshots: options.persistSnapshots,
|
||||
recordingDir: options.recordingDir,
|
||||
stateStore: options.stateStore
|
||||
};
|
||||
|
||||
return {
|
||||
...sharedOptions,
|
||||
...(options.adapterOptions && options.adapterOptions[adapterId]
|
||||
? options.adapterOptions[adapterId]
|
||||
: {})
|
||||
};
|
||||
}
|
||||
|
||||
function createDefaultAdapters(options = {}) {
|
||||
return [
|
||||
createClaudeHistoryAdapter(),
|
||||
createDmuxTmuxAdapter()
|
||||
createClaudeHistoryAdapter(buildDefaultAdapterOptions(options, 'claude-history')),
|
||||
createDmuxTmuxAdapter(buildDefaultAdapterOptions(options, 'dmux-tmux'))
|
||||
];
|
||||
}
|
||||
|
||||
@@ -60,7 +76,7 @@ function normalizeStructuredTarget(target, context = {}) {
|
||||
}
|
||||
|
||||
function createAdapterRegistry(options = {}) {
|
||||
const adapters = options.adapters || createDefaultAdapters();
|
||||
const adapters = options.adapters || createDefaultAdapters(options);
|
||||
|
||||
return {
|
||||
adapters,
|
||||
|
||||
Reference in New Issue
Block a user