@marinoscar/platform-cli 0.0.0-stage → 0.1.0-next.11

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 (752) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/LICENSE +21 -0
  3. package/README.md +182 -2
  4. package/dist/android/build.d.ts +30 -0
  5. package/dist/android/build.d.ts.map +1 -0
  6. package/dist/android/build.js +126 -0
  7. package/dist/android/build.js.map +1 -0
  8. package/dist/android/command.d.ts +21 -0
  9. package/dist/android/command.d.ts.map +1 -0
  10. package/dist/android/command.js +355 -0
  11. package/dist/android/command.js.map +1 -0
  12. package/dist/android/deploy-step.d.ts +85 -0
  13. package/dist/android/deploy-step.d.ts.map +1 -0
  14. package/dist/android/deploy-step.js +268 -0
  15. package/dist/android/deploy-step.js.map +1 -0
  16. package/dist/android/doctor.d.ts +47 -0
  17. package/dist/android/doctor.d.ts.map +1 -0
  18. package/dist/android/doctor.js +219 -0
  19. package/dist/android/doctor.js.map +1 -0
  20. package/dist/android/exec.d.ts +42 -0
  21. package/dist/android/exec.d.ts.map +1 -0
  22. package/dist/android/exec.js +103 -0
  23. package/dist/android/exec.js.map +1 -0
  24. package/dist/android/fix-plan.d.ts +44 -0
  25. package/dist/android/fix-plan.d.ts.map +1 -0
  26. package/dist/android/fix-plan.js +86 -0
  27. package/dist/android/fix-plan.js.map +1 -0
  28. package/dist/android/git-freshness.d.ts +34 -0
  29. package/dist/android/git-freshness.d.ts.map +1 -0
  30. package/dist/android/git-freshness.js +120 -0
  31. package/dist/android/git-freshness.js.map +1 -0
  32. package/dist/android/gradle.d.ts +32 -0
  33. package/dist/android/gradle.d.ts.map +1 -0
  34. package/dist/android/gradle.js +55 -0
  35. package/dist/android/gradle.js.map +1 -0
  36. package/dist/android/identity.d.ts +27 -0
  37. package/dist/android/identity.d.ts.map +1 -0
  38. package/dist/android/identity.js +60 -0
  39. package/dist/android/identity.js.map +1 -0
  40. package/dist/android/index.d.ts +7 -0
  41. package/dist/android/index.d.ts.map +1 -0
  42. package/dist/android/index.js +8 -0
  43. package/dist/android/index.js.map +1 -0
  44. package/dist/android/installer.d.ts +28 -0
  45. package/dist/android/installer.d.ts.map +1 -0
  46. package/dist/android/installer.js +96 -0
  47. package/dist/android/installer.js.map +1 -0
  48. package/dist/android/java.d.ts +26 -0
  49. package/dist/android/java.d.ts.map +1 -0
  50. package/dist/android/java.js +65 -0
  51. package/dist/android/java.js.map +1 -0
  52. package/dist/android/keystore.d.ts +54 -0
  53. package/dist/android/keystore.d.ts.map +1 -0
  54. package/dist/android/keystore.js +159 -0
  55. package/dist/android/keystore.js.map +1 -0
  56. package/dist/android/metadata.d.ts +39 -0
  57. package/dist/android/metadata.d.ts.map +1 -0
  58. package/dist/android/metadata.js +61 -0
  59. package/dist/android/metadata.js.map +1 -0
  60. package/dist/android/operations.d.ts +42 -0
  61. package/dist/android/operations.d.ts.map +1 -0
  62. package/dist/android/operations.js +59 -0
  63. package/dist/android/operations.js.map +1 -0
  64. package/dist/android/paths.d.ts +29 -0
  65. package/dist/android/paths.d.ts.map +1 -0
  66. package/dist/android/paths.js +97 -0
  67. package/dist/android/paths.js.map +1 -0
  68. package/dist/android/publish.d.ts +37 -0
  69. package/dist/android/publish.d.ts.map +1 -0
  70. package/dist/android/publish.js +119 -0
  71. package/dist/android/publish.js.map +1 -0
  72. package/dist/android/registrations.d.ts +92 -0
  73. package/dist/android/registrations.d.ts.map +1 -0
  74. package/dist/android/registrations.js +112 -0
  75. package/dist/android/registrations.js.map +1 -0
  76. package/dist/android/release-status.d.ts +73 -0
  77. package/dist/android/release-status.d.ts.map +1 -0
  78. package/dist/android/release-status.js +161 -0
  79. package/dist/android/release-status.js.map +1 -0
  80. package/dist/android/release.d.ts +33 -0
  81. package/dist/android/release.d.ts.map +1 -0
  82. package/dist/android/release.js +59 -0
  83. package/dist/android/release.js.map +1 -0
  84. package/dist/android/screen-layout.d.ts +26 -0
  85. package/dist/android/screen-layout.d.ts.map +1 -0
  86. package/dist/android/screen-layout.js +24 -0
  87. package/dist/android/screen-layout.js.map +1 -0
  88. package/dist/android/screen-model.d.ts +56 -0
  89. package/dist/android/screen-model.d.ts.map +1 -0
  90. package/dist/android/screen-model.js +207 -0
  91. package/dist/android/screen-model.js.map +1 -0
  92. package/dist/android/screen.d.ts +8 -0
  93. package/dist/android/screen.d.ts.map +1 -0
  94. package/dist/android/screen.js +395 -0
  95. package/dist/android/screen.js.map +1 -0
  96. package/dist/android/sdk.d.ts +48 -0
  97. package/dist/android/sdk.d.ts.map +1 -0
  98. package/dist/android/sdk.js +82 -0
  99. package/dist/android/sdk.js.map +1 -0
  100. package/dist/android/server-url.d.ts +19 -0
  101. package/dist/android/server-url.d.ts.map +1 -0
  102. package/dist/android/server-url.js +36 -0
  103. package/dist/android/server-url.js.map +1 -0
  104. package/dist/android/upload-progress.d.ts +3 -0
  105. package/dist/android/upload-progress.d.ts.map +1 -0
  106. package/dist/android/upload-progress.js +47 -0
  107. package/dist/android/upload-progress.js.map +1 -0
  108. package/dist/android/version.d.ts +47 -0
  109. package/dist/android/version.d.ts.map +1 -0
  110. package/dist/android/version.js +136 -0
  111. package/dist/android/version.js.map +1 -0
  112. package/dist/api-client/index.d.ts +3 -0
  113. package/dist/api-client/index.d.ts.map +1 -0
  114. package/dist/api-client/index.js +5 -0
  115. package/dist/api-client/index.js.map +1 -0
  116. package/dist/commands/index.d.ts +52 -0
  117. package/dist/commands/index.d.ts.map +1 -0
  118. package/dist/commands/index.js +63 -0
  119. package/dist/commands/index.js.map +1 -0
  120. package/dist/core/cli-registry.d.ts +41 -0
  121. package/dist/core/cli-registry.d.ts.map +1 -0
  122. package/dist/core/cli-registry.js +49 -0
  123. package/dist/core/cli-registry.js.map +1 -0
  124. package/dist/core/command-registry.d.ts +60 -0
  125. package/dist/core/command-registry.d.ts.map +1 -0
  126. package/dist/core/command-registry.js +114 -0
  127. package/dist/core/command-registry.js.map +1 -0
  128. package/dist/core/env-annotation-registry.d.ts +58 -0
  129. package/dist/core/env-annotation-registry.d.ts.map +1 -0
  130. package/dist/core/env-annotation-registry.js +80 -0
  131. package/dist/core/env-annotation-registry.js.map +1 -0
  132. package/dist/core/env-generator-registry.d.ts +59 -0
  133. package/dist/core/env-generator-registry.d.ts.map +1 -0
  134. package/dist/core/env-generator-registry.js +102 -0
  135. package/dist/core/env-generator-registry.js.map +1 -0
  136. package/dist/core/env-group-registry.d.ts +65 -0
  137. package/dist/core/env-group-registry.d.ts.map +1 -0
  138. package/dist/core/env-group-registry.js +77 -0
  139. package/dist/core/env-group-registry.js.map +1 -0
  140. package/dist/core/env-spec-registry.d.ts +133 -0
  141. package/dist/core/env-spec-registry.d.ts.map +1 -0
  142. package/dist/core/env-spec-registry.js +103 -0
  143. package/dist/core/env-spec-registry.js.map +1 -0
  144. package/dist/core/env-values.d.ts +76 -0
  145. package/dist/core/env-values.d.ts.map +1 -0
  146. package/dist/core/env-values.js +125 -0
  147. package/dist/core/env-values.js.map +1 -0
  148. package/dist/core/index.d.ts +14 -0
  149. package/dist/core/index.d.ts.map +1 -0
  150. package/dist/core/index.js +10 -0
  151. package/dist/core/index.js.map +1 -0
  152. package/dist/deploy/index.d.ts +3 -0
  153. package/dist/deploy/index.d.ts.map +1 -0
  154. package/dist/deploy/index.js +5 -0
  155. package/dist/deploy/index.js.map +1 -0
  156. package/dist/engine/api-client.d.ts +211 -0
  157. package/dist/engine/api-client.d.ts.map +1 -0
  158. package/dist/engine/api-client.js +350 -0
  159. package/dist/engine/api-client.js.map +1 -0
  160. package/dist/engine/browser.d.ts +18 -0
  161. package/dist/engine/browser.d.ts.map +1 -0
  162. package/dist/engine/browser.js +115 -0
  163. package/dist/engine/browser.js.map +1 -0
  164. package/dist/engine/builtin-registrations.d.ts +20 -0
  165. package/dist/engine/builtin-registrations.d.ts.map +1 -0
  166. package/dist/engine/builtin-registrations.js +86 -0
  167. package/dist/engine/builtin-registrations.js.map +1 -0
  168. package/dist/engine/commands/api.d.ts +88 -0
  169. package/dist/engine/commands/api.d.ts.map +1 -0
  170. package/dist/engine/commands/api.js +398 -0
  171. package/dist/engine/commands/api.js.map +1 -0
  172. package/dist/engine/commands/config.d.ts +5 -0
  173. package/dist/engine/commands/config.d.ts.map +1 -0
  174. package/dist/engine/commands/config.js +83 -0
  175. package/dist/engine/commands/config.js.map +1 -0
  176. package/dist/engine/commands/deploy.d.ts +243 -0
  177. package/dist/engine/commands/deploy.d.ts.map +1 -0
  178. package/dist/engine/commands/deploy.js +1166 -0
  179. package/dist/engine/commands/deploy.js.map +1 -0
  180. package/dist/engine/commands/init.d.ts +18 -0
  181. package/dist/engine/commands/init.d.ts.map +1 -0
  182. package/dist/engine/commands/init.js +50 -0
  183. package/dist/engine/commands/init.js.map +1 -0
  184. package/dist/engine/commands/login.d.ts +4 -0
  185. package/dist/engine/commands/login.d.ts.map +1 -0
  186. package/dist/engine/commands/login.js +205 -0
  187. package/dist/engine/commands/login.js.map +1 -0
  188. package/dist/engine/commands/node.d.ts +21 -0
  189. package/dist/engine/commands/node.d.ts.map +1 -0
  190. package/dist/engine/commands/node.js +436 -0
  191. package/dist/engine/commands/node.js.map +1 -0
  192. package/dist/engine/config.d.ts +246 -0
  193. package/dist/engine/config.d.ts.map +1 -0
  194. package/dist/engine/config.js +414 -0
  195. package/dist/engine/config.js.map +1 -0
  196. package/dist/engine/conformance.d.ts +187 -0
  197. package/dist/engine/conformance.d.ts.map +1 -0
  198. package/dist/engine/conformance.js +227 -0
  199. package/dist/engine/conformance.js.map +1 -0
  200. package/dist/engine/create-cli.d.ts +94 -0
  201. package/dist/engine/create-cli.d.ts.map +1 -0
  202. package/dist/engine/create-cli.js +60 -0
  203. package/dist/engine/create-cli.js.map +1 -0
  204. package/dist/engine/deploy/about.d.ts +12 -0
  205. package/dist/engine/deploy/about.d.ts.map +1 -0
  206. package/dist/engine/deploy/about.js +110 -0
  207. package/dist/engine/deploy/about.js.map +1 -0
  208. package/dist/engine/deploy/adopt.d.ts +21 -0
  209. package/dist/engine/deploy/adopt.d.ts.map +1 -0
  210. package/dist/engine/deploy/adopt.js +78 -0
  211. package/dist/engine/deploy/adopt.js.map +1 -0
  212. package/dist/engine/deploy/answers-file.d.ts +7 -0
  213. package/dist/engine/deploy/answers-file.d.ts.map +1 -0
  214. package/dist/engine/deploy/answers-file.js +49 -0
  215. package/dist/engine/deploy/answers-file.js.map +1 -0
  216. package/dist/engine/deploy/app-role.d.ts +278 -0
  217. package/dist/engine/deploy/app-role.d.ts.map +1 -0
  218. package/dist/engine/deploy/app-role.js +826 -0
  219. package/dist/engine/deploy/app-role.js.map +1 -0
  220. package/dist/engine/deploy/app-version.d.ts +47 -0
  221. package/dist/engine/deploy/app-version.d.ts.map +1 -0
  222. package/dist/engine/deploy/app-version.js +232 -0
  223. package/dist/engine/deploy/app-version.js.map +1 -0
  224. package/dist/engine/deploy/checks/database.d.ts +83 -0
  225. package/dist/engine/deploy/checks/database.d.ts.map +1 -0
  226. package/dist/engine/deploy/checks/database.js +455 -0
  227. package/dist/engine/deploy/checks/database.js.map +1 -0
  228. package/dist/engine/deploy/checks/dns.d.ts +3 -0
  229. package/dist/engine/deploy/checks/dns.d.ts.map +1 -0
  230. package/dist/engine/deploy/checks/dns.js +85 -0
  231. package/dist/engine/deploy/checks/dns.js.map +1 -0
  232. package/dist/engine/deploy/checks/host.d.ts +19 -0
  233. package/dist/engine/deploy/checks/host.d.ts.map +1 -0
  234. package/dist/engine/deploy/checks/host.js +543 -0
  235. package/dist/engine/deploy/checks/host.js.map +1 -0
  236. package/dist/engine/deploy/checks/index.d.ts +33 -0
  237. package/dist/engine/deploy/checks/index.d.ts.map +1 -0
  238. package/dist/engine/deploy/checks/index.js +67 -0
  239. package/dist/engine/deploy/checks/index.js.map +1 -0
  240. package/dist/engine/deploy/checks/registry.d.ts +110 -0
  241. package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
  242. package/dist/engine/deploy/checks/registry.js +104 -0
  243. package/dist/engine/deploy/checks/registry.js.map +1 -0
  244. package/dist/engine/deploy/checks/source.d.ts +45 -0
  245. package/dist/engine/deploy/checks/source.d.ts.map +1 -0
  246. package/dist/engine/deploy/checks/source.js +175 -0
  247. package/dist/engine/deploy/checks/source.js.map +1 -0
  248. package/dist/engine/deploy/checks/tls.d.ts +87 -0
  249. package/dist/engine/deploy/checks/tls.d.ts.map +1 -0
  250. package/dist/engine/deploy/checks/tls.js +552 -0
  251. package/dist/engine/deploy/checks/tls.js.map +1 -0
  252. package/dist/engine/deploy/checks/types.d.ts +186 -0
  253. package/dist/engine/deploy/checks/types.d.ts.map +1 -0
  254. package/dist/engine/deploy/checks/types.js +199 -0
  255. package/dist/engine/deploy/checks/types.js.map +1 -0
  256. package/dist/engine/deploy/compose-files.d.ts +29 -0
  257. package/dist/engine/deploy/compose-files.d.ts.map +1 -0
  258. package/dist/engine/deploy/compose-files.js +118 -0
  259. package/dist/engine/deploy/compose-files.js.map +1 -0
  260. package/dist/engine/deploy/compose-hints.d.ts +11 -0
  261. package/dist/engine/deploy/compose-hints.d.ts.map +1 -0
  262. package/dist/engine/deploy/compose-hints.js +70 -0
  263. package/dist/engine/deploy/compose-hints.js.map +1 -0
  264. package/dist/engine/deploy/consent.d.ts +29 -0
  265. package/dist/engine/deploy/consent.d.ts.map +1 -0
  266. package/dist/engine/deploy/consent.js +35 -0
  267. package/dist/engine/deploy/consent.js.map +1 -0
  268. package/dist/engine/deploy/database-drop.d.ts +22 -0
  269. package/dist/engine/deploy/database-drop.d.ts.map +1 -0
  270. package/dist/engine/deploy/database-drop.js +135 -0
  271. package/dist/engine/deploy/database-drop.js.map +1 -0
  272. package/dist/engine/deploy/database.d.ts +116 -0
  273. package/dist/engine/deploy/database.d.ts.map +1 -0
  274. package/dist/engine/deploy/database.js +252 -0
  275. package/dist/engine/deploy/database.js.map +1 -0
  276. package/dist/engine/deploy/deploy-info.d.ts +48 -0
  277. package/dist/engine/deploy/deploy-info.d.ts.map +1 -0
  278. package/dist/engine/deploy/deploy-info.js +163 -0
  279. package/dist/engine/deploy/deploy-info.js.map +1 -0
  280. package/dist/engine/deploy/deployment-evidence.d.ts +38 -0
  281. package/dist/engine/deploy/deployment-evidence.d.ts.map +1 -0
  282. package/dist/engine/deploy/deployment-evidence.js +92 -0
  283. package/dist/engine/deploy/deployment-evidence.js.map +1 -0
  284. package/dist/engine/deploy/edge-config.d.ts +103 -0
  285. package/dist/engine/deploy/edge-config.d.ts.map +1 -0
  286. package/dist/engine/deploy/edge-config.js +170 -0
  287. package/dist/engine/deploy/edge-config.js.map +1 -0
  288. package/dist/engine/deploy/env-absence.d.ts +61 -0
  289. package/dist/engine/deploy/env-absence.d.ts.map +1 -0
  290. package/dist/engine/deploy/env-absence.js +33 -0
  291. package/dist/engine/deploy/env-absence.js.map +1 -0
  292. package/dist/engine/deploy/env-file.d.ts +14 -0
  293. package/dist/engine/deploy/env-file.d.ts.map +1 -0
  294. package/dist/engine/deploy/env-file.js +58 -0
  295. package/dist/engine/deploy/env-file.js.map +1 -0
  296. package/dist/engine/deploy/env-fragments.d.ts +29 -0
  297. package/dist/engine/deploy/env-fragments.d.ts.map +1 -0
  298. package/dist/engine/deploy/env-fragments.js +73 -0
  299. package/dist/engine/deploy/env-fragments.js.map +1 -0
  300. package/dist/engine/deploy/env-metadata.d.ts +73 -0
  301. package/dist/engine/deploy/env-metadata.d.ts.map +1 -0
  302. package/dist/engine/deploy/env-metadata.js +227 -0
  303. package/dist/engine/deploy/env-metadata.js.map +1 -0
  304. package/dist/engine/deploy/env-spec.d.ts +75 -0
  305. package/dist/engine/deploy/env-spec.d.ts.map +1 -0
  306. package/dist/engine/deploy/env-spec.js +239 -0
  307. package/dist/engine/deploy/env-spec.js.map +1 -0
  308. package/dist/engine/deploy/env-wizard.d.ts +56 -0
  309. package/dist/engine/deploy/env-wizard.d.ts.map +1 -0
  310. package/dist/engine/deploy/env-wizard.js +235 -0
  311. package/dist/engine/deploy/env-wizard.js.map +1 -0
  312. package/dist/engine/deploy/executor.d.ts +81 -0
  313. package/dist/engine/deploy/executor.d.ts.map +1 -0
  314. package/dist/engine/deploy/executor.js +247 -0
  315. package/dist/engine/deploy/executor.js.map +1 -0
  316. package/dist/engine/deploy/health.d.ts +153 -0
  317. package/dist/engine/deploy/health.d.ts.map +1 -0
  318. package/dist/engine/deploy/health.js +335 -0
  319. package/dist/engine/deploy/health.js.map +1 -0
  320. package/dist/engine/deploy/hooks.d.ts +66 -0
  321. package/dist/engine/deploy/hooks.d.ts.map +1 -0
  322. package/dist/engine/deploy/hooks.js +19 -0
  323. package/dist/engine/deploy/hooks.js.map +1 -0
  324. package/dist/engine/deploy/host-facts.d.ts +23 -0
  325. package/dist/engine/deploy/host-facts.d.ts.map +1 -0
  326. package/dist/engine/deploy/host-facts.js +67 -0
  327. package/dist/engine/deploy/host-facts.js.map +1 -0
  328. package/dist/engine/deploy/install.d.ts +233 -0
  329. package/dist/engine/deploy/install.d.ts.map +1 -0
  330. package/dist/engine/deploy/install.js +1318 -0
  331. package/dist/engine/deploy/install.js.map +1 -0
  332. package/dist/engine/deploy/inventory.d.ts +30 -0
  333. package/dist/engine/deploy/inventory.d.ts.map +1 -0
  334. package/dist/engine/deploy/inventory.js +122 -0
  335. package/dist/engine/deploy/inventory.js.map +1 -0
  336. package/dist/engine/deploy/journal.d.ts +77 -0
  337. package/dist/engine/deploy/journal.d.ts.map +1 -0
  338. package/dist/engine/deploy/journal.js +221 -0
  339. package/dist/engine/deploy/journal.js.map +1 -0
  340. package/dist/engine/deploy/layout.d.ts +77 -0
  341. package/dist/engine/deploy/layout.d.ts.map +1 -0
  342. package/dist/engine/deploy/layout.js +191 -0
  343. package/dist/engine/deploy/layout.js.map +1 -0
  344. package/dist/engine/deploy/oauth-check.d.ts +58 -0
  345. package/dist/engine/deploy/oauth-check.d.ts.map +1 -0
  346. package/dist/engine/deploy/oauth-check.js +213 -0
  347. package/dist/engine/deploy/oauth-check.js.map +1 -0
  348. package/dist/engine/deploy/proxy-bootstrap.d.ts +149 -0
  349. package/dist/engine/deploy/proxy-bootstrap.d.ts.map +1 -0
  350. package/dist/engine/deploy/proxy-bootstrap.js +416 -0
  351. package/dist/engine/deploy/proxy-bootstrap.js.map +1 -0
  352. package/dist/engine/deploy/proxy-streams.d.ts +110 -0
  353. package/dist/engine/deploy/proxy-streams.d.ts.map +1 -0
  354. package/dist/engine/deploy/proxy-streams.js +208 -0
  355. package/dist/engine/deploy/proxy-streams.js.map +1 -0
  356. package/dist/engine/deploy/proxy.d.ts +375 -0
  357. package/dist/engine/deploy/proxy.d.ts.map +1 -0
  358. package/dist/engine/deploy/proxy.js +758 -0
  359. package/dist/engine/deploy/proxy.js.map +1 -0
  360. package/dist/engine/deploy/renewal.d.ts +54 -0
  361. package/dist/engine/deploy/renewal.d.ts.map +1 -0
  362. package/dist/engine/deploy/renewal.js +169 -0
  363. package/dist/engine/deploy/renewal.js.map +1 -0
  364. package/dist/engine/deploy/repo.d.ts +119 -0
  365. package/dist/engine/deploy/repo.d.ts.map +1 -0
  366. package/dist/engine/deploy/repo.js +277 -0
  367. package/dist/engine/deploy/repo.js.map +1 -0
  368. package/dist/engine/deploy/run-record.d.ts +28 -0
  369. package/dist/engine/deploy/run-record.d.ts.map +1 -0
  370. package/dist/engine/deploy/run-record.js +44 -0
  371. package/dist/engine/deploy/run-record.js.map +1 -0
  372. package/dist/engine/deploy/state.d.ts +289 -0
  373. package/dist/engine/deploy/state.d.ts.map +1 -0
  374. package/dist/engine/deploy/state.js +163 -0
  375. package/dist/engine/deploy/state.js.map +1 -0
  376. package/dist/engine/deploy/steps/app-step-context.d.ts +24 -0
  377. package/dist/engine/deploy/steps/app-step-context.d.ts.map +1 -0
  378. package/dist/engine/deploy/steps/app-step-context.js +45 -0
  379. package/dist/engine/deploy/steps/app-step-context.js.map +1 -0
  380. package/dist/engine/deploy/steps/pipeline.d.ts +46 -0
  381. package/dist/engine/deploy/steps/pipeline.d.ts.map +1 -0
  382. package/dist/engine/deploy/steps/pipeline.js +73 -0
  383. package/dist/engine/deploy/steps/pipeline.js.map +1 -0
  384. package/dist/engine/deploy/steps/plan.d.ts +28 -0
  385. package/dist/engine/deploy/steps/plan.d.ts.map +1 -0
  386. package/dist/engine/deploy/steps/plan.js +32 -0
  387. package/dist/engine/deploy/steps/plan.js.map +1 -0
  388. package/dist/engine/deploy/steps/registry.d.ts +182 -0
  389. package/dist/engine/deploy/steps/registry.d.ts.map +1 -0
  390. package/dist/engine/deploy/steps/registry.js +212 -0
  391. package/dist/engine/deploy/steps/registry.js.map +1 -0
  392. package/dist/engine/deploy/steps/step-values.d.ts +28 -0
  393. package/dist/engine/deploy/steps/step-values.d.ts.map +1 -0
  394. package/dist/engine/deploy/steps/step-values.js +33 -0
  395. package/dist/engine/deploy/steps/step-values.js.map +1 -0
  396. package/dist/engine/deploy/testing/fake-postgres.d.ts +88 -0
  397. package/dist/engine/deploy/testing/fake-postgres.d.ts.map +1 -0
  398. package/dist/engine/deploy/testing/fake-postgres.js +236 -0
  399. package/dist/engine/deploy/testing/fake-postgres.js.map +1 -0
  400. package/dist/engine/deploy/testing/fake-vps.d.ts +147 -0
  401. package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -0
  402. package/dist/engine/deploy/testing/fake-vps.js +365 -0
  403. package/dist/engine/deploy/testing/fake-vps.js.map +1 -0
  404. package/dist/engine/deploy/uninstall.d.ts +87 -0
  405. package/dist/engine/deploy/uninstall.d.ts.map +1 -0
  406. package/dist/engine/deploy/uninstall.js +321 -0
  407. package/dist/engine/deploy/uninstall.js.map +1 -0
  408. package/dist/engine/deploy/update.d.ts +112 -0
  409. package/dist/engine/deploy/update.d.ts.map +1 -0
  410. package/dist/engine/deploy/update.js +1280 -0
  411. package/dist/engine/deploy/update.js.map +1 -0
  412. package/dist/engine/deploy/version-step.d.ts +65 -0
  413. package/dist/engine/deploy/version-step.d.ts.map +1 -0
  414. package/dist/engine/deploy/version-step.js +176 -0
  415. package/dist/engine/deploy/version-step.js.map +1 -0
  416. package/dist/engine/device-auth.d.ts +240 -0
  417. package/dist/engine/device-auth.d.ts.map +1 -0
  418. package/dist/engine/device-auth.js +442 -0
  419. package/dist/engine/device-auth.js.map +1 -0
  420. package/dist/engine/device-login.d.ts +126 -0
  421. package/dist/engine/device-login.d.ts.map +1 -0
  422. package/dist/engine/device-login.js +164 -0
  423. package/dist/engine/device-login.js.map +1 -0
  424. package/dist/engine/errors.d.ts +314 -0
  425. package/dist/engine/errors.d.ts.map +1 -0
  426. package/dist/engine/errors.js +561 -0
  427. package/dist/engine/errors.js.map +1 -0
  428. package/dist/engine/identity.d.ts +169 -0
  429. package/dist/engine/identity.d.ts.map +1 -0
  430. package/dist/engine/identity.js +227 -0
  431. package/dist/engine/identity.js.map +1 -0
  432. package/dist/engine/index.d.ts +104 -0
  433. package/dist/engine/index.d.ts.map +1 -0
  434. package/dist/engine/index.js +126 -0
  435. package/dist/engine/index.js.map +1 -0
  436. package/dist/engine/init/local-profile.d.ts +93 -0
  437. package/dist/engine/init/local-profile.d.ts.map +1 -0
  438. package/dist/engine/init/local-profile.js +295 -0
  439. package/dist/engine/init/local-profile.js.map +1 -0
  440. package/dist/engine/init/run-init.d.ts +41 -0
  441. package/dist/engine/init/run-init.d.ts.map +1 -0
  442. package/dist/engine/init/run-init.js +297 -0
  443. package/dist/engine/init/run-init.js.map +1 -0
  444. package/dist/engine/node/capabilities.d.ts +238 -0
  445. package/dist/engine/node/capabilities.d.ts.map +1 -0
  446. package/dist/engine/node/capabilities.js +316 -0
  447. package/dist/engine/node/capabilities.js.map +1 -0
  448. package/dist/engine/node/daemon.d.ts +63 -0
  449. package/dist/engine/node/daemon.d.ts.map +1 -0
  450. package/dist/engine/node/daemon.js +227 -0
  451. package/dist/engine/node/daemon.js.map +1 -0
  452. package/dist/engine/node/doctor.d.ts +58 -0
  453. package/dist/engine/node/doctor.d.ts.map +1 -0
  454. package/dist/engine/node/doctor.js +394 -0
  455. package/dist/engine/node/doctor.js.map +1 -0
  456. package/dist/engine/node/enrollment.d.ts +98 -0
  457. package/dist/engine/node/enrollment.d.ts.map +1 -0
  458. package/dist/engine/node/enrollment.js +189 -0
  459. package/dist/engine/node/enrollment.js.map +1 -0
  460. package/dist/engine/node/env-flags.d.ts +5 -0
  461. package/dist/engine/node/env-flags.d.ts.map +1 -0
  462. package/dist/engine/node/env-flags.js +22 -0
  463. package/dist/engine/node/env-flags.js.map +1 -0
  464. package/dist/engine/node/executors/credential-hygiene.d.ts +63 -0
  465. package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -0
  466. package/dist/engine/node/executors/credential-hygiene.js +189 -0
  467. package/dist/engine/node/executors/credential-hygiene.js.map +1 -0
  468. package/dist/engine/node/executors/db-backup-run.d.ts +73 -0
  469. package/dist/engine/node/executors/db-backup-run.d.ts.map +1 -0
  470. package/dist/engine/node/executors/db-backup-run.js +362 -0
  471. package/dist/engine/node/executors/db-backup-run.js.map +1 -0
  472. package/dist/engine/node/executors/example-checksum.d.ts +30 -0
  473. package/dist/engine/node/executors/example-checksum.d.ts.map +1 -0
  474. package/dist/engine/node/executors/example-checksum.js +56 -0
  475. package/dist/engine/node/executors/example-checksum.js.map +1 -0
  476. package/dist/engine/node/executors/index.d.ts +168 -0
  477. package/dist/engine/node/executors/index.d.ts.map +1 -0
  478. package/dist/engine/node/executors/index.js +44 -0
  479. package/dist/engine/node/executors/index.js.map +1 -0
  480. package/dist/engine/node/executors/registry.d.ts +38 -0
  481. package/dist/engine/node/executors/registry.d.ts.map +1 -0
  482. package/dist/engine/node/executors/registry.js +92 -0
  483. package/dist/engine/node/executors/registry.js.map +1 -0
  484. package/dist/engine/node/heap-snapshot.d.ts +37 -0
  485. package/dist/engine/node/heap-snapshot.d.ts.map +1 -0
  486. package/dist/engine/node/heap-snapshot.js +160 -0
  487. package/dist/engine/node/heap-snapshot.js.map +1 -0
  488. package/dist/engine/node/install-deps.d.ts +73 -0
  489. package/dist/engine/node/install-deps.d.ts.map +1 -0
  490. package/dist/engine/node/install-deps.js +150 -0
  491. package/dist/engine/node/install-deps.js.map +1 -0
  492. package/dist/engine/node/ipc-protocol.d.ts +67 -0
  493. package/dist/engine/node/ipc-protocol.d.ts.map +1 -0
  494. package/dist/engine/node/ipc-protocol.js +83 -0
  495. package/dist/engine/node/ipc-protocol.js.map +1 -0
  496. package/dist/engine/node/lifecycle.d.ts +103 -0
  497. package/dist/engine/node/lifecycle.d.ts.map +1 -0
  498. package/dist/engine/node/lifecycle.js +259 -0
  499. package/dist/engine/node/lifecycle.js.map +1 -0
  500. package/dist/engine/node/logger.d.ts +82 -0
  501. package/dist/engine/node/logger.d.ts.map +1 -0
  502. package/dist/engine/node/logger.js +241 -0
  503. package/dist/engine/node/logger.js.map +1 -0
  504. package/dist/engine/node/memory-watchdog.d.ts +78 -0
  505. package/dist/engine/node/memory-watchdog.d.ts.map +1 -0
  506. package/dist/engine/node/memory-watchdog.js +224 -0
  507. package/dist/engine/node/memory-watchdog.js.map +1 -0
  508. package/dist/engine/node/node-api.d.ts +391 -0
  509. package/dist/engine/node/node-api.d.ts.map +1 -0
  510. package/dist/engine/node/node-api.js +123 -0
  511. package/dist/engine/node/node-api.js.map +1 -0
  512. package/dist/engine/node/node-config.d.ts +128 -0
  513. package/dist/engine/node/node-config.d.ts.map +1 -0
  514. package/dist/engine/node/node-config.js +237 -0
  515. package/dist/engine/node/node-config.js.map +1 -0
  516. package/dist/engine/node/node-dashboard-source.d.ts +56 -0
  517. package/dist/engine/node/node-dashboard-source.d.ts.map +1 -0
  518. package/dist/engine/node/node-dashboard-source.js +213 -0
  519. package/dist/engine/node/node-dashboard-source.js.map +1 -0
  520. package/dist/engine/node/node-engine.d.ts +229 -0
  521. package/dist/engine/node/node-engine.d.ts.map +1 -0
  522. package/dist/engine/node/node-engine.js +723 -0
  523. package/dist/engine/node/node-engine.js.map +1 -0
  524. package/dist/engine/node/node-errors.d.ts +54 -0
  525. package/dist/engine/node/node-errors.d.ts.map +1 -0
  526. package/dist/engine/node/node-errors.js +71 -0
  527. package/dist/engine/node/node-errors.js.map +1 -0
  528. package/dist/engine/node/node-events.d.ts +132 -0
  529. package/dist/engine/node/node-events.d.ts.map +1 -0
  530. package/dist/engine/node/node-events.js +2 -0
  531. package/dist/engine/node/node-events.js.map +1 -0
  532. package/dist/engine/node/node-vitals.d.ts +123 -0
  533. package/dist/engine/node/node-vitals.d.ts.map +1 -0
  534. package/dist/engine/node/node-vitals.js +266 -0
  535. package/dist/engine/node/node-vitals.js.map +1 -0
  536. package/dist/engine/node/paths.d.ts +39 -0
  537. package/dist/engine/node/paths.d.ts.map +1 -0
  538. package/dist/engine/node/paths.js +60 -0
  539. package/dist/engine/node/paths.js.map +1 -0
  540. package/dist/engine/node/pg-dump.d.ts +126 -0
  541. package/dist/engine/node/pg-dump.d.ts.map +1 -0
  542. package/dist/engine/node/pg-dump.js +223 -0
  543. package/dist/engine/node/pg-dump.js.map +1 -0
  544. package/dist/engine/node/pidfile.d.ts +38 -0
  545. package/dist/engine/node/pidfile.d.ts.map +1 -0
  546. package/dist/engine/node/pidfile.js +156 -0
  547. package/dist/engine/node/pidfile.js.map +1 -0
  548. package/dist/engine/node/runtime-tuning.d.ts +65 -0
  549. package/dist/engine/node/runtime-tuning.d.ts.map +1 -0
  550. package/dist/engine/node/runtime-tuning.js +198 -0
  551. package/dist/engine/node/runtime-tuning.js.map +1 -0
  552. package/dist/engine/node/service.d.ts +39 -0
  553. package/dist/engine/node/service.d.ts.map +1 -0
  554. package/dist/engine/node/service.js +211 -0
  555. package/dist/engine/node/service.js.map +1 -0
  556. package/dist/engine/node/start.d.ts +62 -0
  557. package/dist/engine/node/start.d.ts.map +1 -0
  558. package/dist/engine/node/start.js +245 -0
  559. package/dist/engine/node/start.js.map +1 -0
  560. package/dist/engine/node/worker-env-table.d.ts +15 -0
  561. package/dist/engine/node/worker-env-table.d.ts.map +1 -0
  562. package/dist/engine/node/worker-env-table.js +97 -0
  563. package/dist/engine/node/worker-env-table.js.map +1 -0
  564. package/dist/engine/node/worker-env.d.ts +50 -0
  565. package/dist/engine/node/worker-env.d.ts.map +1 -0
  566. package/dist/engine/node/worker-env.js +101 -0
  567. package/dist/engine/node/worker-env.js.map +1 -0
  568. package/dist/engine/output.d.ts +97 -0
  569. package/dist/engine/output.d.ts.map +1 -0
  570. package/dist/engine/output.js +274 -0
  571. package/dist/engine/output.js.map +1 -0
  572. package/dist/engine/package-info.d.ts +7 -0
  573. package/dist/engine/package-info.d.ts.map +1 -0
  574. package/dist/engine/package-info.js +38 -0
  575. package/dist/engine/package-info.js.map +1 -0
  576. package/dist/engine/program.d.ts +50 -0
  577. package/dist/engine/program.d.ts.map +1 -0
  578. package/dist/engine/program.js +197 -0
  579. package/dist/engine/program.js.map +1 -0
  580. package/dist/engine/prompt.d.ts +69 -0
  581. package/dist/engine/prompt.d.ts.map +1 -0
  582. package/dist/engine/prompt.js +205 -0
  583. package/dist/engine/prompt.js.map +1 -0
  584. package/dist/engine/registries.d.ts +5 -0
  585. package/dist/engine/registries.d.ts.map +1 -0
  586. package/dist/engine/registries.js +52 -0
  587. package/dist/engine/registries.js.map +1 -0
  588. package/dist/engine/request-body.d.ts +31 -0
  589. package/dist/engine/request-body.d.ts.map +1 -0
  590. package/dist/engine/request-body.js +156 -0
  591. package/dist/engine/request-body.js.map +1 -0
  592. package/dist/engine/test-support.d.ts +50 -0
  593. package/dist/engine/test-support.d.ts.map +1 -0
  594. package/dist/engine/test-support.js +86 -0
  595. package/dist/engine/test-support.js.map +1 -0
  596. package/dist/engine/tui/app.d.ts +3 -0
  597. package/dist/engine/tui/app.d.ts.map +1 -0
  598. package/dist/engine/tui/app.js +100 -0
  599. package/dist/engine/tui/app.js.map +1 -0
  600. package/dist/engine/tui/builtin-screens.d.ts +6 -0
  601. package/dist/engine/tui/builtin-screens.d.ts.map +1 -0
  602. package/dist/engine/tui/builtin-screens.js +54 -0
  603. package/dist/engine/tui/builtin-screens.js.map +1 -0
  604. package/dist/engine/tui/index.d.ts +23 -0
  605. package/dist/engine/tui/index.d.ts.map +1 -0
  606. package/dist/engine/tui/index.js +71 -0
  607. package/dist/engine/tui/index.js.map +1 -0
  608. package/dist/engine/tui/layout.d.ts +132 -0
  609. package/dist/engine/tui/layout.d.ts.map +1 -0
  610. package/dist/engine/tui/layout.js +200 -0
  611. package/dist/engine/tui/layout.js.map +1 -0
  612. package/dist/engine/tui/routes.d.ts +5 -0
  613. package/dist/engine/tui/routes.d.ts.map +1 -0
  614. package/dist/engine/tui/routes.js +16 -0
  615. package/dist/engine/tui/routes.js.map +1 -0
  616. package/dist/engine/tui/screen-registry.d.ts +100 -0
  617. package/dist/engine/tui/screen-registry.d.ts.map +1 -0
  618. package/dist/engine/tui/screen-registry.js +96 -0
  619. package/dist/engine/tui/screen-registry.js.map +1 -0
  620. package/dist/engine/tui/screen-sections.d.ts +9 -0
  621. package/dist/engine/tui/screen-sections.d.ts.map +1 -0
  622. package/dist/engine/tui/screen-sections.js +45 -0
  623. package/dist/engine/tui/screen-sections.js.map +1 -0
  624. package/dist/engine/tui/screens/deploy/advanced-model.d.ts +69 -0
  625. package/dist/engine/tui/screens/deploy/advanced-model.d.ts.map +1 -0
  626. package/dist/engine/tui/screens/deploy/advanced-model.js +228 -0
  627. package/dist/engine/tui/screens/deploy/advanced-model.js.map +1 -0
  628. package/dist/engine/tui/screens/deploy/doctor-model.d.ts +37 -0
  629. package/dist/engine/tui/screens/deploy/doctor-model.d.ts.map +1 -0
  630. package/dist/engine/tui/screens/deploy/doctor-model.js +89 -0
  631. package/dist/engine/tui/screens/deploy/doctor-model.js.map +1 -0
  632. package/dist/engine/tui/screens/deploy/doctor.d.ts +8 -0
  633. package/dist/engine/tui/screens/deploy/doctor.d.ts.map +1 -0
  634. package/dist/engine/tui/screens/deploy/doctor.js +155 -0
  635. package/dist/engine/tui/screens/deploy/doctor.js.map +1 -0
  636. package/dist/engine/tui/screens/deploy/fields.d.ts +123 -0
  637. package/dist/engine/tui/screens/deploy/fields.d.ts.map +1 -0
  638. package/dist/engine/tui/screens/deploy/fields.js +202 -0
  639. package/dist/engine/tui/screens/deploy/fields.js.map +1 -0
  640. package/dist/engine/tui/screens/deploy/flags-model.d.ts +67 -0
  641. package/dist/engine/tui/screens/deploy/flags-model.d.ts.map +1 -0
  642. package/dist/engine/tui/screens/deploy/flags-model.js +302 -0
  643. package/dist/engine/tui/screens/deploy/flags-model.js.map +1 -0
  644. package/dist/engine/tui/screens/deploy/index.d.ts +6 -0
  645. package/dist/engine/tui/screens/deploy/index.d.ts.map +1 -0
  646. package/dist/engine/tui/screens/deploy/index.js +83 -0
  647. package/dist/engine/tui/screens/deploy/index.js.map +1 -0
  648. package/dist/engine/tui/screens/deploy/install-model.d.ts +159 -0
  649. package/dist/engine/tui/screens/deploy/install-model.d.ts.map +1 -0
  650. package/dist/engine/tui/screens/deploy/install-model.js +319 -0
  651. package/dist/engine/tui/screens/deploy/install-model.js.map +1 -0
  652. package/dist/engine/tui/screens/deploy/install.d.ts +8 -0
  653. package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -0
  654. package/dist/engine/tui/screens/deploy/install.js +361 -0
  655. package/dist/engine/tui/screens/deploy/install.js.map +1 -0
  656. package/dist/engine/tui/screens/deploy/model.d.ts +49 -0
  657. package/dist/engine/tui/screens/deploy/model.d.ts.map +1 -0
  658. package/dist/engine/tui/screens/deploy/model.js +59 -0
  659. package/dist/engine/tui/screens/deploy/model.js.map +1 -0
  660. package/dist/engine/tui/screens/deploy/run-model.d.ts +58 -0
  661. package/dist/engine/tui/screens/deploy/run-model.d.ts.map +1 -0
  662. package/dist/engine/tui/screens/deploy/run-model.js +117 -0
  663. package/dist/engine/tui/screens/deploy/run-model.js.map +1 -0
  664. package/dist/engine/tui/screens/deploy/run.d.ts +75 -0
  665. package/dist/engine/tui/screens/deploy/run.d.ts.map +1 -0
  666. package/dist/engine/tui/screens/deploy/run.js +201 -0
  667. package/dist/engine/tui/screens/deploy/run.js.map +1 -0
  668. package/dist/engine/tui/screens/deploy/status.d.ts +17 -0
  669. package/dist/engine/tui/screens/deploy/status.d.ts.map +1 -0
  670. package/dist/engine/tui/screens/deploy/status.js +107 -0
  671. package/dist/engine/tui/screens/deploy/status.js.map +1 -0
  672. package/dist/engine/tui/screens/deploy/update.d.ts +41 -0
  673. package/dist/engine/tui/screens/deploy/update.d.ts.map +1 -0
  674. package/dist/engine/tui/screens/deploy/update.js +175 -0
  675. package/dist/engine/tui/screens/deploy/update.js.map +1 -0
  676. package/dist/engine/tui/screens/deploy.d.ts +12 -0
  677. package/dist/engine/tui/screens/deploy.d.ts.map +1 -0
  678. package/dist/engine/tui/screens/deploy.js +23 -0
  679. package/dist/engine/tui/screens/deploy.js.map +1 -0
  680. package/dist/engine/tui/screens/invoke.d.ts +6 -0
  681. package/dist/engine/tui/screens/invoke.d.ts.map +1 -0
  682. package/dist/engine/tui/screens/invoke.js +193 -0
  683. package/dist/engine/tui/screens/invoke.js.map +1 -0
  684. package/dist/engine/tui/screens/login.d.ts +6 -0
  685. package/dist/engine/tui/screens/login.d.ts.map +1 -0
  686. package/dist/engine/tui/screens/login.js +255 -0
  687. package/dist/engine/tui/screens/login.js.map +1 -0
  688. package/dist/engine/tui/screens/logout.d.ts +6 -0
  689. package/dist/engine/tui/screens/logout.d.ts.map +1 -0
  690. package/dist/engine/tui/screens/logout.js +142 -0
  691. package/dist/engine/tui/screens/logout.js.map +1 -0
  692. package/dist/engine/tui/screens/menu.d.ts +22 -0
  693. package/dist/engine/tui/screens/menu.d.ts.map +1 -0
  694. package/dist/engine/tui/screens/menu.js +84 -0
  695. package/dist/engine/tui/screens/menu.js.map +1 -0
  696. package/dist/engine/tui/screens/node.d.ts +6 -0
  697. package/dist/engine/tui/screens/node.d.ts.map +1 -0
  698. package/dist/engine/tui/screens/node.js +228 -0
  699. package/dist/engine/tui/screens/node.js.map +1 -0
  700. package/dist/engine/tui/screens/status.d.ts +6 -0
  701. package/dist/engine/tui/screens/status.d.ts.map +1 -0
  702. package/dist/engine/tui/screens/status.js +134 -0
  703. package/dist/engine/tui/screens/status.js.map +1 -0
  704. package/dist/engine/tui/scroll-box.d.ts +27 -0
  705. package/dist/engine/tui/scroll-box.d.ts.map +1 -0
  706. package/dist/engine/tui/scroll-box.js +52 -0
  707. package/dist/engine/tui/scroll-box.js.map +1 -0
  708. package/dist/engine/tui/section-registry.d.ts +65 -0
  709. package/dist/engine/tui/section-registry.d.ts.map +1 -0
  710. package/dist/engine/tui/section-registry.js +90 -0
  711. package/dist/engine/tui/section-registry.js.map +1 -0
  712. package/dist/engine/tui/terminal.d.ts +31 -0
  713. package/dist/engine/tui/terminal.d.ts.map +1 -0
  714. package/dist/engine/tui/terminal.js +142 -0
  715. package/dist/engine/tui/terminal.js.map +1 -0
  716. package/dist/engine/tui/tty.d.ts +49 -0
  717. package/dist/engine/tui/tty.d.ts.map +1 -0
  718. package/dist/engine/tui/tty.js +139 -0
  719. package/dist/engine/tui/tty.js.map +1 -0
  720. package/dist/index.d.ts +10 -0
  721. package/dist/index.d.ts.map +1 -0
  722. package/dist/index.js +11 -0
  723. package/dist/index.js.map +1 -0
  724. package/dist/node/index.d.ts +3 -0
  725. package/dist/node/index.d.ts.map +1 -0
  726. package/dist/node/index.js +5 -0
  727. package/dist/node/index.js.map +1 -0
  728. package/dist/telemetry/env-fragment.d.ts +47 -0
  729. package/dist/telemetry/env-fragment.d.ts.map +1 -0
  730. package/dist/telemetry/env-fragment.js +73 -0
  731. package/dist/telemetry/env-fragment.js.map +1 -0
  732. package/dist/telemetry/index.d.ts +7 -0
  733. package/dist/telemetry/index.d.ts.map +1 -0
  734. package/dist/telemetry/index.js +7 -0
  735. package/dist/telemetry/index.js.map +1 -0
  736. package/dist/telemetry/node-span-relay.d.ts +107 -0
  737. package/dist/telemetry/node-span-relay.d.ts.map +1 -0
  738. package/dist/telemetry/node-span-relay.js +314 -0
  739. package/dist/telemetry/node-span-relay.js.map +1 -0
  740. package/dist/telemetry/node-span.d.ts +92 -0
  741. package/dist/telemetry/node-span.d.ts.map +1 -0
  742. package/dist/telemetry/node-span.js +28 -0
  743. package/dist/telemetry/node-span.js.map +1 -0
  744. package/dist/testing/index.d.ts +3 -0
  745. package/dist/testing/index.d.ts.map +1 -0
  746. package/dist/testing/index.js +4 -0
  747. package/dist/testing/index.js.map +1 -0
  748. package/dist/tui/index.d.ts +3 -0
  749. package/dist/tui/index.d.ts.map +1 -0
  750. package/dist/tui/index.js +5 -0
  751. package/dist/tui/index.js.map +1 -0
  752. package/package.json +102 -4
@@ -0,0 +1,48 @@
1
+ import type { DeploymentHistoryEntry, HostFacts } from './state.js';
2
+ /** The one value `schema` may hold. See rule 1 above. */
3
+ export declare const DEPLOY_INFO_SCHEMA_VERSION = 1;
4
+ export declare const DEPLOY_INFO_DIRNAME = "deploy-info";
5
+ export declare const DEPLOY_INFO_FILENAME = "info.json";
6
+ export interface DeployInfoInput {
7
+ name: string;
8
+ version?: string | undefined;
9
+ commitSha?: string | undefined;
10
+ ref?: string | undefined;
11
+ installedAt?: string | undefined;
12
+ updatedAt?: string | undefined;
13
+ cliVersion?: string | undefined;
14
+ domain?: string | undefined;
15
+ /** Step ids that completed, in order. */
16
+ completed?: readonly string[] | undefined;
17
+ failedStep?: string | undefined;
18
+ outcome?: 'success' | 'failure' | undefined;
19
+ /** Which command wrote this document (issue #392). */
20
+ lastCommand?: 'install' | 'update' | undefined;
21
+ /** Loopback port the proxy forwards to. */
22
+ bindPort?: number | undefined;
23
+ /** How the shared proxy publishes this deployment; absent means not known. */
24
+ proxy?: {
25
+ mode?: 'container' | 'host' | null | undefined;
26
+ container?: string | null | undefined;
27
+ certificateExpiresAt?: string | null | undefined;
28
+ } | undefined;
29
+ /** The host, as `collectHostFacts` observed it; absent means not known. */
30
+ host?: HostFacts | undefined;
31
+ /** The deployment state's own history -- the SAME entries, newest first. */
32
+ history?: readonly DeploymentHistoryEntry[] | undefined;
33
+ }
34
+ export declare function buildDeployInfo(input: DeployInfoInput): Record<string, unknown>;
35
+ export declare function deployInfoPath(deployRoot: string): string;
36
+ /**
37
+ * Writes the document atomically into the bind-mounted directory.
38
+ *
39
+ * ⚠ NEVER THROWS. This is BOOKKEEPING ABOUT a deployment, not the deployment:
40
+ * it runs after the API is answering, so a failure here must not fail a run
41
+ * that has already succeeded. The caller journals what came back.
42
+ */
43
+ export declare function writeDeployInfo(deployRoot: string, input: DeployInfoInput): {
44
+ written: boolean;
45
+ path: string;
46
+ error?: string | undefined;
47
+ };
48
+ //# sourceMappingURL=deploy-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-info.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/deploy-info.ts"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpE,yDAAyD;AACzD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,yCAAyC;IACzC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5C,sDAAsD;IACtD,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC/C,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,CAAC,EACF;QACE,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QAC/C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACtC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;KAClD,GACD,SAAS,CAAC;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,sBAAsB,EAAE,GAAG,SAAS,CAAC;CACzD;AAOD,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqE/E;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,eAAe,GACrB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAgBhE"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * `deploy-info/info.json` — the note this CLI leaves for the running application.
3
+ *
4
+ * =============================================================================
5
+ * ⚠ THE OTHER HALF OF THE ABOUT PAGE, AND IT WAS MISSING
6
+ * =============================================================================
7
+ *
8
+ * `apps/api/src/about/deploy-info.ts` reads this document, `vps.compose.yml`
9
+ * bind-mounts the directory read-only into the api container, and the Console's
10
+ * About page renders it. All three shipped. Nothing wrote the file — install
11
+ * created the DIRECTORY (so the bind mount would not be created root-owned by
12
+ * Docker) and stopped there. So the About page reported `absent` on every
13
+ * deployment, including ones this CLI had just deployed, and said so in copy
14
+ * carefully written not to assert a negative — which was the only reason it did
15
+ * not read as a lie.
16
+ *
17
+ * =============================================================================
18
+ * ⚠ WRITTEN AT THE HEALTH GATE, NOT AT THE END
19
+ * =============================================================================
20
+ *
21
+ * If the API is answering, the application demonstrably IS deployed, and this
22
+ * document should describe it. Writing it at the end of the pipeline means a
23
+ * failure in `publish` — between health and the end — leaves the About page
24
+ * reporting nothing at all about a deployment that is up and serving, which is
25
+ * exactly when somebody is looking at it.
26
+ *
27
+ * That is why `run` exists in the document: a run that got far enough to write
28
+ * this file did deploy something, and the page's third state — complete, but
29
+ * the run did not finish — is rendered from `run.outcome` plus `run.failedStep`.
30
+ *
31
+ * ⚠ AND REWRITTEN ONCE MORE AT THE END OF A SUCCESSFUL RUN (issue #392). The
32
+ * health-gate write cannot carry this run's `history` entry (history is
33
+ * success-only, and the run has not succeeded yet) nor the certificate
34
+ * `publish` has yet to issue. Install and update build both writes from one
35
+ * builder, so the second only ADDS what the run learned since; a run that fails
36
+ * after the health gate leaves the first write — with the prior history —
37
+ * standing, which is exactly the "complete, but did not finish" state.
38
+ *
39
+ * =============================================================================
40
+ * ⚠ THREE RULES THE READER DEPENDS ON
41
+ * =============================================================================
42
+ *
43
+ * 1. `schema` IS 1 AND DOES NOT MOVE. The reader validates it strictly and
44
+ * everything else leniently, precisely so new fields need no bump. A bump to
45
+ * add an optional field makes every already-deployed API answer `invalid`
46
+ * the instant a newer CLI writes its file — before the container it
47
+ * describes has necessarily restarted.
48
+ * 2. `null` IS THE IDIOM FOR KNOWN-TO-BE-ABSENT. Never omit a key to mean "I do
49
+ * not know"; the reader turns a missing value into `null` anyway, and an
50
+ * explicit one says a human decided rather than that a writer forgot.
51
+ * 3. THE WRITE IS ATOMIC, and the DIRECTORY is what is mounted, not the file.
52
+ * A rename over an existing path gives the container the new document with
53
+ * no restart; bind-mounting the file itself would pin an inode and leave the
54
+ * container reading the old one for ever.
55
+ */
56
+ import { renameSync, unlinkSync, writeFileSync } from 'node:fs';
57
+ import { join } from 'node:path';
58
+ import { cliName } from '../identity.js';
59
+ /** The one value `schema` may hold. See rule 1 above. */
60
+ export const DEPLOY_INFO_SCHEMA_VERSION = 1;
61
+ export const DEPLOY_INFO_DIRNAME = 'deploy-info';
62
+ export const DEPLOY_INFO_FILENAME = 'info.json';
63
+ /** `undefined` becomes `null`; see rule 2. */
64
+ function orNull(value) {
65
+ return value === undefined ? null : value;
66
+ }
67
+ export function buildDeployInfo(input) {
68
+ return {
69
+ schema: DEPLOY_INFO_SCHEMA_VERSION,
70
+ app: {
71
+ name: input.name,
72
+ version: orNull(input.version),
73
+ commitSha: orNull(input.commitSha),
74
+ ref: orNull(input.ref),
75
+ },
76
+ installedAt: orNull(input.installedAt),
77
+ updatedAt: orNull(input.updatedAt),
78
+ deployedBy: {
79
+ cli: cliName(),
80
+ version: orNull(input.cliVersion),
81
+ },
82
+ domain: orNull(input.domain),
83
+ // ⚠ `null`, NOT a fabricated zero. This CLI does not ask the remote how far
84
+ // ahead it is at deploy time, and "0 commits behind" is a claim, not an
85
+ // absence. The reader renders null as "not known", which is true.
86
+ remote: null,
87
+ run: {
88
+ completed: [...(input.completed ?? [])],
89
+ failedStep: orNull(input.failedStep),
90
+ // A document written at the health gate describes a deployment that is
91
+ // answering. `success` here means the steps up to this point succeeded;
92
+ // a later failure rewrites it with the failed step named.
93
+ outcome: orNull(input.outcome) ?? 'success',
94
+ },
95
+ // ⚠ ISSUE #392's ADDITIVE FIELDS. `schema` stays 1 (rule 1), every key is
96
+ // ALWAYS written (rule 2), and each object is rebuilt key by key rather
97
+ // than spread, so the document's shape is exactly the contract's and a
98
+ // field added to an internal type can never leak into it. The shared
99
+ // fixture `packages/platform-api/test/fixtures/deploy-info.sample.json` pins that shape
100
+ // from both sides.
101
+ lastCommand: orNull(input.lastCommand),
102
+ bindPort: orNull(input.bindPort),
103
+ proxy: input.proxy === undefined
104
+ ? null
105
+ : {
106
+ mode: orNull(input.proxy.mode),
107
+ container: orNull(input.proxy.container),
108
+ certificateExpiresAt: orNull(input.proxy.certificateExpiresAt),
109
+ },
110
+ host: input.host === undefined
111
+ ? null
112
+ : {
113
+ hostname: input.host.hostname,
114
+ os: input.host.os,
115
+ kernel: input.host.kernel,
116
+ arch: input.host.arch,
117
+ cpus: input.host.cpus,
118
+ memoryBytes: input.host.memoryBytes,
119
+ dockerVersion: input.host.dockerVersion,
120
+ composeVersion: input.host.composeVersion,
121
+ capturedAt: input.host.capturedAt,
122
+ },
123
+ history: (input.history ?? []).map((entry) => ({
124
+ at: entry.at,
125
+ command: entry.command,
126
+ commitSha: entry.commitSha,
127
+ previousCommitSha: entry.previousCommitSha,
128
+ ref: entry.ref,
129
+ durationMs: entry.durationMs,
130
+ cliVersion: entry.cliVersion,
131
+ outcome: entry.outcome,
132
+ })),
133
+ };
134
+ }
135
+ export function deployInfoPath(deployRoot) {
136
+ return join(deployRoot, DEPLOY_INFO_DIRNAME, DEPLOY_INFO_FILENAME);
137
+ }
138
+ /**
139
+ * Writes the document atomically into the bind-mounted directory.
140
+ *
141
+ * ⚠ NEVER THROWS. This is BOOKKEEPING ABOUT a deployment, not the deployment:
142
+ * it runs after the API is answering, so a failure here must not fail a run
143
+ * that has already succeeded. The caller journals what came back.
144
+ */
145
+ export function writeDeployInfo(deployRoot, input) {
146
+ const path = deployInfoPath(deployRoot);
147
+ const temporary = `${path}.tmp`;
148
+ try {
149
+ writeFileSync(temporary, `${JSON.stringify(buildDeployInfo(input), null, 2)}\n`);
150
+ renameSync(temporary, path);
151
+ return { written: true, path };
152
+ }
153
+ catch (error) {
154
+ try {
155
+ unlinkSync(temporary);
156
+ }
157
+ catch {
158
+ // It may never have been created. Nothing to report.
159
+ }
160
+ return { written: false, path, error: error.message };
161
+ }
162
+ }
163
+ //# sourceMappingURL=deploy-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-info.js","sourceRoot":"","sources":["../../../src/engine/deploy/deploy-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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,KAAe,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC;AACH,CAAC"}
@@ -0,0 +1,38 @@
1
+ /** Where a deployment's configuration lives under the current layout. */
2
+ export declare function envPathFor(deployRoot: string): string;
3
+ /**
4
+ * Where a deployment installed by an earlier CLI keeps its configuration.
5
+ *
6
+ * Deployments in the field have `.env` inside the checkout, at
7
+ * `repo/infra/compose/.env`, because that is where compose reads it from and
8
+ * nothing had yet moved it out. They are real deployments and must be
9
+ * recognised as such; refusing them would re-create the failure this module
10
+ * exists to remove, on every server already running.
11
+ */
12
+ export declare function legacyEnvPathFor(deployRoot: string): string;
13
+ /** A git checkout, by the one marker that does not require running git. */
14
+ export declare function hasGitCheckout(repoPath: string): boolean;
15
+ /** Readable, and a file rather than a directory. */
16
+ export declare function hasReadableEnvFile(deployRoot: string): boolean;
17
+ /**
18
+ * The `.env` this deployment actually uses, current layout preferred.
19
+ *
20
+ * Returns `undefined` when there is none. A caller that needs to know WHICH of
21
+ * the two it found - the migration in `install` does - gets it from the path.
22
+ */
23
+ export declare function resolveEnvPath(deployRoot: string): string | undefined;
24
+ /**
25
+ * THE predicate. Both, and only these two.
26
+ *
27
+ * Each is something the CLI creates and the pipeline needs, and neither is
28
+ * inferable from the other.
29
+ */
30
+ export declare function isDeployment(deployRoot: string): boolean;
31
+ /** Why a directory is not a deployment, for an operator-facing message. */
32
+ export declare function describeEvidence(deployRoot: string): {
33
+ isDeployment: boolean;
34
+ hasCheckout: boolean;
35
+ hasEnv: boolean;
36
+ envPath: string | undefined;
37
+ };
38
+ //# sourceMappingURL=deployment-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-evidence.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/deployment-evidence.ts"],"names":[],"mappings":"AA8BA,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASrE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG;IACpD,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAUA"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * What makes a directory a deployment.
3
+ *
4
+ * \> A deployment is a clone, an `.env`, and running containers. It is NOT a
5
+ * \> record in a file.
6
+ *
7
+ * This module exists because that sentence was not true of the code. `update`
8
+ * asked whether the CLI's own bookkeeping was present, not whether a
9
+ * DEPLOYMENT was: a directory with a clone at the right revision, an `.env`,
10
+ * running containers, an issued certificate and a serving site could not be
11
+ * updated because a JSON file was missing. The operator was told there was no
12
+ * deployment while standing in one, and pointed at `install`, whose
13
+ * precondition is the opposite.
14
+ *
15
+ * ⚠ RUNNING CONTAINERS ARE DELIBERATELY EXCLUDED from the predicate, despite
16
+ * the sentence above. A deployment whose containers are stopped or wedged is
17
+ * PRECISELY the one being updated or repaired, and consulting Docker would put
18
+ * a subprocess on a path that must keep working when the daemon is down.
19
+ *
20
+ * ⚠ THE STATE FILE IS DELIBERATELY EXCLUDED. That is the whole lesson.
21
+ *
22
+ * ⚠ Both adoption and enumeration MUST import from here. When they each had
23
+ * their own idea of what a deployment was, fixing one left a bare `update`
24
+ * never reaching the other - so the adoption path was unreachable in exactly
25
+ * the case it existed for. `deployment-evidence.test.ts` asserts the two
26
+ * callers use the same function.
27
+ */
28
+ import { existsSync, statSync } from 'node:fs';
29
+ import { join } from 'node:path';
30
+ /** Where a deployment's configuration lives under the current layout. */
31
+ export function envPathFor(deployRoot) {
32
+ return join(deployRoot, '.env');
33
+ }
34
+ /**
35
+ * Where a deployment installed by an earlier CLI keeps its configuration.
36
+ *
37
+ * Deployments in the field have `.env` inside the checkout, at
38
+ * `repo/infra/compose/.env`, because that is where compose reads it from and
39
+ * nothing had yet moved it out. They are real deployments and must be
40
+ * recognised as such; refusing them would re-create the failure this module
41
+ * exists to remove, on every server already running.
42
+ */
43
+ export function legacyEnvPathFor(deployRoot) {
44
+ return join(deployRoot, 'repo', 'infra', 'compose', '.env');
45
+ }
46
+ /** A git checkout, by the one marker that does not require running git. */
47
+ export function hasGitCheckout(repoPath) {
48
+ return existsSync(join(repoPath, '.git'));
49
+ }
50
+ /** Readable, and a file rather than a directory. */
51
+ export function hasReadableEnvFile(deployRoot) {
52
+ return resolveEnvPath(deployRoot) !== undefined;
53
+ }
54
+ /**
55
+ * The `.env` this deployment actually uses, current layout preferred.
56
+ *
57
+ * Returns `undefined` when there is none. A caller that needs to know WHICH of
58
+ * the two it found - the migration in `install` does - gets it from the path.
59
+ */
60
+ export function resolveEnvPath(deployRoot) {
61
+ for (const candidate of [envPathFor(deployRoot), legacyEnvPathFor(deployRoot)]) {
62
+ try {
63
+ if (statSync(candidate).isFile())
64
+ return candidate;
65
+ }
66
+ catch {
67
+ // Absent, or unreadable by this user. Either way it is not the file.
68
+ }
69
+ }
70
+ return undefined;
71
+ }
72
+ /**
73
+ * THE predicate. Both, and only these two.
74
+ *
75
+ * Each is something the CLI creates and the pipeline needs, and neither is
76
+ * inferable from the other.
77
+ */
78
+ export function isDeployment(deployRoot) {
79
+ return hasGitCheckout(join(deployRoot, 'repo')) && hasReadableEnvFile(deployRoot);
80
+ }
81
+ /** Why a directory is not a deployment, for an operator-facing message. */
82
+ export function describeEvidence(deployRoot) {
83
+ const hasCheckout = hasGitCheckout(join(deployRoot, 'repo'));
84
+ const envPath = resolveEnvPath(deployRoot);
85
+ return {
86
+ isDeployment: hasCheckout && envPath !== undefined,
87
+ hasCheckout,
88
+ hasEnv: envPath !== undefined,
89
+ envPath,
90
+ };
91
+ }
92
+ //# sourceMappingURL=deployment-evidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-evidence.js","sourceRoot":"","sources":["../../../src/engine/deploy/deployment-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAC,UAAkB;IAC3C,OAAO,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO,cAAc,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,KAAK,MAAM,SAAS,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAC/E,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE;gBAAE,OAAO,SAAS,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,qEAAqE;QACvE,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AACpF,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IAMjD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAE3C,OAAO;QACL,YAAY,EAAE,WAAW,IAAI,OAAO,KAAK,SAAS;QAClD,WAAW;QACX,MAAM,EAAE,OAAO,KAAK,SAAS;QAC7B,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * One config file: where the checkout holds it, where the container reads it.
3
+ *
4
+ * @stability experimental
5
+ */
6
+ export interface EdgeConfigFile {
7
+ /** Relative to the checkout root. */
8
+ checkout: string;
9
+ /** Absolute, inside the nginx container. */
10
+ container: string;
11
+ }
12
+ /** Must match the nginx service's `volumes:` in infra/compose/base.compose.yml. */
13
+ export declare const EDGE_CONFIG_FILES: readonly EdgeConfigFile[];
14
+ /**
15
+ * Adds a single-file bind mount of the app's nginx to the stale-inode check
16
+ * `deploy update` runs: the file is hashed in the checkout and inside the
17
+ * nginx container, and the container is recreated once when they differ.
18
+ *
19
+ * Only SINGLE-FILE mounts need this. A directory mount (`app.d/`) follows a
20
+ * rename and never goes stale.
21
+ *
22
+ * @param file - Where the checkout holds the file (relative) and where the container reads it (absolute).
23
+ * @throws UsageError on a path that is not plain, or one the platform already checks.
24
+ * @throws Error on a duplicate container path, or after `createCli` built the CLI.
25
+ * @stability experimental
26
+ * @extensionPoint registry
27
+ * @example
28
+ * ```ts
29
+ * registerEdgeConfigFile({ checkout: 'infra/nginx/ssl-extra.conf', container: '/etc/nginx/ssl-extra.conf' });
30
+ * ```
31
+ */
32
+ export declare function registerEdgeConfigFile(file: EdgeConfigFile): void;
33
+ /**
34
+ * The platform's edge config files followed by the app's registered ones.
35
+ *
36
+ * @returns The files `deploy update` compares, in order.
37
+ * @stability experimental
38
+ */
39
+ export declare function edgeConfigFiles(): readonly EdgeConfigFile[];
40
+ /** Refuses later registrations; `createCli` calls it. */
41
+ export declare function freezeEdgeConfigRegistry(by: string): void;
42
+ /** Empties the registry. Tests only. */
43
+ export declare function resetEdgeConfigRegistryForTests(): void;
44
+ /** The sha256 of a file's bytes, lowercase hex -- what `sha256sum` prints. */
45
+ export declare function sha256OfFile(path: string): string;
46
+ /**
47
+ * The checkout's hashes, keyed by the CONTAINER path they are mounted at.
48
+ *
49
+ * A file the checkout does not have is left out rather than failing: a fork
50
+ * that dropped csp.conf also dropped its mount, and there is nothing to
51
+ * compare. The caller decides what an empty map means.
52
+ */
53
+ export declare function checkoutEdgeHashes(checkoutPath: string, files?: readonly EdgeConfigFile[]): Map<string, string>;
54
+ /**
55
+ * Parses `sha256sum` output into path -\> hash.
56
+ *
57
+ * Tolerant on purpose: GNU prints `<hash> <path>`, busybox (nginx:alpine) the
58
+ * same, and binary mode puts a `*` before the path. Anything that is not a
59
+ * hash line -- an error that reached stdout, compose's own chatter, a blank
60
+ * line -- is ignored rather than trusted; a path missing from the result is
61
+ * treated as "differs" by `compareEdgeConfig`, which is the safe direction.
62
+ */
63
+ export declare function parseSha256sum(stdout: string): Map<string, string>;
64
+ export interface EdgeConfigDrift {
65
+ /** The container path. */
66
+ file: string;
67
+ expected: string;
68
+ /** Undefined when the container did not report the file at all. */
69
+ running: string | undefined;
70
+ }
71
+ /** Every file whose running hash is not the checkout's; empty means current. */
72
+ export declare function compareEdgeConfig(expected: ReadonlyMap<string, string>, running: ReadonlyMap<string, string>): EdgeConfigDrift[];
73
+ /** One line per drifted file, short hashes, for the journal and the error. */
74
+ export declare function describeDrift(drift: readonly EdgeConfigDrift[]): string;
75
+ /** What reading the container's hashes produced. */
76
+ export interface RunningRead {
77
+ hashes: Map<string, string>;
78
+ /** Set when the read itself failed -- typically nginx is not running. */
79
+ error?: string | undefined;
80
+ }
81
+ export interface ReconcileEdgeConfigOptions {
82
+ checkoutPath: string;
83
+ files?: readonly EdgeConfigFile[] | undefined;
84
+ /** Reads the running container's hashes. Never throws; reports `error`. */
85
+ readRunning: () => Promise<RunningRead>;
86
+ /** Recreates the nginx container. */
87
+ recreate: () => Promise<void>;
88
+ /** The command an operator can run by hand; quoted in the failure. */
89
+ manualCommand: string;
90
+ line: (text: string) => void;
91
+ /** A notice worth surfacing beyond the journal (the recreate). */
92
+ notice?: ((text: string) => void) | undefined;
93
+ }
94
+ export type ReconcileOutcome = 'current' | 'recreated' | 'nothing-to-check';
95
+ /**
96
+ * Compare, recreate at most ONCE, compare again, and refuse if still stale.
97
+ *
98
+ * One recreate, not a loop: if a fresh container still reads the wrong bytes,
99
+ * the cause is not a stale inode (a wrong mount, a compose file this CLI does
100
+ * not know about, an override) and repeating the recreate would only hide it.
101
+ */
102
+ export declare function reconcileEdgeConfig(options: ReconcileEdgeConfigOptions): Promise<ReconcileOutcome>;
103
+ //# sourceMappingURL=edge-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-config.d.ts","sourceRoot":"","sources":["../../../src/engine/deploy/edge-config.ts"],"names":[],"mappings":"AAmCA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAGtD,CAAC;AAq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ED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IAC9C,2EAA2E;IAC3E,WAAW,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACxC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAE5E;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,gBAAgB,CAAC,CAoC3B"}
@@ -0,0 +1,170 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { createCliRegistry } from '../../core/index.js';
5
+ import { UsageError } from '../errors.js';
6
+ /** Must match the nginx service's `volumes:` in infra/compose/base.compose.yml. */
7
+ export const EDGE_CONFIG_FILES = [
8
+ { checkout: 'infra/nginx/nginx.conf', container: '/etc/nginx/nginx.conf' },
9
+ { checkout: 'infra/nginx/csp.conf', container: '/etc/nginx/csp.conf' },
10
+ ];
11
+ // An app that mounts ANOTHER single file into nginx (an overlay mounting its
12
+ // own `ssl.conf` or `maps.conf`) gets the stale-inode bug described above,
13
+ // unchecked, because the list is the platform's two files. `registerEdgeConfigFile`
14
+ // adds the app's file to the same comparison: hashed in the checkout and in the
15
+ // container on every update, the container recreated when they differ.
16
+ /** Container paths are handed to `sha256sum` as argv (no shell), but stay plain anyway. */
17
+ const CONTAINER_PATH = /^\/[A-Za-z0-9._+/-]+$/;
18
+ /** Checkout paths are relative, inside the checkout. */
19
+ const CHECKOUT_PATH = /^[A-Za-z0-9._+-][A-Za-z0-9._+/-]*$/;
20
+ const registry = createCliRegistry({
21
+ name: 'edge config file',
22
+ registerFn: 'registerEdgeConfigFile',
23
+ idOf: (file) => file.container,
24
+ validate: (file) => {
25
+ if (typeof file?.container !== 'string' || !CONTAINER_PATH.test(file.container) || file.container.includes('//')) {
26
+ throw new UsageError(`Edge config container path ${JSON.stringify(file?.container)} must be an absolute path of plain characters.`);
27
+ }
28
+ if (typeof file.checkout !== 'string' ||
29
+ !CHECKOUT_PATH.test(file.checkout) ||
30
+ file.checkout.split('/').includes('..') ||
31
+ file.checkout.includes('//')) {
32
+ throw new UsageError(`Edge config checkout path ${JSON.stringify(file.checkout)} must be relative to the checkout root, without ".." segments.`);
33
+ }
34
+ if (EDGE_CONFIG_FILES.some((builtin) => builtin.container === file.container)) {
35
+ throw new UsageError(`${file.container} is already checked by the platform.`);
36
+ }
37
+ },
38
+ });
39
+ /**
40
+ * Adds a single-file bind mount of the app's nginx to the stale-inode check
41
+ * `deploy update` runs: the file is hashed in the checkout and inside the
42
+ * nginx container, and the container is recreated once when they differ.
43
+ *
44
+ * Only SINGLE-FILE mounts need this. A directory mount (`app.d/`) follows a
45
+ * rename and never goes stale.
46
+ *
47
+ * @param file - Where the checkout holds the file (relative) and where the container reads it (absolute).
48
+ * @throws UsageError on a path that is not plain, or one the platform already checks.
49
+ * @throws Error on a duplicate container path, or after `createCli` built the CLI.
50
+ * @stability experimental
51
+ * @extensionPoint registry
52
+ * @example
53
+ * ```ts
54
+ * registerEdgeConfigFile({ checkout: 'infra/nginx/ssl-extra.conf', container: '/etc/nginx/ssl-extra.conf' });
55
+ * ```
56
+ */
57
+ export function registerEdgeConfigFile(file) {
58
+ registry.register(Object.freeze({ checkout: file.checkout, container: file.container }));
59
+ }
60
+ /**
61
+ * The platform's edge config files followed by the app's registered ones.
62
+ *
63
+ * @returns The files `deploy update` compares, in order.
64
+ * @stability experimental
65
+ */
66
+ export function edgeConfigFiles() {
67
+ const registered = registry.list();
68
+ return registered.length === 0 ? EDGE_CONFIG_FILES : [...EDGE_CONFIG_FILES, ...registered];
69
+ }
70
+ /** Refuses later registrations; `createCli` calls it. */
71
+ export function freezeEdgeConfigRegistry(by) {
72
+ registry.freeze(by);
73
+ }
74
+ /** Empties the registry. Tests only. */
75
+ export function resetEdgeConfigRegistryForTests() {
76
+ registry.reset();
77
+ }
78
+ /** The sha256 of a file's bytes, lowercase hex -- what `sha256sum` prints. */
79
+ export function sha256OfFile(path) {
80
+ return createHash('sha256').update(readFileSync(path)).digest('hex');
81
+ }
82
+ /**
83
+ * The checkout's hashes, keyed by the CONTAINER path they are mounted at.
84
+ *
85
+ * A file the checkout does not have is left out rather than failing: a fork
86
+ * that dropped csp.conf also dropped its mount, and there is nothing to
87
+ * compare. The caller decides what an empty map means.
88
+ */
89
+ export function checkoutEdgeHashes(checkoutPath, files = edgeConfigFiles()) {
90
+ const hashes = new Map();
91
+ for (const file of files) {
92
+ const path = join(checkoutPath, file.checkout);
93
+ if (existsSync(path))
94
+ hashes.set(file.container, sha256OfFile(path));
95
+ }
96
+ return hashes;
97
+ }
98
+ const SHA256_LINE = /^([0-9a-fA-F]{64})\s+\*?(.+?)\s*$/;
99
+ /**
100
+ * Parses `sha256sum` output into path -\> hash.
101
+ *
102
+ * Tolerant on purpose: GNU prints `<hash> <path>`, busybox (nginx:alpine) the
103
+ * same, and binary mode puts a `*` before the path. Anything that is not a
104
+ * hash line -- an error that reached stdout, compose's own chatter, a blank
105
+ * line -- is ignored rather than trusted; a path missing from the result is
106
+ * treated as "differs" by `compareEdgeConfig`, which is the safe direction.
107
+ */
108
+ export function parseSha256sum(stdout) {
109
+ const hashes = new Map();
110
+ for (const raw of stdout.split(/\r?\n/)) {
111
+ const match = SHA256_LINE.exec(raw.trim());
112
+ if (match === null)
113
+ continue;
114
+ hashes.set(match[2], match[1].toLowerCase());
115
+ }
116
+ return hashes;
117
+ }
118
+ /** Every file whose running hash is not the checkout's; empty means current. */
119
+ export function compareEdgeConfig(expected, running) {
120
+ const drift = [];
121
+ for (const [file, hash] of expected) {
122
+ const actual = running.get(file);
123
+ if (actual !== hash)
124
+ drift.push({ file, expected: hash, running: actual });
125
+ }
126
+ return drift;
127
+ }
128
+ /** One line per drifted file, short hashes, for the journal and the error. */
129
+ export function describeDrift(drift) {
130
+ return drift
131
+ .map((entry) => `${entry.file}: checkout ${entry.expected.slice(0, 12)}, running ${entry.running === undefined ? 'unreadable' : entry.running.slice(0, 12)}`)
132
+ .join('; ');
133
+ }
134
+ /**
135
+ * Compare, recreate at most ONCE, compare again, and refuse if still stale.
136
+ *
137
+ * One recreate, not a loop: if a fresh container still reads the wrong bytes,
138
+ * the cause is not a stale inode (a wrong mount, a compose file this CLI does
139
+ * not know about, an override) and repeating the recreate would only hide it.
140
+ */
141
+ export async function reconcileEdgeConfig(options) {
142
+ const expected = checkoutEdgeHashes(options.checkoutPath, options.files);
143
+ if (expected.size === 0) {
144
+ options.line('No nginx config in the checkout; nothing to compare.');
145
+ return 'nothing-to-check';
146
+ }
147
+ const first = await options.readRunning();
148
+ const drift = compareEdgeConfig(expected, first.hashes);
149
+ if (drift.length === 0) {
150
+ options.line(`nginx config is current (${[...expected.keys()].join(', ')}).`);
151
+ return 'current';
152
+ }
153
+ options.line(first.error === undefined
154
+ ? `nginx is serving a stale config: ${describeDrift(drift)}`
155
+ : `Could not read nginx's config (${first.error}); recreating it.`);
156
+ options.notice?.('nginx config drifted from the checkout; recreating nginx');
157
+ await options.recreate();
158
+ const second = await options.readRunning();
159
+ const remaining = compareEdgeConfig(expected, second.hashes);
160
+ if (remaining.length === 0) {
161
+ options.line('nginx recreated; its config now matches the checkout.');
162
+ return 'recreated';
163
+ }
164
+ throw new Error(`nginx still serves a config that differs from the checkout after being recreated: ` +
165
+ `${describeDrift(remaining)}` +
166
+ (second.error === undefined ? '' : ` (${second.error})`) +
167
+ `. The running site is serving an OLD config (headers, CSP, routing). ` +
168
+ `Recreate nginx by hand and check its mounts: ${options.manualCommand}`);
169
+ }
170
+ //# sourceMappingURL=edge-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-config.js","sourceRoot":"","sources":["../../../src/engine/deploy/edge-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0C1C,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,uBAAuB,EAAE;IAC1E,EAAE,QAAQ,EAAE,sBAAsB,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACvE,CAAC;AAEF,6EAA6E;AAC7E,2EAA2E;AAC3E,oFAAoF;AACpF,gFAAgF;AAChF,uEAAuE;AAEvE,2FAA2F;AAC3F,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAC/C,wDAAwD;AACxD,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAE3D,MAAM,QAAQ,GAAG,iBAAiB,CAAiB;IACjD,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,wBAAwB;IACpC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,IAAI,OAAO,IAAI,EAAE,SAAS,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CA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