@alienplatform/sdk 1.14.1 → 2.0.0
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/dist.js +371 -275
- package/dist/index.d.ts +22 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -14356
- package/dist/native.d.ts +26 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +2 -0
- package/dist/worker-runtime/channel.d.ts +25 -0
- package/dist/worker-runtime/channel.d.ts.map +1 -0
- package/dist/worker-runtime/errors.d.ts +79 -0
- package/dist/worker-runtime/errors.d.ts.map +1 -0
- package/dist/worker-runtime/event-loop.d.ts +43 -0
- package/dist/worker-runtime/event-loop.d.ts.map +1 -0
- package/dist/{generated → worker-runtime/generated}/control.d.ts +15 -15
- package/dist/worker-runtime/generated/control.d.ts.map +1 -0
- package/dist/worker-runtime/generated/google/protobuf/duration.d.ts.map +1 -0
- package/dist/worker-runtime/generated/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/{generated → worker-runtime/generated}/wait_until.d.ts +29 -29
- package/dist/worker-runtime/generated/wait_until.d.ts.map +1 -0
- package/dist/worker-runtime/grpc-utils.d.ts +23 -0
- package/dist/worker-runtime/grpc-utils.d.ts.map +1 -0
- package/dist/worker-runtime/index.d.ts +33 -0
- package/dist/worker-runtime/index.d.ts.map +1 -0
- package/dist/{src.js → worker-runtime/index.js} +9370 -4035
- package/dist/worker-runtime/registry.d.ts +169 -0
- package/dist/worker-runtime/registry.d.ts.map +1 -0
- package/dist/worker-runtime/service-definitions.d.ts +12 -0
- package/dist/worker-runtime/service-definitions.d.ts.map +1 -0
- package/dist/worker-runtime/wait-until-manager.d.ts +34 -0
- package/dist/worker-runtime/wait-until-manager.d.ts.map +1 -0
- package/package.json +18 -38
- package/.turbo/turbo-build.log +0 -30
- package/AGENTS.md +0 -70
- package/dist/bearerTokenAuthenticationPolicy.js +0 -3028
- package/dist/bindings/artifact-registry.d.ts +0 -88
- package/dist/bindings/artifact-registry.d.ts.map +0 -1
- package/dist/bindings/build.d.ts +0 -67
- package/dist/bindings/build.d.ts.map +0 -1
- package/dist/bindings/index.d.ts +0 -13
- package/dist/bindings/index.d.ts.map +0 -1
- package/dist/bindings/kv.d.ts +0 -113
- package/dist/bindings/kv.d.ts.map +0 -1
- package/dist/bindings/postgres.d.ts +0 -90
- package/dist/bindings/postgres.d.ts.map +0 -1
- package/dist/bindings/postgres.test.d.ts +0 -2
- package/dist/bindings/postgres.test.d.ts.map +0 -1
- package/dist/bindings/queue.d.ts +0 -81
- package/dist/bindings/queue.d.ts.map +0 -1
- package/dist/bindings/service-account.d.ts +0 -46
- package/dist/bindings/service-account.d.ts.map +0 -1
- package/dist/bindings/storage.d.ts +0 -164
- package/dist/bindings/storage.d.ts.map +0 -1
- package/dist/bindings/vault.d.ts +0 -65
- package/dist/bindings/vault.d.ts.map +0 -1
- package/dist/bindings/worker.d.ts +0 -72
- package/dist/bindings/worker.d.ts.map +0 -1
- package/dist/channel.d.ts +0 -39
- package/dist/channel.d.ts.map +0 -1
- package/dist/checksum.js +0 -6176
- package/dist/commands/client.d.ts +0 -47
- package/dist/commands/client.d.ts.map +0 -1
- package/dist/commands/errors.d.ts +0 -198
- package/dist/commands/errors.d.ts.map +0 -1
- package/dist/commands/index.d.ts +0 -23
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -387
- package/dist/commands/types.d.ts +0 -40
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands.d.ts +0 -55
- package/dist/commands.d.ts.map +0 -1
- package/dist/context.d.ts +0 -182
- package/dist/context.d.ts.map +0 -1
- package/dist/dist-cjs.js +0 -15258
- package/dist/dist2.js +0 -1239
- package/dist/errors.d.ts +0 -359
- package/dist/errors.d.ts.map +0 -1
- package/dist/es5.js +0 -1720
- package/dist/esm.js +0 -18068
- package/dist/esm2.js +0 -3166
- package/dist/event-streams.js +0 -770
- package/dist/events.d.ts +0 -163
- package/dist/events.d.ts.map +0 -1
- package/dist/generated/artifact_registry.d.ts +0 -302
- package/dist/generated/artifact_registry.d.ts.map +0 -1
- package/dist/generated/build.d.ts +0 -184
- package/dist/generated/build.d.ts.map +0 -1
- package/dist/generated/container.d.ts +0 -101
- package/dist/generated/container.d.ts.map +0 -1
- package/dist/generated/control.d.ts.map +0 -1
- package/dist/generated/google/protobuf/duration.d.ts.map +0 -1
- package/dist/generated/google/protobuf/timestamp.d.ts.map +0 -1
- package/dist/generated/kv.d.ts +0 -182
- package/dist/generated/kv.d.ts.map +0 -1
- package/dist/generated/queue.d.ts +0 -127
- package/dist/generated/queue.d.ts.map +0 -1
- package/dist/generated/service_account.d.ts +0 -112
- package/dist/generated/service_account.d.ts.map +0 -1
- package/dist/generated/storage.d.ts +0 -784
- package/dist/generated/storage.d.ts.map +0 -1
- package/dist/generated/vault.d.ts +0 -107
- package/dist/generated/vault.d.ts.map +0 -1
- package/dist/generated/wait_until.d.ts.map +0 -1
- package/dist/generated/worker.d.ts +0 -107
- package/dist/generated/worker.d.ts.map +0 -1
- package/dist/global.d.ts +0 -208
- package/dist/global.d.ts.map +0 -1
- package/dist/grpc-utils.d.ts +0 -25
- package/dist/grpc-utils.d.ts.map +0 -1
- package/dist/jws.js +0 -611
- package/dist/open.js +0 -461
- package/dist/rolldown-runtime.js +0 -44
- package/dist/src2.js +0 -114032
- package/dist/types.d.ts +0 -337
- package/dist/types.d.ts.map +0 -1
- package/dist/wait-until.d.ts +0 -115
- package/dist/wait-until.d.ts.map +0 -1
- package/scripts/generate-proto.sh +0 -46
- package/src/bindings/AGENTS.md +0 -105
- package/src/bindings/artifact-registry.ts +0 -317
- package/src/bindings/build.ts +0 -195
- package/src/bindings/index.ts +0 -13
- package/src/bindings/kv.ts +0 -240
- package/src/bindings/postgres.test.ts +0 -17
- package/src/bindings/postgres.ts +0 -446
- package/src/bindings/queue.ts +0 -191
- package/src/bindings/service-account.ts +0 -113
- package/src/bindings/storage.ts +0 -536
- package/src/bindings/vault.ts +0 -133
- package/src/bindings/worker.ts +0 -164
- package/src/channel.ts +0 -102
- package/src/commands/client.ts +0 -446
- package/src/commands/errors.ts +0 -126
- package/src/commands/index.ts +0 -41
- package/src/commands/types.ts +0 -52
- package/src/commands.ts +0 -76
- package/src/context.ts +0 -368
- package/src/errors.ts +0 -280
- package/src/events.ts +0 -511
- package/src/generated/artifact_registry.ts +0 -2096
- package/src/generated/build.ts +0 -1311
- package/src/generated/container.ts +0 -503
- package/src/generated/control.ts +0 -2018
- package/src/generated/google/protobuf/duration.ts +0 -196
- package/src/generated/google/protobuf/timestamp.ts +0 -226
- package/src/generated/kv.ts +0 -1169
- package/src/generated/queue.ts +0 -753
- package/src/generated/service_account.ts +0 -814
- package/src/generated/storage.ts +0 -3820
- package/src/generated/vault.ts +0 -543
- package/src/generated/wait_until.ts +0 -829
- package/src/generated/worker.ts +0 -759
- package/src/global.ts +0 -287
- package/src/grpc-utils.ts +0 -159
- package/src/index.ts +0 -160
- package/src/types.ts +0 -397
- package/src/wait-until.ts +0 -273
- package/tsconfig.json +0 -8
- package/tsdown.config.ts +0 -17
- /package/dist/{generated → worker-runtime/generated}/google/protobuf/duration.d.ts +0 -0
- /package/dist/{generated → worker-runtime/generated}/google/protobuf/timestamp.d.ts +0 -0
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@alienplatform/sdk/native` — the embedded-addon bridge for compiled Workers.
|
|
3
|
+
*
|
|
4
|
+
* A Worker depends only on `@alienplatform/sdk`; `@alienplatform/bindings` is a
|
|
5
|
+
* transitive dependency reached *through* the SDK, so a Worker's own
|
|
6
|
+
* `node_modules` cannot resolve `@alienplatform/bindings/native` directly. But
|
|
7
|
+
* it can resolve the SDK, and the SDK can resolve `@alienplatform/bindings/native`
|
|
8
|
+
* (bindings is the SDK's direct dependency). This subpath is that one hop: it
|
|
9
|
+
* re-exports `installEmbeddedAddon` so a compiled Worker bootstrap can register
|
|
10
|
+
* the bun-embedded addon with the bindings loader without naming the bindings
|
|
11
|
+
* package it can't see.
|
|
12
|
+
*
|
|
13
|
+
* `bun build --compile` follows this static re-export chain
|
|
14
|
+
* (`@alienplatform/sdk/native` → `@alienplatform/bindings/native` → the staged
|
|
15
|
+
* `alien-bindings.node`) and embeds the addon into the single-file binary. The
|
|
16
|
+
* SDK keeps `@alienplatform/bindings` external (see tsdown.config.ts), so the
|
|
17
|
+
* compiled binary has exactly one bindings module — the same one the SDK's
|
|
18
|
+
* re-exported `kv`/`storage`/`queue`/`vault` resolve through — and the
|
|
19
|
+
* registration performed here is visible to those factories.
|
|
20
|
+
*
|
|
21
|
+
* This module is imported only by a generated compiled entry (never in dev),
|
|
22
|
+
* so its transitive static `import addon from "./alien-bindings.node"` inside
|
|
23
|
+
* `@alienplatform/bindings/native` only runs where that addon has been staged.
|
|
24
|
+
*/
|
|
25
|
+
export { installEmbeddedAddon } from "@alienplatform/bindings/native";
|
|
26
|
+
//# sourceMappingURL=native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA"}
|
package/dist/native.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gRPC channel management for the Alien Worker runtime.
|
|
3
|
+
*/
|
|
4
|
+
import { type Channel } from "nice-grpc";
|
|
5
|
+
export type WorkerProtocolGeneration = "current" | "legacy";
|
|
6
|
+
export interface GrpcEndpointConfig {
|
|
7
|
+
address: string;
|
|
8
|
+
generation: WorkerProtocolGeneration;
|
|
9
|
+
}
|
|
10
|
+
/** Re-export the Channel type */
|
|
11
|
+
export type GrpcChannel = Channel;
|
|
12
|
+
/**
|
|
13
|
+
* Get the gRPC endpoint from environment variables.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getGrpcEndpointConfig(): GrpcEndpointConfig;
|
|
16
|
+
export declare function getGrpcEndpoint(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Create a gRPC channel to the specified address.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createGrpcChannel(address: string): Promise<Channel>;
|
|
21
|
+
/**
|
|
22
|
+
* Get or create a cached gRPC channel to the specified address.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getOrCreateChannel(address: string): Promise<Channel>;
|
|
25
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/channel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,WAAW,CAAA;AAgBvD,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,wBAAwB,CAAA;CACrC;AAKD,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAEjC;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAkB1D;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWzE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1E"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors internal to the Worker runtime.
|
|
3
|
+
*
|
|
4
|
+
* These are the gRPC/transport and environment errors the Worker runtime raises
|
|
5
|
+
* while connecting to the runtime and dispatching tasks. They are confined to
|
|
6
|
+
* the `./worker-runtime` subpath — the facade root does not re-export them (the
|
|
7
|
+
* app-facing error surface is `BindingNotConfiguredError`/`AlienError` from
|
|
8
|
+
* `@alienplatform/bindings` and `@alienplatform/core`).
|
|
9
|
+
*/
|
|
10
|
+
import * as z from "zod/v4";
|
|
11
|
+
/**
|
|
12
|
+
* Error thrown when the gRPC connection to the runtime fails.
|
|
13
|
+
*/
|
|
14
|
+
export declare const GrpcConnectionError: {
|
|
15
|
+
metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
|
|
16
|
+
endpoint: z.ZodString;
|
|
17
|
+
reason: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
contextSchema: z.ZodObject<{
|
|
20
|
+
endpoint: z.ZodString;
|
|
21
|
+
reason: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
create: (context: {
|
|
24
|
+
endpoint: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
|
|
27
|
+
endpoint: z.ZodString;
|
|
28
|
+
reason: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Error thrown when a gRPC call fails.
|
|
33
|
+
*/
|
|
34
|
+
export declare const GrpcCallError: {
|
|
35
|
+
metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
|
|
36
|
+
service: z.ZodString;
|
|
37
|
+
method: z.ZodString;
|
|
38
|
+
grpcCode: z.ZodString;
|
|
39
|
+
details: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
contextSchema: z.ZodObject<{
|
|
42
|
+
service: z.ZodString;
|
|
43
|
+
method: z.ZodString;
|
|
44
|
+
grpcCode: z.ZodString;
|
|
45
|
+
details: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
create: (context: {
|
|
48
|
+
service: string;
|
|
49
|
+
method: string;
|
|
50
|
+
grpcCode: string;
|
|
51
|
+
details: string;
|
|
52
|
+
}) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
|
|
53
|
+
service: z.ZodString;
|
|
54
|
+
method: z.ZodString;
|
|
55
|
+
grpcCode: z.ZodString;
|
|
56
|
+
details: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Error thrown when a required environment variable is missing.
|
|
61
|
+
*/
|
|
62
|
+
export declare const MissingEnvVarError: {
|
|
63
|
+
metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
|
|
64
|
+
variable: z.ZodString;
|
|
65
|
+
description: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
contextSchema: z.ZodObject<{
|
|
68
|
+
variable: z.ZodString;
|
|
69
|
+
description: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
create: (context: {
|
|
72
|
+
variable: string;
|
|
73
|
+
description: string;
|
|
74
|
+
}) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
|
|
75
|
+
variable: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAA;AAE3B;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;CAW9B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAaxB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;CAW7B,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker event loop — connects to the runtime over the Worker protocol,
|
|
3
|
+
* registers the handlers collected in {@link ./registry.ts}, and dispatches
|
|
4
|
+
* incoming tasks (commands + storage/cron/queue events) to them.
|
|
5
|
+
*/
|
|
6
|
+
import { type Channel } from "nice-grpc";
|
|
7
|
+
import type { getControlServiceDefinition } from "./service-definitions.js";
|
|
8
|
+
/**
|
|
9
|
+
* Event loop runner for processing tasks from the runtime.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class EventLoop {
|
|
14
|
+
private readonly client;
|
|
15
|
+
private sendClient;
|
|
16
|
+
private readonly applicationId;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly service;
|
|
19
|
+
private running;
|
|
20
|
+
constructor(channel: Channel, applicationId: string, endpoint: string, service: ReturnType<typeof getControlServiceDefinition>);
|
|
21
|
+
/**
|
|
22
|
+
* Get or create a separate gRPC client for sending task results.
|
|
23
|
+
* Uses a dedicated channel to avoid HTTP/2 multiplexing issues with the
|
|
24
|
+
* long-lived waitForTasks stream on some runtimes (e.g. Bun).
|
|
25
|
+
*/
|
|
26
|
+
private getSendClient;
|
|
27
|
+
/**
|
|
28
|
+
* Register all handlers (events + commands) with the runtime.
|
|
29
|
+
*/
|
|
30
|
+
registerHandlers(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Start the event loop.
|
|
33
|
+
*/
|
|
34
|
+
start(): Promise<void>;
|
|
35
|
+
private processTasks;
|
|
36
|
+
private handleTask;
|
|
37
|
+
private handleCommand;
|
|
38
|
+
private sendTaskResult;
|
|
39
|
+
private fromProtoStorageEvent;
|
|
40
|
+
private fromProtoCronEvent;
|
|
41
|
+
private fromProtoQueueMessage;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=event-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-loop.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/event-loop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,WAAW,CAAA;AAkBtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAE3E;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,UAAU,CAA6B;IAC/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgD;IACxE,OAAO,CAAC,OAAO,CAAQ;gBAGrB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,UAAU,CAAC,OAAO,2BAA2B,CAAC;IAQzD;;;;OAIG;YACW,aAAa;IAQ3B;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BvC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAYd,YAAY;YAaZ,UAAU;YA4DV,aAAa;YAyBb,cAAc;IAqB5B,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,qBAAqB;CA4B9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
3
|
-
export declare const protobufPackage = "
|
|
3
|
+
export declare const protobufPackage = "alien_worker.control";
|
|
4
4
|
export interface RegisterHttpServerRequest {
|
|
5
5
|
/** The port the application's HTTP server is listening on */
|
|
6
6
|
port: number;
|
|
@@ -142,50 +142,50 @@ export declare const TaskSuccess: MessageFns<TaskSuccess>;
|
|
|
142
142
|
export declare const TaskError: MessageFns<TaskError>;
|
|
143
143
|
export declare const SendTaskResultResponse: MessageFns<SendTaskResultResponse>;
|
|
144
144
|
/**
|
|
145
|
-
* Service for runtime-application control communication.
|
|
146
|
-
* The runtime hosts this service, and applications connect to it.
|
|
145
|
+
* Service for Worker runtime-to-application control communication.
|
|
146
|
+
* The Worker runtime hosts this service, and Worker applications connect to it.
|
|
147
147
|
*/
|
|
148
148
|
export type ControlServiceDefinition = typeof ControlServiceDefinition;
|
|
149
149
|
export declare const ControlServiceDefinition: {
|
|
150
150
|
readonly name: "ControlService";
|
|
151
|
-
readonly fullName: "
|
|
151
|
+
readonly fullName: "alien_worker.control.ControlService";
|
|
152
152
|
readonly methods: {
|
|
153
153
|
/** App registers that it has an HTTP server listening on a port */
|
|
154
154
|
readonly registerHttpServer: {
|
|
155
155
|
readonly name: "RegisterHttpServer";
|
|
156
|
-
readonly requestType:
|
|
156
|
+
readonly requestType: MessageFns<RegisterHttpServerRequest>;
|
|
157
157
|
readonly requestStream: false;
|
|
158
|
-
readonly responseType:
|
|
158
|
+
readonly responseType: MessageFns<RegisterHttpServerResponse>;
|
|
159
159
|
readonly responseStream: false;
|
|
160
160
|
readonly options: {};
|
|
161
161
|
};
|
|
162
162
|
/** App registers an event handler for a specific resource */
|
|
163
163
|
readonly registerEventHandler: {
|
|
164
164
|
readonly name: "RegisterEventHandler";
|
|
165
|
-
readonly requestType:
|
|
165
|
+
readonly requestType: MessageFns<RegisterEventHandlerRequest>;
|
|
166
166
|
readonly requestStream: false;
|
|
167
|
-
readonly responseType:
|
|
167
|
+
readonly responseType: MessageFns<RegisterEventHandlerResponse>;
|
|
168
168
|
readonly responseStream: false;
|
|
169
169
|
readonly options: {};
|
|
170
170
|
};
|
|
171
171
|
/**
|
|
172
172
|
* App waits for tasks - this is a server-streaming RPC
|
|
173
|
-
*
|
|
173
|
+
* Worker runtime sends tasks as they arrive; the app processes them.
|
|
174
174
|
*/
|
|
175
175
|
readonly waitForTasks: {
|
|
176
176
|
readonly name: "WaitForTasks";
|
|
177
|
-
readonly requestType:
|
|
177
|
+
readonly requestType: MessageFns<WaitForTasksRequest>;
|
|
178
178
|
readonly requestStream: false;
|
|
179
|
-
readonly responseType:
|
|
179
|
+
readonly responseType: MessageFns<Task>;
|
|
180
180
|
readonly responseStream: true;
|
|
181
181
|
readonly options: {};
|
|
182
182
|
};
|
|
183
183
|
/** App sends result for a processed task */
|
|
184
184
|
readonly sendTaskResult: {
|
|
185
185
|
readonly name: "SendTaskResult";
|
|
186
|
-
readonly requestType:
|
|
186
|
+
readonly requestType: MessageFns<SendTaskResultRequest>;
|
|
187
187
|
readonly requestStream: false;
|
|
188
|
-
readonly responseType:
|
|
188
|
+
readonly responseType: MessageFns<SendTaskResultResponse>;
|
|
189
189
|
readonly responseStream: false;
|
|
190
190
|
readonly options: {};
|
|
191
191
|
};
|
|
@@ -198,7 +198,7 @@ export interface ControlServiceImplementation<CallContextExt = {}> {
|
|
|
198
198
|
registerEventHandler(request: RegisterEventHandlerRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RegisterEventHandlerResponse>>;
|
|
199
199
|
/**
|
|
200
200
|
* App waits for tasks - this is a server-streaming RPC
|
|
201
|
-
*
|
|
201
|
+
* Worker runtime sends tasks as they arrive; the app processes them.
|
|
202
202
|
*/
|
|
203
203
|
waitForTasks(request: WaitForTasksRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<Task>>;
|
|
204
204
|
/** App sends result for a processed task */
|
|
@@ -211,7 +211,7 @@ export interface ControlServiceClient<CallOptionsExt = {}> {
|
|
|
211
211
|
registerEventHandler(request: DeepPartial<RegisterEventHandlerRequest>, options?: CallOptions & CallOptionsExt): Promise<RegisterEventHandlerResponse>;
|
|
212
212
|
/**
|
|
213
213
|
* App waits for tasks - this is a server-streaming RPC
|
|
214
|
-
*
|
|
214
|
+
* Worker runtime sends tasks as they arrive; the app processes them.
|
|
215
215
|
*/
|
|
216
216
|
waitForTasks(request: DeepPartial<WaitForTasksRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<Task>;
|
|
217
217
|
/** App sends result for a processed task */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/worker-runtime/generated/control.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGjE,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wCAAwC;AACxC,MAAM,WAAW,IAAI;IACnB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,S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AE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
3
3
|
import { Duration } from "./google/protobuf/duration.js";
|
|
4
|
-
export declare const protobufPackage = "
|
|
5
|
-
/** Request to notify runtime about a new registered task. */
|
|
4
|
+
export declare const protobufPackage = "alien_worker.wait_until";
|
|
5
|
+
/** Request to notify the Worker runtime about a new registered task. */
|
|
6
6
|
export interface NotifyTaskRegisteredRequest {
|
|
7
7
|
/** Unique identifier for the application instance. */
|
|
8
8
|
applicationId: string;
|
|
@@ -13,7 +13,7 @@ export interface NotifyTaskRegisteredResponse {
|
|
|
13
13
|
/** Success confirmation. */
|
|
14
14
|
success: boolean;
|
|
15
15
|
}
|
|
16
|
-
/** Request to wait for drain signal from runtime. */
|
|
16
|
+
/** Request to wait for a drain signal from the Worker runtime. */
|
|
17
17
|
export interface WaitForDrainSignalRequest {
|
|
18
18
|
/** Unique identifier for the application instance. */
|
|
19
19
|
applicationId: string;
|
|
@@ -40,7 +40,7 @@ export interface NotifyDrainCompleteRequest {
|
|
|
40
40
|
errorMessage?: string | undefined;
|
|
41
41
|
}
|
|
42
42
|
export interface NotifyDrainCompleteResponse {
|
|
43
|
-
/** Acknowledgment from runtime. */
|
|
43
|
+
/** Acknowledgment from the Worker runtime. */
|
|
44
44
|
acknowledged: boolean;
|
|
45
45
|
}
|
|
46
46
|
/** Request to get current task count. */
|
|
@@ -60,77 +60,77 @@ export declare const NotifyDrainCompleteRequest: MessageFns<NotifyDrainCompleteR
|
|
|
60
60
|
export declare const NotifyDrainCompleteResponse: MessageFns<NotifyDrainCompleteResponse>;
|
|
61
61
|
export declare const GetTaskCountRequest: MessageFns<GetTaskCountRequest>;
|
|
62
62
|
export declare const GetTaskCountResponse: MessageFns<GetTaskCountResponse>;
|
|
63
|
-
/** Service for coordinating wait_until tasks between application and runtime. */
|
|
63
|
+
/** Service for coordinating wait_until tasks between a Worker application and its runtime. */
|
|
64
64
|
export type WaitUntilServiceDefinition = typeof WaitUntilServiceDefinition;
|
|
65
65
|
export declare const WaitUntilServiceDefinition: {
|
|
66
66
|
readonly name: "WaitUntilService";
|
|
67
|
-
readonly fullName: "
|
|
67
|
+
readonly fullName: "alien_worker.wait_until.WaitUntilService";
|
|
68
68
|
readonly methods: {
|
|
69
|
-
/** Application notifies runtime that it has registered a new task. */
|
|
69
|
+
/** Application notifies the Worker runtime that it has registered a new task. */
|
|
70
70
|
readonly notifyTaskRegistered: {
|
|
71
71
|
readonly name: "NotifyTaskRegistered";
|
|
72
|
-
readonly requestType:
|
|
72
|
+
readonly requestType: MessageFns<NotifyTaskRegisteredRequest>;
|
|
73
73
|
readonly requestStream: false;
|
|
74
|
-
readonly responseType:
|
|
74
|
+
readonly responseType: MessageFns<NotifyTaskRegisteredResponse>;
|
|
75
75
|
readonly responseStream: false;
|
|
76
76
|
readonly options: {};
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* Application calls this to wait for a drain signal from runtime.
|
|
80
|
-
* This is a blocking call that returns when runtime decides it's time to drain.
|
|
79
|
+
* Application calls this to wait for a drain signal from the Worker runtime.
|
|
80
|
+
* This is a blocking call that returns when the Worker runtime decides it's time to drain.
|
|
81
81
|
*/
|
|
82
82
|
readonly waitForDrainSignal: {
|
|
83
83
|
readonly name: "WaitForDrainSignal";
|
|
84
|
-
readonly requestType:
|
|
84
|
+
readonly requestType: MessageFns<WaitForDrainSignalRequest>;
|
|
85
85
|
readonly requestStream: false;
|
|
86
|
-
readonly responseType:
|
|
86
|
+
readonly responseType: MessageFns<WaitForDrainSignalResponse>;
|
|
87
87
|
readonly responseStream: false;
|
|
88
88
|
readonly options: {};
|
|
89
89
|
};
|
|
90
|
-
/** Application notifies runtime that it has completed draining all tasks. */
|
|
90
|
+
/** Application notifies the Worker runtime that it has completed draining all tasks. */
|
|
91
91
|
readonly notifyDrainComplete: {
|
|
92
92
|
readonly name: "NotifyDrainComplete";
|
|
93
|
-
readonly requestType:
|
|
93
|
+
readonly requestType: MessageFns<NotifyDrainCompleteRequest>;
|
|
94
94
|
readonly requestStream: false;
|
|
95
|
-
readonly responseType:
|
|
95
|
+
readonly responseType: MessageFns<NotifyDrainCompleteResponse>;
|
|
96
96
|
readonly responseStream: false;
|
|
97
97
|
readonly options: {};
|
|
98
98
|
};
|
|
99
|
-
/**
|
|
99
|
+
/** Worker runtime can query how many tasks are currently registered (for monitoring). */
|
|
100
100
|
readonly getTaskCount: {
|
|
101
101
|
readonly name: "GetTaskCount";
|
|
102
|
-
readonly requestType:
|
|
102
|
+
readonly requestType: MessageFns<GetTaskCountRequest>;
|
|
103
103
|
readonly requestStream: false;
|
|
104
|
-
readonly responseType:
|
|
104
|
+
readonly responseType: MessageFns<GetTaskCountResponse>;
|
|
105
105
|
readonly responseStream: false;
|
|
106
106
|
readonly options: {};
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
110
|
export interface WaitUntilServiceImplementation<CallContextExt = {}> {
|
|
111
|
-
/** Application notifies runtime that it has registered a new task. */
|
|
111
|
+
/** Application notifies the Worker runtime that it has registered a new task. */
|
|
112
112
|
notifyTaskRegistered(request: NotifyTaskRegisteredRequest, context: CallContext & CallContextExt): Promise<DeepPartial<NotifyTaskRegisteredResponse>>;
|
|
113
113
|
/**
|
|
114
|
-
* Application calls this to wait for a drain signal from runtime.
|
|
115
|
-
* This is a blocking call that returns when runtime decides it's time to drain.
|
|
114
|
+
* Application calls this to wait for a drain signal from the Worker runtime.
|
|
115
|
+
* This is a blocking call that returns when the Worker runtime decides it's time to drain.
|
|
116
116
|
*/
|
|
117
117
|
waitForDrainSignal(request: WaitForDrainSignalRequest, context: CallContext & CallContextExt): Promise<DeepPartial<WaitForDrainSignalResponse>>;
|
|
118
|
-
/** Application notifies runtime that it has completed draining all tasks. */
|
|
118
|
+
/** Application notifies the Worker runtime that it has completed draining all tasks. */
|
|
119
119
|
notifyDrainComplete(request: NotifyDrainCompleteRequest, context: CallContext & CallContextExt): Promise<DeepPartial<NotifyDrainCompleteResponse>>;
|
|
120
|
-
/**
|
|
120
|
+
/** Worker runtime can query how many tasks are currently registered (for monitoring). */
|
|
121
121
|
getTaskCount(request: GetTaskCountRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetTaskCountResponse>>;
|
|
122
122
|
}
|
|
123
123
|
export interface WaitUntilServiceClient<CallOptionsExt = {}> {
|
|
124
|
-
/** Application notifies runtime that it has registered a new task. */
|
|
124
|
+
/** Application notifies the Worker runtime that it has registered a new task. */
|
|
125
125
|
notifyTaskRegistered(request: DeepPartial<NotifyTaskRegisteredRequest>, options?: CallOptions & CallOptionsExt): Promise<NotifyTaskRegisteredResponse>;
|
|
126
126
|
/**
|
|
127
|
-
* Application calls this to wait for a drain signal from runtime.
|
|
128
|
-
* This is a blocking call that returns when runtime decides it's time to drain.
|
|
127
|
+
* Application calls this to wait for a drain signal from the Worker runtime.
|
|
128
|
+
* This is a blocking call that returns when the Worker runtime decides it's time to drain.
|
|
129
129
|
*/
|
|
130
130
|
waitForDrainSignal(request: DeepPartial<WaitForDrainSignalRequest>, options?: CallOptions & CallOptionsExt): Promise<WaitForDrainSignalResponse>;
|
|
131
|
-
/** Application notifies runtime that it has completed draining all tasks. */
|
|
131
|
+
/** Application notifies the Worker runtime that it has completed draining all tasks. */
|
|
132
132
|
notifyDrainComplete(request: DeepPartial<NotifyDrainCompleteRequest>, options?: CallOptions & CallOptionsExt): Promise<NotifyDrainCompleteResponse>;
|
|
133
|
-
/**
|
|
133
|
+
/** Worker runtime can query how many tasks are currently registered (for monitoring). */
|
|
134
134
|
getTaskCount(request: DeepPartial<GetTaskCountRequest>, options?: CallOptions & CallOptionsExt): Promise<GetTaskCountResponse>;
|
|
135
135
|
}
|
|
136
136
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait_until.d.ts","sourceRoot":"","sources":["../../../src/worker-runtime/generated/wait_until.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,wEAAwE;AACxE,MAAM,WAAW,2BAA2B;IAC1C,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,4BAA4B;IAC3C,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,kEAAkE;AAClE,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,YAAY,EACR,QAAQ,GACR,SAAS,CAAC;IACd,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2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C,GAC9C,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACrD,OAAO,CAAC,CAAC,CAAC,CAAC;AAMf,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gRPC utility functions for the Worker runtime's control-plane calls.
|
|
3
|
+
*
|
|
4
|
+
* The only gRPC surfaces left in the SDK are the Worker protocol services
|
|
5
|
+
* (Control + WaitUntil); binding I/O no longer flows over gRPC. So this wrapper
|
|
6
|
+
* maps any transport failure to a single {@link GrpcCallError} rather than the
|
|
7
|
+
* per-binding error taxonomy the old binding-gRPC clients carried.
|
|
8
|
+
*/
|
|
9
|
+
import { AlienError } from "@alienplatform/core";
|
|
10
|
+
/**
|
|
11
|
+
* Convert a gRPC error to an AlienError with proper chaining.
|
|
12
|
+
*/
|
|
13
|
+
export declare function grpcErrorToAlienError(error: unknown, service: string, method: string): Promise<AlienError<import("zod").ZodObject<{
|
|
14
|
+
service: import("zod").ZodString;
|
|
15
|
+
method: import("zod").ZodString;
|
|
16
|
+
grpcCode: import("zod").ZodString;
|
|
17
|
+
details: import("zod").ZodString;
|
|
18
|
+
}, import("zod/v4/core").$strip>>>;
|
|
19
|
+
/**
|
|
20
|
+
* Wrap an async gRPC call with error handling.
|
|
21
|
+
*/
|
|
22
|
+
export declare function wrapGrpcCall<T>(service: string, method: string, call: () => Promise<T>): Promise<T>;
|
|
23
|
+
//# sourceMappingURL=grpc-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc-utils.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/grpc-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAIhD;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;mCAyB1F;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAMZ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@alienplatform/sdk/worker-runtime` — the Worker protocol runtime.
|
|
3
|
+
*
|
|
4
|
+
* This subpath is the ONLY home for `nice-grpc` and the generated Worker
|
|
5
|
+
* protocol clients. It exports {@link runWorker}, the ~10-line bootstrap entry
|
|
6
|
+
* that generated Worker bootstraps call, plus the protocol internals those
|
|
7
|
+
* bootstraps build against.
|
|
8
|
+
*
|
|
9
|
+
* `runWorker` connects to the runtime over the Worker protocol
|
|
10
|
+
* (`ALIEN_WORKER_GRPC_ADDRESS`), serves the app's HTTP handler (if any) and
|
|
11
|
+
* registers its port, then registers the app's handlers and dispatches Worker
|
|
12
|
+
* tasks to them. Each `waitUntil` background task is reported to the runtime as
|
|
13
|
+
* it is registered (graceful drain-on-shutdown is a planned future feature).
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Run a Worker application.
|
|
17
|
+
*
|
|
18
|
+
* The generated Worker bootstrap imports the user module (which registers
|
|
19
|
+
* handlers via `command`/`onStorageEvent`/… as a side effect) and passes its
|
|
20
|
+
* default export here. `runWorker`:
|
|
21
|
+
*
|
|
22
|
+
* 1. Connects to the runtime over the Worker protocol (`ALIEN_WORKER_GRPC_ADDRESS`).
|
|
23
|
+
* 2. Serves the app's HTTP `fetch` handler (or a minimal readiness server) and
|
|
24
|
+
* registers the port with the runtime.
|
|
25
|
+
* 3. Registers the app's handlers and enters the task-dispatch loop, keeping the
|
|
26
|
+
* process alive and reporting `waitUntil` background tasks to the runtime as
|
|
27
|
+
* they are registered.
|
|
28
|
+
*
|
|
29
|
+
* @param app - The user module's default export (an object with a `fetch`
|
|
30
|
+
* method for HTTP apps), or `undefined` for handler-only Workers.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runWorker(app?: unknown): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/worker-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA8CH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC5D"}
|