@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
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Describes a database instance.
|
|
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 database shape (engine, size, replicas, backups).
|
|
10
10
|
* - Adapter-specific fields (namespace, storageSize, version, region, …)
|
|
11
|
-
* live under `config`. Each adapter package
|
|
11
|
+
* live under an open `config` keyed by `adapter`. Each adapter package
|
|
12
|
+
* defines and parses its own concrete schema.
|
|
12
13
|
*/
|
|
13
14
|
import * as z from 'zod/v4';
|
|
14
|
-
import { createRuntimeKind } from '@vibesdotdev/
|
|
15
|
-
import { RuntimeDescriptorSchema } from '@vibesdotdev/
|
|
16
|
-
import {
|
|
15
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
16
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
17
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
18
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
17
19
|
export const DatabaseBackupSchema = z.object({
|
|
18
20
|
enabled: z.boolean().default(false),
|
|
19
21
|
schedule: z.string().optional(),
|
|
@@ -30,74 +32,111 @@ const DatabaseBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
30
32
|
/** Backup configuration. */
|
|
31
33
|
backups: DatabaseBackupSchema.optional()
|
|
32
34
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
/** Range of source IPs/UUIDs that may reach the cluster. */
|
|
36
|
+
export const TrustedSourceSchema = z.object({
|
|
37
|
+
/** Resource type (droplet, k8s, ip, tag, app). */
|
|
38
|
+
type: z.enum(['droplet', 'k8s', 'ip_addr', 'tag', 'app']),
|
|
39
|
+
/** Identifier — droplet id, cluster uuid, CIDR, tag name, or app id. */
|
|
40
|
+
value: z.string().min(1)
|
|
41
|
+
});
|
|
42
|
+
/** Storage autoscaling configuration. */
|
|
43
|
+
export const StorageAutoscalingSchema = z.object({
|
|
44
|
+
enabled: z.boolean().default(true),
|
|
45
|
+
/** Trigger threshold as a percentage of provisioned storage. */
|
|
46
|
+
thresholdPercent: z.number().int().min(1).max(100).default(80),
|
|
47
|
+
/** Maximum disk size in GiB (0 = uncapped). */
|
|
48
|
+
maxSizeGib: z.number().int().nonnegative().default(0),
|
|
49
|
+
/** Step (percent of current size) to grow by. */
|
|
50
|
+
incrementPercent: z.number().int().min(1).max(100).default(20)
|
|
51
|
+
});
|
|
52
|
+
/** PgBouncer / direct pool configuration. */
|
|
53
|
+
export const ConnectionPoolSchema = z.object({
|
|
54
|
+
name: z.string().min(1),
|
|
55
|
+
mode: z.enum(['transaction', 'session', 'statement']).default('transaction'),
|
|
56
|
+
size: z.number().int().positive(),
|
|
57
|
+
db: z.string().min(1),
|
|
58
|
+
user: z.string().min(1).optional()
|
|
59
|
+
});
|
|
60
|
+
/** Maintenance window — UTC day-of-week + HH:MM:SS. */
|
|
61
|
+
export const MaintenanceWindowSchema = z.object({
|
|
62
|
+
day: z.enum([
|
|
63
|
+
'monday',
|
|
64
|
+
'tuesday',
|
|
65
|
+
'wednesday',
|
|
66
|
+
'thursday',
|
|
67
|
+
'friday',
|
|
68
|
+
'saturday',
|
|
69
|
+
'sunday'
|
|
70
|
+
]),
|
|
71
|
+
hour: z
|
|
72
|
+
.string()
|
|
73
|
+
.regex(/^\d{2}:\d{2}(:\d{2})?$/, 'hour must be HH:MM or HH:MM:SS UTC')
|
|
74
|
+
});
|
|
75
|
+
/** Cluster-level metrics alert policy. */
|
|
76
|
+
export const MetricsAlertSchema = z.object({
|
|
77
|
+
type: z.enum([
|
|
78
|
+
'cpu',
|
|
79
|
+
'memory',
|
|
80
|
+
'disk',
|
|
81
|
+
'load_15',
|
|
82
|
+
'load_5',
|
|
83
|
+
'load_1',
|
|
84
|
+
'replication_lag',
|
|
85
|
+
'kafka_disk',
|
|
86
|
+
'open_connections'
|
|
87
|
+
]),
|
|
88
|
+
threshold: z.number(),
|
|
89
|
+
/** Comparator for threshold. */
|
|
90
|
+
compare: z.enum(['GreaterThan', 'LessThan']).default('GreaterThan'),
|
|
91
|
+
/** Sustained window before firing. */
|
|
92
|
+
window: z.enum(['5m', '10m', '30m', '1h']).default('10m'),
|
|
93
|
+
/** Notification channels — Slack webhook, email, or PagerDuty integration ids. */
|
|
94
|
+
notify: z
|
|
40
95
|
.object({
|
|
41
|
-
|
|
42
|
-
|
|
96
|
+
email: z.array(z.string().email()).optional(),
|
|
97
|
+
slackWebhook: z.string().url().optional(),
|
|
98
|
+
pagerdutyServiceId: z.string().min(1).optional()
|
|
43
99
|
})
|
|
44
|
-
.optional()
|
|
45
|
-
/** Postgres version tag (default: 16-alpine). */
|
|
46
|
-
version: z.string().min(1).default('16-alpine')
|
|
100
|
+
.optional()
|
|
47
101
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/** Postgres version (default: 16). */
|
|
54
|
-
version: z.string().min(1).default('16')
|
|
102
|
+
/** Postgres extension to enable on the cluster (e.g., pgvector, postgis). */
|
|
103
|
+
export const PostgresExtensionSchema = z.object({
|
|
104
|
+
name: z.string().min(1),
|
|
105
|
+
version: z.string().min(1).optional(),
|
|
106
|
+
schema: z.string().min(1).optional()
|
|
55
107
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
databaseName: z.string().min(1),
|
|
69
|
-
/** ID of the consuming app (for wrangler.jsonc generation). */
|
|
70
|
-
consumerAppId: z.string().min(1)
|
|
108
|
+
/** Behavior when the cluster's major Postgres version reaches EOL. */
|
|
109
|
+
export const MajorVersionUpgradePolicySchema = z.enum(['manual', 'auto']);
|
|
110
|
+
/**
|
|
111
|
+
* Adapter-specific configuration: the adapter id plus its own fields. Each
|
|
112
|
+
* adapter package defines and parses its own config schema (Cloudflare D1's is
|
|
113
|
+
* `CloudflareD1DatabaseConfigSchema` in `@vibesdotdev/integrations-cloudflare`;
|
|
114
|
+
* DigitalOcean's DOKS/managed-postgres configs live in
|
|
115
|
+
* `@vibesdotdev/integrations-digitalocean`; a Turso adapter owns its config
|
|
116
|
+
* in its own integrations package); this kind names no provider.
|
|
117
|
+
*/
|
|
118
|
+
export const DatabaseConfigSchema = z.looseObject({
|
|
119
|
+
adapter: z.string().min(1)
|
|
71
120
|
});
|
|
72
|
-
export const DatabaseConfigSchema = z.union([
|
|
73
|
-
DoksDatabaseConfigSchema.extend({ adapter: z.literal('doks-statefulset') }),
|
|
74
|
-
DOManagedPostgresConfigSchema.extend({ adapter: z.literal('do-managed-postgres') }),
|
|
75
|
-
TursoDatabaseConfigSchema.extend({ adapter: z.literal('turso') }),
|
|
76
|
-
CloudflareD1ConfigSchema
|
|
77
|
-
]);
|
|
78
121
|
export const DatabaseDescriptorSchema = DatabaseBaseSchema.extend({
|
|
79
|
-
/**
|
|
80
|
-
* Adapter-specific configuration. Discriminated union — each adapter
|
|
81
|
-
* package defines its own config schema under its discriminator key.
|
|
82
|
-
*/
|
|
122
|
+
/** Adapter-specific configuration, parsed by the adapter that owns it. */
|
|
83
123
|
config: DatabaseConfigSchema.optional()
|
|
84
124
|
});
|
|
85
125
|
class DefaultDatabaseImplementation {
|
|
86
126
|
descriptor;
|
|
87
127
|
context;
|
|
128
|
+
/** The descriptor as this kind's schema reads it. */
|
|
129
|
+
config;
|
|
88
130
|
constructor(descriptor, context) {
|
|
89
131
|
this.descriptor = descriptor;
|
|
90
132
|
this.context = context;
|
|
91
|
-
|
|
92
|
-
get config() {
|
|
93
|
-
return this.descriptor;
|
|
133
|
+
this.config = readKindDescriptor(DatabaseDescriptorSchema, descriptor);
|
|
94
134
|
}
|
|
95
135
|
}
|
|
96
136
|
export const databaseKind = createRuntimeKind({
|
|
97
137
|
id: 'infra/database',
|
|
98
138
|
descriptorSchema: DatabaseDescriptorSchema,
|
|
99
139
|
defaultImplementation: DefaultDatabaseImplementation,
|
|
100
|
-
|
|
101
|
-
extractStem
|
|
140
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
102
141
|
});
|
|
103
142
|
//# sourceMappingURL=database.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.kind.js","sourceRoot":"","sources":["../../src/kinds/database.kind.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"database.kind.js","sourceRoot":"","sources":["../../src/kinds/database.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAGH,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;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACjE,0EAA0E;IAC1E,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAIH,MAAM,6BAA6B;IAIjB;IACA;IAJjB,qDAAqD;IAC5C,MAAM,CAAqB;IACpC,YACiB,UAA6B,EAC7B,OAAoB;QADpB,eAAU,GAAV,UAAU,CAAmB;QAC7B,YAAO,GAAP,OAAO,CAAa;QAEpC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;CAED;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAoD;IAChG,EAAE,EAAE,gBAAgB;IACpB,gBAAgB,EAAE,wBAAwB;IAC1C,qBAAqB,EAAE,6BAA6B;IACpD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type DeploymentProviderImplementation } from '../schemas/deployment-provider.ts';
|
|
2
|
+
export { DeploymentProviderDescriptorSchema, type DeploymentProviderDescriptor } from '../schemas/deployment-provider.ts';
|
|
3
|
+
/** Schema-only: every provider registers its own implementation, constructed with the resolving runtime. */
|
|
4
|
+
export declare const deploymentProviderKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DeploymentProviderImplementation>;
|
|
5
|
+
//# sourceMappingURL=deployment-provider.kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-provider.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/deployment-provider.kind.ts"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,gCAAgC,EACrC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,kCAAkC,EAAE,KAAK,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAE1H,4GAA4G;AAC5G,eAAO,MAAM,sBAAsB,6FAIjC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel';
|
|
2
|
+
import { DeploymentProviderDescriptorSchema } from "../schemas/deployment-provider.js";
|
|
3
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
4
|
+
export { DeploymentProviderDescriptorSchema } from "../schemas/deployment-provider.js";
|
|
5
|
+
/** Schema-only: every provider registers its own implementation, constructed with the resolving runtime. */
|
|
6
|
+
export const deploymentProviderKind = createRuntimeKind({
|
|
7
|
+
id: 'infra/deployment-provider',
|
|
8
|
+
descriptorSchema: DeploymentProviderDescriptorSchema,
|
|
9
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=deployment-provider.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-provider.kind.js","sourceRoot":"","sources":["../../src/kinds/deployment-provider.kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EACN,kCAAkC,EAGlC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,kCAAkC,EAAqC,MAAM,mCAAmC,CAAC;AAE1H,4GAA4G;AAC5G,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAA4F;IAClJ,EAAE,EAAE,2BAA2B;IAC/B,gBAAgB,EAAE,kCAAkC;IACpD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC"}
|
|
@@ -4,17 +4,10 @@
|
|
|
4
4
|
* All infra kinds use the same discovery pattern for *.infra.ts files.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Package-relative discovery patterns for infra resource declaration files
|
|
8
|
+
* (rc02-rc03 §2.5): a package's own `*.infra.ts`, and `infra/*.infra.ts`. The
|
|
9
|
+
* kernel's one discovery pass matches them in every declared package of the
|
|
10
|
+
* bound workspace; nothing recurses and nothing binds by filename stem.
|
|
8
11
|
*/
|
|
9
|
-
export declare const
|
|
10
|
-
/**
|
|
11
|
-
* Extract the stem (base name without extension) from an infra file.
|
|
12
|
-
* Matches both .infra.ts and .infra.tsx extensions.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* extractStem('auth.infra.ts') // 'auth'
|
|
16
|
-
* extractStem('my-service.infra.tsx') // 'my-service'
|
|
17
|
-
* extractStem('not-infra.ts') // null
|
|
18
|
-
*/
|
|
19
|
-
export declare function extractStem(filename: string): string | null;
|
|
12
|
+
export declare const INFRA_DISCOVERY_PATTERNS: readonly ["*.infra.ts", "infra/*.infra.ts"];
|
|
20
13
|
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/kinds/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/kinds/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,6CAA8C,CAAC"}
|
package/dist/kinds/discovery.js
CHANGED
|
@@ -4,22 +4,10 @@
|
|
|
4
4
|
* All infra kinds use the same discovery pattern for *.infra.ts files.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Package-relative discovery patterns for infra resource declaration files
|
|
8
|
+
* (rc02-rc03 §2.5): a package's own `*.infra.ts`, and `infra/*.infra.ts`. The
|
|
9
|
+
* kernel's one discovery pass matches them in every declared package of the
|
|
10
|
+
* bound workspace; nothing recurses and nothing binds by filename stem.
|
|
8
11
|
*/
|
|
9
|
-
export const
|
|
10
|
-
/**
|
|
11
|
-
* Extract the stem (base name without extension) from an infra file.
|
|
12
|
-
* Matches both .infra.ts and .infra.tsx extensions.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* extractStem('auth.infra.ts') // 'auth'
|
|
16
|
-
* extractStem('my-service.infra.tsx') // 'my-service'
|
|
17
|
-
* extractStem('not-infra.ts') // null
|
|
18
|
-
*/
|
|
19
|
-
export function extractStem(filename) {
|
|
20
|
-
const match = filename.match(/^(.+)\.infra\.tsx?$/);
|
|
21
|
-
const stem = match ? match[1] : null;
|
|
22
|
-
// Return null for empty stem (e.g., '.infra.ts')
|
|
23
|
-
return stem && stem.length > 0 ? stem : null;
|
|
24
|
-
}
|
|
12
|
+
export const INFRA_DISCOVERY_PATTERNS = ['*.infra.ts', 'infra/*.infra.ts'];
|
|
25
13
|
//# sourceMappingURL=discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/kinds/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/kinds/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAU,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infra DNS Kind
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic schema for authoritative DNS records. Per-provider
|
|
5
|
+
* implementations (cloudflare-dns, do-domains, route53) map this shape
|
|
6
|
+
* onto the native API.
|
|
7
|
+
*
|
|
8
|
+
* `proxied` is modeled here rather than in the Cloudflare adapter because
|
|
9
|
+
* whether a hostname is served through a reverse proxy is a product
|
|
10
|
+
* decision with protocol consequences, not a vendor detail. Git over HTTP
|
|
11
|
+
* requires a direct origin; a proxied record silently breaks smart-HTTP
|
|
12
|
+
* pack negotiation. Providers without a proxy layer reject `proxied: true`
|
|
13
|
+
* as unsupported rather than accepting and ignoring it.
|
|
14
|
+
*/
|
|
15
|
+
import * as z from 'zod/v4';
|
|
16
|
+
import type { InfraAuthorityFingerprint } from './inventory.kind.ts';
|
|
17
|
+
declare const DnsRecordTypeSchema: z.ZodEnum<{
|
|
18
|
+
A: "A";
|
|
19
|
+
AAAA: "AAAA";
|
|
20
|
+
CNAME: "CNAME";
|
|
21
|
+
TXT: "TXT";
|
|
22
|
+
MX: "MX";
|
|
23
|
+
SRV: "SRV";
|
|
24
|
+
CAA: "CAA";
|
|
25
|
+
NS: "NS";
|
|
26
|
+
}>;
|
|
27
|
+
export type DnsRecordType = z.infer<typeof DnsRecordTypeSchema>;
|
|
28
|
+
declare const DnsRecordSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
type: z.ZodEnum<{
|
|
31
|
+
A: "A";
|
|
32
|
+
AAAA: "AAAA";
|
|
33
|
+
CNAME: "CNAME";
|
|
34
|
+
TXT: "TXT";
|
|
35
|
+
MX: "MX";
|
|
36
|
+
SRV: "SRV";
|
|
37
|
+
CAA: "CAA";
|
|
38
|
+
NS: "NS";
|
|
39
|
+
}>;
|
|
40
|
+
content: z.ZodString;
|
|
41
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
42
|
+
proxied: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type DnsRecord = z.infer<typeof DnsRecordSchema>;
|
|
47
|
+
export type DnsRecordInput = z.input<typeof DnsRecordSchema>;
|
|
48
|
+
declare const DnsBaseSchema: z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
name: z.ZodOptional<z.ZodString>;
|
|
51
|
+
description: z.ZodOptional<z.ZodString>;
|
|
52
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
60
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
61
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
65
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
66
|
+
reason: z.ZodString;
|
|
67
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>]>>;
|
|
69
|
+
kind: z.ZodLiteral<"infra/dns">;
|
|
70
|
+
adapter: z.ZodString;
|
|
71
|
+
adapterConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
72
|
+
zone: z.ZodOptional<z.ZodString>;
|
|
73
|
+
environment: z.ZodDefault<z.ZodString>;
|
|
74
|
+
records: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
type: z.ZodEnum<{
|
|
77
|
+
A: "A";
|
|
78
|
+
AAAA: "AAAA";
|
|
79
|
+
CNAME: "CNAME";
|
|
80
|
+
TXT: "TXT";
|
|
81
|
+
MX: "MX";
|
|
82
|
+
SRV: "SRV";
|
|
83
|
+
CAA: "CAA";
|
|
84
|
+
NS: "NS";
|
|
85
|
+
}>;
|
|
86
|
+
content: z.ZodString;
|
|
87
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
proxied: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type InfraDnsDescriptor = z.infer<typeof DnsBaseSchema>;
|
|
94
|
+
export type InfraDnsDescriptorInput = z.input<typeof DnsBaseSchema>;
|
|
95
|
+
/** A record as it exists on the provider, carrying the provider-assigned id. */
|
|
96
|
+
export type LiveDnsRecord = DnsRecord & {
|
|
97
|
+
providerId: string;
|
|
98
|
+
zone: string;
|
|
99
|
+
};
|
|
100
|
+
export interface DnsZoneStatus {
|
|
101
|
+
zone: string;
|
|
102
|
+
status: string;
|
|
103
|
+
nameservers: string[];
|
|
104
|
+
activatedOn?: string;
|
|
105
|
+
modifiedOn?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface DnsZoneActivationResult {
|
|
108
|
+
requested: boolean;
|
|
109
|
+
status: DnsZoneStatus;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Implementation contract every provider implements. `upsertRecord` is
|
|
113
|
+
* idempotent on (name, type): it updates the existing record in place
|
|
114
|
+
* rather than creating a duplicate RRset entry. Opt-in matchContent selects by
|
|
115
|
+
* exact content as well, creating a sibling when that value is absent. Callers
|
|
116
|
+
* must check supportsContentMatch before using this mode.
|
|
117
|
+
*/
|
|
118
|
+
export interface DnsImplementation {
|
|
119
|
+
/** Whether diff/upsert support preserving siblings by matching exact content. */
|
|
120
|
+
supportsContentMatch?: boolean;
|
|
121
|
+
/** Redacted authority used by the latest provider request. */
|
|
122
|
+
getAuthority?(): Promise<InfraAuthorityFingerprint>;
|
|
123
|
+
/** List records, optionally narrowed by exact name and/or type. */
|
|
124
|
+
listRecords(filter?: {
|
|
125
|
+
name?: string;
|
|
126
|
+
type?: DnsRecordType;
|
|
127
|
+
}): Promise<LiveDnsRecord[]>;
|
|
128
|
+
/** Create or update a record by (name, type). Returns the provider id. */
|
|
129
|
+
upsertRecord(record: DnsRecordInput, options?: {
|
|
130
|
+
matchContent?: boolean;
|
|
131
|
+
}): Promise<{
|
|
132
|
+
providerId: string;
|
|
133
|
+
created: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
/** Delete by provider id. Absence is not an error. */
|
|
136
|
+
deleteRecord(providerId: string): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Diff desired against live for the names in `desired`. Records outside
|
|
139
|
+
* that set are never reported for deletion — this kind is additive by
|
|
140
|
+
* default so it can coexist with records owned elsewhere.
|
|
141
|
+
*/
|
|
142
|
+
diff(desired: DnsRecordInput[], options?: {
|
|
143
|
+
matchContent?: boolean;
|
|
144
|
+
}): Promise<{
|
|
145
|
+
create: DnsRecord[];
|
|
146
|
+
update: Array<{
|
|
147
|
+
providerId: string;
|
|
148
|
+
from: LiveDnsRecord;
|
|
149
|
+
to: DnsRecord;
|
|
150
|
+
}>;
|
|
151
|
+
unchanged: LiveDnsRecord[];
|
|
152
|
+
}>;
|
|
153
|
+
/** Read the authoritative zone's provider activation state. */
|
|
154
|
+
getZoneStatus?(): Promise<DnsZoneStatus>;
|
|
155
|
+
/** Request an immediate provider activation check for a pending zone. */
|
|
156
|
+
requestZoneActivation?(): Promise<DnsZoneActivationResult>;
|
|
157
|
+
}
|
|
158
|
+
export declare const dnsKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DnsImplementation>;
|
|
159
|
+
export type InfraDnsKind = InfraDnsDescriptor;
|
|
160
|
+
export type InfraDnsKindInput = InfraDnsDescriptorInput;
|
|
161
|
+
export { DnsBaseSchema as InfraDnsDescriptorSchema, DnsRecordSchema, D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CAAC,CAAC;CAC3D;AAED,eAAO,MAAM,OAAO,8EAIlB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAExD,OAAO,EAAE,aAAa,IAAI,wBAAwB,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infra DNS Kind
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic schema for authoritative DNS records. Per-provider
|
|
5
|
+
* implementations (cloudflare-dns, do-domains, route53) map this shape
|
|
6
|
+
* onto the native API.
|
|
7
|
+
*
|
|
8
|
+
* `proxied` is modeled here rather than in the Cloudflare adapter because
|
|
9
|
+
* whether a hostname is served through a reverse proxy is a product
|
|
10
|
+
* decision with protocol consequences, not a vendor detail. Git over HTTP
|
|
11
|
+
* requires a direct origin; a proxied record silently breaks smart-HTTP
|
|
12
|
+
* pack negotiation. Providers without a proxy layer reject `proxied: true`
|
|
13
|
+
* as unsupported rather than accepting and ignoring it.
|
|
14
|
+
*/
|
|
15
|
+
import * as z from 'zod/v4';
|
|
16
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
17
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
18
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
19
|
+
const DnsRecordTypeSchema = z.enum(['A', 'AAAA', 'CNAME', 'TXT', 'MX', 'SRV', 'CAA', 'NS']);
|
|
20
|
+
const DnsRecordSchema = z.object({
|
|
21
|
+
/** Fully-qualified record name (e.g. `git.vibes.dev`). */
|
|
22
|
+
name: z.string().min(1),
|
|
23
|
+
type: DnsRecordTypeSchema,
|
|
24
|
+
/** Record value: IP for A/AAAA, target for CNAME, payload for TXT. */
|
|
25
|
+
content: z.string().min(1),
|
|
26
|
+
/** TTL in seconds. `1` means "provider automatic" where supported. */
|
|
27
|
+
ttl: z.number().int().positive().default(1),
|
|
28
|
+
/**
|
|
29
|
+
* Serve through the provider's reverse proxy when true. Must be false
|
|
30
|
+
* for protocols the proxy cannot carry (git smart-HTTP, raw SSH).
|
|
31
|
+
*/
|
|
32
|
+
proxied: z.boolean().default(false),
|
|
33
|
+
/** Priority for MX/SRV. */
|
|
34
|
+
priority: z.number().int().nonnegative().optional(),
|
|
35
|
+
comment: z.string().optional()
|
|
36
|
+
});
|
|
37
|
+
const DnsBaseSchema = RuntimeDescriptorSchema.extend({
|
|
38
|
+
kind: z.literal('infra/dns'),
|
|
39
|
+
/** Adapter id (e.g. 'cloudflare-dns', 'do-domains'). */
|
|
40
|
+
adapter: z.string().min(1),
|
|
41
|
+
adapterConfig: z.record(z.string(), z.unknown()).optional(),
|
|
42
|
+
/** Apex zone this descriptor is authoritative for (e.g. `vibes.dev`). */
|
|
43
|
+
zone: z.string().min(1).optional(),
|
|
44
|
+
/** Environment name for credential resolution via `vibes secrets`. */
|
|
45
|
+
environment: z.string().default('local'),
|
|
46
|
+
records: z.array(DnsRecordSchema).default([])
|
|
47
|
+
});
|
|
48
|
+
export const dnsKind = createRuntimeKind({
|
|
49
|
+
id: 'infra/dns',
|
|
50
|
+
descriptorSchema: DnsBaseSchema,
|
|
51
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
52
|
+
});
|
|
53
|
+
export { DnsBaseSchema as InfraDnsDescriptorSchema, DnsRecordSchema, DnsRecordTypeSchema };
|
|
54
|
+
//# sourceMappingURL=dns.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dns.kind.js","sourceRoot":"","sources":["../../src/kinds/dns.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,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