@vibesdotdev/infra-core 0.0.2 → 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 +27 -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-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 +21 -32
- 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 +25 -29
- package/dist/kinds/package-registry.kind.d.ts.map +1 -1
- package/dist/kinds/package-registry.kind.js +12 -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 -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 +87 -36
- 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
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
* wraps the same primitive for one-off ops and drift detection.
|
|
17
17
|
*/
|
|
18
18
|
import * as z from 'zod/v4';
|
|
19
|
+
import type { InfraAuthorityFingerprint } from './inventory.kind.ts';
|
|
19
20
|
/**
|
|
20
|
-
* Delivery channel for an alert.
|
|
21
|
-
*
|
|
21
|
+
* Delivery channel for an alert. `email` and `webhook` are typed entries;
|
|
22
|
+
* every other channel goes through the open entry, which refuses the
|
|
23
|
+
* built-in kinds so a malformed email or webhook target can never slip
|
|
24
|
+
* through it. Provider impls translate these to native delivery slots.
|
|
22
25
|
*/
|
|
23
|
-
declare const AlertMechanismSchema: z.
|
|
26
|
+
declare const AlertMechanismSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
24
27
|
kind: z.ZodLiteral<"email">;
|
|
25
28
|
target: z.ZodEmail;
|
|
26
29
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -28,12 +31,9 @@ declare const AlertMechanismSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
28
31
|
target: z.ZodString;
|
|
29
32
|
secretRef: z.ZodOptional<z.ZodString>;
|
|
30
33
|
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
kind: z.
|
|
34
|
+
kind: z.ZodString;
|
|
32
35
|
target: z.ZodString;
|
|
33
|
-
}, z.core.$
|
|
34
|
-
kind: z.ZodLiteral<"slack">;
|
|
35
|
-
target: z.ZodString;
|
|
36
|
-
}, z.core.$strip>], "kind">;
|
|
36
|
+
}, z.core.$loose>]>;
|
|
37
37
|
export type AlertMechanism = z.infer<typeof AlertMechanismSchema>;
|
|
38
38
|
/**
|
|
39
39
|
* Cross-provider alert categories. Each maps to one or more native
|
|
@@ -45,12 +45,14 @@ declare const AlertTypeSchema: z.ZodEnum<{
|
|
|
45
45
|
usage: "usage";
|
|
46
46
|
"error-rate": "error-rate";
|
|
47
47
|
latency: "latency";
|
|
48
|
+
"scheduled-event-missing": "scheduled-event-missing";
|
|
49
|
+
"log-marker": "log-marker";
|
|
48
50
|
}>;
|
|
49
51
|
export type AlertType = z.infer<typeof AlertTypeSchema>;
|
|
50
52
|
declare const AlertWindowSchema: z.ZodEnum<{
|
|
51
53
|
"5m": "5m";
|
|
52
|
-
"15m": "15m";
|
|
53
54
|
"1h": "1h";
|
|
55
|
+
"15m": "15m";
|
|
54
56
|
"6h": "6h";
|
|
55
57
|
"24h": "24h";
|
|
56
58
|
"7d": "7d";
|
|
@@ -65,20 +67,22 @@ declare const AlertPolicySchema: z.ZodObject<{
|
|
|
65
67
|
usage: "usage";
|
|
66
68
|
"error-rate": "error-rate";
|
|
67
69
|
latency: "latency";
|
|
70
|
+
"scheduled-event-missing": "scheduled-event-missing";
|
|
71
|
+
"log-marker": "log-marker";
|
|
68
72
|
}>;
|
|
69
73
|
threshold: z.ZodNumber;
|
|
70
74
|
warningThreshold: z.ZodOptional<z.ZodNumber>;
|
|
71
75
|
window: z.ZodOptional<z.ZodEnum<{
|
|
72
76
|
"5m": "5m";
|
|
73
|
-
"15m": "15m";
|
|
74
77
|
"1h": "1h";
|
|
78
|
+
"15m": "15m";
|
|
75
79
|
"6h": "6h";
|
|
76
80
|
"24h": "24h";
|
|
77
81
|
"7d": "7d";
|
|
78
82
|
"30d": "30d";
|
|
79
83
|
}>>;
|
|
80
84
|
filters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
81
|
-
mechanisms: z.ZodArray<z.
|
|
85
|
+
mechanisms: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
82
86
|
kind: z.ZodLiteral<"email">;
|
|
83
87
|
target: z.ZodEmail;
|
|
84
88
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -86,16 +90,27 @@ declare const AlertPolicySchema: z.ZodObject<{
|
|
|
86
90
|
target: z.ZodString;
|
|
87
91
|
secretRef: z.ZodOptional<z.ZodString>;
|
|
88
92
|
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
-
kind: z.
|
|
93
|
+
kind: z.ZodString;
|
|
90
94
|
target: z.ZodString;
|
|
91
|
-
}, z.core.$
|
|
92
|
-
kind: z.ZodLiteral<"slack">;
|
|
93
|
-
target: z.ZodString;
|
|
94
|
-
}, z.core.$strip>], "kind">>;
|
|
95
|
+
}, z.core.$loose>]>>;
|
|
95
96
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
96
97
|
description: z.ZodOptional<z.ZodString>;
|
|
97
98
|
}, z.core.$strip>;
|
|
98
99
|
export type AlertPolicy = z.infer<typeof AlertPolicySchema>;
|
|
100
|
+
export declare const AlertAuditDiagnosticsSchema: z.ZodObject<{
|
|
101
|
+
category: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
102
|
+
markerDelivery: z.ZodOptional<z.ZodString>;
|
|
103
|
+
unrepresentedCategories: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
104
|
+
custom: "custom";
|
|
105
|
+
budget: "budget";
|
|
106
|
+
usage: "usage";
|
|
107
|
+
"error-rate": "error-rate";
|
|
108
|
+
latency: "latency";
|
|
109
|
+
"scheduled-event-missing": "scheduled-event-missing";
|
|
110
|
+
"log-marker": "log-marker";
|
|
111
|
+
}>>>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type AlertAuditDiagnostics = z.infer<typeof AlertAuditDiagnosticsSchema>;
|
|
99
114
|
declare const AlertsBaseSchema: z.ZodObject<{
|
|
100
115
|
id: z.ZodString;
|
|
101
116
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -104,12 +119,35 @@ declare const AlertsBaseSchema: z.ZodObject<{
|
|
|
104
119
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
120
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
106
121
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
107
123
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
108
124
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
109
|
-
config: z.ZodOptional<z.
|
|
125
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
126
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
127
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
131
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
132
|
+
reason: z.ZodString;
|
|
133
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>]>>;
|
|
110
135
|
kind: z.ZodLiteral<"infra/alerts">;
|
|
111
136
|
adapter: z.ZodString;
|
|
112
137
|
adapterConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
|
+
auditDiagnostics: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
category: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
140
|
+
markerDelivery: z.ZodOptional<z.ZodString>;
|
|
141
|
+
unrepresentedCategories: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
142
|
+
custom: "custom";
|
|
143
|
+
budget: "budget";
|
|
144
|
+
usage: "usage";
|
|
145
|
+
"error-rate": "error-rate";
|
|
146
|
+
latency: "latency";
|
|
147
|
+
"scheduled-event-missing": "scheduled-event-missing";
|
|
148
|
+
"log-marker": "log-marker";
|
|
149
|
+
}>>>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
113
151
|
environment: z.ZodDefault<z.ZodString>;
|
|
114
152
|
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
153
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -120,20 +158,22 @@ declare const AlertsBaseSchema: z.ZodObject<{
|
|
|
120
158
|
usage: "usage";
|
|
121
159
|
"error-rate": "error-rate";
|
|
122
160
|
latency: "latency";
|
|
161
|
+
"scheduled-event-missing": "scheduled-event-missing";
|
|
162
|
+
"log-marker": "log-marker";
|
|
123
163
|
}>;
|
|
124
164
|
threshold: z.ZodNumber;
|
|
125
165
|
warningThreshold: z.ZodOptional<z.ZodNumber>;
|
|
126
166
|
window: z.ZodOptional<z.ZodEnum<{
|
|
127
167
|
"5m": "5m";
|
|
128
|
-
"15m": "15m";
|
|
129
168
|
"1h": "1h";
|
|
169
|
+
"15m": "15m";
|
|
130
170
|
"6h": "6h";
|
|
131
171
|
"24h": "24h";
|
|
132
172
|
"7d": "7d";
|
|
133
173
|
"30d": "30d";
|
|
134
174
|
}>>;
|
|
135
175
|
filters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
136
|
-
mechanisms: z.ZodArray<z.
|
|
176
|
+
mechanisms: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
137
177
|
kind: z.ZodLiteral<"email">;
|
|
138
178
|
target: z.ZodEmail;
|
|
139
179
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -141,12 +181,9 @@ declare const AlertsBaseSchema: z.ZodObject<{
|
|
|
141
181
|
target: z.ZodString;
|
|
142
182
|
secretRef: z.ZodOptional<z.ZodString>;
|
|
143
183
|
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
-
kind: z.
|
|
145
|
-
target: z.ZodString;
|
|
146
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
-
kind: z.ZodLiteral<"slack">;
|
|
184
|
+
kind: z.ZodString;
|
|
148
185
|
target: z.ZodString;
|
|
149
|
-
}, z.core.$
|
|
186
|
+
}, z.core.$loose>]>>;
|
|
150
187
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
151
188
|
description: z.ZodOptional<z.ZodString>;
|
|
152
189
|
}, z.core.$strip>>>;
|
|
@@ -159,6 +196,8 @@ export type InfraAlertsDescriptorInput = z.input<typeof AlertsBaseSchema>;
|
|
|
159
196
|
* desired set without trampling unrelated policies on the provider.
|
|
160
197
|
*/
|
|
161
198
|
export interface AlertsImplementation {
|
|
199
|
+
/** Redacted authority used by the latest provider request, when applicable. */
|
|
200
|
+
getAuthority?(): Promise<InfraAuthorityFingerprint>;
|
|
162
201
|
/** List policies currently configured on the provider. */
|
|
163
202
|
listPolicies(): Promise<Array<AlertPolicy & {
|
|
164
203
|
providerId: string;
|
|
@@ -185,7 +224,7 @@ export interface AlertsImplementation {
|
|
|
185
224
|
}>;
|
|
186
225
|
}>;
|
|
187
226
|
}
|
|
188
|
-
export declare const alertsKind: import("@vibesdotdev/
|
|
227
|
+
export declare const alertsKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<AlertsImplementation>;
|
|
189
228
|
export type InfraAlertsKind = InfraAlertsDescriptor;
|
|
190
229
|
export type InfraAlertsKindInput = InfraAlertsDescriptorInput;
|
|
191
230
|
export { AlertsBaseSchema as InfraAlertsDescriptorSchema, AlertPolicySchema, AlertMechanismSchema, AlertTypeSchema, AlertWindowSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/alerts.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"alerts.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/alerts.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;;;GAKG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;mBAuBxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,QAAA,MAAM,eAAe;;;;;;;;EA8BnB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,QAAA,MAAM,iBAAiB;;;;;;;;EAAwD,CAAC;AAEhF,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BrB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAKtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAepB,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACrE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,+EAA+E;IAC/E,YAAY,CAAC,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACpD,0DAA0D;IAC1D,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACrE,gEAAgE;IAChE,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,sCAAsC;IACtC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QACrC,MAAM,EAAE,WAAW,EAAE,CAAC;QACtB,MAAM,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,WAAW,CAAA;SAAE,CAAC,CAAC;QAC3D,MAAM,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACpD,CAAC,CAAC;CACH;AAED,eAAO,MAAM,UAAU,iFAIrB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AACpD,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE9D,OAAO,EACN,gBAAgB,IAAI,2BAA2B,EAC/C,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,CAAC"}
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
* wraps the same primitive for one-off ops and drift detection.
|
|
17
17
|
*/
|
|
18
18
|
import * as z from 'zod/v4';
|
|
19
|
-
import { createRuntimeKind } from '@vibesdotdev/
|
|
20
|
-
import { RuntimeDescriptorSchema } from '@vibesdotdev/
|
|
21
|
-
import {
|
|
19
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
20
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
21
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
22
22
|
/**
|
|
23
|
-
* Delivery channel for an alert.
|
|
24
|
-
*
|
|
23
|
+
* Delivery channel for an alert. `email` and `webhook` are typed entries;
|
|
24
|
+
* every other channel goes through the open entry, which refuses the
|
|
25
|
+
* built-in kinds so a malformed email or webhook target can never slip
|
|
26
|
+
* through it. Provider impls translate these to native delivery slots.
|
|
25
27
|
*/
|
|
26
|
-
const AlertMechanismSchema = z.
|
|
28
|
+
const AlertMechanismSchema = z.union([
|
|
27
29
|
z.object({
|
|
28
30
|
kind: z.literal('email'),
|
|
29
31
|
/** Email address — must be a verified destination on the provider. */
|
|
@@ -36,15 +38,15 @@ const AlertMechanismSchema = z.discriminatedUnion('kind', [
|
|
|
36
38
|
/** Optional secret name (in the active secrets store) used for HMAC signing. */
|
|
37
39
|
secretRef: z.string().optional()
|
|
38
40
|
}),
|
|
39
|
-
z
|
|
40
|
-
|
|
41
|
-
/**
|
|
41
|
+
z
|
|
42
|
+
.looseObject({
|
|
43
|
+
/** Channel id owned by an adapter (resolved through its own config). */
|
|
44
|
+
kind: z.string().min(1),
|
|
45
|
+
/** Channel target (integration key, webhook URL, …). */
|
|
42
46
|
target: z.string().min(1)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/** Slack webhook URL (Incoming Webhooks). */
|
|
47
|
-
target: z.string().url()
|
|
47
|
+
})
|
|
48
|
+
.refine((mechanism) => mechanism.kind !== 'email' && mechanism.kind !== 'webhook', {
|
|
49
|
+
error: 'use the typed email/webhook entry for the built-in kinds'
|
|
48
50
|
})
|
|
49
51
|
]);
|
|
50
52
|
/**
|
|
@@ -60,6 +62,25 @@ const AlertTypeSchema = z.enum([
|
|
|
60
62
|
'error-rate',
|
|
61
63
|
/** P99 latency or wall-time crossed a threshold. */
|
|
62
64
|
'latency',
|
|
65
|
+
/**
|
|
66
|
+
* A scheduled (cron) handler has not reported a successful tick within
|
|
67
|
+
* its expected window — a probable dead cron. Most providers (incl. CF
|
|
68
|
+
* Notifications) have no native "cron didn't fire" alert; this category
|
|
69
|
+
* is consumed by `vibes infra audit`'s heartbeat freshness check (see
|
|
70
|
+
* `heartbeat/cron-heartbeat.ts`) and provider impls without a native
|
|
71
|
+
* mapping reject it as unsupported.
|
|
72
|
+
*/
|
|
73
|
+
'scheduled-event-missing',
|
|
74
|
+
/**
|
|
75
|
+
* An alert keyed to a structured log marker (e.g. `[VIBES-ERR jobs dlq]`
|
|
76
|
+
* emitted by the shared dead-letter drainer) matched by a Workers-
|
|
77
|
+
* Observability log alert. Like `scheduled-event-missing`, no provider has a
|
|
78
|
+
* native "match this log line" Notifications type — it is declared here so
|
|
79
|
+
* every first-class error marker a worker emits has an ops watcher of record,
|
|
80
|
+
* and `vibes infra audit` can surface it. The marker string + scope live in
|
|
81
|
+
* `filters` (`marker`, `worker`). Provider impls reject it as unsupported.
|
|
82
|
+
*/
|
|
83
|
+
'log-marker',
|
|
63
84
|
/** Catch-all for provider-specific types not yet modeled here. */
|
|
64
85
|
'custom'
|
|
65
86
|
]);
|
|
@@ -91,11 +112,18 @@ const AlertPolicySchema = z.object({
|
|
|
91
112
|
enabled: z.boolean().default(true),
|
|
92
113
|
description: z.string().optional()
|
|
93
114
|
});
|
|
115
|
+
export const AlertAuditDiagnosticsSchema = z.object({
|
|
116
|
+
category: z.record(z.string(), z.string()).default({}),
|
|
117
|
+
markerDelivery: z.string().optional(),
|
|
118
|
+
/** Alert categories this adapter cannot represent in its live policy listing. */
|
|
119
|
+
unrepresentedCategories: z.array(AlertTypeSchema).default([])
|
|
120
|
+
});
|
|
94
121
|
const AlertsBaseSchema = RuntimeDescriptorSchema.extend({
|
|
95
122
|
kind: z.literal('infra/alerts'),
|
|
96
123
|
/** Adapter id (e.g. 'cloudflare-alerts', 'do-monitoring'). */
|
|
97
124
|
adapter: z.string().min(1),
|
|
98
125
|
adapterConfig: z.record(z.string(), z.unknown()).optional(),
|
|
126
|
+
auditDiagnostics: AlertAuditDiagnosticsSchema.optional(),
|
|
99
127
|
/**
|
|
100
128
|
* Default environment name for credential resolution via `vibes
|
|
101
129
|
* secrets`. Defaults to 'local' since the CLI / dev workflow is
|
|
@@ -109,8 +137,7 @@ const AlertsBaseSchema = RuntimeDescriptorSchema.extend({
|
|
|
109
137
|
export const alertsKind = createRuntimeKind({
|
|
110
138
|
id: 'infra/alerts',
|
|
111
139
|
descriptorSchema: AlertsBaseSchema,
|
|
112
|
-
|
|
113
|
-
extractStem
|
|
140
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
114
141
|
});
|
|
115
142
|
export { AlertsBaseSchema as InfraAlertsDescriptorSchema, AlertPolicySchema, AlertMechanismSchema, AlertTypeSchema, AlertWindowSchema };
|
|
116
143
|
//# sourceMappingURL=alerts.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.kind.js","sourceRoot":"","sources":["../../src/kinds/alerts.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"alerts.kind.js","sourceRoot":"","sources":["../../src/kinds/alerts.kind.ts"],"names":[],"mappings":"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"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* 4. Implementation returns artifact content (format determined by impl)
|
|
15
15
|
*/
|
|
16
16
|
import * as z from 'zod/v4';
|
|
17
|
+
import { type RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
17
18
|
/**
|
|
18
19
|
* Minimal base schema for artifact descriptors.
|
|
19
20
|
*
|
|
@@ -28,10 +29,43 @@ declare const ArtifactBaseSchema: z.ZodObject<{
|
|
|
28
29
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
30
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
30
31
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
31
33
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
34
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
-
config: z.ZodOptional<z.
|
|
35
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
36
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
37
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
41
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
42
|
+
reason: z.ZodString;
|
|
43
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>]>>;
|
|
34
45
|
kind: z.ZodLiteral<"infra/artifact">;
|
|
46
|
+
format: z.ZodOptional<z.ZodString>;
|
|
47
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
kind: z.ZodString;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/** What a generator is handed: where outputs go, the resources it may read, and its own descriptor. */
|
|
52
|
+
export interface ArtifactGenerationContext {
|
|
53
|
+
/** Output directory for generated artifacts. */
|
|
54
|
+
outputDir: string;
|
|
55
|
+
/** Resource descriptors the generator may read. */
|
|
56
|
+
resources: RuntimeDescriptor[];
|
|
57
|
+
/** The generator's own descriptor. */
|
|
58
|
+
descriptor: RuntimeDescriptor;
|
|
59
|
+
}
|
|
60
|
+
/** Facts a generator reports about one output: JSON values only. */
|
|
61
|
+
export declare const ArtifactMetadataSchema: z.ZodRecord<z.ZodString, z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
62
|
+
export type ArtifactMetadata = z.infer<typeof ArtifactMetadataSchema>;
|
|
63
|
+
/** One generated output as the generate surface reads it: text or bytes, a name and a path. */
|
|
64
|
+
export declare const ArtifactOutputSchema: z.ZodObject<{
|
|
65
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
|
|
66
|
+
filename: z.ZodString;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
|
|
35
69
|
}, z.core.$strip>;
|
|
36
70
|
/**
|
|
37
71
|
* Generic artifact generator interface.
|
|
@@ -42,10 +76,10 @@ export interface ArtifactGenerator {
|
|
|
42
76
|
/**
|
|
43
77
|
* Generate artifact content.
|
|
44
78
|
*
|
|
45
|
-
* @param
|
|
79
|
+
* @param context - Where outputs go, the readable resources and the generator's descriptor.
|
|
46
80
|
* @returns Generated artifact (content + metadata)
|
|
47
81
|
*/
|
|
48
|
-
generate(
|
|
82
|
+
generate(context?: ArtifactGenerationContext): Promise<ArtifactOutput>;
|
|
49
83
|
}
|
|
50
84
|
/**
|
|
51
85
|
* Generated artifact output (generic shape).
|
|
@@ -53,14 +87,14 @@ export interface ArtifactGenerator {
|
|
|
53
87
|
* Implementations may return more specific types.
|
|
54
88
|
*/
|
|
55
89
|
export interface ArtifactOutput {
|
|
56
|
-
/** Generated content (string for text formats,
|
|
57
|
-
content: string |
|
|
90
|
+
/** Generated content (string for text formats, bytes for binary) */
|
|
91
|
+
content: string | Uint8Array;
|
|
58
92
|
/** Recommended filename (including extension) */
|
|
59
93
|
filename: string;
|
|
60
94
|
/** Full output path */
|
|
61
95
|
path: string;
|
|
62
96
|
/** Optional metadata */
|
|
63
|
-
metadata?:
|
|
97
|
+
metadata?: ArtifactMetadata;
|
|
64
98
|
}
|
|
65
99
|
/**
|
|
66
100
|
* Artifact descriptor type (base shape, implementations extend)
|
|
@@ -77,10 +111,24 @@ export declare const ArtifactDescriptorSchema: z.ZodObject<{
|
|
|
77
111
|
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
112
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
79
113
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
80
115
|
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
116
|
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
config: z.ZodOptional<z.
|
|
117
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
118
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
119
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
123
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
124
|
+
reason: z.ZodString;
|
|
125
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>]>>;
|
|
83
127
|
kind: z.ZodLiteral<"infra/artifact">;
|
|
128
|
+
format: z.ZodOptional<z.ZodString>;
|
|
129
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
kind: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
84
132
|
}, z.core.$strip>;
|
|
85
133
|
/**
|
|
86
134
|
* Artifact kind descriptor for runtime registration.
|
|
@@ -89,8 +137,8 @@ export declare const ArtifactDescriptorSchema: z.ZodObject<{
|
|
|
89
137
|
* their own implementations via runtime plugins.
|
|
90
138
|
*/
|
|
91
139
|
declare class NoOpArtifactImplementation implements ArtifactGenerator {
|
|
92
|
-
generate(
|
|
140
|
+
generate(): Promise<ArtifactOutput>;
|
|
93
141
|
}
|
|
94
|
-
export declare const artifactKind: import("@vibesdotdev/
|
|
95
|
-
export {
|
|
142
|
+
export declare const artifactKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<NoOpArtifactImplementation>;
|
|
143
|
+
export { INFRA_DISCOVERY_PATTERNS } from './discovery.ts';
|
|
96
144
|
//# sourceMappingURL=artifact.kind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/artifact.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"artifact.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/artifact.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAGzG;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMtB,CAAC;AAEH,uGAAuG;AACvG,MAAM,WAAW,yBAAyB;IACzC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;CAC9B;AAED,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,2QAAwC,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACvE;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,oEAAoE;IACpE,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqB,CAAC;AAE3D;;;;;GAKG;AACH,cAAM,0BAA2B,YAAW,iBAAiB;IACtD,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;CAMzC;AAED,eAAO,MAAM,YAAY,uFAKvB,CAAC;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* 4. Implementation returns artifact content (format determined by impl)
|
|
15
15
|
*/
|
|
16
16
|
import * as z from 'zod/v4';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
18
|
+
import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
19
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
20
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
21
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
20
22
|
/**
|
|
21
23
|
* Minimal base schema for artifact descriptors.
|
|
22
24
|
*
|
|
@@ -24,7 +26,20 @@ import { INFRA_DISCOVERY_PATTERN, extractStem } from "./discovery.js";
|
|
|
24
26
|
* output format, generation options, etc.).
|
|
25
27
|
*/
|
|
26
28
|
const ArtifactBaseSchema = RuntimeDescriptorSchema.extend({
|
|
27
|
-
kind: z.literal('infra/artifact')
|
|
29
|
+
kind: z.literal('infra/artifact'),
|
|
30
|
+
/** The output format the generator produces (e.g. `yaml`, `jsonc`); `vibes infra generate --format` filters on it. */
|
|
31
|
+
format: z.string().min(1).optional(),
|
|
32
|
+
/** The resource kind the generator reads (e.g. `infra/worker`). */
|
|
33
|
+
source: z.object({ kind: z.string().min(1) }).optional()
|
|
34
|
+
});
|
|
35
|
+
/** Facts a generator reports about one output: JSON values only. */
|
|
36
|
+
export const ArtifactMetadataSchema = z.record(z.string(), JsonValueSchema);
|
|
37
|
+
/** One generated output as the generate surface reads it: text or bytes, a name and a path. */
|
|
38
|
+
export const ArtifactOutputSchema = z.object({
|
|
39
|
+
content: z.union([z.string(), z.instanceof(Uint8Array)]),
|
|
40
|
+
filename: z.string().min(1),
|
|
41
|
+
path: z.string().min(1),
|
|
42
|
+
metadata: ArtifactMetadataSchema.optional()
|
|
28
43
|
});
|
|
29
44
|
/**
|
|
30
45
|
* Artifact descriptor schema
|
|
@@ -37,17 +52,19 @@ export const ArtifactDescriptorSchema = ArtifactBaseSchema;
|
|
|
37
52
|
* their own implementations via runtime plugins.
|
|
38
53
|
*/
|
|
39
54
|
class NoOpArtifactImplementation {
|
|
40
|
-
async generate(
|
|
41
|
-
throw new
|
|
55
|
+
async generate() {
|
|
56
|
+
throw new CapabilityError('No artifact generator is registered for this descriptor.', 'UNAVAILABLE', {
|
|
57
|
+
reason: 'artifact-generator-unregistered',
|
|
58
|
+
recoveryHint: 'Adapter plugins (infra-kubernetes, infra-helm, etc.) must register implementations.'
|
|
59
|
+
});
|
|
42
60
|
}
|
|
43
61
|
}
|
|
44
62
|
export const artifactKind = createRuntimeKind({
|
|
45
63
|
id: 'infra/artifact',
|
|
46
64
|
descriptorSchema: ArtifactDescriptorSchema,
|
|
47
65
|
defaultImplementation: NoOpArtifactImplementation,
|
|
48
|
-
|
|
49
|
-
extractStem
|
|
66
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
50
67
|
});
|
|
51
68
|
// Re-export discovery helpers
|
|
52
|
-
export {
|
|
69
|
+
export { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
53
70
|
//# sourceMappingURL=artifact.kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.kind.js","sourceRoot":"","sources":["../../src/kinds/artifact.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"artifact.kind.js","sourceRoot":"","sources":["../../src/kinds/artifact.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAA0B,MAAM,wCAAwC,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACjC,sHAAsH;IACtH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC,mEAAmE;IACnE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC;AAYH,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC;AAG5E,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAsCH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,0BAA0B;IAC/B,KAAK,CAAC,QAAQ;QACb,MAAM,IAAI,eAAe,CAAC,0DAA0D,EAAE,aAAa,EAAE;YACpG,MAAM,EAAE,iCAAiC;YACzC,YAAY,EAAE,qFAAqF;SACnG,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAiD;IAC7F,EAAE,EAAE,gBAAgB;IACpB,gBAAgB,EAAE,wBAAwB;IAC1C,qBAAqB,EAAE,0BAA0B;IACjD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC;AAEH,8BAA8B;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Provider-neutral read-only account economics. */
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
4
|
+
import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
|
|
5
|
+
export declare const BillingMoneySchema: z.ZodObject<{
|
|
6
|
+
currency: z.ZodString;
|
|
7
|
+
amount: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const BillingSummarySchema: z.ZodObject<{
|
|
10
|
+
provider: z.ZodString;
|
|
11
|
+
collectedAt: z.ZodISODateTime;
|
|
12
|
+
accountBalance: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
currency: z.ZodString;
|
|
14
|
+
amount: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
monthToDateUsage: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
currency: z.ZodString;
|
|
18
|
+
amount: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
monthToDateBalance: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
currency: z.ZodString;
|
|
22
|
+
amount: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
grossProductCharges: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
currency: z.ZodString;
|
|
26
|
+
amount: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
invoiceCreditsAndAdjustments: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
currency: z.ZodString;
|
|
30
|
+
amount: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
sponsorshipCredits: z.ZodObject<{
|
|
33
|
+
status: z.ZodEnum<{
|
|
34
|
+
unknown: "unknown";
|
|
35
|
+
available: "available";
|
|
36
|
+
unsupported: "unsupported";
|
|
37
|
+
}>;
|
|
38
|
+
remaining: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
currency: z.ZodString;
|
|
40
|
+
amount: z.ZodString;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
43
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
46
|
+
source: z.ZodString;
|
|
47
|
+
message: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type BillingSummary = z.infer<typeof BillingSummarySchema>;
|
|
51
|
+
export declare const BillingDescriptorSchema: z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
name: z.ZodOptional<z.ZodString>;
|
|
54
|
+
description: z.ZodOptional<z.ZodString>;
|
|
55
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
60
|
+
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
63
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
64
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
68
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
69
|
+
reason: z.ZodString;
|
|
70
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>]>>;
|
|
72
|
+
kind: z.ZodLiteral<"infra/billing">;
|
|
73
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type BillingDescriptor = z.infer<typeof BillingDescriptorSchema>;
|
|
76
|
+
export interface BillingImplementation {
|
|
77
|
+
summary(): Promise<BillingSummary>;
|
|
78
|
+
}
|
|
79
|
+
declare class DefaultBillingImplementation {
|
|
80
|
+
readonly descriptor: RuntimeDescriptor;
|
|
81
|
+
readonly context: KindContext;
|
|
82
|
+
/** The descriptor as this kind's schema reads it. */
|
|
83
|
+
readonly config: BillingDescriptor;
|
|
84
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext);
|
|
85
|
+
}
|
|
86
|
+
export declare const billingKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DefaultBillingImplementation>;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=billing.kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/billing.kind.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,WAAW,qBAAqB;IACrC,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;CACnC;AACD,cAAM,4BAA4B;aAIhB,UAAU,EAAE,iBAAiB;aAC7B,OAAO,EAAE,WAAW;IAJrC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAElB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,WAAW;CAIrC;AACD,eAAO,MAAM,WAAW,yFAKtB,CAAC"}
|