refactor: repo facade

This commit is contained in:
Cristina Poncela Cubeiro 2026-07-30 14:07:58 +02:00
parent 6a9591ae78
commit 5e48d41ecd
12 changed files with 318 additions and 298 deletions

View file

@ -13,7 +13,7 @@ import {
MemorySessionStore,
ok,
parseCommandArgs,
SessionRepo,
SessionRepository,
streamProxy,
toError,
truncateHead,
@ -27,7 +27,7 @@ const stream = createAssistantMessageEventStream();
const agent = new Agent({ initialState: { model }, streamFn: streamSimple });
agent.steer({ role: "user", content: [{ type: "text", text: "queued" }], timestamp: 0 });
const repo = new SessionRepo({ storage: new MemorySessionStore() });
const repo = new SessionRepository({ store: new MemorySessionStore() });
const result = getOrThrow(ok({ value: 1 }));
const customMessage = createCustomMessage("note", "hello", true, undefined, "2026-01-01T00:00:00.000Z");
const llmMessages = convertToLlm([customMessage]);
@ -40,7 +40,7 @@ console.log(
schema.type,
typeof stream.push,
agent.hasQueuedMessages(),
typeof repo.storage.create,
typeof repo.create,
result.value,
llmMessages.length,
bashExecutionToText({