mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
refactor(agent): share session register key helper
This commit is contained in:
parent
7edcfe25e4
commit
a2fd9783f5
2 changed files with 2 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { type Usage, uuidv7 } from "@earendil-works/pi-ai";
|
||||
import type { AgentMessage } from "../../types.ts";
|
||||
import { StorageBackedSession } from "./session.ts";
|
||||
import { StorageState, type StorageStateSnapshot } from "./storage-state.ts";
|
||||
import { registerKey, StorageState, type StorageStateSnapshot } from "./storage-state.ts";
|
||||
import type {
|
||||
BranchScan,
|
||||
CommitResult,
|
||||
|
|
@ -37,10 +37,6 @@ export interface MemorySessionRepoOptions {
|
|||
now?: () => number;
|
||||
}
|
||||
|
||||
function registerKey(namespace: RegisterNamespace, key: string): string {
|
||||
return `${namespace}\u0000${key}`;
|
||||
}
|
||||
|
||||
function isRegisterNamespace<TNamespace extends RegisterNamespace>(
|
||||
register: Register,
|
||||
namespace: TNamespace,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export interface StorageStateSnapshot {
|
|||
nextSeq: number;
|
||||
}
|
||||
|
||||
function registerKey(namespace: RegisterNamespace, key: string): string {
|
||||
export function registerKey(namespace: RegisterNamespace, key: string): string {
|
||||
return `${namespace}\u0000${key}`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue