@marinoscar/platform-cli 0.1.0-next.3 → 0.1.0-next.31

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 (943) hide show
  1. package/CHANGELOG.md +365 -0
  2. package/README.md +163 -31
  3. package/dist/android/build.d.ts +30 -0
  4. package/dist/android/build.d.ts.map +1 -0
  5. package/dist/android/build.js +126 -0
  6. package/dist/android/build.js.map +1 -0
  7. package/dist/android/command.d.ts +21 -0
  8. package/dist/android/command.d.ts.map +1 -0
  9. package/dist/android/command.js +355 -0
  10. package/dist/android/command.js.map +1 -0
  11. package/dist/android/deploy-step.d.ts +85 -0
  12. package/dist/android/deploy-step.d.ts.map +1 -0
  13. package/dist/android/deploy-step.js +268 -0
  14. package/dist/android/deploy-step.js.map +1 -0
  15. package/dist/android/doctor.d.ts +47 -0
  16. package/dist/android/doctor.d.ts.map +1 -0
  17. package/dist/android/doctor.js +219 -0
  18. package/dist/android/doctor.js.map +1 -0
  19. package/dist/android/exec.d.ts +42 -0
  20. package/dist/android/exec.d.ts.map +1 -0
  21. package/dist/android/exec.js +103 -0
  22. package/dist/android/exec.js.map +1 -0
  23. package/dist/android/fix-plan.d.ts +44 -0
  24. package/dist/android/fix-plan.d.ts.map +1 -0
  25. package/dist/android/fix-plan.js +86 -0
  26. package/dist/android/fix-plan.js.map +1 -0
  27. package/dist/android/git-freshness.d.ts +34 -0
  28. package/dist/android/git-freshness.d.ts.map +1 -0
  29. package/dist/android/git-freshness.js +120 -0
  30. package/dist/android/git-freshness.js.map +1 -0
  31. package/dist/android/gradle.d.ts +32 -0
  32. package/dist/android/gradle.d.ts.map +1 -0
  33. package/dist/android/gradle.js +55 -0
  34. package/dist/android/gradle.js.map +1 -0
  35. package/dist/android/identity.d.ts +27 -0
  36. package/dist/android/identity.d.ts.map +1 -0
  37. package/dist/android/identity.js +60 -0
  38. package/dist/android/identity.js.map +1 -0
  39. package/dist/android/index.d.ts +7 -0
  40. package/dist/android/index.d.ts.map +1 -0
  41. package/dist/android/index.js +8 -0
  42. package/dist/android/index.js.map +1 -0
  43. package/dist/android/installer.d.ts +28 -0
  44. package/dist/android/installer.d.ts.map +1 -0
  45. package/dist/android/installer.js +96 -0
  46. package/dist/android/installer.js.map +1 -0
  47. package/dist/android/java.d.ts +26 -0
  48. package/dist/android/java.d.ts.map +1 -0
  49. package/dist/android/java.js +65 -0
  50. package/dist/android/java.js.map +1 -0
  51. package/dist/android/keystore.d.ts +54 -0
  52. package/dist/android/keystore.d.ts.map +1 -0
  53. package/dist/android/keystore.js +159 -0
  54. package/dist/android/keystore.js.map +1 -0
  55. package/dist/android/metadata.d.ts +39 -0
  56. package/dist/android/metadata.d.ts.map +1 -0
  57. package/dist/android/metadata.js +61 -0
  58. package/dist/android/metadata.js.map +1 -0
  59. package/dist/android/operations.d.ts +42 -0
  60. package/dist/android/operations.d.ts.map +1 -0
  61. package/dist/android/operations.js +59 -0
  62. package/dist/android/operations.js.map +1 -0
  63. package/dist/android/paths.d.ts +29 -0
  64. package/dist/android/paths.d.ts.map +1 -0
  65. package/dist/android/paths.js +97 -0
  66. package/dist/android/paths.js.map +1 -0
  67. package/dist/android/publish.d.ts +37 -0
  68. package/dist/android/publish.d.ts.map +1 -0
  69. package/dist/android/publish.js +119 -0
  70. package/dist/android/publish.js.map +1 -0
  71. package/dist/android/registrations.d.ts +92 -0
  72. package/dist/android/registrations.d.ts.map +1 -0
  73. package/dist/android/registrations.js +112 -0
  74. package/dist/android/registrations.js.map +1 -0
  75. package/dist/android/release-status.d.ts +73 -0
  76. package/dist/android/release-status.d.ts.map +1 -0
  77. package/dist/android/release-status.js +161 -0
  78. package/dist/android/release-status.js.map +1 -0
  79. package/dist/android/release.d.ts +33 -0
  80. package/dist/android/release.d.ts.map +1 -0
  81. package/dist/android/release.js +59 -0
  82. package/dist/android/release.js.map +1 -0
  83. package/dist/android/screen-layout.d.ts +26 -0
  84. package/dist/android/screen-layout.d.ts.map +1 -0
  85. package/dist/android/screen-layout.js +24 -0
  86. package/dist/android/screen-layout.js.map +1 -0
  87. package/dist/android/screen-model.d.ts +56 -0
  88. package/dist/android/screen-model.d.ts.map +1 -0
  89. package/dist/android/screen-model.js +207 -0
  90. package/dist/android/screen-model.js.map +1 -0
  91. package/dist/android/screen.d.ts +8 -0
  92. package/dist/android/screen.d.ts.map +1 -0
  93. package/dist/android/screen.js +395 -0
  94. package/dist/android/screen.js.map +1 -0
  95. package/dist/android/sdk.d.ts +48 -0
  96. package/dist/android/sdk.d.ts.map +1 -0
  97. package/dist/android/sdk.js +82 -0
  98. package/dist/android/sdk.js.map +1 -0
  99. package/dist/android/server-url.d.ts +19 -0
  100. package/dist/android/server-url.d.ts.map +1 -0
  101. package/dist/android/server-url.js +36 -0
  102. package/dist/android/server-url.js.map +1 -0
  103. package/dist/android/upload-progress.d.ts +3 -0
  104. package/dist/android/upload-progress.d.ts.map +1 -0
  105. package/dist/android/upload-progress.js +47 -0
  106. package/dist/android/upload-progress.js.map +1 -0
  107. package/dist/android/version.d.ts +47 -0
  108. package/dist/android/version.d.ts.map +1 -0
  109. package/dist/android/version.js +136 -0
  110. package/dist/android/version.js.map +1 -0
  111. package/dist/api-client/index.d.ts +3 -0
  112. package/dist/api-client/index.d.ts.map +1 -0
  113. package/dist/api-client/index.js +5 -0
  114. package/dist/api-client/index.js.map +1 -0
  115. package/dist/commands/index.d.ts +52 -0
  116. package/dist/commands/index.d.ts.map +1 -0
  117. package/dist/commands/index.js +63 -0
  118. package/dist/commands/index.js.map +1 -0
  119. package/dist/core/cli-registry.d.ts +41 -0
  120. package/dist/core/cli-registry.d.ts.map +1 -0
  121. package/dist/core/cli-registry.js +49 -0
  122. package/dist/core/cli-registry.js.map +1 -0
  123. package/dist/core/command-registry.d.ts +10 -0
  124. package/dist/core/command-registry.d.ts.map +1 -1
  125. package/dist/core/command-registry.js +17 -0
  126. package/dist/core/command-registry.js.map +1 -1
  127. package/dist/core/env-annotation-registry.d.ts +58 -0
  128. package/dist/core/env-annotation-registry.d.ts.map +1 -0
  129. package/dist/core/env-annotation-registry.js +80 -0
  130. package/dist/core/env-annotation-registry.js.map +1 -0
  131. package/dist/core/env-generator-registry.d.ts +59 -0
  132. package/dist/core/env-generator-registry.d.ts.map +1 -0
  133. package/dist/core/env-generator-registry.js +102 -0
  134. package/dist/core/env-generator-registry.js.map +1 -0
  135. package/dist/core/env-group-registry.d.ts +65 -0
  136. package/dist/core/env-group-registry.d.ts.map +1 -0
  137. package/dist/core/env-group-registry.js +77 -0
  138. package/dist/core/env-group-registry.js.map +1 -0
  139. package/dist/core/env-spec-registry.d.ts +16 -2
  140. package/dist/core/env-spec-registry.d.ts.map +1 -1
  141. package/dist/core/env-spec-registry.js +15 -0
  142. package/dist/core/env-spec-registry.js.map +1 -1
  143. package/dist/core/env-values.d.ts +3 -2
  144. package/dist/core/env-values.d.ts.map +1 -1
  145. package/dist/core/env-values.js +5 -3
  146. package/dist/core/env-values.js.map +1 -1
  147. package/dist/core/index.d.ts +10 -2
  148. package/dist/core/index.d.ts.map +1 -1
  149. package/dist/core/index.js +6 -2
  150. package/dist/core/index.js.map +1 -1
  151. package/dist/deploy/index.d.ts +3 -0
  152. package/dist/deploy/index.d.ts.map +1 -0
  153. package/dist/deploy/index.js +5 -0
  154. package/dist/deploy/index.js.map +1 -0
  155. package/dist/engine/api-client.d.ts +211 -0
  156. package/dist/engine/api-client.d.ts.map +1 -0
  157. package/dist/engine/api-client.js +350 -0
  158. package/dist/engine/api-client.js.map +1 -0
  159. package/dist/engine/browser.d.ts +18 -0
  160. package/dist/engine/browser.d.ts.map +1 -0
  161. package/dist/engine/browser.js +115 -0
  162. package/dist/engine/browser.js.map +1 -0
  163. package/dist/engine/builtin-registrations.d.ts +20 -0
  164. package/dist/engine/builtin-registrations.d.ts.map +1 -0
  165. package/dist/engine/builtin-registrations.js +86 -0
  166. package/dist/engine/builtin-registrations.js.map +1 -0
  167. package/dist/engine/commands/api.d.ts +88 -0
  168. package/dist/engine/commands/api.d.ts.map +1 -0
  169. package/dist/engine/commands/api.js +398 -0
  170. package/dist/engine/commands/api.js.map +1 -0
  171. package/dist/engine/commands/config.d.ts +5 -0
  172. package/dist/engine/commands/config.d.ts.map +1 -0
  173. package/dist/engine/commands/config.js +83 -0
  174. package/dist/engine/commands/config.js.map +1 -0
  175. package/dist/engine/commands/deploy.d.ts +250 -0
  176. package/dist/engine/commands/deploy.d.ts.map +1 -0
  177. package/dist/engine/commands/deploy.js +1186 -0
  178. package/dist/engine/commands/deploy.js.map +1 -0
  179. package/dist/engine/commands/init.d.ts +18 -0
  180. package/dist/engine/commands/init.d.ts.map +1 -0
  181. package/dist/engine/commands/init.js +50 -0
  182. package/dist/engine/commands/init.js.map +1 -0
  183. package/dist/engine/commands/login.d.ts +4 -0
  184. package/dist/engine/commands/login.d.ts.map +1 -0
  185. package/dist/engine/commands/login.js +205 -0
  186. package/dist/engine/commands/login.js.map +1 -0
  187. package/dist/engine/commands/node.d.ts +21 -0
  188. package/dist/engine/commands/node.d.ts.map +1 -0
  189. package/dist/engine/commands/node.js +503 -0
  190. package/dist/engine/commands/node.js.map +1 -0
  191. package/dist/engine/config.d.ts +284 -0
  192. package/dist/engine/config.d.ts.map +1 -0
  193. package/dist/engine/config.js +469 -0
  194. package/dist/engine/config.js.map +1 -0
  195. package/dist/engine/conformance.d.ts +193 -0
  196. package/dist/engine/conformance.d.ts.map +1 -0
  197. package/dist/engine/conformance.js +243 -0
  198. package/dist/engine/conformance.js.map +1 -0
  199. package/dist/engine/create-cli.d.ts +181 -0
  200. package/dist/engine/create-cli.d.ts.map +1 -0
  201. package/dist/engine/create-cli.js +91 -0
  202. package/dist/engine/create-cli.js.map +1 -0
  203. package/dist/engine/deploy/about.d.ts +12 -0
  204. package/dist/engine/deploy/about.d.ts.map +1 -0
  205. package/dist/engine/deploy/about.js +110 -0
  206. package/dist/engine/deploy/about.js.map +1 -0
  207. package/dist/engine/deploy/adopt.d.ts +21 -0
  208. package/dist/engine/deploy/adopt.d.ts.map +1 -0
  209. package/dist/engine/deploy/adopt.js +78 -0
  210. package/dist/engine/deploy/adopt.js.map +1 -0
  211. package/dist/engine/deploy/answers-file.d.ts +7 -0
  212. package/dist/engine/deploy/answers-file.d.ts.map +1 -0
  213. package/dist/engine/deploy/answers-file.js +49 -0
  214. package/dist/engine/deploy/answers-file.js.map +1 -0
  215. package/dist/engine/deploy/app-role.d.ts +278 -0
  216. package/dist/engine/deploy/app-role.d.ts.map +1 -0
  217. package/dist/engine/deploy/app-role.js +826 -0
  218. package/dist/engine/deploy/app-role.js.map +1 -0
  219. package/dist/engine/deploy/app-version.d.ts +103 -0
  220. package/dist/engine/deploy/app-version.d.ts.map +1 -0
  221. package/dist/engine/deploy/app-version.js +344 -0
  222. package/dist/engine/deploy/app-version.js.map +1 -0
  223. package/dist/engine/deploy/checks/compose.d.ts +16 -0
  224. package/dist/engine/deploy/checks/compose.d.ts.map +1 -0
  225. package/dist/engine/deploy/checks/compose.js +149 -0
  226. package/dist/engine/deploy/checks/compose.js.map +1 -0
  227. package/dist/engine/deploy/checks/database.d.ts +83 -0
  228. package/dist/engine/deploy/checks/database.d.ts.map +1 -0
  229. package/dist/engine/deploy/checks/database.js +455 -0
  230. package/dist/engine/deploy/checks/database.js.map +1 -0
  231. package/dist/engine/deploy/checks/dns.d.ts +3 -0
  232. package/dist/engine/deploy/checks/dns.d.ts.map +1 -0
  233. package/dist/engine/deploy/checks/dns.js +85 -0
  234. package/dist/engine/deploy/checks/dns.js.map +1 -0
  235. package/dist/engine/deploy/checks/host.d.ts +19 -0
  236. package/dist/engine/deploy/checks/host.d.ts.map +1 -0
  237. package/dist/engine/deploy/checks/host.js +543 -0
  238. package/dist/engine/deploy/checks/host.js.map +1 -0
  239. package/dist/engine/deploy/checks/index.d.ts +35 -0
  240. package/dist/engine/deploy/checks/index.d.ts.map +1 -0
  241. package/dist/engine/deploy/checks/index.js +75 -0
  242. package/dist/engine/deploy/checks/index.js.map +1 -0
  243. package/dist/engine/deploy/checks/registry.d.ts +110 -0
  244. package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
  245. package/dist/engine/deploy/checks/registry.js +104 -0
  246. package/dist/engine/deploy/checks/registry.js.map +1 -0
  247. package/dist/engine/deploy/checks/source.d.ts +45 -0
  248. package/dist/engine/deploy/checks/source.d.ts.map +1 -0
  249. package/dist/engine/deploy/checks/source.js +175 -0
  250. package/dist/engine/deploy/checks/source.js.map +1 -0
  251. package/dist/engine/deploy/checks/stack-ports.d.ts +4 -0
  252. package/dist/engine/deploy/checks/stack-ports.d.ts.map +1 -0
  253. package/dist/engine/deploy/checks/stack-ports.js +261 -0
  254. package/dist/engine/deploy/checks/stack-ports.js.map +1 -0
  255. package/dist/engine/deploy/checks/tls.d.ts +87 -0
  256. package/dist/engine/deploy/checks/tls.d.ts.map +1 -0
  257. package/dist/engine/deploy/checks/tls.js +552 -0
  258. package/dist/engine/deploy/checks/tls.js.map +1 -0
  259. package/dist/engine/deploy/checks/types.d.ts +202 -0
  260. package/dist/engine/deploy/checks/types.d.ts.map +1 -0
  261. package/dist/engine/deploy/checks/types.js +199 -0
  262. package/dist/engine/deploy/checks/types.js.map +1 -0
  263. package/dist/engine/deploy/compose-command.d.ts +16 -0
  264. package/dist/engine/deploy/compose-command.d.ts.map +1 -0
  265. package/dist/engine/deploy/compose-command.js +40 -0
  266. package/dist/engine/deploy/compose-command.js.map +1 -0
  267. package/dist/engine/deploy/compose-containers.d.ts +101 -0
  268. package/dist/engine/deploy/compose-containers.d.ts.map +1 -0
  269. package/dist/engine/deploy/compose-containers.js +191 -0
  270. package/dist/engine/deploy/compose-containers.js.map +1 -0
  271. package/dist/engine/deploy/compose-files.d.ts +29 -0
  272. package/dist/engine/deploy/compose-files.d.ts.map +1 -0
  273. package/dist/engine/deploy/compose-files.js +118 -0
  274. package/dist/engine/deploy/compose-files.js.map +1 -0
  275. package/dist/engine/deploy/compose-hints.d.ts +11 -0
  276. package/dist/engine/deploy/compose-hints.d.ts.map +1 -0
  277. package/dist/engine/deploy/compose-hints.js +70 -0
  278. package/dist/engine/deploy/compose-hints.js.map +1 -0
  279. package/dist/engine/deploy/compose-port-variables.d.ts +58 -0
  280. package/dist/engine/deploy/compose-port-variables.d.ts.map +1 -0
  281. package/dist/engine/deploy/compose-port-variables.js +184 -0
  282. package/dist/engine/deploy/compose-port-variables.js.map +1 -0
  283. package/dist/engine/deploy/compose-ports.d.ts +98 -0
  284. package/dist/engine/deploy/compose-ports.d.ts.map +1 -0
  285. package/dist/engine/deploy/compose-ports.js +204 -0
  286. package/dist/engine/deploy/compose-ports.js.map +1 -0
  287. package/dist/engine/deploy/compose-project.d.ts +113 -0
  288. package/dist/engine/deploy/compose-project.d.ts.map +1 -0
  289. package/dist/engine/deploy/compose-project.js +177 -0
  290. package/dist/engine/deploy/compose-project.js.map +1 -0
  291. package/dist/engine/deploy/consent.d.ts +29 -0
  292. package/dist/engine/deploy/consent.d.ts.map +1 -0
  293. package/dist/engine/deploy/consent.js +35 -0
  294. package/dist/engine/deploy/consent.js.map +1 -0
  295. package/dist/engine/deploy/database-drop.d.ts +22 -0
  296. package/dist/engine/deploy/database-drop.d.ts.map +1 -0
  297. package/dist/engine/deploy/database-drop.js +135 -0
  298. package/dist/engine/deploy/database-drop.js.map +1 -0
  299. package/dist/engine/deploy/database.d.ts +116 -0
  300. package/dist/engine/deploy/database.d.ts.map +1 -0
  301. package/dist/engine/deploy/database.js +252 -0
  302. package/dist/engine/deploy/database.js.map +1 -0
  303. package/dist/engine/deploy/deploy-info.d.ts +48 -0
  304. package/dist/engine/deploy/deploy-info.d.ts.map +1 -0
  305. package/dist/engine/deploy/deploy-info.js +163 -0
  306. package/dist/engine/deploy/deploy-info.js.map +1 -0
  307. package/dist/engine/deploy/deployment-evidence.d.ts +38 -0
  308. package/dist/engine/deploy/deployment-evidence.d.ts.map +1 -0
  309. package/dist/engine/deploy/deployment-evidence.js +92 -0
  310. package/dist/engine/deploy/deployment-evidence.js.map +1 -0
  311. package/dist/engine/deploy/edge-config.d.ts +103 -0
  312. package/dist/engine/deploy/edge-config.d.ts.map +1 -0
  313. package/dist/engine/deploy/edge-config.js +170 -0
  314. package/dist/engine/deploy/edge-config.js.map +1 -0
  315. package/dist/engine/deploy/env-absence.d.ts +61 -0
  316. package/dist/engine/deploy/env-absence.d.ts.map +1 -0
  317. package/dist/engine/deploy/env-absence.js +33 -0
  318. package/dist/engine/deploy/env-absence.js.map +1 -0
  319. package/dist/engine/deploy/env-file.d.ts +14 -0
  320. package/dist/engine/deploy/env-file.d.ts.map +1 -0
  321. package/dist/engine/deploy/env-file.js +58 -0
  322. package/dist/engine/deploy/env-file.js.map +1 -0
  323. package/dist/engine/deploy/env-fragments.d.ts +29 -0
  324. package/dist/engine/deploy/env-fragments.d.ts.map +1 -0
  325. package/dist/engine/deploy/env-fragments.js +73 -0
  326. package/dist/engine/deploy/env-fragments.js.map +1 -0
  327. package/dist/engine/deploy/env-metadata.d.ts +73 -0
  328. package/dist/engine/deploy/env-metadata.d.ts.map +1 -0
  329. package/dist/engine/deploy/env-metadata.js +227 -0
  330. package/dist/engine/deploy/env-metadata.js.map +1 -0
  331. package/dist/engine/deploy/env-spec.d.ts +75 -0
  332. package/dist/engine/deploy/env-spec.d.ts.map +1 -0
  333. package/dist/engine/deploy/env-spec.js +239 -0
  334. package/dist/engine/deploy/env-spec.js.map +1 -0
  335. package/dist/engine/deploy/env-wizard.d.ts +56 -0
  336. package/dist/engine/deploy/env-wizard.d.ts.map +1 -0
  337. package/dist/engine/deploy/env-wizard.js +235 -0
  338. package/dist/engine/deploy/env-wizard.js.map +1 -0
  339. package/dist/engine/deploy/executor.d.ts +81 -0
  340. package/dist/engine/deploy/executor.d.ts.map +1 -0
  341. package/dist/engine/deploy/executor.js +247 -0
  342. package/dist/engine/deploy/executor.js.map +1 -0
  343. package/dist/engine/deploy/free-ports.d.ts +145 -0
  344. package/dist/engine/deploy/free-ports.d.ts.map +1 -0
  345. package/dist/engine/deploy/free-ports.js +235 -0
  346. package/dist/engine/deploy/free-ports.js.map +1 -0
  347. package/dist/engine/deploy/health.d.ts +153 -0
  348. package/dist/engine/deploy/health.d.ts.map +1 -0
  349. package/dist/engine/deploy/health.js +335 -0
  350. package/dist/engine/deploy/health.js.map +1 -0
  351. package/dist/engine/deploy/hooks.d.ts +66 -0
  352. package/dist/engine/deploy/hooks.d.ts.map +1 -0
  353. package/dist/engine/deploy/hooks.js +19 -0
  354. package/dist/engine/deploy/hooks.js.map +1 -0
  355. package/dist/engine/deploy/host-facts.d.ts +23 -0
  356. package/dist/engine/deploy/host-facts.d.ts.map +1 -0
  357. package/dist/engine/deploy/host-facts.js +67 -0
  358. package/dist/engine/deploy/host-facts.js.map +1 -0
  359. package/dist/engine/deploy/install.d.ts +239 -0
  360. package/dist/engine/deploy/install.d.ts.map +1 -0
  361. package/dist/engine/deploy/install.js +1474 -0
  362. package/dist/engine/deploy/install.js.map +1 -0
  363. package/dist/engine/deploy/inventory.d.ts +30 -0
  364. package/dist/engine/deploy/inventory.d.ts.map +1 -0
  365. package/dist/engine/deploy/inventory.js +122 -0
  366. package/dist/engine/deploy/inventory.js.map +1 -0
  367. package/dist/engine/deploy/journal.d.ts +77 -0
  368. package/dist/engine/deploy/journal.d.ts.map +1 -0
  369. package/dist/engine/deploy/journal.js +221 -0
  370. package/dist/engine/deploy/journal.js.map +1 -0
  371. package/dist/engine/deploy/layout.d.ts +77 -0
  372. package/dist/engine/deploy/layout.d.ts.map +1 -0
  373. package/dist/engine/deploy/layout.js +191 -0
  374. package/dist/engine/deploy/layout.js.map +1 -0
  375. package/dist/engine/deploy/oauth-check.d.ts +58 -0
  376. package/dist/engine/deploy/oauth-check.d.ts.map +1 -0
  377. package/dist/engine/deploy/oauth-check.js +213 -0
  378. package/dist/engine/deploy/oauth-check.js.map +1 -0
  379. package/dist/engine/deploy/proxy-bootstrap.d.ts +149 -0
  380. package/dist/engine/deploy/proxy-bootstrap.d.ts.map +1 -0
  381. package/dist/engine/deploy/proxy-bootstrap.js +416 -0
  382. package/dist/engine/deploy/proxy-bootstrap.js.map +1 -0
  383. package/dist/engine/deploy/proxy-streams.d.ts +110 -0
  384. package/dist/engine/deploy/proxy-streams.d.ts.map +1 -0
  385. package/dist/engine/deploy/proxy-streams.js +208 -0
  386. package/dist/engine/deploy/proxy-streams.js.map +1 -0
  387. package/dist/engine/deploy/proxy.d.ts +375 -0
  388. package/dist/engine/deploy/proxy.d.ts.map +1 -0
  389. package/dist/engine/deploy/proxy.js +758 -0
  390. package/dist/engine/deploy/proxy.js.map +1 -0
  391. package/dist/engine/deploy/renewal.d.ts +54 -0
  392. package/dist/engine/deploy/renewal.d.ts.map +1 -0
  393. package/dist/engine/deploy/renewal.js +169 -0
  394. package/dist/engine/deploy/renewal.js.map +1 -0
  395. package/dist/engine/deploy/repo.d.ts +119 -0
  396. package/dist/engine/deploy/repo.d.ts.map +1 -0
  397. package/dist/engine/deploy/repo.js +282 -0
  398. package/dist/engine/deploy/repo.js.map +1 -0
  399. package/dist/engine/deploy/run-record.d.ts +28 -0
  400. package/dist/engine/deploy/run-record.d.ts.map +1 -0
  401. package/dist/engine/deploy/run-record.js +44 -0
  402. package/dist/engine/deploy/run-record.js.map +1 -0
  403. package/dist/engine/deploy/stack-ports-gate.d.ts +19 -0
  404. package/dist/engine/deploy/stack-ports-gate.d.ts.map +1 -0
  405. package/dist/engine/deploy/stack-ports-gate.js +54 -0
  406. package/dist/engine/deploy/stack-ports-gate.js.map +1 -0
  407. package/dist/engine/deploy/state.d.ts +289 -0
  408. package/dist/engine/deploy/state.d.ts.map +1 -0
  409. package/dist/engine/deploy/state.js +163 -0
  410. package/dist/engine/deploy/state.js.map +1 -0
  411. package/dist/engine/deploy/steps/app-step-context.d.ts +24 -0
  412. package/dist/engine/deploy/steps/app-step-context.d.ts.map +1 -0
  413. package/dist/engine/deploy/steps/app-step-context.js +45 -0
  414. package/dist/engine/deploy/steps/app-step-context.js.map +1 -0
  415. package/dist/engine/deploy/steps/pipeline.d.ts +46 -0
  416. package/dist/engine/deploy/steps/pipeline.d.ts.map +1 -0
  417. package/dist/engine/deploy/steps/pipeline.js +73 -0
  418. package/dist/engine/deploy/steps/pipeline.js.map +1 -0
  419. package/dist/engine/deploy/steps/plan.d.ts +28 -0
  420. package/dist/engine/deploy/steps/plan.d.ts.map +1 -0
  421. package/dist/engine/deploy/steps/plan.js +32 -0
  422. package/dist/engine/deploy/steps/plan.js.map +1 -0
  423. package/dist/engine/deploy/steps/registry.d.ts +182 -0
  424. package/dist/engine/deploy/steps/registry.d.ts.map +1 -0
  425. package/dist/engine/deploy/steps/registry.js +214 -0
  426. package/dist/engine/deploy/steps/registry.js.map +1 -0
  427. package/dist/engine/deploy/steps/step-values.d.ts +28 -0
  428. package/dist/engine/deploy/steps/step-values.d.ts.map +1 -0
  429. package/dist/engine/deploy/steps/step-values.js +33 -0
  430. package/dist/engine/deploy/steps/step-values.js.map +1 -0
  431. package/dist/engine/deploy/testing/fake-containers.d.ts +29 -0
  432. package/dist/engine/deploy/testing/fake-containers.d.ts.map +1 -0
  433. package/dist/engine/deploy/testing/fake-containers.js +32 -0
  434. package/dist/engine/deploy/testing/fake-containers.js.map +1 -0
  435. package/dist/engine/deploy/testing/fake-postgres.d.ts +88 -0
  436. package/dist/engine/deploy/testing/fake-postgres.d.ts.map +1 -0
  437. package/dist/engine/deploy/testing/fake-postgres.js +236 -0
  438. package/dist/engine/deploy/testing/fake-postgres.js.map +1 -0
  439. package/dist/engine/deploy/testing/fake-vps.d.ts +147 -0
  440. package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -0
  441. package/dist/engine/deploy/testing/fake-vps.js +371 -0
  442. package/dist/engine/deploy/testing/fake-vps.js.map +1 -0
  443. package/dist/engine/deploy/uninstall.d.ts +87 -0
  444. package/dist/engine/deploy/uninstall.d.ts.map +1 -0
  445. package/dist/engine/deploy/uninstall.js +321 -0
  446. package/dist/engine/deploy/uninstall.js.map +1 -0
  447. package/dist/engine/deploy/update.d.ts +114 -0
  448. package/dist/engine/deploy/update.d.ts.map +1 -0
  449. package/dist/engine/deploy/update.js +1385 -0
  450. package/dist/engine/deploy/update.js.map +1 -0
  451. package/dist/engine/deploy/version-step.d.ts +74 -0
  452. package/dist/engine/deploy/version-step.d.ts.map +1 -0
  453. package/dist/engine/deploy/version-step.js +177 -0
  454. package/dist/engine/deploy/version-step.js.map +1 -0
  455. package/dist/engine/device-auth.d.ts +240 -0
  456. package/dist/engine/device-auth.d.ts.map +1 -0
  457. package/dist/engine/device-auth.js +442 -0
  458. package/dist/engine/device-auth.js.map +1 -0
  459. package/dist/engine/device-login.d.ts +126 -0
  460. package/dist/engine/device-login.d.ts.map +1 -0
  461. package/dist/engine/device-login.js +164 -0
  462. package/dist/engine/device-login.js.map +1 -0
  463. package/dist/engine/errors.d.ts +314 -0
  464. package/dist/engine/errors.d.ts.map +1 -0
  465. package/dist/engine/errors.js +561 -0
  466. package/dist/engine/errors.js.map +1 -0
  467. package/dist/engine/github-raw-manifest.d.ts +59 -0
  468. package/dist/engine/github-raw-manifest.d.ts.map +1 -0
  469. package/dist/engine/github-raw-manifest.js +197 -0
  470. package/dist/engine/github-raw-manifest.js.map +1 -0
  471. package/dist/engine/identity.d.ts +169 -0
  472. package/dist/engine/identity.d.ts.map +1 -0
  473. package/dist/engine/identity.js +227 -0
  474. package/dist/engine/identity.js.map +1 -0
  475. package/dist/engine/index.d.ts +141 -0
  476. package/dist/engine/index.d.ts.map +1 -0
  477. package/dist/engine/index.js +147 -0
  478. package/dist/engine/index.js.map +1 -0
  479. package/dist/engine/init/local-profile.d.ts +93 -0
  480. package/dist/engine/init/local-profile.d.ts.map +1 -0
  481. package/dist/engine/init/local-profile.js +295 -0
  482. package/dist/engine/init/local-profile.js.map +1 -0
  483. package/dist/engine/init/run-init.d.ts +41 -0
  484. package/dist/engine/init/run-init.d.ts.map +1 -0
  485. package/dist/engine/init/run-init.js +297 -0
  486. package/dist/engine/init/run-init.js.map +1 -0
  487. package/dist/engine/node/capabilities.d.ts +433 -0
  488. package/dist/engine/node/capabilities.d.ts.map +1 -0
  489. package/dist/engine/node/capabilities.js +597 -0
  490. package/dist/engine/node/capabilities.js.map +1 -0
  491. package/dist/engine/node/daemon-channels.d.ts +66 -0
  492. package/dist/engine/node/daemon-channels.d.ts.map +1 -0
  493. package/dist/engine/node/daemon-channels.js +65 -0
  494. package/dist/engine/node/daemon-channels.js.map +1 -0
  495. package/dist/engine/node/daemon.d.ts +63 -0
  496. package/dist/engine/node/daemon.d.ts.map +1 -0
  497. package/dist/engine/node/daemon.js +279 -0
  498. package/dist/engine/node/daemon.js.map +1 -0
  499. package/dist/engine/node/doctor.d.ts +60 -0
  500. package/dist/engine/node/doctor.d.ts.map +1 -0
  501. package/dist/engine/node/doctor.js +447 -0
  502. package/dist/engine/node/doctor.js.map +1 -0
  503. package/dist/engine/node/enrollment.d.ts +98 -0
  504. package/dist/engine/node/enrollment.d.ts.map +1 -0
  505. package/dist/engine/node/enrollment.js +189 -0
  506. package/dist/engine/node/enrollment.js.map +1 -0
  507. package/dist/engine/node/env-flags.d.ts +5 -0
  508. package/dist/engine/node/env-flags.d.ts.map +1 -0
  509. package/dist/engine/node/env-flags.js +22 -0
  510. package/dist/engine/node/env-flags.js.map +1 -0
  511. package/dist/engine/node/executors/credential-hygiene.d.ts +63 -0
  512. package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -0
  513. package/dist/engine/node/executors/credential-hygiene.js +210 -0
  514. package/dist/engine/node/executors/credential-hygiene.js.map +1 -0
  515. package/dist/engine/node/executors/db-backup-run.d.ts +73 -0
  516. package/dist/engine/node/executors/db-backup-run.d.ts.map +1 -0
  517. package/dist/engine/node/executors/db-backup-run.js +362 -0
  518. package/dist/engine/node/executors/db-backup-run.js.map +1 -0
  519. package/dist/engine/node/executors/example-checksum.d.ts +30 -0
  520. package/dist/engine/node/executors/example-checksum.d.ts.map +1 -0
  521. package/dist/engine/node/executors/example-checksum.js +56 -0
  522. package/dist/engine/node/executors/example-checksum.js.map +1 -0
  523. package/dist/engine/node/executors/index.d.ts +213 -0
  524. package/dist/engine/node/executors/index.d.ts.map +1 -0
  525. package/dist/engine/node/executors/index.js +58 -0
  526. package/dist/engine/node/executors/index.js.map +1 -0
  527. package/dist/engine/node/executors/registry.d.ts +38 -0
  528. package/dist/engine/node/executors/registry.d.ts.map +1 -0
  529. package/dist/engine/node/executors/registry.js +103 -0
  530. package/dist/engine/node/executors/registry.js.map +1 -0
  531. package/dist/engine/node/heap-snapshot.d.ts +37 -0
  532. package/dist/engine/node/heap-snapshot.d.ts.map +1 -0
  533. package/dist/engine/node/heap-snapshot.js +160 -0
  534. package/dist/engine/node/heap-snapshot.js.map +1 -0
  535. package/dist/engine/node/host-telemetry.d.ts +38 -0
  536. package/dist/engine/node/host-telemetry.d.ts.map +1 -0
  537. package/dist/engine/node/host-telemetry.js +39 -0
  538. package/dist/engine/node/host-telemetry.js.map +1 -0
  539. package/dist/engine/node/host-vitals.d.ts +51 -0
  540. package/dist/engine/node/host-vitals.d.ts.map +1 -0
  541. package/dist/engine/node/host-vitals.js +117 -0
  542. package/dist/engine/node/host-vitals.js.map +1 -0
  543. package/dist/engine/node/install-deps.d.ts +231 -0
  544. package/dist/engine/node/install-deps.d.ts.map +1 -0
  545. package/dist/engine/node/install-deps.js +392 -0
  546. package/dist/engine/node/install-deps.js.map +1 -0
  547. package/dist/engine/node/ipc-protocol.d.ts +114 -0
  548. package/dist/engine/node/ipc-protocol.d.ts.map +1 -0
  549. package/dist/engine/node/ipc-protocol.js +122 -0
  550. package/dist/engine/node/ipc-protocol.js.map +1 -0
  551. package/dist/engine/node/lifecycle.d.ts +103 -0
  552. package/dist/engine/node/lifecycle.d.ts.map +1 -0
  553. package/dist/engine/node/lifecycle.js +260 -0
  554. package/dist/engine/node/lifecycle.js.map +1 -0
  555. package/dist/engine/node/logger.d.ts +95 -0
  556. package/dist/engine/node/logger.d.ts.map +1 -0
  557. package/dist/engine/node/logger.js +241 -0
  558. package/dist/engine/node/logger.js.map +1 -0
  559. package/dist/engine/node/memory-watchdog.d.ts +89 -0
  560. package/dist/engine/node/memory-watchdog.d.ts.map +1 -0
  561. package/dist/engine/node/memory-watchdog.js +248 -0
  562. package/dist/engine/node/memory-watchdog.js.map +1 -0
  563. package/dist/engine/node/models.d.ts +195 -0
  564. package/dist/engine/node/models.d.ts.map +1 -0
  565. package/dist/engine/node/models.js +379 -0
  566. package/dist/engine/node/models.js.map +1 -0
  567. package/dist/engine/node/node-api.d.ts +439 -0
  568. package/dist/engine/node/node-api.d.ts.map +1 -0
  569. package/dist/engine/node/node-api.js +125 -0
  570. package/dist/engine/node/node-api.js.map +1 -0
  571. package/dist/engine/node/node-config.d.ts +128 -0
  572. package/dist/engine/node/node-config.d.ts.map +1 -0
  573. package/dist/engine/node/node-config.js +237 -0
  574. package/dist/engine/node/node-config.js.map +1 -0
  575. package/dist/engine/node/node-dashboard-source.d.ts +83 -0
  576. package/dist/engine/node/node-dashboard-source.d.ts.map +1 -0
  577. package/dist/engine/node/node-dashboard-source.js +181 -0
  578. package/dist/engine/node/node-dashboard-source.js.map +1 -0
  579. package/dist/engine/node/node-engine.d.ts +282 -0
  580. package/dist/engine/node/node-engine.d.ts.map +1 -0
  581. package/dist/engine/node/node-engine.js +925 -0
  582. package/dist/engine/node/node-engine.js.map +1 -0
  583. package/dist/engine/node/node-errors.d.ts +54 -0
  584. package/dist/engine/node/node-errors.d.ts.map +1 -0
  585. package/dist/engine/node/node-errors.js +71 -0
  586. package/dist/engine/node/node-errors.js.map +1 -0
  587. package/dist/engine/node/node-events-queue.d.ts +27 -0
  588. package/dist/engine/node/node-events-queue.d.ts.map +1 -0
  589. package/dist/engine/node/node-events-queue.js +46 -0
  590. package/dist/engine/node/node-events-queue.js.map +1 -0
  591. package/dist/engine/node/node-events.d.ts +132 -0
  592. package/dist/engine/node/node-events.d.ts.map +1 -0
  593. package/dist/engine/node/node-events.js +2 -0
  594. package/dist/engine/node/node-events.js.map +1 -0
  595. package/dist/engine/node/node-vitals.d.ts +123 -0
  596. package/dist/engine/node/node-vitals.d.ts.map +1 -0
  597. package/dist/engine/node/node-vitals.js +266 -0
  598. package/dist/engine/node/node-vitals.js.map +1 -0
  599. package/dist/engine/node/paths.d.ts +39 -0
  600. package/dist/engine/node/paths.d.ts.map +1 -0
  601. package/dist/engine/node/paths.js +60 -0
  602. package/dist/engine/node/paths.js.map +1 -0
  603. package/dist/engine/node/pg-dump.d.ts +126 -0
  604. package/dist/engine/node/pg-dump.d.ts.map +1 -0
  605. package/dist/engine/node/pg-dump.js +223 -0
  606. package/dist/engine/node/pg-dump.js.map +1 -0
  607. package/dist/engine/node/pidfile.d.ts +38 -0
  608. package/dist/engine/node/pidfile.d.ts.map +1 -0
  609. package/dist/engine/node/pidfile.js +156 -0
  610. package/dist/engine/node/pidfile.js.map +1 -0
  611. package/dist/engine/node/power-probe.d.ts +59 -0
  612. package/dist/engine/node/power-probe.d.ts.map +1 -0
  613. package/dist/engine/node/power-probe.js +240 -0
  614. package/dist/engine/node/power-probe.js.map +1 -0
  615. package/dist/engine/node/power-watcher.d.ts +30 -0
  616. package/dist/engine/node/power-watcher.d.ts.map +1 -0
  617. package/dist/engine/node/power-watcher.js +116 -0
  618. package/dist/engine/node/power-watcher.js.map +1 -0
  619. package/dist/engine/node/runtime-state.d.ts +24 -0
  620. package/dist/engine/node/runtime-state.d.ts.map +1 -0
  621. package/dist/engine/node/runtime-state.js +19 -0
  622. package/dist/engine/node/runtime-state.js.map +1 -0
  623. package/dist/engine/node/runtime-tuning.d.ts +174 -0
  624. package/dist/engine/node/runtime-tuning.d.ts.map +1 -0
  625. package/dist/engine/node/runtime-tuning.js +327 -0
  626. package/dist/engine/node/runtime-tuning.js.map +1 -0
  627. package/dist/engine/node/service.d.ts +39 -0
  628. package/dist/engine/node/service.d.ts.map +1 -0
  629. package/dist/engine/node/service.js +215 -0
  630. package/dist/engine/node/service.js.map +1 -0
  631. package/dist/engine/node/start.d.ts +69 -0
  632. package/dist/engine/node/start.d.ts.map +1 -0
  633. package/dist/engine/node/start.js +325 -0
  634. package/dist/engine/node/start.js.map +1 -0
  635. package/dist/engine/node/worker-env-aliases.d.ts +39 -0
  636. package/dist/engine/node/worker-env-aliases.d.ts.map +1 -0
  637. package/dist/engine/node/worker-env-aliases.js +126 -0
  638. package/dist/engine/node/worker-env-aliases.js.map +1 -0
  639. package/dist/engine/node/worker-env-table.d.ts +15 -0
  640. package/dist/engine/node/worker-env-table.d.ts.map +1 -0
  641. package/dist/engine/node/worker-env-table.js +100 -0
  642. package/dist/engine/node/worker-env-table.js.map +1 -0
  643. package/dist/engine/node/worker-env.d.ts +67 -0
  644. package/dist/engine/node/worker-env.d.ts.map +1 -0
  645. package/dist/engine/node/worker-env.js +114 -0
  646. package/dist/engine/node/worker-env.js.map +1 -0
  647. package/dist/engine/output.d.ts +97 -0
  648. package/dist/engine/output.d.ts.map +1 -0
  649. package/dist/engine/output.js +274 -0
  650. package/dist/engine/output.js.map +1 -0
  651. package/dist/engine/package-info.d.ts +7 -0
  652. package/dist/engine/package-info.d.ts.map +1 -0
  653. package/dist/engine/package-info.js +38 -0
  654. package/dist/engine/package-info.js.map +1 -0
  655. package/dist/engine/program.d.ts +53 -0
  656. package/dist/engine/program.d.ts.map +1 -0
  657. package/dist/engine/program.js +213 -0
  658. package/dist/engine/program.js.map +1 -0
  659. package/dist/engine/prompt.d.ts +69 -0
  660. package/dist/engine/prompt.d.ts.map +1 -0
  661. package/dist/engine/prompt.js +205 -0
  662. package/dist/engine/prompt.js.map +1 -0
  663. package/dist/engine/registries.d.ts +5 -0
  664. package/dist/engine/registries.d.ts.map +1 -0
  665. package/dist/engine/registries.js +68 -0
  666. package/dist/engine/registries.js.map +1 -0
  667. package/dist/engine/request-body.d.ts +31 -0
  668. package/dist/engine/request-body.d.ts.map +1 -0
  669. package/dist/engine/request-body.js +156 -0
  670. package/dist/engine/request-body.js.map +1 -0
  671. package/dist/engine/semver.d.ts +31 -0
  672. package/dist/engine/semver.d.ts.map +1 -0
  673. package/dist/engine/semver.js +100 -0
  674. package/dist/engine/semver.js.map +1 -0
  675. package/dist/engine/test-support.d.ts +50 -0
  676. package/dist/engine/test-support.d.ts.map +1 -0
  677. package/dist/engine/test-support.js +86 -0
  678. package/dist/engine/test-support.js.map +1 -0
  679. package/dist/engine/tui/app-registry.d.ts +103 -0
  680. package/dist/engine/tui/app-registry.d.ts.map +1 -0
  681. package/dist/engine/tui/app-registry.js +103 -0
  682. package/dist/engine/tui/app-registry.js.map +1 -0
  683. package/dist/engine/tui/app.d.ts +11 -0
  684. package/dist/engine/tui/app.d.ts.map +1 -0
  685. package/dist/engine/tui/app.js +134 -0
  686. package/dist/engine/tui/app.js.map +1 -0
  687. package/dist/engine/tui/builtin-screens.d.ts +11 -0
  688. package/dist/engine/tui/builtin-screens.d.ts.map +1 -0
  689. package/dist/engine/tui/builtin-screens.js +69 -0
  690. package/dist/engine/tui/builtin-screens.js.map +1 -0
  691. package/dist/engine/tui/conformance.d.ts +149 -0
  692. package/dist/engine/tui/conformance.d.ts.map +1 -0
  693. package/dist/engine/tui/conformance.js +428 -0
  694. package/dist/engine/tui/conformance.js.map +1 -0
  695. package/dist/engine/tui/context.d.ts +220 -0
  696. package/dist/engine/tui/context.d.ts.map +1 -0
  697. package/dist/engine/tui/context.js +258 -0
  698. package/dist/engine/tui/context.js.map +1 -0
  699. package/dist/engine/tui/dashboard/index.d.ts +8 -0
  700. package/dist/engine/tui/dashboard/index.d.ts.map +1 -0
  701. package/dist/engine/tui/dashboard/index.js +5 -0
  702. package/dist/engine/tui/dashboard/index.js.map +1 -0
  703. package/dist/engine/tui/dashboard/jobs-insights.d.ts +145 -0
  704. package/dist/engine/tui/dashboard/jobs-insights.d.ts.map +1 -0
  705. package/dist/engine/tui/dashboard/jobs-insights.js +63 -0
  706. package/dist/engine/tui/dashboard/jobs-insights.js.map +1 -0
  707. package/dist/engine/tui/dashboard/node-embedded.d.ts +33 -0
  708. package/dist/engine/tui/dashboard/node-embedded.d.ts.map +1 -0
  709. package/dist/engine/tui/dashboard/node-embedded.js +81 -0
  710. package/dist/engine/tui/dashboard/node-embedded.js.map +1 -0
  711. package/dist/engine/tui/dashboard/source.d.ts +294 -0
  712. package/dist/engine/tui/dashboard/source.d.ts.map +1 -0
  713. package/dist/engine/tui/dashboard/source.js +397 -0
  714. package/dist/engine/tui/dashboard/source.js.map +1 -0
  715. package/dist/engine/tui/dashboard/use-dashboard.d.ts +23 -0
  716. package/dist/engine/tui/dashboard/use-dashboard.d.ts.map +1 -0
  717. package/dist/engine/tui/dashboard/use-dashboard.js +32 -0
  718. package/dist/engine/tui/dashboard/use-dashboard.js.map +1 -0
  719. package/dist/engine/tui/index.d.ts +25 -0
  720. package/dist/engine/tui/index.d.ts.map +1 -0
  721. package/dist/engine/tui/index.js +89 -0
  722. package/dist/engine/tui/index.js.map +1 -0
  723. package/dist/engine/tui/layout.d.ts +152 -0
  724. package/dist/engine/tui/layout.d.ts.map +1 -0
  725. package/dist/engine/tui/layout.js +214 -0
  726. package/dist/engine/tui/layout.js.map +1 -0
  727. package/dist/engine/tui/menu-registry.d.ts +201 -0
  728. package/dist/engine/tui/menu-registry.d.ts.map +1 -0
  729. package/dist/engine/tui/menu-registry.js +205 -0
  730. package/dist/engine/tui/menu-registry.js.map +1 -0
  731. package/dist/engine/tui/menu-tree.d.ts +198 -0
  732. package/dist/engine/tui/menu-tree.d.ts.map +1 -0
  733. package/dist/engine/tui/menu-tree.js +276 -0
  734. package/dist/engine/tui/menu-tree.js.map +1 -0
  735. package/dist/engine/tui/raw-mode.d.ts +54 -0
  736. package/dist/engine/tui/raw-mode.d.ts.map +1 -0
  737. package/dist/engine/tui/raw-mode.js +106 -0
  738. package/dist/engine/tui/raw-mode.js.map +1 -0
  739. package/dist/engine/tui/routes.d.ts +5 -0
  740. package/dist/engine/tui/routes.d.ts.map +1 -0
  741. package/dist/engine/tui/routes.js +16 -0
  742. package/dist/engine/tui/routes.js.map +1 -0
  743. package/dist/engine/tui/screen-registry.d.ts +170 -0
  744. package/dist/engine/tui/screen-registry.d.ts.map +1 -0
  745. package/dist/engine/tui/screen-registry.js +180 -0
  746. package/dist/engine/tui/screen-registry.js.map +1 -0
  747. package/dist/engine/tui/screen-sections.d.ts +9 -0
  748. package/dist/engine/tui/screen-sections.d.ts.map +1 -0
  749. package/dist/engine/tui/screen-sections.js +45 -0
  750. package/dist/engine/tui/screen-sections.js.map +1 -0
  751. package/dist/engine/tui/screens/deploy/advanced-model.d.ts +69 -0
  752. package/dist/engine/tui/screens/deploy/advanced-model.d.ts.map +1 -0
  753. package/dist/engine/tui/screens/deploy/advanced-model.js +228 -0
  754. package/dist/engine/tui/screens/deploy/advanced-model.js.map +1 -0
  755. package/dist/engine/tui/screens/deploy/doctor-model.d.ts +37 -0
  756. package/dist/engine/tui/screens/deploy/doctor-model.d.ts.map +1 -0
  757. package/dist/engine/tui/screens/deploy/doctor-model.js +89 -0
  758. package/dist/engine/tui/screens/deploy/doctor-model.js.map +1 -0
  759. package/dist/engine/tui/screens/deploy/doctor.d.ts +8 -0
  760. package/dist/engine/tui/screens/deploy/doctor.d.ts.map +1 -0
  761. package/dist/engine/tui/screens/deploy/doctor.js +163 -0
  762. package/dist/engine/tui/screens/deploy/doctor.js.map +1 -0
  763. package/dist/engine/tui/screens/deploy/fields.d.ts +123 -0
  764. package/dist/engine/tui/screens/deploy/fields.d.ts.map +1 -0
  765. package/dist/engine/tui/screens/deploy/fields.js +202 -0
  766. package/dist/engine/tui/screens/deploy/fields.js.map +1 -0
  767. package/dist/engine/tui/screens/deploy/flags-model.d.ts +67 -0
  768. package/dist/engine/tui/screens/deploy/flags-model.d.ts.map +1 -0
  769. package/dist/engine/tui/screens/deploy/flags-model.js +302 -0
  770. package/dist/engine/tui/screens/deploy/flags-model.js.map +1 -0
  771. package/dist/engine/tui/screens/deploy/index.d.ts +6 -0
  772. package/dist/engine/tui/screens/deploy/index.d.ts.map +1 -0
  773. package/dist/engine/tui/screens/deploy/index.js +83 -0
  774. package/dist/engine/tui/screens/deploy/index.js.map +1 -0
  775. package/dist/engine/tui/screens/deploy/install-model.d.ts +159 -0
  776. package/dist/engine/tui/screens/deploy/install-model.d.ts.map +1 -0
  777. package/dist/engine/tui/screens/deploy/install-model.js +319 -0
  778. package/dist/engine/tui/screens/deploy/install-model.js.map +1 -0
  779. package/dist/engine/tui/screens/deploy/install.d.ts +8 -0
  780. package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -0
  781. package/dist/engine/tui/screens/deploy/install.js +365 -0
  782. package/dist/engine/tui/screens/deploy/install.js.map +1 -0
  783. package/dist/engine/tui/screens/deploy/model.d.ts +49 -0
  784. package/dist/engine/tui/screens/deploy/model.d.ts.map +1 -0
  785. package/dist/engine/tui/screens/deploy/model.js +59 -0
  786. package/dist/engine/tui/screens/deploy/model.js.map +1 -0
  787. package/dist/engine/tui/screens/deploy/run-model.d.ts +58 -0
  788. package/dist/engine/tui/screens/deploy/run-model.d.ts.map +1 -0
  789. package/dist/engine/tui/screens/deploy/run-model.js +117 -0
  790. package/dist/engine/tui/screens/deploy/run-model.js.map +1 -0
  791. package/dist/engine/tui/screens/deploy/run.d.ts +75 -0
  792. package/dist/engine/tui/screens/deploy/run.d.ts.map +1 -0
  793. package/dist/engine/tui/screens/deploy/run.js +201 -0
  794. package/dist/engine/tui/screens/deploy/run.js.map +1 -0
  795. package/dist/engine/tui/screens/deploy/status.d.ts +17 -0
  796. package/dist/engine/tui/screens/deploy/status.d.ts.map +1 -0
  797. package/dist/engine/tui/screens/deploy/status.js +107 -0
  798. package/dist/engine/tui/screens/deploy/status.js.map +1 -0
  799. package/dist/engine/tui/screens/deploy/update.d.ts +41 -0
  800. package/dist/engine/tui/screens/deploy/update.d.ts.map +1 -0
  801. package/dist/engine/tui/screens/deploy/update.js +175 -0
  802. package/dist/engine/tui/screens/deploy/update.js.map +1 -0
  803. package/dist/engine/tui/screens/deploy.d.ts +12 -0
  804. package/dist/engine/tui/screens/deploy.d.ts.map +1 -0
  805. package/dist/engine/tui/screens/deploy.js +23 -0
  806. package/dist/engine/tui/screens/deploy.js.map +1 -0
  807. package/dist/engine/tui/screens/invoke.d.ts +6 -0
  808. package/dist/engine/tui/screens/invoke.d.ts.map +1 -0
  809. package/dist/engine/tui/screens/invoke.js +196 -0
  810. package/dist/engine/tui/screens/invoke.js.map +1 -0
  811. package/dist/engine/tui/screens/jobs.d.ts +12 -0
  812. package/dist/engine/tui/screens/jobs.d.ts.map +1 -0
  813. package/dist/engine/tui/screens/jobs.js +72 -0
  814. package/dist/engine/tui/screens/jobs.js.map +1 -0
  815. package/dist/engine/tui/screens/login.d.ts +6 -0
  816. package/dist/engine/tui/screens/login.d.ts.map +1 -0
  817. package/dist/engine/tui/screens/login.js +263 -0
  818. package/dist/engine/tui/screens/login.js.map +1 -0
  819. package/dist/engine/tui/screens/logout.d.ts +6 -0
  820. package/dist/engine/tui/screens/logout.d.ts.map +1 -0
  821. package/dist/engine/tui/screens/logout.js +149 -0
  822. package/dist/engine/tui/screens/logout.js.map +1 -0
  823. package/dist/engine/tui/screens/menu.d.ts +25 -0
  824. package/dist/engine/tui/screens/menu.d.ts.map +1 -0
  825. package/dist/engine/tui/screens/menu.js +124 -0
  826. package/dist/engine/tui/screens/menu.js.map +1 -0
  827. package/dist/engine/tui/screens/node.d.ts +6 -0
  828. package/dist/engine/tui/screens/node.d.ts.map +1 -0
  829. package/dist/engine/tui/screens/node.js +277 -0
  830. package/dist/engine/tui/screens/node.js.map +1 -0
  831. package/dist/engine/tui/screens/not-logged-in.d.ts +12 -0
  832. package/dist/engine/tui/screens/not-logged-in.d.ts.map +1 -0
  833. package/dist/engine/tui/screens/not-logged-in.js +14 -0
  834. package/dist/engine/tui/screens/not-logged-in.js.map +1 -0
  835. package/dist/engine/tui/screens/status.d.ts +6 -0
  836. package/dist/engine/tui/screens/status.d.ts.map +1 -0
  837. package/dist/engine/tui/screens/status.js +138 -0
  838. package/dist/engine/tui/screens/status.js.map +1 -0
  839. package/dist/engine/tui/scroll-box.d.ts +42 -0
  840. package/dist/engine/tui/scroll-box.d.ts.map +1 -0
  841. package/dist/engine/tui/scroll-box.js +62 -0
  842. package/dist/engine/tui/scroll-box.js.map +1 -0
  843. package/dist/engine/tui/section-registry.d.ts +65 -0
  844. package/dist/engine/tui/section-registry.d.ts.map +1 -0
  845. package/dist/engine/tui/section-registry.js +90 -0
  846. package/dist/engine/tui/section-registry.js.map +1 -0
  847. package/dist/engine/tui/terminal.d.ts +31 -0
  848. package/dist/engine/tui/terminal.d.ts.map +1 -0
  849. package/dist/engine/tui/terminal.js +142 -0
  850. package/dist/engine/tui/terminal.js.map +1 -0
  851. package/dist/engine/tui/testing/feeds.d.ts +58 -0
  852. package/dist/engine/tui/testing/feeds.d.ts.map +1 -0
  853. package/dist/engine/tui/testing/feeds.js +67 -0
  854. package/dist/engine/tui/testing/feeds.js.map +1 -0
  855. package/dist/engine/tui/testing/harness.d.ts +243 -0
  856. package/dist/engine/tui/testing/harness.d.ts.map +1 -0
  857. package/dist/engine/tui/testing/harness.js +332 -0
  858. package/dist/engine/tui/testing/harness.js.map +1 -0
  859. package/dist/engine/tui/theme.d.ts +179 -0
  860. package/dist/engine/tui/theme.d.ts.map +1 -0
  861. package/dist/engine/tui/theme.js +111 -0
  862. package/dist/engine/tui/theme.js.map +1 -0
  863. package/dist/engine/tui/tty.d.ts +56 -0
  864. package/dist/engine/tui/tty.d.ts.map +1 -0
  865. package/dist/engine/tui/tty.js +146 -0
  866. package/dist/engine/tui/tty.js.map +1 -0
  867. package/dist/engine/tui/ui/active-items.d.ts +40 -0
  868. package/dist/engine/tui/ui/active-items.d.ts.map +1 -0
  869. package/dist/engine/tui/ui/active-items.js +38 -0
  870. package/dist/engine/tui/ui/active-items.js.map +1 -0
  871. package/dist/engine/tui/ui/event-log.d.ts +58 -0
  872. package/dist/engine/tui/ui/event-log.d.ts.map +1 -0
  873. package/dist/engine/tui/ui/event-log.js +32 -0
  874. package/dist/engine/tui/ui/event-log.js.map +1 -0
  875. package/dist/engine/tui/ui/index.d.ts +20 -0
  876. package/dist/engine/tui/ui/index.d.ts.map +1 -0
  877. package/dist/engine/tui/ui/index.js +14 -0
  878. package/dist/engine/tui/ui/index.js.map +1 -0
  879. package/dist/engine/tui/ui/meter-legend.d.ts +26 -0
  880. package/dist/engine/tui/ui/meter-legend.d.ts.map +1 -0
  881. package/dist/engine/tui/ui/meter-legend.js +25 -0
  882. package/dist/engine/tui/ui/meter-legend.js.map +1 -0
  883. package/dist/engine/tui/ui/run-summary.d.ts +58 -0
  884. package/dist/engine/tui/ui/run-summary.d.ts.map +1 -0
  885. package/dist/engine/tui/ui/run-summary.js +29 -0
  886. package/dist/engine/tui/ui/run-summary.js.map +1 -0
  887. package/dist/engine/tui/ui/segment-meter.d.ts +72 -0
  888. package/dist/engine/tui/ui/segment-meter.d.ts.map +1 -0
  889. package/dist/engine/tui/ui/segment-meter.js +128 -0
  890. package/dist/engine/tui/ui/segment-meter.js.map +1 -0
  891. package/dist/engine/tui/ui/status-line.d.ts +42 -0
  892. package/dist/engine/tui/ui/status-line.d.ts.map +1 -0
  893. package/dist/engine/tui/ui/status-line.js +35 -0
  894. package/dist/engine/tui/ui/status-line.js.map +1 -0
  895. package/dist/engine/tui/ui/tone.d.ts +46 -0
  896. package/dist/engine/tui/ui/tone.d.ts.map +1 -0
  897. package/dist/engine/tui/ui/tone.js +48 -0
  898. package/dist/engine/tui/ui/tone.js.map +1 -0
  899. package/dist/engine/update-notice-options.d.ts +70 -0
  900. package/dist/engine/update-notice-options.d.ts.map +1 -0
  901. package/dist/engine/update-notice-options.js +79 -0
  902. package/dist/engine/update-notice-options.js.map +1 -0
  903. package/dist/engine/update-notice.d.ts +69 -0
  904. package/dist/engine/update-notice.d.ts.map +1 -0
  905. package/dist/engine/update-notice.js +204 -0
  906. package/dist/engine/update-notice.js.map +1 -0
  907. package/dist/index.d.ts +4 -5
  908. package/dist/index.d.ts.map +1 -1
  909. package/dist/index.js +5 -5
  910. package/dist/index.js.map +1 -1
  911. package/dist/node/index.d.ts +3 -0
  912. package/dist/node/index.d.ts.map +1 -0
  913. package/dist/node/index.js +5 -0
  914. package/dist/node/index.js.map +1 -0
  915. package/dist/telemetry/index.d.ts +2 -1
  916. package/dist/telemetry/index.d.ts.map +1 -1
  917. package/dist/telemetry/index.js +1 -0
  918. package/dist/telemetry/index.js.map +1 -1
  919. package/dist/telemetry/node-span-relay.d.ts +1 -1
  920. package/dist/telemetry/node-span-relay.d.ts.map +1 -1
  921. package/dist/telemetry/node-span-relay.js +39 -6
  922. package/dist/telemetry/node-span-relay.js.map +1 -1
  923. package/dist/telemetry/node-span.d.ts +39 -7
  924. package/dist/telemetry/node-span.d.ts.map +1 -1
  925. package/dist/telemetry/node-span.js +19 -1
  926. package/dist/telemetry/node-span.js.map +1 -1
  927. package/dist/testing/index.d.ts +3 -0
  928. package/dist/testing/index.d.ts.map +1 -0
  929. package/dist/testing/index.js +4 -0
  930. package/dist/testing/index.js.map +1 -0
  931. package/dist/tui/index.d.ts +3 -0
  932. package/dist/tui/index.d.ts.map +1 -0
  933. package/dist/tui/index.js +7 -0
  934. package/dist/tui/index.js.map +1 -0
  935. package/dist/tui/testing/index.d.ts +5 -0
  936. package/dist/tui/testing/index.d.ts.map +1 -0
  937. package/dist/tui/testing/index.js +12 -0
  938. package/dist/tui/testing/index.js.map +1 -0
  939. package/dist/tui/ui/index.d.ts +2 -0
  940. package/dist/tui/ui/index.d.ts.map +1 -0
  941. package/dist/tui/ui/index.js +10 -0
  942. package/dist/tui/ui/index.js.map +1 -0
  943. package/package.json +56 -5
@@ -0,0 +1,295 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { dirname, join, resolve } from 'node:path';
3
+ import { metadataFor, } from '../deploy/env-metadata.js';
4
+ // =============================================================================
5
+ // The LOCAL profile (issue #344, epic #341)
6
+ // =============================================================================
7
+ //
8
+ // `deploy install` and `init` ask the same question - "what belongs in
9
+ // infra/compose/.env?" - about two different machines. Everything that answers
10
+ // it is already written and is REUSED WHOLE: `parseEnvExample` produces the
11
+ // question list, `runEnvWizard` drives it, `generateBase64Key` makes the
12
+ // secrets, `serializeEnvFile` writes the file. This module is only the
13
+ // DIFFERENCE between the two machines, and it is deliberately about a page
14
+ // long, because that difference is genuinely small:
15
+ //
16
+ // - NODE_ENV is not forced to production. A checkout is a development
17
+ // environment; that is the entire point of it.
18
+ // - APP_URL is not derived from a public domain. There isn't one. The
19
+ // template's own default (http://localhost:3535) is already the right
20
+ // answer, which is why this file does not restate it.
21
+ // - The OAuth callback is still DERIVED rather than asked - from APP_URL
22
+ // instead of from a domain. The deploy path's reason holds unchanged
23
+ // locally: a callback that disagrees with APP_URL is the single most
24
+ // common way a hand-written .env fails, and both restate a fact the
25
+ // operator has already stated.
26
+ // - Google credentials and the admin address may be EMPTY here. On a VPS
27
+ // they cannot: a deployment nobody can log into is not a deployment. In a
28
+ // fresh clone "I have not created the OAuth client yet" is a real, normal
29
+ // state, and refusing to write a file over it just leaves the person with
30
+ // no .env at all.
31
+ //
32
+ // WHAT THIS FILE DELIBERATELY DOES NOT DO is re-specify defaults.
33
+ // `.env.example` is the specification (see env-spec.ts's header), so every
34
+ // value not named below - ports, token lifetimes, job queue tuning, storage
35
+ // limits - comes from the template, and a fork that adds a variable gets it
36
+ // here for free.
37
+ // =============================================================================
38
+ /** Where the template and the file it generates live, relative to the root. */
39
+ export const ENV_TEMPLATE_RELATIVE_PATH = join('infra', 'compose', '.env.example');
40
+ export const ENV_FILE_RELATIVE_PATH = join('infra', 'compose', '.env');
41
+ /**
42
+ * Walks up from `startDir` looking for the environment template.
43
+ *
44
+ * ANCHORED ON `.env.example`, NOT ON `.git` OR `package.json`. It is the file
45
+ * this command actually needs, so finding it IS the precondition; a checkout
46
+ * exported without its git directory, or a nested workspace with its own
47
+ * package.json, would both defeat the other two anchors.
48
+ */
49
+ export function findRepoRoot(startDir) {
50
+ let current = resolve(startDir);
51
+ for (;;) {
52
+ if (existsSync(join(current, ENV_TEMPLATE_RELATIVE_PATH)))
53
+ return current;
54
+ const parent = dirname(current);
55
+ if (parent === current)
56
+ return undefined;
57
+ current = parent;
58
+ }
59
+ }
60
+ /**
61
+ * Generated with the CSPRNG, never put to anybody.
62
+ *
63
+ * Asking a human to invent a 32-byte key produces one of two things: a value
64
+ * pasted from another system, or `openssl rand -base64 32` run in a second
65
+ * terminal - which is precisely the manual step this command exists to remove.
66
+ */
67
+ export const GENERATED_KEYS = [
68
+ 'JWT_SECRET',
69
+ 'COOKIE_SECRET',
70
+ 'SECRETS_ENCRYPTION_KEY',
71
+ ];
72
+ /**
73
+ * The only keys a person is asked about, because nothing can work them out.
74
+ *
75
+ * Note what is NOT here: everything with a usable template default. Eight
76
+ * questions is a setup; thirty-four is a form, and a form is something people
77
+ * click through - the same argument env-wizard.ts's header makes for deploy.
78
+ */
79
+ export const PROMPTED_KEYS = [
80
+ 'INITIAL_ADMIN_EMAIL',
81
+ 'GOOGLE_CLIENT_ID',
82
+ 'GOOGLE_CLIENT_SECRET',
83
+ 'POSTGRES_HOST',
84
+ 'POSTGRES_PORT',
85
+ 'POSTGRES_USER',
86
+ 'POSTGRES_PASSWORD',
87
+ 'POSTGRES_DB',
88
+ ];
89
+ /** Keys an unfinished setup may legitimately leave empty. */
90
+ export const BLANK_OK_KEYS = [
91
+ 'INITIAL_ADMIN_EMAIL',
92
+ 'GOOGLE_CLIENT_ID',
93
+ 'GOOGLE_CLIENT_SECRET',
94
+ ];
95
+ /**
96
+ * Keys the application cannot actually run without, in the order they bite.
97
+ *
98
+ * GOOGLE_CLIENT_ID is first because its absence is not a degraded feature: the
99
+ * API does not boot at all. Passport's OAuth2Strategy throws "OAuth2Strategy
100
+ * requires a clientID option" while Nest is still wiring modules, so the
101
+ * container exits before it ever serves a request. That fact is currently
102
+ * recorded in a comment in .github/workflows/ci.yml and nowhere a person
103
+ * setting the project up would look, which is why `init` says it out loud.
104
+ */
105
+ export const REQUIRED_TO_RUN = [
106
+ 'GOOGLE_CLIENT_ID',
107
+ 'GOOGLE_CLIENT_SECRET',
108
+ 'INITIAL_ADMIN_EMAIL',
109
+ ];
110
+ /**
111
+ * The compose service name the database answers to, and the default offered
112
+ * for POSTGRES_HOST.
113
+ *
114
+ * THE ONE TEMPLATE DEFAULT THIS PROFILE OVERRIDES, and the reason is that the
115
+ * template's `localhost` is right for exactly one of the two readers of this
116
+ * file and wrong for the other. base.compose.yml passes POSTGRES_HOST into the
117
+ * api CONTAINER (falling back to `db` when .env omits it), and inside that
118
+ * container `localhost` is the container itself - so accepting every default
119
+ * would produce a stack that cannot reach its own database, which is the one
120
+ * outcome this command exists to prevent.
121
+ *
122
+ * The cost is stated in the prompt's help and in the next steps: host-side
123
+ * tooling (`prisma:migrate` run from the checkout) resolves this name too, and
124
+ * cannot resolve `db`. Somebody pointing at a PostgreSQL on their own machine
125
+ * answers `localhost` and gets the host-side commands instead.
126
+ */
127
+ export const COMPOSE_DB_HOST = 'db';
128
+ /** True when this host name only means anything inside the compose network. */
129
+ export function isComposeInternalHost(host) {
130
+ return host !== undefined && host !== '' && !/^(localhost|127\.0\.0\.1|\[?::1\]?)$/.test(host);
131
+ }
132
+ function isBlank(value) {
133
+ return value === undefined || value === '';
134
+ }
135
+ /** `<APP_URL>/api/auth/<provider>/callback`, with any trailing slash removed. */
136
+ export function callbackUrlFor(appUrl, provider) {
137
+ if (isBlank(appUrl))
138
+ return undefined;
139
+ return `${appUrl.replace(/\/+$/, '')}/api/auth/${provider}/callback`;
140
+ }
141
+ /**
142
+ * Local derivations, keyed on the ANSWERS rather than on a domain.
143
+ *
144
+ * APP_URL is resolved before either of these, because `.env.example` presents
145
+ * the Application section before the OAuth ones and the wizard walks the
146
+ * template in file order - the same ordering guarantee the deploy path's
147
+ * derivations already rely on.
148
+ */
149
+ const LOCAL_DERIVATIONS = {
150
+ GOOGLE_CALLBACK_URL: ({ answers }) => callbackUrlFor(answers.get('APP_URL'), 'google'),
151
+ // Only once somebody has actually configured Microsoft. Returning undefined
152
+ // leaves the key exactly as the template has it - commented out - rather
153
+ // than writing a callback for a provider this deployment does not use.
154
+ MICROSOFT_CALLBACK_URL: ({ answers }) => isBlank(answers.get('MICROSOFT_CLIENT_ID'))
155
+ ? undefined
156
+ : callbackUrlFor(answers.get('APP_URL'), 'microsoft'),
157
+ };
158
+ /**
159
+ * The local annotation for one key.
160
+ *
161
+ * Built FROM `metadataFor`, not beside it. `secret`, `validate`, `generate`,
162
+ * `never` and `group` are facts about the variable itself and are identical on
163
+ * both machines - a password is a password, and TEST_AUTH_ENABLED is still
164
+ * never written. Only the four members that encode "this is a public VPS"
165
+ * (`fixed`, the domain-based `derive`, and which keys are `essential`) are
166
+ * replaced. Keeping the shared half means a fork that annotates a new variable
167
+ * gets it in both profiles at once.
168
+ */
169
+ export function localMetadataFor(key) {
170
+ const base = metadataFor(key);
171
+ const local = {};
172
+ if (base.never === true)
173
+ local.never = true;
174
+ if (base.secret === true)
175
+ local.secret = true;
176
+ if (base.generate !== undefined)
177
+ local.generate = base.generate;
178
+ if (base.validate !== undefined)
179
+ local.validate = base.validate;
180
+ // Groups stay opt-in exactly as they are on a VPS: the observability and
181
+ // storage stacks are separate compose overlays, so their variables belong to
182
+ // whoever turns those on. Skipping them also keeps their several secret keys
183
+ // out of the question list, which is what keeps this to eight prompts.
184
+ if (base.group !== undefined)
185
+ local.group = base.group;
186
+ const derive = LOCAL_DERIVATIONS[key];
187
+ if (derive !== undefined)
188
+ local.derive = derive;
189
+ if (PROMPTED_KEYS.includes(key))
190
+ local.essential = true;
191
+ if (BLANK_OK_KEYS.includes(key))
192
+ local.allowBlank = true;
193
+ return local;
194
+ }
195
+ /**
196
+ * Per-key adjustments to the parsed template, applied before the wizard runs.
197
+ *
198
+ * Two kinds, both about what pressing Enter should mean:
199
+ *
200
+ * - A PLACEHOLDER is not a default. `your-google-client-id` fails the shared
201
+ * `rejectPlaceholder` validator, so leaving it as the fallback would trap
202
+ * somebody on a question whose offered answer is refused. Empty is the
203
+ * honest default for a credential that does not exist yet.
204
+ * - `.env.example`'s help is written for a person copying the file by hand.
205
+ * Where a prompt needs to say more than that, it is said here, next to the
206
+ * reason - never by editing `.env.example`, which is a validated file that
207
+ * both this CLI and Docker Compose read.
208
+ */
209
+ const SPEC_OVERRIDES = {
210
+ POSTGRES_HOST: {
211
+ defaultValue: COMPOSE_DB_HOST,
212
+ help: [
213
+ 'Where PostgreSQL is, as the API sees it.',
214
+ '',
215
+ ` ${COMPOSE_DB_HOST} the database container (add -f devdb.compose.yml when you`,
216
+ ' bring the stack up). The right answer if you have no',
217
+ ' PostgreSQL of your own.',
218
+ ' localhost a PostgreSQL already running on this machine.',
219
+ '',
220
+ 'This name is also what `prisma:migrate` uses. A compose service name',
221
+ `resolves only inside the stack, so with ${COMPOSE_DB_HOST} the migration runs in the`,
222
+ 'api container; with localhost it runs from this checkout.',
223
+ ].join('\n'),
224
+ },
225
+ POSTGRES_PASSWORD: {
226
+ help: [
227
+ 'The database password.',
228
+ '',
229
+ 'Press Enter to accept the development default (postgres), which is',
230
+ 'also what the devdb.compose.yml container is created with.',
231
+ ].join('\n'),
232
+ },
233
+ GOOGLE_CLIENT_ID: {
234
+ defaultValue: '',
235
+ help: [
236
+ 'REQUIRED to run the application. The API does not start without it:',
237
+ 'Passport throws "OAuth2Strategy requires a clientID option" during',
238
+ 'bootstrap, so the container exits before serving anything.',
239
+ '',
240
+ 'Create one at https://console.cloud.google.com/apis/credentials, with',
241
+ 'the callback URL shown at the end of this run as an authorised',
242
+ 'redirect URI. You may leave it empty now and fill it in later.',
243
+ ].join('\n'),
244
+ },
245
+ GOOGLE_CLIENT_SECRET: { defaultValue: '' },
246
+ INITIAL_ADMIN_EMAIL: {
247
+ defaultValue: '',
248
+ help: [
249
+ 'The Google account that becomes the first Admin.',
250
+ '',
251
+ 'The seed writes it to the allowlist, and the first login matching it',
252
+ 'claims the Admin role. Every other address is refused by the allowlist,',
253
+ 'so with this empty NOBODY can log in - not even you.',
254
+ ].join('\n'),
255
+ },
256
+ };
257
+ /** Applies those adjustments, leaving every other spec exactly as parsed. */
258
+ export function localSpecs(specs) {
259
+ return specs.map((spec) => {
260
+ const override = SPEC_OVERRIDES[spec.key];
261
+ if (override === undefined)
262
+ return spec;
263
+ return {
264
+ ...spec,
265
+ ...(override.defaultValue === undefined ? {} : { defaultValue: override.defaultValue }),
266
+ ...(override.help === undefined ? {} : { help: override.help }),
267
+ };
268
+ });
269
+ }
270
+ /**
271
+ * The answers an unattended run gives to the questions it cannot ask.
272
+ *
273
+ * The wizard refuses, by design, to let an ESSENTIAL key fall back to its
274
+ * template default when nobody is there to confirm it - `deploy install`
275
+ * silently shipping `POSTGRES_PASSWORD=postgres` to a public server is exactly
276
+ * the accident that rule prevents. Locally those defaults ARE the intended
277
+ * answers, so this supplies them as answers rather than weakening the rule.
278
+ *
279
+ * Only keys with a usable default appear. The three in BLANK_OK_KEYS have
280
+ * none, and stay empty through `allowBlank`.
281
+ */
282
+ export function unattendedLocalAnswers(specs) {
283
+ const answers = new Map();
284
+ for (const spec of localSpecs(specs)) {
285
+ if (!PROMPTED_KEYS.includes(spec.key))
286
+ continue;
287
+ if (BLANK_OK_KEYS.includes(spec.key))
288
+ continue;
289
+ if (spec.defaultValue === '')
290
+ continue;
291
+ answers.set(spec.key, spec.defaultValue);
292
+ }
293
+ return answers;
294
+ }
295
+ //# sourceMappingURL=local-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-profile.js","sourceRoot":"","sources":["../../../src/engine/init/local-profile.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,41 @@
1
+ import { type PromptContext } from '../prompt.js';
2
+ export interface InitOptions {
3
+ /** Where to start looking for the repository root. */
4
+ cwd?: string | undefined;
5
+ /** Skips the search when given. */
6
+ repoRoot?: string | undefined;
7
+ /** Overwrite an existing .env, keeping the values already in it. */
8
+ force?: boolean | undefined;
9
+ /** Never prompt: generate the secrets, take every default, leave OAuth blank. */
10
+ nonInteractive?: boolean | undefined;
11
+ /** Supplies INITIAL_ADMIN_EMAIL without a prompt. */
12
+ adminEmail?: string | undefined;
13
+ /** Review every variable, not only the eight that are asked by default. */
14
+ all?: boolean | undefined;
15
+ promptContext?: PromptContext | undefined;
16
+ stderr?: {
17
+ write(chunk: string): unknown;
18
+ } | undefined;
19
+ }
20
+ export interface InitResult {
21
+ /** Absolute path of the file that was written. */
22
+ envPath: string;
23
+ /** Number of variables in it. */
24
+ variables: number;
25
+ /** Keys whose value this run generated. Never their values. */
26
+ generated: string[];
27
+ /** Keys the application needs that came out empty. */
28
+ missingRequired: string[];
29
+ }
30
+ export declare function runInit(options?: InitOptions): Promise<InitResult>;
31
+ /**
32
+ * What to do next, in the order it has to be done.
33
+ *
34
+ * Written from the values that were actually chosen rather than as a fixed
35
+ * block of prose: the migration command depends on POSTGRES_HOST, because a
36
+ * compose service name resolves inside the stack and nowhere else, and a
37
+ * person told to run the wrong one of the two gets a connection error with no
38
+ * hint that it was the instruction that was wrong.
39
+ */
40
+ export declare function formatNextSteps(values: ReadonlyMap<string, string>, missingRequired: readonly string[], composeDir?: string): string[];
41
+ //# sourceMappingURL=run-init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-init.d.ts","sourceRoot":"","sources":["../../../src/engine/init/run-init.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAyCtE,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,iFAAiF;IACjF,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,2EAA2E;IAC3E,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACxD;AAED,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sDAAsD;IACtD,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAkFD,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAwJ5E;AAWD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,eAAe,EAAE,SAAS,MAAM,EAAE,EAClC,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,EAAE,CAgFV"}
@@ -0,0 +1,297 @@
1
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { composeFilesForMode } from '@marinoscar/platform-infra';
4
+ import { cliName } from '../identity.js';
5
+ import { generateBase64Key } from '../deploy/env-metadata.js';
6
+ import { diffEnv, parseEnvExample, parseEnvFile, serializeEnvFile, } from '../deploy/env-spec.js';
7
+ import { runEnvWizard } from '../deploy/env-wizard.js';
8
+ import { PreconditionError, UsageError } from '../errors.js';
9
+ import { canPrompt, confirm } from '../prompt.js';
10
+ import { COMPOSE_DB_HOST, ENV_FILE_RELATIVE_PATH, ENV_TEMPLATE_RELATIVE_PATH, GENERATED_KEYS, REQUIRED_TO_RUN, findRepoRoot, isComposeInternalHost, localMetadataFor, localSpecs, unattendedLocalAnswers, } from './local-profile.js';
11
+ /** Reads and parses the template, failing with something actionable. */
12
+ function readTemplate(root) {
13
+ const path = join(root, ENV_TEMPLATE_RELATIVE_PATH);
14
+ let contents;
15
+ try {
16
+ contents = readFileSync(path, 'utf8');
17
+ }
18
+ catch {
19
+ throw new PreconditionError(`Cannot read the environment template at ${path}.\n` +
20
+ `${cliName()} init derives its questions from that file, so it cannot run without it.`);
21
+ }
22
+ const specs = parseEnvExample(contents);
23
+ if (specs.length === 0) {
24
+ throw new PreconditionError(`${path} declares no variables, so there is nothing to configure.`);
25
+ }
26
+ return { path, specs };
27
+ }
28
+ /**
29
+ * What a --force run would actually do to the file that is already there.
30
+ *
31
+ * Reuses `diffEnv` rather than describing the file in its own way - it is the
32
+ * same comparison `deploy update` makes when a new revision adds variables -
33
+ * but then FILTERS IT THROUGH THE LOCAL PROFILE, because `diffEnv` answers
34
+ * "what is in the template and not in the file" and that is not the same
35
+ * question. A commented-out template entry is an optional variable nothing
36
+ * writes, and a grouped one belongs to a compose overlay this command does not
37
+ * turn on. Listing those as "would be added" would be a promise the run does
38
+ * not keep, and thirty names is a lot of noise to hide the two that matter.
39
+ */
40
+ function describeExisting(specs, current) {
41
+ const { missing, unknown } = diffEnv(specs, current);
42
+ const lines = [];
43
+ const additions = missing.filter((spec) => {
44
+ if (spec.optional)
45
+ return false;
46
+ const metadata = localMetadataFor(spec.key);
47
+ return metadata.never !== true && metadata.group === undefined;
48
+ });
49
+ // The wizard deletes these outright, whatever the template says.
50
+ const removals = [...current.keys()].filter((key) => localMetadataFor(key).never === true);
51
+ lines.push(` ${current.size} variable(s) are set in it.`);
52
+ if (additions.length > 0) {
53
+ lines.push(` ${additions.length} variable(s) would be added:`);
54
+ for (const spec of additions)
55
+ lines.push(` ${spec.key}`);
56
+ }
57
+ else {
58
+ lines.push(' Nothing would be added: every variable it needs is already there.');
59
+ }
60
+ if (removals.length > 0) {
61
+ lines.push(` ${removals.length} variable(s) would be removed: ${removals.join(', ')}`);
62
+ }
63
+ if (unknown.length > 0) {
64
+ lines.push(` ${unknown.length} variable(s) are not in the template and would be kept untouched.`);
65
+ }
66
+ lines.push(' Every value already set would be kept, secrets included.');
67
+ return lines;
68
+ }
69
+ export async function runInit(options = {}) {
70
+ const stderr = options.stderr ?? process.stderr;
71
+ const write = (line) => {
72
+ stderr.write(`${line}\n`);
73
+ };
74
+ const root = options.repoRoot ?? findRepoRoot(options.cwd ?? process.cwd()) ?? undefined;
75
+ if (root === undefined) {
76
+ throw new PreconditionError(`Could not find ${ENV_TEMPLATE_RELATIVE_PATH} in this directory or any parent.\n` +
77
+ `Run ${cliName()} init from inside a checkout of this repository, or pass --repo-root <path>.`);
78
+ }
79
+ const { path: templatePath, specs } = readTemplate(root);
80
+ const envPath = join(root, ENV_FILE_RELATIVE_PATH);
81
+ const exists = existsSync(envPath);
82
+ const current = exists ? parseEnvFile(readFileSync(envPath, 'utf8')) : undefined;
83
+ write('');
84
+ write(` Bootstrapping ${envPath}`);
85
+ write(` Questions come from ${templatePath}`);
86
+ // ---------------------------------------------------------------------------
87
+ // 1. Never clobber silently.
88
+ // ---------------------------------------------------------------------------
89
+ // A .env holds the only copy of three generated secrets and a database
90
+ // password. Overwriting it is not undoable, and it is precisely the file
91
+ // somebody has just spent ten minutes getting right.
92
+ if (exists && options.force !== true) {
93
+ write('');
94
+ write(` ${envPath} already exists. Nothing has been changed.`);
95
+ const plan = describeExisting(specs, current);
96
+ const interactive = options.nonInteractive !== true && canPrompt(options.promptContext);
97
+ if (interactive) {
98
+ write('');
99
+ const show = await confirm(' Show what init would change?', { defaultValue: true }, options.promptContext);
100
+ if (show) {
101
+ write('');
102
+ for (const line of plan)
103
+ write(line);
104
+ }
105
+ }
106
+ else {
107
+ write('');
108
+ for (const line of plan)
109
+ write(line);
110
+ }
111
+ throw new UsageError(`Refusing to overwrite ${envPath}. Re-run with --force to fill in what is missing (existing values, including secrets, are kept).`);
112
+ }
113
+ // Fail here rather than three questions into a wizard nobody can answer.
114
+ // `prompt()` refuses without a TTY, correctly, but its message is the
115
+ // general one ("supply the value on the command line") and this command's
116
+ // answer is a specific flag - said before anything is printed, not after a
117
+ // page of help text for a question that was never going to be asked.
118
+ if (options.nonInteractive !== true && !canPrompt(options.promptContext)) {
119
+ throw new UsageError(`${cliName()} init needs an interactive terminal to ask about the database and Google OAuth.\n` +
120
+ `Re-run with --non-interactive to generate the secrets, take every default and leave OAuth blank.`);
121
+ }
122
+ // ---------------------------------------------------------------------------
123
+ // 2. Generate the three secrets. Never ask.
124
+ // ---------------------------------------------------------------------------
125
+ // Only when there is nothing usable already: regenerating JWT_SECRET on a
126
+ // --force re-run would invalidate every session and every refresh token the
127
+ // developer is holding, for no reason they asked for.
128
+ const seed = new Map(current ?? []);
129
+ const generated = [];
130
+ for (const key of GENERATED_KEYS) {
131
+ const held = seed.get(key);
132
+ if (held !== undefined && held !== '')
133
+ continue;
134
+ seed.set(key, generateBase64Key());
135
+ generated.push(key);
136
+ }
137
+ // An unattended run answers with the local defaults rather than being
138
+ // refused for not having a person to confirm them. Never over an existing
139
+ // value: what is already in the file is a decision somebody made.
140
+ if (options.nonInteractive === true) {
141
+ for (const [key, value] of unattendedLocalAnswers(specs)) {
142
+ const held = seed.get(key);
143
+ if (held === undefined || held === '')
144
+ seed.set(key, value);
145
+ }
146
+ }
147
+ // The flag is an explicit statement, so it wins over the file.
148
+ if (options.adminEmail !== undefined && options.adminEmail !== '') {
149
+ seed.set('INITIAL_ADMIN_EMAIL', options.adminEmail);
150
+ }
151
+ if (generated.length > 0) {
152
+ write('');
153
+ write(` Generated ${generated.length} secret(s) with the CSPRNG: ${generated.join(', ')}`);
154
+ write(' They are written to the file below and shown nowhere else.');
155
+ }
156
+ // ---------------------------------------------------------------------------
157
+ // 3. The wizard - the deploy one, with the local profile.
158
+ // ---------------------------------------------------------------------------
159
+ const prepared = localSpecs(specs);
160
+ const appUrl = seed.get('APP_URL') ?? prepared.find((spec) => spec.key === 'APP_URL')?.defaultValue ?? '';
161
+ const { values } = await runEnvWizard({
162
+ specs: prepared,
163
+ // Only consulted by derivations that want a bare host name; the local
164
+ // profile derives from APP_URL itself, so this is descriptive rather than
165
+ // load-bearing here.
166
+ domain: hostOf(appUrl),
167
+ existing: seed,
168
+ metadata: localMetadataFor,
169
+ ...(options.all === undefined ? {} : { all: options.all }),
170
+ ...(options.nonInteractive === undefined ? {} : { nonInteractive: options.nonInteractive }),
171
+ ...(options.promptContext === undefined ? {} : { ctx: options.promptContext }),
172
+ });
173
+ // ---------------------------------------------------------------------------
174
+ // 4. Write it. 0600, because it holds every secret this application has.
175
+ // ---------------------------------------------------------------------------
176
+ mkdirSync(dirname(envPath), { recursive: true });
177
+ // Serialised against the ORIGINAL specs, so the generated file keeps the
178
+ // template's section banners and key order and diffs cleanly against it.
179
+ writeFileSync(envPath, serializeEnvFile(values, specs), { mode: 0o600 });
180
+ const missingRequired = REQUIRED_TO_RUN.filter((key) => {
181
+ const value = values.get(key);
182
+ return value === undefined || value === '';
183
+ });
184
+ write('');
185
+ write(` Wrote ${envPath} (${values.size} variables, mode 0600)`);
186
+ for (const line of formatNextSteps(values, missingRequired, join(root, 'infra', 'compose')))
187
+ write(line);
188
+ return {
189
+ envPath,
190
+ variables: values.size,
191
+ generated,
192
+ missingRequired,
193
+ };
194
+ }
195
+ /** Bare host of a URL, or the input unchanged when it is not one. */
196
+ function hostOf(url) {
197
+ try {
198
+ return new URL(url).host;
199
+ }
200
+ catch {
201
+ return url;
202
+ }
203
+ }
204
+ /**
205
+ * What to do next, in the order it has to be done.
206
+ *
207
+ * Written from the values that were actually chosen rather than as a fixed
208
+ * block of prose: the migration command depends on POSTGRES_HOST, because a
209
+ * compose service name resolves inside the stack and nowhere else, and a
210
+ * person told to run the wrong one of the two gets a connection error with no
211
+ * hint that it was the instruction that was wrong.
212
+ */
213
+ export function formatNextSteps(values, missingRequired, composeDir) {
214
+ const lines = [];
215
+ const inCompose = isComposeInternalHost(values.get('POSTGRES_HOST'));
216
+ const appUrl = values.get('APP_URL') ?? '';
217
+ const adminEmail = values.get('INITIAL_ADMIN_EMAIL') ?? '';
218
+ // The platform's dev files, then the app's dev overlays (app.<name> and
219
+ // app.dev.<name>), from the package's one ordering (#714).
220
+ const composeFiles = composeFilesForMode(inCompose ? 'devdb' : 'dev', { overlays: listComposeDir(composeDir) }).map((file) => `-f ${file}`);
221
+ const compose = `docker compose ${composeFiles.join(' ')}`;
222
+ const migrate = 'npm run prisma:migrate --workspace=api';
223
+ const seed = 'npm run prisma:seed --workspace=api';
224
+ if (missingRequired.length > 0) {
225
+ lines.push('');
226
+ lines.push(' ---------------------------------------------------------------');
227
+ lines.push(' GOOGLE OAUTH IS REQUIRED. The API will not start yet.');
228
+ lines.push(' ---------------------------------------------------------------');
229
+ lines.push('');
230
+ lines.push(` These are empty: ${missingRequired.join(', ')}`);
231
+ lines.push('');
232
+ lines.push(' Without GOOGLE_CLIENT_ID the API exits during bootstrap with');
233
+ lines.push(' "OAuth2Strategy requires a clientID option" - it is not a');
234
+ lines.push(' degraded mode, the process does not come up. Without');
235
+ lines.push(' INITIAL_ADMIN_EMAIL nobody can log in: the allowlist refuses');
236
+ lines.push(' every address, and that one is what seeds the first Admin.');
237
+ lines.push('');
238
+ lines.push(' Create an OAuth client at');
239
+ lines.push(' https://console.cloud.google.com/apis/credentials');
240
+ lines.push(' with this as an authorised redirect URI:');
241
+ lines.push(` ${values.get('GOOGLE_CALLBACK_URL') ?? ''}`);
242
+ lines.push(' then set the values in the file above.');
243
+ }
244
+ lines.push('');
245
+ lines.push(' Next steps');
246
+ lines.push('');
247
+ lines.push(' 1. Create the shared docker network (once per machine):');
248
+ lines.push(' docker network create devnet');
249
+ lines.push('');
250
+ lines.push(' 2. Start the stack, from infra/compose:');
251
+ lines.push(` ${compose} up`);
252
+ if (inCompose) {
253
+ lines.push('');
254
+ lines.push(` The devdb overlay is included because POSTGRES_HOST is "${values.get('POSTGRES_HOST') ?? ''}",`);
255
+ lines.push(' which is the database container it provides. Drop that -f if you');
256
+ lines.push(' meant a PostgreSQL of your own, and change POSTGRES_HOST to match.');
257
+ }
258
+ else {
259
+ lines.push('');
260
+ lines.push(' No PostgreSQL of your own? Add the database overlay:');
261
+ lines.push(` ${compose} -f devdb.compose.yml up`);
262
+ lines.push(' and set POSTGRES_HOST to the service name');
263
+ lines.push(` (${COMPOSE_DB_HOST}) so the api container can reach it.`);
264
+ }
265
+ lines.push('');
266
+ lines.push(' 3. Apply the database schema:');
267
+ if (inCompose) {
268
+ lines.push(` docker compose ${composeFiles.join(' ')} exec api ${migrate}`);
269
+ lines.push(` (POSTGRES_HOST is a compose service name, so this runs inside`);
270
+ lines.push(' the stack rather than from this checkout.)');
271
+ }
272
+ else {
273
+ lines.push(` ${migrate}`);
274
+ }
275
+ lines.push('');
276
+ lines.push(' 4. Seed the roles, permissions and the admin allowlist entry:');
277
+ lines.push(inCompose ? ` docker compose ${composeFiles.join(' ')} exec api ${seed}` : ` ${seed}`);
278
+ lines.push('');
279
+ lines.push(` 5. Open ${appUrl} and sign in with Google as`);
280
+ lines.push(adminEmail === ''
281
+ ? ' whichever address you set as INITIAL_ADMIN_EMAIL.'
282
+ : ` ${adminEmail} - the first login with that address becomes Admin.`);
283
+ lines.push('');
284
+ return lines;
285
+ }
286
+ /** The file names in the checkout's infra/compose, or none when it cannot be read. */
287
+ function listComposeDir(composeDir) {
288
+ if (composeDir === undefined)
289
+ return [];
290
+ try {
291
+ return readdirSync(composeDir);
292
+ }
293
+ catch {
294
+ return [];
295
+ }
296
+ }
297
+ //# sourceMappingURL=run-init.js.map