rivetkit 2.0.37 → 2.0.39

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 (104) hide show
  1. package/dist/tsup/{chunk-G4N7FZMM.cjs → chunk-7E3RWMR6.cjs} +195 -93
  2. package/dist/tsup/chunk-7E3RWMR6.cjs.map +1 -0
  3. package/dist/tsup/{chunk-J6TX5EFW.js → chunk-BQ36VTSB.js} +108 -6
  4. package/dist/tsup/chunk-BQ36VTSB.js.map +1 -0
  5. package/dist/tsup/{chunk-4V7MS7SO.cjs → chunk-C64FV764.cjs} +3 -3
  6. package/dist/tsup/{chunk-4V7MS7SO.cjs.map → chunk-C64FV764.cjs.map} +1 -1
  7. package/dist/tsup/{chunk-XI335ZED.js → chunk-CDK6DRO2.js} +6 -4
  8. package/dist/tsup/chunk-CDK6DRO2.js.map +1 -0
  9. package/dist/tsup/{chunk-LYYTV7DN.cjs → chunk-DY4H3ASE.cjs} +50 -46
  10. package/dist/tsup/chunk-DY4H3ASE.cjs.map +1 -0
  11. package/dist/tsup/{chunk-B6BP74X3.cjs → chunk-KMYFL3OL.cjs} +318 -92
  12. package/dist/tsup/chunk-KMYFL3OL.cjs.map +1 -0
  13. package/dist/tsup/{chunk-22NKW7F5.cjs → chunk-MZPYVTVG.cjs} +9 -9
  14. package/dist/tsup/{chunk-22NKW7F5.cjs.map → chunk-MZPYVTVG.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-RBA5AQTB.js → chunk-OJZRCEIA.js} +5 -5
  16. package/dist/tsup/{chunk-RXA3ZMCL.js → chunk-PHCD25XO.js} +2 -2
  17. package/dist/tsup/{chunk-5XGZXH74.js → chunk-PVKUXMOA.js} +264 -38
  18. package/dist/tsup/chunk-PVKUXMOA.js.map +1 -0
  19. package/dist/tsup/{chunk-FIUSIG6J.js → chunk-T7IPDBWH.js} +8 -4
  20. package/dist/tsup/{chunk-FIUSIG6J.js.map → chunk-T7IPDBWH.js.map} +1 -1
  21. package/dist/tsup/{chunk-5VVIFC6M.cjs → chunk-UAX5E3EU.cjs} +443 -369
  22. package/dist/tsup/chunk-UAX5E3EU.cjs.map +1 -0
  23. package/dist/tsup/{chunk-X5IX3YPO.cjs → chunk-X72X7I7T.cjs} +6 -4
  24. package/dist/tsup/chunk-X72X7I7T.cjs.map +1 -0
  25. package/dist/tsup/{chunk-ZQBSQ6H3.js → chunk-XU74APB4.js} +208 -134
  26. package/dist/tsup/chunk-XU74APB4.js.map +1 -0
  27. package/dist/tsup/client/mod.cjs +5 -5
  28. package/dist/tsup/client/mod.d.cts +3 -3
  29. package/dist/tsup/client/mod.d.ts +3 -3
  30. package/dist/tsup/client/mod.js +4 -4
  31. package/dist/tsup/common/log.cjs +2 -2
  32. package/dist/tsup/common/log.js +1 -1
  33. package/dist/tsup/common/websocket.cjs +3 -3
  34. package/dist/tsup/common/websocket.js +2 -2
  35. package/dist/tsup/{config--NjwiYlS.d.cts → config-BuBlMs6C.d.cts} +238 -60
  36. package/dist/tsup/{config-CRuzI6n4.d.ts → config-CBwo4ooA.d.ts} +238 -60
  37. package/dist/tsup/{driver-yKjYx9Yy.d.cts → driver-CPXmh8f8.d.cts} +1 -1
  38. package/dist/tsup/{driver-BcmckRaF.d.ts → driver-DxWa6HUO.d.ts} +1 -1
  39. package/dist/tsup/driver-helpers/mod.cjs +3 -3
  40. package/dist/tsup/driver-helpers/mod.d.cts +2 -2
  41. package/dist/tsup/driver-helpers/mod.d.ts +2 -2
  42. package/dist/tsup/driver-helpers/mod.js +2 -2
  43. package/dist/tsup/driver-test-suite/mod.cjs +81 -35
  44. package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
  45. package/dist/tsup/driver-test-suite/mod.d.cts +2 -2
  46. package/dist/tsup/driver-test-suite/mod.d.ts +2 -2
  47. package/dist/tsup/driver-test-suite/mod.js +407 -361
  48. package/dist/tsup/driver-test-suite/mod.js.map +1 -1
  49. package/dist/tsup/{kv-CTM8sCvx.d.cts → keys-Chhy4ylv.d.cts} +1 -0
  50. package/dist/tsup/{kv-CTM8sCvx.d.ts → keys-Chhy4ylv.d.ts} +1 -0
  51. package/dist/tsup/mod.cjs +19 -7
  52. package/dist/tsup/mod.cjs.map +1 -1
  53. package/dist/tsup/mod.d.cts +5 -5
  54. package/dist/tsup/mod.d.ts +5 -5
  55. package/dist/tsup/mod.js +18 -6
  56. package/dist/tsup/test/mod.cjs +7 -7
  57. package/dist/tsup/test/mod.d.cts +1 -1
  58. package/dist/tsup/test/mod.d.ts +1 -1
  59. package/dist/tsup/test/mod.js +6 -6
  60. package/dist/tsup/utils.cjs +2 -2
  61. package/dist/tsup/utils.js +1 -1
  62. package/package.json +6 -4
  63. package/src/actor/config.ts +198 -2
  64. package/src/actor/contexts/base/actor.ts +12 -0
  65. package/src/actor/instance/connection-manager.ts +1 -1
  66. package/src/actor/instance/keys.ts +29 -0
  67. package/src/actor/instance/kv.ts +240 -14
  68. package/src/actor/instance/mod.ts +5 -4
  69. package/src/actor/instance/state-manager.ts +1 -1
  70. package/src/actor/mod.ts +2 -1
  71. package/src/actor/router-websocket-endpoints.ts +2 -1
  72. package/src/client/actor-conn.ts +70 -81
  73. package/src/client/actor-handle.ts +35 -15
  74. package/src/client/actor-query.ts +47 -0
  75. package/src/client/errors.ts +22 -58
  76. package/src/client/mod.ts +1 -1
  77. package/src/client/utils.ts +33 -0
  78. package/src/driver-helpers/utils.ts +1 -1
  79. package/src/driver-test-suite/mod.ts +3 -0
  80. package/src/driver-test-suite/test-inline-client-driver.ts +3 -0
  81. package/src/driver-test-suite/tests/actor-kv.ts +44 -0
  82. package/src/driver-test-suite/utils.ts +4 -0
  83. package/src/drivers/engine/actor-driver.ts +3 -3
  84. package/src/drivers/file-system/manager.ts +5 -0
  85. package/src/manager/driver.ts +8 -3
  86. package/src/manager-api/actors.ts +1 -20
  87. package/src/registry/config/index.ts +68 -0
  88. package/src/remote-manager-driver/actor-http-client.ts +5 -3
  89. package/src/remote-manager-driver/actor-websocket-client.ts +18 -7
  90. package/src/remote-manager-driver/mod.ts +21 -1
  91. package/src/serverless/router.test.ts +166 -0
  92. package/src/serverless/router.ts +58 -5
  93. package/src/utils/env-vars.ts +4 -1
  94. package/dist/tsup/chunk-5VVIFC6M.cjs.map +0 -1
  95. package/dist/tsup/chunk-5XGZXH74.js.map +0 -1
  96. package/dist/tsup/chunk-B6BP74X3.cjs.map +0 -1
  97. package/dist/tsup/chunk-G4N7FZMM.cjs.map +0 -1
  98. package/dist/tsup/chunk-J6TX5EFW.js.map +0 -1
  99. package/dist/tsup/chunk-LYYTV7DN.cjs.map +0 -1
  100. package/dist/tsup/chunk-X5IX3YPO.cjs.map +0 -1
  101. package/dist/tsup/chunk-XI335ZED.js.map +0 -1
  102. package/dist/tsup/chunk-ZQBSQ6H3.js.map +0 -1
  103. /package/dist/tsup/{chunk-RBA5AQTB.js.map → chunk-OJZRCEIA.js.map} +0 -0
  104. /package/dist/tsup/{chunk-RXA3ZMCL.js.map → chunk-PHCD25XO.js.map} +0 -0
@@ -9,13 +9,13 @@
9
9
 
10
10
 
11
11
 
12
- var _chunk5VVIFC6Mcjs = require('../chunk-5VVIFC6M.cjs');
13
- require('../chunk-4V7MS7SO.cjs');
12
+ var _chunkUAX5E3EUcjs = require('../chunk-UAX5E3EU.cjs');
13
+ require('../chunk-C64FV764.cjs');
14
14
 
15
15
 
16
- var _chunkB6BP74X3cjs = require('../chunk-B6BP74X3.cjs');
16
+ var _chunkKMYFL3OLcjs = require('../chunk-KMYFL3OL.cjs');
17
17
  require('../chunk-KDFWJKMJ.cjs');
18
- require('../chunk-X5IX3YPO.cjs');
18
+ require('../chunk-X72X7I7T.cjs');
19
19
  require('../chunk-SNAUKDDK.cjs');
20
20
  require('../chunk-GBENOENJ.cjs');
21
21
 
@@ -30,5 +30,5 @@ require('../chunk-GBENOENJ.cjs');
30
30
 
31
31
 
32
32
 
33
- exports.ActorClientError = _chunk5VVIFC6Mcjs.ActorClientError; exports.ActorConnDisposed = _chunk5VVIFC6Mcjs.ActorConnDisposed; exports.ActorConnRaw = _chunk5VVIFC6Mcjs.ActorConnRaw; exports.ActorDefinition = _chunk5VVIFC6Mcjs.ActorDefinition; exports.ActorError = _chunk5VVIFC6Mcjs.ActorError; exports.ActorHandleRaw = _chunk5VVIFC6Mcjs.ActorHandleRaw; exports.InternalError = _chunk5VVIFC6Mcjs.InternalError; exports.KV_KEYS = _chunkB6BP74X3cjs.KEYS; exports.MalformedResponseMessage = _chunk5VVIFC6Mcjs.MalformedResponseMessage; exports.ManagerError = _chunk5VVIFC6Mcjs.ManagerError; exports.createClient = _chunk5VVIFC6Mcjs.createClient;
33
+ exports.ActorClientError = _chunkUAX5E3EUcjs.ActorClientError; exports.ActorConnDisposed = _chunkUAX5E3EUcjs.ActorConnDisposed; exports.ActorConnRaw = _chunkUAX5E3EUcjs.ActorConnRaw; exports.ActorDefinition = _chunkUAX5E3EUcjs.ActorDefinition; exports.ActorError = _chunkUAX5E3EUcjs.ActorError; exports.ActorHandleRaw = _chunkUAX5E3EUcjs.ActorHandleRaw; exports.InternalError = _chunkUAX5E3EUcjs.InternalError; exports.KV_KEYS = _chunkKMYFL3OLcjs.KEYS; exports.MalformedResponseMessage = _chunkUAX5E3EUcjs.MalformedResponseMessage; exports.ManagerError = _chunkUAX5E3EUcjs.ManagerError; exports.createClient = _chunkUAX5E3EUcjs.createClient;
34
34
  //# sourceMappingURL=mod.cjs.map
@@ -1,6 +1,6 @@
1
- import { a7 as Registry, C as Client } from '../config--NjwiYlS.cjs';
2
- export { au as ActorAccessor, al as ActorActionFunction, ae as ActorClientError, am as ActorConn, af as ActorConnDisposed, ar as ActorConnRaw, an as ActorConnStatus, f as ActorDefinition, ag as ActorError, as as ActorHandle, at as ActorHandleRaw, l as AnyActorDefinition, av as ClientRaw, ao as ConnectionStateCallback, aw as CreateOptions, ak as CreateRequest, E as Encoding, ap as EventUnsubscribe, ax as ExtractActorsFromRegistry, ay as ExtractRegistryFromClient, az as GetOptions, aA as GetWithIdOptions, ah as InternalError, ai as MalformedResponseMessage, aj as ManagerError, aB as QueryOptions, aC as Region, aq as StatusChangeCallback } from '../config--NjwiYlS.cjs';
3
- export { K as KV_KEYS } from '../kv-CTM8sCvx.cjs';
1
+ import { aa as Registry, C as Client } from '../config-BuBlMs6C.cjs';
2
+ export { aC as ActorAccessor, at as ActorActionFunction, am as ActorClientError, au as ActorConn, an as ActorConnDisposed, az as ActorConnRaw, av as ActorConnStatus, f as ActorDefinition, ao as ActorError, aA as ActorHandle, aB as ActorHandleRaw, l as AnyActorDefinition, aD as ClientRaw, aw as ConnectionStateCallback, aE as CreateOptions, as as CreateRequest, E as Encoding, ax as EventUnsubscribe, aF as ExtractActorsFromRegistry, aG as ExtractRegistryFromClient, aH as GetOptions, aI as GetWithIdOptions, ap as InternalError, aq as MalformedResponseMessage, ar as ManagerError, aJ as QueryOptions, aK as Region, ay as StatusChangeCallback } from '../config-BuBlMs6C.cjs';
3
+ export { K as KV_KEYS } from '../keys-Chhy4ylv.cjs';
4
4
  import z from 'zod';
5
5
  import { GetUpgradeWebSocket } from '../utils.cjs';
6
6
  import '@rivetkit/virtual-websocket';
@@ -1,6 +1,6 @@
1
- import { a7 as Registry, C as Client } from '../config-CRuzI6n4.js';
2
- export { au as ActorAccessor, al as ActorActionFunction, ae as ActorClientError, am as ActorConn, af as ActorConnDisposed, ar as ActorConnRaw, an as ActorConnStatus, f as ActorDefinition, ag as ActorError, as as ActorHandle, at as ActorHandleRaw, l as AnyActorDefinition, av as ClientRaw, ao as ConnectionStateCallback, aw as CreateOptions, ak as CreateRequest, E as Encoding, ap as EventUnsubscribe, ax as ExtractActorsFromRegistry, ay as ExtractRegistryFromClient, az as GetOptions, aA as GetWithIdOptions, ah as InternalError, ai as MalformedResponseMessage, aj as ManagerError, aB as QueryOptions, aC as Region, aq as StatusChangeCallback } from '../config-CRuzI6n4.js';
3
- export { K as KV_KEYS } from '../kv-CTM8sCvx.js';
1
+ import { aa as Registry, C as Client } from '../config-CBwo4ooA.js';
2
+ export { aC as ActorAccessor, at as ActorActionFunction, am as ActorClientError, au as ActorConn, an as ActorConnDisposed, az as ActorConnRaw, av as ActorConnStatus, f as ActorDefinition, ao as ActorError, aA as ActorHandle, aB as ActorHandleRaw, l as AnyActorDefinition, aD as ClientRaw, aw as ConnectionStateCallback, aE as CreateOptions, as as CreateRequest, E as Encoding, ax as EventUnsubscribe, aF as ExtractActorsFromRegistry, aG as ExtractRegistryFromClient, aH as GetOptions, aI as GetWithIdOptions, ap as InternalError, aq as MalformedResponseMessage, ar as ManagerError, aJ as QueryOptions, aK as Region, ay as StatusChangeCallback } from '../config-CBwo4ooA.js';
3
+ export { K as KV_KEYS } from '../keys-Chhy4ylv.js';
4
4
  import z from 'zod';
5
5
  import { GetUpgradeWebSocket } from '../utils.js';
6
6
  import '@rivetkit/virtual-websocket';
@@ -9,13 +9,13 @@ import {
9
9
  MalformedResponseMessage,
10
10
  ManagerError,
11
11
  createClient
12
- } from "../chunk-ZQBSQ6H3.js";
13
- import "../chunk-RXA3ZMCL.js";
12
+ } from "../chunk-XU74APB4.js";
13
+ import "../chunk-PHCD25XO.js";
14
14
  import {
15
15
  KEYS
16
- } from "../chunk-5XGZXH74.js";
16
+ } from "../chunk-PVKUXMOA.js";
17
17
  import "../chunk-E6ZE2YEA.js";
18
- import "../chunk-XI335ZED.js";
18
+ import "../chunk-CDK6DRO2.js";
19
19
  import "../chunk-2YHR67M4.js";
20
20
  export {
21
21
  ActorClientError,
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkX5IX3YPOcjs = require('../chunk-X5IX3YPO.cjs');
9
+ var _chunkX72X7I7Tcjs = require('../chunk-X72X7I7T.cjs');
10
10
  require('../chunk-SNAUKDDK.cjs');
11
11
  require('../chunk-GBENOENJ.cjs');
12
12
 
@@ -17,5 +17,5 @@ require('../chunk-GBENOENJ.cjs');
17
17
 
18
18
 
19
19
 
20
- exports.LogLevelSchema = _chunkX5IX3YPOcjs.LogLevelSchema; exports.configureBaseLogger = _chunkX5IX3YPOcjs.configureBaseLogger; exports.configureDefaultLogger = _chunkX5IX3YPOcjs.configureDefaultLogger; exports.getBaseLogger = _chunkX5IX3YPOcjs.getBaseLogger; exports.getIncludeTarget = _chunkX5IX3YPOcjs.getIncludeTarget; exports.getLogger = _chunkX5IX3YPOcjs.getLogger; exports.getPinoLevel = _chunkX5IX3YPOcjs.getPinoLevel;
20
+ exports.LogLevelSchema = _chunkX72X7I7Tcjs.LogLevelSchema; exports.configureBaseLogger = _chunkX72X7I7Tcjs.configureBaseLogger; exports.configureDefaultLogger = _chunkX72X7I7Tcjs.configureDefaultLogger; exports.getBaseLogger = _chunkX72X7I7Tcjs.getBaseLogger; exports.getIncludeTarget = _chunkX72X7I7Tcjs.getIncludeTarget; exports.getLogger = _chunkX72X7I7Tcjs.getLogger; exports.getPinoLevel = _chunkX72X7I7Tcjs.getPinoLevel;
21
21
  //# sourceMappingURL=log.cjs.map
@@ -6,7 +6,7 @@ import {
6
6
  getIncludeTarget,
7
7
  getLogger,
8
8
  getPinoLevel
9
- } from "../chunk-XI335ZED.js";
9
+ } from "../chunk-CDK6DRO2.js";
10
10
  import "../chunk-2YHR67M4.js";
11
11
  export {
12
12
  LogLevelSchema,
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk4V7MS7SOcjs = require('../chunk-4V7MS7SO.cjs');
4
- require('../chunk-X5IX3YPO.cjs');
3
+ var _chunkC64FV764cjs = require('../chunk-C64FV764.cjs');
4
+ require('../chunk-X72X7I7T.cjs');
5
5
  require('../chunk-SNAUKDDK.cjs');
6
6
  require('../chunk-GBENOENJ.cjs');
7
7
 
8
8
 
9
- exports.importWebSocket = _chunk4V7MS7SOcjs.importWebSocket;
9
+ exports.importWebSocket = _chunkC64FV764cjs.importWebSocket;
10
10
  //# sourceMappingURL=websocket.cjs.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  importWebSocket
3
- } from "../chunk-RXA3ZMCL.js";
4
- import "../chunk-XI335ZED.js";
3
+ } from "../chunk-PHCD25XO.js";
4
+ import "../chunk-CDK6DRO2.js";
5
5
  import "../chunk-2YHR67M4.js";
6
6
  export {
7
7
  importWebSocket
@@ -28,60 +28,6 @@ type DatabaseProvider<DB extends {
28
28
  onMigrate: (client: DB) => void | Promise<void>;
29
29
  };
30
30
 
31
- declare class ActorClientError extends Error {
32
- }
33
- declare class InternalError extends ActorClientError {
34
- }
35
- declare class ManagerError extends ActorClientError {
36
- constructor(error: string, opts?: ErrorOptions);
37
- }
38
- declare class MalformedResponseMessage extends ActorClientError {
39
- constructor(cause?: unknown);
40
- }
41
- declare class ActorError extends ActorClientError {
42
- readonly group: string;
43
- readonly code: string;
44
- readonly metadata?: unknown | undefined;
45
- __type: string;
46
- constructor(group: string, code: string, message: string, metadata?: unknown | undefined);
47
- }
48
- declare class ActorConnDisposed extends ActorClientError {
49
- constructor();
50
- }
51
- /**
52
- * Errors from serverless connection workflow.
53
- * Matches ServerlessConnectionError from API.
54
- */
55
- type ServerlessConnectionError = {
56
- http_error: {
57
- status_code: number;
58
- body: string;
59
- };
60
- } | "stream_ended_early" | {
61
- connection_error: {
62
- message: string;
63
- };
64
- } | "invalid_base64" | {
65
- invalid_payload: {
66
- message: string;
67
- };
68
- } | "runner_config_not_found" | "runner_config_not_serverless" | "namespace_not_found";
69
- /**
70
- * Actor error details from API response.
71
- * Matches ActorError from API.
72
- */
73
- type ActorErrorDetails = {
74
- serverless_error: ServerlessConnectionError;
75
- } | {
76
- no_capacity: {
77
- runner_name: string;
78
- };
79
- } | {
80
- runner_no_response: {
81
- runner_id: string;
82
- };
83
- };
84
-
85
31
  type ManagerDriverBuilder = (config: RegistryConfig) => ManagerDriver;
86
32
  interface ManagerDriver {
87
33
  getForId(input: GetForIdInput): Promise<ActorOutput | undefined>;
@@ -93,6 +39,12 @@ interface ManagerDriver {
93
39
  openWebSocket(path: string, actorId: string, encoding: Encoding, params: unknown): Promise<UniversalWebSocket>;
94
40
  proxyRequest(c: Context, actorRequest: Request, actorId: string): Promise<Response>;
95
41
  proxyWebSocket(c: Context, path: string, actorId: string, encoding: Encoding, params: unknown): Promise<Response>;
42
+ /**
43
+ * Build a public gateway URL for a specific actor.
44
+ *
45
+ * This lives on the driver because the base endpoint varies by runtime.
46
+ */
47
+ buildGatewayUrl(actorId: string): Promise<string>;
96
48
  displayInformation(): ManagerDisplayInformation;
97
49
  extraStartupLog?: () => Record<string, unknown>;
98
50
  modifyManagerRouter?: (config: RegistryConfig, router: Hono) => void;
@@ -146,7 +98,7 @@ interface ActorOutput {
146
98
  connectableTs?: number | null;
147
99
  sleepTs?: number | null;
148
100
  destroyTs?: number | null;
149
- error?: ActorErrorDetails | null;
101
+ error?: unknown;
150
102
  }
151
103
 
152
104
  type ActorDriverBuilder = (config: RegistryConfig, managerDriver: ManagerDriver, inlineClient: AnyClient) => ActorDriver;
@@ -392,6 +344,99 @@ type RegistryConfigInput<A extends RegistryActors> = Omit<z.input<typeof Registr
392
344
  declare function buildActorNames(config: RegistryConfig): Record<string, {
393
345
  metadata: Record<string, any>;
394
346
  }>;
347
+ declare const DocInspectorConfigSchema: z.ZodOptional<z.ZodObject<{
348
+ enabled: z.ZodOptional<z.ZodBoolean>;
349
+ token: z.ZodOptional<z.ZodString>;
350
+ defaultEndpoint: z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strip>>;
352
+ declare const DocConfigureRunnerPoolSchema: z.ZodOptional<z.ZodObject<{
353
+ name: z.ZodOptional<z.ZodString>;
354
+ url: z.ZodString;
355
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
356
+ maxRunners: z.ZodOptional<z.ZodNumber>;
357
+ minRunners: z.ZodOptional<z.ZodNumber>;
358
+ requestLifespan: z.ZodOptional<z.ZodNumber>;
359
+ runnersMargin: z.ZodOptional<z.ZodNumber>;
360
+ slotsPerRunner: z.ZodOptional<z.ZodNumber>;
361
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
362
+ }, z.core.$strip>>;
363
+ declare const DocServerlessConfigSchema: z.ZodObject<{
364
+ spawnEngine: z.ZodOptional<z.ZodBoolean>;
365
+ engineVersion: z.ZodOptional<z.ZodString>;
366
+ configureRunnerPool: z.ZodOptional<z.ZodObject<{
367
+ name: z.ZodOptional<z.ZodString>;
368
+ url: z.ZodString;
369
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
370
+ maxRunners: z.ZodOptional<z.ZodNumber>;
371
+ minRunners: z.ZodOptional<z.ZodNumber>;
372
+ requestLifespan: z.ZodOptional<z.ZodNumber>;
373
+ runnersMargin: z.ZodOptional<z.ZodNumber>;
374
+ slotsPerRunner: z.ZodOptional<z.ZodNumber>;
375
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
376
+ }, z.core.$strip>>;
377
+ basePath: z.ZodOptional<z.ZodString>;
378
+ publicEndpoint: z.ZodOptional<z.ZodString>;
379
+ publicToken: z.ZodOptional<z.ZodString>;
380
+ }, z.core.$strip>;
381
+ declare const DocRunnerConfigSchema: z.ZodObject<{
382
+ totalSlots: z.ZodOptional<z.ZodNumber>;
383
+ runnerName: z.ZodOptional<z.ZodString>;
384
+ runnerKey: z.ZodOptional<z.ZodString>;
385
+ version: z.ZodOptional<z.ZodNumber>;
386
+ }, z.core.$strip>;
387
+ declare const DocRegistryConfigSchema: z.ZodObject<{
388
+ use: z.ZodRecord<z.ZodString, z.ZodUnknown>;
389
+ maxIncomingMessageSize: z.ZodOptional<z.ZodNumber>;
390
+ maxOutgoingMessageSize: z.ZodOptional<z.ZodNumber>;
391
+ noWelcome: z.ZodOptional<z.ZodBoolean>;
392
+ logging: z.ZodOptional<z.ZodObject<{
393
+ level: z.ZodOptional<z.ZodEnum<{
394
+ error: "error";
395
+ trace: "trace";
396
+ fatal: "fatal";
397
+ warn: "warn";
398
+ info: "info";
399
+ debug: "debug";
400
+ silent: "silent";
401
+ }>>;
402
+ }, z.core.$strip>>;
403
+ endpoint: z.ZodOptional<z.ZodString>;
404
+ token: z.ZodOptional<z.ZodString>;
405
+ namespace: z.ZodOptional<z.ZodString>;
406
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
407
+ serveManager: z.ZodOptional<z.ZodBoolean>;
408
+ managerBasePath: z.ZodOptional<z.ZodString>;
409
+ managerPort: z.ZodOptional<z.ZodNumber>;
410
+ inspector: z.ZodOptional<z.ZodObject<{
411
+ enabled: z.ZodOptional<z.ZodBoolean>;
412
+ token: z.ZodOptional<z.ZodString>;
413
+ defaultEndpoint: z.ZodOptional<z.ZodString>;
414
+ }, z.core.$strip>>;
415
+ serverless: z.ZodOptional<z.ZodObject<{
416
+ spawnEngine: z.ZodOptional<z.ZodBoolean>;
417
+ engineVersion: z.ZodOptional<z.ZodString>;
418
+ configureRunnerPool: z.ZodOptional<z.ZodObject<{
419
+ name: z.ZodOptional<z.ZodString>;
420
+ url: z.ZodString;
421
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
422
+ maxRunners: z.ZodOptional<z.ZodNumber>;
423
+ minRunners: z.ZodOptional<z.ZodNumber>;
424
+ requestLifespan: z.ZodOptional<z.ZodNumber>;
425
+ runnersMargin: z.ZodOptional<z.ZodNumber>;
426
+ slotsPerRunner: z.ZodOptional<z.ZodNumber>;
427
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
428
+ }, z.core.$strip>>;
429
+ basePath: z.ZodOptional<z.ZodString>;
430
+ publicEndpoint: z.ZodOptional<z.ZodString>;
431
+ publicToken: z.ZodOptional<z.ZodString>;
432
+ }, z.core.$strip>>;
433
+ runner: z.ZodOptional<z.ZodObject<{
434
+ totalSlots: z.ZodOptional<z.ZodNumber>;
435
+ runnerName: z.ZodOptional<z.ZodString>;
436
+ runnerKey: z.ZodOptional<z.ZodString>;
437
+ version: z.ZodOptional<z.ZodNumber>;
438
+ }, z.core.$strip>>;
439
+ }, z.core.$strip>;
395
440
 
396
441
  type AnyActorDefinition = ActorDefinition<any, any, any, any, any, any, any>;
397
442
  declare class ActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, R extends Actions<S, CP, CS, V, I, DB>> {
@@ -686,6 +731,27 @@ type ActorDefinitionActions<AD extends AnyActorDefinition> = AD extends ActorDef
686
731
  [K in keyof R]: R[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Return> : never;
687
732
  } : never;
688
733
 
734
+ declare class ActorClientError extends Error {
735
+ }
736
+ declare class InternalError extends ActorClientError {
737
+ }
738
+ declare class ManagerError extends ActorClientError {
739
+ constructor(error: string, opts?: ErrorOptions);
740
+ }
741
+ declare class MalformedResponseMessage extends ActorClientError {
742
+ constructor(cause?: unknown);
743
+ }
744
+ declare class ActorError extends ActorClientError {
745
+ readonly group: string;
746
+ readonly code: string;
747
+ readonly metadata?: unknown | undefined;
748
+ __type: string;
749
+ constructor(group: string, code: string, message: string, metadata?: unknown | undefined);
750
+ }
751
+ declare class ActorConnDisposed extends ActorClientError {
752
+ constructor();
753
+ }
754
+
689
755
  /**
690
756
  * Connection status for an actor connection.
691
757
  *
@@ -902,13 +968,15 @@ declare class ActorHandleRaw {
902
968
  */
903
969
  websocket(path?: string, protocols?: string | string[]): Promise<WebSocket>;
904
970
  /**
905
- * Resolves the actor to get its unique actor ID
906
- *
907
- * @returns {Promise<string>} - A promise that resolves to the actor's ID
971
+ * Resolves the actor to get its unique actor ID.
908
972
  */
909
973
  resolve({ signal }?: {
910
974
  signal?: AbortSignal;
911
975
  }): Promise<string>;
976
+ /**
977
+ * Returns the raw URL for routing traffic to the actor.
978
+ */
979
+ getGatewayUrl(): Promise<string>;
912
980
  }
913
981
  /**
914
982
  * Stateless handle to a actor. Allows calling actor's remote procedure calls with inferred types
@@ -1172,6 +1240,61 @@ declare class ActorInspector {
1172
1240
  executeAction(name: string, params: ArrayBuffer): Promise<ArrayBuffer>;
1173
1241
  }
1174
1242
 
1243
+ /**
1244
+ * User-facing KV storage interface exposed on ActorContext.
1245
+ */
1246
+ type KvValueType = "text" | "arrayBuffer" | "binary";
1247
+ type KvKeyType = "text" | "binary";
1248
+ type KvKey = Uint8Array | string;
1249
+ type KvValueTypeMap = {
1250
+ text: string;
1251
+ arrayBuffer: ArrayBuffer;
1252
+ binary: Uint8Array;
1253
+ };
1254
+ type KvKeyTypeMap = {
1255
+ text: string;
1256
+ binary: Uint8Array;
1257
+ };
1258
+ type KvValueOptions<T extends KvValueType = "text"> = {
1259
+ type?: T;
1260
+ };
1261
+ type KvListOptions<T extends KvValueType = "text", K extends KvKeyType = "text"> = KvValueOptions<T> & {
1262
+ keyType?: K;
1263
+ };
1264
+ declare class ActorKv {
1265
+ #private;
1266
+ constructor(driver: ActorDriver, actorId: string);
1267
+ /**
1268
+ * Get a single value by key.
1269
+ */
1270
+ get<T extends KvValueType = "text">(key: KvKey, options?: KvValueOptions<T>): Promise<KvValueTypeMap[T] | null>;
1271
+ /**
1272
+ * Get multiple values by keys.
1273
+ */
1274
+ getBatch<T extends KvValueType = "text">(keys: KvKey[], options?: KvValueOptions<T>): Promise<(KvValueTypeMap[T] | null)[]>;
1275
+ /**
1276
+ * Put a single key-value pair.
1277
+ */
1278
+ put<T extends KvValueType = KvValueType>(key: KvKey, value: KvValueTypeMap[T], options?: KvValueOptions<T>): Promise<void>;
1279
+ /**
1280
+ * Put multiple key-value pairs.
1281
+ */
1282
+ putBatch<T extends KvValueType = KvValueType>(entries: [KvKey, KvValueTypeMap[T]][], options?: KvValueOptions<T>): Promise<void>;
1283
+ /**
1284
+ * Delete a single key.
1285
+ */
1286
+ delete(key: KvKey): Promise<void>;
1287
+ /**
1288
+ * Delete multiple keys.
1289
+ */
1290
+ deleteBatch(keys: KvKey[]): Promise<void>;
1291
+ /**
1292
+ * List all keys with a given prefix.
1293
+ * Returns key-value pairs where keys have the user prefix removed.
1294
+ */
1295
+ list<T extends KvValueType = "text", K extends KvKeyType = "text">(prefix: KvKeyTypeMap[K], options?: KvListOptions<T, K>): Promise<[KvKeyTypeMap[K], KvValueTypeMap[T]][]>;
1296
+ }
1297
+
1175
1298
  declare class Schedule {
1176
1299
  #private;
1177
1300
  constructor(actor: AnyActorInstance);
@@ -1185,6 +1308,10 @@ declare class Schedule {
1185
1308
  declare class ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider> {
1186
1309
  #private;
1187
1310
  constructor(actor: ActorInstance<TState, TConnParams, TConnState, TVars, TInput, TDatabase>);
1311
+ /**
1312
+ * Gets the KV storage interface.
1313
+ */
1314
+ get kv(): ActorKv;
1188
1315
  /**
1189
1316
  * Get the actor state
1190
1317
  *
@@ -2041,7 +2168,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2041
2168
  * @param opts Additional options including the original HTTP upgrade request
2042
2169
  */
2043
2170
  onWebSocket?: (c: WebSocketContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase>, websocket: UniversalWebSocket) => void | Promise<void>;
2044
- actions: TActions;
2171
+ actions?: TActions;
2045
2172
  }
2046
2173
  type ActorDatabaseConfig<TDatabase extends AnyDatabaseProvider> = {
2047
2174
  /**
@@ -2054,5 +2181,56 @@ type ActorConfigInput<TState = undefined, TConnParams = undefined, TConnState =
2054
2181
  types?: ActorTypes<TState, TConnParams, TConnState, TVars, TInput, TDatabase>;
2055
2182
  } & Omit<z.input<typeof ActorConfigSchema>, "actions" | "onCreate" | "onDestroy" | "onWake" | "onSleep" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase> & ActorDatabaseConfig<TDatabase>;
2056
2183
  declare function test<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase>>(input: ActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TActions>): ActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase>;
2184
+ declare const DocActorOptionsSchema: z.ZodObject<{
2185
+ createVarsTimeout: z.ZodOptional<z.ZodNumber>;
2186
+ createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
2187
+ onConnectTimeout: z.ZodOptional<z.ZodNumber>;
2188
+ onSleepTimeout: z.ZodOptional<z.ZodNumber>;
2189
+ onDestroyTimeout: z.ZodOptional<z.ZodNumber>;
2190
+ stateSaveInterval: z.ZodOptional<z.ZodNumber>;
2191
+ actionTimeout: z.ZodOptional<z.ZodNumber>;
2192
+ waitUntilTimeout: z.ZodOptional<z.ZodNumber>;
2193
+ connectionLivenessTimeout: z.ZodOptional<z.ZodNumber>;
2194
+ connectionLivenessInterval: z.ZodOptional<z.ZodNumber>;
2195
+ noSleep: z.ZodOptional<z.ZodBoolean>;
2196
+ sleepTimeout: z.ZodOptional<z.ZodNumber>;
2197
+ canHibernateWebSocket: z.ZodOptional<z.ZodBoolean>;
2198
+ }, z.core.$strip>;
2199
+ declare const DocActorConfigSchema: z.ZodObject<{
2200
+ state: z.ZodOptional<z.ZodUnknown>;
2201
+ createState: z.ZodOptional<z.ZodUnknown>;
2202
+ connState: z.ZodOptional<z.ZodUnknown>;
2203
+ createConnState: z.ZodOptional<z.ZodUnknown>;
2204
+ vars: z.ZodOptional<z.ZodUnknown>;
2205
+ createVars: z.ZodOptional<z.ZodUnknown>;
2206
+ db: z.ZodOptional<z.ZodUnknown>;
2207
+ onCreate: z.ZodOptional<z.ZodUnknown>;
2208
+ onDestroy: z.ZodOptional<z.ZodUnknown>;
2209
+ onWake: z.ZodOptional<z.ZodUnknown>;
2210
+ onSleep: z.ZodOptional<z.ZodUnknown>;
2211
+ onStateChange: z.ZodOptional<z.ZodUnknown>;
2212
+ onBeforeConnect: z.ZodOptional<z.ZodUnknown>;
2213
+ onConnect: z.ZodOptional<z.ZodUnknown>;
2214
+ onDisconnect: z.ZodOptional<z.ZodUnknown>;
2215
+ onBeforeActionResponse: z.ZodOptional<z.ZodUnknown>;
2216
+ onRequest: z.ZodOptional<z.ZodUnknown>;
2217
+ onWebSocket: z.ZodOptional<z.ZodUnknown>;
2218
+ actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2219
+ options: z.ZodOptional<z.ZodObject<{
2220
+ createVarsTimeout: z.ZodOptional<z.ZodNumber>;
2221
+ createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
2222
+ onConnectTimeout: z.ZodOptional<z.ZodNumber>;
2223
+ onSleepTimeout: z.ZodOptional<z.ZodNumber>;
2224
+ onDestroyTimeout: z.ZodOptional<z.ZodNumber>;
2225
+ stateSaveInterval: z.ZodOptional<z.ZodNumber>;
2226
+ actionTimeout: z.ZodOptional<z.ZodNumber>;
2227
+ waitUntilTimeout: z.ZodOptional<z.ZodNumber>;
2228
+ connectionLivenessTimeout: z.ZodOptional<z.ZodNumber>;
2229
+ connectionLivenessInterval: z.ZodOptional<z.ZodNumber>;
2230
+ noSleep: z.ZodOptional<z.ZodBoolean>;
2231
+ sleepTimeout: z.ZodOptional<z.ZodNumber>;
2232
+ canHibernateWebSocket: z.ZodOptional<z.ZodBoolean>;
2233
+ }, z.core.$strip>>;
2234
+ }, z.core.$strip>;
2057
2235
 
2058
- export { type WakeContextOf as $, type ActorDriver as A, BeforeActionResponseContext as B, type Client as C, type BeforeActionResponseContextOf as D, type Encoding as E, BeforeConnectContext as F, type BeforeConnectContextOf as G, ConnectContext as H, type ConnectContextOf as I, CreateContext as J, type CreateContextOf as K, CreateConnStateContext as L, type CreateConnStateContextOf as M, CreateVarsContext as N, type CreateVarsContextOf as O, DestroyContext as P, type DestroyContextOf as Q, type RegistryConfig as R, DisconnectContext as S, type DisconnectContextOf as T, RequestContext as U, type RequestContextOf as V, SleepContext as W, type SleepContextOf as X, StateChangeContext as Y, type StateChangeContextOf as Z, WakeContext as _, type AnyConn as a, WebSocketContext as a0, type WebSocketContextOf as a1, type RegistryActors as a2, RegistryConfigSchema as a3, type FetchHandler as a4, type ServerlessHandler as a5, type LegacyStartServerOutput as a6, Registry as a7, setup as a8, ActorsSchema as a9, type GetWithIdOptions as aA, type QueryOptions as aB, type Region as aC, type ManagerDriver as aD, ActorInstance as aE, type ActorOutput as aF, type CreateInput as aG, type GetForIdInput as aH, type GetOrCreateWithKeyInput as aI, type GetWithKeyInput as aJ, type ListActorsInput as aK, type ManagerDisplayInformation as aL, type ManagerDriverBuilder as aM, type ActorDriverBuilder as aN, TestConfigSchema as aa, type TestConfig as ab, type RegistryConfigInput as ac, buildActorNames as ad, ActorClientError as ae, ActorConnDisposed as af, ActorError as ag, InternalError as ah, MalformedResponseMessage as ai, ManagerError as aj, type CreateRequest as ak, type ActorActionFunction as al, type ActorConn as am, type ActorConnStatus as an, type ConnectionStateCallback as ao, type EventUnsubscribe as ap, type StatusChangeCallback as aq, ActorConnRaw as ar, type ActorHandle as as, ActorHandleRaw as at, type ActorAccessor as au, ClientRaw as av, type CreateOptions as aw, type ExtractActorsFromRegistry as ax, type ExtractRegistryFromClient as ay, type GetOptions as az, type AnyActorInstance as b, type AnyDatabaseProvider as c, type Actions as d, type ActorConfigInput as e, ActorDefinition as f, type AnyClient as g, createClientWithDriver as h, type ActorQuery as i, type ActorKey as j, Conn as k, type AnyActorDefinition as l, lookupInRegistry as m, type ActorTypes as n, ActorConfigSchema as o, type AuthIntent as p, type ActorConfig as q, ActorContext as r, type ActorContextOf as s, test as t, ConnContext as u, type ConnContextOf as v, ConnInitContext as w, type ConnInitContextOf as x, ActionContext as y, type ActionContextOf as z };
2236
+ export { StateChangeContext as $, type ActorDriver as A, ActionContext as B, type Client as C, DocActorOptionsSchema as D, type Encoding as E, type ActionContextOf as F, BeforeActionResponseContext as G, type BeforeActionResponseContextOf as H, BeforeConnectContext as I, type BeforeConnectContextOf as J, ConnectContext as K, type ConnectContextOf as L, CreateContext as M, type CreateContextOf as N, CreateConnStateContext as O, type CreateConnStateContextOf as P, CreateVarsContext as Q, type RegistryConfig as R, type CreateVarsContextOf as S, DestroyContext as T, type DestroyContextOf as U, DisconnectContext as V, type DisconnectContextOf as W, RequestContext as X, type RequestContextOf as Y, SleepContext as Z, type SleepContextOf as _, type AnyConn as a, type StateChangeContextOf as a0, WakeContext as a1, type WakeContextOf as a2, WebSocketContext as a3, type WebSocketContextOf as a4, type RegistryActors as a5, RegistryConfigSchema as a6, type FetchHandler as a7, type ServerlessHandler as a8, type LegacyStartServerOutput as a9, type ActorHandle as aA, ActorHandleRaw as aB, type ActorAccessor as aC, ClientRaw as aD, type CreateOptions as aE, type ExtractActorsFromRegistry as aF, type ExtractRegistryFromClient as aG, type GetOptions as aH, type GetWithIdOptions as aI, type QueryOptions as aJ, type Region as aK, type ManagerDriver as aL, ActorInstance as aM, type ActorOutput as aN, type CreateInput as aO, type GetForIdInput as aP, type GetOrCreateWithKeyInput as aQ, type GetWithKeyInput as aR, type ListActorsInput as aS, type ManagerDisplayInformation as aT, type ManagerDriverBuilder as aU, type ActorDriverBuilder as aV, Registry as aa, setup as ab, ActorsSchema as ac, TestConfigSchema as ad, type TestConfig as ae, type RegistryConfigInput as af, buildActorNames as ag, DocInspectorConfigSchema as ah, DocConfigureRunnerPoolSchema as ai, DocServerlessConfigSchema as aj, DocRunnerConfigSchema as ak, DocRegistryConfigSchema as al, ActorClientError as am, ActorConnDisposed as an, ActorError as ao, InternalError as ap, MalformedResponseMessage as aq, ManagerError as ar, type CreateRequest as as, type ActorActionFunction as at, type ActorConn as au, type ActorConnStatus as av, type ConnectionStateCallback as aw, type EventUnsubscribe as ax, type StatusChangeCallback as ay, ActorConnRaw as az, type AnyActorInstance as b, type AnyDatabaseProvider as c, type Actions as d, type ActorConfigInput as e, ActorDefinition as f, type AnyClient as g, createClientWithDriver as h, type ActorQuery as i, type ActorKey as j, Conn as k, type AnyActorDefinition as l, lookupInRegistry as m, ActorKv as n, type ActorTypes as o, ActorConfigSchema as p, type AuthIntent as q, type ActorConfig as r, DocActorConfigSchema as s, test as t, ActorContext as u, type ActorContextOf as v, ConnContext as w, type ConnContextOf as x, ConnInitContext as y, type ConnInitContextOf as z };