@vibesdotdev/infra-core 0.0.1 → 1.0.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -0
- package/README.md +34 -63
- package/dist/bootstrap/seed.descriptor.d.ts +1 -1
- package/dist/bootstrap/seed.descriptor.d.ts.map +1 -1
- package/dist/bootstrap/seed.descriptor.js +1 -1
- package/dist/bootstrap/seed.descriptor.js.map +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts +1 -1
- package/dist/bootstrap/seed.impl-shape.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.d.ts +1 -3
- package/dist/bootstrap/seed.kind.d.ts.map +1 -1
- package/dist/bootstrap/seed.kind.js +17 -4
- package/dist/bootstrap/seed.kind.js.map +1 -1
- package/dist/bootstrap/seed.runner.d.ts +9 -2
- package/dist/bootstrap/seed.runner.d.ts.map +1 -1
- package/dist/bootstrap/seed.runner.js +37 -18
- package/dist/bootstrap/seed.runner.js.map +1 -1
- package/dist/capped-id.d.ts +19 -0
- package/dist/capped-id.d.ts.map +1 -0
- package/dist/capped-id.js +64 -0
- package/dist/capped-id.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts +23 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js +33 -0
- package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts +24 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js +73 -0
- package/dist/cli/generate/artifact/artifact.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/context.d.ts +17 -0
- package/dist/cli/generate/context.d.ts.map +1 -0
- package/dist/cli/generate/context.js +24 -0
- package/dist/cli/generate/context.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts +30 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js +25 -0
- package/dist/cli/generate/generate/generate.cli-command.descriptor.js.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts +25 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js +64 -0
- package/dist/cli/generate/generate/generate.cli-command.impl.js.map +1 -0
- package/dist/cli/generate/generate-core.d.ts +51 -0
- package/dist/cli/generate/generate-core.d.ts.map +1 -0
- package/dist/cli/generate/generate-core.js +172 -0
- package/dist/cli/generate/generate-core.js.map +1 -0
- package/dist/cli/generate/index.d.ts +5 -0
- package/dist/cli/generate/index.d.ts.map +1 -0
- package/dist/cli/generate/index.js +5 -0
- package/dist/cli/generate/index.js.map +1 -0
- package/dist/credentials/resolve.d.ts +82 -22
- package/dist/credentials/resolve.d.ts.map +1 -1
- package/dist/credentials/resolve.js +251 -77
- package/dist/credentials/resolve.js.map +1 -1
- package/dist/deployment-budget.d.ts +319 -0
- package/dist/deployment-budget.d.ts.map +1 -0
- package/dist/deployment-budget.js +660 -0
- package/dist/deployment-budget.js.map +1 -0
- package/dist/deployment-environment.d.ts +30 -0
- package/dist/deployment-environment.d.ts.map +1 -0
- package/dist/deployment-environment.js +53 -0
- package/dist/deployment-environment.js.map +1 -0
- package/dist/deployment-graph.d.ts +185 -0
- package/dist/deployment-graph.d.ts.map +1 -0
- package/dist/deployment-graph.js +705 -0
- package/dist/deployment-graph.js.map +1 -0
- package/dist/deployment.d.ts +25 -4
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +105 -0
- package/dist/deployment.js.map +1 -1
- package/dist/doks/cloud/base.d.ts +49 -0
- package/dist/doks/cloud/base.d.ts.map +1 -0
- package/dist/doks/cloud/base.js +138 -0
- package/dist/doks/cloud/base.js.map +1 -0
- package/dist/doks/cloud/factory.d.ts +18 -0
- package/dist/doks/cloud/factory.d.ts.map +1 -0
- package/dist/doks/cloud/factory.js +22 -0
- package/dist/doks/cloud/factory.js.map +1 -0
- package/dist/doks/cloud/index.d.ts +5 -0
- package/dist/doks/cloud/index.d.ts.map +1 -0
- package/dist/doks/cloud/index.js +4 -0
- package/dist/doks/cloud/index.js.map +1 -0
- package/dist/doks/types.d.ts +95 -0
- package/dist/doks/types.d.ts.map +1 -0
- package/dist/doks/types.js +14 -0
- package/dist/doks/types.js.map +1 -0
- package/dist/generate/index.d.ts +29 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +28 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/infra-generate.plugin.d.ts +3 -0
- package/dist/generate/infra-generate.plugin.d.ts.map +1 -0
- package/dist/generate/infra-generate.plugin.js +23 -0
- package/dist/generate/infra-generate.plugin.js.map +1 -0
- package/dist/generate/plugin.d.ts +2 -0
- package/dist/generate/plugin.d.ts.map +1 -0
- package/dist/generate/plugin.js +2 -0
- package/dist/generate/plugin.js.map +1 -0
- package/dist/heartbeat/cron-heartbeat.d.ts +97 -0
- package/dist/heartbeat/cron-heartbeat.d.ts.map +1 -0
- package/dist/heartbeat/cron-heartbeat.js +200 -0
- package/dist/heartbeat/cron-heartbeat.js.map +1 -0
- package/dist/index.d.ts +37 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -14
- package/dist/index.js.map +1 -1
- package/dist/infra.plugin.d.ts +1 -1
- package/dist/infra.plugin.d.ts.map +1 -1
- package/dist/infra.plugin.js +64 -12
- package/dist/infra.plugin.js.map +1 -1
- package/dist/kinds/alerts.kind.d.ts +64 -25
- package/dist/kinds/alerts.kind.d.ts.map +1 -1
- package/dist/kinds/alerts.kind.js +43 -16
- package/dist/kinds/alerts.kind.js.map +1 -1
- package/dist/kinds/artifact.kind.d.ts +58 -10
- package/dist/kinds/artifact.kind.d.ts.map +1 -1
- package/dist/kinds/artifact.kind.js +26 -9
- package/dist/kinds/artifact.kind.js.map +1 -1
- package/dist/kinds/billing.kind.d.ts +88 -0
- package/dist/kinds/billing.kind.d.ts.map +1 -0
- package/dist/kinds/billing.kind.js +48 -0
- package/dist/kinds/billing.kind.js.map +1 -0
- package/dist/kinds/build-job.kind.d.ts +383 -0
- package/dist/kinds/build-job.kind.d.ts.map +1 -0
- package/dist/kinds/build-job.kind.js +218 -0
- package/dist/kinds/build-job.kind.js.map +1 -0
- package/dist/kinds/cache-byte-store.d.ts +23 -0
- package/dist/kinds/cache-byte-store.d.ts.map +1 -0
- package/dist/kinds/cache-byte-store.js +9 -0
- package/dist/kinds/cache-byte-store.js.map +1 -0
- package/dist/kinds/cache.kind.d.ts +38 -94
- package/dist/kinds/cache.kind.d.ts.map +1 -1
- package/dist/kinds/cache.kind.js +39 -50
- package/dist/kinds/cache.kind.js.map +1 -1
- package/dist/kinds/cluster.kind.d.ts +154 -0
- package/dist/kinds/cluster.kind.d.ts.map +1 -0
- package/dist/kinds/cluster.kind.js +99 -0
- package/dist/kinds/cluster.kind.js.map +1 -0
- package/dist/kinds/compute-source.kind.d.ts +155 -0
- package/dist/kinds/compute-source.kind.d.ts.map +1 -0
- package/dist/kinds/compute-source.kind.js +158 -0
- package/dist/kinds/compute-source.kind.js.map +1 -0
- package/dist/kinds/container-registry.kind.d.ts +62 -0
- package/dist/kinds/container-registry.kind.d.ts.map +1 -0
- package/dist/kinds/container-registry.kind.js +47 -0
- package/dist/kinds/container-registry.kind.js.map +1 -0
- package/dist/kinds/database-migrator.kind.d.ts +6 -0
- package/dist/kinds/database-migrator.kind.d.ts.map +1 -0
- package/dist/kinds/database-migrator.kind.js +28 -0
- package/dist/kinds/database-migrator.kind.js.map +1 -0
- package/dist/kinds/database.kind.d.ts +114 -93
- package/dist/kinds/database.kind.d.ts.map +1 -1
- package/dist/kinds/database.kind.js +93 -54
- package/dist/kinds/database.kind.js.map +1 -1
- package/dist/kinds/deployment-provider.kind.d.ts +5 -0
- package/dist/kinds/deployment-provider.kind.d.ts.map +1 -0
- package/dist/kinds/deployment-provider.kind.js +11 -0
- package/dist/kinds/deployment-provider.kind.js.map +1 -0
- package/dist/kinds/discovery.d.ts +5 -12
- package/dist/kinds/discovery.d.ts.map +1 -1
- package/dist/kinds/discovery.js +5 -17
- package/dist/kinds/discovery.js.map +1 -1
- package/dist/kinds/dns.kind.d.ts +162 -0
- package/dist/kinds/dns.kind.d.ts.map +1 -0
- package/dist/kinds/dns.kind.js +54 -0
- package/dist/kinds/dns.kind.js.map +1 -0
- package/dist/kinds/drift.kind.d.ts +115 -0
- package/dist/kinds/drift.kind.d.ts.map +1 -0
- package/dist/kinds/drift.kind.js +60 -0
- package/dist/kinds/drift.kind.js.map +1 -0
- package/dist/kinds/edge-hostname.kind.d.ts +124 -0
- package/dist/kinds/edge-hostname.kind.d.ts.map +1 -0
- package/dist/kinds/edge-hostname.kind.js +87 -0
- package/dist/kinds/edge-hostname.kind.js.map +1 -0
- package/dist/kinds/edge-tls.kind.d.ts +194 -0
- package/dist/kinds/edge-tls.kind.d.ts.map +1 -0
- package/dist/kinds/edge-tls.kind.js +58 -0
- package/dist/kinds/edge-tls.kind.js.map +1 -0
- package/dist/kinds/firewall.kind.d.ts +92 -0
- package/dist/kinds/firewall.kind.d.ts.map +1 -0
- package/dist/kinds/firewall.kind.js +59 -0
- package/dist/kinds/firewall.kind.js.map +1 -0
- package/dist/kinds/git-hosting.kind.d.ts +36 -38
- package/dist/kinds/git-hosting.kind.d.ts.map +1 -1
- package/dist/kinds/git-hosting.kind.js +23 -34
- package/dist/kinds/git-hosting.kind.js.map +1 -1
- package/dist/kinds/index.d.ts +41 -15
- package/dist/kinds/index.d.ts.map +1 -1
- package/dist/kinds/index.js +40 -14
- package/dist/kinds/index.js.map +1 -1
- package/dist/kinds/inventory.kind.d.ts +245 -0
- package/dist/kinds/inventory.kind.d.ts.map +1 -0
- package/dist/kinds/inventory.kind.js +243 -0
- package/dist/kinds/inventory.kind.js.map +1 -0
- package/dist/kinds/load-balancer.kind.d.ts +135 -0
- package/dist/kinds/load-balancer.kind.d.ts.map +1 -0
- package/dist/kinds/load-balancer.kind.js +71 -0
- package/dist/kinds/load-balancer.kind.js.map +1 -0
- package/dist/kinds/logs.kind.d.ts +74 -3
- package/dist/kinds/logs.kind.d.ts.map +1 -1
- package/dist/kinds/logs.kind.js +26 -17
- package/dist/kinds/logs.kind.js.map +1 -1
- package/dist/kinds/nfs.kind.d.ts +67 -0
- package/dist/kinds/nfs.kind.d.ts.map +1 -0
- package/dist/kinds/nfs.kind.js +45 -0
- package/dist/kinds/nfs.kind.js.map +1 -0
- package/dist/kinds/node-pool.kind.d.ts +134 -0
- package/dist/kinds/node-pool.kind.d.ts.map +1 -0
- package/dist/kinds/node-pool.kind.js +88 -0
- package/dist/kinds/node-pool.kind.js.map +1 -0
- package/dist/kinds/object-storage.kind.d.ts +50 -24
- package/dist/kinds/object-storage.kind.d.ts.map +1 -1
- package/dist/kinds/object-storage.kind.js +40 -23
- package/dist/kinds/object-storage.kind.js.map +1 -1
- package/dist/kinds/observability.kind.d.ts +104 -6
- package/dist/kinds/observability.kind.d.ts.map +1 -1
- package/dist/kinds/observability.kind.js +67 -9
- package/dist/kinds/observability.kind.js.map +1 -1
- package/dist/kinds/package-registry.kind.d.ts +141 -35
- package/dist/kinds/package-registry.kind.d.ts.map +1 -1
- package/dist/kinds/package-registry.kind.js +55 -25
- package/dist/kinds/package-registry.kind.js.map +1 -1
- package/dist/kinds/queue.kind.d.ts +67 -63
- package/dist/kinds/queue.kind.d.ts.map +1 -1
- package/dist/kinds/queue.kind.js +55 -33
- package/dist/kinds/queue.kind.js.map +1 -1
- package/dist/kinds/read-descriptor.d.ts +15 -0
- package/dist/kinds/read-descriptor.d.ts.map +1 -0
- package/dist/kinds/read-descriptor.js +11 -0
- package/dist/kinds/read-descriptor.js.map +1 -0
- package/dist/kinds/rum.kind.d.ts +36 -6
- package/dist/kinds/rum.kind.d.ts.map +1 -1
- package/dist/kinds/rum.kind.js +6 -7
- package/dist/kinds/rum.kind.js.map +1 -1
- package/dist/kinds/sandbox.kind.d.ts +136 -40
- package/dist/kinds/sandbox.kind.d.ts.map +1 -1
- package/dist/kinds/sandbox.kind.js +82 -43
- package/dist/kinds/sandbox.kind.js.map +1 -1
- package/dist/kinds/select-compute-source.d.ts +72 -0
- package/dist/kinds/select-compute-source.d.ts.map +1 -0
- package/dist/kinds/select-compute-source.js +170 -0
- package/dist/kinds/select-compute-source.js.map +1 -0
- package/dist/kinds/service-release.kind.d.ts +771 -0
- package/dist/kinds/service-release.kind.d.ts.map +1 -0
- package/dist/kinds/service-release.kind.js +676 -0
- package/dist/kinds/service-release.kind.js.map +1 -0
- package/dist/kinds/spend-guard.kind.d.ts +41 -0
- package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
- package/dist/kinds/spend-guard.kind.js +140 -0
- package/dist/kinds/spend-guard.kind.js.map +1 -0
- package/dist/kinds/utilization.kind.d.ts +88 -0
- package/dist/kinds/utilization.kind.d.ts.map +1 -0
- package/dist/kinds/utilization.kind.js +62 -0
- package/dist/kinds/utilization.kind.js.map +1 -0
- package/dist/kinds/volume.kind.d.ts +54 -0
- package/dist/kinds/volume.kind.d.ts.map +1 -0
- package/dist/kinds/volume.kind.js +39 -0
- package/dist/kinds/volume.kind.js.map +1 -0
- package/dist/kinds/vpc.kind.d.ts +61 -0
- package/dist/kinds/vpc.kind.d.ts.map +1 -0
- package/dist/kinds/vpc.kind.js +51 -0
- package/dist/kinds/vpc.kind.js.map +1 -0
- package/dist/kinds/web-app.kind.d.ts +118 -45
- package/dist/kinds/web-app.kind.d.ts.map +1 -1
- package/dist/kinds/web-app.kind.js +69 -42
- package/dist/kinds/web-app.kind.js.map +1 -1
- package/dist/kinds/worker.kind.d.ts +129 -188
- package/dist/kinds/worker.kind.d.ts.map +1 -1
- package/dist/kinds/worker.kind.js +45 -123
- package/dist/kinds/worker.kind.js.map +1 -1
- package/dist/schemas/database-migration.d.ts +173 -0
- package/dist/schemas/database-migration.d.ts.map +1 -0
- package/dist/schemas/database-migration.js +88 -0
- package/dist/schemas/database-migration.js.map +1 -0
- package/dist/schemas/deployment-environment.d.ts +11 -0
- package/dist/schemas/deployment-environment.d.ts.map +1 -0
- package/dist/schemas/deployment-environment.js +9 -0
- package/dist/schemas/deployment-environment.js.map +1 -0
- package/dist/schemas/deployment-provider.d.ts +383 -0
- package/dist/schemas/deployment-provider.d.ts.map +1 -0
- package/dist/schemas/deployment-provider.js +211 -0
- package/dist/schemas/deployment-provider.js.map +1 -0
- package/dist/schemas/log-stream.d.ts +27 -0
- package/dist/schemas/log-stream.d.ts.map +1 -0
- package/dist/schemas/log-stream.js +31 -0
- package/dist/schemas/log-stream.js.map +1 -0
- package/dist/schemas/spend-guard.d.ts +155 -0
- package/dist/schemas/spend-guard.d.ts.map +1 -0
- package/dist/schemas/spend-guard.js +61 -0
- package/dist/schemas/spend-guard.js.map +1 -0
- package/dist/schemas.d.ts +195 -20
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +151 -31
- package/dist/schemas.js.map +1 -1
- package/dist/service.d.ts +87 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +199 -0
- package/dist/service.js.map +1 -0
- package/dist/settle-work.d.ts +20 -0
- package/dist/settle-work.d.ts.map +1 -0
- package/dist/settle-work.js +22 -0
- package/dist/settle-work.js.map +1 -0
- package/dist/web-app-projection.d.ts +208 -0
- package/dist/web-app-projection.d.ts.map +1 -0
- package/dist/web-app-projection.js +95 -0
- package/dist/web-app-projection.js.map +1 -0
- package/package.json +123 -40
- package/SPEC.md +0 -169
- package/src/bootstrap/index.ts +0 -15
- package/src/bootstrap/seed.descriptor.ts +0 -24
- package/src/bootstrap/seed.impl-shape.ts +0 -5
- package/src/bootstrap/seed.kind.ts +0 -26
- package/src/bootstrap/seed.runner.ts +0 -87
- package/src/credentials/resolve.ts +0 -205
- package/src/deployment.ts +0 -57
- package/src/index.ts +0 -149
- package/src/infra.plugin.ts +0 -54
- package/src/kinds/alerts.kind.ts +0 -164
- package/src/kinds/artifact.kind.ts +0 -96
- package/src/kinds/cache.kind.ts +0 -104
- package/src/kinds/database.kind.ts +0 -120
- package/src/kinds/discovery.ts +0 -26
- package/src/kinds/git-hosting.kind.ts +0 -100
- package/src/kinds/index.ts +0 -139
- package/src/kinds/logs.kind.ts +0 -104
- package/src/kinds/object-storage.kind.ts +0 -101
- package/src/kinds/observability.kind.ts +0 -178
- package/src/kinds/package-registry.kind.ts +0 -95
- package/src/kinds/queue.kind.ts +0 -102
- package/src/kinds/rum.kind.ts +0 -135
- package/src/kinds/sandbox.kind.ts +0 -115
- package/src/kinds/web-app.kind.ts +0 -103
- package/src/kinds/worker.kind.ts +0 -203
- package/src/schemas.ts +0 -127
|
@@ -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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Provider-neutral read-only account economics. */
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
|
|
4
|
+
import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
5
|
+
import { readKindDescriptor } from "./read-descriptor.js";
|
|
6
|
+
import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
|
|
7
|
+
export const BillingMoneySchema = z.object({
|
|
8
|
+
currency: z.string().regex(/^[A-Z]{3}$/, 'currency must be an ISO 4217-style code'),
|
|
9
|
+
amount: z.string().regex(/^-?\d+(?:\.\d+)?$/, 'amount must be a decimal string')
|
|
10
|
+
});
|
|
11
|
+
export const BillingSummarySchema = z.object({
|
|
12
|
+
provider: z.string().min(1),
|
|
13
|
+
collectedAt: z.iso.datetime({ offset: true }),
|
|
14
|
+
accountBalance: BillingMoneySchema.optional(),
|
|
15
|
+
monthToDateUsage: BillingMoneySchema.optional(),
|
|
16
|
+
monthToDateBalance: BillingMoneySchema.optional(),
|
|
17
|
+
grossProductCharges: BillingMoneySchema.optional(),
|
|
18
|
+
invoiceCreditsAndAdjustments: BillingMoneySchema.optional(),
|
|
19
|
+
sponsorshipCredits: z.object({
|
|
20
|
+
status: z.enum(['available', 'unknown', 'unsupported']),
|
|
21
|
+
remaining: BillingMoneySchema.optional(),
|
|
22
|
+
expiresAt: z.iso.datetime({ offset: true }).optional(),
|
|
23
|
+
reason: z.string().optional()
|
|
24
|
+
}),
|
|
25
|
+
errors: z.array(z.object({ source: z.string(), message: z.string() }))
|
|
26
|
+
});
|
|
27
|
+
export const BillingDescriptorSchema = RuntimeDescriptorSchema.extend({
|
|
28
|
+
kind: z.literal('infra/billing'),
|
|
29
|
+
provider: z.string().min(1).optional()
|
|
30
|
+
});
|
|
31
|
+
class DefaultBillingImplementation {
|
|
32
|
+
descriptor;
|
|
33
|
+
context;
|
|
34
|
+
/** The descriptor as this kind's schema reads it. */
|
|
35
|
+
config;
|
|
36
|
+
constructor(descriptor, context) {
|
|
37
|
+
this.descriptor = descriptor;
|
|
38
|
+
this.context = context;
|
|
39
|
+
this.config = readKindDescriptor(BillingDescriptorSchema, descriptor);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const billingKind = createRuntimeKind({
|
|
43
|
+
id: 'infra/billing',
|
|
44
|
+
descriptorSchema: BillingDescriptorSchema,
|
|
45
|
+
defaultImplementation: DefaultBillingImplementation,
|
|
46
|
+
discoveryPatterns: INFRA_DISCOVERY_PATTERNS
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=billing.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.kind.js","sourceRoot":"","sources":["../../src/kinds/billing.kind.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,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;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,yCAAyC,CAAC;IACnF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,iCAAiC,CAAC;CAChF,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,cAAc,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAC7C,gBAAgB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAC/C,kBAAkB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACjD,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAClD,4BAA4B,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAC3D,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QACvD,SAAS,EAAE,kBAAkB,CAAC,QAAQ,EAAE;QACxC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;QACtD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;CACtE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACrE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAKH,MAAM,4BAA4B;IAIhB;IACA;IAJjB,qDAAqD;IAC5C,MAAM,CAAoB;IACnC,YACiB,UAA6B,EAC7B,OAAoB;QADpB,eAAU,GAAV,UAAU,CAAmB;QAC7B,YAAO,GAAP,OAAO,CAAa;QAEpC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;CACD;AACD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAkD;IAC7F,EAAE,EAAE,eAAe;IACnB,gBAAgB,EAAE,uBAAuB;IACzC,qBAAqB,EAAE,4BAA4B;IACnD,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC"}
|