rivetkit 2.3.7 → 2.3.8
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 +34 -6
- package/dist/browser/client.js +33 -14
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +34 -6
- package/dist/tsup/agent-os/index.d.ts +34 -6
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-46AE7JOI.cjs → chunk-5MJPN3QU.cjs} +172 -151
- package/dist/tsup/chunk-5MJPN3QU.cjs.map +1 -0
- package/dist/tsup/{chunk-MNZFNIVI.cjs → chunk-7TNEDX3Y.cjs} +3 -3
- package/dist/tsup/{chunk-MNZFNIVI.cjs.map → chunk-7TNEDX3Y.cjs.map} +1 -1
- package/dist/tsup/{chunk-YU3C5OCU.js → chunk-BL6ERZQO.js} +36 -15
- package/dist/tsup/chunk-BL6ERZQO.js.map +1 -0
- package/dist/tsup/{chunk-DOPH7DT2.cjs → chunk-F6GCLL5Z.cjs} +7 -7
- package/dist/tsup/{chunk-DOPH7DT2.cjs.map → chunk-F6GCLL5Z.cjs.map} +1 -1
- package/dist/tsup/{chunk-6D2WRHJV.js → chunk-HWBISPRP.js} +2 -2
- package/dist/tsup/{chunk-UIZZCJ5W.cjs → chunk-IJMVVULS.cjs} +4 -4
- package/dist/tsup/{chunk-UIZZCJ5W.cjs.map → chunk-IJMVVULS.cjs.map} +1 -1
- package/dist/tsup/{chunk-7YQJXWBW.js → chunk-MY6BRV3S.js} +3 -3
- package/dist/tsup/{chunk-2SGPZEAJ.cjs → chunk-NUMGL52R.cjs} +6 -3
- package/dist/tsup/chunk-NUMGL52R.cjs.map +1 -0
- package/dist/tsup/{chunk-TQHMPWL6.cjs → chunk-TMTJPSHQ.cjs} +9 -9
- package/dist/tsup/{chunk-TQHMPWL6.cjs.map → chunk-TMTJPSHQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-YHPFCYL3.js → chunk-V7PJYBA5.js} +2 -2
- package/dist/tsup/{chunk-CH25U5NO.js → chunk-YFXQ7DBH.js} +3 -3
- package/dist/tsup/{chunk-OG4OR2CM.js → chunk-ZKDZW5DQ.js} +6 -3
- package/dist/tsup/chunk-ZKDZW5DQ.js.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-BRpVbJCD.d.ts → config-CUymbyM6.d.ts} +35 -7
- package/dist/tsup/{config-BobvQpex.d.cts → config-CpB-e4I9.d.cts} +35 -7
- package/dist/tsup/{context-Cj-DFyiy.d.ts → context-YBUBTwTS.d.ts} +1 -1
- package/dist/tsup/{context-YEBNJrws.d.cts → context-c-6G4mjk.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +2 -2
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/inspector/mod.cjs +4 -4
- package/dist/tsup/inspector/mod.js +3 -3
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/mod.cjs +449 -124
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +388 -63
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +6 -6
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +3 -3
- package/package.json +8 -8
- package/src/client/actor-handle.ts +3 -1
- package/src/client/raw-utils.ts +11 -2
- package/src/common/actor-router-consts.ts +1 -0
- package/src/common/encoding.ts +4 -1
- package/src/common/fetch-like.ts +49 -0
- package/src/engine-client/actor-http-client.ts +6 -22
- package/src/registry/index.ts +159 -14
- package/src/registry/napi-runtime.ts +74 -0
- package/src/registry/native-http.ts +208 -0
- package/src/registry/native.ts +111 -63
- package/src/registry/runtime.ts +35 -0
- package/src/registry/wasm-runtime.ts +11 -0
- package/dist/tsup/chunk-2SGPZEAJ.cjs.map +0 -1
- package/dist/tsup/chunk-46AE7JOI.cjs.map +0 -1
- package/dist/tsup/chunk-OG4OR2CM.js.map +0 -1
- package/dist/tsup/chunk-YU3C5OCU.js.map +0 -1
- /package/dist/tsup/{chunk-6D2WRHJV.js.map → chunk-HWBISPRP.js.map} +0 -0
- /package/dist/tsup/{chunk-7YQJXWBW.js.map → chunk-MY6BRV3S.js.map} +0 -0
- /package/dist/tsup/{chunk-YHPFCYL3.js.map → chunk-V7PJYBA5.js.map} +0 -0
- /package/dist/tsup/{chunk-CH25U5NO.js.map → chunk-YFXQ7DBH.js.map} +0 -0
|
@@ -594,6 +594,12 @@ interface RuntimeHttpRequest {
|
|
|
594
594
|
headers?: Record<string, string>;
|
|
595
595
|
body?: RuntimeBytes;
|
|
596
596
|
}
|
|
597
|
+
interface RuntimeHttpResponseBodyStream {
|
|
598
|
+
cancelled(): Promise<void>;
|
|
599
|
+
write(chunk: Uint8Array): Promise<void>;
|
|
600
|
+
end(): Promise<void>;
|
|
601
|
+
error(message: string): Promise<void>;
|
|
602
|
+
}
|
|
597
603
|
interface RuntimeStateDeltaPayload {
|
|
598
604
|
state?: RuntimeBytes;
|
|
599
605
|
connHibernation: Array<{
|
|
@@ -816,6 +822,7 @@ interface RuntimeListenerConfig {
|
|
|
816
822
|
port: number;
|
|
817
823
|
host?: string;
|
|
818
824
|
publicDir?: string;
|
|
825
|
+
application?: RuntimeApplicationFetch;
|
|
819
826
|
}
|
|
820
827
|
interface RuntimeServerlessRequest {
|
|
821
828
|
method: string;
|
|
@@ -823,6 +830,19 @@ interface RuntimeServerlessRequest {
|
|
|
823
830
|
headers: Record<string, string>;
|
|
824
831
|
body: RuntimeBytes;
|
|
825
832
|
}
|
|
833
|
+
interface RuntimeApplicationRequest extends RuntimeServerlessRequest {
|
|
834
|
+
cancelToken?: CancellationTokenHandle;
|
|
835
|
+
}
|
|
836
|
+
interface RuntimeApplicationResponse {
|
|
837
|
+
status: number;
|
|
838
|
+
headers: Record<string, string>;
|
|
839
|
+
body?: RuntimeBytes;
|
|
840
|
+
stream?: boolean;
|
|
841
|
+
}
|
|
842
|
+
type RuntimeApplicationFetch = (request: RuntimeApplicationRequest, responseBodyStream?: RuntimeHttpResponseBodyStream) => Promise<RuntimeApplicationResponse>;
|
|
843
|
+
interface RuntimeApplicationListenerConfig extends RuntimeListenerConfig {
|
|
844
|
+
application: RuntimeApplicationFetch;
|
|
845
|
+
}
|
|
826
846
|
interface RuntimeServerlessResponseHead {
|
|
827
847
|
status: number;
|
|
828
848
|
headers: Record<string, string>;
|
|
@@ -865,6 +885,7 @@ interface CoreRuntime {
|
|
|
865
885
|
registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
|
|
866
886
|
handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
|
|
867
887
|
serveListener(registry: RegistryHandle, listener: RuntimeListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
888
|
+
serveApplicationListener(registry: RegistryHandle, listener: RuntimeApplicationListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
868
889
|
registryHealth?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
869
890
|
registryMetadata?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
870
891
|
registryMetrics?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
@@ -975,6 +996,15 @@ type FetchHandler = (request: Request, ...args: any) => Response | Promise<Respo
|
|
|
975
996
|
interface ServerlessHandler {
|
|
976
997
|
fetch: FetchHandler;
|
|
977
998
|
}
|
|
999
|
+
interface RegistryApplication {
|
|
1000
|
+
fetch: FetchHandler;
|
|
1001
|
+
}
|
|
1002
|
+
interface RegistryListenOptions {
|
|
1003
|
+
port?: number;
|
|
1004
|
+
host?: string;
|
|
1005
|
+
publicDir?: string;
|
|
1006
|
+
application?: RegistryApplication;
|
|
1007
|
+
}
|
|
978
1008
|
interface RegistryRoutes {
|
|
979
1009
|
health(): Promise<Response>;
|
|
980
1010
|
metadata(): Promise<Response>;
|
|
@@ -1024,18 +1054,16 @@ declare class Registry<A extends RegistryActors> {
|
|
|
1024
1054
|
* @param opts.host Address to bind. Defaults to `0.0.0.0`.
|
|
1025
1055
|
* @param opts.publicDir If set, serves static files from this directory
|
|
1026
1056
|
* as a fallback below the framework routes.
|
|
1057
|
+
* @param opts.application If set, handles requests that do not match a
|
|
1058
|
+
* framework route.
|
|
1027
1059
|
*
|
|
1028
1060
|
* @example
|
|
1029
1061
|
* ```ts
|
|
1030
1062
|
* await registry.listen();
|
|
1031
|
-
* await registry.listen({
|
|
1063
|
+
* await registry.listen({ application: app });
|
|
1032
1064
|
* ```
|
|
1033
1065
|
*/
|
|
1034
|
-
listen(opts?:
|
|
1035
|
-
port?: number;
|
|
1036
|
-
host?: string;
|
|
1037
|
-
publicDir?: string;
|
|
1038
|
-
}): Promise<void>;
|
|
1066
|
+
listen(opts?: RegistryListenOptions): Promise<void>;
|
|
1039
1067
|
/**
|
|
1040
1068
|
* Gracefully drains all live registries.
|
|
1041
1069
|
*
|
|
@@ -594,6 +594,12 @@ interface RuntimeHttpRequest {
|
|
|
594
594
|
headers?: Record<string, string>;
|
|
595
595
|
body?: RuntimeBytes;
|
|
596
596
|
}
|
|
597
|
+
interface RuntimeHttpResponseBodyStream {
|
|
598
|
+
cancelled(): Promise<void>;
|
|
599
|
+
write(chunk: Uint8Array): Promise<void>;
|
|
600
|
+
end(): Promise<void>;
|
|
601
|
+
error(message: string): Promise<void>;
|
|
602
|
+
}
|
|
597
603
|
interface RuntimeStateDeltaPayload {
|
|
598
604
|
state?: RuntimeBytes;
|
|
599
605
|
connHibernation: Array<{
|
|
@@ -816,6 +822,7 @@ interface RuntimeListenerConfig {
|
|
|
816
822
|
port: number;
|
|
817
823
|
host?: string;
|
|
818
824
|
publicDir?: string;
|
|
825
|
+
application?: RuntimeApplicationFetch;
|
|
819
826
|
}
|
|
820
827
|
interface RuntimeServerlessRequest {
|
|
821
828
|
method: string;
|
|
@@ -823,6 +830,19 @@ interface RuntimeServerlessRequest {
|
|
|
823
830
|
headers: Record<string, string>;
|
|
824
831
|
body: RuntimeBytes;
|
|
825
832
|
}
|
|
833
|
+
interface RuntimeApplicationRequest extends RuntimeServerlessRequest {
|
|
834
|
+
cancelToken?: CancellationTokenHandle;
|
|
835
|
+
}
|
|
836
|
+
interface RuntimeApplicationResponse {
|
|
837
|
+
status: number;
|
|
838
|
+
headers: Record<string, string>;
|
|
839
|
+
body?: RuntimeBytes;
|
|
840
|
+
stream?: boolean;
|
|
841
|
+
}
|
|
842
|
+
type RuntimeApplicationFetch = (request: RuntimeApplicationRequest, responseBodyStream?: RuntimeHttpResponseBodyStream) => Promise<RuntimeApplicationResponse>;
|
|
843
|
+
interface RuntimeApplicationListenerConfig extends RuntimeListenerConfig {
|
|
844
|
+
application: RuntimeApplicationFetch;
|
|
845
|
+
}
|
|
826
846
|
interface RuntimeServerlessResponseHead {
|
|
827
847
|
status: number;
|
|
828
848
|
headers: Record<string, string>;
|
|
@@ -865,6 +885,7 @@ interface CoreRuntime {
|
|
|
865
885
|
registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
|
|
866
886
|
handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
|
|
867
887
|
serveListener(registry: RegistryHandle, listener: RuntimeListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
888
|
+
serveApplicationListener(registry: RegistryHandle, listener: RuntimeApplicationListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
868
889
|
registryHealth?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
869
890
|
registryMetadata?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
870
891
|
registryMetrics?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
@@ -975,6 +996,15 @@ type FetchHandler = (request: Request, ...args: any) => Response | Promise<Respo
|
|
|
975
996
|
interface ServerlessHandler {
|
|
976
997
|
fetch: FetchHandler;
|
|
977
998
|
}
|
|
999
|
+
interface RegistryApplication {
|
|
1000
|
+
fetch: FetchHandler;
|
|
1001
|
+
}
|
|
1002
|
+
interface RegistryListenOptions {
|
|
1003
|
+
port?: number;
|
|
1004
|
+
host?: string;
|
|
1005
|
+
publicDir?: string;
|
|
1006
|
+
application?: RegistryApplication;
|
|
1007
|
+
}
|
|
978
1008
|
interface RegistryRoutes {
|
|
979
1009
|
health(): Promise<Response>;
|
|
980
1010
|
metadata(): Promise<Response>;
|
|
@@ -1024,18 +1054,16 @@ declare class Registry<A extends RegistryActors> {
|
|
|
1024
1054
|
* @param opts.host Address to bind. Defaults to `0.0.0.0`.
|
|
1025
1055
|
* @param opts.publicDir If set, serves static files from this directory
|
|
1026
1056
|
* as a fallback below the framework routes.
|
|
1057
|
+
* @param opts.application If set, handles requests that do not match a
|
|
1058
|
+
* framework route.
|
|
1027
1059
|
*
|
|
1028
1060
|
* @example
|
|
1029
1061
|
* ```ts
|
|
1030
1062
|
* await registry.listen();
|
|
1031
|
-
* await registry.listen({
|
|
1063
|
+
* await registry.listen({ application: app });
|
|
1032
1064
|
* ```
|
|
1033
1065
|
*/
|
|
1034
|
-
listen(opts?:
|
|
1035
|
-
port?: number;
|
|
1036
|
-
host?: string;
|
|
1037
|
-
publicDir?: string;
|
|
1038
|
-
}): Promise<void>;
|
|
1066
|
+
listen(opts?: RegistryListenOptions): Promise<void>;
|
|
1039
1067
|
/**
|
|
1040
1068
|
* Gracefully drains all live registries.
|
|
1041
1069
|
*
|
|
@@ -417,7 +417,7 @@ function isRivetErrorCode(error, group, code) {
|
|
|
417
417
|
// package.json
|
|
418
418
|
var package_default = {
|
|
419
419
|
name: "rivetkit",
|
|
420
|
-
version: "2.3.
|
|
420
|
+
version: "2.3.8",
|
|
421
421
|
description: "Lightweight libraries for building stateful actors on edge platforms",
|
|
422
422
|
license: "Apache-2.0",
|
|
423
423
|
keywords: [
|