@vibesdotdev/infra-core 0.0.2 → 1.0.0-rc.5

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 (319) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +27 -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-environment.d.ts +30 -0
  54. package/dist/deployment-environment.d.ts.map +1 -0
  55. package/dist/deployment-environment.js +53 -0
  56. package/dist/deployment-environment.js.map +1 -0
  57. package/dist/deployment.d.ts +8 -4
  58. package/dist/deployment.d.ts.map +1 -1
  59. package/dist/deployment.js +30 -0
  60. package/dist/deployment.js.map +1 -1
  61. package/dist/doks/cloud/base.d.ts +49 -0
  62. package/dist/doks/cloud/base.d.ts.map +1 -0
  63. package/dist/doks/cloud/base.js +138 -0
  64. package/dist/doks/cloud/base.js.map +1 -0
  65. package/dist/doks/cloud/factory.d.ts +18 -0
  66. package/dist/doks/cloud/factory.d.ts.map +1 -0
  67. package/dist/doks/cloud/factory.js +22 -0
  68. package/dist/doks/cloud/factory.js.map +1 -0
  69. package/dist/doks/cloud/index.d.ts +5 -0
  70. package/dist/doks/cloud/index.d.ts.map +1 -0
  71. package/dist/doks/cloud/index.js +4 -0
  72. package/dist/doks/cloud/index.js.map +1 -0
  73. package/dist/doks/types.d.ts +95 -0
  74. package/dist/doks/types.d.ts.map +1 -0
  75. package/dist/doks/types.js +14 -0
  76. package/dist/doks/types.js.map +1 -0
  77. package/dist/generate/index.d.ts +29 -0
  78. package/dist/generate/index.d.ts.map +1 -0
  79. package/dist/generate/index.js +28 -0
  80. package/dist/generate/index.js.map +1 -0
  81. package/dist/generate/infra-generate.plugin.d.ts +3 -0
  82. package/dist/generate/infra-generate.plugin.d.ts.map +1 -0
  83. package/dist/generate/infra-generate.plugin.js +23 -0
  84. package/dist/generate/infra-generate.plugin.js.map +1 -0
  85. package/dist/generate/plugin.d.ts +2 -0
  86. package/dist/generate/plugin.d.ts.map +1 -0
  87. package/dist/generate/plugin.js +2 -0
  88. package/dist/generate/plugin.js.map +1 -0
  89. package/dist/heartbeat/cron-heartbeat.d.ts +97 -0
  90. package/dist/heartbeat/cron-heartbeat.d.ts.map +1 -0
  91. package/dist/heartbeat/cron-heartbeat.js +200 -0
  92. package/dist/heartbeat/cron-heartbeat.js.map +1 -0
  93. package/dist/index.d.ts +35 -21
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +28 -14
  96. package/dist/index.js.map +1 -1
  97. package/dist/infra.plugin.d.ts +1 -1
  98. package/dist/infra.plugin.d.ts.map +1 -1
  99. package/dist/infra.plugin.js +62 -12
  100. package/dist/infra.plugin.js.map +1 -1
  101. package/dist/kinds/alerts.kind.d.ts +64 -25
  102. package/dist/kinds/alerts.kind.d.ts.map +1 -1
  103. package/dist/kinds/alerts.kind.js +43 -16
  104. package/dist/kinds/alerts.kind.js.map +1 -1
  105. package/dist/kinds/artifact.kind.d.ts +58 -10
  106. package/dist/kinds/artifact.kind.d.ts.map +1 -1
  107. package/dist/kinds/artifact.kind.js +26 -9
  108. package/dist/kinds/artifact.kind.js.map +1 -1
  109. package/dist/kinds/billing.kind.d.ts +88 -0
  110. package/dist/kinds/billing.kind.d.ts.map +1 -0
  111. package/dist/kinds/billing.kind.js +48 -0
  112. package/dist/kinds/billing.kind.js.map +1 -0
  113. package/dist/kinds/build-job.kind.d.ts +381 -0
  114. package/dist/kinds/build-job.kind.d.ts.map +1 -0
  115. package/dist/kinds/build-job.kind.js +216 -0
  116. package/dist/kinds/build-job.kind.js.map +1 -0
  117. package/dist/kinds/cache.kind.d.ts +39 -92
  118. package/dist/kinds/cache.kind.d.ts.map +1 -1
  119. package/dist/kinds/cache.kind.js +26 -51
  120. package/dist/kinds/cache.kind.js.map +1 -1
  121. package/dist/kinds/cluster.kind.d.ts +154 -0
  122. package/dist/kinds/cluster.kind.d.ts.map +1 -0
  123. package/dist/kinds/cluster.kind.js +99 -0
  124. package/dist/kinds/cluster.kind.js.map +1 -0
  125. package/dist/kinds/compute-source.kind.d.ts +138 -0
  126. package/dist/kinds/compute-source.kind.d.ts.map +1 -0
  127. package/dist/kinds/compute-source.kind.js +145 -0
  128. package/dist/kinds/compute-source.kind.js.map +1 -0
  129. package/dist/kinds/compute-sources.descriptors.d.ts +45 -0
  130. package/dist/kinds/compute-sources.descriptors.d.ts.map +1 -0
  131. package/dist/kinds/compute-sources.descriptors.js +93 -0
  132. package/dist/kinds/compute-sources.descriptors.js.map +1 -0
  133. package/dist/kinds/container-registry.kind.d.ts +62 -0
  134. package/dist/kinds/container-registry.kind.d.ts.map +1 -0
  135. package/dist/kinds/container-registry.kind.js +47 -0
  136. package/dist/kinds/container-registry.kind.js.map +1 -0
  137. package/dist/kinds/database-migrator.kind.d.ts +6 -0
  138. package/dist/kinds/database-migrator.kind.d.ts.map +1 -0
  139. package/dist/kinds/database-migrator.kind.js +28 -0
  140. package/dist/kinds/database-migrator.kind.js.map +1 -0
  141. package/dist/kinds/database.kind.d.ts +114 -93
  142. package/dist/kinds/database.kind.d.ts.map +1 -1
  143. package/dist/kinds/database.kind.js +93 -54
  144. package/dist/kinds/database.kind.js.map +1 -1
  145. package/dist/kinds/deployment-provider.kind.d.ts +5 -0
  146. package/dist/kinds/deployment-provider.kind.d.ts.map +1 -0
  147. package/dist/kinds/deployment-provider.kind.js +11 -0
  148. package/dist/kinds/deployment-provider.kind.js.map +1 -0
  149. package/dist/kinds/discovery.d.ts +5 -12
  150. package/dist/kinds/discovery.d.ts.map +1 -1
  151. package/dist/kinds/discovery.js +5 -17
  152. package/dist/kinds/discovery.js.map +1 -1
  153. package/dist/kinds/dns.kind.d.ts +162 -0
  154. package/dist/kinds/dns.kind.d.ts.map +1 -0
  155. package/dist/kinds/dns.kind.js +54 -0
  156. package/dist/kinds/dns.kind.js.map +1 -0
  157. package/dist/kinds/drift.kind.d.ts +115 -0
  158. package/dist/kinds/drift.kind.d.ts.map +1 -0
  159. package/dist/kinds/drift.kind.js +60 -0
  160. package/dist/kinds/drift.kind.js.map +1 -0
  161. package/dist/kinds/edge-tls.kind.d.ts +194 -0
  162. package/dist/kinds/edge-tls.kind.d.ts.map +1 -0
  163. package/dist/kinds/edge-tls.kind.js +58 -0
  164. package/dist/kinds/edge-tls.kind.js.map +1 -0
  165. package/dist/kinds/firewall.kind.d.ts +92 -0
  166. package/dist/kinds/firewall.kind.d.ts.map +1 -0
  167. package/dist/kinds/firewall.kind.js +59 -0
  168. package/dist/kinds/firewall.kind.js.map +1 -0
  169. package/dist/kinds/git-hosting.kind.d.ts +36 -38
  170. package/dist/kinds/git-hosting.kind.d.ts.map +1 -1
  171. package/dist/kinds/git-hosting.kind.js +21 -32
  172. package/dist/kinds/git-hosting.kind.js.map +1 -1
  173. package/dist/kinds/index.d.ts +40 -15
  174. package/dist/kinds/index.d.ts.map +1 -1
  175. package/dist/kinds/index.js +39 -14
  176. package/dist/kinds/index.js.map +1 -1
  177. package/dist/kinds/inventory.kind.d.ts +327 -0
  178. package/dist/kinds/inventory.kind.d.ts.map +1 -0
  179. package/dist/kinds/inventory.kind.js +188 -0
  180. package/dist/kinds/inventory.kind.js.map +1 -0
  181. package/dist/kinds/load-balancer.kind.d.ts +135 -0
  182. package/dist/kinds/load-balancer.kind.d.ts.map +1 -0
  183. package/dist/kinds/load-balancer.kind.js +71 -0
  184. package/dist/kinds/load-balancer.kind.js.map +1 -0
  185. package/dist/kinds/logs.kind.d.ts +74 -3
  186. package/dist/kinds/logs.kind.d.ts.map +1 -1
  187. package/dist/kinds/logs.kind.js +26 -17
  188. package/dist/kinds/logs.kind.js.map +1 -1
  189. package/dist/kinds/nfs.kind.d.ts +67 -0
  190. package/dist/kinds/nfs.kind.d.ts.map +1 -0
  191. package/dist/kinds/nfs.kind.js +45 -0
  192. package/dist/kinds/nfs.kind.js.map +1 -0
  193. package/dist/kinds/node-pool.kind.d.ts +134 -0
  194. package/dist/kinds/node-pool.kind.d.ts.map +1 -0
  195. package/dist/kinds/node-pool.kind.js +88 -0
  196. package/dist/kinds/node-pool.kind.js.map +1 -0
  197. package/dist/kinds/object-storage.kind.d.ts +50 -24
  198. package/dist/kinds/object-storage.kind.d.ts.map +1 -1
  199. package/dist/kinds/object-storage.kind.js +40 -23
  200. package/dist/kinds/object-storage.kind.js.map +1 -1
  201. package/dist/kinds/observability.kind.d.ts +104 -6
  202. package/dist/kinds/observability.kind.d.ts.map +1 -1
  203. package/dist/kinds/observability.kind.js +67 -9
  204. package/dist/kinds/observability.kind.js.map +1 -1
  205. package/dist/kinds/package-registry.kind.d.ts +139 -33
  206. package/dist/kinds/package-registry.kind.d.ts.map +1 -1
  207. package/dist/kinds/package-registry.kind.js +55 -25
  208. package/dist/kinds/package-registry.kind.js.map +1 -1
  209. package/dist/kinds/queue.kind.d.ts +67 -63
  210. package/dist/kinds/queue.kind.d.ts.map +1 -1
  211. package/dist/kinds/queue.kind.js +55 -33
  212. package/dist/kinds/queue.kind.js.map +1 -1
  213. package/dist/kinds/read-descriptor.d.ts +15 -0
  214. package/dist/kinds/read-descriptor.d.ts.map +1 -0
  215. package/dist/kinds/read-descriptor.js +11 -0
  216. package/dist/kinds/read-descriptor.js.map +1 -0
  217. package/dist/kinds/rum.kind.d.ts +36 -6
  218. package/dist/kinds/rum.kind.d.ts.map +1 -1
  219. package/dist/kinds/rum.kind.js +6 -7
  220. package/dist/kinds/rum.kind.js.map +1 -1
  221. package/dist/kinds/sandbox.kind.d.ts +136 -36
  222. package/dist/kinds/sandbox.kind.d.ts.map +1 -1
  223. package/dist/kinds/sandbox.kind.js +80 -34
  224. package/dist/kinds/sandbox.kind.js.map +1 -1
  225. package/dist/kinds/select-compute-source.d.ts +72 -0
  226. package/dist/kinds/select-compute-source.d.ts.map +1 -0
  227. package/dist/kinds/select-compute-source.js +170 -0
  228. package/dist/kinds/select-compute-source.js.map +1 -0
  229. package/dist/kinds/service-release.kind.d.ts +771 -0
  230. package/dist/kinds/service-release.kind.d.ts.map +1 -0
  231. package/dist/kinds/service-release.kind.js +676 -0
  232. package/dist/kinds/service-release.kind.js.map +1 -0
  233. package/dist/kinds/spend-guard.kind.d.ts +40 -0
  234. package/dist/kinds/spend-guard.kind.d.ts.map +1 -0
  235. package/dist/kinds/spend-guard.kind.js +133 -0
  236. package/dist/kinds/spend-guard.kind.js.map +1 -0
  237. package/dist/kinds/utilization.kind.d.ts +88 -0
  238. package/dist/kinds/utilization.kind.d.ts.map +1 -0
  239. package/dist/kinds/utilization.kind.js +62 -0
  240. package/dist/kinds/utilization.kind.js.map +1 -0
  241. package/dist/kinds/volume.kind.d.ts +54 -0
  242. package/dist/kinds/volume.kind.d.ts.map +1 -0
  243. package/dist/kinds/volume.kind.js +39 -0
  244. package/dist/kinds/volume.kind.js.map +1 -0
  245. package/dist/kinds/vpc.kind.d.ts +61 -0
  246. package/dist/kinds/vpc.kind.d.ts.map +1 -0
  247. package/dist/kinds/vpc.kind.js +51 -0
  248. package/dist/kinds/vpc.kind.js.map +1 -0
  249. package/dist/kinds/web-app.kind.d.ts +115 -45
  250. package/dist/kinds/web-app.kind.d.ts.map +1 -1
  251. package/dist/kinds/web-app.kind.js +69 -42
  252. package/dist/kinds/web-app.kind.js.map +1 -1
  253. package/dist/kinds/worker.kind.d.ts +293 -188
  254. package/dist/kinds/worker.kind.d.ts.map +1 -1
  255. package/dist/kinds/worker.kind.js +45 -123
  256. package/dist/kinds/worker.kind.js.map +1 -1
  257. package/dist/schemas/database-migration.d.ts +173 -0
  258. package/dist/schemas/database-migration.d.ts.map +1 -0
  259. package/dist/schemas/database-migration.js +88 -0
  260. package/dist/schemas/database-migration.js.map +1 -0
  261. package/dist/schemas/deployment-environment.d.ts +11 -0
  262. package/dist/schemas/deployment-environment.d.ts.map +1 -0
  263. package/dist/schemas/deployment-environment.js +9 -0
  264. package/dist/schemas/deployment-environment.js.map +1 -0
  265. package/dist/schemas/deployment-provider.d.ts +336 -0
  266. package/dist/schemas/deployment-provider.d.ts.map +1 -0
  267. package/dist/schemas/deployment-provider.js +198 -0
  268. package/dist/schemas/deployment-provider.js.map +1 -0
  269. package/dist/schemas/log-stream.d.ts +27 -0
  270. package/dist/schemas/log-stream.d.ts.map +1 -0
  271. package/dist/schemas/log-stream.js +31 -0
  272. package/dist/schemas/log-stream.js.map +1 -0
  273. package/dist/schemas/spend-guard.d.ts +155 -0
  274. package/dist/schemas/spend-guard.d.ts.map +1 -0
  275. package/dist/schemas/spend-guard.js +61 -0
  276. package/dist/schemas/spend-guard.js.map +1 -0
  277. package/dist/schemas.d.ts +190 -20
  278. package/dist/schemas.d.ts.map +1 -1
  279. package/dist/schemas.js +137 -31
  280. package/dist/schemas.js.map +1 -1
  281. package/dist/service.d.ts +87 -0
  282. package/dist/service.d.ts.map +1 -0
  283. package/dist/service.js +199 -0
  284. package/dist/service.js.map +1 -0
  285. package/dist/settle-work.d.ts +20 -0
  286. package/dist/settle-work.d.ts.map +1 -0
  287. package/dist/settle-work.js +22 -0
  288. package/dist/settle-work.js.map +1 -0
  289. package/dist/web-app-projection.d.ts +132 -0
  290. package/dist/web-app-projection.d.ts.map +1 -0
  291. package/dist/web-app-projection.js +93 -0
  292. package/dist/web-app-projection.js.map +1 -0
  293. package/package.json +87 -36
  294. package/src/bootstrap/index.ts +0 -15
  295. package/src/bootstrap/seed.descriptor.ts +0 -24
  296. package/src/bootstrap/seed.impl-shape.ts +0 -5
  297. package/src/bootstrap/seed.kind.ts +0 -26
  298. package/src/bootstrap/seed.runner.ts +0 -87
  299. package/src/credentials/resolve.ts +0 -205
  300. package/src/deployment.ts +0 -57
  301. package/src/index.ts +0 -149
  302. package/src/infra.plugin.ts +0 -54
  303. package/src/kinds/alerts.kind.ts +0 -164
  304. package/src/kinds/artifact.kind.ts +0 -96
  305. package/src/kinds/cache.kind.ts +0 -104
  306. package/src/kinds/database.kind.ts +0 -120
  307. package/src/kinds/discovery.ts +0 -26
  308. package/src/kinds/git-hosting.kind.ts +0 -100
  309. package/src/kinds/index.ts +0 -139
  310. package/src/kinds/logs.kind.ts +0 -104
  311. package/src/kinds/object-storage.kind.ts +0 -101
  312. package/src/kinds/observability.kind.ts +0 -178
  313. package/src/kinds/package-registry.kind.ts +0 -95
  314. package/src/kinds/queue.kind.ts +0 -102
  315. package/src/kinds/rum.kind.ts +0 -135
  316. package/src/kinds/sandbox.kind.ts +0 -115
  317. package/src/kinds/web-app.kind.ts +0 -103
  318. package/src/kinds/worker.kind.ts +0 -203
  319. package/src/schemas.ts +0 -127
package/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VIBES DEV LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -12,9 +12,35 @@ bun add @vibesdotdev/infra-core
12
12
  npm install @vibesdotdev/infra-core
13
13
  ```
14
14
 
15
+ ## Contracts and development
16
+
17
+ The root exports infrastructure contracts and deployment helpers. Explicit
18
+ subpaths include `./schemas`, `./kinds`, `./deployment`, `./plugin`,
19
+ `./service`, `./bootstrap`, `./generate`, `./generate/plugin`,
20
+ `./doks/cloud` and `./doks/types`.
21
+
22
+ Compose `infraServicesPlugin` from `./service` with Config, storage participation
23
+ and a service catalog. An omitted service environment uses the schema-declared
24
+ `production` default; explicit `host` requires a declared host tier.
25
+ Primary overrides preserve separately declared internal transport.
26
+
27
+ Runtime dependencies are infra-contracts, Config, Filesystem, Logging, Kernel,
28
+ Shared and Zod. First-party source dependencies use `workspace:^`; Registry owns
29
+ their publication rewrite.
30
+
31
+ `bun run check` checks all source and tests without emitting. `bun run test`
32
+ runs in-process tests. `bun run build` emits production JavaScript and declarations
33
+ using `tsconfig.build.json`, excluding tests, fixtures and the Svelte surface.
34
+
35
+ Kubernetes log providers may implement optional `LogsImplementation.streamLogs`
36
+ from `./kinds`. `WorkerLogRequestSchema` / `WorkerLogRequest` own selectors;
37
+ `ActiveLogStreamSchema` / `ActiveLogStream` describe byte output, completion,
38
+ and active cancellation with cleanup. Existing WebSocket tails and queries remain
39
+ compatible. Core declares the contract; provider adapters execute it.
40
+
15
41
  ## Documentation
16
42
 
17
- - Package guide: https://docs.vibes.dev/packages/infra-core
43
+ - Package guide: https://docs.vibes.dev/infra-core
18
44
  - Vibes docs: https://docs.vibes.dev
19
45
 
20
46
  ## License
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  export declare const bootstrapSeedModeSchema: z.ZodEnum<{
3
3
  "cold-start": "cold-start";
4
4
  deploy: "deploy";
@@ -1 +1 @@
1
- {"version":3,"file":"seed.descriptor.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;EAAmC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;2BAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;iBAOxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
1
+ {"version":3,"file":"seed.descriptor.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,uBAAuB;;;EAAmC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;2BAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;iBAOxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  export const bootstrapSeedModeSchema = z.enum(['cold-start', 'deploy']);
3
3
  export const bootstrapSeedConditionSchema = z.discriminatedUnion('kind', [
4
4
  z.object({ kind: z.literal('always') }),
@@ -1 +1 @@
1
- {"version":3,"file":"seed.descriptor.js","sourceRoot":"","sources":["../../src/bootstrap/seed.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGxE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACxE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,CAAC,CAAC,MAAM,CAAC;QACR,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACvC,CAAC;CACF,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,Q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AC,CAAC;IAClD,SAAS,EAAE,4BAA4B,CAAC,QAAQ,EAAE;IAClD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { VibesRuntime } from '@vibesdotdev/runtime';
1
+ import type { VibesRuntime } from '@vibesdotdev/kernel';
2
2
  export interface BootstrapSeedImpl {
3
3
  run(runtime: VibesRuntime, env: Record<string, string | undefined>): Promise<void>;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"seed.impl-shape.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.impl-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IACjC,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF"}
1
+ {"version":3,"file":"seed.impl-shape.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.impl-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,iBAAiB;IACjC,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF"}
@@ -1,5 +1,3 @@
1
- import type { RuntimeKindDescriptor } from '@vibesdotdev/runtime/schemas/kind';
2
- import { type BootstrapSeedDescriptor } from './seed.descriptor.ts';
3
1
  import type { BootstrapSeedImpl } from './seed.impl-shape.ts';
4
- export declare const bootstrapSeedKind: RuntimeKindDescriptor<BootstrapSeedDescriptor, BootstrapSeedImpl, never>;
2
+ export declare const bootstrapSeedKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<BootstrapSeedImpl>;
5
3
  //# sourceMappingURL=seed.kind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.kind.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,EAEN,KAAK,uBAAuB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAS9D,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CACpD,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,CAQL,CAAC"}
1
+ {"version":3,"file":"seed.kind.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.kind.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAkB9D,eAAO,MAAM,iBAAiB,8EAK5B,CAAC"}
@@ -1,14 +1,27 @@
1
+ import { CapabilityError } from '@vibesdotdev/kernel';
2
+ import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
1
3
  import { bootstrapSeedDescriptorSchema } from "./seed.descriptor.js";
4
+ /**
5
+ * A seed declared with no implementation loader. Running it refuses
6
+ * `UNAVAILABLE bootstrap-seed-unimplemented`, so the runner reports the seed
7
+ * failed: a declared seed is never reported as ran without running.
8
+ */
2
9
  class UnregisteredBootstrapSeed {
3
- constructor(_descriptor) { }
10
+ descriptor;
11
+ constructor(descriptor) {
12
+ this.descriptor = descriptor;
13
+ }
4
14
  async run() {
5
- // No-op when no impl loader is registered for this descriptor id.
15
+ throw new CapabilityError('This bootstrap seed has no registered implementation.', 'UNAVAILABLE', {
16
+ reason: 'bootstrap-seed-unimplemented',
17
+ details: { seedId: this.descriptor.id }
18
+ });
6
19
  }
7
20
  }
8
- export const bootstrapSeedKind = {
21
+ export const bootstrapSeedKind = createRuntimeKind({
9
22
  id: 'bootstrap/seed',
10
23
  descriptorSchema: bootstrapSeedDescriptorSchema,
11
24
  defaultImplementation: UnregisteredBootstrapSeed,
12
25
  contexts: []
13
- };
26
+ });
14
27
  //# sourceMappingURL=seed.kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.kind.js","sourceRoot":"","sources":["../../src/bootstrap/seed.kind.ts"],"names":[],"mappings":"AACA,OAAO,EACN,6BAA6B,EAE7B,MAAM,sBAAsB,CAAC;AAG9B,MAAM,yBAAyB;IAC9B,YAAY,WAA8B,IAAG,CAAC;IAC9C,KAAK,CAAC,GAAG;QACR,kEAAkE;IACnE,CAAC;CACD;AAED,MAAM,CAAC,MAAM,iBAAiB,GAI1B;IACH,EAAE,EAAE,gBAAgB;IACpB,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,yBAED;IACtB,QAAQ,EAAE,EAAE;CACZ,CAAC"}
1
+ {"version":3,"file":"seed.kind.js","sourceRoot":"","sources":["../../src/bootstrap/seed.kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,6BAA6B,EAAgC,MAAM,sBAAsB,CAAC;AAGnG;;;;GAIG;AACH,MAAM,yBAAyB;IACD;IAA7B,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IAE9D,KAAK,CAAC,GAAG;QACR,MAAM,IAAI,eAAe,CAAC,uDAAuD,EAAE,aAAa,EAAE;YACjG,MAAM,EAAE,8BAA8B;YACtC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE;SACvC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAA6C;IAC9F,EAAE,EAAE,gBAAgB;IACpB,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,yBAAyB;IAChD,QAAQ,EAAE,EAAE;CACZ,CAAC,CAAC"}
@@ -1,14 +1,21 @@
1
- import type { VibesRuntime } from '@vibesdotdev/runtime';
2
- import type { BootstrapSeedMode } from './seed.descriptor.ts';
1
+ import type { VibesRuntime } from '@vibesdotdev/kernel';
2
+ import { type BootstrapSeedMode } from './seed.descriptor.ts';
3
3
  export interface BootstrapSeedRunResult {
4
4
  ran: string[];
5
5
  skipped: Array<{
6
6
  id: string;
7
7
  reason: string;
8
8
  }>;
9
+ /**
10
+ * Seeds that did not complete. `error` is value-free: the failure's class
11
+ * name, and its code and reason when typed; what the seed threw is never
12
+ * repeated (it may carry a credential).
13
+ */
9
14
  failed: Array<{
10
15
  id: string;
11
16
  error: string;
17
+ code?: string;
18
+ reason?: string;
12
19
  }>;
13
20
  }
14
21
  export interface BootstrapSeedRunOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"seed.runner.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAGX,iBAAiB,EACjB,MAAM,sBAAsB,CAAC;AAK9B,MAAM,WAAW,sBAAsB;IACtC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACxC;AAED,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAiDjC"}
1
+ {"version":3,"file":"seed.runner.d.ts","sourceRoot":"","sources":["../../src/bootstrap/seed.runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAIN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAQ9B,MAAM,WAAW,sBAAsB;IACtC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;OAIG;IACH,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,uBAAuB;IACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACxC;AAmBD,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CAgDjC"}
@@ -1,12 +1,34 @@
1
+ import * as z from 'zod/v4';
2
+ import { readUntrusted } from '@vibesdotdev/config/manifest/read-untrusted';
1
3
  import { getLogger } from '@vibesdotdev/logging';
2
- const log = getLogger('infra.bootstrap.seed');
4
+ import { bootstrapSeedDescriptorSchema } from "./seed.descriptor.js";
5
+ import { readKindDescriptor } from "../kinds/read-descriptor.js";
6
+ import { failureText, settleWork } from "../settle-work.js";
7
+ /** The logger seed runs report through, always on the handed runtime. */
8
+ const LOGGER_ID = 'infra.bootstrap.seed';
9
+ const SEED_UNREADABLE = {
10
+ code: 'INVALID_INPUT',
11
+ reason: 'bootstrap-seed-unreadable',
12
+ message: () => 'A bootstrap seed implementation does not offer run().'
13
+ };
14
+ /** A resolved seed offers `run`; kept as the original object (its method may use `this`). */
15
+ const BootstrapSeedRunsSchema = z.object({ run: z.function() });
16
+ const BootstrapSeedImplSchema = z.custom((value) => BootstrapSeedRunsSchema.safeParse(value).success);
17
+ function failedEntry(id, facts) {
18
+ const entry = { id, error: failureText(facts) };
19
+ if (facts.code !== undefined)
20
+ entry.code = facts.code;
21
+ if (facts.reason !== undefined)
22
+ entry.reason = facts.reason;
23
+ return entry;
24
+ }
3
25
  export async function runBootstrapSeeds(runtime, mode, options) {
4
- const allDescriptors = runtime
5
- .assets('bootstrap/seed')
6
- .descriptors();
26
+ const log = getLogger(LOGGER_ID, runtime);
7
27
  const result = { ran: [], skipped: [], failed: [] };
8
28
  const runnable = [];
9
- for (const descriptor of allDescriptors) {
29
+ for (const raw of runtime.assets('bootstrap/seed').descriptors()) {
30
+ // The kind's schema admitted it at registration; this read is the typed identity.
31
+ const descriptor = readKindDescriptor(bootstrapSeedDescriptorSchema, raw);
10
32
  if (!descriptor.executeOn.includes(mode)) {
11
33
  result.skipped.push({
12
34
  id: descriptor.id,
@@ -25,12 +47,12 @@ export async function runBootstrapSeeds(runtime, mode, options) {
25
47
  }
26
48
  runnable.sort((a, b) => (a.priority ?? 100) - (b.priority ?? 100));
27
49
  for (const descriptor of runnable) {
28
- try {
29
- const impl = (await runtime
30
- .query('bootstrap/seed')
31
- .withId(descriptor.id)
32
- .resolve());
50
+ const outcome = await settleWork(async () => {
51
+ const resolved = await runtime.query('bootstrap/seed').withId(descriptor.id).resolve();
52
+ const impl = readUntrusted(BootstrapSeedImplSchema, () => resolved, SEED_UNREADABLE);
33
53
  await impl.run(runtime, options.env);
54
+ });
55
+ if (outcome.ok) {
34
56
  result.ran.push(descriptor.id);
35
57
  log.info('bootstrap seed completed', {
36
58
  id: descriptor.id,
@@ -38,10 +60,10 @@ export async function runBootstrapSeeds(runtime, mode, options) {
38
60
  priority: descriptor.priority ?? 100
39
61
  });
40
62
  }
41
- catch (err) {
42
- const error = err instanceof Error ? err.message : String(err);
43
- result.failed.push({ id: descriptor.id, error });
44
- log.error('bootstrap seed failed', { id: descriptor.id, mode, error });
63
+ else {
64
+ const entry = failedEntry(descriptor.id, outcome.failure);
65
+ result.failed.push(entry);
66
+ log.error('bootstrap seed failed', { id: descriptor.id, mode, failure: entry.error });
45
67
  }
46
68
  }
47
69
  return result;
@@ -51,9 +73,6 @@ function evaluateCondition(condition, env) {
51
73
  return true;
52
74
  if (condition.kind === 'always')
53
75
  return true;
54
- if (condition.kind === 'env-keys-present') {
55
- return condition.keys.every((key) => Boolean(env[key]));
56
- }
57
- return true;
76
+ return condition.keys.every((key) => Boolean(env[key]));
58
77
  }
59
78
  //# sourceMappingURL=seed.runner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed.runner.js","sourceRoot":"","sources":["../../src/bootstrap/seed.runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAQjD,MAAM,GAAG,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC;AAY9C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,OAAqB,EACrB,IAAuB,EACvB,OAAgC;IAEhC,MAAM,cAAc,GAAG,OAAO;SAC5B,MAAM,CAAC,gBAAgB,CAAC;SACxB,WAAW,EAAmD,CAAC;IAEjE,MAAM,MAAM,GAA2B,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC5E,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAE/C,KAAK,MAAM,UAAU,IAAI,cAAc,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAA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AO,CAAC,EAAE,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC/B,GAAG,CAAC,IAAI,CAAC,0BAA0B,EAAE;gBACpC,EAAE,EAAE,UAAU,CAAC,EAAE;gBACjB,IAAI;gBACJ,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,GAAG;aACpC,CAAC,CAAC;QACJ,CAAC;aAAM,CAAC;YACP,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QACvF,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CACzB,SAA6C,EAC7C,GAAuC;IAEvC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Derive a deterministic, length-capped identifier from a prefix and a key.
3
+ *
4
+ * Generalization of the git-host Sandbox-id fix (`sandboxIdForRepo`,
5
+ * git-smart-http-cloudflare): keep the readable `${prefix}-${slug(key)}` when
6
+ * it fits within `max`, and fall back to `${prefix}-` plus a SHA-256-hex slice
7
+ * of the RAW key on overflow. The hash covers the un-slugged key, so distinct
8
+ * keys that slug identically still hash apart once they overflow.
9
+ *
10
+ * `max` defaults to 63 — the shared cap for Cloudflare script names, DNS
11
+ * labels, k8s object names, and CF Sandbox ids.
12
+ *
13
+ * Refusals are typed and never repeat the prefix or key:
14
+ * `INVALID_INPUT capped-id-prefix-invalid` (not a DNS label),
15
+ * `capped-id-max-invalid` (`max` not a safe integer) and
16
+ * `capped-id-budget-too-small` (fewer than 16 hash characters would fit).
17
+ */
18
+ export declare function cappedId(prefix: string, key: string, max?: number): string;
19
+ //# sourceMappingURL=capped-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capped-id.d.ts","sourceRoot":"","sources":["../src/capped-id.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAwBtE"}
@@ -0,0 +1,64 @@
1
+ import { CapabilityError } from '@vibesdotdev/kernel';
2
+ import { sha256Hex } from '@vibesdotdev/shared/hashing';
3
+ /**
4
+ * Minimum number of hex chars retained in the hashed fallback. Below this the
5
+ * suffix loses collision resistance, so `cappedId` throws instead of silently
6
+ * weakening ids.
7
+ */
8
+ const MIN_HASH_CHARS = 16;
9
+ const PREFIX_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
10
+ /**
11
+ * Reduce arbitrary input to a DNS-label-safe slug: lowercase alphanumerics and
12
+ * hyphens only, runs of anything else collapsed to a single hyphen, no leading
13
+ * or trailing hyphens.
14
+ */
15
+ function slug(value) {
16
+ return value
17
+ .toLowerCase()
18
+ .replace(/[^a-z0-9-]+/g, '-')
19
+ .replace(/-{2,}/g, '-')
20
+ .replace(/^-+|-+$/g, '');
21
+ }
22
+ /**
23
+ * Derive a deterministic, length-capped identifier from a prefix and a key.
24
+ *
25
+ * Generalization of the git-host Sandbox-id fix (`sandboxIdForRepo`,
26
+ * git-smart-http-cloudflare): keep the readable `${prefix}-${slug(key)}` when
27
+ * it fits within `max`, and fall back to `${prefix}-` plus a SHA-256-hex slice
28
+ * of the RAW key on overflow. The hash covers the un-slugged key, so distinct
29
+ * keys that slug identically still hash apart once they overflow.
30
+ *
31
+ * `max` defaults to 63 — the shared cap for Cloudflare script names, DNS
32
+ * labels, k8s object names, and CF Sandbox ids.
33
+ *
34
+ * Refusals are typed and never repeat the prefix or key:
35
+ * `INVALID_INPUT capped-id-prefix-invalid` (not a DNS label),
36
+ * `capped-id-max-invalid` (`max` not a safe integer) and
37
+ * `capped-id-budget-too-small` (fewer than 16 hash characters would fit).
38
+ */
39
+ export function cappedId(prefix, key, max = 63) {
40
+ if (!PREFIX_PATTERN.test(prefix)) {
41
+ throw new CapabilityError('cappedId prefix must be a lowercase alphanumeric/hyphen label.', 'INVALID_INPUT', {
42
+ reason: 'capped-id-prefix-invalid'
43
+ });
44
+ }
45
+ if (!Number.isSafeInteger(max)) {
46
+ throw new CapabilityError('cappedId max must be a whole number of characters.', 'INVALID_INPUT', {
47
+ reason: 'capped-id-max-invalid'
48
+ });
49
+ }
50
+ const hashBudget = max - prefix.length - 1;
51
+ if (hashBudget < MIN_HASH_CHARS) {
52
+ throw new CapabilityError('cappedId prefix leaves too few characters for a collision-resistant hash suffix.', 'INVALID_INPUT', {
53
+ reason: 'capped-id-budget-too-small', details: { max, minimumHashChars: MIN_HASH_CHARS }
54
+ });
55
+ }
56
+ const slugged = slug(key);
57
+ const readable = `${prefix}-${slugged}`;
58
+ if (slugged.length > 0 && readable.length <= max) {
59
+ return readable;
60
+ }
61
+ const hex = sha256Hex(key);
62
+ return `${prefix}-${hex.slice(0, Math.min(hashBudget, hex.length))}`;
63
+ }
64
+ //# sourceMappingURL=capped-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capped-id.js","sourceRoot":"","sources":["../src/capped-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,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,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QAClD,OAAO,QAAQ,CAAC;IACjB,CAAC;IACD,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,GAAG,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC"}
@@ -0,0 +1,23 @@
1
+ declare const _default: {
2
+ id: string;
3
+ kind: "cli/command";
4
+ group: string;
5
+ name: string;
6
+ description: string;
7
+ usage: string;
8
+ arguments: {
9
+ name: string;
10
+ description: string;
11
+ required: boolean;
12
+ variadic: boolean;
13
+ }[];
14
+ options: {
15
+ flags: string;
16
+ description: string;
17
+ }[];
18
+ surfaces: string[];
19
+ hardware: string[];
20
+ enabled: true;
21
+ };
22
+ export default _default;
23
+ //# sourceMappingURL=artifact.cli-command.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.cli-command.descriptor.d.ts","sourceRoot":"","sources":["../../../../src/cli/generate/artifact/artifact.cli-command.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA,wBA2BG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * CLI command: vibes infra artifact
3
+ */
4
+ import { createRuntimeAsset } from '@vibesdotdev/kernel';
5
+ export default createRuntimeAsset({
6
+ id: 'infra-generate.artifact',
7
+ kind: 'cli/command',
8
+ group: 'infra',
9
+ name: 'artifact',
10
+ description: 'List and query available artifact generators',
11
+ usage: 'vibes infra artifact [list|info]',
12
+ arguments: [
13
+ {
14
+ name: 'subcommand',
15
+ description: 'Subcommand (list|info)',
16
+ required: false,
17
+ variadic: false
18
+ },
19
+ {
20
+ name: 'id',
21
+ description: 'Artifact generator ID (for info subcommand)',
22
+ required: false,
23
+ variadic: false
24
+ }
25
+ ],
26
+ options: [
27
+ { flags: '-v, --verbose', description: 'Verbose output' }
28
+ ],
29
+ surfaces: ['cli'],
30
+ hardware: ['consumer', 'cloud'],
31
+ enabled: true
32
+ });
33
+ //# sourceMappingURL=artifact.cli-command.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.cli-command.descriptor.js","sourceRoot":"","sources":["../../../../src/cli/generate/artifact/artifact.cli-command.descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAe,kBAAkB,CAAC;IACjC,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE,kCAAkC;IACzC,SAAS,EAAE;QACV;YACC,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,wBAAwB;YACrC,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,KAAK;SACf;QACD;YACC,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,KAAK;SACf;KACD;IACD,OAAO,EAAE;QACR,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE;KACzD;IACD,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;CACb,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Implementation: vibes infra artifact
3
+ *
4
+ * Refusals are typed for the CLI host, which maps them to the exit code:
5
+ * `INVALID_INPUT infra-artifact-subcommand-unknown`,
6
+ * `INVALID_INPUT infra-artifact-id-required` and
7
+ * `NOT_FOUND infra-artifact-not-found`.
8
+ */
9
+ import * as z from 'zod/v4';
10
+ import { type CommandContext } from '../context.ts';
11
+ declare const ArtifactArgsSchema: z.ZodObject<{
12
+ subcommand: z.ZodOptional<z.ZodString>;
13
+ id: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$loose>;
15
+ export type ArtifactCommandArgs = z.input<typeof ArtifactArgsSchema>;
16
+ declare const ArtifactOptionsSchema: z.ZodObject<{
17
+ verbose: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
18
+ }, z.core.$loose>;
19
+ export type ArtifactCommandOptions = z.input<typeof ArtifactOptionsSchema>;
20
+ declare const _default: {
21
+ execute(rawArgs: ArtifactCommandArgs, rawOptions: ArtifactCommandOptions, context: CommandContext): Promise<void>;
22
+ };
23
+ export default _default;
24
+ //# sourceMappingURL=artifact.cli-command.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.cli-command.impl.d.ts","sourceRoot":"","sources":["../../../../src/cli/generate/artifact/artifact.cli-command.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEjF,QAAA,MAAM,kBAAkB;;;iBAGtB,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAErE,QAAA,MAAM,qBAAqB;;iBAEzB,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;;qBAGnD,mBAAmB,cAAc,sBAAsB,WAAW,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;;AADxH,wBA2DE"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Implementation: vibes infra artifact
3
+ *
4
+ * Refusals are typed for the CLI host, which maps them to the exit code:
5
+ * `INVALID_INPUT infra-artifact-subcommand-unknown`,
6
+ * `INVALID_INPUT infra-artifact-id-required` and
7
+ * `NOT_FOUND infra-artifact-not-found`.
8
+ */
9
+ import * as z from 'zod/v4';
10
+ import { CapabilityError } from '@vibesdotdev/kernel';
11
+ import { ArtifactDescriptorSchema } from "../../../kinds/artifact.kind.js";
12
+ import { commandUi, readCommandInput } from "../context.js";
13
+ const ArtifactArgsSchema = z.looseObject({
14
+ subcommand: z.string().optional(),
15
+ id: z.string().optional()
16
+ });
17
+ const ArtifactOptionsSchema = z.looseObject({
18
+ verbose: z.union([z.boolean(), z.string()]).optional()
19
+ });
20
+ export default {
21
+ async execute(rawArgs, rawOptions, context) {
22
+ const runtime = context.runtime;
23
+ const args = readCommandInput(ArtifactArgsSchema, rawArgs, 'infra-artifact-input-invalid');
24
+ readCommandInput(ArtifactOptionsSchema, rawOptions, 'infra-artifact-input-invalid');
25
+ const ui = await commandUi(runtime);
26
+ const subcommand = args.subcommand ?? 'list';
27
+ const artifactId = args.id;
28
+ if (subcommand === 'list') {
29
+ const generators = runtime.hasKind('infra/artifact') ? runtime.query('infra/artifact').descriptors() : [];
30
+ ui.info('\n=== Available Artifact Generators ===\n');
31
+ if (generators.length === 0) {
32
+ ui.log(' No artifact generators found.');
33
+ ui.log(' Make sure adapter plugins (infra-doks, infra-cloudflare, etc.) are registered.');
34
+ return;
35
+ }
36
+ for (const descriptor of generators) {
37
+ const declared = ArtifactDescriptorSchema.safeParse(descriptor);
38
+ const artifact = declared.success ? declared.data : undefined;
39
+ ui.log(` ${descriptor.id}`);
40
+ ui.log(` Kind: ${artifact?.source?.kind ?? 'N/A'}`);
41
+ ui.log(` Format: ${artifact?.format ?? 'N/A'}`);
42
+ ui.log(` Description: ${artifact?.description ?? 'No description'}`);
43
+ ui.log('');
44
+ }
45
+ ui.info(`Total: ${generators.length} generators`);
46
+ return;
47
+ }
48
+ if (subcommand === 'info') {
49
+ if (!artifactId) {
50
+ throw new CapabilityError('An artifact generator id is required: vibes infra artifact info <artifact-id>.', 'INVALID_INPUT', {
51
+ reason: 'infra-artifact-id-required'
52
+ });
53
+ }
54
+ const descriptors = runtime.hasKind('infra/artifact') ? runtime.query('infra/artifact').withId(artifactId).descriptors() : [];
55
+ const [descriptor] = descriptors;
56
+ if (!descriptor) {
57
+ throw new CapabilityError('No artifact generator is registered with that id.', 'NOT_FOUND', {
58
+ reason: 'infra-artifact-not-found',
59
+ details: { id: artifactId }
60
+ });
61
+ }
62
+ ui.info('=== Artifact Generator Info ===');
63
+ ui.info(` ID: ${artifactId}`);
64
+ ui.info(` Descriptor: ${JSON.stringify(ArtifactDescriptorSchema.safeParse(descriptor).data ?? { id: descriptor.id, kind: descriptor.kind }, null, 2)}`);
65
+ return;
66
+ }
67
+ throw new CapabilityError('Unknown subcommand. Usage: vibes infra artifact [list|info].', 'INVALID_INPUT', {
68
+ reason: 'infra-artifact-subcommand-unknown',
69
+ details: { allowed: ['list', 'info'] }
70
+ });
71
+ }
72
+ };
73
+ //# sourceMappingURL=artifact.cli-command.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.cli-command.impl.js","sourceRoot":"","sources":["../../../../src/cli/generate/artifact/artifact.cli-command.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAuB,MAAM,eAAe,CAAC;AAEjF,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACzB,CAAC,CAAC;AAGH,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,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,UAAU,EAAE,CAAC,CAAC;YAC/B,EAAE,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACzJ,OAAO;QACR,CAAC;QACD,MAAM,IAAI,eAAe,CAAC,8DAA8D,EAAE,eAAe,EAAE;YAC1G,MAAM,EAAE,mCAAmC;YAC3C,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;SACtC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as z from 'zod/v4';
2
+ import type { VibesRuntime } from '@vibesdotdev/kernel';
3
+ /** CLI UI context for command implementations. */
4
+ export interface UIContext {
5
+ info(message: string): void;
6
+ log(message: string): void;
7
+ error(message: string): void;
8
+ }
9
+ /** Command execution context. */
10
+ export interface CommandContext {
11
+ readonly runtime: VibesRuntime;
12
+ }
13
+ /** The handed runtime's CLI UI, read once and checked. */
14
+ export declare function commandUi(runtime: VibesRuntime): Promise<UIContext>;
15
+ /** Read a command's parsed arguments or options once, refusing typed (field paths only, never values). */
16
+ export declare function readCommandInput<Schema extends z.ZodType, Input>(schema: Schema, input: Input, reason: string): z.output<Schema>;
17
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/cli/generate/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACzB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,iCAAiC;AACjC,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAC/B;AAYD,0DAA0D;AAC1D,wBAAsB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAGzE;AAED,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAMhI"}
@@ -0,0 +1,24 @@
1
+ import * as z from 'zod/v4';
2
+ import { readUntrusted } from '@vibesdotdev/config/manifest/read-untrusted';
3
+ /** The CLI's `cli/ui` context offers the three writers; kept as the original object (its methods may use `this`). */
4
+ const UIOperationsSchema = z.object({ info: z.function(), log: z.function(), error: z.function() });
5
+ const UIContextSchema = z.custom((value) => UIOperationsSchema.safeParse(value).success);
6
+ const UI_UNAVAILABLE = {
7
+ code: 'UNAVAILABLE',
8
+ reason: 'cli-ui-unavailable',
9
+ message: () => 'The CLI UI context does not offer info, log and error.'
10
+ };
11
+ /** The handed runtime's CLI UI, read once and checked. */
12
+ export async function commandUi(runtime) {
13
+ const ui = await runtime.context('cli/ui');
14
+ return readUntrusted(UIContextSchema, () => ui, UI_UNAVAILABLE);
15
+ }
16
+ /** Read a command's parsed arguments or options once, refusing typed (field paths only, never values). */
17
+ export function readCommandInput(schema, input, reason) {
18
+ return readUntrusted(schema, () => input, {
19
+ code: 'INVALID_INPUT',
20
+ reason,
21
+ message: () => 'The command arguments or options are invalid.'
22
+ });
23
+ }
24
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/cli/generate/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAA6B,MAAM,6CAA6C,CAAC;AAevG,qHAAqH;AACrH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACpG,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAY,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;AAEpG,MAAM,cAAc,GAAyB;IAC5C,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,oBAAoB;IAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,wDAAwD;CACvE,CAAC;AAEF,0DAA0D;AAC1D,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAqB;IACpD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,OAAO,CAAY,QAAQ,CAAC,CAAC;IACtD,OAAO,aAAa,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;AACjE,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,gBAAgB,CAAkC,MAAc,EAAE,KAAY,EAAE,MAAc;IAC7G,OAAO,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;QACzC,IAAI,EAAE,eAAe;QACrB,MAAM;QACN,OAAO,EAAE,GAAG,EAAE,CAAC,+CAA+C;KAC9D,CAAC,CAAC;AACJ,CAAC"}