@vibesdotdev/infra-core 0.0.1 → 1.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +33 -63
  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 +34 -20
  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 +23 -34
  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 +326 -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 +27 -31
  206. package/dist/kinds/package-registry.kind.d.ts.map +1 -1
  207. package/dist/kinds/package-registry.kind.js +13 -26
  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 +291 -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 +89 -39
  294. package/SPEC.md +0 -169
  295. package/src/bootstrap/index.ts +0 -15
  296. package/src/bootstrap/seed.descriptor.ts +0 -24
  297. package/src/bootstrap/seed.impl-shape.ts +0 -5
  298. package/src/bootstrap/seed.kind.ts +0 -26
  299. package/src/bootstrap/seed.runner.ts +0 -87
  300. package/src/credentials/resolve.ts +0 -205
  301. package/src/deployment.ts +0 -57
  302. package/src/index.ts +0 -149
  303. package/src/infra.plugin.ts +0 -54
  304. package/src/kinds/alerts.kind.ts +0 -164
  305. package/src/kinds/artifact.kind.ts +0 -96
  306. package/src/kinds/cache.kind.ts +0 -104
  307. package/src/kinds/database.kind.ts +0 -120
  308. package/src/kinds/discovery.ts +0 -26
  309. package/src/kinds/git-hosting.kind.ts +0 -100
  310. package/src/kinds/index.ts +0 -139
  311. package/src/kinds/logs.kind.ts +0 -104
  312. package/src/kinds/object-storage.kind.ts +0 -101
  313. package/src/kinds/observability.kind.ts +0 -178
  314. package/src/kinds/package-registry.kind.ts +0 -95
  315. package/src/kinds/queue.kind.ts +0 -102
  316. package/src/kinds/rum.kind.ts +0 -135
  317. package/src/kinds/sandbox.kind.ts +0 -115
  318. package/src/kinds/web-app.kind.ts +0 -103
  319. package/src/kinds/worker.kind.ts +0 -203
  320. package/src/schemas.ts +0 -127
@@ -12,8 +12,8 @@
12
12
  * The kind decouples *configuration* (which hostnames, which token,
13
13
  * which privacy mode) from *delivery* (how the beacon `<script>` tag
14
14
  * lands in the HTML). For SvelteKit apps, the
15
- * `@vibesdotdev/cloudflare-web-analytics` package provides a `handle`
16
- * hook that injects the beacon via `transformPageChunk` — no
15
+ * `@vibesdotdev/integrations-cloudflare/svelte/web-analytics` surface provides a
16
+ * `handle` hook that injects the beacon via `transformPageChunk` — no
17
17
  * per-app `app.html` edits required once the kind is wired in.
18
18
  */
19
19
  import * as z from 'zod/v4';
@@ -32,10 +32,10 @@ export type RumPrivacy = z.infer<typeof RumPrivacySchema>;
32
32
  * custom → caller injects however they want; we just track config
33
33
  */
34
34
  declare const RumInjectionSchema: z.ZodEnum<{
35
+ custom: "custom";
35
36
  "app-html": "app-html";
36
37
  "sveltekit-hook": "sveltekit-hook";
37
38
  "provider-auto": "provider-auto";
38
- custom: "custom";
39
39
  }>;
40
40
  export type RumInjection = z.infer<typeof RumInjectionSchema>;
41
41
  declare const RumBaseSchema: z.ZodObject<{
@@ -45,9 +45,19 @@ declare const RumBaseSchema: z.ZodObject<{
45
45
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
46
  hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
47
  priority: z.ZodOptional<z.ZodNumber>;
48
+ capabilityId: z.ZodOptional<z.ZodString>;
48
49
  requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
50
  optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
- config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ config: z.ZodOptional<z.ZodUnknown>;
52
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
53
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
54
+ maxEntries: z.ZodOptional<z.ZodNumber>;
55
+ maxBytes: z.ZodOptional<z.ZodNumber>;
56
+ cascadeFrom: z.ZodOptional<z.ZodString>;
57
+ ageField: z.ZodOptional<z.ZodString>;
58
+ reason: z.ZodString;
59
+ enforcedBy: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>]>>;
51
61
  kind: z.ZodLiteral<"infra/rum">;
52
62
  adapter: z.ZodString;
53
63
  adapterConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -58,10 +68,10 @@ declare const RumBaseSchema: z.ZodObject<{
58
68
  }, z.core.$strip>]>;
59
69
  hostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
60
70
  injection: z.ZodDefault<z.ZodEnum<{
71
+ custom: "custom";
61
72
  "app-html": "app-html";
62
73
  "sveltekit-hook": "sveltekit-hook";
63
74
  "provider-auto": "provider-auto";
64
- custom: "custom";
65
75
  }>>;
66
76
  privacy: z.ZodDefault<z.ZodObject<{
67
77
  excludeEU: z.ZodDefault<z.ZodBoolean>;
@@ -89,7 +99,27 @@ export interface RumSiteSnapshot {
89
99
  pageViews24h?: number;
90
100
  createdAt?: string;
91
101
  }
102
+ /** Real provider measurements, normalized to milliseconds. Empty is not healthy. */
103
+ export interface RumPerformanceSnapshot {
104
+ start: string;
105
+ end: string;
106
+ rows: Array<{
107
+ hostname: string;
108
+ path: string;
109
+ samples: number;
110
+ lcpP75Ms: number;
111
+ }>;
112
+ /** A truncated result must not be used to assert complete coverage. */
113
+ truncated: boolean;
114
+ }
115
+ export interface RumPerformanceQuery {
116
+ hostname: string;
117
+ start: string;
118
+ end: string;
119
+ }
92
120
  export interface RumImplementation {
121
+ /** Optional read capability; unsupported providers report unavailable, never zero. */
122
+ getPerformance?(query: RumPerformanceQuery): Promise<RumPerformanceSnapshot>;
93
123
  /** Enumerate the configured RUM sites on the provider. */
94
124
  listSites(): Promise<RumSiteSnapshot[]>;
95
125
  /** Look up a single site by siteTag. */
@@ -106,7 +136,7 @@ export interface RumImplementation {
106
136
  /** Toggle enabled state. */
107
137
  setEnabled(siteTag: string, enabled: boolean): Promise<void>;
108
138
  }
109
- export declare const rumKind: import("@vibesdotdev/runtime").RuntimeKindDescriptorRecord<RumImplementation>;
139
+ export declare const rumKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<RumImplementation>;
110
140
  export type InfraRumKind = InfraRumDescriptor;
111
141
  export type InfraRumKindInput = InfraRumDescriptorInput;
112
142
  export { RumBaseSchema as InfraRumDescriptorSchema, RumPrivacySchema, RumInjectionSchema };
@@ -1 +1 @@
1
- {"version":3,"file":"rum.kind.d.ts","sourceRoot":"","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M,YAAY,GAAG,kBAAkB,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAExD,OAAO,EACN,aAAa,IAAI,wBAAwB,EACzC,gBAAgB,EAChB,kBAAkB,EAClB,CAAC"}
@@ -12,14 +12,14 @@
12
12
  * The kind decouples *configuration* (which hostnames, which token,
13
13
  * which privacy mode) from *delivery* (how the beacon `<script>` tag
14
14
  * lands in the HTML). For SvelteKit apps, the
15
- * `@vibesdotdev/cloudflare-web-analytics` package provides a `handle`
16
- * hook that injects the beacon via `transformPageChunk` — no
15
+ * `@vibesdotdev/integrations-cloudflare/svelte/web-analytics` surface provides a
16
+ * `handle` hook that injects the beacon via `transformPageChunk` — no
17
17
  * per-app `app.html` edits required once the kind is wired in.
18
18
  */
19
19
  import * as z from 'zod/v4';
20
- import { createRuntimeKind } from '@vibesdotdev/runtime/factory/kind';
21
- import { RuntimeDescriptorSchema } from '@vibesdotdev/runtime/schemas/descriptor';
22
- import { INFRA_DISCOVERY_PATTERN, extractStem } from "./discovery.js";
20
+ import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
21
+ import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
22
+ import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
23
23
  const RumPrivacySchema = z.object({
24
24
  /** Drop EU visitor data at the beacon level (GDPR fast path). */
25
25
  excludeEU: z.boolean().default(false),
@@ -73,8 +73,7 @@ const RumBaseSchema = RuntimeDescriptorSchema.extend({
73
73
  export const rumKind = createRuntimeKind({
74
74
  id: 'infra/rum',
75
75
  descriptorSchema: RumBaseSchema,
76
- discoveryPattern: INFRA_DISCOVERY_PATTERN,
77
- extractStem
76
+ discoveryPatterns: INFRA_DISCOVERY_PATTERNS
78
77
  });
79
78
  export { RumBaseSchema as InfraRumDescriptorSchema, RumPrivacySchema, RumInjectionSchema };
80
79
  //# sourceMappingURL=rum.kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rum.kind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AAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;IACpD,SAAS,EAAE,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACvD,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxC,SAAS,EAAE,KAAK;QAChB,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,6EAA6E;IAC7E,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CAClC,CAAC,CAAC;AA0DH,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAwC;IAC/E,EAAE,EAAE,WAAW;IACf,gBAAgB,EAAE,aAAa;IAC/B,iBAAiB,EAAE,wBAAwB;CAC3C,CAAC,CAAC;AAKH,OAAO,EACN,aAAa,IAAI,wBAAwB,EACzC,gBAAgB,EAChB,kBAAkB,EAClB,CAAC"}
@@ -5,17 +5,23 @@
5
5
  * subprocess capabilities. Used for agent code execution, tool sandboxing,
6
6
  * and long-running background tasks.
7
7
  *
8
- * Schema shape: strict common base + `config` discriminated union.
8
+ * Schema shape: strict common base + an open, adapter-keyed `config`.
9
9
  *
10
10
  * - The base defines fields universal across every adapter:
11
11
  * id/kind/name + the sandbox shape (entrypoint, image, limits,
12
12
  * outboundProxy, liveView, persistent, env).
13
- * - Adapter-specific fields live under `config`. Each adapter package
14
- * defines its own concrete schema under its discriminator key.
13
+ * - Adapter-specific fields live under `config`, keyed by a non-empty
14
+ * `adapter` discriminator. Cloud provider adapter schemas live in their
15
+ * integrations owners (Cloudflare's in `@vibesdotdev/integrations-cloudflare`,
16
+ * DigitalOcean droplet and DOKS job configs in
17
+ * `@vibesdotdev/integrations-digitalocean`); this kind names no cloud
18
+ * provider, so a config for any adapter — including one contributed by a
19
+ * user plugin — parses here, and the adapter validates its own grammar.
20
+ * The local docker adapter is not a cloud integration and is defined here.
15
21
  */
16
22
  import * as z from 'zod/v4';
17
- import type { RuntimeKindDescriptorRecord } from '@vibesdotdev/runtime/schemas/kind';
18
- import type { RuntimeDescriptor } from '@vibesdotdev/runtime/schemas/descriptor';
23
+ import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
24
+ import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
19
25
  export declare const SandboxOutboundProxySchema: z.ZodObject<{
20
26
  binding: z.ZodString;
21
27
  workerPath: z.ZodOptional<z.ZodString>;
@@ -30,27 +36,94 @@ export declare const SandboxResourceLimitsSchema: z.ZodObject<{
30
36
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
31
37
  }, z.core.$strip>;
32
38
  export type SandboxResourceLimits = z.infer<typeof SandboxResourceLimitsSchema>;
33
- export declare const CloudflareSandboxConfigSchema: z.ZodObject<{
34
- image: z.ZodOptional<z.ZodString>;
35
- }, z.core.$strip>;
39
+ /** Host bootstrap accepted by a provisioner; omitted preserves legacy cloud-init callers. */
40
+ export declare const SandboxBootstrapSchema: z.ZodEnum<{
41
+ entrypoint: "entrypoint";
42
+ "cloud-init": "cloud-init";
43
+ }>;
44
+ export type SandboxBootstrap = z.infer<typeof SandboxBootstrapSchema>;
45
+ export interface SandboxProvisionOptions {
46
+ /** Stable noncredential configuration, included in operation identity. */
47
+ env?: Record<string, string>;
48
+ /** Resolve transient authority only when a new process must be started. Never persisted. */
49
+ resolveCredentials?: () => Promise<Record<string, string>>;
50
+ }
51
+ /** Local docker sandbox adapter: a container image plus volume mounts. */
36
52
  export declare const DockerSandboxConfigSchema: z.ZodObject<{
37
53
  image: z.ZodString;
38
54
  volumes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
39
55
  }, z.core.$strip>;
40
- export declare const DigitalOceanDropletSandboxConfigSchema: z.ZodObject<{
41
- dropletSize: z.ZodString;
42
- }, z.core.$strip>;
43
- export declare const SandboxConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
56
+ export type DockerSandboxConfig = z.infer<typeof DockerSandboxConfigSchema>;
57
+ /**
58
+ * Adapter-specific configuration: the adapter id plus its own fields. Each
59
+ * adapter package defines and parses its own config schema; this kind names
60
+ * no cloud provider, so a config for any adapter — including one contributed
61
+ * by a user plugin — parses here, and the adapter validates its own grammar.
62
+ */
63
+ export declare const SandboxConfigSchema: z.ZodObject<{
64
+ adapter: z.ZodString;
65
+ }, z.core.$loose>;
66
+ export type SandboxConfig = z.infer<typeof SandboxConfigSchema>;
67
+ /** Placement a host profile supplies when a launch omits size, region or image. */
68
+ export declare const SandboxHostPlacementDefaultsSchema: z.ZodObject<{
69
+ size: z.ZodOptional<z.ZodString>;
70
+ region: z.ZodOptional<z.ZodString>;
44
71
  image: z.ZodOptional<z.ZodString>;
45
- adapter: z.ZodLiteral<"cloudflare-sandbox">;
46
- }, z.core.$strip>, z.ZodObject<{
47
- image: z.ZodString;
48
- volumes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
- adapter: z.ZodLiteral<"docker">;
50
- }, z.core.$strip>, z.ZodObject<{
51
- dropletSize: z.ZodString;
52
- adapter: z.ZodLiteral<"digitalocean-droplet">;
53
- }, z.core.$strip>]>;
72
+ }, z.core.$strip>;
73
+ export type SandboxHostPlacementDefaults = z.infer<typeof SandboxHostPlacementDefaultsSchema>;
74
+ /**
75
+ * How the provider's `advancePause` stops compute billing:
76
+ * - `snapshot-destroy`: snapshot the disk, then delete the instance; only the
77
+ * snapshot bills while paused (a provider whose stopped instances still bill).
78
+ * - `power-off`: stop the instance in place; the provider stops compute billing.
79
+ */
80
+ export declare const SandboxPauseStrategySchema: z.ZodEnum<{
81
+ "snapshot-destroy": "snapshot-destroy";
82
+ "power-off": "power-off";
83
+ }>;
84
+ export type SandboxPauseStrategy = z.infer<typeof SandboxPauseStrategySchema>;
85
+ /**
86
+ * The fleet-host profile a provisioner declares: what `vibes fleet launch`
87
+ * may request from it and what it supplies on omission. Generic launch reads
88
+ * only this; a sandbox without a profile is never selected implicitly.
89
+ */
90
+ export declare const SandboxHostProfileSchema: z.ZodObject<{
91
+ provider: z.ZodString;
92
+ aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ gpuSizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
95
+ defaults: z.ZodDefault<z.ZodObject<{
96
+ size: z.ZodOptional<z.ZodString>;
97
+ region: z.ZodOptional<z.ZodString>;
98
+ image: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>;
100
+ gpuDefaults: z.ZodDefault<z.ZodObject<{
101
+ image: z.ZodOptional<z.ZodString>;
102
+ region: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strict>>;
104
+ pause: z.ZodOptional<z.ZodEnum<{
105
+ "snapshot-destroy": "snapshot-destroy";
106
+ "power-off": "power-off";
107
+ }>>;
108
+ }, z.core.$strip>;
109
+ export type SandboxHostProfile = z.infer<typeof SandboxHostProfileSchema>;
110
+ /** One fleet-host launch as the selected provider sees it before any paid call. */
111
+ export interface SandboxHostLaunchRequest {
112
+ size: string;
113
+ region: string;
114
+ image: string;
115
+ gpu: boolean;
116
+ sshKeyIds: readonly string[];
117
+ }
118
+ /**
119
+ * Optional `infra/sandbox` implementation operation: refuse a launch the
120
+ * provider would reject (throw a `CapabilityError`) before the platform is
121
+ * asked to provision. Provider-specific rules live here, never in generic launch.
122
+ */
123
+ export interface SandboxHostLaunchPreflight {
124
+ preflightHostLaunch(request: SandboxHostLaunchRequest): void | Promise<void>;
125
+ }
126
+ export declare function hasSandboxHostLaunchPreflight(implementation: Partial<SandboxHostLaunchPreflight> | null | undefined): implementation is SandboxHostLaunchPreflight;
54
127
  export declare const SandboxDescriptorSchema: z.ZodObject<{
55
128
  id: z.ZodString;
56
129
  name: z.ZodOptional<z.ZodString>;
@@ -59,9 +132,42 @@ export declare const SandboxDescriptorSchema: z.ZodObject<{
59
132
  hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
133
  enabled: z.ZodOptional<z.ZodBoolean>;
61
134
  priority: z.ZodOptional<z.ZodNumber>;
135
+ capabilityId: z.ZodOptional<z.ZodString>;
62
136
  requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
137
  optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
139
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
140
+ maxEntries: z.ZodOptional<z.ZodNumber>;
141
+ maxBytes: z.ZodOptional<z.ZodNumber>;
142
+ cascadeFrom: z.ZodOptional<z.ZodString>;
143
+ ageField: z.ZodOptional<z.ZodString>;
144
+ reason: z.ZodString;
145
+ enforcedBy: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strip>]>>;
64
147
  kind: z.ZodLiteral<"infra/sandbox">;
148
+ bootstrap: z.ZodOptional<z.ZodEnum<{
149
+ entrypoint: "entrypoint";
150
+ "cloud-init": "cloud-init";
151
+ }>>;
152
+ hostProfile: z.ZodOptional<z.ZodObject<{
153
+ provider: z.ZodString;
154
+ aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
155
+ sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
156
+ gpuSizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
157
+ defaults: z.ZodDefault<z.ZodObject<{
158
+ size: z.ZodOptional<z.ZodString>;
159
+ region: z.ZodOptional<z.ZodString>;
160
+ image: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>>;
162
+ gpuDefaults: z.ZodDefault<z.ZodObject<{
163
+ image: z.ZodOptional<z.ZodString>;
164
+ region: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strict>>;
166
+ pause: z.ZodOptional<z.ZodEnum<{
167
+ "snapshot-destroy": "snapshot-destroy";
168
+ "power-off": "power-off";
169
+ }>>;
170
+ }, z.core.$strip>>;
65
171
  entrypoint: z.ZodOptional<z.ZodString>;
66
172
  image: z.ZodOptional<z.ZodString>;
67
173
  limits: z.ZodOptional<z.ZodObject<{
@@ -86,26 +192,20 @@ export declare const SandboxDescriptorSchema: z.ZodObject<{
86
192
  secret: z.ZodOptional<z.ZodBoolean>;
87
193
  description: z.ZodOptional<z.ZodString>;
88
194
  storeKey: z.ZodOptional<z.ZodString>;
195
+ storeBinding: z.ZodOptional<z.ZodBoolean>;
89
196
  }, z.core.$strip>>>;
90
- config: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
91
- image: z.ZodOptional<z.ZodString>;
92
- adapter: z.ZodLiteral<"cloudflare-sandbox">;
93
- }, z.core.$strip>, z.ZodObject<{
94
- image: z.ZodString;
95
- volumes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
96
- adapter: z.ZodLiteral<"docker">;
97
- }, z.core.$strip>, z.ZodObject<{
98
- dropletSize: z.ZodString;
99
- adapter: z.ZodLiteral<"digitalocean-droplet">;
100
- }, z.core.$strip>]>>;
197
+ config: z.ZodOptional<z.ZodObject<{
198
+ adapter: z.ZodString;
199
+ }, z.core.$loose>>;
101
200
  }, z.core.$strip>;
102
201
  export type SandboxDescriptor = z.infer<typeof SandboxDescriptorSchema>;
103
202
  declare class DefaultSandboxImplementation {
104
203
  readonly descriptor: RuntimeDescriptor;
105
- readonly context: unknown;
106
- constructor(descriptor: RuntimeDescriptor, context: unknown);
107
- get config(): SandboxDescriptor;
204
+ readonly context: KindContext;
205
+ /** The descriptor as this kind's schema reads it. */
206
+ readonly config: SandboxDescriptor;
207
+ constructor(descriptor: RuntimeDescriptor, context: KindContext);
108
208
  }
109
- export declare const sandboxKind: RuntimeKindDescriptorRecord<DefaultSandboxImplementation>;
209
+ export declare const sandboxKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<DefaultSandboxImplementation>;
110
210
  export {};
111
211
  //# sourceMappingURL=sandbox.kind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/sandbox.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAIjF,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;iBAMtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AA2BhF,eAAO,MAAM,6BAA6B;;iBAGxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;iBAKpC,CAAC;AAEH,eAAO,MAAM,sCAAsC;;iBAGjD,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;mBAI9B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,cAAM,4BAA4B;aAEhB,UAAU,EAAE,iBAAiB;aAC7B,OAAO,EAAE,OAAO;gBADhB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,OAAO;IAGjC,IAAI,MAAM,IAAI,iBAAiB,CAE9B;CACD;AAED,eAAO,MAAM,WAAW,2DAMtB,CAAC"}
1
+ {"version":3,"file":"sandbox.kind.d.ts","sourceRoot":"","sources":["../../src/kinds/sandbox.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,CAA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
6
  * and long-running background tasks.
7
7
  *
8
- * Schema shape: strict common base + `config` discriminated union.
8
+ * Schema shape: strict common base + an open, adapter-keyed `config`.
9
9
  *
10
10
  * - The base defines fields universal across every adapter:
11
11
  * id/kind/name + the sandbox shape (entrypoint, image, limits,
12
12
  * outboundProxy, liveView, persistent, env).
13
- * - Adapter-specific fields live under `config`. Each adapter package
14
- * defines its own concrete schema under its discriminator key.
13
+ * - Adapter-specific fields live under `config`, keyed by a non-empty
14
+ * `adapter` discriminator. Cloud provider adapter schemas live in their
15
+ * integrations owners (Cloudflare's in `@vibesdotdev/integrations-cloudflare`,
16
+ * DigitalOcean droplet and DOKS job configs in
17
+ * `@vibesdotdev/integrations-digitalocean`); this kind names no cloud
18
+ * provider, so a config for any adapter — including one contributed by a
19
+ * user plugin — parses here, and the adapter validates its own grammar.
20
+ * The local docker adapter is not a cloud integration and is defined here.
15
21
  */
16
22
  import * as z from 'zod/v4';
17
- import { createRuntimeKind } from '@vibesdotdev/runtime/factory/kind';
18
- import { RuntimeDescriptorSchema } from '@vibesdotdev/runtime/schemas/descriptor';
23
+ import { createRuntimeKind } from '@vibesdotdev/kernel/factory/kind';
24
+ import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
25
+ import { readKindDescriptor } from "./read-descriptor.js";
19
26
  import { deploymentEnvRequirementSchema } from "../schemas.js";
20
- import { INFRA_DISCOVERY_PATTERN, extractStem } from "./discovery.js";
27
+ import { INFRA_DISCOVERY_PATTERNS } from "./discovery.js";
21
28
  export const SandboxOutboundProxySchema = z.object({
22
29
  binding: z.string().min(1),
23
30
  workerPath: z.string().min(1).optional(),
@@ -30,8 +37,70 @@ export const SandboxResourceLimitsSchema = z.object({
30
37
  maxSubprocesses: z.number().int().positive().optional(),
31
38
  timeoutSeconds: z.number().int().positive().optional()
32
39
  });
40
+ /** Host bootstrap accepted by a provisioner; omitted preserves legacy cloud-init callers. */
41
+ export const SandboxBootstrapSchema = z.enum(['cloud-init', 'entrypoint']);
42
+ /** Local docker sandbox adapter: a container image plus volume mounts. */
43
+ export const DockerSandboxConfigSchema = z.object({
44
+ /** Container image. */
45
+ image: z.string(),
46
+ /** Volume mounts (hostPath: containerPath). */
47
+ volumes: z.record(z.string(), z.string()).optional()
48
+ });
49
+ /**
50
+ * Adapter-specific configuration: the adapter id plus its own fields. Each
51
+ * adapter package defines and parses its own config schema; this kind names
52
+ * no cloud provider, so a config for any adapter — including one contributed
53
+ * by a user plugin — parses here, and the adapter validates its own grammar.
54
+ */
55
+ export const SandboxConfigSchema = z.looseObject({
56
+ adapter: z.string().min(1)
57
+ });
58
+ const SandboxSlugSchema = z.string().trim().min(1);
59
+ /** Placement a host profile supplies when a launch omits size, region or image. */
60
+ export const SandboxHostPlacementDefaultsSchema = z.object({
61
+ size: SandboxSlugSchema.optional(),
62
+ region: SandboxSlugSchema.optional(),
63
+ image: SandboxSlugSchema.optional()
64
+ });
65
+ /**
66
+ * How the provider's `advancePause` stops compute billing:
67
+ * - `snapshot-destroy`: snapshot the disk, then delete the instance; only the
68
+ * snapshot bills while paused (a provider whose stopped instances still bill).
69
+ * - `power-off`: stop the instance in place; the provider stops compute billing.
70
+ */
71
+ export const SandboxPauseStrategySchema = z.enum(['snapshot-destroy', 'power-off']);
72
+ /**
73
+ * The fleet-host profile a provisioner declares: what `vibes fleet launch`
74
+ * may request from it and what it supplies on omission. Generic launch reads
75
+ * only this; a sandbox without a profile is never selected implicitly.
76
+ */
77
+ export const SandboxHostProfileSchema = z.object({
78
+ /** Host provider id recorded on the platform host row. */
79
+ provider: SandboxSlugSchema,
80
+ /** Other names a launch may select this profile by. */
81
+ aliases: z.array(SandboxSlugSchema).default([]),
82
+ /** CPU sizes a launch may request. Absent: the provider validates sizes itself. */
83
+ sizes: z.array(SandboxSlugSchema).min(1).optional(),
84
+ /** Sizes admitted only for a GPU launch. */
85
+ gpuSizes: z.array(SandboxSlugSchema).default([]),
86
+ /** Placement for an omitted value on a CPU launch. */
87
+ defaults: SandboxHostPlacementDefaultsSchema.default({}),
88
+ /**
89
+ * Region and image for an omitted value on a GPU launch. A GPU size is never
90
+ * defaulted: an omitted size must not start a paid GPU host.
91
+ */
92
+ gpuDefaults: SandboxHostPlacementDefaultsSchema.omit({ size: true }).strict().default({}),
93
+ /** Pause semantics of this provider's `advancePause`. Absent: the provider cannot pause. */
94
+ pause: SandboxPauseStrategySchema.optional()
95
+ });
96
+ export function hasSandboxHostLaunchPreflight(implementation) {
97
+ return typeof implementation?.preflightHostLaunch === 'function';
98
+ }
33
99
  const SandboxBaseSchema = RuntimeDescriptorSchema.extend({
34
100
  kind: z.literal('infra/sandbox'),
101
+ bootstrap: SandboxBootstrapSchema.optional(),
102
+ /** Fleet-host profile; present when this sandbox provisions fleet hosts. */
103
+ hostProfile: SandboxHostProfileSchema.optional(),
35
104
  /** Shell or script to run on sandbox start. */
36
105
  entrypoint: z.string().optional(),
37
106
  /** Container image or template snapshot. */
@@ -47,48 +116,25 @@ const SandboxBaseSchema = RuntimeDescriptorSchema.extend({
47
116
  /** Environment variable requirements. */
48
117
  env: z.array(deploymentEnvRequirementSchema).optional()
49
118
  });
50
- export const CloudflareSandboxConfigSchema = z.object({
51
- /** Container image or template snapshot. */
52
- image: z.string().optional()
53
- });
54
- export const DockerSandboxConfigSchema = z.object({
55
- /** Container image. */
56
- image: z.string(),
57
- /** Volume mounts (hostPath: containerPath). */
58
- volumes: z.record(z.string(), z.string()).optional()
59
- });
60
- export const DigitalOceanDropletSandboxConfigSchema = z.object({
61
- /** Droplet size slug (e.g., 's-2vcpu-2gb'). */
62
- dropletSize: z.string().min(1)
63
- });
64
- export const SandboxConfigSchema = z.union([
65
- CloudflareSandboxConfigSchema.extend({ adapter: z.literal('cloudflare-sandbox') }),
66
- DockerSandboxConfigSchema.extend({ adapter: z.literal('docker') }),
67
- DigitalOceanDropletSandboxConfigSchema.extend({ adapter: z.literal('digitalocean-droplet') })
68
- ]);
69
119
  export const SandboxDescriptorSchema = SandboxBaseSchema.extend({
70
- /**
71
- * Adapter-specific configuration. Discriminated union — each adapter
72
- * package defines its own config schema under its discriminator key.
73
- */
120
+ /** Adapter-specific configuration, parsed by the adapter that owns it. */
74
121
  config: SandboxConfigSchema.optional()
75
122
  });
76
123
  class DefaultSandboxImplementation {
77
124
  descriptor;
78
125
  context;
126
+ /** The descriptor as this kind's schema reads it. */
127
+ config;
79
128
  constructor(descriptor, context) {
80
129
  this.descriptor = descriptor;
81
130
  this.context = context;
82
- }
83
- get config() {
84
- return this.descriptor;
131
+ this.config = readKindDescriptor(SandboxDescriptorSchema, descriptor);
85
132
  }
86
133
  }
87
134
  export const sandboxKind = createRuntimeKind({
88
135
  id: 'infra/sandbox',
89
136
  descriptorSchema: SandboxDescriptorSchema,
90
137
  defaultImplementation: DefaultSandboxImplementation,
91
- discoveryPattern: INFRA_DISCOVERY_PATTERN,
92
- extractStem
138
+ discoveryPatterns: INFRA_DISCOVERY_PATTERNS
93
139
  });
94
140
  //# sourceMappingURL=sandbox.kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.kind.js","sourceRoot":"","sources":["../../src/kinds/sandbox.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ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-source.kind.ts';
3
+ export interface ComputeDemand {
4
+ os?: ComputeSourceOs;
5
+ arch?: ComputeSourceArch;
6
+ /** Extra capabilities the job needs; every one must be provided. */
7
+ labels?: readonly string[];
8
+ /**
9
+ * Whether the code about to run has been reviewed. `untrusted` is a fork
10
+ * PR or anything else where the ref is not controlled by the repository
11
+ * owner, and it restricts selection to ephemeral sources.
12
+ */
13
+ trust: 'trusted' | 'untrusted';
14
+ /** Requesting scope. Required to select a `byo` source. */
15
+ owner?: {
16
+ type: string;
17
+ id: string;
18
+ };
19
+ /** Wall-clock ceiling the lease must be able to cover. */
20
+ maxDurationSeconds?: number;
21
+ }
22
+ /**
23
+ * What a lease of this length would cost us, in the provider's own terms.
24
+ *
25
+ * Conservative on purpose. `usdPerSecondCpuActive` is only charged while the
26
+ * vCPUs are busy, and we do not measure CPU-seconds in CI, so ranking assumes
27
+ * they are busy the whole time. Assuming idle would rank a CPU-metered source
28
+ * as cheap and then hand us the bill — the failure the caller cannot see. A
29
+ * job that really does idle costs less than this says, never more.
30
+ *
31
+ * `minimumUsd` is applied as a floor rather than added, because that is how a
32
+ * provider minimum actually works: a 10-second droplet costs the minimum, not
33
+ * the minimum plus 10 seconds.
34
+ *
35
+ * When the caller states no duration there is nothing to multiply, so the
36
+ * comparison falls back to the fixed costs — which still orders a free
37
+ * bring-your-own machine below a paid one.
38
+ */
39
+ export declare function expectedCostUsd(source: ComputeSourceDescriptor, maxDurationSeconds: number | undefined): number;
40
+ /**
41
+ * Which registered compute source should serve this demand.
42
+ *
43
+ * Throws rather than returning undefined: a caller that cannot get the machine
44
+ * class it asked for must stop, not proceed on something else.
45
+ */
46
+ export declare function selectComputeSource(sources: readonly ComputeSourceDescriptor[], demand: ComputeDemand): ComputeSourceDescriptor;
47
+ /**
48
+ * The cost basis to bill a lease from, in the billing layer's own vocabulary.
49
+ *
50
+ * The rating engine takes `CostBasis[]` and, when given none, falls back to
51
+ * `unknownCostHeuristic` — a $0.0001/compute-second floor doubled by a safety
52
+ * multiplier, or $0.72/hour. Every source we own is cheaper than that: a
53
+ * Cloudflare `standard-4` at full CPU is $0.40/hour and a DigitalOcean
54
+ * `s-2vcpu-4gb` is $0.036/hour. Handing the engine the real number is
55
+ * therefore not a tightening — it stops CI from being billed at up to twenty
56
+ * times what it costs us.
57
+ *
58
+ * Deliberately uses the SAME rate `expectedCostUsd` ranks on, including the
59
+ * assumption that metered CPU is fully active. If selection and the invoice
60
+ * disagreed about what a source costs, one of them would be lying, and the
61
+ * cheaper-looking source would win work it could not afford. The assumption
62
+ * only ever errs toward billing our real exposure rather than under-recovering
63
+ * it, and it still lands well under the heuristic it replaces.
64
+ *
65
+ * `minimumUsd` is NOT expressed here. A provider floor applies to a lease, not
66
+ * to a second, and there is no way to say "per-unit, but never less than X" in
67
+ * a per-unit basis. Folding it into the rate would inflate every long lease.
68
+ * The floor belongs to whatever holds the lease, and this returns only what is
69
+ * true per second.
70
+ */
71
+ export declare function computeSourceCostBasis(source: ComputeSourceDescriptor): CostBasis[];
72
+ //# sourceMappingURL=select-compute-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-compute-source.d.ts","sourceRoot":"","sources":["../../src/kinds/select-compute-source.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5G,MAAM,WAAW,aAAa;IAC7B,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,2DAA2D;IAC3D,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA0BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,uBAAuB,EAC/B,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACpC,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,SAAS,uBAAuB,EAAE,EAC3C,MAAM,EAAE,aAAa,GACnB,uBAAuB,CA+EzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAAE,CAUnF"}