@vibesdotdev/infra-core 0.0.2 → 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.
Files changed (331) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +28 -1
  3. package/dist/bootstrap/seed.descriptor.d.ts +1 -1
  4. package/dist/bootstrap/seed.descriptor.d.ts.map +1 -1
  5. package/dist/bootstrap/seed.descriptor.js +1 -1
  6. package/dist/bootstrap/seed.descriptor.js.map +1 -1
  7. package/dist/bootstrap/seed.impl-shape.d.ts +1 -1
  8. package/dist/bootstrap/seed.impl-shape.d.ts.map +1 -1
  9. package/dist/bootstrap/seed.kind.d.ts +1 -3
  10. package/dist/bootstrap/seed.kind.d.ts.map +1 -1
  11. package/dist/bootstrap/seed.kind.js +17 -4
  12. package/dist/bootstrap/seed.kind.js.map +1 -1
  13. package/dist/bootstrap/seed.runner.d.ts +9 -2
  14. package/dist/bootstrap/seed.runner.d.ts.map +1 -1
  15. package/dist/bootstrap/seed.runner.js +37 -18
  16. package/dist/bootstrap/seed.runner.js.map +1 -1
  17. package/dist/capped-id.d.ts +19 -0
  18. package/dist/capped-id.d.ts.map +1 -0
  19. package/dist/capped-id.js +64 -0
  20. package/dist/capped-id.js.map +1 -0
  21. package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts +23 -0
  22. package/dist/cli/generate/artifact/artifact.cli-command.descriptor.d.ts.map +1 -0
  23. package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js +33 -0
  24. package/dist/cli/generate/artifact/artifact.cli-command.descriptor.js.map +1 -0
  25. package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts +24 -0
  26. package/dist/cli/generate/artifact/artifact.cli-command.impl.d.ts.map +1 -0
  27. package/dist/cli/generate/artifact/artifact.cli-command.impl.js +73 -0
  28. package/dist/cli/generate/artifact/artifact.cli-command.impl.js.map +1 -0
  29. package/dist/cli/generate/context.d.ts +17 -0
  30. package/dist/cli/generate/context.d.ts.map +1 -0
  31. package/dist/cli/generate/context.js +24 -0
  32. package/dist/cli/generate/context.js.map +1 -0
  33. package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts +30 -0
  34. package/dist/cli/generate/generate/generate.cli-command.descriptor.d.ts.map +1 -0
  35. package/dist/cli/generate/generate/generate.cli-command.descriptor.js +25 -0
  36. package/dist/cli/generate/generate/generate.cli-command.descriptor.js.map +1 -0
  37. package/dist/cli/generate/generate/generate.cli-command.impl.d.ts +25 -0
  38. package/dist/cli/generate/generate/generate.cli-command.impl.d.ts.map +1 -0
  39. package/dist/cli/generate/generate/generate.cli-command.impl.js +64 -0
  40. package/dist/cli/generate/generate/generate.cli-command.impl.js.map +1 -0
  41. package/dist/cli/generate/generate-core.d.ts +51 -0
  42. package/dist/cli/generate/generate-core.d.ts.map +1 -0
  43. package/dist/cli/generate/generate-core.js +172 -0
  44. package/dist/cli/generate/generate-core.js.map +1 -0
  45. package/dist/cli/generate/index.d.ts +5 -0
  46. package/dist/cli/generate/index.d.ts.map +1 -0
  47. package/dist/cli/generate/index.js +5 -0
  48. package/dist/cli/generate/index.js.map +1 -0
  49. package/dist/credentials/resolve.d.ts +82 -22
  50. package/dist/credentials/resolve.d.ts.map +1 -1
  51. package/dist/credentials/resolve.js +251 -77
  52. package/dist/credentials/resolve.js.map +1 -1
  53. package/dist/deployment-budget.d.ts +319 -0
  54. package/dist/deployment-budget.d.ts.map +1 -0
  55. package/dist/deployment-budget.js +660 -0
  56. package/dist/deployment-budget.js.map +1 -0
  57. package/dist/deployment-environment.d.ts +30 -0
  58. package/dist/deployment-environment.d.ts.map +1 -0
  59. package/dist/deployment-environment.js +53 -0
  60. package/dist/deployment-environment.js.map +1 -0
  61. package/dist/deployment-graph.d.ts +185 -0
  62. package/dist/deployment-graph.d.ts.map +1 -0
  63. package/dist/deployment-graph.js +705 -0
  64. package/dist/deployment-graph.js.map +1 -0
  65. package/dist/deployment.d.ts +25 -4
  66. package/dist/deployment.d.ts.map +1 -1
  67. package/dist/deployment.js +105 -0
  68. package/dist/deployment.js.map +1 -1
  69. package/dist/doks/cloud/base.d.ts +49 -0
  70. package/dist/doks/cloud/base.d.ts.map +1 -0
  71. package/dist/doks/cloud/base.js +138 -0
  72. package/dist/doks/cloud/base.js.map +1 -0
  73. package/dist/doks/cloud/factory.d.ts +18 -0
  74. package/dist/doks/cloud/factory.d.ts.map +1 -0
  75. package/dist/doks/cloud/factory.js +22 -0
  76. package/dist/doks/cloud/factory.js.map +1 -0
  77. package/dist/doks/cloud/index.d.ts +5 -0
  78. package/dist/doks/cloud/index.d.ts.map +1 -0
  79. package/dist/doks/cloud/index.js +4 -0
  80. package/dist/doks/cloud/index.js.map +1 -0
  81. package/dist/doks/types.d.ts +95 -0
  82. package/dist/doks/types.d.ts.map +1 -0
  83. package/dist/doks/types.js +14 -0
  84. package/dist/doks/types.js.map +1 -0
  85. package/dist/generate/index.d.ts +29 -0
  86. package/dist/generate/index.d.ts.map +1 -0
  87. package/dist/generate/index.js +28 -0
  88. package/dist/generate/index.js.map +1 -0
  89. package/dist/generate/infra-generate.plugin.d.ts +3 -0
  90. package/dist/generate/infra-generate.plugin.d.ts.map +1 -0
  91. package/dist/generate/infra-generate.plugin.js +23 -0
  92. package/dist/generate/infra-generate.plugin.js.map +1 -0
  93. package/dist/generate/plugin.d.ts +2 -0
  94. package/dist/generate/plugin.d.ts.map +1 -0
  95. package/dist/generate/plugin.js +2 -0
  96. package/dist/generate/plugin.js.map +1 -0
  97. package/dist/heartbeat/cron-heartbeat.d.ts +97 -0
  98. package/dist/heartbeat/cron-heartbeat.d.ts.map +1 -0
  99. package/dist/heartbeat/cron-heartbeat.js +200 -0
  100. package/dist/heartbeat/cron-heartbeat.js.map +1 -0
  101. package/dist/index.d.ts +37 -22
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +29 -14
  104. package/dist/index.js.map +1 -1
  105. package/dist/infra.plugin.d.ts +1 -1
  106. package/dist/infra.plugin.d.ts.map +1 -1
  107. package/dist/infra.plugin.js +64 -12
  108. package/dist/infra.plugin.js.map +1 -1
  109. package/dist/kinds/alerts.kind.d.ts +64 -25
  110. package/dist/kinds/alerts.kind.d.ts.map +1 -1
  111. package/dist/kinds/alerts.kind.js +43 -16
  112. package/dist/kinds/alerts.kind.js.map +1 -1
  113. package/dist/kinds/artifact.kind.d.ts +58 -10
  114. package/dist/kinds/artifact.kind.d.ts.map +1 -1
  115. package/dist/kinds/artifact.kind.js +26 -9
  116. package/dist/kinds/artifact.kind.js.map +1 -1
  117. package/dist/kinds/billing.kind.d.ts +88 -0
  118. package/dist/kinds/billing.kind.d.ts.map +1 -0
  119. package/dist/kinds/billing.kind.js +48 -0
  120. package/dist/kinds/billing.kind.js.map +1 -0
  121. package/dist/kinds/build-job.kind.d.ts +383 -0
  122. package/dist/kinds/build-job.kind.d.ts.map +1 -0
  123. package/dist/kinds/build-job.kind.js +218 -0
  124. package/dist/kinds/build-job.kind.js.map +1 -0
  125. package/dist/kinds/cache-byte-store.d.ts +23 -0
  126. package/dist/kinds/cache-byte-store.d.ts.map +1 -0
  127. package/dist/kinds/cache-byte-store.js +9 -0
  128. package/dist/kinds/cache-byte-store.js.map +1 -0
  129. package/dist/kinds/cache.kind.d.ts +38 -94
  130. package/dist/kinds/cache.kind.d.ts.map +1 -1
  131. package/dist/kinds/cache.kind.js +39 -50
  132. package/dist/kinds/cache.kind.js.map +1 -1
  133. package/dist/kinds/cluster.kind.d.ts +154 -0
  134. package/dist/kinds/cluster.kind.d.ts.map +1 -0
  135. package/dist/kinds/cluster.kind.js +99 -0
  136. package/dist/kinds/cluster.kind.js.map +1 -0
  137. package/dist/kinds/compute-source.kind.d.ts +155 -0
  138. package/dist/kinds/compute-source.kind.d.ts.map +1 -0
  139. package/dist/kinds/compute-source.kind.js +158 -0
  140. package/dist/kinds/compute-source.kind.js.map +1 -0
  141. package/dist/kinds/container-registry.kind.d.ts +62 -0
  142. package/dist/kinds/container-registry.kind.d.ts.map +1 -0
  143. package/dist/kinds/container-registry.kind.js +47 -0
  144. package/dist/kinds/container-registry.kind.js.map +1 -0
  145. package/dist/kinds/database-migrator.kind.d.ts +6 -0
  146. package/dist/kinds/database-migrator.kind.d.ts.map +1 -0
  147. package/dist/kinds/database-migrator.kind.js +28 -0
  148. package/dist/kinds/database-migrator.kind.js.map +1 -0
  149. package/dist/kinds/database.kind.d.ts +114 -93
  150. package/dist/kinds/database.kind.d.ts.map +1 -1
  151. package/dist/kinds/database.kind.js +93 -54
  152. package/dist/kinds/database.kind.js.map +1 -1
  153. package/dist/kinds/deployment-provider.kind.d.ts +5 -0
  154. package/dist/kinds/deployment-provider.kind.d.ts.map +1 -0
  155. package/dist/kinds/deployment-provider.kind.js +11 -0
  156. package/dist/kinds/deployment-provider.kind.js.map +1 -0
  157. package/dist/kinds/discovery.d.ts +5 -12
  158. package/dist/kinds/discovery.d.ts.map +1 -1
  159. package/dist/kinds/discovery.js +5 -17
  160. package/dist/kinds/discovery.js.map +1 -1
  161. package/dist/kinds/dns.kind.d.ts +162 -0
  162. package/dist/kinds/dns.kind.d.ts.map +1 -0
  163. package/dist/kinds/dns.kind.js +54 -0
  164. package/dist/kinds/dns.kind.js.map +1 -0
  165. package/dist/kinds/drift.kind.d.ts +115 -0
  166. package/dist/kinds/drift.kind.d.ts.map +1 -0
  167. package/dist/kinds/drift.kind.js +60 -0
  168. package/dist/kinds/drift.kind.js.map +1 -0
  169. package/dist/kinds/edge-hostname.kind.d.ts +124 -0
  170. package/dist/kinds/edge-hostname.kind.d.ts.map +1 -0
  171. package/dist/kinds/edge-hostname.kind.js +87 -0
  172. package/dist/kinds/edge-hostname.kind.js.map +1 -0
  173. package/dist/kinds/edge-tls.kind.d.ts +194 -0
  174. package/dist/kinds/edge-tls.kind.d.ts.map +1 -0
  175. package/dist/kinds/edge-tls.kind.js +58 -0
  176. package/dist/kinds/edge-tls.kind.js.map +1 -0
  177. package/dist/kinds/firewall.kind.d.ts +92 -0
  178. package/dist/kinds/firewall.kind.d.ts.map +1 -0
  179. package/dist/kinds/firewall.kind.js +59 -0
  180. package/dist/kinds/firewall.kind.js.map +1 -0
  181. package/dist/kinds/git-hosting.kind.d.ts +36 -38
  182. package/dist/kinds/git-hosting.kind.d.ts.map +1 -1
  183. package/dist/kinds/git-hosting.kind.js +21 -32
  184. package/dist/kinds/git-hosting.kind.js.map +1 -1
  185. package/dist/kinds/index.d.ts +41 -15
  186. package/dist/kinds/index.d.ts.map +1 -1
  187. package/dist/kinds/index.js +40 -14
  188. package/dist/kinds/index.js.map +1 -1
  189. package/dist/kinds/inventory.kind.d.ts +245 -0
  190. package/dist/kinds/inventory.kind.d.ts.map +1 -0
  191. package/dist/kinds/inventory.kind.js +243 -0
  192. package/dist/kinds/inventory.kind.js.map +1 -0
  193. package/dist/kinds/load-balancer.kind.d.ts +135 -0
  194. package/dist/kinds/load-balancer.kind.d.ts.map +1 -0
  195. package/dist/kinds/load-balancer.kind.js +71 -0
  196. package/dist/kinds/load-balancer.kind.js.map +1 -0
  197. package/dist/kinds/logs.kind.d.ts +74 -3
  198. package/dist/kinds/logs.kind.d.ts.map +1 -1
  199. package/dist/kinds/logs.kind.js +26 -17
  200. package/dist/kinds/logs.kind.js.map +1 -1
  201. package/dist/kinds/nfs.kind.d.ts +67 -0
  202. package/dist/kinds/nfs.kind.d.ts.map +1 -0
  203. package/dist/kinds/nfs.kind.js +45 -0
  204. package/dist/kinds/nfs.kind.js.map +1 -0
  205. package/dist/kinds/node-pool.kind.d.ts +134 -0
  206. package/dist/kinds/node-pool.kind.d.ts.map +1 -0
  207. package/dist/kinds/node-pool.kind.js +88 -0
  208. package/dist/kinds/node-pool.kind.js.map +1 -0
  209. package/dist/kinds/object-storage.kind.d.ts +50 -24
  210. package/dist/kinds/object-storage.kind.d.ts.map +1 -1
  211. package/dist/kinds/object-storage.kind.js +40 -23
  212. package/dist/kinds/object-storage.kind.js.map +1 -1
  213. package/dist/kinds/observability.kind.d.ts +104 -6
  214. package/dist/kinds/observability.kind.d.ts.map +1 -1
  215. package/dist/kinds/observability.kind.js +67 -9
  216. package/dist/kinds/observability.kind.js.map +1 -1
  217. package/dist/kinds/package-registry.kind.d.ts +139 -33
  218. package/dist/kinds/package-registry.kind.d.ts.map +1 -1
  219. package/dist/kinds/package-registry.kind.js +55 -25
  220. package/dist/kinds/package-registry.kind.js.map +1 -1
  221. package/dist/kinds/queue.kind.d.ts +67 -63
  222. package/dist/kinds/queue.kind.d.ts.map +1 -1
  223. package/dist/kinds/queue.kind.js +55 -33
  224. package/dist/kinds/queue.kind.js.map +1 -1
  225. package/dist/kinds/read-descriptor.d.ts +15 -0
  226. package/dist/kinds/read-descriptor.d.ts.map +1 -0
  227. package/dist/kinds/read-descriptor.js +11 -0
  228. package/dist/kinds/read-descriptor.js.map +1 -0
  229. package/dist/kinds/rum.kind.d.ts +36 -6
  230. package/dist/kinds/rum.kind.d.ts.map +1 -1
  231. package/dist/kinds/rum.kind.js +6 -7
  232. package/dist/kinds/rum.kind.js.map +1 -1
  233. package/dist/kinds/sandbox.kind.d.ts +136 -40
  234. package/dist/kinds/sandbox.kind.d.ts.map +1 -1
  235. package/dist/kinds/sandbox.kind.js +82 -43
  236. package/dist/kinds/sandbox.kind.js.map +1 -1
  237. package/dist/kinds/select-compute-source.d.ts +72 -0
  238. package/dist/kinds/select-compute-source.d.ts.map +1 -0
  239. package/dist/kinds/select-compute-source.js +170 -0
  240. package/dist/kinds/select-compute-source.js.map +1 -0
  241. package/dist/kinds/service-release.kind.d.ts +771 -0
  242. package/dist/kinds/service-release.kind.d.ts.map +1 -0
  243. package/dist/kinds/service-release.kind.js +676 -0
  244. package/dist/kinds/service-release.kind.js.map +1 -0
  245. package/dist/kinds/spend-guard.kind.d.ts +41 -0
  246. package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
  247. package/dist/kinds/spend-guard.kind.js +140 -0
  248. package/dist/kinds/spend-guard.kind.js.map +1 -0
  249. package/dist/kinds/utilization.kind.d.ts +88 -0
  250. package/dist/kinds/utilization.kind.d.ts.map +1 -0
  251. package/dist/kinds/utilization.kind.js +62 -0
  252. package/dist/kinds/utilization.kind.js.map +1 -0
  253. package/dist/kinds/volume.kind.d.ts +54 -0
  254. package/dist/kinds/volume.kind.d.ts.map +1 -0
  255. package/dist/kinds/volume.kind.js +39 -0
  256. package/dist/kinds/volume.kind.js.map +1 -0
  257. package/dist/kinds/vpc.kind.d.ts +61 -0
  258. package/dist/kinds/vpc.kind.d.ts.map +1 -0
  259. package/dist/kinds/vpc.kind.js +51 -0
  260. package/dist/kinds/vpc.kind.js.map +1 -0
  261. package/dist/kinds/web-app.kind.d.ts +118 -45
  262. package/dist/kinds/web-app.kind.d.ts.map +1 -1
  263. package/dist/kinds/web-app.kind.js +69 -42
  264. package/dist/kinds/web-app.kind.js.map +1 -1
  265. package/dist/kinds/worker.kind.d.ts +129 -188
  266. package/dist/kinds/worker.kind.d.ts.map +1 -1
  267. package/dist/kinds/worker.kind.js +45 -123
  268. package/dist/kinds/worker.kind.js.map +1 -1
  269. package/dist/schemas/database-migration.d.ts +173 -0
  270. package/dist/schemas/database-migration.d.ts.map +1 -0
  271. package/dist/schemas/database-migration.js +88 -0
  272. package/dist/schemas/database-migration.js.map +1 -0
  273. package/dist/schemas/deployment-environment.d.ts +11 -0
  274. package/dist/schemas/deployment-environment.d.ts.map +1 -0
  275. package/dist/schemas/deployment-environment.js +9 -0
  276. package/dist/schemas/deployment-environment.js.map +1 -0
  277. package/dist/schemas/deployment-provider.d.ts +383 -0
  278. package/dist/schemas/deployment-provider.d.ts.map +1 -0
  279. package/dist/schemas/deployment-provider.js +211 -0
  280. package/dist/schemas/deployment-provider.js.map +1 -0
  281. package/dist/schemas/log-stream.d.ts +27 -0
  282. package/dist/schemas/log-stream.d.ts.map +1 -0
  283. package/dist/schemas/log-stream.js +31 -0
  284. package/dist/schemas/log-stream.js.map +1 -0
  285. package/dist/schemas/spend-guard.d.ts +155 -0
  286. package/dist/schemas/spend-guard.d.ts.map +1 -0
  287. package/dist/schemas/spend-guard.js +61 -0
  288. package/dist/schemas/spend-guard.js.map +1 -0
  289. package/dist/schemas.d.ts +195 -20
  290. package/dist/schemas.d.ts.map +1 -1
  291. package/dist/schemas.js +151 -31
  292. package/dist/schemas.js.map +1 -1
  293. package/dist/service.d.ts +87 -0
  294. package/dist/service.d.ts.map +1 -0
  295. package/dist/service.js +199 -0
  296. package/dist/service.js.map +1 -0
  297. package/dist/settle-work.d.ts +20 -0
  298. package/dist/settle-work.d.ts.map +1 -0
  299. package/dist/settle-work.js +22 -0
  300. package/dist/settle-work.js.map +1 -0
  301. package/dist/web-app-projection.d.ts +208 -0
  302. package/dist/web-app-projection.d.ts.map +1 -0
  303. package/dist/web-app-projection.js +95 -0
  304. package/dist/web-app-projection.js.map +1 -0
  305. package/package.json +121 -37
  306. package/src/bootstrap/index.ts +0 -15
  307. package/src/bootstrap/seed.descriptor.ts +0 -24
  308. package/src/bootstrap/seed.impl-shape.ts +0 -5
  309. package/src/bootstrap/seed.kind.ts +0 -26
  310. package/src/bootstrap/seed.runner.ts +0 -87
  311. package/src/credentials/resolve.ts +0 -205
  312. package/src/deployment.ts +0 -57
  313. package/src/index.ts +0 -149
  314. package/src/infra.plugin.ts +0 -54
  315. package/src/kinds/alerts.kind.ts +0 -164
  316. package/src/kinds/artifact.kind.ts +0 -96
  317. package/src/kinds/cache.kind.ts +0 -104
  318. package/src/kinds/database.kind.ts +0 -120
  319. package/src/kinds/discovery.ts +0 -26
  320. package/src/kinds/git-hosting.kind.ts +0 -100
  321. package/src/kinds/index.ts +0 -139
  322. package/src/kinds/logs.kind.ts +0 -104
  323. package/src/kinds/object-storage.kind.ts +0 -101
  324. package/src/kinds/observability.kind.ts +0 -178
  325. package/src/kinds/package-registry.kind.ts +0 -95
  326. package/src/kinds/queue.kind.ts +0 -102
  327. package/src/kinds/rum.kind.ts +0 -135
  328. package/src/kinds/sandbox.kind.ts +0 -115
  329. package/src/kinds/web-app.kind.ts +0 -103
  330. package/src/kinds/worker.kind.ts +0 -203
  331. 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.ZodRecord<z.ZodString, z.ZodUnknown>>;
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 options - Implementation-specific options (descriptor, context, etc.)
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(options?: unknown): Promise<ArtifactOutput>;
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, Buffer for binary) */
57
- content: string | Buffer;
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?: Record<string, unknown>;
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.ZodRecord<z.ZodString, z.ZodUnknown>>;
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(options?: unknown): Promise<ArtifactOutput>;
140
+ generate(): Promise<ArtifactOutput>;
93
141
  }
94
- export declare const artifactKind: import("@vibesdotdev/runtime/schemas/kind").RuntimeKindDescriptorRecord<NoOpArtifactImplementation>;
95
- export { INFRA_DISCOVERY_PATTERN, extractStem } from './discovery.ts';
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;AAM5B;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;iBAEtB,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;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,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,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M,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 { createRuntimeKind } from '@vibesdotdev/runtime/factory/kind';
18
- import { RuntimeDescriptorSchema } from '@vibesdotdev/runtime/schemas/descriptor';
19
- import { INFRA_DISCOVERY_PATTERN, extractStem } from "./discovery.js";
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(options) {
41
- throw new Error('No artifact generator registered. Adapter plugins (infra-kubernetes, infra-helm, etc.) must register implementations.');
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
- discoveryPattern: INFRA_DISCOVERY_PATTERN,
49
- extractStem
66
+ discoveryPatterns: INFRA_DISCOVERY_PATTERNS
50
67
  });
51
68
  // Re-export discovery helpers
52
- export { INFRA_DISCOVERY_PATTERN, extractStem } from "./discovery.js";
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,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAA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AE,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,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