mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 17:04:49 +00:00
Refactor SessionEventBase to pass sessionManager and modelRegistry
Breaking changes to hook types: - SessionEventBase now passes sessionManager and modelRegistry directly - before_compact: passes preparation, previousCompactions (newest first) - before_switch: has targetSessionFile; switch: has previousSessionFile - Removed resolveApiKey (use modelRegistry.getApiKey()) - getSessionFile() returns string | undefined for in-memory sessions Updated: - All session event emissions in agent-session.ts - Hook examples (custom-compaction.ts, auto-commit-on-exit.ts, confirm-destructive.ts) - Tests (compaction-hooks.test.ts, compaction-hooks-example.test.ts) - export-html.ts guards for in-memory sessions
This commit is contained in:
parent
d96375b5e5
commit
9bba388ec5
14 changed files with 145 additions and 177 deletions
|
|
@ -1343,6 +1343,9 @@ export function exportSessionToHtml(
|
|||
const opts: ExportOptions = typeof options === "string" ? { outputPath: options } : options || {};
|
||||
|
||||
const sessionFile = sessionManager.getSessionFile();
|
||||
if (!sessionFile) {
|
||||
throw new Error("Cannot export in-memory session to HTML");
|
||||
}
|
||||
const content = readFileSync(sessionFile, "utf8");
|
||||
const data = parseSessionFile(content);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue