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.
- package/dist/browser/client.d.ts +96 -14
- package/dist/browser/client.js +12 -2
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +139 -139
- package/dist/browser/inspector/client.js +12 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +146 -76
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +83 -9
- package/dist/tsup/agent-os/index.d.ts +83 -9
- package/dist/tsup/agent-os/index.js +146 -76
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-HOZ3ZLZ2.js → chunk-3ZR542SK.js} +6 -6
- package/dist/tsup/chunk-3ZR542SK.js.map +1 -0
- package/dist/tsup/{chunk-HNHLBM3Y.cjs → chunk-4KGXFC6M.cjs} +42 -5
- package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
- package/dist/tsup/chunk-5UYWLCRO.js +14 -0
- package/dist/tsup/chunk-5UYWLCRO.js.map +1 -0
- package/dist/tsup/{chunk-QWLJCP3X.js → chunk-6W5VGLFT.js} +42 -5
- package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
- package/dist/tsup/chunk-6WYATRS4.js +243 -0
- package/dist/tsup/chunk-6WYATRS4.js.map +1 -0
- package/dist/tsup/chunk-B3W74FBB.cjs +14 -0
- package/dist/tsup/chunk-B3W74FBB.cjs.map +1 -0
- package/dist/tsup/{chunk-XOOESJY7.js → chunk-FWROC5LA.js} +2 -2
- package/dist/tsup/{chunk-V5CVATRU.cjs → chunk-GLIPKKEC.cjs} +7 -7
- package/dist/tsup/{chunk-V5CVATRU.cjs.map → chunk-GLIPKKEC.cjs.map} +1 -1
- package/dist/tsup/{chunk-T5XVTVQY.cjs → chunk-GN2EUMEW.cjs} +3 -3
- package/dist/tsup/{chunk-T5XVTVQY.cjs.map → chunk-GN2EUMEW.cjs.map} +1 -1
- package/dist/tsup/{chunk-T56IZ42M.cjs → chunk-GU7ML3KE.cjs} +13 -3
- package/dist/tsup/chunk-GU7ML3KE.cjs.map +1 -0
- package/dist/tsup/{chunk-IOLZ3ONU.js → chunk-JQ2AZ5FN.js} +3 -3
- package/dist/tsup/{chunk-7AFZMFPQ.js → chunk-JTHHCZCZ.js} +10 -1
- package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
- package/dist/tsup/{chunk-UEULFXUI.cjs → chunk-KVFIONKQ.cjs} +11 -2
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
- package/dist/tsup/chunk-LWQFXGKS.cjs +243 -0
- package/dist/tsup/chunk-LWQFXGKS.cjs.map +1 -0
- package/dist/tsup/{chunk-QVCO6DTZ.js → chunk-MO2SSUOR.js} +8 -7
- package/dist/tsup/chunk-MO2SSUOR.js.map +1 -0
- package/dist/tsup/{chunk-LZ4TSBIP.js → chunk-OUENKQHB.js} +13 -3
- package/dist/tsup/chunk-OUENKQHB.js.map +1 -0
- package/dist/tsup/{chunk-6SBPWTXJ.cjs → chunk-PUZY2XCD.cjs} +10 -9
- package/dist/tsup/chunk-PUZY2XCD.cjs.map +1 -0
- package/dist/tsup/{chunk-C5TORAVP.js → chunk-QFJ24MBU.js} +27 -2
- package/dist/tsup/{chunk-C5TORAVP.js.map → chunk-QFJ24MBU.js.map} +1 -1
- package/dist/tsup/{chunk-BZWKY6WO.cjs → chunk-RXXDNJXB.cjs} +140 -140
- package/dist/tsup/{chunk-BZWKY6WO.cjs.map → chunk-RXXDNJXB.cjs.map} +1 -1
- package/dist/tsup/{chunk-IMRDHZM2.cjs → chunk-VBJQIBXI.cjs} +30 -5
- package/dist/tsup/chunk-VBJQIBXI.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +4 -3
- package/dist/tsup/client/mod.d.ts +4 -3
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-CZcjyT5B.d.ts → config-C4OSv0QP.d.ts} +92 -7
- package/dist/tsup/{config-rGWrumlO.d.cts → config-DTGoWdkG.d.cts} +92 -7
- package/dist/tsup/{config-BxOimoGX.d.cts → config-ey2I2zz5.d.cts} +46 -6
- package/dist/tsup/{config-BxOimoGX.d.ts → config-ey2I2zz5.d.ts} +46 -6
- package/dist/tsup/{context-B8W8E8nW.d.cts → context-C6cvDNyk.d.cts} +2 -2
- package/dist/tsup/{context-_UrDZhEh.d.ts → context-CMygeBxS.d.ts} +2 -2
- package/dist/tsup/db/drizzle.cjs +18 -10
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +5 -6
- package/dist/tsup/db/drizzle.d.ts +5 -6
- package/dist/tsup/db/drizzle.js +13 -5
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +5 -175
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.d.cts +11 -4
- package/dist/tsup/db/mod.d.ts +11 -4
- package/dist/tsup/db/mod.js +4 -174
- package/dist/tsup/db/mod.js.map +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +3 -2
- package/dist/tsup/dynamic/mod.d.ts +3 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -4
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +12 -146
- package/dist/tsup/inspector/mod.d.ts +12 -146
- package/dist/tsup/inspector/mod.js +4 -3
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector/workflow.cjs +21 -0
- package/dist/tsup/inspector/workflow.cjs.map +1 -0
- package/dist/tsup/inspector/workflow.d.cts +144 -0
- package/dist/tsup/inspector/workflow.d.ts +144 -0
- package/dist/tsup/inspector/workflow.js +21 -0
- package/dist/tsup/inspector/workflow.js.map +1 -0
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +4 -3
- package/dist/tsup/inspector-tab/mod.d.ts +4 -3
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +743 -247
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +6 -5
- package/dist/tsup/mod.d.ts +6 -5
- package/dist/tsup/mod.js +670 -174
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +3 -2
- package/dist/tsup/test/mod.d.ts +3 -2
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +89 -95
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -4
- package/dist/tsup/workflow/mod.d.ts +5 -4
- package/dist/tsup/workflow/mod.js +86 -92
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +19 -9
- package/src/actor/config.test.ts +65 -1
- package/src/actor/config.ts +169 -5
- package/src/actor/mod.ts +10 -1
- package/src/client/actor-common.ts +5 -14
- package/src/common/database/config.ts +50 -3
- package/src/common/database/mod.test.ts +142 -4
- package/src/common/database/mod.ts +210 -98
- package/src/common/database/native-database.ts +42 -3
- package/src/common/database/shared.ts +9 -0
- package/src/db/drizzle.test.ts +8 -1
- package/src/db/drizzle.ts +15 -4
- package/src/db/mod.ts +3 -0
- package/src/inspector/workflow.ts +61 -0
- package/src/registry/napi-runtime.ts +69 -1
- package/src/registry/native.ts +474 -161
- package/src/registry/run-handler-coordinator.test.ts +252 -0
- package/src/registry/run-handler-coordinator.ts +219 -0
- package/src/registry/runtime.ts +34 -1
- package/src/registry/wasm-runtime.ts +122 -17
- package/src/utils/node.ts +44 -28
- package/src/workflow/driver.ts +56 -58
- package/src/workflow/inspector.ts +10 -15
- package/src/workflow/mod.ts +48 -70
- package/dist/tsup/chunk-6SBPWTXJ.cjs.map +0 -1
- package/dist/tsup/chunk-7AFZMFPQ.js.map +0 -1
- package/dist/tsup/chunk-HNHLBM3Y.cjs.map +0 -1
- package/dist/tsup/chunk-HOZ3ZLZ2.js.map +0 -1
- package/dist/tsup/chunk-IMRDHZM2.cjs.map +0 -1
- package/dist/tsup/chunk-LZ4TSBIP.js.map +0 -1
- package/dist/tsup/chunk-QVCO6DTZ.js.map +0 -1
- package/dist/tsup/chunk-QWLJCP3X.js.map +0 -1
- package/dist/tsup/chunk-T56IZ42M.cjs.map +0 -1
- package/dist/tsup/chunk-UEULFXUI.cjs.map +0 -1
- /package/dist/tsup/{chunk-XOOESJY7.js.map → chunk-FWROC5LA.js.map} +0 -0
- /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 {
|
|
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
|
|
9
|
-
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory
|
|
10
|
-
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
9
|
-
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory
|
|
10
|
-
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
3
|
+
} from "../chunk-MO2SSUOR.js";
|
|
4
|
+
import "../chunk-5UYWLCRO.js";
|
|
4
5
|
import {
|
|
5
6
|
decodeWorkflowHistoryTransport,
|
|
6
7
|
encodeWorkflowHistoryTransport
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
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
|