@vibesdotdev/infra-core 0.0.1

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.
Files changed (133) hide show
  1. package/README.md +78 -0
  2. package/SPEC.md +169 -0
  3. package/dist/bootstrap/index.d.ts +5 -0
  4. package/dist/bootstrap/index.d.ts.map +1 -0
  5. package/dist/bootstrap/index.js +4 -0
  6. package/dist/bootstrap/index.js.map +1 -0
  7. package/dist/bootstrap/seed.descriptor.d.ts +31 -0
  8. package/dist/bootstrap/seed.descriptor.d.ts.map +1 -0
  9. package/dist/bootstrap/seed.descriptor.js +18 -0
  10. package/dist/bootstrap/seed.descriptor.js.map +1 -0
  11. package/dist/bootstrap/seed.impl-shape.d.ts +5 -0
  12. package/dist/bootstrap/seed.impl-shape.d.ts.map +1 -0
  13. package/dist/bootstrap/seed.impl-shape.js +2 -0
  14. package/dist/bootstrap/seed.impl-shape.js.map +1 -0
  15. package/dist/bootstrap/seed.kind.d.ts +5 -0
  16. package/dist/bootstrap/seed.kind.d.ts.map +1 -0
  17. package/dist/bootstrap/seed.kind.js +14 -0
  18. package/dist/bootstrap/seed.kind.js.map +1 -0
  19. package/dist/bootstrap/seed.runner.d.ts +18 -0
  20. package/dist/bootstrap/seed.runner.d.ts.map +1 -0
  21. package/dist/bootstrap/seed.runner.js +59 -0
  22. package/dist/bootstrap/seed.runner.js.map +1 -0
  23. package/dist/credentials/resolve.d.ts +80 -0
  24. package/dist/credentials/resolve.d.ts.map +1 -0
  25. package/dist/credentials/resolve.js +128 -0
  26. package/dist/credentials/resolve.js.map +1 -0
  27. package/dist/deployment.d.ts +9 -0
  28. package/dist/deployment.d.ts.map +1 -0
  29. package/dist/deployment.js +25 -0
  30. package/dist/deployment.js.map +1 -0
  31. package/dist/index.d.ts +32 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +21 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/infra.plugin.d.ts +18 -0
  36. package/dist/infra.plugin.d.ts.map +1 -0
  37. package/dist/infra.plugin.js +52 -0
  38. package/dist/infra.plugin.js.map +1 -0
  39. package/dist/kinds/alerts.kind.d.ts +192 -0
  40. package/dist/kinds/alerts.kind.d.ts.map +1 -0
  41. package/dist/kinds/alerts.kind.js +116 -0
  42. package/dist/kinds/alerts.kind.js.map +1 -0
  43. package/dist/kinds/artifact.kind.d.ts +96 -0
  44. package/dist/kinds/artifact.kind.d.ts.map +1 -0
  45. package/dist/kinds/artifact.kind.js +53 -0
  46. package/dist/kinds/artifact.kind.js.map +1 -0
  47. package/dist/kinds/cache.kind.d.ts +128 -0
  48. package/dist/kinds/cache.kind.d.ts.map +1 -0
  49. package/dist/kinds/cache.kind.js +90 -0
  50. package/dist/kinds/cache.kind.js.map +1 -0
  51. package/dist/kinds/database.kind.d.ts +141 -0
  52. package/dist/kinds/database.kind.d.ts.map +1 -0
  53. package/dist/kinds/database.kind.js +103 -0
  54. package/dist/kinds/database.kind.js.map +1 -0
  55. package/dist/kinds/discovery.d.ts +20 -0
  56. package/dist/kinds/discovery.d.ts.map +1 -0
  57. package/dist/kinds/discovery.js +25 -0
  58. package/dist/kinds/discovery.js.map +1 -0
  59. package/dist/kinds/git-hosting.kind.d.ts +98 -0
  60. package/dist/kinds/git-hosting.kind.d.ts.map +1 -0
  61. package/dist/kinds/git-hosting.kind.js +81 -0
  62. package/dist/kinds/git-hosting.kind.js.map +1 -0
  63. package/dist/kinds/index.d.ts +16 -0
  64. package/dist/kinds/index.d.ts.map +1 -0
  65. package/dist/kinds/index.js +16 -0
  66. package/dist/kinds/index.js.map +1 -0
  67. package/dist/kinds/logs.kind.d.ts +91 -0
  68. package/dist/kinds/logs.kind.d.ts.map +1 -0
  69. package/dist/kinds/logs.kind.js +73 -0
  70. package/dist/kinds/logs.kind.js.map +1 -0
  71. package/dist/kinds/object-storage.kind.d.ts +85 -0
  72. package/dist/kinds/object-storage.kind.d.ts.map +1 -0
  73. package/dist/kinds/object-storage.kind.js +81 -0
  74. package/dist/kinds/object-storage.kind.js.map +1 -0
  75. package/dist/kinds/observability.kind.d.ts +176 -0
  76. package/dist/kinds/observability.kind.d.ts.map +1 -0
  77. package/dist/kinds/observability.kind.js +120 -0
  78. package/dist/kinds/observability.kind.js.map +1 -0
  79. package/dist/kinds/package-registry.kind.d.ts +89 -0
  80. package/dist/kinds/package-registry.kind.d.ts.map +1 -0
  81. package/dist/kinds/package-registry.kind.js +78 -0
  82. package/dist/kinds/package-registry.kind.js.map +1 -0
  83. package/dist/kinds/queue.kind.d.ts +113 -0
  84. package/dist/kinds/queue.kind.d.ts.map +1 -0
  85. package/dist/kinds/queue.kind.js +86 -0
  86. package/dist/kinds/queue.kind.js.map +1 -0
  87. package/dist/kinds/rum.kind.d.ts +113 -0
  88. package/dist/kinds/rum.kind.d.ts.map +1 -0
  89. package/dist/kinds/rum.kind.js +80 -0
  90. package/dist/kinds/rum.kind.js.map +1 -0
  91. package/dist/kinds/sandbox.kind.d.ts +111 -0
  92. package/dist/kinds/sandbox.kind.d.ts.map +1 -0
  93. package/dist/kinds/sandbox.kind.js +94 -0
  94. package/dist/kinds/sandbox.kind.js.map +1 -0
  95. package/dist/kinds/web-app.kind.d.ts +99 -0
  96. package/dist/kinds/web-app.kind.d.ts.map +1 -0
  97. package/dist/kinds/web-app.kind.js +86 -0
  98. package/dist/kinds/web-app.kind.js.map +1 -0
  99. package/dist/kinds/worker.kind.d.ts +244 -0
  100. package/dist/kinds/worker.kind.d.ts.map +1 -0
  101. package/dist/kinds/worker.kind.js +171 -0
  102. package/dist/kinds/worker.kind.js.map +1 -0
  103. package/dist/schemas.d.ts +125 -0
  104. package/dist/schemas.d.ts.map +1 -0
  105. package/dist/schemas.js +102 -0
  106. package/dist/schemas.js.map +1 -0
  107. package/package.json +92 -0
  108. package/src/bootstrap/index.ts +15 -0
  109. package/src/bootstrap/seed.descriptor.ts +24 -0
  110. package/src/bootstrap/seed.impl-shape.ts +5 -0
  111. package/src/bootstrap/seed.kind.ts +26 -0
  112. package/src/bootstrap/seed.runner.ts +87 -0
  113. package/src/credentials/resolve.ts +205 -0
  114. package/src/deployment.ts +57 -0
  115. package/src/index.ts +149 -0
  116. package/src/infra.plugin.ts +54 -0
  117. package/src/kinds/alerts.kind.ts +164 -0
  118. package/src/kinds/artifact.kind.ts +96 -0
  119. package/src/kinds/cache.kind.ts +104 -0
  120. package/src/kinds/database.kind.ts +120 -0
  121. package/src/kinds/discovery.ts +26 -0
  122. package/src/kinds/git-hosting.kind.ts +100 -0
  123. package/src/kinds/index.ts +139 -0
  124. package/src/kinds/logs.kind.ts +104 -0
  125. package/src/kinds/object-storage.kind.ts +101 -0
  126. package/src/kinds/observability.kind.ts +178 -0
  127. package/src/kinds/package-registry.kind.ts +95 -0
  128. package/src/kinds/queue.kind.ts +102 -0
  129. package/src/kinds/rum.kind.ts +135 -0
  130. package/src/kinds/sandbox.kind.ts +115 -0
  131. package/src/kinds/web-app.kind.ts +103 -0
  132. package/src/kinds/worker.kind.ts +203 -0
  133. package/src/schemas.ts +127 -0
@@ -0,0 +1,128 @@
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
+ import { getVibesRuntime } from '@vibesdotdev/runtime';
27
+ /**
28
+ * Tier-aware backend selection. Mirrors the secrets/store kind's own
29
+ * resolver (`packages/secrets/src/kinds/store.kind.ts`) so callers
30
+ * don't need to import internal helpers.
31
+ */
32
+ function pickBackend(descriptors, tier) {
33
+ if (descriptors.length === 0)
34
+ return undefined;
35
+ const matches = descriptors.filter((d) => (d.tiers ?? []).includes(tier));
36
+ const pool = matches.length > 0 ? matches : descriptors;
37
+ pool.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
38
+ return pool[0];
39
+ }
40
+ function inferTier(environment, override) {
41
+ if (override)
42
+ return override;
43
+ if (environment === 'local' || environment === 'dev' || environment === 'staging' || environment === 'production') {
44
+ return environment;
45
+ }
46
+ return 'local';
47
+ }
48
+ /**
49
+ * Resolve a single credential by walking the candidate keys against
50
+ * process.env then the active secrets store. Returns the first match.
51
+ *
52
+ * Throws when no candidate resolves — adapters should let this bubble
53
+ * up so the CLI surfaces a clean "missing credentials" message rather
54
+ * than a vague "401 Unauthorized" downstream.
55
+ */
56
+ export async function resolveAdapterCredential(options) {
57
+ const env = options.environment ?? 'local';
58
+ const tier = inferTier(env, options.tier);
59
+ const includeEnv = options.includeProcessEnv ?? true;
60
+ // 1. process.env (CI / shell override)
61
+ if (includeEnv) {
62
+ for (const key of options.keyCandidates) {
63
+ const v = process.env[key];
64
+ if (v && v.length > 0) {
65
+ return { key, value: v, source: 'process.env' };
66
+ }
67
+ }
68
+ }
69
+ // 2. secrets/store runtime resolution (tier-aware, priority-ordered)
70
+ const runtime = getVibesRuntime();
71
+ if (!runtime.hasKind('secrets/store')) {
72
+ throw new Error(`No secrets/store kind registered; cannot resolve ${options.humanName ?? options.keyCandidates[0]}. ` +
73
+ 'Load the secrets plugin (and a backend like encrypted-local) before calling this adapter.');
74
+ }
75
+ const descriptors = runtime
76
+ .assets('secrets/store')
77
+ .descriptors();
78
+ // `VIBES_DEBUG_SECRETS=1` dumps the visible descriptor pool when
79
+ // you're tracing why a credential is missing or getting misrouted.
80
+ if (process.env.VIBES_DEBUG_SECRETS === '1') {
81
+ console.error(`[secrets-debug] descriptors visible at tier=${tier}:`);
82
+ for (const d of descriptors) {
83
+ console.error(` - id=${d.id} priority=${d.priority ?? '-'} tiers=${JSON.stringify(d.tiers)}`);
84
+ }
85
+ }
86
+ const target = pickBackend(descriptors, tier);
87
+ if (!target) {
88
+ throw new Error(`No secrets/store backend available for tier=${tier}. Register a backend ` +
89
+ '(encrypted-local for local, cloudflare-secrets-store for production) before calling this adapter.');
90
+ }
91
+ const store = (await runtime
92
+ .query('secrets/store')
93
+ .withId(target.id)
94
+ .resolve());
95
+ if (!store || typeof store.get !== 'function') {
96
+ throw new Error(`Resolved secrets/store '${target.id}' has no get() method for ${options.humanName ?? options.keyCandidates[0]}.`);
97
+ }
98
+ for (const key of options.keyCandidates) {
99
+ try {
100
+ const v = await store.get(env, key);
101
+ if (v && v.length > 0) {
102
+ return { key, value: v, source: target.id };
103
+ }
104
+ }
105
+ catch {
106
+ // next candidate
107
+ }
108
+ }
109
+ throw new Error(`Missing credential: none of [${options.keyCandidates.join(', ')}] resolved from process.env or ` +
110
+ `${target.id} (environment=${env}, tier=${tier}). ` +
111
+ `Set the value with \`vibes secrets set --environment ${env} ${options.keyCandidates[0]} <value>\`.`);
112
+ }
113
+ /**
114
+ * Convenience wrapper for resolving multiple credentials at once.
115
+ * Each key gets a candidate list of one (the key itself). Use the
116
+ * single-credential form when you need fallback chains.
117
+ */
118
+ export async function resolveAdapterCredentials(keys, options) {
119
+ const out = {};
120
+ for (const key of keys) {
121
+ out[key] = await resolveAdapterCredential({
122
+ keyCandidates: [key],
123
+ ...(options ?? {})
124
+ });
125
+ }
126
+ return out;
127
+ }
128
+ //# sour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CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,IAAuB,EACvB,OAA8E;IAE9E,MAAM,GAAG,GAA8C,EAAE,CAAC;IAC1D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,wBAAwB,CAAC;YACzC,aAAa,EAAE,CAAC,GAAG,CAAC;YACpB,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;SAClB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type AppDeployment, type AppDeploymentInput, type DeploymentDependency, type DeploymentEnvRequirement, type DeploymentOrigin, type DeploymentUpstream } from './schemas.ts';
2
+ export declare function createAppDeployment(input: AppDeploymentInput): AppDeployment;
3
+ export declare function createDeploymentOrigin(input: DeploymentOrigin): DeploymentOrigin;
4
+ export declare function createDeploymentEnvRequirement(input: DeploymentEnvRequirement): DeploymentEnvRequirement;
5
+ export declare function createDeploymentDependency(input: DeploymentDependency): DeploymentDependency;
6
+ export declare function getPrimaryOrigin(deployment: AppDeployment): DeploymentOrigin;
7
+ export declare function getUpstreamOriginEnv(upstream: DeploymentUpstream): Record<string, string>;
8
+ export type { AppDeployment, AppDeploymentInput, DeploymentDependency, DeploymentEnvRequirement, DeploymentOrigin, DeploymentUpstream };
9
+ //# sourceMappingURL=deployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../src/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AAEtB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAE5E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAEhF;AAED,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,wBAAwB,GAC7B,wBAAwB,CAE1B;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAE5F;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,GAAG,gBAAgB,CAI5E;AAED,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,kBAAkB,GAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB;AAED,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { appDeploymentSchema, deploymentDependencySchema, deploymentEnvRequirementSchema, deploymentOriginSchema } from "./schemas.js";
2
+ export function createAppDeployment(input) {
3
+ return appDeploymentSchema.parse(input);
4
+ }
5
+ export function createDeploymentOrigin(input) {
6
+ return deploymentOriginSchema.parse(input);
7
+ }
8
+ export function createDeploymentEnvRequirement(input) {
9
+ return deploymentEnvRequirementSchema.parse(input);
10
+ }
11
+ export function createDeploymentDependency(input) {
12
+ return deploymentDependencySchema.parse(input);
13
+ }
14
+ export function getPrimaryOrigin(deployment) {
15
+ return (deployment.origins.find((origin) => origin.kind === 'primary') ?? deployment.origins[0]);
16
+ }
17
+ export function getUpstreamOriginEnv(upstream) {
18
+ if (!upstream.originEnvVar) {
19
+ return {};
20
+ }
21
+ return {
22
+ [upstream.originEnvVar]: upstream.origin
23
+ };
24
+ }
25
+ //# sourceMappingURL=deployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment.js","sourceRoot":"","sources":["../src/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,8BAA8B,EAC9B,sBAAsB,EAOtB,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,mBAAmB,CAAC,KAAyB;IAC5D,OAAO,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAuB;IAC7D,OAAO,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC7C,KAA+B;IAE/B,OAAO,8BAA8B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAA2B;IACrE,OAAO,0BAA0B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAyB;IACzD,OAAO,CACN,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CACvF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CACnC,QAA4B;IAE5B,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO;QACN,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM;KACxC,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ export { createAppDeployment, createDeploymentOrigin, createDeploymentEnvRequirement, createDeploymentDependency, getPrimaryOrigin, getUpstreamOriginEnv } from './deployment.ts';
2
+ export type { AppDeployment, AppDeploymentInput, DeploymentDependency, DeploymentEnvRequirement, DeploymentOrigin, DeploymentUpstream } from './deployment.ts';
3
+ export { deploymentProviderSchema, appRuntimeSchema, deploymentOriginSchema, deploymentBuildSchema, deploymentEnvRequirementSchema, deploymentDependencySchema, deploymentUpstreamSchema, appDeploymentSchema } from './schemas.ts';
4
+ export type { DeploymentProvider, AppRuntime, DeploymentOrigin as DeploymentOriginType, DeploymentBuild, DeploymentEnvRequirement as DeploymentEnvRequirementType, DeploymentDependency as DeploymentDependencyType, DeploymentUpstream as DeploymentUpstreamType, AppDeploymentInput as AppDeploymentInputType, AppDeployment as AppDeploymentType } from './schemas.ts';
5
+ export { webAppKind, WebAppDescriptorSchema, WebAppConfigSchema, CloudflareWorkersWebAppConfigSchema, DigitalOceanAppWebAppConfigSchema } from './kinds/index.ts';
6
+ export type { WebAppDescriptor, WebAppDependency } from './kinds/index.ts';
7
+ export { workerKind, WorkerDescriptorSchema, WorkerConfigSchema, DoksDeploymentWorkerConfigSchema, WorkerScalingSchema } from './kinds/index.ts';
8
+ export type { WorkerDescriptor, WorkerScaling } from './kinds/index.ts';
9
+ export { databaseKind, DatabaseDescriptorSchema, DatabaseConfigSchema, DoksDatabaseConfigSchema, DOManagedPostgresConfigSchema, TursoDatabaseConfigSchema, CloudflareD1ConfigSchema, DatabaseBackupSchema } from './kinds/index.ts';
10
+ export type { DatabaseDescriptor, DatabaseBackup } from './kinds/index.ts';
11
+ export { queueKind, QueueDescriptorSchema, QueueConfigSchema, DoksQueueConfigSchema, QueueTopicSchema } from './kinds/index.ts';
12
+ export type { QueueDescriptor, QueueTopic } from './kinds/index.ts';
13
+ export { cacheKind, CacheDescriptorSchema, CacheConfigSchema, DOManagedRedisConfigSchema } from './kinds/index.ts';
14
+ export type { CacheDescriptor } from './kinds/index.ts';
15
+ export { objectStorageKind, ObjectStorageDescriptorSchema, ObjectStorageConfigSchema, DOSpacesConfigSchema, CorsRuleSchema, LifecycleRuleSchema } from './kinds/index.ts';
16
+ export type { ObjectStorageDescriptor, CorsRule, LifecycleRule } from './kinds/index.ts';
17
+ export { sandboxKind, SandboxDescriptorSchema, SandboxConfigSchema, CloudflareSandboxConfigSchema, DockerSandboxConfigSchema, DigitalOceanDropletSandboxConfigSchema, SandboxOutboundProxySchema, SandboxResourceLimitsSchema } from './kinds/index.ts';
18
+ export type { SandboxDescriptor, SandboxOutboundProxy, SandboxResourceLimits } from './kinds/index.ts';
19
+ export { gitHostingKind, GitHostingDescriptorSchema, GitHostingConfigSchema, GiteaDoksGitHostingConfigSchema, GitHostingTypeSchema, GitHostingAuthMethodSchema } from './kinds/index.ts';
20
+ export type { GitHostingDescriptor, GitHostingType, GitHostingAuthMethod } from './kinds/index.ts';
21
+ export { packageRegistryKind, PackageRegistryDescriptorSchema, PackageRegistryConfigSchema, VerdaccioDoksPackageRegistryConfigSchema, PackageRegistryTypeSchema } from './kinds/index.ts';
22
+ export type { PackageRegistryDescriptor, PackageRegistryType } from './kinds/index.ts';
23
+ export { logsKind, InfraLogsDescriptorSchema, type InfraLogsDescriptor, type InfraLogsDescriptorInput, type InfraLogsKind, type InfraLogsKindInput, type LogsImplementation } from './kinds/index.ts';
24
+ export { artifactKind, ArtifactDescriptorSchema, type ArtifactDescriptor, type ArtifactGenerator, type ArtifactOutput } from './kinds/index.ts';
25
+ export { INFRA_DISCOVERY_PATTERN, extractStem } from './kinds/index.ts';
26
+ export { alertsKind, InfraAlertsDescriptorSchema, AlertPolicySchema, AlertMechanismSchema, AlertTypeSchema, AlertWindowSchema, type InfraAlertsDescriptor, type InfraAlertsDescriptorInput, type InfraAlertsKind, type InfraAlertsKindInput, type AlertsImplementation, type AlertPolicy, type AlertMechanism, type AlertType } from './kinds/index.ts';
27
+ export { observabilityKind, InfraObservabilityDescriptorSchema, ObservabilityScopeSchema, ObservabilitySettingsSchema, type InfraObservabilityDescriptor, type InfraObservabilityDescriptorInput, type InfraObservabilityKind, type InfraObservabilityKindInput, type ObservabilityImplementation, type ObservabilityScope, type ObservabilitySettings, type ObservabilitySnapshot, type SetObservabilityInput, type SetObservabilityResult } from './kinds/index.ts';
28
+ export { rumKind, InfraRumDescriptorSchema, RumPrivacySchema, RumInjectionSchema, type InfraRumDescriptor, type InfraRumDescriptorInput, type InfraRumKind, type InfraRumKindInput, type RumImplementation, type RumSiteSnapshot, type RumPrivacy, type RumInjection } from './kinds/index.ts';
29
+ export { resolveAdapterCredential, resolveAdapterCredentials, type EnvironmentTier, type ResolveAdapterCredentialOptions, type ResolvedAdapterCredential } from './credentials/resolve.ts';
30
+ export { bootstrapSeedKind, bootstrapSeedConditionSchema, bootstrapSeedDescriptorSchema, bootstrapSeedModeSchema, runBootstrapSeeds, type BootstrapSeedCondition, type BootstrapSeedDescriptor, type BootstrapSeedImpl, type BootstrapSeedMode, type BootstrapSeedRunOptions, type BootstrapSeedRunResult } from './bootstrap/index.ts';
31
+ export { default as infraPlugin } from './infra.plugin';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EACX,kBAAkB,EAClB,UAAU,EACV,gBAAgB,IAAI,oBAAoB,EACxC,eAAe,EACf,wBAAwB,IAAI,4BAA4B,EACxD,oBAAoB,IAAI,wBAAwB,EAChD,kBAAkB,IAAI,sBAAsB,EAC5C,kBAAkB,IAAI,sBAAsB,EAC5C,aAAa,IAAI,iBAAiB,EAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,UAAU,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,mCAAmC,EAAE,iCAAiC,EAC9H,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAA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,EAC1B,KAAK,sBAAsB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,OAAO,EACP,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,iBAAiB,EACjB,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ export { createAppDeployment, createDeploymentOrigin, createDeploymentEnvRequirement, createDeploymentDependency, getPrimaryOrigin, getUpstreamOriginEnv } from "./deployment.js";
2
+ export { deploymentProviderSchema, appRuntimeSchema, deploymentOriginSchema, deploymentBuildSchema, deploymentEnvRequirementSchema, deploymentDependencySchema, deploymentUpstreamSchema, appDeploymentSchema } from "./schemas.js";
3
+ export { webAppKind, WebAppDescriptorSchema, WebAppConfigSchema, CloudflareWorkersWebAppConfigSchema, DigitalOceanAppWebAppConfigSchema } from "./kinds/index.js";
4
+ export { workerKind, WorkerDescriptorSchema, WorkerConfigSchema, DoksDeploymentWorkerConfigSchema, WorkerScalingSchema } from "./kinds/index.js";
5
+ export { databaseKind, DatabaseDescriptorSchema, DatabaseConfigSchema, DoksDatabaseConfigSchema, DOManagedPostgresConfigSchema, TursoDatabaseConfigSchema, CloudflareD1ConfigSchema, DatabaseBackupSchema } from "./kinds/index.js";
6
+ export { queueKind, QueueDescriptorSchema, QueueConfigSchema, DoksQueueConfigSchema, QueueTopicSchema } from "./kinds/index.js";
7
+ export { cacheKind, CacheDescriptorSchema, CacheConfigSchema, DOManagedRedisConfigSchema } from "./kinds/index.js";
8
+ export { objectStorageKind, ObjectStorageDescriptorSchema, ObjectStorageConfigSchema, DOSpacesConfigSchema, CorsRuleSchema, LifecycleRuleSchema } from "./kinds/index.js";
9
+ export { sandboxKind, SandboxDescriptorSchema, SandboxConfigSchema, CloudflareSandboxConfigSchema, DockerSandboxConfigSchema, DigitalOceanDropletSandboxConfigSchema, SandboxOutboundProxySchema, SandboxResourceLimitsSchema } from "./kinds/index.js";
10
+ export { gitHostingKind, GitHostingDescriptorSchema, GitHostingConfigSchema, GiteaDoksGitHostingConfigSchema, GitHostingTypeSchema, GitHostingAuthMethodSchema } from "./kinds/index.js";
11
+ export { packageRegistryKind, PackageRegistryDescriptorSchema, PackageRegistryConfigSchema, VerdaccioDoksPackageRegistryConfigSchema, PackageRegistryTypeSchema } from "./kinds/index.js";
12
+ export { logsKind, InfraLogsDescriptorSchema } from "./kinds/index.js";
13
+ export { artifactKind, ArtifactDescriptorSchema } from "./kinds/index.js";
14
+ export { INFRA_DISCOVERY_PATTERN, extractStem } from "./kinds/index.js";
15
+ export { alertsKind, InfraAlertsDescriptorSchema, AlertPolicySchema, AlertMechanismSchema, AlertTypeSchema, AlertWindowSchema } from "./kinds/index.js";
16
+ export { observabilityKind, InfraObservabilityDescriptorSchema, ObservabilityScopeSchema, ObservabilitySettingsSchema } from "./kinds/index.js";
17
+ export { rumKind, InfraRumDescriptorSchema, RumPrivacySchema, RumInjectionSchema } from "./kinds/index.js";
18
+ export { resolveAdapterCredential, resolveAdapterCredentials } from "./credentials/resolve.js";
19
+ export { bootstrapSeedKind, bootstrapSeedConditionSchema, bootstrapSeedDescriptorSchema, bootstrapSeedModeSchema, runBootstrapSeeds } from "./bootstrap/index.js";
20
+ export { default as infraPlugin } from './infra.plugin';
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AASzB,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AAYtB,OAAO,EACN,UAAU,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,mCAAmC,EAAE,iCAAiC,EAC9H,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,UAAU,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,mBAAmB,EAC7G,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,oBAAoB,EAChM,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,SAAS,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAC5F,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnH,OAAO,EACN,iBAAiB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EACtI,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,WAAW,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,2BAA2B,EACpN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,cAAc,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,0BAA0B,EACrJ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,mBAAmB,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,wCAAwC,EAAE,yBAAyB,EACtJ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,QAAQ,EAAE,yBAAyB,EACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,YAAY,EACZ,wBAAwB,EAIxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACN,UAAU,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EASjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iBAAiB,EACjB,kCAAkC,EAClC,wBAAwB,EACxB,2BAA2B,EAW3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,OAAO,EACP,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EASlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EAIzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,iBAAiB,EACjB,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,iBAAiB,EAOjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Infrastructure Runtime Plugin
3
+ *
4
+ * Registers all infra resource kinds with the runtime.
5
+ */
6
+ /**
7
+ * Note on layering: inference is an apps/ai domain concern, not an infra kind.
8
+ * Existing runtime kinds `ai/provider`, `ai/adapter`, `ai/model`, and
9
+ * `ai/generation` already express "who/how/where inference runs", and the
10
+ * runtime's hardware scope + connectionMode qualifier + priority already
11
+ * select between consumer-direct, consumer-worker, cloud-worker, and
12
+ * cloud-via-API strategies. New strategies (CF Unified Inference, Agents
13
+ * Week bindings) should be added as new `ai/provider` descriptors + adapters,
14
+ * not as a parallel `infra/inference` kind.
15
+ */
16
+ declare const _default: import("@vibesdotdev/runtime").RuntimePlugin;
17
+ export default _default;
18
+ //# sourceMappingURL=infra.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra.plugin.d.ts","sourceRoot":"","sources":["../src/infra.plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;;;;;;;;GASG;;AAEH,wBAoBG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Infrastructure Runtime Plugin
3
+ *
4
+ * Registers all infra resource kinds with the runtime.
5
+ */
6
+ import { createRuntimePlugin } from '@vibesdotdev/runtime/factory/plugin';
7
+ import { webAppKind } from './kinds/web-app.kind';
8
+ import { workerKind } from './kinds/worker.kind';
9
+ import { databaseKind } from './kinds/database.kind';
10
+ import { queueKind } from './kinds/queue.kind';
11
+ import { cacheKind } from './kinds/cache.kind';
12
+ import { objectStorageKind } from './kinds/object-storage.kind';
13
+ import { sandboxKind } from './kinds/sandbox.kind';
14
+ import { gitHostingKind } from './kinds/git-hosting.kind';
15
+ import { packageRegistryKind } from './kinds/package-registry.kind';
16
+ import { logsKind } from './kinds/logs.kind';
17
+ import { alertsKind } from "./kinds/alerts.kind.js";
18
+ import { observabilityKind } from "./kinds/observability.kind.js";
19
+ import { rumKind } from "./kinds/rum.kind.js";
20
+ import { bootstrapSeedKind } from "./bootstrap/index.js";
21
+ /**
22
+ * Note on layering: inference is an apps/ai domain concern, not an infra kind.
23
+ * Existing runtime kinds `ai/provider`, `ai/adapter`, `ai/model`, and
24
+ * `ai/generation` already express "who/how/where inference runs", and the
25
+ * runtime's hardware scope + connectionMode qualifier + priority already
26
+ * select between consumer-direct, consumer-worker, cloud-worker, and
27
+ * cloud-via-API strategies. New strategies (CF Unified Inference, Agents
28
+ * Week bindings) should be added as new `ai/provider` descriptors + adapters,
29
+ * not as a parallel `infra/inference` kind.
30
+ */
31
+ export default createRuntimePlugin({
32
+ id: 'infra',
33
+ name: 'Infrastructure',
34
+ description: 'Resource kinds for deployable infrastructure',
35
+ kinds: [
36
+ webAppKind,
37
+ workerKind,
38
+ databaseKind,
39
+ queueKind,
40
+ cacheKind,
41
+ objectStorageKind,
42
+ sandboxKind,
43
+ gitHostingKind,
44
+ packageRegistryKind,
45
+ logsKind,
46
+ alertsKind,
47
+ observabilityKind,
48
+ rumKind,
49
+ bootstrapSeedKind
50
+ ]
51
+ });
52
+ //# sourceMappingURL=infra.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra.plugin.js","sourceRoot":"","sources":["../src/infra.plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;;GASG;AAEH,eAAe,mBAAmB,CAAC;IAClC,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE;QACN,UAAU;QACV,UAAU;QACV,YAAY;QACZ,SAAS;QACT,SAAS;QACT,iBAAiB;QACjB,WAAW;QACX,cAAc;QACd,mBAAmB;QACnB,QAAQ;QACR,UAAU;QACV,iBAAiB;QACjB,OAAO;QACP,iBAAiB;KACjB;CACD,CAAC,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Infra Alerts Kind
3
+ *
4
+ * Provider-agnostic schema for alerting / notification policies that
5
+ * span billing (budget + per-product usage), reliability (error rate,
6
+ * latency), and operational lifecycle (deploys, subscription changes).
7
+ *
8
+ * Per-provider implementations (cloudflare-alerts, do-monitoring,
9
+ * cloudwatch-alarms) map this shape onto the native API. Where a
10
+ * provider doesn't support a `type`, the impl rejects with a clear
11
+ * "unsupported" error rather than silently falling back.
12
+ *
13
+ * Configuration is declarative — typically encoded in an
14
+ * `infra/account.config.ts` or `infra/alerts.infra.ts` file alongside
15
+ * `infra/dns.ts`. The CLI (`vibes infra alerts list|create|delete`)
16
+ * wraps the same primitive for one-off ops and drift detection.
17
+ */
18
+ import * as z from 'zod/v4';
19
+ /**
20
+ * Delivery channel for an alert. Provider impls translate these to
21
+ * native delivery slots (e.g. CF's `mechanisms.email[]`).
22
+ */
23
+ declare const AlertMechanismSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ kind: z.ZodLiteral<"email">;
25
+ target: z.ZodEmail;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"webhook">;
28
+ target: z.ZodString;
29
+ secretRef: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"pagerduty">;
32
+ target: z.ZodString;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"slack">;
35
+ target: z.ZodString;
36
+ }, z.core.$strip>], "kind">;
37
+ export type AlertMechanism = z.infer<typeof AlertMechanismSchema>;
38
+ /**
39
+ * Cross-provider alert categories. Each maps to one or more native
40
+ * alert types per provider.
41
+ */
42
+ declare const AlertTypeSchema: z.ZodEnum<{
43
+ custom: "custom";
44
+ budget: "budget";
45
+ usage: "usage";
46
+ "error-rate": "error-rate";
47
+ latency: "latency";
48
+ }>;
49
+ export type AlertType = z.infer<typeof AlertTypeSchema>;
50
+ declare const AlertWindowSchema: z.ZodEnum<{
51
+ "5m": "5m";
52
+ "15m": "15m";
53
+ "1h": "1h";
54
+ "6h": "6h";
55
+ "24h": "24h";
56
+ "7d": "7d";
57
+ "30d": "30d";
58
+ }>;
59
+ declare const AlertPolicySchema: z.ZodObject<{
60
+ id: z.ZodOptional<z.ZodString>;
61
+ name: z.ZodString;
62
+ type: z.ZodEnum<{
63
+ custom: "custom";
64
+ budget: "budget";
65
+ usage: "usage";
66
+ "error-rate": "error-rate";
67
+ latency: "latency";
68
+ }>;
69
+ threshold: z.ZodNumber;
70
+ warningThreshold: z.ZodOptional<z.ZodNumber>;
71
+ window: z.ZodOptional<z.ZodEnum<{
72
+ "5m": "5m";
73
+ "15m": "15m";
74
+ "1h": "1h";
75
+ "6h": "6h";
76
+ "24h": "24h";
77
+ "7d": "7d";
78
+ "30d": "30d";
79
+ }>>;
80
+ filters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
81
+ mechanisms: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
82
+ kind: z.ZodLiteral<"email">;
83
+ target: z.ZodEmail;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ kind: z.ZodLiteral<"webhook">;
86
+ target: z.ZodString;
87
+ secretRef: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"pagerduty">;
90
+ target: z.ZodString;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ kind: z.ZodLiteral<"slack">;
93
+ target: z.ZodString;
94
+ }, z.core.$strip>], "kind">>;
95
+ enabled: z.ZodDefault<z.ZodBoolean>;
96
+ description: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strip>;
98
+ export type AlertPolicy = z.infer<typeof AlertPolicySchema>;
99
+ declare const AlertsBaseSchema: z.ZodObject<{
100
+ id: z.ZodString;
101
+ name: z.ZodOptional<z.ZodString>;
102
+ description: z.ZodOptional<z.ZodString>;
103
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ enabled: z.ZodOptional<z.ZodBoolean>;
106
+ priority: z.ZodOptional<z.ZodNumber>;
107
+ requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
110
+ kind: z.ZodLiteral<"infra/alerts">;
111
+ adapter: z.ZodString;
112
+ adapterConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
+ environment: z.ZodDefault<z.ZodString>;
114
+ policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
115
+ id: z.ZodOptional<z.ZodString>;
116
+ name: z.ZodString;
117
+ type: z.ZodEnum<{
118
+ custom: "custom";
119
+ budget: "budget";
120
+ usage: "usage";
121
+ "error-rate": "error-rate";
122
+ latency: "latency";
123
+ }>;
124
+ threshold: z.ZodNumber;
125
+ warningThreshold: z.ZodOptional<z.ZodNumber>;
126
+ window: z.ZodOptional<z.ZodEnum<{
127
+ "5m": "5m";
128
+ "15m": "15m";
129
+ "1h": "1h";
130
+ "6h": "6h";
131
+ "24h": "24h";
132
+ "7d": "7d";
133
+ "30d": "30d";
134
+ }>>;
135
+ filters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
136
+ mechanisms: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ kind: z.ZodLiteral<"email">;
138
+ target: z.ZodEmail;
139
+ }, z.core.$strip>, z.ZodObject<{
140
+ kind: z.ZodLiteral<"webhook">;
141
+ target: z.ZodString;
142
+ secretRef: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>, z.ZodObject<{
144
+ kind: z.ZodLiteral<"pagerduty">;
145
+ target: z.ZodString;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ kind: z.ZodLiteral<"slack">;
148
+ target: z.ZodString;
149
+ }, z.core.$strip>], "kind">>;
150
+ enabled: z.ZodDefault<z.ZodBoolean>;
151
+ description: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>>>;
153
+ }, z.core.$strip>;
154
+ export type InfraAlertsDescriptor = z.infer<typeof AlertsBaseSchema>;
155
+ export type InfraAlertsDescriptorInput = z.input<typeof AlertsBaseSchema>;
156
+ /**
157
+ * Implementation contract every provider implements. Operations are
158
+ * idempotent: `applyPolicies` reconciles the live policy set to the
159
+ * desired set without trampling unrelated policies on the provider.
160
+ */
161
+ export interface AlertsImplementation {
162
+ /** List policies currently configured on the provider. */
163
+ listPolicies(): Promise<Array<AlertPolicy & {
164
+ providerId: string;
165
+ }>>;
166
+ /** Create a single policy. Returns the provider-assigned id. */
167
+ createPolicy(policy: AlertPolicy): Promise<{
168
+ providerId: string;
169
+ }>;
170
+ /** Delete a policy by provider id. */
171
+ deletePolicy(providerId: string): Promise<void>;
172
+ /**
173
+ * Diff desired (descriptor) against live; return the set of policies
174
+ * that need create/update/delete. Empty arrays = in sync.
175
+ */
176
+ diff(desired: AlertPolicy[]): Promise<{
177
+ create: AlertPolicy[];
178
+ update: Array<{
179
+ providerId: string;
180
+ policy: AlertPolicy;
181
+ }>;
182
+ delete: Array<{
183
+ providerId: string;
184
+ name: string;
185
+ }>;
186
+ }>;
187
+ }
188
+ export declare const alertsKind: import("@vibesdotdev/runtime").RuntimeKindDescriptorRecord<AlertsImplementation>;
189
+ export type InfraAlertsKind = InfraAlertsDescriptor;
190
+ export type InfraAlertsKindInput = InfraAlertsDescriptorInput;
191
+ export { AlertsBaseSchema as InfraAlertsDescriptorSchema, AlertPolicySchema, AlertMechanismSchema, AlertTypeSchema, AlertWindowSchema };
192
+ //# sourceMappingURL=alerts.kind.d.ts.map
@@ -0,0 +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;AAK5B;;;GAGG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;2BAuBxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,QAAA,MAAM,eAAe;;;;;;EAWnB,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,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcpB,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC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