rivetkit 2.3.0 → 2.3.1

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 (120) hide show
  1. package/dist/browser/client.d.ts +19 -6
  2. package/dist/browser/client.js +4 -4
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +4 -4
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/actor/errors.cjs +4 -2
  7. package/dist/tsup/actor/errors.cjs.map +1 -1
  8. package/dist/tsup/actor/errors.d.cts +1 -1
  9. package/dist/tsup/actor/errors.d.ts +1 -1
  10. package/dist/tsup/actor/errors.js +3 -1
  11. package/dist/tsup/agent-os/index.cjs +4 -4
  12. package/dist/tsup/agent-os/index.cjs.map +1 -1
  13. package/dist/tsup/agent-os/index.d.cts +18 -5
  14. package/dist/tsup/agent-os/index.d.ts +18 -5
  15. package/dist/tsup/agent-os/index.js +4 -4
  16. package/dist/tsup/agent-os/index.js.map +1 -1
  17. package/dist/tsup/{chunk-NIY3RSPX.cjs → chunk-3MHDOUD7.cjs} +11 -2
  18. package/dist/tsup/chunk-3MHDOUD7.cjs.map +1 -0
  19. package/dist/tsup/{chunk-KORQB2IR.cjs → chunk-4FC7TVS6.cjs} +6 -2
  20. package/dist/tsup/chunk-4FC7TVS6.cjs.map +1 -0
  21. package/dist/tsup/{chunk-47HHIEXH.cjs → chunk-4UUEB43Y.cjs} +4 -4
  22. package/dist/tsup/{chunk-47HHIEXH.cjs.map → chunk-4UUEB43Y.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-7QKCIVAY.cjs → chunk-5IWLUJ6W.cjs} +167 -167
  24. package/dist/tsup/{chunk-7QKCIVAY.cjs.map → chunk-5IWLUJ6W.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-P2GNQ4RN.js → chunk-H6VVZMWN.js} +4 -4
  26. package/dist/tsup/{chunk-MEHBWPLJ.js → chunk-I35VSLEM.js} +3 -3
  27. package/dist/tsup/{chunk-BEI24WTI.js → chunk-JBUZRPY5.js} +2 -2
  28. package/dist/tsup/{chunk-B6VUNZUD.cjs → chunk-JLJJZYCJ.cjs} +10 -10
  29. package/dist/tsup/{chunk-B6VUNZUD.cjs.map → chunk-JLJJZYCJ.cjs.map} +1 -1
  30. package/dist/tsup/{chunk-VTTFNQQI.js → chunk-L2X3YFER.js} +31 -6
  31. package/dist/tsup/chunk-L2X3YFER.js.map +1 -0
  32. package/dist/tsup/{chunk-DXXJPH55.cjs → chunk-MNHKOS6L.cjs} +39 -14
  33. package/dist/tsup/chunk-MNHKOS6L.cjs.map +1 -0
  34. package/dist/tsup/{chunk-UMZVD6DQ.js → chunk-NERUIBOT.js} +2 -2
  35. package/dist/tsup/{chunk-I4LN3FNT.cjs → chunk-OST76LRW.cjs} +7 -7
  36. package/dist/tsup/{chunk-I4LN3FNT.cjs.map → chunk-OST76LRW.cjs.map} +1 -1
  37. package/dist/tsup/{chunk-LVTBW2RE.cjs → chunk-OZBCXBVP.cjs} +3 -3
  38. package/dist/tsup/{chunk-LVTBW2RE.cjs.map → chunk-OZBCXBVP.cjs.map} +1 -1
  39. package/dist/tsup/{chunk-4JDSFJS5.js → chunk-PT6OIW5E.js} +5 -5
  40. package/dist/tsup/{chunk-2OTRTA3J.js → chunk-R6KPN5EW.js} +2 -2
  41. package/dist/tsup/{chunk-3677IIOV.cjs → chunk-V5KMAMX3.cjs} +5 -5
  42. package/dist/tsup/{chunk-3677IIOV.cjs.map → chunk-V5KMAMX3.cjs.map} +1 -1
  43. package/dist/tsup/{chunk-DPIMKYNB.js → chunk-XIX5DOZN.js} +10 -1
  44. package/dist/tsup/chunk-XIX5DOZN.js.map +1 -0
  45. package/dist/tsup/{chunk-BRP62GZC.js → chunk-ZZ3WBRPD.js} +5 -1
  46. package/dist/tsup/chunk-ZZ3WBRPD.js.map +1 -0
  47. package/dist/tsup/client/mod.cjs +7 -7
  48. package/dist/tsup/client/mod.d.cts +3 -3
  49. package/dist/tsup/client/mod.d.ts +3 -3
  50. package/dist/tsup/client/mod.js +6 -6
  51. package/dist/tsup/common/log.cjs +3 -3
  52. package/dist/tsup/common/log.js +2 -2
  53. package/dist/tsup/common/websocket.cjs +4 -4
  54. package/dist/tsup/common/websocket.js +3 -3
  55. package/dist/tsup/{config-CZQQ-mso.d.cts → config-CzvopP5m.d.cts} +22 -7
  56. package/dist/tsup/{config-BxWAw3iH.d.ts → config-DZuT7tcp.d.ts} +22 -7
  57. package/dist/tsup/context-CyAdY-aA.d.ts +128 -0
  58. package/dist/tsup/context-sNB28g0N.d.cts +128 -0
  59. package/dist/tsup/dynamic/mod.cjs +2 -2
  60. package/dist/tsup/dynamic/mod.d.cts +2 -2
  61. package/dist/tsup/dynamic/mod.d.ts +2 -2
  62. package/dist/tsup/dynamic/mod.js +1 -1
  63. package/dist/tsup/inspector/mod.cjs +6 -6
  64. package/dist/tsup/inspector/mod.js +5 -5
  65. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  66. package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
  67. package/dist/tsup/inspector-tab/mod.d.cts +3 -3
  68. package/dist/tsup/inspector-tab/mod.d.ts +3 -3
  69. package/dist/tsup/inspector-tab/mod.js +1 -1
  70. package/dist/tsup/inspector-tab/mod.js.map +1 -1
  71. package/dist/tsup/mod.cjs +292 -276
  72. package/dist/tsup/mod.cjs.map +1 -1
  73. package/dist/tsup/mod.d.cts +4 -4
  74. package/dist/tsup/mod.d.ts +4 -4
  75. package/dist/tsup/mod.js +202 -186
  76. package/dist/tsup/mod.js.map +1 -1
  77. package/dist/tsup/test/mod.cjs +10 -10
  78. package/dist/tsup/test/mod.d.cts +2 -2
  79. package/dist/tsup/test/mod.d.ts +2 -2
  80. package/dist/tsup/test/mod.js +6 -6
  81. package/dist/tsup/{utils-DQosb24I.d.ts → utils-CqDnC_PS.d.cts} +2 -1
  82. package/dist/tsup/{utils-DQosb24I.d.cts → utils-CqDnC_PS.d.ts} +2 -1
  83. package/dist/tsup/utils.cjs +3 -3
  84. package/dist/tsup/utils.d.cts +1 -1
  85. package/dist/tsup/utils.d.ts +1 -1
  86. package/dist/tsup/utils.js +2 -2
  87. package/dist/tsup/workflow/mod.cjs +184 -148
  88. package/dist/tsup/workflow/mod.cjs.map +1 -1
  89. package/dist/tsup/workflow/mod.d.cts +6 -6
  90. package/dist/tsup/workflow/mod.d.ts +6 -6
  91. package/dist/tsup/workflow/mod.js +177 -141
  92. package/dist/tsup/workflow/mod.js.map +1 -1
  93. package/package.json +11 -11
  94. package/src/actor/config.ts +14 -0
  95. package/src/actor/errors.ts +11 -0
  96. package/src/inspector-tab/mod.ts +1 -1
  97. package/src/registry/index.ts +74 -18
  98. package/src/registry/napi-runtime.ts +16 -0
  99. package/src/registry/native.ts +79 -30
  100. package/src/registry/runtime.ts +11 -0
  101. package/src/registry/wasm-runtime.ts +11 -0
  102. package/src/utils/env-vars.ts +31 -0
  103. package/src/workflow/context.ts +675 -244
  104. package/src/workflow/driver.ts +20 -7
  105. package/src/workflow/mod.ts +25 -9
  106. package/dist/tsup/chunk-BRP62GZC.js.map +0 -1
  107. package/dist/tsup/chunk-DPIMKYNB.js.map +0 -1
  108. package/dist/tsup/chunk-DXXJPH55.cjs.map +0 -1
  109. package/dist/tsup/chunk-KORQB2IR.cjs.map +0 -1
  110. package/dist/tsup/chunk-NIY3RSPX.cjs.map +0 -1
  111. package/dist/tsup/chunk-VTTFNQQI.js.map +0 -1
  112. package/dist/tsup/context-Bw7xq8w3.d.cts +0 -92
  113. package/dist/tsup/context-D8QA76sV.d.ts +0 -92
  114. package/src/utils/serve.ts +0 -216
  115. /package/dist/tsup/{chunk-P2GNQ4RN.js.map → chunk-H6VVZMWN.js.map} +0 -0
  116. /package/dist/tsup/{chunk-MEHBWPLJ.js.map → chunk-I35VSLEM.js.map} +0 -0
  117. /package/dist/tsup/{chunk-BEI24WTI.js.map → chunk-JBUZRPY5.js.map} +0 -0
  118. /package/dist/tsup/{chunk-UMZVD6DQ.js.map → chunk-NERUIBOT.js.map} +0 -0
  119. /package/dist/tsup/{chunk-4JDSFJS5.js.map → chunk-PT6OIW5E.js.map} +0 -0
  120. /package/dist/tsup/{chunk-2OTRTA3J.js.map → chunk-R6KPN5EW.js.map} +0 -0
@@ -0,0 +1,128 @@
1
+ import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, w as ActorLogger, al as QueueFilterName, aq as QueueNextOptions, ar as QueueResultMessageForName, ap as QueueNextBatchOptions, ax as Registry, _ as Client, bu as InferEventArgs, bv as InferSchemaMap } from './config-DZuT7tcp.js';
2
+ import { WorkflowContextInterface, StepConfig, TryStepResult, TryStepConfig, TryBlockResult, TryBlockConfig, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
3
+ import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.js';
4
+
5
+ type WorkflowActorQueueNextOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextOptions<TName, TCompletable>, "signal">;
6
+ type WorkflowActorQueueNextOptionsFallback<TCompletable extends boolean> = Omit<QueueNextOptions<string, TCompletable>, "signal">;
7
+ type WorkflowActorQueueNextBatchOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextBatchOptions<TName, TCompletable>, "signal">;
8
+ type WorkflowActorQueueNextBatchOptionsFallback<TCompletable extends boolean> = Omit<QueueNextBatchOptions<string, TCompletable>, "signal">;
9
+ type WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (step: WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<T>;
10
+ type WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (step: WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, output: T) => Promise<void>;
11
+ type WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<T>;
12
+ type WorkflowStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<StepConfig<T>, "run" | "rollback"> & {
13
+ run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
14
+ rollback?: WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
15
+ };
16
+ type WorkflowTryStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<TryStepConfig<T>, "run" | "rollback"> & {
17
+ run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
18
+ rollback?: WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
19
+ };
20
+ type WorkflowTryConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<TryBlockConfig<T>, "run"> & {
21
+ run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
22
+ };
23
+ type WorkflowLoopConfig<S, T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<LoopConfig<S, T>, "run"> & {
24
+ run: (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, state: S) => Promise<LoopResult<S, T> | (S extends undefined ? undefined | void : never)>;
25
+ };
26
+ type WorkflowBranchConfig<TOutput, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
27
+ run: WorkflowContextRun<TOutput, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
28
+ };
29
+ declare const DEACTIVATE_STEP: unique symbol;
30
+ /**
31
+ * The context handed to a workflow step (`step` / `tryStep` callbacks). This is
32
+ * the only scope where actor data (state, vars, db, client) and side effects
33
+ * (broadcast, queue.send) are reachable. It is valid only while its step is
34
+ * executing; using it after the step resolves throws.
35
+ */
36
+ declare class WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
37
+ #private;
38
+ constructor(runCtx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, onGuardViolation: () => void);
39
+ [DEACTIVATE_STEP](): void;
40
+ get actorId(): string;
41
+ get name(): string;
42
+ get key(): string[];
43
+ get log(): ActorLogger;
44
+ get abortSignal(): AbortSignal;
45
+ get state(): TState extends never ? never : TState;
46
+ get vars(): TVars extends never ? never : TVars;
47
+ get db(): TDatabase extends never ? never : InferDatabaseClient<TDatabase>;
48
+ client<R extends Registry<any> = Registry<any>>(): Client<R>;
49
+ broadcast<K extends keyof TEvents & string>(name: K, ...args: InferEventArgs<InferSchemaMap<TEvents>[K]>): void;
50
+ broadcast(name: keyof TEvents extends never ? string : never, ...args: Array<unknown>): void;
51
+ get queue(): {
52
+ send: {
53
+ <K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K]): Promise<void>;
54
+ (name: keyof TQueues extends never ? string : never, body: unknown): Promise<void>;
55
+ };
56
+ };
57
+ /**
58
+ * Holds the actor awake for the duration of the provided promise. The actor
59
+ * cannot idle-sleep or finalize the sleep grace period until the promise
60
+ * settles.
61
+ */
62
+ keepAwake<T>(promise: Promise<T>): Promise<T>;
63
+ /**
64
+ * Registers a promise that the sleep grace period will wait on. Use this for
65
+ * best-effort flush/cleanup work that may complete inside the grace window.
66
+ */
67
+ waitUntil(promise: Promise<void>): void;
68
+ destroy(): void;
69
+ }
70
+ /**
71
+ * The context handed to the workflow function and to orchestration callbacks
72
+ * (`try` / `loop` / `race` / `join`). It exposes the deterministic, replayable
73
+ * workflow primitives (step, sleep, queue waits, control flow). It deliberately
74
+ * does NOT expose actor data; reach `state`, `db`, `vars`, `client`, and
75
+ * `broadcast` through the step context passed to `step` / `tryStep`.
76
+ */
77
+ declare class WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
78
+ #private;
79
+ constructor(inner: WorkflowContextInterface, runCtx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>);
80
+ get workflowId(): string;
81
+ get abortSignal(): AbortSignal;
82
+ get actorId(): string;
83
+ get name(): string;
84
+ get key(): string[];
85
+ get log(): ActorLogger;
86
+ get queue(): {
87
+ next: {
88
+ <const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextOptions<TName, TCompletable>): Promise<QueueResultMessageForName<TQueues, TName, TCompletable>>;
89
+ <const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextOptionsFallback<TCompletable>): Promise<QueueResultMessageForName<TQueues, QueueFilterName<TQueues>, TCompletable>>;
90
+ };
91
+ nextBatch: {
92
+ <const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextBatchOptions<TName, TCompletable>): Promise<Array<QueueResultMessageForName<TQueues, TName, TCompletable>>>;
93
+ <const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextBatchOptionsFallback<TCompletable>): Promise<Array<QueueResultMessageForName<TQueues, QueueFilterName<TQueues>, TCompletable>>>;
94
+ };
95
+ };
96
+ step<T>(name: string, run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
97
+ step<T>(config: WorkflowStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
98
+ tryStep<T>(name: string, run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryStepResult<T>>;
99
+ tryStep<T>(config: WorkflowTryStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryStepResult<T>>;
100
+ try<T>(name: string, run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryBlockResult<T>>;
101
+ try<T>(config: WorkflowTryConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryBlockResult<T>>;
102
+ loop<T>(name: string, run: (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<LoopResult<undefined, T> | undefined | void>): Promise<T>;
103
+ loop<S, T>(config: WorkflowLoopConfig<S, T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
104
+ sleep(name: string, durationMs: number): Promise<void>;
105
+ sleepUntil(name: string, timestampMs: number): Promise<void>;
106
+ rollbackCheckpoint(name: string): Promise<void>;
107
+ join<T extends Record<string, WorkflowBranchConfig<unknown, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>>(name: string, branches: T): Promise<{
108
+ [K in keyof T]: Awaited<ReturnType<T[K]["run"]>>;
109
+ }>;
110
+ join<T extends Record<string, BranchConfig<unknown>>>(name: string, branches: T): Promise<{
111
+ [K in keyof T]: BranchOutput<T[K]>;
112
+ }>;
113
+ race<T>(name: string, branches: Array<{
114
+ name: string;
115
+ run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
116
+ }>): Promise<{
117
+ winner: string;
118
+ value: T;
119
+ }>;
120
+ removed(name: string, originalType: EntryKindType): Promise<void>;
121
+ isEvicted(): boolean;
122
+ }
123
+ type WorkflowContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WorkflowContext<S, CP, CS, V, I, DB, E, Q> : never;
124
+ type WorkflowLoopContextOf<AD extends AnyActorDefinition> = WorkflowContextOf<AD>;
125
+ type WorkflowBranchContextOf<AD extends AnyActorDefinition> = WorkflowContextOf<AD>;
126
+ type WorkflowStepContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WorkflowStepContext<S, CP, CS, V, I, DB, E, Q> : never;
127
+
128
+ export { type WorkflowBranchContextOf as W, type WorkflowContextOf as a, type WorkflowLoopContextOf as b, type WorkflowStepContextOf as c, WorkflowContext as d, type WorkflowBranchConfig as e, type WorkflowLoopConfig as f, type WorkflowStepConfig as g, WorkflowStepContext as h, type WorkflowTryConfig as i, type WorkflowTryStepConfig as j };
@@ -0,0 +1,128 @@
1
+ import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, w as ActorLogger, al as QueueFilterName, aq as QueueNextOptions, ar as QueueResultMessageForName, ap as QueueNextBatchOptions, ax as Registry, _ as Client, bu as InferEventArgs, bv as InferSchemaMap } from './config-CzvopP5m.cjs';
2
+ import { WorkflowContextInterface, StepConfig, TryStepResult, TryStepConfig, TryBlockResult, TryBlockConfig, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
3
+ import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.cjs';
4
+
5
+ type WorkflowActorQueueNextOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextOptions<TName, TCompletable>, "signal">;
6
+ type WorkflowActorQueueNextOptionsFallback<TCompletable extends boolean> = Omit<QueueNextOptions<string, TCompletable>, "signal">;
7
+ type WorkflowActorQueueNextBatchOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextBatchOptions<TName, TCompletable>, "signal">;
8
+ type WorkflowActorQueueNextBatchOptionsFallback<TCompletable extends boolean> = Omit<QueueNextBatchOptions<string, TCompletable>, "signal">;
9
+ type WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (step: WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<T>;
10
+ type WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (step: WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, output: T) => Promise<void>;
11
+ type WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<T>;
12
+ type WorkflowStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<StepConfig<T>, "run" | "rollback"> & {
13
+ run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
14
+ rollback?: WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
15
+ };
16
+ type WorkflowTryStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<TryStepConfig<T>, "run" | "rollback"> & {
17
+ run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
18
+ rollback?: WorkflowStepRollback<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
19
+ };
20
+ type WorkflowTryConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<TryBlockConfig<T>, "run"> & {
21
+ run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
22
+ };
23
+ type WorkflowLoopConfig<S, T, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = Omit<LoopConfig<S, T>, "run"> & {
24
+ run: (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, state: S) => Promise<LoopResult<S, T> | (S extends undefined ? undefined | void : never)>;
25
+ };
26
+ type WorkflowBranchConfig<TOutput, TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
27
+ run: WorkflowContextRun<TOutput, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
28
+ };
29
+ declare const DEACTIVATE_STEP: unique symbol;
30
+ /**
31
+ * The context handed to a workflow step (`step` / `tryStep` callbacks). This is
32
+ * the only scope where actor data (state, vars, db, client) and side effects
33
+ * (broadcast, queue.send) are reachable. It is valid only while its step is
34
+ * executing; using it after the step resolves throws.
35
+ */
36
+ declare class WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
37
+ #private;
38
+ constructor(runCtx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, onGuardViolation: () => void);
39
+ [DEACTIVATE_STEP](): void;
40
+ get actorId(): string;
41
+ get name(): string;
42
+ get key(): string[];
43
+ get log(): ActorLogger;
44
+ get abortSignal(): AbortSignal;
45
+ get state(): TState extends never ? never : TState;
46
+ get vars(): TVars extends never ? never : TVars;
47
+ get db(): TDatabase extends never ? never : InferDatabaseClient<TDatabase>;
48
+ client<R extends Registry<any> = Registry<any>>(): Client<R>;
49
+ broadcast<K extends keyof TEvents & string>(name: K, ...args: InferEventArgs<InferSchemaMap<TEvents>[K]>): void;
50
+ broadcast(name: keyof TEvents extends never ? string : never, ...args: Array<unknown>): void;
51
+ get queue(): {
52
+ send: {
53
+ <K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K]): Promise<void>;
54
+ (name: keyof TQueues extends never ? string : never, body: unknown): Promise<void>;
55
+ };
56
+ };
57
+ /**
58
+ * Holds the actor awake for the duration of the provided promise. The actor
59
+ * cannot idle-sleep or finalize the sleep grace period until the promise
60
+ * settles.
61
+ */
62
+ keepAwake<T>(promise: Promise<T>): Promise<T>;
63
+ /**
64
+ * Registers a promise that the sleep grace period will wait on. Use this for
65
+ * best-effort flush/cleanup work that may complete inside the grace window.
66
+ */
67
+ waitUntil(promise: Promise<void>): void;
68
+ destroy(): void;
69
+ }
70
+ /**
71
+ * The context handed to the workflow function and to orchestration callbacks
72
+ * (`try` / `loop` / `race` / `join`). It exposes the deterministic, replayable
73
+ * workflow primitives (step, sleep, queue waits, control flow). It deliberately
74
+ * does NOT expose actor data; reach `state`, `db`, `vars`, `client`, and
75
+ * `broadcast` through the step context passed to `step` / `tryStep`.
76
+ */
77
+ declare class WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
78
+ #private;
79
+ constructor(inner: WorkflowContextInterface, runCtx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>);
80
+ get workflowId(): string;
81
+ get abortSignal(): AbortSignal;
82
+ get actorId(): string;
83
+ get name(): string;
84
+ get key(): string[];
85
+ get log(): ActorLogger;
86
+ get queue(): {
87
+ next: {
88
+ <const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextOptions<TName, TCompletable>): Promise<QueueResultMessageForName<TQueues, TName, TCompletable>>;
89
+ <const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextOptionsFallback<TCompletable>): Promise<QueueResultMessageForName<TQueues, QueueFilterName<TQueues>, TCompletable>>;
90
+ };
91
+ nextBatch: {
92
+ <const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextBatchOptions<TName, TCompletable>): Promise<Array<QueueResultMessageForName<TQueues, TName, TCompletable>>>;
93
+ <const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextBatchOptionsFallback<TCompletable>): Promise<Array<QueueResultMessageForName<TQueues, QueueFilterName<TQueues>, TCompletable>>>;
94
+ };
95
+ };
96
+ step<T>(name: string, run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
97
+ step<T>(config: WorkflowStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
98
+ tryStep<T>(name: string, run: WorkflowStepRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryStepResult<T>>;
99
+ tryStep<T>(config: WorkflowTryStepConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryStepResult<T>>;
100
+ try<T>(name: string, run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryBlockResult<T>>;
101
+ try<T>(config: WorkflowTryConfig<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<TryBlockResult<T>>;
102
+ loop<T>(name: string, run: (ctx: WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => Promise<LoopResult<undefined, T> | undefined | void>): Promise<T>;
103
+ loop<S, T>(config: WorkflowLoopConfig<S, T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>): Promise<T>;
104
+ sleep(name: string, durationMs: number): Promise<void>;
105
+ sleepUntil(name: string, timestampMs: number): Promise<void>;
106
+ rollbackCheckpoint(name: string): Promise<void>;
107
+ join<T extends Record<string, WorkflowBranchConfig<unknown, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>>(name: string, branches: T): Promise<{
108
+ [K in keyof T]: Awaited<ReturnType<T[K]["run"]>>;
109
+ }>;
110
+ join<T extends Record<string, BranchConfig<unknown>>>(name: string, branches: T): Promise<{
111
+ [K in keyof T]: BranchOutput<T[K]>;
112
+ }>;
113
+ race<T>(name: string, branches: Array<{
114
+ name: string;
115
+ run: WorkflowContextRun<T, TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
116
+ }>): Promise<{
117
+ winner: string;
118
+ value: T;
119
+ }>;
120
+ removed(name: string, originalType: EntryKindType): Promise<void>;
121
+ isEvicted(): boolean;
122
+ }
123
+ type WorkflowContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WorkflowContext<S, CP, CS, V, I, DB, E, Q> : never;
124
+ type WorkflowLoopContextOf<AD extends AnyActorDefinition> = WorkflowContextOf<AD>;
125
+ type WorkflowBranchContextOf<AD extends AnyActorDefinition> = WorkflowContextOf<AD>;
126
+ type WorkflowStepContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WorkflowStepContext<S, CP, CS, V, I, DB, E, Q> : never;
127
+
128
+ export { type WorkflowBranchContextOf as W, type WorkflowContextOf as a, type WorkflowLoopContextOf as b, type WorkflowStepContextOf as c, WorkflowContext as d, type WorkflowBranchConfig as e, type WorkflowLoopConfig as f, type WorkflowStepConfig as g, WorkflowStepContext as h, type WorkflowTryConfig as i, type WorkflowTryStepConfig as j };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
3
+ var _chunk3MHDOUD7cjs = require('../chunk-3MHDOUD7.cjs');
4
4
 
5
5
  // src/dynamic/internal.ts
6
6
  var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
@@ -9,7 +9,7 @@ var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
9
9
 
10
10
  // src/dynamic/mod.ts
11
11
  function dynamicActor(input) {
12
- const config = _chunkNIY3RSPXcjs.ActorConfigSchema.parse({
12
+ const config = _chunk3MHDOUD7cjs.ActorConfigSchema.parse({
13
13
  actions: {}
14
14
  });
15
15
  return {
@@ -1,4 +1,4 @@
1
- import { A as AnyActorDefinition } from '../config-CZQQ-mso.cjs';
1
+ import { A as AnyActorDefinition } from '../config-CzvopP5m.cjs';
2
2
  import 'zod/v4';
3
3
  import '../config-D49x8NpL.cjs';
4
4
  import '@rivetkit/rivetkit-wasm';
@@ -8,7 +8,7 @@ import '@rivetkit/virtual-websocket';
8
8
  import '@standard-schema/spec';
9
9
  import 'hono';
10
10
  import '../utils.cjs';
11
- import '../utils-DQosb24I.cjs';
11
+ import '../utils-CqDnC_PS.cjs';
12
12
  import 'hono/utils/http-status';
13
13
 
14
14
  declare const DYNAMIC_ACTOR_DEFINITION_SYMBOL: unique symbol;
@@ -1,4 +1,4 @@
1
- import { A as AnyActorDefinition } from '../config-BxWAw3iH.js';
1
+ import { A as AnyActorDefinition } from '../config-DZuT7tcp.js';
2
2
  import 'zod/v4';
3
3
  import '../config-D49x8NpL.js';
4
4
  import '@rivetkit/rivetkit-wasm';
@@ -8,7 +8,7 @@ import '@rivetkit/virtual-websocket';
8
8
  import '@standard-schema/spec';
9
9
  import 'hono';
10
10
  import '../utils.js';
11
- import '../utils-DQosb24I.js';
11
+ import '../utils-CqDnC_PS.js';
12
12
  import 'hono/utils/http-status';
13
13
 
14
14
  declare const DYNAMIC_ACTOR_DEFINITION_SYMBOL: unique symbol;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ActorConfigSchema
3
- } from "../chunk-DPIMKYNB.js";
3
+ } from "../chunk-XIX5DOZN.js";
4
4
 
5
5
  // src/dynamic/internal.ts
6
6
  var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
- var _chunkB6VUNZUDcjs = require('../chunk-B6VUNZUD.cjs');
3
+ var _chunkJLJJZYCJcjs = require('../chunk-JLJJZYCJ.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunk47HHIEXHcjs = require('../chunk-47HHIEXH.cjs');
8
- require('../chunk-3677IIOV.cjs');
9
- require('../chunk-DXXJPH55.cjs');
10
- require('../chunk-KORQB2IR.cjs');
7
+ var _chunk4UUEB43Ycjs = require('../chunk-4UUEB43Y.cjs');
8
+ require('../chunk-V5KMAMX3.cjs');
9
+ require('../chunk-MNHKOS6L.cjs');
10
+ require('../chunk-4FC7TVS6.cjs');
11
11
 
12
12
  // src/common/bare/generated/inspector/v4.ts
13
13
  var _barets = require('@rivetkit/bare-ts'); var bare = _interopRequireWildcard(_barets);
@@ -761,5 +761,5 @@ function decodeToClient(bytes) {
761
761
 
762
762
 
763
763
 
764
- exports.createWorkflowInspectorAdapter = _chunkB6VUNZUDcjs.createWorkflowInspectorAdapter; exports.decodeToClient = decodeToClient; exports.decodeToServer = decodeToServer; exports.decodeWorkflowHistoryTransport = _chunk47HHIEXHcjs.decodeWorkflowHistoryTransport; exports.encodeToClient = encodeToClient; exports.encodeToServer = encodeToServer; exports.encodeWorkflowHistoryTransport = _chunk47HHIEXHcjs.encodeWorkflowHistoryTransport; exports.readActionRequest = readActionRequest; exports.readActionResponse = readActionResponse; exports.readConnection = readConnection; exports.readConnectionsRequest = readConnectionsRequest; exports.readConnectionsResponse = readConnectionsResponse; exports.readConnectionsUpdated = readConnectionsUpdated; exports.readDatabaseSchemaRequest = readDatabaseSchemaRequest; exports.readDatabaseSchemaResponse = readDatabaseSchemaResponse; exports.readDatabaseTableRowsRequest = readDatabaseTableRowsRequest; exports.readDatabaseTableRowsResponse = readDatabaseTableRowsResponse; exports.readError = readError; exports.readInit = readInit; exports.readPatchStateRequest = readPatchStateRequest; exports.readQueueMessageSummary = readQueueMessageSummary; exports.readQueueRequest = readQueueRequest; exports.readQueueResponse = readQueueResponse; exports.readQueueStatus = readQueueStatus; exports.readQueueUpdated = readQueueUpdated; exports.readRpcsListRequest = readRpcsListRequest; exports.readRpcsListResponse = readRpcsListResponse; exports.readState = readState; exports.readStateRequest = readStateRequest; exports.readStateResponse = readStateResponse; exports.readStateUpdated = readStateUpdated; exports.readToClient = readToClient; exports.readToClientBody = readToClientBody; exports.readToServer = readToServer; exports.readToServerBody = readToServerBody; exports.readTraceQueryRequest = readTraceQueryRequest; exports.readTraceQueryResponse = readTraceQueryResponse; exports.readWorkflowHistory = readWorkflowHistory; exports.readWorkflowHistoryRequest = readWorkflowHistoryRequest; exports.readWorkflowHistoryResponse = readWorkflowHistoryResponse; exports.readWorkflowHistoryUpdated = readWorkflowHistoryUpdated; exports.readWorkflowReplayRequest = readWorkflowReplayRequest; exports.readWorkflowReplayResponse = readWorkflowReplayResponse; exports.writeActionRequest = writeActionRequest; exports.writeActionResponse = writeActionResponse; exports.writeConnection = writeConnection; exports.writeConnectionsRequest = writeConnectionsRequest; exports.writeConnectionsResponse = writeConnectionsResponse; exports.writeConnectionsUpdated = writeConnectionsUpdated; exports.writeDatabaseSchemaRequest = writeDatabaseSchemaRequest; exports.writeDatabaseSchemaResponse = writeDatabaseSchemaResponse; exports.writeDatabaseTableRowsRequest = writeDatabaseTableRowsRequest; exports.writeDatabaseTableRowsResponse = writeDatabaseTableRowsResponse; exports.writeError = writeError; exports.writeInit = writeInit; exports.writePatchStateRequest = writePatchStateRequest; exports.writeQueueMessageSummary = writeQueueMessageSummary; exports.writeQueueRequest = writeQueueRequest; exports.writeQueueResponse = writeQueueResponse; exports.writeQueueStatus = writeQueueStatus; exports.writeQueueUpdated = writeQueueUpdated; exports.writeRpcsListRequest = writeRpcsListRequest; exports.writeRpcsListResponse = writeRpcsListResponse; exports.writeState = writeState; exports.writeStateRequest = writeStateRequest; exports.writeStateResponse = writeStateResponse; exports.writeStateUpdated = writeStateUpdated; exports.writeToClient = writeToClient; exports.writeToClientBody = writeToClientBody; exports.writeToServer = writeToServer; exports.writeToServerBody = writeToServerBody; exports.writeTraceQueryRequest = writeTraceQueryRequest; exports.writeTraceQueryResponse = writeTraceQueryResponse; exports.writeWorkflowHistory = writeWorkflowHistory; exports.writeWorkflowHistoryRequest = writeWorkflowHistoryRequest; exports.writeWorkflowHistoryResponse = writeWorkflowHistoryResponse; exports.writeWorkflowHistoryUpdated = writeWorkflowHistoryUpdated; exports.writeWorkflowReplayRequest = writeWorkflowReplayRequest; exports.writeWorkflowReplayResponse = writeWorkflowReplayResponse;
764
+ exports.createWorkflowInspectorAdapter = _chunkJLJJZYCJcjs.createWorkflowInspectorAdapter; exports.decodeToClient = decodeToClient; exports.decodeToServer = decodeToServer; exports.decodeWorkflowHistoryTransport = _chunk4UUEB43Ycjs.decodeWorkflowHistoryTransport; exports.encodeToClient = encodeToClient; exports.encodeToServer = encodeToServer; exports.encodeWorkflowHistoryTransport = _chunk4UUEB43Ycjs.encodeWorkflowHistoryTransport; exports.readActionRequest = readActionRequest; exports.readActionResponse = readActionResponse; exports.readConnection = readConnection; exports.readConnectionsRequest = readConnectionsRequest; exports.readConnectionsResponse = readConnectionsResponse; exports.readConnectionsUpdated = readConnectionsUpdated; exports.readDatabaseSchemaRequest = readDatabaseSchemaRequest; exports.readDatabaseSchemaResponse = readDatabaseSchemaResponse; exports.readDatabaseTableRowsRequest = readDatabaseTableRowsRequest; exports.readDatabaseTableRowsResponse = readDatabaseTableRowsResponse; exports.readError = readError; exports.readInit = readInit; exports.readPatchStateRequest = readPatchStateRequest; exports.readQueueMessageSummary = readQueueMessageSummary; exports.readQueueRequest = readQueueRequest; exports.readQueueResponse = readQueueResponse; exports.readQueueStatus = readQueueStatus; exports.readQueueUpdated = readQueueUpdated; exports.readRpcsListRequest = readRpcsListRequest; exports.readRpcsListResponse = readRpcsListResponse; exports.readState = readState; exports.readStateRequest = readStateRequest; exports.readStateResponse = readStateResponse; exports.readStateUpdated = readStateUpdated; exports.readToClient = readToClient; exports.readToClientBody = readToClientBody; exports.readToServer = readToServer; exports.readToServerBody = readToServerBody; exports.readTraceQueryRequest = readTraceQueryRequest; exports.readTraceQueryResponse = readTraceQueryResponse; exports.readWorkflowHistory = readWorkflowHistory; exports.readWorkflowHistoryRequest = readWorkflowHistoryRequest; exports.readWorkflowHistoryResponse = readWorkflowHistoryResponse; exports.readWorkflowHistoryUpdated = readWorkflowHistoryUpdated; exports.readWorkflowReplayRequest = readWorkflowReplayRequest; exports.readWorkflowReplayResponse = readWorkflowReplayResponse; exports.writeActionRequest = writeActionRequest; exports.writeActionResponse = writeActionResponse; exports.writeConnection = writeConnection; exports.writeConnectionsRequest = writeConnectionsRequest; exports.writeConnectionsResponse = writeConnectionsResponse; exports.writeConnectionsUpdated = writeConnectionsUpdated; exports.writeDatabaseSchemaRequest = writeDatabaseSchemaRequest; exports.writeDatabaseSchemaResponse = writeDatabaseSchemaResponse; exports.writeDatabaseTableRowsRequest = writeDatabaseTableRowsRequest; exports.writeDatabaseTableRowsResponse = writeDatabaseTableRowsResponse; exports.writeError = writeError; exports.writeInit = writeInit; exports.writePatchStateRequest = writePatchStateRequest; exports.writeQueueMessageSummary = writeQueueMessageSummary; exports.writeQueueRequest = writeQueueRequest; exports.writeQueueResponse = writeQueueResponse; exports.writeQueueStatus = writeQueueStatus; exports.writeQueueUpdated = writeQueueUpdated; exports.writeRpcsListRequest = writeRpcsListRequest; exports.writeRpcsListResponse = writeRpcsListResponse; exports.writeState = writeState; exports.writeStateRequest = writeStateRequest; exports.writeStateResponse = writeStateResponse; exports.writeStateUpdated = writeStateUpdated; exports.writeToClient = writeToClient; exports.writeToClientBody = writeToClientBody; exports.writeToServer = writeToServer; exports.writeToServerBody = writeToServerBody; exports.writeTraceQueryRequest = writeTraceQueryRequest; exports.writeTraceQueryResponse = writeTraceQueryResponse; exports.writeWorkflowHistory = writeWorkflowHistory; exports.writeWorkflowHistoryRequest = writeWorkflowHistoryRequest; exports.writeWorkflowHistoryResponse = writeWorkflowHistoryResponse; exports.writeWorkflowHistoryUpdated = writeWorkflowHistoryUpdated; exports.writeWorkflowReplayRequest = writeWorkflowReplayRequest; exports.writeWorkflowReplayResponse = writeWorkflowReplayResponse;
765
765
  //# sourceMappingURL=mod.cjs.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-P2GNQ4RN.js";
3
+ } from "../chunk-H6VVZMWN.js";
4
4
  import {
5
5
  decodeWorkflowHistoryTransport,
6
6
  encodeWorkflowHistoryTransport
7
- } from "../chunk-UMZVD6DQ.js";
8
- import "../chunk-2OTRTA3J.js";
9
- import "../chunk-VTTFNQQI.js";
10
- import "../chunk-BRP62GZC.js";
7
+ } from "../chunk-NERUIBOT.js";
8
+ import "../chunk-R6KPN5EW.js";
9
+ import "../chunk-L2X3YFER.js";
10
+ import "../chunk-ZZ3WBRPD.js";
11
11
 
12
12
  // src/common/bare/generated/inspector/v4.ts
13
13
  import * as bare from "@rivetkit/bare-ts";
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
8
+ var _chunk3MHDOUD7cjs = require('../chunk-3MHDOUD7.cjs');
9
9
 
10
10
  // src/inspector-tab/mod.ts
11
11
  var _zod = require('zod');
@@ -169,5 +169,5 @@ var InspectorTabConfigResponseSchema = _zod.z.object({
169
169
 
170
170
 
171
171
 
172
- exports.ACTOR_ID_PARAM = ACTOR_ID_PARAM; exports.ActorInspectorConfigSchema = _chunkNIY3RSPXcjs.ActorInspectorConfigSchema; exports.BUILTIN_INSPECTOR_TAB_IDS = _chunkNIY3RSPXcjs.BUILTIN_INSPECTOR_TAB_IDS; exports.BuiltinInspectorTabIdSchema = _chunkNIY3RSPXcjs.BuiltinInspectorTabIdSchema; exports.CustomInspectorTabEntrySchema = _chunkNIY3RSPXcjs.CustomInspectorTabEntrySchema; exports.HideInspectorTabEntrySchema = _chunkNIY3RSPXcjs.HideInspectorTabEntrySchema; exports.InspectorActionRequestSchema = InspectorActionRequestSchema; exports.InspectorActionResponseSchema = InspectorActionResponseSchema; exports.InspectorConnectionSchema = InspectorConnectionSchema; exports.InspectorConnectionsResponseSchema = InspectorConnectionsResponseSchema; exports.InspectorQueueMessageSchema = InspectorQueueMessageSchema; exports.InspectorQueueResponseSchema = InspectorQueueResponseSchema; exports.InspectorRpcsResponseSchema = InspectorRpcsResponseSchema; exports.InspectorStateResponseSchema = InspectorStateResponseSchema; exports.InspectorTabConfigResponseSchema = InspectorTabConfigResponseSchema; exports.InspectorTabDescriptorSchema = InspectorTabDescriptorSchema; exports.InspectorTabEntrySchema = _chunkNIY3RSPXcjs.InspectorTabEntrySchema; exports.POSTMESSAGE_PROTOCOL_VERSION = POSTMESSAGE_PROTOCOL_VERSION; exports.SHELL_ORIGIN_PARAM = SHELL_ORIGIN_PARAM; exports.ShellToTabMessageSchema = ShellToTabMessageSchema; exports.TabToShellMessageSchema = TabToShellMessageSchema; exports.V1InitSchema = V1InitSchema; exports.V1ReadySchema = V1ReadySchema; exports.V1SetActiveTabSchema = V1SetActiveTabSchema; exports.V1TabsAvailableSchema = V1TabsAvailableSchema; exports.V1TokenRefreshNeededSchema = V1TokenRefreshNeededSchema;
172
+ exports.ACTOR_ID_PARAM = ACTOR_ID_PARAM; exports.ActorInspectorConfigSchema = _chunk3MHDOUD7cjs.ActorInspectorConfigSchema; exports.BUILTIN_INSPECTOR_TAB_IDS = _chunk3MHDOUD7cjs.BUILTIN_INSPECTOR_TAB_IDS; exports.BuiltinInspectorTabIdSchema = _chunk3MHDOUD7cjs.BuiltinInspectorTabIdSchema; exports.CustomInspectorTabEntrySchema = _chunk3MHDOUD7cjs.CustomInspectorTabEntrySchema; exports.HideInspectorTabEntrySchema = _chunk3MHDOUD7cjs.HideInspectorTabEntrySchema; exports.InspectorActionRequestSchema = InspectorActionRequestSchema; exports.InspectorActionResponseSchema = InspectorActionResponseSchema; exports.InspectorConnectionSchema = InspectorConnectionSchema; exports.InspectorConnectionsResponseSchema = InspectorConnectionsResponseSchema; exports.InspectorQueueMessageSchema = InspectorQueueMessageSchema; exports.InspectorQueueResponseSchema = InspectorQueueResponseSchema; exports.InspectorRpcsResponseSchema = InspectorRpcsResponseSchema; exports.InspectorStateResponseSchema = InspectorStateResponseSchema; exports.InspectorTabConfigResponseSchema = InspectorTabConfigResponseSchema; exports.InspectorTabDescriptorSchema = InspectorTabDescriptorSchema; exports.InspectorTabEntrySchema = _chunk3MHDOUD7cjs.InspectorTabEntrySchema; exports.POSTMESSAGE_PROTOCOL_VERSION = POSTMESSAGE_PROTOCOL_VERSION; exports.SHELL_ORIGIN_PARAM = SHELL_ORIGIN_PARAM; exports.ShellToTabMessageSchema = ShellToTabMessageSchema; exports.TabToShellMessageSchema = TabToShellMessageSchema; exports.V1InitSchema = V1InitSchema; exports.V1ReadySchema = V1ReadySchema; exports.V1SetActiveTabSchema = V1SetActiveTabSchema; exports.V1TabsAvailableSchema = V1TabsAvailableSchema; exports.V1TokenRefreshNeededSchema = V1TokenRefreshNeededSchema;
173
173
  //# sourceMappingURL=mod.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","../../../src/inspector-tab/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACA;ACuBA,0BAAkB;AAmDX,IAAM,6BAAA,EAA+B,MAAA,CAAE,MAAA,CAAO;AAAA,EACpD,EAAA,EAAI,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACb,KAAA,EAAO,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EAChB,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQf,QAAA,EAAU,MAAA,CAAE,OAAA,CAAQ,CAAA,CAAE,QAAA,CAAS;AAChC,CAAC,CAAA;AAOM,IAAM,aAAA,EAAe,MAAA,CAAE,MAAA,CAAO;AAAA,EACpC,IAAA,EAAM,MAAA,CAAE,OAAA,CAAQ,MAAM,CAAA;AAAA,EACtB,CAAA,EAAG,MAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAAA;AAAA,EAEd,OAAA,EAAS,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AA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,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA,EAElB,SAAA,EAAW,MAAA,CAAE,OAAA,CAAQ,CAAA;AAAA,EACrB,QAAA,EAAU,MAAA,CAAE,KAAA,CAAM,2BAA2B;AAC9C,CAAC,CAAA;AAGM,IAAM,iCAAA,EAAmC,MAAA,CAAE,MAAA,CAAO;AAAA,EACxD,IAAA,EAAM,MAAA,CAAE,KAAA;AAAA,IACP,MAAA,CAAE,MAAA,CAAO;AAAA,MACR,EAAA,EAAI,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,MACb,KAAA,EAAO,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,MAC3B,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,MACrC,MAAA,EAAQ,MAAA,CAAE,OAAA,CAAQ,CAAA,CAAE,QAAA,CAAS;AAAA,IAC9B,CAAC;AAAA,EACF;AACD,CAAC,CAAA;ADpJD;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,+rDAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","sourcesContent":[null,"/**\n * Type and schema declarations for custom Rivet inspector tabs.\n *\n * Everything here is **derived from runtime Zod schemas** that the\n * dashboard and rivetkit itself use, so the published types cannot\n * drift from the wire format. There are three sources of truth:\n *\n * 1. The `inspector.tabs[]` actor-config Zod schemas in\n * `../actor/config.ts` — re-exported below. These validate the\n * authoring surface (`defineActor({ inspector: { tabs: [...] } })`).\n * 2. The dashboard ↔ tab postMessage envelopes defined in this file.\n * The inspector-ui SPA (`frontend/apps/inspector-ui/src/bridge.ts`)\n * imports the same schemas to validate messages at runtime, so any\n * change here lands on both ends in lockstep.\n * 3. The inspector HTTP endpoint response schemas defined in this\n * file. The dashboard parses every response through them; if the\n * Rust handler ever emits a different shape, the dashboard fails\n * loudly at the parse step instead of silently casting `unknown`.\n *\n * Tab bundles import these types for autocomplete and compile-time\n * safety:\n *\n * ```ts\n * import type {\n * ShellToTabMessage,\n * TabToShellMessage,\n * V1Init,\n * InspectorStateResponse,\n * } from \"rivetkit/inspector-tab\";\n * ```\n */\n\nimport { z } from \"zod\";\n\n// ============================================================================\n// Re-exported from `../actor/config.ts` — the authoring schema for\n// `defineActor({ inspector: { tabs: [...] } })`.\n// ============================================================================\n\nexport {\n\tActorInspectorConfigSchema,\n\tBUILTIN_INSPECTOR_TAB_IDS,\n\tBuiltinInspectorTabIdSchema,\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\nexport type { ActorInspectorConfig } from \"../actor/config\";\n\nimport type {\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\n/** One entry in the actor's `inspector.tabs[]` declaration. */\nexport type ActorInspectorTabEntry = z.input<typeof InspectorTabEntrySchema>;\n/** A custom-tab entry — adds a new tab to the dashboard strip. */\nexport type ActorCustomInspectorTabEntry = z.input<\n\ttypeof CustomInspectorTabEntrySchema\n>;\n/** A hide modifier — removes a built-in tab from the strip. */\nexport type ActorHideInspectorTabEntry = z.input<\n\ttypeof HideInspectorTabEntrySchema\n>;\n/** Union of the six built-in inspector tab ids. */\nexport type BuiltinInspectorTabId =\n\t| \"workflow\"\n\t| \"database\"\n\t| \"state\"\n\t| \"queue\"\n\t| \"connections\"\n\t| \"console\";\n\n// ============================================================================\n// Dashboard ↔ tab postMessage envelope (source of truth).\n//\n// These Zod schemas are imported by `frontend/apps/inspector-ui/src/bridge.ts`\n// and used to validate inbound messages at runtime. Changes here flow to\n// both sides in a single commit.\n// ============================================================================\n\n/** Public tab descriptor that crosses the dashboard ↔ inspector-ui bridge. */\nexport const InspectorTabDescriptorSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\ticon: z.string(),\n\t/**\n\t * `true` for author-shipped custom tabs; absent or `false` for\n\t * built-in tabs the SPA renders. Lets the dashboard route the\n\t * iframe `src` to `/inspector/custom-tabs/<id>/` for custom tabs and\n\t * `/inspector/ui/` for built-ins without the dashboard needing to\n\t * know which ids are built-in.\n\t */\n\tisCustom: z.boolean().optional(),\n});\n\n/**\n * Initial handshake from the dashboard. Sent on first mount and again on\n * every token refresh. Tabs MUST accept late `init` messages and replace\n * the cached token.\n */\nexport const V1InitSchema = z.object({\n\ttype: z.literal(\"init\"),\n\tv: z.literal(1),\n\t/** The actor this tab is mounted for. */\n\tactorId: z.string(),\n\t/**\n\t * Per-actor inspector bearer token. Tabs include it as\n\t * `Authorization: Bearer ${authToken}` on every authenticated fetch.\n\t */\n\tauthToken: z.string(),\n\t/**\n\t * Outer Rivet API token. Optional; not required for inspector HTTP\n\t * routes but available to tabs that want to call the engine REST API.\n\t */\n\trivetToken: z.string().optional(),\n\t/**\n\t * The tab id the dashboard wants active at mount time. Multi-view\n\t * tabs may read this to seed their initial route; most tabs ignore it.\n\t */\n\tactiveTab: z.string().optional(),\n\t/**\n\t * Dashboard's currently active theme. Tabs that use the shared\n\t * stylesheet (`/inspector/tab.css`) mirror it by toggling the `dark`\n\t * class on `<html>`. Optional for backwards compatibility — tabs\n\t * should default to `\"dark\"` if absent (the dashboard pinned dark\n\t * mode before this field was added).\n\t */\n\ttheme: z.enum([\"light\", \"dark\"]).optional(),\n});\n\n/**\n * Dashboard tells the inspector-ui SPA which built-in tab to render. Not\n * sent to custom tabs — when the user activates a custom tab the\n * dashboard navigates the outer iframe to a different `src`.\n */\nexport const V1SetActiveTabSchema = z.object({\n\ttype: z.literal(\"set-active-tab\"),\n\tv: z.literal(1),\n\ttab: z.string(),\n});\n\n/**\n * Tab → dashboard. Sent once after the message listener is registered.\n * The dashboard hides the \"Connecting to inspector…\" overlay on receipt;\n * if it never arrives the overlay times out after 8 s.\n */\nexport const V1ReadySchema = z.object({\n\ttype: z.literal(\"ready\"),\n\tv: z.literal(1),\n});\n\n/**\n * Tab → dashboard. Sent when the tab gets a 401 on an inspector data\n * call. The dashboard refreshes the token and re-issues `v1Init`.\n */\nexport const V1TokenRefreshNeededSchema = z.object({\n\ttype: z.literal(\"token-refresh-needed\"),\n\tv: z.literal(1),\n});\n\n/**\n * Emitted by the inspector-ui SPA to tell the dashboard which tabs to\n * render in the strip. Custom tab bundles do NOT emit this — only the\n * SPA does.\n */\nexport const V1TabsAvailableSchema = z.object({\n\ttype: z.literal(\"tabs-available\"),\n\tv: z.literal(1),\n\ttabs: z.array(InspectorTabDescriptorSchema),\n});\n\n/** Discriminated union of messages a tab can RECEIVE from the dashboard. */\nexport const ShellToTabMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1InitSchema,\n\tV1SetActiveTabSchema,\n]);\n\n/** Discriminated union of messages a tab can SEND to the dashboard. */\nexport const TabToShellMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1ReadySchema,\n\tV1TabsAvailableSchema,\n\tV1TokenRefreshNeededSchema,\n]);\n\nexport type InspectorTabDescriptor = z.infer<\n\ttypeof InspectorTabDescriptorSchema\n>;\nexport type V1Init = z.infer<typeof V1InitSchema>;\nexport type V1SetActiveTab = z.infer<typeof V1SetActiveTabSchema>;\nexport type V1Ready = z.infer<typeof V1ReadySchema>;\nexport type V1TokenRefreshNeeded = z.infer<typeof V1TokenRefreshNeededSchema>;\nexport type V1TabsAvailable = z.infer<typeof V1TabsAvailableSchema>;\nexport type ShellToTabMessage = z.infer<typeof ShellToTabMessageSchema>;\nexport type TabToShellMessage = z.infer<typeof TabToShellMessageSchema>;\n\n/** Stable envelope protocol version. Bump only when introducing a v2 shape. */\nexport const POSTMESSAGE_PROTOCOL_VERSION = 1;\n\n/** URL query parameters the dashboard sets on the tab iframe `src`. */\nexport const SHELL_ORIGIN_PARAM = \"shellOrigin\";\nexport const ACTOR_ID_PARAM = \"actorId\";\n\n// ============================================================================\n// Inspector HTTP endpoint response schemas (source of truth).\n//\n// The dashboard parses every authenticated inspector response through\n// these schemas (`frontend/src/components/actors/actor-inspector-context.tsx`).\n// If the Rust handler emits a different shape the parse fails and the\n// dashboard surfaces an error — drift is loud.\n// ============================================================================\n\n/** `GET /inspector/state` response shape. */\nexport const InspectorStateResponseSchema = z.object({\n\t/** Current actor state (whatever shape the actor declared). */\n\tstate: z.unknown(),\n\t/**\n\t * `false` when the actor did not declare any state — `state` is then\n\t * `null` and `PATCH /inspector/state` returns an error.\n\t */\n\tisStateEnabled: z.boolean(),\n});\n\n/** `POST /inspector/action/<name>` request body. */\nexport const InspectorActionRequestSchema = z\n\t.object({\n\t\t/** Positional arguments. Mutually exclusive with `properties`. */\n\t\targs: z.array(z.unknown()).optional(),\n\t\t/** Keyed arguments. Mutually exclusive with `args`. */\n\t\tproperties: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.refine(\n\t\t(body) => !(body.args !== undefined && body.properties !== undefined),\n\t\t\"Use either `args` or `properties`, not both\",\n\t);\n\n/** `POST /inspector/action/<name>` response shape. */\nexport const InspectorActionResponseSchema = z.object({\n\toutput: z.unknown(),\n});\n\n/** `GET /inspector/rpcs` response shape — the list of action names. */\nexport const InspectorRpcsResponseSchema = z.object({\n\trpcs: z.array(z.string()),\n});\n\n/** One connection record in `GET /inspector/connections`. */\nexport const InspectorConnectionSchema = z.object({\n\tconnectionType: z.string().nullable(),\n\tid: z.string(),\n\tdetails: z.object({\n\t\tconnectionType: z.string().nullable(),\n\t\tparams: z.unknown(),\n\t\tstateEnabled: z.boolean(),\n\t\tstate: z.unknown(),\n\t\tsubscriptions: z.number(),\n\t\tisHibernatable: z.boolean(),\n\t}),\n});\n\n/** `GET /inspector/connections` response shape. */\nexport const InspectorConnectionsResponseSchema = z.object({\n\tconnections: z.array(InspectorConnectionSchema),\n});\n\n/** One queued message in `GET /inspector/queue`. */\nexport const InspectorQueueMessageSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtMs: z.number(),\n});\n\n/** `GET /inspector/queue` response shape. */\nexport const InspectorQueueResponseSchema = z.object({\n\tsize: z.number(),\n\tmaxSize: z.number(),\n\t/** `true` if `?limit=N` truncated the message list below `size`. */\n\ttruncated: z.boolean(),\n\tmessages: z.array(InspectorQueueMessageSchema),\n});\n\n/** `GET /inspector/tab-config` response shape. */\nexport const InspectorTabConfigResponseSchema = z.object({\n\ttabs: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t\tlabel: z.string().optional(),\n\t\t\ticon: z.string().nullable().optional(),\n\t\t\thidden: z.boolean().optional(),\n\t\t}),\n\t),\n});\n\nexport type InspectorStateResponse = z.infer<\n\ttypeof InspectorStateResponseSchema\n>;\nexport type InspectorActionRequest = z.infer<\n\ttypeof InspectorActionRequestSchema\n>;\nexport type InspectorActionResponse = z.infer<\n\ttypeof InspectorActionResponseSchema\n>;\nexport type InspectorRpcsResponse = z.infer<typeof InspectorRpcsResponseSchema>;\nexport type InspectorConnection = z.infer<typeof InspectorConnectionSchema>;\nexport type InspectorConnectionsResponse = z.infer<\n\ttypeof InspectorConnectionsResponseSchema\n>;\nexport type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;\nexport type InspectorQueueResponse = z.infer<\n\ttypeof InspectorQueueResponseSchema\n>;\nexport type InspectorTabConfigResponse = z.infer<\n\ttypeof InspectorTabConfigResponseSchema\n>;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","../../../src/inspector-tab/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACA;ACuBA,0BAAkB;AAmDX,IAAM,6BAAA,EAA+B,MAAA,CAAE,MAAA,CAAO;AAAA,EACpD,EAAA,EAAI,MAAA,CAAE,MAAA,CAA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,+rDAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","sourcesContent":[null,"/**\n * Type and schema declarations for custom Rivet inspector tabs.\n *\n * Everything here is **derived from runtime Zod schemas** that the\n * dashboard and rivetkit itself use, so the published types cannot\n * drift from the wire format. There are three sources of truth:\n *\n * 1. The `inspector.tabs[]` actor-config Zod schemas in\n * `../actor/config.ts` — re-exported below. These validate the\n * authoring surface (`defineActor({ inspector: { tabs: [...] } })`).\n * 2. The dashboard ↔ tab postMessage envelopes defined in this file.\n * The inspector-ui SPA (`frontend/apps/inspector-ui/src/bridge.ts`)\n * imports the same schemas to validate messages at runtime, so any\n * change here lands on both ends in lockstep.\n * 3. The inspector HTTP endpoint response schemas defined in this\n * file. The dashboard parses every response through them; if the\n * Rust handler ever emits a different shape, the dashboard fails\n * loudly at the parse step instead of silently casting `unknown`.\n *\n * Tab bundles import these types for autocomplete and compile-time\n * safety:\n *\n * ```ts\n * import type {\n * ShellToTabMessage,\n * TabToShellMessage,\n * V1Init,\n * InspectorStateResponse,\n * } from \"rivetkit/inspector-tab\";\n * ```\n */\n\nimport { z } from \"zod\";\n\n// ============================================================================\n// Re-exported from `../actor/config.ts` — the authoring schema for\n// `defineActor({ inspector: { tabs: [...] } })`.\n// ============================================================================\n\nexport type { ActorInspectorConfig } from \"../actor/config\";\nexport {\n\tActorInspectorConfigSchema,\n\tBUILTIN_INSPECTOR_TAB_IDS,\n\tBuiltinInspectorTabIdSchema,\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\nimport type {\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\n/** One entry in the actor's `inspector.tabs[]` declaration. */\nexport type ActorInspectorTabEntry = z.input<typeof InspectorTabEntrySchema>;\n/** A custom-tab entry — adds a new tab to the dashboard strip. */\nexport type ActorCustomInspectorTabEntry = z.input<\n\ttypeof CustomInspectorTabEntrySchema\n>;\n/** A hide modifier — removes a built-in tab from the strip. */\nexport type ActorHideInspectorTabEntry = z.input<\n\ttypeof HideInspectorTabEntrySchema\n>;\n/** Union of the six built-in inspector tab ids. */\nexport type BuiltinInspectorTabId =\n\t| \"workflow\"\n\t| \"database\"\n\t| \"state\"\n\t| \"queue\"\n\t| \"connections\"\n\t| \"console\";\n\n// ============================================================================\n// Dashboard ↔ tab postMessage envelope (source of truth).\n//\n// These Zod schemas are imported by `frontend/apps/inspector-ui/src/bridge.ts`\n// and used to validate inbound messages at runtime. Changes here flow to\n// both sides in a single commit.\n// ============================================================================\n\n/** Public tab descriptor that crosses the dashboard ↔ inspector-ui bridge. */\nexport const InspectorTabDescriptorSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\ticon: z.string(),\n\t/**\n\t * `true` for author-shipped custom tabs; absent or `false` for\n\t * built-in tabs the SPA renders. Lets the dashboard route the\n\t * iframe `src` to `/inspector/custom-tabs/<id>/` for custom tabs and\n\t * `/inspector/ui/` for built-ins without the dashboard needing to\n\t * know which ids are built-in.\n\t */\n\tisCustom: z.boolean().optional(),\n});\n\n/**\n * Initial handshake from the dashboard. Sent on first mount and again on\n * every token refresh. Tabs MUST accept late `init` messages and replace\n * the cached token.\n */\nexport const V1InitSchema = z.object({\n\ttype: z.literal(\"init\"),\n\tv: z.literal(1),\n\t/** The actor this tab is mounted for. */\n\tactorId: z.string(),\n\t/**\n\t * Per-actor inspector bearer token. Tabs include it as\n\t * `Authorization: Bearer ${authToken}` on every authenticated fetch.\n\t */\n\tauthToken: z.string(),\n\t/**\n\t * Outer Rivet API token. Optional; not required for inspector HTTP\n\t * routes but available to tabs that want to call the engine REST API.\n\t */\n\trivetToken: z.string().optional(),\n\t/**\n\t * The tab id the dashboard wants active at mount time. Multi-view\n\t * tabs may read this to seed their initial route; most tabs ignore it.\n\t */\n\tactiveTab: z.string().optional(),\n\t/**\n\t * Dashboard's currently active theme. Tabs that use the shared\n\t * stylesheet (`/inspector/tab.css`) mirror it by toggling the `dark`\n\t * class on `<html>`. Optional for backwards compatibility — tabs\n\t * should default to `\"dark\"` if absent (the dashboard pinned dark\n\t * mode before this field was added).\n\t */\n\ttheme: z.enum([\"light\", \"dark\"]).optional(),\n});\n\n/**\n * Dashboard tells the inspector-ui SPA which built-in tab to render. Not\n * sent to custom tabs — when the user activates a custom tab the\n * dashboard navigates the outer iframe to a different `src`.\n */\nexport const V1SetActiveTabSchema = z.object({\n\ttype: z.literal(\"set-active-tab\"),\n\tv: z.literal(1),\n\ttab: z.string(),\n});\n\n/**\n * Tab → dashboard. Sent once after the message listener is registered.\n * The dashboard hides the \"Connecting to inspector…\" overlay on receipt;\n * if it never arrives the overlay times out after 8 s.\n */\nexport const V1ReadySchema = z.object({\n\ttype: z.literal(\"ready\"),\n\tv: z.literal(1),\n});\n\n/**\n * Tab → dashboard. Sent when the tab gets a 401 on an inspector data\n * call. The dashboard refreshes the token and re-issues `v1Init`.\n */\nexport const V1TokenRefreshNeededSchema = z.object({\n\ttype: z.literal(\"token-refresh-needed\"),\n\tv: z.literal(1),\n});\n\n/**\n * Emitted by the inspector-ui SPA to tell the dashboard which tabs to\n * render in the strip. Custom tab bundles do NOT emit this — only the\n * SPA does.\n */\nexport const V1TabsAvailableSchema = z.object({\n\ttype: z.literal(\"tabs-available\"),\n\tv: z.literal(1),\n\ttabs: z.array(InspectorTabDescriptorSchema),\n});\n\n/** Discriminated union of messages a tab can RECEIVE from the dashboard. */\nexport const ShellToTabMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1InitSchema,\n\tV1SetActiveTabSchema,\n]);\n\n/** Discriminated union of messages a tab can SEND to the dashboard. */\nexport const TabToShellMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1ReadySchema,\n\tV1TabsAvailableSchema,\n\tV1TokenRefreshNeededSchema,\n]);\n\nexport type InspectorTabDescriptor = z.infer<\n\ttypeof InspectorTabDescriptorSchema\n>;\nexport type V1Init = z.infer<typeof V1InitSchema>;\nexport type V1SetActiveTab = z.infer<typeof V1SetActiveTabSchema>;\nexport type V1Ready = z.infer<typeof V1ReadySchema>;\nexport type V1TokenRefreshNeeded = z.infer<typeof V1TokenRefreshNeededSchema>;\nexport type V1TabsAvailable = z.infer<typeof V1TabsAvailableSchema>;\nexport type ShellToTabMessage = z.infer<typeof ShellToTabMessageSchema>;\nexport type TabToShellMessage = z.infer<typeof TabToShellMessageSchema>;\n\n/** Stable envelope protocol version. Bump only when introducing a v2 shape. */\nexport const POSTMESSAGE_PROTOCOL_VERSION = 1;\n\n/** URL query parameters the dashboard sets on the tab iframe `src`. */\nexport const SHELL_ORIGIN_PARAM = \"shellOrigin\";\nexport const ACTOR_ID_PARAM = \"actorId\";\n\n// ============================================================================\n// Inspector HTTP endpoint response schemas (source of truth).\n//\n// The dashboard parses every authenticated inspector response through\n// these schemas (`frontend/src/components/actors/actor-inspector-context.tsx`).\n// If the Rust handler emits a different shape the parse fails and the\n// dashboard surfaces an error — drift is loud.\n// ============================================================================\n\n/** `GET /inspector/state` response shape. */\nexport const InspectorStateResponseSchema = z.object({\n\t/** Current actor state (whatever shape the actor declared). */\n\tstate: z.unknown(),\n\t/**\n\t * `false` when the actor did not declare any state — `state` is then\n\t * `null` and `PATCH /inspector/state` returns an error.\n\t */\n\tisStateEnabled: z.boolean(),\n});\n\n/** `POST /inspector/action/<name>` request body. */\nexport const InspectorActionRequestSchema = z\n\t.object({\n\t\t/** Positional arguments. Mutually exclusive with `properties`. */\n\t\targs: z.array(z.unknown()).optional(),\n\t\t/** Keyed arguments. Mutually exclusive with `args`. */\n\t\tproperties: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.refine(\n\t\t(body) => !(body.args !== undefined && body.properties !== undefined),\n\t\t\"Use either `args` or `properties`, not both\",\n\t);\n\n/** `POST /inspector/action/<name>` response shape. */\nexport const InspectorActionResponseSchema = z.object({\n\toutput: z.unknown(),\n});\n\n/** `GET /inspector/rpcs` response shape — the list of action names. */\nexport const InspectorRpcsResponseSchema = z.object({\n\trpcs: z.array(z.string()),\n});\n\n/** One connection record in `GET /inspector/connections`. */\nexport const InspectorConnectionSchema = z.object({\n\tconnectionType: z.string().nullable(),\n\tid: z.string(),\n\tdetails: z.object({\n\t\tconnectionType: z.string().nullable(),\n\t\tparams: z.unknown(),\n\t\tstateEnabled: z.boolean(),\n\t\tstate: z.unknown(),\n\t\tsubscriptions: z.number(),\n\t\tisHibernatable: z.boolean(),\n\t}),\n});\n\n/** `GET /inspector/connections` response shape. */\nexport const InspectorConnectionsResponseSchema = z.object({\n\tconnections: z.array(InspectorConnectionSchema),\n});\n\n/** One queued message in `GET /inspector/queue`. */\nexport const InspectorQueueMessageSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtMs: z.number(),\n});\n\n/** `GET /inspector/queue` response shape. */\nexport const InspectorQueueResponseSchema = z.object({\n\tsize: z.number(),\n\tmaxSize: z.number(),\n\t/** `true` if `?limit=N` truncated the message list below `size`. */\n\ttruncated: z.boolean(),\n\tmessages: z.array(InspectorQueueMessageSchema),\n});\n\n/** `GET /inspector/tab-config` response shape. */\nexport const InspectorTabConfigResponseSchema = z.object({\n\ttabs: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t\tlabel: z.string().optional(),\n\t\t\ticon: z.string().nullable().optional(),\n\t\t\thidden: z.boolean().optional(),\n\t\t}),\n\t),\n});\n\nexport type InspectorStateResponse = z.infer<\n\ttypeof InspectorStateResponseSchema\n>;\nexport type InspectorActionRequest = z.infer<\n\ttypeof InspectorActionRequestSchema\n>;\nexport type InspectorActionResponse = z.infer<\n\ttypeof InspectorActionResponseSchema\n>;\nexport type InspectorRpcsResponse = z.infer<typeof InspectorRpcsResponseSchema>;\nexport type InspectorConnection = z.infer<typeof InspectorConnectionSchema>;\nexport type InspectorConnectionsResponse = z.infer<\n\ttypeof InspectorConnectionsResponseSchema\n>;\nexport type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;\nexport type InspectorQueueResponse = z.infer<\n\ttypeof InspectorQueueResponseSchema\n>;\nexport type InspectorTabConfigResponse = z.infer<\n\ttypeof InspectorTabConfigResponseSchema\n>;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { a0 as CustomInspectorTabEntrySchema, ae as HideInspectorTabEntrySchema, af as InspectorTabEntrySchema } from '../config-CZQQ-mso.cjs';
3
- export { s as ActorInspectorConfig, t as ActorInspectorConfigSchema, U as BUILTIN_INSPECTOR_TAB_IDS, X as BuiltinInspectorTabIdSchema } from '../config-CZQQ-mso.cjs';
2
+ import { a0 as CustomInspectorTabEntrySchema, ae as HideInspectorTabEntrySchema, af as InspectorTabEntrySchema } from '../config-CzvopP5m.cjs';
3
+ export { s as ActorInspectorConfig, t as ActorInspectorConfigSchema, U as BUILTIN_INSPECTOR_TAB_IDS, X as BuiltinInspectorTabIdSchema } from '../config-CzvopP5m.cjs';
4
4
  import 'zod/v4';
5
5
  import '../config-D49x8NpL.cjs';
6
6
  import '@rivetkit/rivetkit-wasm';
@@ -9,7 +9,7 @@ import '@rivetkit/virtual-websocket';
9
9
  import '@standard-schema/spec';
10
10
  import 'hono';
11
11
  import '../utils.cjs';
12
- import '../utils-DQosb24I.cjs';
12
+ import '../utils-CqDnC_PS.cjs';
13
13
  import 'hono/utils/http-status';
14
14
 
15
15
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { a0 as CustomInspectorTabEntrySchema, ae as HideInspectorTabEntrySchema, af as InspectorTabEntrySchema } from '../config-BxWAw3iH.js';
3
- export { s as ActorInspectorConfig, t as ActorInspectorConfigSchema, U as BUILTIN_INSPECTOR_TAB_IDS, X as BuiltinInspectorTabIdSchema } from '../config-BxWAw3iH.js';
2
+ import { a0 as CustomInspectorTabEntrySchema, ae as HideInspectorTabEntrySchema, af as InspectorTabEntrySchema } from '../config-DZuT7tcp.js';
3
+ export { s as ActorInspectorConfig, t as ActorInspectorConfigSchema, U as BUILTIN_INSPECTOR_TAB_IDS, X as BuiltinInspectorTabIdSchema } from '../config-DZuT7tcp.js';
4
4
  import 'zod/v4';
5
5
  import '../config-D49x8NpL.js';
6
6
  import '@rivetkit/rivetkit-wasm';
@@ -9,7 +9,7 @@ import '@rivetkit/virtual-websocket';
9
9
  import '@standard-schema/spec';
10
10
  import 'hono';
11
11
  import '../utils.js';
12
- import '../utils-DQosb24I.js';
12
+ import '../utils-CqDnC_PS.js';
13
13
  import 'hono/utils/http-status';
14
14
 
15
15
  /**
@@ -5,7 +5,7 @@ import {
5
5
  CustomInspectorTabEntrySchema,
6
6
  HideInspectorTabEntrySchema,
7
7
  InspectorTabEntrySchema
8
- } from "../chunk-DPIMKYNB.js";
8
+ } from "../chunk-XIX5DOZN.js";
9
9
 
10
10
  // src/inspector-tab/mod.ts
11
11
  import { z } from "zod";