mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
refactor: repo owns session and storage separately
This commit is contained in:
parent
3627c01179
commit
6a9591ae78
13 changed files with 266 additions and 237 deletions
|
|
@ -10,9 +10,10 @@ import {
|
|||
formatSkillInvocation,
|
||||
formatSkillsForSystemPrompt,
|
||||
getOrThrow,
|
||||
InMemorySessionRepo,
|
||||
MemorySessionStore,
|
||||
ok,
|
||||
parseCommandArgs,
|
||||
SessionRepo,
|
||||
streamProxy,
|
||||
toError,
|
||||
truncateHead,
|
||||
|
|
@ -26,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 InMemorySessionRepo();
|
||||
const repo = new SessionRepo({ storage: 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]);
|
||||
|
|
@ -39,7 +40,7 @@ console.log(
|
|||
schema.type,
|
||||
typeof stream.push,
|
||||
agent.hasQueuedMessages(),
|
||||
typeof repo.create,
|
||||
typeof repo.storage.create,
|
||||
result.value,
|
||||
llmMessages.length,
|
||||
bashExecutionToText({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue