@@ -2,6 +2,7 @@ import * as transport from "rivetkit/experimental/inspector/workflow";
22import {
33 encodeWorkflowHistoryTransport ,
44 encodeWorkflowInspectorValue ,
5+ type WorkflowHistoryBytes ,
56 type WorkflowInspectorAdapter ,
67} from "rivetkit/experimental/inspector/workflow" ;
78import type {
@@ -21,7 +22,7 @@ function assertUnreachable(value: never): never {
2122 throw new Error ( `Unexpected workflow Inspector value: ${ String ( value ) } ` ) ;
2223}
2324
24- type HistoryListener = ( history : ArrayBuffer ) => void ;
25+ type HistoryListener = ( history : WorkflowHistoryBytes ) => void ;
2526
2627function createHistoryEmitter ( ) {
2728 const listeners = new Set < HistoryListener > ( ) ;
@@ -31,7 +32,7 @@ function createHistoryEmitter() {
3132 listeners . add ( listener ) ;
3233 return ( ) => listeners . delete ( listener ) ;
3334 } ,
34- emit : ( history : ArrayBuffer ) => {
35+ emit : ( history : WorkflowHistoryBytes ) => {
3536 for ( const listener of listeners ) {
3637 listener ( history ) ;
3738 }
@@ -44,16 +45,17 @@ export function createWorkflowInspectorAdapter(): {
4445 update : ( snapshot : WorkflowHistorySnapshot ) => void ;
4546 setGetState : ( fn : ( ) => Promise < WorkflowState | null > ) => void ;
4647 setReplayFromStep : (
47- fn : ( entryId ?: string ) => Promise < ArrayBuffer | null > ,
48+ fn : ( entryId ?: string ) => Promise < WorkflowHistoryBytes | null > ,
4849 ) => void ;
4950} {
5051 const emitter = createHistoryEmitter ( ) ;
51- let history : ArrayBuffer | null = null ;
52+ let history : WorkflowHistoryBytes | null = null ;
5253 let getState : ( ) => Promise < WorkflowState | null > = async ( ) => null ;
53- let replayFromStep : ( entryId ?: string ) => Promise < ArrayBuffer | null > =
54- async ( ) => {
55- throw new Error ( "Workflow replay controls are not initialized" ) ;
56- } ;
54+ let replayFromStep : (
55+ entryId ?: string ,
56+ ) => Promise < WorkflowHistoryBytes | null > = async ( ) => {
57+ throw new Error ( "Workflow replay controls are not initialized" ) ;
58+ } ;
5759
5860 const adapter : WorkflowInspectorAdapter = {
5961 getHistory : ( ) => history ,
0 commit comments