rivetkit 2.3.11-rc.9 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/browser/client.d.ts +96 -14
  2. package/dist/browser/client.js +12 -2
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.d.ts +139 -139
  5. package/dist/browser/inspector/client.js +12 -2
  6. package/dist/browser/inspector/client.js.map +1 -1
  7. package/dist/tsup/agent-os/index.cjs +146 -76
  8. package/dist/tsup/agent-os/index.cjs.map +1 -1
  9. package/dist/tsup/agent-os/index.d.cts +83 -9
  10. package/dist/tsup/agent-os/index.d.ts +83 -9
  11. package/dist/tsup/agent-os/index.js +146 -76
  12. package/dist/tsup/agent-os/index.js.map +1 -1
  13. package/dist/tsup/{chunk-HOZ3ZLZ2.js → chunk-3ZR542SK.js} +6 -6
  14. package/dist/tsup/chunk-3ZR542SK.js.map +1 -0
  15. package/dist/tsup/{chunk-HNHLBM3Y.cjs → chunk-4KGXFC6M.cjs} +42 -5
  16. package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
  17. package/dist/tsup/chunk-5UYWLCRO.js +14 -0
  18. package/dist/tsup/chunk-5UYWLCRO.js.map +1 -0
  19. package/dist/tsup/{chunk-QWLJCP3X.js → chunk-6W5VGLFT.js} +42 -5
  20. package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
  21. package/dist/tsup/chunk-6WYATRS4.js +243 -0
  22. package/dist/tsup/chunk-6WYATRS4.js.map +1 -0
  23. package/dist/tsup/chunk-B3W74FBB.cjs +14 -0
  24. package/dist/tsup/chunk-B3W74FBB.cjs.map +1 -0
  25. package/dist/tsup/{chunk-XOOESJY7.js → chunk-FWROC5LA.js} +2 -2
  26. package/dist/tsup/{chunk-V5CVATRU.cjs → chunk-GLIPKKEC.cjs} +7 -7
  27. package/dist/tsup/{chunk-V5CVATRU.cjs.map → chunk-GLIPKKEC.cjs.map} +1 -1
  28. package/dist/tsup/{chunk-T5XVTVQY.cjs → chunk-GN2EUMEW.cjs} +3 -3
  29. package/dist/tsup/{chunk-T5XVTVQY.cjs.map → chunk-GN2EUMEW.cjs.map} +1 -1
  30. package/dist/tsup/{chunk-T56IZ42M.cjs → chunk-GU7ML3KE.cjs} +13 -3
  31. package/dist/tsup/chunk-GU7ML3KE.cjs.map +1 -0
  32. package/dist/tsup/{chunk-IOLZ3ONU.js → chunk-JQ2AZ5FN.js} +3 -3
  33. package/dist/tsup/{chunk-7AFZMFPQ.js → chunk-JTHHCZCZ.js} +10 -1
  34. package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
  35. package/dist/tsup/{chunk-UEULFXUI.cjs → chunk-KVFIONKQ.cjs} +11 -2
  36. package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
  37. package/dist/tsup/chunk-LWQFXGKS.cjs +243 -0
  38. package/dist/tsup/chunk-LWQFXGKS.cjs.map +1 -0
  39. package/dist/tsup/{chunk-QVCO6DTZ.js → chunk-MO2SSUOR.js} +8 -7
  40. package/dist/tsup/chunk-MO2SSUOR.js.map +1 -0
  41. package/dist/tsup/{chunk-LZ4TSBIP.js → chunk-OUENKQHB.js} +13 -3
  42. package/dist/tsup/chunk-OUENKQHB.js.map +1 -0
  43. package/dist/tsup/{chunk-6SBPWTXJ.cjs → chunk-PUZY2XCD.cjs} +10 -9
  44. package/dist/tsup/chunk-PUZY2XCD.cjs.map +1 -0
  45. package/dist/tsup/{chunk-C5TORAVP.js → chunk-QFJ24MBU.js} +27 -2
  46. package/dist/tsup/{chunk-C5TORAVP.js.map → chunk-QFJ24MBU.js.map} +1 -1
  47. package/dist/tsup/{chunk-BZWKY6WO.cjs → chunk-RXXDNJXB.cjs} +140 -140
  48. package/dist/tsup/{chunk-BZWKY6WO.cjs.map → chunk-RXXDNJXB.cjs.map} +1 -1
  49. package/dist/tsup/{chunk-IMRDHZM2.cjs → chunk-VBJQIBXI.cjs} +30 -5
  50. package/dist/tsup/chunk-VBJQIBXI.cjs.map +1 -0
  51. package/dist/tsup/client/mod.cjs +6 -6
  52. package/dist/tsup/client/mod.d.cts +4 -3
  53. package/dist/tsup/client/mod.d.ts +4 -3
  54. package/dist/tsup/client/mod.js +5 -5
  55. package/dist/tsup/common/log.cjs +2 -2
  56. package/dist/tsup/common/log.js +1 -1
  57. package/dist/tsup/common/websocket.cjs +3 -3
  58. package/dist/tsup/common/websocket.js +2 -2
  59. package/dist/tsup/{config-CZcjyT5B.d.ts → config-C4OSv0QP.d.ts} +92 -7
  60. package/dist/tsup/{config-rGWrumlO.d.cts → config-DTGoWdkG.d.cts} +92 -7
  61. package/dist/tsup/{config-BxOimoGX.d.cts → config-ey2I2zz5.d.cts} +46 -6
  62. package/dist/tsup/{config-BxOimoGX.d.ts → config-ey2I2zz5.d.ts} +46 -6
  63. package/dist/tsup/{context-B8W8E8nW.d.cts → context-C6cvDNyk.d.cts} +2 -2
  64. package/dist/tsup/{context-_UrDZhEh.d.ts → context-CMygeBxS.d.ts} +2 -2
  65. package/dist/tsup/db/drizzle.cjs +18 -10
  66. package/dist/tsup/db/drizzle.cjs.map +1 -1
  67. package/dist/tsup/db/drizzle.d.cts +5 -6
  68. package/dist/tsup/db/drizzle.d.ts +5 -6
  69. package/dist/tsup/db/drizzle.js +13 -5
  70. package/dist/tsup/db/drizzle.js.map +1 -1
  71. package/dist/tsup/db/mod.cjs +5 -175
  72. package/dist/tsup/db/mod.cjs.map +1 -1
  73. package/dist/tsup/db/mod.d.cts +11 -4
  74. package/dist/tsup/db/mod.d.ts +11 -4
  75. package/dist/tsup/db/mod.js +4 -174
  76. package/dist/tsup/db/mod.js.map +1 -1
  77. package/dist/tsup/dynamic/mod.cjs +2 -2
  78. package/dist/tsup/dynamic/mod.d.cts +3 -2
  79. package/dist/tsup/dynamic/mod.d.ts +3 -2
  80. package/dist/tsup/dynamic/mod.js +1 -1
  81. package/dist/tsup/inspector/mod.cjs +5 -4
  82. package/dist/tsup/inspector/mod.cjs.map +1 -1
  83. package/dist/tsup/inspector/mod.d.cts +12 -146
  84. package/dist/tsup/inspector/mod.d.ts +12 -146
  85. package/dist/tsup/inspector/mod.js +4 -3
  86. package/dist/tsup/inspector/mod.js.map +1 -1
  87. package/dist/tsup/inspector/workflow.cjs +21 -0
  88. package/dist/tsup/inspector/workflow.cjs.map +1 -0
  89. package/dist/tsup/inspector/workflow.d.cts +144 -0
  90. package/dist/tsup/inspector/workflow.d.ts +144 -0
  91. package/dist/tsup/inspector/workflow.js +21 -0
  92. package/dist/tsup/inspector/workflow.js.map +1 -0
  93. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  94. package/dist/tsup/inspector-tab/mod.d.cts +4 -3
  95. package/dist/tsup/inspector-tab/mod.d.ts +4 -3
  96. package/dist/tsup/inspector-tab/mod.js +1 -1
  97. package/dist/tsup/mod.cjs +743 -247
  98. package/dist/tsup/mod.cjs.map +1 -1
  99. package/dist/tsup/mod.d.cts +6 -5
  100. package/dist/tsup/mod.d.ts +6 -5
  101. package/dist/tsup/mod.js +670 -174
  102. package/dist/tsup/mod.js.map +1 -1
  103. package/dist/tsup/test/mod.cjs +7 -7
  104. package/dist/tsup/test/mod.d.cts +3 -2
  105. package/dist/tsup/test/mod.d.ts +3 -2
  106. package/dist/tsup/test/mod.js +5 -5
  107. package/dist/tsup/unstable/migrations.d.cts +1 -1
  108. package/dist/tsup/unstable/migrations.d.ts +1 -1
  109. package/dist/tsup/utils.cjs +2 -2
  110. package/dist/tsup/utils.js +1 -1
  111. package/dist/tsup/workflow/mod.cjs +89 -95
  112. package/dist/tsup/workflow/mod.cjs.map +1 -1
  113. package/dist/tsup/workflow/mod.d.cts +5 -4
  114. package/dist/tsup/workflow/mod.d.ts +5 -4
  115. package/dist/tsup/workflow/mod.js +86 -92
  116. package/dist/tsup/workflow/mod.js.map +1 -1
  117. package/package.json +19 -9
  118. package/src/actor/config.test.ts +65 -1
  119. package/src/actor/config.ts +169 -5
  120. package/src/actor/mod.ts +10 -1
  121. package/src/client/actor-common.ts +5 -14
  122. package/src/common/database/config.ts +50 -3
  123. package/src/common/database/mod.test.ts +142 -4
  124. package/src/common/database/mod.ts +210 -98
  125. package/src/common/database/native-database.ts +42 -3
  126. package/src/common/database/shared.ts +9 -0
  127. package/src/db/drizzle.test.ts +8 -1
  128. package/src/db/drizzle.ts +15 -4
  129. package/src/db/mod.ts +3 -0
  130. package/src/inspector/workflow.ts +61 -0
  131. package/src/registry/napi-runtime.ts +69 -1
  132. package/src/registry/native.ts +474 -161
  133. package/src/registry/run-handler-coordinator.test.ts +252 -0
  134. package/src/registry/run-handler-coordinator.ts +219 -0
  135. package/src/registry/runtime.ts +34 -1
  136. package/src/registry/wasm-runtime.ts +122 -17
  137. package/src/utils/node.ts +44 -28
  138. package/src/workflow/driver.ts +56 -58
  139. package/src/workflow/inspector.ts +10 -15
  140. package/src/workflow/mod.ts +48 -70
  141. package/dist/tsup/chunk-6SBPWTXJ.cjs.map +0 -1
  142. package/dist/tsup/chunk-7AFZMFPQ.js.map +0 -1
  143. package/dist/tsup/chunk-HNHLBM3Y.cjs.map +0 -1
  144. package/dist/tsup/chunk-HOZ3ZLZ2.js.map +0 -1
  145. package/dist/tsup/chunk-IMRDHZM2.cjs.map +0 -1
  146. package/dist/tsup/chunk-LZ4TSBIP.js.map +0 -1
  147. package/dist/tsup/chunk-QVCO6DTZ.js.map +0 -1
  148. package/dist/tsup/chunk-QWLJCP3X.js.map +0 -1
  149. package/dist/tsup/chunk-T56IZ42M.cjs.map +0 -1
  150. package/dist/tsup/chunk-UEULFXUI.cjs.map +0 -1
  151. /package/dist/tsup/{chunk-XOOESJY7.js.map → chunk-FWROC5LA.js.map} +0 -0
  152. /package/dist/tsup/{chunk-IOLZ3ONU.js.map → chunk-JQ2AZ5FN.js.map} +0 -0
@@ -1,13 +1,15 @@
1
1
  import * as bare from '@rivetkit/bare-ts';
2
- import { WorkflowState, WorkflowHistorySnapshot } from '@rivetkit/workflow-engine';
2
+ import { WorkflowInspectorAdapter as WorkflowInspectorAdapter$1, WorkflowHistoryBytes } from './workflow.cjs';
3
+ export { WorkflowHistory as TransportWorkflowHistory, decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport } from './workflow.cjs';
4
+ import { WorkflowHistorySnapshot, WorkflowState } from '@rivetkit/workflow-engine';
3
5
 
4
6
  type uint = bigint;
5
7
  type State = ArrayBuffer;
6
8
  declare function readState(bc: bare.ByteCursor): State;
7
9
  declare function writeState(bc: bare.ByteCursor, x: State): void;
8
- type WorkflowHistory$1 = ArrayBuffer;
9
- declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$1;
10
- declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$1): void;
10
+ type WorkflowHistory = ArrayBuffer;
11
+ declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory;
12
+ declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory): void;
11
13
  type PatchStateRequest = {
12
14
  readonly state: ArrayBuffer;
13
15
  };
@@ -141,7 +143,7 @@ type Init = {
141
143
  readonly rpcs: readonly string[];
142
144
  readonly isDatabaseEnabled: boolean;
143
145
  readonly queueSize: uint;
144
- readonly workflowHistory: WorkflowHistory$1 | null;
146
+ readonly workflowHistory: WorkflowHistory | null;
145
147
  readonly isWorkflowEnabled: boolean;
146
148
  readonly tabConfig: readonly TabConfigEntry[];
147
149
  };
@@ -195,14 +197,14 @@ declare function readQueueResponse(bc: bare.ByteCursor): QueueResponse;
195
197
  declare function writeQueueResponse(bc: bare.ByteCursor, x: QueueResponse): void;
196
198
  type WorkflowHistoryResponse = {
197
199
  readonly rid: uint;
198
- readonly history: WorkflowHistory$1 | null;
200
+ readonly history: WorkflowHistory | null;
199
201
  readonly isWorkflowEnabled: boolean;
200
202
  };
201
203
  declare function readWorkflowHistoryResponse(bc: bare.ByteCursor): WorkflowHistoryResponse;
202
204
  declare function writeWorkflowHistoryResponse(bc: bare.ByteCursor, x: WorkflowHistoryResponse): void;
203
205
  type WorkflowReplayResponse = {
204
206
  readonly rid: uint;
205
- readonly history: WorkflowHistory$1 | null;
207
+ readonly history: WorkflowHistory | null;
206
208
  readonly isWorkflowEnabled: boolean;
207
209
  };
208
210
  declare function readWorkflowReplayResponse(bc: bare.ByteCursor): WorkflowReplayResponse;
@@ -230,7 +232,7 @@ type QueueUpdated = {
230
232
  declare function readQueueUpdated(bc: bare.ByteCursor): QueueUpdated;
231
233
  declare function writeQueueUpdated(bc: bare.ByteCursor, x: QueueUpdated): void;
232
234
  type WorkflowHistoryUpdated = {
233
- readonly history: WorkflowHistory$1;
235
+ readonly history: WorkflowHistory;
234
236
  };
235
237
  declare function readWorkflowHistoryUpdated(bc: bare.ByteCursor): WorkflowHistoryUpdated;
236
238
  declare function writeWorkflowHistoryUpdated(bc: bare.ByteCursor, x: WorkflowHistoryUpdated): void;
@@ -309,143 +311,7 @@ declare function writeToClient(bc: bare.ByteCursor, x: ToClient): void;
309
311
  declare function encodeToClient(x: ToClient, config?: Partial<bare.Config>): Uint8Array;
310
312
  declare function decodeToClient(bytes: Uint8Array): ToClient;
311
313
 
312
- type u32 = number;
313
- type u64 = bigint;
314
- type WorkflowCbor = ArrayBuffer;
315
- type WorkflowNameIndex = u32;
316
- type WorkflowLoopIterationMarker = {
317
- readonly loop: WorkflowNameIndex;
318
- readonly iteration: u32;
319
- };
320
- type WorkflowPathSegment = {
321
- readonly tag: "WorkflowNameIndex";
322
- readonly val: WorkflowNameIndex;
323
- } | {
324
- readonly tag: "WorkflowLoopIterationMarker";
325
- readonly val: WorkflowLoopIterationMarker;
326
- };
327
- type WorkflowLocation = readonly WorkflowPathSegment[];
328
- declare enum WorkflowEntryStatus {
329
- PENDING = "PENDING",
330
- RUNNING = "RUNNING",
331
- COMPLETED = "COMPLETED",
332
- FAILED = "FAILED",
333
- EXHAUSTED = "EXHAUSTED"
334
- }
335
- declare enum WorkflowSleepState {
336
- PENDING = "PENDING",
337
- COMPLETED = "COMPLETED",
338
- INTERRUPTED = "INTERRUPTED"
339
- }
340
- declare enum WorkflowBranchStatusType {
341
- PENDING = "PENDING",
342
- RUNNING = "RUNNING",
343
- COMPLETED = "COMPLETED",
344
- FAILED = "FAILED",
345
- CANCELLED = "CANCELLED"
346
- }
347
- type WorkflowStepEntry = {
348
- readonly output: WorkflowCbor | null;
349
- readonly error: string | null;
350
- };
351
- type WorkflowLoopEntry = {
352
- readonly state: WorkflowCbor;
353
- readonly iteration: u32;
354
- readonly output: WorkflowCbor | null;
355
- };
356
- type WorkflowSleepEntry = {
357
- readonly deadline: u64;
358
- readonly state: WorkflowSleepState;
359
- };
360
- type WorkflowMessageEntry = {
361
- readonly name: string;
362
- readonly messageData: WorkflowCbor;
363
- };
364
- type WorkflowRollbackCheckpointEntry = {
365
- readonly name: string;
366
- };
367
- type WorkflowBranchStatus = {
368
- readonly status: WorkflowBranchStatusType;
369
- readonly output: WorkflowCbor | null;
370
- readonly error: string | null;
371
- };
372
- type WorkflowJoinEntry = {
373
- readonly branches: ReadonlyMap<string, WorkflowBranchStatus>;
374
- };
375
- type WorkflowRaceEntry = {
376
- readonly winner: string | null;
377
- readonly branches: ReadonlyMap<string, WorkflowBranchStatus>;
378
- };
379
- type WorkflowRemovedEntry = {
380
- readonly originalType: string;
381
- readonly originalName: string | null;
382
- };
383
- type WorkflowVersionCheckEntry = {
384
- readonly resolved: u32;
385
- readonly latest: u32;
386
- };
387
- type WorkflowEntryKind = {
388
- readonly tag: "WorkflowStepEntry";
389
- readonly val: WorkflowStepEntry;
390
- } | {
391
- readonly tag: "WorkflowLoopEntry";
392
- readonly val: WorkflowLoopEntry;
393
- } | {
394
- readonly tag: "WorkflowSleepEntry";
395
- readonly val: WorkflowSleepEntry;
396
- } | {
397
- readonly tag: "WorkflowMessageEntry";
398
- readonly val: WorkflowMessageEntry;
399
- } | {
400
- readonly tag: "WorkflowRollbackCheckpointEntry";
401
- readonly val: WorkflowRollbackCheckpointEntry;
402
- } | {
403
- readonly tag: "WorkflowJoinEntry";
404
- readonly val: WorkflowJoinEntry;
405
- } | {
406
- readonly tag: "WorkflowRaceEntry";
407
- readonly val: WorkflowRaceEntry;
408
- } | {
409
- readonly tag: "WorkflowRemovedEntry";
410
- readonly val: WorkflowRemovedEntry;
411
- } | {
412
- readonly tag: "WorkflowVersionCheckEntry";
413
- readonly val: WorkflowVersionCheckEntry;
414
- };
415
- type WorkflowEntry = {
416
- readonly id: string;
417
- readonly location: WorkflowLocation;
418
- readonly kind: WorkflowEntryKind;
419
- };
420
- type WorkflowEntryMetadata = {
421
- readonly status: WorkflowEntryStatus;
422
- readonly error: string | null;
423
- readonly attempts: u32;
424
- readonly lastAttemptAt: u64;
425
- readonly createdAt: u64;
426
- readonly completedAt: u64 | null;
427
- readonly rollbackCompletedAt: u64 | null;
428
- readonly rollbackError: string | null;
429
- };
430
- type WorkflowHistory = {
431
- readonly nameRegistry: readonly string[];
432
- readonly entries: readonly WorkflowEntry[];
433
- readonly entryMetadata: ReadonlyMap<string, WorkflowEntryMetadata>;
434
- };
435
-
436
- declare const workflowHistoryBare: unique symbol;
437
- type WorkflowHistoryBytes = ArrayBuffer & {
438
- readonly [workflowHistoryBare]: true;
439
- };
440
- declare function encodeWorkflowHistoryTransport(history: WorkflowHistory): WorkflowHistoryBytes;
441
- declare function decodeWorkflowHistoryTransport(data: ArrayBuffer | ArrayBufferView): WorkflowHistory;
442
-
443
- interface WorkflowInspectorAdapter {
444
- getHistory: () => WorkflowHistoryBytes | null;
445
- getState: () => Promise<WorkflowState | null>;
446
- onHistoryUpdated: (listener: (history: WorkflowHistoryBytes) => void) => () => void;
447
- replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
448
- }
314
+ type WorkflowInspectorAdapter = WorkflowInspectorAdapter$1;
449
315
  declare function createWorkflowInspectorAdapter(): {
450
316
  adapter: WorkflowInspectorAdapter;
451
317
  update: (snapshot: WorkflowHistorySnapshot) => void;
@@ -453,4 +319,4 @@ declare function createWorkflowInspectorAdapter(): {
453
319
  setReplayFromStep: (fn: (entryId?: string) => Promise<WorkflowHistoryBytes | null>) => void;
454
320
  };
455
321
 
456
- 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 as TransportWorkflowHistory, type WorkflowHistory$1 as WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowInspectorAdapter, type WorkflowReplayRequest, type WorkflowReplayResponse, createWorkflowInspectorAdapter, 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, 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 };
322
+ 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 };
@@ -1,13 +1,15 @@
1
1
  import * as bare from '@rivetkit/bare-ts';
2
- import { WorkflowState, WorkflowHistorySnapshot } from '@rivetkit/workflow-engine';
2
+ import { WorkflowInspectorAdapter as WorkflowInspectorAdapter$1, WorkflowHistoryBytes } from './workflow.js';
3
+ export { WorkflowHistory as TransportWorkflowHistory, decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport } from './workflow.js';
4
+ import { WorkflowHistorySnapshot, WorkflowState } from '@rivetkit/workflow-engine';
3
5
 
4
6
  type uint = bigint;
5
7
  type State = ArrayBuffer;
6
8
  declare function readState(bc: bare.ByteCursor): State;
7
9
  declare function writeState(bc: bare.ByteCursor, x: State): void;
8
- type WorkflowHistory$1 = ArrayBuffer;
9
- declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$1;
10
- declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$1): void;
10
+ type WorkflowHistory = ArrayBuffer;
11
+ declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory;
12
+ declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory): void;
11
13
  type PatchStateRequest = {
12
14
  readonly state: ArrayBuffer;
13
15
  };
@@ -141,7 +143,7 @@ type Init = {
141
143
  readonly rpcs: readonly string[];
142
144
  readonly isDatabaseEnabled: boolean;
143
145
  readonly queueSize: uint;
144
- readonly workflowHistory: WorkflowHistory$1 | null;
146
+ readonly workflowHistory: WorkflowHistory | null;
145
147
  readonly isWorkflowEnabled: boolean;
146
148
  readonly tabConfig: readonly TabConfigEntry[];
147
149
  };
@@ -195,14 +197,14 @@ declare function readQueueResponse(bc: bare.ByteCursor): QueueResponse;
195
197
  declare function writeQueueResponse(bc: bare.ByteCursor, x: QueueResponse): void;
196
198
  type WorkflowHistoryResponse = {
197
199
  readonly rid: uint;
198
- readonly history: WorkflowHistory$1 | null;
200
+ readonly history: WorkflowHistory | null;
199
201
  readonly isWorkflowEnabled: boolean;
200
202
  };
201
203
  declare function readWorkflowHistoryResponse(bc: bare.ByteCursor): WorkflowHistoryResponse;
202
204
  declare function writeWorkflowHistoryResponse(bc: bare.ByteCursor, x: WorkflowHistoryResponse): void;
203
205
  type WorkflowReplayResponse = {
204
206
  readonly rid: uint;
205
- readonly history: WorkflowHistory$1 | null;
207
+ readonly history: WorkflowHistory | null;
206
208
  readonly isWorkflowEnabled: boolean;
207
209
  };
208
210
  declare function readWorkflowReplayResponse(bc: bare.ByteCursor): WorkflowReplayResponse;
@@ -230,7 +232,7 @@ type QueueUpdated = {
230
232
  declare function readQueueUpdated(bc: bare.ByteCursor): QueueUpdated;
231
233
  declare function writeQueueUpdated(bc: bare.ByteCursor, x: QueueUpdated): void;
232
234
  type WorkflowHistoryUpdated = {
233
- readonly history: WorkflowHistory$1;
235
+ readonly history: WorkflowHistory;
234
236
  };
235
237
  declare function readWorkflowHistoryUpdated(bc: bare.ByteCursor): WorkflowHistoryUpdated;
236
238
  declare function writeWorkflowHistoryUpdated(bc: bare.ByteCursor, x: WorkflowHistoryUpdated): void;
@@ -309,143 +311,7 @@ declare function writeToClient(bc: bare.ByteCursor, x: ToClient): void;
309
311
  declare function encodeToClient(x: ToClient, config?: Partial<bare.Config>): Uint8Array;
310
312
  declare function decodeToClient(bytes: Uint8Array): ToClient;
311
313
 
312
- type u32 = number;
313
- type u64 = bigint;
314
- type WorkflowCbor = ArrayBuffer;
315
- type WorkflowNameIndex = u32;
316
- type WorkflowLoopIterationMarker = {
317
- readonly loop: WorkflowNameIndex;
318
- readonly iteration: u32;
319
- };
320
- type WorkflowPathSegment = {
321
- readonly tag: "WorkflowNameIndex";
322
- readonly val: WorkflowNameIndex;
323
- } | {
324
- readonly tag: "WorkflowLoopIterationMarker";
325
- readonly val: WorkflowLoopIterationMarker;
326
- };
327
- type WorkflowLocation = readonly WorkflowPathSegment[];
328
- declare enum WorkflowEntryStatus {
329
- PENDING = "PENDING",
330
- RUNNING = "RUNNING",
331
- COMPLETED = "COMPLETED",
332
- FAILED = "FAILED",
333
- EXHAUSTED = "EXHAUSTED"
334
- }
335
- declare enum WorkflowSleepState {
336
- PENDING = "PENDING",
337
- COMPLETED = "COMPLETED",
338
- INTERRUPTED = "INTERRUPTED"
339
- }
340
- declare enum WorkflowBranchStatusType {
341
- PENDING = "PENDING",
342
- RUNNING = "RUNNING",
343
- COMPLETED = "COMPLETED",
344
- FAILED = "FAILED",
345
- CANCELLED = "CANCELLED"
346
- }
347
- type WorkflowStepEntry = {
348
- readonly output: WorkflowCbor | null;
349
- readonly error: string | null;
350
- };
351
- type WorkflowLoopEntry = {
352
- readonly state: WorkflowCbor;
353
- readonly iteration: u32;
354
- readonly output: WorkflowCbor | null;
355
- };
356
- type WorkflowSleepEntry = {
357
- readonly deadline: u64;
358
- readonly state: WorkflowSleepState;
359
- };
360
- type WorkflowMessageEntry = {
361
- readonly name: string;
362
- readonly messageData: WorkflowCbor;
363
- };
364
- type WorkflowRollbackCheckpointEntry = {
365
- readonly name: string;
366
- };
367
- type WorkflowBranchStatus = {
368
- readonly status: WorkflowBranchStatusType;
369
- readonly output: WorkflowCbor | null;
370
- readonly error: string | null;
371
- };
372
- type WorkflowJoinEntry = {
373
- readonly branches: ReadonlyMap<string, WorkflowBranchStatus>;
374
- };
375
- type WorkflowRaceEntry = {
376
- readonly winner: string | null;
377
- readonly branches: ReadonlyMap<string, WorkflowBranchStatus>;
378
- };
379
- type WorkflowRemovedEntry = {
380
- readonly originalType: string;
381
- readonly originalName: string | null;
382
- };
383
- type WorkflowVersionCheckEntry = {
384
- readonly resolved: u32;
385
- readonly latest: u32;
386
- };
387
- type WorkflowEntryKind = {
388
- readonly tag: "WorkflowStepEntry";
389
- readonly val: WorkflowStepEntry;
390
- } | {
391
- readonly tag: "WorkflowLoopEntry";
392
- readonly val: WorkflowLoopEntry;
393
- } | {
394
- readonly tag: "WorkflowSleepEntry";
395
- readonly val: WorkflowSleepEntry;
396
- } | {
397
- readonly tag: "WorkflowMessageEntry";
398
- readonly val: WorkflowMessageEntry;
399
- } | {
400
- readonly tag: "WorkflowRollbackCheckpointEntry";
401
- readonly val: WorkflowRollbackCheckpointEntry;
402
- } | {
403
- readonly tag: "WorkflowJoinEntry";
404
- readonly val: WorkflowJoinEntry;
405
- } | {
406
- readonly tag: "WorkflowRaceEntry";
407
- readonly val: WorkflowRaceEntry;
408
- } | {
409
- readonly tag: "WorkflowRemovedEntry";
410
- readonly val: WorkflowRemovedEntry;
411
- } | {
412
- readonly tag: "WorkflowVersionCheckEntry";
413
- readonly val: WorkflowVersionCheckEntry;
414
- };
415
- type WorkflowEntry = {
416
- readonly id: string;
417
- readonly location: WorkflowLocation;
418
- readonly kind: WorkflowEntryKind;
419
- };
420
- type WorkflowEntryMetadata = {
421
- readonly status: WorkflowEntryStatus;
422
- readonly error: string | null;
423
- readonly attempts: u32;
424
- readonly lastAttemptAt: u64;
425
- readonly createdAt: u64;
426
- readonly completedAt: u64 | null;
427
- readonly rollbackCompletedAt: u64 | null;
428
- readonly rollbackError: string | null;
429
- };
430
- type WorkflowHistory = {
431
- readonly nameRegistry: readonly string[];
432
- readonly entries: readonly WorkflowEntry[];
433
- readonly entryMetadata: ReadonlyMap<string, WorkflowEntryMetadata>;
434
- };
435
-
436
- declare const workflowHistoryBare: unique symbol;
437
- type WorkflowHistoryBytes = ArrayBuffer & {
438
- readonly [workflowHistoryBare]: true;
439
- };
440
- declare function encodeWorkflowHistoryTransport(history: WorkflowHistory): WorkflowHistoryBytes;
441
- declare function decodeWorkflowHistoryTransport(data: ArrayBuffer | ArrayBufferView): WorkflowHistory;
442
-
443
- interface WorkflowInspectorAdapter {
444
- getHistory: () => WorkflowHistoryBytes | null;
445
- getState: () => Promise<WorkflowState | null>;
446
- onHistoryUpdated: (listener: (history: WorkflowHistoryBytes) => void) => () => void;
447
- replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
448
- }
314
+ type WorkflowInspectorAdapter = WorkflowInspectorAdapter$1;
449
315
  declare function createWorkflowInspectorAdapter(): {
450
316
  adapter: WorkflowInspectorAdapter;
451
317
  update: (snapshot: WorkflowHistorySnapshot) => void;
@@ -453,4 +319,4 @@ declare function createWorkflowInspectorAdapter(): {
453
319
  setReplayFromStep: (fn: (entryId?: string) => Promise<WorkflowHistoryBytes | null>) => void;
454
320
  };
455
321
 
456
- 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 as TransportWorkflowHistory, type WorkflowHistory$1 as WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowInspectorAdapter, type WorkflowReplayRequest, type WorkflowReplayResponse, createWorkflowInspectorAdapter, 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, 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 };
322
+ 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 };
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-QVCO6DTZ.js";
3
+ } from "../chunk-MO2SSUOR.js";
4
+ import "../chunk-5UYWLCRO.js";
4
5
  import {
5
6
  decodeWorkflowHistoryTransport,
6
7
  encodeWorkflowHistoryTransport
7
- } from "../chunk-C5TORAVP.js";
8
- import "../chunk-LZ4TSBIP.js";
8
+ } from "../chunk-QFJ24MBU.js";
9
+ import "../chunk-OUENKQHB.js";
9
10
  import "../chunk-ZZ3WBRPD.js";
10
11
 
11
12
  // src/common/bare/generated/inspector/v5.ts