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

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 +149 -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 +1164 -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 +530 -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 +102 -0
  241. package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
  242. package/dist/engine/deploy/checks/registry.js +103 -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 +178 -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 +1315 -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 +1279 -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 +153 -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,246 @@
1
+ /**
2
+ * The shape persisted to `~/.appctl/config.json`.
3
+ *
4
+ * EVERY FIELD IS OPTIONAL AT READ TIME, deliberately. This file is on a user's
5
+ * disk: it survives CLI upgrades, gets hand-edited, gets partially restored
6
+ * from a backup, and gets written by a version that knew different fields. A
7
+ * reader that demands a complete record turns any of that into a hard failure
8
+ * for commands that did not need the missing piece. Completeness is asserted
9
+ * where it is actually required — `requireCredentials()` — and nowhere else.
10
+ */
11
+ export interface StoredConfig {
12
+ /** What the user typed, e.g. `https://app.example.com`. NOT the `/api` root. */
13
+ serverUrl?: string;
14
+ /** The bearer credential. A `pat_...` token from the device flow (#141). */
15
+ token?: string;
16
+ /** Absolute ISO-8601 expiry of `token`, when the server told us one. */
17
+ expiresAt?: string;
18
+ /** PAT row id, so the user can find it in the web Access Tokens page. */
19
+ tokenId?: string;
20
+ /** PAT display name, same purpose. */
21
+ tokenName?: string;
22
+ /** When this file was last written, for `config` output. */
23
+ updatedAt?: string;
24
+ /**
25
+ * The `worker_nodes` row this machine registered (#272, epic #254).
26
+ *
27
+ * Stored so a restart RE-ATTACHES to its existing node rather than leaking a
28
+ * new row on every start — which is what a container without it would do,
29
+ * once per crash-loop iteration.
30
+ */
31
+ nodeId?: string;
32
+ /** Worker-node settings. Absent on every machine that never ran `node register`. */
33
+ node?: StoredNodeConfig;
34
+ }
35
+ /**
36
+ * The persisted half of a worker node's settings (#272).
37
+ *
38
+ * Every field optional for the same reason every field of `StoredConfig` is:
39
+ * this file is on a user's disk and gets hand-edited, partially restored and
40
+ * written by other versions. Defaults are applied in `node-config.ts`, once,
41
+ * where the environment overlay is also applied.
42
+ */
43
+ export interface StoredNodeConfig {
44
+ name?: string;
45
+ concurrency?: number;
46
+ eligibleTypes?: string[];
47
+ pollIntervalMs?: number;
48
+ }
49
+ /** Where a resolved field came from. Shown by `config`; used by diagnostics. */
50
+ export type ConfigSource = 'env' | 'file';
51
+ /** The merged view of environment and file, with nothing required. */
52
+ export interface ResolvedConfig {
53
+ serverUrl: string | undefined;
54
+ token: string | undefined;
55
+ expiresAt: string | undefined;
56
+ tokenId: string | undefined;
57
+ tokenName: string | undefined;
58
+ updatedAt: string | undefined;
59
+ /** Which layer supplied each credential field, when one did. */
60
+ serverUrlSource: ConfigSource | undefined;
61
+ tokenSource: ConfigSource | undefined;
62
+ /** Absolute path of the config file, whether or not it exists. */
63
+ path: string;
64
+ /** True when a readable config file was found. */
65
+ fileExists: boolean;
66
+ }
67
+ /** A complete credential. Only `requireCredentials()` can produce one. */
68
+ export interface Credentials {
69
+ serverUrl: string;
70
+ token: string;
71
+ expiresAt: string | undefined;
72
+ serverUrlSource: ConfigSource;
73
+ tokenSource: ConfigSource;
74
+ }
75
+ /**
76
+ * Injection seam for tests and for a caller that must not read the real
77
+ * environment. Everything in this module takes it as an optional last
78
+ * argument and defaults to the real process — so production code never has to
79
+ * thread it through, and a test never has to mutate `process.env` or
80
+ * `os.homedir` globally (which leaks across test files and produces failures
81
+ * that depend on execution order).
82
+ */
83
+ export interface ConfigContext {
84
+ env?: NodeJS.ProcessEnv;
85
+ home?: string;
86
+ }
87
+ /** `APPCTL_SERVER_URL` — resolved once so help text and lookups cannot drift. */
88
+ export declare function serverUrlEnvVar(): string;
89
+ /** `APPCTL_TOKEN`. */
90
+ export declare function tokenEnvVar(): string;
91
+ /** The config directory, `~/.appctl`. */
92
+ export declare function configDirPath(ctx?: ConfigContext): string;
93
+ /** The config file, `~/.appctl/config.json`. */
94
+ export declare function configFilePath(ctx?: ConfigContext): string;
95
+ /**
96
+ * Read and validate the config file.
97
+ *
98
+ * Returns `undefined` when there is no file — an expected state, not an
99
+ * error, and the reason ENOENT is the one errno swallowed here. Everything
100
+ * else (EACCES on a file someone chowned, EISDIR on a path someone made a
101
+ * directory) becomes a ConfigError naming the path, because those are real
102
+ * problems that a silent `undefined` would convert into a misleading "not
103
+ * logged in".
104
+ */
105
+ export declare function readConfigFile(ctx?: ConfigContext): StoredConfig | undefined;
106
+ /**
107
+ * Persist the config, replacing whatever was there.
108
+ *
109
+ * ---------------------------------------------------------------------------
110
+ * HOW `0600` IS ACTUALLY GUARANTEED — the part with a trap in it
111
+ * ---------------------------------------------------------------------------
112
+ * The obvious implementation is `writeFileSync(path, json, { mode: 0o600 })`,
113
+ * and it is WRONG in a way that never shows up in a passing test.
114
+ *
115
+ * `mode` is the mode passed to `open(2)`, and `open(2)` APPLIES IT ONLY WHEN
116
+ * IT CREATES THE FILE. Writing over an existing `config.json` ignores `mode`
117
+ * entirely and leaves whatever permissions the file already had. So the first
118
+ * login on a clean machine produces a correct `0600` file and every test
119
+ * asserting the mode passes — while a user whose config was ever created by
120
+ * something else (an older build without the mode, a `cp` from a dotfiles
121
+ * repo, an editor that rewrote it, a restore from an archive that dropped
122
+ * modes) keeps a world-readable token forever, and re-running `login` does not
123
+ * fix it because that is exactly the path that ignores the mode.
124
+ *
125
+ * The other obvious implementation — write, then `chmod` — closes that gap but
126
+ * opens a window: between the write and the chmod the token is on disk under
127
+ * the process umask, typically `0644`. On a shared machine that window is all
128
+ * an attacker needs, and it is reopened on every single login. #143 asks for
129
+ * the mode AT CREATION for precisely this reason.
130
+ *
131
+ * So: create a BRAND NEW file with `flag: 'wx'` (O_CREAT|O_EXCL — the open
132
+ * fails rather than reusing anything, which makes `mode` unconditionally
133
+ * apply), then `rename(2)` it over the target. Rename moves the inode, so the
134
+ * destination ends up with the new file's `0600` no matter what the old one
135
+ * had, and it is atomic within a filesystem — a crash or a full disk mid-write
136
+ * leaves the previous config intact instead of a truncated file that reads as
137
+ * corrupt. The temp file is created in the SAME DIRECTORY because `rename`
138
+ * across filesystems fails with EXDEV, and `~` can easily be a different mount
139
+ * from the system temp directory.
140
+ *
141
+ * ON UMASK: `mode` is masked by the process umask, and a umask can only CLEAR
142
+ * permission bits, never set them. So `0o600 & ~umask` is at most `0o600` for
143
+ * every possible umask — the file can end up more restrictive (a `0o077`
144
+ * umask yields `0o600`, a `0o277` umask yields `0o400`) but never more
145
+ * permissive. That one-directional property is what makes "no window where it
146
+ * is world-readable" a guarantee rather than a hope.
147
+ * ---------------------------------------------------------------------------
148
+ */
149
+ export declare function writeConfigFile(config: StoredConfig, ctx?: ConfigContext): string;
150
+ /**
151
+ * Convenience for the one write both login paths perform (#142): store the
152
+ * server URL and the credential together.
153
+ *
154
+ * Both paths go through here rather than each assembling a StoredConfig, so
155
+ * there is one place that decides what a successful login persists.
156
+ */
157
+ export declare function saveCredentials(input: {
158
+ serverUrl: string;
159
+ token: string;
160
+ expiresAt?: string | undefined;
161
+ tokenId?: string | undefined;
162
+ tokenName?: string | undefined;
163
+ }, ctx?: ConfigContext): string;
164
+ /** Remove the config file. No-op when there is none. For a future `logout`. */
165
+ export declare function deleteConfigFile(ctx?: ConfigContext): boolean;
166
+ /**
167
+ * Merge environment over file. Never throws for "nothing configured".
168
+ *
169
+ * The merge is PER FIELD rather than all-or-nothing: `APPCTL_TOKEN` alone is a
170
+ * legitimate way to run one command as a different principal against the
171
+ * server already in the config file, and `APPCTL_SERVER_URL` alone is how you
172
+ * point an existing login at a different host. Requiring both to be set to use
173
+ * either would break both of those for no gain — and the case where a partial
174
+ * environment is genuinely a mistake is caught with a specific message in
175
+ * `requireCredentials()`, where the missing half is actually known.
176
+ */
177
+ export declare function resolveConfig(ctx?: ConfigContext): ResolvedConfig;
178
+ /**
179
+ * The accessor every authenticated command uses (#144 onwards).
180
+ *
181
+ * THE WHOLE POINT IS THE FAILURE MESSAGE. Without this, a command reads an
182
+ * undefined token, sends `Authorization: Bearer undefined`, and reports the
183
+ * server's 401 — telling a user who has never logged in that their
184
+ * credentials were rejected. They were not rejected; they were never sent.
185
+ * That message sends people to revoke and re-issue tokens that were never the
186
+ * problem, and it is exactly the outcome #143 calls out.
187
+ *
188
+ * The three "nothing usable" cases get three different sentences, because
189
+ * they have three different fixes:
190
+ * - a half-set environment: name the variable that is missing (a CI
191
+ * misconfiguration, where "run login" is useless advice — there is no
192
+ * browser on the runner)
193
+ * - no server URL: say so
194
+ * - no token: run `login`
195
+ */
196
+ export declare function requireCredentials(ctx?: ConfigContext): Credentials;
197
+ /**
198
+ * Turn a token into something safe to print.
199
+ *
200
+ * THIS FUNCTION CAN NEVER RETURN THE TOKEN. Every branch either returns a
201
+ * constant mask or a slice bounded by PAT_PREFIX_HINT_LENGTH, which is checked
202
+ * against MIN_LENGTH_TO_REVEAL first — so there is no input, including an
203
+ * empty string or a hand-crafted short value, for which the output equals the
204
+ * input. That property is the whole contract; anything added here must
205
+ * preserve it.
206
+ */
207
+ export declare function maskToken(token: string | undefined): string;
208
+ /** A display-safe summary. Structurally incapable of carrying the token. */
209
+ export interface ConfigSummary {
210
+ serverUrl: string | undefined;
211
+ serverUrlSource: ConfigSource | undefined;
212
+ /** Masked. See `maskToken` — this field never holds a usable credential. */
213
+ tokenHint: string;
214
+ tokenSource: ConfigSource | undefined;
215
+ tokenName: string | undefined;
216
+ tokenId: string | undefined;
217
+ expiresAt: string | undefined;
218
+ /** True when `expiresAt` is in the past. `undefined` when there is no expiry. */
219
+ expired: boolean | undefined;
220
+ updatedAt: string | undefined;
221
+ path: string;
222
+ fileExists: boolean;
223
+ }
224
+ /**
225
+ * Build the summary a `config` command prints.
226
+ *
227
+ * The return type is the enforcement mechanism, not a convention: there is no
228
+ * field on ConfigSummary that a token could be assigned to without a type
229
+ * error, so a future edit cannot casually add one to the output. A function
230
+ * returning `Record<string, unknown>` would have made "never print the token"
231
+ * a rule somebody has to remember.
232
+ */
233
+ export declare function describeConfig(ctx?: ConfigContext, now?: Date): ConfigSummary;
234
+ /**
235
+ * Has the stored token expired?
236
+ *
237
+ * `undefined` means UNKNOWN, and is returned both when no expiry was recorded
238
+ * and when the recorded one is unparseable. It deliberately does not collapse
239
+ * to `false`: a caller that wants to warn should not warn on a value it could
240
+ * not read, and a caller that wants to block must not treat "I cannot tell"
241
+ * as "it is fine". The server remains the authority either way — this is a
242
+ * courtesy check so the CLI can say "your token expired, run login" instead of
243
+ * relaying a bare 401.
244
+ */
245
+ export declare function isExpired(expiresAt: string | undefined, now?: Date): boolean | undefined;
246
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/engine/config.ts"],"names":[],"mappings":"AA+CA;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,gFAAgF;AAChF,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AAE1C,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gEAAgE;IAChE,eAAe,EAAE,YAAY,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,eAAe,EAAE,YAAY,CAAC;IAC9B,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iFAAiF;AACjF,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,sBAAsB;AACtB,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAMD,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAEzD;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAE1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,CAkD5E;AAiCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAoCjF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,EACD,GAAG,CAAC,EAAE,aAAa,GAClB,MAAM,CAWR;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,OAAO,CAS7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,cAAc,CA0BjE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,WAAW,CAqCnE;AAsCD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAM3D;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,eAAe,EAAE,YAAY,GAAG,SAAS,CAAC;IAC1C,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,iFAAiF;IACjF,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,GAAG,GAAE,IAAiB,GAAG,aAAa,CAezF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,GAAG,SAAS,CAKpG"}
@@ -0,0 +1,414 @@
1
+ import { randomBytes } from 'node:crypto';
2
+ import { mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
3
+ import { homedir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { cliName, configDirName, configFileName, envVar } from './identity.js';
6
+ import { AuthRequiredError, ConfigError } from './errors.js';
7
+ /** `APPCTL_SERVER_URL` — resolved once so help text and lookups cannot drift. */
8
+ export function serverUrlEnvVar() {
9
+ return envVar('SERVER_URL');
10
+ }
11
+ /** `APPCTL_TOKEN`. */
12
+ export function tokenEnvVar() {
13
+ return envVar('TOKEN');
14
+ }
15
+ function contextEnv(ctx) {
16
+ return ctx?.env ?? process.env;
17
+ }
18
+ /** The config directory, `~/.appctl`. */
19
+ export function configDirPath(ctx) {
20
+ return join(ctx?.home ?? homedir(), configDirName());
21
+ }
22
+ /** The config file, `~/.appctl/config.json`. */
23
+ export function configFilePath(ctx) {
24
+ return join(configDirPath(ctx), configFileName());
25
+ }
26
+ /**
27
+ * Read and validate the config file.
28
+ *
29
+ * Returns `undefined` when there is no file — an expected state, not an
30
+ * error, and the reason ENOENT is the one errno swallowed here. Everything
31
+ * else (EACCES on a file someone chowned, EISDIR on a path someone made a
32
+ * directory) becomes a ConfigError naming the path, because those are real
33
+ * problems that a silent `undefined` would convert into a misleading "not
34
+ * logged in".
35
+ */
36
+ export function readConfigFile(ctx) {
37
+ const path = configFilePath(ctx);
38
+ let raw;
39
+ try {
40
+ raw = readFileSync(path, 'utf8');
41
+ }
42
+ catch (cause) {
43
+ if (cause?.code === 'ENOENT')
44
+ return undefined;
45
+ throw new ConfigError(`Could not read ${path}: ${cause.message}`, { cause });
46
+ }
47
+ let parsed;
48
+ try {
49
+ parsed = JSON.parse(raw);
50
+ }
51
+ catch (cause) {
52
+ // Naming the remedy matters more than naming the parse position. The file
53
+ // is disposable — every field in it is re-obtainable by logging in again —
54
+ // so "delete it and re-login" is always correct and always sufficient.
55
+ throw new ConfigError(`${path} is not valid JSON. Delete it and run \`${cliName()} login\` again.`, { cause });
56
+ }
57
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
58
+ throw new ConfigError(`${path} does not contain a JSON object. Delete it and run \`${cliName()} login\` again.`);
59
+ }
60
+ const body = parsed;
61
+ // Every field is read through `readString`, which drops anything that is not
62
+ // a non-empty string. A `token: null` left behind by a hand-edit therefore
63
+ // reads as "no token" and produces the run-login message, rather than being
64
+ // sent to the server as the literal text `null` and coming back as a 401
65
+ // that blames the user's credentials.
66
+ return {
67
+ ...optionalField('serverUrl', readString(body.serverUrl)),
68
+ ...optionalField('token', readString(body.token)),
69
+ ...optionalField('expiresAt', readString(body.expiresAt)),
70
+ ...optionalField('tokenId', readString(body.tokenId)),
71
+ ...optionalField('tokenName', readString(body.tokenName)),
72
+ ...optionalField('updatedAt', readString(body.updatedAt)),
73
+ ...optionalField('nodeId', readString(body.nodeId)),
74
+ ...optionalField('node', readStoredNodeConfig(body.node)),
75
+ };
76
+ }
77
+ /**
78
+ * Read the `node` block, dropping anything of the wrong type.
79
+ *
80
+ * Same contract as `readString`: a hand-edited `concurrency: "4"` reads as
81
+ * absent and the default applies, rather than propagating a string into
82
+ * arithmetic and producing a claim limit of `NaN` — which the server would
83
+ * reject with a validation error naming a field the user never set.
84
+ */
85
+ function readStoredNodeConfig(value) {
86
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
87
+ return undefined;
88
+ const body = value;
89
+ const types = Array.isArray(body.eligibleTypes)
90
+ ? body.eligibleTypes.filter((entry) => typeof entry === 'string' && entry.trim().length > 0)
91
+ : undefined;
92
+ const block = {
93
+ ...optionalField('name', readString(body.name)),
94
+ ...optionalField('concurrency', readFiniteNumber(body.concurrency)),
95
+ ...optionalField('eligibleTypes', types),
96
+ ...optionalField('pollIntervalMs', readFiniteNumber(body.pollIntervalMs)),
97
+ };
98
+ return Object.keys(block).length > 0 ? block : undefined;
99
+ }
100
+ /** A finite number, or `undefined`. `NaN` and `Infinity` are not numbers a config may hold. */
101
+ function readFiniteNumber(value) {
102
+ return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
103
+ }
104
+ /**
105
+ * Persist the config, replacing whatever was there.
106
+ *
107
+ * ---------------------------------------------------------------------------
108
+ * HOW `0600` IS ACTUALLY GUARANTEED — the part with a trap in it
109
+ * ---------------------------------------------------------------------------
110
+ * The obvious implementation is `writeFileSync(path, json, { mode: 0o600 })`,
111
+ * and it is WRONG in a way that never shows up in a passing test.
112
+ *
113
+ * `mode` is the mode passed to `open(2)`, and `open(2)` APPLIES IT ONLY WHEN
114
+ * IT CREATES THE FILE. Writing over an existing `config.json` ignores `mode`
115
+ * entirely and leaves whatever permissions the file already had. So the first
116
+ * login on a clean machine produces a correct `0600` file and every test
117
+ * asserting the mode passes — while a user whose config was ever created by
118
+ * something else (an older build without the mode, a `cp` from a dotfiles
119
+ * repo, an editor that rewrote it, a restore from an archive that dropped
120
+ * modes) keeps a world-readable token forever, and re-running `login` does not
121
+ * fix it because that is exactly the path that ignores the mode.
122
+ *
123
+ * The other obvious implementation — write, then `chmod` — closes that gap but
124
+ * opens a window: between the write and the chmod the token is on disk under
125
+ * the process umask, typically `0644`. On a shared machine that window is all
126
+ * an attacker needs, and it is reopened on every single login. #143 asks for
127
+ * the mode AT CREATION for precisely this reason.
128
+ *
129
+ * So: create a BRAND NEW file with `flag: 'wx'` (O_CREAT|O_EXCL — the open
130
+ * fails rather than reusing anything, which makes `mode` unconditionally
131
+ * apply), then `rename(2)` it over the target. Rename moves the inode, so the
132
+ * destination ends up with the new file's `0600` no matter what the old one
133
+ * had, and it is atomic within a filesystem — a crash or a full disk mid-write
134
+ * leaves the previous config intact instead of a truncated file that reads as
135
+ * corrupt. The temp file is created in the SAME DIRECTORY because `rename`
136
+ * across filesystems fails with EXDEV, and `~` can easily be a different mount
137
+ * from the system temp directory.
138
+ *
139
+ * ON UMASK: `mode` is masked by the process umask, and a umask can only CLEAR
140
+ * permission bits, never set them. So `0o600 & ~umask` is at most `0o600` for
141
+ * every possible umask — the file can end up more restrictive (a `0o077`
142
+ * umask yields `0o600`, a `0o277` umask yields `0o400`) but never more
143
+ * permissive. That one-directional property is what makes "no window where it
144
+ * is world-readable" a guarantee rather than a hope.
145
+ * ---------------------------------------------------------------------------
146
+ */
147
+ export function writeConfigFile(config, ctx) {
148
+ const dir = configDirPath(ctx);
149
+ const target = configFilePath(ctx);
150
+ // `0o700` on the directory is defence in depth, not the control: the file
151
+ // mode above is what protects the token. Like the file, the mode applies
152
+ // only on creation, and an existing directory is deliberately left alone —
153
+ // silently chmod-ing a directory a user created themselves is a surprise,
154
+ // and `~/.appctl` may legitimately hold other things by then.
155
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
156
+ const payload = `${JSON.stringify({ ...config, updatedAt: new Date().toISOString() }, null, 2)}\n`;
157
+ // Randomised so two concurrent logins cannot collide on the temp name and
158
+ // have one of them fail the O_EXCL open. The `.tmp` suffix keeps it clearly
159
+ // disposable, and the basename deliberately stays derived from
160
+ // CONFIG_FILE_NAME rather than being something like `credentials.tmp` — see
161
+ // the note on CONFIG_FILE_NAME in branding.ts about globally-ignored names.
162
+ const tmp = join(dir, `${configFileName()}.${process.pid}.${randomBytes(6).toString('hex')}.tmp`);
163
+ try {
164
+ writeFileSync(tmp, payload, { encoding: 'utf8', mode: 0o600, flag: 'wx' });
165
+ renameSync(tmp, target);
166
+ }
167
+ catch (cause) {
168
+ // Best-effort cleanup so a failed login does not litter `~/.appctl` with
169
+ // temp files that each contain a valid token. `force` because the file may
170
+ // never have been created (that is one of the ways we get here).
171
+ try {
172
+ rmSync(tmp, { force: true });
173
+ }
174
+ catch {
175
+ // Nothing useful to do, and the real error below is the one to report.
176
+ }
177
+ throw new ConfigError(`Could not write ${target}: ${cause.message}`, { cause });
178
+ }
179
+ return target;
180
+ }
181
+ /**
182
+ * Convenience for the one write both login paths perform (#142): store the
183
+ * server URL and the credential together.
184
+ *
185
+ * Both paths go through here rather than each assembling a StoredConfig, so
186
+ * there is one place that decides what a successful login persists.
187
+ */
188
+ export function saveCredentials(input, ctx) {
189
+ return writeConfigFile({
190
+ serverUrl: input.serverUrl,
191
+ token: input.token,
192
+ ...optionalField('expiresAt', input.expiresAt),
193
+ ...optionalField('tokenId', input.tokenId),
194
+ ...optionalField('tokenName', input.tokenName),
195
+ }, ctx);
196
+ }
197
+ /** Remove the config file. No-op when there is none. For a future `logout`. */
198
+ export function deleteConfigFile(ctx) {
199
+ const path = configFilePath(ctx);
200
+ try {
201
+ statSync(path);
202
+ }
203
+ catch {
204
+ return false;
205
+ }
206
+ rmSync(path, { force: true });
207
+ return true;
208
+ }
209
+ /**
210
+ * Merge environment over file. Never throws for "nothing configured".
211
+ *
212
+ * The merge is PER FIELD rather than all-or-nothing: `APPCTL_TOKEN` alone is a
213
+ * legitimate way to run one command as a different principal against the
214
+ * server already in the config file, and `APPCTL_SERVER_URL` alone is how you
215
+ * point an existing login at a different host. Requiring both to be set to use
216
+ * either would break both of those for no gain — and the case where a partial
217
+ * environment is genuinely a mistake is caught with a specific message in
218
+ * `requireCredentials()`, where the missing half is actually known.
219
+ */
220
+ export function resolveConfig(ctx) {
221
+ const env = contextEnv(ctx);
222
+ const file = readConfigFile(ctx);
223
+ const envServerUrl = readString(env[serverUrlEnvVar()]);
224
+ const envToken = readString(env[tokenEnvVar()]);
225
+ const serverUrl = envServerUrl ?? file?.serverUrl;
226
+ const token = envToken ?? file?.token;
227
+ return {
228
+ serverUrl,
229
+ token,
230
+ // Expiry belongs to the token, so it is only meaningful when the token
231
+ // came from the file. An `APPCTL_TOKEN` from CI has no expiry we know of,
232
+ // and pairing it with the file's leftover `expiresAt` would let the CLI
233
+ // announce that a perfectly valid pipeline token expired last week.
234
+ expiresAt: envToken === undefined ? file?.expiresAt : undefined,
235
+ tokenId: envToken === undefined ? file?.tokenId : undefined,
236
+ tokenName: envToken === undefined ? file?.tokenName : undefined,
237
+ updatedAt: file?.updatedAt,
238
+ serverUrlSource: envServerUrl !== undefined ? 'env' : file?.serverUrl !== undefined ? 'file' : undefined,
239
+ tokenSource: envToken !== undefined ? 'env' : file?.token !== undefined ? 'file' : undefined,
240
+ path: configFilePath(ctx),
241
+ fileExists: file !== undefined,
242
+ };
243
+ }
244
+ /**
245
+ * The accessor every authenticated command uses (#144 onwards).
246
+ *
247
+ * THE WHOLE POINT IS THE FAILURE MESSAGE. Without this, a command reads an
248
+ * undefined token, sends `Authorization: Bearer undefined`, and reports the
249
+ * server's 401 — telling a user who has never logged in that their
250
+ * credentials were rejected. They were not rejected; they were never sent.
251
+ * That message sends people to revoke and re-issue tokens that were never the
252
+ * problem, and it is exactly the outcome #143 calls out.
253
+ *
254
+ * The three "nothing usable" cases get three different sentences, because
255
+ * they have three different fixes:
256
+ * - a half-set environment: name the variable that is missing (a CI
257
+ * misconfiguration, where "run login" is useless advice — there is no
258
+ * browser on the runner)
259
+ * - no server URL: say so
260
+ * - no token: run `login`
261
+ */
262
+ export function requireCredentials(ctx) {
263
+ const resolved = resolveConfig(ctx);
264
+ // Checked FIRST, before the generic messages, because "you set one of the
265
+ // two variables" is a much more specific diagnosis than "not logged in" and
266
+ // it is the single most likely way a pipeline is broken. Only reported when
267
+ // the file cannot cover the gap — a developer with a config file who
268
+ // exports one variable to override a single field is doing something
269
+ // supported, not something broken.
270
+ if (resolved.serverUrl === undefined && resolved.token !== undefined && resolved.tokenSource === 'env') {
271
+ throw new AuthRequiredError(`${tokenEnvVar()} is set but ${serverUrlEnvVar()} is not, and no server URL is stored in ${resolved.path}. Set both, or run \`${cliName()} login\`.`);
272
+ }
273
+ if (resolved.token === undefined && resolved.serverUrl !== undefined && resolved.serverUrlSource === 'env') {
274
+ throw new AuthRequiredError(`${serverUrlEnvVar()} is set but ${tokenEnvVar()} is not, and no token is stored in ${resolved.path}. Set both, or run \`${cliName()} login\`.`);
275
+ }
276
+ if (resolved.serverUrl === undefined || resolved.token === undefined) {
277
+ throw new AuthRequiredError(`Not logged in. Run \`${cliName()} login\` first, or set ${serverUrlEnvVar()} and ${tokenEnvVar()}.`);
278
+ }
279
+ return {
280
+ serverUrl: resolved.serverUrl,
281
+ token: resolved.token,
282
+ expiresAt: resolved.expiresAt,
283
+ // Both sources are known to be defined here: a field cannot have a value
284
+ // and no source. The non-null assertions state that rather than inventing
285
+ // a fallback that would be a lie if it ever ran.
286
+ serverUrlSource: resolved.serverUrlSource,
287
+ tokenSource: resolved.tokenSource,
288
+ };
289
+ }
290
+ // -----------------------------------------------------------------------------
291
+ // Display
292
+ // -----------------------------------------------------------------------------
293
+ /** What replaces the unreadable part of a token. Matches #115's credential store. */
294
+ const HINT_MASK = '••••••••';
295
+ /**
296
+ * How many leading characters of a `pat_` token are shown.
297
+ *
298
+ * EIGHT, and it is the LEADING characters — which is the opposite of #115's
299
+ * credential hints, on purpose. Two reasons, both specific to this token kind:
300
+ *
301
+ * 1. Those eight characters are ALREADY PUBLIC by the API's own design.
302
+ * `PatService` stores `tokenPrefix = 'pat_' + the first 4 hex characters`
303
+ * as a separate, non-secret column and `GET /api/pat` returns it. So the
304
+ * hint reveals nothing that the Access Tokens page does not already show
305
+ * the same user.
306
+ *
307
+ * 2. It is the only hint that does the job. A hint exists so a user can
308
+ * match what is on their machine against a row in the web UI and know
309
+ * which one to revoke — and the string the web UI displays is exactly
310
+ * this prefix. Revealing the last four characters instead would expose
311
+ * four genuinely secret bytes and still not match anything on screen.
312
+ *
313
+ * A token that is not a PAT (a session JWT supplied through the environment)
314
+ * gets NOTHING revealed: its leading characters are the base64 of a constant
315
+ * JOSE header, identical for every token ever issued, so revealing them would
316
+ * be a useless hint — and "useless" is not a reason to start revealing bytes
317
+ * of a credential.
318
+ */
319
+ const PAT_PREFIX_HINT_LENGTH = 8;
320
+ /** Below this, reveal nothing: the prefix would be most of the value. */
321
+ const MIN_LENGTH_TO_REVEAL = 16;
322
+ /**
323
+ * Turn a token into something safe to print.
324
+ *
325
+ * THIS FUNCTION CAN NEVER RETURN THE TOKEN. Every branch either returns a
326
+ * constant mask or a slice bounded by PAT_PREFIX_HINT_LENGTH, which is checked
327
+ * against MIN_LENGTH_TO_REVEAL first — so there is no input, including an
328
+ * empty string or a hand-crafted short value, for which the output equals the
329
+ * input. That property is the whole contract; anything added here must
330
+ * preserve it.
331
+ */
332
+ export function maskToken(token) {
333
+ if (token === undefined || token.length === 0)
334
+ return '(none)';
335
+ if (token.startsWith('pat_') && token.length >= MIN_LENGTH_TO_REVEAL) {
336
+ return `${token.slice(0, PAT_PREFIX_HINT_LENGTH)}${HINT_MASK}`;
337
+ }
338
+ return HINT_MASK;
339
+ }
340
+ /**
341
+ * Build the summary a `config` command prints.
342
+ *
343
+ * The return type is the enforcement mechanism, not a convention: there is no
344
+ * field on ConfigSummary that a token could be assigned to without a type
345
+ * error, so a future edit cannot casually add one to the output. A function
346
+ * returning `Record<string, unknown>` would have made "never print the token"
347
+ * a rule somebody has to remember.
348
+ */
349
+ export function describeConfig(ctx, now = new Date()) {
350
+ const resolved = resolveConfig(ctx);
351
+ return {
352
+ serverUrl: resolved.serverUrl,
353
+ serverUrlSource: resolved.serverUrlSource,
354
+ tokenHint: maskToken(resolved.token),
355
+ tokenSource: resolved.tokenSource,
356
+ tokenName: resolved.tokenName,
357
+ tokenId: resolved.tokenId,
358
+ expiresAt: resolved.expiresAt,
359
+ expired: isExpired(resolved.expiresAt, now),
360
+ updatedAt: resolved.updatedAt,
361
+ path: resolved.path,
362
+ fileExists: resolved.fileExists,
363
+ };
364
+ }
365
+ /**
366
+ * Has the stored token expired?
367
+ *
368
+ * `undefined` means UNKNOWN, and is returned both when no expiry was recorded
369
+ * and when the recorded one is unparseable. It deliberately does not collapse
370
+ * to `false`: a caller that wants to warn should not warn on a value it could
371
+ * not read, and a caller that wants to block must not treat "I cannot tell"
372
+ * as "it is fine". The server remains the authority either way — this is a
373
+ * courtesy check so the CLI can say "your token expired, run login" instead of
374
+ * relaying a bare 401.
375
+ */
376
+ export function isExpired(expiresAt, now = new Date()) {
377
+ if (expiresAt === undefined)
378
+ return undefined;
379
+ const parsed = Date.parse(expiresAt);
380
+ if (Number.isNaN(parsed))
381
+ return undefined;
382
+ return parsed <= now.getTime();
383
+ }
384
+ // -----------------------------------------------------------------------------
385
+ // Helpers
386
+ // -----------------------------------------------------------------------------
387
+ /**
388
+ * A non-empty string, or `undefined`.
389
+ *
390
+ * Empty and whitespace-only both become `undefined` because that is what they
391
+ * mean in practice: `APPCTL_TOKEN=` in a CI file is an UNSET variable that the
392
+ * shell happens to export as empty, and treating it as a credential produces
393
+ * `Authorization: Bearer ` — a malformed header and a 401 whose message tells
394
+ * the user their token was rejected rather than that it was blank.
395
+ */
396
+ function readString(value) {
397
+ if (typeof value !== 'string')
398
+ return undefined;
399
+ const trimmed = value.trim();
400
+ return trimmed.length > 0 ? trimmed : undefined;
401
+ }
402
+ /**
403
+ * `{ key: value }` when defined, `{}` when not.
404
+ *
405
+ * Required by `exactOptionalPropertyTypes`, which is on for this package: it
406
+ * makes `{ expiresAt: undefined }` a type error where `expiresAt?: string` is
407
+ * declared, precisely so that "absent" and "explicitly nothing" cannot be
408
+ * confused. It also keeps the written JSON clean — `JSON.stringify` drops
409
+ * undefined values, but only after they have been allowed into the object.
410
+ */
411
+ function optionalField(key, value) {
412
+ return value === undefined ? {} : { [key]: value };
413
+ }
414
+ //# sourceMappingURL=config.js.map