rivetkit 2.0.38 → 2.0.40

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 (99) hide show
  1. package/dist/tsup/{chunk-IWXMFQDT.cjs → chunk-4KNL47JA.cjs} +274 -80
  2. package/dist/tsup/chunk-4KNL47JA.cjs.map +1 -0
  3. package/dist/tsup/{chunk-UUEZVDRL.js → chunk-4T4UWXHN.js} +8 -4
  4. package/dist/tsup/{chunk-UUEZVDRL.js.map → chunk-4T4UWXHN.js.map} +1 -1
  5. package/dist/tsup/{chunk-LULP6HM2.cjs → chunk-6NBNCWEC.cjs} +313 -289
  6. package/dist/tsup/chunk-6NBNCWEC.cjs.map +1 -0
  7. package/dist/tsup/{chunk-WIZ4JGP6.js → chunk-7Q7R3QYT.js} +2 -2
  8. package/dist/tsup/{chunk-6WLJW57U.cjs → chunk-B5BMSBR4.cjs} +230 -128
  9. package/dist/tsup/chunk-B5BMSBR4.cjs.map +1 -0
  10. package/dist/tsup/{chunk-FZQHTGQX.cjs → chunk-D2HB4PM5.cjs} +9 -9
  11. package/dist/tsup/{chunk-FZQHTGQX.cjs.map → chunk-D2HB4PM5.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-IRTVRBJA.cjs → chunk-FB4TVPDQ.cjs} +50 -46
  13. package/dist/tsup/chunk-FB4TVPDQ.cjs.map +1 -0
  14. package/dist/tsup/{chunk-O433HWWG.cjs → chunk-HZOBB3KP.cjs} +2 -2
  15. package/dist/tsup/{chunk-O433HWWG.cjs.map → chunk-HZOBB3KP.cjs.map} +1 -1
  16. package/dist/tsup/{chunk-K2RNF2ZR.js → chunk-J2R742IE.js} +5 -5
  17. package/dist/tsup/{chunk-FA6FGAEC.js → chunk-J6YRLC6K.js} +143 -41
  18. package/dist/tsup/chunk-J6YRLC6K.js.map +1 -0
  19. package/dist/tsup/{chunk-MIOU6BF3.js → chunk-KVB2SG32.js} +219 -25
  20. package/dist/tsup/chunk-KVB2SG32.js.map +1 -0
  21. package/dist/tsup/{chunk-GFKZZG2A.cjs → chunk-XCDGPOZT.cjs} +3 -3
  22. package/dist/tsup/{chunk-GFKZZG2A.cjs.map → chunk-XCDGPOZT.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-EEL32AJM.js → chunk-XCRJ245S.js} +74 -50
  24. package/dist/tsup/chunk-XCRJ245S.js.map +1 -0
  25. package/dist/tsup/{chunk-4U45T5KW.js → chunk-ZUMPCWKF.js} +2 -2
  26. package/dist/tsup/{chunk-4U45T5KW.js.map → chunk-ZUMPCWKF.js.map} +1 -1
  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-CbIHPGKl.d.ts → config-OR5ZtHFa.d.ts} +75 -5
  36. package/dist/tsup/{config-CwJCQyP1.d.cts → config-cizn-tcF.d.cts} +75 -5
  37. package/dist/tsup/{driver-Lw_oORox.d.cts → driver-Bg4evbcN.d.cts} +1 -1
  38. package/dist/tsup/{driver-CMN823Lc.d.ts → driver-BrAG8ioa.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 +109 -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 +435 -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 +9 -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 +8 -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 +2 -2
  63. package/src/actor/config.ts +183 -34
  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/schedule-manager.ts +2 -1
  70. package/src/actor/instance/state-manager.ts +1 -1
  71. package/src/actor/mod.ts +2 -1
  72. package/src/actor/router-websocket-endpoints.test.ts +54 -0
  73. package/src/actor/router-websocket-endpoints.ts +11 -5
  74. package/src/client/actor-handle.ts +13 -3
  75. package/src/client/mod.ts +1 -1
  76. package/src/driver-helpers/utils.ts +1 -1
  77. package/src/driver-test-suite/mod.ts +3 -0
  78. package/src/driver-test-suite/test-inline-client-driver.ts +3 -0
  79. package/src/driver-test-suite/tests/actor-kv.ts +44 -0
  80. package/src/driver-test-suite/tests/raw-websocket.ts +40 -0
  81. package/src/driver-test-suite/utils.ts +4 -0
  82. package/src/drivers/engine/actor-driver.ts +3 -3
  83. package/src/drivers/file-system/manager.ts +5 -0
  84. package/src/engine-process/mod.ts +62 -7
  85. package/src/manager/driver.ts +7 -0
  86. package/src/registry/config/index.ts +6 -0
  87. package/src/registry/serve.ts +9 -5
  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 +10 -0
  91. package/dist/tsup/chunk-6WLJW57U.cjs.map +0 -1
  92. package/dist/tsup/chunk-EEL32AJM.js.map +0 -1
  93. package/dist/tsup/chunk-FA6FGAEC.js.map +0 -1
  94. package/dist/tsup/chunk-IRTVRBJA.cjs.map +0 -1
  95. package/dist/tsup/chunk-IWXMFQDT.cjs.map +0 -1
  96. package/dist/tsup/chunk-LULP6HM2.cjs.map +0 -1
  97. package/dist/tsup/chunk-MIOU6BF3.js.map +0 -1
  98. /package/dist/tsup/{chunk-WIZ4JGP6.js.map → chunk-7Q7R3QYT.js.map} +0 -0
  99. /package/dist/tsup/{chunk-K2RNF2ZR.js.map → chunk-J2R742IE.js.map} +0 -0
@@ -39,6 +39,12 @@ interface ManagerDriver {
39
39
  openWebSocket(path: string, actorId: string, encoding: Encoding, params: unknown): Promise<UniversalWebSocket>;
40
40
  proxyRequest(c: Context, actorRequest: Request, actorId: string): Promise<Response>;
41
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>;
42
48
  displayInformation(): ManagerDisplayInformation;
43
49
  extraStartupLog?: () => Record<string, unknown>;
44
50
  modifyManagerRouter?: (config: RegistryConfig, router: Hono) => void;
@@ -181,6 +187,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
181
187
  serveManager: z.ZodOptional<z.ZodBoolean>;
182
188
  managerBasePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
183
189
  managerPort: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
190
+ managerHost: z.ZodOptional<z.ZodString>;
184
191
  inspector: z.ZodDefault<z.ZodOptional<z.ZodObject<{
185
192
  enabled: z.ZodDefault<z.ZodBoolean>;
186
193
  token: z.ZodDefault<z.ZodOptional<z.ZodCustom<() => string, () => string>>>;
@@ -275,6 +282,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
275
282
  actor: ActorDriverBuilder;
276
283
  autoStartActorDriver: boolean;
277
284
  } | undefined;
285
+ managerHost?: string | undefined;
278
286
  }, {
279
287
  use: Record<string, AnyActorDefinition>;
280
288
  test: {
@@ -330,6 +338,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
330
338
  autoStartActorDriver: boolean;
331
339
  } | undefined;
332
340
  serveManager?: boolean | undefined;
341
+ managerHost?: string | undefined;
333
342
  }>>;
334
343
  type RegistryConfig = z.infer<typeof RegistryConfigSchema>;
335
344
  type RegistryConfigInput<A extends RegistryActors> = Omit<z.input<typeof RegistryConfigSchema>, "use"> & {
@@ -962,13 +971,15 @@ declare class ActorHandleRaw {
962
971
  */
963
972
  websocket(path?: string, protocols?: string | string[]): Promise<WebSocket>;
964
973
  /**
965
- * Resolves the actor to get its unique actor ID
966
- *
967
- * @returns {Promise<string>} - A promise that resolves to the actor's ID
974
+ * Resolves the actor to get its unique actor ID.
968
975
  */
969
976
  resolve({ signal }?: {
970
977
  signal?: AbortSignal;
971
978
  }): Promise<string>;
979
+ /**
980
+ * Returns the raw URL for routing traffic to the actor.
981
+ */
982
+ getGatewayUrl(): Promise<string>;
972
983
  }
973
984
  /**
974
985
  * Stateless handle to a actor. Allows calling actor's remote procedure calls with inferred types
@@ -1232,6 +1243,61 @@ declare class ActorInspector {
1232
1243
  executeAction(name: string, params: ArrayBuffer): Promise<ArrayBuffer>;
1233
1244
  }
1234
1245
 
1246
+ /**
1247
+ * User-facing KV storage interface exposed on ActorContext.
1248
+ */
1249
+ type KvValueType = "text" | "arrayBuffer" | "binary";
1250
+ type KvKeyType = "text" | "binary";
1251
+ type KvKey = Uint8Array | string;
1252
+ type KvValueTypeMap = {
1253
+ text: string;
1254
+ arrayBuffer: ArrayBuffer;
1255
+ binary: Uint8Array;
1256
+ };
1257
+ type KvKeyTypeMap = {
1258
+ text: string;
1259
+ binary: Uint8Array;
1260
+ };
1261
+ type KvValueOptions<T extends KvValueType = "text"> = {
1262
+ type?: T;
1263
+ };
1264
+ type KvListOptions<T extends KvValueType = "text", K extends KvKeyType = "text"> = KvValueOptions<T> & {
1265
+ keyType?: K;
1266
+ };
1267
+ declare class ActorKv {
1268
+ #private;
1269
+ constructor(driver: ActorDriver, actorId: string);
1270
+ /**
1271
+ * Get a single value by key.
1272
+ */
1273
+ get<T extends KvValueType = "text">(key: KvKey, options?: KvValueOptions<T>): Promise<KvValueTypeMap[T] | null>;
1274
+ /**
1275
+ * Get multiple values by keys.
1276
+ */
1277
+ getBatch<T extends KvValueType = "text">(keys: KvKey[], options?: KvValueOptions<T>): Promise<(KvValueTypeMap[T] | null)[]>;
1278
+ /**
1279
+ * Put a single key-value pair.
1280
+ */
1281
+ put<T extends KvValueType = KvValueType>(key: KvKey, value: KvValueTypeMap[T], options?: KvValueOptions<T>): Promise<void>;
1282
+ /**
1283
+ * Put multiple key-value pairs.
1284
+ */
1285
+ putBatch<T extends KvValueType = KvValueType>(entries: [KvKey, KvValueTypeMap[T]][], options?: KvValueOptions<T>): Promise<void>;
1286
+ /**
1287
+ * Delete a single key.
1288
+ */
1289
+ delete(key: KvKey): Promise<void>;
1290
+ /**
1291
+ * Delete multiple keys.
1292
+ */
1293
+ deleteBatch(keys: KvKey[]): Promise<void>;
1294
+ /**
1295
+ * List all keys with a given prefix.
1296
+ * Returns key-value pairs where keys have the user prefix removed.
1297
+ */
1298
+ list<T extends KvValueType = "text", K extends KvKeyType = "text">(prefix: KvKeyTypeMap[K], options?: KvListOptions<T, K>): Promise<[KvKeyTypeMap[K], KvValueTypeMap[T]][]>;
1299
+ }
1300
+
1235
1301
  declare class Schedule {
1236
1302
  #private;
1237
1303
  constructor(actor: AnyActorInstance);
@@ -1245,6 +1311,10 @@ declare class Schedule {
1245
1311
  declare class ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider> {
1246
1312
  #private;
1247
1313
  constructor(actor: ActorInstance<TState, TConnParams, TConnState, TVars, TInput, TDatabase>);
1314
+ /**
1315
+ * Gets the KV storage interface.
1316
+ */
1317
+ get kv(): ActorKv;
1248
1318
  /**
1249
1319
  * Get the actor state
1250
1320
  *
@@ -2101,7 +2171,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2101
2171
  * @param opts Additional options including the original HTTP upgrade request
2102
2172
  */
2103
2173
  onWebSocket?: (c: WebSocketContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase>, websocket: UniversalWebSocket) => void | Promise<void>;
2104
- actions: TActions;
2174
+ actions?: TActions;
2105
2175
  }
2106
2176
  type ActorDatabaseConfig<TDatabase extends AnyDatabaseProvider> = {
2107
2177
  /**
@@ -2166,4 +2236,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
2166
2236
  }, z.core.$strip>>;
2167
2237
  }, z.core.$strip>;
2168
2238
 
2169
- export { type StateChangeContextOf as $, type ActorDriver as A, type ActionContextOf as B, type Client as C, DocActorOptionsSchema as D, type Encoding as E, BeforeActionResponseContext as F, type BeforeActionResponseContextOf as G, BeforeConnectContext as H, type BeforeConnectContextOf as I, ConnectContext as J, type ConnectContextOf as K, CreateContext as L, type CreateContextOf as M, CreateConnStateContext as N, type CreateConnStateContextOf as O, CreateVarsContext as P, type CreateVarsContextOf as Q, type RegistryConfig as R, DestroyContext as S, type DestroyContextOf as T, DisconnectContext as U, type DisconnectContextOf as V, RequestContext as W, type RequestContextOf as X, SleepContext as Y, type SleepContextOf as Z, StateChangeContext as _, type AnyConn as a, WakeContext as a0, type WakeContextOf as a1, WebSocketContext as a2, type WebSocketContextOf as a3, type RegistryActors as a4, RegistryConfigSchema as a5, type FetchHandler as a6, type ServerlessHandler as a7, type LegacyStartServerOutput as a8, Registry as a9, ActorHandleRaw as aA, type ActorAccessor as aB, ClientRaw as aC, type CreateOptions as aD, type ExtractActorsFromRegistry as aE, type ExtractRegistryFromClient as aF, type GetOptions as aG, type GetWithIdOptions as aH, type QueryOptions as aI, type Region as aJ, type ManagerDriver as aK, ActorInstance as aL, type ActorOutput as aM, type CreateInput as aN, type GetForIdInput as aO, type GetOrCreateWithKeyInput as aP, type GetWithKeyInput as aQ, type ListActorsInput as aR, type ManagerDisplayInformation as aS, type ManagerDriverBuilder as aT, type ActorDriverBuilder as aU, setup as aa, ActorsSchema as ab, TestConfigSchema as ac, type TestConfig as ad, type RegistryConfigInput as ae, buildActorNames as af, DocInspectorConfigSchema as ag, DocConfigureRunnerPoolSchema as ah, DocServerlessConfigSchema as ai, DocRunnerConfigSchema as aj, DocRegistryConfigSchema as ak, ActorClientError as al, ActorConnDisposed as am, ActorError as an, InternalError as ao, MalformedResponseMessage as ap, ManagerError as aq, type CreateRequest as ar, type ActorActionFunction as as, type ActorConn as at, type ActorConnStatus as au, type ConnectionStateCallback as av, type EventUnsubscribe as aw, type StatusChangeCallback as ax, ActorConnRaw as ay, type ActorHandle 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, DocActorConfigSchema as r, ActorContext as s, test as t, type ActorContextOf as u, ConnContext as v, type ConnContextOf as w, ConnInitContext as x, type ConnInitContextOf as y, ActionContext as z };
2239
+ 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 };
@@ -39,6 +39,12 @@ interface ManagerDriver {
39
39
  openWebSocket(path: string, actorId: string, encoding: Encoding, params: unknown): Promise<UniversalWebSocket>;
40
40
  proxyRequest(c: Context, actorRequest: Request, actorId: string): Promise<Response>;
41
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>;
42
48
  displayInformation(): ManagerDisplayInformation;
43
49
  extraStartupLog?: () => Record<string, unknown>;
44
50
  modifyManagerRouter?: (config: RegistryConfig, router: Hono) => void;
@@ -181,6 +187,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
181
187
  serveManager: z.ZodOptional<z.ZodBoolean>;
182
188
  managerBasePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
183
189
  managerPort: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
190
+ managerHost: z.ZodOptional<z.ZodString>;
184
191
  inspector: z.ZodDefault<z.ZodOptional<z.ZodObject<{
185
192
  enabled: z.ZodDefault<z.ZodBoolean>;
186
193
  token: z.ZodDefault<z.ZodOptional<z.ZodCustom<() => string, () => string>>>;
@@ -275,6 +282,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
275
282
  actor: ActorDriverBuilder;
276
283
  autoStartActorDriver: boolean;
277
284
  } | undefined;
285
+ managerHost?: string | undefined;
278
286
  }, {
279
287
  use: Record<string, AnyActorDefinition>;
280
288
  test: {
@@ -330,6 +338,7 @@ declare const RegistryConfigSchema: z.ZodPipe<z.ZodObject<{
330
338
  autoStartActorDriver: boolean;
331
339
  } | undefined;
332
340
  serveManager?: boolean | undefined;
341
+ managerHost?: string | undefined;
333
342
  }>>;
334
343
  type RegistryConfig = z.infer<typeof RegistryConfigSchema>;
335
344
  type RegistryConfigInput<A extends RegistryActors> = Omit<z.input<typeof RegistryConfigSchema>, "use"> & {
@@ -962,13 +971,15 @@ declare class ActorHandleRaw {
962
971
  */
963
972
  websocket(path?: string, protocols?: string | string[]): Promise<WebSocket>;
964
973
  /**
965
- * Resolves the actor to get its unique actor ID
966
- *
967
- * @returns {Promise<string>} - A promise that resolves to the actor's ID
974
+ * Resolves the actor to get its unique actor ID.
968
975
  */
969
976
  resolve({ signal }?: {
970
977
  signal?: AbortSignal;
971
978
  }): Promise<string>;
979
+ /**
980
+ * Returns the raw URL for routing traffic to the actor.
981
+ */
982
+ getGatewayUrl(): Promise<string>;
972
983
  }
973
984
  /**
974
985
  * Stateless handle to a actor. Allows calling actor's remote procedure calls with inferred types
@@ -1232,6 +1243,61 @@ declare class ActorInspector {
1232
1243
  executeAction(name: string, params: ArrayBuffer): Promise<ArrayBuffer>;
1233
1244
  }
1234
1245
 
1246
+ /**
1247
+ * User-facing KV storage interface exposed on ActorContext.
1248
+ */
1249
+ type KvValueType = "text" | "arrayBuffer" | "binary";
1250
+ type KvKeyType = "text" | "binary";
1251
+ type KvKey = Uint8Array | string;
1252
+ type KvValueTypeMap = {
1253
+ text: string;
1254
+ arrayBuffer: ArrayBuffer;
1255
+ binary: Uint8Array;
1256
+ };
1257
+ type KvKeyTypeMap = {
1258
+ text: string;
1259
+ binary: Uint8Array;
1260
+ };
1261
+ type KvValueOptions<T extends KvValueType = "text"> = {
1262
+ type?: T;
1263
+ };
1264
+ type KvListOptions<T extends KvValueType = "text", K extends KvKeyType = "text"> = KvValueOptions<T> & {
1265
+ keyType?: K;
1266
+ };
1267
+ declare class ActorKv {
1268
+ #private;
1269
+ constructor(driver: ActorDriver, actorId: string);
1270
+ /**
1271
+ * Get a single value by key.
1272
+ */
1273
+ get<T extends KvValueType = "text">(key: KvKey, options?: KvValueOptions<T>): Promise<KvValueTypeMap[T] | null>;
1274
+ /**
1275
+ * Get multiple values by keys.
1276
+ */
1277
+ getBatch<T extends KvValueType = "text">(keys: KvKey[], options?: KvValueOptions<T>): Promise<(KvValueTypeMap[T] | null)[]>;
1278
+ /**
1279
+ * Put a single key-value pair.
1280
+ */
1281
+ put<T extends KvValueType = KvValueType>(key: KvKey, value: KvValueTypeMap[T], options?: KvValueOptions<T>): Promise<void>;
1282
+ /**
1283
+ * Put multiple key-value pairs.
1284
+ */
1285
+ putBatch<T extends KvValueType = KvValueType>(entries: [KvKey, KvValueTypeMap[T]][], options?: KvValueOptions<T>): Promise<void>;
1286
+ /**
1287
+ * Delete a single key.
1288
+ */
1289
+ delete(key: KvKey): Promise<void>;
1290
+ /**
1291
+ * Delete multiple keys.
1292
+ */
1293
+ deleteBatch(keys: KvKey[]): Promise<void>;
1294
+ /**
1295
+ * List all keys with a given prefix.
1296
+ * Returns key-value pairs where keys have the user prefix removed.
1297
+ */
1298
+ list<T extends KvValueType = "text", K extends KvKeyType = "text">(prefix: KvKeyTypeMap[K], options?: KvListOptions<T, K>): Promise<[KvKeyTypeMap[K], KvValueTypeMap[T]][]>;
1299
+ }
1300
+
1235
1301
  declare class Schedule {
1236
1302
  #private;
1237
1303
  constructor(actor: AnyActorInstance);
@@ -1245,6 +1311,10 @@ declare class Schedule {
1245
1311
  declare class ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider> {
1246
1312
  #private;
1247
1313
  constructor(actor: ActorInstance<TState, TConnParams, TConnState, TVars, TInput, TDatabase>);
1314
+ /**
1315
+ * Gets the KV storage interface.
1316
+ */
1317
+ get kv(): ActorKv;
1248
1318
  /**
1249
1319
  * Get the actor state
1250
1320
  *
@@ -2101,7 +2171,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2101
2171
  * @param opts Additional options including the original HTTP upgrade request
2102
2172
  */
2103
2173
  onWebSocket?: (c: WebSocketContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase>, websocket: UniversalWebSocket) => void | Promise<void>;
2104
- actions: TActions;
2174
+ actions?: TActions;
2105
2175
  }
2106
2176
  type ActorDatabaseConfig<TDatabase extends AnyDatabaseProvider> = {
2107
2177
  /**
@@ -2166,4 +2236,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
2166
2236
  }, z.core.$strip>>;
2167
2237
  }, z.core.$strip>;
2168
2238
 
2169
- export { type StateChangeContextOf as $, type ActorDriver as A, type ActionContextOf as B, type Client as C, DocActorOptionsSchema as D, type Encoding as E, BeforeActionResponseContext as F, type BeforeActionResponseContextOf as G, BeforeConnectContext as H, type BeforeConnectContextOf as I, ConnectContext as J, type ConnectContextOf as K, CreateContext as L, type CreateContextOf as M, CreateConnStateContext as N, type CreateConnStateContextOf as O, CreateVarsContext as P, type CreateVarsContextOf as Q, type RegistryConfig as R, DestroyContext as S, type DestroyContextOf as T, DisconnectContext as U, type DisconnectContextOf as V, RequestContext as W, type RequestContextOf as X, SleepContext as Y, type SleepContextOf as Z, StateChangeContext as _, type AnyConn as a, WakeContext as a0, type WakeContextOf as a1, WebSocketContext as a2, type WebSocketContextOf as a3, type RegistryActors as a4, RegistryConfigSchema as a5, type FetchHandler as a6, type ServerlessHandler as a7, type LegacyStartServerOutput as a8, Registry as a9, ActorHandleRaw as aA, type ActorAccessor as aB, ClientRaw as aC, type CreateOptions as aD, type ExtractActorsFromRegistry as aE, type ExtractRegistryFromClient as aF, type GetOptions as aG, type GetWithIdOptions as aH, type QueryOptions as aI, type Region as aJ, type ManagerDriver as aK, ActorInstance as aL, type ActorOutput as aM, type CreateInput as aN, type GetForIdInput as aO, type GetOrCreateWithKeyInput as aP, type GetWithKeyInput as aQ, type ListActorsInput as aR, type ManagerDisplayInformation as aS, type ManagerDriverBuilder as aT, type ActorDriverBuilder as aU, setup as aa, ActorsSchema as ab, TestConfigSchema as ac, type TestConfig as ad, type RegistryConfigInput as ae, buildActorNames as af, DocInspectorConfigSchema as ag, DocConfigureRunnerPoolSchema as ah, DocServerlessConfigSchema as ai, DocRunnerConfigSchema as aj, DocRegistryConfigSchema as ak, ActorClientError as al, ActorConnDisposed as am, ActorError as an, InternalError as ao, MalformedResponseMessage as ap, ManagerError as aq, type CreateRequest as ar, type ActorActionFunction as as, type ActorConn as at, type ActorConnStatus as au, type ConnectionStateCallback as av, type EventUnsubscribe as aw, type StatusChangeCallback as ax, ActorConnRaw as ay, type ActorHandle 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, DocActorConfigSchema as r, ActorContext as s, test as t, type ActorContextOf as u, ConnContext as v, type ConnContextOf as w, ConnInitContext as x, type ConnInitContextOf as y, ActionContext as z };
2239
+ 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 };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { aT as ManagerDriverBuilder, aU as ActorDriverBuilder } from './config-CwJCQyP1.cjs';
2
+ import { aU as ManagerDriverBuilder, aV as ActorDriverBuilder } from './config-cizn-tcF.cjs';
3
3
 
4
4
  declare const DriverConfigSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { aT as ManagerDriverBuilder, aU as ActorDriverBuilder } from './config-CbIHPGKl.js';
2
+ import { aU as ManagerDriverBuilder, aV as ActorDriverBuilder } from './config-OR5ZtHFa.js';
3
3
 
4
4
  declare const DriverConfigSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -17,9 +17,9 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkIWXMFQDTcjs = require('../chunk-IWXMFQDT.cjs');
20
+ var _chunk4KNL47JAcjs = require('../chunk-4KNL47JA.cjs');
21
21
  require('../chunk-KDFWJKMJ.cjs');
22
- require('../chunk-O433HWWG.cjs');
22
+ require('../chunk-HZOBB3KP.cjs');
23
23
  require('../chunk-SNAUKDDK.cjs');
24
24
  require('../chunk-GBENOENJ.cjs');
25
25
 
@@ -41,5 +41,5 @@ require('../chunk-GBENOENJ.cjs');
41
41
 
42
42
 
43
43
 
44
- exports.ALLOWED_PUBLIC_HEADERS = _chunkIWXMFQDTcjs.ALLOWED_PUBLIC_HEADERS; exports.HEADER_ACTOR_ID = _chunkIWXMFQDTcjs.HEADER_ACTOR_ID; exports.HEADER_ACTOR_QUERY = _chunkIWXMFQDTcjs.HEADER_ACTOR_QUERY; exports.HEADER_CONN_PARAMS = _chunkIWXMFQDTcjs.HEADER_CONN_PARAMS; exports.HEADER_ENCODING = _chunkIWXMFQDTcjs.HEADER_ENCODING; exports.HEADER_RIVET_ACTOR = _chunkIWXMFQDTcjs.HEADER_RIVET_ACTOR; exports.HEADER_RIVET_TARGET = _chunkIWXMFQDTcjs.HEADER_RIVET_TARGET; exports.PATH_CONNECT = _chunkIWXMFQDTcjs.PATH_CONNECT; exports.PATH_WEBSOCKET_BASE = _chunkIWXMFQDTcjs.PATH_WEBSOCKET_BASE; exports.PATH_WEBSOCKET_PREFIX = _chunkIWXMFQDTcjs.PATH_WEBSOCKET_PREFIX; exports.WS_PROTOCOL_ACTOR = _chunkIWXMFQDTcjs.WS_PROTOCOL_ACTOR; exports.WS_PROTOCOL_CONN_PARAMS = _chunkIWXMFQDTcjs.WS_PROTOCOL_CONN_PARAMS; exports.WS_PROTOCOL_ENCODING = _chunkIWXMFQDTcjs.WS_PROTOCOL_ENCODING; exports.WS_PROTOCOL_PATH = _chunkIWXMFQDTcjs.WS_TEST_PROTOCOL_PATH; exports.WS_PROTOCOL_STANDARD = _chunkIWXMFQDTcjs.WS_PROTOCOL_STANDARD; exports.WS_PROTOCOL_TARGET = _chunkIWXMFQDTcjs.WS_PROTOCOL_TARGET; exports.buildManagerRouter = _chunkIWXMFQDTcjs.buildManagerRouter; exports.getInitialActorKvState = _chunkIWXMFQDTcjs.getInitialActorKvState;
44
+ exports.ALLOWED_PUBLIC_HEADERS = _chunk4KNL47JAcjs.ALLOWED_PUBLIC_HEADERS; exports.HEADER_ACTOR_ID = _chunk4KNL47JAcjs.HEADER_ACTOR_ID; exports.HEADER_ACTOR_QUERY = _chunk4KNL47JAcjs.HEADER_ACTOR_QUERY; exports.HEADER_CONN_PARAMS = _chunk4KNL47JAcjs.HEADER_CONN_PARAMS; exports.HEADER_ENCODING = _chunk4KNL47JAcjs.HEADER_ENCODING; exports.HEADER_RIVET_ACTOR = _chunk4KNL47JAcjs.HEADER_RIVET_ACTOR; exports.HEADER_RIVET_TARGET = _chunk4KNL47JAcjs.HEADER_RIVET_TARGET; exports.PATH_CONNECT = _chunk4KNL47JAcjs.PATH_CONNECT; exports.PATH_WEBSOCKET_BASE = _chunk4KNL47JAcjs.PATH_WEBSOCKET_BASE; exports.PATH_WEBSOCKET_PREFIX = _chunk4KNL47JAcjs.PATH_WEBSOCKET_PREFIX; exports.WS_PROTOCOL_ACTOR = _chunk4KNL47JAcjs.WS_PROTOCOL_ACTOR; exports.WS_PROTOCOL_CONN_PARAMS = _chunk4KNL47JAcjs.WS_PROTOCOL_CONN_PARAMS; exports.WS_PROTOCOL_ENCODING = _chunk4KNL47JAcjs.WS_PROTOCOL_ENCODING; exports.WS_PROTOCOL_PATH = _chunk4KNL47JAcjs.WS_TEST_PROTOCOL_PATH; exports.WS_PROTOCOL_STANDARD = _chunk4KNL47JAcjs.WS_PROTOCOL_STANDARD; exports.WS_PROTOCOL_TARGET = _chunk4KNL47JAcjs.WS_PROTOCOL_TARGET; exports.buildManagerRouter = _chunk4KNL47JAcjs.buildManagerRouter; exports.getInitialActorKvState = _chunk4KNL47JAcjs.getInitialActorKvState;
45
45
  //# sourceMappingURL=mod.cjs.map
@@ -1,5 +1,5 @@
1
- import { R as RegistryConfig, aK as ManagerDriver } from '../config-CwJCQyP1.cjs';
2
- export { A as ActorDriver, aL as ActorInstance, aM as ActorOutput, b as AnyActorInstance, aN as CreateInput, aO as GetForIdInput, aP as GetOrCreateWithKeyInput, aQ as GetWithKeyInput, aR as ListActorsInput, aS as ManagerDisplayInformation } from '../config-CwJCQyP1.cjs';
1
+ import { R as RegistryConfig, aL as ManagerDriver } from '../config-cizn-tcF.cjs';
2
+ export { A as ActorDriver, aM as ActorInstance, aN as ActorOutput, b as AnyActorInstance, aO as CreateInput, aP as GetForIdInput, aQ as GetOrCreateWithKeyInput, aR as GetWithKeyInput, aS as ListActorsInput, aT as ManagerDisplayInformation } from '../config-cizn-tcF.cjs';
3
3
  export { A as ALLOWED_PUBLIC_HEADERS, H as HEADER_ACTOR_ID, b as HEADER_ACTOR_QUERY, c as HEADER_CONN_PARAMS, d as HEADER_ENCODING, e as HEADER_RIVET_ACTOR, f as HEADER_RIVET_TARGET, P as PATH_CONNECT, g as PATH_WEBSOCKET_BASE, a as PATH_WEBSOCKET_PREFIX, W as WS_PROTOCOL_ACTOR, h as WS_PROTOCOL_CONN_PARAMS, i as WS_PROTOCOL_ENCODING, l as WS_PROTOCOL_PATH, j as WS_PROTOCOL_STANDARD, k as WS_PROTOCOL_TARGET } from '../actor-router-consts-DzI2szci.cjs';
4
4
  import * as _hono_zod_openapi from '@hono/zod-openapi';
5
5
  import { Hono } from 'hono';
@@ -1,5 +1,5 @@
1
- import { R as RegistryConfig, aK as ManagerDriver } from '../config-CbIHPGKl.js';
2
- export { A as ActorDriver, aL as ActorInstance, aM as ActorOutput, b as AnyActorInstance, aN as CreateInput, aO as GetForIdInput, aP as GetOrCreateWithKeyInput, aQ as GetWithKeyInput, aR as ListActorsInput, aS as ManagerDisplayInformation } from '../config-CbIHPGKl.js';
1
+ import { R as RegistryConfig, aL as ManagerDriver } from '../config-OR5ZtHFa.js';
2
+ export { A as ActorDriver, aM as ActorInstance, aN as ActorOutput, b as AnyActorInstance, aO as CreateInput, aP as GetForIdInput, aQ as GetOrCreateWithKeyInput, aR as GetWithKeyInput, aS as ListActorsInput, aT as ManagerDisplayInformation } from '../config-OR5ZtHFa.js';
3
3
  export { A as ALLOWED_PUBLIC_HEADERS, H as HEADER_ACTOR_ID, b as HEADER_ACTOR_QUERY, c as HEADER_CONN_PARAMS, d as HEADER_ENCODING, e as HEADER_RIVET_ACTOR, f as HEADER_RIVET_TARGET, P as PATH_CONNECT, g as PATH_WEBSOCKET_BASE, a as PATH_WEBSOCKET_PREFIX, W as WS_PROTOCOL_ACTOR, h as WS_PROTOCOL_CONN_PARAMS, i as WS_PROTOCOL_ENCODING, l as WS_PROTOCOL_PATH, j as WS_PROTOCOL_STANDARD, k as WS_PROTOCOL_TARGET } from '../actor-router-consts-DzI2szci.js';
4
4
  import * as _hono_zod_openapi from '@hono/zod-openapi';
5
5
  import { Hono } from 'hono';
@@ -17,9 +17,9 @@ import {
17
17
  WS_TEST_PROTOCOL_PATH,
18
18
  buildManagerRouter,
19
19
  getInitialActorKvState
20
- } from "../chunk-MIOU6BF3.js";
20
+ } from "../chunk-KVB2SG32.js";
21
21
  import "../chunk-E6ZE2YEA.js";
22
- import "../chunk-4U45T5KW.js";
22
+ import "../chunk-ZUMPCWKF.js";
23
23
  import "../chunk-2YHR67M4.js";
24
24
  export {
25
25
  ALLOWED_PUBLIC_HEADERS,