import * as vbare from 'vbare'; import * as bare from '@rivetkit/bare-ts'; type u32 = number; type u64 = bigint; type WorkflowCbor = ArrayBuffer; type WorkflowNameIndex = u32; type WorkflowLoopIterationMarker = { readonly loop: WorkflowNameIndex; readonly iteration: u32; }; type WorkflowPathSegment = { readonly tag: "WorkflowNameIndex"; readonly val: WorkflowNameIndex; } | { readonly tag: "WorkflowLoopIterationMarker"; readonly val: WorkflowLoopIterationMarker; }; type WorkflowLocation = readonly WorkflowPathSegment[]; declare enum WorkflowEntryStatus { PENDING = "PENDING", RUNNING = "RUNNING", COMPLETED = "COMPLETED", FAILED = "FAILED", EXHAUSTED = "EXHAUSTED" } declare enum WorkflowSleepState { PENDING = "PENDING", COMPLETED = "COMPLETED", INTERRUPTED = "INTERRUPTED" } declare enum WorkflowBranchStatusType { PENDING = "PENDING", RUNNING = "RUNNING", COMPLETED = "COMPLETED", FAILED = "FAILED", CANCELLED = "CANCELLED" } type WorkflowStepEntry = { readonly output: WorkflowCbor | null; readonly error: string | null; }; type WorkflowLoopEntry = { readonly state: WorkflowCbor; readonly iteration: u32; readonly output: WorkflowCbor | null; }; type WorkflowSleepEntry = { readonly deadline: u64; readonly state: WorkflowSleepState; }; type WorkflowMessageEntry = { readonly name: string; readonly messageData: WorkflowCbor; }; type WorkflowRollbackCheckpointEntry = { readonly name: string; }; type WorkflowBranchStatus = { readonly status: WorkflowBranchStatusType; readonly output: WorkflowCbor | null; readonly error: string | null; }; type WorkflowJoinEntry = { readonly branches: ReadonlyMap; }; type WorkflowRaceEntry = { readonly winner: string | null; readonly branches: ReadonlyMap; }; type WorkflowRemovedEntry = { readonly originalType: string; readonly originalName: string | null; }; type WorkflowVersionCheckEntry = { readonly resolved: u32; readonly latest: u32; }; type WorkflowEntryKind = { readonly tag: "WorkflowStepEntry"; readonly val: WorkflowStepEntry; } | { readonly tag: "WorkflowLoopEntry"; readonly val: WorkflowLoopEntry; } | { readonly tag: "WorkflowSleepEntry"; readonly val: WorkflowSleepEntry; } | { readonly tag: "WorkflowMessageEntry"; readonly val: WorkflowMessageEntry; } | { readonly tag: "WorkflowRollbackCheckpointEntry"; readonly val: WorkflowRollbackCheckpointEntry; } | { readonly tag: "WorkflowJoinEntry"; readonly val: WorkflowJoinEntry; } | { readonly tag: "WorkflowRaceEntry"; readonly val: WorkflowRaceEntry; } | { readonly tag: "WorkflowRemovedEntry"; readonly val: WorkflowRemovedEntry; } | { readonly tag: "WorkflowVersionCheckEntry"; readonly val: WorkflowVersionCheckEntry; }; type WorkflowEntry = { readonly id: string; readonly location: WorkflowLocation; readonly kind: WorkflowEntryKind; }; type WorkflowEntryMetadata = { readonly status: WorkflowEntryStatus; readonly error: string | null; readonly attempts: u32; readonly lastAttemptAt: u64; readonly createdAt: u64; readonly completedAt: u64 | null; readonly rollbackCompletedAt: u64 | null; readonly rollbackError: string | null; }; type WorkflowHistory$1 = { readonly nameRegistry: readonly string[]; readonly entries: readonly WorkflowEntry[]; readonly entryMetadata: ReadonlyMap; }; declare const workflowHistoryBare: unique symbol; type WorkflowHistoryBytes = ArrayBuffer & { readonly [workflowHistoryBare]: true; }; declare function encodeWorkflowHistoryTransport(history: WorkflowHistory$1): WorkflowHistoryBytes; declare function decodeWorkflowHistoryTransport(data: ArrayBuffer | ArrayBufferView): WorkflowHistory$1; 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 SchedulesRequest = { readonly id: uint; }; declare function readSchedulesRequest(bc: bare.ByteCursor): SchedulesRequest; declare function writeSchedulesRequest(bc: bare.ByteCursor, x: SchedulesRequest): void; type ScheduleHistoryRequest = { readonly id: uint; readonly scheduleId: string; readonly limit: uint; }; declare function readScheduleHistoryRequest(bc: bare.ByteCursor): ScheduleHistoryRequest; declare function writeScheduleHistoryRequest(bc: bare.ByteCursor, x: ScheduleHistoryRequest): void; type ScheduleDeleteRequest = { readonly id: uint; readonly scheduleId: string; readonly kind: string; }; declare function readScheduleDeleteRequest(bc: bare.ByteCursor): ScheduleDeleteRequest; declare function writeScheduleDeleteRequest(bc: bare.ByteCursor, x: ScheduleDeleteRequest): 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; } | { readonly tag: "SchedulesRequest"; readonly val: SchedulesRequest; } | { readonly tag: "ScheduleHistoryRequest"; readonly val: ScheduleHistoryRequest; } | { readonly tag: "ScheduleDeleteRequest"; readonly val: ScheduleDeleteRequest; }; 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 Schedule = { readonly id: string; readonly name: string | null; readonly kind: string; readonly action: string; readonly args: ArrayBuffer; readonly nextRunAt: uint; readonly lastRunAt: uint | null; readonly expression: string | null; readonly timezone: string | null; readonly intervalMs: uint | null; readonly maxHistory: uint | null; }; declare function readSchedule(bc: bare.ByteCursor): Schedule; declare function writeSchedule(bc: bare.ByteCursor, x: Schedule): void; type ScheduleError = { readonly group: string; readonly code: string; readonly message: string; readonly metadata: ArrayBuffer | null; }; declare function readScheduleError(bc: bare.ByteCursor): ScheduleError; declare function writeScheduleError(bc: bare.ByteCursor, x: ScheduleError): void; type ScheduleFire = { readonly action: string; readonly scheduledAt: uint; readonly firedAt: uint; readonly finishedAt: uint | null; readonly result: string; readonly error: ScheduleError | null; }; declare function readScheduleFire(bc: bare.ByteCursor): ScheduleFire; declare function writeScheduleFire(bc: bare.ByteCursor, x: ScheduleFire): 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[]; readonly schedules: readonly Schedule[]; }; 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 SchedulesResponse = { readonly rid: uint; readonly schedules: readonly Schedule[]; }; declare function readSchedulesResponse(bc: bare.ByteCursor): SchedulesResponse; declare function writeSchedulesResponse(bc: bare.ByteCursor, x: SchedulesResponse): void; type ScheduleHistoryResponse = { readonly rid: uint; readonly scheduleId: string; readonly history: readonly ScheduleFire[]; }; declare function readScheduleHistoryResponse(bc: bare.ByteCursor): ScheduleHistoryResponse; declare function writeScheduleHistoryResponse(bc: bare.ByteCursor, x: ScheduleHistoryResponse): void; type ScheduleDeleteResponse = { readonly rid: uint; readonly scheduleId: string; readonly deleted: boolean; }; declare function readScheduleDeleteResponse(bc: bare.ByteCursor): ScheduleDeleteResponse; declare function writeScheduleDeleteResponse(bc: bare.ByteCursor, x: ScheduleDeleteResponse): 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 SchedulesUpdated = { readonly schedules: readonly Schedule[]; }; declare function readSchedulesUpdated(bc: bare.ByteCursor): SchedulesUpdated; declare function writeSchedulesUpdated(bc: bare.ByteCursor, x: SchedulesUpdated): 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: "SchedulesUpdated"; readonly val: SchedulesUpdated; } | { 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: "SchedulesResponse"; readonly val: SchedulesResponse; } | { readonly tag: "ScheduleHistoryResponse"; readonly val: ScheduleHistoryResponse; } | { readonly tag: "ScheduleDeleteResponse"; readonly val: ScheduleDeleteResponse; } | { 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; declare const CURRENT_VERSION = 6; declare const TO_SERVER_VERSIONED: vbare.VersionedDataHandler; declare const TO_CLIENT_VERSIONED: vbare.VersionedDataHandler; export { type ActionRequest, type ActionResponse, CURRENT_VERSION, 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 Schedule, type ScheduleDeleteRequest, type ScheduleDeleteResponse, type ScheduleError, type ScheduleFire, type ScheduleHistoryRequest, type ScheduleHistoryResponse, type SchedulesRequest, type SchedulesResponse, type SchedulesUpdated, type State, type StateRequest, type StateResponse, type StateUpdated, TO_CLIENT_VERSIONED, TO_SERVER_VERSIONED, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory$1 as TransportWorkflowHistory, type WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowReplayRequest, type WorkflowReplayResponse, decodeToClient, decodeToServer, decodeWorkflowHistoryTransport, encodeToClient, encodeToServer, encodeWorkflowHistoryTransport, readActionRequest, readActionResponse, readConnection, readConnectionsRequest, readConnectionsResponse, readConnectionsUpdated, readDatabaseSchemaRequest, readDatabaseSchemaResponse, readDatabaseTableRowsRequest, readDatabaseTableRowsResponse, readError, readInit, readPatchStateRequest, readQueueMessageSummary, readQueueRequest, readQueueResponse, readQueueStatus, readQueueUpdated, readRpcsListRequest, readRpcsListResponse, readSchedule, readScheduleDeleteRequest, readScheduleDeleteResponse, readScheduleError, readScheduleFire, readScheduleHistoryRequest, readScheduleHistoryResponse, readSchedulesRequest, readSchedulesResponse, readSchedulesUpdated, 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, writeSchedule, writeScheduleDeleteRequest, writeScheduleDeleteResponse, writeScheduleError, writeScheduleFire, writeScheduleHistoryRequest, writeScheduleHistoryResponse, writeSchedulesRequest, writeSchedulesResponse, writeSchedulesUpdated, writeState, writeStateRequest, writeStateResponse, writeStateUpdated, writeTabConfigEntry, writeToClient, writeToClientBody, writeToServer, writeToServerBody, writeTraceQueryRequest, writeTraceQueryResponse, writeWorkflowHistory, writeWorkflowHistoryRequest, writeWorkflowHistoryResponse, writeWorkflowHistoryUpdated, writeWorkflowReplayRequest, writeWorkflowReplayResponse };