@vibesdotdev/infra-core 0.0.1 → 1.0.0-rc.4
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 +33 -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-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.d.ts +8 -4
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +30 -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 +34 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -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 +62 -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 +381 -0
- package/dist/kinds/build-job.kind.d.ts.map +1 -0
- package/dist/kinds/build-job.kind.js +216 -0
- package/dist/kinds/build-job.kind.js.map +1 -0
- package/dist/kinds/cache.kind.d.ts +39 -92
- package/dist/kinds/cache.kind.d.ts.map +1 -1
- package/dist/kinds/cache.kind.js +26 -51
- 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 +138 -0
- package/dist/kinds/compute-source.kind.d.ts.map +1 -0
- package/dist/kinds/compute-source.kind.js +145 -0
- package/dist/kinds/compute-source.kind.js.map +1 -0
- package/dist/kinds/compute-sources.descriptors.d.ts +45 -0
- package/dist/kinds/compute-sources.descriptors.d.ts.map +1 -0
- package/dist/kinds/compute-sources.descriptors.js +93 -0
- package/dist/kinds/compute-sources.descriptors.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-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 +40 -15
- package/dist/kinds/index.d.ts.map +1 -1
- package/dist/kinds/index.js +39 -14
- package/dist/kinds/index.js.map +1 -1
- package/dist/kinds/inventory.kind.d.ts +326 -0
- package/dist/kinds/inventory.kind.d.ts.map +1 -0
- package/dist/kinds/inventory.kind.js +188 -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 +27 -31
- package/dist/kinds/package-registry.kind.d.ts.map +1 -1
- package/dist/kinds/package-registry.kind.js +13 -26
- 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 -36
- package/dist/kinds/sandbox.kind.d.ts.map +1 -1
- package/dist/kinds/sandbox.kind.js +80 -34
- 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 +40 -0
- package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
- package/dist/kinds/spend-guard.kind.js +133 -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 +115 -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 +291 -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 +336 -0
- package/dist/schemas/deployment-provider.d.ts.map +1 -0
- package/dist/schemas/deployment-provider.js +198 -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 +190 -20
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +137 -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 +132 -0
- package/dist/web-app-projection.d.ts.map +1 -0
- package/dist/web-app-projection.js +93 -0
- package/dist/web-app-projection.js.map +1 -0
- package/package.json +89 -39
- 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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind: infra/node-pool
|
|
3
|
+
*
|
|
4
|
+
* Provider-neutral Kubernetes node-pool descriptor. Captures autoscaling,
|
|
5
|
+
* GPU shape, device plugin flags, and a workload class used by infra
|
|
6
|
+
* profile reconcilers.
|
|
7
|
+
*
|
|
8
|
+
* `config` is an open, adapter-keyed shape (DigitalOcean's Kubernetes node
|
|
9
|
+
* pool config lives in `@vibesdotdev/integrations-digitalocean`); this kind
|
|
10
|
+
* names no provider, so a config for any adapter parses here and the
|
|
11
|
+
* adapter validates its own grammar.
|
|
12
|
+
*/
|
|
13
|
+
import * as z from 'zod/v4';
|
|
14
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
15
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
16
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
17
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
18
|
+
export const NodePoolTaintSchema = z.object({
|
|
19
|
+
key: z.string().min(1),
|
|
20
|
+
value: z.string(),
|
|
21
|
+
effect: z.enum(['NoSchedule', 'PreferNoSchedule', 'NoExecute'])
|
|
22
|
+
});
|
|
23
|
+
export const NodePoolGpuSchema = z.object({
|
|
24
|
+
vendor: z.enum(['nvidia', 'amd']),
|
|
25
|
+
model: z.string().min(1),
|
|
26
|
+
count: z.number().int().positive(),
|
|
27
|
+
vramGb: z.number().int().positive().optional()
|
|
28
|
+
});
|
|
29
|
+
export const NodePoolDevicePluginsSchema = z.object({
|
|
30
|
+
nvidia: z.boolean().optional(),
|
|
31
|
+
amd: z.boolean().optional(),
|
|
32
|
+
amdMetrics: z.boolean().optional()
|
|
33
|
+
});
|
|
34
|
+
export const NodePoolWorkloadClassSchema = z.enum([
|
|
35
|
+
'system',
|
|
36
|
+
'worker',
|
|
37
|
+
'build',
|
|
38
|
+
'exec',
|
|
39
|
+
'gpu-inference',
|
|
40
|
+
'gpu-training'
|
|
41
|
+
]);
|
|
42
|
+
const NodePoolBaseSchema = RuntimeDescriptorSchema.extend({
|
|
43
|
+
kind: z.literal('infra/node-pool'),
|
|
44
|
+
clusterRef: z.string().optional(),
|
|
45
|
+
size: z.string().min(1).optional(),
|
|
46
|
+
count: z.number().int().nonnegative().optional(),
|
|
47
|
+
autoScale: z.boolean().optional(),
|
|
48
|
+
minNodes: z.number().int().nonnegative().optional(),
|
|
49
|
+
maxNodes: z.number().int().nonnegative().optional(),
|
|
50
|
+
autoscaleToZero: z.boolean().optional(),
|
|
51
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
52
|
+
tags: z.array(z.string()).optional(),
|
|
53
|
+
taints: z.array(NodePoolTaintSchema).optional(),
|
|
54
|
+
gpu: NodePoolGpuSchema.optional(),
|
|
55
|
+
devicePlugins: NodePoolDevicePluginsSchema.optional(),
|
|
56
|
+
workloadClass: NodePoolWorkloadClassSchema.optional()
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
60
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
61
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
62
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
63
|
+
*/
|
|
64
|
+
export const NodePoolConfigSchema = z.looseObject({
|
|
65
|
+
adapter: z.string().min(1)
|
|
66
|
+
});
|
|
67
|
+
export const NodePoolDescriptorSchema = NodePoolBaseSchema.extend({
|
|
68
|
+
/** Adapter-specific configuration, parsed by the adapter that owns it. */
|
|
69
|
+
config: NodePoolConfigSchema.optional()
|
|
70
|
+
});
|
|
71
|
+
class DefaultNodePoolImplementation {
|
|
72
|
+
descriptor;
|
|
73
|
+
context;
|
|
74
|
+
/** The descriptor as this kind's schema reads it. */
|
|
75
|
+
config;
|
|
76
|
+
constructor(descriptor, context) {
|
|
77
|
+
this.descriptor = descriptor;
|
|
78
|
+
this.context = context;
|
|
79
|
+
this.config = readKindDescriptor(NodePoolDescriptorSchema, descriptor);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export const nodePoolKind = createRuntimeKind({
|
|
83
|
+
id: 'infra/node-pool',
|
|
84
|
+
descriptorSchema: NodePoolDescriptorSchema,
|
|
85
|
+
defaultImplementation: DefaultNodePoolImplementation,
|
|
86
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=node-pool.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-pool.kind.js","sourceRoot":"","sources":["../../src/kinds/node-pool.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;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,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;CAC/D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,CA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,YAAY,GAAG,iBAAiB,CAAoD;IAChG,EAAE,EAAE,iBAAiB;IACrB,gBAAgB,EAAE,wBAAwB;IAC1C,qBAAqB,EAAE,6BAA6B;IACpD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC"}
|
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes object/blob storage.
|
|
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 storage shape (bucket, cors, lifecycle, publicAccess).
|
|
10
|
-
* - Adapter-specific fields (region, acl, …) live under `config
|
|
11
|
-
* Each adapter package defines
|
|
10
|
+
* - Adapter-specific fields (region, acl, …) live under `config`, keyed by
|
|
11
|
+
* a non-empty `adapter` discriminator. Each adapter package defines and
|
|
12
|
+
* parses its own concrete schema (DigitalOcean Spaces' lives in
|
|
13
|
+
* `@vibesdotdev/integrations-digitalocean`; Cloudflare R2's in
|
|
14
|
+
* `@vibesdotdev/integrations-cloudflare`); this kind names no provider,
|
|
15
|
+
* so a config for any adapter — including one contributed by a user
|
|
16
|
+
* plugin — parses here, and the adapter validates its own grammar.
|
|
12
17
|
*/
|
|
13
18
|
import * as z from 'zod/v4';
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
19
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
20
|
+
import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
|
|
16
21
|
export declare const CorsRuleSchema: z.ZodObject<{
|
|
17
22
|
allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
18
23
|
allowedMethods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -23,22 +28,34 @@ export type CorsRule = z.infer<typeof CorsRuleSchema>;
|
|
|
23
28
|
export declare const LifecycleRuleSchema: z.ZodObject<{
|
|
24
29
|
prefix: z.ZodOptional<z.ZodString>;
|
|
25
30
|
expiration: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
abortIncompleteMultipartUploadDays: z.ZodOptional<z.ZodNumber>;
|
|
26
32
|
transition: z.ZodOptional<z.ZodObject<{
|
|
27
33
|
days: z.ZodNumber;
|
|
28
34
|
storageClass: z.ZodString;
|
|
29
35
|
}, z.core.$strip>>;
|
|
30
36
|
}, z.core.$strip>;
|
|
31
37
|
export type LifecycleRule = z.infer<typeof LifecycleRuleSchema>;
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Reference to a credential or secret materialized at apply time. The shape
|
|
40
|
+
* is intentionally permissive — full validation lives in the credentials
|
|
41
|
+
* runtime. Keeping it inline keeps this kind decoupled from runtime/secrets.
|
|
42
|
+
*/
|
|
43
|
+
export declare const CredentialReferenceSchema: z.ZodObject<{
|
|
44
|
+
store: z.ZodOptional<z.ZodString>;
|
|
45
|
+
key: z.ZodString;
|
|
46
|
+
env: z.ZodOptional<z.ZodString>;
|
|
34
47
|
}, z.core.$strip>;
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
export type CredentialReference = z.infer<typeof CredentialReferenceSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
51
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
52
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
53
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
54
|
+
*/
|
|
55
|
+
export declare const ObjectStorageConfigSchema: z.ZodObject<{
|
|
56
|
+
adapter: z.ZodString;
|
|
57
|
+
}, z.core.$loose>;
|
|
58
|
+
export type ObjectStorageConfig = z.infer<typeof ObjectStorageConfigSchema>;
|
|
42
59
|
export declare const ObjectStorageDescriptorSchema: z.ZodObject<{
|
|
43
60
|
id: z.ZodString;
|
|
44
61
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -47,8 +64,18 @@ export declare const ObjectStorageDescriptorSchema: z.ZodObject<{
|
|
|
47
64
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
65
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
49
66
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
50
68
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
69
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
71
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
75
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
76
|
+
reason: z.ZodString;
|
|
77
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>]>>;
|
|
52
79
|
kind: z.ZodLiteral<"infra/object-storage">;
|
|
53
80
|
bucket: z.ZodOptional<z.ZodString>;
|
|
54
81
|
cors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -60,26 +87,25 @@ export declare const ObjectStorageDescriptorSchema: z.ZodObject<{
|
|
|
60
87
|
lifecycle: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
88
|
prefix: z.ZodOptional<z.ZodString>;
|
|
62
89
|
expiration: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
abortIncompleteMultipartUploadDays: z.ZodOptional<z.ZodNumber>;
|
|
63
91
|
transition: z.ZodOptional<z.ZodObject<{
|
|
64
92
|
days: z.ZodNumber;
|
|
65
93
|
storageClass: z.ZodString;
|
|
66
94
|
}, z.core.$strip>>;
|
|
67
95
|
}, z.core.$strip>>>;
|
|
68
96
|
publicAccess: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
-
config: z.ZodOptional<z.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
-
adapter: z.ZodLiteral<"cloudflare-r2">;
|
|
74
|
-
}, z.core.$strip>]>>;
|
|
97
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
adapter: z.ZodString;
|
|
99
|
+
}, z.core.$loose>>;
|
|
75
100
|
}, z.core.$strip>;
|
|
76
101
|
export type ObjectStorageDescriptor = z.infer<typeof ObjectStorageDescriptorSchema>;
|
|
77
102
|
declare class DefaultObjectStorageImplementation {
|
|
78
103
|
readonly descriptor: RuntimeDescriptor;
|
|
79
|
-
readonly context:
|
|
80
|
-
|
|
81
|
-
|
|
104
|
+
readonly context: KindContext;
|
|
105
|
+
/** The descriptor as this kind's schema reads it. */
|
|
106
|
+
readonly config: ObjectStorageDescriptor;
|
|
107
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext);
|
|
82
108
|
}
|
|
83
|
-
export declare const objectStorageKind: RuntimeKindDescriptorRecord<DefaultObjectStorageImplementation>;
|
|
109
|
+
export declare const objectStorageKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DefaultObjectStorageImplementation>;
|
|
84
110
|
export {};
|
|
85
111
|
//# sourceMappingURL=object-storage.kind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-storage.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/object-storage.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"object-storage.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/object-storage.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAIpE,eAAO,MAAM,cAAc;;;;;iBAKzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;;;iBAiB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAkB5E;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;iBAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,cAAM,kCAAkC;aAItB,UAAU,EAAE,iBAAiB;aAC7B,OAAO,EAAE,WAAW;IAJrC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;gBAExB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,WAAW;CAKrC;AAED,eAAO,MAAM,iBAAiB,+FAQ5B,CAAC"}
|
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes object/blob storage.
|
|
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 storage shape (bucket, cors, lifecycle, publicAccess).
|
|
10
|
-
* - Adapter-specific fields (region, acl, …) live under `config
|
|
11
|
-
* Each adapter package defines
|
|
10
|
+
* - Adapter-specific fields (region, acl, …) live under `config`, keyed by
|
|
11
|
+
* a non-empty `adapter` discriminator. Each adapter package defines and
|
|
12
|
+
* parses its own concrete schema (DigitalOcean Spaces' lives in
|
|
13
|
+
* `@vibesdotdev/integrations-digitalocean`; Cloudflare R2's in
|
|
14
|
+
* `@vibesdotdev/integrations-cloudflare`); this kind names no provider,
|
|
15
|
+
* so a config for any adapter — including one contributed by a user
|
|
16
|
+
* plugin — parses here, and the adapter validates its own grammar.
|
|
12
17
|
*/
|
|
13
18
|
import * as z from 'zod/v4';
|
|
14
|
-
import { createRuntimeKind } from '@vibesdotdev/
|
|
15
|
-
import { RuntimeDescriptorSchema } from '@vibesdotdev/
|
|
16
|
-
import {
|
|
19
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
20
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
21
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
22
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
17
23
|
export const CorsRuleSchema = z.object({
|
|
18
24
|
allowedOrigins: z.array(z.string()).default(['*']),
|
|
19
25
|
allowedMethods: z.array(z.string()).default(['GET']),
|
|
@@ -25,6 +31,11 @@ export const LifecycleRuleSchema = z.object({
|
|
|
25
31
|
prefix: z.string().optional(),
|
|
26
32
|
/** Days until expiration */
|
|
27
33
|
expiration: z.number().int().positive().optional(),
|
|
34
|
+
/**
|
|
35
|
+
* Days after which incomplete multipart uploads are aborted.
|
|
36
|
+
* Maps to S3-compatible `AbortIncompleteMultipartUpload`.
|
|
37
|
+
*/
|
|
38
|
+
abortIncompleteMultipartUploadDays: z.number().int().positive().optional(),
|
|
28
39
|
/** Storage class transition */
|
|
29
40
|
transition: z
|
|
30
41
|
.object({
|
|
@@ -33,6 +44,16 @@ export const LifecycleRuleSchema = z.object({
|
|
|
33
44
|
})
|
|
34
45
|
.optional()
|
|
35
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* Reference to a credential or secret materialized at apply time. The shape
|
|
49
|
+
* is intentionally permissive — full validation lives in the credentials
|
|
50
|
+
* runtime. Keeping it inline keeps this kind decoupled from runtime/secrets.
|
|
51
|
+
*/
|
|
52
|
+
export const CredentialReferenceSchema = z.object({
|
|
53
|
+
store: z.string().min(1).optional(),
|
|
54
|
+
key: z.string().min(1),
|
|
55
|
+
env: z.string().min(1).optional()
|
|
56
|
+
});
|
|
36
57
|
const ObjectStorageBaseSchema = RuntimeDescriptorSchema.extend({
|
|
37
58
|
kind: z.literal('infra/object-storage'),
|
|
38
59
|
/** Bucket name (defaults to descriptor id when omitted). */
|
|
@@ -44,38 +65,34 @@ const ObjectStorageBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
44
65
|
/** Whether the bucket is publicly readable. */
|
|
45
66
|
publicAccess: z.boolean().optional()
|
|
46
67
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
70
|
+
* adapter package defines and parses its own config schema; this kind names
|
|
71
|
+
* no provider, so a config for any adapter — including one contributed by a
|
|
72
|
+
* user plugin — parses here, and the adapter validates its own grammar.
|
|
73
|
+
*/
|
|
74
|
+
export const ObjectStorageConfigSchema = z.looseObject({
|
|
75
|
+
adapter: z.string().min(1)
|
|
50
76
|
});
|
|
51
|
-
export const CloudflareR2ConfigSchema = z.object({});
|
|
52
|
-
export const ObjectStorageConfigSchema = z.union([
|
|
53
|
-
DOSpacesConfigSchema.extend({ adapter: z.literal('do-spaces') }),
|
|
54
|
-
CloudflareR2ConfigSchema.extend({ adapter: z.literal('cloudflare-r2') })
|
|
55
|
-
]);
|
|
56
77
|
export const ObjectStorageDescriptorSchema = ObjectStorageBaseSchema.extend({
|
|
57
|
-
/**
|
|
58
|
-
* Adapter-specific configuration. Discriminated union — each adapter
|
|
59
|
-
* package defines its own config schema under its discriminator key.
|
|
60
|
-
*/
|
|
78
|
+
/** Adapter-specific configuration, parsed by the adapter that owns it. */
|
|
61
79
|
config: ObjectStorageConfigSchema.optional()
|
|
62
80
|
});
|
|
63
81
|
class DefaultObjectStorageImplementation {
|
|
64
82
|
descriptor;
|
|
65
83
|
context;
|
|
84
|
+
/** The descriptor as this kind's schema reads it. */
|
|
85
|
+
config;
|
|
66
86
|
constructor(descriptor, context) {
|
|
67
87
|
this.descriptor = descriptor;
|
|
68
88
|
this.context = context;
|
|
69
|
-
|
|
70
|
-
get config() {
|
|
71
|
-
return this.descriptor;
|
|
89
|
+
this.config = readKindDescriptor(ObjectStorageDescriptorSchema, descriptor);
|
|
72
90
|
}
|
|
73
91
|
}
|
|
74
92
|
export const objectStorageKind = createRuntimeKind({
|
|
75
93
|
id: 'infra/object-storage',
|
|
76
94
|
descriptorSchema: ObjectStorageDescriptorSchema,
|
|
77
95
|
defaultImplementation: DefaultObjectStorageImplementation,
|
|
78
|
-
|
|
79
|
-
extractStem
|
|
96
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
80
97
|
});
|
|
81
98
|
//# sourceMappingURL=object-storage.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-storage.kind.js","sourceRoot":"","sources":["../../src/kinds/object-storage.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"object-storage.kind.js","sourceRoot":"","sources":["../../src/kinds/object-storage.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;A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,YACiB,UAA6B,EAC7B,OAAoB;QADpB,eAAU,GAAV,UAAU,CAAmB;QAC7B,YAAO,GAAP,OAAO,CAAa;QAEpC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,6BAA6B,EAAE,UAAU,CAAC,CAAC;IAC7E,CAAC;CAED;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAGhD;IACD,EAAE,EAAE,sBAAsB;IAC1B,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,kCAAkC;IACzD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC"}
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* 1. The CLI can introspect + write settings across the entire fleet
|
|
9
9
|
* without going through deploy.
|
|
10
|
-
* 2. Cross-cutting policies (e.g. "
|
|
11
|
-
*
|
|
10
|
+
* 2. Cross-cutting policies (e.g. "full log capture on every Worker")
|
|
11
|
+
* have a single declarative shape.
|
|
12
12
|
* 3. Provider impls map onto the native control plane (CF Workers
|
|
13
13
|
* Observability, DO Monitoring, Datadog, etc.).
|
|
14
14
|
*
|
|
15
15
|
* CLI surface (`vibes infra observability …`):
|
|
16
16
|
* status [--worker] read current settings
|
|
17
|
-
* set [--worker] --sampling
|
|
18
|
-
* exports list
|
|
17
|
+
* set [--worker] --sampling 1 write new settings
|
|
18
|
+
* exports list read safe export inventory
|
|
19
|
+
* exports add|remove (not yet wired)
|
|
19
20
|
*
|
|
20
21
|
* Production Workers consume settings via their wrangler.jsonc; the CLI
|
|
21
22
|
* writes directly to the provider API for immediate effect. To avoid
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
* path — the CLI here is for ops-time tuning between deploys.
|
|
24
25
|
*/
|
|
25
26
|
import * as z from 'zod/v4';
|
|
27
|
+
import { type InfraAuthorityFingerprint, type InfraProviderFailure } from './inventory.kind.ts';
|
|
26
28
|
declare const ObservabilityScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
29
|
kind: z.ZodLiteral<"worker">;
|
|
28
30
|
workerName: z.ZodString;
|
|
@@ -72,6 +74,33 @@ declare const ObservabilitySettingsSchema: z.ZodObject<{
|
|
|
72
74
|
}, z.core.$strip>], "kind">>>;
|
|
73
75
|
}, z.core.$strip>;
|
|
74
76
|
export type ObservabilitySettings = z.infer<typeof ObservabilitySettingsSchema>;
|
|
77
|
+
/**
|
|
78
|
+
* Provider-neutral queue health evidence collected from an adapter's live
|
|
79
|
+
* control plane. `oldestMessageAgeMs` is an age, rather than a provider
|
|
80
|
+
* timestamp, so consumers can compare it directly to a declared retention
|
|
81
|
+
* window.
|
|
82
|
+
*/
|
|
83
|
+
export declare const QueueBacklogSchema: z.ZodObject<{
|
|
84
|
+
queueName: z.ZodString;
|
|
85
|
+
backlogCount: z.ZodNumber;
|
|
86
|
+
backlogBytes: z.ZodNumber;
|
|
87
|
+
oldestMessageAgeMs: z.ZodNumber;
|
|
88
|
+
capturedAt: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type QueueBacklog = z.infer<typeof QueueBacklogSchema>;
|
|
91
|
+
export interface QueueBacklogAlert {
|
|
92
|
+
alerting: boolean;
|
|
93
|
+
thresholdMs: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A queue is alerting only after its oldest message has consumed more than
|
|
97
|
+
* half of its retention window. Equality is deliberately healthy: the
|
|
98
|
+
* policy is strictly `age > retention / 2`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function evaluateQueueBacklogAlert(queueBacklog: QueueBacklog, retentionMs: number): QueueBacklogAlert;
|
|
101
|
+
export interface QueueBacklogImplementation {
|
|
102
|
+
listQueueBacklogs(): Promise<QueueBacklog[]>;
|
|
103
|
+
}
|
|
75
104
|
declare const ObservabilityBaseSchema: z.ZodObject<{
|
|
76
105
|
id: z.ZodString;
|
|
77
106
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -80,9 +109,19 @@ declare const ObservabilityBaseSchema: z.ZodObject<{
|
|
|
80
109
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
110
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
82
111
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
83
113
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
114
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
-
config: z.ZodOptional<z.
|
|
115
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
116
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
117
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
121
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
122
|
+
reason: z.ZodString;
|
|
123
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>]>>;
|
|
86
125
|
kind: z.ZodLiteral<"infra/observability">;
|
|
87
126
|
adapter: z.ZodString;
|
|
88
127
|
adapterConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -141,7 +180,62 @@ export interface ObservabilitySnapshot {
|
|
|
141
180
|
settings: ObservabilitySettings;
|
|
142
181
|
/** Last-modified timestamp from the provider, when available. */
|
|
143
182
|
modifiedAt?: string;
|
|
183
|
+
/** Bounded provider-safe evidence when this worker could not be read. */
|
|
184
|
+
failure?: InfraProviderFailure;
|
|
144
185
|
}
|
|
186
|
+
/** Public inventory deliberately excludes destination credentials and URL paths. */
|
|
187
|
+
export declare const ObservabilityExportDestinationSchema: z.ZodObject<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
signal: z.ZodEnum<{
|
|
191
|
+
unknown: "unknown";
|
|
192
|
+
logs: "logs";
|
|
193
|
+
traces: "traces";
|
|
194
|
+
}>;
|
|
195
|
+
enabled: z.ZodBoolean;
|
|
196
|
+
endpointOrigin: z.ZodOptional<z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>>;
|
|
197
|
+
transport: z.ZodEnum<{
|
|
198
|
+
unknown: "unknown";
|
|
199
|
+
http: "http";
|
|
200
|
+
https: "https";
|
|
201
|
+
}>;
|
|
202
|
+
headerNames: z.ZodArray<z.ZodString>;
|
|
203
|
+
lastDeliveredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
204
|
+
lastErrorAt: z.ZodOptional<z.ZodISODateTime>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type ObservabilityExportDestination = z.infer<typeof ObservabilityExportDestinationSchema>;
|
|
207
|
+
export declare const ObservabilityExportInventorySchema: z.ZodObject<{
|
|
208
|
+
destinations: z.ZodArray<z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
signal: z.ZodEnum<{
|
|
212
|
+
unknown: "unknown";
|
|
213
|
+
logs: "logs";
|
|
214
|
+
traces: "traces";
|
|
215
|
+
}>;
|
|
216
|
+
enabled: z.ZodBoolean;
|
|
217
|
+
endpointOrigin: z.ZodOptional<z.ZodPipe<z.ZodURL, z.ZodTransform<string, string>>>;
|
|
218
|
+
transport: z.ZodEnum<{
|
|
219
|
+
unknown: "unknown";
|
|
220
|
+
http: "http";
|
|
221
|
+
https: "https";
|
|
222
|
+
}>;
|
|
223
|
+
headerNames: z.ZodArray<z.ZodString>;
|
|
224
|
+
lastDeliveredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
225
|
+
lastErrorAt: z.ZodOptional<z.ZodISODateTime>;
|
|
226
|
+
}, z.core.$strip>>;
|
|
227
|
+
workers: z.ZodArray<z.ZodObject<{
|
|
228
|
+
workerName: z.ZodString;
|
|
229
|
+
logs: z.ZodArray<z.ZodString>;
|
|
230
|
+
traces: z.ZodArray<z.ZodString>;
|
|
231
|
+
failure: z.ZodOptional<z.ZodObject<{
|
|
232
|
+
code: z.ZodString;
|
|
233
|
+
message: z.ZodString;
|
|
234
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
}, z.core.$strip>;
|
|
238
|
+
export type ObservabilityExportInventory = z.infer<typeof ObservabilityExportInventorySchema>;
|
|
145
239
|
export interface SetObservabilityInput {
|
|
146
240
|
scope: ObservabilityScope;
|
|
147
241
|
settings: ObservabilitySettings;
|
|
@@ -164,12 +258,16 @@ export interface SetObservabilityResult {
|
|
|
164
258
|
* Implementation contract every provider implements.
|
|
165
259
|
*/
|
|
166
260
|
export interface ObservabilityImplementation {
|
|
261
|
+
/** Redacted authority used by the latest provider request, when applicable. */
|
|
262
|
+
getAuthority?(): Promise<InfraAuthorityFingerprint>;
|
|
167
263
|
/** Read current settings for a scope. account-wide → one snapshot per Worker. */
|
|
168
264
|
getStatus(scope: ObservabilityScope): Promise<ObservabilitySnapshot[]>;
|
|
265
|
+
/** Read export destinations and worker bindings without proving collector delivery. */
|
|
266
|
+
listExports?(scope: ObservabilityScope): Promise<ObservabilityExportInventory>;
|
|
169
267
|
/** Apply settings to a scope. Returns per-Worker outcome. */
|
|
170
268
|
set(input: SetObservabilityInput): Promise<SetObservabilityResult>;
|
|
171
269
|
}
|
|
172
|
-
export declare const observabilityKind: import("@vibesdotdev/
|
|
270
|
+
export declare const observabilityKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<ObservabilityImplementation>;
|
|
173
271
|
export type InfraObservabilityKind = InfraObservabilityDescriptor;
|
|
174
272
|
export type InfraObservabilityKindInput = InfraObservabilityDescriptorInput;
|
|
175
273
|
export { ObservabilityBaseSchema as InfraObservabilityDescriptorSchema, ObservabilityScopeSchema, ObservabilitySettingsSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/observability.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"observability.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/observability.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAEN,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,MAAM,qBAAqB,CAAC;AAG7B,QAAA,MAAM,wBAAwB;;;;;;2BAU5B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmD/B,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;iBAM7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACxC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,GACjB,iBAAiB,CAWnB;AAED,MAAM,WAAW,0BAA0B;IAC1C,iBAAiB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC7C;AAED,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA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C/E,YAAY,CAAC,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACpD,iFAAiF;IACjF,SAAS,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACvE,uFAAuF;IACvF,WAAW,CAAC,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/E,6DAA6D;IAC7D,GAAG,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACnE;AAED,eAAO,MAAM,iBAAiB,wFAO5B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAClE,MAAM,MAAM,2BAA2B,GAAG,iCAAiC,CAAC;AAE5E,OAAO,EACN,uBAAuB,IAAI,kCAAkC,EAC7D,wBAAwB,EACxB,2BAA2B,EAC3B,CAAC"}
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* 1. The CLI can introspect + write settings across the entire fleet
|
|
9
9
|
* without going through deploy.
|
|
10
|
-
* 2. Cross-cutting policies (e.g. "
|
|
11
|
-
*
|
|
10
|
+
* 2. Cross-cutting policies (e.g. "full log capture on every Worker")
|
|
11
|
+
* have a single declarative shape.
|
|
12
12
|
* 3. Provider impls map onto the native control plane (CF Workers
|
|
13
13
|
* Observability, DO Monitoring, Datadog, etc.).
|
|
14
14
|
*
|
|
15
15
|
* CLI surface (`vibes infra observability …`):
|
|
16
16
|
* status [--worker] read current settings
|
|
17
|
-
* set [--worker] --sampling
|
|
18
|
-
* exports list
|
|
17
|
+
* set [--worker] --sampling 1 write new settings
|
|
18
|
+
* exports list read safe export inventory
|
|
19
|
+
* exports add|remove (not yet wired)
|
|
19
20
|
*
|
|
20
21
|
* Production Workers consume settings via their wrangler.jsonc; the CLI
|
|
21
22
|
* writes directly to the provider API for immediate effect. To avoid
|
|
@@ -23,9 +24,11 @@
|
|
|
23
24
|
* path — the CLI here is for ops-time tuning between deploys.
|
|
24
25
|
*/
|
|
25
26
|
import * as z from 'zod/v4';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
27
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
28
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
29
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
30
|
+
import { InfraProviderFailureSchema } from "./inventory.kind.js";
|
|
31
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
29
32
|
const ObservabilityScopeSchema = z.discriminatedUnion('kind', [
|
|
30
33
|
z.object({
|
|
31
34
|
kind: z.literal('worker'),
|
|
@@ -92,6 +95,36 @@ const ObservabilitySettingsSchema = z.object({
|
|
|
92
95
|
]))
|
|
93
96
|
.optional()
|
|
94
97
|
});
|
|
98
|
+
/**
|
|
99
|
+
* Provider-neutral queue health evidence collected from an adapter's live
|
|
100
|
+
* control plane. `oldestMessageAgeMs` is an age, rather than a provider
|
|
101
|
+
* timestamp, so consumers can compare it directly to a declared retention
|
|
102
|
+
* window.
|
|
103
|
+
*/
|
|
104
|
+
export const QueueBacklogSchema = z.object({
|
|
105
|
+
queueName: z.string().min(1),
|
|
106
|
+
backlogCount: z.number().int().nonnegative(),
|
|
107
|
+
backlogBytes: z.number().int().nonnegative(),
|
|
108
|
+
oldestMessageAgeMs: z.number().int().nonnegative(),
|
|
109
|
+
capturedAt: z.string().datetime()
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* A queue is alerting only after its oldest message has consumed more than
|
|
113
|
+
* half of its retention window. Equality is deliberately healthy: the
|
|
114
|
+
* policy is strictly `age > retention / 2`.
|
|
115
|
+
*/
|
|
116
|
+
export function evaluateQueueBacklogAlert(queueBacklog, retentionMs) {
|
|
117
|
+
if (!Number.isFinite(retentionMs) || retentionMs <= 0) {
|
|
118
|
+
throw new CapabilityError('Queue backlog retention must be a positive finite number of milliseconds.', 'INVALID_INPUT', {
|
|
119
|
+
reason: 'queue-backlog-retention-invalid'
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const thresholdMs = retentionMs / 2;
|
|
123
|
+
return {
|
|
124
|
+
alerting: queueBacklog.oldestMessageAgeMs > thresholdMs,
|
|
125
|
+
thresholdMs
|
|
126
|
+
};
|
|
127
|
+
}
|
|
95
128
|
const ObservabilityBaseSchema = RuntimeDescriptorSchema.extend({
|
|
96
129
|
kind: z.literal('infra/observability'),
|
|
97
130
|
adapter: z.string().min(1),
|
|
@@ -110,11 +143,36 @@ const ObservabilityBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
110
143
|
*/
|
|
111
144
|
settings: ObservabilitySettingsSchema.optional()
|
|
112
145
|
});
|
|
146
|
+
/** Public inventory deliberately excludes destination credentials and URL paths. */
|
|
147
|
+
export const ObservabilityExportDestinationSchema = z.object({
|
|
148
|
+
id: z.string().min(1),
|
|
149
|
+
name: z.string(),
|
|
150
|
+
signal: z.enum(['logs', 'traces', 'unknown']),
|
|
151
|
+
enabled: z.boolean(),
|
|
152
|
+
endpointOrigin: z
|
|
153
|
+
.url({ protocol: /^https?$/ })
|
|
154
|
+
.transform((value) => new URL(value).origin)
|
|
155
|
+
.optional(),
|
|
156
|
+
/** URL scheme only; does not certify an OTLP encoding or collector. */
|
|
157
|
+
transport: z.enum(['http', 'https', 'unknown']),
|
|
158
|
+
headerNames: z.array(z.string().regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/)),
|
|
159
|
+
lastDeliveredAt: z.iso.datetime().optional(),
|
|
160
|
+
lastErrorAt: z.iso.datetime().optional()
|
|
161
|
+
});
|
|
162
|
+
export const ObservabilityExportInventorySchema = z.object({
|
|
163
|
+
destinations: z.array(ObservabilityExportDestinationSchema),
|
|
164
|
+
workers: z.array(z.object({
|
|
165
|
+
workerName: z.string().min(1),
|
|
166
|
+
logs: z.array(z.string()),
|
|
167
|
+
traces: z.array(z.string()),
|
|
168
|
+
/** When present, empty lists mean unreadable, not confirmed unconfigured. */
|
|
169
|
+
failure: InfraProviderFailureSchema.optional()
|
|
170
|
+
}))
|
|
171
|
+
});
|
|
113
172
|
export const observabilityKind = createRuntimeKind({
|
|
114
173
|
id: 'infra/observability',
|
|
115
174
|
descriptorSchema: ObservabilityBaseSchema,
|
|
116
|
-
|
|
117
|
-
extractStem
|
|
175
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
118
176
|
});
|
|
119
177
|
export { ObservabilityBaseSchema as InfraObservabilityDescriptorSchema, ObservabilityScopeSchema, ObservabilitySettingsSchema };
|
|
120
178
|
//# sourceMappingURL=observability.kind.js.map
|