@vibesdotdev/infra-core 0.0.2 → 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 +28 -1
- 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 +21 -32
- 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 +139 -33
- 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 +121 -37
- 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,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;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;IACpD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAA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BAAkB;IAClB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAExC,uBAAuB;IACvB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IAElD,+CAA+C;IAC/C,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC3E,0EAA0E;IAC1E,MAAM,EAAE,yBAAyB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH,MAAM,kCAAkC;IAItB;IACA;IAJjB,qDAAqD;IAC5C,MAAM,CAA0B;IACzC,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;;;;;;;;;;;;;;;;;;;;;;;;;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 -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.kind.js","sourceRoot":"","sources":["../../src/kinds/observability.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"observability.kind.js","sour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CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1D,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oCAAoC,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAC,KAAK,CACf,CAAC,CAAC,MAAM,CAAC;QACR,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC3B,6EAA6E;QAC7E,OAAO,EAAE,0BAA0B,CAAC,QAAQ,EAAE;KAC9C,CAAC,CACF;CACD,CAAC,CAAC;AA8BH,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAGhD;IACD,EAAE,EAAE,qBAAqB;IACzB,gBAAgB,EAAE,uBAAuB;IACzC,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC;AAKH,OAAO,EACN,uBAAuB,IAAI,kCAAkC,EAC7D,wBAAwB,EACxB,2BAA2B,EAC3B,CAAC"}
|
|
@@ -11,10 +11,18 @@
|
|
|
11
11
|
* - Adapter-specific fields (dockerImage, storageSize, domain, …)
|
|
12
12
|
* live exclusively under `config`. Each adapter package defines its own
|
|
13
13
|
* concrete schema under its discriminator key.
|
|
14
|
+
* - `publish` is how a release writes to this registry: the Secrets key that
|
|
15
|
+
* holds its credential, the second factor the account asks for, and, for a
|
|
16
|
+
* registry that only ever carries another registry's exact bytes, `mirrorOf`.
|
|
17
|
+
*
|
|
18
|
+
* Every release surface (`vibes infra npm publish`, `vibes infra npm mirror`,
|
|
19
|
+
* Forge's `publish:` step) resolves a registry by id through this kind and
|
|
20
|
+
* calls its implementation ({@link PackageRegistryImplementation}). The adapter
|
|
21
|
+
* named by `config.adapter` registers that implementation per descriptor id;
|
|
22
|
+
* a registry with no registered implementation refuses typed
|
|
23
|
+
* (`package-registry-implementation-missing`), never a silent fallback.
|
|
14
24
|
*/
|
|
15
25
|
import * as z from 'zod/v4';
|
|
16
|
-
import type { RuntimeKindDescriptorRecord } from '@vibesdotdev/runtime/schemas/kind';
|
|
17
|
-
import type { RuntimeDescriptor } from '@vibesdotdev/runtime/schemas/descriptor';
|
|
18
26
|
export declare const PackageRegistryTypeSchema: z.ZodEnum<{
|
|
19
27
|
npm: "npm";
|
|
20
28
|
docker: "docker";
|
|
@@ -22,21 +30,23 @@ export declare const PackageRegistryTypeSchema: z.ZodEnum<{
|
|
|
22
30
|
helm: "helm";
|
|
23
31
|
}>;
|
|
24
32
|
export type PackageRegistryType = z.infer<typeof PackageRegistryTypeSchema>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
/** What a release writes with: the credential's Secrets key, the account's second factor, and an exact-bytes source. */
|
|
34
|
+
export declare const PackageRegistryPublishSchema: z.ZodObject<{
|
|
35
|
+
credential: z.ZodObject<{
|
|
36
|
+
secret: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
secondFactor: z.ZodDefault<z.ZodEnum<{
|
|
39
|
+
web: "web";
|
|
40
|
+
none: "none";
|
|
41
|
+
otp: "otp";
|
|
42
|
+
}>>;
|
|
43
|
+
mirrorOf: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export type PackageRegistryPublish = z.infer<typeof PackageRegistryPublishSchema>;
|
|
46
|
+
/** Open adapter config: the adapter package that owns `adapter` validates the rest. */
|
|
47
|
+
export declare const PackageRegistryConfigSchema: z.ZodObject<{
|
|
48
|
+
adapter: z.ZodString;
|
|
49
|
+
}, z.core.$loose>;
|
|
40
50
|
export declare const PackageRegistryDescriptorSchema: z.ZodObject<{
|
|
41
51
|
id: z.ZodString;
|
|
42
52
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -45,10 +55,21 @@ export declare const PackageRegistryDescriptorSchema: z.ZodObject<{
|
|
|
45
55
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
56
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
47
57
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
48
59
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
60
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
62
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
66
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
67
|
+
reason: z.ZodString;
|
|
68
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>]>>;
|
|
50
70
|
kind: z.ZodLiteral<"infra/package-registry">;
|
|
51
|
-
url: z.ZodString
|
|
71
|
+
url: z.ZodOptional<z.ZodString>;
|
|
72
|
+
service: z.ZodOptional<z.ZodString>;
|
|
52
73
|
registryType: z.ZodDefault<z.ZodEnum<{
|
|
53
74
|
npm: "npm";
|
|
54
75
|
docker: "docker";
|
|
@@ -67,23 +88,108 @@ export declare const PackageRegistryDescriptorSchema: z.ZodObject<{
|
|
|
67
88
|
secret: z.ZodOptional<z.ZodBoolean>;
|
|
68
89
|
description: z.ZodOptional<z.ZodString>;
|
|
69
90
|
storeKey: z.ZodOptional<z.ZodString>;
|
|
91
|
+
storeBinding: z.ZodOptional<z.ZodBoolean>;
|
|
70
92
|
}, z.core.$strip>>>;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
publish: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
credential: z.ZodObject<{
|
|
95
|
+
secret: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
secondFactor: z.ZodDefault<z.ZodEnum<{
|
|
98
|
+
web: "web";
|
|
99
|
+
none: "none";
|
|
100
|
+
otp: "otp";
|
|
101
|
+
}>>;
|
|
102
|
+
mirrorOf: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
adapter: z.ZodString;
|
|
106
|
+
}, z.core.$loose>>;
|
|
79
107
|
}, z.core.$strip>;
|
|
80
108
|
export type PackageRegistryDescriptor = z.infer<typeof PackageRegistryDescriptorSchema>;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
109
|
+
/** One released version as a registry serves it. */
|
|
110
|
+
export type PackageRegistryRelease = {
|
|
111
|
+
version: string;
|
|
112
|
+
integrity: string;
|
|
113
|
+
};
|
|
114
|
+
/** What reading a package's release tag found. */
|
|
115
|
+
export type PackageRegistryReleaseRead = {
|
|
116
|
+
state: 'released';
|
|
117
|
+
release: PackageRegistryRelease;
|
|
118
|
+
}
|
|
119
|
+
/** The registry does not serve the package to this reader. */
|
|
120
|
+
| {
|
|
121
|
+
state: 'absent';
|
|
122
|
+
} | {
|
|
123
|
+
state: 'untagged';
|
|
124
|
+
};
|
|
125
|
+
/** Every release tag a registry serves for one package. */
|
|
126
|
+
export type PackageRegistryReleasesRead = {
|
|
127
|
+
state: 'released';
|
|
128
|
+
tags: Record<string, PackageRegistryRelease>;
|
|
129
|
+
}
|
|
130
|
+
/** The registry does not serve the package to this reader. */
|
|
131
|
+
| {
|
|
132
|
+
state: 'absent';
|
|
133
|
+
};
|
|
134
|
+
/** The second factor a write answers with, as the descriptor's `publish.secondFactor` asks. */
|
|
135
|
+
export type PackageRegistrySecondFactor = {
|
|
136
|
+
kind: 'otp';
|
|
137
|
+
code: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* `announce` shows the approval URL to the account owner; the write waits for the approval.
|
|
141
|
+
* With `retryOnTimeout`, an approval that expires unanswered is asked for again.
|
|
142
|
+
*/
|
|
143
|
+
| {
|
|
144
|
+
kind: 'web';
|
|
145
|
+
announce: (authUrl: string) => void | Promise<void>;
|
|
146
|
+
retryOnTimeout?: boolean;
|
|
147
|
+
};
|
|
148
|
+
/** Exact package bytes to write, with the digests the source recorded for them. */
|
|
149
|
+
export type PackageRegistryPublishInput = {
|
|
150
|
+
bytes: Uint8Array;
|
|
151
|
+
tag: string;
|
|
152
|
+
access?: 'public' | 'restricted';
|
|
153
|
+
dist: {
|
|
154
|
+
integrity: string;
|
|
155
|
+
shasum: string;
|
|
156
|
+
};
|
|
157
|
+
secondFactor?: PackageRegistrySecondFactor;
|
|
158
|
+
};
|
|
159
|
+
/** The release contract every `infra/package-registry` implementation answers. */
|
|
160
|
+
export interface PackageRegistryImplementation {
|
|
161
|
+
readonly config: PackageRegistryDescriptor;
|
|
162
|
+
/** The same registry reading its credential from another Secrets environment. */
|
|
163
|
+
forEnvironment(environment: string): PackageRegistryImplementation;
|
|
164
|
+
/** The registry origin: `url`, or the named service's configured primary origin. */
|
|
165
|
+
origin(): Promise<string>;
|
|
166
|
+
/** The version on `tag`, read as an anonymous caller when `anonymous` (what the public is served). */
|
|
167
|
+
readRelease(name: string, tag: string, options?: {
|
|
168
|
+
anonymous?: boolean;
|
|
169
|
+
}): Promise<PackageRegistryReleaseRead>;
|
|
170
|
+
/** Every release tag of `name`, read as an anonymous caller when `anonymous`. */
|
|
171
|
+
readReleases(name: string, options?: {
|
|
172
|
+
anonymous?: boolean;
|
|
173
|
+
}): Promise<PackageRegistryReleasesRead>;
|
|
174
|
+
/** The package's current dist-tags (tag → version); empty when the registry holds no such package. */
|
|
175
|
+
distTags(name: string): Promise<Record<string, string>>;
|
|
176
|
+
/** Points `tag` at an existing `version`, answered with the second factor the descriptor asks for. */
|
|
177
|
+
setTag(input: {
|
|
178
|
+
name: string;
|
|
179
|
+
tag: string;
|
|
180
|
+
version: string;
|
|
181
|
+
secondFactor?: PackageRegistrySecondFactor;
|
|
182
|
+
}): Promise<void>;
|
|
183
|
+
/** The integrity this registry records for `name@version`, or `undefined` when it holds no such version. */
|
|
184
|
+
versionIntegrity(name: string, version: string): Promise<string | undefined>;
|
|
185
|
+
/** The bytes of `name@version`, refused unless they match `integrity`. */
|
|
186
|
+
tarball(name: string, version: string, integrity: string): Promise<Uint8Array>;
|
|
187
|
+
/** Writes exactly `input.bytes` and returns once the registry accepts them (serving them may lag). */
|
|
188
|
+
publish(input: PackageRegistryPublishInput): Promise<{
|
|
189
|
+
name: string;
|
|
190
|
+
version: string;
|
|
191
|
+
integrity: string;
|
|
192
|
+
}>;
|
|
86
193
|
}
|
|
87
|
-
export declare const packageRegistryKind: RuntimeKindDescriptorRecord<
|
|
88
|
-
export {};
|
|
194
|
+
export declare const packageRegistryKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<PackageRegistryImplementation>;
|
|
89
195
|
//# sourceMappingURL=package-registry.kind.d.ts.map
|