{"version":3,"file":"branching.d.cts","names":["ThreadState","Node","StateType","Fork","Sequence","Array","getBranchSequence","Record","getBranchView","getBranchContext"],"sources":["../../src/ui/branching.d.ts"],"sourcesContent":["import type { ThreadState } from \"../schema.js\";\ninterface Node<StateType = any> {\n    type: \"node\";\n    value: ThreadState<StateType>;\n    path: string[];\n}\ninterface Fork<StateType = any> {\n    type: \"fork\";\n    items: Array<Sequence<StateType>>;\n}\nexport interface Sequence<StateType = any> {\n    type: \"sequence\";\n    items: Array<Node<StateType> | Fork<StateType>>;\n}\nexport declare function getBranchSequence<StateType extends Record<string, unknown>>(history: ThreadState<StateType>[]): {\n    rootSequence: Sequence<any>;\n    paths: string[][];\n};\nexport declare function getBranchView<StateType extends Record<string, unknown>>(sequence: Sequence<StateType>, paths: string[][], branch: string): {\n    history: ThreadState<StateType>[];\n    branchByCheckpoint: Record<string, {\n        branch: string | undefined;\n        branchOptions: string[] | undefined;\n    }>;\n};\nexport declare function getBranchContext<StateType extends Record<string, unknown>>(branch: string, history: ThreadState<StateType>[] | undefined): {\n    branchTree: Sequence<any>;\n    flatHistory: ThreadState<any>[];\n    branchByCheckpoint: Record<string, {\n        branch: string | undefined;\n        branchOptions: string[] | undefined;\n    }>;\n    threadHead: ThreadState<any> | undefined;\n};\nexport {};\n"],"mappings":";;;UACUC;;EAAAA,KAAAA,EAECD,WAFG,CAESE,SAFT,CAAA;EAAA,IAAA,EAAA,MAAA,EAAA;;UAKJC,IAHCH,CAAAA,YAAAA,GAAAA,CAAAA,CAAAA;EAAW,IAAA,EAAA,MAAA;EAGZG,KAAAA,EAECE,KAFG,CAEGD,QAFH,CAEYF,SAFZ,CAAA,CAAA;;AAEYA,UAETE,QAFSF,CAAAA,YAAAA,GAAAA,CAAAA,CAAAA;MAATE,EAAAA,UAAAA;OAANC,EAIAA,KAJAA,CAIMJ,IAJNI,CAIWH,SAJXG,CAAAA,GAIwBF,IAJxBE,CAI6BH,SAJ7BG,CAAAA,CAAAA"}