@vibesdotdev/infra-core 0.0.1 → 1.0.0-rc.11
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/LICENSE +18 -0
- package/README.md +34 -63
- package/dist/bootstrap/seed.descriptor.d.ts +1 -1
- package/dist/bootstrap/seed.descriptor.d.ts.map +1 -1
- package/dist/bootstrap/seed.descriptor.js +1 -1
- package/dist/bootstrap/seed.descriptor.js.map +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.d.ts +1 -3
- package/dist/bootstrap/seed.kind.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.js +17 -4
- package/dist/bootstrap/seed.kind.js.map +1 -1
- package/dist/bootstrap/seed.runner.d.ts +9 -2
- package/dist/bootstrap/seed.runner.d.ts.map +1 -1
- package/dist/bootstrap/seed.runner.js +37 -18
- package/dist/bootstrap/seed.runner.js.map +1 -1
- package/dist/capped-id.d.ts +19 -0
- package/dist/capped-id.d.ts.map +1 -0
- package/dist/capped-id.js +64 -0
- package/dist/capped-id.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts +23 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js +33 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts +24 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js +73 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/context.d.ts +17 -0
- package/dist/cli/generate/context.d.ts.map +1 -0
- package/dist/cli/generate/context.js +24 -0
- package/dist/cli/generate/context.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts +30 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js +25 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts +25 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js +64 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/generate-core.d.ts +51 -0
- package/dist/cli/generate/generate-core.d.ts.map +1 -0
- package/dist/cli/generate/generate-core.js +172 -0
- package/dist/cli/generate/generate-core.js.map +1 -0
- package/dist/cli/generate/index.d.ts +5 -0
- package/dist/cli/generate/index.d.ts.map +1 -0
- package/dist/cli/generate/index.js +5 -0
- package/dist/cli/generate/index.js.map +1 -0
- package/dist/credentials/resolve.d.ts +82 -22
- package/dist/credentials/resolve.d.ts.map +1 -1
- package/dist/credentials/resolve.js +251 -77
- package/dist/credentials/resolve.js.map +1 -1
- package/dist/deployment-budget.d.ts +319 -0
- package/dist/deployment-budget.d.ts.map +1 -0
- package/dist/deployment-budget.js +660 -0
- package/dist/deployment-budget.js.map +1 -0
- package/dist/deployment-environment.d.ts +30 -0
- package/dist/deployment-environment.d.ts.map +1 -0
- package/dist/deployment-environment.js +53 -0
- package/dist/deployment-environment.js.map +1 -0
- package/dist/deployment-graph.d.ts +185 -0
- package/dist/deployment-graph.d.ts.map +1 -0
- package/dist/deployment-graph.js +705 -0
- package/dist/deployment-graph.js.map +1 -0
- package/dist/deployment.d.ts +25 -4
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +105 -0
- package/dist/deployment.js.map +1 -1
- package/dist/doks/cloud/base.d.ts +49 -0
- package/dist/doks/cloud/base.d.ts.map +1 -0
- package/dist/doks/cloud/base.js +138 -0
- package/dist/doks/cloud/base.js.map +1 -0
- package/dist/doks/cloud/factory.d.ts +18 -0
- package/dist/doks/cloud/factory.d.ts.map +1 -0
- package/dist/doks/cloud/factory.js +22 -0
- package/dist/doks/cloud/factory.js.map +1 -0
- package/dist/doks/cloud/index.d.ts +5 -0
- package/dist/doks/cloud/index.d.ts.map +1 -0
- package/dist/doks/cloud/index.js +4 -0
- package/dist/doks/cloud/index.js.map +1 -0
- package/dist/doks/types.d.ts +95 -0
- package/dist/doks/types.d.ts.map +1 -0
- package/dist/doks/types.js +14 -0
- package/dist/doks/types.js.map +1 -0
- package/dist/generate/index.d.ts +29 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +28 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/infra-generate.plugin.d.ts +3 -0
- package/dist/generate/infra-generate.plugin.d.ts.map +1 -0
- package/dist/generate/infra-generate.plugin.js +23 -0
- package/dist/generate/infra-generate.plugin.js.map +1 -0
- package/dist/generate/plugin.d.ts +2 -0
- package/dist/generate/plugin.d.ts.map +1 -0
- package/dist/generate/plugin.js +2 -0
- package/dist/generate/plugin.js.map +1 -0
- package/dist/heartbeat/cron-heartbeat.d.ts +97 -0
- package/dist/heartbeat/cron-heartbeat.d.ts.map +1 -0
- package/dist/heartbeat/cron-heartbeat.js +200 -0
- package/dist/heartbeat/cron-heartbeat.js.map +1 -0
- package/dist/index.d.ts +37 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -14
- package/dist/index.js.map +1 -1
- package/dist/infra.plugin.d.ts +1 -1
- package/dist/infra.plugin.d.ts.map +1 -1
- package/dist/infra.plugin.js +64 -12
- package/dist/infra.plugin.js.map +1 -1
- package/dist/kinds/alerts.kind.d.ts +64 -25
- package/dist/kinds/alerts.kind.d.ts.map +1 -1
- package/dist/kinds/alerts.kind.js +43 -16
- package/dist/kinds/alerts.kind.js.map +1 -1
- package/dist/kinds/artifact.kind.d.ts +58 -10
- package/dist/kinds/artifact.kind.d.ts.map +1 -1
- package/dist/kinds/artifact.kind.js +26 -9
- package/dist/kinds/artifact.kind.js.map +1 -1
- package/dist/kinds/billing.kind.d.ts +88 -0
- package/dist/kinds/billing.kind.d.ts.map +1 -0
- package/dist/kinds/billing.kind.js +48 -0
- package/dist/kinds/billing.kind.js.map +1 -0
- package/dist/kinds/build-job.kind.d.ts +383 -0
- package/dist/kinds/build-job.kind.d.ts.map +1 -0
- package/dist/kinds/build-job.kind.js +218 -0
- package/dist/kinds/build-job.kind.js.map +1 -0
- package/dist/kinds/cache-byte-store.d.ts +23 -0
- package/dist/kinds/cache-byte-store.d.ts.map +1 -0
- package/dist/kinds/cache-byte-store.js +9 -0
- package/dist/kinds/cache-byte-store.js.map +1 -0
- package/dist/kinds/cache.kind.d.ts +38 -94
- package/dist/kinds/cache.kind.d.ts.map +1 -1
- package/dist/kinds/cache.kind.js +39 -50
- package/dist/kinds/cache.kind.js.map +1 -1
- package/dist/kinds/cluster.kind.d.ts +154 -0
- package/dist/kinds/cluster.kind.d.ts.map +1 -0
- package/dist/kinds/cluster.kind.js +99 -0
- package/dist/kinds/cluster.kind.js.map +1 -0
- package/dist/kinds/compute-source.kind.d.ts +155 -0
- package/dist/kinds/compute-source.kind.d.ts.map +1 -0
- package/dist/kinds/compute-source.kind.js +158 -0
- package/dist/kinds/compute-source.kind.js.map +1 -0
- package/dist/kinds/container-registry.kind.d.ts +62 -0
- package/dist/kinds/container-registry.kind.d.ts.map +1 -0
- package/dist/kinds/container-registry.kind.js +47 -0
- package/dist/kinds/container-registry.kind.js.map +1 -0
- package/dist/kinds/database-migrator.kind.d.ts +6 -0
- package/dist/kinds/database-migrator.kind.d.ts.map +1 -0
- package/dist/kinds/database-migrator.kind.js +28 -0
- package/dist/kinds/database-migrator.kind.js.map +1 -0
- package/dist/kinds/database.kind.d.ts +114 -93
- package/dist/kinds/database.kind.d.ts.map +1 -1
- package/dist/kinds/database.kind.js +93 -54
- package/dist/kinds/database.kind.js.map +1 -1
- package/dist/kinds/deployment-provider.kind.d.ts +5 -0
- package/dist/kinds/deployment-provider.kind.d.ts.map +1 -0
- package/dist/kinds/deployment-provider.kind.js +11 -0
- package/dist/kinds/deployment-provider.kind.js.map +1 -0
- package/dist/kinds/discovery.d.ts +5 -12
- package/dist/kinds/discovery.d.ts.map +1 -1
- package/dist/kinds/discovery.js +5 -17
- package/dist/kinds/discovery.js.map +1 -1
- package/dist/kinds/dns.kind.d.ts +162 -0
- package/dist/kinds/dns.kind.d.ts.map +1 -0
- package/dist/kinds/dns.kind.js +54 -0
- package/dist/kinds/dns.kind.js.map +1 -0
- package/dist/kinds/drift.kind.d.ts +115 -0
- package/dist/kinds/drift.kind.d.ts.map +1 -0
- package/dist/kinds/drift.kind.js +60 -0
- package/dist/kinds/drift.kind.js.map +1 -0
- package/dist/kinds/edge-hostname.kind.d.ts +124 -0
- package/dist/kinds/edge-hostname.kind.d.ts.map +1 -0
- package/dist/kinds/edge-hostname.kind.js +87 -0
- package/dist/kinds/edge-hostname.kind.js.map +1 -0
- package/dist/kinds/edge-tls.kind.d.ts +194 -0
- package/dist/kinds/edge-tls.kind.d.ts.map +1 -0
- package/dist/kinds/edge-tls.kind.js +58 -0
- package/dist/kinds/edge-tls.kind.js.map +1 -0
- package/dist/kinds/firewall.kind.d.ts +92 -0
- package/dist/kinds/firewall.kind.d.ts.map +1 -0
- package/dist/kinds/firewall.kind.js +59 -0
- package/dist/kinds/firewall.kind.js.map +1 -0
- package/dist/kinds/git-hosting.kind.d.ts +36 -38
- package/dist/kinds/git-hosting.kind.d.ts.map +1 -1
- package/dist/kinds/git-hosting.kind.js +23 -34
- package/dist/kinds/git-hosting.kind.js.map +1 -1
- package/dist/kinds/index.d.ts +41 -15
- package/dist/kinds/index.d.ts.map +1 -1
- package/dist/kinds/index.js +40 -14
- package/dist/kinds/index.js.map +1 -1
- package/dist/kinds/inventory.kind.d.ts +245 -0
- package/dist/kinds/inventory.kind.d.ts.map +1 -0
- package/dist/kinds/inventory.kind.js +243 -0
- package/dist/kinds/inventory.kind.js.map +1 -0
- package/dist/kinds/load-balancer.kind.d.ts +135 -0
- package/dist/kinds/load-balancer.kind.d.ts.map +1 -0
- package/dist/kinds/load-balancer.kind.js +71 -0
- package/dist/kinds/load-balancer.kind.js.map +1 -0
- package/dist/kinds/logs.kind.d.ts +74 -3
- package/dist/kinds/logs.kind.d.ts.map +1 -1
- package/dist/kinds/logs.kind.js +26 -17
- package/dist/kinds/logs.kind.js.map +1 -1
- package/dist/kinds/nfs.kind.d.ts +67 -0
- package/dist/kinds/nfs.kind.d.ts.map +1 -0
- package/dist/kinds/nfs.kind.js +45 -0
- package/dist/kinds/nfs.kind.js.map +1 -0
- package/dist/kinds/node-pool.kind.d.ts +134 -0
- package/dist/kinds/node-pool.kind.d.ts.map +1 -0
- package/dist/kinds/node-pool.kind.js +88 -0
- package/dist/kinds/node-pool.kind.js.map +1 -0
- package/dist/kinds/object-storage.kind.d.ts +50 -24
- package/dist/kinds/object-storage.kind.d.ts.map +1 -1
- package/dist/kinds/object-storage.kind.js +40 -23
- package/dist/kinds/object-storage.kind.js.map +1 -1
- package/dist/kinds/observability.kind.d.ts +104 -6
- package/dist/kinds/observability.kind.d.ts.map +1 -1
- package/dist/kinds/observability.kind.js +67 -9
- package/dist/kinds/observability.kind.js.map +1 -1
- package/dist/kinds/package-registry.kind.d.ts +141 -35
- package/dist/kinds/package-registry.kind.d.ts.map +1 -1
- package/dist/kinds/package-registry.kind.js +55 -25
- package/dist/kinds/package-registry.kind.js.map +1 -1
- package/dist/kinds/queue.kind.d.ts +67 -63
- package/dist/kinds/queue.kind.d.ts.map +1 -1
- package/dist/kinds/queue.kind.js +55 -33
- package/dist/kinds/queue.kind.js.map +1 -1
- package/dist/kinds/read-descriptor.d.ts +15 -0
- package/dist/kinds/read-descriptor.d.ts.map +1 -0
- package/dist/kinds/read-descriptor.js +11 -0
- package/dist/kinds/read-descriptor.js.map +1 -0
- package/dist/kinds/rum.kind.d.ts +36 -6
- package/dist/kinds/rum.kind.d.ts.map +1 -1
- package/dist/kinds/rum.kind.js +6 -7
- package/dist/kinds/rum.kind.js.map +1 -1
- package/dist/kinds/sandbox.kind.d.ts +136 -40
- package/dist/kinds/sandbox.kind.d.ts.map +1 -1
- package/dist/kinds/sandbox.kind.js +82 -43
- package/dist/kinds/sandbox.kind.js.map +1 -1
- package/dist/kinds/select-compute-source.d.ts +72 -0
- package/dist/kinds/select-compute-source.d.ts.map +1 -0
- package/dist/kinds/select-compute-source.js +170 -0
- package/dist/kinds/select-compute-source.js.map +1 -0
- package/dist/kinds/service-release.kind.d.ts +771 -0
- package/dist/kinds/service-release.kind.d.ts.map +1 -0
- package/dist/kinds/service-release.kind.js +676 -0
- package/dist/kinds/service-release.kind.js.map +1 -0
- package/dist/kinds/spend-guard.kind.d.ts +41 -0
- package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
- package/dist/kinds/spend-guard.kind.js +140 -0
- package/dist/kinds/spend-guard.kind.js.map +1 -0
- package/dist/kinds/utilization.kind.d.ts +88 -0
- package/dist/kinds/utilization.kind.d.ts.map +1 -0
- package/dist/kinds/utilization.kind.js +62 -0
- package/dist/kinds/utilization.kind.js.map +1 -0
- package/dist/kinds/volume.kind.d.ts +54 -0
- package/dist/kinds/volume.kind.d.ts.map +1 -0
- package/dist/kinds/volume.kind.js +39 -0
- package/dist/kinds/volume.kind.js.map +1 -0
- package/dist/kinds/vpc.kind.d.ts +61 -0
- package/dist/kinds/vpc.kind.d.ts.map +1 -0
- package/dist/kinds/vpc.kind.js +51 -0
- package/dist/kinds/vpc.kind.js.map +1 -0
- package/dist/kinds/web-app.kind.d.ts +118 -45
- package/dist/kinds/web-app.kind.d.ts.map +1 -1
- package/dist/kinds/web-app.kind.js +69 -42
- package/dist/kinds/web-app.kind.js.map +1 -1
- package/dist/kinds/worker.kind.d.ts +129 -188
- package/dist/kinds/worker.kind.d.ts.map +1 -1
- package/dist/kinds/worker.kind.js +45 -123
- package/dist/kinds/worker.kind.js.map +1 -1
- package/dist/schemas/database-migration.d.ts +173 -0
- package/dist/schemas/database-migration.d.ts.map +1 -0
- package/dist/schemas/database-migration.js +88 -0
- package/dist/schemas/database-migration.js.map +1 -0
- package/dist/schemas/deployment-environment.d.ts +11 -0
- package/dist/schemas/deployment-environment.d.ts.map +1 -0
- package/dist/schemas/deployment-environment.js +9 -0
- package/dist/schemas/deployment-environment.js.map +1 -0
- package/dist/schemas/deployment-provider.d.ts +383 -0
- package/dist/schemas/deployment-provider.d.ts.map +1 -0
- package/dist/schemas/deployment-provider.js +211 -0
- package/dist/schemas/deployment-provider.js.map +1 -0
- package/dist/schemas/log-stream.d.ts +27 -0
- package/dist/schemas/log-stream.d.ts.map +1 -0
- package/dist/schemas/log-stream.js +31 -0
- package/dist/schemas/log-stream.js.map +1 -0
- package/dist/schemas/spend-guard.d.ts +155 -0
- package/dist/schemas/spend-guard.d.ts.map +1 -0
- package/dist/schemas/spend-guard.js +61 -0
- package/dist/schemas/spend-guard.js.map +1 -0
- package/dist/schemas.d.ts +195 -20
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +151 -31
- package/dist/schemas.js.map +1 -1
- package/dist/service.d.ts +87 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +199 -0
- package/dist/service.js.map +1 -0
- package/dist/settle-work.d.ts +20 -0
- package/dist/settle-work.d.ts.map +1 -0
- package/dist/settle-work.js +22 -0
- package/dist/settle-work.js.map +1 -0
- package/dist/web-app-projection.d.ts +208 -0
- package/dist/web-app-projection.d.ts.map +1 -0
- package/dist/web-app-projection.js +95 -0
- package/dist/web-app-projection.js.map +1 -0
- package/package.json +123 -40
- package/SPEC.md +0 -169
- package/src/bootstrap/index.ts +0 -15
- package/src/bootstrap/seed.descriptor.ts +0 -24
- package/src/bootstrap/seed.impl-shape.ts +0 -5
- package/src/bootstrap/seed.kind.ts +0 -26
- package/src/bootstrap/seed.runner.ts +0 -87
- package/src/credentials/resolve.ts +0 -205
- package/src/deployment.ts +0 -57
- package/src/index.ts +0 -149
- package/src/infra.plugin.ts +0 -54
- package/src/kinds/alerts.kind.ts +0 -164
- package/src/kinds/artifact.kind.ts +0 -96
- package/src/kinds/cache.kind.ts +0 -104
- package/src/kinds/database.kind.ts +0 -120
- package/src/kinds/discovery.ts +0 -26
- package/src/kinds/git-hosting.kind.ts +0 -100
- package/src/kinds/index.ts +0 -139
- package/src/kinds/logs.kind.ts +0 -104
- package/src/kinds/object-storage.kind.ts +0 -101
- package/src/kinds/observability.kind.ts +0 -178
- package/src/kinds/package-registry.kind.ts +0 -95
- package/src/kinds/queue.kind.ts +0 -102
- package/src/kinds/rum.kind.ts +0 -135
- package/src/kinds/sandbox.kind.ts +0 -115
- package/src/kinds/web-app.kind.ts +0 -103
- package/src/kinds/worker.kind.ts +0 -203
- package/src/schemas.ts +0 -127
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes a background worker process.
|
|
5
5
|
*
|
|
6
|
-
* Schema shape: strict common base + `config
|
|
6
|
+
* Schema shape: strict common base + an open, adapter-keyed `config`.
|
|
7
7
|
*
|
|
8
8
|
* - The base defines fields universal across adapters: id/kind/name +
|
|
9
9
|
* the worker shape (entrypoint, queues, concurrency, scaling, env).
|
|
10
10
|
* - Adapter-specific fields (namespace, image, healthPort, …) live under
|
|
11
|
-
* `config
|
|
11
|
+
* `config`, keyed by a non-empty `adapter` discriminator. Each adapter
|
|
12
|
+
* package defines and parses its own concrete schema (DOKS deployment and
|
|
13
|
+
* DigitalOcean Functions configs live in
|
|
14
|
+
* `@vibesdotdev/integrations-digitalocean`; Cloudflare Workers' in
|
|
15
|
+
* `@vibesdotdev/integrations-cloudflare`); this kind names no provider,
|
|
16
|
+
* so a descriptor contributed by an adapter it has never heard of still
|
|
17
|
+
* parses and the adapter validates its own grammar at resolution time.
|
|
12
18
|
*/
|
|
13
19
|
import * as z from 'zod/v4';
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
20
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
21
|
+
import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
|
|
16
22
|
export declare const WorkerScalingSchema: z.ZodObject<{
|
|
17
23
|
min: z.ZodDefault<z.ZodNumber>;
|
|
18
24
|
max: z.ZodDefault<z.ZodNumber>;
|
|
@@ -20,127 +26,69 @@ export declare const WorkerScalingSchema: z.ZodObject<{
|
|
|
20
26
|
memory: z.ZodOptional<z.ZodString>;
|
|
21
27
|
}, z.core.$strip>;
|
|
22
28
|
export type WorkerScaling = z.infer<typeof WorkerScalingSchema>;
|
|
23
|
-
export declare const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
export declare const KubernetesTolerationSchema: z.ZodObject<{
|
|
30
|
+
key: z.ZodOptional<z.ZodString>;
|
|
31
|
+
operator: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
Exists: "Exists";
|
|
33
|
+
Equal: "Equal";
|
|
34
|
+
}>>;
|
|
35
|
+
value: z.ZodOptional<z.ZodString>;
|
|
36
|
+
effect: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
NoSchedule: "NoSchedule";
|
|
38
|
+
PreferNoSchedule: "PreferNoSchedule";
|
|
39
|
+
NoExecute: "NoExecute";
|
|
40
|
+
}>>;
|
|
29
41
|
}, z.core.$strip>;
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
kvNamespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
69
|
-
binding: z.ZodString;
|
|
70
|
-
id: z.ZodString;
|
|
71
|
-
}, z.core.$strip>>>;
|
|
72
|
-
r2Buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
73
|
-
binding: z.ZodString;
|
|
74
|
-
bucketName: z.ZodString;
|
|
75
|
-
}, z.core.$strip>>>;
|
|
76
|
-
queueProducers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
77
|
-
queue: z.ZodString;
|
|
78
|
-
binding: z.ZodString;
|
|
79
|
-
}, z.core.$strip>>>;
|
|
80
|
-
smartPlacement: z.ZodDefault<z.ZodBoolean>;
|
|
81
|
-
jobConsumer: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
export declare const WorkerHostedRuntimeSchema: z.ZodObject<{
|
|
43
|
+
scope: z.ZodObject<{
|
|
44
|
+
surface: z.ZodString;
|
|
45
|
+
hardware: z.ZodString;
|
|
46
|
+
purpose: z.ZodString;
|
|
47
|
+
lifecycle: z.ZodString;
|
|
48
|
+
hosting: z.ZodObject<{
|
|
49
|
+
mode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
50
|
+
local: "local";
|
|
51
|
+
hosted: "hosted";
|
|
52
|
+
"managed-cloud": "managed-cloud";
|
|
53
|
+
}>, z.ZodString]>;
|
|
54
|
+
owner: z.ZodUnion<readonly [z.ZodEnum<{
|
|
55
|
+
consumer: "consumer";
|
|
56
|
+
customer: "customer";
|
|
57
|
+
vibes: "vibes";
|
|
58
|
+
}>, z.ZodString]>;
|
|
59
|
+
venue: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
60
|
+
"user-device": "user-device";
|
|
61
|
+
"ipc-worker": "ipc-worker";
|
|
62
|
+
doks: "doks";
|
|
63
|
+
"cloudflare-workers": "cloudflare-workers";
|
|
64
|
+
"digitalocean-functions": "digitalocean-functions";
|
|
65
|
+
}>, z.ZodString]>>;
|
|
66
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
qualifiers: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
69
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
70
|
+
workspace: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
root: z.ZodOptional<z.ZodString>;
|
|
72
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
read: "read";
|
|
74
|
+
write: "write";
|
|
75
|
+
}>>;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
host: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
82
80
|
}, z.core.$strip>;
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
95
|
-
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
96
|
-
secretsStoreId: z.ZodOptional<z.ZodString>;
|
|
97
|
-
consumers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
98
|
-
queue: z.ZodString;
|
|
99
|
-
maxBatchSize: z.ZodDefault<z.ZodNumber>;
|
|
100
|
-
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
101
|
-
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip>>>;
|
|
103
|
-
durableObjects: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
104
|
-
binding: z.ZodString;
|
|
105
|
-
className: z.ZodString;
|
|
106
|
-
scriptName: z.ZodOptional<z.ZodString>;
|
|
107
|
-
}, z.core.$strip>>>;
|
|
108
|
-
migrations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
109
|
-
tag: z.ZodString;
|
|
110
|
-
newClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
|
-
renamedClasses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
112
|
-
from: z.ZodString;
|
|
113
|
-
to: z.ZodString;
|
|
114
|
-
}, z.core.$strip>>>;
|
|
115
|
-
deletedClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
-
newSqliteClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
-
}, z.core.$strip>>>;
|
|
118
|
-
services: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
119
|
-
binding: z.ZodString;
|
|
120
|
-
service: z.ZodString;
|
|
121
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
122
|
-
}, z.core.$strip>>>;
|
|
123
|
-
d1Databases: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
124
|
-
binding: z.ZodString;
|
|
125
|
-
databaseName: z.ZodString;
|
|
126
|
-
databaseId: z.ZodString;
|
|
127
|
-
}, z.core.$strip>>>;
|
|
128
|
-
kvNamespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
129
|
-
binding: z.ZodString;
|
|
130
|
-
id: z.ZodString;
|
|
131
|
-
}, z.core.$strip>>>;
|
|
132
|
-
r2Buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
133
|
-
binding: z.ZodString;
|
|
134
|
-
bucketName: z.ZodString;
|
|
135
|
-
}, z.core.$strip>>>;
|
|
136
|
-
queueProducers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
137
|
-
queue: z.ZodString;
|
|
138
|
-
binding: z.ZodString;
|
|
139
|
-
}, z.core.$strip>>>;
|
|
140
|
-
smartPlacement: z.ZodDefault<z.ZodBoolean>;
|
|
141
|
-
jobConsumer: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
-
adapter: z.ZodLiteral<"cloudflare-workers">;
|
|
143
|
-
}, z.core.$strip>]>;
|
|
81
|
+
export type WorkerHostedRuntime = z.infer<typeof WorkerHostedRuntimeSchema>;
|
|
82
|
+
/**
|
|
83
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
84
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
85
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
86
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
87
|
+
*/
|
|
88
|
+
export declare const WorkerConfigSchema: z.ZodObject<{
|
|
89
|
+
adapter: z.ZodString;
|
|
90
|
+
}, z.core.$loose>;
|
|
91
|
+
export type WorkerConfig = z.infer<typeof WorkerConfigSchema>;
|
|
144
92
|
export declare const WorkerDescriptorSchema: z.ZodObject<{
|
|
145
93
|
id: z.ZodString;
|
|
146
94
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -149,8 +97,18 @@ export declare const WorkerDescriptorSchema: z.ZodObject<{
|
|
|
149
97
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
150
98
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
151
99
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
152
101
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
153
102
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
104
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
108
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
109
|
+
reason: z.ZodString;
|
|
110
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strip>]>>;
|
|
154
112
|
kind: z.ZodLiteral<"infra/worker">;
|
|
155
113
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
156
114
|
queues: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -161,6 +119,45 @@ export declare const WorkerDescriptorSchema: z.ZodObject<{
|
|
|
161
119
|
cpu: z.ZodOptional<z.ZodString>;
|
|
162
120
|
memory: z.ZodOptional<z.ZodString>;
|
|
163
121
|
}, z.core.$strip>>;
|
|
122
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
scope: z.ZodObject<{
|
|
124
|
+
surface: z.ZodString;
|
|
125
|
+
hardware: z.ZodString;
|
|
126
|
+
purpose: z.ZodString;
|
|
127
|
+
lifecycle: z.ZodString;
|
|
128
|
+
hosting: z.ZodObject<{
|
|
129
|
+
mode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
130
|
+
local: "local";
|
|
131
|
+
hosted: "hosted";
|
|
132
|
+
"managed-cloud": "managed-cloud";
|
|
133
|
+
}>, z.ZodString]>;
|
|
134
|
+
owner: z.ZodUnion<readonly [z.ZodEnum<{
|
|
135
|
+
consumer: "consumer";
|
|
136
|
+
customer: "customer";
|
|
137
|
+
vibes: "vibes";
|
|
138
|
+
}>, z.ZodString]>;
|
|
139
|
+
venue: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
140
|
+
"user-device": "user-device";
|
|
141
|
+
"ipc-worker": "ipc-worker";
|
|
142
|
+
doks: "doks";
|
|
143
|
+
"cloudflare-workers": "cloudflare-workers";
|
|
144
|
+
"digitalocean-functions": "digitalocean-functions";
|
|
145
|
+
}>, z.ZodString]>>;
|
|
146
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
qualifiers: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
149
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
150
|
+
workspace: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
root: z.ZodOptional<z.ZodString>;
|
|
152
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
153
|
+
read: "read";
|
|
154
|
+
write: "write";
|
|
155
|
+
}>>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
host: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
164
161
|
env: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
162
|
name: z.ZodString;
|
|
166
163
|
public: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -169,76 +166,20 @@ export declare const WorkerDescriptorSchema: z.ZodObject<{
|
|
|
169
166
|
secret: z.ZodOptional<z.ZodBoolean>;
|
|
170
167
|
description: z.ZodOptional<z.ZodString>;
|
|
171
168
|
storeKey: z.ZodOptional<z.ZodString>;
|
|
169
|
+
storeBinding: z.ZodOptional<z.ZodBoolean>;
|
|
172
170
|
}, z.core.$strip>>>;
|
|
173
|
-
config: z.ZodOptional<z.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
healthPort: z.ZodDefault<z.ZodNumber>;
|
|
177
|
-
healthPath: z.ZodDefault<z.ZodString>;
|
|
178
|
-
readyPath: z.ZodDefault<z.ZodString>;
|
|
179
|
-
adapter: z.ZodLiteral<"doks-deployment">;
|
|
180
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
181
|
-
cfWorkerName: z.ZodString;
|
|
182
|
-
workerEntry: z.ZodDefault<z.ZodString>;
|
|
183
|
-
compatibilityDate: z.ZodOptional<z.ZodString>;
|
|
184
|
-
compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
|
-
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
186
|
-
secretsStoreId: z.ZodOptional<z.ZodString>;
|
|
187
|
-
consumers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
188
|
-
queue: z.ZodString;
|
|
189
|
-
maxBatchSize: z.ZodDefault<z.ZodNumber>;
|
|
190
|
-
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
191
|
-
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.core.$strip>>>;
|
|
193
|
-
durableObjects: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
194
|
-
binding: z.ZodString;
|
|
195
|
-
className: z.ZodString;
|
|
196
|
-
scriptName: z.ZodOptional<z.ZodString>;
|
|
197
|
-
}, z.core.$strip>>>;
|
|
198
|
-
migrations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
199
|
-
tag: z.ZodString;
|
|
200
|
-
newClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
201
|
-
renamedClasses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
202
|
-
from: z.ZodString;
|
|
203
|
-
to: z.ZodString;
|
|
204
|
-
}, z.core.$strip>>>;
|
|
205
|
-
deletedClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
206
|
-
newSqliteClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
|
-
}, z.core.$strip>>>;
|
|
208
|
-
services: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
209
|
-
binding: z.ZodString;
|
|
210
|
-
service: z.ZodString;
|
|
211
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
212
|
-
}, z.core.$strip>>>;
|
|
213
|
-
d1Databases: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
214
|
-
binding: z.ZodString;
|
|
215
|
-
databaseName: z.ZodString;
|
|
216
|
-
databaseId: z.ZodString;
|
|
217
|
-
}, z.core.$strip>>>;
|
|
218
|
-
kvNamespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
219
|
-
binding: z.ZodString;
|
|
220
|
-
id: z.ZodString;
|
|
221
|
-
}, z.core.$strip>>>;
|
|
222
|
-
r2Buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
223
|
-
binding: z.ZodString;
|
|
224
|
-
bucketName: z.ZodString;
|
|
225
|
-
}, z.core.$strip>>>;
|
|
226
|
-
queueProducers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
227
|
-
queue: z.ZodString;
|
|
228
|
-
binding: z.ZodString;
|
|
229
|
-
}, z.core.$strip>>>;
|
|
230
|
-
smartPlacement: z.ZodDefault<z.ZodBoolean>;
|
|
231
|
-
jobConsumer: z.ZodDefault<z.ZodBoolean>;
|
|
232
|
-
adapter: z.ZodLiteral<"cloudflare-workers">;
|
|
233
|
-
}, z.core.$strip>]>>;
|
|
171
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
adapter: z.ZodString;
|
|
173
|
+
}, z.core.$loose>>;
|
|
234
174
|
}, z.core.$strip>;
|
|
235
175
|
export type WorkerDescriptor = z.infer<typeof WorkerDescriptorSchema>;
|
|
236
176
|
declare class DefaultWorkerImplementation {
|
|
237
177
|
readonly descriptor: RuntimeDescriptor;
|
|
238
|
-
readonly context:
|
|
239
|
-
|
|
240
|
-
|
|
178
|
+
readonly context: KindContext;
|
|
179
|
+
/** The descriptor as this kind's schema reads it. */
|
|
180
|
+
readonly config: WorkerDescriptor;
|
|
181
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext);
|
|
241
182
|
}
|
|
242
|
-
export declare const workerKind: RuntimeKindDescriptorRecord<DefaultWorkerImplementation>;
|
|
183
|
+
export declare const workerKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DefaultWorkerImplementation>;
|
|
243
184
|
export {};
|
|
244
185
|
//# sourceMappingURL=worker.kind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.kind.d.ts","sourceRoot":"","sources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,eAAO,MAAM,UAAU,wFAKrB,CAAC"}
|
|
@@ -3,27 +3,51 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes a background worker process.
|
|
5
5
|
*
|
|
6
|
-
* Schema shape: strict common base + `config
|
|
6
|
+
* Schema shape: strict common base + an open, adapter-keyed `config`.
|
|
7
7
|
*
|
|
8
8
|
* - The base defines fields universal across adapters: id/kind/name +
|
|
9
9
|
* the worker shape (entrypoint, queues, concurrency, scaling, env).
|
|
10
10
|
* - Adapter-specific fields (namespace, image, healthPort, …) live under
|
|
11
|
-
* `config
|
|
11
|
+
* `config`, keyed by a non-empty `adapter` discriminator. Each adapter
|
|
12
|
+
* package defines and parses its own concrete schema (DOKS deployment and
|
|
13
|
+
* DigitalOcean Functions configs live in
|
|
14
|
+
* `@vibesdotdev/integrations-digitalocean`; Cloudflare Workers' in
|
|
15
|
+
* `@vibesdotdev/integrations-cloudflare`); this kind names no provider,
|
|
16
|
+
* so a descriptor contributed by an adapter it has never heard of still
|
|
17
|
+
* parses and the adapter validates its own grammar at resolution time.
|
|
12
18
|
*/
|
|
13
19
|
import * as z from 'zod/v4';
|
|
14
|
-
import { createRuntimeKind } from '@vibesdotdev/
|
|
15
|
-
import { RuntimeDescriptorSchema } from '@vibesdotdev/
|
|
20
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
21
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
22
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
23
|
+
import { WireRuntimeScopeSchema } from '@vibesdotdev/kernel/schemas/scope';
|
|
16
24
|
import { deploymentEnvRequirementSchema } from "../schemas.js";
|
|
17
|
-
import {
|
|
25
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
18
26
|
export const WorkerScalingSchema = z.object({
|
|
19
27
|
min: z.number().int().nonnegative().default(1),
|
|
20
28
|
max: z.number().int().positive().default(1),
|
|
21
29
|
cpu: z.string().optional(),
|
|
22
30
|
memory: z.string().optional()
|
|
23
31
|
});
|
|
32
|
+
export const KubernetesTolerationSchema = z.object({
|
|
33
|
+
key: z.string().min(1).optional(),
|
|
34
|
+
operator: z.enum(['Exists', 'Equal']).optional(),
|
|
35
|
+
value: z.string().optional(),
|
|
36
|
+
effect: z.enum(['NoSchedule', 'PreferNoSchedule', 'NoExecute']).optional()
|
|
37
|
+
});
|
|
38
|
+
export const WorkerHostedRuntimeSchema = z.object({
|
|
39
|
+
/**
|
|
40
|
+
* Runtime scope this worker process hosts. This is distinct from the
|
|
41
|
+
* descriptor's own top-level `hardware` field, which scopes the infra
|
|
42
|
+
* descriptor/resolver itself.
|
|
43
|
+
*/
|
|
44
|
+
scope: WireRuntimeScopeSchema,
|
|
45
|
+
/** Queue/runtime adapter that this host should resolve explicitly, when any. */
|
|
46
|
+
adapter: z.string().min(1).optional()
|
|
47
|
+
});
|
|
24
48
|
const WorkerBaseSchema = RuntimeDescriptorSchema.extend({
|
|
25
49
|
kind: z.literal('infra/worker'),
|
|
26
|
-
/** Path to worker entrypoint (e.g., '
|
|
50
|
+
/** Path to worker entrypoint (e.g., 'workers/src/ai/entrypoint.ts'). */
|
|
27
51
|
entrypoint: z.string().min(1).optional(),
|
|
28
52
|
/** Queue names this worker consumes from. */
|
|
29
53
|
queues: z.array(z.string().min(1)).optional(),
|
|
@@ -31,141 +55,39 @@ const WorkerBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
31
55
|
concurrency: z.number().int().positive().optional(),
|
|
32
56
|
/** Scaling configuration. */
|
|
33
57
|
scaling: WorkerScalingSchema.optional(),
|
|
58
|
+
/** Runtime hosted by this worker process. */
|
|
59
|
+
runtime: WorkerHostedRuntimeSchema.optional(),
|
|
34
60
|
/** Environment variable requirements. */
|
|
35
61
|
env: z.array(deploymentEnvRequirementSchema).optional()
|
|
36
62
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
healthPath: z.string().min(1).default('/healthz'),
|
|
46
|
-
/** Readiness probe path (default: /readyz). */
|
|
47
|
-
readyPath: z.string().min(1).default('/readyz')
|
|
48
|
-
});
|
|
49
|
-
export const CloudflareWorkersWorkerConfigSchema = z.object({
|
|
50
|
-
/** Cloudflare Workers script name (e.g., "vibes-jobs"). */
|
|
51
|
-
cfWorkerName: z.string().min(1),
|
|
52
|
-
/** Path to the `_worker.js` entry point relative to outputDir. */
|
|
53
|
-
workerEntry: z.string().min(1).default('_worker.js'),
|
|
54
|
-
/** Compatibility date for wrangler. */
|
|
55
|
-
compatibilityDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
56
|
-
/** Compatibility flags for wrangler. */
|
|
57
|
-
compatibilityFlags: z.array(z.string()).default(['nodejs_compat']),
|
|
58
|
-
/** Environment variables to include. */
|
|
59
|
-
env: z.record(z.string(), z.string()).default({}),
|
|
60
|
-
/** Cloudflare Secrets Store ID for secret bindings. */
|
|
61
|
-
secretsStoreId: z.string().min(1).optional(),
|
|
62
|
-
/**
|
|
63
|
-
* Detailed queue-consumer config. When present, these override the
|
|
64
|
-
* coarse `queues: string[]` field on the base descriptor and let
|
|
65
|
-
* declarations control batch size, retries, and dead-letter routing.
|
|
66
|
-
*/
|
|
67
|
-
consumers: z
|
|
68
|
-
.array(z.object({
|
|
69
|
-
queue: z.string().min(1),
|
|
70
|
-
maxBatchSize: z.number().int().positive().default(10),
|
|
71
|
-
maxRetries: z.number().int().min(0).default(3),
|
|
72
|
-
deadLetterQueue: z.string().optional()
|
|
73
|
-
}))
|
|
74
|
-
.default([]),
|
|
75
|
-
/** Durable Object class bindings. */
|
|
76
|
-
durableObjects: z
|
|
77
|
-
.array(z.object({
|
|
78
|
-
binding: z.string().regex(/^[_A-Z0-9]+$/),
|
|
79
|
-
className: z.string().min(1),
|
|
80
|
-
scriptName: z.string().min(1).optional()
|
|
81
|
-
}))
|
|
82
|
-
.default([]),
|
|
83
|
-
/** Durable Object migrations. */
|
|
84
|
-
migrations: z
|
|
85
|
-
.array(z.object({
|
|
86
|
-
tag: z.string().min(1),
|
|
87
|
-
newClasses: z.array(z.string().min(1)).optional(),
|
|
88
|
-
renamedClasses: z
|
|
89
|
-
.array(z.object({ from: z.string().min(1), to: z.string().min(1) }))
|
|
90
|
-
.optional(),
|
|
91
|
-
deletedClasses: z.array(z.string().min(1)).optional(),
|
|
92
|
-
newSqliteClasses: z.array(z.string().min(1)).optional()
|
|
93
|
-
}))
|
|
94
|
-
.default([]),
|
|
95
|
-
/** Service bindings — call other Workers from this Worker. */
|
|
96
|
-
services: z
|
|
97
|
-
.array(z.object({
|
|
98
|
-
binding: z.string().regex(/^[_A-Z0-9]+$/),
|
|
99
|
-
service: z.string().min(1),
|
|
100
|
-
environment: z.string().min(1).optional()
|
|
101
|
-
}))
|
|
102
|
-
.default([]),
|
|
103
|
-
/** D1 database bindings. */
|
|
104
|
-
d1Databases: z
|
|
105
|
-
.array(z.object({
|
|
106
|
-
binding: z.string().regex(/^[_A-Z0-9]+$/),
|
|
107
|
-
databaseName: z.string().min(1),
|
|
108
|
-
databaseId: z.string().min(1)
|
|
109
|
-
}))
|
|
110
|
-
.default([]),
|
|
111
|
-
/** KV namespace bindings. */
|
|
112
|
-
kvNamespaces: z
|
|
113
|
-
.array(z.object({
|
|
114
|
-
binding: z.string().min(1),
|
|
115
|
-
id: z.string().min(1)
|
|
116
|
-
}))
|
|
117
|
-
.default([]),
|
|
118
|
-
/** R2 bucket bindings. */
|
|
119
|
-
r2Buckets: z
|
|
120
|
-
.array(z.object({
|
|
121
|
-
binding: z.string().min(1),
|
|
122
|
-
bucketName: z.string().min(1)
|
|
123
|
-
}))
|
|
124
|
-
.default([]),
|
|
125
|
-
/** Queue producer bindings (worker can also produce to queues). */
|
|
126
|
-
queueProducers: z
|
|
127
|
-
.array(z.object({
|
|
128
|
-
queue: z.string().min(1),
|
|
129
|
-
binding: z.string().min(1)
|
|
130
|
-
}))
|
|
131
|
-
.default([]),
|
|
132
|
-
/** Enable smart placement. */
|
|
133
|
-
smartPlacement: z.boolean().default(false),
|
|
134
|
-
/**
|
|
135
|
-
* Whether this is a job-consumer Worker. When true, deploy step
|
|
136
|
-
* auto-injects the JOB_RESULT_STORE Durable Object binding +
|
|
137
|
-
* initial migration via `generateJobConsumerWorkerConfig` from
|
|
138
|
-
* `@vibesdotdev/infra-cloudflare`.
|
|
139
|
-
*/
|
|
140
|
-
jobConsumer: z.boolean().default(false)
|
|
63
|
+
/**
|
|
64
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
65
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
66
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
67
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
68
|
+
*/
|
|
69
|
+
export const WorkerConfigSchema = z.looseObject({
|
|
70
|
+
adapter: z.string().min(1)
|
|
141
71
|
});
|
|
142
|
-
export const WorkerConfigSchema = z.union([
|
|
143
|
-
DoksDeploymentWorkerConfigSchema.extend({ adapter: z.literal('doks-deployment') }),
|
|
144
|
-
CloudflareWorkersWorkerConfigSchema.extend({ adapter: z.literal('cloudflare-workers') })
|
|
145
|
-
]);
|
|
146
72
|
export const WorkerDescriptorSchema = WorkerBaseSchema.extend({
|
|
147
|
-
/**
|
|
148
|
-
* Adapter-specific configuration. Discriminated union — each adapter
|
|
149
|
-
* package defines its own config schema under its discriminator key.
|
|
150
|
-
*/
|
|
73
|
+
/** Adapter-specific configuration, parsed by the adapter that owns it. */
|
|
151
74
|
config: WorkerConfigSchema.optional()
|
|
152
75
|
});
|
|
153
76
|
class DefaultWorkerImplementation {
|
|
154
77
|
descriptor;
|
|
155
78
|
context;
|
|
79
|
+
/** The descriptor as this kind's schema reads it. */
|
|
80
|
+
config;
|
|
156
81
|
constructor(descriptor, context) {
|
|
157
82
|
this.descriptor = descriptor;
|
|
158
83
|
this.context = context;
|
|
159
|
-
|
|
160
|
-
get config() {
|
|
161
|
-
return this.descriptor;
|
|
84
|
+
this.config = readKindDescriptor(WorkerDescriptorSchema, descriptor);
|
|
162
85
|
}
|
|
163
86
|
}
|
|
164
87
|
export const workerKind = createRuntimeKind({
|
|
165
88
|
id: 'infra/worker',
|
|
166
89
|
descriptorSchema: WorkerDescriptorSchema,
|
|
167
90
|
defaultImplementation: DefaultWorkerImplementation,
|
|
168
|
-
|
|
169
|
-
extractStem
|
|
91
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
170
92
|
});
|
|
171
93
|
//# sourceMappingURL=worker.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.kind.js","sourceRoot":"","sources":["../../src/kinds/worker.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker.kind.js","sourceRoot":"","sources":["../../src/kinds/worker.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAA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