mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(agent): populate session types with doc comments from design doc
This commit is contained in:
parent
f27941774e
commit
80ef7ff0f4
1 changed files with 18 additions and 7 deletions
|
|
@ -14,9 +14,9 @@ export interface IdGenerator {
|
|||
export interface EntryBase {
|
||||
type: string;
|
||||
id: string;
|
||||
seq: number;
|
||||
parentId: string | null;
|
||||
timestamp: number;
|
||||
seq: number; // shared sequence; read-side, storage-assigned
|
||||
parentId: string | null; // storage-assigned: the appending lane's leaf
|
||||
timestamp: number; // Unix ms, storage-assigned
|
||||
}
|
||||
|
||||
export interface MessageEntry extends EntryBase {
|
||||
|
|
@ -222,15 +222,16 @@ export interface EntryCursor {
|
|||
|
||||
export interface EntryQuery {
|
||||
type?: Entry["type"];
|
||||
customType?: string;
|
||||
order?: EntryOrder;
|
||||
customType?: string; // for type "custom"
|
||||
order?: EntryOrder; // default newestFirst
|
||||
limit?: number;
|
||||
cursor?: EntryCursor;
|
||||
}
|
||||
|
||||
/** Bounds of a branch scan. Default: the whole path, leaf to root. */
|
||||
export interface BranchBounds {
|
||||
start?: string;
|
||||
stopAtType?: Entry["type"];
|
||||
start?: string; // default: the view's lane leaf
|
||||
stopAtType?: Entry["type"]; // scan ends after the first match, inclusive
|
||||
stopAtId?: string;
|
||||
}
|
||||
|
||||
|
|
@ -318,14 +319,24 @@ export interface SessionTree {
|
|||
getLeafId(): Promise<string | null>;
|
||||
getEntry(id: string): Promise<Entry | undefined>;
|
||||
getStats(): Promise<SessionStats>;
|
||||
|
||||
// Global facts. Latest wins; not branch-scoped. "set", not "append":
|
||||
// append vocabulary is reserved for tree writes.
|
||||
getName(): Promise<string | undefined>;
|
||||
setName(name: string): Promise<void>;
|
||||
getLabel(targetId: string): Promise<string | undefined>;
|
||||
setLabel(targetId: string, label: string | undefined): Promise<void>;
|
||||
|
||||
/** Session-wide, all branches, sequence order. */
|
||||
findEntries(query?: EntryQuery): Promise<Entry[]>;
|
||||
findEntry(query?: EntryQuery): Promise<Entry | undefined>;
|
||||
|
||||
/** Branch-scoped: the path from start toward root. */
|
||||
findEntriesOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry[]>;
|
||||
findEntryOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry | undefined>;
|
||||
|
||||
// Writes. Resolve on durable acceptance; the returned id is the entry's
|
||||
// id (provisioned when the write defers).
|
||||
appendMessage(message: AgentMessage): Promise<string>;
|
||||
appendCustomEntry(customType: string, data?: unknown): Promise<string>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue