rivetkit 2.3.20 → 2.3.22
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 +43 -5
- package/dist/browser/client.js +315 -63
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +2 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +2 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +1 -1
- package/dist/tsup/agent-os/index.cjs +2 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +32 -4
- package/dist/tsup/agent-os/index.d.ts +32 -4
- package/dist/tsup/agent-os/index.js +2 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-553CIQJY.js → chunk-47FSGXYN.js} +2 -2
- package/dist/tsup/{chunk-2NXLTFWI.js → chunk-4DTWJFIZ.js} +3 -3
- package/dist/tsup/chunk-4DTWJFIZ.js.map +1 -0
- package/dist/tsup/{chunk-2CE5UNWK.cjs → chunk-BDKVTNJF.cjs} +11 -10
- package/dist/tsup/chunk-BDKVTNJF.cjs.map +1 -0
- package/dist/tsup/{chunk-DHWZTUKA.js → chunk-DE2IFYJK.js} +4 -3
- package/dist/tsup/chunk-DE2IFYJK.js.map +1 -0
- package/dist/tsup/{chunk-DMQUERRN.js → chunk-GINS4O73.js} +2 -2
- package/dist/tsup/{chunk-3WS7Z64U.cjs → chunk-GZZNJGXY.cjs} +3 -3
- package/dist/tsup/chunk-GZZNJGXY.cjs.map +1 -0
- package/dist/tsup/{chunk-A36FMKOV.cjs → chunk-HEY27WZX.cjs} +479 -230
- package/dist/tsup/chunk-HEY27WZX.cjs.map +1 -0
- package/dist/tsup/{chunk-WAISW7KR.cjs → chunk-KEAUN5F5.cjs} +10 -10
- package/dist/tsup/chunk-KEAUN5F5.cjs.map +1 -0
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -1
- package/dist/tsup/{chunk-CVLNRT7O.cjs → chunk-LUMROGNM.cjs} +3 -3
- package/dist/tsup/chunk-LUMROGNM.cjs.map +1 -0
- package/dist/tsup/{chunk-JX2ITWAV.cjs → chunk-MGI2VVF6.cjs} +14 -4
- package/dist/tsup/chunk-MGI2VVF6.cjs.map +1 -0
- package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -1
- package/dist/tsup/chunk-NWCAIWHL.cjs.map +1 -1
- package/dist/tsup/{chunk-RSIOGT2U.cjs → chunk-QOQA4JPN.cjs} +7 -7
- package/dist/tsup/chunk-QOQA4JPN.cjs.map +1 -0
- package/dist/tsup/{chunk-TZVAVPGJ.js → chunk-QXBNHJH5.js} +4 -4
- package/dist/tsup/{chunk-W2PXGWMR.js → chunk-RIPVNPR6.js} +2 -2
- package/dist/tsup/{chunk-5G2J26VM.js → chunk-VD47X7KQ.js} +318 -69
- package/dist/tsup/chunk-VD47X7KQ.js.map +1 -0
- package/dist/tsup/{chunk-76YTS32R.cjs → chunk-WLRGUAMW.cjs} +4 -4
- package/dist/tsup/chunk-WLRGUAMW.cjs.map +1 -0
- package/dist/tsup/{chunk-IHKDFKM4.cjs → chunk-WMNXGH25.cjs} +3 -3
- package/dist/tsup/chunk-WMNXGH25.cjs.map +1 -0
- package/dist/tsup/{chunk-SNNVRHLX.js → chunk-XZBDVEQN.js} +2 -2
- package/dist/tsup/{chunk-P2OFXH4G.js → chunk-ZOVJDAOW.js} +14 -4
- package/dist/tsup/chunk-ZOVJDAOW.js.map +1 -0
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +15 -6
- package/dist/tsup/client/mod.d.ts +15 -6
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-Be-VOHaX.d.ts → config-Cv6pjCt-.d.ts} +37 -7
- package/dist/tsup/{config-Ct5uXxXk.d.cts → config-osdJqQwX.d.cts} +37 -7
- package/dist/tsup/{context-CXLa0BIM.d.ts → context-CoVbKBuk.d.ts} +1 -1
- package/dist/tsup/{context-Cw-11Q-B.d.cts → context-DpjrM7n7.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +3 -3
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.js +2 -2
- package/dist/tsup/db/mod.cjs +4 -4
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.js +3 -3
- package/dist/tsup/dynamic/mod.cjs.map +1 -1
- package/dist/tsup/dynamic/mod.d.cts +4 -3
- package/dist/tsup/dynamic/mod.d.ts +4 -3
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/inspector/workflow.cjs +5 -5
- package/dist/tsup/inspector/workflow.cjs.map +1 -1
- package/dist/tsup/inspector/workflow.js +4 -4
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +5 -4
- package/dist/tsup/inspector-tab/mod.d.ts +5 -4
- package/dist/tsup/mod.cjs +170 -158
- 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 +56 -44
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +4 -3
- package/dist/tsup/test/mod.d.ts +4 -3
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/unstable/migrations.cjs.map +1 -1
- package/dist/tsup/{utils-DsoDinPz.d.ts → utils-3rsE0JvI.d.cts} +12 -2
- package/dist/tsup/{utils-DsoDinPz.d.cts → utils-3rsE0JvI.d.ts} +12 -2
- package/dist/tsup/{utils-OQHBjfcM.d.ts → utils-C1O-SklO.d.ts} +1 -1
- package/dist/tsup/{utils-CNFeS-Dk.d.cts → utils-C6b0aYUM.d.cts} +1 -1
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.d.cts +2 -2
- package/dist/tsup/utils.d.ts +2 -2
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +11 -11
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +6 -5
- package/dist/tsup/workflow/mod.d.ts +6 -5
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +10 -9
- package/src/actor/errors.ts +27 -4
- package/src/client/actor-conn.ts +34 -1
- package/src/client/actor-handle.ts +29 -1
- package/src/client/auth.ts +37 -0
- package/src/client/client.ts +10 -2
- package/src/client/config.ts +12 -1
- package/src/client/mod.ts +9 -0
- package/src/client/token-provider.test.ts +86 -0
- package/src/client/token-provider.ts +93 -0
- package/src/client/utils.ts +1 -0
- package/src/engine-client/actor-websocket-client.ts +2 -1
- package/src/engine-client/api-endpoints.ts +28 -0
- package/src/engine-client/driver.ts +4 -0
- package/src/engine-client/mod.ts +201 -64
- package/src/registry/config/envoy.ts +1 -17
- package/src/registry/config/index.test.ts +2 -2
- package/src/registry/config/index.ts +7 -2
- package/src/registry/index.ts +28 -0
- package/src/registry/native.ts +31 -3
- package/dist/tsup/chunk-2CE5UNWK.cjs.map +0 -1
- package/dist/tsup/chunk-2NXLTFWI.js.map +0 -1
- package/dist/tsup/chunk-3WS7Z64U.cjs.map +0 -1
- package/dist/tsup/chunk-5G2J26VM.js.map +0 -1
- package/dist/tsup/chunk-76YTS32R.cjs.map +0 -1
- package/dist/tsup/chunk-A36FMKOV.cjs.map +0 -1
- package/dist/tsup/chunk-CVLNRT7O.cjs.map +0 -1
- package/dist/tsup/chunk-DHWZTUKA.js.map +0 -1
- package/dist/tsup/chunk-IHKDFKM4.cjs.map +0 -1
- package/dist/tsup/chunk-JX2ITWAV.cjs.map +0 -1
- package/dist/tsup/chunk-P2OFXH4G.js.map +0 -1
- package/dist/tsup/chunk-RSIOGT2U.cjs.map +0 -1
- package/dist/tsup/chunk-WAISW7KR.cjs.map +0 -1
- package/src/registry/process-metrics.ts +0 -250
- /package/dist/tsup/{chunk-553CIQJY.js.map → chunk-47FSGXYN.js.map} +0 -0
- /package/dist/tsup/{chunk-DMQUERRN.js.map → chunk-GINS4O73.js.map} +0 -0
- /package/dist/tsup/{chunk-TZVAVPGJ.js.map → chunk-QXBNHJH5.js.map} +0 -0
- /package/dist/tsup/{chunk-W2PXGWMR.js.map → chunk-RIPVNPR6.js.map} +0 -0
- /package/dist/tsup/{chunk-SNNVRHLX.js.map → chunk-XZBDVEQN.js.map} +0 -0
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
3
|
-
export { E as Encoding, t as toUint8Array } from './utils-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-osdJqQwX.cjs';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-osdJqQwX.cjs';
|
|
3
|
+
export { E as Encoding, t as toUint8Array } from './utils-C6b0aYUM.cjs';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
import { A as AnyDatabaseProvider } from './config-ey2I2zz5.cjs';
|
|
7
|
-
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-
|
|
7
|
+
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-3rsE0JvI.cjs';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-DpjrM7n7.cjs';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
|
13
13
|
import 'pino';
|
|
14
14
|
import './inspector/workflow.cjs';
|
|
15
15
|
import '@standard-schema/spec';
|
|
16
|
+
import '@rivetkit/engine-api-full';
|
|
16
17
|
import 'hono';
|
|
17
18
|
import 'hono/utils/http-status';
|
|
18
19
|
import '@rivetkit/workflow-engine';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
3
|
-
export { E as Encoding, t as toUint8Array } from './utils-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-Cv6pjCt-.js';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-Cv6pjCt-.js';
|
|
3
|
+
export { E as Encoding, t as toUint8Array } from './utils-C1O-SklO.js';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
import { A as AnyDatabaseProvider } from './config-ey2I2zz5.js';
|
|
7
|
-
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-
|
|
7
|
+
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-3rsE0JvI.js';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-CoVbKBuk.js';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
|
13
13
|
import 'pino';
|
|
14
14
|
import './inspector/workflow.js';
|
|
15
15
|
import '@standard-schema/spec';
|
|
16
|
+
import '@rivetkit/engine-api-full';
|
|
16
17
|
import 'hono';
|
|
17
18
|
import 'hono/utils/http-status';
|
|
18
19
|
import '@rivetkit/workflow-engine';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeWorkflowHistoryTransport
|
|
3
|
+
} from "./chunk-XZBDVEQN.js";
|
|
1
4
|
import {
|
|
2
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
3
6
|
ActorConfigSchema,
|
|
@@ -15,34 +18,35 @@ import {
|
|
|
15
18
|
getRunMetadata,
|
|
16
19
|
hasRunInspectorConfig
|
|
17
20
|
} from "./chunk-CSOHAAZK.js";
|
|
18
|
-
import {
|
|
19
|
-
decodeWorkflowHistoryTransport
|
|
20
|
-
} from "./chunk-SNNVRHLX.js";
|
|
21
21
|
import {
|
|
22
22
|
ALLOWED_PUBLIC_HEADERS,
|
|
23
|
+
ENGINE_HOST,
|
|
24
|
+
ENGINE_PORT,
|
|
23
25
|
HEADER_CONN_PARAMS,
|
|
24
26
|
HEADER_ORIGINAL_REQUEST_URL,
|
|
25
27
|
RemoteEngineControlClient,
|
|
28
|
+
buildEngineEndpoint,
|
|
26
29
|
convertRegistryConfigToClientConfig,
|
|
27
30
|
createClientWithDriver,
|
|
28
31
|
getDatacenters,
|
|
32
|
+
isLocalEngineEndpoint,
|
|
29
33
|
isResponseLike,
|
|
30
34
|
readActiveTraceHeaders,
|
|
31
35
|
runWithActorInvocationSpan,
|
|
32
36
|
tryParseEndpoint,
|
|
33
37
|
updateRunnerConfig
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VD47X7KQ.js";
|
|
35
39
|
import {
|
|
36
40
|
makePrefixedKey,
|
|
37
41
|
removePrefixFromKey
|
|
38
42
|
} from "./chunk-JI6GZ2C2.js";
|
|
39
|
-
import "./chunk-553CIQJY.js";
|
|
40
43
|
import {
|
|
41
44
|
bindNativeStateTransactionContext,
|
|
42
45
|
db,
|
|
43
46
|
registerNativeStateTransactionOpener
|
|
44
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-RIPVNPR6.js";
|
|
45
48
|
import "./chunk-JTHHCZCZ.js";
|
|
49
|
+
import "./chunk-47FSGXYN.js";
|
|
46
50
|
import {
|
|
47
51
|
LogLevelSchema,
|
|
48
52
|
VERSION,
|
|
@@ -76,7 +80,7 @@ import {
|
|
|
76
80
|
parsePortEnv,
|
|
77
81
|
stringifyError,
|
|
78
82
|
toUint8Array
|
|
79
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-DE2IFYJK.js";
|
|
80
84
|
import {
|
|
81
85
|
INTERNAL_ERROR_CODE,
|
|
82
86
|
RivetError,
|
|
@@ -89,7 +93,7 @@ import {
|
|
|
89
93
|
isRivetErrorLike,
|
|
90
94
|
toRivetError,
|
|
91
95
|
unsupportedFeature
|
|
92
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ZOVJDAOW.js";
|
|
93
97
|
|
|
94
98
|
// src/actor/log.ts
|
|
95
99
|
function loggerWithoutContext() {
|
|
@@ -385,25 +389,6 @@ var InlineWebSocketAdapter = class {
|
|
|
385
389
|
}
|
|
386
390
|
};
|
|
387
391
|
|
|
388
|
-
// src/common/engine.ts
|
|
389
|
-
var ENGINE_HOST = "127.0.0.1";
|
|
390
|
-
var ENGINE_PORT = 6420;
|
|
391
|
-
var ENGINE_ENDPOINT = buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT);
|
|
392
|
-
function buildEngineEndpoint(host, port) {
|
|
393
|
-
const urlHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
394
|
-
return `http://${urlHost}:${port}`;
|
|
395
|
-
}
|
|
396
|
-
function isLocalEngineEndpoint(endpoint) {
|
|
397
|
-
let url;
|
|
398
|
-
try {
|
|
399
|
-
url = new URL(endpoint);
|
|
400
|
-
} catch {
|
|
401
|
-
return false;
|
|
402
|
-
}
|
|
403
|
-
const hostname = url.hostname.toLowerCase();
|
|
404
|
-
return hostname === "localhost" || hostname === "0.0.0.0" || hostname === "::" || hostname === "[::]" || hostname === "::1" || hostname === "[::1]" || /^127(?:\.\d{1,3}){0,3}$/.test(hostname);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
392
|
// src/registry/log.ts
|
|
408
393
|
function logger2() {
|
|
409
394
|
return getLogger("registry");
|
|
@@ -510,20 +495,9 @@ import { z as z3 } from "zod";
|
|
|
510
495
|
|
|
511
496
|
// src/registry/config/envoy.ts
|
|
512
497
|
import { z } from "zod/v4";
|
|
513
|
-
var warnedMissingVersion = false;
|
|
514
498
|
var EnvoyConfigSchema = z.object({
|
|
515
499
|
poolName: z.string().default(() => getRivetPool() ?? "default"),
|
|
516
|
-
version: z.number().default(() =>
|
|
517
|
-
const version = getRivetEnvoyVersion();
|
|
518
|
-
if (version !== void 0) return version;
|
|
519
|
-
if (getNodeEnv() === "production" && !warnedMissingVersion) {
|
|
520
|
-
warnedMissingVersion = true;
|
|
521
|
-
getLogger("rivetkit").error(
|
|
522
|
-
"RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions"
|
|
523
|
-
);
|
|
524
|
-
}
|
|
525
|
-
return 1;
|
|
526
|
-
}),
|
|
500
|
+
version: z.number().default(() => getRivetEnvoyVersion() ?? 1),
|
|
527
501
|
// Deprecated.
|
|
528
502
|
totalSlots: z.number().default(() => getRivetTotalSlots() ?? 1e5),
|
|
529
503
|
envoyKey: z.string().optional()
|
|
@@ -828,7 +802,7 @@ var RegistryConfigSchema = z3.object({
|
|
|
828
802
|
config.startEngine || parsedEndpoint
|
|
829
803
|
);
|
|
830
804
|
const namespace = (parsedEndpoint == null ? void 0 : parsedEndpoint.namespace) ?? config.namespace ?? "default";
|
|
831
|
-
const token = (parsedEndpoint == null ? void 0 : parsedEndpoint.token) ?? config.token ?? "
|
|
805
|
+
const token = (parsedEndpoint == null ? void 0 : parsedEndpoint.token) ?? config.token ?? (endpoint && isLocalEngineEndpoint(endpoint) ? "default" : void 0);
|
|
832
806
|
const parsedPublicEndpoint = config.serverless.publicEndpoint ? tryParseEndpoint(ctx, {
|
|
833
807
|
endpoint: config.serverless.publicEndpoint,
|
|
834
808
|
path: ["serverless", "publicEndpoint"]
|
|
@@ -3865,7 +3839,18 @@ function isStructuredBridgeError(error) {
|
|
|
3865
3839
|
}
|
|
3866
3840
|
function encodeNativeCallbackError(error) {
|
|
3867
3841
|
const structuredError = isStructuredBridgeError(error) ? error : deconstructError(error, true);
|
|
3868
|
-
const
|
|
3842
|
+
const { encoded, droppedMetadataCause } = encodeBridgeRivetError(structuredError);
|
|
3843
|
+
if (droppedMetadataCause !== void 0) {
|
|
3844
|
+
logger2().warn(
|
|
3845
|
+
{
|
|
3846
|
+
group: structuredError.group,
|
|
3847
|
+
code: structuredError.code,
|
|
3848
|
+
error: String(droppedMetadataCause)
|
|
3849
|
+
},
|
|
3850
|
+
"dropped error metadata that JSON cannot encode"
|
|
3851
|
+
);
|
|
3852
|
+
}
|
|
3853
|
+
const bridgeError = new Error(encoded, {
|
|
3869
3854
|
cause: error instanceof Error ? error : void 0
|
|
3870
3855
|
});
|
|
3871
3856
|
return Object.assign(bridgeError, {
|
|
@@ -5202,7 +5187,10 @@ var ActorContextHandleAdapter = class {
|
|
|
5202
5187
|
}
|
|
5203
5188
|
this.#request = request;
|
|
5204
5189
|
this[ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
5205
|
-
this
|
|
5190
|
+
this,
|
|
5191
|
+
() => this.#logByInvocationScope.delete(
|
|
5192
|
+
this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE
|
|
5193
|
+
)
|
|
5206
5194
|
);
|
|
5207
5195
|
}
|
|
5208
5196
|
get kv() {
|
|
@@ -5374,7 +5362,10 @@ var ActorContextHandleAdapter = class {
|
|
|
5374
5362
|
() => this.#runtime.actorInvocationTraceContext(this.#ctx)
|
|
5375
5363
|
);
|
|
5376
5364
|
}
|
|
5377
|
-
/**
|
|
5365
|
+
/**
|
|
5366
|
+
* Cached per invocation, because the `run` context outlives workflow runs and steps.
|
|
5367
|
+
* A workflow queue receive clears the entry, because the run's ray becomes the message's ray.
|
|
5368
|
+
*/
|
|
5378
5369
|
get log() {
|
|
5379
5370
|
const scope = this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE;
|
|
5380
5371
|
const cached = this.#logByInvocationScope.get(scope);
|
|
@@ -5921,13 +5912,15 @@ var ActorContextHandleAdapter = class {
|
|
|
5921
5912
|
};
|
|
5922
5913
|
var NativeWorkflowRuntimeAdapter = class {
|
|
5923
5914
|
#ctx;
|
|
5915
|
+
#onMessagesReceived;
|
|
5924
5916
|
#completions = /* @__PURE__ */ new Map();
|
|
5925
5917
|
id;
|
|
5926
5918
|
driver;
|
|
5927
5919
|
queueManager;
|
|
5928
5920
|
stateManager;
|
|
5929
|
-
constructor(ctx) {
|
|
5921
|
+
constructor(ctx, onMessagesReceived) {
|
|
5930
5922
|
this.#ctx = ctx;
|
|
5923
|
+
this.#onMessagesReceived = onMessagesReceived;
|
|
5931
5924
|
this.id = ctx.actorId;
|
|
5932
5925
|
this.driver = {
|
|
5933
5926
|
kvBatchGet: async (actorId, keys) => {
|
|
@@ -5967,6 +5960,9 @@ var NativeWorkflowRuntimeAdapter = class {
|
|
|
5967
5960
|
timeout: timeout ?? 0,
|
|
5968
5961
|
completable
|
|
5969
5962
|
});
|
|
5963
|
+
if (messages.length > 0) {
|
|
5964
|
+
this.#onMessagesReceived();
|
|
5965
|
+
}
|
|
5970
5966
|
return messages.map(
|
|
5971
5967
|
(message) => this.#wrapQueueMessage(message)
|
|
5972
5968
|
);
|
|
@@ -7820,7 +7816,23 @@ var Registry = class {
|
|
|
7820
7816
|
* Starts an actor envoy for standalone server deployments.
|
|
7821
7817
|
*/
|
|
7822
7818
|
#startEnvoy(config, printWelcome) {
|
|
7819
|
+
var _a;
|
|
7823
7820
|
if (!this.#runtimeServePromise) {
|
|
7821
|
+
const configuredEnvoyVersion = (_a = this.#config.envoy) == null ? void 0 : _a.version;
|
|
7822
|
+
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : getRivetEnvoyVersion() !== void 0 ? "environment" : "default";
|
|
7823
|
+
logger2().info({
|
|
7824
|
+
msg: "starting rivetkit envoy",
|
|
7825
|
+
rivetkitVersion: VERSION,
|
|
7826
|
+
envoyVersion: config.envoy.version,
|
|
7827
|
+
envoyVersionSource
|
|
7828
|
+
});
|
|
7829
|
+
if (envoyVersionSource === "default" && getNodeEnv() === "production") {
|
|
7830
|
+
logger2().error({
|
|
7831
|
+
msg: "envoy version defaulted because neither config.envoy.version nor RIVET_ENVOY_VERSION is set; actors will not drain automatically across deploys. See https://rivet.dev/docs/actors/versions",
|
|
7832
|
+
envoyVersion: config.envoy.version,
|
|
7833
|
+
envoyVersionSource
|
|
7834
|
+
});
|
|
7835
|
+
}
|
|
7824
7836
|
const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
|
|
7825
7837
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
7826
7838
|
this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
|