File size: 837 Bytes
4e23b01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import type { RecordDehydrator, WireRecord } from './record';

export interface AgentJournalRef {
  readonly tree: string;
  readonly branch: string;
}

export interface SwitchBranchInput {
  readonly turns: number;
  readonly reason?: string;
  readonly fromTurnId?: number;
}

export interface SwitchedBranch {
  readonly branch: string;
  readonly base: { readonly branch: string; readonly line: number };
  readonly edgeLine: number;
  readonly forkLine: number;
}

export interface IAgentJournal {
  readonly journalRef: AgentJournalRef;
  append(record: WireRecord, dehydrate?: RecordDehydrator): void;
  read(): AsyncIterable<WireRecord>;
  readRaw(): AsyncIterable<WireRecord>;
  switchBranch(input: SwitchBranchInput): Promise<SwitchedBranch>;
  branches(): readonly string[];
  nextSeq(): number;
  settled(): Promise<void>;
}