@cnc-tools/storm 0.0.0 → 0.6.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 (527) 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/exec/cleanup.d.ts +135 -0
  15. package/dist/commands/exec/cleanup.js +171 -0
  16. package/dist/commands/exec/command.d.ts +272 -0
  17. package/dist/commands/exec/command.js +23 -0
  18. package/dist/commands/exec/job-summary.d.ts +10 -0
  19. package/dist/commands/exec/job-summary.js +34 -0
  20. package/dist/commands/exec/live-view.d.ts +22 -0
  21. package/dist/commands/exec/live-view.js +395 -0
  22. package/dist/commands/exec/metadata.d.ts +66 -0
  23. package/dist/commands/exec/metadata.js +55 -0
  24. package/dist/commands/exec/mint-failed.d.ts +11 -0
  25. package/dist/commands/exec/mint-failed.js +33 -0
  26. package/dist/commands/exec/outcomes.d.ts +614 -0
  27. package/dist/commands/exec/outcomes.js +338 -0
  28. package/dist/commands/exec/progress.d.ts +44 -0
  29. package/dist/commands/exec/progress.js +277 -0
  30. package/dist/commands/exec/redaction.d.ts +15 -0
  31. package/dist/commands/exec/redaction.js +40 -0
  32. package/dist/commands/exec/run-collector.d.ts +30 -0
  33. package/dist/commands/exec/run-collector.js +73 -0
  34. package/dist/commands/exec/run-command.d.ts +221 -0
  35. package/dist/commands/exec/run-command.js +663 -0
  36. package/dist/commands/exec/run-metadata.d.ts +56 -0
  37. package/dist/commands/exec/run-metadata.js +58 -0
  38. package/dist/commands/exec/run-record.d.ts +170 -0
  39. package/dist/commands/exec/run-record.js +104 -0
  40. package/dist/commands/exec/tests-summary.d.ts +34 -0
  41. package/dist/commands/exec/tests-summary.js +141 -0
  42. package/dist/commands/exec/testserver-flags.d.ts +48 -0
  43. package/dist/commands/exec/testserver-flags.js +80 -0
  44. package/dist/commands/exec/text.d.ts +22 -0
  45. package/dist/commands/exec/text.js +74 -0
  46. package/dist/commands/exec/view.d.ts +35 -0
  47. package/dist/commands/exec/view.js +163 -0
  48. package/dist/commands/exec/waterfall.d.ts +25 -0
  49. package/dist/commands/exec/waterfall.js +108 -0
  50. package/dist/commands/exec/worker-chart.d.ts +79 -0
  51. package/dist/commands/exec/worker-chart.js +313 -0
  52. package/dist/commands/runs/facts.d.ts +150 -0
  53. package/dist/commands/runs/facts.js +292 -0
  54. package/dist/commands/runs/list/command.d.ts +86 -0
  55. package/dist/commands/runs/list/command.js +36 -0
  56. package/dist/commands/runs/list/metadata.d.ts +22 -0
  57. package/dist/commands/runs/list/metadata.js +19 -0
  58. package/dist/commands/runs/list/outcomes.d.ts +74 -0
  59. package/dist/commands/runs/list/outcomes.js +89 -0
  60. package/dist/commands/runs/logs/command.d.ts +72 -0
  61. package/dist/commands/runs/logs/command.js +51 -0
  62. package/dist/commands/runs/logs/metadata.d.ts +22 -0
  63. package/dist/commands/runs/logs/metadata.js +22 -0
  64. package/dist/commands/runs/logs/outcomes.d.ts +55 -0
  65. package/dist/commands/runs/logs/outcomes.js +80 -0
  66. package/dist/commands/runs/metadata.d.ts +3 -0
  67. package/dist/commands/runs/metadata.js +3 -0
  68. package/dist/commands/runs/past-run.d.ts +72 -0
  69. package/dist/commands/runs/past-run.js +99 -0
  70. package/dist/commands/runs/show/command.d.ts +176 -0
  71. package/dist/commands/runs/show/command.js +76 -0
  72. package/dist/commands/runs/show/metadata.d.ts +25 -0
  73. package/dist/commands/runs/show/metadata.js +22 -0
  74. package/dist/commands/runs/show/outcomes.d.ts +164 -0
  75. package/dist/commands/runs/show/outcomes.js +320 -0
  76. package/dist/commands/vitest/command.d.ts +299 -0
  77. package/dist/commands/vitest/command.js +138 -0
  78. package/dist/commands/vitest/metadata.d.ts +66 -0
  79. package/dist/commands/vitest/metadata.js +35 -0
  80. package/dist/commands/vitest/outcomes.d.ts +273 -0
  81. package/dist/commands/vitest/outcomes.js +77 -0
  82. package/dist/config/by-name.d.ts +24 -0
  83. package/dist/config/by-name.js +26 -0
  84. package/dist/config/errors.d.ts +58 -0
  85. package/dist/config/errors.js +101 -0
  86. package/dist/config/gateways.d.ts +32 -0
  87. package/dist/config/gateways.js +1 -0
  88. package/dist/config/index.d.ts +10 -0
  89. package/dist/config/index.js +13 -0
  90. package/dist/config/live/config-gateway.d.ts +6 -0
  91. package/dist/config/live/config-gateway.js +71 -0
  92. package/dist/config/load.d.ts +54 -0
  93. package/dist/config/load.js +175 -0
  94. package/dist/config/resolve.d.ts +49 -0
  95. package/dist/config/resolve.js +94 -0
  96. package/dist/config/resource-config.d.ts +132 -0
  97. package/dist/config/resource-config.js +19 -0
  98. package/dist/config/schema.d.ts +64 -0
  99. package/dist/config/schema.js +57 -0
  100. package/dist/config/set.d.ts +27 -0
  101. package/dist/config/set.js +71 -0
  102. package/dist/config/settings-file.d.ts +41 -0
  103. package/dist/config/settings-file.js +72 -0
  104. package/dist/config-file/define.d.ts +39 -0
  105. package/dist/config-file/define.js +9 -0
  106. package/dist/config-file/toolchain.d.ts +9 -0
  107. package/dist/config-file/toolchain.js +41 -0
  108. package/dist/context.d.ts +89 -0
  109. package/dist/context.js +45 -0
  110. package/dist/core/command-provider.d.ts +126 -0
  111. package/dist/core/command-provider.js +13 -0
  112. package/dist/core/command-slots.d.ts +67 -0
  113. package/dist/core/command-slots.js +136 -0
  114. package/dist/core/events.d.ts +128 -0
  115. package/dist/core/events.js +15 -0
  116. package/dist/core/gateways.d.ts +249 -0
  117. package/dist/core/gateways.js +1 -0
  118. package/dist/core/index.d.ts +20 -0
  119. package/dist/core/index.js +18 -0
  120. package/dist/core/keyed.d.ts +12 -0
  121. package/dist/core/keyed.js +24 -0
  122. package/dist/core/lane.d.ts +46 -0
  123. package/dist/core/lane.js +5 -0
  124. package/dist/core/limit.d.ts +9 -0
  125. package/dist/core/limit.js +29 -0
  126. package/dist/core/live/command-gateway.d.ts +11 -0
  127. package/dist/core/live/command-gateway.js +83 -0
  128. package/dist/core/live/job-summary-gateway.d.ts +5 -0
  129. package/dist/core/live/job-summary-gateway.js +20 -0
  130. package/dist/core/live/progress-terminal.d.ts +20 -0
  131. package/dist/core/live/progress-terminal.js +173 -0
  132. package/dist/core/live/run-directory-gateway.d.ts +24 -0
  133. package/dist/core/live/run-directory-gateway.js +437 -0
  134. package/dist/core/mint.d.ts +10 -0
  135. package/dist/core/mint.js +14 -0
  136. package/dist/core/payload.d.ts +26 -0
  137. package/dist/core/payload.js +33 -0
  138. package/dist/core/presentation.d.ts +87 -0
  139. package/dist/core/presentation.js +5 -0
  140. package/dist/core/presentations.d.ts +56 -0
  141. package/dist/core/presentations.js +66 -0
  142. package/dist/core/provider.d.ts +69 -0
  143. package/dist/core/provider.js +5 -0
  144. package/dist/core/resource.d.ts +262 -0
  145. package/dist/core/resource.js +6 -0
  146. package/dist/core/resources.d.ts +131 -0
  147. package/dist/core/resources.js +254 -0
  148. package/dist/core/run-directory.d.ts +69 -0
  149. package/dist/core/run-directory.js +94 -0
  150. package/dist/core/run-state.d.ts +152 -0
  151. package/dist/core/run-state.js +313 -0
  152. package/dist/core/run.d.ts +187 -0
  153. package/dist/core/run.js +321 -0
  154. package/dist/core/state-directory.d.ts +19 -0
  155. package/dist/core/state-directory.js +29 -0
  156. package/dist/core/timeline.d.ts +63 -0
  157. package/dist/core/timeline.js +97 -0
  158. package/dist/core/timing.d.ts +22 -0
  159. package/dist/core/timing.js +26 -0
  160. package/dist/credential/credential.d.ts +46 -0
  161. package/dist/credential/credential.js +80 -0
  162. package/dist/credential/diagnosis.d.ts +18 -0
  163. package/dist/credential/diagnosis.js +99 -0
  164. package/dist/credential/gateways.d.ts +109 -0
  165. package/dist/credential/gateways.js +1 -0
  166. package/dist/credential/index.d.ts +7 -0
  167. package/dist/credential/index.js +7 -0
  168. package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
  169. package/dist/credential/live/github-actions-token-gateway.js +43 -0
  170. package/dist/credential/live/github-actions-token-response.d.ts +19 -0
  171. package/dist/credential/live/github-actions-token-response.js +49 -0
  172. package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
  173. package/dist/credential/live/vercel-cli-gateway.js +64 -0
  174. package/dist/credential/live/vercel-output.d.ts +60 -0
  175. package/dist/credential/live/vercel-output.js +122 -0
  176. package/dist/credential/live/vercel-process.d.ts +14 -0
  177. package/dist/credential/live/vercel-process.js +3 -0
  178. package/dist/credential/settle.d.ts +31 -0
  179. package/dist/credential/settle.js +49 -0
  180. package/dist/credential/source.d.ts +110 -0
  181. package/dist/credential/source.js +114 -0
  182. package/dist/help-logo.d.ts +11 -0
  183. package/dist/help-logo.js +56 -0
  184. package/dist/presentation.d.ts +26 -0
  185. package/dist/presentation.js +21 -0
  186. package/dist/resources/github/cleanup.d.ts +23 -0
  187. package/dist/resources/github/cleanup.js +39 -0
  188. package/dist/resources/github/command.d.ts +74 -0
  189. package/dist/resources/github/command.js +117 -0
  190. package/dist/resources/github/config.d.ts +16 -0
  191. package/dist/resources/github/config.js +37 -0
  192. package/dist/resources/github/events.d.ts +26 -0
  193. package/dist/resources/github/events.js +2 -0
  194. package/dist/resources/github/fixture-repo.d.ts +69 -0
  195. package/dist/resources/github/fixture-repo.js +60 -0
  196. package/dist/resources/github/gateways.d.ts +62 -0
  197. package/dist/resources/github/gateways.js +1 -0
  198. package/dist/resources/github/index.d.ts +12 -0
  199. package/dist/resources/github/index.js +15 -0
  200. package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
  201. package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
  202. package/dist/resources/github/live/gateways.d.ts +6 -0
  203. package/dist/resources/github/live/gateways.js +13 -0
  204. package/dist/resources/github/presentation.d.ts +13 -0
  205. package/dist/resources/github/presentation.js +43 -0
  206. package/dist/resources/github/provider.d.ts +66 -0
  207. package/dist/resources/github/provider.js +58 -0
  208. package/dist/resources/github/resource-provider.d.ts +6 -0
  209. package/dist/resources/github/resource-provider.js +20 -0
  210. package/dist/resources/github/resource.d.ts +33 -0
  211. package/dist/resources/github/resource.js +12 -0
  212. package/dist/resources/testserver/cleanup.d.ts +14 -0
  213. package/dist/resources/testserver/cleanup.js +22 -0
  214. package/dist/resources/testserver/command.d.ts +322 -0
  215. package/dist/resources/testserver/command.js +245 -0
  216. package/dist/resources/testserver/commands/app.d.ts +18 -0
  217. package/dist/resources/testserver/commands/app.js +3 -0
  218. package/dist/resources/testserver/commands/create/command.d.ts +136 -0
  219. package/dist/resources/testserver/commands/create/command.js +158 -0
  220. package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
  221. package/dist/resources/testserver/commands/create/metadata.js +45 -0
  222. package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
  223. package/dist/resources/testserver/commands/create/outcomes.js +172 -0
  224. package/dist/resources/testserver/commands/list/command.d.ts +60 -0
  225. package/dist/resources/testserver/commands/list/command.js +56 -0
  226. package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
  227. package/dist/resources/testserver/commands/list/metadata.js +9 -0
  228. package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
  229. package/dist/resources/testserver/commands/list/outcomes.js +152 -0
  230. package/dist/resources/testserver/config.d.ts +18 -0
  231. package/dist/resources/testserver/config.js +78 -0
  232. package/dist/resources/testserver/credential-facts.d.ts +80 -0
  233. package/dist/resources/testserver/credential-facts.js +83 -0
  234. package/dist/resources/testserver/events.d.ts +59 -0
  235. package/dist/resources/testserver/events.js +4 -0
  236. package/dist/resources/testserver/index.d.ts +16 -0
  237. package/dist/resources/testserver/index.js +24 -0
  238. package/dist/resources/testserver/lane.d.ts +28 -0
  239. package/dist/resources/testserver/lane.js +139 -0
  240. package/dist/resources/testserver/live/gateways.d.ts +6 -0
  241. package/dist/resources/testserver/live/gateways.js +26 -0
  242. package/dist/resources/testserver/options.d.ts +5 -0
  243. package/dist/resources/testserver/options.js +5 -0
  244. package/dist/resources/testserver/pool/channels.d.ts +80 -0
  245. package/dist/resources/testserver/pool/channels.js +48 -0
  246. package/dist/resources/testserver/pool/create.d.ts +48 -0
  247. package/dist/resources/testserver/pool/create.js +45 -0
  248. package/dist/resources/testserver/pool/directory.d.ts +4 -0
  249. package/dist/resources/testserver/pool/directory.js +5 -0
  250. package/dist/resources/testserver/pool/gateways.d.ts +190 -0
  251. package/dist/resources/testserver/pool/gateways.js +1 -0
  252. package/dist/resources/testserver/pool/host.d.ts +8 -0
  253. package/dist/resources/testserver/pool/host.js +21 -0
  254. package/dist/resources/testserver/pool/index.d.ts +9 -0
  255. package/dist/resources/testserver/pool/index.js +10 -0
  256. package/dist/resources/testserver/pool/inspect.d.ts +53 -0
  257. package/dist/resources/testserver/pool/inspect.js +45 -0
  258. package/dist/resources/testserver/pool/lease.d.ts +84 -0
  259. package/dist/resources/testserver/pool/lease.js +125 -0
  260. package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
  261. package/dist/resources/testserver/pool/live/pool-records.js +70 -0
  262. package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
  263. package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
  264. package/dist/resources/testserver/pool/staleness.d.ts +16 -0
  265. package/dist/resources/testserver/pool/staleness.js +27 -0
  266. package/dist/resources/testserver/presentation.d.ts +9 -0
  267. package/dist/resources/testserver/presentation.js +217 -0
  268. package/dist/resources/testserver/provider.d.ts +177 -0
  269. package/dist/resources/testserver/provider.js +254 -0
  270. package/dist/resources/testserver/ran.d.ts +87 -0
  271. package/dist/resources/testserver/ran.js +140 -0
  272. package/dist/resources/testserver/resource-provider.d.ts +12 -0
  273. package/dist/resources/testserver/resource-provider.js +38 -0
  274. package/dist/resources/testserver/resource.d.ts +32 -0
  275. package/dist/resources/testserver/resource.js +10 -0
  276. package/dist/resources/testserver/run-sandbox.d.ts +13 -0
  277. package/dist/resources/testserver/run-sandbox.js +6 -0
  278. package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
  279. package/dist/resources/testserver/sandbox/channels.js +21 -0
  280. package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
  281. package/dist/resources/testserver/sandbox/create-failure.js +65 -0
  282. package/dist/resources/testserver/sandbox/create.d.ts +29 -0
  283. package/dist/resources/testserver/sandbox/create.js +37 -0
  284. package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
  285. package/dist/resources/testserver/sandbox/gateways.js +1 -0
  286. package/dist/resources/testserver/sandbox/index.d.ts +6 -0
  287. package/dist/resources/testserver/sandbox/index.js +7 -0
  288. package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
  289. package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
  290. package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
  291. package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
  292. package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
  293. package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
  294. package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
  295. package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
  296. package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
  297. package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
  298. package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
  299. package/dist/resources/testserver/sandbox/live/sse.js +32 -0
  300. package/dist/resources.d.ts +455 -0
  301. package/dist/resources.js +88 -0
  302. package/dist/runner/base.d.ts +40 -0
  303. package/dist/runner/base.js +52 -0
  304. package/dist/runner/context.d.ts +13 -0
  305. package/dist/runner/context.js +9 -0
  306. package/dist/runner/events.d.ts +179 -0
  307. package/dist/runner/events.js +16 -0
  308. package/dist/runner/gateways.d.ts +351 -0
  309. package/dist/runner/gateways.js +3 -0
  310. package/dist/runner/index.d.ts +19 -0
  311. package/dist/runner/index.js +18 -0
  312. package/dist/runner/live/checkout-gateway.d.ts +3 -0
  313. package/dist/runner/live/checkout-gateway.js +206 -0
  314. package/dist/runner/live/git-output.d.ts +14 -0
  315. package/dist/runner/live/git-output.js +32 -0
  316. package/dist/runner/live/sandbox-errors.d.ts +7 -0
  317. package/dist/runner/live/sandbox-errors.js +21 -0
  318. package/dist/runner/live/sandbox-gateway.d.ts +7 -0
  319. package/dist/runner/live/sandbox-gateway.js +427 -0
  320. package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
  321. package/dist/runner/live/snapshot-cache-gateway.js +104 -0
  322. package/dist/runner/live/snapshot-records.d.ts +11 -0
  323. package/dist/runner/live/snapshot-records.js +57 -0
  324. package/dist/runner/live/terminal.d.ts +16 -0
  325. package/dist/runner/live/terminal.js +37 -0
  326. package/dist/runner/live/user.d.ts +2 -0
  327. package/dist/runner/live/user.js +11 -0
  328. package/dist/runner/output.d.ts +23 -0
  329. package/dist/runner/output.js +58 -0
  330. package/dist/runner/prepare.d.ts +67 -0
  331. package/dist/runner/prepare.js +59 -0
  332. package/dist/runner/ready.d.ts +68 -0
  333. package/dist/runner/ready.js +159 -0
  334. package/dist/runner/recipe.d.ts +126 -0
  335. package/dist/runner/recipe.js +302 -0
  336. package/dist/runner/remote-command.d.ts +77 -0
  337. package/dist/runner/remote-command.js +127 -0
  338. package/dist/runner/scope.d.ts +58 -0
  339. package/dist/runner/scope.js +117 -0
  340. package/dist/runner/snapshot-build.d.ts +33 -0
  341. package/dist/runner/snapshot-build.js +112 -0
  342. package/dist/runner/snapshot-cache.d.ts +84 -0
  343. package/dist/runner/snapshot-cache.js +126 -0
  344. package/dist/runner/snapshot-key.d.ts +52 -0
  345. package/dist/runner/snapshot-key.js +91 -0
  346. package/dist/runner/steps.d.ts +41 -0
  347. package/dist/runner/steps.js +49 -0
  348. package/dist/sdk/container/api-request.d.ts +32 -0
  349. package/dist/sdk/container/api-request.js +46 -0
  350. package/dist/sdk/container/container.d.ts +144 -0
  351. package/dist/sdk/container/container.js +346 -0
  352. package/dist/sdk/container/feature-flags.d.ts +37 -0
  353. package/dist/sdk/container/feature-flags.js +118 -0
  354. package/dist/sdk/container/gateways.d.ts +108 -0
  355. package/dist/sdk/container/gateways.js +1 -0
  356. package/dist/sdk/container/index.d.ts +5 -0
  357. package/dist/sdk/container/index.js +5 -0
  358. package/dist/sdk/container/live/container-gateway.d.ts +17 -0
  359. package/dist/sdk/container/live/container-gateway.js +114 -0
  360. package/dist/sdk/factories/build.d.ts +66 -0
  361. package/dist/sdk/factories/build.js +98 -0
  362. package/dist/sdk/factories/definition.d.ts +28 -0
  363. package/dist/sdk/factories/definition.js +16 -0
  364. package/dist/sdk/factories/definitions.d.ts +166 -0
  365. package/dist/sdk/factories/definitions.js +235 -0
  366. package/dist/sdk/factories/gateways.d.ts +25 -0
  367. package/dist/sdk/factories/gateways.js +1 -0
  368. package/dist/sdk/factories/index.d.ts +5 -0
  369. package/dist/sdk/factories/index.js +5 -0
  370. package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
  371. package/dist/sdk/factories/live/factory-gateway.js +29 -0
  372. package/dist/sdk/index.d.ts +7 -0
  373. package/dist/sdk/index.js +15 -0
  374. package/dist/sdk/payload/index.d.ts +2 -0
  375. package/dist/sdk/payload/index.js +4 -0
  376. package/dist/sdk/payload/payload.d.ts +47 -0
  377. package/dist/sdk/payload/payload.js +74 -0
  378. package/dist/sdk/payload/test-events.d.ts +102 -0
  379. package/dist/sdk/payload/test-events.js +59 -0
  380. package/dist/sdk/proxy/exchange.d.ts +58 -0
  381. package/dist/sdk/proxy/exchange.js +173 -0
  382. package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
  383. package/dist/sdk/proxy/faulted-exchange.js +106 -0
  384. package/dist/sdk/proxy/faults.d.ts +133 -0
  385. package/dist/sdk/proxy/faults.js +147 -0
  386. package/dist/sdk/proxy/index.d.ts +3 -0
  387. package/dist/sdk/proxy/index.js +3 -0
  388. package/dist/sdk/proxy/proxy.d.ts +93 -0
  389. package/dist/sdk/proxy/proxy.js +99 -0
  390. package/dist/sdk/proxy/records.d.ts +56 -0
  391. package/dist/sdk/proxy/records.js +56 -0
  392. package/dist/sdk/records/body.d.ts +89 -0
  393. package/dist/sdk/records/body.js +236 -0
  394. package/dist/sdk/records/index.d.ts +2 -0
  395. package/dist/sdk/records/index.js +4 -0
  396. package/dist/sdk/records/records.d.ts +49 -0
  397. package/dist/sdk/records/records.js +16 -0
  398. package/dist/sdk/seed/index.d.ts +1 -0
  399. package/dist/sdk/seed/index.js +3 -0
  400. package/dist/sdk/seed/seed.d.ts +221 -0
  401. package/dist/sdk/seed/seed.js +171 -0
  402. package/dist/sdk/testserver/clock.d.ts +8 -0
  403. package/dist/sdk/testserver/clock.js +10 -0
  404. package/dist/sdk/testserver/failure.d.ts +73 -0
  405. package/dist/sdk/testserver/failure.js +61 -0
  406. package/dist/sdk/testserver/index.d.ts +5 -0
  407. package/dist/sdk/testserver/index.js +8 -0
  408. package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
  409. package/dist/sdk/testserver/live/connect-failure.js +30 -0
  410. package/dist/sdk/testserver/live/request.d.ts +69 -0
  411. package/dist/sdk/testserver/live/request.js +89 -0
  412. package/dist/sdk/testserver/service-ids.d.ts +19 -0
  413. package/dist/sdk/testserver/service-ids.js +77 -0
  414. package/dist/sdk/testserver/test-id.d.ts +15 -0
  415. package/dist/sdk/testserver/test-id.js +28 -0
  416. package/dist/story/align.d.ts +37 -0
  417. package/dist/story/align.js +39 -0
  418. package/dist/story/artifact.d.ts +60 -0
  419. package/dist/story/artifact.js +93 -0
  420. package/dist/story/definition.d.ts +52 -0
  421. package/dist/story/definition.js +9 -0
  422. package/dist/story/diff.d.ts +9 -0
  423. package/dist/story/diff.js +97 -0
  424. package/dist/story/errors.d.ts +14 -0
  425. package/dist/story/errors.js +21 -0
  426. package/dist/story/gateways.d.ts +74 -0
  427. package/dist/story/gateways.js +3 -0
  428. package/dist/story/host.d.ts +27 -0
  429. package/dist/story/host.js +97 -0
  430. package/dist/story/index.d.ts +7 -0
  431. package/dist/story/index.js +9 -0
  432. package/dist/story/json.d.ts +16 -0
  433. package/dist/story/json.js +59 -0
  434. package/dist/story/live/artifact-gateway.d.ts +2 -0
  435. package/dist/story/live/artifact-gateway.js +82 -0
  436. package/dist/story/mode.d.ts +17 -0
  437. package/dist/story/mode.js +21 -0
  438. package/dist/story/orphans.d.ts +17 -0
  439. package/dist/story/orphans.js +15 -0
  440. package/dist/story/report.d.ts +30 -0
  441. package/dist/story/report.js +118 -0
  442. package/dist/story/run.d.ts +49 -0
  443. package/dist/story/run.js +160 -0
  444. package/dist/story/sequence.d.ts +30 -0
  445. package/dist/story/sequence.js +74 -0
  446. package/dist/story/settle.d.ts +94 -0
  447. package/dist/story/settle.js +70 -0
  448. package/dist/time/duration.d.ts +19 -0
  449. package/dist/time/duration.js +37 -0
  450. package/dist/time/index.d.ts +2 -0
  451. package/dist/time/index.js +4 -0
  452. package/dist/time/time.d.ts +15 -0
  453. package/dist/time/time.js +23 -0
  454. package/dist/vercel-cli/ansi.d.ts +13 -0
  455. package/dist/vercel-cli/ansi.js +32 -0
  456. package/dist/vercel-cli/arguments.d.ts +25 -0
  457. package/dist/vercel-cli/arguments.js +78 -0
  458. package/dist/vercel-cli/auth-config.d.ts +43 -0
  459. package/dist/vercel-cli/auth-config.js +36 -0
  460. package/dist/vercel-cli/clock.d.ts +9 -0
  461. package/dist/vercel-cli/clock.js +10 -0
  462. package/dist/vercel-cli/config-files.d.ts +24 -0
  463. package/dist/vercel-cli/config-files.js +40 -0
  464. package/dist/vercel-cli/context.d.ts +12 -0
  465. package/dist/vercel-cli/context.js +12 -0
  466. package/dist/vercel-cli/driver.d.ts +218 -0
  467. package/dist/vercel-cli/driver.js +364 -0
  468. package/dist/vercel-cli/entry.d.ts +8 -0
  469. package/dist/vercel-cli/entry.js +13 -0
  470. package/dist/vercel-cli/environment.d.ts +33 -0
  471. package/dist/vercel-cli/environment.js +72 -0
  472. package/dist/vercel-cli/errors.d.ts +8 -0
  473. package/dist/vercel-cli/errors.js +8 -0
  474. package/dist/vercel-cli/gateways.d.ts +103 -0
  475. package/dist/vercel-cli/gateways.js +4 -0
  476. package/dist/vercel-cli/index.d.ts +10 -0
  477. package/dist/vercel-cli/index.js +15 -0
  478. package/dist/vercel-cli/invocation.d.ts +234 -0
  479. package/dist/vercel-cli/invocation.js +397 -0
  480. package/dist/vercel-cli/keys.d.ts +14 -0
  481. package/dist/vercel-cli/keys.js +12 -0
  482. package/dist/vercel-cli/live/config-files.d.ts +28 -0
  483. package/dist/vercel-cli/live/config-files.js +66 -0
  484. package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
  485. package/dist/vercel-cli/live/process-gateway.js +178 -0
  486. package/dist/vercel-cli/redaction.d.ts +13 -0
  487. package/dist/vercel-cli/redaction.js +22 -0
  488. package/dist/vercel-cli/report.d.ts +22 -0
  489. package/dist/vercel-cli/report.js +110 -0
  490. package/dist/vercel-cli/verbose.d.ts +7 -0
  491. package/dist/vercel-cli/verbose.js +24 -0
  492. package/dist/version.d.ts +20 -0
  493. package/dist/version.js +57 -0
  494. package/dist/vitest/config.d.ts +51 -0
  495. package/dist/vitest/config.js +61 -0
  496. package/dist/vitest/container-scope.d.ts +108 -0
  497. package/dist/vitest/container-scope.js +234 -0
  498. package/dist/vitest/diagnostics.d.ts +146 -0
  499. package/dist/vitest/diagnostics.js +306 -0
  500. package/dist/vitest/find-vitest.d.ts +7 -0
  501. package/dist/vitest/find-vitest.js +28 -0
  502. package/dist/vitest/fixtures.d.ts +64 -0
  503. package/dist/vitest/fixtures.js +172 -0
  504. package/dist/vitest/gateways.d.ts +78 -0
  505. package/dist/vitest/gateways.js +4 -0
  506. package/dist/vitest/index.d.ts +3 -0
  507. package/dist/vitest/index.js +9 -0
  508. package/dist/vitest/list-output.d.ts +3 -0
  509. package/dist/vitest/list-output.js +19 -0
  510. package/dist/vitest/live/list-gateway.d.ts +11 -0
  511. package/dist/vitest/live/list-gateway.js +107 -0
  512. package/dist/vitest/ownership.d.ts +29 -0
  513. package/dist/vitest/ownership.js +68 -0
  514. package/dist/vitest/plan.d.ts +66 -0
  515. package/dist/vitest/plan.js +104 -0
  516. package/dist/vitest/sandbox.d.ts +16 -0
  517. package/dist/vitest/sandbox.js +35 -0
  518. package/dist/vitest/test-events.d.ts +41 -0
  519. package/dist/vitest/test-events.js +92 -0
  520. package/dist/vitest/test-results.d.ts +84 -0
  521. package/dist/vitest/test-results.js +160 -0
  522. package/dist/vitest/types.d.ts +68 -0
  523. package/dist/vitest/types.js +4 -0
  524. package/package.json +119 -3
  525. package/skills/overview.md +33 -0
  526. package/skills/read-run-output.md +65 -0
  527. package/README.md +0 -3
@@ -0,0 +1,166 @@
1
+ import { z } from "zod";
2
+ /** The factory definitions, shaped like their paths: `factories.tokens.tokens` is `tokens/tokens`. */
3
+ export declare const factories: {
4
+ readonly users: import("./definition.ts").FactoryDefinition<{
5
+ id: z.ZodOptional<z.ZodString>;
6
+ username: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodOptional<z.ZodString>;
8
+ email: z.ZodOptional<z.ZodString>;
9
+ defaultTeamId: z.ZodOptional<z.ZodString>;
10
+ }, {
11
+ id: z.ZodString;
12
+ type: z.ZodLiteral<"user">;
13
+ username: z.ZodString;
14
+ name: z.ZodString;
15
+ email: z.ZodString;
16
+ defaultTeamId: z.ZodOptional<z.ZodString>;
17
+ }>;
18
+ readonly teams: import("./definition.ts").FactoryDefinition<{
19
+ id: z.ZodOptional<z.ZodString>;
20
+ slug: z.ZodOptional<z.ZodString>;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ creatorId: z.ZodOptional<z.ZodString>;
23
+ members: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ uid: z.ZodString;
25
+ role: z.ZodEnum<{
26
+ BILLING: "BILLING";
27
+ CONTRIBUTOR: "CONTRIBUTOR";
28
+ DEVELOPER: "DEVELOPER";
29
+ MEMBER: "MEMBER";
30
+ OWNER: "OWNER";
31
+ SECURITY: "SECURITY";
32
+ VIEWER: "VIEWER";
33
+ VIEWER_FOR_PLUS: "VIEWER_FOR_PLUS";
34
+ }>;
35
+ confirmed: z.ZodBoolean;
36
+ created: z.ZodOptional<z.ZodNumber>;
37
+ createdAt: z.ZodOptional<z.ZodNumber>;
38
+ accessRequestedAt: z.ZodOptional<z.ZodNumber>;
39
+ joinedFrom: z.ZodOptional<z.ZodObject<{
40
+ origin: z.ZodString;
41
+ gitUserLogin: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$loose>>;
43
+ }, z.core.$strict>>>;
44
+ billing: z.ZodOptional<z.ZodObject<{
45
+ plan: z.ZodNullable<z.ZodEnum<{
46
+ enterprise: "enterprise";
47
+ hobby: "hobby";
48
+ pro: "pro";
49
+ }>>;
50
+ period: z.ZodNullable<z.ZodString>;
51
+ email: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strict>>;
53
+ saml: z.ZodOptional<z.ZodObject<{
54
+ enforced: z.ZodBoolean;
55
+ connection: z.ZodOptional<z.ZodObject<{
56
+ id: z.ZodString;
57
+ type: z.ZodString;
58
+ state: z.ZodString;
59
+ connectedAt: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strict>>;
61
+ }, z.core.$strict>>;
62
+ sensitiveEnvironmentVariablePolicy: z.ZodOptional<z.ZodEnum<{
63
+ default: "default";
64
+ off: "off";
65
+ on: "on";
66
+ }>>;
67
+ disjunctiveProductionSecretPolicy: z.ZodOptional<z.ZodEnum<{
68
+ default: "default";
69
+ off: "off";
70
+ on: "on";
71
+ }>>;
72
+ }, {
73
+ id: z.ZodString;
74
+ type: z.ZodLiteral<"team">;
75
+ slug: z.ZodString;
76
+ name: z.ZodString;
77
+ creatorId: z.ZodString;
78
+ members: z.ZodArray<z.ZodObject<{
79
+ uid: z.ZodString;
80
+ role: z.ZodString;
81
+ confirmed: z.ZodBoolean;
82
+ createdAt: z.ZodOptional<z.ZodNumber>;
83
+ accessRequestedAt: z.ZodOptional<z.ZodNumber>;
84
+ joinedFrom: z.ZodOptional<z.ZodObject<{
85
+ origin: z.ZodString;
86
+ gitUserLogin: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$loose>>;
88
+ }, z.core.$loose>>;
89
+ saml: z.ZodOptional<z.ZodObject<{
90
+ enforced: z.ZodBoolean;
91
+ connection: z.ZodOptional<z.ZodObject<{
92
+ id: z.ZodString;
93
+ type: z.ZodString;
94
+ state: z.ZodString;
95
+ }, z.core.$loose>>;
96
+ }, z.core.$loose>>;
97
+ sensitiveEnvironmentVariablePolicy: z.ZodOptional<z.ZodEnum<{
98
+ default: "default";
99
+ off: "off";
100
+ on: "on";
101
+ }>>;
102
+ disjunctiveProductionSecretPolicy: z.ZodOptional<z.ZodEnum<{
103
+ default: "default";
104
+ off: "off";
105
+ on: "on";
106
+ }>>;
107
+ }>;
108
+ readonly projects: import("./definition.ts").FactoryDefinition<{
109
+ id: z.ZodOptional<z.ZodString>;
110
+ name: z.ZodOptional<z.ZodString>;
111
+ accountId: z.ZodOptional<z.ZodString>;
112
+ framework: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
+ buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
+ rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
+ link: z.ZodOptional<z.ZodObject<{
116
+ type: z.ZodLiteral<"github">;
117
+ org: z.ZodString;
118
+ repo: z.ZodString;
119
+ repoId: z.ZodNumber;
120
+ }, z.core.$strict>>;
121
+ }, {
122
+ id: z.ZodString;
123
+ name: z.ZodString;
124
+ accountId: z.ZodString;
125
+ framework: z.ZodOptional<z.ZodNullable<z.ZodString>>;
126
+ buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
127
+ rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
128
+ link: z.ZodOptional<z.ZodObject<{
129
+ type: z.ZodString;
130
+ org: z.ZodOptional<z.ZodString>;
131
+ repo: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$loose>>;
133
+ }>;
134
+ readonly tokens: {
135
+ readonly tokens: import("./definition.ts").FactoryDefinition<{
136
+ uid: z.ZodString;
137
+ teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ scopes: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
139
+ type: z.ZodLiteral<"user">;
140
+ origin: z.ZodOptional<z.ZodString>;
141
+ createdAt: z.ZodNumber;
142
+ }, z.core.$strict>, z.ZodObject<{
143
+ type: z.ZodLiteral<"team">;
144
+ teamId: z.ZodString;
145
+ origin: z.ZodOptional<z.ZodString>;
146
+ createdAt: z.ZodNumber;
147
+ }, z.core.$strict>], "type">>>;
148
+ projectId: z.ZodOptional<z.ZodString>;
149
+ projectScope: z.ZodOptional<z.ZodEnum<{
150
+ account: "account";
151
+ "project-only": "project-only";
152
+ }>>;
153
+ }, {
154
+ id: z.ZodString;
155
+ uid: z.ZodString;
156
+ type: z.ZodLiteral<"token">;
157
+ teamId: z.ZodNullable<z.ZodString>;
158
+ secretString: z.ZodString;
159
+ scopes: z.ZodArray<z.ZodObject<{
160
+ type: z.ZodString;
161
+ }, z.core.$loose>>;
162
+ projectId: z.ZodOptional<z.ZodString>;
163
+ projectScope: z.ZodOptional<z.ZodString>;
164
+ }>;
165
+ };
166
+ };
@@ -0,0 +1,235 @@
1
+ import { z } from "zod";
2
+ import { defineFactory } from "./definition.js";
3
+ /** The `vercel/api` commit these definitions were checked against. */
4
+ const CHECKED_AGAINST = "6d01460f045";
5
+ /**
6
+ * `users` (`packages/users-test-factory/src/users.ts`). Every attribute has a default, so `{}` is valid input.
7
+ * `defaultTeamId` is unset by default; a user the `vercel` CLI acts as needs it to name a team it is a member of.
8
+ * The response is the whole user record; the definition checks the fields examples use.
9
+ */
10
+ const users = defineFactory({
11
+ path: "users",
12
+ checkedAgainst: CHECKED_AGAINST,
13
+ input: z.strictObject({
14
+ id: z.string().optional(),
15
+ username: z.string().optional(),
16
+ name: z.string().optional(),
17
+ email: z.string().optional(),
18
+ defaultTeamId: z.string().optional(),
19
+ }),
20
+ output: z.looseObject({
21
+ id: z.string(),
22
+ type: z.literal("user"),
23
+ username: z.string(),
24
+ name: z.string(),
25
+ email: z.string(),
26
+ defaultTeamId: z.string().optional(),
27
+ }),
28
+ });
29
+ /** A team membership role (`packages/acl-types/roles.ts`, `teamRoles`). */
30
+ const teamRole = z.enum([
31
+ "OWNER",
32
+ "MEMBER",
33
+ "DEVELOPER",
34
+ "SECURITY",
35
+ "BILLING",
36
+ "VIEWER",
37
+ "VIEWER_FOR_PLUS",
38
+ "CONTRIBUTOR",
39
+ ]);
40
+ /**
41
+ * A team's SAML configuration (`packages/core-types/src/saml.ts`, `SamlConfiguration`), only the fields tests seed:
42
+ * `orgId`, `roles`, `directory` and `defaultRedirectUri` wait until a test needs them. The API treats a team as
43
+ * SAML-enforced when `enforced` is true and its connection's `state` is `active` (`packages/auth/is-saml-enabled.ts`),
44
+ * and then a token reaches it only through a team scope for it (`packages/auth/token-scope.ts`, `getTeamScope`).
45
+ */
46
+ const samlConfiguration = z.strictObject({
47
+ enforced: z.boolean(),
48
+ connection: z
49
+ .strictObject({
50
+ id: z.string(),
51
+ type: z.string(),
52
+ state: z.string(),
53
+ connectedAt: z.number().optional(),
54
+ })
55
+ .optional(),
56
+ });
57
+ /**
58
+ * Where a team member joined from (`packages/core-types/src/membership.ts`, `TeamMembershipJoinedSource`): its
59
+ * `origin`, such as `github`, and the type's other fields, unchecked; `gitUserLogin` names a Git provider's user.
60
+ */
61
+ const joinedFrom = z.looseObject({ origin: z.string(), gitUserLogin: z.string().optional() });
62
+ /**
63
+ * A team policy's setting (`packages/core-types/src/on-off-default.ts`, `OnOffDefault`): `default` leaves it to the
64
+ * API's default, `on` and `off` set it.
65
+ */
66
+ const onOffDefault = z.enum(["default", "on", "off"]);
67
+ /**
68
+ * `teams` (`packages/teams-test-factory/src/index.ts`). Every attribute has a default: `members` defaults to
69
+ * `creatorId` as its one confirmed `OWNER`, and `creatorId` to a random user id. After building the team, the
70
+ * factory writes each member's membership onto that member's user record, and Testserver wires it with
71
+ * `strictMembershipWrites: true` (`testserver/factories/src/server.ts`), so every member, the default creator
72
+ * included, must be a user seeded first. The default member has `created` and `createdAt`, but the factory passes
73
+ * given members through unchanged, so a member given without `createdAt` has none, and `GET /v2/teams/:teamId/members`
74
+ * (`services/api-team-members/src/endpoint/get-members.ts`), which pages by it, then answers `pagination.next: null`
75
+ * with `hasNext: true`. The factory copies each member's `confirmed` onto that user's record, stamped with its own
76
+ * `confirmedAt` and `accessRequestedAt`, and not its `joinedFrom`. `billing` replaces the default Hobby billing object
77
+ * whole. `saml` has no default; the factory passes it through unchanged. `sensitiveEnvironmentVariablePolicy` defaults
78
+ * to `default`, and `disjunctiveProductionSecretPolicy` (production secrets kept apart from other environments' values
79
+ * for the same key) has no default; the factory stores either as given on the team (`packages/core-types/src/team.ts`,
80
+ * `Team`), where `GET /v2/teams/:teamId` reads them back.
81
+ */
82
+ const teams = defineFactory({
83
+ path: "teams",
84
+ checkedAgainst: CHECKED_AGAINST,
85
+ input: z.strictObject({
86
+ id: z.string().optional(),
87
+ slug: z.string().optional(),
88
+ name: z.string().optional(),
89
+ creatorId: z.string().optional(),
90
+ members: z
91
+ .array(
92
+ // A membership (`packages/core-types/src/membership.ts`, `TeamMembership`), only the fields tests seed.
93
+ z.strictObject({
94
+ uid: z.string(),
95
+ role: teamRole,
96
+ // `false` for a pending member, such as one who requested access.
97
+ confirmed: z.boolean(),
98
+ // When the member joined: `created`, and `createdAt`, which `GET /v2/teams/:teamId/members` pages by.
99
+ created: z.number().optional(),
100
+ createdAt: z.number().optional(),
101
+ // When a pending member requested access, and where from (`TeamMembershipJoinedSource`), which
102
+ // `GET /v1/teams/:teamId/request/:userId` reads back.
103
+ accessRequestedAt: z.number().optional(),
104
+ joinedFrom: joinedFrom.optional(),
105
+ }))
106
+ .optional(),
107
+ billing: z
108
+ .strictObject({
109
+ // `BillingPlan` (`packages/core-types/src/billing.ts`), or `null`, which the API lists as a team with no plan.
110
+ plan: z.enum(["hobby", "pro", "enterprise"]).nullable(),
111
+ // A billing period such as `monthly`, or `null` for a free plan.
112
+ period: z.string().nullable(),
113
+ // The invoice recipient, which `vercel teams members remove` asks to replace when it removes them.
114
+ email: z.string().optional(),
115
+ })
116
+ .optional(),
117
+ saml: samlConfiguration.optional(),
118
+ sensitiveEnvironmentVariablePolicy: onOffDefault.optional(),
119
+ disjunctiveProductionSecretPolicy: onOffDefault.optional(),
120
+ }),
121
+ output: z.looseObject({
122
+ id: z.string(),
123
+ type: z.literal("team"),
124
+ slug: z.string(),
125
+ name: z.string(),
126
+ creatorId: z.string(),
127
+ members: z.array(z.looseObject({
128
+ uid: z.string(),
129
+ role: z.string(),
130
+ confirmed: z.boolean(),
131
+ createdAt: z.number().optional(),
132
+ accessRequestedAt: z.number().optional(),
133
+ joinedFrom: joinedFrom.optional(),
134
+ })),
135
+ saml: z
136
+ .looseObject({
137
+ enforced: z.boolean(),
138
+ connection: z.looseObject({ id: z.string(), type: z.string(), state: z.string() }).optional(),
139
+ })
140
+ .optional(),
141
+ sensitiveEnvironmentVariablePolicy: onOffDefault.optional(),
142
+ disjunctiveProductionSecretPolicy: onOffDefault.optional(),
143
+ }),
144
+ });
145
+ /**
146
+ * A project's GitHub link (`packages/projects-types/types.ts`, `GithubProjectLink`), only the fields tests seed:
147
+ * `GET /v9/projects?repoUrl=` matches a project on `type`, `org` and `repo`. The type's `gitCredentialId`,
148
+ * `productionBranch` and `repoOwnerId` wait until a test needs them.
149
+ */
150
+ const githubLink = z.strictObject({
151
+ type: z.literal("github"),
152
+ org: z.string(),
153
+ repo: z.string(),
154
+ repoId: z.number().int(),
155
+ });
156
+ /**
157
+ * `projects` (`packages/projects-test-factory/src/index.ts`), the top-level project builder only. `accountId` is
158
+ * the user or team id that owns the project; it defaults to a random user id, and nothing checks that the account
159
+ * exists. `framework`, `buildCommand`, `rootDirectory` and `link` (`packages/projects-types/types.ts`, `Project`)
160
+ * have no default; the factory passes them through unchanged.
161
+ */
162
+ const projects = defineFactory({
163
+ path: "projects",
164
+ checkedAgainst: CHECKED_AGAINST,
165
+ input: z.strictObject({
166
+ id: z.string().optional(),
167
+ name: z.string().optional(),
168
+ accountId: z.string().optional(),
169
+ // A framework slug such as `nextjs`, or `null` for "Other".
170
+ framework: z.string().nullable().optional(),
171
+ buildCommand: z.string().nullable().optional(),
172
+ rootDirectory: z.string().nullable().optional(),
173
+ link: githubLink.optional(),
174
+ }),
175
+ output: z.looseObject({
176
+ id: z.string(),
177
+ name: z.string(),
178
+ accountId: z.string(),
179
+ framework: z.string().nullable().optional(),
180
+ buildCommand: z.string().nullable().optional(),
181
+ rootDirectory: z.string().nullable().optional(),
182
+ link: z.looseObject({ type: z.string(), org: z.string().optional(), repo: z.string().optional() }).optional(),
183
+ }),
184
+ });
185
+ /** A classic token's authorization scope (`packages/token-types/src/classic-token.ts`, `TokenScope`). */
186
+ const tokenScope = z.discriminatedUnion("type", [
187
+ z.strictObject({ type: z.literal("user"), origin: z.string().optional(), createdAt: z.number() }),
188
+ z.strictObject({
189
+ type: z.literal("team"),
190
+ teamId: z.string(),
191
+ origin: z.string().optional(),
192
+ createdAt: z.number(),
193
+ }),
194
+ ]);
195
+ /**
196
+ * `tokens/tokens` (`packages/tokens-test-factory/src/index.ts`): a classic token for the user `uid`.
197
+ * `secretString` is the 24-character secret; `Authorization: Bearer <secretString>` authenticates as the user in
198
+ * the container that seeded it.
199
+ *
200
+ * `scopes` decides which teams the token reaches, not `teamId` (`packages/auth/token-scope.ts`, `getTeamScope`).
201
+ * It defaults to one user scope, which reaches every team the user belongs to that doesn't enforce SAML, whatever
202
+ * `teamId` says. Passing `scopes` replaces that list: a token limited to one team has only that team's scope.
203
+ *
204
+ * `projectId` limits the token to one project, which must belong to the token's owner, and `projectScope` says how far
205
+ * (`packages/token-types/src/classic-token.ts`, `ProjectTokenScope`): `account`, the default when it is missing, keeps
206
+ * the account's other resources, and `project-only` denies team and user resources, so `GET /v2/user` answers 404.
207
+ */
208
+ const tokens = defineFactory({
209
+ path: "tokens/tokens",
210
+ checkedAgainst: CHECKED_AGAINST,
211
+ input: z.strictObject({
212
+ uid: z.string(),
213
+ teamId: z.string().nullable().optional(),
214
+ scopes: z.array(tokenScope).optional(),
215
+ projectId: z.string().optional(),
216
+ projectScope: z.enum(["account", "project-only"]).optional(),
217
+ }),
218
+ output: z.looseObject({
219
+ id: z.string(),
220
+ uid: z.string(),
221
+ type: z.literal("token"),
222
+ teamId: z.string().nullable(),
223
+ secretString: z.string(),
224
+ scopes: z.array(z.looseObject({ type: z.string() })),
225
+ projectId: z.string().optional(),
226
+ projectScope: z.string().optional(),
227
+ }),
228
+ });
229
+ /** The factory definitions, shaped like their paths: `factories.tokens.tokens` is `tokens/tokens`. */
230
+ export const factories = {
231
+ users,
232
+ teams,
233
+ projects,
234
+ tokens: { tokens },
235
+ };
@@ -0,0 +1,25 @@
1
+ import type { TestserverFailure } from "../testserver/index.ts";
2
+ /** A factory call's options, the second element of the `[data, options]` body. Untyped in this slice. */
3
+ export type FactoryOptions = Readonly<Record<string, unknown>>;
4
+ /** One factory call: `path` (such as `tokens/tokens`) in the container `testId` selects. */
5
+ export interface FactoryBuildRequest {
6
+ readonly testserverUrl: string;
7
+ readonly testId: string;
8
+ readonly path: string;
9
+ readonly data: unknown;
10
+ readonly options?: FactoryOptions;
11
+ }
12
+ export type FactoryBuildOutcome = {
13
+ readonly ok: true;
14
+ readonly body: unknown;
15
+ } | {
16
+ readonly ok: false;
17
+ readonly failure: TestserverFailure;
18
+ };
19
+ /**
20
+ * Testserver's factories, which seed entities into a container. An unknown path is an `http-error` 404, and a
21
+ * factory that fails to build is an `http-error` 500. It never rejects: every failure is in the outcome.
22
+ */
23
+ export interface FactoryGateway {
24
+ build(request: FactoryBuildRequest): Promise<FactoryBuildOutcome>;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export { buildFactory, buildUntypedFactory, type FactoryCall, type FactoryContext, FactoryInputError, FactoryOutputError, type FactoryTarget, } from "./build.ts";
2
+ export { type AnyFactoryDefinition, defineFactory, type FactoryDefinition, type FactoryInput, type FactoryOutput, } from "./definition.ts";
3
+ export { factories } from "./definitions.ts";
4
+ export type { FactoryBuildOutcome, FactoryBuildRequest, FactoryGateway, FactoryOptions } from "./gateways.ts";
5
+ export { liveFactoryGateway, type LiveFactoryOptions } from "./live/factory-gateway.ts";
@@ -0,0 +1,5 @@
1
+ // The SDK's `factories` module: factory definitions, the factory gateway, and building entities through them.
2
+ export { buildFactory, buildUntypedFactory, FactoryInputError, FactoryOutputError, } from "./build.js";
3
+ export { defineFactory, } from "./definition.js";
4
+ export { factories } from "./definitions.js";
5
+ export { liveFactoryGateway } from "./live/factory-gateway.js";
@@ -0,0 +1,10 @@
1
+ import type { FactoryGateway } from "../gateways.ts";
2
+ export interface LiveFactoryOptions {
3
+ /** How long one factory call, response body included, may take. */
4
+ readonly timeoutMs: number;
5
+ }
6
+ /**
7
+ * Factory calls over `fetch`: `POST /_/factories/<path>` with the `test-id` header and the JSON body
8
+ * `[data, options]`, or `[data]` without options. The response body is JSON.
9
+ */
10
+ export declare function liveFactoryGateway(options: LiveFactoryOptions): FactoryGateway;
@@ -0,0 +1,29 @@
1
+ import { BODY_EXCERPT_CHARS, requestTestserver } from "../../testserver/index.js";
2
+ /**
3
+ * Factory calls over `fetch`: `POST /_/factories/<path>` with the `test-id` header and the JSON body
4
+ * `[data, options]`, or `[data]` without options. The response body is JSON.
5
+ */
6
+ export function liveFactoryGateway(options) {
7
+ return { build: (request) => build(options, request) };
8
+ }
9
+ async function build(options, request) {
10
+ const response = await requestTestserver({
11
+ testserverUrl: request.testserverUrl,
12
+ testId: request.testId,
13
+ method: "POST",
14
+ path: `/_/factories/${request.path}`,
15
+ body: request.options === undefined ? [request.data] : [request.data, request.options],
16
+ timeoutMs: options.timeoutMs,
17
+ });
18
+ if (!response.ok)
19
+ return response;
20
+ try {
21
+ return { ok: true, body: JSON.parse(response.text) };
22
+ }
23
+ catch {
24
+ return {
25
+ ok: false,
26
+ failure: { kind: "malformed", detail: `not JSON: ${response.text.slice(0, BODY_EXCERPT_CHARS)}` },
27
+ };
28
+ }
29
+ }
@@ -0,0 +1,7 @@
1
+ export { type Container, type ContainerInfo, type ContainerLogRecord, type ContainerOptions, type ContainerRequestBody, type ContainerRequestInit, FEATURE_FLAG_CLIENTS, type FeatureFlagClient, type FeatureFlags, featureFlagsKey, type FeatureFlagValue, liveSdkContext, type SdkContext, type ServiceWarmup, type ServiceWarmupOutcome, startContainer, withContainer, } from "./container/index.ts";
2
+ export { type AnyFactoryDefinition, defineFactory, type FactoryCall, factories, type FactoryDefinition, type FactoryInput, FactoryInputError, type FactoryOptions, type FactoryOutput, FactoryOutputError, } from "./factories/index.ts";
3
+ export { parseTestEvent, readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayload, RunPayloadError, type RunPayloadGitHubFixtureRepo, type RunPayloadResources, type TestEvent, testEventLine, type TestEventState, type TestResultError, type TestResultEvent, type TestResultOutput, type WorkerTestEvent, } from "./payload/index.ts";
4
+ export { type ContainerProxy, type FaultHandle, type FaultResponse, type FaultRule, type FaultUpstream, isOpenRecord, type OpenRequestOutcome, type ProxyFault, type ProxyOptions, type ProxyRequestOutcome, type ProxyRequestRecord, type ProxyTarget, startProxy, withProxy, } from "./proxy/index.ts";
5
+ export { type ApiRequestRecord, RECORDED_BODY_CAP_BYTES, type RecordedBody, REDACTED, redactSecrets, redactTokenFields, } from "./records/index.ts";
6
+ export { type Login, type LoginOptions, type LoginProjectOption, type LoginTeamOptions, type SeededProject, type SeedProjectFields, type SeededTeam, type SeededTeamlessUser, type SeededToken, type SeededUser, type SeedTeamMember, type SeedDefaultTeamFields, type SeedUserFields, type Seeder, seeder, type SeederOptions, type TeamPolicies, type TeamPolicy, type TeamRole, } from "./seed/index.ts";
7
+ export { describeFailure, type KnownTestserverServiceId, MAX_TEST_ID_LENGTH, SERVICE_IDS_CHECKED_AGAINST, TESTSERVER_CONNECTION_FAILURE, TESTSERVER_SERVICE_IDS, type TestserverServiceId, TEST_ID_HEADER, TestIdError, TestserverCallError, type TestserverFailure, } from "./testserver/index.ts";
@@ -0,0 +1,15 @@
1
+ // The storm SDK's published surface, exported as `@cnc-tools/storm/sdk`: only what a command uses. A command
2
+ // running under a storm run uses it to read the run payload, start containers, seed them through factories or
3
+ // the seeder's entity-level calls, send them API requests, warm their services, read their logs, and proxy clients
4
+ // that can't send a test id. The gateway seams the SDK's own tests and fakes need live on each SDK module's
5
+ // `index.ts`, not here. The Vitest adapter (`src/vitest/`, `@cnc-tools/storm/vitest`) builds on this surface;
6
+ // nothing here imports it. Everything
7
+ // under `src/sdk/` depends only on Node builtins and `zod`, and on nothing outside this directory, so the tree can
8
+ // move into its own package; `tsconfig.sdk.json` and `.oxlintrc.json` check it.
9
+ export { FEATURE_FLAG_CLIENTS, featureFlagsKey, liveSdkContext, startContainer, withContainer, } from "./container/index.js";
10
+ export { defineFactory, factories, FactoryInputError, FactoryOutputError, } from "./factories/index.js";
11
+ export { parseTestEvent, readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError, testEventLine, } from "./payload/index.js";
12
+ export { isOpenRecord, startProxy, withProxy, } from "./proxy/index.js";
13
+ export { RECORDED_BODY_CAP_BYTES, REDACTED, redactSecrets, redactTokenFields, } from "./records/index.js";
14
+ export { seeder, } from "./seed/index.js";
15
+ export { describeFailure, MAX_TEST_ID_LENGTH, SERVICE_IDS_CHECKED_AGAINST, TESTSERVER_CONNECTION_FAILURE, TESTSERVER_SERVICE_IDS, TEST_ID_HEADER, TestIdError, TestserverCallError, } from "./testserver/index.js";
@@ -0,0 +1,2 @@
1
+ export { readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayload, RunPayloadError, type RunPayloadGitHubFixtureRepo, type RunPayloadResources, } from "./payload.ts";
2
+ export { parseTestEvent, type TestEvent, testEventLine, type TestEventState, type TestResultError, type TestResultEvent, type TestResultOutput, type WorkerTestEvent, } from "./test-events.ts";
@@ -0,0 +1,4 @@
1
+ // The SDK's `payload` module: the run payload a command reads from `STORM_RUN`, and the test events a command
2
+ // appends to the file it names.
3
+ export { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError, } from "./payload.js";
4
+ export { parseTestEvent, testEventLine, } from "./test-events.js";
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The GitHub fixture repository a run holds for its command: the HTTPS URL to clone it from, its `owner/name`, a token
3
+ * for it, and the run prefix (`run/<UTC timestamp>-<suffix>`), the branches under which the run deletes once the
4
+ * command has stopped. The token is test data limited to this repository; storm hides it in what it prints and
5
+ * writes, and the command should too.
6
+ */
7
+ export interface RunPayloadGitHubFixtureRepo {
8
+ readonly url: string;
9
+ readonly nameWithOwner: string;
10
+ readonly token: string;
11
+ readonly runPrefix: string;
12
+ }
13
+ /**
14
+ * The resources a run holds for its command, by name: `testserverPool`, in a run with a Testserver side, lists each
15
+ * Testserver sandbox the run holds, once, by its Testserver URL. A run without one has no `testserverPool`.
16
+ * `githubFixtureRepo`, in a run with the GitHub fixture repository resource, names the repository.
17
+ */
18
+ export interface RunPayloadResources {
19
+ readonly testserverPool?: {
20
+ readonly sandboxes: readonly {
21
+ readonly url: string;
22
+ }[];
23
+ };
24
+ readonly githubFixtureRepo?: RunPayloadGitHubFixtureRepo;
25
+ }
26
+ /**
27
+ * The run payload, version 2: the resources the run holds (`resources`); where the command may append test events
28
+ * (`testEvents`, a file path), when the run follows them; and whether the run is verbose (`verbose`, under
29
+ * `storm vitest --verbose` or `storm exec --verbose`), so the command prints what each test did as it goes, passing or not.
30
+ */
31
+ export interface RunPayload {
32
+ readonly version: 2;
33
+ readonly resources: RunPayloadResources;
34
+ readonly testEvents?: string;
35
+ readonly verbose?: true;
36
+ }
37
+ /** The variable a run hands its command the run payload in. */
38
+ export declare const RUN_PAYLOAD_VARIABLE = "STORM_RUN";
39
+ /** `readRunPayload` found `STORM_RUN` missing, not JSON, or not a version 2 run payload. */
40
+ export declare class RunPayloadError extends Error {
41
+ readonly name = "RunPayloadError";
42
+ }
43
+ /**
44
+ * The run payload in `env`'s `STORM_RUN`, which a storm run sets for its command. Throws a
45
+ * `RunPayloadError` saying what is wrong when the variable is missing or holds no valid version 2 run payload.
46
+ */
47
+ export declare function readRunPayload(env?: Readonly<Record<string, string | undefined>>): RunPayload;
@@ -0,0 +1,74 @@
1
+ import { z } from "zod";
2
+ /** The variable a run hands its command the run payload in. */
3
+ export const RUN_PAYLOAD_VARIABLE = "STORM_RUN";
4
+ /** The run payload version this SDK reads. */
5
+ const RUN_PAYLOAD_VERSION = 2;
6
+ const runPayloadSchema = z.object({
7
+ version: z.literal(RUN_PAYLOAD_VERSION),
8
+ resources: z.object({
9
+ testserverPool: z.object({ sandboxes: z.array(z.object({ url: z.string().min(1) })) }).optional(),
10
+ githubFixtureRepo: z
11
+ .object({
12
+ url: z.string().min(1),
13
+ nameWithOwner: z.string().min(1),
14
+ token: z.string().min(1),
15
+ runPrefix: z.string().min(1),
16
+ })
17
+ .optional(),
18
+ }),
19
+ testEvents: z.string().min(1).optional(),
20
+ verbose: z.literal(true).optional(),
21
+ });
22
+ /** `readRunPayload` found `STORM_RUN` missing, not JSON, or not a version 2 run payload. */
23
+ export class RunPayloadError extends Error {
24
+ name = "RunPayloadError";
25
+ }
26
+ /**
27
+ * The run payload in `env`'s `STORM_RUN`, which a storm run sets for its command. Throws a
28
+ * `RunPayloadError` saying what is wrong when the variable is missing or holds no valid version 2 run payload.
29
+ */
30
+ export function readRunPayload(env = process.env) {
31
+ const raw = env[RUN_PAYLOAD_VARIABLE];
32
+ if (raw === undefined || raw === "") {
33
+ throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm vitest\` or \`storm exec\``);
34
+ }
35
+ let json;
36
+ try {
37
+ json = JSON.parse(raw);
38
+ }
39
+ catch {
40
+ throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not JSON`);
41
+ }
42
+ if (typeof json === "object" && json !== null && "version" in json && json.version !== RUN_PAYLOAD_VERSION) {
43
+ throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} has run payload version ${JSON.stringify(json.version)}; this SDK reads version ${RUN_PAYLOAD_VERSION}`);
44
+ }
45
+ const parsed = runPayloadSchema.safeParse(json);
46
+ if (!parsed.success) {
47
+ const issue = parsed.error.issues[0];
48
+ const where = issue === undefined || issue.path.length === 0 ? "" : ` at ${issue.path.join(".")}`;
49
+ throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not a valid run payload${where}: ${issue?.message ?? "invalid"}`);
50
+ }
51
+ const { resources, testEvents, verbose } = parsed.data;
52
+ const pool = resources.testserverPool;
53
+ const github = resources.githubFixtureRepo;
54
+ return {
55
+ version: RUN_PAYLOAD_VERSION,
56
+ resources: {
57
+ ...(pool === undefined
58
+ ? {}
59
+ : { testserverPool: { sandboxes: pool.sandboxes.map((sandbox) => ({ url: sandbox.url })) } }),
60
+ ...(github === undefined
61
+ ? {}
62
+ : {
63
+ githubFixtureRepo: {
64
+ url: github.url,
65
+ nameWithOwner: github.nameWithOwner,
66
+ token: github.token,
67
+ runPrefix: github.runPrefix,
68
+ },
69
+ }),
70
+ },
71
+ ...(testEvents === undefined ? {} : { testEvents }),
72
+ ...(verbose === undefined ? {} : { verbose }),
73
+ };
74
+ }