rivetkit 2.3.19 → 2.3.21
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 +82 -5
- package/dist/browser/client.js +302 -60
- 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.map +1 -1
- package/dist/tsup/agent-os/index.cjs +35 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +71 -4
- package/dist/tsup/agent-os/index.d.ts +71 -4
- package/dist/tsup/agent-os/index.js +35 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-X7RMJQGY.js → chunk-2CI2IEVN.js} +2 -2
- package/dist/tsup/{chunk-WME6KOXW.js → chunk-5EGLHQJJ.js} +2 -2
- package/dist/tsup/{chunk-464WE4RF.js → chunk-5IBUZFLP.js} +2 -2
- package/dist/tsup/{chunk-PPEIPCW4.cjs → chunk-6LRPYB4Q.cjs} +4 -4
- package/dist/tsup/chunk-6LRPYB4Q.cjs.map +1 -0
- package/dist/tsup/{chunk-7BRRGBRY.cjs → chunk-APOANSDG.cjs} +10 -10
- package/dist/tsup/chunk-APOANSDG.cjs.map +1 -0
- package/dist/tsup/{chunk-G4U5L6AX.cjs → chunk-ARGNQGYG.cjs} +3 -3
- package/dist/tsup/chunk-ARGNQGYG.cjs.map +1 -0
- package/dist/tsup/{chunk-IJUXBWH4.cjs → chunk-B5SNXPSS.cjs} +448 -199
- package/dist/tsup/chunk-B5SNXPSS.cjs.map +1 -0
- package/dist/tsup/{chunk-4SC2NSAV.js → chunk-CJXBGTVT.js} +2 -2
- package/dist/tsup/{chunk-EB77NZL4.js → chunk-CSOHAAZK.js} +33 -1
- package/dist/tsup/chunk-CSOHAAZK.js.map +1 -0
- package/dist/tsup/{chunk-Z4RAXFSD.cjs → chunk-GHKQC4PD.cjs} +3 -3
- package/dist/tsup/chunk-GHKQC4PD.cjs.map +1 -0
- package/dist/tsup/chunk-JX2ITWAV.cjs.map +1 -1
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -1
- package/dist/tsup/{chunk-RJC5O2SD.cjs → chunk-KWGN2ZBJ.cjs} +3 -2
- package/dist/tsup/chunk-KWGN2ZBJ.cjs.map +1 -0
- package/dist/tsup/{chunk-OGPFN6BT.cjs → chunk-LWSLKKZ5.cjs} +3 -3
- package/dist/tsup/chunk-LWSLKKZ5.cjs.map +1 -0
- package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -1
- package/dist/tsup/{chunk-7A5EIXJJ.cjs → chunk-NL2EIKK6.cjs} +7 -7
- package/dist/tsup/chunk-NL2EIKK6.cjs.map +1 -0
- package/dist/tsup/{chunk-EO5UOXXY.cjs → chunk-NWCAIWHL.cjs} +34 -2
- package/dist/tsup/chunk-NWCAIWHL.cjs.map +1 -0
- package/dist/tsup/{chunk-BKX7UDTA.js → chunk-PYRI75DL.js} +314 -65
- package/dist/tsup/chunk-PYRI75DL.js.map +1 -0
- package/dist/tsup/{chunk-7HTST3NX.js → chunk-RFN3BG6D.js} +3 -3
- package/dist/tsup/chunk-RFN3BG6D.js.map +1 -0
- package/dist/tsup/{chunk-DN6MD3KK.js → chunk-RGIZNZYO.js} +3 -2
- package/dist/tsup/chunk-RGIZNZYO.js.map +1 -0
- package/dist/tsup/{chunk-DK3L22R6.js → chunk-VMMXXVDO.js} +4 -4
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +12 -3
- package/dist/tsup/client/mod.d.ts +12 -3
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-DEm0yIVV.d.ts → config-Bc1nnvUl.d.ts} +76 -6
- package/dist/tsup/{config-8n2AOhXK.d.cts → config-Do_0guSS.d.cts} +76 -6
- package/dist/tsup/{context-DwjOVvlE.d.cts → context-CgNkhjdY.d.cts} +1 -1
- package/dist/tsup/{context-DGg2-IOm.d.ts → context-oGQxZDPz.d.ts} +1 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.cjs.map +1 -1
- package/dist/tsup/dynamic/mod.d.cts +2 -1
- package/dist/tsup/dynamic/mod.d.ts +2 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.cjs.map +1 -1
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +3 -2
- package/dist/tsup/inspector-tab/mod.d.ts +3 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +140 -136
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -3
- package/dist/tsup/mod.d.ts +4 -3
- package/dist/tsup/mod.js +44 -40
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +2 -1
- package/dist/tsup/test/mod.d.ts +2 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/unstable/migrations.cjs.map +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +10 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -3
- package/dist/tsup/workflow/mod.d.ts +4 -3
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +10 -9
- package/src/actor/actions.ts +36 -0
- package/src/actor/config.ts +27 -0
- package/src/actor/definition.ts +6 -1
- package/src/actor/mod.ts +5 -0
- package/src/actor/tracing.ts +28 -0
- 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 +18 -0
- package/src/registry/runtime.ts +8 -0
- package/dist/tsup/chunk-7A5EIXJJ.cjs.map +0 -1
- package/dist/tsup/chunk-7BRRGBRY.cjs.map +0 -1
- package/dist/tsup/chunk-7HTST3NX.js.map +0 -1
- package/dist/tsup/chunk-BKX7UDTA.js.map +0 -1
- package/dist/tsup/chunk-DN6MD3KK.js.map +0 -1
- package/dist/tsup/chunk-EB77NZL4.js.map +0 -1
- package/dist/tsup/chunk-EO5UOXXY.cjs.map +0 -1
- package/dist/tsup/chunk-G4U5L6AX.cjs.map +0 -1
- package/dist/tsup/chunk-IJUXBWH4.cjs.map +0 -1
- package/dist/tsup/chunk-OGPFN6BT.cjs.map +0 -1
- package/dist/tsup/chunk-PPEIPCW4.cjs.map +0 -1
- package/dist/tsup/chunk-RJC5O2SD.cjs.map +0 -1
- package/dist/tsup/chunk-Z4RAXFSD.cjs.map +0 -1
- /package/dist/tsup/{chunk-X7RMJQGY.js.map → chunk-2CI2IEVN.js.map} +0 -0
- /package/dist/tsup/{chunk-WME6KOXW.js.map → chunk-5EGLHQJJ.js.map} +0 -0
- /package/dist/tsup/{chunk-464WE4RF.js.map → chunk-5IBUZFLP.js.map} +0 -0
- /package/dist/tsup/{chunk-4SC2NSAV.js.map → chunk-CJXBGTVT.js.map} +0 -0
- /package/dist/tsup/{chunk-DK3L22R6.js.map → chunk-VMMXXVDO.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
|
|
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-Do_0guSS.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-Do_0guSS.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-CNFeS-Dk.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
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-DsoDinPz.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-CgNkhjdY.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
|
|
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-Bc1nnvUl.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-Bc1nnvUl.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-OQHBjfcM.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
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-DsoDinPz.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-oGQxZDPz.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-CJXBGTVT.js";
|
|
1
4
|
import {
|
|
2
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
3
6
|
ActorConfigSchema,
|
|
@@ -8,39 +11,41 @@ import {
|
|
|
8
11
|
disposeRunInspector,
|
|
9
12
|
flattenActionHandlers,
|
|
10
13
|
flattenActionInputSchemas,
|
|
14
|
+
flattenActionTraceSamplers,
|
|
11
15
|
getRunFunction,
|
|
12
16
|
getRunInspectorConfig,
|
|
13
17
|
getRunInspectorKind,
|
|
14
18
|
getRunMetadata,
|
|
15
19
|
hasRunInspectorConfig
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
decodeWorkflowHistoryTransport
|
|
19
|
-
} from "./chunk-4SC2NSAV.js";
|
|
20
|
+
} from "./chunk-CSOHAAZK.js";
|
|
20
21
|
import {
|
|
21
22
|
ALLOWED_PUBLIC_HEADERS,
|
|
23
|
+
ENGINE_HOST,
|
|
24
|
+
ENGINE_PORT,
|
|
22
25
|
HEADER_CONN_PARAMS,
|
|
23
26
|
HEADER_ORIGINAL_REQUEST_URL,
|
|
24
27
|
RemoteEngineControlClient,
|
|
28
|
+
buildEngineEndpoint,
|
|
25
29
|
convertRegistryConfigToClientConfig,
|
|
26
30
|
createClientWithDriver,
|
|
27
31
|
getDatacenters,
|
|
32
|
+
isLocalEngineEndpoint,
|
|
28
33
|
isResponseLike,
|
|
29
34
|
readActiveTraceHeaders,
|
|
30
35
|
runWithActorInvocationSpan,
|
|
31
36
|
tryParseEndpoint,
|
|
32
37
|
updateRunnerConfig
|
|
33
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PYRI75DL.js";
|
|
34
39
|
import {
|
|
35
40
|
makePrefixedKey,
|
|
36
41
|
removePrefixFromKey
|
|
37
42
|
} from "./chunk-JI6GZ2C2.js";
|
|
38
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-2CI2IEVN.js";
|
|
39
44
|
import {
|
|
40
45
|
bindNativeStateTransactionContext,
|
|
41
46
|
db,
|
|
42
47
|
registerNativeStateTransactionOpener
|
|
43
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-5EGLHQJJ.js";
|
|
44
49
|
import "./chunk-JTHHCZCZ.js";
|
|
45
50
|
import {
|
|
46
51
|
LogLevelSchema,
|
|
@@ -75,7 +80,7 @@ import {
|
|
|
75
80
|
parsePortEnv,
|
|
76
81
|
stringifyError,
|
|
77
82
|
toUint8Array
|
|
78
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-RGIZNZYO.js";
|
|
79
84
|
import {
|
|
80
85
|
INTERNAL_ERROR_CODE,
|
|
81
86
|
RivetError,
|
|
@@ -128,12 +133,14 @@ function isStaticActorInstance(_actor) {
|
|
|
128
133
|
return true;
|
|
129
134
|
}
|
|
130
135
|
function actor(input) {
|
|
136
|
+
var _a;
|
|
131
137
|
warnDeprecatedOptionKeys(
|
|
132
138
|
input == null ? void 0 : input.options
|
|
133
139
|
);
|
|
134
140
|
const config = ActorConfigSchema.parse(input);
|
|
135
141
|
flattenActionHandlers(config.actions);
|
|
136
142
|
flattenActionInputSchemas(config.actions, config.actionInputSchemas);
|
|
143
|
+
flattenActionTraceSamplers(config.actions, (_a = config.tracing) == null ? void 0 : _a.actions);
|
|
137
144
|
return new ActorDefinition(config);
|
|
138
145
|
}
|
|
139
146
|
function isStaticActorDefinition(definition) {
|
|
@@ -382,25 +389,6 @@ var InlineWebSocketAdapter = class {
|
|
|
382
389
|
}
|
|
383
390
|
};
|
|
384
391
|
|
|
385
|
-
// src/common/engine.ts
|
|
386
|
-
var ENGINE_HOST = "127.0.0.1";
|
|
387
|
-
var ENGINE_PORT = 6420;
|
|
388
|
-
var ENGINE_ENDPOINT = buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT);
|
|
389
|
-
function buildEngineEndpoint(host, port) {
|
|
390
|
-
const urlHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
391
|
-
return `http://${urlHost}:${port}`;
|
|
392
|
-
}
|
|
393
|
-
function isLocalEngineEndpoint(endpoint) {
|
|
394
|
-
let url;
|
|
395
|
-
try {
|
|
396
|
-
url = new URL(endpoint);
|
|
397
|
-
} catch {
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
const hostname = url.hostname.toLowerCase();
|
|
401
|
-
return hostname === "localhost" || hostname === "0.0.0.0" || hostname === "::" || hostname === "[::]" || hostname === "::1" || hostname === "[::1]" || /^127(?:\.\d{1,3}){0,3}$/.test(hostname);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
392
|
// src/registry/log.ts
|
|
405
393
|
function logger2() {
|
|
406
394
|
return getLogger("registry");
|
|
@@ -507,20 +495,9 @@ import { z as z3 } from "zod";
|
|
|
507
495
|
|
|
508
496
|
// src/registry/config/envoy.ts
|
|
509
497
|
import { z } from "zod/v4";
|
|
510
|
-
var warnedMissingVersion = false;
|
|
511
498
|
var EnvoyConfigSchema = z.object({
|
|
512
499
|
poolName: z.string().default(() => getRivetPool() ?? "default"),
|
|
513
|
-
version: z.number().default(() =>
|
|
514
|
-
const version = getRivetEnvoyVersion();
|
|
515
|
-
if (version !== void 0) return version;
|
|
516
|
-
if (getNodeEnv() === "production" && !warnedMissingVersion) {
|
|
517
|
-
warnedMissingVersion = true;
|
|
518
|
-
getLogger("rivetkit").error(
|
|
519
|
-
"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"
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
return 1;
|
|
523
|
-
}),
|
|
500
|
+
version: z.number().default(() => getRivetEnvoyVersion() ?? 1),
|
|
524
501
|
// Deprecated.
|
|
525
502
|
totalSlots: z.number().default(() => getRivetTotalSlots() ?? 1e5),
|
|
526
503
|
envoyKey: z.string().optional()
|
|
@@ -825,7 +802,7 @@ var RegistryConfigSchema = z3.object({
|
|
|
825
802
|
config.startEngine || parsedEndpoint
|
|
826
803
|
);
|
|
827
804
|
const namespace = (parsedEndpoint == null ? void 0 : parsedEndpoint.namespace) ?? config.namespace ?? "default";
|
|
828
|
-
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);
|
|
829
806
|
const parsedPublicEndpoint = config.serverless.publicEndpoint ? tryParseEndpoint(ctx, {
|
|
830
807
|
endpoint: config.serverless.publicEndpoint,
|
|
831
808
|
path: ["serverless", "publicEndpoint"]
|
|
@@ -6054,6 +6031,13 @@ function withConnContext(runtime, ctx, conn, clientFactory, schemas = {}, databa
|
|
|
6054
6031
|
)
|
|
6055
6032
|
});
|
|
6056
6033
|
}
|
|
6034
|
+
function buildActorTracingConfig(actions, tracing) {
|
|
6035
|
+
if (tracing === void 0) return void 0;
|
|
6036
|
+
return {
|
|
6037
|
+
sampler: tracing.sampler,
|
|
6038
|
+
actions: flattenActionTraceSamplers(actions, tracing.actions)
|
|
6039
|
+
};
|
|
6040
|
+
}
|
|
6057
6041
|
function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
6058
6042
|
var _a;
|
|
6059
6043
|
const config = definition.config;
|
|
@@ -6067,6 +6051,10 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
|
6067
6051
|
hasDatabase: true,
|
|
6068
6052
|
remoteSqlite: usesRemoteSqlite,
|
|
6069
6053
|
sqliteProfiling,
|
|
6054
|
+
tracing: buildActorTracingConfig(
|
|
6055
|
+
definition.config.actions,
|
|
6056
|
+
definition.config.tracing
|
|
6057
|
+
),
|
|
6070
6058
|
enableActorRuntimeSocket: options.enableActorRuntimeSocket === true,
|
|
6071
6059
|
hasState: config.state !== void 0 || typeof config.createState === "function",
|
|
6072
6060
|
canHibernateWebsocket: typeof canHibernate === "boolean" ? canHibernate : void 0,
|
|
@@ -7806,7 +7794,23 @@ var Registry = class {
|
|
|
7806
7794
|
* Starts an actor envoy for standalone server deployments.
|
|
7807
7795
|
*/
|
|
7808
7796
|
#startEnvoy(config, printWelcome) {
|
|
7797
|
+
var _a;
|
|
7809
7798
|
if (!this.#runtimeServePromise) {
|
|
7799
|
+
const configuredEnvoyVersion = (_a = this.#config.envoy) == null ? void 0 : _a.version;
|
|
7800
|
+
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : getRivetEnvoyVersion() !== void 0 ? "environment" : "default";
|
|
7801
|
+
logger2().info({
|
|
7802
|
+
msg: "starting rivetkit envoy",
|
|
7803
|
+
rivetkitVersion: VERSION,
|
|
7804
|
+
envoyVersion: config.envoy.version,
|
|
7805
|
+
envoyVersionSource
|
|
7806
|
+
});
|
|
7807
|
+
if (envoyVersionSource === "default" && getNodeEnv() === "production") {
|
|
7808
|
+
logger2().error({
|
|
7809
|
+
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",
|
|
7810
|
+
envoyVersion: config.envoy.version,
|
|
7811
|
+
envoyVersionSource
|
|
7812
|
+
});
|
|
7813
|
+
}
|
|
7810
7814
|
const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
|
|
7811
7815
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
7812
7816
|
this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
|