rivetkit 2.3.0-rc.11 → 2.3.0-rc.13
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 +407 -20
- package/dist/browser/client.js +101 -86
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +12 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/agent-os/index.cjs +66 -3
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +404 -17
- package/dist/tsup/agent-os/index.d.ts +404 -17
- package/dist/tsup/agent-os/index.js +66 -3
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-WXYWDLJY.js → chunk-33YE6XCI.js} +4 -4
- package/dist/tsup/{chunk-2NXFKPRB.cjs → chunk-7OR3CHD5.cjs} +10 -10
- package/dist/tsup/{chunk-2NXFKPRB.cjs.map → chunk-7OR3CHD5.cjs.map} +1 -1
- package/dist/tsup/{chunk-LW5HNCWD.cjs → chunk-7XQCARVY.cjs} +3 -3
- package/dist/tsup/{chunk-LW5HNCWD.cjs.map → chunk-7XQCARVY.cjs.map} +1 -1
- package/dist/tsup/{chunk-GX6W4MW3.cjs → chunk-BSPS6NSN.cjs} +5 -5
- package/dist/tsup/{chunk-GX6W4MW3.cjs.map → chunk-BSPS6NSN.cjs.map} +1 -1
- package/dist/tsup/{chunk-T3VCJ4PV.js → chunk-DPIMKYNB.js} +61 -2
- package/dist/tsup/chunk-DPIMKYNB.js.map +1 -0
- package/dist/tsup/{chunk-XG25CGSW.cjs → chunk-E5CLYAUZ.cjs} +146 -143
- package/dist/tsup/chunk-E5CLYAUZ.cjs.map +1 -0
- package/dist/tsup/{chunk-RDBGKI66.cjs → chunk-EBWOJRCC.cjs} +22 -5
- package/dist/tsup/chunk-EBWOJRCC.cjs.map +1 -0
- package/dist/tsup/{chunk-YRQ4F5CD.js → chunk-HHNYEQD3.js} +6 -6
- package/dist/tsup/chunk-HHNYEQD3.js.map +1 -0
- package/dist/tsup/{chunk-4FP4FFB5.js → chunk-IOUSQVXI.js} +21 -4
- package/dist/tsup/chunk-IOUSQVXI.js.map +1 -0
- package/dist/tsup/{chunk-LNP7Q6I6.cjs → chunk-ISDKSSYR.cjs} +4 -4
- package/dist/tsup/{chunk-LNP7Q6I6.cjs.map → chunk-ISDKSSYR.cjs.map} +1 -1
- package/dist/tsup/{chunk-TTLUIDVH.js → chunk-J72WHUBC.js} +12 -9
- package/dist/tsup/chunk-J72WHUBC.js.map +1 -0
- package/dist/tsup/{chunk-Y3JBOFBG.cjs → chunk-KWABEUUA.cjs} +10 -10
- package/dist/tsup/chunk-KWABEUUA.cjs.map +1 -0
- package/dist/tsup/{chunk-XCDCURZ4.cjs → chunk-NIY3RSPX.cjs} +62 -3
- package/dist/tsup/chunk-NIY3RSPX.cjs.map +1 -0
- package/dist/tsup/{chunk-3P2JUHWJ.js → chunk-T44AVAGW.js} +2 -2
- package/dist/tsup/{chunk-GRFBV2U7.js → chunk-TCXEM6PA.js} +2 -2
- package/dist/tsup/{chunk-KRC4L3YB.js → chunk-ZI5CNA2Z.js} +2 -2
- package/dist/tsup/client/mod.cjs +7 -7
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- package/dist/tsup/client/mod.js +6 -6
- 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-De5UVu0V.d.ts → config-BxWAw3iH.d.ts} +476 -20
- package/dist/tsup/{config-CTwe3WwC.d.cts → config-CZQQ-mso.d.cts} +476 -20
- package/dist/tsup/{context-Dmj477Uh.d.cts → context-Bw7xq8w3.d.cts} +1 -1
- package/dist/tsup/{context-DPHISlUi.d.ts → context-D8QA76sV.d.ts} +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector-tab/mod.cjs +173 -0
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -0
- package/dist/tsup/inspector-tab/mod.d.cts +250 -0
- package/dist/tsup/inspector-tab/mod.d.ts +250 -0
- package/dist/tsup/inspector-tab/mod.js +173 -0
- package/dist/tsup/inspector-tab/mod.js.map +1 -0
- package/dist/tsup/mod.cjs +341 -138
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +277 -74
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +10 -10
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/{utils-DVekpm4I.d.ts → utils-DQosb24I.d.cts} +1 -1
- package/dist/tsup/{utils-DVekpm4I.d.cts → utils-DQosb24I.d.ts} +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.d.cts +1 -1
- package/dist/tsup/utils.d.ts +1 -1
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +11 -11
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +19 -9
- package/src/actor/config.ts +111 -10
- package/src/actor/definition.ts +6 -5
- package/src/actor/instance/mod.ts +4 -4
- package/src/actor/mod.ts +2 -0
- package/src/client/actor-common.ts +24 -27
- package/src/client/actor-handle.ts +2 -1
- package/src/common/engine.ts +28 -1
- package/src/common/utils.ts +1 -1
- package/src/devtools-loader/index.ts +4 -7
- package/src/devtools-loader/serve-devtools.ts +26 -0
- package/src/drivers/engine/actor-driver.ts +16 -5
- package/src/engine-client/actor-http-client.ts +2 -2
- package/src/engine-client/api-endpoints.ts +5 -1
- package/src/engine-client/ws-proxy.ts +5 -0
- package/src/inspector-tab/mod.ts +315 -0
- package/src/registry/config/index.ts +40 -16
- package/src/registry/index.ts +143 -62
- package/src/registry/napi-runtime.ts +6 -0
- package/src/registry/native.ts +170 -27
- package/src/registry/process-metrics.ts +16 -4
- package/src/registry/runtime.ts +26 -0
- package/src/registry/wasm-runtime.ts +16 -1
- package/src/utils/env-vars.ts +6 -0
- package/dist/tsup/chunk-4FP4FFB5.js.map +0 -1
- package/dist/tsup/chunk-RDBGKI66.cjs.map +0 -1
- package/dist/tsup/chunk-T3VCJ4PV.js.map +0 -1
- package/dist/tsup/chunk-TTLUIDVH.js.map +0 -1
- package/dist/tsup/chunk-XCDCURZ4.cjs.map +0 -1
- package/dist/tsup/chunk-XG25CGSW.cjs.map +0 -1
- package/dist/tsup/chunk-Y3JBOFBG.cjs.map +0 -1
- package/dist/tsup/chunk-YRQ4F5CD.js.map +0 -1
- /package/dist/tsup/{chunk-WXYWDLJY.js.map → chunk-33YE6XCI.js.map} +0 -0
- /package/dist/tsup/{chunk-3P2JUHWJ.js.map → chunk-T44AVAGW.js.map} +0 -0
- /package/dist/tsup/{chunk-GRFBV2U7.js.map → chunk-TCXEM6PA.js.map} +0 -0
- /package/dist/tsup/{chunk-KRC4L3YB.js.map → chunk-ZI5CNA2Z.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.cjs';
|
|
2
|
+
import { A as AnyDatabaseProvider, d as SqliteNativeMetrics, I as InferDatabaseClient } from './config-D49x8NpL.cjs';
|
|
3
3
|
import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
|
|
4
4
|
import { z as z$1 } from 'zod';
|
|
5
5
|
import { Logger } from 'pino';
|
|
@@ -7,7 +7,7 @@ import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
|
7
7
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
8
|
import { Context, Hono } from 'hono';
|
|
9
9
|
import { GetUpgradeWebSocket } from './utils.cjs';
|
|
10
|
-
import { R as RivetError } from './utils-
|
|
10
|
+
import { R as RivetError } from './utils-DQosb24I.cjs';
|
|
11
11
|
|
|
12
12
|
declare const ActorKeySchema: z.ZodArray<z.ZodString>;
|
|
13
13
|
type ActorKey = z.infer<typeof ActorKeySchema>;
|
|
@@ -167,6 +167,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
167
167
|
httpPort: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
168
168
|
httpHost: z$1.ZodOptional<z$1.ZodString>;
|
|
169
169
|
startEngine: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
170
|
+
engineHost: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
|
|
171
|
+
enginePort: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
170
172
|
engineVersion: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
|
|
171
173
|
configurePool: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
|
|
172
174
|
name: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -191,7 +193,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
191
193
|
envoyKey: z$1.ZodOptional<z$1.ZodString>;
|
|
192
194
|
}, z$1.core.$strip>>>;
|
|
193
195
|
shutdown: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
194
|
-
gracePeriodMs: z$1.
|
|
196
|
+
gracePeriodMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
195
197
|
disableSignalHandlers: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
196
198
|
}, z$1.core.$strip>>>;
|
|
197
199
|
}, z$1.core.$strip>, z$1.ZodTransform<{
|
|
@@ -232,6 +234,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
232
234
|
httpBasePath: string;
|
|
233
235
|
httpPort: number;
|
|
234
236
|
startEngine: boolean;
|
|
237
|
+
engineHost: string;
|
|
238
|
+
enginePort: number;
|
|
235
239
|
engineVersion: string;
|
|
236
240
|
envoy: {
|
|
237
241
|
poolName: string;
|
|
@@ -240,8 +244,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
240
244
|
envoyKey?: string | undefined;
|
|
241
245
|
};
|
|
242
246
|
shutdown: {
|
|
243
|
-
gracePeriodMs: number;
|
|
244
247
|
disableSignalHandlers: boolean;
|
|
248
|
+
gracePeriodMs?: number | undefined;
|
|
245
249
|
};
|
|
246
250
|
staticDir?: string | undefined;
|
|
247
251
|
httpHost?: string | undefined;
|
|
@@ -283,6 +287,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
283
287
|
httpBasePath: string;
|
|
284
288
|
httpPort: number;
|
|
285
289
|
startEngine: boolean;
|
|
290
|
+
engineHost: string;
|
|
291
|
+
enginePort: number;
|
|
286
292
|
engineVersion: string;
|
|
287
293
|
serverless: {
|
|
288
294
|
basePath: string;
|
|
@@ -297,8 +303,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
297
303
|
envoyKey?: string | undefined;
|
|
298
304
|
};
|
|
299
305
|
shutdown: {
|
|
300
|
-
gracePeriodMs: number;
|
|
301
306
|
disableSignalHandlers: boolean;
|
|
307
|
+
gracePeriodMs?: number | undefined;
|
|
302
308
|
};
|
|
303
309
|
staticDir?: string | undefined;
|
|
304
310
|
httpHost?: string | undefined;
|
|
@@ -456,7 +462,7 @@ type InferQueueCompleteMap<T extends QueueSchemaConfig> = {
|
|
|
456
462
|
type InferEventArgs<T> = T extends readonly unknown[] ? number extends T["length"] ? [T] : T : [T];
|
|
457
463
|
|
|
458
464
|
interface BaseActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>, _R extends Actions<S, CP, CS, V, I, DB, E, Q> = Actions<S, CP, CS, V, I, DB, E, Q>> {
|
|
459
|
-
readonly config: ActorConfig<S, CP, CS, V, I, DB, E, Q>;
|
|
465
|
+
readonly config: ActorConfig<S, CP, CS, V, I, DB, E, Q, _R>;
|
|
460
466
|
}
|
|
461
467
|
interface AnyActorDefinition {
|
|
462
468
|
readonly config: any;
|
|
@@ -464,8 +470,8 @@ interface AnyActorDefinition {
|
|
|
464
470
|
type AnyStaticActorDefinition = ActorDefinition<any, any, any, any, any, any, any, any, any>;
|
|
465
471
|
declare class ActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>, R extends Actions<S, CP, CS, V, I, DB, E, Q> = Actions<S, CP, CS, V, I, DB, E, Q>> implements BaseActorDefinition<S, CP, CS, V, I, DB, E, Q, R> {
|
|
466
472
|
#private;
|
|
467
|
-
constructor(config: ActorConfig<S, CP, CS, V, I, DB, E, Q>);
|
|
468
|
-
get config(): ActorConfig<S, CP, CS, V, I, DB, E, Q>;
|
|
473
|
+
constructor(config: ActorConfig<S, CP, CS, V, I, DB, E, Q, R>);
|
|
474
|
+
get config(): ActorConfig<S, CP, CS, V, I, DB, E, Q, R>;
|
|
469
475
|
}
|
|
470
476
|
interface BaseActorInstance<S = any, CP = any, CS = any, V = any, I = any, DB extends AnyDatabaseProvider = AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>> {
|
|
471
477
|
id: string;
|
|
@@ -559,6 +565,335 @@ interface ActorOutput {
|
|
|
559
565
|
error?: unknown;
|
|
560
566
|
}
|
|
561
567
|
|
|
568
|
+
declare const handleBrand: unique symbol;
|
|
569
|
+
type OpaqueHandle<Name extends string> = {
|
|
570
|
+
readonly [handleBrand]: Name;
|
|
571
|
+
};
|
|
572
|
+
type RegistryHandle = OpaqueHandle<"registry">;
|
|
573
|
+
type ActorFactoryHandle = OpaqueHandle<"actorFactory">;
|
|
574
|
+
type ActorContextHandle = OpaqueHandle<"actorContext">;
|
|
575
|
+
type ConnHandle = OpaqueHandle<"conn">;
|
|
576
|
+
type WebSocketHandle = OpaqueHandle<"webSocket">;
|
|
577
|
+
type CancellationTokenHandle = OpaqueHandle<"cancellationToken">;
|
|
578
|
+
type RuntimeBytes = Uint8Array;
|
|
579
|
+
interface RuntimeActorKeySegment {
|
|
580
|
+
kind: string;
|
|
581
|
+
stringValue?: string;
|
|
582
|
+
numberValue?: number;
|
|
583
|
+
}
|
|
584
|
+
interface RuntimeHttpRequest {
|
|
585
|
+
method: string;
|
|
586
|
+
uri: string;
|
|
587
|
+
headers?: Record<string, string>;
|
|
588
|
+
body?: RuntimeBytes;
|
|
589
|
+
}
|
|
590
|
+
interface RuntimeStateDeltaPayload {
|
|
591
|
+
state?: RuntimeBytes;
|
|
592
|
+
connHibernation: Array<{
|
|
593
|
+
connId: string;
|
|
594
|
+
bytes: RuntimeBytes;
|
|
595
|
+
}>;
|
|
596
|
+
connHibernationRemoved: string[];
|
|
597
|
+
}
|
|
598
|
+
interface RuntimeRequestSaveOpts {
|
|
599
|
+
immediate?: boolean;
|
|
600
|
+
maxWaitMs?: number;
|
|
601
|
+
}
|
|
602
|
+
interface RuntimeInspectorSnapshot {
|
|
603
|
+
stateRevision: number;
|
|
604
|
+
connectionsRevision: number;
|
|
605
|
+
queueRevision: number;
|
|
606
|
+
activeConnections: number;
|
|
607
|
+
queueSize: number;
|
|
608
|
+
connectedClients: number;
|
|
609
|
+
}
|
|
610
|
+
interface RuntimeQueueMessage {
|
|
611
|
+
id(): bigint;
|
|
612
|
+
name(): string;
|
|
613
|
+
body(): RuntimeBytes;
|
|
614
|
+
createdAt(): number;
|
|
615
|
+
isCompletable(): boolean;
|
|
616
|
+
complete(response?: RuntimeBytes | undefined | null): Promise<void>;
|
|
617
|
+
}
|
|
618
|
+
interface RuntimeQueueInspectMessage {
|
|
619
|
+
id: number;
|
|
620
|
+
name: string;
|
|
621
|
+
createdAtMs: number;
|
|
622
|
+
}
|
|
623
|
+
interface RuntimeQueueNextBatchOptions {
|
|
624
|
+
names?: string[];
|
|
625
|
+
count?: number;
|
|
626
|
+
timeoutMs?: number;
|
|
627
|
+
completable?: boolean;
|
|
628
|
+
}
|
|
629
|
+
interface RuntimeQueueWaitOptions {
|
|
630
|
+
timeoutMs?: number;
|
|
631
|
+
completable?: boolean;
|
|
632
|
+
}
|
|
633
|
+
interface RuntimeQueueEnqueueAndWaitOptions {
|
|
634
|
+
timeoutMs?: number;
|
|
635
|
+
}
|
|
636
|
+
interface RuntimeQueueTryNextBatchOptions {
|
|
637
|
+
names?: string[];
|
|
638
|
+
count?: number;
|
|
639
|
+
completable?: boolean;
|
|
640
|
+
}
|
|
641
|
+
interface RuntimeKvListOptions {
|
|
642
|
+
reverse?: boolean;
|
|
643
|
+
limit?: number;
|
|
644
|
+
}
|
|
645
|
+
interface RuntimeKvEntry {
|
|
646
|
+
key: RuntimeBytes;
|
|
647
|
+
value: RuntimeBytes;
|
|
648
|
+
}
|
|
649
|
+
type RuntimeSqlBindNoValues = {
|
|
650
|
+
intValue?: never;
|
|
651
|
+
floatValue?: never;
|
|
652
|
+
textValue?: never;
|
|
653
|
+
blobValue?: never;
|
|
654
|
+
};
|
|
655
|
+
type RuntimeSqlBindParam = ({
|
|
656
|
+
kind: "null";
|
|
657
|
+
} & RuntimeSqlBindNoValues) | {
|
|
658
|
+
kind: "int";
|
|
659
|
+
intValue: number;
|
|
660
|
+
floatValue?: never;
|
|
661
|
+
textValue?: never;
|
|
662
|
+
blobValue?: never;
|
|
663
|
+
} | {
|
|
664
|
+
kind: "float";
|
|
665
|
+
intValue?: never;
|
|
666
|
+
floatValue: number;
|
|
667
|
+
textValue?: never;
|
|
668
|
+
blobValue?: never;
|
|
669
|
+
} | {
|
|
670
|
+
kind: "text";
|
|
671
|
+
intValue?: never;
|
|
672
|
+
floatValue?: never;
|
|
673
|
+
textValue: string;
|
|
674
|
+
blobValue?: never;
|
|
675
|
+
} | {
|
|
676
|
+
kind: "blob";
|
|
677
|
+
intValue?: never;
|
|
678
|
+
floatValue?: never;
|
|
679
|
+
textValue?: never;
|
|
680
|
+
blobValue: RuntimeBytes;
|
|
681
|
+
};
|
|
682
|
+
type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
683
|
+
interface RuntimeSqlQueryResult {
|
|
684
|
+
columns: string[];
|
|
685
|
+
rows: unknown[][];
|
|
686
|
+
}
|
|
687
|
+
type RuntimeSqlExecResult = RuntimeSqlQueryResult;
|
|
688
|
+
interface RuntimeSqlExecuteResult extends RuntimeSqlQueryResult {
|
|
689
|
+
changes: number;
|
|
690
|
+
lastInsertRowId?: number | null;
|
|
691
|
+
}
|
|
692
|
+
interface RuntimeSqlRunResult {
|
|
693
|
+
changes: number;
|
|
694
|
+
}
|
|
695
|
+
interface RuntimeActorConfig {
|
|
696
|
+
name?: string;
|
|
697
|
+
icon?: string;
|
|
698
|
+
hasDatabase?: boolean;
|
|
699
|
+
remoteSqlite?: boolean;
|
|
700
|
+
hasState?: boolean;
|
|
701
|
+
canHibernateWebsocket?: boolean;
|
|
702
|
+
stateSaveIntervalMs?: number;
|
|
703
|
+
createStateTimeoutMs?: number;
|
|
704
|
+
onCreateTimeoutMs?: number;
|
|
705
|
+
createVarsTimeoutMs?: number;
|
|
706
|
+
createConnStateTimeoutMs?: number;
|
|
707
|
+
onBeforeConnectTimeoutMs?: number;
|
|
708
|
+
onConnectTimeoutMs?: number;
|
|
709
|
+
onMigrateTimeoutMs?: number;
|
|
710
|
+
onWakeTimeoutMs?: number;
|
|
711
|
+
onBeforeActorStartTimeoutMs?: number;
|
|
712
|
+
actionTimeoutMs?: number;
|
|
713
|
+
onRequestTimeoutMs?: number;
|
|
714
|
+
sleepTimeoutMs?: number;
|
|
715
|
+
noSleep?: boolean;
|
|
716
|
+
sleepGracePeriodMs?: number;
|
|
717
|
+
connectionLivenessTimeoutMs?: number;
|
|
718
|
+
connectionLivenessIntervalMs?: number;
|
|
719
|
+
maxQueueSize?: number;
|
|
720
|
+
maxQueueMessageSize?: number;
|
|
721
|
+
maxIncomingMessageSize?: number;
|
|
722
|
+
maxOutgoingMessageSize?: number;
|
|
723
|
+
preloadMaxWorkflowBytes?: number;
|
|
724
|
+
preloadMaxConnectionsBytes?: number;
|
|
725
|
+
actions?: Array<{
|
|
726
|
+
name: string;
|
|
727
|
+
}>;
|
|
728
|
+
inspectorTabs?: Array<RuntimeInspectorTabEntry>;
|
|
729
|
+
}
|
|
730
|
+
interface RuntimeInspectorTabEntry {
|
|
731
|
+
id: string;
|
|
732
|
+
/** Required for custom entries; omitted for built-in hides. */
|
|
733
|
+
label?: string;
|
|
734
|
+
/**
|
|
735
|
+
* Required for custom entries — absolute path to the source directory.
|
|
736
|
+
* Resolved on the TS side before being handed to the runtime.
|
|
737
|
+
*/
|
|
738
|
+
source?: string;
|
|
739
|
+
/** Optional icon id for custom entries. */
|
|
740
|
+
icon?: string;
|
|
741
|
+
/** Set to true for built-in hide entries. */
|
|
742
|
+
hidden?: boolean;
|
|
743
|
+
}
|
|
744
|
+
interface RuntimeServeConfig {
|
|
745
|
+
version: number;
|
|
746
|
+
endpoint: string;
|
|
747
|
+
token?: string;
|
|
748
|
+
namespace: string;
|
|
749
|
+
poolName: string;
|
|
750
|
+
engineBinaryPath?: string;
|
|
751
|
+
engineHost?: string;
|
|
752
|
+
enginePort?: number;
|
|
753
|
+
handleInspectorHttpInRuntime?: boolean;
|
|
754
|
+
inspectorTestToken?: string;
|
|
755
|
+
serverlessBasePath?: string;
|
|
756
|
+
serverlessPackageVersion: string;
|
|
757
|
+
serverlessClientEndpoint?: string;
|
|
758
|
+
serverlessClientNamespace?: string;
|
|
759
|
+
serverlessClientToken?: string;
|
|
760
|
+
serverlessValidateEndpoint: boolean;
|
|
761
|
+
serverlessMaxStartPayloadBytes: number;
|
|
762
|
+
}
|
|
763
|
+
interface RuntimeServerlessRequest {
|
|
764
|
+
method: string;
|
|
765
|
+
url: string;
|
|
766
|
+
headers: Record<string, string>;
|
|
767
|
+
body: RuntimeBytes;
|
|
768
|
+
}
|
|
769
|
+
interface RuntimeServerlessResponseHead {
|
|
770
|
+
status: number;
|
|
771
|
+
headers: Record<string, string>;
|
|
772
|
+
}
|
|
773
|
+
interface RuntimeRegistryRouteResponse {
|
|
774
|
+
status: number;
|
|
775
|
+
headers: Record<string, string>;
|
|
776
|
+
body: RuntimeBytes;
|
|
777
|
+
}
|
|
778
|
+
type RuntimeServerlessStreamEvent = {
|
|
779
|
+
kind: "chunk";
|
|
780
|
+
chunk?: RuntimeBytes;
|
|
781
|
+
} | {
|
|
782
|
+
kind: "end";
|
|
783
|
+
error?: {
|
|
784
|
+
group: string;
|
|
785
|
+
code: string;
|
|
786
|
+
message: string;
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
type RuntimeServerlessStreamCallback = (error: unknown, event?: RuntimeServerlessStreamEvent) => unknown;
|
|
790
|
+
type RuntimeWebSocketEvent = {
|
|
791
|
+
kind: "message";
|
|
792
|
+
data: string | RuntimeBytes;
|
|
793
|
+
binary: boolean;
|
|
794
|
+
messageIndex?: number;
|
|
795
|
+
} | {
|
|
796
|
+
kind: "close";
|
|
797
|
+
code: number;
|
|
798
|
+
reason: string;
|
|
799
|
+
wasClean: boolean;
|
|
800
|
+
};
|
|
801
|
+
interface CoreRuntime {
|
|
802
|
+
readonly kind: "napi" | "wasm";
|
|
803
|
+
createRegistry(): RegistryHandle;
|
|
804
|
+
registerActor(registry: RegistryHandle, name: string, factory: ActorFactoryHandle): void;
|
|
805
|
+
serveRegistry(registry: RegistryHandle, config: RuntimeServeConfig): Promise<void>;
|
|
806
|
+
shutdownRegistry(registry: RegistryHandle): Promise<void>;
|
|
807
|
+
registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
|
|
808
|
+
handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
|
|
809
|
+
registryHealth?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
810
|
+
registryMetadata?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
811
|
+
registryMetrics?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
|
|
812
|
+
createActorFactory(callbacks: object, config?: RuntimeActorConfig | undefined | null): ActorFactoryHandle;
|
|
813
|
+
createCancellationToken(): CancellationTokenHandle;
|
|
814
|
+
cancellationTokenAborted(token: CancellationTokenHandle): boolean;
|
|
815
|
+
cancelCancellationToken(token: CancellationTokenHandle): void;
|
|
816
|
+
onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): void;
|
|
817
|
+
actorState(ctx: ActorContextHandle): RuntimeBytes;
|
|
818
|
+
actorBeginOnStateChange(ctx: ActorContextHandle): void;
|
|
819
|
+
actorEndOnStateChange(ctx: ActorContextHandle): void;
|
|
820
|
+
actorSetAlarm(ctx: ActorContextHandle, timestampMs?: number | undefined | null): void;
|
|
821
|
+
actorRequestSave(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): void;
|
|
822
|
+
actorRequestSaveAndWait(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): Promise<void>;
|
|
823
|
+
actorInspectorSnapshot(ctx: ActorContextHandle): RuntimeInspectorSnapshot;
|
|
824
|
+
actorDecodeInspectorRequest(ctx: ActorContextHandle, bytes: RuntimeBytes, advertisedVersion: number): RuntimeBytes;
|
|
825
|
+
actorEncodeInspectorResponse(ctx: ActorContextHandle, bytes: RuntimeBytes, targetVersion: number): RuntimeBytes;
|
|
826
|
+
actorVerifyInspectorAuth(ctx: ActorContextHandle, bearerToken?: string | undefined | null): Promise<void>;
|
|
827
|
+
actorQueueHibernationRemoval(ctx: ActorContextHandle, connId: string): void;
|
|
828
|
+
actorTakePendingHibernationChanges(ctx: ActorContextHandle): string[];
|
|
829
|
+
actorDirtyHibernatableConns(ctx: ActorContextHandle): ConnHandle[];
|
|
830
|
+
actorSaveState(ctx: ActorContextHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
|
|
831
|
+
actorId(ctx: ActorContextHandle): string;
|
|
832
|
+
actorName(ctx: ActorContextHandle): string;
|
|
833
|
+
actorKey(ctx: ActorContextHandle): RuntimeActorKeySegment[];
|
|
834
|
+
actorRegion(ctx: ActorContextHandle): string;
|
|
835
|
+
actorSleep(ctx: ActorContextHandle): void;
|
|
836
|
+
actorDestroy(ctx: ActorContextHandle): void;
|
|
837
|
+
actorAbortSignal(ctx: ActorContextHandle): AbortSignal;
|
|
838
|
+
actorConns(ctx: ActorContextHandle): ConnHandle[];
|
|
839
|
+
actorConnectConn(ctx: ActorContextHandle, params: RuntimeBytes, request?: RuntimeHttpRequest | undefined | null): Promise<ConnHandle>;
|
|
840
|
+
actorBroadcast(ctx: ActorContextHandle, name: string, args: RuntimeBytes): void;
|
|
841
|
+
actorWaitUntil(ctx: ActorContextHandle, promise: Promise<unknown>): void;
|
|
842
|
+
actorWaitForTrackedShutdownWork(ctx: ActorContextHandle): Promise<boolean>;
|
|
843
|
+
actorWaitForTrackedShutdownWorkUnbounded(ctx: ActorContextHandle): Promise<void>;
|
|
844
|
+
actorKeepAwake(ctx: ActorContextHandle, promise: Promise<unknown>): void;
|
|
845
|
+
actorBeginKeepAwake(ctx: ActorContextHandle): number;
|
|
846
|
+
actorEndKeepAwake(ctx: ActorContextHandle, regionId: number): void;
|
|
847
|
+
actorRegisterTask(ctx: ActorContextHandle, promise: Promise<unknown>): void;
|
|
848
|
+
actorRuntimeState(ctx: ActorContextHandle): object;
|
|
849
|
+
actorClearRuntimeState(ctx: ActorContextHandle): void;
|
|
850
|
+
actorRestartRunHandler(ctx: ActorContextHandle): void;
|
|
851
|
+
actorBeginWebsocketCallback(ctx: ActorContextHandle): number;
|
|
852
|
+
actorEndWebsocketCallback(ctx: ActorContextHandle, regionId: number): void;
|
|
853
|
+
actorKvGet(ctx: ActorContextHandle, key: RuntimeBytes): Promise<RuntimeBytes | null>;
|
|
854
|
+
actorKvPut(ctx: ActorContextHandle, key: RuntimeBytes, value: RuntimeBytes): Promise<void>;
|
|
855
|
+
actorKvDelete(ctx: ActorContextHandle, key: RuntimeBytes): Promise<void>;
|
|
856
|
+
actorKvDeleteRange(ctx: ActorContextHandle, start: RuntimeBytes, end: RuntimeBytes): Promise<void>;
|
|
857
|
+
actorKvListPrefix(ctx: ActorContextHandle, prefix: RuntimeBytes, options?: RuntimeKvListOptions | undefined | null): Promise<RuntimeKvEntry[]>;
|
|
858
|
+
actorKvListRange(ctx: ActorContextHandle, start: RuntimeBytes, end: RuntimeBytes, options?: RuntimeKvListOptions | undefined | null): Promise<RuntimeKvEntry[]>;
|
|
859
|
+
actorKvBatchGet(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<Array<RuntimeBytes | undefined | null>>;
|
|
860
|
+
actorKvBatchPut(ctx: ActorContextHandle, entries: RuntimeKvEntry[]): Promise<void>;
|
|
861
|
+
actorKvBatchDelete(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<void>;
|
|
862
|
+
actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
863
|
+
actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
864
|
+
actorSqlQuery(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlQueryResult>;
|
|
865
|
+
actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
|
|
866
|
+
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
867
|
+
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
868
|
+
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
869
|
+
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
870
|
+
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
871
|
+
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
872
|
+
actorQueueWaitForNamesAvailable(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<void>;
|
|
873
|
+
actorQueueEnqueueAndWait(ctx: ActorContextHandle, name: string, body: RuntimeBytes, options?: RuntimeQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeBytes | null>;
|
|
874
|
+
actorQueueTryNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueTryNextBatchOptions | undefined | null): RuntimeQueueMessage[];
|
|
875
|
+
actorQueueMaxSize(ctx: ActorContextHandle): number;
|
|
876
|
+
actorQueueInspectMessages(ctx: ActorContextHandle): Promise<RuntimeQueueInspectMessage[]>;
|
|
877
|
+
actorScheduleAfter(ctx: ActorContextHandle, durationMs: number, actionName: string, args: RuntimeBytes): void;
|
|
878
|
+
actorScheduleAt(ctx: ActorContextHandle, timestampMs: number, actionName: string, args: RuntimeBytes): void;
|
|
879
|
+
connId(conn: ConnHandle): string;
|
|
880
|
+
connParams(conn: ConnHandle): RuntimeBytes;
|
|
881
|
+
connState(conn: ConnHandle): RuntimeBytes;
|
|
882
|
+
connSetState(conn: ConnHandle, state: RuntimeBytes): void;
|
|
883
|
+
connIsHibernatable(conn: ConnHandle): boolean;
|
|
884
|
+
connSend(conn: ConnHandle, name: string, args: RuntimeBytes): void;
|
|
885
|
+
connDisconnect(conn: ConnHandle, reason?: string | undefined | null): Promise<void>;
|
|
886
|
+
webSocketSend(ws: WebSocketHandle, data: RuntimeBytes, binary: boolean): void;
|
|
887
|
+
webSocketClose(ws: WebSocketHandle, code?: number | undefined | null, reason?: string | undefined | null): Promise<void>;
|
|
888
|
+
webSocketSetEventCallback(ws: WebSocketHandle, callback: (event: RuntimeWebSocketEvent) => void): void;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
declare function buildConfiguredRegistry(config: RegistryConfig): Promise<{
|
|
892
|
+
runtime: CoreRuntime;
|
|
893
|
+
registry: RegistryHandle;
|
|
894
|
+
serveConfig: RuntimeServeConfig;
|
|
895
|
+
}>;
|
|
896
|
+
|
|
562
897
|
type FetchHandler = (request: Request, ...args: any) => Response | Promise<Response>;
|
|
563
898
|
interface ServerlessHandler {
|
|
564
899
|
fetch: FetchHandler;
|
|
@@ -568,12 +903,20 @@ interface RegistryRoutes {
|
|
|
568
903
|
metadata(): Promise<Response>;
|
|
569
904
|
prometheusMetrics(request?: Request): Promise<Response>;
|
|
570
905
|
}
|
|
906
|
+
/**
|
|
907
|
+
* Injectable dependencies for {@link Registry}. Production code uses the
|
|
908
|
+
* defaults. Tests override `buildConfiguredRegistry` to drive lifecycle
|
|
909
|
+
* orchestration against a fake `CoreRuntime` without an engine.
|
|
910
|
+
*/
|
|
911
|
+
interface RegistryDeps {
|
|
912
|
+
buildConfiguredRegistry: typeof buildConfiguredRegistry;
|
|
913
|
+
}
|
|
571
914
|
declare class Registry<A extends RegistryActors> {
|
|
572
915
|
#private;
|
|
573
916
|
readonly routes: RegistryRoutes;
|
|
574
917
|
get config(): RegistryConfigInput<A>;
|
|
575
918
|
parseConfig(): RegistryConfig;
|
|
576
|
-
constructor(config: RegistryConfigInput<A>);
|
|
919
|
+
constructor(config: RegistryConfigInput<A>, deps?: Partial<RegistryDeps>);
|
|
577
920
|
/**
|
|
578
921
|
* Handle an incoming HTTP request for serverless deployments.
|
|
579
922
|
*
|
|
@@ -613,6 +956,27 @@ declare class Registry<A extends RegistryActors> {
|
|
|
613
956
|
port?: number;
|
|
614
957
|
publicDir?: string;
|
|
615
958
|
}): Promise<void>;
|
|
959
|
+
/**
|
|
960
|
+
* Gracefully drains all live registries.
|
|
961
|
+
*
|
|
962
|
+
* Programmatic counterpart to the SIGINT/SIGTERM handlers: tears down
|
|
963
|
+
* every live `CoreRegistry` (both `start()` and `handler()` modes) and
|
|
964
|
+
* waits for the serve promise to resolve, all bounded by the shutdown
|
|
965
|
+
* grace period. Unlike a signal-driven shutdown, this does not re-raise a
|
|
966
|
+
* signal or exit the process. The caller owns process lifetime.
|
|
967
|
+
*
|
|
968
|
+
* Idempotent: concurrent or repeated calls share a single drain. Safe to
|
|
969
|
+
* call even if nothing has been started.
|
|
970
|
+
*
|
|
971
|
+
* @example
|
|
972
|
+
* ```ts
|
|
973
|
+
* const registry = setup({ use: { counter } });
|
|
974
|
+
* registry.start();
|
|
975
|
+
* // ...later, on your own shutdown trigger:
|
|
976
|
+
* await registry.shutdown();
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
shutdown(): Promise<void>;
|
|
616
980
|
startEnvoy(): void;
|
|
617
981
|
/**
|
|
618
982
|
* Starts the actor envoy for standalone server deployments.
|
|
@@ -654,6 +1018,10 @@ interface QueueSendResult<TResponse = unknown> {
|
|
|
654
1018
|
type ActorActionFunction<Args extends Array<unknown> = unknown[], Response = unknown> = (...args: Args extends [unknown, ...infer Rest] ? Rest : Args) => Promise<Response>;
|
|
655
1019
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
656
1020
|
type LooseEventSubscribe = (eventName: string, callback: (...args: any[]) => void) => () => void;
|
|
1021
|
+
type ActorActionMap<R> = {
|
|
1022
|
+
[K in keyof NonNullable<R>]: NonNullable<R>[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Awaited<Return>> : never;
|
|
1023
|
+
};
|
|
1024
|
+
type ActionsOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<any, any, any, any, any, any, any, any, infer R> ? R : never;
|
|
657
1025
|
interface ActorGatewayOptions {
|
|
658
1026
|
skipReadyWait?: boolean;
|
|
659
1027
|
}
|
|
@@ -666,15 +1034,7 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
666
1034
|
/**
|
|
667
1035
|
* Maps action methods from actor definition to typed function signatures.
|
|
668
1036
|
*/
|
|
669
|
-
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : AD
|
|
670
|
-
config: {
|
|
671
|
-
actions?: infer R;
|
|
672
|
-
};
|
|
673
|
-
} ? {
|
|
674
|
-
[K in keyof R]: R[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Return> : never;
|
|
675
|
-
} : AD extends BaseActorDefinition<any, any, any, any, any, any, any, any, infer R> ? {
|
|
676
|
-
[K in keyof R]: R[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Return> : never;
|
|
677
|
-
} : {};
|
|
1037
|
+
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
|
|
678
1038
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
679
1039
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
680
1040
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
@@ -1202,6 +1562,10 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1202
1562
|
limit?: number;
|
|
1203
1563
|
};
|
|
1204
1564
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1565
|
+
/**
|
|
1566
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db` / `c.sql`)
|
|
1567
|
+
* or actor state instead.
|
|
1568
|
+
*/
|
|
1205
1569
|
interface ActorKv {
|
|
1206
1570
|
get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
|
|
1207
1571
|
put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
|
|
@@ -1300,6 +1664,10 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1300
1664
|
[RAW_STATE_SYMBOL](): TState;
|
|
1301
1665
|
state: TState;
|
|
1302
1666
|
vars: TVars;
|
|
1667
|
+
/**
|
|
1668
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`db` / `sql`)
|
|
1669
|
+
* or actor state instead.
|
|
1670
|
+
*/
|
|
1303
1671
|
readonly kv: ActorKv;
|
|
1304
1672
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
1305
1673
|
readonly schedule: ActorSchedule;
|
|
@@ -1365,6 +1733,75 @@ interface WorkflowInspectorConfig<THistory = unknown> {
|
|
|
1365
1733
|
interface RunInspectorConfig<THistory = unknown> {
|
|
1366
1734
|
workflow?: WorkflowInspectorConfig<THistory>;
|
|
1367
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Built-in inspector tabs the dashboard ships. Used to validate
|
|
1738
|
+
* `hidden: true` entries and reject custom-tab ids that collide with
|
|
1739
|
+
* a built-in.
|
|
1740
|
+
*/
|
|
1741
|
+
declare const BUILTIN_INSPECTOR_TAB_IDS: readonly ["workflow", "database", "state", "queue", "connections", "console"];
|
|
1742
|
+
declare const BuiltinInspectorTabIdSchema: z.ZodEnum<{
|
|
1743
|
+
workflow: "workflow";
|
|
1744
|
+
state: "state";
|
|
1745
|
+
database: "database";
|
|
1746
|
+
queue: "queue";
|
|
1747
|
+
connections: "connections";
|
|
1748
|
+
console: "console";
|
|
1749
|
+
}>;
|
|
1750
|
+
declare const CustomInspectorTabEntrySchema: z.ZodObject<{
|
|
1751
|
+
id: z.ZodString;
|
|
1752
|
+
label: z.ZodString;
|
|
1753
|
+
source: z.ZodString;
|
|
1754
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
1755
|
+
hidden: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1756
|
+
}, z.core.$strict>;
|
|
1757
|
+
declare const HideInspectorTabEntrySchema: z.ZodObject<{
|
|
1758
|
+
id: z.ZodEnum<{
|
|
1759
|
+
workflow: "workflow";
|
|
1760
|
+
state: "state";
|
|
1761
|
+
database: "database";
|
|
1762
|
+
queue: "queue";
|
|
1763
|
+
connections: "connections";
|
|
1764
|
+
console: "console";
|
|
1765
|
+
}>;
|
|
1766
|
+
hidden: z.ZodLiteral<true>;
|
|
1767
|
+
}, z.core.$strict>;
|
|
1768
|
+
declare const InspectorTabEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1769
|
+
id: z.ZodString;
|
|
1770
|
+
label: z.ZodString;
|
|
1771
|
+
source: z.ZodString;
|
|
1772
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
1773
|
+
hidden: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1774
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1775
|
+
id: z.ZodEnum<{
|
|
1776
|
+
workflow: "workflow";
|
|
1777
|
+
state: "state";
|
|
1778
|
+
database: "database";
|
|
1779
|
+
queue: "queue";
|
|
1780
|
+
connections: "connections";
|
|
1781
|
+
console: "console";
|
|
1782
|
+
}>;
|
|
1783
|
+
hidden: z.ZodLiteral<true>;
|
|
1784
|
+
}, z.core.$strict>]>;
|
|
1785
|
+
declare const ActorInspectorConfigSchema: z.ZodObject<{
|
|
1786
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1787
|
+
id: z.ZodString;
|
|
1788
|
+
label: z.ZodString;
|
|
1789
|
+
source: z.ZodString;
|
|
1790
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
1791
|
+
hidden: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1792
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1793
|
+
id: z.ZodEnum<{
|
|
1794
|
+
workflow: "workflow";
|
|
1795
|
+
state: "state";
|
|
1796
|
+
database: "database";
|
|
1797
|
+
queue: "queue";
|
|
1798
|
+
connections: "connections";
|
|
1799
|
+
console: "console";
|
|
1800
|
+
}>;
|
|
1801
|
+
hidden: z.ZodLiteral<true>;
|
|
1802
|
+
}, z.core.$strict>]>>>;
|
|
1803
|
+
}, z.core.$strict>;
|
|
1804
|
+
type ActorInspectorConfig = z.input<typeof ActorInspectorConfigSchema>;
|
|
1368
1805
|
declare const RunConfigSchema: z.ZodObject<{
|
|
1369
1806
|
name: z.ZodOptional<z.ZodString>;
|
|
1370
1807
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -1506,6 +1943,25 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
1506
1943
|
preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
|
|
1507
1944
|
preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
|
|
1508
1945
|
}, z.core.$strict>>;
|
|
1946
|
+
inspector: z.ZodOptional<z.ZodObject<{
|
|
1947
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1948
|
+
id: z.ZodString;
|
|
1949
|
+
label: z.ZodString;
|
|
1950
|
+
source: z.ZodString;
|
|
1951
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
1952
|
+
hidden: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1953
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1954
|
+
id: z.ZodEnum<{
|
|
1955
|
+
workflow: "workflow";
|
|
1956
|
+
state: "state";
|
|
1957
|
+
database: "database";
|
|
1958
|
+
queue: "queue";
|
|
1959
|
+
connections: "connections";
|
|
1960
|
+
console: "console";
|
|
1961
|
+
}>;
|
|
1962
|
+
hidden: z.ZodLiteral<true>;
|
|
1963
|
+
}, z.core.$strict>]>>>;
|
|
1964
|
+
}, z.core.$strict>>;
|
|
1509
1965
|
}, z.core.$strict>;
|
|
1510
1966
|
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
1511
1967
|
state: TState;
|
|
@@ -1710,7 +2166,7 @@ type ActorDatabaseConfig<TDatabase extends AnyDatabaseProvider> = {
|
|
|
1710
2166
|
*/
|
|
1711
2167
|
db: TDatabase;
|
|
1712
2168
|
} | Record<never, never>;
|
|
1713
|
-
type ActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = Omit<z.infer<typeof ActorConfigSchema>, "actions" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues,
|
|
2169
|
+
type ActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> = Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>> = Omit<z.infer<typeof ActorConfigSchema>, "actions" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & ActorDatabaseConfig<TDatabase>;
|
|
1714
2170
|
type ActorConfigInput<TState = undefined, TConnParams = undefined, TConnState = undefined, TVars = undefined, TInput = undefined, TDatabase extends AnyDatabaseProvider = undefined, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> = Record<never, never>> = {
|
|
1715
2171
|
types?: ActorTypes<TState, TConnParams, TConnState, TVars, TInput, TDatabase>;
|
|
1716
2172
|
} & Omit<z.input<typeof ActorConfigSchema>, "actions" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & ActorDatabaseConfig<TDatabase>;
|
|
@@ -1789,4 +2245,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
1789
2245
|
}, z.core.$strip>>;
|
|
1790
2246
|
}, z.core.$strip>;
|
|
1791
2247
|
|
|
1792
|
-
export {
|
|
2248
|
+
export { type Conn as $, type AnyActorDefinition as A, type BaseActorDefinition as B, type ConnectContext as C, type DestroyContext as D, type EventSchemaConfig as E, type ActorQuery as F, type ActorQueue as G, type ActorSchedule as H, type ActorTypes as I, ActorsSchema as J, type AnyActorInstance as K, type AnyClient as L, type MigrateContext as M, type AnyConn as N, type AnyStaticActorDefinition as O, type AnyStaticActorInstance as P, type QueueSchemaConfig as Q, type RequestContext as R, type SleepContext as S, type AuthIntent as T, BUILTIN_INSPECTOR_TAB_IDS as U, type BaseActorInstance as V, type WakeContext as W, BuiltinInspectorTabIdSchema as X, CONN_DRIVER_SYMBOL as Y, CONN_STATE_MANAGER_SYMBOL as Z, type Client as _, type ActionContext as a, getRunInspectorConfig as a$, CustomInspectorTabEntrySchema as a0, DEFAULT_SLEEP_GRACE_PERIOD as a1, DocActorConfigSchema as a2, DocActorOptionsSchema as a3, DocConfigurePoolSchema as a4, DocEnvoyConfigSchema as a5, DocRegistryConfigSchema as a6, DocServerlessConfigSchema as a7, DocSqliteConfigSchema as a8, type Encoding as a9, type RegistryConfigInput as aA, RegistryConfigSchema as aB, type RegistryDeps as aC, type RegistryRoutes as aD, type RunConfig as aE, RunConfigSchema as aF, type RunInspectorConfig as aG, type RuntimeKind as aH, RuntimeKindSchema as aI, type ServerlessHandler as aJ, type SqliteBackend as aK, SqliteBackendSchema as aL, type SqliteConfig as aM, SqliteConfigSchema as aN, type TestConfig as aO, TestConfigSchema as aP, type Type as aQ, type WasmRuntimeBindings as aR, type WasmRuntimeConfig as aS, WasmRuntimeConfigSchema as aT, type WasmRuntimeInitInput as aU, type WorkflowInspectorConfig as aV, actor as aW, buildActorNames as aX, createClientWithDriver as aY, event as aZ, getRunFunction as a_, type FetchHandler as aa, type GlobalActorOptions as ab, type GlobalActorOptionsInput as ac, GlobalActorOptionsSchema as ad, HideInspectorTabEntrySchema as ae, InspectorTabEntrySchema as af, type InspectorUnsubscribe as ag, type InstanceActorOptions as ah, type InstanceActorOptionsInput as ai, InstanceActorOptionsSchema as aj, type QueueEnqueueAndWaitOptions as ak, type QueueFilterName as al, type QueueIterOptions as am, type QueueMessageOf as an, type QueueName as ao, type QueueNextBatchOptions as ap, type QueueNextOptions as aq, type QueueResultMessageForName as ar, type QueueTryNextBatchOptions as as, type QueueTryNextOptions as at, type QueueWaitOptions as au, RAW_STATE_SYMBOL as av, RUN_FUNCTION_CONFIG_SYMBOL as aw, Registry as ax, type RegistryActors as ay, type RegistryConfig as az, type BeforeActionResponseContext as b, getRunMetadata as b0, isStaticActorDefinition as b1, isStaticActorInstance as b2, lookupInRegistry as b3, queue as b4, setup as b5, test as b6, type ActorAccessor as b7, type ActorActionFunction as b8, type ActorActionOptions as b9, type ActorConn as ba, ActorConnRaw as bb, type ActorConnStatus as bc, type ActorConnectOptions as bd, type ActorGatewayOptions as be, type ActorHandle as bf, ActorHandleRaw as bg, ClientRaw as bh, type ConnectionStateCallback as bi, type CreateOptions as bj, type CreateRequest as bk, type EventUnsubscribe as bl, type ExtractActorsFromRegistry as bm, type ExtractRegistryFromClient as bn, type GetOptions as bo, type GetWithIdOptions as bp, type QueryOptions as bq, type Region as br, type StatusChangeCallback as bs, type InferSchemaMap as bt, type InferEventArgs as bu, type BeforeConnectContext as c, type CreateConnStateContext as d, type CreateContext as e, type CreateVarsContext as f, type DisconnectContext as g, type RunContext as h, type StateChangeContext as i, type WebSocketContext as j, ACTOR_CONTEXT_INTERNAL_SYMBOL as k, type Actions as l, type ActorConfig as m, type ActorConfigInput as n, ActorConfigSchema as o, type ActorContext as p, type ActorContextOf as q, ActorDefinition as r, type ActorInspectorConfig as s, ActorInspectorConfigSchema as t, type ActorKey as u, type ActorKv as v, type ActorLogger as w, type ActorOptions as x, type ActorOptionsInput as y, ActorOptionsSchema as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext,
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, al as QueueFilterName, aq as QueueNextOptions, ar as QueueResultMessageForName, ap as QueueNextBatchOptions, bt as InferSchemaMap, ax as Registry, _ as Client, w as ActorLogger, bu as InferEventArgs } from './config-CZQQ-mso.cjs';
|
|
2
2
|
import { WorkflowContextInterface, StepConfig, TryStepConfig, TryStepResult, TryBlockResult, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
3
3
|
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.cjs';
|
|
4
4
|
|