import { DurableMemoryCoordinator } from '../../background-agents/durable-memory/coordinator.js';
export default function durableMemoryExtension(shortcut) {
    const coordinator = new DurableMemoryCoordinator();
    shortcut.on('session_start', async () => {
        coordinator.initialize();
    });
    shortcut.on('session_switch', async () => {
        coordinator.initialize();
    });
    shortcut.on('before_agent_start', async (event) => {
        const fragment = coordinator.getPromptFragment();
        if (!fragment)
            return;
        return {
            systemPrompt: `${event.systemPrompt}\n\n${fragment}`
        };
    });
    shortcut.registerPostTurnHandler(coordinator.createPostTurnHandler());
    shortcut.on('session_before_compact', async (event, ctx) => {
        await coordinator.onBeforeCompaction(event.preparation.messagesToSummarize, ctx, event.signal);
    });
}
export { DurableMemoryCoordinator } from '../../background-agents/durable-memory/coordinator.js';
export { durableMemoryAgent } from '../../background-agents/durable-memory/memory-agent.js';
export { buildMemoryAgentPrompt } from '../../background-agents/durable-memory/prompt-builder.js';
export { rebuildDerivedIndex } from './applier.js';
export { DURABLE_MEMORY_AGENT_DESCRIPTION, DURABLE_MEMORY_AGENT_MODEL, DURABLE_MEMORY_AGENT_NAME, DURABLE_MEMORY_AGENT_TOOLS } from './constants.js';
export { deriveMemoryIndex } from './derive-index.js';
export { attachCheckpointProvenance, createCheckpointProvenance, mergeProvenance } from './provenance.js';
export { buildDurableMemoryPromptFragment } from './retrieval.js';
export { parseTopicDocument, renderTopicDocument, slugifyEntryId, slugifyTopicFileName } from './topic-file.js';
export { validateWorkspaceState } from './validator.js';
export { DurableMemoryWorkspace } from './workspace.js';
//# sourceMappingURL=index.js.map