@atomic-chat/core 0.5.1 → 0.13.2

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 (970) hide show
  1. package/README.md +22 -0
  2. package/dist/app-daemon.js +20 -67
  3. package/dist/app-daemon.js.map +1 -1
  4. package/dist/backend/advisor/advisor.d.ts +132 -0
  5. package/dist/backend/advisor/advisor.js +537 -0
  6. package/dist/backend/advisor/advisor.js.map +1 -0
  7. package/dist/backend/advisor/index.d.ts +6 -0
  8. package/dist/backend/advisor/index.js +7 -0
  9. package/dist/backend/advisor/index.js.map +1 -0
  10. package/dist/backend/advisor/policy.d.ts +81 -0
  11. package/dist/backend/advisor/policy.js +154 -0
  12. package/dist/backend/advisor/policy.js.map +1 -0
  13. package/dist/backend/catalog/archive.d.ts +21 -7
  14. package/dist/backend/catalog/archive.js +57 -17
  15. package/dist/backend/catalog/archive.js.map +1 -1
  16. package/dist/backend/catalog/bundled-manifest-baseline.js +42 -26
  17. package/dist/backend/catalog/bundled-manifest-baseline.js.map +1 -1
  18. package/dist/backend/catalog/cuda-family.d.ts +12 -2
  19. package/dist/backend/catalog/cuda-family.js +30 -7
  20. package/dist/backend/catalog/cuda-family.js.map +1 -1
  21. package/dist/backend/catalog/index.d.ts +5 -0
  22. package/dist/backend/catalog/index.js +5 -0
  23. package/dist/backend/catalog/index.js.map +1 -1
  24. package/dist/backend/catalog/manifest.d.ts +5 -3
  25. package/dist/backend/catalog/manifest.js +12 -9
  26. package/dist/backend/catalog/manifest.js.map +1 -1
  27. package/dist/backend/catalog/migrate.d.ts +8 -6
  28. package/dist/backend/catalog/migrate.js +26 -15
  29. package/dist/backend/catalog/migrate.js.map +1 -1
  30. package/dist/backend/catalog/prism-catalog.d.ts +42 -0
  31. package/dist/backend/catalog/prism-catalog.js +101 -0
  32. package/dist/backend/catalog/prism-catalog.js.map +1 -0
  33. package/dist/backend/catalog/prism-manifest-baseline.d.ts +2 -0
  34. package/dist/backend/catalog/prism-manifest-baseline.js +11 -0
  35. package/dist/backend/catalog/prism-manifest-baseline.js.map +1 -0
  36. package/dist/backend/catalog/prism-manifest-baseline.json +134 -0
  37. package/dist/backend/catalog/prism-manifest.d.ts +90 -0
  38. package/dist/backend/catalog/prism-manifest.js +171 -0
  39. package/dist/backend/catalog/prism-manifest.js.map +1 -0
  40. package/dist/backend/catalog/turboquant-catalog.d.ts +60 -0
  41. package/dist/backend/catalog/turboquant-catalog.js +162 -0
  42. package/dist/backend/catalog/turboquant-catalog.js.map +1 -0
  43. package/dist/backend/catalog/turboquant-index.d.ts +104 -0
  44. package/dist/backend/catalog/turboquant-index.js +260 -0
  45. package/dist/backend/catalog/turboquant-index.js.map +1 -0
  46. package/dist/backend/index.d.ts +1 -0
  47. package/dist/backend/index.js +1 -0
  48. package/dist/backend/index.js.map +1 -1
  49. package/dist/backend/install/runtime-backend.d.ts +6 -6
  50. package/dist/backend/install/runtime-backend.js +23 -20
  51. package/dist/backend/install/runtime-backend.js.map +1 -1
  52. package/dist/backend/install/service.d.ts +106 -5
  53. package/dist/backend/install/service.js +247 -21
  54. package/dist/backend/install/service.js.map +1 -1
  55. package/dist/backend/installed/bundled.d.ts +19 -0
  56. package/dist/backend/installed/bundled.js +45 -0
  57. package/dist/backend/installed/bundled.js.map +1 -0
  58. package/dist/backend/installed/index.d.ts +1 -0
  59. package/dist/backend/installed/index.js +1 -0
  60. package/dist/backend/installed/index.js.map +1 -1
  61. package/dist/backend/installed/installed.js +3 -0
  62. package/dist/backend/installed/installed.js.map +1 -1
  63. package/dist/backend/optimal/optimal-cache.d.ts +27 -8
  64. package/dist/backend/optimal/optimal-cache.js +38 -19
  65. package/dist/backend/optimal/optimal-cache.js.map +1 -1
  66. package/dist/backend/optimal/optimal-store.js +1 -1
  67. package/dist/backend/optimal/optimal-store.js.map +1 -1
  68. package/dist/backend/select/categories.d.ts +2 -1
  69. package/dist/backend/select/categories.js +8 -1
  70. package/dist/backend/select/categories.js.map +1 -1
  71. package/dist/backend/select/features.d.ts +13 -5
  72. package/dist/backend/select/features.js +36 -6
  73. package/dist/backend/select/features.js.map +1 -1
  74. package/dist/backend/select/index.d.ts +2 -0
  75. package/dist/backend/select/index.js +2 -0
  76. package/dist/backend/select/index.js.map +1 -1
  77. package/dist/backend/select/prism.d.ts +54 -0
  78. package/dist/backend/select/prism.js +212 -0
  79. package/dist/backend/select/prism.js.map +1 -0
  80. package/dist/backend/select/recovery.d.ts +4 -2
  81. package/dist/backend/select/recovery.js +17 -5
  82. package/dist/backend/select/recovery.js.map +1 -1
  83. package/dist/backend/select/tiers.d.ts +20 -11
  84. package/dist/backend/select/tiers.js +49 -11
  85. package/dist/backend/select/tiers.js.map +1 -1
  86. package/dist/backend/select/turboquant-tiers.d.ts +45 -0
  87. package/dist/backend/select/turboquant-tiers.js +114 -0
  88. package/dist/backend/select/turboquant-tiers.js.map +1 -0
  89. package/dist/backend/types.d.ts +6 -69
  90. package/dist/cli/commands/backends.d.ts +10 -0
  91. package/dist/cli/commands/backends.js +142 -0
  92. package/dist/cli/commands/backends.js.map +1 -0
  93. package/dist/cli/commands/hardware.d.ts +13 -0
  94. package/dist/cli/commands/hardware.js +71 -0
  95. package/dist/cli/commands/hardware.js.map +1 -0
  96. package/dist/cli/commands/host-step.d.ts +28 -0
  97. package/dist/cli/commands/host-step.js +67 -0
  98. package/dist/cli/commands/host-step.js.map +1 -0
  99. package/dist/cli/commands/index.d.ts +4 -1
  100. package/dist/cli/commands/index.js +4 -1
  101. package/dist/cli/commands/index.js.map +1 -1
  102. package/dist/cli/commands/serve.js +4 -4
  103. package/dist/cli/commands/serve.js.map +1 -1
  104. package/dist/cli/commands/shared.d.ts +6 -1
  105. package/dist/cli/commands/shared.js +7 -0
  106. package/dist/cli/commands/shared.js.map +1 -1
  107. package/dist/cli/io.d.ts +11 -0
  108. package/dist/cli/io.js +28 -3
  109. package/dist/cli/io.js.map +1 -1
  110. package/dist/cli/launch.js +2 -2
  111. package/dist/cli/launch.js.map +1 -1
  112. package/dist/cli/main.d.ts +1 -1
  113. package/dist/cli/main.js +11 -1
  114. package/dist/cli/main.js.map +1 -1
  115. package/dist/client/control-client.d.ts +128 -7
  116. package/dist/client/control-client.js +211 -12
  117. package/dist/client/control-client.js.map +1 -1
  118. package/dist/cloud/registry.js +9 -1
  119. package/dist/cloud/registry.js.map +1 -1
  120. package/dist/config/paths.d.ts +137 -0
  121. package/dist/config/paths.js +163 -0
  122. package/dist/config/paths.js.map +1 -1
  123. package/dist/contracts/backend-advisor.d.ts +225 -0
  124. package/dist/contracts/backend-advisor.js +14 -0
  125. package/dist/contracts/backend-advisor.js.map +1 -0
  126. package/dist/contracts/control-api.d.ts +7 -1
  127. package/dist/contracts/control-api.js +7 -1
  128. package/dist/contracts/control-api.js.map +1 -1
  129. package/dist/contracts/decision.d.ts +394 -0
  130. package/dist/contracts/decision.js +69 -0
  131. package/dist/contracts/decision.js.map +1 -0
  132. package/dist/contracts/diffusion.d.ts +62 -9
  133. package/dist/contracts/embedding.d.ts +103 -0
  134. package/dist/contracts/embedding.js +24 -0
  135. package/dist/contracts/embedding.js.map +1 -0
  136. package/dist/contracts/engine-builds.d.ts +108 -0
  137. package/dist/contracts/engine-builds.js +11 -0
  138. package/dist/contracts/engine-builds.js.map +1 -0
  139. package/dist/contracts/engines.d.ts +157 -0
  140. package/dist/contracts/engines.js +50 -0
  141. package/dist/contracts/engines.js.map +1 -0
  142. package/dist/contracts/environment.d.ts +774 -0
  143. package/dist/contracts/environment.js +116 -0
  144. package/dist/contracts/environment.js.map +1 -0
  145. package/dist/contracts/errors.d.ts +43 -2
  146. package/dist/contracts/errors.js +41 -0
  147. package/dist/contracts/errors.js.map +1 -1
  148. package/dist/contracts/events.d.ts +82 -4
  149. package/dist/contracts/hardware.d.ts +79 -6
  150. package/dist/contracts/hardware.js +9 -5
  151. package/dist/contracts/hardware.js.map +1 -1
  152. package/dist/contracts/index.d.ts +8 -0
  153. package/dist/contracts/index.js +8 -0
  154. package/dist/contracts/index.js.map +1 -1
  155. package/dist/contracts/model-compatibility.d.ts +97 -0
  156. package/dist/contracts/model-compatibility.js +6 -0
  157. package/dist/contracts/model-compatibility.js.map +1 -0
  158. package/dist/contracts/model-setup.d.ts +115 -0
  159. package/dist/contracts/model-setup.js +33 -0
  160. package/dist/contracts/model-setup.js.map +1 -0
  161. package/dist/contracts/model-yml.d.ts +14 -0
  162. package/dist/contracts/model-yml.js +1 -0
  163. package/dist/contracts/model-yml.js.map +1 -1
  164. package/dist/contracts/session.d.ts +45 -2
  165. package/dist/contracts/session.js +14 -1
  166. package/dist/contracts/session.js.map +1 -1
  167. package/dist/contracts/settings.d.ts +44 -1
  168. package/dist/contracts/settings.js.map +1 -1
  169. package/dist/core/atomic-core.d.ts +44 -5
  170. package/dist/core/atomic-core.js +24 -0
  171. package/dist/core/atomic-core.js.map +1 -1
  172. package/dist/core/create.js +517 -23
  173. package/dist/core/create.js.map +1 -1
  174. package/dist/core/gpu/index.d.ts +6 -0
  175. package/dist/core/gpu/index.js +7 -0
  176. package/dist/core/gpu/index.js.map +1 -0
  177. package/dist/core/gpu/policy.d.ts +68 -0
  178. package/dist/core/gpu/policy.js +99 -0
  179. package/dist/core/gpu/policy.js.map +1 -0
  180. package/dist/core/gpu/residency.d.ts +44 -0
  181. package/dist/core/gpu/residency.js +101 -0
  182. package/dist/core/gpu/residency.js.map +1 -0
  183. package/dist/core/gpu-residency.d.ts +39 -0
  184. package/dist/core/gpu-residency.js +32 -0
  185. package/dist/core/gpu-residency.js.map +1 -0
  186. package/dist/core/index.d.ts +1 -1
  187. package/dist/core/managed-engines.d.ts +207 -0
  188. package/dist/core/managed-engines.js +579 -0
  189. package/dist/core/managed-engines.js.map +1 -0
  190. package/dist/core/managed-environment.d.ts +72 -0
  191. package/dist/core/managed-environment.js +218 -0
  192. package/dist/core/managed-environment.js.map +1 -0
  193. package/dist/core/model-setup/index.d.ts +4 -0
  194. package/dist/core/model-setup/index.js +5 -0
  195. package/dist/core/model-setup/index.js.map +1 -0
  196. package/dist/core/model-setup/plan.d.ts +56 -0
  197. package/dist/core/model-setup/plan.js +158 -0
  198. package/dist/core/model-setup/plan.js.map +1 -0
  199. package/dist/core/model-setup/service.d.ts +92 -0
  200. package/dist/core/model-setup/service.js +329 -0
  201. package/dist/core/model-setup/service.js.map +1 -0
  202. package/dist/core/model-setup/store.d.ts +29 -0
  203. package/dist/core/model-setup/store.js +116 -0
  204. package/dist/core/model-setup/store.js.map +1 -0
  205. package/dist/core/model-setup/wiring.d.ts +59 -0
  206. package/dist/core/model-setup/wiring.js +132 -0
  207. package/dist/core/model-setup/wiring.js.map +1 -0
  208. package/dist/core/prism.d.ts +36 -0
  209. package/dist/core/prism.js +42 -0
  210. package/dist/core/prism.js.map +1 -0
  211. package/dist/core/public-server.d.ts +7 -0
  212. package/dist/core/public-server.js +2 -0
  213. package/dist/core/public-server.js.map +1 -1
  214. package/dist/core/sessions.d.ts +6 -1
  215. package/dist/core/sessions.js +18 -14
  216. package/dist/core/sessions.js.map +1 -1
  217. package/dist/core/types.d.ts +27 -1
  218. package/dist/core/types.js.map +1 -1
  219. package/dist/decision/args.d.ts +110 -0
  220. package/dist/decision/args.js +126 -0
  221. package/dist/decision/args.js.map +1 -0
  222. package/dist/decision/backoff.d.ts +25 -0
  223. package/dist/decision/backoff.js +33 -0
  224. package/dist/decision/backoff.js.map +1 -0
  225. package/dist/decision/engine-candidates.d.ts +52 -0
  226. package/dist/decision/engine-candidates.js +138 -0
  227. package/dist/decision/engine-candidates.js.map +1 -0
  228. package/dist/decision/engine-fallback.d.ts +41 -0
  229. package/dist/decision/engine-fallback.js +57 -0
  230. package/dist/decision/engine-fallback.js.map +1 -0
  231. package/dist/decision/engine-version.d.ts +27 -0
  232. package/dist/decision/engine-version.js +54 -0
  233. package/dist/decision/engine-version.js.map +1 -0
  234. package/dist/decision/engine.d.ts +114 -0
  235. package/dist/decision/engine.js +253 -0
  236. package/dist/decision/engine.js.map +1 -0
  237. package/dist/decision/http.d.ts +36 -0
  238. package/dist/decision/http.js +73 -0
  239. package/dist/decision/http.js.map +1 -0
  240. package/dist/decision/index.d.ts +20 -0
  241. package/dist/decision/index.js +21 -0
  242. package/dist/decision/index.js.map +1 -0
  243. package/dist/decision/model-facts.d.ts +32 -0
  244. package/dist/decision/model-facts.js +40 -0
  245. package/dist/decision/model-facts.js.map +1 -0
  246. package/dist/decision/outcome.d.ts +35 -0
  247. package/dist/decision/outcome.js +105 -0
  248. package/dist/decision/outcome.js.map +1 -0
  249. package/dist/decision/process.d.ts +67 -0
  250. package/dist/decision/process.js +133 -0
  251. package/dist/decision/process.js.map +1 -0
  252. package/dist/decision/readiness.d.ts +74 -0
  253. package/dist/decision/readiness.js +165 -0
  254. package/dist/decision/readiness.js.map +1 -0
  255. package/dist/decision/request.d.ts +11 -0
  256. package/dist/decision/request.js +56 -0
  257. package/dist/decision/request.js.map +1 -0
  258. package/dist/decision/service.d.ts +202 -0
  259. package/dist/decision/service.js +711 -0
  260. package/dist/decision/service.js.map +1 -0
  261. package/dist/decision/upstream-version.d.ts +23 -0
  262. package/dist/decision/upstream-version.js +34 -0
  263. package/dist/decision/upstream-version.js.map +1 -0
  264. package/dist/decision/wiring.d.ts +67 -0
  265. package/dist/decision/wiring.js +101 -0
  266. package/dist/decision/wiring.js.map +1 -0
  267. package/dist/diffusion/args.d.ts +4 -2
  268. package/dist/diffusion/args.js +10 -3
  269. package/dist/diffusion/args.js.map +1 -1
  270. package/dist/diffusion/image-job.js +1 -1
  271. package/dist/diffusion/image-job.js.map +1 -1
  272. package/dist/diffusion/install.d.ts +35 -11
  273. package/dist/diffusion/install.js +74 -49
  274. package/dist/diffusion/install.js.map +1 -1
  275. package/dist/diffusion/job-kind.d.ts +33 -7
  276. package/dist/diffusion/jobs.d.ts +6 -1
  277. package/dist/diffusion/jobs.js +60 -18
  278. package/dist/diffusion/jobs.js.map +1 -1
  279. package/dist/diffusion/parse.d.ts +1 -2
  280. package/dist/diffusion/parse.js +1 -13
  281. package/dist/diffusion/parse.js.map +1 -1
  282. package/dist/diffusion/progress.js +3 -0
  283. package/dist/diffusion/progress.js.map +1 -1
  284. package/dist/diffusion/server-process.d.ts +6 -0
  285. package/dist/diffusion/server-process.js +3 -2
  286. package/dist/diffusion/server-process.js.map +1 -1
  287. package/dist/diffusion/service.d.ts +52 -6
  288. package/dist/diffusion/service.js +215 -40
  289. package/dist/diffusion/service.js.map +1 -1
  290. package/dist/diffusion/session.d.ts +27 -3
  291. package/dist/diffusion/session.js +108 -17
  292. package/dist/diffusion/session.js.map +1 -1
  293. package/dist/diffusion/state.d.ts +19 -1
  294. package/dist/diffusion/state.js +10 -0
  295. package/dist/diffusion/state.js.map +1 -1
  296. package/dist/diffusion/tracker.d.ts +15 -1
  297. package/dist/diffusion/tracker.js +32 -6
  298. package/dist/diffusion/tracker.js.map +1 -1
  299. package/dist/diffusion/types.d.ts +7 -0
  300. package/dist/diffusion/types.js +11 -0
  301. package/dist/diffusion/types.js.map +1 -1
  302. package/dist/diffusion/video-estimate.d.ts +214 -0
  303. package/dist/diffusion/video-estimate.js +402 -0
  304. package/dist/diffusion/video-estimate.js.map +1 -0
  305. package/dist/diffusion/video-eta.d.ts +90 -0
  306. package/dist/diffusion/video-eta.js +248 -0
  307. package/dist/diffusion/video-eta.js.map +1 -0
  308. package/dist/diffusion/video-history.d.ts +45 -0
  309. package/dist/diffusion/video-history.js +121 -0
  310. package/dist/diffusion/video-history.js.map +1 -0
  311. package/dist/diffusion/video-job.d.ts +13 -5
  312. package/dist/diffusion/video-job.js +42 -15
  313. package/dist/diffusion/video-job.js.map +1 -1
  314. package/dist/diffusion/video-recipe.js +3 -0
  315. package/dist/diffusion/video-recipe.js.map +1 -1
  316. package/dist/diffusion/video-tiling.d.ts +54 -0
  317. package/dist/diffusion/video-tiling.js +70 -0
  318. package/dist/diffusion/video-tiling.js.map +1 -0
  319. package/dist/diffusion/wiring.d.ts +14 -1
  320. package/dist/diffusion/wiring.js +7 -0
  321. package/dist/diffusion/wiring.js.map +1 -1
  322. package/dist/downloads/protocol.d.ts +3 -8
  323. package/dist/downloads/protocol.js.map +1 -1
  324. package/dist/embedding/args.d.ts +39 -0
  325. package/dist/embedding/args.js +46 -0
  326. package/dist/embedding/args.js.map +1 -0
  327. package/dist/embedding/engine.d.ts +50 -0
  328. package/dist/embedding/engine.js +100 -0
  329. package/dist/embedding/engine.js.map +1 -0
  330. package/dist/embedding/ffmpeg.d.ts +18 -0
  331. package/dist/embedding/ffmpeg.js +63 -0
  332. package/dist/embedding/ffmpeg.js.map +1 -0
  333. package/dist/embedding/index.d.ts +16 -0
  334. package/dist/embedding/index.js +17 -0
  335. package/dist/embedding/index.js.map +1 -0
  336. package/dist/embedding/model-facts.d.ts +51 -0
  337. package/dist/embedding/model-facts.js +84 -0
  338. package/dist/embedding/model-facts.js.map +1 -0
  339. package/dist/embedding/process.d.ts +66 -0
  340. package/dist/embedding/process.js +131 -0
  341. package/dist/embedding/process.js.map +1 -0
  342. package/dist/embedding/readiness.d.ts +56 -0
  343. package/dist/embedding/readiness.js +114 -0
  344. package/dist/embedding/readiness.js.map +1 -0
  345. package/dist/embedding/request.d.ts +43 -0
  346. package/dist/embedding/request.js +285 -0
  347. package/dist/embedding/request.js.map +1 -0
  348. package/dist/embedding/service.d.ts +152 -0
  349. package/dist/embedding/service.js +602 -0
  350. package/dist/embedding/service.js.map +1 -0
  351. package/dist/embedding/wiring.d.ts +51 -0
  352. package/dist/embedding/wiring.js +79 -0
  353. package/dist/embedding/wiring.js.map +1 -0
  354. package/dist/engine-builds/builds.d.ts +54 -0
  355. package/dist/engine-builds/builds.js +151 -0
  356. package/dist/engine-builds/builds.js.map +1 -0
  357. package/dist/engine-builds/index.d.ts +10 -0
  358. package/dist/engine-builds/index.js +11 -0
  359. package/dist/engine-builds/index.js.map +1 -0
  360. package/dist/engine-builds/install.d.ts +42 -0
  361. package/dist/engine-builds/install.js +100 -0
  362. package/dist/engine-builds/install.js.map +1 -0
  363. package/dist/engine-builds/manifest.d.ts +121 -0
  364. package/dist/engine-builds/manifest.js +254 -0
  365. package/dist/engine-builds/manifest.js.map +1 -0
  366. package/dist/engine-builds/order.d.ts +24 -0
  367. package/dist/engine-builds/order.js +44 -0
  368. package/dist/engine-builds/order.js.map +1 -0
  369. package/dist/engine-builds/select.d.ts +123 -0
  370. package/dist/engine-builds/select.js +223 -0
  371. package/dist/engine-builds/select.js.map +1 -0
  372. package/dist/engine-builds/service.d.ts +123 -0
  373. package/dist/engine-builds/service.js +392 -0
  374. package/dist/engine-builds/service.js.map +1 -0
  375. package/dist/engines/descriptor-order.d.ts +28 -0
  376. package/dist/engines/descriptor-order.js +60 -0
  377. package/dist/engines/descriptor-order.js.map +1 -0
  378. package/dist/engines/engine-build.d.ts +23 -0
  379. package/dist/engines/engine-build.js +58 -0
  380. package/dist/engines/engine-build.js.map +1 -0
  381. package/dist/engines/index.d.ts +10 -0
  382. package/dist/engines/index.js +11 -0
  383. package/dist/engines/index.js.map +1 -0
  384. package/dist/engines/llamacpp.d.ts +71 -0
  385. package/dist/engines/llamacpp.js +176 -0
  386. package/dist/engines/llamacpp.js.map +1 -0
  387. package/dist/engines/managed.d.ts +49 -0
  388. package/dist/engines/managed.js +88 -0
  389. package/dist/engines/managed.js.map +1 -0
  390. package/dist/engines/service.d.ts +46 -0
  391. package/dist/engines/service.js +61 -0
  392. package/dist/engines/service.js.map +1 -0
  393. package/dist/engines/versions.d.ts +65 -0
  394. package/dist/engines/versions.js +259 -0
  395. package/dist/engines/versions.js.map +1 -0
  396. package/dist/hardware/cpu-flags.d.ts +44 -0
  397. package/dist/hardware/cpu-flags.js +206 -0
  398. package/dist/hardware/cpu-flags.js.map +1 -0
  399. package/dist/hardware/drm-sysfs.d.ts +51 -0
  400. package/dist/hardware/drm-sysfs.js +67 -0
  401. package/dist/hardware/drm-sysfs.js.map +1 -0
  402. package/dist/hardware/facts.d.ts +42 -0
  403. package/dist/hardware/facts.js +92 -0
  404. package/dist/hardware/facts.js.map +1 -0
  405. package/dist/hardware/index.d.ts +19 -3
  406. package/dist/hardware/index.js +19 -3
  407. package/dist/hardware/index.js.map +1 -1
  408. package/dist/hardware/merge.d.ts +55 -0
  409. package/dist/hardware/merge.js +141 -0
  410. package/dist/hardware/merge.js.map +1 -0
  411. package/dist/hardware/nvidia-smi.d.ts +43 -0
  412. package/dist/hardware/nvidia-smi.js +118 -0
  413. package/dist/hardware/nvidia-smi.js.map +1 -0
  414. package/dist/hardware/probe-common.d.ts +72 -0
  415. package/dist/hardware/probe-common.js +106 -0
  416. package/dist/hardware/probe-common.js.map +1 -0
  417. package/dist/hardware/probe-darwin.d.ts +20 -0
  418. package/dist/hardware/probe-darwin.js +76 -0
  419. package/dist/hardware/probe-darwin.js.map +1 -0
  420. package/dist/hardware/probe-linux.d.ts +9 -0
  421. package/dist/hardware/probe-linux.js +133 -0
  422. package/dist/hardware/probe-linux.js.map +1 -0
  423. package/dist/hardware/probe-windows.d.ts +7 -0
  424. package/dist/hardware/probe-windows.js +50 -0
  425. package/dist/hardware/probe-windows.js.map +1 -0
  426. package/dist/hardware/probe.d.ts +16 -0
  427. package/dist/hardware/probe.js +65 -0
  428. package/dist/hardware/probe.js.map +1 -0
  429. package/dist/hardware/service.d.ts +60 -0
  430. package/dist/hardware/service.js +114 -0
  431. package/dist/hardware/service.js.map +1 -0
  432. package/dist/hardware/vulkan.d.ts +47 -0
  433. package/dist/hardware/vulkan.js +148 -0
  434. package/dist/hardware/vulkan.js.map +1 -0
  435. package/dist/hardware/windows-video.d.ts +97 -0
  436. package/dist/hardware/windows-video.js +214 -0
  437. package/dist/hardware/windows-video.js.map +1 -0
  438. package/dist/host/app-daemon.d.ts +47 -0
  439. package/dist/host/app-daemon.js +146 -0
  440. package/dist/host/app-daemon.js.map +1 -0
  441. package/dist/host/index.d.ts +5 -3
  442. package/dist/host/index.js +5 -3
  443. package/dist/host/index.js.map +1 -1
  444. package/dist/host/log-file.d.ts +74 -0
  445. package/dist/host/log-file.js +214 -0
  446. package/dist/host/log-file.js.map +1 -0
  447. package/dist/host/recipes/enable-wsl.d.ts +63 -0
  448. package/dist/host/recipes/enable-wsl.js +73 -0
  449. package/dist/host/recipes/enable-wsl.js.map +1 -0
  450. package/dist/host/recipes/executor-io-windows.d.ts +69 -0
  451. package/dist/host/recipes/executor-io-windows.js +235 -0
  452. package/dist/host/recipes/executor-io-windows.js.map +1 -0
  453. package/dist/host/recipes/executor-io.d.ts +80 -0
  454. package/dist/host/recipes/executor-io.js +211 -0
  455. package/dist/host/recipes/executor-io.js.map +1 -0
  456. package/dist/host/recipes/executor.d.ts +81 -0
  457. package/dist/host/recipes/executor.js +678 -0
  458. package/dist/host/recipes/executor.js.map +1 -0
  459. package/dist/host/recipes/guest-executor.d.ts +29 -0
  460. package/dist/host/recipes/guest-executor.js +76 -0
  461. package/dist/host/recipes/guest-executor.js.map +1 -0
  462. package/dist/host/recipes/index.d.ts +16 -0
  463. package/dist/host/recipes/index.js +17 -0
  464. package/dist/host/recipes/index.js.map +1 -0
  465. package/dist/host/recipes/install-container-runtime.d.ts +389 -0
  466. package/dist/host/recipes/install-container-runtime.js +796 -0
  467. package/dist/host/recipes/install-container-runtime.js.map +1 -0
  468. package/dist/host/recipes/openpgp.d.ts +23 -0
  469. package/dist/host/recipes/openpgp.js +153 -0
  470. package/dist/host/recipes/openpgp.js.map +1 -0
  471. package/dist/host/recipes/request-file.d.ts +96 -0
  472. package/dist/host/recipes/request-file.js +103 -0
  473. package/dist/host/recipes/request-file.js.map +1 -0
  474. package/dist/lock/process-journal.d.ts +5 -2
  475. package/dist/lock/process-journal.js.map +1 -1
  476. package/dist/models/capabilities.d.ts +7 -0
  477. package/dist/models/capabilities.js +17 -1
  478. package/dist/models/capabilities.js.map +1 -1
  479. package/dist/models/compatibility/index.d.ts +10 -0
  480. package/dist/models/compatibility/index.js +11 -0
  481. package/dist/models/compatibility/index.js.map +1 -0
  482. package/dist/models/compatibility/inspect.d.ts +19 -0
  483. package/dist/models/compatibility/inspect.js +59 -0
  484. package/dist/models/compatibility/inspect.js.map +1 -0
  485. package/dist/models/compatibility/resolve.d.ts +59 -0
  486. package/dist/models/compatibility/resolve.js +219 -0
  487. package/dist/models/compatibility/resolve.js.map +1 -0
  488. package/dist/models/compatibility/rules-baseline.d.ts +2 -0
  489. package/dist/models/compatibility/rules-baseline.js +10 -0
  490. package/dist/models/compatibility/rules-baseline.js.map +1 -0
  491. package/dist/models/compatibility/rules-baseline.json +292 -0
  492. package/dist/models/compatibility/rules-service.d.ts +36 -0
  493. package/dist/models/compatibility/rules-service.js +109 -0
  494. package/dist/models/compatibility/rules-service.js.map +1 -0
  495. package/dist/models/compatibility/rules.d.ts +81 -0
  496. package/dist/models/compatibility/rules.js +164 -0
  497. package/dist/models/compatibility/rules.js.map +1 -0
  498. package/dist/models/compatibility/service.d.ts +59 -0
  499. package/dist/models/compatibility/service.js +137 -0
  500. package/dist/models/compatibility/service.js.map +1 -0
  501. package/dist/models/decision-checkpoint.d.ts +22 -0
  502. package/dist/models/decision-checkpoint.js +33 -0
  503. package/dist/models/decision-checkpoint.js.map +1 -0
  504. package/dist/models/gguf/classify.d.ts +27 -1
  505. package/dist/models/gguf/classify.js +78 -2
  506. package/dist/models/gguf/classify.js.map +1 -1
  507. package/dist/models/gguf/index.d.ts +1 -0
  508. package/dist/models/gguf/index.js +1 -0
  509. package/dist/models/gguf/index.js.map +1 -1
  510. package/dist/models/gguf/tensors.d.ts +56 -0
  511. package/dist/models/gguf/tensors.js +236 -0
  512. package/dist/models/gguf/tensors.js.map +1 -0
  513. package/dist/models/index.d.ts +2 -0
  514. package/dist/models/index.js +2 -0
  515. package/dist/models/index.js.map +1 -1
  516. package/dist/router/resolve.d.ts +7 -1
  517. package/dist/router/resolve.js +14 -1
  518. package/dist/router/resolve.js.map +1 -1
  519. package/dist/runtime/container/argv.d.ts +88 -0
  520. package/dist/runtime/container/argv.js +406 -0
  521. package/dist/runtime/container/argv.js.map +1 -0
  522. package/dist/runtime/container/docker-binary.d.ts +4 -0
  523. package/dist/runtime/container/docker-binary.js +34 -0
  524. package/dist/runtime/container/docker-binary.js.map +1 -0
  525. package/dist/runtime/container/env.d.ts +17 -0
  526. package/dist/runtime/container/env.js +52 -0
  527. package/dist/runtime/container/env.js.map +1 -0
  528. package/dist/runtime/container/exec.d.ts +27 -0
  529. package/dist/runtime/container/exec.js +79 -0
  530. package/dist/runtime/container/exec.js.map +1 -0
  531. package/dist/runtime/container/execution-journal.d.ts +55 -0
  532. package/dist/runtime/container/execution-journal.js +167 -0
  533. package/dist/runtime/container/execution-journal.js.map +1 -0
  534. package/dist/runtime/container/heartbeat.d.ts +47 -0
  535. package/dist/runtime/container/heartbeat.js +78 -0
  536. package/dist/runtime/container/heartbeat.js.map +1 -0
  537. package/dist/runtime/container/index.d.ts +30 -0
  538. package/dist/runtime/container/index.js +31 -0
  539. package/dist/runtime/container/index.js.map +1 -0
  540. package/dist/runtime/container/operations.d.ts +40 -0
  541. package/dist/runtime/container/operations.js +233 -0
  542. package/dist/runtime/container/operations.js.map +1 -0
  543. package/dist/runtime/container/pull.d.ts +48 -0
  544. package/dist/runtime/container/pull.js +280 -0
  545. package/dist/runtime/container/pull.js.map +1 -0
  546. package/dist/runtime/container/reconcile.d.ts +34 -0
  547. package/dist/runtime/container/reconcile.js +79 -0
  548. package/dist/runtime/container/reconcile.js.map +1 -0
  549. package/dist/runtime/container/types.d.ts +124 -0
  550. package/dist/runtime/container/types.js +2 -0
  551. package/dist/runtime/container/types.js.map +1 -0
  552. package/dist/runtime/container/watchdog.d.ts +114 -0
  553. package/dist/runtime/container/watchdog.js +418 -0
  554. package/dist/runtime/container/watchdog.js.map +1 -0
  555. package/dist/runtime/container/wiring.d.ts +78 -0
  556. package/dist/runtime/container/wiring.js +92 -0
  557. package/dist/runtime/container/wiring.js.map +1 -0
  558. package/dist/runtime/container/wsl-exec.d.ts +13 -0
  559. package/dist/runtime/container/wsl-exec.js +18 -0
  560. package/dist/runtime/container/wsl-exec.js.map +1 -0
  561. package/dist/runtime/environment/cached-document.d.ts +128 -0
  562. package/dist/runtime/environment/cached-document.js +218 -0
  563. package/dist/runtime/environment/cached-document.js.map +1 -0
  564. package/dist/runtime/environment/canonical-json.d.ts +78 -0
  565. package/dist/runtime/environment/canonical-json.js +86 -0
  566. package/dist/runtime/environment/canonical-json.js.map +1 -0
  567. package/dist/runtime/environment/descriptor-provider.d.ts +121 -0
  568. package/dist/runtime/environment/descriptor-provider.js +159 -0
  569. package/dist/runtime/environment/descriptor-provider.js.map +1 -0
  570. package/dist/runtime/environment/descriptor.d.ts +35 -0
  571. package/dist/runtime/environment/descriptor.js +239 -0
  572. package/dist/runtime/environment/descriptor.js.map +1 -0
  573. package/dist/runtime/environment/diagnostics.d.ts +50 -0
  574. package/dist/runtime/environment/diagnostics.js +114 -0
  575. package/dist/runtime/environment/diagnostics.js.map +1 -0
  576. package/dist/runtime/environment/document-fields.d.ts +39 -0
  577. package/dist/runtime/environment/document-fields.js +96 -0
  578. package/dist/runtime/environment/document-fields.js.map +1 -0
  579. package/dist/runtime/environment/environment-manifest-provider.d.ts +65 -0
  580. package/dist/runtime/environment/environment-manifest-provider.js +89 -0
  581. package/dist/runtime/environment/environment-manifest-provider.js.map +1 -0
  582. package/dist/runtime/environment/environment-manifest.d.ts +35 -0
  583. package/dist/runtime/environment/environment-manifest.js +131 -0
  584. package/dist/runtime/environment/environment-manifest.js.map +1 -0
  585. package/dist/runtime/environment/guest-host.d.ts +43 -0
  586. package/dist/runtime/environment/guest-host.js +88 -0
  587. package/dist/runtime/environment/guest-host.js.map +1 -0
  588. package/dist/runtime/environment/host-exec.d.ts +38 -0
  589. package/dist/runtime/environment/host-exec.js +145 -0
  590. package/dist/runtime/environment/host-exec.js.map +1 -0
  591. package/dist/runtime/environment/host-step-failure.d.ts +33 -0
  592. package/dist/runtime/environment/host-step-failure.js +34 -0
  593. package/dist/runtime/environment/host-step-failure.js.map +1 -0
  594. package/dist/runtime/environment/index.d.ts +56 -0
  595. package/dist/runtime/environment/index.js +57 -0
  596. package/dist/runtime/environment/index.js.map +1 -0
  597. package/dist/runtime/environment/installations.d.ts +25 -0
  598. package/dist/runtime/environment/installations.js +70 -0
  599. package/dist/runtime/environment/installations.js.map +1 -0
  600. package/dist/runtime/environment/inventory.d.ts +42 -0
  601. package/dist/runtime/environment/inventory.js +57 -0
  602. package/dist/runtime/environment/inventory.js.map +1 -0
  603. package/dist/runtime/environment/linux-blockers.d.ts +130 -0
  604. package/dist/runtime/environment/linux-blockers.js +251 -0
  605. package/dist/runtime/environment/linux-blockers.js.map +1 -0
  606. package/dist/runtime/environment/linux-docker-facts.d.ts +200 -0
  607. package/dist/runtime/environment/linux-docker-facts.js +342 -0
  608. package/dist/runtime/environment/linux-docker-facts.js.map +1 -0
  609. package/dist/runtime/environment/linux-docker-network.d.ts +80 -0
  610. package/dist/runtime/environment/linux-docker-network.js +195 -0
  611. package/dist/runtime/environment/linux-docker-network.js.map +1 -0
  612. package/dist/runtime/environment/linux-host.d.ts +22 -0
  613. package/dist/runtime/environment/linux-host.js +98 -0
  614. package/dist/runtime/environment/linux-host.js.map +1 -0
  615. package/dist/runtime/environment/linux-plan.d.ts +126 -0
  616. package/dist/runtime/environment/linux-plan.js +392 -0
  617. package/dist/runtime/environment/linux-plan.js.map +1 -0
  618. package/dist/runtime/environment/linux-probe.d.ts +245 -0
  619. package/dist/runtime/environment/linux-probe.js +315 -0
  620. package/dist/runtime/environment/linux-probe.js.map +1 -0
  621. package/dist/runtime/environment/linux-provisioner.d.ts +102 -0
  622. package/dist/runtime/environment/linux-provisioner.js +734 -0
  623. package/dist/runtime/environment/linux-provisioner.js.map +1 -0
  624. package/dist/runtime/environment/provisioner-descriptors.d.ts +17 -0
  625. package/dist/runtime/environment/provisioner-descriptors.js +62 -0
  626. package/dist/runtime/environment/provisioner-descriptors.js.map +1 -0
  627. package/dist/runtime/environment/recovery.d.ts +74 -0
  628. package/dist/runtime/environment/recovery.js +121 -0
  629. package/dist/runtime/environment/recovery.js.map +1 -0
  630. package/dist/runtime/environment/rootfs-download.d.ts +2 -0
  631. package/dist/runtime/environment/rootfs-download.js +47 -0
  632. package/dist/runtime/environment/rootfs-download.js.map +1 -0
  633. package/dist/runtime/environment/service.d.ts +280 -0
  634. package/dist/runtime/environment/service.js +776 -0
  635. package/dist/runtime/environment/service.js.map +1 -0
  636. package/dist/runtime/environment/state.d.ts +163 -0
  637. package/dist/runtime/environment/state.js +479 -0
  638. package/dist/runtime/environment/state.js.map +1 -0
  639. package/dist/runtime/environment/store-models.d.ts +19 -0
  640. package/dist/runtime/environment/store-models.js +30 -0
  641. package/dist/runtime/environment/store-models.js.map +1 -0
  642. package/dist/runtime/environment/store.d.ts +210 -0
  643. package/dist/runtime/environment/store.js +438 -0
  644. package/dist/runtime/environment/store.js.map +1 -0
  645. package/dist/runtime/environment/windows-environment-record.d.ts +48 -0
  646. package/dist/runtime/environment/windows-environment-record.js +89 -0
  647. package/dist/runtime/environment/windows-environment-record.js.map +1 -0
  648. package/dist/runtime/environment/windows-forwarding.d.ts +27 -0
  649. package/dist/runtime/environment/windows-forwarding.js +84 -0
  650. package/dist/runtime/environment/windows-forwarding.js.map +1 -0
  651. package/dist/runtime/environment/windows-guest-setup.d.ts +48 -0
  652. package/dist/runtime/environment/windows-guest-setup.js +157 -0
  653. package/dist/runtime/environment/windows-guest-setup.js.map +1 -0
  654. package/dist/runtime/environment/windows-host.d.ts +46 -0
  655. package/dist/runtime/environment/windows-host.js +163 -0
  656. package/dist/runtime/environment/windows-host.js.map +1 -0
  657. package/dist/runtime/environment/windows-plan.d.ts +78 -0
  658. package/dist/runtime/environment/windows-plan.js +216 -0
  659. package/dist/runtime/environment/windows-plan.js.map +1 -0
  660. package/dist/runtime/environment/windows-probe.d.ts +135 -0
  661. package/dist/runtime/environment/windows-probe.js +261 -0
  662. package/dist/runtime/environment/windows-probe.js.map +1 -0
  663. package/dist/runtime/environment/windows-provisioner.d.ts +113 -0
  664. package/dist/runtime/environment/windows-provisioner.js +782 -0
  665. package/dist/runtime/environment/windows-provisioner.js.map +1 -0
  666. package/dist/runtime/environment/wiring.d.ts +117 -0
  667. package/dist/runtime/environment/wiring.js +354 -0
  668. package/dist/runtime/environment/wiring.js.map +1 -0
  669. package/dist/runtime/foundation-models/runtime.d.ts +8 -0
  670. package/dist/runtime/foundation-models/runtime.js +5 -2
  671. package/dist/runtime/foundation-models/runtime.js.map +1 -1
  672. package/dist/runtime/llamacpp/args.d.ts +10 -1
  673. package/dist/runtime/llamacpp/args.js +43 -7
  674. package/dist/runtime/llamacpp/args.js.map +1 -1
  675. package/dist/runtime/llamacpp/fit-margin.d.ts +46 -0
  676. package/dist/runtime/llamacpp/fit-margin.js +47 -0
  677. package/dist/runtime/llamacpp/fit-margin.js.map +1 -0
  678. package/dist/runtime/llamacpp/index.d.ts +1 -0
  679. package/dist/runtime/llamacpp/index.js +1 -0
  680. package/dist/runtime/llamacpp/index.js.map +1 -1
  681. package/dist/runtime/llamacpp/load-plan.d.ts +23 -1
  682. package/dist/runtime/llamacpp/load-plan.js +82 -1
  683. package/dist/runtime/llamacpp/load-plan.js.map +1 -1
  684. package/dist/runtime/llamacpp/policy.d.ts +16 -0
  685. package/dist/runtime/llamacpp/policy.js +20 -0
  686. package/dist/runtime/llamacpp/policy.js.map +1 -1
  687. package/dist/runtime/llamacpp/probe.d.ts +21 -1
  688. package/dist/runtime/llamacpp/probe.js +32 -6
  689. package/dist/runtime/llamacpp/probe.js.map +1 -1
  690. package/dist/runtime/llamacpp/runtime.d.ts +56 -1
  691. package/dist/runtime/llamacpp/runtime.js +142 -15
  692. package/dist/runtime/llamacpp/runtime.js.map +1 -1
  693. package/dist/runtime/managed-engines/index.d.ts +8 -0
  694. package/dist/runtime/managed-engines/index.js +9 -0
  695. package/dist/runtime/managed-engines/index.js.map +1 -0
  696. package/dist/runtime/managed-engines/runtime.d.ts +140 -0
  697. package/dist/runtime/managed-engines/runtime.js +402 -0
  698. package/dist/runtime/managed-engines/runtime.js.map +1 -0
  699. package/dist/runtime/managed-engines/spec.d.ts +70 -0
  700. package/dist/runtime/managed-engines/spec.js +39 -0
  701. package/dist/runtime/managed-engines/spec.js.map +1 -0
  702. package/dist/runtime/managed-models/check.d.ts +50 -0
  703. package/dist/runtime/managed-models/check.js +157 -0
  704. package/dist/runtime/managed-models/check.js.map +1 -0
  705. package/dist/runtime/managed-models/compatibility.d.ts +256 -0
  706. package/dist/runtime/managed-models/compatibility.js +594 -0
  707. package/dist/runtime/managed-models/compatibility.js.map +1 -0
  708. package/dist/runtime/managed-models/delete.d.ts +15 -0
  709. package/dist/runtime/managed-models/delete.js +60 -0
  710. package/dist/runtime/managed-models/delete.js.map +1 -0
  711. package/dist/runtime/managed-models/guest-files.d.ts +8 -0
  712. package/dist/runtime/managed-models/guest-files.js +49 -0
  713. package/dist/runtime/managed-models/guest-files.js.map +1 -0
  714. package/dist/runtime/managed-models/index.d.ts +17 -0
  715. package/dist/runtime/managed-models/index.js +18 -0
  716. package/dist/runtime/managed-models/index.js.map +1 -0
  717. package/dist/runtime/managed-models/location.d.ts +22 -0
  718. package/dist/runtime/managed-models/location.js +53 -0
  719. package/dist/runtime/managed-models/location.js.map +1 -0
  720. package/dist/runtime/managed-models/migrate.d.ts +30 -0
  721. package/dist/runtime/managed-models/migrate.js +119 -0
  722. package/dist/runtime/managed-models/migrate.js.map +1 -0
  723. package/dist/runtime/managed-models/model-dir.d.ts +36 -0
  724. package/dist/runtime/managed-models/model-dir.js +136 -0
  725. package/dist/runtime/managed-models/model-dir.js.map +1 -0
  726. package/dist/runtime/managed-models/quant-format.d.ts +71 -0
  727. package/dist/runtime/managed-models/quant-format.js +299 -0
  728. package/dist/runtime/managed-models/quant-format.js.map +1 -0
  729. package/dist/runtime/managed-models/registry.d.ts +26 -0
  730. package/dist/runtime/managed-models/registry.js +66 -0
  731. package/dist/runtime/managed-models/registry.js.map +1 -0
  732. package/dist/runtime/managed-text/adapter.d.ts +266 -0
  733. package/dist/runtime/managed-text/adapter.js +96 -0
  734. package/dist/runtime/managed-text/adapter.js.map +1 -0
  735. package/dist/runtime/managed-text/backend-target.d.ts +3 -0
  736. package/dist/runtime/managed-text/backend-target.js +52 -0
  737. package/dist/runtime/managed-text/backend-target.js.map +1 -0
  738. package/dist/runtime/managed-text/deployment.d.ts +14 -0
  739. package/dist/runtime/managed-text/deployment.js +32 -0
  740. package/dist/runtime/managed-text/deployment.js.map +1 -0
  741. package/dist/runtime/managed-text/engine-cache.d.ts +15 -0
  742. package/dist/runtime/managed-text/engine-cache.js +64 -0
  743. package/dist/runtime/managed-text/engine-cache.js.map +1 -0
  744. package/dist/runtime/managed-text/gateway.d.ts +158 -0
  745. package/dist/runtime/managed-text/gateway.js +535 -0
  746. package/dist/runtime/managed-text/gateway.js.map +1 -0
  747. package/dist/runtime/managed-text/generation-defaults.d.ts +23 -0
  748. package/dist/runtime/managed-text/generation-defaults.js +51 -0
  749. package/dist/runtime/managed-text/generation-defaults.js.map +1 -0
  750. package/dist/runtime/managed-text/index.d.ts +26 -0
  751. package/dist/runtime/managed-text/index.js +27 -0
  752. package/dist/runtime/managed-text/index.js.map +1 -0
  753. package/dist/runtime/managed-text/lifecycle.d.ts +276 -0
  754. package/dist/runtime/managed-text/lifecycle.js +859 -0
  755. package/dist/runtime/managed-text/lifecycle.js.map +1 -0
  756. package/dist/runtime/managed-text/load-policy.d.ts +47 -0
  757. package/dist/runtime/managed-text/load-policy.js +111 -0
  758. package/dist/runtime/managed-text/load-policy.js.map +1 -0
  759. package/dist/runtime/managed-text/mount-source.d.ts +14 -0
  760. package/dist/runtime/managed-text/mount-source.js +18 -0
  761. package/dist/runtime/managed-text/mount-source.js.map +1 -0
  762. package/dist/runtime/managed-text/readiness.d.ts +13 -0
  763. package/dist/runtime/managed-text/readiness.js +24 -0
  764. package/dist/runtime/managed-text/readiness.js.map +1 -0
  765. package/dist/runtime/managed-text/request-rules.d.ts +18 -0
  766. package/dist/runtime/managed-text/request-rules.js +62 -0
  767. package/dist/runtime/managed-text/request-rules.js.map +1 -0
  768. package/dist/runtime/managed-text/types.d.ts +88 -0
  769. package/dist/runtime/managed-text/types.js +12 -0
  770. package/dist/runtime/managed-text/types.js.map +1 -0
  771. package/dist/runtime/managed-text/wsl-deployment.d.ts +24 -0
  772. package/dist/runtime/managed-text/wsl-deployment.js +70 -0
  773. package/dist/runtime/managed-text/wsl-deployment.js.map +1 -0
  774. package/dist/runtime/mlx/errors.d.ts +6 -1
  775. package/dist/runtime/mlx/errors.js +7 -2
  776. package/dist/runtime/mlx/errors.js.map +1 -1
  777. package/dist/runtime/mlx/runtime.d.ts +36 -1
  778. package/dist/runtime/mlx/runtime.js +85 -4
  779. package/dist/runtime/mlx/runtime.js.map +1 -1
  780. package/dist/runtime/shared/backend-output.d.ts +23 -0
  781. package/dist/runtime/shared/backend-output.js +32 -0
  782. package/dist/runtime/shared/backend-output.js.map +1 -0
  783. package/dist/runtime/shared/bounded-output.d.ts +24 -0
  784. package/dist/runtime/shared/bounded-output.js +63 -0
  785. package/dist/runtime/shared/bounded-output.js.map +1 -0
  786. package/dist/runtime/shared/external-sessions.js +9 -1
  787. package/dist/runtime/shared/external-sessions.js.map +1 -1
  788. package/dist/runtime/shared/gpu-occupancy.d.ts +60 -0
  789. package/dist/runtime/shared/gpu-occupancy.js +10 -0
  790. package/dist/runtime/shared/gpu-occupancy.js.map +1 -0
  791. package/dist/runtime/shared/index.d.ts +4 -0
  792. package/dist/runtime/shared/index.js +4 -0
  793. package/dist/runtime/shared/index.js.map +1 -1
  794. package/dist/runtime/shared/local-runtime.d.ts +35 -0
  795. package/dist/runtime/shared/ports.d.ts +6 -0
  796. package/dist/runtime/shared/ports.js +12 -1
  797. package/dist/runtime/shared/ports.js.map +1 -1
  798. package/dist/runtime/shared/process.d.ts +11 -0
  799. package/dist/runtime/shared/process.js +20 -0
  800. package/dist/runtime/shared/process.js.map +1 -1
  801. package/dist/runtime/shared/redact-args.d.ts +7 -0
  802. package/dist/runtime/shared/redact-args.js +26 -0
  803. package/dist/runtime/shared/redact-args.js.map +1 -0
  804. package/dist/runtime/shared/sidecar.d.ts +15 -0
  805. package/dist/runtime/shared/sidecar.js +43 -8
  806. package/dist/runtime/shared/sidecar.js.map +1 -1
  807. package/dist/runtime/tensorrt-llm/adapter.d.ts +250 -0
  808. package/dist/runtime/tensorrt-llm/adapter.js +1011 -0
  809. package/dist/runtime/tensorrt-llm/adapter.js.map +1 -0
  810. package/dist/runtime/tensorrt-llm/check.d.ts +12 -0
  811. package/dist/runtime/tensorrt-llm/check.js +21 -0
  812. package/dist/runtime/tensorrt-llm/check.js.map +1 -0
  813. package/dist/runtime/tensorrt-llm/compatibility.d.ts +100 -0
  814. package/dist/runtime/tensorrt-llm/compatibility.js +181 -0
  815. package/dist/runtime/tensorrt-llm/compatibility.js.map +1 -0
  816. package/dist/runtime/tensorrt-llm/engine.d.ts +3 -0
  817. package/dist/runtime/tensorrt-llm/engine.js +24 -0
  818. package/dist/runtime/tensorrt-llm/engine.js.map +1 -0
  819. package/dist/runtime/tensorrt-llm/host-facts.d.ts +55 -0
  820. package/dist/runtime/tensorrt-llm/host-facts.js +87 -0
  821. package/dist/runtime/tensorrt-llm/host-facts.js.map +1 -0
  822. package/dist/runtime/tensorrt-llm/index.d.ts +30 -0
  823. package/dist/runtime/tensorrt-llm/index.js +31 -0
  824. package/dist/runtime/tensorrt-llm/index.js.map +1 -0
  825. package/dist/runtime/tensorrt-llm/installation.d.ts +23 -0
  826. package/dist/runtime/tensorrt-llm/installation.js +53 -0
  827. package/dist/runtime/tensorrt-llm/installation.js.map +1 -0
  828. package/dist/runtime/tensorrt-llm/kv-cache.d.ts +25 -0
  829. package/dist/runtime/tensorrt-llm/kv-cache.js +28 -0
  830. package/dist/runtime/tensorrt-llm/kv-cache.js.map +1 -0
  831. package/dist/runtime/tensorrt-llm/prelaunch.d.ts +20 -0
  832. package/dist/runtime/tensorrt-llm/prelaunch.js +168 -0
  833. package/dist/runtime/tensorrt-llm/prelaunch.js.map +1 -0
  834. package/dist/runtime/tensorrt-llm/route-policy.d.ts +19 -0
  835. package/dist/runtime/tensorrt-llm/route-policy.js +17 -0
  836. package/dist/runtime/tensorrt-llm/route-policy.js.map +1 -0
  837. package/dist/runtime/tensorrt-llm/settings.d.ts +7 -0
  838. package/dist/runtime/tensorrt-llm/settings.js +48 -0
  839. package/dist/runtime/tensorrt-llm/settings.js.map +1 -0
  840. package/dist/runtime/vllm/adapter.d.ts +46 -0
  841. package/dist/runtime/vllm/adapter.js +425 -0
  842. package/dist/runtime/vllm/adapter.js.map +1 -0
  843. package/dist/runtime/vllm/engine.d.ts +16 -0
  844. package/dist/runtime/vllm/engine.js +37 -0
  845. package/dist/runtime/vllm/engine.js.map +1 -0
  846. package/dist/runtime/vllm/index.d.ts +11 -0
  847. package/dist/runtime/vllm/index.js +12 -0
  848. package/dist/runtime/vllm/index.js.map +1 -0
  849. package/dist/runtime/vllm/memory.d.ts +69 -0
  850. package/dist/runtime/vllm/memory.js +123 -0
  851. package/dist/runtime/vllm/memory.js.map +1 -0
  852. package/dist/runtime/vllm/settings.d.ts +52 -0
  853. package/dist/runtime/vllm/settings.js +151 -0
  854. package/dist/runtime/vllm/settings.js.map +1 -0
  855. package/dist/runtime/wsl/guest-paths.d.ts +33 -0
  856. package/dist/runtime/wsl/guest-paths.js +83 -0
  857. package/dist/runtime/wsl/guest-paths.js.map +1 -0
  858. package/dist/runtime/wsl/guest-scope.d.ts +14 -0
  859. package/dist/runtime/wsl/guest-scope.js +98 -0
  860. package/dist/runtime/wsl/guest-scope.js.map +1 -0
  861. package/dist/runtime/wsl/index.d.ts +12 -0
  862. package/dist/runtime/wsl/index.js +13 -0
  863. package/dist/runtime/wsl/index.js.map +1 -0
  864. package/dist/runtime/wsl/keeper.d.ts +29 -0
  865. package/dist/runtime/wsl/keeper.js +48 -0
  866. package/dist/runtime/wsl/keeper.js.map +1 -0
  867. package/dist/runtime/wsl/transport.d.ts +106 -0
  868. package/dist/runtime/wsl/transport.js +181 -0
  869. package/dist/runtime/wsl/transport.js.map +1 -0
  870. package/dist/server/control/index.d.ts +1 -1
  871. package/dist/server/control/router.js +15 -0
  872. package/dist/server/control/router.js.map +1 -1
  873. package/dist/server/control/routes/backends.js +26 -0
  874. package/dist/server/control/routes/backends.js.map +1 -1
  875. package/dist/server/control/routes/decision.d.ts +10 -0
  876. package/dist/server/control/routes/decision.js +43 -0
  877. package/dist/server/control/routes/decision.js.map +1 -0
  878. package/dist/server/control/routes/diffusion-video.js +4 -0
  879. package/dist/server/control/routes/diffusion-video.js.map +1 -1
  880. package/dist/server/control/routes/diffusion.d.ts +1 -1
  881. package/dist/server/control/routes/diffusion.js +4 -9
  882. package/dist/server/control/routes/diffusion.js.map +1 -1
  883. package/dist/server/control/routes/embedding.d.ts +9 -0
  884. package/dist/server/control/routes/embedding.js +43 -0
  885. package/dist/server/control/routes/embedding.js.map +1 -0
  886. package/dist/server/control/routes/engine-builds.d.ts +14 -0
  887. package/dist/server/control/routes/engine-builds.js +82 -0
  888. package/dist/server/control/routes/engine-builds.js.map +1 -0
  889. package/dist/server/control/routes/engines.d.ts +17 -0
  890. package/dist/server/control/routes/engines.js +152 -0
  891. package/dist/server/control/routes/engines.js.map +1 -0
  892. package/dist/server/control/routes/environments.d.ts +16 -0
  893. package/dist/server/control/routes/environments.js +207 -0
  894. package/dist/server/control/routes/environments.js.map +1 -0
  895. package/dist/server/control/routes/hardware.d.ts +1 -1
  896. package/dist/server/control/routes/hardware.js +11 -6
  897. package/dist/server/control/routes/hardware.js.map +1 -1
  898. package/dist/server/control/routes/model-setups.d.ts +11 -0
  899. package/dist/server/control/routes/model-setups.js +55 -0
  900. package/dist/server/control/routes/model-setups.js.map +1 -0
  901. package/dist/server/control/routes/models.d.ts +3 -2
  902. package/dist/server/control/routes/models.js +45 -2
  903. package/dist/server/control/routes/models.js.map +1 -1
  904. package/dist/server/control/types.d.ts +167 -9
  905. package/dist/server/control/types.js.map +1 -1
  906. package/dist/server/http.d.ts +9 -1
  907. package/dist/server/http.js +51 -1
  908. package/dist/server/http.js.map +1 -1
  909. package/dist/server/public/decision-preview.d.ts +17 -0
  910. package/dist/server/public/decision-preview.js +119 -0
  911. package/dist/server/public/decision-preview.js.map +1 -0
  912. package/dist/server/public/decision.d.ts +32 -0
  913. package/dist/server/public/decision.js +135 -0
  914. package/dist/server/public/decision.js.map +1 -0
  915. package/dist/server/public/embedding.d.ts +31 -0
  916. package/dist/server/public/embedding.js +126 -0
  917. package/dist/server/public/embedding.js.map +1 -0
  918. package/dist/server/public/errors.d.ts +2 -1
  919. package/dist/server/public/errors.js +5 -2
  920. package/dist/server/public/errors.js.map +1 -1
  921. package/dist/server/public/forward.js +75 -3
  922. package/dist/server/public/forward.js.map +1 -1
  923. package/dist/server/public/gates.d.ts +13 -0
  924. package/dist/server/public/gates.js +37 -14
  925. package/dist/server/public/gates.js.map +1 -1
  926. package/dist/server/public/index.d.ts +5 -2
  927. package/dist/server/public/index.js +14 -1
  928. package/dist/server/public/index.js.map +1 -1
  929. package/dist/server/public/listing.d.ts +13 -2
  930. package/dist/server/public/listing.js +33 -9
  931. package/dist/server/public/listing.js.map +1 -1
  932. package/dist/server/public/policy.d.ts +9 -0
  933. package/dist/server/public/policy.js +68 -0
  934. package/dist/server/public/policy.js.map +1 -0
  935. package/dist/server/public/responses.js +10 -0
  936. package/dist/server/public/responses.js.map +1 -1
  937. package/dist/server/public/trace.d.ts +2 -2
  938. package/dist/server/public/trace.js +6 -2
  939. package/dist/server/public/trace.js.map +1 -1
  940. package/dist/server/public/types.d.ts +84 -1
  941. package/dist/settings/decision.d.ts +15 -0
  942. package/dist/settings/decision.js +88 -0
  943. package/dist/settings/decision.js.map +1 -0
  944. package/dist/settings/embedding.d.ts +12 -0
  945. package/dist/settings/embedding.js +82 -0
  946. package/dist/settings/embedding.js.map +1 -0
  947. package/dist/settings/index.d.ts +2 -0
  948. package/dist/settings/index.js +2 -0
  949. package/dist/settings/index.js.map +1 -1
  950. package/dist/settings/schema/atomic-prism.json +433 -0
  951. package/dist/settings/schema/tensorrt-llm.json +253 -0
  952. package/dist/settings/schema/vllm.json +273 -0
  953. package/dist/settings/schema.js +58 -0
  954. package/dist/settings/schema.js.map +1 -1
  955. package/dist/settings/store.d.ts +13 -2
  956. package/dist/settings/store.js +44 -0
  957. package/dist/settings/store.js.map +1 -1
  958. package/dist/util/index.d.ts +1 -0
  959. package/dist/util/index.js +1 -0
  960. package/dist/util/index.js.map +1 -1
  961. package/dist/util/result.d.ts +19 -0
  962. package/dist/util/result.js +15 -0
  963. package/dist/util/result.js.map +1 -0
  964. package/dist/version.d.ts +1 -1
  965. package/dist/version.js +1 -1
  966. package/dist/version.js.map +1 -1
  967. package/package.json +1 -1
  968. package/src/settings/schema/atomic-prism.json +433 -0
  969. package/src/settings/schema/tensorrt-llm.json +253 -0
  970. package/src/settings/schema/vllm.json +273 -0
@@ -0,0 +1,776 @@
1
+ /**
2
+ * The part that actually runs a setup: it holds the record, decides nothing itself, and turns each
3
+ * decision the reducer makes into one piece of external work.
4
+ *
5
+ * The split matters because the two halves fail differently. The reducer is a table and is proved
6
+ * by reading it. Everything the machine does — probing a host, pulling sixteen gigabytes, asking
7
+ * for a password, importing a distribution — fails in ways nobody enumerates in advance, so it all
8
+ * arrives here through injected seams that a test can make fail at any point.
9
+ *
10
+ * Two things are deliberate. Work is committed with the revision it was computed from, so a result
11
+ * from an attempt that has been superseded is dropped instead of applied. And the privileged step
12
+ * is not work this service performs: it hands the step out, and waits for the app to come back with
13
+ * a receipt, which is then verified against the machine rather than believed.
14
+ */
15
+ import { AtomicCoreError } from '../../contracts/index.js';
16
+ import { identityPermitsTakeover, verifyProcessIdentity } from '../../lock/index.js';
17
+ import { beginFingerprint } from './canonical-json.js';
18
+ import { summarizeRuntimeDescriptor } from './descriptor.js';
19
+ import { recoverOperation } from './recovery.js';
20
+ import { reduceOperation } from './state.js';
21
+ import { classifyReceipt, withReceipt } from './store.js';
22
+ import { poolsExhaustedIn } from './host-step-failure.js';
23
+ const unsupported = (input) => ({
24
+ plan_digest: 'sha256:0000000000000000000000000000000000000000000000000000000000000000',
25
+ environment_id: input.environment_id,
26
+ target: input.target,
27
+ availability: 'unsupported',
28
+ recipe_id: 'none',
29
+ recipe_digest: 'sha256:0000000000000000000000000000000000000000000000000000000000000000',
30
+ descriptor_id: null,
31
+ environment_manifest_id: null,
32
+ image_digest: null,
33
+ adopts_existing_engine: false,
34
+ system_changes: [],
35
+ download_bytes: null,
36
+ required_disk_bytes: null,
37
+ docker_root_dir: null,
38
+ free_disk_bytes: null,
39
+ requires_elevation: false,
40
+ may_require_relogin: false,
41
+ may_require_reboot: false,
42
+ blockers: [
43
+ {
44
+ code: 'MANAGED_PREREQUISITE_BLOCKED',
45
+ message: 'Managed runtimes are not available on this system yet.',
46
+ },
47
+ ],
48
+ warnings: [],
49
+ });
50
+ const notFound = (operationId) => new AtomicCoreError('MANAGED_OPERATION_NOT_FOUND', 'No such operation.', operationId);
51
+ const TERMINAL = ['ready', 'removed', 'cancelled', 'failed'];
52
+ /** Phases in which an operation waits on the user, with no core working on it. */
53
+ const WAITING = ['awaiting-consent', 'relogin-required', 'reboot-required'];
54
+ /** How often byte progress of a pull is announced, at most. The first tick always goes out. */
55
+ export const PROGRESS_EMIT_INTERVAL_MS = 250;
56
+ /** How many times a receipt is re-read and re-applied after losing a compare-and-swap. */
57
+ const RECEIPT_ATTEMPTS = 3;
58
+ const receiptConflict = (why, details) => new AtomicCoreError('MANAGED_RECEIPT_CONFLICT', why, details);
59
+ /** Resolves once `signal` fires; never, if there is no signal to wait on. */
60
+ const whenAborted = (signal) => new Promise((resolve) => {
61
+ if (signal === undefined)
62
+ return;
63
+ if (signal.aborted) {
64
+ resolve();
65
+ return;
66
+ }
67
+ signal.addEventListener('abort', () => resolve(), { once: true });
68
+ });
69
+ export class EnvironmentService {
70
+ options;
71
+ aborts = new Map();
72
+ /**
73
+ * Byte progress of a pull in flight, by operation. Kept in memory and announced on
74
+ * `environment:operation` without a new revision: the pull effect was issued at the current
75
+ * revision and has to answer at it, so a revision per tick would make its own result stale.
76
+ */
77
+ progress = new Map();
78
+ /** The last state of each operation this service announced: what a progress tick is checked against. */
79
+ latest = new Map();
80
+ running = new Set();
81
+ stopped = false;
82
+ constructor(options) {
83
+ this.options = options;
84
+ }
85
+ async list() {
86
+ return this.options.readSnapshot();
87
+ }
88
+ /** What setting this up would involve, without touching the machine. */
89
+ async probe(input) {
90
+ const environmentId = input.environment_id ?? this.options.environmentId;
91
+ if (this.options.provisioner === null) {
92
+ return unsupported({ environment_id: environmentId, target: input.target });
93
+ }
94
+ const record = this.speculative(environmentId, input);
95
+ const controller = new AbortController();
96
+ const { plan } = await this.options.provisioner.probe(record, controller.signal);
97
+ return plan;
98
+ }
99
+ /**
100
+ * One cached runtime descriptor, as a client shows it (task 2.22): read from the cache by id, never
101
+ * fetched, so asking cannot change which descriptor an installation or a plan names.
102
+ * `MANAGED_ADAPTER_UNAVAILABLE` where no host recipe applies (off Linux), like a probe answering
103
+ * `unsupported` there; `MANAGED_METADATA_INVALID` for an id this core has not cached.
104
+ */
105
+ async descriptor(descriptorId) {
106
+ if (this.options.provisioner === null || this.options.descriptors === undefined) {
107
+ throw new AtomicCoreError('MANAGED_ADAPTER_UNAVAILABLE', 'Managed runtimes are not available on this system.');
108
+ }
109
+ const cached = await this.options.descriptors.forInstallation(descriptorId);
110
+ if (cached.kind !== 'available') {
111
+ throw new AtomicCoreError('MANAGED_METADATA_INVALID', 'This core has no cached runtime descriptor with that id.', descriptorId);
112
+ }
113
+ return summarizeRuntimeDescriptor(cached.descriptor);
114
+ }
115
+ /**
116
+ * Put the environment's bookkeeping back to "nothing was ever attempted" without uninstalling
117
+ * anything: every finished operation is archived, so no failed setup is shown or resumed any more
118
+ * and the next setup starts from a fresh probe — with whatever descriptor conf serves now, not the
119
+ * one an old consent pinned. Refused with `MANAGED_OPERATION_CONFLICT` while an operation is still
120
+ * running. The distribution, the images, the models, the installation records and the cached conf
121
+ * documents stay exactly as they are; removing those is `remove`'s job.
122
+ */
123
+ async reset(environmentId) {
124
+ if (environmentId !== this.options.environmentId) {
125
+ throw new AtomicCoreError('MANAGED_OPERATION_NOT_FOUND', 'No such environment.', environmentId);
126
+ }
127
+ const stamp = this.options.resetStamp?.() ?? new Date().toISOString().replace(/[:.]/g, '-');
128
+ const archived = await this.options.store.archiveFinished(stamp);
129
+ for (const id of archived.ids)
130
+ this.latest.delete(id);
131
+ this.options.onReset?.(archived.ids);
132
+ return {
133
+ environment_id: environmentId,
134
+ archived_operation_ids: archived.ids,
135
+ archive_path: archived.path,
136
+ };
137
+ }
138
+ /** A read-only report on the environment for a support message (`EnvironmentDiagnostics`). */
139
+ async diagnostics(environmentId) {
140
+ if (environmentId !== this.options.environmentId) {
141
+ throw new AtomicCoreError('MANAGED_OPERATION_NOT_FOUND', 'No such environment.', environmentId);
142
+ }
143
+ if (this.options.diagnostics === undefined) {
144
+ throw new AtomicCoreError('MANAGED_ADAPTER_UNAVAILABLE', 'Managed runtimes are not available on this system.');
145
+ }
146
+ return this.options.diagnostics();
147
+ }
148
+ /**
149
+ * Start, or hand back the operation this request already started.
150
+ *
151
+ * Recovery only runs when a core starts, so an operation whose core died while another core kept
152
+ * running would refuse every later `begin` on its environment until that other core restarted.
153
+ * When the operation in the way belongs to a process that can be shown to be gone, it is ended
154
+ * here instead (task 2.6), and the new request goes ahead.
155
+ */
156
+ async begin(environmentId, input) {
157
+ return (await this.beginWith(environmentId, input)).record.machine.operation;
158
+ }
159
+ async beginWith(environmentId, input, chain = {}) {
160
+ const fingerprint = beginFingerprint(input);
161
+ let result;
162
+ try {
163
+ result = await this.options.store.createOrGet(environmentId, input, fingerprint, chain);
164
+ }
165
+ catch (error) {
166
+ if (!(await this.endAbandonedBlocker(error)))
167
+ throw error;
168
+ result = await this.options.store.createOrGet(environmentId, input, fingerprint, chain);
169
+ }
170
+ if (result.created) {
171
+ // Announced from its first state, so the snapshot and the event stream both show it at once.
172
+ this.announce(result.record.machine.operation);
173
+ this.dispatch(result.record);
174
+ }
175
+ return result;
176
+ }
177
+ /**
178
+ * The plan a removal of `target` would show, computed as the removal's own probe computes it: what
179
+ * a caller consenting on the user's behalf approves (a reinstall, `DELETE /engines/…`). Changes
180
+ * nothing.
181
+ */
182
+ async planRemoval(environmentId, target, retainModels) {
183
+ if (this.options.provisioner === null)
184
+ return unsupported({ environment_id: environmentId, target });
185
+ const record = this.speculative(environmentId, { target }, { kind: 'remove', retain_models: retainModels });
186
+ const controller = new AbortController();
187
+ return (await this.options.provisioner.probe(record, controller.signal)).plan;
188
+ }
189
+ /**
190
+ * Reinstall an engine from a newer release (change `unify-engine-lifecycle`, design D6): a removal
191
+ * that keeps the models, approved here — the client's call to update is the consent to remove — and
192
+ * on disk the setup that follows it. The setup is begun by this core once the removal ends
193
+ * `removed` (or by the next core, if this one stops first), and it asks for consent like any
194
+ * setup: the new image is tens of gigabytes. A retried request answers the same removal.
195
+ */
196
+ async beginReinstall(environmentId, input) {
197
+ const plan = await this.planRemoval(environmentId, input.target, true);
198
+ const { record, created } = await this.beginWith(environmentId, {
199
+ request_id: input.request_id,
200
+ target: input.target,
201
+ kind: 'remove',
202
+ retain_models: true,
203
+ approved_plan_digest: plan.plan_digest,
204
+ }, {
205
+ follow_up: {
206
+ kind: 'setup',
207
+ descriptor_id: input.descriptor_id,
208
+ request_id: `${input.request_id}:setup`,
209
+ },
210
+ });
211
+ if (created)
212
+ this.options.onReinstall?.(input.target.engine_id, 'started');
213
+ return record.machine.operation;
214
+ }
215
+ /** The setup a `removed` reinstall names; idempotent by its request id, across cores and restarts. */
216
+ async beginFollowUp(record) {
217
+ const follow = record.follow_up;
218
+ if (follow === undefined || this.stopped)
219
+ return;
220
+ await this.beginWith(record.machine.operation.environment_id, {
221
+ request_id: follow.request_id,
222
+ target: record.request.target,
223
+ kind: 'setup',
224
+ descriptor_id: follow.descriptor_id,
225
+ }, { reinstall_of: record.machine.operation.operation_id });
226
+ }
227
+ /** A finished operation that is part of a reinstall moves the chain on, or ends it. */
228
+ async afterFinished(operation) {
229
+ const record = await this.options.store.read(operation.operation_id).catch(() => null);
230
+ if (record === null)
231
+ return;
232
+ const engine = operation.target.kind === 'runtime' ? operation.target.engine_id : null;
233
+ if (record.follow_up !== undefined) {
234
+ if (operation.phase === 'removed')
235
+ await this.beginFollowUp(record);
236
+ else if (engine !== null)
237
+ this.options.onReinstall?.(engine, 'finished');
238
+ }
239
+ if (record.reinstall_of !== undefined && engine !== null)
240
+ this.options.onReinstall?.(engine, 'finished');
241
+ if (record.follow_up !== undefined || record.reinstall_of !== undefined || engine === null)
242
+ return;
243
+ if (operation.kind === 'setup' && operation.phase === 'ready')
244
+ this.options.onInstallationChanged?.(engine, 'install');
245
+ if (operation.kind === 'remove' && operation.phase === 'removed')
246
+ this.options.onInstallationChanged?.(engine, 'uninstall');
247
+ }
248
+ async get(operationId) {
249
+ const record = await this.options.store.read(operationId);
250
+ if (record === null)
251
+ throw notFound(operationId);
252
+ return this.withProgress(record.machine.operation);
253
+ }
254
+ async cancel(operationId) {
255
+ const { record: next, owned } = await this.apply(operationId, { type: 'cancel' });
256
+ // Stop the work in flight; whether that ends the operation now or at a safe boundary is the
257
+ // reducer's call, and it has already been made.
258
+ this.aborts.get(operationId)?.abort();
259
+ // Cancelling usually issues cleanup of its own, and nobody else will run it — but only when
260
+ // this call is the one that actually committed the transition: dispatching the fresh state a
261
+ // lost race handed back would run whatever the *winner* already dispatched a second time.
262
+ if (owned)
263
+ this.dispatch(next);
264
+ return next.machine.operation;
265
+ }
266
+ /** Approve a plan, or continue after a sign-out, a reboot, a failure or a cancellation. */
267
+ async resume(operationId, input) {
268
+ const current = await this.options.store.read(operationId);
269
+ if (current === null)
270
+ throw notFound(operationId);
271
+ const event = current.machine.operation.phase === 'awaiting-consent'
272
+ ? { type: 'approve', input }
273
+ : { type: 'resume', input };
274
+ const { record: next, owned } = await this.apply(operationId, event);
275
+ // Approving or resuming always starts by looking at the machine again; run that look — unless
276
+ // this call lost the race to commit it, in which case whoever won already will.
277
+ if (owned)
278
+ this.dispatch(next);
279
+ return next.machine.operation;
280
+ }
281
+ /**
282
+ * Take the app's word for what the OS prompt did, then check it. A receipt is an assertion: the
283
+ * machine is re-probed before the step counts as done, and a helper that claims success it cannot
284
+ * show is refused by the reducer.
285
+ *
286
+ * A receipt is bound to the pending step by all of its identity: step id, single-use nonce, the
287
+ * revision the step was issued at, and the recipe and parameter digests. A nonce already used —
288
+ * the identical receipt again included — a nonce this operation is not waiting for, or another
289
+ * revision is `MANAGED_RECEIPT_CONFLICT` (spec "Повтор квитанции"); a client that lost the answer
290
+ * reads the operation instead. Recording the nonce and applying the transition are one
291
+ * compare-and-swap, so a receipt that races itself is applied once: the loser re-reads, finds its
292
+ * nonce spent, and is refused.
293
+ */
294
+ async acceptHostReceipt(operationId, receipt) {
295
+ for (let attempt = 0; attempt < RECEIPT_ATTEMPTS; attempt += 1) {
296
+ const current = await this.options.store.read(operationId);
297
+ if (current === null)
298
+ throw notFound(operationId);
299
+ if (classifyReceipt(current, receipt) === 'duplicate') {
300
+ // The same authorization arriving twice authorizes nothing a second time.
301
+ throw receiptConflict('This authorization was already used; nothing was applied again.', receipt.nonce);
302
+ }
303
+ const pending = current.machine.operation.pending_host_step;
304
+ if (pending === null || pending.nonce !== receipt.nonce || pending.step_id !== receipt.step_id) {
305
+ throw receiptConflict('That result does not match the authorization this operation is waiting for.', receipt.step_id);
306
+ }
307
+ if (pending.expected_operation_revision !== receipt.expected_operation_revision) {
308
+ throw receiptConflict('That result is for another revision of this operation.', `step issued at ${pending.expected_operation_revision}, receipt names ${receipt.expected_operation_revision}`);
309
+ }
310
+ if (pending.recipe_digest !== receipt.recipe_digest ||
311
+ pending.parameters_digest !== receipt.parameters_digest) {
312
+ throw new AtomicCoreError('MANAGED_HOST_STEP_INVALID', 'That result is for other recipe bytes or parameters than the step that was authorized.', receipt.step_id);
313
+ }
314
+ const verdict = await this.verdictFor(current, receipt);
315
+ const result = reduceOperation(current.machine, {
316
+ type: 'host-receipt-verified',
317
+ effect_id: current.machine.pending_effect?.effect_id ?? '',
318
+ expected_revision: current.machine.operation.revision,
319
+ receipt,
320
+ prerequisites_met: verdict.prerequisites_met,
321
+ needs_relogin: verdict.needs_relogin,
322
+ ...(verdict.error === null ? {} : { probe_error: verdict.error }),
323
+ ...(verdict.address_pools_configured === undefined
324
+ ? {}
325
+ : { address_pools_configured: verdict.address_pools_configured }),
326
+ }, { next_effect_id: this.options.newEffectId() });
327
+ if (!result.ok) {
328
+ throw new AtomicCoreError(result.error.code, result.error.message, result.error.details);
329
+ }
330
+ const next = { ...withReceipt(current, receipt), machine: result.value.state };
331
+ const swapped = await this.options.store.compareAndSwap(operationId, current.machine.operation.revision, next);
332
+ if (!swapped)
333
+ continue; // someone moved it meanwhile; look again, and maybe it was us
334
+ this.announce(next.machine.operation);
335
+ this.dispatch(next);
336
+ return next.machine.operation;
337
+ }
338
+ throw new AtomicCoreError('MANAGED_OPERATION_CONFLICT', 'The operation kept changing while this result was being recorded; send it again.', operationId);
339
+ }
340
+ /**
341
+ * Pick up whatever the previous core left behind, against what this machine actually shows.
342
+ *
343
+ * A non-terminal operation is not automatically abandoned: app and CLI cores share this store,
344
+ * so the core that wrote it may simply still be running it right now. Only when the recorded
345
+ * owner (`PersistedOperation.owner_pid`) can be shown to be gone does this core touch the
346
+ * record — otherwise two cores would drive the same operation at once, each believing the other
347
+ * is not there.
348
+ */
349
+ async recover(instanceId) {
350
+ const pending = await this.options.store.listRecoverable();
351
+ for (const record of pending) {
352
+ // One record's recovery failing outright (a store error, a reducer refusal this loop did
353
+ // not anticipate) must not stop the rest of the list from being looked at — the next core
354
+ // start, or a client's own `resume`, gets another chance at whichever record it was.
355
+ try {
356
+ if (await this.ownerAlive(record))
357
+ continue;
358
+ if (this.options.provisioner === null) {
359
+ // No recipe exists to reconcile against, so this operation can never move on its own —
360
+ // and with nothing to skip it for (its owner is gone), leaving it non-terminal would
361
+ // block every later `begin` on this environment with MANAGED_OPERATION_CONFLICT forever.
362
+ await this.failAbandoned(record);
363
+ continue;
364
+ }
365
+ const outcome = await recoverOperation(record, {
366
+ instanceId,
367
+ newEffectId: this.options.newEffectId,
368
+ inventory: this.options.provisioner.inventory,
369
+ });
370
+ if (outcome.kind === 'unchanged')
371
+ continue;
372
+ const swapped = await this.options.store.compareAndSwap(record.machine.operation.operation_id, record.machine.operation.revision, outcome.record);
373
+ if (!swapped)
374
+ continue;
375
+ this.announce(outcome.record.machine.operation);
376
+ if (outcome.kind === 'reconciled')
377
+ this.dispatch(outcome.record);
378
+ }
379
+ catch {
380
+ continue;
381
+ }
382
+ }
383
+ // A reinstall whose removal ended `removed` while no core was there to begin its setup. Begun by
384
+ // its derived request id, so one that exists already (this core's, or the other scope's) is
385
+ // answered instead of started again.
386
+ for (const record of await this.options.store.listAll().catch(() => [])) {
387
+ if (record.follow_up === undefined || record.machine.operation.phase !== 'removed')
388
+ continue;
389
+ await this.beginFollowUp(record).catch(() => undefined);
390
+ }
391
+ }
392
+ /** Stop what is in flight. The intent stays on disk, so the next core resumes from it. */
393
+ async shutdown(signal) {
394
+ this.stopped = true;
395
+ for (const controller of this.aborts.values())
396
+ controller.abort();
397
+ await this.idle(signal);
398
+ }
399
+ /**
400
+ * Resolves when nothing is running, or when `signal` fires — whichever comes first. Used by
401
+ * shutdown, and by tests that drive a whole flow to completion.
402
+ *
403
+ * Racing the signal against the wait itself, not just checking it between iterations, is what
404
+ * actually enforces a caller's deadline: a single effect that ignores its own abort (a
405
+ * provisioner step that does not return promptly, or a test double that never resolves) would
406
+ * otherwise leave nothing to check between — `Promise.allSettled` on one such promise simply
407
+ * never settles, and the loop never reaches its next look at `signal.aborted`.
408
+ */
409
+ async idle(signal) {
410
+ while (this.running.size > 0) {
411
+ if (signal?.aborted === true)
412
+ return;
413
+ await Promise.race([Promise.allSettled([...this.running]), whenAborted(signal)]);
414
+ }
415
+ }
416
+ /** A record shaped like the one a real operation would have, for a probe that starts nothing. */
417
+ speculative(environmentId, input, as = { kind: 'setup' }) {
418
+ const request = {
419
+ request_id: 'probe',
420
+ target: input.target,
421
+ kind: as.kind,
422
+ ...(input.descriptor_id !== undefined ? { descriptor_id: input.descriptor_id } : {}),
423
+ ...(as.retain_models !== undefined ? { retain_models: as.retain_models } : {}),
424
+ };
425
+ return {
426
+ machine: {
427
+ operation: {
428
+ schema_version: 1,
429
+ operation_id: 'probe',
430
+ request_id: 'probe',
431
+ environment_id: environmentId,
432
+ target: input.target,
433
+ kind: as.kind,
434
+ instance_id: this.options.instanceId,
435
+ revision: 0,
436
+ phase: 'checking',
437
+ plan_digest: null,
438
+ approved_plan_digest: null,
439
+ carried_plan_digest: null,
440
+ progress: null,
441
+ pending_host_step: null,
442
+ completed_step_ids: [],
443
+ cancellation_requested: false,
444
+ error: null,
445
+ },
446
+ pending_effect: null,
447
+ indivisible_host_step_running: false,
448
+ },
449
+ request_digest: beginFingerprint(request),
450
+ request,
451
+ requirement_plan: null,
452
+ accepted_receipt_digests: {},
453
+ completed_effect_ids: [],
454
+ owned_resource_ids: [],
455
+ // A probe never reaches the store: there is no owner to record.
456
+ owner_pid: null,
457
+ owner_process_start_id: null,
458
+ };
459
+ }
460
+ /**
461
+ * What the machine shows after a receipt. A refusal or a failure changed nothing, so there is
462
+ * nothing to look at; a receipt claiming the step ran is checked by a fresh probe.
463
+ */
464
+ async verdictFor(record, receipt) {
465
+ const provisioner = this.options.provisioner;
466
+ if (receipt.outcome === 'failed' &&
467
+ poolsExhaustedIn(receipt.log_tail) &&
468
+ provisioner?.addressPoolsConfigured) {
469
+ // Which of Docker's two pool failures it was is in daemon.json, read now (task 2.23).
470
+ const configured = await provisioner.addressPoolsConfigured().catch(() => 'unknown');
471
+ return {
472
+ prerequisites_met: false,
473
+ needs_relogin: false,
474
+ error: null,
475
+ address_pools_configured: configured,
476
+ };
477
+ }
478
+ if (receipt.outcome === 'declined' || receipt.outcome === 'failed' || provisioner === null) {
479
+ return { prerequisites_met: false, needs_relogin: false, error: null };
480
+ }
481
+ return provisioner.verifyHostStep(record, new AbortController().signal);
482
+ }
483
+ /**
484
+ * Announce a committed state, and remember it as the operation's current one while it runs. A
485
+ * finished operation is forgotten, so this map stays as small as what is in flight.
486
+ */
487
+ announce(operation) {
488
+ const finished = TERMINAL.includes(operation.phase);
489
+ if (finished)
490
+ this.latest.delete(operation.operation_id);
491
+ else
492
+ this.latest.set(operation.operation_id, operation);
493
+ this.options.emit?.('environment:operation', operation);
494
+ if (finished)
495
+ this.track(this.afterFinished(operation));
496
+ }
497
+ /** Work that `idle()` and `shutdown()` wait for, like a dispatched effect. */
498
+ track(work) {
499
+ const task = work.catch(() => undefined);
500
+ this.running.add(task);
501
+ void task.finally(() => this.running.delete(task));
502
+ }
503
+ /** `current` is the pull `pulling` started at, still: same phase, same revision. Unknown counts as still. */
504
+ stillPulling(current, pulling) {
505
+ return (current === undefined || (current.phase === 'pulling-image' && current.revision === pulling.revision));
506
+ }
507
+ /** The operation with the byte progress of a pull still in flight, when there is one. */
508
+ withProgress(operation) {
509
+ const live = this.progress.get(operation.operation_id);
510
+ return live !== undefined && operation.phase === 'pulling-image'
511
+ ? { ...operation, progress: live }
512
+ : operation;
513
+ }
514
+ /**
515
+ * `begin` was refused because another operation is running on this environment. If that
516
+ * operation's owner is provably gone, end it and say so; the caller then tries again once.
517
+ */
518
+ async endAbandonedBlocker(error) {
519
+ if (!(error instanceof AtomicCoreError) || error.code !== 'MANAGED_OPERATION_CONFLICT')
520
+ return false;
521
+ if (error.details === undefined)
522
+ return false;
523
+ const running = await this.options.store.read(error.details).catch(() => null);
524
+ if (running === null || TERMINAL.includes(running.machine.operation.phase))
525
+ return false;
526
+ // Waiting on the user is not abandonment: a consent not yet given, or a sign-in or reboot the
527
+ // operation continues after at the next core start, stays theirs (review r1, item 6).
528
+ if (WAITING.includes(running.machine.operation.phase))
529
+ return false;
530
+ if (await this.ownerAlive(running))
531
+ return false;
532
+ await this.failAbandoned(running, {
533
+ code: 'MANAGED_OPERATION_CONFLICT',
534
+ message: 'The core that was running this operation is gone; a new operation replaced it.',
535
+ });
536
+ return true;
537
+ }
538
+ /**
539
+ * Apply one event and commit it against the revision it was computed from.
540
+ *
541
+ * `owned: false` means somebody else — another call in this core, or the other core over the
542
+ * same shared store — committed a change to this operation between this call's read and its
543
+ * compare-and-swap. Its own transition never happened; `record` is simply the current state,
544
+ * handed back so the caller has something to return. The caller must not dispatch on it: the
545
+ * write that *did* land already came from a call whose own `apply` returned `owned: true`, and
546
+ * that call already dispatched whatever comes next. Dispatching again here would run the same
547
+ * external step (a pull, an activation, a removal) a second time for no reason a retry would.
548
+ */
549
+ async apply(operationId, event, patch = {}) {
550
+ const current = await this.options.store.read(operationId);
551
+ if (current === null)
552
+ throw notFound(operationId);
553
+ const result = reduceOperation(current.machine, event, {
554
+ next_effect_id: this.options.newEffectId(),
555
+ });
556
+ if (!result.ok) {
557
+ throw new AtomicCoreError(result.error.code, result.error.message, result.error.details);
558
+ }
559
+ const next = { ...current, ...patch, machine: result.value.state };
560
+ const swapped = await this.options.store.compareAndSwap(operationId, current.machine.operation.revision, next);
561
+ if (!swapped) {
562
+ // Somebody else moved the operation while this event was being computed.
563
+ const fresh = await this.options.store.read(operationId);
564
+ if (fresh === null)
565
+ throw notFound(operationId);
566
+ return { record: fresh, owned: false };
567
+ }
568
+ this.announce(next.machine.operation);
569
+ return { record: next, owned: true };
570
+ }
571
+ /**
572
+ * Whether the process that last wrote `record` (`owner_pid`) can still be shown to be running.
573
+ * `unknown` counts as alive, the same as `InstanceLock`'s own takeover decision: an unproven
574
+ * claim that a core is gone must not let a second core start driving the same operation.
575
+ */
576
+ async ownerAlive(record) {
577
+ const pid = record.owner_pid;
578
+ if (pid === null)
579
+ return false; // nothing was ever recorded; there is no owner to protect
580
+ const verdict = await verifyProcessIdentity(pid, record.owner_process_start_id, this.options.identityDeps);
581
+ return !identityPermitsTakeover(verdict);
582
+ }
583
+ /**
584
+ * Give up on an operation whose owner is gone and that no provisioner exists to reconcile: with
585
+ * no recipe to check the host against, this operation can never reach a terminal phase on its
586
+ * own, and leaving it non-terminal would refuse every later `begin` on its environment forever
587
+ * (`MANAGED_OPERATION_CONFLICT`, `OperationStore.createOrGet`'s busy check).
588
+ */
589
+ async failAbandoned(record, error = {
590
+ code: 'MANAGED_PREREQUISITE_BLOCKED',
591
+ message: 'The core that started this operation is gone, and managed runtimes are not available on this system yet.',
592
+ }) {
593
+ const operationId = record.machine.operation.operation_id;
594
+ const pending = record.machine.pending_effect;
595
+ if (pending !== null) {
596
+ await this.apply(operationId, {
597
+ type: 'failed',
598
+ effect_id: pending.effect_id,
599
+ expected_revision: record.machine.operation.revision,
600
+ error,
601
+ }).catch(() => undefined);
602
+ return;
603
+ }
604
+ // Nothing is pending — awaiting consent, or waiting on a sign-out or reboot that will never
605
+ // come from a core that is gone. `cancel` is the one event the reducer accepts without a
606
+ // pending effect; it issues a `cleanup` effect, which the no-provisioner branch of `perform`
607
+ // (below) turns into the same failure `execute` would have reported for real work. `recover`'s
608
+ // own per-record `try`/`catch` is the backstop; this one keeps a refusal here from reading as
609
+ // an operation this call still owes a result to.
610
+ const applied = await this.apply(operationId, { type: 'cancel' }).catch(() => null);
611
+ if (applied?.owned === true)
612
+ this.dispatch(applied.record);
613
+ }
614
+ /** Run whatever the machine is now waiting on, without making the caller wait for it. */
615
+ dispatch(record) {
616
+ const effect = record.machine.pending_effect;
617
+ if (effect === null || this.stopped)
618
+ return;
619
+ const task = this.perform(record, effect).catch(() => undefined);
620
+ this.running.add(task);
621
+ void task.finally(() => this.running.delete(task));
622
+ }
623
+ async perform(record, effect) {
624
+ const provisioner = this.options.provisioner;
625
+ const operationId = record.machine.operation.operation_id;
626
+ const controller = new AbortController();
627
+ this.aborts.set(operationId, controller);
628
+ const identity = { effect_id: effect.effect_id, expected_revision: effect.expected_revision };
629
+ try {
630
+ if (effect.kind === 'probe') {
631
+ const answer = provisioner === null
632
+ ? { plan: unsupported(record.machine.operation), host_step: null }
633
+ : await provisioner.probe(record, controller.signal);
634
+ // The plan is kept with the record: it names the descriptor this operation installs, so a
635
+ // later probe, the pull and the activation all resolve the same one (design D7).
636
+ const { record: next, owned } = await this.apply(operationId, {
637
+ type: 'requirements-ready',
638
+ ...identity,
639
+ plan: answer.plan,
640
+ host_step: answer.host_step,
641
+ ...('image_present' in answer && answer.image_present !== undefined
642
+ ? { image_present: answer.image_present }
643
+ : {}),
644
+ }, { requirement_plan: answer.plan });
645
+ if (owned)
646
+ this.dispatch(next);
647
+ return;
648
+ }
649
+ if (effect.kind === 'reconcile' && provisioner !== null) {
650
+ // An explicit resume: the same questions recovery asks at startup, then the reducer decides
651
+ // whether to keep waiting or to look at requirements again.
652
+ const inventory = provisioner.inventory;
653
+ const [steps, planDigest, needsRelogin, needsReboot] = await Promise.all([
654
+ inventory.verifyCompletedSteps(record),
655
+ inventory.currentPlanDigest(record),
656
+ inventory.needsRelogin(record),
657
+ inventory.needsReboot(record),
658
+ ]);
659
+ const { record: next, owned } = await this.apply(operationId, {
660
+ type: 'reconciled',
661
+ ...identity,
662
+ instance_id: this.options.instanceId,
663
+ verified_completed_step_ids: steps,
664
+ current_plan_digest: planDigest,
665
+ needs_relogin: needsRelogin,
666
+ needs_reboot: needsReboot,
667
+ });
668
+ if (owned)
669
+ this.dispatch(next);
670
+ return;
671
+ }
672
+ if (effect.kind === 'host-step') {
673
+ // The privileged work belongs to the app. Say it has begun — from here until the receipt
674
+ // arrives, a cancellation is recorded rather than acted on — and wait.
675
+ await this.apply(operationId, { type: 'host-step-started', ...identity });
676
+ return;
677
+ }
678
+ if (provisioner === null) {
679
+ await this.apply(operationId, {
680
+ type: 'failed',
681
+ ...identity,
682
+ error: {
683
+ code: 'MANAGED_PREREQUISITE_BLOCKED',
684
+ message: 'Managed runtimes are not available on this system yet.',
685
+ },
686
+ });
687
+ return;
688
+ }
689
+ const done = await this.execute(provisioner, effect, record, controller.signal);
690
+ const { record: next, owned } = await this.apply(operationId, {
691
+ ...done,
692
+ ...identity,
693
+ });
694
+ if (owned)
695
+ this.dispatch(next);
696
+ }
697
+ catch (error) {
698
+ const failure = error instanceof AtomicCoreError
699
+ ? {
700
+ code: error.code,
701
+ message: error.message,
702
+ ...(error.details === undefined ? {} : { details: error.details }),
703
+ }
704
+ : { code: 'IO_ERROR', message: error.message };
705
+ // A refusal from the reducer means this result no longer applies; there is nothing to record.
706
+ if (error instanceof AtomicCoreError && error.code === 'MANAGED_OPERATION_CONFLICT')
707
+ return;
708
+ await this.apply(operationId, { type: 'failed', ...identity, error: failure }).catch(() => undefined);
709
+ }
710
+ finally {
711
+ if (this.aborts.get(operationId) === controller)
712
+ this.aborts.delete(operationId);
713
+ }
714
+ }
715
+ async execute(provisioner, effect, record, signal) {
716
+ switch (effect.kind) {
717
+ case 'prepare-environment':
718
+ await provisioner.prepare(record, signal, (ids) => this.options.store.recordOwned(record.machine.operation.operation_id, ids));
719
+ return { type: 'environment-verified' };
720
+ case 'pull-image': {
721
+ const operation = record.machine.operation;
722
+ const now = this.options.now ?? Date.now;
723
+ let last = null;
724
+ try {
725
+ await provisioner.pull(record, (progress) => {
726
+ // Only for the operation as it stands now: a tick still streaming after a cancel (or
727
+ // any other transition) committed must not announce the pull as current again.
728
+ if (!this.stillPulling(this.latest.get(operation.operation_id), operation))
729
+ return;
730
+ this.progress.set(operation.operation_id, progress);
731
+ const at = now();
732
+ const final = progress.total !== null && progress.completed === progress.total;
733
+ if (last !== null && !final && at - last < PROGRESS_EMIT_INTERVAL_MS)
734
+ return;
735
+ last = at;
736
+ // The shared record decides, not only what this core announced: the other scope's
737
+ // core may have cancelled it (review r2, item E). Checked again once it answers.
738
+ void this.options.store
739
+ .read(operation.operation_id)
740
+ .then((stored) => {
741
+ const latest = this.latest.get(operation.operation_id);
742
+ if (!this.stillPulling(stored?.machine.operation, operation))
743
+ return;
744
+ if (!this.stillPulling(latest, operation))
745
+ return;
746
+ this.options.emit?.('environment:operation', { ...operation, progress });
747
+ })
748
+ .catch(() => undefined);
749
+ }, signal);
750
+ }
751
+ finally {
752
+ this.progress.delete(operation.operation_id);
753
+ }
754
+ return { type: 'image-pulled' };
755
+ }
756
+ case 'verify':
757
+ await provisioner.verify(record, signal);
758
+ return { type: 'verification-passed' };
759
+ case 'unload-resident':
760
+ await provisioner.unloadResident(record, signal);
761
+ return { type: 'resident-unloaded' };
762
+ case 'activate':
763
+ await provisioner.activate(record, signal);
764
+ return { type: 'activation-committed' };
765
+ case 'remove':
766
+ await provisioner.remove(record, signal);
767
+ return { type: 'removal-completed' };
768
+ case 'cleanup':
769
+ await provisioner.cleanup(record, signal);
770
+ return { type: 'cleanup-completed' };
771
+ default:
772
+ throw new AtomicCoreError('MANAGED_OPERATION_CONFLICT', `Nothing runs a ${effect.kind} here.`);
773
+ }
774
+ }
775
+ }
776
+ //# sourceMappingURL=service.js.map