@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
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { VibesRuntime } from '@vibesdotdev/runtime';
|
|
2
|
-
import { getLogger } from '@vibesdotdev/logging';
|
|
3
|
-
import type {
|
|
4
|
-
BootstrapSeedCondition,
|
|
5
|
-
BootstrapSeedDescriptor,
|
|
6
|
-
BootstrapSeedMode
|
|
7
|
-
} from './seed.descriptor.ts';
|
|
8
|
-
import type { BootstrapSeedImpl } from './seed.impl-shape.ts';
|
|
9
|
-
|
|
10
|
-
const log = getLogger('infra.bootstrap.seed');
|
|
11
|
-
|
|
12
|
-
export interface BootstrapSeedRunResult {
|
|
13
|
-
ran: string[];
|
|
14
|
-
skipped: Array<{ id: string; reason: string }>;
|
|
15
|
-
failed: Array<{ id: string; error: string }>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface BootstrapSeedRunOptions {
|
|
19
|
-
env: Record<string, string | undefined>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function runBootstrapSeeds(
|
|
23
|
-
runtime: VibesRuntime,
|
|
24
|
-
mode: BootstrapSeedMode,
|
|
25
|
-
options: BootstrapSeedRunOptions
|
|
26
|
-
): Promise<BootstrapSeedRunResult> {
|
|
27
|
-
const allDescriptors = runtime
|
|
28
|
-
.assets('bootstrap/seed')
|
|
29
|
-
.descriptors() as unknown as readonly BootstrapSeedDescriptor[];
|
|
30
|
-
|
|
31
|
-
const result: BootstrapSeedRunResult = { ran: [], skipped: [], failed: [] };
|
|
32
|
-
const runnable: BootstrapSeedDescriptor[] = [];
|
|
33
|
-
|
|
34
|
-
for (const descriptor of allDescriptors) {
|
|
35
|
-
if (!descriptor.executeOn.includes(mode)) {
|
|
36
|
-
result.skipped.push({
|
|
37
|
-
id: descriptor.id,
|
|
38
|
-
reason: `mode ${mode} not in executeOn`
|
|
39
|
-
});
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (!evaluateCondition(descriptor.condition, options.env)) {
|
|
43
|
-
result.skipped.push({
|
|
44
|
-
id: descriptor.id,
|
|
45
|
-
reason: 'condition not met'
|
|
46
|
-
});
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
runnable.push(descriptor);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
runnable.sort((a, b) => (a.priority ?? 100) - (b.priority ?? 100));
|
|
53
|
-
|
|
54
|
-
for (const descriptor of runnable) {
|
|
55
|
-
try {
|
|
56
|
-
const impl = (await runtime
|
|
57
|
-
.query('bootstrap/seed')
|
|
58
|
-
.withId(descriptor.id)
|
|
59
|
-
.resolve()) as BootstrapSeedImpl;
|
|
60
|
-
await impl.run(runtime, options.env);
|
|
61
|
-
result.ran.push(descriptor.id);
|
|
62
|
-
log.info('bootstrap seed completed', {
|
|
63
|
-
id: descriptor.id,
|
|
64
|
-
mode,
|
|
65
|
-
priority: descriptor.priority ?? 100
|
|
66
|
-
});
|
|
67
|
-
} catch (err) {
|
|
68
|
-
const error = err instanceof Error ? err.message : String(err);
|
|
69
|
-
result.failed.push({ id: descriptor.id, error });
|
|
70
|
-
log.error('bootstrap seed failed', { id: descriptor.id, mode, error });
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function evaluateCondition(
|
|
78
|
-
condition: BootstrapSeedCondition | undefined,
|
|
79
|
-
env: Record<string, string | undefined>
|
|
80
|
-
): boolean {
|
|
81
|
-
if (!condition) return true;
|
|
82
|
-
if (condition.kind === 'always') return true;
|
|
83
|
-
if (condition.kind === 'env-keys-present') {
|
|
84
|
-
return condition.keys.every((key) => Boolean(env[key]));
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider-agnostic credential resolution for infra/* adapters.
|
|
3
|
-
*
|
|
4
|
-
* Routes through the `secrets/store` runtime kind so every adapter
|
|
5
|
-
* (alerts, RUM, observability, …) reads from the same credential chain
|
|
6
|
-
* the rest of the platform uses. The chain (highest precedence first):
|
|
7
|
-
*
|
|
8
|
-
* 1. process.env (CI / explicit overrides)
|
|
9
|
-
* 2. The tier-resolved secrets/store implementation
|
|
10
|
-
* - local tier → encrypted-local → env-file
|
|
11
|
-
* - production → cloudflare-secrets-store → cloudflare-api
|
|
12
|
-
*
|
|
13
|
-
* Adapters declare the secret KEY NAMES (e.g. CLOUDFLARE_API_TOKEN) on
|
|
14
|
-
* their descriptor's `adapterConfig` and use this helper to resolve
|
|
15
|
-
* the values. The helper supports `keyCandidates` for fallback chains
|
|
16
|
-
* (e.g. prefer a scoped CLOUDFLARE_NOTIFICATIONS_API_TOKEN, fall back
|
|
17
|
-
* to the broad CLOUDFLARE_API_TOKEN).
|
|
18
|
-
*
|
|
19
|
-
* Why a helper instead of inlining the secrets/store query: provider
|
|
20
|
-
* adapters live in different packages and shouldn't all duplicate the
|
|
21
|
-
* tier-walk + env-overlay logic. Keeping it in infra-core makes the
|
|
22
|
-
* abstraction explicit ("infra/* adapters route credentials through
|
|
23
|
-
* vibes secrets") and gives us one place to evolve the chain (e.g.
|
|
24
|
-
* adding 1Password CLI as a backend).
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import { getVibesRuntime } from '@vibesdotdev/runtime';
|
|
28
|
-
|
|
29
|
-
export type EnvironmentTier = 'local' | 'dev' | 'staging' | 'production';
|
|
30
|
-
|
|
31
|
-
export interface ResolveAdapterCredentialOptions {
|
|
32
|
-
/**
|
|
33
|
-
* Ordered list of candidate keys. First one that resolves to a
|
|
34
|
-
* non-empty value wins. Useful for scoped → fallback patterns:
|
|
35
|
-
* ['CLOUDFLARE_NOTIFICATIONS_API_TOKEN', 'CLOUDFLARE_API_TOKEN']
|
|
36
|
-
*/
|
|
37
|
-
keyCandidates: readonly string[];
|
|
38
|
-
/**
|
|
39
|
-
* Environment name to read from the secrets store (default: 'local').
|
|
40
|
-
* Maps onto vault.environments[name] in encrypted-local.
|
|
41
|
-
*/
|
|
42
|
-
environment?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Tier hint for runtime store selection. Defaults to inferring from
|
|
45
|
-
* the environment name when it matches a known tier; falls back to
|
|
46
|
-
* 'local' otherwise.
|
|
47
|
-
*/
|
|
48
|
-
tier?: EnvironmentTier;
|
|
49
|
-
/**
|
|
50
|
-
* Whether to consult process.env first. Defaults true — CI/CD and
|
|
51
|
-
* explicit shell overrides should win. Pass false to force
|
|
52
|
-
* store-only resolution.
|
|
53
|
-
*/
|
|
54
|
-
includeProcessEnv?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Optional human-readable name for the credential, used in error
|
|
57
|
-
* messages when no candidate resolves (e.g. "Cloudflare API token").
|
|
58
|
-
*/
|
|
59
|
-
humanName?: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface ResolvedAdapterCredential {
|
|
63
|
-
/** The KEY that resolved (one of keyCandidates). Useful for audit. */
|
|
64
|
-
key: string;
|
|
65
|
-
/** The resolved secret value. Never logged. */
|
|
66
|
-
value: string;
|
|
67
|
-
/** Where the value came from: 'process.env' or the store backend id. */
|
|
68
|
-
source: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface SecretsStoreImplShape {
|
|
72
|
-
id?: string;
|
|
73
|
-
get?(environment: string, key: string): Promise<string | undefined>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface SecretsStoreDescriptorShape {
|
|
77
|
-
id: string;
|
|
78
|
-
priority?: number;
|
|
79
|
-
tiers?: readonly EnvironmentTier[] | EnvironmentTier[];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Tier-aware backend selection. Mirrors the secrets/store kind's own
|
|
84
|
-
* resolver (`packages/secrets/src/kinds/store.kind.ts`) so callers
|
|
85
|
-
* don't need to import internal helpers.
|
|
86
|
-
*/
|
|
87
|
-
function pickBackend(
|
|
88
|
-
descriptors: SecretsStoreDescriptorShape[],
|
|
89
|
-
tier: EnvironmentTier
|
|
90
|
-
): SecretsStoreDescriptorShape | undefined {
|
|
91
|
-
if (descriptors.length === 0) return undefined;
|
|
92
|
-
const matches = descriptors.filter((d) => (d.tiers ?? []).includes(tier));
|
|
93
|
-
const pool = matches.length > 0 ? matches : descriptors;
|
|
94
|
-
pool.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
95
|
-
return pool[0];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function inferTier(environment: string, override?: EnvironmentTier): EnvironmentTier {
|
|
99
|
-
if (override) return override;
|
|
100
|
-
if (environment === 'local' || environment === 'dev' || environment === 'staging' || environment === 'production') {
|
|
101
|
-
return environment;
|
|
102
|
-
}
|
|
103
|
-
return 'local';
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Resolve a single credential by walking the candidate keys against
|
|
108
|
-
* process.env then the active secrets store. Returns the first match.
|
|
109
|
-
*
|
|
110
|
-
* Throws when no candidate resolves — adapters should let this bubble
|
|
111
|
-
* up so the CLI surfaces a clean "missing credentials" message rather
|
|
112
|
-
* than a vague "401 Unauthorized" downstream.
|
|
113
|
-
*/
|
|
114
|
-
export async function resolveAdapterCredential(
|
|
115
|
-
options: ResolveAdapterCredentialOptions
|
|
116
|
-
): Promise<ResolvedAdapterCredential> {
|
|
117
|
-
const env = options.environment ?? 'local';
|
|
118
|
-
const tier = inferTier(env, options.tier);
|
|
119
|
-
const includeEnv = options.includeProcessEnv ?? true;
|
|
120
|
-
|
|
121
|
-
// 1. process.env (CI / shell override)
|
|
122
|
-
if (includeEnv) {
|
|
123
|
-
for (const key of options.keyCandidates) {
|
|
124
|
-
const v = process.env[key];
|
|
125
|
-
if (v && v.length > 0) {
|
|
126
|
-
return { key, value: v, source: 'process.env' };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// 2. secrets/store runtime resolution (tier-aware, priority-ordered)
|
|
132
|
-
const runtime = getVibesRuntime();
|
|
133
|
-
if (!runtime.hasKind('secrets/store')) {
|
|
134
|
-
throw new Error(
|
|
135
|
-
`No secrets/store kind registered; cannot resolve ${options.humanName ?? options.keyCandidates[0]}. ` +
|
|
136
|
-
'Load the secrets plugin (and a backend like encrypted-local) before calling this adapter.'
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const descriptors = runtime
|
|
141
|
-
.assets('secrets/store')
|
|
142
|
-
.descriptors() as SecretsStoreDescriptorShape[];
|
|
143
|
-
// `VIBES_DEBUG_SECRETS=1` dumps the visible descriptor pool when
|
|
144
|
-
// you're tracing why a credential is missing or getting misrouted.
|
|
145
|
-
if (process.env.VIBES_DEBUG_SECRETS === '1') {
|
|
146
|
-
console.error(`[secrets-debug] descriptors visible at tier=${tier}:`);
|
|
147
|
-
for (const d of descriptors) {
|
|
148
|
-
console.error(` - id=${d.id} priority=${d.priority ?? '-'} tiers=${JSON.stringify(d.tiers)}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const target = pickBackend(descriptors, tier);
|
|
152
|
-
if (!target) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`No secrets/store backend available for tier=${tier}. Register a backend ` +
|
|
155
|
-
'(encrypted-local for local, cloudflare-secrets-store for production) before calling this adapter.'
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const store = (await runtime
|
|
160
|
-
.query('secrets/store')
|
|
161
|
-
.withId(target.id)
|
|
162
|
-
.resolve()) as SecretsStoreImplShape;
|
|
163
|
-
|
|
164
|
-
if (!store || typeof store.get !== 'function') {
|
|
165
|
-
throw new Error(
|
|
166
|
-
`Resolved secrets/store '${target.id}' has no get() method for ${options.humanName ?? options.keyCandidates[0]}.`
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
for (const key of options.keyCandidates) {
|
|
171
|
-
try {
|
|
172
|
-
const v = await store.get(env, key);
|
|
173
|
-
if (v && v.length > 0) {
|
|
174
|
-
return { key, value: v, source: target.id };
|
|
175
|
-
}
|
|
176
|
-
} catch {
|
|
177
|
-
// next candidate
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
throw new Error(
|
|
182
|
-
`Missing credential: none of [${options.keyCandidates.join(', ')}] resolved from process.env or ` +
|
|
183
|
-
`${target.id} (environment=${env}, tier=${tier}). ` +
|
|
184
|
-
`Set the value with \`vibes secrets set --environment ${env} ${options.keyCandidates[0]} <value>\`.`
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Convenience wrapper for resolving multiple credentials at once.
|
|
190
|
-
* Each key gets a candidate list of one (the key itself). Use the
|
|
191
|
-
* single-credential form when you need fallback chains.
|
|
192
|
-
*/
|
|
193
|
-
export async function resolveAdapterCredentials(
|
|
194
|
-
keys: readonly string[],
|
|
195
|
-
options?: Omit<ResolveAdapterCredentialOptions, 'keyCandidates' | 'humanName'>
|
|
196
|
-
): Promise<Record<string, ResolvedAdapterCredential>> {
|
|
197
|
-
const out: Record<string, ResolvedAdapterCredential> = {};
|
|
198
|
-
for (const key of keys) {
|
|
199
|
-
out[key] = await resolveAdapterCredential({
|
|
200
|
-
keyCandidates: [key],
|
|
201
|
-
...(options ?? {})
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
return out;
|
|
205
|
-
}
|
package/src/deployment.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
appDeploymentSchema,
|
|
3
|
-
deploymentDependencySchema,
|
|
4
|
-
deploymentEnvRequirementSchema,
|
|
5
|
-
deploymentOriginSchema,
|
|
6
|
-
type AppDeployment,
|
|
7
|
-
type AppDeploymentInput,
|
|
8
|
-
type DeploymentDependency,
|
|
9
|
-
type DeploymentEnvRequirement,
|
|
10
|
-
type DeploymentOrigin,
|
|
11
|
-
type DeploymentUpstream
|
|
12
|
-
} from './schemas.ts';
|
|
13
|
-
|
|
14
|
-
export function createAppDeployment(input: AppDeploymentInput): AppDeployment {
|
|
15
|
-
return appDeploymentSchema.parse(input);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function createDeploymentOrigin(input: DeploymentOrigin): DeploymentOrigin {
|
|
19
|
-
return deploymentOriginSchema.parse(input);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function createDeploymentEnvRequirement(
|
|
23
|
-
input: DeploymentEnvRequirement
|
|
24
|
-
): DeploymentEnvRequirement {
|
|
25
|
-
return deploymentEnvRequirementSchema.parse(input);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function createDeploymentDependency(input: DeploymentDependency): DeploymentDependency {
|
|
29
|
-
return deploymentDependencySchema.parse(input);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function getPrimaryOrigin(deployment: AppDeployment): DeploymentOrigin {
|
|
33
|
-
return (
|
|
34
|
-
deployment.origins.find((origin) => origin.kind === 'primary') ?? deployment.origins[0]
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function getUpstreamOriginEnv(
|
|
39
|
-
upstream: DeploymentUpstream
|
|
40
|
-
): Record<string, string> {
|
|
41
|
-
if (!upstream.originEnvVar) {
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
[upstream.originEnvVar]: upstream.origin
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export type {
|
|
51
|
-
AppDeployment,
|
|
52
|
-
AppDeploymentInput,
|
|
53
|
-
DeploymentDependency,
|
|
54
|
-
DeploymentEnvRequirement,
|
|
55
|
-
DeploymentOrigin,
|
|
56
|
-
DeploymentUpstream
|
|
57
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
createAppDeployment,
|
|
3
|
-
createDeploymentOrigin,
|
|
4
|
-
createDeploymentEnvRequirement,
|
|
5
|
-
createDeploymentDependency,
|
|
6
|
-
getPrimaryOrigin,
|
|
7
|
-
getUpstreamOriginEnv
|
|
8
|
-
} from './deployment.ts';
|
|
9
|
-
export type {
|
|
10
|
-
AppDeployment,
|
|
11
|
-
AppDeploymentInput,
|
|
12
|
-
DeploymentDependency,
|
|
13
|
-
DeploymentEnvRequirement,
|
|
14
|
-
DeploymentOrigin,
|
|
15
|
-
DeploymentUpstream
|
|
16
|
-
} from './deployment.ts';
|
|
17
|
-
export {
|
|
18
|
-
deploymentProviderSchema,
|
|
19
|
-
appRuntimeSchema,
|
|
20
|
-
deploymentOriginSchema,
|
|
21
|
-
deploymentBuildSchema,
|
|
22
|
-
deploymentEnvRequirementSchema,
|
|
23
|
-
deploymentDependencySchema,
|
|
24
|
-
deploymentUpstreamSchema,
|
|
25
|
-
appDeploymentSchema
|
|
26
|
-
} from './schemas.ts';
|
|
27
|
-
export type {
|
|
28
|
-
DeploymentProvider,
|
|
29
|
-
AppRuntime,
|
|
30
|
-
DeploymentOrigin as DeploymentOriginType,
|
|
31
|
-
DeploymentBuild,
|
|
32
|
-
DeploymentEnvRequirement as DeploymentEnvRequirementType,
|
|
33
|
-
DeploymentDependency as DeploymentDependencyType,
|
|
34
|
-
DeploymentUpstream as DeploymentUpstreamType,
|
|
35
|
-
AppDeploymentInput as AppDeploymentInputType,
|
|
36
|
-
AppDeployment as AppDeploymentType
|
|
37
|
-
} from './schemas.ts';
|
|
38
|
-
export {
|
|
39
|
-
webAppKind, WebAppDescriptorSchema, WebAppConfigSchema, CloudflareWorkersWebAppConfigSchema, DigitalOceanAppWebAppConfigSchema
|
|
40
|
-
} from './kinds/index.ts';
|
|
41
|
-
export type { WebAppDescriptor, WebAppDependency } from './kinds/index.ts';
|
|
42
|
-
export {
|
|
43
|
-
workerKind, WorkerDescriptorSchema, WorkerConfigSchema, DoksDeploymentWorkerConfigSchema, WorkerScalingSchema
|
|
44
|
-
} from './kinds/index.ts';
|
|
45
|
-
export type { WorkerDescriptor, WorkerScaling } from './kinds/index.ts';
|
|
46
|
-
export {
|
|
47
|
-
databaseKind, DatabaseDescriptorSchema, DatabaseConfigSchema, DoksDatabaseConfigSchema, DOManagedPostgresConfigSchema, TursoDatabaseConfigSchema, CloudflareD1ConfigSchema, DatabaseBackupSchema
|
|
48
|
-
} from './kinds/index.ts';
|
|
49
|
-
export type { DatabaseDescriptor, DatabaseBackup } from './kinds/index.ts';
|
|
50
|
-
export {
|
|
51
|
-
queueKind, QueueDescriptorSchema, QueueConfigSchema, DoksQueueConfigSchema, QueueTopicSchema
|
|
52
|
-
} from './kinds/index.ts';
|
|
53
|
-
export type { QueueDescriptor, QueueTopic } from './kinds/index.ts';
|
|
54
|
-
export { cacheKind, CacheDescriptorSchema, CacheConfigSchema, DOManagedRedisConfigSchema } from './kinds/index.ts';
|
|
55
|
-
export type { CacheDescriptor } from './kinds/index.ts';
|
|
56
|
-
export {
|
|
57
|
-
objectStorageKind, ObjectStorageDescriptorSchema, ObjectStorageConfigSchema, DOSpacesConfigSchema, CorsRuleSchema, LifecycleRuleSchema
|
|
58
|
-
} from './kinds/index.ts';
|
|
59
|
-
export type { ObjectStorageDescriptor, CorsRule, LifecycleRule } from './kinds/index.ts';
|
|
60
|
-
export {
|
|
61
|
-
sandboxKind, SandboxDescriptorSchema, SandboxConfigSchema, CloudflareSandboxConfigSchema, DockerSandboxConfigSchema, DigitalOceanDropletSandboxConfigSchema, SandboxOutboundProxySchema, SandboxResourceLimitsSchema
|
|
62
|
-
} from './kinds/index.ts';
|
|
63
|
-
export type { SandboxDescriptor, SandboxOutboundProxy, SandboxResourceLimits } from './kinds/index.ts';
|
|
64
|
-
export {
|
|
65
|
-
gitHostingKind, GitHostingDescriptorSchema, GitHostingConfigSchema, GiteaDoksGitHostingConfigSchema, GitHostingTypeSchema, GitHostingAuthMethodSchema
|
|
66
|
-
} from './kinds/index.ts';
|
|
67
|
-
export type { GitHostingDescriptor, GitHostingType, GitHostingAuthMethod } from './kinds/index.ts';
|
|
68
|
-
export {
|
|
69
|
-
packageRegistryKind, PackageRegistryDescriptorSchema, PackageRegistryConfigSchema, VerdaccioDoksPackageRegistryConfigSchema, PackageRegistryTypeSchema
|
|
70
|
-
} from './kinds/index.ts';
|
|
71
|
-
export type { PackageRegistryDescriptor, PackageRegistryType } from './kinds/index.ts';
|
|
72
|
-
export {
|
|
73
|
-
logsKind, InfraLogsDescriptorSchema, type InfraLogsDescriptor, type InfraLogsDescriptorInput, type InfraLogsKind, type InfraLogsKindInput, type LogsImplementation
|
|
74
|
-
} from './kinds/index.ts';
|
|
75
|
-
export {
|
|
76
|
-
artifactKind,
|
|
77
|
-
ArtifactDescriptorSchema,
|
|
78
|
-
type ArtifactDescriptor,
|
|
79
|
-
type ArtifactGenerator,
|
|
80
|
-
type ArtifactOutput
|
|
81
|
-
} from './kinds/index.ts';
|
|
82
|
-
export { INFRA_DISCOVERY_PATTERN, extractStem } from './kinds/index.ts';
|
|
83
|
-
export {
|
|
84
|
-
alertsKind,
|
|
85
|
-
InfraAlertsDescriptorSchema,
|
|
86
|
-
AlertPolicySchema,
|
|
87
|
-
AlertMechanismSchema,
|
|
88
|
-
AlertTypeSchema,
|
|
89
|
-
AlertWindowSchema,
|
|
90
|
-
type InfraAlertsDescriptor,
|
|
91
|
-
type InfraAlertsDescriptorInput,
|
|
92
|
-
type InfraAlertsKind,
|
|
93
|
-
type InfraAlertsKindInput,
|
|
94
|
-
type AlertsImplementation,
|
|
95
|
-
type AlertPolicy,
|
|
96
|
-
type AlertMechanism,
|
|
97
|
-
type AlertType
|
|
98
|
-
} from './kinds/index.ts';
|
|
99
|
-
export {
|
|
100
|
-
observabilityKind,
|
|
101
|
-
InfraObservabilityDescriptorSchema,
|
|
102
|
-
ObservabilityScopeSchema,
|
|
103
|
-
ObservabilitySettingsSchema,
|
|
104
|
-
type InfraObservabilityDescriptor,
|
|
105
|
-
type InfraObservabilityDescriptorInput,
|
|
106
|
-
type InfraObservabilityKind,
|
|
107
|
-
type InfraObservabilityKindInput,
|
|
108
|
-
type ObservabilityImplementation,
|
|
109
|
-
type ObservabilityScope,
|
|
110
|
-
type ObservabilitySettings,
|
|
111
|
-
type ObservabilitySnapshot,
|
|
112
|
-
type SetObservabilityInput,
|
|
113
|
-
type SetObservabilityResult
|
|
114
|
-
} from './kinds/index.ts';
|
|
115
|
-
export {
|
|
116
|
-
rumKind,
|
|
117
|
-
InfraRumDescriptorSchema,
|
|
118
|
-
RumPrivacySchema,
|
|
119
|
-
RumInjectionSchema,
|
|
120
|
-
type InfraRumDescriptor,
|
|
121
|
-
type InfraRumDescriptorInput,
|
|
122
|
-
type InfraRumKind,
|
|
123
|
-
type InfraRumKindInput,
|
|
124
|
-
type RumImplementation,
|
|
125
|
-
type RumSiteSnapshot,
|
|
126
|
-
type RumPrivacy,
|
|
127
|
-
type RumInjection
|
|
128
|
-
} from './kinds/index.ts';
|
|
129
|
-
export {
|
|
130
|
-
resolveAdapterCredential,
|
|
131
|
-
resolveAdapterCredentials,
|
|
132
|
-
type EnvironmentTier,
|
|
133
|
-
type ResolveAdapterCredentialOptions,
|
|
134
|
-
type ResolvedAdapterCredential
|
|
135
|
-
} from './credentials/resolve.ts';
|
|
136
|
-
export {
|
|
137
|
-
bootstrapSeedKind,
|
|
138
|
-
bootstrapSeedConditionSchema,
|
|
139
|
-
bootstrapSeedDescriptorSchema,
|
|
140
|
-
bootstrapSeedModeSchema,
|
|
141
|
-
runBootstrapSeeds,
|
|
142
|
-
type BootstrapSeedCondition,
|
|
143
|
-
type BootstrapSeedDescriptor,
|
|
144
|
-
type BootstrapSeedImpl,
|
|
145
|
-
type BootstrapSeedMode,
|
|
146
|
-
type BootstrapSeedRunOptions,
|
|
147
|
-
type BootstrapSeedRunResult
|
|
148
|
-
} from './bootstrap/index.ts';
|
|
149
|
-
export { default as infraPlugin } from './infra.plugin';
|
package/src/infra.plugin.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure Runtime Plugin
|
|
3
|
-
*
|
|
4
|
-
* Registers all infra resource kinds with the runtime.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { createRuntimePlugin } from '@vibesdotdev/runtime/factory/plugin';
|
|
8
|
-
import { webAppKind } from './kinds/web-app.kind';
|
|
9
|
-
import { workerKind } from './kinds/worker.kind';
|
|
10
|
-
import { databaseKind } from './kinds/database.kind';
|
|
11
|
-
import { queueKind } from './kinds/queue.kind';
|
|
12
|
-
import { cacheKind } from './kinds/cache.kind';
|
|
13
|
-
import { objectStorageKind } from './kinds/object-storage.kind';
|
|
14
|
-
import { sandboxKind } from './kinds/sandbox.kind';
|
|
15
|
-
import { gitHostingKind } from './kinds/git-hosting.kind';
|
|
16
|
-
import { packageRegistryKind } from './kinds/package-registry.kind';
|
|
17
|
-
import { logsKind } from './kinds/logs.kind';
|
|
18
|
-
import { alertsKind } from './kinds/alerts.kind.ts';
|
|
19
|
-
import { observabilityKind } from './kinds/observability.kind.ts';
|
|
20
|
-
import { rumKind } from './kinds/rum.kind.ts';
|
|
21
|
-
import { bootstrapSeedKind } from './bootstrap/index.ts';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Note on layering: inference is an apps/ai domain concern, not an infra kind.
|
|
25
|
-
* Existing runtime kinds `ai/provider`, `ai/adapter`, `ai/model`, and
|
|
26
|
-
* `ai/generation` already express "who/how/where inference runs", and the
|
|
27
|
-
* runtime's hardware scope + connectionMode qualifier + priority already
|
|
28
|
-
* select between consumer-direct, consumer-worker, cloud-worker, and
|
|
29
|
-
* cloud-via-API strategies. New strategies (CF Unified Inference, Agents
|
|
30
|
-
* Week bindings) should be added as new `ai/provider` descriptors + adapters,
|
|
31
|
-
* not as a parallel `infra/inference` kind.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
export default createRuntimePlugin({
|
|
35
|
-
id: 'infra',
|
|
36
|
-
name: 'Infrastructure',
|
|
37
|
-
description: 'Resource kinds for deployable infrastructure',
|
|
38
|
-
kinds: [
|
|
39
|
-
webAppKind,
|
|
40
|
-
workerKind,
|
|
41
|
-
databaseKind,
|
|
42
|
-
queueKind,
|
|
43
|
-
cacheKind,
|
|
44
|
-
objectStorageKind,
|
|
45
|
-
sandboxKind,
|
|
46
|
-
gitHostingKind,
|
|
47
|
-
packageRegistryKind,
|
|
48
|
-
logsKind,
|
|
49
|
-
alertsKind,
|
|
50
|
-
observabilityKind,
|
|
51
|
-
rumKind,
|
|
52
|
-
bootstrapSeedKind
|
|
53
|
-
]
|
|
54
|
-
});
|