rivetkit 2.3.12-rc.4 → 2.3.12

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 (121) hide show
  1. package/dist/browser/client.d.ts +17 -4
  2. package/dist/browser/client.js +32 -24
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +2 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/actor/errors.cjs +2 -2
  7. package/dist/tsup/actor/errors.js +1 -1
  8. package/dist/tsup/agent-os/index.cjs +3 -19
  9. package/dist/tsup/agent-os/index.cjs.map +1 -1
  10. package/dist/tsup/agent-os/index.d.cts +17 -4
  11. package/dist/tsup/agent-os/index.d.ts +17 -4
  12. package/dist/tsup/agent-os/index.js +3 -19
  13. package/dist/tsup/agent-os/index.js.map +1 -1
  14. package/dist/tsup/{chunk-SPJORZMM.cjs → chunk-2JSYYH6P.cjs} +1 -1
  15. package/dist/tsup/chunk-2JSYYH6P.cjs.map +1 -0
  16. package/dist/tsup/{chunk-IAH47VDZ.cjs → chunk-4KGXFC6M.cjs} +2 -19
  17. package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
  18. package/dist/tsup/{chunk-DLQSZ6Q7.js → chunk-6W5VGLFT.js} +2 -19
  19. package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
  20. package/dist/tsup/{chunk-JIOLC5I2.cjs → chunk-AN7WO7BM.cjs} +3 -3
  21. package/dist/tsup/{chunk-JIOLC5I2.cjs.map → chunk-AN7WO7BM.cjs.map} +1 -1
  22. package/dist/tsup/{chunk-AF2VKCFA.js → chunk-EBXARMGI.js} +2 -2
  23. package/dist/tsup/{chunk-4LRWLBTR.cjs → chunk-FGQABMXZ.cjs} +3 -3
  24. package/dist/tsup/{chunk-4LRWLBTR.cjs.map → chunk-FGQABMXZ.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-BQ7YJ3PG.js → chunk-GEN4NHXM.js} +2 -2
  26. package/dist/tsup/{chunk-NVMHEG5J.js → chunk-JYTXOMM7.js} +2 -2
  27. package/dist/tsup/{chunk-NKLM6C5A.cjs → chunk-MEF7RVQ7.cjs} +10 -10
  28. package/dist/tsup/{chunk-NKLM6C5A.cjs.map → chunk-MEF7RVQ7.cjs.map} +1 -1
  29. package/dist/tsup/{chunk-64DT44V2.js → chunk-MF42PRF2.js} +9 -3
  30. package/dist/tsup/chunk-MF42PRF2.js.map +1 -0
  31. package/dist/tsup/{chunk-IXBD7BXC.js → chunk-OUQUIBVW.js} +1 -1
  32. package/dist/tsup/chunk-OUQUIBVW.js.map +1 -0
  33. package/dist/tsup/{chunk-S3GXVCIM.cjs → chunk-PW2VSGUR.cjs} +4 -4
  34. package/dist/tsup/{chunk-S3GXVCIM.cjs.map → chunk-PW2VSGUR.cjs.map} +1 -1
  35. package/dist/tsup/{chunk-GMBCKV6C.js → chunk-RBXJWAJB.js} +3 -3
  36. package/dist/tsup/{chunk-XDYECGCT.cjs → chunk-SSPTEGTX.cjs} +7 -7
  37. package/dist/tsup/{chunk-XDYECGCT.cjs.map → chunk-SSPTEGTX.cjs.map} +1 -1
  38. package/dist/tsup/{chunk-ARFTQ5HY.cjs → chunk-TAG6UEL5.cjs} +17 -11
  39. package/dist/tsup/chunk-TAG6UEL5.cjs.map +1 -0
  40. package/dist/tsup/{chunk-OCXHNHGQ.cjs → chunk-TXUHVBKH.cjs} +3 -3
  41. package/dist/tsup/{chunk-OCXHNHGQ.cjs.map → chunk-TXUHVBKH.cjs.map} +1 -1
  42. package/dist/tsup/{chunk-F7G5WHOD.cjs → chunk-TZPNSOG2.cjs} +203 -195
  43. package/dist/tsup/chunk-TZPNSOG2.cjs.map +1 -0
  44. package/dist/tsup/{chunk-O74736N5.js → chunk-VOYNLY57.js} +41 -33
  45. package/dist/tsup/chunk-VOYNLY57.js.map +1 -0
  46. package/dist/tsup/{chunk-3CBQIP37.js → chunk-XUODFCRJ.js} +4 -4
  47. package/dist/tsup/{chunk-P5JJG4KY.js → chunk-ZIPXAVKR.js} +2 -2
  48. package/dist/tsup/client/mod.cjs +6 -6
  49. package/dist/tsup/client/mod.d.cts +2 -2
  50. package/dist/tsup/client/mod.d.ts +2 -2
  51. package/dist/tsup/client/mod.js +5 -5
  52. package/dist/tsup/common/log.cjs +3 -3
  53. package/dist/tsup/common/log.js +2 -2
  54. package/dist/tsup/common/websocket.cjs +4 -4
  55. package/dist/tsup/common/websocket.js +3 -3
  56. package/dist/tsup/{config-DzaddF-j.d.ts → config-BGTanB_3.d.ts} +19 -10
  57. package/dist/tsup/{config-VxDc6yMu.d.cts → config-NHz6oMb9.d.cts} +19 -10
  58. package/dist/tsup/{context-Cn8CIrOR.d.cts → context-DB8zG_Ib.d.cts} +1 -1
  59. package/dist/tsup/{context-B6HYokje.d.ts → context-SHomdVV8.d.ts} +1 -1
  60. package/dist/tsup/db/drizzle.cjs +3 -3
  61. package/dist/tsup/db/drizzle.js +2 -2
  62. package/dist/tsup/db/mod.cjs +4 -4
  63. package/dist/tsup/db/mod.js +3 -3
  64. package/dist/tsup/dynamic/mod.cjs +2 -2
  65. package/dist/tsup/dynamic/mod.d.cts +1 -1
  66. package/dist/tsup/dynamic/mod.d.ts +1 -1
  67. package/dist/tsup/dynamic/mod.js +1 -1
  68. package/dist/tsup/inspector/mod.cjs +6 -6
  69. package/dist/tsup/inspector/mod.js +5 -5
  70. package/dist/tsup/inspector/workflow.cjs +5 -5
  71. package/dist/tsup/inspector/workflow.js +4 -4
  72. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  73. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  74. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  75. package/dist/tsup/inspector-tab/mod.js +1 -1
  76. package/dist/tsup/mod.cjs +444 -199
  77. package/dist/tsup/mod.cjs.map +1 -1
  78. package/dist/tsup/mod.d.cts +3 -3
  79. package/dist/tsup/mod.d.ts +3 -3
  80. package/dist/tsup/mod.js +323 -78
  81. package/dist/tsup/mod.js.map +1 -1
  82. package/dist/tsup/test/mod.cjs +7 -7
  83. package/dist/tsup/test/mod.d.cts +1 -1
  84. package/dist/tsup/test/mod.d.ts +1 -1
  85. package/dist/tsup/test/mod.js +5 -5
  86. package/dist/tsup/utils.cjs +3 -3
  87. package/dist/tsup/utils.js +2 -2
  88. package/dist/tsup/workflow/mod.cjs +14 -14
  89. package/dist/tsup/workflow/mod.d.cts +3 -3
  90. package/dist/tsup/workflow/mod.d.ts +3 -3
  91. package/dist/tsup/workflow/mod.js +6 -6
  92. package/package.json +9 -8
  93. package/src/actor/config.test.ts +0 -8
  94. package/src/actor/config.ts +1 -24
  95. package/src/actor/errors.ts +2 -1
  96. package/src/client/actor-handle.ts +10 -3
  97. package/src/client/raw-utils.ts +8 -0
  98. package/src/common/actor-router-consts.ts +2 -0
  99. package/src/engine-client/actor-http-client.ts +6 -22
  100. package/src/engine-client/mod.ts +1 -1
  101. package/src/registry/config/index.ts +27 -1
  102. package/src/registry/index.ts +48 -14
  103. package/src/registry/napi-runtime.ts +32 -5
  104. package/src/registry/native-http.ts +225 -0
  105. package/src/registry/native.ts +130 -65
  106. package/src/registry/runtime.ts +30 -3
  107. package/src/utils/env-vars.ts +4 -0
  108. package/dist/tsup/chunk-64DT44V2.js.map +0 -1
  109. package/dist/tsup/chunk-ARFTQ5HY.cjs.map +0 -1
  110. package/dist/tsup/chunk-DLQSZ6Q7.js.map +0 -1
  111. package/dist/tsup/chunk-F7G5WHOD.cjs.map +0 -1
  112. package/dist/tsup/chunk-IAH47VDZ.cjs.map +0 -1
  113. package/dist/tsup/chunk-IXBD7BXC.js.map +0 -1
  114. package/dist/tsup/chunk-O74736N5.js.map +0 -1
  115. package/dist/tsup/chunk-SPJORZMM.cjs.map +0 -1
  116. /package/dist/tsup/{chunk-AF2VKCFA.js.map → chunk-EBXARMGI.js.map} +0 -0
  117. /package/dist/tsup/{chunk-BQ7YJ3PG.js.map → chunk-GEN4NHXM.js.map} +0 -0
  118. /package/dist/tsup/{chunk-NVMHEG5J.js.map → chunk-JYTXOMM7.js.map} +0 -0
  119. /package/dist/tsup/{chunk-GMBCKV6C.js.map → chunk-RBXJWAJB.js.map} +0 -0
  120. /package/dist/tsup/{chunk-3CBQIP37.js.map → chunk-XUODFCRJ.js.map} +0 -0
  121. /package/dist/tsup/{chunk-P5JJG4KY.js.map → chunk-ZIPXAVKR.js.map} +0 -0
@@ -238,6 +238,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
238
238
  engineHost: z.ZodDefault<z.ZodOptional<z.ZodString>>;
239
239
  enginePort: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
240
240
  engineVersion: z.ZodDefault<z.ZodOptional<z.ZodString>>;
241
+ startServices: z.ZodOptional<z.ZodBoolean>;
241
242
  configurePool: z.ZodOptional<z.ZodOptional<z.ZodObject<{
242
243
  name: z.ZodOptional<z.ZodString>;
243
244
  url: z.ZodString;
@@ -269,6 +270,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
269
270
  backend: "local" | "remote";
270
271
  } | undefined;
271
272
  endpoint: string | undefined;
273
+ startServices: boolean;
272
274
  namespace: string;
273
275
  token: string | undefined;
274
276
  publicEndpoint: string | undefined;
@@ -376,6 +378,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
376
378
  };
377
379
  staticDir?: string | undefined;
378
380
  httpHost?: string | undefined;
381
+ startServices?: boolean | undefined;
379
382
  configurePool?: {
380
383
  url: string;
381
384
  name?: string | undefined;
@@ -645,6 +648,12 @@ interface RuntimeHttpRequest {
645
648
  headers?: Record<string, string>;
646
649
  body?: RuntimeBytes;
647
650
  }
651
+ interface RuntimeHttpResponseBodyStream {
652
+ cancelled(): Promise<void>;
653
+ write(chunk: Uint8Array): Promise<void>;
654
+ end(): Promise<void>;
655
+ error(message: string): Promise<void>;
656
+ }
648
657
  interface RuntimeStateDeltaPayload {
649
658
  state?: RuntimeBytes;
650
659
  connHibernation: Array<{
@@ -796,7 +805,6 @@ interface RuntimeSqlRunResult {
796
805
  interface RuntimeActorConfig {
797
806
  name?: string;
798
807
  icon?: string;
799
- maxActions?: number;
800
808
  hasDatabase?: boolean;
801
809
  remoteSqlite?: boolean;
802
810
  sqliteProfiling?: SqliteProfilingOptions;
@@ -853,6 +861,8 @@ interface RuntimeServeConfig {
853
861
  namespace: string;
854
862
  poolName: string;
855
863
  engineBinaryPath?: string;
864
+ startServices?: boolean;
865
+ servicesBinaryPath?: string;
856
866
  engineHost?: string;
857
867
  enginePort?: number;
858
868
  handleInspectorHttpInRuntime?: boolean;
@@ -877,12 +887,16 @@ interface RuntimeServerlessRequest {
877
887
  headers: Record<string, string>;
878
888
  body: RuntimeBytes;
879
889
  }
890
+ interface RuntimeApplicationRequest extends RuntimeServerlessRequest {
891
+ cancelToken?: CancellationTokenHandle;
892
+ }
880
893
  interface RuntimeApplicationResponse {
881
894
  status: number;
882
895
  headers: Record<string, string>;
883
- body: RuntimeBytes;
896
+ body?: RuntimeBytes;
897
+ stream?: boolean;
884
898
  }
885
- type RuntimeApplicationFetch = (request: RuntimeServerlessRequest) => Promise<RuntimeApplicationResponse>;
899
+ type RuntimeApplicationFetch = (request: RuntimeApplicationRequest, responseBodyStream?: RuntimeHttpResponseBodyStream) => Promise<RuntimeApplicationResponse>;
886
900
  interface RuntimeApplicationListenerConfig extends RuntimeListenerConfig {
887
901
  application: RuntimeApplicationFetch;
888
902
  }
@@ -2007,7 +2021,6 @@ declare const ActorConfigSchema: z$1.ZodObject<{
2007
2021
  options: z$1.ZodPrefault<z$1.ZodObject<{
2008
2022
  name: z$1.ZodOptional<z$1.ZodString>;
2009
2023
  icon: z$1.ZodOptional<z$1.ZodString>;
2010
- maxActions: z$1.ZodDefault<z$1.ZodNumber>;
2011
2024
  enableActorRuntimeSocket: z$1.ZodDefault<z$1.ZodBoolean>;
2012
2025
  canHibernateWebSocket: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
2013
2026
  createVarsTimeout: z$1.ZodDefault<z$1.ZodNumber>;
@@ -238,6 +238,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
238
238
  engineHost: z.ZodDefault<z.ZodOptional<z.ZodString>>;
239
239
  enginePort: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
240
240
  engineVersion: z.ZodDefault<z.ZodOptional<z.ZodString>>;
241
+ startServices: z.ZodOptional<z.ZodBoolean>;
241
242
  configurePool: z.ZodOptional<z.ZodOptional<z.ZodObject<{
242
243
  name: z.ZodOptional<z.ZodString>;
243
244
  url: z.ZodString;
@@ -269,6 +270,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
269
270
  backend: "local" | "remote";
270
271
  } | undefined;
271
272
  endpoint: string | undefined;
273
+ startServices: boolean;
272
274
  namespace: string;
273
275
  token: string | undefined;
274
276
  publicEndpoint: string | undefined;
@@ -376,6 +378,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
376
378
  };
377
379
  staticDir?: string | undefined;
378
380
  httpHost?: string | undefined;
381
+ startServices?: boolean | undefined;
379
382
  configurePool?: {
380
383
  url: string;
381
384
  name?: string | undefined;
@@ -645,6 +648,12 @@ interface RuntimeHttpRequest {
645
648
  headers?: Record<string, string>;
646
649
  body?: RuntimeBytes;
647
650
  }
651
+ interface RuntimeHttpResponseBodyStream {
652
+ cancelled(): Promise<void>;
653
+ write(chunk: Uint8Array): Promise<void>;
654
+ end(): Promise<void>;
655
+ error(message: string): Promise<void>;
656
+ }
648
657
  interface RuntimeStateDeltaPayload {
649
658
  state?: RuntimeBytes;
650
659
  connHibernation: Array<{
@@ -796,7 +805,6 @@ interface RuntimeSqlRunResult {
796
805
  interface RuntimeActorConfig {
797
806
  name?: string;
798
807
  icon?: string;
799
- maxActions?: number;
800
808
  hasDatabase?: boolean;
801
809
  remoteSqlite?: boolean;
802
810
  sqliteProfiling?: SqliteProfilingOptions;
@@ -853,6 +861,8 @@ interface RuntimeServeConfig {
853
861
  namespace: string;
854
862
  poolName: string;
855
863
  engineBinaryPath?: string;
864
+ startServices?: boolean;
865
+ servicesBinaryPath?: string;
856
866
  engineHost?: string;
857
867
  enginePort?: number;
858
868
  handleInspectorHttpInRuntime?: boolean;
@@ -877,12 +887,16 @@ interface RuntimeServerlessRequest {
877
887
  headers: Record<string, string>;
878
888
  body: RuntimeBytes;
879
889
  }
890
+ interface RuntimeApplicationRequest extends RuntimeServerlessRequest {
891
+ cancelToken?: CancellationTokenHandle;
892
+ }
880
893
  interface RuntimeApplicationResponse {
881
894
  status: number;
882
895
  headers: Record<string, string>;
883
- body: RuntimeBytes;
896
+ body?: RuntimeBytes;
897
+ stream?: boolean;
884
898
  }
885
- type RuntimeApplicationFetch = (request: RuntimeServerlessRequest) => Promise<RuntimeApplicationResponse>;
899
+ type RuntimeApplicationFetch = (request: RuntimeApplicationRequest, responseBodyStream?: RuntimeHttpResponseBodyStream) => Promise<RuntimeApplicationResponse>;
886
900
  interface RuntimeApplicationListenerConfig extends RuntimeListenerConfig {
887
901
  application: RuntimeApplicationFetch;
888
902
  }
@@ -2007,7 +2021,6 @@ declare const ActorConfigSchema: z$1.ZodObject<{
2007
2021
  options: z$1.ZodPrefault<z$1.ZodObject<{
2008
2022
  name: z$1.ZodOptional<z$1.ZodString>;
2009
2023
  icon: z$1.ZodOptional<z$1.ZodString>;
2010
- maxActions: z$1.ZodDefault<z$1.ZodNumber>;
2011
2024
  enableActorRuntimeSocket: z$1.ZodDefault<z$1.ZodBoolean>;
2012
2025
  canHibernateWebSocket: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodBoolean, z$1.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
2013
2026
  createVarsTimeout: z$1.ZodDefault<z$1.ZodNumber>;
@@ -88,7 +88,6 @@ function formatActionPath(path) {
88
88
 
89
89
  // src/actor/config.ts
90
90
  var DEFAULT_SLEEP_GRACE_PERIOD = 15e3;
91
- var DEFAULT_MAX_ACTIONS = 128;
92
91
  var zFunction = () => z.custom((val) => typeof val === "function");
93
92
  var zActionTree = z.custom((value) => {
94
93
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -184,8 +183,6 @@ var GlobalActorOptionsBaseSchema = z.object({
184
183
  name: z.string().optional(),
185
184
  /** Icon for the actor in the Inspector UI. Can be an emoji or FontAwesome icon name. */
186
185
  icon: z.string().optional(),
187
- /** Maximum number of action handlers that may be defined on this actor. */
188
- maxActions: z.number().int().nonnegative().default(DEFAULT_MAX_ACTIONS),
189
186
  /** Enables the experimental Actor Runtime Socket for this actor. */
190
187
  enableActorRuntimeSocket: z.boolean().default(false),
191
188
  /**
@@ -277,26 +274,12 @@ var ActorConfigSchema = z.object({
277
274
  message: "Cannot define both 'vars' and 'createVars'",
278
275
  path: ["vars"]
279
276
  }
280
- ).superRefine((data, ctx) => {
281
- const actionCount = Object.keys(
282
- flattenActionHandlers(data.actions)
283
- ).length;
284
- if (actionCount > data.options.maxActions) {
285
- ctx.addIssue({
286
- code: "custom",
287
- message: `Actor defines ${actionCount} actions, but maxActions is ${data.options.maxActions}`,
288
- path: ["actions"]
289
- });
290
- }
291
- });
277
+ );
292
278
  var DocActorOptionsSchema = z.object({
293
279
  name: z.string().optional().describe("Display name for the actor in the Inspector UI."),
294
280
  icon: z.string().optional().describe(
295
281
  "Icon for the actor in the Inspector UI. Can be an emoji (e.g., '\u{1F680}') or FontAwesome icon name (e.g., 'rocket')."
296
282
  ),
297
- maxActions: z.number().int().nonnegative().optional().describe(
298
- `Maximum number of action handlers that may be defined on this actor. Default: ${DEFAULT_MAX_ACTIONS}`
299
- ),
300
283
  enableActorRuntimeSocket: z.boolean().optional().describe(
301
284
  "Enables the experimental Actor Runtime Socket for this actor. Default: false"
302
285
  ),
@@ -437,7 +420,7 @@ function isRivetErrorCode(error, group, code) {
437
420
  // package.json
438
421
  var package_default = {
439
422
  name: "rivetkit",
440
- version: "2.3.12-rc.4",
423
+ version: "2.3.12",
441
424
  description: "Lightweight libraries for building stateful actors on edge platforms",
442
425
  license: "Apache-2.0",
443
426
  keywords: [
@@ -647,6 +630,7 @@ var package_default = {
647
630
  dependencies: {
648
631
  "@hono/zod-openapi": "^1.1.5",
649
632
  "@rivet-dev/agent-os-core": "^0.1.1",
633
+ "@rivet-dev/services": "^0.1.3",
650
634
  "@rivetkit/bare-ts": "^0.6.2",
651
635
  "@rivetkit/engine-cli": "workspace:*",
652
636
  "@rivetkit/engine-envoy-protocol": "workspace:*",