@cnc-tools/storm 0.0.0-stage → 0.5.0

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 (513) hide show
  1. package/bin/node-version.js +24 -0
  2. package/bin/storm.js +16 -0
  3. package/dist/application.d.ts +13 -0
  4. package/dist/application.js +23 -0
  5. package/dist/bin/storm.d.ts +1 -0
  6. package/dist/bin/storm.js +45 -0
  7. package/dist/build-info.js +3 -0
  8. package/dist/closed-terminal.d.ts +7 -0
  9. package/dist/closed-terminal.js +18 -0
  10. package/dist/combine-errors.d.ts +11 -0
  11. package/dist/combine-errors.js +19 -0
  12. package/dist/commands/dashboard.d.ts +11 -0
  13. package/dist/commands/dashboard.js +18 -0
  14. package/dist/commands/run/cleanup.d.ts +135 -0
  15. package/dist/commands/run/cleanup.js +171 -0
  16. package/dist/commands/run/command.d.ts +327 -0
  17. package/dist/commands/run/command.js +620 -0
  18. package/dist/commands/run/job-summary.d.ts +6 -0
  19. package/dist/commands/run/job-summary.js +31 -0
  20. package/dist/commands/run/live-view.d.ts +22 -0
  21. package/dist/commands/run/live-view.js +395 -0
  22. package/dist/commands/run/metadata.d.ts +47 -0
  23. package/dist/commands/run/metadata.js +83 -0
  24. package/dist/commands/run/mint-failed.d.ts +11 -0
  25. package/dist/commands/run/mint-failed.js +33 -0
  26. package/dist/commands/run/outcomes.d.ts +307 -0
  27. package/dist/commands/run/outcomes.js +332 -0
  28. package/dist/commands/run/progress.d.ts +44 -0
  29. package/dist/commands/run/progress.js +277 -0
  30. package/dist/commands/run/redaction.d.ts +15 -0
  31. package/dist/commands/run/redaction.js +40 -0
  32. package/dist/commands/run/run-collector.d.ts +30 -0
  33. package/dist/commands/run/run-collector.js +73 -0
  34. package/dist/commands/run/run-record.d.ts +144 -0
  35. package/dist/commands/run/run-record.js +96 -0
  36. package/dist/commands/run/tests-summary.d.ts +34 -0
  37. package/dist/commands/run/tests-summary.js +141 -0
  38. package/dist/commands/run/text.d.ts +22 -0
  39. package/dist/commands/run/text.js +74 -0
  40. package/dist/commands/run/view.d.ts +35 -0
  41. package/dist/commands/run/view.js +163 -0
  42. package/dist/commands/run/waterfall.d.ts +25 -0
  43. package/dist/commands/run/waterfall.js +108 -0
  44. package/dist/commands/run/worker-chart.d.ts +79 -0
  45. package/dist/commands/run/worker-chart.js +313 -0
  46. package/dist/commands/runs/facts.d.ts +150 -0
  47. package/dist/commands/runs/facts.js +292 -0
  48. package/dist/commands/runs/list/command.d.ts +86 -0
  49. package/dist/commands/runs/list/command.js +36 -0
  50. package/dist/commands/runs/list/metadata.d.ts +22 -0
  51. package/dist/commands/runs/list/metadata.js +19 -0
  52. package/dist/commands/runs/list/outcomes.d.ts +74 -0
  53. package/dist/commands/runs/list/outcomes.js +89 -0
  54. package/dist/commands/runs/logs/command.d.ts +72 -0
  55. package/dist/commands/runs/logs/command.js +51 -0
  56. package/dist/commands/runs/logs/metadata.d.ts +22 -0
  57. package/dist/commands/runs/logs/metadata.js +22 -0
  58. package/dist/commands/runs/logs/outcomes.d.ts +55 -0
  59. package/dist/commands/runs/logs/outcomes.js +77 -0
  60. package/dist/commands/runs/metadata.d.ts +3 -0
  61. package/dist/commands/runs/metadata.js +3 -0
  62. package/dist/commands/runs/past-run.d.ts +72 -0
  63. package/dist/commands/runs/past-run.js +99 -0
  64. package/dist/commands/runs/show/command.d.ts +176 -0
  65. package/dist/commands/runs/show/command.js +76 -0
  66. package/dist/commands/runs/show/metadata.d.ts +25 -0
  67. package/dist/commands/runs/show/metadata.js +22 -0
  68. package/dist/commands/runs/show/outcomes.d.ts +164 -0
  69. package/dist/commands/runs/show/outcomes.js +317 -0
  70. package/dist/config/by-name.d.ts +24 -0
  71. package/dist/config/by-name.js +26 -0
  72. package/dist/config/errors.d.ts +58 -0
  73. package/dist/config/errors.js +101 -0
  74. package/dist/config/gateways.d.ts +32 -0
  75. package/dist/config/gateways.js +1 -0
  76. package/dist/config/index.d.ts +9 -0
  77. package/dist/config/index.js +12 -0
  78. package/dist/config/live/config-gateway.d.ts +6 -0
  79. package/dist/config/live/config-gateway.js +71 -0
  80. package/dist/config/load.d.ts +54 -0
  81. package/dist/config/load.js +175 -0
  82. package/dist/config/resolve.d.ts +49 -0
  83. package/dist/config/resolve.js +94 -0
  84. package/dist/config/resource-config.d.ts +132 -0
  85. package/dist/config/resource-config.js +19 -0
  86. package/dist/config/schema.d.ts +64 -0
  87. package/dist/config/schema.js +57 -0
  88. package/dist/config/set.d.ts +16 -0
  89. package/dist/config/set.js +55 -0
  90. package/dist/config/settings-file.d.ts +41 -0
  91. package/dist/config/settings-file.js +72 -0
  92. package/dist/config-file/define.d.ts +37 -0
  93. package/dist/config-file/define.js +9 -0
  94. package/dist/config-file/toolchain.d.ts +9 -0
  95. package/dist/config-file/toolchain.js +41 -0
  96. package/dist/context.d.ts +86 -0
  97. package/dist/context.js +43 -0
  98. package/dist/core/command-provider.d.ts +126 -0
  99. package/dist/core/command-provider.js +13 -0
  100. package/dist/core/command-slots.d.ts +67 -0
  101. package/dist/core/command-slots.js +136 -0
  102. package/dist/core/events.d.ts +128 -0
  103. package/dist/core/events.js +15 -0
  104. package/dist/core/gateways.d.ts +249 -0
  105. package/dist/core/gateways.js +1 -0
  106. package/dist/core/index.d.ts +20 -0
  107. package/dist/core/index.js +18 -0
  108. package/dist/core/keyed.d.ts +12 -0
  109. package/dist/core/keyed.js +24 -0
  110. package/dist/core/lane.d.ts +46 -0
  111. package/dist/core/lane.js +5 -0
  112. package/dist/core/limit.d.ts +9 -0
  113. package/dist/core/limit.js +29 -0
  114. package/dist/core/live/command-gateway.d.ts +11 -0
  115. package/dist/core/live/command-gateway.js +83 -0
  116. package/dist/core/live/job-summary-gateway.d.ts +5 -0
  117. package/dist/core/live/job-summary-gateway.js +20 -0
  118. package/dist/core/live/progress-terminal.d.ts +20 -0
  119. package/dist/core/live/progress-terminal.js +173 -0
  120. package/dist/core/live/run-directory-gateway.d.ts +24 -0
  121. package/dist/core/live/run-directory-gateway.js +437 -0
  122. package/dist/core/mint.d.ts +10 -0
  123. package/dist/core/mint.js +14 -0
  124. package/dist/core/payload.d.ts +26 -0
  125. package/dist/core/payload.js +33 -0
  126. package/dist/core/presentation.d.ts +87 -0
  127. package/dist/core/presentation.js +5 -0
  128. package/dist/core/presentations.d.ts +56 -0
  129. package/dist/core/presentations.js +66 -0
  130. package/dist/core/provider.d.ts +69 -0
  131. package/dist/core/provider.js +5 -0
  132. package/dist/core/resource.d.ts +262 -0
  133. package/dist/core/resource.js +6 -0
  134. package/dist/core/resources.d.ts +131 -0
  135. package/dist/core/resources.js +254 -0
  136. package/dist/core/run-directory.d.ts +69 -0
  137. package/dist/core/run-directory.js +94 -0
  138. package/dist/core/run-state.d.ts +152 -0
  139. package/dist/core/run-state.js +313 -0
  140. package/dist/core/run.d.ts +187 -0
  141. package/dist/core/run.js +321 -0
  142. package/dist/core/state-directory.d.ts +19 -0
  143. package/dist/core/state-directory.js +29 -0
  144. package/dist/core/timeline.d.ts +63 -0
  145. package/dist/core/timeline.js +97 -0
  146. package/dist/core/timing.d.ts +22 -0
  147. package/dist/core/timing.js +26 -0
  148. package/dist/credential/credential.d.ts +46 -0
  149. package/dist/credential/credential.js +80 -0
  150. package/dist/credential/diagnosis.d.ts +18 -0
  151. package/dist/credential/diagnosis.js +99 -0
  152. package/dist/credential/gateways.d.ts +109 -0
  153. package/dist/credential/gateways.js +1 -0
  154. package/dist/credential/index.d.ts +7 -0
  155. package/dist/credential/index.js +7 -0
  156. package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
  157. package/dist/credential/live/github-actions-token-gateway.js +43 -0
  158. package/dist/credential/live/github-actions-token-response.d.ts +19 -0
  159. package/dist/credential/live/github-actions-token-response.js +49 -0
  160. package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
  161. package/dist/credential/live/vercel-cli-gateway.js +64 -0
  162. package/dist/credential/live/vercel-output.d.ts +60 -0
  163. package/dist/credential/live/vercel-output.js +122 -0
  164. package/dist/credential/live/vercel-process.d.ts +14 -0
  165. package/dist/credential/live/vercel-process.js +3 -0
  166. package/dist/credential/settle.d.ts +31 -0
  167. package/dist/credential/settle.js +49 -0
  168. package/dist/credential/source.d.ts +110 -0
  169. package/dist/credential/source.js +114 -0
  170. package/dist/help-logo.d.ts +11 -0
  171. package/dist/help-logo.js +56 -0
  172. package/dist/presentation.d.ts +26 -0
  173. package/dist/presentation.js +21 -0
  174. package/dist/resources/github/cleanup.d.ts +23 -0
  175. package/dist/resources/github/cleanup.js +39 -0
  176. package/dist/resources/github/command.d.ts +74 -0
  177. package/dist/resources/github/command.js +117 -0
  178. package/dist/resources/github/config.d.ts +16 -0
  179. package/dist/resources/github/config.js +37 -0
  180. package/dist/resources/github/events.d.ts +26 -0
  181. package/dist/resources/github/events.js +2 -0
  182. package/dist/resources/github/fixture-repo.d.ts +69 -0
  183. package/dist/resources/github/fixture-repo.js +60 -0
  184. package/dist/resources/github/gateways.d.ts +62 -0
  185. package/dist/resources/github/gateways.js +1 -0
  186. package/dist/resources/github/index.d.ts +12 -0
  187. package/dist/resources/github/index.js +15 -0
  188. package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
  189. package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
  190. package/dist/resources/github/live/gateways.d.ts +6 -0
  191. package/dist/resources/github/live/gateways.js +13 -0
  192. package/dist/resources/github/presentation.d.ts +13 -0
  193. package/dist/resources/github/presentation.js +43 -0
  194. package/dist/resources/github/provider.d.ts +66 -0
  195. package/dist/resources/github/provider.js +58 -0
  196. package/dist/resources/github/resource-provider.d.ts +6 -0
  197. package/dist/resources/github/resource-provider.js +20 -0
  198. package/dist/resources/github/resource.d.ts +33 -0
  199. package/dist/resources/github/resource.js +12 -0
  200. package/dist/resources/testserver/cleanup.d.ts +14 -0
  201. package/dist/resources/testserver/cleanup.js +22 -0
  202. package/dist/resources/testserver/command.d.ts +322 -0
  203. package/dist/resources/testserver/command.js +245 -0
  204. package/dist/resources/testserver/commands/app.d.ts +18 -0
  205. package/dist/resources/testserver/commands/app.js +3 -0
  206. package/dist/resources/testserver/commands/create/command.d.ts +136 -0
  207. package/dist/resources/testserver/commands/create/command.js +158 -0
  208. package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
  209. package/dist/resources/testserver/commands/create/metadata.js +45 -0
  210. package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
  211. package/dist/resources/testserver/commands/create/outcomes.js +172 -0
  212. package/dist/resources/testserver/commands/list/command.d.ts +60 -0
  213. package/dist/resources/testserver/commands/list/command.js +56 -0
  214. package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
  215. package/dist/resources/testserver/commands/list/metadata.js +9 -0
  216. package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
  217. package/dist/resources/testserver/commands/list/outcomes.js +152 -0
  218. package/dist/resources/testserver/config.d.ts +18 -0
  219. package/dist/resources/testserver/config.js +77 -0
  220. package/dist/resources/testserver/credential-facts.d.ts +80 -0
  221. package/dist/resources/testserver/credential-facts.js +83 -0
  222. package/dist/resources/testserver/events.d.ts +59 -0
  223. package/dist/resources/testserver/events.js +4 -0
  224. package/dist/resources/testserver/index.d.ts +16 -0
  225. package/dist/resources/testserver/index.js +24 -0
  226. package/dist/resources/testserver/lane.d.ts +28 -0
  227. package/dist/resources/testserver/lane.js +139 -0
  228. package/dist/resources/testserver/live/gateways.d.ts +6 -0
  229. package/dist/resources/testserver/live/gateways.js +26 -0
  230. package/dist/resources/testserver/options.d.ts +5 -0
  231. package/dist/resources/testserver/options.js +5 -0
  232. package/dist/resources/testserver/pool/channels.d.ts +80 -0
  233. package/dist/resources/testserver/pool/channels.js +48 -0
  234. package/dist/resources/testserver/pool/create.d.ts +48 -0
  235. package/dist/resources/testserver/pool/create.js +45 -0
  236. package/dist/resources/testserver/pool/directory.d.ts +4 -0
  237. package/dist/resources/testserver/pool/directory.js +5 -0
  238. package/dist/resources/testserver/pool/gateways.d.ts +190 -0
  239. package/dist/resources/testserver/pool/gateways.js +1 -0
  240. package/dist/resources/testserver/pool/host.d.ts +8 -0
  241. package/dist/resources/testserver/pool/host.js +21 -0
  242. package/dist/resources/testserver/pool/index.d.ts +9 -0
  243. package/dist/resources/testserver/pool/index.js +10 -0
  244. package/dist/resources/testserver/pool/inspect.d.ts +53 -0
  245. package/dist/resources/testserver/pool/inspect.js +45 -0
  246. package/dist/resources/testserver/pool/lease.d.ts +84 -0
  247. package/dist/resources/testserver/pool/lease.js +125 -0
  248. package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
  249. package/dist/resources/testserver/pool/live/pool-records.js +70 -0
  250. package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
  251. package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
  252. package/dist/resources/testserver/pool/staleness.d.ts +16 -0
  253. package/dist/resources/testserver/pool/staleness.js +27 -0
  254. package/dist/resources/testserver/presentation.d.ts +9 -0
  255. package/dist/resources/testserver/presentation.js +217 -0
  256. package/dist/resources/testserver/provider.d.ts +177 -0
  257. package/dist/resources/testserver/provider.js +254 -0
  258. package/dist/resources/testserver/ran.d.ts +87 -0
  259. package/dist/resources/testserver/ran.js +140 -0
  260. package/dist/resources/testserver/resource-provider.d.ts +12 -0
  261. package/dist/resources/testserver/resource-provider.js +38 -0
  262. package/dist/resources/testserver/resource.d.ts +32 -0
  263. package/dist/resources/testserver/resource.js +10 -0
  264. package/dist/resources/testserver/run-sandbox.d.ts +13 -0
  265. package/dist/resources/testserver/run-sandbox.js +6 -0
  266. package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
  267. package/dist/resources/testserver/sandbox/channels.js +21 -0
  268. package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
  269. package/dist/resources/testserver/sandbox/create-failure.js +65 -0
  270. package/dist/resources/testserver/sandbox/create.d.ts +29 -0
  271. package/dist/resources/testserver/sandbox/create.js +37 -0
  272. package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
  273. package/dist/resources/testserver/sandbox/gateways.js +1 -0
  274. package/dist/resources/testserver/sandbox/index.d.ts +6 -0
  275. package/dist/resources/testserver/sandbox/index.js +7 -0
  276. package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
  277. package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
  278. package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
  279. package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
  280. package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
  281. package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
  282. package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
  283. package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
  284. package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
  285. package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
  286. package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
  287. package/dist/resources/testserver/sandbox/live/sse.js +32 -0
  288. package/dist/resources.d.ts +452 -0
  289. package/dist/resources.js +88 -0
  290. package/dist/runner/base.d.ts +40 -0
  291. package/dist/runner/base.js +52 -0
  292. package/dist/runner/context.d.ts +13 -0
  293. package/dist/runner/context.js +9 -0
  294. package/dist/runner/events.d.ts +179 -0
  295. package/dist/runner/events.js +16 -0
  296. package/dist/runner/gateways.d.ts +351 -0
  297. package/dist/runner/gateways.js +3 -0
  298. package/dist/runner/index.d.ts +19 -0
  299. package/dist/runner/index.js +18 -0
  300. package/dist/runner/live/checkout-gateway.d.ts +3 -0
  301. package/dist/runner/live/checkout-gateway.js +206 -0
  302. package/dist/runner/live/git-output.d.ts +14 -0
  303. package/dist/runner/live/git-output.js +32 -0
  304. package/dist/runner/live/sandbox-errors.d.ts +7 -0
  305. package/dist/runner/live/sandbox-errors.js +21 -0
  306. package/dist/runner/live/sandbox-gateway.d.ts +7 -0
  307. package/dist/runner/live/sandbox-gateway.js +427 -0
  308. package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
  309. package/dist/runner/live/snapshot-cache-gateway.js +104 -0
  310. package/dist/runner/live/snapshot-records.d.ts +11 -0
  311. package/dist/runner/live/snapshot-records.js +57 -0
  312. package/dist/runner/live/terminal.d.ts +16 -0
  313. package/dist/runner/live/terminal.js +37 -0
  314. package/dist/runner/live/user.d.ts +2 -0
  315. package/dist/runner/live/user.js +11 -0
  316. package/dist/runner/output.d.ts +23 -0
  317. package/dist/runner/output.js +58 -0
  318. package/dist/runner/prepare.d.ts +67 -0
  319. package/dist/runner/prepare.js +59 -0
  320. package/dist/runner/ready.d.ts +68 -0
  321. package/dist/runner/ready.js +159 -0
  322. package/dist/runner/recipe.d.ts +126 -0
  323. package/dist/runner/recipe.js +302 -0
  324. package/dist/runner/remote-command.d.ts +77 -0
  325. package/dist/runner/remote-command.js +127 -0
  326. package/dist/runner/scope.d.ts +58 -0
  327. package/dist/runner/scope.js +117 -0
  328. package/dist/runner/snapshot-build.d.ts +33 -0
  329. package/dist/runner/snapshot-build.js +112 -0
  330. package/dist/runner/snapshot-cache.d.ts +84 -0
  331. package/dist/runner/snapshot-cache.js +126 -0
  332. package/dist/runner/snapshot-key.d.ts +52 -0
  333. package/dist/runner/snapshot-key.js +91 -0
  334. package/dist/runner/steps.d.ts +41 -0
  335. package/dist/runner/steps.js +49 -0
  336. package/dist/sdk/container/api-request.d.ts +32 -0
  337. package/dist/sdk/container/api-request.js +46 -0
  338. package/dist/sdk/container/container.d.ts +144 -0
  339. package/dist/sdk/container/container.js +346 -0
  340. package/dist/sdk/container/feature-flags.d.ts +37 -0
  341. package/dist/sdk/container/feature-flags.js +118 -0
  342. package/dist/sdk/container/gateways.d.ts +108 -0
  343. package/dist/sdk/container/gateways.js +1 -0
  344. package/dist/sdk/container/index.d.ts +5 -0
  345. package/dist/sdk/container/index.js +5 -0
  346. package/dist/sdk/container/live/container-gateway.d.ts +17 -0
  347. package/dist/sdk/container/live/container-gateway.js +114 -0
  348. package/dist/sdk/factories/build.d.ts +66 -0
  349. package/dist/sdk/factories/build.js +98 -0
  350. package/dist/sdk/factories/definition.d.ts +28 -0
  351. package/dist/sdk/factories/definition.js +16 -0
  352. package/dist/sdk/factories/definitions.d.ts +166 -0
  353. package/dist/sdk/factories/definitions.js +235 -0
  354. package/dist/sdk/factories/gateways.d.ts +25 -0
  355. package/dist/sdk/factories/gateways.js +1 -0
  356. package/dist/sdk/factories/index.d.ts +5 -0
  357. package/dist/sdk/factories/index.js +5 -0
  358. package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
  359. package/dist/sdk/factories/live/factory-gateway.js +29 -0
  360. package/dist/sdk/index.d.ts +7 -0
  361. package/dist/sdk/index.js +15 -0
  362. package/dist/sdk/payload/index.d.ts +2 -0
  363. package/dist/sdk/payload/index.js +4 -0
  364. package/dist/sdk/payload/payload.d.ts +47 -0
  365. package/dist/sdk/payload/payload.js +74 -0
  366. package/dist/sdk/payload/test-events.d.ts +102 -0
  367. package/dist/sdk/payload/test-events.js +59 -0
  368. package/dist/sdk/proxy/exchange.d.ts +58 -0
  369. package/dist/sdk/proxy/exchange.js +173 -0
  370. package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
  371. package/dist/sdk/proxy/faulted-exchange.js +106 -0
  372. package/dist/sdk/proxy/faults.d.ts +133 -0
  373. package/dist/sdk/proxy/faults.js +147 -0
  374. package/dist/sdk/proxy/index.d.ts +3 -0
  375. package/dist/sdk/proxy/index.js +3 -0
  376. package/dist/sdk/proxy/proxy.d.ts +93 -0
  377. package/dist/sdk/proxy/proxy.js +99 -0
  378. package/dist/sdk/proxy/records.d.ts +56 -0
  379. package/dist/sdk/proxy/records.js +56 -0
  380. package/dist/sdk/records/body.d.ts +89 -0
  381. package/dist/sdk/records/body.js +236 -0
  382. package/dist/sdk/records/index.d.ts +2 -0
  383. package/dist/sdk/records/index.js +4 -0
  384. package/dist/sdk/records/records.d.ts +49 -0
  385. package/dist/sdk/records/records.js +16 -0
  386. package/dist/sdk/seed/index.d.ts +1 -0
  387. package/dist/sdk/seed/index.js +3 -0
  388. package/dist/sdk/seed/seed.d.ts +221 -0
  389. package/dist/sdk/seed/seed.js +171 -0
  390. package/dist/sdk/testserver/clock.d.ts +8 -0
  391. package/dist/sdk/testserver/clock.js +10 -0
  392. package/dist/sdk/testserver/failure.d.ts +73 -0
  393. package/dist/sdk/testserver/failure.js +61 -0
  394. package/dist/sdk/testserver/index.d.ts +5 -0
  395. package/dist/sdk/testserver/index.js +8 -0
  396. package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
  397. package/dist/sdk/testserver/live/connect-failure.js +30 -0
  398. package/dist/sdk/testserver/live/request.d.ts +69 -0
  399. package/dist/sdk/testserver/live/request.js +89 -0
  400. package/dist/sdk/testserver/service-ids.d.ts +19 -0
  401. package/dist/sdk/testserver/service-ids.js +77 -0
  402. package/dist/sdk/testserver/test-id.d.ts +15 -0
  403. package/dist/sdk/testserver/test-id.js +28 -0
  404. package/dist/story/align.d.ts +37 -0
  405. package/dist/story/align.js +39 -0
  406. package/dist/story/artifact.d.ts +60 -0
  407. package/dist/story/artifact.js +93 -0
  408. package/dist/story/definition.d.ts +52 -0
  409. package/dist/story/definition.js +9 -0
  410. package/dist/story/diff.d.ts +9 -0
  411. package/dist/story/diff.js +97 -0
  412. package/dist/story/errors.d.ts +14 -0
  413. package/dist/story/errors.js +21 -0
  414. package/dist/story/gateways.d.ts +74 -0
  415. package/dist/story/gateways.js +3 -0
  416. package/dist/story/host.d.ts +27 -0
  417. package/dist/story/host.js +97 -0
  418. package/dist/story/index.d.ts +7 -0
  419. package/dist/story/index.js +9 -0
  420. package/dist/story/json.d.ts +16 -0
  421. package/dist/story/json.js +59 -0
  422. package/dist/story/live/artifact-gateway.d.ts +2 -0
  423. package/dist/story/live/artifact-gateway.js +82 -0
  424. package/dist/story/mode.d.ts +17 -0
  425. package/dist/story/mode.js +21 -0
  426. package/dist/story/orphans.d.ts +17 -0
  427. package/dist/story/orphans.js +15 -0
  428. package/dist/story/report.d.ts +30 -0
  429. package/dist/story/report.js +118 -0
  430. package/dist/story/run.d.ts +49 -0
  431. package/dist/story/run.js +160 -0
  432. package/dist/story/sequence.d.ts +30 -0
  433. package/dist/story/sequence.js +74 -0
  434. package/dist/story/settle.d.ts +94 -0
  435. package/dist/story/settle.js +70 -0
  436. package/dist/time/duration.d.ts +19 -0
  437. package/dist/time/duration.js +37 -0
  438. package/dist/time/index.d.ts +2 -0
  439. package/dist/time/index.js +4 -0
  440. package/dist/time/time.d.ts +15 -0
  441. package/dist/time/time.js +23 -0
  442. package/dist/vercel-cli/ansi.d.ts +13 -0
  443. package/dist/vercel-cli/ansi.js +32 -0
  444. package/dist/vercel-cli/arguments.d.ts +25 -0
  445. package/dist/vercel-cli/arguments.js +78 -0
  446. package/dist/vercel-cli/auth-config.d.ts +43 -0
  447. package/dist/vercel-cli/auth-config.js +36 -0
  448. package/dist/vercel-cli/clock.d.ts +9 -0
  449. package/dist/vercel-cli/clock.js +10 -0
  450. package/dist/vercel-cli/config-files.d.ts +24 -0
  451. package/dist/vercel-cli/config-files.js +40 -0
  452. package/dist/vercel-cli/context.d.ts +12 -0
  453. package/dist/vercel-cli/context.js +12 -0
  454. package/dist/vercel-cli/driver.d.ts +218 -0
  455. package/dist/vercel-cli/driver.js +364 -0
  456. package/dist/vercel-cli/entry.d.ts +8 -0
  457. package/dist/vercel-cli/entry.js +13 -0
  458. package/dist/vercel-cli/environment.d.ts +33 -0
  459. package/dist/vercel-cli/environment.js +72 -0
  460. package/dist/vercel-cli/errors.d.ts +8 -0
  461. package/dist/vercel-cli/errors.js +8 -0
  462. package/dist/vercel-cli/gateways.d.ts +103 -0
  463. package/dist/vercel-cli/gateways.js +4 -0
  464. package/dist/vercel-cli/index.d.ts +10 -0
  465. package/dist/vercel-cli/index.js +15 -0
  466. package/dist/vercel-cli/invocation.d.ts +234 -0
  467. package/dist/vercel-cli/invocation.js +397 -0
  468. package/dist/vercel-cli/keys.d.ts +14 -0
  469. package/dist/vercel-cli/keys.js +12 -0
  470. package/dist/vercel-cli/live/config-files.d.ts +28 -0
  471. package/dist/vercel-cli/live/config-files.js +66 -0
  472. package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
  473. package/dist/vercel-cli/live/process-gateway.js +178 -0
  474. package/dist/vercel-cli/redaction.d.ts +13 -0
  475. package/dist/vercel-cli/redaction.js +22 -0
  476. package/dist/vercel-cli/report.d.ts +22 -0
  477. package/dist/vercel-cli/report.js +110 -0
  478. package/dist/vercel-cli/verbose.d.ts +7 -0
  479. package/dist/vercel-cli/verbose.js +24 -0
  480. package/dist/version.d.ts +20 -0
  481. package/dist/version.js +57 -0
  482. package/dist/vitest/config.d.ts +51 -0
  483. package/dist/vitest/config.js +61 -0
  484. package/dist/vitest/container-scope.d.ts +108 -0
  485. package/dist/vitest/container-scope.js +234 -0
  486. package/dist/vitest/diagnostics.d.ts +146 -0
  487. package/dist/vitest/diagnostics.js +306 -0
  488. package/dist/vitest/fixtures.d.ts +64 -0
  489. package/dist/vitest/fixtures.js +172 -0
  490. package/dist/vitest/gateways.d.ts +47 -0
  491. package/dist/vitest/gateways.js +3 -0
  492. package/dist/vitest/index.d.ts +3 -0
  493. package/dist/vitest/index.js +9 -0
  494. package/dist/vitest/list-output.d.ts +3 -0
  495. package/dist/vitest/list-output.js +19 -0
  496. package/dist/vitest/live/list-gateway.d.ts +7 -0
  497. package/dist/vitest/live/list-gateway.js +60 -0
  498. package/dist/vitest/ownership.d.ts +29 -0
  499. package/dist/vitest/ownership.js +68 -0
  500. package/dist/vitest/plan.d.ts +33 -0
  501. package/dist/vitest/plan.js +73 -0
  502. package/dist/vitest/sandbox.d.ts +16 -0
  503. package/dist/vitest/sandbox.js +35 -0
  504. package/dist/vitest/test-events.d.ts +41 -0
  505. package/dist/vitest/test-events.js +92 -0
  506. package/dist/vitest/test-results.d.ts +84 -0
  507. package/dist/vitest/test-results.js +160 -0
  508. package/dist/vitest/types.d.ts +68 -0
  509. package/dist/vitest/types.js +4 -0
  510. package/package.json +123 -4
  511. package/skills/overview.md +32 -0
  512. package/skills/read-run-output.md +65 -0
  513. package/README.md +0 -3
@@ -0,0 +1,77 @@
1
+ // The Testserver pool resource's config: its section `resources.testserverPool` in `storm.config.ts`, the rule
2
+ // and default of each option, and the checks across its options. `config` loads, reads `--set` and merges against it;
3
+ // the command half (`command.ts`) settles the resolved options into the run's request.
4
+ import { checkBoolean, checkNonEmptyString, describeValue, optionKeyPath, readBooleanText, readTextAsIs, readWholeNumberText, wrongValue, } from "../../config/index.js";
5
+ import { parseDuration, parseTtl } from "../../time/index.js";
6
+ import { MAX_SANDBOXES, MIN_SANDBOXES } from "./options.js";
7
+ import { DEFAULT_TTL_MINUTES } from "./sandbox/index.js";
8
+ /** The resource's name, its key under `resources`. */
9
+ const NAME = "testserverPool";
10
+ function sandboxCount(value) {
11
+ return typeof value === "number" && Number.isInteger(value) && value >= MIN_SANDBOXES && value <= MAX_SANDBOXES
12
+ ? { ok: true, value }
13
+ : wrongValue(`must be a whole number from ${MIN_SANDBOXES} to ${MAX_SANDBOXES}, not ${describeValue(value)}`);
14
+ }
15
+ function duration(value) {
16
+ return typeof value === "string" && parseDuration(value) !== undefined
17
+ ? { ok: true, value }
18
+ : wrongValue(`must be a whole number of minutes or hours, such as 30m or 2h, not ${describeValue(value)}`);
19
+ }
20
+ function ttl(value) {
21
+ return typeof value === "string" && parseTtl(value) !== undefined
22
+ ? { ok: true, value }
23
+ : wrongValue(`must be a whole number of minutes or hours from 10m to 5h, not ${describeValue(value)}`);
24
+ }
25
+ /** The tag a value `testserverPool()` made carries. */
26
+ const KIND = "testserverPool";
27
+ /**
28
+ * The Testserver pool resource's config. Every option has a default, so a run that holds the resource, by the file or
29
+ * by a `--set` of any option, has them all. Its checks across options:
30
+ *
31
+ * - under `noCreate`, which creates no Testserver sandbox, a `ttl` from a flag is refused, and the file's is unused;
32
+ * - otherwise the `ttl` must be longer than `minTimeLeft`, or no Testserver sandbox the run created would have the time
33
+ * left the run asks for.
34
+ */
35
+ export const testserverPoolConfig = {
36
+ name: NAME,
37
+ factory: { kind: KIND, call: "testserverPool({ … })", subpath: "@cnc-tools/storm/testserver" },
38
+ options: {
39
+ sandboxes: { check: sandboxCount, readText: readWholeNumberText, default: MIN_SANDBOXES },
40
+ build: { check: checkNonEmptyString, readText: readTextAsIs, default: "stable" },
41
+ minTimeLeft: { check: duration, readText: readTextAsIs, default: "30m" },
42
+ ttl: { check: ttl, readText: readTextAsIs, default: "5h" },
43
+ noCreate: { check: checkBoolean, readText: readBooleanText, default: false },
44
+ },
45
+ resolve({ sandboxes, build, minTimeLeft, ttl, noCreate }) {
46
+ const minTimeLeftMinutes = parseDuration(minTimeLeft.value) ?? 0;
47
+ const settings = { sandboxes: sandboxes.value, build: build.value, minTimeLeftMinutes };
48
+ if (noCreate.value) {
49
+ if (ttl.source !== "flag")
50
+ return { ok: true, value: { ...settings, provisioning: { kind: "no-create" } } };
51
+ return refuse({
52
+ option: "ttl",
53
+ problem: `doesn't apply with ${optionKeyPath(NAME, "noCreate")}=true, which creates no Testserver sandbox`,
54
+ involves: ["ttl", "noCreate"],
55
+ });
56
+ }
57
+ const ttlMinutes = parseTtl(ttl.value) ?? DEFAULT_TTL_MINUTES;
58
+ if (ttlMinutes > minTimeLeftMinutes)
59
+ return { ok: true, value: { ...settings, provisioning: { kind: "create", ttlMinutes } } };
60
+ // Name the value that was given over the other's default: a file's or a flag's `minTimeLeft` against the default
61
+ // `ttl` is the `minTimeLeft` that is too long.
62
+ return refuse(ttl.source === "default" && minTimeLeft.source !== "default"
63
+ ? {
64
+ option: "minTimeLeft",
65
+ problem: `must be shorter than ${optionKeyPath(NAME, "ttl")} (${ttl.value}), not ${minTimeLeft.value}`,
66
+ involves: ["minTimeLeft", "ttl"],
67
+ }
68
+ : {
69
+ option: "ttl",
70
+ problem: `must be longer than ${optionKeyPath(NAME, "minTimeLeft")} (${minTimeLeft.value}), not ${ttl.value}`,
71
+ involves: ["ttl", "minTimeLeft"],
72
+ });
73
+ },
74
+ };
75
+ function refuse(problem) {
76
+ return { ok: false, problems: [problem] };
77
+ }
@@ -0,0 +1,80 @@
1
+ import { z } from "zod";
2
+ import { type CredentialOrigin, type TokenRequestFailure } from "../../credential/index.ts";
3
+ /** The progress line a GitHub Actions OIDC token request prints as it starts, in `run` and `pool create`. */
4
+ export declare const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token\u2026";
5
+ /** The facts of a failed GitHub Actions OIDC token request that `token_request_failed` carries. */
6
+ export declare const tokenRequestFailureShape: {
7
+ /** Why it failed: the job's variables are missing, or the request failed. */
8
+ cause: z.ZodEnum<{
9
+ "request-failed": "request-failed";
10
+ "variables-missing": "variables-missing";
11
+ }>;
12
+ /** The variables that aren't set, under variables-missing; null otherwise. */
13
+ missing: z.ZodNullable<z.ZodArray<z.ZodEnum<{
14
+ ACTIONS_ID_TOKEN_REQUEST_TOKEN: "ACTIONS_ID_TOKEN_REQUEST_TOKEN";
15
+ ACTIONS_ID_TOKEN_REQUEST_URL: "ACTIONS_ID_TOKEN_REQUEST_URL";
16
+ }>>>;
17
+ /** The HTTP status GitHub answered the last attempt with; null when it answered none, or 2xx without a token. */
18
+ status: z.ZodNullable<z.ZodNumber>;
19
+ /** What GitHub or the connection said to the last attempt, at most 200 characters; null when nothing. */
20
+ said: z.ZodNullable<z.ZodString>;
21
+ /** The cause, for a person. */
22
+ detail: z.ZodString;
23
+ /** The one fix. */
24
+ fix: z.ZodString;
25
+ };
26
+ /** A failed GitHub Actions OIDC token request as `token_request_failed` reports it. */
27
+ export declare function tokenRequestFailureFacts(failure: TokenRequestFailure): {
28
+ cause: "variables-missing";
29
+ missing: import("../../credential/gateways.ts").TokenRequestVariable[];
30
+ status: null;
31
+ said: null;
32
+ detail: string;
33
+ fix: string;
34
+ } | {
35
+ cause: "request-failed";
36
+ missing: null;
37
+ status: number | null;
38
+ said: string | null;
39
+ detail: string;
40
+ fix: string;
41
+ };
42
+ /** Where a rejected credential came from, as `credential_rejected` carries it in `origin`. */
43
+ export declare const credentialOriginSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
44
+ source: z.ZodLiteral<"mint">;
45
+ team: z.ZodString;
46
+ project: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ source: z.ZodLiteral<"github-actions">;
49
+ claims: z.ZodNullable<z.ZodObject<{
50
+ aud: z.ZodString;
51
+ repository: z.ZodString;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>], "source">;
54
+ type CredentialOriginFacts = z.infer<typeof credentialOriginSchema>;
55
+ /** The facts of a rejected credential that `credential_rejected` carries: where it came from, and the one fix. */
56
+ export declare const rejectedCredentialShape: {
57
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
+ source: z.ZodLiteral<"mint">;
59
+ team: z.ZodString;
60
+ project: z.ZodString;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ source: z.ZodLiteral<"github-actions">;
63
+ claims: z.ZodNullable<z.ZodObject<{
64
+ aud: z.ZodString;
65
+ repository: z.ZodString;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>], "source">;
68
+ /** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
69
+ fix: z.ZodString;
70
+ };
71
+ /** Where a rejected credential came from, and its fix, as `credential_rejected` reports them. */
72
+ export declare function rejectedCredentialFacts(origin: CredentialOrigin): {
73
+ readonly origin: CredentialOriginFacts;
74
+ readonly fix: string;
75
+ };
76
+ /** The opening of `credential_rejected`'s message: which credential the Testserver control plane rejected. */
77
+ export declare function rejectedCredentialText(origin: CredentialOriginFacts): string;
78
+ /** The rows `credential_rejected` shows for where the credential came from. */
79
+ export declare function credentialOriginRows(origin: CredentialOriginFacts): (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
80
+ export {};
@@ -0,0 +1,83 @@
1
+ // How the Testserver pool's `run` errors and `pool create` report a credential source's failures: a failed GitHub
2
+ // Actions OIDC token request, and where a rejected credential came from.
3
+ import { z } from "zod";
4
+ import { describeTokenRequestFailure, rejectedCredentialFix, } from "../../credential/index.js";
5
+ /** The progress line a GitHub Actions OIDC token request prints as it starts, in `run` and `pool create`. */
6
+ export const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token…";
7
+ /** The facts of a failed GitHub Actions OIDC token request that `token_request_failed` carries. */
8
+ export const tokenRequestFailureShape = {
9
+ /** Why it failed: the job's variables are missing, or the request failed. */
10
+ cause: z.enum(["variables-missing", "request-failed"]),
11
+ /** The variables that aren't set, under variables-missing; null otherwise. */
12
+ missing: z.array(z.enum(["ACTIONS_ID_TOKEN_REQUEST_URL", "ACTIONS_ID_TOKEN_REQUEST_TOKEN"])).nullable(),
13
+ /** The HTTP status GitHub answered the last attempt with; null when it answered none, or 2xx without a token. */
14
+ status: z.number().nullable(),
15
+ /** What GitHub or the connection said to the last attempt, at most 200 characters; null when nothing. */
16
+ said: z.string().nullable(),
17
+ /** The cause, for a person. */
18
+ detail: z.string(),
19
+ /** The one fix. */
20
+ fix: z.string(),
21
+ };
22
+ /** A failed GitHub Actions OIDC token request as `token_request_failed` reports it. */
23
+ export function tokenRequestFailureFacts(failure) {
24
+ const { cause: detail, fix } = describeTokenRequestFailure(failure);
25
+ if (failure.kind === "variables-missing")
26
+ return { cause: failure.kind, missing: [...failure.missing], status: null, said: null, detail, fix };
27
+ const { last } = failure;
28
+ return {
29
+ cause: failure.kind,
30
+ missing: null,
31
+ status: last.kind === "http-error" ? last.status : null,
32
+ said: "said" in last ? last.said : null,
33
+ detail,
34
+ fix,
35
+ };
36
+ }
37
+ /** Where a rejected credential came from, as `credential_rejected` carries it in `origin`. */
38
+ export const credentialOriginSchema = z.discriminatedUnion("source", [
39
+ z.object({
40
+ /** The mint. */
41
+ source: z.literal("mint"),
42
+ /** The control plane team the credential was minted for. */
43
+ team: z.string(),
44
+ /** The control plane project the credential was minted for. */
45
+ project: z.string(),
46
+ }),
47
+ z.object({
48
+ /** A GitHub Actions OIDC token request. */
49
+ source: z.literal("github-actions"),
50
+ /** The token's aud and repository claims; null when they can't be read. */
51
+ claims: z.object({ aud: z.string(), repository: z.string() }).nullable(),
52
+ }),
53
+ ]);
54
+ /** The facts of a rejected credential that `credential_rejected` carries: where it came from, and the one fix. */
55
+ export const rejectedCredentialShape = {
56
+ origin: credentialOriginSchema,
57
+ /** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
58
+ fix: z.string(),
59
+ };
60
+ /** Where a rejected credential came from, and its fix, as `credential_rejected` reports them. */
61
+ export function rejectedCredentialFacts(origin) {
62
+ return {
63
+ origin: origin.source === "mint"
64
+ ? { source: "mint", ...origin.target }
65
+ : { source: "github-actions", claims: origin.claims === undefined ? null : { ...origin.claims } },
66
+ fix: rejectedCredentialFix(origin),
67
+ };
68
+ }
69
+ /** The opening of `credential_rejected`'s message: which credential the Testserver control plane rejected. */
70
+ export function rejectedCredentialText(origin) {
71
+ return origin.source === "mint"
72
+ ? `the credential minted for project ${origin.project} on team ${origin.team}`
73
+ : "the GitHub Actions OIDC token";
74
+ }
75
+ /** The rows `credential_rejected` shows for where the credential came from. */
76
+ export function credentialOriginRows(origin) {
77
+ return origin.source === "mint"
78
+ ? [["Team", origin.team], ["Project", origin.project]]
79
+ : [
80
+ ["aud", origin.claims?.aud ?? "unreadable"],
81
+ ["repository", origin.claims?.repository ?? "unreadable"],
82
+ ];
83
+ }
@@ -0,0 +1,59 @@
1
+ import type { BuildMatch, LeaseReport, PooledCreateOutcome, UnresolvedChannelReason } from "./pool/index.ts";
2
+ import type { RunSandbox } from "./run-sandbox.ts";
3
+ import type { BuildChannel } from "./sandbox/index.ts";
4
+ /**
5
+ * What a run's Testserver pool did.
6
+ *
7
+ * - `build-unresolved`: the `build` setting named a build channel that couldn't be resolved, so the run matches pool
8
+ * entries on the channel as written.
9
+ * - `old-channel-resolution`: under `noCreate`, a build channel resolved from a channel resolution `ageMinutes`
10
+ * old, past the hour a run trusts one for.
11
+ * - `leasing`: the run lists the pool on `match` and health-checks its free Testserver sandboxes, to lease up to
12
+ * `requested`.
13
+ * - `leased`: the pool's usable Testserver sandboxes were leased, up to `requested`.
14
+ * - `creating`: the run creates `count` Testserver sandboxes on `build`.
15
+ * - `create-started` and `create-finished`: create `index` (from 0) of `count`.
16
+ * - `create-progress`: a progress message the Testserver control plane sent for create `index`, such as
17
+ * `✓ Sandboxes restored in 1.7s`.
18
+ * - `sandbox-list`: the Testserver sandboxes the run holds, reused first, just before its command starts.
19
+ */
20
+ export type TestserverPoolEvent = {
21
+ readonly kind: "build-unresolved";
22
+ readonly channel: BuildChannel;
23
+ readonly reason: UnresolvedChannelReason;
24
+ } | {
25
+ readonly kind: "old-channel-resolution";
26
+ readonly channel: BuildChannel;
27
+ readonly build: string;
28
+ readonly ageMinutes: number;
29
+ } | {
30
+ readonly kind: "leasing";
31
+ readonly match: BuildMatch;
32
+ readonly requested: number;
33
+ } | {
34
+ readonly kind: "leased";
35
+ readonly match: BuildMatch;
36
+ readonly requested: number;
37
+ readonly report: LeaseReport;
38
+ } | {
39
+ readonly kind: "creating";
40
+ readonly count: number;
41
+ readonly build: string;
42
+ } | {
43
+ readonly kind: "create-started";
44
+ readonly index: number;
45
+ readonly count: number;
46
+ } | {
47
+ readonly kind: "create-progress";
48
+ readonly index: number;
49
+ readonly count: number;
50
+ readonly message: string;
51
+ } | {
52
+ readonly kind: "create-finished";
53
+ readonly index: number;
54
+ readonly count: number;
55
+ readonly outcome: PooledCreateOutcome;
56
+ } | {
57
+ readonly kind: "sandbox-list";
58
+ readonly sandboxes: readonly RunSandbox[];
59
+ };
@@ -0,0 +1,4 @@
1
+ // What a run reports about its Testserver pool as it goes: the Testserver lane's events. The core nests each one in a
2
+ // `resource` run event, and the Testserver lane (`lane.ts`) applies them to its state. A credential's events, a local
3
+ // run's mint and a GitHub Actions OIDC token request, stay the run's own (`CredentialEvent`).
4
+ export {};
@@ -0,0 +1,16 @@
1
+ export { type TestserverPoolCleanupFacts, testserverPoolCleanupReport } from "./cleanup.ts";
2
+ export { testserverPoolConfig, type TestserverPoolSettings } from "./config.ts";
3
+ export { testserverPoolCanceledLines, testserverPoolCommand, testserverPoolPrepareErrors, testserverPoolRefusalErrors, } from "./command.ts";
4
+ export { liveTestserverPoolGateways, TESTSERVER_ORIGIN } from "./live/gateways.ts";
5
+ export { type TestserverRanFacts, testserverPoolRanReport } from "./ran.ts";
6
+ export { testserverPoolPresentation } from "./presentation.ts";
7
+ export { testserverPoolProvider } from "./resource-provider.ts";
8
+ export { credentialOriginRows, credentialOriginSchema, REQUESTING_TOKEN_LINE, rejectedCredentialFacts, rejectedCredentialShape, rejectedCredentialText, tokenRequestFailureFacts, tokenRequestFailureShape, } from "./credential-facts.ts";
9
+ export type { TestserverPoolEvent } from "./events.ts";
10
+ export { type TestserverLaneState, type TestserverLaneStep, testserverPoolLane } from "./lane.ts";
11
+ export { CREATE_CONCURRENCY, MAX_SANDBOXES, MIN_SANDBOXES } from "./options.ts";
12
+ export { type BuildMatch, createPooledSandbox, type InspectedEntry, inspectPool, type LeaseReport, livePoolStoreGateway, POOL_DIRECTORY_PATTERN, POOL_SUBPATH, type PooledCreateOutcome, type PoolStoreGateway, unavailablePoolStoreGateway, type UnresolvedChannelReason, } from "./pool/index.ts";
13
+ export { type FailedCreate, type RejectedCreate, type TestserverCanceledFacts, type TestserverFacts, type TestserverPoolCleanup, type TestserverPoolKind, type TestserverPoolRequest, testserverPoolRunProvider, type TestserverProvisioning, type TestserverRefusal, type UnpooledSandbox, } from "./provider.ts";
14
+ export { testserverPool, type TestserverPoolOptions, type TestserverPoolResource } from "./resource.ts";
15
+ export { type RunSandbox, type SandboxOrigin, STALE_TESTSERVER_VARIABLES } from "./run-sandbox.ts";
16
+ export { type BuildChannel, type ControlPlaneGateway, CREATE_ATTEMPTS, type CreateFailure, DEFAULT_TTL_MINUTES, describeCreateFailure, describeTtl, type HealthCheckGateway, invalidTtlMessage, liveControlPlaneGateway, liveHealthCheckGateway, mayLeaveSandbox, } from "./sandbox/index.ts";
@@ -0,0 +1,24 @@
1
+ // The Testserver pool resource's folder: the Testserver control plane and health check (`sandbox/`), the pool of
2
+ // Testserver sandboxes (`pool/`), its kind and run half, its events and its lane, its resource config, its command
3
+ // half with its settle, its cleanup and ran reports, its live gateways, how its errors and `pool create` report a
4
+ // credential source's failures, its sandbox counts, and the Testserver sandboxes a run holds. Its provider value
5
+ // (`resource-provider.ts`) carries them to the registry (`src/resources.ts`), the one place outside this folder that
6
+ // takes it; `@cnc-tools/storm/testserver` is `resource.ts`.
7
+ // `sandbox/` and `pool/` keep their own `index.ts` for the files in this folder; everything outside it imports only
8
+ // this file: the registry and `src/config-file/`'s type-only import. Its own commands, `pool create` and `pool list`, are
9
+ // `commands/`, which the registry mounts. The rest of what it exports is for tests.
10
+ export { testserverPoolCleanupReport } from "./cleanup.js";
11
+ export { testserverPoolConfig } from "./config.js";
12
+ export { testserverPoolCanceledLines, testserverPoolCommand, testserverPoolPrepareErrors, testserverPoolRefusalErrors, } from "./command.js";
13
+ export { liveTestserverPoolGateways, TESTSERVER_ORIGIN } from "./live/gateways.js";
14
+ export { testserverPoolRanReport } from "./ran.js";
15
+ export { testserverPoolPresentation } from "./presentation.js";
16
+ export { testserverPoolProvider } from "./resource-provider.js";
17
+ export { credentialOriginRows, credentialOriginSchema, REQUESTING_TOKEN_LINE, rejectedCredentialFacts, rejectedCredentialShape, rejectedCredentialText, tokenRequestFailureFacts, tokenRequestFailureShape, } from "./credential-facts.js";
18
+ export { testserverPoolLane } from "./lane.js";
19
+ export { CREATE_CONCURRENCY, MAX_SANDBOXES, MIN_SANDBOXES } from "./options.js";
20
+ export { createPooledSandbox, inspectPool, livePoolStoreGateway, POOL_DIRECTORY_PATTERN, POOL_SUBPATH, unavailablePoolStoreGateway, } from "./pool/index.js";
21
+ export { testserverPoolRunProvider, } from "./provider.js";
22
+ export { testserverPool } from "./resource.js";
23
+ export { STALE_TESTSERVER_VARIABLES } from "./run-sandbox.js";
24
+ export { CREATE_ATTEMPTS, DEFAULT_TTL_MINUTES, describeCreateFailure, describeTtl, invalidTtlMessage, liveControlPlaneGateway, liveHealthCheckGateway, mayLeaveSandbox, } from "./sandbox/index.js";
@@ -0,0 +1,28 @@
1
+ import type { ResourceLane, Span } from "../../core/index.ts";
2
+ import type { TestserverPoolKind } from "./provider.ts";
3
+ import type { RunSandbox } from "./run-sandbox.ts";
4
+ /** The Testserver lane's steps on the waterfall, in order. */
5
+ export type TestserverLaneStep = "lease" | "create";
6
+ /** The Testserver lane's state: leasing and creating Testserver sandboxes. */
7
+ export interface TestserverLaneState extends Span {
8
+ /** The build it leases and creates on, once leasing started. */
9
+ readonly build: string | undefined;
10
+ readonly requested: number | undefined;
11
+ /** The Testserver sandboxes it holds: leased ones as `reused`, created ones as `created`, until the sandbox list. */
12
+ readonly sandboxes: readonly RunSandbox[];
13
+ readonly creates: {
14
+ readonly count: number;
15
+ readonly started: number;
16
+ readonly finished: number;
17
+ readonly failed: number;
18
+ } | undefined;
19
+ readonly steps: {
20
+ readonly lease: Span | undefined;
21
+ readonly create: Span | undefined;
22
+ };
23
+ }
24
+ /**
25
+ * The Testserver pool's lane. It starts running, applies each Testserver lane event, ends with the lane, and projects
26
+ * its row: the steps that started, and how many Testserver sandboxes it reused and created.
27
+ */
28
+ export declare const testserverPoolLane: ResourceLane<"testserverPool", TestserverPoolKind>;
@@ -0,0 +1,139 @@
1
+ // The Testserver lane: leasing and creating Testserver sandboxes, as the Testserver pool's own events build it. The
2
+ // run's state keeps it under `resources.testserverPool`; the live view draws it, and its waterfall row is
3
+ // `testserver`, with its `lease` and `create` steps and how many Testserver sandboxes it reused and created.
4
+ /**
5
+ * The Testserver pool's lane. It starts running, applies each Testserver lane event, ends with the lane, and projects
6
+ * its row: the steps that started, and how many Testserver sandboxes it reused and created.
7
+ */
8
+ export const testserverPoolLane = {
9
+ resource: "testserverPool",
10
+ lane: "testserver",
11
+ start: (startedAt) => ({
12
+ status: "running",
13
+ startedAt,
14
+ endedAt: undefined,
15
+ build: undefined,
16
+ requested: undefined,
17
+ sandboxes: [],
18
+ creates: undefined,
19
+ steps: { lease: undefined, create: undefined },
20
+ }),
21
+ apply: (testserver, event, at) => applyTestserverEvent(testserver, event, at),
22
+ ended: (testserver, outcome, at) => {
23
+ const status = outcome === "ready" ? "done" : outcome;
24
+ const settle = (span) => settled(span, outcome, status, at);
25
+ return {
26
+ ...testserver,
27
+ status,
28
+ endedAt: at,
29
+ steps: { lease: settle(testserver.steps.lease), create: settle(testserver.steps.create) },
30
+ };
31
+ },
32
+ row: (testserver) => {
33
+ const reused = testserver.sandboxes.filter(({ origin }) => origin === "reused").length;
34
+ const { lease, create } = testserver.steps;
35
+ return {
36
+ steps: [
37
+ ...(lease === undefined ? [] : [{ name: "lease", span: lease }]),
38
+ ...(create === undefined ? [] : [{ name: "create", span: create }]),
39
+ ],
40
+ sandboxes: { reused, created: testserver.sandboxes.length - reused },
41
+ };
42
+ },
43
+ };
44
+ /** The Testserver lane after `event`, at `at`. */
45
+ function applyTestserverEvent(testserver, event, at) {
46
+ switch (event.kind) {
47
+ // Resolving the build is part of the lane, but changes nothing it shows.
48
+ case "build-unresolved":
49
+ case "old-channel-resolution":
50
+ case "create-progress":
51
+ return testserver;
52
+ case "leasing":
53
+ return {
54
+ ...testserver,
55
+ build: buildName(event.match),
56
+ requested: event.requested,
57
+ steps: { ...testserver.steps, lease: { status: "running", startedAt: at, endedAt: undefined } },
58
+ };
59
+ case "leased":
60
+ return {
61
+ ...testserver,
62
+ sandboxes: event.report.leased.map(({ entry }) => ({
63
+ testserverUrl: entry.testserverUrl,
64
+ logViewerUrl: entry.logViewerUrl,
65
+ origin: "reused",
66
+ })),
67
+ steps: { ...testserver.steps, lease: ended(testserver.steps.lease, "done", at) },
68
+ };
69
+ case "creating":
70
+ return {
71
+ ...testserver,
72
+ creates: { count: event.count, started: 0, finished: 0, failed: 0 },
73
+ steps: { ...testserver.steps, create: { status: "running", startedAt: at, endedAt: undefined } },
74
+ };
75
+ case "create-started":
76
+ return {
77
+ ...testserver,
78
+ creates: testserver.creates === undefined
79
+ ? undefined
80
+ : { ...testserver.creates, started: testserver.creates.started + 1 },
81
+ };
82
+ case "create-finished": {
83
+ const { outcome } = event;
84
+ const creates = testserver.creates === undefined
85
+ ? undefined
86
+ : {
87
+ ...testserver.creates,
88
+ finished: testserver.creates.finished + 1,
89
+ failed: testserver.creates.failed + (outcome.kind === "create-failed" ? 1 : 0),
90
+ };
91
+ const create = testserver.steps.create;
92
+ return {
93
+ ...testserver,
94
+ sandboxes: outcome.kind === "create-failed"
95
+ ? testserver.sandboxes
96
+ : [
97
+ ...testserver.sandboxes,
98
+ {
99
+ testserverUrl: outcome.entry.testserverUrl,
100
+ logViewerUrl: outcome.entry.logViewerUrl,
101
+ origin: "created",
102
+ },
103
+ ],
104
+ creates,
105
+ steps: {
106
+ ...testserver.steps,
107
+ // The create step ends with the last create; until then it runs, its end at the latest create's.
108
+ create: create === undefined
109
+ ? undefined
110
+ : {
111
+ ...create,
112
+ endedAt: at,
113
+ status: creates !== undefined && creates.finished >= creates.count ? "done" : create.status,
114
+ },
115
+ },
116
+ };
117
+ }
118
+ case "sandbox-list":
119
+ return {
120
+ ...testserver,
121
+ sandboxes: event.sandboxes.map(({ testserverUrl, logViewerUrl, origin }) => ({
122
+ testserverUrl,
123
+ logViewerUrl,
124
+ origin,
125
+ })),
126
+ };
127
+ }
128
+ }
129
+ /** A step once its lane ended as `outcome`: a step still running ends as `status` unless the lane is ready. */
130
+ function settled(span, outcome, status, at) {
131
+ return outcome === "ready" || span === undefined || span.status !== "running" ? span : ended(span, status, at);
132
+ }
133
+ /** `span` ended at `at` as `status`; undefined stays undefined. */
134
+ function ended(span, status, at) {
135
+ return span === undefined ? undefined : { ...span, status, endedAt: at };
136
+ }
137
+ function buildName(match) {
138
+ return "resolvedBuild" in match ? match.resolvedBuild : match.requestedBuild;
139
+ }
@@ -0,0 +1,6 @@
1
+ import { type ResourceHost } from "../../../core/index.ts";
2
+ import type { TestserverPoolKind } from "../provider.ts";
3
+ /** The Testserver control plane's origin. */
4
+ export declare const TESTSERVER_ORIGIN = "https://testserver.vercel.sh";
5
+ /** The Testserver pool's gateways, live, for `host`. */
6
+ export declare function liveTestserverPoolGateways(host: ResourceHost): TestserverPoolKind["gateways"];
@@ -0,0 +1,26 @@
1
+ // The Testserver pool resource's live gateways, built from the host: the Testserver control plane at
2
+ // `testserver.vercel.sh`, with a 3-minute create and a 10-second `GET /builds`; 5-second health checks; the pool
3
+ // under the host's `XDG_STATE_HOME` or `HOME`, or, when the host names no place for it, a pool whose every operation
4
+ // fails and says why; and the system timer, which a create's retries wait on.
5
+ import { resolveStateDirectory } from "../../../core/index.js";
6
+ import { systemTimer } from "../../../time/index.js";
7
+ import { livePoolStoreGateway, POOL_DIRECTORY_PATTERN, POOL_SUBPATH, unavailablePoolStoreGateway, } from "../pool/index.js";
8
+ import { liveControlPlaneGateway, liveHealthCheckGateway } from "../sandbox/index.js";
9
+ /** The Testserver control plane's origin. */
10
+ export const TESTSERVER_ORIGIN = "https://testserver.vercel.sh";
11
+ /** The Testserver pool's gateways, live, for `host`. */
12
+ export function liveTestserverPoolGateways(host) {
13
+ const directory = resolveStateDirectory(host.env, POOL_SUBPATH);
14
+ return {
15
+ controlPlane: liveControlPlaneGateway({
16
+ origin: TESTSERVER_ORIGIN,
17
+ streamTimeoutMs: 180_000,
18
+ buildsTimeoutMs: 10_000,
19
+ }),
20
+ healthChecks: liveHealthCheckGateway({ timeoutMs: 5_000 }),
21
+ pool: directory.ok
22
+ ? livePoolStoreGateway({ directory: directory.directory })
23
+ : unavailablePoolStoreGateway(POOL_DIRECTORY_PATTERN, directory.reason),
24
+ timer: systemTimer,
25
+ };
26
+ }
@@ -0,0 +1,5 @@
1
+ /** The fewest and most Testserver sandboxes a run asks for. */
2
+ export declare const MIN_SANDBOXES = 1;
3
+ export declare const MAX_SANDBOXES = 32;
4
+ /** How many creates a run has in flight at once. */
5
+ export declare const CREATE_CONCURRENCY = 8;
@@ -0,0 +1,5 @@
1
+ /** The fewest and most Testserver sandboxes a run asks for. */
2
+ export const MIN_SANDBOXES = 1;
3
+ export const MAX_SANDBOXES = 32;
4
+ /** How many creates a run has in flight at once. */
5
+ export const CREATE_CONCURRENCY = 8;
@@ -0,0 +1,80 @@
1
+ import type { CredentialFailure, CredentialSource } from "../../../credential/index.ts";
2
+ import { type BuildChannel, type BuildsFailure, type ControlPlaneGateway } from "../sandbox/index.ts";
3
+ import type { Clock } from "../../../time/index.ts";
4
+ import type { PoolStoreGateway } from "./gateways.ts";
5
+ /** How long a channel resolution is trusted without asking the Testserver control plane again. */
6
+ export declare const CHANNEL_RESOLUTION_TRUST_MINUTES = 60;
7
+ /**
8
+ * Why a build channel couldn't be resolved, so a run matches on the channel as written. `credential-failed`: the
9
+ * credential source couldn't give a credential to ask with. `not-recorded`: there is no channel resolution, and the
10
+ * caller may not get a credential to ask the Testserver control plane.
11
+ */
12
+ export type UnresolvedChannelReason = {
13
+ readonly kind: "credential-failed";
14
+ readonly failure: CredentialFailure;
15
+ } | {
16
+ readonly kind: "builds-failed";
17
+ readonly failure: BuildsFailure;
18
+ } | {
19
+ readonly kind: "no-build";
20
+ } | {
21
+ readonly kind: "not-recorded";
22
+ };
23
+ /**
24
+ * The build `--build` resolved to, and how:
25
+ *
26
+ * - `named`: a build named directly, which resolves to itself without a lookup.
27
+ * - `channel-resolution`: a build channel's recorded resolution, less than an hour old.
28
+ * - `old-channel-resolution`: a build channel's recorded resolution an hour old or more (or from the future), used
29
+ * because the caller may not get a credential; the caller says so.
30
+ * - `control-plane`: a build channel the Testserver control plane resolved just now (`GET /builds`).
31
+ * - `as-written`: a build channel that couldn't be resolved; pool entries are matched on it as their
32
+ * requested build instead, and the caller says why.
33
+ */
34
+ export type BuildResolution = {
35
+ readonly kind: "named";
36
+ readonly build: string;
37
+ } | {
38
+ readonly kind: "channel-resolution";
39
+ readonly channel: BuildChannel;
40
+ readonly build: string;
41
+ readonly learnedAt: string;
42
+ } | {
43
+ readonly kind: "old-channel-resolution";
44
+ readonly channel: BuildChannel;
45
+ readonly build: string;
46
+ readonly learnedAt: string;
47
+ } | {
48
+ readonly kind: "control-plane";
49
+ readonly channel: BuildChannel;
50
+ readonly build: string;
51
+ } | {
52
+ readonly kind: "as-written";
53
+ readonly channel: BuildChannel;
54
+ readonly reason: UnresolvedChannelReason;
55
+ };
56
+ /** Which pool entries a run may lease: those on a resolved build, or, as a fallback, those requested as written. */
57
+ export type BuildMatch = {
58
+ readonly resolvedBuild: string;
59
+ } | {
60
+ readonly requestedBuild: string;
61
+ };
62
+ /**
63
+ * Resolves `build`. A build named directly resolves to itself. A build channel uses its channel resolution
64
+ * when that is less than an hour old; otherwise it gets a credential from `credential` and asks the Testserver
65
+ * control plane, and records what it learns. A failed record write is ignored: it costs only a later lookup.
66
+ * Reading the channel resolutions failing counts as having none.
67
+ *
68
+ * With no `credential`, it never mints or requests a token: it uses the channel resolution at any age, and with none
69
+ * matches on the channel as written (`not-recorded`).
70
+ */
71
+ export declare function resolveBuild(context: {
72
+ readonly pool: PoolStoreGateway;
73
+ readonly controlPlane: ControlPlaneGateway;
74
+ readonly clock: Clock;
75
+ }, request: {
76
+ readonly build: string;
77
+ readonly credential: CredentialSource | undefined;
78
+ }): Promise<BuildResolution>;
79
+ /** The pool entries a resolution lets a run lease. */
80
+ export declare function buildMatch(resolution: BuildResolution): BuildMatch;