mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
refactor: repo facade
This commit is contained in:
parent
6a9591ae78
commit
5e48d41ecd
12 changed files with 318 additions and 298 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue