{"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\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface Node<StateType = any> {\n    type: \"node\";\n    value: ThreadState<StateType>;\n    path: string[];\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface Fork<StateType = any> {\n    type: \"fork\";\n    items: Array<Sequence<StateType>>;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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};\n// Get flat view\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":";;;;UAEUC;EAAAA,IAAAA,EAAAA,MAAI;EAAA,KAAA,EAEHD,WAFG,CAESE,SAFT,CAAA;MAESA,EAAAA,MAAAA,EAAAA;;;AAAD,UAIZC,IAAI,CAAA,YAAA,GAAA,CAAA,CAAA;EAAA,IAAA,EAAA,MAAA;OAEYD,EAAfG,KAAeH,CAATE,QAASF,CAAAA,SAAAA,CAAAA,CAAAA;;;UAGTE;EAAAA,IAAAA,EAAAA,UAAQ;EAAA,KAAA,EAEdC,KAFc,CAERJ,IAFQ,CAEHC,SAFG,CAAA,GAEUC,IAFV,CAEeD,SAFf,CAAA,CAAA"}