import * as bare from '@rivetkit/bare-ts'; import { WorkflowInspectorAdapter as WorkflowInspectorAdapter$1, WorkflowHistoryBytes } from './workflow.js'; export { WorkflowHistory as TransportWorkflowHistory, decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport } from './workflow.js'; import { WorkflowHistorySnapshot, WorkflowState } from '@rivetkit/workflow-engine'; type uint = bigint; type State = ArrayBuffer; declare function readState(bc: bare.ByteCursor): State; declare function writeState(bc: bare.ByteCursor, x: State): void; type WorkflowHistory = ArrayBuffer; declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory; declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory): void; type PatchStateRequest = { readonly state: ArrayBuffer; }; declare function readPatchStateRequest(bc: bare.ByteCursor): PatchStateRequest; declare function writePatchStateRequest(bc: bare.ByteCursor, x: PatchStateRequest): void; type ActionRequest = { readonly id: uint; readonly name: string; readonly args: ArrayBuffer; }; declare function readActionRequest(bc: bare.ByteCursor): ActionRequest; declare function writeActionRequest(bc: bare.ByteCursor, x: ActionRequest): void; type StateRequest = { readonly id: uint; }; declare function readStateRequest(bc: bare.ByteCursor): StateRequest; declare function writeStateRequest(bc: bare.ByteCursor, x: StateRequest): void; type ConnectionsRequest = { readonly id: uint; }; declare function readConnectionsRequest(bc: bare.ByteCursor): ConnectionsRequest; declare function writeConnectionsRequest(bc: bare.ByteCursor, x: ConnectionsRequest): void; type RpcsListRequest = { readonly id: uint; }; declare function readRpcsListRequest(bc: bare.ByteCursor): RpcsListRequest; declare function writeRpcsListRequest(bc: bare.ByteCursor, x: RpcsListRequest): void; type TraceQueryRequest = { readonly id: uint; readonly startMs: uint; readonly endMs: uint; readonly limit: uint; }; declare function readTraceQueryRequest(bc: bare.ByteCursor): TraceQueryRequest; declare function writeTraceQueryRequest(bc: bare.ByteCursor, x: TraceQueryRequest): void; type QueueRequest = { readonly id: uint; readonly limit: uint; }; declare function readQueueRequest(bc: bare.ByteCursor): QueueRequest; declare function writeQueueRequest(bc: bare.ByteCursor, x: QueueRequest): void; type WorkflowHistoryRequest = { readonly id: uint; }; declare function readWorkflowHistoryRequest(bc: bare.ByteCursor): WorkflowHistoryRequest; declare function writeWorkflowHistoryRequest(bc: bare.ByteCursor, x: WorkflowHistoryRequest): void; type WorkflowReplayRequest = { readonly id: uint; readonly entryId: string | null; }; declare function readWorkflowReplayRequest(bc: bare.ByteCursor): WorkflowReplayRequest; declare function writeWorkflowReplayRequest(bc: bare.ByteCursor, x: WorkflowReplayRequest): void; type DatabaseSchemaRequest = { readonly id: uint; }; declare function readDatabaseSchemaRequest(bc: bare.ByteCursor): DatabaseSchemaRequest; declare function writeDatabaseSchemaRequest(bc: bare.ByteCursor, x: DatabaseSchemaRequest): void; type DatabaseTableRowsRequest = { readonly id: uint; readonly table: string; readonly limit: uint; readonly offset: uint; }; declare function readDatabaseTableRowsRequest(bc: bare.ByteCursor): DatabaseTableRowsRequest; declare function writeDatabaseTableRowsRequest(bc: bare.ByteCursor, x: DatabaseTableRowsRequest): void; type ToServerBody = { readonly tag: "PatchStateRequest"; readonly val: PatchStateRequest; } | { readonly tag: "StateRequest"; readonly val: StateRequest; } | { readonly tag: "ConnectionsRequest"; readonly val: ConnectionsRequest; } | { readonly tag: "ActionRequest"; readonly val: ActionRequest; } | { readonly tag: "RpcsListRequest"; readonly val: RpcsListRequest; } | { readonly tag: "TraceQueryRequest"; readonly val: TraceQueryRequest; } | { readonly tag: "QueueRequest"; readonly val: QueueRequest; } | { readonly tag: "WorkflowHistoryRequest"; readonly val: WorkflowHistoryRequest; } | { readonly tag: "WorkflowReplayRequest"; readonly val: WorkflowReplayRequest; } | { readonly tag: "DatabaseSchemaRequest"; readonly val: DatabaseSchemaRequest; } | { readonly tag: "DatabaseTableRowsRequest"; readonly val: DatabaseTableRowsRequest; }; declare function readToServerBody(bc: bare.ByteCursor): ToServerBody; declare function writeToServerBody(bc: bare.ByteCursor, x: ToServerBody): void; type ToServer = { readonly body: ToServerBody; }; declare function readToServer(bc: bare.ByteCursor): ToServer; declare function writeToServer(bc: bare.ByteCursor, x: ToServer): void; declare function encodeToServer(x: ToServer, config?: Partial): Uint8Array; declare function decodeToServer(bytes: Uint8Array): ToServer; type Connection = { readonly id: string; readonly details: ArrayBuffer; }; declare function readConnection(bc: bare.ByteCursor): Connection; declare function writeConnection(bc: bare.ByteCursor, x: Connection): void; /** * Inspector tab descriptor. `label`/`icon` are set for author-declared custom * tabs; a hidden built-in only carries `id` with `hidden` set. */ type TabConfigEntry = { readonly id: string; readonly label: string | null; readonly icon: string | null; readonly hidden: boolean; }; declare function readTabConfigEntry(bc: bare.ByteCursor): TabConfigEntry; declare function writeTabConfigEntry(bc: bare.ByteCursor, x: TabConfigEntry): void; type Init = { readonly connections: readonly Connection[]; readonly state: State | null; readonly isStateEnabled: boolean; readonly rpcs: readonly string[]; readonly isDatabaseEnabled: boolean; readonly queueSize: uint; readonly workflowHistory: WorkflowHistory | null; readonly isWorkflowEnabled: boolean; readonly tabConfig: readonly TabConfigEntry[]; }; declare function readInit(bc: bare.ByteCursor): Init; declare function writeInit(bc: bare.ByteCursor, x: Init): void; type ConnectionsResponse = { readonly rid: uint; readonly connections: readonly Connection[]; }; declare function readConnectionsResponse(bc: bare.ByteCursor): ConnectionsResponse; declare function writeConnectionsResponse(bc: bare.ByteCursor, x: ConnectionsResponse): void; type StateResponse = { readonly rid: uint; readonly state: State | null; readonly isStateEnabled: boolean; }; declare function readStateResponse(bc: bare.ByteCursor): StateResponse; declare function writeStateResponse(bc: bare.ByteCursor, x: StateResponse): void; type ActionResponse = { readonly rid: uint; readonly output: ArrayBuffer; }; declare function readActionResponse(bc: bare.ByteCursor): ActionResponse; declare function writeActionResponse(bc: bare.ByteCursor, x: ActionResponse): void; type TraceQueryResponse = { readonly rid: uint; readonly payload: ArrayBuffer; }; declare function readTraceQueryResponse(bc: bare.ByteCursor): TraceQueryResponse; declare function writeTraceQueryResponse(bc: bare.ByteCursor, x: TraceQueryResponse): void; type QueueMessageSummary = { readonly id: uint; readonly name: string; readonly createdAtMs: uint; }; declare function readQueueMessageSummary(bc: bare.ByteCursor): QueueMessageSummary; declare function writeQueueMessageSummary(bc: bare.ByteCursor, x: QueueMessageSummary): void; type QueueStatus = { readonly size: uint; readonly maxSize: uint; readonly messages: readonly QueueMessageSummary[]; readonly truncated: boolean; }; declare function readQueueStatus(bc: bare.ByteCursor): QueueStatus; declare function writeQueueStatus(bc: bare.ByteCursor, x: QueueStatus): void; type QueueResponse = { readonly rid: uint; readonly status: QueueStatus; }; declare function readQueueResponse(bc: bare.ByteCursor): QueueResponse; declare function writeQueueResponse(bc: bare.ByteCursor, x: QueueResponse): void; type WorkflowHistoryResponse = { readonly rid: uint; readonly history: WorkflowHistory | null; readonly isWorkflowEnabled: boolean; }; declare function readWorkflowHistoryResponse(bc: bare.ByteCursor): WorkflowHistoryResponse; declare function writeWorkflowHistoryResponse(bc: bare.ByteCursor, x: WorkflowHistoryResponse): void; type WorkflowReplayResponse = { readonly rid: uint; readonly history: WorkflowHistory | null; readonly isWorkflowEnabled: boolean; }; declare function readWorkflowReplayResponse(bc: bare.ByteCursor): WorkflowReplayResponse; declare function writeWorkflowReplayResponse(bc: bare.ByteCursor, x: WorkflowReplayResponse): void; type DatabaseSchemaResponse = { readonly rid: uint; readonly schema: ArrayBuffer; }; declare function readDatabaseSchemaResponse(bc: bare.ByteCursor): DatabaseSchemaResponse; declare function writeDatabaseSchemaResponse(bc: bare.ByteCursor, x: DatabaseSchemaResponse): void; type DatabaseTableRowsResponse = { readonly rid: uint; readonly result: ArrayBuffer; }; declare function readDatabaseTableRowsResponse(bc: bare.ByteCursor): DatabaseTableRowsResponse; declare function writeDatabaseTableRowsResponse(bc: bare.ByteCursor, x: DatabaseTableRowsResponse): void; type StateUpdated = { readonly state: State; }; declare function readStateUpdated(bc: bare.ByteCursor): StateUpdated; declare function writeStateUpdated(bc: bare.ByteCursor, x: StateUpdated): void; type QueueUpdated = { readonly queueSize: uint; }; declare function readQueueUpdated(bc: bare.ByteCursor): QueueUpdated; declare function writeQueueUpdated(bc: bare.ByteCursor, x: QueueUpdated): void; type WorkflowHistoryUpdated = { readonly history: WorkflowHistory; }; declare function readWorkflowHistoryUpdated(bc: bare.ByteCursor): WorkflowHistoryUpdated; declare function writeWorkflowHistoryUpdated(bc: bare.ByteCursor, x: WorkflowHistoryUpdated): void; type RpcsListResponse = { readonly rid: uint; readonly rpcs: readonly string[]; }; declare function readRpcsListResponse(bc: bare.ByteCursor): RpcsListResponse; declare function writeRpcsListResponse(bc: bare.ByteCursor, x: RpcsListResponse): void; type ConnectionsUpdated = { readonly connections: readonly Connection[]; }; declare function readConnectionsUpdated(bc: bare.ByteCursor): ConnectionsUpdated; declare function writeConnectionsUpdated(bc: bare.ByteCursor, x: ConnectionsUpdated): void; type Error = { readonly message: string; }; declare function readError(bc: bare.ByteCursor): Error; declare function writeError(bc: bare.ByteCursor, x: Error): void; type ToClientBody = { readonly tag: "StateResponse"; readonly val: StateResponse; } | { readonly tag: "ConnectionsResponse"; readonly val: ConnectionsResponse; } | { readonly tag: "ActionResponse"; readonly val: ActionResponse; } | { readonly tag: "ConnectionsUpdated"; readonly val: ConnectionsUpdated; } | { readonly tag: "QueueUpdated"; readonly val: QueueUpdated; } | { readonly tag: "StateUpdated"; readonly val: StateUpdated; } | { readonly tag: "WorkflowHistoryUpdated"; readonly val: WorkflowHistoryUpdated; } | { readonly tag: "RpcsListResponse"; readonly val: RpcsListResponse; } | { readonly tag: "TraceQueryResponse"; readonly val: TraceQueryResponse; } | { readonly tag: "QueueResponse"; readonly val: QueueResponse; } | { readonly tag: "WorkflowHistoryResponse"; readonly val: WorkflowHistoryResponse; } | { readonly tag: "WorkflowReplayResponse"; readonly val: WorkflowReplayResponse; } | { readonly tag: "Error"; readonly val: Error; } | { readonly tag: "Init"; readonly val: Init; } | { readonly tag: "DatabaseSchemaResponse"; readonly val: DatabaseSchemaResponse; } | { readonly tag: "DatabaseTableRowsResponse"; readonly val: DatabaseTableRowsResponse; }; declare function readToClientBody(bc: bare.ByteCursor): ToClientBody; declare function writeToClientBody(bc: bare.ByteCursor, x: ToClientBody): void; type ToClient = { readonly body: ToClientBody; }; declare function readToClient(bc: bare.ByteCursor): ToClient; declare function writeToClient(bc: bare.ByteCursor, x: ToClient): void; declare function encodeToClient(x: ToClient, config?: Partial): Uint8Array; declare function decodeToClient(bytes: Uint8Array): ToClient; type WorkflowInspectorAdapter = WorkflowInspectorAdapter$1; declare function createWorkflowInspectorAdapter(): { adapter: WorkflowInspectorAdapter; update: (snapshot: WorkflowHistorySnapshot) => void; setGetState: (fn: () => Promise) => void; setReplayFromStep: (fn: (entryId?: string) => Promise) => void; }; export { type ActionRequest, type ActionResponse, type Connection, type ConnectionsRequest, type ConnectionsResponse, type ConnectionsUpdated, type DatabaseSchemaRequest, type DatabaseSchemaResponse, type DatabaseTableRowsRequest, type DatabaseTableRowsResponse, type Error, type Init, type PatchStateRequest, type QueueMessageSummary, type QueueRequest, type QueueResponse, type QueueStatus, type QueueUpdated, type RpcsListRequest, type RpcsListResponse, type State, type StateRequest, type StateResponse, type StateUpdated, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowInspectorAdapter, type WorkflowReplayRequest, type WorkflowReplayResponse, createWorkflowInspectorAdapter, decodeToClient, decodeToServer, encodeToClient, encodeToServer, readActionRequest, readActionResponse, readConnection, readConnectionsRequest, readConnectionsResponse, readConnectionsUpdated, readDatabaseSchemaRequest, readDatabaseSchemaResponse, readDatabaseTableRowsRequest, readDatabaseTableRowsResponse, readError, readInit, readPatchStateRequest, readQueueMessageSummary, readQueueRequest, readQueueResponse, readQueueStatus, readQueueUpdated, readRpcsListRequest, readRpcsListResponse, readState, readStateRequest, readStateResponse, readStateUpdated, readTabConfigEntry, readToClient, readToClientBody, readToServer, readToServerBody, readTraceQueryRequest, readTraceQueryResponse, readWorkflowHistory, readWorkflowHistoryRequest, readWorkflowHistoryResponse, readWorkflowHistoryUpdated, readWorkflowReplayRequest, readWorkflowReplayResponse, type uint, writeActionRequest, writeActionResponse, writeConnection, writeConnectionsRequest, writeConnectionsResponse, writeConnectionsUpdated, writeDatabaseSchemaRequest, writeDatabaseSchemaResponse, writeDatabaseTableRowsRequest, writeDatabaseTableRowsResponse, writeError, writeInit, writePatchStateRequest, writeQueueMessageSummary, writeQueueRequest, writeQueueResponse, writeQueueStatus, writeQueueUpdated, writeRpcsListRequest, writeRpcsListResponse, writeState, writeStateRequest, writeStateResponse, writeStateUpdated, writeTabConfigEntry, writeToClient, writeToClientBody, writeToServer, writeToServerBody, writeTraceQueryRequest, writeTraceQueryResponse, writeWorkflowHistory, writeWorkflowHistoryRequest, writeWorkflowHistoryResponse, writeWorkflowHistoryUpdated, writeWorkflowReplayRequest, writeWorkflowReplayResponse };